ChangeLog-2016-09-26   [plain text]


2016-09-26  Youenn Fablet  <youenn@apple.com>

        ASSERTION FAILED: m_origin || m_type == CachedResource::MainResource
        https://bugs.webkit.org/show_bug.cgi?id=162472
        <rdar://problem/28431522>

        Reviewed by Darin Adler.

        No change of behavior.

        Introducing a new CachedResource constructor for already loaded resources.
        Sharing code with the other constructor in the init method.
        The main difference with this new constructor is that the resource has no specified origin.
        The response tainting remains Basic.

        Making some additional code clean-up.

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::CachedImage): Making use of the new constructor.
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::CachedResource):
        (WebCore::CachedResource::finishRequestInitialization):
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::type):

2016-09-26  Olivier Blin  <olivier.blin@softathome.com>

        [GStreamer] Support flipY for GPU-to-GPU copy of video textures to WebGL
        https://bugs.webkit.org/show_bug.cgi?id=162491

        Reviewed by Philippe Normand.

        GPU-GPU copy of video textures to WebGL has been added for
        GStreamer in bug 159928. It did not handle textures with inverted
        Y, and thus copy to such textures was not accelerated.

        This occurs with THREE.js which defaults to flipY for textures.
        It can be tested on http://flimshaw.github.io/Valiant360/

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface):
        (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
        (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

2016-09-25  Antti Koivisto  <antti@apple.com>

        AuthorStyleSheets shouldn't trigger synchronous style resolutions
        https://bugs.webkit.org/show_bug.cgi?id=162532

        Reviewed by Darin Adler.

        AuthorStyleSheets::didChange() took four different enum values, two of which triggered
        a synchronous style resolution. This is almost always unnecessary as any subsequent
        call that requires up-to-date style or layout will perform it. In the few cases where
        it is actually needed the client can just do it manually.

        The patch also replaces the remaining two enum values with functions:

            void didChangeCandidatesForActiveSet();
            void didChangeContentsOrInterpretation();

        The first indicates that the set of active stylesheets might have changed and needs to be recomputed.
        The seconds one indicates that either the content of some stylesheet has changed or that the environment
        where we interpret the sheets has somehow changed.

        The existing "AsNeeded" values map to didChangeCandidatesForActiveSet() and the rest map to
        didChangeContentsOrInterpretation(). This also makes it obvious that some call sites use the wrong value.
        The patch doesn't address these cases.

        * css/CSSStyleSheet.cpp:
        (WebCore::CSSStyleSheet::didMutateRules):
        (WebCore::CSSStyleSheet::didMutate):
        (WebCore::CSSStyleSheet::clearOwnerNode):
        * dom/AuthorStyleSheets.cpp:
        (WebCore::AuthorStyleSheets::AuthorStyleSheets):
        (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
        (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
        (WebCore::AuthorStyleSheets::flushPendingChanges):
        (WebCore::AuthorStyleSheets::scheduleActiveSetChange):
        (WebCore::AuthorStyleSheets::didChange):
        (WebCore::AuthorStyleSheets::pendingChangeTimerFired):
        (WebCore::AuthorStyleSheets::flushPendingUpdates): Deleted.
        (WebCore::AuthorStyleSheets::scheduleOptimizedUpdate): Deleted.
        (WebCore::AuthorStyleSheets::optimizedUpdateTimerFired): Deleted.
        * dom/AuthorStyleSheets.h:
        (WebCore::AuthorStyleSheets::hasPendingUpdate):
        * dom/Document.cpp:
        (WebCore::Document::setContentLanguage):
        (WebCore::Document::recalcStyle):
        (WebCore::Document::updateStyleIfNeeded):
        (WebCore::Document::updateLayoutIgnorePendingStylesheets):
        (WebCore::Document::didRemoveAllPendingStylesheet):
        (WebCore::Document::usesStyleBasedEditability):
        (WebCore::Document::processHttpEquiv):
        (WebCore::Document::setSelectedStylesheetSet):
        * dom/ExtensionStyleSheets.cpp:
        (WebCore::ExtensionStyleSheets::clearPageUserSheet):
        (WebCore::ExtensionStyleSheets::updatePageUserSheet):
        (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
        (WebCore::ExtensionStyleSheets::addUserStyleSheet):
        (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
        (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
        * dom/InlineStyleSheetOwner.cpp:
        (WebCore::InlineStyleSheetOwner::removedFromDocument):
        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::removedFrom):
        * dom/ShadowRoot.cpp:
        (WebCore::ShadowRoot::updateStyle):
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::setDisabledState):
        (WebCore::HTMLLinkElement::parseAttribute):
        (WebCore::HTMLLinkElement::process):
        (WebCore::HTMLLinkElement::removedFrom):
        (WebCore::HTMLLinkElement::removePendingSheet):
        * html/HTMLStyleElement.cpp:
        (WebCore::HTMLStyleElement::parseAttribute):
        * inspector/InspectorCSSAgent.cpp:
        (WebCore::InspectorCSSAgent::forcePseudoState):
        (WebCore::InspectorCSSAgent::resetPseudoStates):
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::setEmulatedMedia):
        * page/Frame.cpp:
        (WebCore::Frame::setPrinting):
        * page/FrameView.cpp:
        (WebCore::FrameView::layout):
        (WebCore::FrameView::setPagination):
        (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
        * page/Page.cpp:
        (WebCore::Page::setViewMode):
        (WebCore::Page::setNeedsRecalcStyleInAllFrames):
        (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
        * svg/SVGFontFaceElement.cpp:
        (WebCore::SVGFontFaceElement::rebuildFontFace):
        (WebCore::SVGFontFaceElement::removedFrom):
        * xml/XMLTreeViewer.cpp:
        (WebCore::XMLTreeViewer::transformDocumentToTreeView):
        * xml/parser/XMLDocumentParser.cpp:
        (WebCore::XMLDocumentParser::end):
        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::XMLDocumentParser::doEnd):

2016-09-24  Yusuke Suzuki  <utatane.tea@gmail.com>

        Unreviewed, update results of DOM binding tests after r206354.
        https://bugs.webkit.org/show_bug.cgi?id=162503

        Update results of DOM binding tests. After r206354, setDOMException takes
        ThrowScope as its second argument.

        * bindings/scripts/test/JS/JSTestInterface.cpp:
        (WebCore::JSTestInterfaceConstructor::construct):
        (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
        (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        (WebCore::JSTestNamedConstructorNamedConstructor::construct):
        * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
        (WebCore::jsTestNondeterministicNondeterministicGetterExceptionAttr):
        (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjAttrWithGetterException):
        (WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
        (WebCore::jsTestObjStringAttrWithGetterException):
        (WebCore::jsTestObjWithScriptStateAttributeRaises):
        (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
        (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
        (WebCore::jsTestObjNullableStringValue):
        (WebCore::setJSTestObjAttrWithSetterException):
        (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
        (WebCore::setJSTestObjStringAttrWithSetterException):
        (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
        (WebCore::jsTestObjPrototypeFunctionMethodWithException):
        (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
        (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidException):
        (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
        (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
        (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
        (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
        (WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        (WebCore::jsTestTypedefsAttrWithGetterException):
        (WebCore::jsTestTypedefsStringAttrWithGetterException):
        (WebCore::setJSTestTypedefsAttrWithSetterException):
        (WebCore::setJSTestTypedefsStringAttrWithSetterException):
        (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
        (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
        (WebCore::jsTestTypedefsPrototypeFunctionMethodWithException):

2016-09-24  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r206221): [USER] com.apple.WebKit.WebContent.Development at com.apple.JavaScriptCore: vmEntryToJavaScript + 299
        https://bugs.webkit.org/show_bug.cgi?id=162536
        <rdar://problem/28415971>

        Reviewed by Gavin Barraclough.

        Stop marking cross-origin Window/Location objects properties as cacheable
        given that we do not support yet caching of such properties. This is because
        they are using the new CustomAccesstor PropertySlot type, which is not handled
        yet by Repatch.cpp. Performance is anyway not critical for cross-origin
        Window / Location properties.

        Test: http/tests/security/cross-origin-window-property-caching-crash.html

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::getOwnPropertySlotDelegate):

2016-09-24  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r205524): Crash under WTF::numGraphemeClusters()
        https://bugs.webkit.org/show_bug.cgi?id=162534
        <rdar://problem/28463828>

        Reviewed by David Kilzer.

        We were constructing a StringView from a temporary String and then passing it to
        WTF::numGraphemeClusters().

        Test: fast/dom/HTMLInputElement/handleBeforeTextInsertedEvent-crash.html

        * html/TextFieldInputType.cpp:
        (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):

2016-09-24  Chris Dumez  <cdumez@apple.com>

        <a download> does not support Blob URLs
        https://bugs.webkit.org/show_bug.cgi?id=156099
        <rdar://problem/25535520>

        Reviewed by Darin Adler.

        Only allow trusted events to trigger downloads for <a download>, as per:
        - https://html.spec.whatwg.org/#the-a-element:triggered-by-user-activation

        Without this, a script could download a file to the user's disk without
        any user gesture or consent, simply by calling a.click(). I have confirmed
        that Firefox also ignores the click for <a download> if it is synthetic.
        Chrome allows synthetic clicks to trigger downloads but I filed a bug
        about it.

        Test: fast/dom/HTMLAnchorElement/anchor-download-synthetic-click.html

        * html/HTMLAnchorElement.cpp:
        (WebCore::HTMLAnchorElement::handleClick):

2016-09-24  Yusuke Suzuki  <utatane.tea@gmail.com>

        [Binding] setDOMException should be inlined and fall to the slow path if exception occurs
        https://bugs.webkit.org/show_bug.cgi?id=162503

        Reviewed by Saam Barati.

        Binding code emits setDOMException in critical paths. However, it is not inlined.
        Since exception less frequently occurs, we should have inlined setDOMException that
        early returns if it does not need to raise an exception. And it should call the exception
        raising code as slow path case. This tiny optimization can offer improvement if
        the DOM function is tiny and DOM binding occupies large part of it. Combined with r206338,
        it offers 5% improvement in Dromaeo dom-attr getAttribute / setAttribute tests.

        * bindings/js/JSDOMBinding.cpp:
        (WebCore::throwDOMException): Extract the actual exception raising code.
        (WebCore::setDOMExceptionSlow): Call throwDOMException and keep it not inlined.
        (WebCore::setDOMException):
        * bindings/js/JSDOMBinding.h:
        (WebCore::setDOMException): Use ThrowScope& to check `scope.exception()`.
        And it has a path for normal case that allows early returning.
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):
        (GenerateImplementationFunctionCall):
        (GenerateConstructorDefinition):

2016-09-23  Antti Koivisto  <antti@apple.com>

        Move stylesheet change logic from Document to AuthorStyleSheets
        https://bugs.webkit.org/show_bug.cgi?id=162488

        Reviewed by Andreas Kling.

        That's where it belongs.

        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSStyleSheet.cpp:
        (WebCore::CSSStyleSheet::didMutateRules):
        (WebCore::CSSStyleSheet::didMutate):
        (WebCore::CSSStyleSheet::clearOwnerNode):
        * dom/AuthorStyleSheets.cpp:
        (WebCore::AuthorStyleSheets::AuthorStyleSheets):
        (WebCore::AuthorStyleSheets::flushPendingUpdates):
        (WebCore::AuthorStyleSheets::scheduleOptimizedUpdate):
        (WebCore::AuthorStyleSheets::didChange):
        (WebCore::AuthorStyleSheets::optimizedUpdateTimerFired):
        * dom/AuthorStyleSheets.h:
        (WebCore::AuthorStyleSheets::hasPendingUpdate):
        (WebCore::AuthorStyleSheets::pendingUpdateType): Deleted.
        (WebCore::AuthorStyleSheets::setPendingUpdateType): Deleted.
        (WebCore::AuthorStyleSheets::flushPendingUpdates): Deleted.
        * dom/Document.cpp:
        (WebCore::Document::Document):
        (WebCore::Document::setContentLanguage):
        (WebCore::Document::needsStyleRecalc):
        (WebCore::Document::updateStyleIfNeeded):
        (WebCore::Document::updateLayoutIgnorePendingStylesheets):
        (WebCore::Document::didRemoveAllPendingStylesheet):
        (WebCore::Document::processHttpEquiv):
        (WebCore::Document::setSelectedStylesheetSet):
        (WebCore::Document::updateHoverActiveState):

            Remove StyleResolverUpdateFlag argument that was misused to indicate sync style recalc.
            Clients can call updateStyleIfNeeded() directly though none of them appears to need it.

        (WebCore::Document::optimizedStyleSheetUpdateTimerFired): Deleted.
        (WebCore::Document::scheduleOptimizedStyleSheetUpdate): Deleted.
        (WebCore::Document::styleResolverChanged): Deleted.
        * dom/Document.h:
        (WebCore::Document::needsStyleRecalc): Deleted.
        * dom/ExtensionStyleSheets.cpp:
        (WebCore::ExtensionStyleSheets::clearPageUserSheet):
        (WebCore::ExtensionStyleSheets::updatePageUserSheet):
        (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
        (WebCore::ExtensionStyleSheets::addUserStyleSheet):
        (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
        (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
        * dom/InlineStyleSheetOwner.cpp:
        (WebCore::InlineStyleSheetOwner::removedFromDocument):
        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::removedFrom):

            Also fix a bug that prevented document from rendering if a loading processing instruction was removed from the tree.
            This is tested by fast/dom/StyleSheet/detached-style-pi-2.xhtml (after other changes in this patch).

        * dom/ShadowRoot.cpp:
        (WebCore::ShadowRoot::updateStyle):
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::setDisabledState):
        (WebCore::HTMLLinkElement::parseAttribute):
        (WebCore::HTMLLinkElement::process):
        (WebCore::HTMLLinkElement::removedFrom):
        (WebCore::HTMLLinkElement::removePendingSheet):
        * html/HTMLStyleElement.cpp:
        (WebCore::HTMLStyleElement::parseAttribute):
        * inspector/InspectorCSSAgent.cpp:
        (WebCore::InspectorCSSAgent::forcePseudoState):
        (WebCore::InspectorCSSAgent::resetPseudoStates):
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::setEmulatedMedia):
        * page/Frame.cpp:
        (WebCore::Frame::setPrinting):
        * page/FrameView.cpp:
        (WebCore::FrameView::layout):
        (WebCore::FrameView::setPagination):
        (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
        * page/Page.cpp:
        (WebCore::Page::setViewMode):
        (WebCore::Page::setNeedsRecalcStyleInAllFrames):
        (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
        * svg/SVGFontFaceElement.cpp:
        (WebCore::SVGFontFaceElement::rebuildFontFace):
        (WebCore::SVGFontFaceElement::removedFrom):
        * xml/XMLTreeViewer.cpp:
        (WebCore::XMLTreeViewer::transformDocumentToTreeView):
        * xml/parser/XMLDocumentParser.cpp:
        (WebCore::XMLDocumentParser::end):
        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::XMLDocumentParser::doEnd):

2016-09-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        Media controls playhead does not animate smoothly while playing
        https://bugs.webkit.org/show_bug.cgi?id=162399
        <rdar://problem/28115680>

        Reviewed by Beth Dakin.

        The media controls playhead currently does not animate smoothly during playback because we don't specify a
        playback rate when updating the WebPlaybackControlsManager's timing value. However, simply setting this timing
        value to the current playback rate (as known to the UI process) results in the UI process receiving multiple
        updates from the web process where the current time is equal (or even less than) the time at which media began
        to play, which results in the playhead seeking backwards to the start time multiple times when playing or
        resuming media.

        To address this, in WebCore, we inform the playback session model of the media time when playback begins (i.e.
        a `playing` or `play` event is fired). This message precedes both the "rate changed" and "current time changed"
        messages.

        Unit tests to be added in a future patch.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::notifyAboutPlaying):
        (WebCore::HTMLMediaElement::setReadyState):
        (WebCore::HTMLMediaElement::playInternal):
        * html/HTMLMediaElement.h:
        (WebCore::HTMLMediaElement::playbackStartedTime):
        * platform/cocoa/WebPlaybackSessionModel.h:
        (WebCore::WebPlaybackSessionModelClient::playbackStartedTimeChanged):
        (WebCore::WebPlaybackSessionModelClient::bufferedTimeChanged): Deleted.
        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        (WebPlaybackSessionModelMediaElement::updateForEventName):
        (WebPlaybackSessionModelMediaElement::playbackStartedTime):
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        * platform/mac/WebPlaybackSessionInterfaceMac.h:
        * platform/mac/WebPlaybackSessionInterfaceMac.mm:
        (WebCore::WebPlaybackSessionInterfaceMac::currentTimeChanged):
        (WebCore::WebPlaybackSessionInterfaceMac::rateChanged):
        (WebCore::WebPlaybackSessionInterfaceMac::beginScrubbing):
        (WebCore::WebPlaybackSessionInterfaceMac::endScrubbing):
        (WebCore::WebPlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):

2016-09-23  Zalan Bujtas  <zalan@apple.com>

        ASSERTION FAILED: !newRelayoutRoot.container() || is<RenderView>(newRelayoutRoot.container()) || !newRelayoutRoot.container()->needsLayout() while loading sohu.com
        https://bugs.webkit.org/show_bug.cgi?id=162466

        Reviewed by Simon Fraser.

        When we come across a out-of-flow positioned renderer during layout, we add it to a tracker map with
        its containing block (calling RenderBlock::insertPositionedObject).
        It ensures that a containing block can easily access to the out-of-flow positioned descendants during layout/painting/hittesting.
        We do it even when the containing block - positioned renderer pair is already in this tracker map.
        RenderBlock::insertPositionedObject() eagerly sets the positioned-child-needs-layout flag on the containing block
        assuming it needs to layout this descendant later in the layout phase.
        This patch ensure that we only flag the containing block dirty when the descendant needs layout.

        Test: fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block.html

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

2016-09-23  Yusuke Suzuki  <utatane.tea@gmail.com>

        [Binding] Use unchekcedArgument if argumentCount is already checked
        https://bugs.webkit.org/show_bug.cgi?id=162502

        Reviewed by Geoffrey Garen.

        It is not necessary to use `exec->argument(n)` after checking the argument exists.
        This patch changes `argument(n)` to `uncheckedArgument(n)` if we already proved that
        the argument exists. This change drops branches generated by `exec->argument(n)`.
        And it is good for small DOM operations in which DOM binding code occupies large
        part of entire processing. This patch and another small patch[1] offer roughly 5%
        improvement in Dromaeo dom-attr's getAttribute and setAttribute tests.

        [1]: https://bugs.webkit.org/show_bug.cgi?id=162503

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateParametersCheck): GenerateParameterCheck requires GenerateArgumentsCountCheck.
        As a result, existence of mandatory arguments are already checked. We can use `uncheckedArgument(n)`
        for mandatory arguments.
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
        (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
        (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        (WebCore::jsTestEventTargetPrototypeFunctionItem):
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
        (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1):
        (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2):
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        (WebCore::JSTestInterfaceConstructor::construct):
        (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
        (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        (WebCore::JSTestNamedConstructorNamedConstructor::construct):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::JSTestObjConstructor::construct):
        (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
        (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
        (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
        (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
        (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
        (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
        (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString):
        (WebCore::jsTestObjPrototypeFunctionSerializedValue):
        (WebCore::jsTestObjPrototypeFunctionOptionsObject):
        (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
        (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod):
        (WebCore::jsTestObjPrototypeFunctionAddEventListener):
        (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
        (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
        (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
        (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
        (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
        (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
        (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
        (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
        (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
        (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
        (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
        (WebCore::jsTestObjPrototypeFunctionGetElementById):
        (WebCore::jsTestObjPrototypeFunctionConvert1):
        (WebCore::jsTestObjPrototypeFunctionConvert2):
        (WebCore::jsTestObjPrototypeFunctionConvert3):
        (WebCore::jsTestObjPrototypeFunctionConvert4):
        (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
        (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
        (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
        (WebCore::jsTestObjPrototypeFunctionAny):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
        (WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
        (WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
        (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
        (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
        (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        (WebCore::constructJSTestOverloadedConstructors1):
        (WebCore::constructJSTestOverloadedConstructors2):
        (WebCore::constructJSTestOverloadedConstructors3):
        (WebCore::constructJSTestOverloadedConstructors4):
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        (WebCore::JSTestTypedefsConstructor::construct):
        (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
        (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
        (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg):
        (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
        (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
        (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
        (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):

2016-09-23  Alex Christensen  <achristensen@webkit.org>

        Refactor URLParser
        https://bugs.webkit.org/show_bug.cgi?id=162518

        Reviewed by Brady Eidson.

        Use a helper function to determine the currentPosition instead of always determining position based on the
        size of the buffer.  Soon there will be nothing in the buffer in the common case where there are no syntax errors.
        Also make more static functions into methods.  Give IPv6Addresses and IPv4Addresses names.  Start adding syntaxError stubs.

        No change in behavior.  Covered by API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::incrementIteratorSkippingTabAndNewLine):
        (WebCore::URLParser::isWindowsDriveLetter):
        (WebCore::URLParser::appendToASCIIBuffer):
        (WebCore::URLParser::syntaxError):
        (WebCore::URLParser::currentPosition):
        (WebCore::URLParser::URLParser):
        (WebCore::URLParser::parse):
        (WebCore::URLParser::parseAuthority):
        (WebCore::URLParser::appendNumberToASCIIBuffer):
        (WebCore::URLParser::serializeIPv4):
        (WebCore::URLParser::serializeIPv6Piece):
        (WebCore::URLParser::serializeIPv6):
        (WebCore::URLParser::parseIPv4Host):
        (WebCore::URLParser::parseIPv6Host):
        (WebCore::URLParser::parsePort):
        (WebCore::URLParser::parseHostAndPort):
        (WebCore::append): Deleted.
        (WebCore::serializeIPv4): Deleted.
        (WebCore::serializeIPv6Piece): Deleted.
        (WebCore::serializeIPv6): Deleted.
        (WebCore::parseIPv4Host): Deleted.
        (WebCore::parseIPv6Host): Deleted.
        * platform/URLParser.h:

2016-09-23  Alex Christensen  <achristensen@webkit.org>

        Refactor URLParser
        https://bugs.webkit.org/show_bug.cgi?id=162516

        Reviewed by Brady Eidson.

        Turn more static functions into methods, use a helper function to append characters to a buffer.

        No change in behavior, but I added a new API test to cover an interesting 
        ipv6 address parsing case that had no coverage.

        * platform/URLParser.cpp:
        (WebCore::CodePointIterator::codeUnitsSince):
        (WebCore::URLParser::isWindowsDriveLetter):
        (WebCore::URLParser::appendToASCIIBuffer):
        (WebCore::URLParser::checkWindowsDriveLetter):
        (WebCore::URLParser::percentEncodeByte):
        (WebCore::URLParser::utf8PercentEncode):
        (WebCore::URLParser::utf8QueryEncode):
        (WebCore::URLParser::encodeQuery):
        (WebCore::URLParser::copyASCIIStringUntil):
        (WebCore::URLParser::copyURLPartsUntil):
        (WebCore::URLParser::URLParser):
        (WebCore::URLParser::parse):
        (WebCore::URLParser::parseAuthority):
        (WebCore::URLParser::parsePort):
        (WebCore::URLParser::parseHostAndPort):
        (WebCore::utf8PercentEncode): Deleted.
        (WebCore::utf8QueryEncode): Deleted.
        (WebCore::encodeQuery): Deleted.
        (WebCore::copyASCIIStringUntil): Deleted.
        * platform/URLParser.h:
        (WebCore::URLParser::appendToASCIIBuffer):

2016-09-23  Caitlin Potter  <caitp@igalia.com>

        [JSC] Implement parsing of Async Functions
        https://bugs.webkit.org/show_bug.cgi?id=161409

        Reviewed by Yusuke Suzuki.

        * Configurations/FeatureDefines.xcconfig:

2016-09-23  Chris Dumez  <cdumez@apple.com>

        Align HTMLLabelElement.prototype.form with the HTML specification
        https://bugs.webkit.org/show_bug.cgi?id=162369

        Reviewed by Ryosuke Niwa.

        Align HTMLLabelElement.prototype.form with the HTML specification:
        - https://html.spec.whatwg.org/#dom-label-form

        In particular, the following behavior changes:
        - We now return null if the label element has no labeled control.
        - We now return the form element instead of returning null if
          the label element is outside the form but its labeled control
          is inside the form.

        Firefox and Chrome match the specification.

        No new tests, rebaselined existing tests.

        * html/HTMLLabelElement.cpp:
        (WebCore::HTMLLabelElement::form):
        * html/HTMLLabelElement.h:

2016-09-23  Alex Christensen  <achristensen@webkit.org>

        Refactor URLParser
        https://bugs.webkit.org/show_bug.cgi?id=162511

        Reviewed by Brady Eidson.

        Make the constructor take the parameters instead of URL::parse.
        Now we don't need to copy the input string on failure.
        Also, turn some static functions into methods so they will be able to access member variables.

        Covered by existing and new API tests.

        * platform/URL.cpp:
        (WebCore::URL::URL):
        (WebCore::URL::setProtocol):
        (WebCore::URL::setHost):
        (WebCore::URL::removePort):
        (WebCore::URL::setPort):
        (WebCore::URL::setHostAndPort):
        (WebCore::URL::setUser):
        (WebCore::URL::setPass):
        (WebCore::URL::setFragmentIdentifier):
        (WebCore::URL::removeFragmentIdentifier):
        (WebCore::URL::setQuery):
        (WebCore::URL::setPath):
        * platform/URLParser.cpp:
        (WebCore::URLParser::incrementIteratorSkippingTabAndNewLine):
        (WebCore::URLParser::isWindowsDriveLetter):
        (WebCore::URLParser::checkWindowsDriveLetter):
        (WebCore::URLParser::shouldCopyFileURL):
        (WebCore::URLParser::failure):
        (WebCore::URLParser::URLParser):
        (WebCore::URLParser::parse):
        (WebCore::incrementIteratorSkippingTabAndNewLine): Deleted.
        (WebCore::isWindowsDriveLetter): Deleted.
        (WebCore::checkWindowsDriveLetter): Deleted.
        (WebCore::shouldCopyFileURL): Deleted.
        * platform/URLParser.h:
        (WebCore::URLParser::URLParser):
        (WebCore::URLParser::result):
        (WebCore::URLParser::parse): Deleted.
        * platform/cf/URLCF.cpp:
        (WebCore::URL::URL):
        Drive-by fix: Actually assign the URL to be the result of parsing.
        * platform/mac/URLMac.mm:
        (WebCore::URL::URL):

2016-09-23  Alex Christensen  <achristensen@webkit.org>

        Remove URLParser serialized template
        https://bugs.webkit.org/show_bug.cgi?id=162501

        Reviewed by Brady Eidson.

        No change in behavior.  
        This optimization conflicts with another optimization I'm doing.
        We currently have the ParsedURLString tag, where we tell the parser to assume this URL is valid and canonicalized.
        I'm going to instead make URLParser assume all URLs are valid and canonicalized until it finds that it is not, 
        in which case it will canonicalize it if possible.

        * platform/URL.cpp:
        (WebCore::URL::URL):
        * platform/URLParser.cpp:
        (WebCore::incrementIteratorSkippingTabAndNewLine):
        (WebCore::isWindowsDriveLetter):
        (WebCore::checkWindowsDriveLetter):
        (WebCore::shouldCopyFileURL):
        (WebCore::utf8PercentEncode):
        (WebCore::utf8QueryEncode):
        (WebCore::URLParser::parse):
        (WebCore::URLParser::parseAuthority):
        (WebCore::URLParser::parsePort):
        (WebCore::URLParser::parseHostAndPort):
        (WebCore::URLParser::parseSerializedURL): Deleted.
        * platform/URLParser.h:
        (WebCore::URLParser::parse):

2016-09-23  Jer Noble  <jer.noble@apple.com>

        Allow Seeking from the now playing controls
        https://bugs.webkit.org/show_bug.cgi?id=162498

        Reviewed by Beth Dakin.

        We already have a handler for seek commands, we just need to register that handler
        with MediaRemote.

        * platform/mac/RemoteCommandListenerMac.mm:
        (WebCore::RemoteCommandListenerMac::updateSupportedCommands):

2016-09-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        MediaSessionManagerMac::nowPlayingEligibleSession() needs to honor the main content heuristic
        https://bugs.webkit.org/show_bug.cgi?id=162480
        <rdar://problem/28430615>

        Reviewed by Jer Noble.

        Changes the implementation of nowPlayingEligibleSession to use bestMediaElementForShowingPlaybackControlsManager
        and also early return nullptr if the current tab the web process is hosted in is the active tab, and the window
        it is hosted in is the main window. This information is derived from the viewState flags in the Page of each
        tab -- whenever the (visible && active) state changes, the Page tells the global media session manager to update
        its Now Playing info. Then, when each MediaElementSession tries to determine whether it can show playback
        controls for the purposes of Now Playing, each session consults its page's visible and active state. If a page
        is both visible and active, no Now Playing controls are allowed for that media session.

        Also adds some slight adjustments to MediaSessionManagerMac::updateNowPlayingInfo, so we reset the title, rate
        and duration of the current active session when clearing out the now playing info. Likewise, when vending an
        active video, if the video information matches that of the current session, we mark m_nowPlayingActive anyways.
        These tweaks prevent us from getting in a bad state when switching between a tab with media and one without.

        Unit tests to come in a future patch.

        * html/HTMLMediaElement.cpp:
        (WebCore::mediaElementSessionInfoForSession):
        (WebCore::mediaSessionMayBeConfusedWithMainContent):
        (WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager):
        (WebCore::HTMLMediaElement::updatePlaybackControlsManager):
        (WebCore::bestMediaSessionForShowingPlaybackControlsManager): Deleted.
        * html/HTMLMediaElement.h:
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::canShowControlsManager):
        (WebCore::MediaElementSession::pageAllowsNowPlayingControls):
        * html/MediaElementSession.h:
        * page/Page.cpp:
        (WebCore::Page::setViewState):
        (WebCore::Page::isVisibleAndActive):
        * page/Page.h:
        * platform/audio/PlatformMediaSessionManager.cpp:
        (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):
        * platform/audio/PlatformMediaSessionManager.h:
        * platform/audio/mac/MediaSessionManagerMac.mm:
        (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):
        (WebCore::MediaSessionManagerMac::nowPlayingEligibleSession):
        (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):

2016-09-23  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r206311.
        https://bugs.webkit.org/show_bug.cgi?id=162495

        Broke internal iOS build (Requested by anttik on #webkit).

        Reverted changeset:

        "Move stylesheet change logic from Document to
        AuthorStyleSheets"
        https://bugs.webkit.org/show_bug.cgi?id=162488
        http://trac.webkit.org/changeset/206311

2016-09-23  Antti Koivisto  <antti@apple.com>

        Move stylesheet change logic from Document to AuthorStyleSheets
        https://bugs.webkit.org/show_bug.cgi?id=162488

        Reviewed by Andreas Kling.

        That's where it belongs.

        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSStyleSheet.cpp:
        (WebCore::CSSStyleSheet::didMutateRules):
        (WebCore::CSSStyleSheet::didMutate):
        (WebCore::CSSStyleSheet::clearOwnerNode):
        * dom/AuthorStyleSheets.cpp:
        (WebCore::AuthorStyleSheets::AuthorStyleSheets):
        (WebCore::AuthorStyleSheets::flushPendingUpdates):
        (WebCore::AuthorStyleSheets::scheduleOptimizedUpdate):
        (WebCore::AuthorStyleSheets::didChange):
        (WebCore::AuthorStyleSheets::optimizedUpdateTimerFired):
        * dom/AuthorStyleSheets.h:
        (WebCore::AuthorStyleSheets::hasPendingUpdate):
        (WebCore::AuthorStyleSheets::pendingUpdateType): Deleted.
        (WebCore::AuthorStyleSheets::setPendingUpdateType): Deleted.
        (WebCore::AuthorStyleSheets::flushPendingUpdates): Deleted.
        * dom/Document.cpp:
        (WebCore::Document::Document):
        (WebCore::Document::setContentLanguage):
        (WebCore::Document::needsStyleRecalc):
        (WebCore::Document::updateStyleIfNeeded):
        (WebCore::Document::updateLayoutIgnorePendingStylesheets):
        (WebCore::Document::didRemoveAllPendingStylesheet):
        (WebCore::Document::processHttpEquiv):
        (WebCore::Document::setSelectedStylesheetSet):
        (WebCore::Document::updateHoverActiveState):
        (WebCore::Document::optimizedStyleSheetUpdateTimerFired): Deleted.
        (WebCore::Document::scheduleOptimizedStyleSheetUpdate): Deleted.
        (WebCore::Document::styleResolverChanged): Deleted.
        * dom/Document.h:
        (WebCore::Document::needsStyleRecalc): Deleted.
        * dom/ExtensionStyleSheets.cpp:
        (WebCore::ExtensionStyleSheets::clearPageUserSheet):
        (WebCore::ExtensionStyleSheets::updatePageUserSheet):
        (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
        (WebCore::ExtensionStyleSheets::addUserStyleSheet):
        (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
        (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
        * dom/InlineStyleSheetOwner.cpp:
        (WebCore::InlineStyleSheetOwner::removedFromDocument):
        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::removedFrom):

            Also fix a bug that prevented document from rendering if a loading processing instruction was removed from the tree.
            This is tested by fast/dom/StyleSheet/detached-style-pi-2.xhtml (after other changes in this patch).

        * dom/ShadowRoot.cpp:
        (WebCore::ShadowRoot::updateStyle):
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::setDisabledState):
        (WebCore::HTMLLinkElement::parseAttribute):
        (WebCore::HTMLLinkElement::process):
        (WebCore::HTMLLinkElement::removedFrom):
        (WebCore::HTMLLinkElement::removePendingSheet):
        * html/HTMLStyleElement.cpp:
        (WebCore::HTMLStyleElement::parseAttribute):
        * inspector/InspectorCSSAgent.cpp:
        (WebCore::InspectorCSSAgent::forcePseudoState):
        (WebCore::InspectorCSSAgent::resetPseudoStates):
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::setEmulatedMedia):
        * page/Frame.cpp:
        (WebCore::Frame::setPrinting):
        * page/FrameView.cpp:
        (WebCore::FrameView::layout):
        (WebCore::FrameView::setPagination):
        (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
        * page/Page.cpp:
        (WebCore::Page::setViewMode):
        (WebCore::Page::setNeedsRecalcStyleInAllFrames):
        (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
        * svg/SVGFontFaceElement.cpp:
        (WebCore::SVGFontFaceElement::rebuildFontFace):
        (WebCore::SVGFontFaceElement::removedFrom):
        * xml/XMLTreeViewer.cpp:
        (WebCore::XMLTreeViewer::transformDocumentToTreeView):
        * xml/parser/XMLDocumentParser.cpp:
        (WebCore::XMLDocumentParser::end):
        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::XMLDocumentParser::doEnd):

2016-09-22  Sergio Villar Senin  <svillar@igalia.com>

        [css-grid] ASSERT when sizing tracks with percentages inside calc
        https://bugs.webkit.org/show_bug.cgi?id=162383

        Reviewed by Darin Adler.

        There is an ASSERT to check that tracks are at least as wide as the initial base size. This
        was added to verify that we never shrink tracks bellow that value. In order to compute the
        value used for initialization we need a max size which is the value used to resolve
        percentages to. The remaining free space was used to compute that value, that's totally
        wrong because the free space decreases as the track sizing algorithm is run. The available
        space should be used instead.

        An extra ASSERT was removed too because it was redundant, we do always check the sizes of
        the tracks after running the track sizing algorithm and that's precisely the unique point
        were they could be modified.

        Test: fast/css-grid-layout/tracks-wider-min-track-breadth-crash.html

        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):

2016-09-23  Chris Dumez  <cdumez@apple.com>

        document.title getter does not strip / collapse the right whitespace characters
        https://bugs.webkit.org/show_bug.cgi?id=162468

        Reviewed by Ryosuke Niwa.

        The document.title getter does not strip / collapse whitespace characters
        as per:
        - https://html.spec.whatwg.org/#document.title

        This part of the specification provides more information about which
        whitespace characters:
        - https://html.spec.whatwg.org/#strip-and-collapse-whitespace
        - https://html.spec.whatwg.org/#space-character

        Firefox matches the specification. However, WebKit was stripping / collapsing
        some characters it should not.

        No new tests, rebaselined existing tests.

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

2016-09-23  Chris Dumez  <cdumez@apple.com>

        Align Element.insertAdjacentHTML() with the specification
        https://bugs.webkit.org/show_bug.cgi?id=162479

        Reviewed by Sam Weinig.

        Align Element.insertAdjacentHTML() with the specification:
        - https://w3c.github.io/DOM-Parsing/#dom-element-insertadjacenthtml (steps 1 & 2)

        In particular, the following changes issues are now fixed:
        - Calling insertAdjacentHTML() on an element whose parent is a
          DocumentFragment now works insteas of throwing a
          NO_MODIFICATION_ALLOWED_ERR.
        - Calling insertAdjacentHTML() on child of the <html> element
          no longer creates duplicate body / head elements.

        Firefox agrees with the specification.

        Test: fast/dom/insertAdjacentHTML-DocumentFragment-parent.html

        * dom/Element.cpp:
        (WebCore::contextNodeForInsertion):
        (WebCore::Element::insertAdjacentHTML):

2016-09-23  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r206165.
        https://bugs.webkit.org/show_bug.cgi?id=162492

        needs corresponding API change in bug 162475 (Requested by
        alexchristensen on #webkit).

        Reverted changeset:

        "Non-special URLs should have an opaque origin"
        https://bugs.webkit.org/show_bug.cgi?id=162254
        http://trac.webkit.org/changeset/206165

2016-09-23  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix the build after r206300.

        * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Add missing header include.

2016-09-23  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix; Missed a file in the last checkin.

        * platform/graphics/SourceBufferPrivate.h:
        (WebCore::SourceBufferPrivate::enqueuedSamplesForTrackID):

2016-09-23  Jer Noble  <jer.noble@apple.com>

        REGRESSION (206001): Scrubbed video on Youtube stops playing
        https://bugs.webkit.org/show_bug.cgi?id=162481
        <rdar://problem/28436707>

        Reviewed by Eric Carlson.

        Test: media/media-source/media-source-seek-back.html

        When re-enqueing samples after a seek, modified the algorithm for finding the first sample
        to re-enqueue. Instead of finding a sample which contained the requested presentation time,
        we searched for the first sample on-or-after the presentation time. This meant that if the
        last buffered sample in that range started before the seek time, and ended after, it would
        get skipped during re-enquing, and a far, far future sample would be enqueued instead. Now
        revert to the old behavior (find the sample containing the requested time), and only adopt
        the new behavior (find the next sample on-or-after the requested time) if the first failed.
        In addition, bail out if the second check resulted in a sample whose presentation time was
        greater than a "fudge factor" away from the requested time.

        To test this behavior, add a new method onto Internals that returns a list of the enqueued
        samples from a SourceBuffer.

        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::reenqueueMediaForTime):
        (WebCore::SourceBuffer::enqueuedSamplesForTrackID):
        * Modules/mediasource/SourceBuffer.h:
        * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
        (WebCore::MockMediaSourcePrivate::seekToTime):
        * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
        (WebCore::MockSourceBufferPrivate::enqueuedSamplesForTrackID):
        (WebCore::MockSourceBufferPrivate::enqueueSample):
        * platform/mock/mediasource/MockSourceBufferPrivate.h:
        * testing/Internals.cpp:
        (WebCore::Internals::enqueuedSamplesForTrackID):
        * testing/Internals.h:
        * testing/Internals.idl:

2016-09-22  Zalan Bujtas  <zalan@apple.com>

        Replace redundant prepareForDestruction() call with RELEASE_ASSERT in Document::removedLastRef.
        https://bugs.webkit.org/show_bug.cgi?id=162467

        Reviewed by Chris Dumez.

        Since r205786 fixed the root cause of webkit.org/b/159372, we no longer need the workaround.
        Replace it with a RELEASE_ASSERT to ensure clean state.

        No new tests, covered by existing test.

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

2016-09-23  Antoine Quint  <graouts@apple.com>

        Add a new runtime flag for work on modern media controls (off by default)
        https://bugs.webkit.org/show_bug.cgi?id=162420
        <rdar://problem/27989489>

        Reviewed by Eric Carlson.

        * bindings/generic/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setModernMediaControlsEnabled):
        (WebCore::RuntimeEnabledFeatures::modernMediaControlsEnabled):

2016-09-22  Chris Dumez  <cdumez@apple.com>

        [ShadowDOM] Add support for Node.getRootNode(options)
        https://bugs.webkit.org/show_bug.cgi?id=162457

        Reviewed by Ryosuke Niwa.

        Add support for Node.getRootNode(options):
        - https://dom.spec.whatwg.org/#dom-node-getrootnode

        No new tests, rebaselined existing tests.

        * dom/EventPath.cpp:
        (WebCore::RelatedNodeRetargeter::RelatedNodeRetargeter):
        (WebCore::RelatedNodeRetargeter::checkConsistency):
        * dom/Node.cpp:
        (WebCore::Node::rootNode):
        (WebCore::Node::shadowIncludingRoot):
        (WebCore::Node::getRootNode):
        * dom/Node.h:
        * dom/Node.idl:
        * editing/Editor.cpp:
        (WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
        * xml/XPathPath.cpp:
        (WebCore::XPath::LocationPath::evaluate):

2016-09-22  Brady Eidson  <beidson@apple.com>

        IDBIndex.openCursor() matches indices on multiple object stores.
        <rdar://problem/28434463> and https://bugs.webkit.org/show_bug.cgi?id=158833

        Reviewed by Alex Christensen.

        Tests: storage/indexeddb/modern/multiple-objectstore-index-cursor-collision-private.html
               storage/indexeddb/modern/multiple-objectstore-index-cursor-collision.html

        * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
        (WebCore::IDBServer::buildIndexStatement): Need to include the object store id in the statement for
          index cursors, otherwise there will be collisions amongst multiple object stores that happen to
          share primary keys.
        (WebCore::IDBServer::SQLiteIDBCursor::bindArguments):

2016-09-22  Zalan Bujtas  <zalan@apple.com>

        ShowRenderTree: Shuffle letters to have better readability.
        https://bugs.webkit.org/show_bug.cgi?id=162460

        Reviewed by Simon Fraser.
        old: (B)lock/(I)nline/I(N)line-block, (R)elative/A(B)solute/Fi(X)ed/Stick(Y) positioned, (O)verflow clipping, (A)nonymous, (G)enerated, (F)loating, has(L)ayer, (C)omposited, (D)irty layout, Dirty (S)tyle.
        new: (B)lock/(I)nline/I(N)line-block, (A)bsolute/Fi(X)ed/(R)elative/Stic(K)y, (F)loating, (O)verflow clip, Anon(Y)mous, (G)enerated, has(L)ayer, (C)omposited, (+)Dirty style, (+)Dirty layout.

        Not testable.

        * rendering/RenderObject.cpp:
        (WebCore::showRenderTreeLegend):
        (WebCore::RenderObject::showRenderObject):

2016-09-22  Daniel Bates  <dabates@apple.com>

        [CSP] Violation report may be sent to wrong domain on frame-ancestors violation
        https://bugs.webkit.org/show_bug.cgi?id=162079
        <rdar://problem/28321575>

        Reviewed by Andy Estes.

        Fixes an issue where a CSP violation report may be sent to the wrong domain when the
        frame-ancestors directive is violated. In particular, when the frame-ancestors directive
        is violated for a page that specifies a report URI that is a relative URL then the
        report URI would be resolved with respect to the parent frame's document URL and hence
        be sent to the domain of the parent frame's document.

        * page/csp/ContentSecurityPolicy.cpp:
        (WebCore::ContentSecurityPolicy::reportViolation): Adjust the report URL with respect
        to the blocked URL when we do not have a script execution context.

2016-09-22  Daniel Bates  <dabates@apple.com>

        [XSS Auditor] HTML5 entities can bypass XSS Auditor
        https://bugs.webkit.org/show_bug.cgi?id=161939
        <rdar://problem/25819815>

        Reviewed by David Kilzer.

        Merged from Blink:
        <https://chromium.googlesource.com/chromium/src/+/04e44060dccee711842d08652bf1c622a0f43179>

        Truncate a src-like URL at the first & character as it may mark the start of an HTML entity.
        We will evaluate the effectiveness of this approach and adjust it if necessary if we see an
        increase in false positives.

        HTML5 defines more named character references, including named character references for common
        punctuation characters. Characters following some punctuation characters may come from the page
        itself. We truncate src-like strings at punctuation characters to avoid considering such page
        content when performing a match.

        Test: http/tests/security/xssAuditor/script-tag-with-source-data-url5.html

        * html/parser/XSSAuditor.cpp:
        (WebCore::truncateForSrcLikeAttribute):

2016-09-22  Daniel Bates  <dabates@apple.com>

        [XSS Auditor] Truncate data URLs at quotes
        https://bugs.webkit.org/show_bug.cgi?id=161937

        Reviewed by David Kilzer.

        Merged from Blink: 
        <https://chromium.googlesource.com/chromium/src/+/c6d6331190dd43f09459e2341c3111e796f9de12/>

        Truncate a data URL at the first single or double quote character to avoid considering
        characters that may come from the page content following an injected data URL.

        Test: http/tests/security/xssAuditor/script-tag-with-source-data-url4.html

        * html/parser/XSSAuditor.cpp:
        (WebCore::truncateForSrcLikeAttribute):

2016-09-22  Daniel Bates  <dabates@apple.com>

        Remove more ENABLE(TEXT_AUTOSIZING) code
        https://bugs.webkit.org/show_bug.cgi?id=162456

        Reviewed by Simon Fraser.

        * page/Settings.in:
        * rendering/style/StyleVisualData.h:
        (WebCore::StyleVisualData::operator==):

2016-09-22  Jer Noble  <jer.noble@apple.com>

        Fullscreen controls inoperative in WebKitLegacy web views
        https://bugs.webkit.org/show_bug.cgi?id=162374

        Reviewed by Eric Carlson.

        After r205365, the WebPlaybackSessionInterfaceAVKit was now created after the
        WebPlaybackSessionModel which fed it data, so it no longer received the burst of data upon
        creation. Instead, it should have always asked the model for its cached data as soon as it
        was connected to set up its inital state.

        * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
        (WebCore::WebPlaybackSessionInterfaceAVKit::WebPlaybackSessionInterfaceAVKit):

2016-09-22  Chris Dumez  <cdumez@apple.com>

        Fix serialization of HTML void elements when they have children
        https://bugs.webkit.org/show_bug.cgi?id=162418

        Reviewed by Darin Adler.

        Fix serialization of HTML void elements when they have children.

        Void elements (such as <hr>) cannot have a closing tag. When
        encountering them, we would properly not serialize the void
        element's children (if it had any). However, we would incorrectly
        append an end tag (because the element technically has children).

        Relevant specification:
        - https://html.spec.whatwg.org/#html-fragment-serialisation-algorithm

        In particular, this part:
        ""
        If current node is an area, base, basefont, bgsound, br, col, embed,
        frame, hr, img, input, keygen, link, meta, param, source, track or wbr
        element, then continue on to the next child node at this point.
        ""

        Firefox matches the specification.

        No new tests, rebaselined existing test.

        * editing/MarkupAccumulator.cpp:
        (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):

2016-09-22  Don Olmstead  <don.olmstead@am.sony.com>

        [WinCairo] Fix build after r206196

        Reviewed by Alex Christensen.

        * platform/text/win/LocaleWin.cpp:
        (WebCore::LocaleWin::getLocaleInfoString):

2016-09-22  Jonathan Bedard  <jbedard@apple.com>

        Automatic Text Replacement Testing in WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=161919

        Reviewed by Ryosuke Niwa.

        Fixing existing tests:
            editing/inserting/smart-link-when-caret-is-moved-before-URL.html
            editing/inserting/typing-space-to-trigger-smart-link.html

        Implemented test hooks for text replacement for WebKit2.
        Note that spell checking has not been implemented, so most tests which use text replacement still fail.

        * testing/Internals.cpp:
        (WebCore::Internals::Internals): Reset TextChecker.
        (WebCore::Internals::setContinuousSpellCheckingEnabled): Converted exception to an assert.
        (WebCore::Internals::setAutomaticQuoteSubstitutionEnabled): Converted exception to an assert.
        (WebCore::Internals::setAutomaticLinkDetectionEnabled): Converted exception to an assert.
        (WebCore::Internals::setAutomaticDashSubstitutionEnabled): Converted exception to an assert.
        (WebCore::Internals::setAutomaticTextReplacementEnabled): Converted exception to an assert.
        (WebCore::Internals::setAutomaticSpellingCorrectionEnabled): Converted exception to an assert.
        * testing/Internals.h: Removed exception argument for TextChecker setters.
        * testing/Internals.idl: Ditto.

2016-09-22  Nan Wang  <n_wang@apple.com>

        AX: aria-pressed state not correctly conveyed to VoiceOver iOS on <button> unless role=button added
        https://bugs.webkit.org/show_bug.cgi?id=162269

        Reviewed by Chris Fleizach.

        <button> with aria-pressed attribute has a toggle button role, however, we were looking for explicit
        roles in order to convey the aria-press state. Since there's no spec requiring authors explicitly defining
        default ARIA semantics in such case, I'm exposing the aria-pressed state for all valid toggle buttons.

        Changes are covered in modified test.

        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::isPressed):

2016-09-22  Anders Carlsson  <andersca@apple.com>

        Attempt to fix the open source iOS build.

        * platform/spi/cocoa/PassKitSPI.h:

2016-09-22  Olivier Blin  <olivier.blin@softathome.com>

        [GStreamer] Support a direct GPU-to-GPU copy of video textures to WebGL
        https://bugs.webkit.org/show_bug.cgi?id=159928

        Reviewed by Carlos Garcia Campos.

        Copy of GStreamer video frames to WebGL textures was not accelerated.

        WebGLRenderingContextBase::texImage2D(HTMLVideoElement) went
        through a slow software paint() wrapping the video frame into
        cairo surface (ImageGStreamer), downloading it to draw to the
        image cache context, copying it again in software, and uploading
        it back to an OpenGL texture.

        This patch implements copyVideoTextureToPlatformTexture() for
        the GStreamer media player backend, to do GPU-to-GPU copy, by
        extracting code from nativeImageForCurrentTime().

        Doing this also fixes bug #159621: red and blue colors were
        swapped in video rendered through WebGL with GSTREAMER_GL enabled.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::prepareContextForCairoPaint):
        (WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface):
        (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
        (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

2016-09-22  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Rename DataObjectGtk as SelectionData
        https://bugs.webkit.org/show_bug.cgi?id=162380

        Reviewed by Žan Doberšek.

        DataObjectGtk represents the data of a selection, like GtkSelectionData, used for clipboard and drag adn drop
        operations. Data object is a very generic name, and the Gtk suffix sounds like if this is the GTK implementation
        of a generic DataObject class.

        * PlatformGTK.cmake:
        * editing/gtk/EditorGtk.cpp:
        (WebCore::createFragmentFromPasteboardData):
        * page/gtk/DragControllerGtk.cpp:
        * platform/DragData.h:
        * platform/Pasteboard.h:
        * platform/PasteboardStrategy.h:
        (WebCore::PasteboardStrategy::~PasteboardStrategy): Deleted.
        * platform/PlatformPasteboard.h:
        * platform/gtk/DragDataGtk.cpp:
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::createPrivate):
        (WebCore::Pasteboard::createForDragAndDrop):
        (WebCore::Pasteboard::Pasteboard):
        (WebCore::Pasteboard::selectionData):
        (WebCore::selectionDataTypeFromHTMLClipboardType):
        (WebCore::Pasteboard::writeToClipboard):
        (WebCore::Pasteboard::readFromClipboard):
        (WebCore::Pasteboard::writeString):
        (WebCore::Pasteboard::writePlainText):
        (WebCore::Pasteboard::write):
        (WebCore::Pasteboard::writePasteboard):
        (WebCore::Pasteboard::clear):
        (WebCore::Pasteboard::canSmartReplace):
        (WebCore::Pasteboard::read):
        (WebCore::Pasteboard::hasData):
        (WebCore::Pasteboard::types):
        (WebCore::Pasteboard::readString):
        (WebCore::Pasteboard::readFilenames):
        * platform/gtk/PasteboardHelper.cpp:
        (WebCore::PasteboardHelper::getClipboardContents):
        (WebCore::PasteboardHelper::targetListForSelectionData):
        (WebCore::PasteboardHelper::fillSelectionData):
        (WebCore::ClipboardSetData::ClipboardSetData):
        (WebCore::getClipboardContentsCallback):
        (WebCore::PasteboardHelper::writeClipboardContents):
        (WebCore::clearClipboardContentsCallback): Deleted.
        * platform/gtk/PasteboardHelper.h:
        * platform/gtk/PlatformPasteboardGtk.cpp:
        (WebCore::PlatformPasteboard::writeToClipboard):
        (WebCore::PlatformPasteboard::readFromClipboard):
        * platform/gtk/SelectionData.cpp: Renamed from Source/WebCore/platform/gtk/DataObjectGtk.cpp.
        (WebCore::SelectionData::setText):
        (WebCore::SelectionData::setURIList):
        (WebCore::SelectionData::setURL):
        (WebCore::SelectionData::urlLabel):
        (WebCore::SelectionData::clearAllExceptFilenames):
        (WebCore::SelectionData::clearAll):
        * platform/gtk/SelectionData.h: Renamed from Source/WebCore/platform/gtk/DataObjectGtk.h.
        (WebCore::SelectionData::create):
        (WebCore::SelectionData::text):
        (WebCore::SelectionData::hasText):
        (WebCore::SelectionData::clearText):
        (WebCore::SelectionData::setMarkup):
        (WebCore::SelectionData::markup):
        (WebCore::SelectionData::hasMarkup):
        (WebCore::SelectionData::clearMarkup):
        (WebCore::SelectionData::hasURL):
        (WebCore::SelectionData::clearURL):
        (WebCore::SelectionData::filenames):
        (WebCore::SelectionData::hasURIList):
        (WebCore::SelectionData::hasFilenames):
        (WebCore::SelectionData::setImage):
        (WebCore::SelectionData::image):
        (WebCore::SelectionData::hasImage):
        (WebCore::SelectionData::unknownTypeData):
        (WebCore::SelectionData::unknownTypes):
        (WebCore::SelectionData::hasUnknownTypeData):
        (WebCore::SelectionData::canSmartReplace):
        (WebCore::SelectionData::url): Deleted.
        (WebCore::SelectionData::uriList): Deleted.
        (WebCore::SelectionData::clearURIList): Deleted.
        (WebCore::SelectionData::clearImage): Deleted.
        (WebCore::SelectionData::setUnknownTypeData): Deleted.

2016-09-22  Youenn Fablet  <youenn@apple.com>

        CachedResourceRequest should store a SecurityOrigin
        https://bugs.webkit.org/show_bug.cgi?id=162258

        Reviewed by Sam Weinig.

        Test: http/tests/local/script-crossorigin-loads-file-scheme.html

        Passing SecurityOrigin from loader clients to CachedResource through CachedResourceRequest.
        This ensures that specific origin properties like universal access are well preserved.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::loadRequest): Set origin to the request.
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::CachedResource): Setting origin from the request.
        Computing CORS state based on that origin.
        (WebCore::CachedResource::load): Removing origin computation.
        (WebCore::CachedResource::loadFrom): Ditto.
        (WebCore::CachedResource::computeOrigin): Deleted.
        * loader/cache/CachedResource.h:
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
        (WebCore::CachedResourceLoader::prepareFetch): Introduced to implement step 1 to 7 of https://fetch.spec.whatwg.org/#fetching.
        (WebCore::CachedResourceLoader::requestResource):
        * loader/cache/CachedResourceLoader.h:
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin): Storing origin.
        * loader/cache/CachedResourceRequest.h:
        (WebCore::CachedResourceRequest::setOrigin):
        (WebCore::CachedResourceRequest::releaseOrigin):
        (WebCore::CachedResourceRequest::origin):

2016-09-22  Youenn Fablet  <youenn@apple.com>

        Refactor ContentSecurityPolicy::allow* methods
        https://bugs.webkit.org/show_bug.cgi?id=162335

        Reviewed by Darin Adler.

        No change of behavior.

        Removing the second parameter of ContentSecurityPolicy::allow* methods.
        When true, this parameter makes the methods return true.
        This patch updates the callers of allow* methods to check for the parameter before making the call.

        Made some refactoring to share more code between the various allow* methods.

        * Modules/fetch/FetchLoader.cpp:
        (WebCore::FetchLoader::start):
        * Modules/websockets/WebSocket.cpp:
        (WebCore::WebSocket::connect):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::isSafeToLoadURL):
        (WebCore::HTMLMediaElement::outOfBandTrackSources):
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::allowedToLoadPluginContent):
        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::canLoadURL):
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
        (WebCore::DocumentThreadableLoader::redirectReceived):
        (WebCore::DocumentThreadableLoader::loadRequest):
        (WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy):
        * loader/DocumentThreadableLoader.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::checkIfFormActionAllowedByCSP):
        * loader/PolicyChecker.cpp:
        (WebCore::isAllowedByContentSecurityPolicy):
        * loader/SubframeLoader.cpp:
        (WebCore::SubframeLoader::createJavaAppletWidget):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
        * page/EventSource.cpp:
        (WebCore::EventSource::create):
        * page/csp/ContentSecurityPolicy.cpp:
        (WebCore::ContentSecurityPolicy::allowObjectFromSource):
        (WebCore::ContentSecurityPolicy::allowChildFrameFromSource):
        (WebCore::ContentSecurityPolicy::allowResourceFromSource):
        (WebCore::ContentSecurityPolicy::allowChildContextFromSource):
        (WebCore::ContentSecurityPolicy::allowScriptFromSource):
        (WebCore::ContentSecurityPolicy::allowImageFromSource):
        (WebCore::ContentSecurityPolicy::allowStyleFromSource):
        (WebCore::ContentSecurityPolicy::allowFontFromSource):
        (WebCore::ContentSecurityPolicy::allowMediaFromSource):
        (WebCore::ContentSecurityPolicy::allowConnectToSource):
        (WebCore::ContentSecurityPolicy::allowFormAction):
        * page/csp/ContentSecurityPolicy.h:
        * workers/AbstractWorker.cpp:
        (WebCore::AbstractWorker::resolveURL):
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::importScripts):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::initSend):

2016-09-19  Sergio Villar Senin  <svillar@igalia.com>

        [css-grid] Remove the x2 computation of row sizes with indefinite heights
        https://bugs.webkit.org/show_bug.cgi?id=162150

        Reviewed by Darin Adler.

        On r192154, among other things, we added a second pass of the track sizing algorithm for
        rows in order to properly compute row sizes when the height was indefinite. We did that in
        order to have a symmetrical implementation for columns and rows, but unfortunatelly that was
        not correct.

        Apart from issuing incorrect results in some cases it created a huge performance issue in
        the case of having nested grids because we were exponentially increasing the amount of
        executions of the track sizing algorithm. The attached performance test shows a 200%
        improvement with the patch (26 vs 80 runs/s).

        Test: fast/css-grid-layout/nested-grid.html

        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::layoutBlock):
        (WebCore::RenderGrid::computeIntrinsicLogicalHeight):
        (WebCore::RenderGrid::layoutGridItems):

2016-09-22  Youenn Fablet  <youenn@apple.com>

        Improve DeferredWrapper code
        https://bugs.webkit.org/show_bug.cgi?id=161787

        Reviewed by Darin Adler.

        No change of behavior.

        Renaming DeferredWrapper to DeferredPromise.
        Adding create method that creates the underlying JSC::JSPromiseDeferred in non-worker environments.
        Updated create method to take references.
        Introducing domWindow helper accessor into JSDOMObject to ease creation of promise in non-worker environments.
        Doing some minor clean up (renaming of m_wrapper to m_promiseDeferred, accessor change).

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
        * Modules/applepay/ApplePaySession.h:
        * Modules/fetch/DOMWindowFetch.cpp:
        (WebCore::DOMWindowFetch::fetch):
        * Modules/fetch/DOMWindowFetch.h: Updated to take a DeferredPromise to make it consistent with WorkerGlobalScopeFetch.
        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::arrayBuffer):
        (WebCore::FetchBody::blob):
        (WebCore::FetchBody::json):
        (WebCore::FetchBody::text):
        (WebCore::FetchBody::consume):
        (WebCore::FetchBody::consumeArrayBuffer):
        (WebCore::FetchBody::consumeArrayBufferView):
        (WebCore::FetchBody::consumeText):
        (WebCore::FetchBody::consumeBlob):
        * Modules/fetch/FetchBody.h:
        (WebCore::FetchBody::formData):
        * Modules/fetch/FetchBodyConsumer.cpp:
        (WebCore::FetchBodyConsumer::resolveWithData):
        (WebCore::FetchBodyConsumer::resolve):
        * Modules/fetch/FetchBodyConsumer.h:
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::arrayBuffer):
        (WebCore::FetchBodyOwner::blob):
        (WebCore::FetchBodyOwner::formData):
        (WebCore::FetchBodyOwner::json):
        (WebCore::FetchBodyOwner::text):
        * Modules/fetch/FetchBodyOwner.h:
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::consume):
        (WebCore::FetchResponse::finishConsumingStream):
        * Modules/fetch/FetchResponse.h:
        * Modules/fetch/WorkerGlobalScopeFetch.cpp:
        (WebCore::WorkerGlobalScopeFetch::fetch):
        * Modules/fetch/WorkerGlobalScopeFetch.h:
        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::whenDefinedPromise):
        (WebCore::JSCustomElementRegistry::whenDefined):
        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::JSDOMGlobalObject::visitChildren):
        * bindings/js/JSDOMGlobalObject.h:
        * bindings/js/JSDOMPromise.cpp:
        (WebCore::DOMDeferredPromise::DOMDeferredPromise):
        (WebCore::DOMDeferredPromise::~DOMDeferredPromise):
        (WebCore::DOMDeferredPromise::clear):
        (WebCore::DOMDeferredPromise::contextDestroyed):
        (WebCore::DOMDeferredPromise::promise):
        (WebCore::DOMDeferredPromise::callFunction):
        (WebCore::DOMDeferredPromise::reject):
        (WebCore::rejectPromiseWithExceptionIfAny):
        (WebCore::fulfillPromiseWithJSON):
        (WebCore::fulfillPromiseWithArrayBuffer):
        (WebCore::DeferredWrapper::DeferredWrapper): Deleted.
        (WebCore::DeferredWrapper::~DeferredWrapper): Deleted.
        (WebCore::DeferredWrapper::clear): Deleted.
        (WebCore::DeferredWrapper::contextDestroyed): Deleted.
        (WebCore::DeferredWrapper::promise): Deleted.
        (WebCore::DeferredWrapper::callFunction): Deleted.
        (WebCore::DeferredWrapper::reject): Deleted.
        * bindings/js/JSDOMPromise.h:
        (WebCore::DOMDeferredPromise::create):
        (WebCore::callPromiseFunction):
        (WebCore::DOMPromise::DOMPromise):
        (WebCore::DOMPromise::deferredPromise):
        (WebCore::DOMDeferredPromise::resolveWithValue):
        (WebCore::DOMDeferredPromise::resolveWithNewlyCreated):
        (WebCore::DOMDeferredPromise::rejectWithValue):
        (WebCore::DOMDeferredPromise::resolve):
        (WebCore::DOMDeferredPromise::reject):
        (WebCore::DeferredWrapper::create): Deleted.
        (WebCore::DOMPromise::deferredWrapper): Deleted.
        (WebCore::DeferredWrapper::resolveWithValue): Deleted.
        (WebCore::DeferredWrapper::resolveWithNewlyCreated): Deleted.
        (WebCore::DeferredWrapper::rejectWithValue): Deleted.
        (WebCore::DeferredWrapper::resolve): Deleted.
        (WebCore::DeferredWrapper::reject): Deleted.
        * bindings/js/JSDOMWrapper.cpp: Introducing domWindow() accessor.
        * bindings/js/JSDOMWrapper.h:
        * bindings/js/JSFontFaceCustom.cpp:
        (WebCore::JSFontFace::loaded):
        * bindings/js/JSFontFaceSetCustom.cpp:
        (WebCore::JSFontFaceSet::ready):
        * bindings/js/JSMediaDevicesCustom.cpp:
        (WebCore::JSMediaDevices::getUserMedia):
        * bindings/js/JSMediaStreamTrackCustom.cpp:
        (WebCore::JSMediaStreamTrack::applyConstraints):
        * bindings/js/JSReadableStreamSourceCustom.cpp:
        (WebCore::JSReadableStreamSource::start):
        * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
        (WebCore::JSWebKitSubtleCrypto::encrypt):
        (WebCore::JSWebKitSubtleCrypto::decrypt):
        (WebCore::JSWebKitSubtleCrypto::sign):
        (WebCore::JSWebKitSubtleCrypto::verify):
        (WebCore::JSWebKitSubtleCrypto::digest):
        (WebCore::JSWebKitSubtleCrypto::generateKey):
        (WebCore::JSWebKitSubtleCrypto::importKey):
        (WebCore::JSWebKitSubtleCrypto::exportKey):
        (WebCore::JSWebKitSubtleCrypto::wrapKey):
        (WebCore::JSWebKitSubtleCrypto::unwrapKey):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):
        (GenerateReturnParameters):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
        * dom/CustomElementRegistry.h:
        (WebCore::CustomElementRegistry::promiseMap):

2016-09-21  Alexey Proskuryakov  <ap@apple.com>

        Rolling out r206244, as it caused flaky crashes on tests.
        Was: Correct uses of 'safeCast'

        * loader/cache/MemoryCache.cpp:
        (WebCore::MemoryCache::adjustSize):
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::destroyMetadataAndNotify):
        (WebCore::BitmapImage::cacheFrame):
        (WebCore::BitmapImage::didDecodeProperties):
        (WebCore::BitmapImage::dataChanged):
        (WebCore::BitmapImage::frameImageAtIndex):
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::decodedSizeChanged):
        (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):

2016-09-21  Chris Dumez  <cdumez@apple.com>

        Fix serialization of bgsound, keygen and track elements
        https://bugs.webkit.org/show_bug.cgi?id=162353

        Reviewed by Darin Adler.

        Fix serialization of keygen and track elements to match the specification:
        - https://html.spec.whatwg.org/#serialising-html-fragments

        They are not supposed to have an end tag. Firefox and Chrome agree with
        the specification.

        No new tests, rebaselined existing tests.

        * editing/MarkupAccumulator.cpp:
        (WebCore::MarkupAccumulator::elementCannotHaveEndTag):

2016-09-21  Keith Miller  <keith_miller@apple.com>

        Fix build for future versions of Clang.
        https://bugs.webkit.org/show_bug.cgi?id=162346

        Reviewed by Filip Pizlo.

        This fixes issues with the WebCore build where inline
        template-class function definitions are marked as exported. This
        genereates a weak external symobl that our build does not like.

        * Configurations/WebCore.unexp:
        * dom/Exception.h:
        * page/Frame.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
        * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
        (WebCore::WebVideoFullscreenModelVideoElement::videoElement):
        * platform/graphics/Color.h:
        * platform/graphics/transforms/TransformationMatrix.h:
        (WebCore::TransformationMatrix::rotate):
        * platform/mac/WebVideoFullscreenInterfaceMac.h:
        * platform/network/ParsedContentRange.h:
        (WebCore::ParsedContentRange::ParsedContentRange):
        (WebCore::ParsedContentRange::isValid):
        * platform/network/ResourceResponseBase.h:
        (WebCore::ResourceResponseBase::certificateInfo):
        * platform/text/TextStream.h:
        (WebCore::TextStream::increaseIndent):
        (WebCore::TextStream::decreaseIndent):

2016-09-20  Brent Fulgham  <bfulgham@apple.com>

        Correct uses of 'safeCast'
        https://bugs.webkit.org/show_bug.cgi?id=162301
        <rdar://problem/28343658>

        Reviewed by Antti Koivisto.

        A number of integer calculations in BitmapImage and PDFDocumentImage
        are not properly checked for overflow. Correct this.

        Tested by fast/images/large-size-image-crash.html

        * loader/cache/MemoryCache.cpp:
        (WebCore::MemoryCache::adjustSize): RELEASE_ASSERT on overflow.
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::destroyMetadataAndNotify):
        (WebCore::BitmapImage::cacheFrame):
        (WebCore::BitmapImage::didDecodeProperties):
        (WebCore::BitmapImage::dataChanged):
        (WebCore::BitmapImage::ensureFrameAtIndexIsCached):
        (WebCore::BitmapImage::frameImageAtIndex):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::decodedSizeChanged):
        (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):

2016-09-21  Chris Dumez  <cdumez@apple.com>

        Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type
        https://bugs.webkit.org/show_bug.cgi?id=162364

        Reviewed by Darin Adler.

        Setting HTMLMeterElement's attributes to non-finite values throws wrong exception type.
        It should throw a TypeError because their type is 'double' but we throw a
        NOT_SUPPORTED_ERR.

        Specification:
        - https://html.spec.whatwg.org/#htmlmeterelement

        Firefox and Chrome agree with the specification.

        No new tests, updated existing test.

        * html/HTMLMeterElement.cpp:
        (WebCore::HTMLMeterElement::setMin):
        (WebCore::HTMLMeterElement::setMax):
        (WebCore::HTMLMeterElement::setValue):
        (WebCore::HTMLMeterElement::setLow):
        (WebCore::HTMLMeterElement::setHigh):
        (WebCore::HTMLMeterElement::setOptimum):
        * html/HTMLMeterElement.h:
        * html/HTMLMeterElement.idl:

2016-09-21  Anders Carlsson  <andersca@apple.com>

        Fix open source build.

        * platform/spi/cocoa/PassKitSPI.h:

2016-09-21  Chris Dumez  <cdumez@apple.com>

        Fix serialization of HTML Element attributes
        https://bugs.webkit.org/show_bug.cgi?id=162356

        Reviewed by Alex Christensen.

        Fix serialization of HTML Element attributes to align with:
        - https://html.spec.whatwg.org/#html-fragment-serialisation-algorithm
        - https://html.spec.whatwg.org/#escapingString

        In particular, we should not escape '<' and '>'.

        Firefox and Chrome both match the specification.

        Note that we keep escaping '<' and '>' for Element attributes in the
        context of XML serialization, as per:
        - https://w3c.github.io/DOM-Parsing/#dfn-serializing-an-attribute-value

        No new tests, rebaselined existing test.

        * editing/MarkupAccumulator.h:

2016-09-21  Anders Carlsson  <andersca@apple.com>

        support openPaymentSetup API on ApplePaySession object
        https://bugs.webkit.org/show_bug.cgi?id=162357
        rdar://problem/26776939

        Reviewed by Tim Horton.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::ApplePaySession::openPaymentSetup):
        Perform security checks and then call into the PaymentCoordinator. In its completion handler, we resolve the promise.

        * Modules/applepay/ApplePaySession.h:
        Add new members.

        * Modules/applepay/ApplePaySession.idl:
        Add openPaymentSetup declaration.

        * Modules/applepay/PaymentCoordinator.cpp:
        (WebCore::PaymentCoordinator::openPaymentSetup):
        Call through to the clients.

        * Modules/applepay/PaymentCoordinator.h:
        * Modules/applepay/PaymentCoordinatorClient.h:
        Add new members.

        * loader/EmptyClients.cpp:
        Add new stub.

        * platform/spi/cocoa/PassKitSPI.h:
        Add SPI declaration.

2016-09-21  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r206222 and r206227.
        https://bugs.webkit.org/show_bug.cgi?id=162361

        "broke the windows build" (Requested by keith_mi_ on #webkit).

        Reverted changesets:

        "Fix build for future versions of Clang."
        https://bugs.webkit.org/show_bug.cgi?id=162346
        http://trac.webkit.org/changeset/206222

        "Attempt to fix windows build after r206222."
        http://trac.webkit.org/changeset/206227

2016-09-21  Alex Christensen  <achristensen@webkit.org>

        URLParser should match URL::parse when parsing data urls with slashes in them
        https://bugs.webkit.org/show_bug.cgi?id=162352

        Reviewed by Darin Adler.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):

2016-09-21  Per Arne Vollan  <pvollan@apple.com>

        [Win] Null pointer crash under WebCore::CACFLayerTreeHost::create().
        https://bugs.webkit.org/show_bug.cgi?id=162266
        <rdar://problem/28345073>

        Reviewed by Brent Fulgham.

        Add null pointer check.

        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
        (WebCore::CACFLayerTreeHost::create):

2016-09-21  Chris Dumez  <cdumez@apple.com>

        Fix enumeration of properties cross origin
        https://bugs.webkit.org/show_bug.cgi?id=162328

        Reviewed by Darin Adler.

        All cross origin properties for Window / Location are supposed to be not enumerable:
        - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)

        Therefore, there should be no properties to iterate on for cross origin Window /
        Location objects.

        No new tests, rebaselined existing test.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::getOwnPropertyNames):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::getOwnPropertyNames):

2016-09-21  Alex Christensen  <achristensen@webkit.org>

        URLParser should fail when parsing invalid relative URLs with no schemes
        https://bugs.webkit.org/show_bug.cgi?id=162355

        Reviewed by Tim Horton.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::copyASCIIStringUntil):
        When copying from a null String, is8Bit dereferences a null pointer.  We don't want to do that.
        (WebCore::URLParser::parse):
        What the spec calls a "null" URL matches !url.isValid(), not url.isNull().
        The former reflects whether the parsing succeeded, 
        the latter whether the contained String (which could be an invalid URL) is null.

2016-09-21  Antti Koivisto  <antti@apple.com>

        Document::styleResolverChanged simplification
        https://bugs.webkit.org/show_bug.cgi?id=162347

        Reviewed by Anders Carlsson.

        * dom/Document.cpp:
        (WebCore::Document::implicitClose):
        (WebCore::Document::setParsing):
        (WebCore::Document::write):
        (WebCore::Document::styleResolverChanged):

            - Remove unncessary AnimationUpdateBlock, it is created by recalcStyle.
            - Remove explicit setNeedsLayoutAndPrefWidthsRecalc/scheduleRelayout calls, style resolution
              invalidates those as needed.
            - Remove evaluateMediaQueryList call, that is done on layout as needed.
            - Remove the ancient INSTRUMENT_LAYOUT_SCHEDULING and the related printfs.

2016-09-21  Keith Miller  <keith_miller@apple.com>

        Attempt to fix windows build after r206222.

        * page/MainFrame.h:
        (WebCore::Frame::isMainFrame):

2016-09-21  Keith Rollin  <krollin@apple.com>

        New DocumentLoader logging causes crashes
        https://bugs.webkit.org/show_bug.cgi?id=162348
        <rdar://problem/28404744>

        Reviewed by Chris Dumez

        Check for NULL m_frame before using it.

        No new tests -- no tests for logging, though this issue was found by
        contentfiltering/block-after-will-send-request-then-allow-unblock.html

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

2016-09-21  Alex Christensen  <achristensen@webkit.org>

        Optimize URLParser
        https://bugs.webkit.org/show_bug.cgi?id=162338

        Reviewed by Tim Horton.

        No change in behavior. Just a marginal performance improvement.

        * platform/URLParser.cpp:
        (WebCore::isValidSchemeCharacter):
        Added to reduce branches when parsing the scheme of a URL.  Now there is a table lookup instead of many range checks.
        (WebCore::URLParser::parse):
        Use appendVector, which uses memcpy.
        (WebCore::URLParser::parseHostAndPort):
        If we know that we are parsing the serialized output of a valid URL, 
        we do not need to convert host characters to lower case.
        They are already lower case.

2016-09-21  Keith Miller  <keith_miller@apple.com>

        Fix build for future versions of Clang.
        https://bugs.webkit.org/show_bug.cgi?id=162346

        Reviewed by Filip Pizlo.

        This fixes issues with the WebCore build where inline
        template-class function definitions are marked as exported. This
        genereates a weak external symobl that our build does not like.

        * Configurations/WebCore.unexp:
        * dom/Exception.h:
        * page/Frame.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
        * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
        (WebCore::WebVideoFullscreenModelVideoElement::videoElement):
        * platform/graphics/Color.h:
        * platform/graphics/transforms/TransformationMatrix.h:
        (WebCore::TransformationMatrix::rotate):
        * platform/mac/WebVideoFullscreenInterfaceMac.h:
        * platform/network/ParsedContentRange.h:
        (WebCore::ParsedContentRange::ParsedContentRange):
        (WebCore::ParsedContentRange::isValid):
        * platform/network/ResourceResponseBase.h:
        (WebCore::ResourceResponseBase::certificateInfo):
        * platform/text/TextStream.h:
        (WebCore::TextStream::increaseIndent):
        (WebCore::TextStream::decreaseIndent):

2016-09-21  Chris Dumez  <cdumez@apple.com>

        Object.getOwnPropertyDescriptor() does not work correctly cross origin
        https://bugs.webkit.org/show_bug.cgi?id=162311

        Reviewed by Gavin Barraclough.

        Object.getOwnPropertyDescriptor() does not work correctly cross origin. In particular:
        - We return value descriptors for attributes instead of getter/setter descriptors
        - attributes / operations are wrongly marked as non-configurable

        Corresponding specification:
        - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
        - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)

        Test: http/tests/security/cross-origin-descriptors.html

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::getOwnPropertySlotDelegate):

2016-09-21  Alex Christensen  <achristensen@webkit.org>

        URLParser: Correctly parse URLs that are just nonspecialscheme:/
        https://bugs.webkit.org/show_bug.cgi?id=162340

        Reviewed by Tim Horton.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        r206162 wasn't quite right.  If a url is just nonspecialscheme:/ then the path should indeed be /

2016-09-21  Alex Christensen  <achristensen@webkit.org>

        URLParser: correctly parse relative URLs that are just one character
        https://bugs.webkit.org/show_bug.cgi?id=162344

        Reviewed by Tim Horton.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):

2016-09-21  Daniel Bates  <dabates@apple.com>

        REGRESSION (r201090): Setting style.webkitTextSizeAdjust does not change text change on iPad
        https://bugs.webkit.org/show_bug.cgi?id=162227
        <rdar://problem/27201529>

        Reviewed by Simon Fraser.

        The CSS property -webkit-text-size-adjust should be respected on all iOS devices. Following
        r201090 we respect it only on iPhone and in iPhone-apps run on iPad.

        Tests: fast/text-autosizing/ios/ipad/programmatic-text-size-adjust.html
               fast/text-autosizing/ios/ipad/text-size-adjust-inline-style.html
               fast/text-autosizing/ios/programmatic-text-size-adjust.html
               fast/text-autosizing/ios/text-size-adjust-inline-style.html
               fast/text-autosizing/text-size-adjust-inline-style.html

        * css/parser/CSSParser.cpp:
        (WebCore::isValidKeywordPropertyAndValue): Remove unused code to validate -webkit-text-size-adjust.
        This code is never used because -webkit-text-size-adjust is a value property (since it accepts a
        <percentage> as a value and CSSParserFastPaths::isKeywordPropertyID(CSSPropertyWebkitTextSizeAdjust)
        returns false). That is, it is not a keyword property.
        (WebCore::CSSParser::parseValue): Always enable the -webkit-text-size-adjust CSS property when
        building for iOS regardless of whether Settings:textAutosizingEnabled() is enabled.

2016-09-21  Miguel Gomez  <magomez@igalia.com>

        [GTK] Build fails with GSTREAMER_GL enabled
        https://bugs.webkit.org/show_bug.cgi?id=162337

        Reviewed by Michael Catanzaro.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Remove uneeded const.

2016-09-21  Jer Noble  <jer.noble@apple.com>

        REGRESSION(r206127): ASSERTION FAILED: !isClosed() in WebCore::MediaSource::detachFromElement
        https://bugs.webkit.org/show_bug.cgi?id=162307

        Reviewed by Eric Carlson.

        The test is crashing when the ScriptExecutionContext is calling stop() on the media element before
        it's attached MediaSource has been open()ed, which is a valid state. Removing this ASSERT().

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::detachFromElement):

2016-09-19  Jer Noble  <jer.noble@apple.com>

        [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-activesourcebuffers.html
        https://bugs.webkit.org/show_bug.cgi?id=162257

        Reviewed by Eric Carlson.

        Some of the conditions in the track changed methods were reversed, and all failed to schedule
        a change event.

        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::videoTrackSelectedChanged):
        (WebCore::SourceBuffer::audioTrackEnabledChanged):
        (WebCore::SourceBuffer::textTrackModeChanged):

2016-09-20  Jer Noble  <jer.noble@apple.com>

        [media-source] Fix imported/w3c/web-platform-tests/media-source/URL-createObjectURL-null.html
        https://bugs.webkit.org/show_bug.cgi?id=162299

        Reviewed by Eric Carlson.

        URL.createObjectURL() should not take an optional parameter (nor return an optional String). 
        (Ref: https://w3c.github.io/FileAPI/#dfn-createObjectURL)

        * Modules/mediasource/DOMURLMediaSource.cpp:
        (WebCore::DOMURLMediaSource::createObjectURL):
        * Modules/mediasource/DOMURLMediaSource.h:
        * Modules/mediasource/DOMURLMediaSource.idl:
        * Modules/mediasource/MediaSourceRegistry.cpp:
        (WebCore::MediaSourceRegistry::registerURL):
        * Modules/mediasource/MediaSourceRegistry.h:
        * Modules/mediastream/DOMURLMediaStream.cpp:
        (WebCore::DOMURLMediaStream::createObjectURL):
        * Modules/mediastream/DOMURLMediaStream.h:
        * Modules/mediastream/DOMURLMediaStream.idl:
        * Modules/mediastream/MediaStreamRegistry.cpp:
        (WebCore::MediaStreamRegistry::registerURL):
        * Modules/mediastream/MediaStreamRegistry.h:
        * fileapi/Blob.cpp:
        (WebCore::BlobURLRegistry::registerURL):
        * html/DOMURL.cpp:
        (WebCore::DOMURL::createObjectURL):
        (WebCore::DOMURL::createPublicURL):
        * html/DOMURL.h:
        * html/DOMURL.idl:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::setSrcObject):
        * html/PublicURLManager.cpp:
        (WebCore::PublicURLManager::registerURL):
        * html/PublicURLManager.h:
        * html/URLRegistry.h:

2016-09-21  Youenn Fablet  <youenn@apple.com>

        [Fetch] Align Accept header default values with fetch spec
        https://bugs.webkit.org/show_bug.cgi?id=162260

        Reviewed by Sam Weinig.

        Covered by existing and updated tests.

        To start implementing step 1 to 7 of fetch algorithm, this patch updates Accept header handling.

        Default values are set according the spec based on resource type.
        Some resource types are not defined in the spec and we keep using existing values.

        We check if Accept header is already present in the request. If that is the case, no change is done to that header.

        If the Accept header is not set, the default value '*/*' is used.
        An Accept header is therefore always set at CachedResourceLoader level.

        * loader/cache/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet): Removing accept initialization.
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load): Removing accept header setting.
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::accept): Deleted.
        (WebCore::CachedResource::setAccept): Deleted.
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::acceptHeaderValueFromType): helper routine merging fetch spec and existing WebKit accept values.
        (WebCore::CachedResourceLoader::prepareFetch): Should implement step 1 to 7 of https://fetch.spec.whatwg.org/#fetching.
        (WebCore::CachedResourceLoader::requestResource): Making use of prepareFetch.
        * loader/cache/CachedResourceLoader.h:
        * loader/cache/CachedSVGDocument.cpp:
        (WebCore::CachedSVGDocument::CachedSVGDocument): Removing accept initialization.
        * loader/cache/CachedScript.cpp:
        (WebCore::CachedScript::CachedScript): Removing accept initialization.
        * loader/cache/CachedXSLStyleSheet.cpp:
        (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet): Removing accept initialization.
        * platform/network/ResourceRequestBase.cpp:
        (WebCore::ResourceRequestBase::hasHTTPHeader): Introduced to check for header presence.
        * platform/network/ResourceRequestBase.h:

2016-09-21  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>

        [GTK] Fix build failure of ScrollbarThemeGtk with libc++
        https://bugs.webkit.org/show_bug.cgi?id=162302

        Reviewed by Carlos Garcia Campos.

        * platform/gtk/ScrollbarThemeGtk.cpp:
        (WebCore::ScrollbarThemeGtk::paint): Add missing #include <cstdlib>

2016-09-21  Philippe Normand  <pnormand@igalia.com>

        [OpenWebRTC] Miscellaneous fixes
        https://bugs.webkit.org/show_bug.cgi?id=162332

        Reviewed by Alejandro G. Castro.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
        (WebCore::MediaPlayerPrivateGStreamerOwr::currentTime): Improved logging.
        (WebCore::MediaPlayerPrivateGStreamerOwr::load): Ditto.
        (WebCore::MediaPlayerPrivateGStreamerOwr::loadingFailed): Ditto.
        (WebCore::MediaPlayerPrivateGStreamerOwr::createGSTAudioSinkBin):
        Pre-roll the autoaudiosink, fetch the underlying platform audio
        sink and pass it to the OpenWebRTC renderer.
        (WebCore::MediaPlayerPrivateGStreamerOwr::maybeHandleChangeMutedState): Improved logging.
        (WebCore::MediaPlayerPrivateGStreamerOwr::setSize): Don't configure invalid video renderer.
        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
        (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Fix copy-paste error.

2016-09-21  Youenn Fablet  <youenn@apple.com>

        Refactor CachedResourceLoader::canRequest
        https://bugs.webkit.org/show_bug.cgi?id=162144

        Reviewed by Darin Adler.

        Covered by existing tests.

        Simplifying CachedResourceLoader::canRequest by doing:
        - CSP checks in another method
        - Removing Same-Origin type-specific checks by setting FetchOptions::Mode appropriately in resource loader clients
        - Moving script specific check in ScriptElement

        Note that the last check may affect the loading behavior in the case scripts are enabled when starting the load
        of a script, but gets disabled before receiving a redirection for the script load.

        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::checkStyleSheet): Setting XSLT stylesheet fetch mode to SameOrigin.
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::requestScriptWithCache): Returning early if scripts are disabled.
        * loader/CrossOriginPreflightChecker.cpp:
        (WebCore::CrossOriginPreflightChecker::startPreflight): Bypassing CSP checks.
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::startLoadingMainResource): Bypassing CSP checks as CachedResourceLoader was not
        checking them for MainResource.
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::loadRequest): Ditto.
        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::preloadIfNeeded): Using new CachedResourceRequest constructor to enable moving the ResourceRequest.
        (WebCore::LinkLoader::loadLink): Skipping CSP checks for link prefetch/subresources as CachedResourceLoader was
        not checking them for Link Prefetch and Subresource types.
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy): Helper routine to check for CSP.
        (WebCore::CachedResourceLoader::canRequest): Making use of introduced helper routine.
        Simplified same origin check as all requests should have their options set.
        * loader/cache/CachedResourceLoader.h:
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::CachedResourceRequest): More efficient constructor.
        * loader/cache/CachedResourceRequest.h:
        * loader/cache/CachedSVGDocumentReference.cpp:
        (WebCore::CachedSVGDocumentReference::load): Setting fetch mode to SameOrigin.
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::updateExternalDocument): Ditto.
        * xml/XSLImportRule.cpp:
        (WebCore::XSLImportRule::loadSheet): Ditto.

2016-09-21  Miguel Gomez  <magomez@igalia.com>

        Build fails with GSTREAMER_GL when both desktop GL and GLES2 are enabled in gst-plugins-bad
        https://bugs.webkit.org/show_bug.cgi?id=159562

        Reviewed by Philippe Normand.

        Refactor video orientation code so including TextureMapperGL in MediaPlayerPrivateGStreamerBase.h
        is not necessary.

        Covered by existent tests.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::texMapFlagFromOrientation):
        (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
        (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
        (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
        (WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

2016-09-21  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>

        [GTK] Fix build failure in clipboard support
        https://bugs.webkit.org/show_bug.cgi?id=162261

        Reviewed by Carlos Garcia Campos.

        * platform/PlatformPasteboard.h: Add missing #include <functional>
        * platform/gtk/PasteboardHelper.h: Add missing #include <functional>

2016-09-20  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>

        VariadicHelper::Result should not include constructor to initialize members
        https://bugs.webkit.org/show_bug.cgi?id=162298

        Reviewed by Darin Adler.

        Remove the constructor since member-wise initialization does the same thing.

        No new tests required.

        * bindings/js/JSDOMBinding.h: Remove useless constructor.

2016-09-20  Alex Christensen  <achristensen@webkit.org>

        Optimize URLParser
        https://bugs.webkit.org/show_bug.cgi?id=162105

        Reviewed by Geoffrey Garen.

        Covered by new API tests.
        This is about a 5% speedup on my URLParser benchmark.

        * platform/URLParser.cpp:
        (WebCore::percentEncodeByte):
        (WebCore::utf8PercentEncode):
        (WebCore::utf8QueryEncode):
        (WebCore::encodeQuery):
        (WebCore::URLParser::parse):
        (WebCore::serializeURLEncodedForm):
        (WebCore::percentEncode): Deleted.
        (WebCore::utf8PercentEncodeQuery): Deleted.

2016-09-20  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Clean up DataObjectGtk handling
        https://bugs.webkit.org/show_bug.cgi?id=162267

        Reviewed by Michael Catanzaro.

        * platform/Pasteboard.h: Use Ref instead of RefPtr for DataObjectGtk member.
        * platform/PasteboardStrategy.h: Pass a const reference to DataObjectGtk in write method and return a Ref from read.
        * platform/PlatformPasteboard.h: Ditto.
        * platform/gtk/DataObjectGtk.h:
        (WebCore::DataObjectGtk::image): Use Image instead of GdkPixbuf.
        (WebCore::DataObjectGtk::setImage):
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::createForDragAndDrop): Use a reference instead of a pointer.
        (WebCore::Pasteboard::Pasteboard): Receives a reference, so we can also remove the ASSERT.
        (WebCore::Pasteboard::dataObject):
        (WebCore::Pasteboard::writeToClipboard): Remove the ShouldIncludeSmartPaste parameter, callers should also update
        canSmartPaste property of DataObjectGtk before calling this.
        (WebCore::Pasteboard::writePlainText):
        (WebCore::Pasteboard::write): Do not convert the image the GdkPixbuf, pass the image to the DataObjectGtk instead.
        * platform/gtk/PasteboardHelper.cpp:
        (WebCore::PasteboardHelper::fillSelectionData): Convert the DataObjectGtk image to GdkPixbuf right before
        passing it to gtk_selection_data_set_pixbuf().
        (WebCore::ClipboardSetData::ClipboardSetData): Use reference instead of pointer.
        (WebCore::getClipboardContentsCallback):
        (WebCore::clearClipboardContentsCallback): Never clear the saved DataObjectGtk, that was only needed when we had
        a global DataObjectGtk associated to a GtkClipboard.
        (WebCore::PasteboardHelper::writeClipboardContents): Use TemporaryChange to set the settingClipboardDataObject global.
        * platform/gtk/PlatformPasteboardGtk.cpp:
        (WebCore::PlatformPasteboard::writeToClipboard):
        (WebCore::PlatformPasteboard::readFromClipboard):

2016-09-20  Alex Christensen  <achristensen@webkit.org>

        Require WTFMove for String::adopt
        https://bugs.webkit.org/show_bug.cgi?id=162313

        Reviewed by Yusuke Suzuki.

        No change in behavior.  This just makes it more clear what is going on when a String adopts a Vector.

        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneDeserializer::readString):
        * css/parser/CSSParser.cpp:
        (WebCore::quoteCSSStringInternal):
        * dom/Document.cpp:
        (WebCore::canonicalizedTitle):
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::normalizeSpaces):
        * html/parser/HTMLTreeBuilder.cpp:
        (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemainingWhitespace):
        * platform/Length.cpp:
        (WebCore::newCoordsArray):
        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        (WebCore::URLParser::serialize):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::ReplicaState::cloneID):
        * platform/text/TextCodecUTF16.cpp:
        (WebCore::TextCodecUTF16::decode):
        * platform/text/TextCodecUTF8.cpp:
        (WebCore::TextCodecUTF8::decode):
        * platform/text/mac/TextCodecMac.cpp:
        (WebCore::TextCodecMac::decode):

2016-09-20  Jer Noble  <jer.noble@apple.com>

        Adopt MRMediaRemoteSetParentApplication.
        https://bugs.webkit.org/show_bug.cgi?id=162259
        <rdar://problem/28376161>

        Reviewed by Anders Carlsson.

        Allow MediaSessionManagerMac to retrieve the correct parent application identifier
        from a PlatformMediaSession so that it can pass that identifier through to MediaRemote
        via MRMediaRemoteSetParentApplication.

        * Modules/webaudio/AudioContext.cpp:
        (WebCore::AudioContext::sourceApplicationIdentifier):
        * Modules/webaudio/AudioContext.h:
        * platform/audio/PlatformMediaSession.cpp:
        (WebCore::PlatformMediaSession::sourceApplicationIdentifier):
        * platform/audio/PlatformMediaSession.h:
        (WebCore::PlatformMediaSession::resetPlaybackSessionState): Deleted.
        * platform/audio/mac/MediaSessionManagerMac.mm:
        (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
        * platform/mac/MediaRemoteSoftLink.cpp:
        * platform/mac/MediaRemoteSoftLink.h:


2016-09-20  Nan Wang  <n_wang@apple.com>

        AX: AppleVisUser: VO can't navigate web dialogs iOS10
        https://bugs.webkit.org/show_bug.cgi?id=162322

        Reviewed by Chris Fleizach.

        When using VoiceOver to navigate a web dialog's children, we were setting focus
        onto the focusable parent in accessibilityElementDidBecomeFocused. When the focusable
        parent is the dialog, it will cause the VO cursor jumping back and forward. Fixed it
        by not setting focus on web dialogs in such case.

        Test: accessibility/ios-simulator/dialog-did-become-focused.html

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):

2016-09-20  Keith Rollin  <krollin@apple.com>

        Add new logging for network resource loading
        https://bugs.webkit.org/show_bug.cgi?id=162237

        Reviewed by Antti Koivisto.

        Add new logging along the non-main path for resource loading. This
        logging should allow us to differentiate between lack-of-logging due
        execution along a path that doesn't have logging statements and
        lack-of-logging due to a hung process.

        No new tests -- there are no tests for logging.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::startLoadingMainResource):
        (WebCore::DocumentLoader::isAlwaysOnLoggingAllowed):
        * loader/DocumentLoader.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::continueLoadAfterWillSubmitForm):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestResource):
        (WebCore::CachedResourceLoader::isAlwaysOnLoggingAllowed):
        * loader/cache/CachedResourceLoader.h:
        * page/Frame.h:

2016-09-20  Zalan Bujtas  <zalan@apple.com>

        REGRESSION (r204552): Athlete search on Strava gives bad rendering.
        https://bugs.webkit.org/show_bug.cgi?id=162250

        Reviewed by Simon Fraser.

        Test: fast/layers/blank-content-when-child-layer-is-at-negative-big-number.html

        * platform/graphics/LayoutRect.cpp:
        (WebCore::LayoutRect::checkedUnite):
        * platform/graphics/LayoutRect.h:
        (WebCore::LayoutRect::isMaxXMaxYRepresentable):
        (WebCore::LayoutRect::maxXMaxYCorner): Deleted.
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::calculateClipRects):

2016-09-20  Jer Noble  <jer.noble@apple.com>

        [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-appendwindow.html
        https://bugs.webkit.org/show_bug.cgi?id=162306

        Reviewed by Darin Adler.

        appendWindowStart should be a restricted double, and both it and appendWindowEnd should throw
        TypeError exceptions when setting them to disallowed values.

        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::setAppendWindowStart):
        (WebCore::SourceBuffer::setAppendWindowEnd):
        * Modules/mediasource/SourceBuffer.idl:

2016-09-20  Jer Noble  <jer.noble@apple.com>

        [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-preload.html
        https://bugs.webkit.org/show_bug.cgi?id=162304

        Reviewed by Darin Adler.

        If an error occurs while loading a URL on behalf of MediaPlayerPrivateAVFObjC, make sure to signal
        that error to AVFoundation, so that the HTMLMediaElement is notified of the error.

        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
        (WebCore::WebCoreAVFResourceLoader::notifyFinished):

2016-09-20  Anders Carlsson  <andersca@apple.com>

        Remove "in-store" from "-apple-pay-button-type"
        https://bugs.webkit.org/show_bug.cgi?id=162321
        rdar://problem/28394581

        Reviewed by Beth Dakin.

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

2016-09-20  Alex Christensen  <achristensen@webkit.org>

        Fix occasional using uninitialized memory crashes after r206168.
        https://bugs.webkit.org/show_bug.cgi?id=162247

        This fixes a crash in imported/w3c/web-platform-tests/url/urlsearchparams-constructor.html
        I could reproduce about 10% of the time.

        * html/URLSearchParams.h:
        Initialize the pointer to nullptr.

2016-09-20  Alex Christensen  <achristensen@webkit.org>

        Reduce allocations in URLParser
        https://bugs.webkit.org/show_bug.cgi?id=162241

        Reviewed by Chris Dumez.

        Use Vectors instead of StringBuilders.  This allows us to use the inline capacity on the stack
        for short URLs (<2KB) and also allows us to skip branches because we know whether the
        contained type is UChar or LChar at compile time.  It also allows us to use uncheckedAppend.

        Added new API tests for parts that were less tested, but there is
        no change in behavior except for a performance improvement.

        * platform/URLParser.cpp:
        (WebCore::appendCodePoint):
        (WebCore::encodeQuery):
        (WebCore::URLParser::failure):
        (WebCore::URLParser::parse):
        (WebCore::percentDecode):
        (WebCore::domainToASCII):
        (WebCore::hasInvalidDomainCharacter):
        (WebCore::URLParser::parseHost):
        (WebCore::formURLDecode):
        (WebCore::isC0Control): Deleted.
        * platform/URLParser.h:

2016-09-20  Nan Wang  <n_wang@apple.com>

        AX: voiceover does not read contents of input role="spinbutton"
        https://bugs.webkit.org/show_bug.cgi?id=162137

        Reviewed by Chris Fleizach.

        The aria-valuenow attribute value on the spinbutton is not exposed
        on iOS. We should expose aria-valuenow attribute for range controls
        based on https://www.w3.org/TR/wai-aria/states_and_properties#aria-valuenow

        Changes are covered in the modified test.

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper accessibilityValue]):

2016-09-20  Michael Catanzaro  <mcatanzaro@igalia.com>

        URLParser: uidna_IDNToASCII_56 is deprecated
        https://bugs.webkit.org/show_bug.cgi?id=161841

        Reviewed by Alex Christensen.

        Add pragmas to silence the warning, plus a FIXME.

        * platform/URLParser.cpp:
        (WebCore::domainToASCII):

2016-09-20  Alex Christensen  <achristensen@webkit.org>

        Make URLSearchParams spec-compliant
        https://bugs.webkit.org/show_bug.cgi?id=162247

        Reviewed by Chris Dumez and Sam Weinig.

        Covered by newly-passing web platform tests.

        * html/DOMURL.cpp:
        (WebCore::DOMURL::~DOMURL):
        (WebCore::DOMURL::setHref):
        (WebCore::DOMURL::setQuery):
        Update any associated URLSearchParams object when the query could change.
        (WebCore::DOMURL::searchParams):
        The lifetime of the URLSearchParams was wrong.  We were creating a new URLSearchParams each time
        URL.searchParams was called, and we should have been creating one the first time and returning the
        same instance for subsequent calls.  This means the DOMURL must own the URLSearchParams if it is associated,
        but if it is not associated, then a URLSearchParams can live on its own.
        * html/DOMURL.h:
        * html/URLSearchParams.h:
        (WebCore::URLSearchParams::URLDestroyed):
        (WebCore::URLSearchParams::setContents):

2016-09-20  Antti Koivisto  <antti@apple.com>

        Remove AuthorStyleSheets::m_hadActiveLoadingStylesheet bit
        https://bugs.webkit.org/show_bug.cgi?id=162312

        Reviewed by Chris Dumez.

        * dom/AuthorStyleSheets.cpp:
        (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):

            We can handle loading sheets with the normal stylesheet change logic. Remove the special case.

        (WebCore::filterEnabledNonemptyCSSStyleSheets):

            Filter out loading stylesheets.

        * dom/AuthorStyleSheets.h:

2016-09-20  Keith Rollin  <krollin@apple.com>

        Adjust current networking logging
        https://bugs.webkit.org/show_bug.cgi?id=162235

        Reviewed by Antti Koivisto.

        Update the "always on" network logging in order to better track the
        loading of a particular resource and to better bind together the
        resources downloaded for a particular page and frame. Do this by
        consistently logging pageID, frameID, and resourceID.

        No new tests -- there are no tests for logging.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
        * loader/ResourceLoader.h:
        (WebCore::ResourceLoader::frame):

2016-09-20  Alex Christensen  <achristensen@webkit.org>

        Non-special URLs should have an opaque origin
        https://bugs.webkit.org/show_bug.cgi?id=162254

        Reviewed by Sam Weinig.

        Covered by newly passing web platform tests.

        * page/SecurityOrigin.cpp:
        (WebCore::shouldTreatAsUniqueOrigin):
        According to https://url.spec.whatwg.org/#origin all URLs with non-special protocols
        should have a unique SecurityOrigin whose serialization is "null".

2016-09-20  Christopher Reid  <Christopher.Reid@am.sony.com>

        [WinCairo]  Not building since 206044
        https://bugs.webkit.org/show_bug.cgi?id=162246

        Reviewed by Alex Christensen.

        No new tests. No change in behaviour.

        * bindings/js/JSWebGLRenderingContextCustom.cpp:
        * platform/network/curl/CookieJarCurl.cpp:

2016-09-20  Alex Christensen  <achristensen@webkit.org>

        Align URLParser with web platform tests when parsing non-special relative URLs ending in AuthorityOrHost state
        https://bugs.webkit.org/show_bug.cgi?id=162251

        Reviewed by Tim Horton.

        Covered by new and updated API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        Fix parsing of non-special URLs that end after scheme:// with no authority.
        We used to assume that parsing non-special schemes would never end with just scheme:// but a string can indeed end right there.
        When a non-special relative URL contains just scheme:// we need the resulting URL to be valid to conform with the web platform tests.
        (WebCore::URLParser::parseHostAndPort):
        Renamed to reflect what the function actually does.
        (WebCore::URLParser::internalValuesConsistent):
        Add utility function for testing.
        (WebCore::URLParser::parseHost): Deleted.
        * platform/URLParser.h:

2016-09-20  Javier Fernandez  <jfernandez@igalia.com>

        [css-grid] The 'grid' shorthand has a new syntax.
        https://bugs.webkit.org/show_bug.cgi?id=161954

        Reviewed by Darin Adler.

        Implementation of the new CSS syntax for the 'grid' shorthand, as
        defined in the CSS Grid Layout specification:
        - https://drafts.csswg.org/css-grid/#grid-shorthand

        No new tests, just adapted the ones we already have and added a few additional test cases.

        * css/CSSValueKeywords.in:
        * css/parser/CSSParser.cpp:
        (WebCore::CSSParser::parseImplicitAutoFlow): Added. Similar to parseGridAutoFlow, but using the new 'auto-flow' keyword.
        (WebCore::CSSParser::parseGridShorthand): New syntax of the 'grid' shorthand.
        * css/parser/CSSParser.h:

2016-09-20  Alex Christensen  <achristensen@webkit.org>

        URLParser should allow '@' in user
        https://bugs.webkit.org/show_bug.cgi?id=162272

        Reviewed by Tim Horton.

        Covered by a new API test.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        The spec describes using an "@ flag" and rewinding iterators.  I've implemented the authority parsing
        and host parsing a little differently, but this makes it equivalent.

2016-09-20  Alex Christensen  <achristensen@webkit.org>

        URLParser: Fix parsing relative URLs with one slash after the scheme:
        https://bugs.webkit.org/show_bug.cgi?id=162294

        Reviewed by Tim Horton.

        This fixes the relatively-obscure case where a relative URL has the same special scheme as the base,
        but there is only one slash after the scheme: at the beginning of the relative URL.  According to spec,
        this should be interpreted the same as if the scheme: were not there.
        For example, parsing "http:/example.com/" relative to "http://example.org/foo/bar" should be the same as
        parsing "/example.com/" relative to "http://example.org/foo/bar".

        Covered by a new API test.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):

2016-09-20  Alex Christensen  <achristensen@webkit.org>

        Fix Windows file URL quirks in URLParser
        https://bugs.webkit.org/show_bug.cgi?id=162303

        Reviewed by Tim Horton.

        Windows file urls allow c:\ and c|\ to have the same meaning, but when serialized they should both be c:/.
        This is now standardized to allow cross-platform uniform behavior of URLs.

        Covered by new API tests and progress on web platform tests when URLParser is enabled.

        * platform/URLParser.cpp:
        (WebCore::incrementIteratorSkippingTabAndNewLine):
        (WebCore::isWindowsDriveLetter):
        (WebCore::checkWindowsDriveLetter):
        (WebCore::shouldCopyFileURL):
        (WebCore::URLParser::parseSerializedURL):
        (WebCore::URLParser::parse):

2016-09-20  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Rename FrameData to ImageFrame, move it to a separate file and use it for all ports
        https://bugs.webkit.org/show_bug.cgi?id=159819

        Reviewed by Simon Fraser.

        Rename FrameData to ImageFrame and move it to a separate file so caching
        it can be managed outside the BitmapImage object. Make the data members
        of FrameData be private and add getters to return their values. Add backing
        store and disposalMethod members, getter and setters to ImageFrame so it can
        replace the non-CG ImageFrame class.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        Add ImageFrame class to WebCore project.
        
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::BitmapImage): The metadata for the non-decoder case is now calculated in the ImageFrame::initialize().
        (WebCore::BitmapImage::haveFrameImageAtIndex): Call ImageFrame's getters instead of access private members.
        (WebCore::BitmapImage::destroyDecodedData): Pass ImageFrame::Caching::Metadata to ImageFrame::clear() to clear the image only.
        (WebCore::BitmapImage::destroyDecodedDataIfNecessary): ImageFrame::usedFrameBytes() is now renamed to ImageFrame::frameBytes().
        (WebCore::BitmapImage::cacheFrame): Call ImageFrame::initialize() to set the image and cache the frame's metadata.
        (WebCore::BitmapImage::dataChanged): Pass ImageFrame::Caching::Empty to ImageFrame::clear() to clear the frame's image and metadata.
        (WebCore::BitmapImage::ensureFrameAtIndexIsCached): Call ImageFrame's getters instead of access private members.
        (WebCore::BitmapImage::frameImageAtIndex): Call ImageFrame's getters instead of access private members.
        (WebCore::BitmapImage::frameIsCompleteAtIndex): Pass ImageFrame::Caching::Metadata to ensureFrameAtIndexIsCached() to ensure the frame's metadata is cached.
        (WebCore::BitmapImage::frameDurationAtIndex): Pass ImageFrame::Caching::Metadata to ensureFrameAtIndexIsCached() to ensure the frame's metadata is cached.
        (WebCore::BitmapImage::frameHasAlphaAtIndex): Pass ImageFrame::Caching::Metadata to ensureFrameAtIndexIsCached() to ensure the frame's metadata is cached.
        (WebCore::BitmapImage::frameOrientationAtIndex): Pass ImageFrame::Caching::Metadata to ensureFrameAtIndexIsCached() to ensure the frame's metadata is cached.
        (WebCore::BitmapImage::singlePixelSolidColor): Call ImageFrame's getters instead of access private members.
        (WebCore::BitmapImage::repetitionCount): Change the return type to be RepetitionCount instead of int.
        (WebCore::BitmapImage::shouldAnimate): Use a simpler condition since RepetitionCountNone is equal to zero.
        (WebCore::BitmapImage::startAnimation): Replace the cAnimation* constants by the new RepetitionCount* enum.
        (WebCore::BitmapImage::internalAdvanceAnimation): Replace the cAnimation* constants by the new RepetitionCount* enum.

        * platform/graphics/BitmapImage.h: FrameData is renamed to ImageFrame and moved to a separate file named ImageFrame.h.
        (WebCore::FrameData::FrameData): Deleted.
        (WebCore::FrameData::~FrameData): Deleted.
        (WebCore::FrameData::clear): Deleted.
        (WebCore::FrameData::usedFrameBytes): Deleted.

        * platform/graphics/ImageBackingStore.h: 
        (WebCore::ImageBackingStore::fillRect): Make it efficient to fill a rect in the ImageBackingStore with the same color.
        (WebCore::ImageBackingStore::pixelAt): Asserts the point is in the bounds of the ImageBackingStore size.
        (WebCore::ImageBackingStore::setPixel): Use pixelValue().
        (WebCore::ImageBackingStore::inBounds): Private functions check whether a point or a rect is in the bounds of the ImageBackingStore size.
        (WebCore::ImageBackingStore::pixelValue): Calculate the RGBA value form red, green, blue and alpha values.

        * platform/graphics/ImageFrame.cpp: Added.
        (WebCore::ImageFrame::ImageFrame): 
        (WebCore::ImageFrame::~ImageFrame):
        (WebCore::ImageFrame::operator=):
        (WebCore::ImageFrame::fillMetaData): Caches the ImageFrame's metadata.
        (WebCore::ImageFrame::clearImage): Deletes all the allocated memory by ImageFrame which can be the ImageBackingStore or the NativeImagePtr.
        (WebCore::ImageFrame::clear): Deletes the allocated memory and may or may not clears the metadata also.
        (WebCore::ImageFrame::initialize): Sets a new ImageBackingStore or a new NativeImagePtr in the ImageFrame.
        (WebCore::ImageFrame::size): Returns the size of the ImageFrame which can be the size of ImageBackingStore or the size of NativeImagePtr.
        (WebCore::ImageFrame::singlePixelSolidColor): Returns whether the ImageFrame can be drawn by filling the image rectangle with a solid color.
        
        * platform/graphics/ImageFrame.h: Added.
        (WebCore::operator++): SubsamplingLevel is strongly typed but RepetitionCount is not since it can be any unsigned value in addition to -1.
        (WebCore::ImageFrame::ImageFrame):
        (WebCore::ImageFrame::setDecoding):
        (WebCore::ImageFrame::decoding):
        (WebCore::ImageFrame::isEmpty):
        (WebCore::ImageFrame::isPartial):
        (WebCore::ImageFrame::isComplete):
        (WebCore::ImageFrame::sizeRespectingOrientation):
        (WebCore::ImageFrame::frameBytes):
        (WebCore::ImageFrame::subsamplingLevel):
        (WebCore::ImageFrame::setDisposalMethod):
        (WebCore::ImageFrame::disposalMethod):
        (WebCore::ImageFrame::image):
        (WebCore::ImageFrame::setOrientation):
        (WebCore::ImageFrame::orientation):
        (WebCore::ImageFrame::setDuration):
        (WebCore::ImageFrame::duration):
        (WebCore::ImageFrame::setHasAlpha):
        (WebCore::ImageFrame::hasAlpha):
        (WebCore::ImageFrame::hasImage):
        (WebCore::ImageFrame::hasInvalidImage):
        (WebCore::ImageFrame::hasMetadata):
        (WebCore::ImageFrame::backingStore):
        (WebCore::ImageFrame::hasBackingStore):
        Setters and getters for the private members.

        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::calculateMaximumSubsamplingLevel): allowSubsamplingOfFrameAtIndex() is renamed to frameAllowSubsamplingAtIndex().
        (WebCore::ImageSource::subsamplingLevelForScale): Use the values of the enum class SubsamplingLevel.
        (WebCore::ImageSource::size): Use the values of the enum class SubsamplingLevel.
        (WebCore::ImageSource::sizeRespectingOrientation): Use the values of the enum class SubsamplingLevel.
        (WebCore::ImageSource::repetitionCount): Replace the constants cAnimation* by the enum RepetitionCount*.
        (WebCore::ImageSource::frameAllowSubsamplingAtIndex): Rename allowSubsamplingOfFrameAtIndex() to frameAllowSubsamplingAtIndex().
        (WebCore::ImageSource::frameSizeAtIndex): Replace the call to orientationAtIndex() by frameOrientationAtIndex().
        (WebCore::ImageSource::frameOrientationAtIndex): Rename orientationAtIndex() to frameOrientationAtIndex().
        (WebCore::ImageSource::dump): Replace the call to orientationAtIndex() by frameOrientationAtIndex().
        (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex): Deleted.
        (WebCore::ImageSource::orientationAtIndex): Deleted.
        
        * platform/graphics/ImageSource.h:
        (WebCore::ImageSource::decoder): We need this function temporarily till we move caching the frames outside BitmapImage. 

        * platform/graphics/NativeImage.h: Change SubImages() to Subimages(). See Darin's comment in https://bugs.webkit.org/show_bug.cgi?id=159819#c6.
        * platform/graphics/cairo/NativeImageCairo.cpp:
        (WebCore::clearNativeImageSubimages):
        (WebCore::clearNativeImageSubImages): Deleted.

        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::createImageSourceOptions): Use the values of the enum class SubsamplingLevel.
        (WebCore::imageSourceOptions): Use the values of the enum class SubsamplingLevel.
        (WebCore::ImageDecoder::repetitionCount): Change the return type to be RepetitionCount instead of int.
        (WebCore::ImageDecoder::frameOrientationAtIndex): orientationAtIndex() is renamed to frameOrientationAtIndex().
        (WebCore::ImageDecoder::frameAllowSubsamplingAtIndex): allowSubsamplingOfFrameAtIndex() is renamed to frameAllowSubsamplingAtIndex().
        (WebCore::ImageDecoder::orientationAtIndex): Deleted.
        (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex): Deleted.
        * platform/graphics/cg/ImageDecoderCG.h:

        * platform/graphics/cg/NativeImageCG.cpp:
        (WebCore::clearNativeImageSubimages): Change SubImages() to Subimages().
        (WebCore::clearNativeImageSubImages): Deleted.

        * platform/image-decoders/ImageDecoder.cpp:
        (WebCore::ImageDecoder::frameIsCompleteAtIndex): Use ImageFrame::isComplete() instead of checking the value of the decoding status().
        (WebCore::ImageDecoder::frameHasAlphaAtIndex): Use ImageFrame::isComplete() instead of checking the value of the decoding status().
        (WebCore::ImageDecoder::frameDurationAtIndex): Use ImageFrame::isEmpty() instead of checking the value of the decoding status().
        (WebCore::ImageDecoder::createFrameImageAtIndex): Access the ImageBackingStore::image() function directly.
        (WebCore::ImageFrame::ImageFrame): Deleted.
        (WebCore::ImageFrame::operator=): Deleted.
        (WebCore::ImageFrame::clearPixelData): Deleted.
        (WebCore::ImageFrame::zeroFillPixelData): Deleted.
        (WebCore::ImageFrame::zeroFillFrameRect): Deleted.
        (WebCore::ImageFrame::initializeBackingStore): Deleted.
        (WebCore::ImageFrame::hasAlpha): Deleted.
        (WebCore::ImageFrame::setHasAlpha): Deleted.
        (WebCore::ImageFrame::setOriginalFrameRect): Deleted.
        (WebCore::ImageFrame::setStatus): Deleted.

        * platform/image-decoders/ImageDecoder.h:
        (WebCore::ImageDecoder::repetitionCount): Use the type RepetitionCount and the enum RepetitionCount* values.
        (WebCore::ImageDecoder::frameOrientationAtIndex): Rename orientationAtIndex() to frameOrientationAtIndex().
        (WebCore::ImageDecoder::frameAllowSubsamplingAtIndex): Rename allowSubsamplingOfFrameAtIndex() to frameAllowSubsamplingAtIndex().
        (WebCore::ImageDecoder::subsamplingLevelForScale): Use the enum class SubsamplingLevel value instead of integer values.
        (WebCore::ImageFrame::ImageFrame): Deleted.
        (WebCore::ImageFrame::copyRowNTimes): Deleted.
        (WebCore::ImageFrame::size): Deleted.
        (WebCore::ImageFrame::asNewNativeImage): Deleted.
        (WebCore::ImageFrame::backingStore): Deleted.
        (WebCore::ImageFrame::hasBackingStore): Deleted.
        (WebCore::ImageFrame::originalFrameRect): Deleted.
        (WebCore::ImageFrame::status): Deleted.
        (WebCore::ImageFrame::duration): Deleted.
        (WebCore::ImageFrame::disposalMethod): Deleted.
        (WebCore::ImageFrame::setDuration): Deleted.
        (WebCore::ImageFrame::setDisposalMethod): Deleted.
        (WebCore::ImageFrame::pixelAt): Deleted.
        (WebCore::ImageFrame::setPixel): Deleted.
        (WebCore::ImageFrame::blendPixel): Deleted.
        (WebCore::ImageDecoder::orientationAtIndex): Deleted.
        (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex): Deleted.

        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
        (WebCore::BMPImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
        (WebCore::BMPImageDecoder::decode): Ditto.

        * platform/image-decoders/bmp/BMPImageReader.cpp:
        (WebCore::BMPImageReader::decodeBMP): Call ImageFrame::isEmpty(). ImageBuffer::initializeBackingStore() is renamed to initialize().
        (WebCore::BMPImageReader::processNonRLEData): Replace ImageFrame::zeroFillPixelData() by ImageBackingStore::clear() and ImageFrame::setAlpha().

        * platform/image-decoders/bmp/BMPImageReader.h:
        (WebCore::BMPImageReader::setPixel): Call ImageBackingStore::setPixel() directly.
        (WebCore::BMPImageReader::fillRGBA): Replace an efficient loop to call setPixel() by ImageBackingStore::fillRect().

        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::GIFImageDecoder): Move the initialization of m_repetitionCount to the header file.
        (WebCore::GIFImageDecoder::repetitionCount): Change the return type.
        (WebCore::GIFImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
        (WebCore::GIFImageDecoder::clearFrameBufferCache): Use the values of the new enum class ImageFrame::DisposalMethod.
        (WebCore::GIFImageDecoder::haveDecodedRow): Call the ImageBackingStore API's directly.
        (WebCore::GIFImageDecoder::frameComplete): Use the values of the new enum class ImageFrame::DisposalMethod.
        (WebCore::GIFImageDecoder::initFrameBuffer): Move calling ImageBackingStore::setFrameRect() to be after initializing the ImageBackingStore itself.

        * platform/image-decoders/gif/GIFImageDecoder.h: Make repetitionCount() returns RepetitionCount and use the new enum class ImageFrame::DisposalMethod.
        
        * platform/image-decoders/gif/GIFImageReader.cpp:
        (GIFImageReader::parse):

        * platform/image-decoders/gif/GIFImageReader.h:
        (GIFFrameContext::GIFFrameContext): Use new enum class ImageFrame::DisposalMethod.
        
        * platform/image-decoders/ico/ICOImageDecoder.cpp:
        (WebCore::ICOImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
        (WebCore::ICOImageDecoder::decode): Ditto.

        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
        (WebCore::setPixel): Call ImageBackingStore::setPixel() directly.
        (WebCore::JPEGImageDecoder::outputScanlines): ImageFrame::initializeBackingStore() is renamed to initialize().
        (WebCore::JPEGImageDecoder::jpegComplete): ImageFrame::setStatus() is renamed to ImageFrame::setDecoding().
        (WebCore::JPEGImageDecoder::decode): Call ImageFrame::isComplete() instead of checking the value of the decoding status().

        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
        (WebCore::PNGImageDecoder::rowAvailable): Call the ImageBackingStore APIs directly.
        (WebCore::PNGImageDecoder::pngComplete): ImageFrame::setStatus() is renamed to setDecoding().
        (WebCore::PNGImageDecoder::readChunks): Use the values of the new enum class ImageFrame::DisposalMethod.
        (WebCore::PNGImageDecoder::clearFrameBufferCache): Replace the call to ImageFrame::clearPixelData() by  ImageFrame::clear().
        (WebCore::PNGImageDecoder::initFrameBuffer): Move calling ImageBackingStore::setFrameRect() to be after initializing the ImageBackingStore itself.
        (WebCore::PNGImageDecoder::frameComplete): Call the ImageBackingStore APIs directly.

        * platform/image-decoders/png/PNGImageDecoder.h: Call ImageFrame::isComplete() instead of checking the value of the decoding status().

        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::frameBufferAtIndex): Call ImageFrame::isComplete() instead of checking the value of the decoding status().
        (WebCore::WEBPImageDecoder::decode): ImageFrame::setStatus() is renamed to setDecoding(). And initializeBackingStore() is renamed to initialize().

2016-09-20  Don Olmstead  <don.olmstead@am.sony.com>

        [WinCairo] Use find_package cairo in build
        https://bugs.webkit.org/show_bug.cgi?id=162239

        Reviewed by Alex Christensen.

        No new tests. No change in behavior.

        * PlatformWinCairo.cmake:

2016-09-20  Jer Noble  <jer.noble@apple.com>

        [media-source] Support MediaSource.setLiveSeekableRanges()
        https://bugs.webkit.org/show_bug.cgi?id=162252

        Reviewed by Sam Weinig.

        Fixes tests: imported/w3c/web-platform-tests/media-source/interfaces.html
                     imported/w3c/web-platform-tests/media-source/mediasource-liveseekable.html

        Add support for a new part of the Media Source specification, the ability for clients to
        specify the seekable ranges for a MediaSource-backed HTMLMediaElement.

        Adding the live-seekable methods to MediaSource fixes a large number of the interfaces.html
        tests, and the rest are fixed by adding on<event> handlers to MediaSource, SourceBuffer,
        and SourceBufferList.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::seekable):
        (WebCore::MediaSource::setLiveSeekableRange):
        (WebCore::MediaSource::clearLiveSeekableRange):
        * Modules/mediasource/MediaSource.h:
        * Modules/mediasource/MediaSource.idl:
        * Modules/mediasource/SourceBuffer.idl:
        * Modules/mediasource/SourceBufferList.idl:
        * Modules/mediasource/VideoPlaybackQuality.idl:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::seekable):

2016-09-20  Per Arne Vollan  <pvollan@apple.com>

        [Win] Unreviewed warning fix.

        * page/CaptionUserPreferencesMediaAF.cpp:

2016-09-19  Chris Dumez  <cdumez@apple.com>

        Add support for HTMLSourceElement.prototype.sizes / HTMLSourceElement.prototype.srcset
        https://bugs.webkit.org/show_bug.cgi?id=162244

        Reviewed by Alex Christensen.

        Add support for HTMLPrototype.prototype.sizes / HTMLPrototype.prototype.srcset:
        - https://html.spec.whatwg.org/#the-source-element

        We already support the corresponding content attributes internally. However, we
        are missing the corresponding IDL attributes that are supposed to reflect them.

        Chrome and Firefox support them. We already had those IDL attributes on
        HTMLImageElement.

        No new tests, rebaselined existing test.

        * html/HTMLSourceElement.idl:

2016-09-19  Anders Carlsson  <andersca@apple.com>

        Suppress JavaScript prompts early on in certain cases
        https://bugs.webkit.org/show_bug.cgi?id=162243
        rdar://problem/27661602

        Reviewed by Geoffrey Garen.

        Export symbols needed by WebKit2.

        * loader/FrameLoader.h:
        * loader/FrameLoaderStateMachine.h:

2016-09-19  Chris Dumez  <cdumez@apple.com>

        Align HTMLAppletElement with the specification
        https://bugs.webkit.org/show_bug.cgi?id=162240

        Reviewed by Alex Christensen.

        Align HTMLAppletElement with the specification:
        - https://html.spec.whatwg.org/#htmlappletelement

        In particular:
        - space / vspace should be of type "unsigned long", not DOMString
        - codeBase and object should reflect as URLs

        Firefox agree with the specification. Chrome does not have
        HTMLAppletElement anymore.

        No new tests, rebaselined existing test.

        * html/HTMLAppletElement.cpp:
        (WebCore::HTMLAppletElement::isURLAttribute):
        * html/HTMLAppletElement.h:
        * html/HTMLAppletElement.idl:

2016-09-16  Jer Noble  <jer.noble@apple.com>

        [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-avtracks.html
        https://bugs.webkit.org/show_bug.cgi?id=162104

        Reviewed by Eric Carlson.

        Fixes test: imported/w3c/web-platform-tests/media-source/mediasource-avtracks.html

        Multiple overlapping issues are causing this test to fail:

        - When a MediaSource object is not attached from a HTMLMediaElement, it's SourceBuffer
          objects will return `null` from .videoTracks and .audioTracks, foiling the tests ability
          to assert that sourceBuffer.videoTracks.length == 0.

        - When a MediaSource object is detached from a HTMLMediaElement, it's tracks are removed
          but do not generate 'removedtrack' events.

        When these bugs were fixed, a few more popped up:

        - The HTMLMediaElement removes its tracks before it closes the MediaSource, which causes an
          assertion when the MediaSource tells the HTMLMediaElement to remove its copy of the 
          source's tracks (which have already been removed).

        - When the HTMLMediaElement is stop()-ed due to its ScriptExecutionContext being destroyed,
          it tries to close its MediaSource, which has itself already been stop()-ed and thus asserts.

        To eliminate all these bugs and make the code more self explanatory, we will rename the 
        HTMLMediaElement's closeMediaSource() method to detachMediaSource(), and the MediaSource's
        close() method to detachFromElement(). The only way to close a MediaSource is now by calling
        detachMediaSource() from the HTMLMediaElement.  The parts of the "Detaching from a media
        element" algorithm which were previously spread across setReadyState() and onReadyStateChange()
        are now unified in the newly renamed detachFromElement() method. The HTMLMediaElement will
        first detach its MediaSource, and only after that remove all its tracks.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::setReadyState): Move steps into detachFromElement().
        (WebCore::MediaSource::onReadyStateChange): Ditto.
        (WebCore::MediaSource::detachFromElement): Perform the steps as specified.
        (WebCore::MediaSource::attachToElement): Takes a reference rather than a bare pointer.
        (WebCore::MediaSource::stop): Ask the media elemnet to detach.
        (WebCore::MediaSource::close): Renamed to detachFromElement().
        * Modules/mediasource/MediaSource.h:
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::videoTracks): Always return a valid TrackList object.
        (WebCore::SourceBuffer::audioTracks): Ditto.
        (WebCore::SourceBuffer::textTracks): Ditto.
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::~HTMLMediaElement): Renamed closeMediaSource() -> detachMediaSource().
        (WebCore::HTMLMediaElement::prepareForLoad): Ditto.
        (WebCore::HTMLMediaElement::loadResource): Ditto.
        (WebCore::HTMLMediaElement::noneSupported): Ditto.
        (WebCore::HTMLMediaElement::mediaLoadingFailedFatally): Ditto.
        (WebCore::HTMLMediaElement::detachMediaSource): Ditto.
        (WebCore::HTMLMediaElement::userCancelledLoad): Ditto.
        (WebCore::HTMLMediaElement::createMediaPlayer): Ditto.
        (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto. Also, detach from the MediaSource before
            removing tracks.
        (WebCore::HTMLMediaElement::closeMediaSource): Deleted.
        * html/HTMLMediaElement.h:
        * html/track/TrackListBase.cpp:
        (TrackListBase::remove): Only try to clear the media element from Tracks that have one.

2016-09-19  Alex Christensen  <achristensen@webkit.org>

        URLParser can read memory out of bounds
        https://bugs.webkit.org/show_bug.cgi?id=162206

        Reviewed by Geoff Garen.

        Covered by new API tests.
        URLParser is disabled by default still.

        * platform/URLParser.cpp:
        (WebCore::parseIPv4Host):
        If there are fewer than two numbers in an ipv4 address, we would subtract two from the Vector's size, 
        causing us to read memory up to std::numeric_limits<size_t>::max() - 2.  Added a bounds check and many tests.

2016-09-19  Alex Christensen  <achristensen@webkit.org>

        URLParser should parse serialized valid URLs faster than unknown input
        https://bugs.webkit.org/show_bug.cgi?id=162228

        Reviewed by Chris Dumez.

        The URL constructor with ParsedURLStringTag is almost twice as fast as the other URL constructors.
        Assuming there are no tabs or newlines, and assuming characters are already encoded decreases the URLParser
        runtime by over 25% and adds infrastructure for more optimizations.

        No new tests. No change in behaviour.

        * platform/URL.cpp:
        (WebCore::URL::URL):
        * platform/URLParser.cpp:
        (WebCore::utf8PercentEncode):
        (WebCore::utf8PercentEncodeQuery):
        (WebCore::URLParser::parse):
        (WebCore::URLParser::parseSerializedURL):
        (WebCore::incrementIterator):
        (WebCore::URLParser::parseAuthority):
        (WebCore::URLParser::parsePort):
        (WebCore::URLParser::parseHost):
        * platform/URLParser.h:
        (WebCore::URLParser::parse): Deleted.

2016-09-19  Daniel Bates  <dabates@apple.com>

        Cleanup: Remove an extraneous copy of SecurityOrigin
        https://bugs.webkit.org/show_bug.cgi?id=162118

        Reviewed by Youenn Fablet.

        Share one isolated copy of the SecurityOrigin between the ContentSecurityPolicy and
        LoaderTaskOptions objects instead of creating two isolated copies of the SecurityOrigin.
        This is safe because both ContentSecurityPolicy and LoaderTaskOptions are instantiated
        in WorkerThreadableLoader::MainThreadBridge for use on the main thread only.

        * loader/WorkerThreadableLoader.cpp:
        (WebCore::LoaderTaskOptions::LoaderTaskOptions):
        (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):

2016-09-19  Antti Koivisto  <antti@apple.com>

        Add size assert for RenderElement
        https://bugs.webkit.org/show_bug.cgi?id=162096

        Reviewed by Simon Fraser.

        Also remove the unused m_visibleInViewportState field.

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::unregisterForVisibleInViewportCallback):
        * rendering/RenderElement.h:

2016-09-19  Keith Rollin  <krollin@apple.com>

        REGRESSION (r205275): LOG_WITH_STREAM() macros are all compiled in release builds now
        https://bugs.webkit.org/show_bug.cgi?id=162180

        Reviewed by Simon Fraser.

        Disable LOG_WITH_STREAM in release mode. Along with this, remove a
        local variable in GraphcsContextCG.cpp in release mode that's no
        longer referenced. And adjust logFunctionResult so that it gets
        defined only in debug mode, too, to match its declaration in
        LogMacros.h.

        No new tests -- there are no tests for logging.

        * platform/LogMacros.h:
        * platform/Logging.cpp:
        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::drawNativeImage):

2016-09-19  Daniel Bates  <dabates@apple.com>

        Remove ENABLE(TEXT_AUTOSIZING) automatic text size adjustment code
        https://bugs.webkit.org/show_bug.cgi?id=162167

        Reviewed by Simon Fraser.

        Remove the automatic text size adjustment code guarded by ENABLE(TEXT_AUTOSIZING)
        because it is not used by any port. On Mac and iOS, analogous code guarded by
        ENABLE(IOS_TEXT_AUTOSIZING) is used.

        * CMakeLists.txt:
        * Configurations/FeatureDefines.xcconfig:
        * dom/Document.cpp:
        (WebCore::Document::Document):
        * dom/Document.h:
        (WebCore::Document::textAutosizer): Deleted.
        * page/FrameView.cpp:
        (WebCore::FrameView::setFrameRect):
        (WebCore::FrameView::layout):
        * page/Settings.cpp:
        (WebCore::Settings::Settings):
        (WebCore::Settings::setTextAutosizingFontScaleFactor): Deleted.
        * page/Settings.h:
        (WebCore::Settings::textAutosizingFontScaleFactor): Deleted.
        * page/animation/CSSPropertyAnimation.cpp:
        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
        * rendering/RenderingAllInOne.cpp:
        * rendering/TextAutosizer.cpp: Removed.
        * rendering/TextAutosizer.h: Removed.
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::changeRequiresLayout):
        (WebCore::RenderStyle::lineHeight):
        (WebCore::RenderStyle::setFontSize):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::textAutosizingMultiplier): Deleted.
        (WebCore::RenderStyle::setTextAutosizingMultiplier): Deleted.
        * rendering/style/StyleVisualData.cpp:
        (WebCore::StyleVisualData::StyleVisualData):
        * rendering/style/StyleVisualData.h:
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::Backup::Backup):
        (WebCore::InternalSettings::Backup::restoreTo):
        (WebCore::InternalSettings::setTextAutosizingEnabled):
        (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride):
        (WebCore::InternalSettings::setTextAutosizingFontScaleFactor): Deleted.
        * testing/InternalSettings.h:
        * testing/InternalSettings.idl:

2016-09-19  Chris Dumez  <cdumez@apple.com>

        Update XHTMLParser to recognize "-//W3C//DTD MathML 2.0//EN" public identifier
        https://bugs.webkit.org/show_bug.cgi?id=162166

        Reviewed by Alex Christensen.

        Update XHTMLParser to recognize "-//W3C//DTD MathML 2.0//EN" public identifier as
        per the latest HTML specification.
        - https://html.spec.whatwg.org/#parsing-xhtml-documents

        Firefox already recognizes it properly.

        Test: imported/w3c/web-platform-tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm

        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::convertUTF16EntityToUTF8):
        Fix assertion that was causing the new test to crash in debug. The input '\u0026'
        gets converted to '&' which is only 1 character. However, the assertion wrongly
        expected WTF::Unicode::convertUTF16ToUTF8() to generate more than 1 character.

        (WebCore::externalSubsetHandler):
        Add "-//W3C//DTD MathML 2.0//EN" to the list.

2016-09-19  Chris Dumez  <cdumez@apple.com>

        Window's pageXOffset / pageYOffset attributes should be replaceable
        https://bugs.webkit.org/show_bug.cgi?id=162046

        Reviewed by Darin Adler.

        Window's pageXOffset / pageYOffset attributes should be replaceable as per:
        - https://drafts.csswg.org/cssom-view/#extensions-to-the-window-interface

        Firefox agrees with the specification.

        No new tests, rebaselined existing test.

        * page/DOMWindow.h:
        * page/DOMWindow.idl:

2016-09-19  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r206107.
        https://bugs.webkit.org/show_bug.cgi?id=162229

        still failing on armv7 for some reason (Requested by anttik on
        #webkit).

        Reverted changeset:

        "Add size assert for RenderElement"
        https://bugs.webkit.org/show_bug.cgi?id=162096
        http://trac.webkit.org/changeset/206107

2016-09-19  Antti Koivisto  <antti@apple.com>

        Add size assert for RenderElement
        https://bugs.webkit.org/show_bug.cgi?id=162096

        Reviewed by Simon Fraser.

        Also remove the unused m_visibleInViewportState field.

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::unregisterForVisibleInViewportCallback):
        * rendering/RenderElement.h:

2016-09-19  Nan Wang  <n_wang@apple.com>

        AX: Add accessibility support for details element on iOS
        https://bugs.webkit.org/show_bug.cgi?id=162041

        Reviewed by Chris Fleizach.

        The details and summary elements are poorly supported on iOS.
        Two major issues:
            1. Assistive technologies taking focus onto details/summary elements will cause unexpected behavior.
            2. VoiceOver is not speaking the expanded status of the details element.
        Fixed them by not setting focus onto elements inside details and exposing the details element's expanded
        status to its summary's accessible children.

        Test: accessibility/ios-simulator/detail-summary-ios.html

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (matchedParent):
        (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
        (-[WebAccessibilityObjectWrapper _accessibilityLandmarkAncestor]):
        (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
        (-[WebAccessibilityObjectWrapper _accessibilityFieldsetAncestor]):
        (-[WebAccessibilityObjectWrapper tableCellParent]):
        (-[WebAccessibilityObjectWrapper tableParent]):
        (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
        (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
        (-[WebAccessibilityObjectWrapper detailParentForSummaryObject:]):
        (-[WebAccessibilityObjectWrapper detailParentForObject:]):
        (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):
        (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAExpanded]):
        (-[WebAccessibilityObjectWrapper accessibilityIsExpanded]):

2016-09-19  Zalan Bujtas  <zalan@apple.com>

        ASSERTION FAILED: clipRectsContext.rootLayer == m_clipRectsCache->m_clipRectsRoot[clipRectsType] while loading guardian.co.uk
        https://bugs.webkit.org/show_bug.cgi?id=162129
        <rdar://problem/28353350>

        Reviewed by Antti Koivisto.

        Neither ::localClipRect() nor ::selfClipRect() accounts for paginated context while computing the cliprects (See FIXMEs).
        This patch ensures that we don't end up caching these invalid cliprects.

        Test: fast/multicol/assert-on-cliprect-caching-when-paginated.html

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

2016-09-19  Youenn Fablet  <youenn@apple.com>

        Clean-up after r206014
        https://bugs.webkit.org/show_bug.cgi?id=162140

        Reviewed by Sam Weinig.

        Covered by existing tests.

        * platform/network/HTTPHeaderMap.cpp:
        (WebCore::HTTPHeaderMap::add):

2016-09-19  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>

        If a host object is only used as a variadic argument, its bindings header isn't properly included
        https://bugs.webkit.org/show_bug.cgi?id=150121

        Reviewed by Youenn Fablet.

        Modify JS binding generator to include binding headers of objects passed
        as variadic argument.

        * Modules/mediastream/RTCPeerConnection.h: Remove workaround.
        * bindings/scripts/CodeGeneratorJS.pm:
        (AddVariadicToImplIncludes):
        (GenerateParametersCheck):
        * bindings/scripts/test/JS/JSTestObj.cpp:

2016-09-19  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: ⇧⌘C should highlight node under cursor without re-moving mouse
        https://bugs.webkit.org/show_bug.cgi?id=162128

        Reviewed by Brian Burg.

        * inspector/InspectorDOMAgent.h:
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
        (WebCore::InspectorDOMAgent::mouseDidMoveOverElement):
        (WebCore::InspectorDOMAgent::highlightMousedOverNode):
        (WebCore::InspectorDOMAgent::setSearchingForNode):
        When the inspector is connected, remember the last moused over node.
        This produces far more consistent results of highlighting under
        the cursor when pressing and releasing the keyboard shortcut keys,
        without having to move the mouse. Even when using the shortcut to
        first connect the inspector this produces far more consistent
        results because releasing the keys for the shortcut produce new
        mouseDidMoveOverElement events.

2016-09-19  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>

        JSDOMBindings' toArguments() should return a more descriptive object
        https://bugs.webkit.org/show_bug.cgi?id=161793

        Reviewed by Youenn Fablet.

        Replace std::pair with new VariadicHelperResult class with more
        readable members names.

        No additional tests required.

        * bindings/js/JSDOMBinding.h:
        (WebCore::VariadicHelper::Result::Result):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateParametersCheck):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
        (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
        (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
        (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):

2016-09-18  Alex Christensen  <achristensen@webkit.org>

        Remove unnecessary String allocations in URLParser
        https://bugs.webkit.org/show_bug.cgi?id=162089

        Reviewed by Chris Dumez.

        No change in behavior except a performance improvement.

        * platform/URL.cpp:
        (WebCore::assertProtocolIsGood):
        (WebCore::URL::protocolIs):
        (WebCore::protocolIs):
        * platform/URL.h:
        Added a new protocolIs for non-null-terminated strings from user input.
        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        Don't make a String to compare protocols.

2016-09-17  Alex Christensen  <achristensen@webkit.org>

        Inline functions in URLParser
        https://bugs.webkit.org/show_bug.cgi?id=162106

        Reviewed by Antti Koivisto.

        No change in behavior. Just make URLParser faster.

        * platform/URLParser.cpp:
        (WebCore::isC0Control):
        (WebCore::isC0ControlOrSpace):
        (WebCore::isTabOrNewline):
        (WebCore::isInSimpleEncodeSet):
        (WebCore::isInDefaultEncodeSet):
        (WebCore::isInUserInfoEncodeSet):
        (WebCore::isInvalidDomainCharacter):
        (WebCore::isPercentOrNonASCII):
        (WebCore::isSlashQuestionOrHash):
        (WebCore::isWindowsDriveLetter):
        (WebCore::shouldCopyFileURL):
        (WebCore::percentEncode):
        (WebCore::utf8PercentEncode):
        (WebCore::utf8PercentEncodeQuery):
        (WebCore::encodeQuery):
        (WebCore::isDefaultPort):
        (WebCore::isSpecialScheme):
        (WebCore::copyASCIIStringUntil):
        (WebCore::isPercentEncodedDot):
        (WebCore::isSingleDotPathSegment):
        (WebCore::isDoubleDotPathSegment):
        (WebCore::consumeSingleDotPathSegment):
        (WebCore::consumeDoubleDotPathSegment):
        (WebCore::serializeIPv4):
        (WebCore::zeroSequenceLength):
        (WebCore::findLongestZeroSequence):
        (WebCore::serializeIPv6Piece):
        (WebCore::serializeIPv6):
        (WebCore::parseIPv4Number):
        (WebCore::pow256):
        (WebCore::parseIPv4Host):
        (WebCore::parseIPv6Host):
        (WebCore::percentDecode):
        (WebCore::containsOnlyASCII):
        (WebCore::domainToASCII):
        (WebCore::hasInvalidDomainCharacter):
        (WebCore::formURLDecode):
        (WebCore::serializeURLEncodedForm):

2016-09-17  David Kilzer  <ddkilzer@apple.com>

        MainThreadBridge needs an isolatedCopy() of SecurityOrigin
        <https://webkit.org/b/162116>
        <rdar://problem/27525870>

        Reviewed by Carlos Garcia Campos.

        Covered by existing tests.

        * loader/WorkerThreadableLoader.cpp:
        (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
        Make an isolatedCopy() of SecurityOrigin here since that's the
        correct idiom to use when the object is passed from a worker
        thread back to the main thread.  Fix suggested by Daniel Bates.

2016-09-16  Yusuke Suzuki  <utatane.tea@gmail.com>

        [DFG] Introduce IsCellWithType node and unify IsJSArray, IsRegExpObject and newly added IsProxyObject
        https://bugs.webkit.org/show_bug.cgi?id=162000

        Reviewed by Filip Pizlo.

        * bridge/runtime_array.h:
        (JSC::RuntimeArray::createStructure):

2016-09-16  Chris Dumez  <cdumez@apple.com>

        Cancelling one frame's load cancels load in other frames that have the same URL as well
        https://bugs.webkit.org/show_bug.cgi?id=162094

        Reviewed by Antti Koivisto.

        Cancelling one frame's load cancels load in other frames that have the same URL as well.

        So if you have several frames that are loading URL X and you navigate one of the frames
        to Y, then the load of X will be cancelled and this frame will navigate to Y. All other
        frames will not load URL X even though they should.

        The issue is that all the DocumentLoaders share the same CachedResource because of the
        memoryCache. When we call DocumentLoader::stopLoading(), it will cancel the
        CachedResource's load even though there are several clients for this CachedResource
        and other clients still want the load.

        The approach chosen in this patch is to not reuse CachedResources that are still
        loading when trying to load a main resource. This is not the most efficient approach.
        I still chose this approach because:
        - It is very unlikely to introduce new bugs.
        - The change is very simple.
        - This is a corner case (several iframes having the same URL and cancelling the load in
          one of them).

        Test: http/tests/navigation/frames-same-url-cancel-load.html

        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::determineRevalidationPolicy):

2016-09-16  Michael Catanzaro  <mcatanzaro@igalia.com>

        ASSERTION FAILED: The string being removed is atomic in the string table of an other thread! iterator != atomicStringTable.end() at Source/WTF/wtf/text/AtomicStringImpl.cpp(453)
        https://bugs.webkit.org/show_bug.cgi?id=161800

        Reviewed by Žan Doberšek.

        Speculative fix. These strings are created as static objects on a secondary thread, but all
        static objects are destroyed in exit handlers on the main thread, and AtomicStrings must
        always be destroyed on the same thread they are created.

        * platform/graphics/texmap/TextureMapperShaderProgram.h:

2016-09-16  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r206055.
        https://bugs.webkit.org/show_bug.cgi?id=162110

        broke 32bit ARM build (Requested by anttik on #webkit).

        Reverted changeset:

        "Add size assert for RenderElement"
        https://bugs.webkit.org/show_bug.cgi?id=162096
        http://trac.webkit.org/changeset/206055

2016-09-16  Brent Fulgham  <bfulgham@apple.com>

        [Win][Direct2D] Provide Color support for Direct2D
        https://bugs.webkit.org/show_bug.cgi?id=162090

        Reviewed by Dean Jackson.

        Add casting operations to the Color class to allow easy interoption with
        native Direct2D operations.

        No new tests. No change in behavior.

        * PlatformWin.cmake: Add new Windows implementation file.
        * platform/graphics/Color.h:
        * platform/graphics/win/ColorDirect2D.cpp: Added.
        (WebCore::Color::Color):
        (WebCore::Color::operator D2D1_COLOR_F):

2016-09-16  Antti Koivisto  <antti@apple.com>

        Add size assert for RenderElement
        https://bugs.webkit.org/show_bug.cgi?id=162096

        Reviewed by Simon Fraser.

        Also remove the unused m_visibleInViewportState field.

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::unregisterForVisibleInViewportCallback):
        * rendering/RenderElement.h:

2016-09-16  Antti Koivisto  <antti@apple.com>

        Tighten region style map to use RenderElement instead of RenderObject
        https://bugs.webkit.org/show_bug.cgi?id=162064

        Reviewed by Zalan Bujtas.

        RenderTexts don't have styles of their own so the map can operate on RenderElements.

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::willBeRemovedFromTree):
        (WebCore::RenderElement::removeFromRenderFlowThread):
        (WebCore::RenderElement::removeFromRenderFlowThreadIncludingDescendants):
        (WebCore::RenderElement::invalidateFlowThreadContainingBlockIncludingDescendants):
        * rendering/RenderElement.h:
        * rendering/RenderFlowThread.cpp:
        (WebCore::RenderFlowThread::removeFlowChildInfo):
        * rendering/RenderFlowThread.h:
        * rendering/RenderNamedFlowFragment.cpp:
        (WebCore::RenderNamedFlowFragment::computeChildrenStyleInRegion):
        (WebCore::RenderNamedFlowFragment::setRendererStyleInRegion):
        (WebCore::RenderNamedFlowFragment::clearObjectStyleInRegion):
        (WebCore::RenderNamedFlowFragment::setRegionObjectsRegionStyle):
        (WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle):
        (WebCore::RenderNamedFlowFragment::setObjectStyleInRegion): Deleted.
        * rendering/RenderNamedFlowFragment.h:
        * rendering/RenderNamedFlowThread.cpp:
        (WebCore::RenderNamedFlowThread::clearRenderObjectCustomStyle):
        (WebCore::RenderNamedFlowThread::removeFlowChildInfo):
        * rendering/RenderNamedFlowThread.h:
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::willBeRemovedFromTree):
        (WebCore::RenderObject::removeFromRenderFlowThread): Deleted.
        (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants): Deleted.
        (WebCore::RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants): Deleted.

            These can now move to RenderElement.

        * rendering/RenderObject.h:

2016-09-16  Brent Fulgham  <bfulgham@apple.com>

        CaptionUserPreferences's use of the PageGroup's page map is incorrect
        https://bugs.webkit.org/show_bug.cgi?id=122194
        <rdar://problem/27332004>

        Reviewed by Zalan Bujtas.

        Avoid the possibility of dereferencing an unsafe iterator by checking
        for an empty HashSet before using the result of 'begin()'.

        No new tests because there is no change in behavior.

        * page/CaptionUserPreferences.cpp:
        (WebCore::CaptionUserPreferences::CaptionUserPreferences): Use new safer
        accessor to retrieve the current page.
        (WebCore::CaptionUserPreferences::setCaptionDisplayMode): Ditto.
        (WebCore::CaptionUserPreferences::currentPage): Added.
        (WebCore::CaptionUserPreferences::userPrefersCaptions): Use new safer
        accessor to retrieve the current page.
        (WebCore::CaptionUserPreferences::setUserPrefersCaptions): Ditto.
        (WebCore::CaptionUserPreferences::userPrefersSubtitles): Ditto.
        (WebCore::CaptionUserPreferences::setUserPrefersSubtitles): Ditto.
        (WebCore::CaptionUserPreferences::userPrefersTextDescriptions): Ditto.
        (WebCore::CaptionUserPreferences::setUserPrefersTextDescriptions): Ditto.
        * page/CaptionUserPreferences.h:

2016-09-16  Alex Christensen  <achristensen@webkit.org>

        Use Vector<LChar> instead of StringBuilder for the ASCII parts of URLParser
        https://bugs.webkit.org/show_bug.cgi?id=162035

        Reviewed by Chris Dumez.

        StringBuilder::append checks to see whether its StringBuffer is 8-bit or 16-bit each time it is called.
        When parsing URLs, almost all of the parsed URL is guaranteed to be 8-bit ASCII.
        Using a Vector<LChar> for this allows us to use uncheckedAppend in some places, and it always eliminates the 8-bit check.
        This is a ~20% speedup in url parsing.

        Covered by existing API tests.

        * platform/URLParser.cpp:
        (WebCore::isWindowsDriveLetter):
        (WebCore::percentEncode):
        (WebCore::utf8PercentEncode):
        (WebCore::utf8PercentEncodeQuery):
        (WebCore::encodeQuery):
        (WebCore::URLParser::copyURLPartsUntil):
        (WebCore::URLParser::popPath):
        (WebCore::URLParser::parse):
        (WebCore::URLParser::parseAuthority):
        (WebCore::appendNumber):
        (WebCore::serializeIPv4):
        (WebCore::serializeIPv6Piece):
        (WebCore::serializeIPv6):
        (WebCore::URLParser::parsePort):
        (WebCore::URLParser::parseHost):
        (WebCore::serializeURLEncodedForm):
        (WebCore::URLParser::serialize):
        (WebCore::bufferView): Deleted.
        * platform/URLParser.h:

2016-09-16  Dave Hyatt  <hyatt@apple.com>

        [CSS Parser] Get CSSPropertyParserHelpers.cpp compiling
        https://bugs.webkit.org/show_bug.cgi?id=162078

        Reviewed by Dean Jackson.

        * css/CSSCalculationValue.cpp:
        (WebCore::hasDoubleValue):
        (WebCore::checkDepthAndIndex):
        (WebCore::CSSCalcExpressionNodeParser::parseCalc):
        (WebCore::CSSCalcExpressionNodeParser::operatorValue):
        (WebCore::CSSCalcExpressionNodeParser::parseValue):
        (WebCore::CSSCalcExpressionNodeParser::parseValueTerm):
        (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
        (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
        (WebCore::CSSCalcExpressionNodeParser::parseValueExpression):
        (WebCore::checkDepthAndIndexDeprecated):
        (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueTerm):
        (WebCore::CSSCalcExpressionNodeParserDeprecated::parseValueMultiplicativeExpression):
        (WebCore::CSSCalcExpressionNodeParserDeprecated::parseAdditiveValueExpression):
        (WebCore::CSSCalcValue::create):
        * css/CSSCalculationValue.h:
        (WebCore::CSSCalcValue::createCalculationValue):
        (WebCore::CSSCalcValue::setPermittedValueRange):
        Switch off the permitted calc value range enum, since we can just use the identical ValueRange enum.
        Deprecate the CSSParserValueList-based parser by renaming it, and add a new parser that operates
        on tokens.

        * css/CSSPrimitiveValue.cpp:
        (WebCore::isValidCSSUnitTypeForDoubleConversion):
        (WebCore::isStringType):
        (WebCore::CSSPrimitiveValue::cleanup):
        (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
        (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
        (WebCore::CSSPrimitiveValue::cloneForCSSOM):
        (WebCore::CSSPrimitiveValue::equals):
        (WebCore::CSSPrimitiveValue::buildParserValue):
        * css/CSSPrimitiveValue.h:
        Add support for CSS_QUIRKY_EMS as a unit type. This will let us eliminate the extra m_isQuirkValue boolean
        eventually.

        * css/parser/CSSParser.cpp:
        (WebCore::CSSParser::validateCalculationUnit):
        (WebCore::CSSParser::parseCalculation):
        * css/parser/CSSParser.h:
        Switch to ValueRange.

        * css/parser/CSSParserIdioms.cpp:
        (WebCore::completeURL):
        * css/parser/CSSParserIdioms.h:
        Make the URL completion function from CSSParser.cpp available to all.

        * css/parser/CSSParserMode.h:
        (WebCore::isUnitLessValueParsingEnabledForMode):
        (WebCore::isUnitLessLengthParsingEnabledForMode): Deleted.
        Rename this to value, since for now we're not supporting Blink's UserUnits. This means we need to support
        unitless parsing for times and angles in addition to lengths, making the name of the function inappropriate.

        * css/parser/CSSParserToken.cpp:
        (WebCore::cssPrimitiveValueUnitFromTrie):
        Turn quirky ems support back on.

        * css/parser/CSSParserValues.cpp:
        (WebCore::CSSParserValue::createCSSValue):
        Support quirky ems.

        * css/parser/CSSPropertyParserHelpers.cpp:
        (WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue):
        (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
        (WebCore::CSSPropertyParserHelpers::consumeInteger):
        (WebCore::CSSPropertyParserHelpers::consumePositiveInteger):
        (WebCore::CSSPropertyParserHelpers::consumeNumber):
        (WebCore::CSSPropertyParserHelpers::shouldAcceptUnitlessValue):
        (WebCore::CSSPropertyParserHelpers::consumeLength):
        (WebCore::CSSPropertyParserHelpers::consumePercent):
        (WebCore::CSSPropertyParserHelpers::canConsumeCalcValue):
        (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
        (WebCore::CSSPropertyParserHelpers::consumeAngle):
        (WebCore::CSSPropertyParserHelpers::consumeTime):
        (WebCore::CSSPropertyParserHelpers::consumeIdent):
        (WebCore::CSSPropertyParserHelpers::consumeIdentRange):
        (WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
        (WebCore::CSSPropertyParserHelpers::consumeString):
        (WebCore::CSSPropertyParserHelpers::consumeUrl):
        (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
        (WebCore::CSSPropertyParserHelpers::parseHSLParameters):
        (WebCore::CSSPropertyParserHelpers::consumeColor):
        (WebCore::CSSPropertyParserHelpers::consumePositionComponent):
        (WebCore::CSSPropertyParserHelpers::positionFromOneValue):
        (WebCore::CSSPropertyParserHelpers::positionFromTwoValues):
        (WebCore::CSSPropertyParserHelpers::createPrimitiveValuePair):
        (WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues):
        (WebCore::CSSPropertyParserHelpers::consumePosition):
        (WebCore::CSSPropertyParserHelpers::consumeOneOrTwoValuedPosition):
        (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
        (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientStopColor):
        (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
        (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
        (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
        (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
        (WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
        (WebCore::CSSPropertyParserHelpers::consumeImageOrNone):
        (WebCore::CSSPropertyParserHelpers::consumeCrossFade):
        (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
        (WebCore::CSSPropertyParserHelpers::consumeImageSet):
        (WebCore::CSSPropertyParserHelpers::consumeImage):
        * css/parser/CSSPropertyParserHelpers.h:
        (WebCore::CSSPropertyParserHelpers::isCSSWideKeyword):
        Lots of changes here. The most important is switching over to RefPtrs and Refs where appropriate, with the
        requisite WTFMoves. Unit types also have to be converted back to our values, and unitless parsing has
        to work with consumeTime and consumeAngle.

        * platform/CalculationValue.cpp:
        (WebCore::CalculationValue::create):
        * platform/CalculationValue.h:
        (WebCore::CalculationValue::CalculationValue):
        Use ValueRange.

        * platform/graphics/Color.cpp:
        (WebCore::Color::parseHexColor):
        (WebCore::Color::Color):
        * platform/graphics/Color.h:
        Add a StringView-based parseHexColor function.

        * rendering/style/BasicShapes.cpp:
        (WebCore::BasicShapeCenterCoordinate::updateComputedLength):
        Use ValueRange

2016-09-16  Jer Noble  <jer.noble@apple.com>

        [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-av-audio-bitrate.html
        https://bugs.webkit.org/show_bug.cgi?id=162052

        Reviewed by Brent Fulgham.

        Fixes tests: imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-av-audio-bitrate.html
                     imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-av-video-bitrate.html

        The above tests would throw an assertion while trying to invert a range with an invalid end time. Check the
        validity of trackBuffer.lastEnqueuedPresentationTime before comparing it and assigning it to a range.

        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::removeCodedFrames):

2016-09-16  Alex Christensen  <achristensen@webkit.org>

        URLParser should percent encode the user and password according to spec
        https://bugs.webkit.org/show_bug.cgi?id=162049

        Reviewed by Tim Horton.

        Covered by new API tests based on the web platform tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parseAuthority):

2016-09-16  Alex Christensen  <achristensen@webkit.org>

        Fix more edge cases in URLParser
        https://bugs.webkit.org/show_bug.cgi?id=162051

        Reviewed by Tim Horton.

        Added new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        Some edge case handling was wrong. Also, some of the terminal states are not possible
        to reach because we transition to those states without incrementing the iterator.

2016-09-16  Alex Christensen  <achristensen@webkit.org>

        Fix Windows clean build after r205929

        * DerivedSources.cpp:

2016-09-16  Jer Noble  <jer.noble@apple.com>

        [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-timestamp-offset.html
        https://bugs.webkit.org/show_bug.cgi?id=162038

        Reviewed by Eric Carlson.

        The timestampOffset property is no longer specified as an 'unrestricted' double.

        * Modules/mediasource/SourceBuffer.idl:

2016-09-16  Per Arne Vollan  <pvollan@apple.com>

        [Win] Compile fix.
        https://bugs.webkit.org/show_bug.cgi?id=162059

        Reviewed by Alex Christensen.

        If an include file exists in two places in the include paths, we can end up including the file twice,
        since #pragma once will not protect us against this.

        * PlatformWin.cmake: Put WebCore forwarding folder first in include list.

2016-09-16  Chris Dumez  <cdumez@apple.com>

        Cloning a textarea does not clone the textarea's value
        https://bugs.webkit.org/show_bug.cgi?id=156637

        Reviewed by Ryosuke Niwa.

        Update WebKit so that cloning a textarea element also clones its value.
        This matches the HTML specification after:
        - https://github.com/whatwg/html/pull/1784

        The new behavior also matches Chrome and Edge.

        Test: imported/w3c/web-platform-tests/html/semantics/forms/the-textarea-element/cloning-steps.html

        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::copyNonAttributePropertiesFromElement):
        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::copyNonAttributePropertiesFromElement):
        * html/HTMLTextAreaElement.h:

2016-09-16  Jer Noble  <jer.noble@apple.com>

        [media-source] Only fire 'resize' events when new sized frame is displayed, not parsed.
        https://bugs.webkit.org/show_bug.cgi?id=162039

        Reviewed by Eric Carlson.

        Fixes tests: imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-av-framesize.html
                     imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-v-framesize.html

        Currently, the SourceBufferPrivateAVFObjC will signal a size change as soon as the sample is
        parsed during appendData(). This is incorrect, as the intrinsic size of the video element
        should be based on when the sample is displayed, and it causes some W3C test cases to fail.
        Set a boundary time observer on the player's synchronizer at each sample's presentation time
        where that sample signals a change in intrinsic size. Flush those observers whenever the
        samples are flushed un-displayed (typically, during a seek). Because the observer callback
        may have already been issued (but not executed) at a flush, use a separate weak pointer
        factory, and invalidate all outstanding size change observer weak pointers when flushing.

        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::reenqueueMediaForTime): When re-enqueing, enqueue the next decodable
            sample, even if it doesn't include the current time. This handles cases where the current
            time is 0, and the first video sample starts at 0.033.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::flushPendingSizeChanges):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeChanged): Deleted.
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
        (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
        (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):

2016-09-16  Alex Christensen  <achristensen@webkit.org>

        Fix Windows clean build after r205929

        * DerivedSources.cpp:

2016-09-16  Jer Noble  <jer.noble@apple.com>

        [media-source] ASAN crash running imported/w3c/web-platform-tests/media-source/mediasource-remove.html
        https://bugs.webkit.org/show_bug.cgi?id=162050

        Reviewed by Brent Fulgham.

        SampleMap::removeSample() was accessing the passed-in sample after removing it from its own storage. If
        the SampleMap held the last reference to the sample, it would end up acessing freed memory. Fix the
        post-removal access, but also ensure that the caller, SourceBuffer::removeCodedFrames(), retains the
        sample it passes into removeSample().

        * Modules/mediasource/SampleMap.cpp:
        (WebCore::SampleMap::removeSample):
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::removeCodedFrames):

2016-09-16  Javier Fernandez  <jfernandez@igalia.com>

        [GTK] Unreviewed build fix after r206007.
        https://bugs.webkit.org/show_bug.cgi?id=162058

        * css/parser/CSSParserFastPaths.cpp:
        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):

2016-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>

        [TextureMapper] Scrolling through 01.org/dleyna crashes WebKitWebProcess
        https://bugs.webkit.org/show_bug.cgi?id=162020

        Reviewed by Žan Doberšek.

        The problem is that we are trying to clone a ReferenceFilterOperation, which is not expected to be cloned, from
        FilterAnimationValue copy constructor, and FilterOperations are never expected to be nullptr, so we end up
        crashing. We just need to validate the filters before setting then and before creating a TextureMapperAnimation
        for them.

        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
        (WebCore::GraphicsLayerTextureMapper::filtersCanBeComposited): Return false if there are reference filters or no
        filters at all. I don't know if we really support other filters, but at least we won't crash for the others.
        (WebCore::GraphicsLayerTextureMapper::addAnimation): Check if filters can be composited before creating a
        TextureMapperAnimation.
        (WebCore::GraphicsLayerTextureMapper::setFilters): Check if filters can be composited before setting them.
        * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::filtersCanBeComposited): Return false if there are reference filters or no
        filters at all. I don't know if we really support other filters, but at least we won't crash for the others.
        (WebCore::CoordinatedGraphicsLayer::setFilters): Check if filters can be composited before setting them.
        (WebCore::CoordinatedGraphicsLayer::addAnimation): Check if filters can be composited before creating a
        TextureMapperAnimation.
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

2016-09-16  Youenn Fablet  <youenn@apple.com>

        CachedFont do not need to be updated according Origin/Fetch mode
        https://bugs.webkit.org/show_bug.cgi?id=161909

        Reviewed by Sam Weinig.

        No change of behavior.

        * loader/cache/CachedFont.h: Ensuring CachedFont is not reused.
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Doing direct reuse for CachedFont as WebKit is ignoring CORS for all fonts related stuff.

2016-09-16  Youenn Fablet  <youenn@apple.com>

        CachedResource should efficiently construct its ResourceRequest
        https://bugs.webkit.org/show_bug.cgi?id=161609

        Reviewed by Sam Weinig.

        Covered by existing tests.

        Making CachedResourceLoader take a CachedResourceRequest&& when being asked to load resources.
        Making CachedResource et al take a CachedResourceRequest&& as constructor parameter.

        CachedResource now sets its options at construction time instead of load time.
        This may change some specific behaviors, for instance when loading manually images.

        Made some refactoring when both the resource and request are needed, for ResourceTimingInformation.
        Made local copies of some CachedResourceRequest fields so that we do not need it after being WTFMoved.
        Some of these properties may be put outside CachedResourceRequest in a later refactoring step.

        * css/CSSFontFaceSrcValue.cpp:
        (WebCore::CSSFontFaceSrcValue::cachedFont):
        * css/CSSImageSetValue.cpp:
        (WebCore::CSSImageSetValue::loadBestFitImage):
        * css/CSSImageValue.cpp:
        (WebCore::CSSImageValue::loadImage):
        * css/StyleRuleImport.cpp:
        (WebCore::StyleRuleImport::requestStyleSheet):
        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::checkStyleSheet):
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::requestScriptWithCache):
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::process):
        * html/parser/HTMLResourcePreloader.cpp:
        (WebCore::HTMLResourcePreloader::preload):
        * loader/CrossOriginPreflightChecker.cpp:
        (WebCore::CrossOriginPreflightChecker::startPreflight):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::startLoadingMainResource):
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::loadRequest):
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::updateFromElement):
        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::preloadIfNeeded):
        (WebCore::LinkLoader::loadLink):
        * loader/MediaResourceLoader.cpp:
        (WebCore::MediaResourceLoader::requestResource):
        * loader/ResourceTimingInformation.cpp:
        (WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation):
        * loader/ResourceTimingInformation.h:
        * loader/TextTrackLoader.cpp:
        (WebCore::TextTrackLoader::load):
        * loader/cache/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
        * loader/cache/CachedCSSStyleSheet.h:
        * loader/cache/CachedFont.cpp:
        (WebCore::CachedFont::CachedFont):
        (WebCore::CachedFont::load):
        (WebCore::CachedFont::beginLoadIfNeeded):
        * loader/cache/CachedFont.h:
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::CachedImage):
        (WebCore::CachedImage::load):
        * loader/cache/CachedImage.h:
        * loader/cache/CachedRawResource.cpp:
        (WebCore::CachedRawResource::CachedRawResource):
        * loader/cache/CachedRawResource.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::CachedResource):
        (WebCore::CachedResource::load):
        (WebCore::CachedResource::loadFrom):
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::resourceRequest):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::createResource):
        (WebCore::CachedResourceLoader::requestImage):
        (WebCore::CachedResourceLoader::requestFont):
        (WebCore::CachedResourceLoader::requestTextTrack):
        (WebCore::CachedResourceLoader::requestCSSStyleSheet):
        (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
        (WebCore::CachedResourceLoader::requestScript):
        (WebCore::CachedResourceLoader::requestXSLStyleSheet):
        (WebCore::CachedResourceLoader::requestSVGDocument):
        (WebCore::CachedResourceLoader::requestLinkResource):
        (WebCore::CachedResourceLoader::requestMedia):
        (WebCore::CachedResourceLoader::requestRawResource):
        (WebCore::CachedResourceLoader::requestMainResource):
        (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
        (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
        (WebCore::CachedResourceLoader::requestResource):
        (WebCore::CachedResourceLoader::revalidateResource):
        (WebCore::CachedResourceLoader::loadResource):
        (WebCore::CachedResourceLoader::reloadImagesIfNotDeferred):
        (WebCore::CachedResourceLoader::preload):
        (WebCore::CachedResourceLoader::checkForPendingPreloads):
        (WebCore::CachedResourceLoader::requestPreload):
        * loader/cache/CachedResourceLoader.h:
        * loader/cache/CachedSVGDocument.cpp:
        (WebCore::CachedSVGDocument::CachedSVGDocument):
        * loader/cache/CachedSVGDocument.h:
        * loader/cache/CachedSVGDocumentReference.cpp:
        (WebCore::CachedSVGDocumentReference::load):
        * loader/cache/CachedSVGFont.cpp:
        (WebCore::CachedSVGFont::CachedSVGFont):
        * loader/cache/CachedSVGFont.h:
        * loader/cache/CachedScript.cpp:
        (WebCore::CachedScript::CachedScript):
        * loader/cache/CachedScript.h:
        * loader/cache/CachedTextTrack.cpp:
        (WebCore::CachedTextTrack::CachedTextTrack):
        * loader/cache/CachedTextTrack.h:
        * loader/cache/CachedXSLStyleSheet.cpp:
        (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
        (WebCore::CachedXSLStyleSheet::didAddClient):
        * loader/cache/CachedXSLStyleSheet.h:
        * loader/icon/IconLoader.cpp:
        (WebCore::IconLoader::startLoading):
        * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
        (WebCore::WebCoreAVCFResourceLoader::startLoading):
        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
        (WebCore::WebCoreAVFResourceLoader::startLoading):
        * svg/SVGFEImageElement.cpp:
        (WebCore::SVGFEImageElement::requestImageResource):
        * svg/SVGFontFaceUriElement.cpp:
        (WebCore::SVGFontFaceUriElement::loadFont):
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::updateExternalDocument):
        * xml/XSLImportRule.cpp:
        (WebCore::XSLImportRule::loadSheet):

2016-09-16  Youenn Fablet  <youenn@apple.com>

        [Fetch API] Headers should be combine with ',' and not ', '
        https://bugs.webkit.org/show_bug.cgi?id=161736

        Reviewed by Sam Weinig.

        Covered by updated tests and http/tests/xmlhttprequest/check-combining-headers.html.

        * loader/CrossOriginAccessControl.cpp:
        (WebCore::createAccessControlPreflightRequest): Combining with ',' for Access-Control-Request-Headers
        * platform/network/HTTPHeaderMap.cpp:
        (HTTPHeaderMap::add): Combining with ','

2016-09-16  Youenn Fablet  <youenn@apple.com>

        Custom promise-returning functions should not throw if callee has not the expected type
        https://bugs.webkit.org/show_bug.cgi?id=162011

        Reviewed by Sam Weinig.

        Covered by added test.

        Updating code generator to handle this case.
        Cleaning related getUserMedia implementation.

        * CMakeLists.txt: Removing Modules/mediastream/MediaDevices.js.
        * DerivedSources.make: Removing Modules/mediastream/MediaDevices.js.
        * Modules/mediastream/MediaDevices.idl: Cleaning IDL definition
        * Modules/mediastream/MediaDevices.js: Removing error throwing and so removing file.
        * Modules/mediastream/NavigatorUserMedia.js: getUsermMediaFromJS to getUserMedia.
        * WebCore.xcodeproj/project.pbxproj: Removing Modules/mediastream/MediaDevices.js.
        * bindings/js/JSDOMPromise.cpp:
        (WebCore::createRejectedPromiseWithTypeError): Helper routine.
        * bindings/js/JSDOMPromise.h:
        * bindings/js/WebCoreBuiltinNames.h: getUsermMediaFromJS to getUserMedia.
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation): Rejecting promise in case of failing castedThis, but only for custom functions since
        they are handled differently for non custom methods.
        (GenerateFunctionCastedThis):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestObj.h:
        * bindings/scripts/test/TestObj.idl: Adding custom promise test.

2016-09-16  Youenn Fablet  <youenn@apple.com>

        Link loader should use FetchOptions::mode according its crossOrigin attribute
        https://bugs.webkit.org/show_bug.cgi?id=161859

        Reviewed by Sam Weinig.

        Tests: http/tests/security/cached-cross-origin-preloaded-css-stylesheet.html
               http/tests/security/cached-cross-origin-preloading-css-stylesheet.html

        Setting fetch mode according crossorigin attribute for link preload elements.
        This allows calling onerror callback for CORS failures, which was not the case before the patch.

        Making cached CSS stylesheet reusable accross origins and fetch modes.

        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::preloadIfNeeded): Using CachedResourceRequest::setAsPotentiallyCrossOrigin to set fetch mode.
        * loader/cache/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::sheetText): clean-up.
        (WebCore::CachedCSSStyleSheet::setBodyDataFrom): Implementing data init for cached css stylesheets.
        * loader/cache/CachedCSSStyleSheet.h:
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Activating update support for stylesheets.
        (WebCore::CachedResourceLoader::requestResource): Fixing for matching cached resources that need being reloaded due to different origin/fetch mode.

2016-09-16  Youenn Fablet  <youenn@apple.com>

        [Fetch API] Referrer and Origin header should not be considered as safe request headers
        https://bugs.webkit.org/show_bug.cgi?id=161902

        Reviewed by Sam Weinig.

        Test: http/tests/fetch/fetch-cors-with-referrer.html and updated WPT tests.

        Removing Origin and Referrer from safe request headers.
        Making referrer header setting after preflight for fetch API code path.

        Ensuring that no ThreadableLoader client sets Origin or Referrer headers of the ResourceRequest, as they should use the proper mechanisms for that.

        Handling no-referrer referrer special value by setting the referrer-policy to NoReferrer in FetchLoader.

        * Modules/fetch/FetchLoader.cpp:
        (WebCore::FetchLoader::start): Computing referrer value and handling special "client"and "no-referrer" cases.
        Passing the value directly to ThreadableLoader.
        * Modules/fetch/FetchRequest.cpp:
        (WebCore::FetchRequest::internalRequest): Removing setting of ResourceRequest referrer header.
        (WebCore::FetchRequest::clone): Removing obsolete FIXME.
        * Modules/fetch/FetchRequest.h:
        * loader/CrossOriginAccessControl.cpp:
        (WebCore::isOnAccessControlSimpleRequestHeaderWhitelist): Removing Origin and Referrer headers.
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::create): Updated to take a referrer as parameter.
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Ditto.
        * loader/DocumentThreadableLoader.h: Ditto.
        * loader/ThreadableLoader.cpp: Ditto.
        (WebCore::ThreadableLoader::create): Ditto.
        * loader/ThreadableLoader.h: Ditto.
        * loader/WorkerThreadableLoader.cpp: Ditto.
        (WebCore::WorkerThreadableLoader::WorkerThreadableLoader): Ditto.
        (WebCore::WorkerThreadableLoader::loadResourceSynchronously): Ditto.
        * loader/WorkerThreadableLoader.h: Ditto.
        (WebCore::WorkerThreadableLoader::create): Ditto.
        * platform/network/ResourceRequestBase.cpp:
        (WebCore::ResourceRequestBase::hasHTTPReferrer): Added to enable asserting that no threadable loader client sets the referrer in the request.
        * platform/network/ResourceRequestBase.h:

2016-09-15  Dave Hyatt  <hyatt@apple.com>

        [CSS Parser] Get CSSParserFastPaths.cpp compiling
        https://bugs.webkit.org/show_bug.cgi?id=162033

        Reviewed by Dean Jackson.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        Add new StyleColor.h/.cpp files to the projecty

        * css/CSSFunctionValue.cpp:
        (WebCore::CSSFunctionValue::CSSFunctionValue):
        (WebCore::CSSFunctionValue::customCSSText):
        (WebCore::CSSFunctionValue::append):
        (WebCore::CSSFunctionValue::buildParserValueSubstitutingVariables):
        * css/CSSFunctionValue.h:
        Tweak CSSFunctionValue so that the name can be represented as a keyword ID instead of a String. Eventually we also
        want to make CSSFunctionValue subclass CSSValueList rather than referencing a separate CSSValueList as a member. For now
        I left that alone though in order to not change too much in the old parser.

        * css/CSSProperty.cpp:
        (WebCore::CSSProperty::isDescriptorOnly):
        Whether or not a property is only a descriptor, e.g., used in viewport and font face stuff.

        * css/CSSProperty.h:
        * css/CSSValueKeywords.in:
        Added new keywords for functions that can be used as values. The new parser uses keywords to represent function names.

        * css/StyleColor.cpp: Added.
        (WebCore::StyleColor::colorFromKeyword):
        (WebCore::StyleColor::isColorKeyword):
        (WebCore::StyleColor::isSystemColor):
        * css/StyleColor.h: Added.
        (WebCore::StyleColor::StyleColor):
        (WebCore::StyleColor::currentColor):
        (WebCore::StyleColor::isCurrentColor):
        (WebCore::StyleColor::getColor):
        (WebCore::StyleColor::resolve):
        (WebCore::operator==):
        (WebCore::operator!=):
        New color helper that contains code for checking and looking up colors. This code is similar to some code we already
        had in the old CSSParser.cpp file, but this way it can be used outside the parser and/or in different files.

        * css/parser/CSSParserFastPaths.cpp:
        (WebCore::parseSimpleLengthValue):
        (WebCore::isColorPropertyID):
        (WebCore::parseColorIntOrPercentage):
        (WebCore::fastParseColorInternal):
        (WebCore::CSSParserFastPaths::parseColor):
        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
        (WebCore::isUniversalKeyword):
        (WebCore::parseKeywordValue):
        (WebCore::parseTransformTranslateArguments):
        (WebCore::parseTransformNumberArguments):
        (WebCore::parseSimpleTransformValue):
        (WebCore::transformCanLikelyUseFastPath):
        (WebCore::parseSimpleTransformList):
        (WebCore::parseSimpleTransform):
        (WebCore::CSSParserFastPaths::maybeParseValue):
        * css/parser/CSSParserFastPaths.h:
        Get everything compiling in this file. Key changes included reverting to our old unit names, making CSSFunctionValue compatible,
        adding support for StyleColor, adding support for mode checking of keywords, and fixing up the memory management model so that
        RefPtrs are used on returns from parsing functions.

        * css/parser/CSSParserIdioms.cpp:
        (WebCore::isValueAllowedInMode):
        * css/parser/CSSParserIdioms.h:
        New helper function for restricting keywords to certain modes only. The -webkit-text color quirk has been moved to this function.

2016-09-15  Brady Eidson  <beidson@apple.com>

        WKWebView.hasOnlySecureContent always returns "YES" after going back to a CachedPage (even if it has http resources).
        <rdar://problem/27681261> and https://bugs.webkit.org/show_bug.cgi?id=162043

        Reviewed by Brent Fulgham. 

        No new tests (Not possible with current testing infrastructure).

        This adds the infrastructure for WebCore to track whether or not a CachedFrame had insecure content at the time
        it was cached, and then to report that back to the client when a CachedPage is restored.

        Since "has insecure content" is currently only tracked in the WK2 UI process, that is the only client of this code.

        * history/CachedFrame.cpp:
        (WebCore::CachedFrame::setHasInsecureContent):
        * history/CachedFrame.h:
        (WebCore::CachedFrame::hasInsecureContent):

        * loader/EmptyClients.h:

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::receivedFirstData):
        (WebCore::FrameLoader::commitProvisionalLoad):
        (WebCore::FrameLoader::dispatchDidCommitLoad):
        * loader/FrameLoader.h:

        * loader/FrameLoaderClient.h:

        * loader/FrameLoaderTypes.h:

2016-09-13  Jer Noble  <jer.noble@apple.com>

        [media-source] web-platform-test/media-source/mediasource-remove.html test failing
        https://bugs.webkit.org/show_bug.cgi?id=161950

        Reviewed by Eric Carlson.

        Fixes test: web-platform-test/media-source/mediasource-remove.html

        The mediasource-remove.html test was failing in a number of ways:

        - Tests with invalid start or end times were not throwing the correct exception
          code, or not throwing exception codes at all

        - Tests were showing an incorrect start buffered range at the beginning of each test.

        - Tests which removed samples were not getting the expected buffered values at the end
          each test.

        For the exception failures, update the implementation of abort() and remove() to throw
        the correct exceptions at the correct times.

        For the incorrect initial buffered range, update our buffered calculations to store
        individual PlatformTimeRanges on each TrackBuffer, and coalesce them into a single
        value when an append operation completes, a remove operation completes, or when the
        MediaSource's ready state changes.

        For the incorrect buffered ranges after removal, this is caused because the "samples"
        that make up an audio track are actually a collection of a large number of individual
        samples.  So when we are asked to remove media data in a given range, break these audio
        meta-samples into two pieces at the removal points. This allows the removal algorithm
        to operate on a individual audio sample basis. (We should look into using this technique
        when audio samples are evicted during an append operation.) This requires adding some
        methods to MediaSample and it's concrete subclasses to "divide" a sample into two at
        a given presentation time.

        Fixing these behaviors, however, breaks the media-source-end-of-stream-buffered.html
        test, which expects the buffered range for the entire element to expand to the maximum
        buffered time of any of the element's MediaSource's active sourceBuffers. To fix this,
        update the MediaSource's monitorSourceBuffer() implementation to match the current
        specification. The new spec no longer queries the individual SourceBuffers, but rather
        queries the already coalesced buffered ranges. So move the helper methods hasCurrentTime()
        hasFutureTime(), and canPlayThrough() up into MediaSource from SourceBuffer. Also, update
        seekToTime, since it has the same problem as monitorSourceBuffer().

        However, this breaks the media-source-monitor-source-buffers.html test, which appends
        10s of movie data instantaneously, then never appends again. The SourceBuffer's
        monitorBufferingRate() method only re-evaluates the rate after data has been appended,
        so the SourceBuffer thinks it's buffered data at a prodigious rate forever. Instead,
        allow the SourceBuffer to continuously re-evalute it's buffering rate by modifying the
        exponential moving average so that the co-efficient scales based on how frequently the
        method is called. Call the method more often, and the moving average changes less quickly,
        and it means that when media is stalled out at the end of a buffered range, the readyState
        of a video element will eventually drop to HAVE_CURRENT_DATA when the average buffering
        rate falls below the level where playback would continue uninterrupted.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::seekToTime):
        (WebCore::MediaSource::currentTimeFudgeFactor):
        (WebCore::MediaSource::hasBufferedTime):
        (WebCore::MediaSource::hasCurrentTime):
        (WebCore::MediaSource::hasFutureTime):
        (WebCore::MediaSource::monitorSourceBuffers):
        * Modules/mediasource/MediaSource.h:
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::abort):
        (WebCore::SourceBuffer::remove):
        (WebCore::SourceBuffer::abortIfUpdating):
        (WebCore::SourceBuffer::removeCodedFrames):
        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
        (WebCore::SourceBuffer::updateBufferedFromTrackBuffers):
        (WebCore::SourceBuffer::canPlayThroughRange):
        (WebCore::SourceBuffer::monitorBufferingRate):
        (WebCore::currentTimeFudgeFactor): Deleted.
        (WebCore::SourceBuffer::hasCurrentTime): Deleted.
        (WebCore::SourceBuffer::hasFutureTime): Deleted.
        (WebCore::SourceBuffer::canPlayThrough): Deleted.
        * platform/MediaSample.h:
        * platform/cf/CoreMediaSoftLink.cpp:
        * platform/cf/CoreMediaSoftLink.h:
        * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
        (WebCore::MediaSampleAVFObjC::isDivisable):
        (WebCore::MediaSampleAVFObjC::divide):
        * platform/mock/mediasource/MockSourceBufferPrivate.cpp:

2016-09-15  Zalan Bujtas  <zalan@apple.com>

        ASSERTION FAILED: willBeComposited == needsToBeComposited(layer) in WebCore::RenderLayerCompositor::computeCompositingRequirements
        https://bugs.webkit.org/show_bug.cgi?id=151097
        <rdar://problem/27711678>

        Reviewed by Simon Fraser.

        This patch ensures that when will-change property triggers stacking context, we make the associated layer a non-normal flow layer.
        (This is similar to what any other stacking context-triggering CSS property does.)  

        Test: compositing/assert-on-will-change-transform-with-composited-descendant.html

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

2016-09-15  Zalan Bujtas  <zalan@apple.com>

        Move RenderObject::shouldRespectImageOrientation to RenderElement.
        https://bugs.webkit.org/show_bug.cgi?id=162028

        Reviewed by Antti Koivisto.

        Tighten the type for imageSizeForRenderer/canRender so that RenderObject::shouldRespectImageOrientation could
        be moved to RenderElement.

        No change in functionality.

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::imageSizeForRenderer):
        * loader/cache/CachedImage.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::shouldRespectImageOrientation):
        * rendering/RenderElement.h:
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::shouldRespectImageOrientation): Deleted.
        * rendering/RenderObject.h:
        * rendering/style/StyleCachedImage.cpp:
        (WebCore::StyleCachedImage::canRender):
        * rendering/style/StyleCachedImage.h:
        * rendering/style/StyleImage.h:
        (WebCore::StyleImage::canRender):

2016-09-15  Anders Carlsson  <andersca@apple.com>

        Fix build.

        * platform/spi/cocoa/PassKitSPI.h:

2016-09-15  Alex Christensen  <achristensen@webkit.org>

        Use character class table in URLParser
        https://bugs.webkit.org/show_bug.cgi?id=161997

        Reviewed by Chris Dumez.

        No change in behavior except a performance improvement.
        
        Before this change, URLParser took 1.514x as long to run my URL Parsing benchmark as URL::parse
        with a standard deviation of the ration of the runtimes of 0.063 after 8 runs with each parser.
        After this change, URLParser took 1.328x as long with a standard deviation of 0.037.
        This isn't the cleanest data, but it's enough to convince me that this is a significant improvement.

        * platform/URLParser.cpp:
        (WebCore::isC0Control):
        (WebCore::isC0ControlOrSpace):
        (WebCore::isTabOrNewline):
        (WebCore::isInSimpleEncodeSet):
        (WebCore::isInDefaultEncodeSet):
        (WebCore::isInUserInfoEncodeSet):
        (WebCore::isInvalidDomainCharacter):
        (WebCore::isSlashQuestionOrHash):
        (WebCore::shouldPercentEncodeQueryByte):
        (WebCore::shouldCopyFileURL):
        (WebCore::isSingleDotPathSegment):
        (WebCore::URLParser::parse):

2016-09-15  Keith Miller  <keith_miller@apple.com>

        Pragma out undefined-var-template warnings in JSC for JSObjects that are templatized
        https://bugs.webkit.org/show_bug.cgi?id=161985

        Reviewed by Alex Christensen.

        Delete unneeded using, which broke the build on newer versions of clang.

        * bridge/objc/WebScriptObject.mm:

2016-09-15  Alex Christensen  <achristensen@webkit.org>

        URLParser: Check for invalid characters in the host
        https://bugs.webkit.org/show_bug.cgi?id=162023

        Reviewed by Tim Horton.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::failure):
        (WebCore::URLParser::parseHost):

2016-09-15  Antti Koivisto  <antti@apple.com>

        Remove some extra spaces.

        * rendering/TextDecorationPainter.cpp:
        (WebCore::collectStylesForRenderer):

2016-09-15  Alex Christensen  <achristensen@webkit.org>

        Use efficient iterators in URLParser
        https://bugs.webkit.org/show_bug.cgi?id=162007

        Reviewed by Tim Horton.

        URLParser used to use StringView::CodePoints::Iterator, which needs to check if
        the StringView is 8-bit or 16-bit every time it does anything.
        I wrote a new CodePointIterator template which already knows whether it is iterating
        8-bit or 16-bit characters, so it does not need to do the checks each time it gets a
        code point or advances to the next code point.

        No change in behavior except a performance increase.
        Covered by existing tests.

        * platform/URLParser.cpp:
        (WebCore::CodePointIterator::CodePointIterator):
        (WebCore::CodePointIterator::operator==):
        (WebCore::CodePointIterator::operator!=):
        (WebCore::CodePointIterator::operator=):
        (WebCore::CodePointIterator::atEnd):
        (WebCore::CodePointIterator<LChar>::operator):
        (WebCore::CodePointIterator<UChar>::operator):
        (WebCore::isWindowsDriveLetter):
        (WebCore::shouldCopyFileURL):
        (WebCore::isPercentEncodedDot):
        (WebCore::isSingleDotPathSegment):
        (WebCore::isDoubleDotPathSegment):
        (WebCore::consumeSingleDotPathSegment):
        (WebCore::consumeDoubleDotPathSegment):
        (WebCore::URLParser::failure):
        (WebCore::URLParser::parse):
        (WebCore::URLParser::parseAuthority):
        (WebCore::parseIPv4Number):
        (WebCore::parseIPv4Host):
        (WebCore::parseIPv6Host):
        (WebCore::URLParser::parsePort):
        (WebCore::URLParser::parseHost):
        * platform/URLParser.h:

2016-09-14  Antti Koivisto  <antti@apple.com>

        Move text decoration style computation from RenderObject to TextDecorationPainter
        https://bugs.webkit.org/show_bug.cgi?id=162004

        Reviewed by Zalan Bujtas.

        It is mostly an implementation detail of TextDecorationPainter.

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (AXAttributeStringSetStyle):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (AXAttributeStringSetStyle):
        * rendering/RenderObject.cpp:
        (WebCore::decorationColor): Deleted.
        (WebCore::RenderObject::getTextDecorationColorsAndStyles): Deleted.
        * rendering/RenderObject.h:
        * rendering/TextDecorationPainter.cpp:
        (WebCore::TextDecorationPainter::TextDecorationPainter):
        (WebCore::TextDecorationPainter::paintTextDecoration):
        (WebCore::decorationColor):
        * rendering/TextDecorationPainter.h:

2016-09-15  Dave Hyatt  <hyatt@apple.com>

        [CSS Parser] Make stylesheets parse using the new parser if the setting is enabled
        https://bugs.webkit.org/show_bug.cgi?id=162018

        Reviewed by Zalan Bujtas.

        * css/parser/CSSParser.cpp:
        (WebCore::CSSParserContext::CSSParserContext):
        (WebCore::CSSParser::parseSheet):
        * css/parser/CSSParserMode.h:

2016-09-15  Fujii Hironori  <Hironori.Fujii@sony.com>

        [CMake] Refactor GENERATE_BINDINGS
        https://bugs.webkit.org/show_bug.cgi?id=161854

        Reviewed by Gyuyoung Kim.

        * CMakeLists.txt: Changed the arguments of GENERATE_BINDINGS to
        new style.  Removed add_custom_command of preprocess-idls.pl which
        is moved to GENERATE_BINDINGS.  Moved IDL_ATTRIBUTES_FILE into
        GENERATE_BINDINGS.

2016-09-14  Anders Carlsson  <andersca@apple.com>

        Add CSS -webkit-appearance property for Apple Pay buttons
        https://bugs.webkit.org/show_bug.cgi?id=161986
        rdar://problem/27459216

        Reviewed by Dean Jackson.

        Add a new -webkit-appearance property, "-apple-pay-button".
        Also, add two properties, "-apple-pay-button-type" and "-apple-pay-button-style".

        * WebCore.xcodeproj/project.pbxproj:
        Add RenderThemeCocoa.h and RenderThemeCocoa.mm.

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::propertyValue):
        Handle CSSPropertyApplePayButtonStyle and CSSPropertyApplePayButtonType.

        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator ApplePayButtonStyle):
        (WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
        Add ApplePayButtonStyle and ApplePayButtonType conversion routines.

        * css/CSSPropertyNames.in:
        Add -apple-pay-button-style and -apple-pay-button-type.

        * css/CSSValueKeywords.in:
        Add CSS values.

        * css/parser/CSSParser.cpp:
        (WebCore::isValidKeywordPropertyAndValue):
        Handle CSSPropertyApplePayButtonStyle and CSSPropertyApplePayButtonType.

        * css/parser/CSSParserFastPaths.cpp:
        (WebCore::CSSParserFastPaths::isKeywordPropertyID):
        Handle CSSPropertyApplePayButtonStyle and CSSPropertyApplePayButtonType.

        (WebCore::isAppleLegacyCSSPropertyKeyword):
        New function that returns whether the CSS property should be rewritten to -webkit-.
        We want to rewrite -apple- but not -apple-pay-.

        (WebCore::cssPropertyID):
        Use the newly added isAppleLegacyCSSPropertyKeyword.

        (WebCore::isAppleLegacyCSSValueKeyword):
        Check for "-apple-pay-" in addition to "-apple-system-".

        * platform/ThemeTypes.h:
        Add ApplePayButtonPart.

        * platform/spi/cocoa/PassKitSPI.h:
        Add PKDrawApplePayButton declaration.

        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::adjustStyle):
        Handle ApplePayButtonPart.

        (WebCore::RenderTheme::paint):
        Handle ApplePayButtonPart.

        * rendering/RenderTheme.h:
        (WebCore::RenderTheme::adjustApplePayButtonStyle):
        (WebCore::RenderTheme::paintApplePayButton):
        Add new functions.

        * rendering/RenderThemeCocoa.h: Added.
        * rendering/RenderThemeCocoa.mm: Added.
        (WebCore::RenderThemeCocoa::adjustApplePayButtonStyle):
        Adjust the minimum width and minimum height accordingly.

        (WebCore::toPKPaymentButtonStyle):
        (WebCore::toPKPaymentButtonType):
        Helper functions that convert our WebCore types to PK types.

        (WebCore::RenderThemeCocoa::paintApplePayButton):
        Call PKDrawApplePayButton.

        * rendering/RenderThemeIOS.h:
        * rendering/RenderThemeMac.h:
        Inherit from RenderThemeCocoa.

        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::applePayButtonStyle):
        (WebCore::RenderStyle::applePayButtonType):
        (WebCore::RenderStyle::setApplePayButtonStyle):
        (WebCore::RenderStyle::setApplePayButtonType):
        (WebCore::RenderStyle::initialApplePayButtonStyle):
        (WebCore::RenderStyle::initialApplePayButtonType):
        * rendering/style/RenderStyleConstants.h:
        * rendering/style/StyleRareInheritedData.cpp:
        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
        (WebCore::StyleRareInheritedData::operator==):
        * rendering/style/StyleRareInheritedData.h:
        Add new style members for the button style and button type properties.

2016-09-15  Sergio Villar Senin  <svillar@igalia.com>

        [css-grid] Implement fit-content track size
        https://bugs.webkit.org/show_bug.cgi?id=161379

        Reviewed by Manuel Rego Casasnovas.

        This implements the new <fit-content> track size which is defined as follows: "Represents
        the formula min(max-content, max(auto, argument)), which is calculated similar to auto
        (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is
        greater than the auto minimum."

        From the parsing POV fit-content was implemented as a new type of function which only takes
        one argument. That forced us to refactor some code because minmax() was the only allowed
        function for <track-size>s so far.

        The implementation key is a new attribute in GridTrack called growthLimitCap which is
        precisely the single attribute of fit-content(). Some parts of the track sizing algorithm
        were adapted to this change like for example the sorting of tracks by growth potential (we
        need to consider the caps).

        Tests: fast/css-grid-layout/fit-content-columns.html
        fast/css-grid-layout/fit-content-rows.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::specifiedValueForGridTrackSize): Added support for fit-content sizes.
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::createGridTrackSize): Added support for fit-content sizes.
        * css/parser/CSSParser.cpp:
        (WebCore::isGridTrackFixedSized): Added support for fit-content sizes.
        (WebCore::CSSParser::parseGridTrackSize): Added support for parsing fit-content() functions.
        * css/parser/CSSPropertyParser.cpp: Added support for parsing fit-content() functions so
        it'll be available once we switch to the new parser.
        * rendering/RenderGrid.cpp:
        (WebCore::GridTrack::baseSize): Just return a LayoutUnit, the return value optimization will
        keep it fast in any case.
        (WebCore::GridTrack::growthLimit): Ditto.
        (WebCore::GridTrack::setGrowthLimit): Added an ASSERT to check that the growth limit is
        never higher than the cap.
        (WebCore::GridTrack::infiniteGrowthPotential):
        (WebCore::GridTrack::plannedSize): Just return a LayoutUnit, the return value optimization will
        keep it fast in any case.
        (WebCore::GridTrack::tempSize): Just return a LayoutUnit, the return value optimization will
        keep it fast in any case.
        (WebCore::GridTrack::setTempSize): Added as we no longer return a reference in tempSize().
        (WebCore::GridTrack::growTempSize): New utility function which increases the tempSize.
        (WebCore::GridTrack::setInfinitelyGrowable):
        (WebCore::GridTrack::setGrowthLimitCap): Added.
        (WebCore::GridTrack::growthLimitCap): Ditto.
        (WebCore::GridTrack::growthLimitIsInfinite): Made private.
        (WebCore::RenderGrid::GridSizingData::freeSpace): Renamed from freeSpaceForDirection.
        (WebCore::RenderGrid::GridSizingData::availableSpace): We now cache the available space as
        it is used to compute relative (percentage) sizes.
        (WebCore::RenderGrid::GridSizingData::setAvailableSpace): Ditto.
        (WebCore::RenderGrid::GridSizingData::setFreeSpace): Renamed from setFreeSpaceForDirection.
        (WebCore::RenderGrid::computeTrackSizesForDirection): Receives the available space instead
        of the free space.
        (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Properly initialize free and available
        spaces.
        (WebCore::RenderGrid::computeIntrinsicLogicalHeight): Ditto.
        (WebCore::RenderGrid::computeUsedBreadthOfGridTracks): Use available space to initialize the
        track sizes. Also use sizingOperation to decide whether or not sizes are indefinite. Last
        but not least, added support for fit-content tracks.
        (WebCore::RenderGrid::computeUsedBreadthOfMinLength): Pass a GridTrackSize instead of a GridLength.
        (WebCore::RenderGrid::computeUsedBreadthOfMaxLength): Ditto.
        (WebCore::RenderGrid::gridTrackSize): Added support for fit-content.
        (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Ditto.
        (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): Ditto.
        (WebCore::trackSizeForTrackSizeComputationPhase):
        (WebCore::sortByGridTrackGrowthPotential): Reworked the function so it properly sorts tracks
        with growth limit caps to support fit-content().
        (WebCore::clampGrowthShareIfNeeded): Clamps the given growthShare passed as argument to the
        track growth limit cap.
        (WebCore::RenderGrid::distributeSpaceToTracks): Use the new setTempSize() method. Also sort
        the selected tracks to grow over growth limits in order to respect the track caps eventually
        set by fit-content (otherwise those tracks could indefinitely grow over the specified value).
        (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): Use the new defined functions.
        (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): Use freeSpace().
        (WebCore::RenderGrid::populateGridPositionsForDirection): Ditto.
        (WebCore::GridTrack::infinitelyGrowable): Deleted.
        (WebCore::RenderGrid::GridSizingData::freeSpaceForDirection): Deleted.
        (WebCore::RenderGrid::GridSizingData::setFreeSpaceForDirection): Deleted.
        (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): Deleted.
        * rendering/RenderGrid.h: Changed the signature of some methods. Moved
        TrackSizeComputationPhase out of the RenderGrid class.
        * rendering/style/GridTrackSize.h:
        (WebCore::GridTrackSize::GridTrackSize): Added some extra documentation. Added a new
        attribute to the constructor to support fit-content GridTrackSizes.
        (WebCore::GridTrackSize::fitContentTrackBreadth): New method which returns the growth limit
        cap set by fit-content().
        (WebCore::GridTrackSize::minTrackBreadth):
        (WebCore::GridTrackSize::isFitContent): Added.
        (WebCore::GridTrackSize::length): Deleted.
        (WebCore::GridTrackSize::isPercentage): Deleted.

2016-09-15  Sergio Villar Senin  <svillar@igalia.com>

        [css-grid] Fix a dangling reference
        https://bugs.webkit.org/show_bug.cgi?id=161739

        Reviewed by Alexey Proskuryakov.

        The code was trying to get a reference to a private attribute of a temporary object returned
        by gridTrackSize().

        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild):

2016-09-15  Sergio Villar Senin  <svillar@igalia.com>

        Unreviewed, rolling out r205966.

        Triggered some assertions

        Reverted changeset:

        "[css-grid] Implement fit-content track size"
        https://bugs.webkit.org/show_bug.cgi?id=161379
        http://trac.webkit.org/changeset/205966

2016-09-15  Zalan Bujtas  <zalan@apple.com>

        Cleanup RenderLayer::shouldBeNormalFlowOnly
        https://bugs.webkit.org/show_bug.cgi?id=161981

        Reviewed by Simon Fraser.

        This patch changes the logic of figuring about if a particular layer is normal flow only by simply checking
        if the layer creates a stacking context. If it does, we assume that it can't be a normal flow layer anymore.
        This patch slightly changes behaviour by making layers with isolation and reflection to be non normal flow layers anymore.    

        Covered by existing testcases.

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

2016-09-07  Sergio Villar Senin  <svillar@igalia.com>

        [css-grid] Implement fit-content track size
        https://bugs.webkit.org/show_bug.cgi?id=161379

        Reviewed by Manuel Rego Casasnovas.

        This implements the new <fit-content> track size which is defined as follows: "Represents
        the formula min(max-content, max(auto, argument)), which is calculated similar to auto
        (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is
        greater than the auto minimum."

        From the parsing POV fit-content was implemented as a new type of function which only takes
        one argument. That forced us to refactor some code because minmax() was the only allowed
        function for <track-size>s so far.

        The implementation key is a new attribute in GridTrack called growthLimitCap which is
        precisely the single attribute of fit-content(). Some parts of the track sizing algorithm
        were adapted to this change like for example the sorting of tracks by growth potential (we
        need to consider the caps).

        Tests: fast/css-grid-layout/fit-content-columns.html
        fast/css-grid-layout/fit-content-rows.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::specifiedValueForGridTrackSize): Added support for fit-content sizes.
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::createGridTrackSize): Added support for fit-content sizes.
        * css/parser/CSSParser.cpp:
        (WebCore::isGridTrackFixedSized): Added support for fit-content sizes.
        (WebCore::CSSParser::parseGridTrackSize): Added support for parsing fit-content() functions.
        * css/parser/CSSPropertyParser.cpp: Added support for parsing fit-content() functions so
        it'll be available once we switch to the new parser.
        * rendering/RenderGrid.cpp:
        (WebCore::GridTrack::baseSize): Just return a LayoutUnit, the return value optimization will
        keep it fast in any case.
        (WebCore::GridTrack::growthLimit): Ditto.
        (WebCore::GridTrack::setGrowthLimit): Added an ASSERT to check that the growth limit is
        never higher than the cap.
        (WebCore::GridTrack::infiniteGrowthPotential):
        (WebCore::GridTrack::plannedSize): Just return a LayoutUnit, the return value optimization will
        keep it fast in any case.
        (WebCore::GridTrack::tempSize): Just return a LayoutUnit, the return value optimization will
        keep it fast in any case.
        (WebCore::GridTrack::setTempSize): Added as we no longer return a reference in tempSize().
        (WebCore::GridTrack::growTempSize): New utility function which increases the tempSize.
        (WebCore::GridTrack::setInfinitelyGrowable):
        (WebCore::GridTrack::setGrowthLimitCap): Added.
        (WebCore::GridTrack::growthLimitCap): Ditto.
        (WebCore::GridTrack::growthLimitIsInfinite): Made private.
        (WebCore::RenderGrid::GridSizingData::freeSpace): Renamed from freeSpaceForDirection.
        (WebCore::RenderGrid::GridSizingData::availableSpace): We now cache the available space as
        it is used to compute relative (percentage) sizes.
        (WebCore::RenderGrid::GridSizingData::setAvailableSpace): Ditto.
        (WebCore::RenderGrid::GridSizingData::setFreeSpace): Renamed from setFreeSpaceForDirection.
        (WebCore::RenderGrid::computeTrackSizesForDirection): Receives the available space instead
        of the free space.
        (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Properly initialize free and available
        spaces.
        (WebCore::RenderGrid::computeIntrinsicLogicalHeight): Ditto.
        (WebCore::RenderGrid::computeUsedBreadthOfGridTracks): Use available space to initialize the
        track sizes. Also use sizingOperation to decide whether or not sizes are indefinite. Last
        but not least, added support for fit-content tracks.
        (WebCore::RenderGrid::computeUsedBreadthOfMinLength): Pass a GridTrackSize instead of a GridLength.
        (WebCore::RenderGrid::computeUsedBreadthOfMaxLength): Ditto.
        (WebCore::RenderGrid::gridTrackSize): Added support for fit-content.
        (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Ditto.
        (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): Ditto.
        (WebCore::trackSizeForTrackSizeComputationPhase):
        (WebCore::sortByGridTrackGrowthPotential): Reworked the function so it properly sorts tracks
        with growth limit caps to support fit-content().
        (WebCore::clampGrowthShareIfNeeded): Clamps the given growthShare passed as argument to the
        track growth limit cap.
        (WebCore::RenderGrid::distributeSpaceToTracks): Use the new setTempSize() method. Also sort
        the selected tracks to grow over growth limits in order to respect the track caps eventually
        set by fit-content (otherwise those tracks could indefinitely grow over the specified value).
        (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): Use the new defined functions.
        (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): Use freeSpace().
        (WebCore::RenderGrid::populateGridPositionsForDirection): Ditto.
        (WebCore::GridTrack::infinitelyGrowable): Deleted.
        (WebCore::RenderGrid::GridSizingData::freeSpaceForDirection): Deleted.
        (WebCore::RenderGrid::GridSizingData::setFreeSpaceForDirection): Deleted.
        (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): Deleted.
        * rendering/RenderGrid.h: Changed the signature of some methods. Moved
        TrackSizeComputationPhase out of the RenderGrid class.
        * rendering/style/GridTrackSize.h:
        (WebCore::GridTrackSize::GridTrackSize): Added some extra documentation. Added a new
        attribute to the constructor to support fit-content GridTrackSizes.
        (WebCore::GridTrackSize::fitContentTrackBreadth): New method which returns the growth limit
        cap set by fit-content().
        (WebCore::GridTrackSize::minTrackBreadth):
        (WebCore::GridTrackSize::isFitContent): Added.
        (WebCore::GridTrackSize::length): Deleted.
        (WebCore::GridTrackSize::isPercentage): Deleted.

2016-09-15  Alejandro G. Castro  <alex@igalia.com>

        Fix build warnings in the mediastream code
        https://bugs.webkit.org/show_bug.cgi?id=161957

        Reviewed by Philippe Normand.

        * platform/mediastream/MediaConstraints.cpp:
        (WebCore::MediaConstraint::create): Added assertion and mock return.
        * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
        (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint):
        Added assertion and mock return.
        (WebCore::RealtimeMediaSourceSupportedConstraints::supportsConstraint):
        Added assertion and mock return.

2016-09-15  Youenn Fablet  <youenn@apple.com>

        Rebase binding tests after r205953
        https://bugs.webkit.org/show_bug.cgi?id=162012

        Unreviewed.

        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::jsTestNodePrototypeFunctionTestWorkerPromise):
        (WebCore::jsTestNodePrototypeFunctionTestWorkerPromisePromise):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunction):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):

2016-09-15  Alejandro G. Castro  <alex@igalia.com>

        [WebRTC][OpenWebRTC] crash in maybeHandleChangeMutedState
        https://bugs.webkit.org/show_bug.cgi?id=161619

        Added OpenWebRTC support to the RealtimeMediaSource mock class.

        Reviewed by Eric Carlson.

        Fixed tests.

        * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
        (WebCore::RealtimeMediaSourceOwr::RealtimeMediaSourceOwr): Allowed
        inheritance of the class, required to use it when creating the
        mock class. Added a new constructor to create the class with null
        mediastream.
        * platform/mock/MockRealtimeMediaSource.cpp:
        (WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource): Use
        the new BaseRealtimeMediaSourceClass in the constructor.
        * platform/mock/MockRealtimeMediaSource.h: Added a new
        BaseRealtimeMediaSourceClass defined using the
        RealtimeMediaSourceOwr class for OpenWebRTC platform.

2016-09-15  Sergio Villar Senin  <svillar@igalia.com>

        [css-grid] Fix intrinsic size computation with flexible sized tracks
        https://bugs.webkit.org/show_bug.cgi?id=161903

        Reviewed by Manuel Rego Casasnovas.

        This is fixing a regression added in r192154. When computing the min content size of a grid
        container (min preferred logical width) we should not take into account the fr tracks. As
        stated in the early versions of the spec that size is the sum of the tracks' base sizes
        before running the maximize tracks step.

        That regression was causing sizing issues in grids with fr tracks both when under
        min|max-content constrains and also when used as grid items (in nested grids).

        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):

2016-09-13  Sergio Villar Senin  <svillar@igalia.com>

        [css-grid] Too many gaps with trailing collapsing tracks
        https://bugs.webkit.org/show_bug.cgi?id=161905

        Reviewed by Darin Adler.

        The total number and size of gaps were incorrectly computed whenever there were trailing
        collapsed tracks (with collapsed gaps). The problem was that we were trying to optimize too
        much the amount of hash table queries required to know the gaps between two lines. We were
        considering that a gap always exist between 2 consecutive tracks if the first one is not
        empty. That's generally true (for both NOTEMPTY|NOTEMPTY and NOTEMPTY|EMPTY+|NOTEMPTY
        sequences) but not for all the cases (NOTEMPTY|EMPTY+).

        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::guttersSize):

2016-09-15  Youenn Fablet  <youenn@apple.com>

        callPromiseFunction should be made usable for custom binding code
        https://bugs.webkit.org/show_bug.cgi?id=161961

        Reviewed by Darin Adler.

        Covered by updated test.

        * bindings/js/JSDOMBinding.h:
        (WebCore::castThisValue): Utility function to cast this value to a specific type.
        * bindings/js/JSDOMPromise.h:
        (WebCore::callPromiseFunction): Updated to take real promise function as a template parameter
        for improved efficiency. Added workerMode template parameter.
        (WebCore::bindingPromiseFunctionAdapter): Function signature adaptor.
        * bindings/js/JSMediaDevicesCustom.cpp:
        (WebCore::JSMediaDevicesGetUserMediaPromiseFunction):
        (WebCore::JSMediaDevices::getUserMedia): Making use of callPromiseFunction to properly handle exceptions.
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation): Updated to use template parameter.
        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::jsTestNodePrototypeFunctionTestWorkerPromise):
        (WebCore::jsTestNodePrototypeFunctionTestWorkerPromisePromise):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunction):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException):
        * bindings/scripts/test/TestNode.idl: Adding Worker promise binding test.

2016-09-14  Jiewen Tan  <jiewen_tan@apple.com>

        WebCrypto algorithms should be exposed via KeyAlgorithm dictionary
        https://bugs.webkit.org/show_bug.cgi?id=128748
        <rdar://problem/27359438>

        Reviewed by Brent Fulgham and Chris Dumez.

        Replace custom CryptoAlgorithmBuilder/buildAlgorithmDescription with KeyAlgorithm dictionary which is
        defined by the spec: https://www.w3.org/TR/WebCryptoAPI/#key-algorithm-dictionary. Moreover, mark
        CryptoKey.usages as CachedAttribute.

        Tests: crypto/subtle/crypto-key-algorithm-gc.html
               crypto/subtle/crypto-key-usages-gc.html

        * PlatformEfl.cmake:
        * PlatformGTK.cmake:
        * PlatformMac.cmake:
        Remove CryptoAlgorithmDescriptionBuilder.cpp.
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSCryptoAlgorithmBuilder.cpp:
        (WebCore::JSCryptoAlgorithmBuilder::add):
        (WebCore::JSCryptoAlgorithmBuilder::createEmptyClone): Deleted.
        * bindings/js/JSCryptoAlgorithmBuilder.h:
        * bindings/js/JSCryptoKeyCustom.cpp:
        (WebCore::JSCryptoKey::algorithm):
        Get rid of dependency on CryptoAlgorithmDescriptionBuilder.
        * crypto/CryptoAlgorithmDescriptionBuilder.cpp: Removed.
        * crypto/CryptoAlgorithmDescriptionBuilder.h: Removed.
        Replace it with KeyAlgorithm.
        * crypto/CryptoKey.cpp:
        (WebCore::CryptoKey::CryptoKey):
        (WebCore::CryptoKey::buildAlgorithmDescription): Deleted.
        * crypto/CryptoKey.h:
        (WebCore::KeyAlgorithm::KeyAlgorithm):
        (WebCore::KeyAlgorithm::~KeyAlgorithm):
        (WebCore::CryptoKey::algorithmIdentifier):
        * crypto/CryptoKey.idl:
        Add KeyAlgorithm dictionary which is returned via CryptoKey.buildAlgorithm() method,
        and rename m_algorithm to m_algorithmIdentifier to distingush it with newly
        added KeyAlgorithm dictionary.
        * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
        (WebCore::buildAlgorithm):
        (WebCore::CryptoKeyRSA::buildAlgorithmDescription): Deleted.
        * crypto/keys/CryptoKeyAES.cpp:
        (WebCore::CryptoKeyAES::buildAlgorithm):
        (WebCore::CryptoKeyAES::buildAlgorithmDescription): Deleted.
        * crypto/keys/CryptoKeyAES.h:
        (WebCore::AesKeyAlgorithm::AesKeyAlgorithm):
        (WebCore::AesKeyAlgorithm::~AesKeyAlgorithm):
        * crypto/keys/CryptoKeyHMAC.cpp:
        (WebCore::CryptoKeyHMAC::buildAlgorithm):
        (WebCore::CryptoKeyHMAC::buildAlgorithmDescription): Deleted.
        * crypto/keys/CryptoKeyHMAC.h:
        (WebCore::HmacKeyAlgorithm::HmacKeyAlgorithm):
        (WebCore::HmacKeyAlgorithm::~HmacKeyAlgorithm):
        * crypto/keys/CryptoKeyRSA.h:
        (WebCore::RsaKeyAlgorithm::RsaKeyAlgorithm):
        (WebCore::RsaKeyAlgorithm::~RsaKeyAlgorithm):
        (WebCore::RsaHashedKeyAlgorithm::RsaHashedKeyAlgorithm):
        (WebCore::RsaHashedKeyAlgorithm::~RsaHashedKeyAlgorithm):
        * crypto/mac/CryptoKeyRSAMac.cpp:
        (WebCore::CryptoKeyRSA::buildAlgorithm):
        (WebCore::CryptoKeyRSA::buildAlgorithmDescription): Deleted.

2016-09-14  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r205670): ASSERTION FAILED: methodTable(vm)->toThis(this, exec, NotStrictMode) == this
        https://bugs.webkit.org/show_bug.cgi?id=161982

        Reviewed by Saam Barati.

        We no longer need a custom [[SetPrototypeOf]] anymore as JSProxy::setPrototypeOf()
        no longer forwards the call to its target.

        No new layout tests because the behavior only changes in the context of the JSC
        tests (which were updated in this patch).

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::setPrototype): Deleted.
        * page/DOMWindow.idl:

2016-09-14  Wenson Hsieh  <wenson_hsieh@apple.com>

        Media controls behave strangely when changing media sources
        https://bugs.webkit.org/show_bug.cgi?id=161914
        <rdar://problem/28227805>

        Reviewed by Tim Horton.

        Addresses media controls flickering while changing the source of a media element. To accomplish this, we make
        the following changes to the media controls main content heuristic:

        - Prevent elements that are not mostly within the mainframe rect (or elements with empty rects) from showing
          media controls. Many websites that rely on same document navigation will move videos offscreen when navigating
          to a section of their site that does not play media. Without this check, we would not know to hide a video
          element on certain popular websites that use this technique, since the video has been interacted with in the
          past.

        - Rather than check whether a media element currently has video/audio sources, check whether it has ever had
          audio. Many websites will use the same media element across different videos and change only the source, and
          we should not prevent a media element from having media controls on grounds of having no audio or video in
          this case.

        - Rather than add user gesture and playback behavior restrictions before dispatching an ended event, add only
          the gesture restriction immediately, and add the playback restriction after waiting for a grace period only if
          the user has not interacted with the video since ending, and the video is not currently playing or about to
          play. This gives the user a chance to interact with the controls when a video ends, but also allows the page
          to load or begin playing a new video with the same media element without thrashing media control state.

        Adds 3 new API tests.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::HTMLMediaElement):
        (WebCore::HTMLMediaElement::~HTMLMediaElement):
        (WebCore::HTMLMediaElement::mediaPlayerActiveSourceBuffersChanged):
        (WebCore::HTMLMediaElement::seekWithTolerance):
        (WebCore::HTMLMediaElement::beginScrubbing):
        (WebCore::HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary):
        (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
        (WebCore::HTMLMediaElement::playbackControlsManagerBehaviorRestrictionsTimerFired):
        * html/HTMLMediaElement.h:
        (WebCore::HTMLMediaElement::hasEverHadAudio):
        (WebCore::HTMLMediaElement::hasEverHadVideo):
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::canShowControlsManager):
        (WebCore::isElementRectMostlyInMainFrame):
        * platform/graphics/MediaPlayer.h:
        (WebCore::MediaPlayerClient::mediaPlayerActiveSourceBuffersChanged):
        * platform/graphics/MediaPlayerPrivate.h:
        (WebCore::MediaPlayerPrivateInterface::notifyActiveSourceBuffersChanged):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::notifyActiveSourceBuffersChanged):
        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
        (WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer):
        (WebCore::MediaSourcePrivateAVFObjC::sourceBufferPrivateDidChangeActiveState):

2016-09-14  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Minor cleanup
        https://bugs.webkit.org/show_bug.cgi?id=161976

        Reviewed by Youenn Fablet and Dean Jackson.

        No new tests, no behavior change.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/mediastream/CaptureDeviceInfo.h: Removed.
        * Modules/mediastream/CaptureDeviceManager.cpp: Removed.
        * Modules/mediastream/CaptureDeviceManager.h: Removed.
        * Modules/mediastream/MediaDevicesRequest.cpp:
        (WebCore::MediaDevicesRequest::didCompletePermissionCheck):
        (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Deleted.
        (WebCore::MediaDevicesRequest::requestOrigin): Deleted.
        * Modules/mediastream/MediaDevicesRequest.h:
        * Modules/mediastream/MediaStreamTrackSourcesCallback.h: Removed.
        * Modules/mediastream/MediaStreamTrackSourcesCallback.idl: Removed.
        * Modules/mediastream/SourceInfo.cpp: Removed.
        * Modules/mediastream/SourceInfo.h: Removed.
        * Modules/mediastream/SourceInfo.idl: Removed.
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/CaptureDevice.h: Copied from Source/WebCore/Modules/mediastream/CaptureDeviceInfo.h.
        (WebCore::CaptureDevice::CaptureDevice):
        (WebCore::CaptureDevice::persistentId):
        (WebCore::CaptureDevice::label):
        (WebCore::CaptureDevice::groupId):
        (WebCore::CaptureDevice::kind):
        (WebCore::CaptureSessionInfo::~CaptureSessionInfo): Deleted.
        (WebCore::CaptureSessionInfo::supportsVideoSize): Deleted.
        (WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions): Deleted.
        * platform/mediastream/CaptureDeviceManager.cpp: Copied from Source/WebCore/Modules/mediastream/CaptureDeviceManager.cpp.
        (CaptureDeviceManager::getSourcesInfo):
        * platform/mediastream/CaptureDeviceManager.h: Copied from Source/WebCore/Modules/mediastream/CaptureDeviceManager.h.
        (WebCore::CaptureSessionInfo::~CaptureSessionInfo):
        (WebCore::CaptureSessionInfo::supportsVideoSize):
        (WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions):
        * platform/mediastream/MediaStreamTrackSourcesRequestClient.h: Removed.
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        * platform/mediastream/mac/AVCaptureDeviceManager.h:
        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
        (WebCore::AVCaptureDeviceManager::getSourcesInfo):
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamDevices):
        (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources): Deleted.
        (WebCore::RealtimeMediaSourceCenterMac::sourceWithUID): Deleted.
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
        (WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamDevices):
        (WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamTrackSources): Deleted.
        (WebCore::RealtimeMediaSourceCenterOwr::sourceWithUID): Deleted.
        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
        * platform/mock/MockRealtimeMediaSource.cpp:
        (WebCore::MockRealtimeMediaSource::audioDeviceInfo):
        (WebCore::MockRealtimeMediaSource::videoDeviceInfo):
        (WebCore::MockRealtimeMediaSource::trackSourceWithUID): Deleted.
        * platform/mock/MockRealtimeMediaSource.h:
        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
        (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamDevices):
        (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources): Deleted.
        (WebCore::MockRealtimeMediaSourceCenter::sourceWithUID): Deleted.
        * platform/mock/MockRealtimeMediaSourceCenter.h:

2016-09-14  Antti Koivisto  <antti@apple.com>

        Move more code out from RenderObject
        https://bugs.webkit.org/show_bug.cgi?id=161980

        Reviewed by Zalan Bujtas.

        Move some functions that are only needed for RenderElement there.
        Move collapsing anonymous table rows to RenderTableRow.

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::hasOutlineAnnotation):
        (WebCore::RenderElement::hasSelfPaintingLayer):
        (WebCore::RenderElement::checkForRepaintDuringLayout):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::hasOutline):
        (WebCore::RenderElement::hasHiddenBackface): Deleted.
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::pixelSnappedAbsoluteClippedOverflowRect):
        (WebCore::RenderObject::destroyAndCleanupAnonymousWrappers):
        (WebCore::RenderObject::hasSelfPaintingLayer): Deleted.
        (WebCore::RenderObject::checkForRepaintDuringLayout): Deleted.
        (WebCore::RenderObject::hasOutlineAnnotation): Deleted.
        (WebCore::RenderObject::hasEntirelyFixedBackground): Deleted.
        (WebCore::collapseAnonymousTableRowsIfNeeded): Deleted.
        * rendering/RenderObject.h:
        (WebCore::RenderObject::hasLayer):
        (WebCore::RenderObject::canBeSelectionLeaf):
        (WebCore::RenderObject::hasOutline): Deleted.
        (WebCore::RenderObject::hasSelectedChildren): Deleted.
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::destroyAndCollapseAnonymousSiblingRows):
        * rendering/RenderTableRow.h:
        * rendering/RenderView.cpp:
        (WebCore::RenderView::rootBackgroundIsEntirelyFixed):

2016-09-14  Daniel Bates  <dabates@apple.com>

        Switch CSSParser to use CSSParserFastPaths::isKeywordPropertyID()
        https://bugs.webkit.org/show_bug.cgi?id=161983

        Reviewed by David Hyatt.

        Towards switching to the new CSS parser keyword properties validation logic,
        switch over the old CSS parser logic for determining a keyword property to
        use the analogous logic in the new CSS parser.

        A side benefit of this change is that it is a step towards unifying CSS- and
        SVG CSS- keyword properties. The new CSS parser does not make a distinction
        between these kinds of properties and will allow us to have a shared code path
        for validating a keyword property.

        No functionality was changed. So, no new tests.

        * css/parser/CSSParser.cpp: Include header CSSParserFastPaths.h.
        (WebCore::isValidKeywordPropertyAndValue): Validate SVG CSS keyword properties. This
        logic was moved from CSSParser::parseSVGValue(). In subsequent patches we will switch
        the old CSS parser from this function to CSSParserFastPaths::isValidKeywordPropertyAndValue().
        (WebCore::parseKeywordValue): Modified to call CSSParserFastPaths::isKeywordPropertyID().
        (WebCore::CSSParser::parseValue): Ditto.
        (WebCore::isKeywordPropertyID): Deleted. Incorporated its functionality into
        CSSParserFastPaths::isKeywordPropertyID().
        * css/parser/CSSParserFastPaths.cpp:
        (WebCore::CSSParserFastPaths::isKeywordPropertyID): Incorporates the functionality
        of WebCore::isKeywordPropertyID().
        * css/parser/SVGCSSParser.cpp:
        (WebCore::CSSParser::parseSVGValue): Move properties that can be processed as
        keyword properties from here to WebCore::isValidKeywordPropertyAndValue().

2016-09-13  Dean Jackson  <dino@apple.com>

        Rename parseColorParameters and clean up conditional
        https://bugs.webkit.org/show_bug.cgi?id=161941
        <rdar://problem/28292750>

        Reviewed by Dan Bates.

        In preparation for adding color() support, rename the existing
        parseColorParameters to parseRGBParameters.

        Also clean up the logic in the parseColorFromValue function.

        * css/parser/CSSParser.cpp:
        (WebCore::CSSParser::parseRGBParameters):
        (WebCore::CSSParser::parseColorFromValue):
        (WebCore::CSSParser::parseColorParameters): Deleted.
        * css/parser/CSSParser.h:

2016-09-14  Chris Dumez  <cdumez@apple.com>

        Add support hr.color IDL attribute
        https://bugs.webkit.org/show_bug.cgi?id=161977

        Reviewed by Darin Adler.

        Add support hr.color IDL attribute as per:
        - https://html.spec.whatwg.org/#HTMLHRElement-partial

        Even though this is a legacy attribute, it is still part of the HTML specification
        and it is still supported by Firefox and Chrome.

        Also note that even though WebKit does not currently support the 'color' IDL
        attribute on <hr>, it does support the 'color' content attribute on <hr>.
        Therefore, we only need to reflect the 'color' content attribute.

        No new tests, rebaselined existing test.

        * html/HTMLHRElement.idl:

2016-09-14  Alex Christensen  <achristensen@webkit.org>

        URLParser: Add fast path for hosts containing no non-ASCII or percent characters
        https://bugs.webkit.org/show_bug.cgi?id=161970

        Reviewed by Daniel Bates.

        Covered by existing tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        (WebCore::URLParser::parseHost):
        * platform/URLParser.h:
        When parsing the host of a URL, if it contains non-ASCII characters or percent-encoded values,
        we need to do additional encoding.  Many URLs, including all already-parsed URLs, do not have
        such characters in their host, and therefore do not need the additional encoding.  Skipping
        the additional encoding significantly speeds up my URL parsing benchmark.

2016-09-14  Zalan Bujtas  <zalan@apple.com>

        ShowRenderTree should take position offset into account when printing inflow positioned renderers.
        https://bugs.webkit.org/show_bug.cgi?id=161978

        Reviewed by Simon Fraser.

        Adjust (x, y) with the inflow positioned renderer's offset.  

        Not testable.

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::showRenderObject):

2016-09-14  Alex Christensen  <achristensen@webkit.org>

        URLParser: Add fast path for utf8 encoding queries
        https://bugs.webkit.org/show_bug.cgi?id=161968

        Reviewed by Daniel Bates.

        No change in behavior.  Covered by existing tests.

        * platform/URLParser.cpp:
        (WebCore::utf8PercentEncodeQuery):
        (WebCore::URLParser::parse):
        If the text encoding is UTF-8 (which is quite common), then we can encode the query
        as we iterate its code points. This reduces memory allocation and significantly speeds
        up my URL parsing benchmark.

2016-09-14  Chris Dumez  <cdumez@apple.com>

        Regression(r152725): generate-bindings.pl --write-dependencies does not work
        https://bugs.webkit.org/show_bug.cgi?id=161897

        Reviewed by Darin Adler.

        r152725 inadvertently dropped the code generating the JS*.dep files when
        --write-dependencies is passed to the bindings generator. As a result,
        our dependency tracking was broken. This patch restores the code that
        was dropped in r152725.

        * bindings/scripts/CodeGeneratorJS.pm:
        (new):
        (GenerateHeader):

2016-09-14  Chris Dumez  <cdumez@apple.com>

        input.type cannot be set to "file" after being set to another type
        https://bugs.webkit.org/show_bug.cgi?id=161943

        Reviewed by Daniel Bates.

        input.type cannot be set to "file" after being set to another type.
        This behavior does not match the HTML specification or the behavior
        of Firefox and Chrome. This patch drops this restriction and aligns
        our behavior with other browsers.

        Test: fast/dom/HTMLInputElement/input-type-change-to-file.html

        * html/FileInputType.cpp:
        (WebCore::FileInputType::canChangeFromAnotherType): Deleted.
        * html/FileInputType.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::updateType):
        * html/InputType.cpp:
        (WebCore::InputType::canChangeFromAnotherType): Deleted.
        * html/InputType.h:

2016-09-14  Carlos Garnacho <carlosg@gnome.org>

        [GTK][Wayland] Implement clipboard support
        https://bugs.webkit.org/show_bug.cgi?id=146574

        Reviewed by Carlos Garcia Campos.

        Implement PlatformPasteboard in the GTK+ platform, and move Pasteboard
        to using PasteboardStrategy so clipboard management is left to the
        UIProcess.

        DataObjectGtk is still used in the Pasteboard GTK implementation, it's
        now just never backed by a GtkClipboard, this object is instead
        serialized through PasteboardStrategy, so the UIProcess side can mirror
        the content in a GtkClipboard-backed DataObjectGtk, which is then
        exposed to the windowing through PlatformPasteboard/PasteboardHelper.

        When requesting clipboard content, it works similarly, the UIProcess
        side first updates its DataObjectGtk, which is then mirrored by the
        WebProcess through the PasteboardStrategy requests.

        * PlatformGTK.cmake: Added PlatformPasteboardGtk.cpp
        * editing/gtk/EditorGtk.cpp:
        (WebCore::Editor::writeSelectionToPasteboard): Eliminate usage of
        PasteboardWebContent callback argument. This is done differently as
        we have to signal back the WebProcess.
        * platform/Pasteboard.h: Cleaned up of direct GTK+ dependency.
        * platform/PasteboardStrategy.h: Added plumbing towards the pasteboard
        proxy.
        * platform/PlatformPasteboard.h:
        * platform/gtk/DataObjectGtk.cpp:
        (WebCore::DataObjectGtk::clearAllExceptFilenames): Clear the "smart
        paste" flag if set, now that this is DataObjectGtk data.
        * platform/gtk/DataObjectGtk.h:
        (WebCore::DataObjectGtk::canSmartReplace):
        (WebCore::DataObjectGtk::setCanSmartReplace): Added functions, in order
        to flag whether a DataObjectGtk has the "smart paste" feature enabled
        or not.
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::createForCopyAndPaste):
        (WebCore::Pasteboard::createForGlobalSelection):
        (WebCore::Pasteboard::Pasteboard):
        (WebCore::Pasteboard::writeToClipboard):
        (WebCore::Pasteboard::readFromClipboard):
        (WebCore::Pasteboard::writePlainText):
        (WebCore::Pasteboard::write):
        (WebCore::Pasteboard::writePasteboard):
        (WebCore::Pasteboard::clear):
        (WebCore::Pasteboard::canSmartReplace):
        (WebCore::Pasteboard::read):
        (WebCore::Pasteboard::hasData):
        (WebCore::Pasteboard::types):
        (WebCore::Pasteboard::readString):
        (WebCore::Pasteboard::readFilenames): Made to use the
        PasteboardStrategy instead of PasteboardHelper/GTK+ API.
        * platform/gtk/PasteboardHelper.cpp:
        (WebCore::PasteboardHelper::~PasteboardHelper):
        (WebCore::ClipboardSetData::ClipboardSetData):
        (WebCore::clearClipboardContentsCallback):
        (WebCore::PasteboardHelper::writeClipboardContents): Remove the GClosure
        to notify whether the global selection has been replaced. Use std:function
        instead. Remove SmartPasteInclusion argument, now figured out through
        DataObjectGtk canSmartPaste() member.
        * platform/gtk/PasteboardHelper.h:
        * platform/gtk/PlatformPasteboardGtk.cpp: Added.
        (WebCore::PlatformPasteboard::PlatformPasteboard):
        (WebCore::PlatformPasteboard::writeToClipboard):
        (WebCore::PlatformPasteboard::readFromClipboard): Implemented
        PlatformPasteboard using PasteboardHelper/GTK+ API.

2016-09-13  Dave Hyatt  <hyatt@apple.com>

        [CSS Parser] Enable the new sizes parser by default
        https://bugs.webkit.org/show_bug.cgi?id=161931

        Reviewed by Zalan Bujtas.

        Added new tests in fast/dom/HTMLImageElement/sizes.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSGrammar.y.in:
        Remove the old code that parsed source size lists.

        * css/MediaQueryEvaluator.cpp:
        (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
        * css/MediaQueryEvaluator.h:
        Change to take a const Document&, since the Document is not modified.

        * css/SourceSizeList.cpp: Removed.
        * css/SourceSizeList.h: Removed.
        * css/parser/CSSParser.cpp:
        (WebCore::CSSParser::parseSizesAttribute): Deleted.
        (WebCore::CSSParser::SourceSize::SourceSize): Deleted.
        (WebCore::CSSParser::sourceSize): Deleted.
        * css/parser/CSSParser.h:
        Remove the old sizes processing code.

        * css/parser/MediaQueryParser.cpp:
        (WebCore::MediaQueryParser::skipUntilComma):
        (WebCore::MediaQueryParser::parseInternal):
        Fix a bug I introduced when modifying this code from Blink. The Nones should have been Nots.

        * css/parser/SizesAttributeParser.cpp:
        (WebCore::SizesAttributeParser::computeLength):
        (WebCore::SizesAttributeParser::SizesAttributeParser):
        (WebCore::SizesAttributeParser::calculateLengthInPixels):
        (WebCore::SizesAttributeParser::mediaConditionMatches):
        (WebCore::SizesAttributeParser::effectiveSizeDefaultValue):
        * css/parser/SizesAttributeParser.h:
        * css/parser/SizesCalcParser.cpp:
        (WebCore::SizesCalcParser::SizesCalcParser):
        (WebCore::SizesCalcParser::appendLength):
        * css/parser/SizesCalcParser.h:
        Make the sizes parsers take a Document, since having separate style and view arguments made
        no sense, given that the style used is always the view's.

        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
        (WebCore::HTMLImageElement::selectImageSource):
        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
        Switch image elements and the preload scanner over to the new code.

2016-09-13  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r205887.

        Broke the Windows build

        Reverted changeset:

        "Merge Element::ScrollToOptions and
        DOMWindow::ScrollToOptions"
        https://bugs.webkit.org/show_bug.cgi?id=161932
        http://trac.webkit.org/changeset/205887

2016-09-13  Dean Jackson  <dino@apple.com>

        Remove a .rej file.

        * animation/DocumentTimeline.h.rej: Removed.

2016-09-13  Alex Christensen  <achristensen@webkit.org>

        Implement URLSearchParams
        https://bugs.webkit.org/show_bug.cgi?id=161920

        Reviewed by Chris Dumez.

        Covered by newly passing web platform tests.

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * html/DOMURL.cpp:
        (WebCore::DOMURL::setQuery):
        (WebCore::DOMURL::searchParams):
        * html/DOMURL.h:
        * html/URLSearchParams.cpp: Added.
        (WebCore::URLSearchParams::URLSearchParams):
        (WebCore::URLSearchParams::get):
        (WebCore::URLSearchParams::has):
        (WebCore::URLSearchParams::set):
        (WebCore::URLSearchParams::append):
        (WebCore::URLSearchParams::getAll):
        (WebCore::URLSearchParams::remove):
        (WebCore::URLSearchParams::toString):
        (WebCore::URLSearchParams::updateURL):
        (WebCore::URLSearchParams::Iterator::Iterator):
        * html/URLSearchParams.h: Added.
        (WebCore::URLSearchParams::create):
        (WebCore::URLSearchParams::createIterator):
        * html/URLSearchParams.idl: Added.
        * html/URLUtils.idl:
        * platform/URLParser.cpp:
        (WebCore::percentDecode):
        (WebCore::URLParser::parseHost):
        (WebCore::formURLDecode):
        (WebCore::serializeURLEncodedForm):
        (WebCore::URLParser::serialize):
        * platform/URLParser.h:

2016-09-12  Dean Jackson  <dino@apple.com>

        Replace RGBA32 with Color in member variables
        https://bugs.webkit.org/show_bug.cgi?id=161856
        <rdar://problem/28254324>

        Reviewed by Simon Fraser.

        In preparation for the Color class to become more than
        just a 4-byte RGBA value, I went through a few places
        that were using the RGBA32 type directly, and replaced
        them with Color. This will make some objects a little
        bigger e.g. BorderValue and its friends.

        I mostly looked at the places that were using RGBA32 as
        a member variable. There is still a lot of RGBA32 use
        around the project, in particular the CSS parser.

        There should be no behaviour change.

        * html/canvas/CanvasRenderingContext2D.cpp: Shadows now use Color.
        (WebCore::CanvasRenderingContext2D::setShadow):
        (WebCore::CanvasRenderingContext2D::shouldDrawShadows):
        (WebCore::CanvasRenderingContext2D::didDraw):
        * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/CanvasStyle.cpp: Canvas style uses Color for fills and strokes.
        (WebCore::CanvasStyle::CanvasStyle):
        (WebCore::CanvasStyle::isEquivalentColor):
        (WebCore::CanvasStyle::isEquivalentRGBA):
        (WebCore::CanvasStyle::applyStrokeColor):
        (WebCore::CanvasStyle::applyFillColor):
        * html/canvas/CanvasStyle.h:
        (WebCore::CanvasStyle::CMYKAValues::CMYKAValues):
        (WebCore::CanvasStyle::color):

        * html/track/TextTrackCueGeneric.h: Foreground, background and
        highlight colors.
        * platform/graphics/InbandTextTrackPrivateClient.h:
        (WebCore::GenericCueData::setForegroundColor):
        (WebCore::GenericCueData::setBackgroundColor):
        (WebCore::GenericCueData::setHighlightColor):

        * page/PageOverlay.cpp: Background color.
        (WebCore::PageOverlay::setBackgroundColor):
        * page/PageOverlay.h:

        * platform/graphics/mac/ColorMac.h: Random function that returned RGBA32.
        * platform/graphics/mac/ColorMac.mm:
        (WebCore::oldAquaFocusRingColor):

        * rendering/RenderTableCell.cpp: Update the size of CollapsedBorderValue.

        * rendering/RenderTheme.h: Use a NeverDestroyed Color rather than a static RGBA32.

        * rendering/style/BorderValue.h: Use a Color.
        (WebCore::BorderValue::BorderValue):
        (WebCore::BorderValue::isTransparent):
        (WebCore::BorderValue::operator==):
        (WebCore::BorderValue::setColor):
        (WebCore::BorderValue::color):
        * rendering/style/CollapsedBorderValue.h:
        (WebCore::CollapsedBorderValue::CollapsedBorderValue):
        (WebCore::CollapsedBorderValue::color):
        * rendering/style/OutlineValue.h:
        (WebCore::OutlineValue::operator==):

        * rendering/style/RenderStyle.cpp: Update to match new BorderValue.

2016-09-13  Jer Noble  <jer.noble@apple.com>

        [media-source] MediaSource.addSourceBuffer(null) should throw an exception
        https://bugs.webkit.org/show_bug.cgi?id=161884

        Reviewed by Eric Carlson.

        Fixes test: imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer.html

        * Modules/mediasource/MediaSource.idl: The addSourceBuffer() parameter is not optional
            and not nullable.

2016-09-13  Daniel Bates  <dabates@apple.com>

        Remove Chrome app-specific CSS property -webkit-app-region
        https://bugs.webkit.org/show_bug.cgi?id=161935

        Reviewed by Simon Fraser.

        * css/parser/CSSParserFastPaths.cpp:

2016-09-13  Daniel Bates  <dabates@apple.com>

        Treat some CSS properties as keyword properties
        https://bugs.webkit.org/show_bug.cgi?id=161934

        Reviewed by Simon Fraser.

        Move validation of the following CSS keyword properties from CSSParser::parseValue() to
        WebCore::isValidKeywordPropertyAndValue():

        CSSPropertyColumnProgression
        CSSPropertyFontStretch
        CSSPropertyTextAlign
        CSSPropertyUnicodeBidi
        CSSPropertyWebkitColumnAxis
        CSSPropertyWebkitCursorVisibility
        CSSPropertyWebkitTextDecorationStyle
        CSSPropertyWebkitTextOrientation
        CSSPropertyWebkitTextZoom
        CSSPropertyWebkitTouchCallout

        Among other benefits, this will make it more straightforward to migrate from CSSParser::is{KeywordPropertyID, ValidKeywordPropertyAndValue}()
        to CSSParserFastPaths::is{KeywordPropertyID, ValidKeywordPropertyAndValue}(), respectively.

        * css/parser/CSSParser.cpp:
        (WebCore::isValidKeywordPropertyAndValue):
        (WebCore::isKeywordPropertyID):
        (WebCore::CSSParser::parseValue):

2016-09-13  Chris Dumez  <cdumez@apple.com>

        Merge Element::ScrollToOptions and DOMWindow::ScrollToOptions
        https://bugs.webkit.org/show_bug.cgi?id=161932

        Reviewed by Simon Fraser.

        Merge Element::ScrollToOptions and DOMWindow::ScrollToOptions.
        Ideally we would merge them on IDL side as well but this is for
        another patch.

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateDictionaryImplementationContent):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::convertDictionary<TestObj::Dictionary>):
        (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
        (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
        (WebCore::convertDictionary<AlternateDictionaryName>):
        * dom/Element.h:
        * dom/Element.idl:
        * dom/ScrollToOptions.h: Added.
        * html/HTMLBodyElement.cpp:
        (WebCore::HTMLBodyElement::scrollTo):
        * page/DOMWindow.h:
        * page/DOMWindow.idl:

2016-09-13  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Unify font's ascent, descent, and x-height between macOS and iOS
        https://bugs.webkit.org/show_bug.cgi?id=161877

        Reviewed by Simon Fraser.

        macOS and iOS have slightly different handling of ascent, descent, and x-height.
        This patch migrates them to have the same handling of them.

        There are slight behavior changes here because our previous code converted between
        floats and doubles in unnecessary places, and does not handle rounding in
        consistent ways. The differences are all miniscule, but nevertheless lead to test
        results needing to be updated.

        Coincidentally, by performing this unification, there are no longer any places
        on macOS Sierra which are using the CGFontRef member of PlatformFontData. This
        patch removes the member on that operating system for memory savings as well as
        clarity.

        Covered by existing tests.

        * platform/graphics/FontPlatformData.cpp:
        * platform/graphics/FontPlatformData.h:
        * platform/graphics/cocoa/FontCocoa.mm:
        (WebCore::Font::platformInit):
        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
        (WebCore::FontPlatformData::FontPlatformData):
        (WebCore::FontPlatformData::platformIsEqual):
        (WebCore::FontPlatformData::ctFont):

2016-09-13  Brent Fulgham  <bfulgham@apple.com>

        [Win] Unreviewed build fix.

        Based on a suggestion by Simon Fraser, I have corrected the
        headers to avoid including <d2d1.h> directly, relying instead
        on forward declarations.

        * platform/graphics/FloatPoint.h:
        * platform/graphics/FloatRect.h:
        * platform/graphics/FloatSize.h:
        * platform/graphics/IntPoint.h:
        * platform/graphics/IntRect.h:
        * platform/graphics/IntSize.h:
        * platform/graphics/transforms/AffineTransform.h:
        * platform/graphics/transforms/TransformationMatrix.h:

2016-09-13  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Get rid of the m_premultiplyAlpha flag of the ImageFrame class
        https://bugs.webkit.org/show_bug.cgi?id=159721

        Reviewed by Simon Fraser.

        This flag was only needed when calling ImageBackingStore::create() in 
        ImageFrame::setSize(). Instead we can pass ImageDecoder::m_premultiplyAlpha 
        to ImageFrame::setSize(), which is renamed ImageFrame::initializeBackingStore().
        The passed premultiplyAlpha can then be passed to ImageBackingStore::create().

        * platform/image-decoders/ImageDecoder.cpp:
        (WebCore::ImageFrame::ImageFrame):
        (WebCore::ImageFrame::operator=):
        (WebCore::ImageFrame::initializeBackingStore):
        (WebCore::ImageFrame::copyBitmapData): Deleted.
        (WebCore::ImageFrame::setSize): Deleted.
        * platform/image-decoders/ImageDecoder.h:
        (WebCore::ImageFrame::disposalMethod):
        (WebCore::ImageFrame::setDisposalMethod):
        (WebCore::ImageDecoder::premultiplyAlpha):
        (WebCore::ImageFrame::premultiplyAlpha): Deleted.
        (WebCore::ImageFrame::setPremultiplyAlpha): Deleted.
        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
        (WebCore::BMPImageDecoder::frameBufferAtIndex):
        * platform/image-decoders/bmp/BMPImageReader.cpp:
        (WebCore::BMPImageReader::decodeBMP):
        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::decode):
        (WebCore::GIFImageDecoder::initFrameBuffer):
        * platform/image-decoders/ico/ICOImageDecoder.cpp:
        (WebCore::ICOImageDecoder::frameCount):
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageDecoder::frameBufferAtIndex):
        (WebCore::JPEGImageDecoder::outputScanlines):
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::frameBufferAtIndex):
        (WebCore::PNGImageDecoder::rowAvailable):
        (WebCore::PNGImageDecoder::readChunks):
        (WebCore::PNGImageDecoder::initFrameBuffer):
        (WebCore::setPixelRGB): Deleted.
        (WebCore::setPixelRGBA): Deleted.
        (WebCore::setPixelPremultipliedRGBA): Deleted.
        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::frameBufferAtIndex):
        (WebCore::WEBPImageDecoder::decode):

2016-09-12  Brent Fulgham  <bfulgham@apple.com>

        [Win][Direct2D] Provide Direct2D-based geometry and transform cast operations
        https://bugs.webkit.org/show_bug.cgi?id=161818

        Reviewed by Dean Jackson.

        Tested by new TestWebKitAPI tests.

        Add new casting operators to and from various Direct2D data types.

        * PlatformWin.cmake:
        * platform/graphics/FloatPoint.h:
        (WebCore::FloatPoint::FloatPoint):
        * platform/graphics/FloatRect.h:
        * platform/graphics/FloatSize.h:
        (WebCore::FloatSize::FloatSize):
        * platform/graphics/IntPoint.h:
        * platform/graphics/IntRect.h:
        * platform/graphics/IntSize.h:
        * platform/graphics/transforms/AffineTransform.h:
        * platform/graphics/transforms/TransformationMatrix.h:
        * platform/graphics/win/FloatPointDirect2D.cpp:
        * platform/graphics/win/FloatRectDirect2D.cpp:
        * platform/graphics/win/FloatSizeDirect2D.cpp:
        * platform/graphics/win/IntPointWin.cpp:
        (WebCore::IntPoint::IntPoint):
        (WebCore::IntPoint::operator D2D1_POINT_2F):
        (WebCore::IntPoint::operator D2D1_POINT_2U):
        * platform/graphics/win/IntRectWin.cpp:
        (WebCore::IntRect::IntRect):
        (WebCore::IntRect::operator D2D1_RECT_F):
        (WebCore::IntRect::operator D2D1_RECT_U):
        * platform/graphics/win/IntSizeWin.cpp:
        (WebCore::IntSize::IntSize):
        (WebCore::IntSize::operator D2D1_SIZE_U):
        (WebCore::IntSize::operator D2D1_SIZE_F):
        * platform/graphics/win/TransformationMatrixDirect2D.cpp: Added.
        (WebCore::TransformationMatrix::TransformationMatrix):
        (WebCore::TransformationMatrix::operator D2D1_MATRIX_3X2_F):
        (WebCore::AffineTransform::AffineTransform):
        (WebCore::AffineTransform::operator D2D1_MATRIX_3X2_F):

2016-09-13  Tim Horton  <timothy_horton@apple.com>

        Undoing a candidate insertion results in the replaced text being selected
        https://bugs.webkit.org/show_bug.cgi?id=161894
        <rdar://problem/28225774>

        Reviewed by Simon Fraser.

        Test: editing/mac/spelling/accept-candidate-undo-does-not-select.html

        * WebCore.xcodeproj/project.pbxproj:
        * editing/ReplaceRangeWithTextCommand.cpp: Added.
        (WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand):
        (WebCore::ReplaceRangeWithTextCommand::doApply):
        * editing/ReplaceRangeWithTextCommand.h: Added.
        (WebCore::ReplaceRangeWithTextCommand::create):
        Add a editor command that replaces a range with the given text.

        * editing/Editor.cpp:
        (WebCore::Editor::rangeForTextCheckingResult):
        (WebCore::Editor::handleAcceptedCandidate):
        (WebCore::Editor::selectTextCheckingResult): Deleted.
        * editing/Editor.h:
        Make use of the new editor command to do candidate insertion as a single
        composite operation, so that it is undone as a unit. Otherwise, undo ends up
        undoing the insertion, but not the selection, and we are left with the old
        text, selected, which is undesirable.

2016-09-13  Dave Hyatt  <hyatt@apple.com>

        [CSS Parser] Add CSS Variable Parsing support
        https://bugs.webkit.org/show_bug.cgi?id=161916

        Reviewed by Dean Jackson.

        This patch not only adds the parser for CSS variables (from Blink), but it also brings in
        all of the data structures used to store variables and custom property declarations. We
        will be abandoning our old data structures eventually in favor of these new ones. They
        are not significantly different other than operating on the CSSParserTokenRanges rather
        than the soon-to-be-removed parser value lists.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSCustomIdentValue.cpp: Added.
        (WebCore::CSSCustomIdentValue::CSSCustomIdentValue):
        (WebCore::CSSCustomIdentValue::customCSSText):
        * css/CSSCustomIdentValue.h: Added.
        (WebCore::CSSCustomIdentValue::create):
        (WebCore::CSSCustomIdentValue::value):
        (WebCore::CSSCustomIdentValue::isKnownPropertyID):
        (WebCore::CSSCustomIdentValue::valueAsPropertyID):
        (WebCore::CSSCustomIdentValue::equals):
        * css/CSSCustomPropertyDeclaration.cpp: Added.
        (WebCore::CSSCustomPropertyDeclaration::customCSSText):
        * css/CSSCustomPropertyDeclaration.h: Added.
        (WebCore::CSSCustomPropertyDeclaration::create):
        (WebCore::CSSCustomPropertyDeclaration::name):
        (WebCore::CSSCustomPropertyDeclaration::value):
        (WebCore::CSSCustomPropertyDeclaration::id):
        (WebCore::CSSCustomPropertyDeclaration::equals):
        (WebCore::CSSCustomPropertyDeclaration::CSSCustomPropertyDeclaration):
        * css/CSSCustomPropertyValue.h:
        * css/CSSValue.cpp:
        (WebCore::CSSValue::cssText):
        (WebCore::CSSValue::destroy):
        * css/CSSValue.h:
        (WebCore::CSSValue::isCustomPropertyDeclaration):
        (WebCore::CSSValue::isCustomIdentValue):
        (WebCore::CSSValue::isVariableReferenceValue):
        * css/CSSValueKeywords.in:
        * css/CSSVariableData.cpp: Added.
        (WebCore::CSSVariableData::updateTokens):
        (WebCore::CSSVariableData::operator==):
        (WebCore::CSSVariableData::consumeAndUpdateTokens):
        (WebCore::CSSVariableData::CSSVariableData):
        * css/CSSVariableData.h: Added.
        (WebCore::CSSVariableData::create):
        (WebCore::CSSVariableData::createResolved):
        (WebCore::CSSVariableData::tokenRange):
        (WebCore::CSSVariableData::tokens):
        (WebCore::CSSVariableData::needsVariableResolution):
        (WebCore::CSSVariableData::CSSVariableData):
        * css/CSSVariableDependentValue.h:
        * css/CSSVariableReferenceValue.cpp: Added.
        (WebCore::CSSVariableReferenceValue::customCSSText):
        * css/CSSVariableReferenceValue.h: Added.
        (WebCore::CSSVariableReferenceValue::create):
        (WebCore::CSSVariableReferenceValue::variableDataValue):
        (WebCore::CSSVariableReferenceValue::equals):
        (WebCore::CSSVariableReferenceValue::CSSVariableReferenceValue):
        * css/CSSVariableValue.h:
        * css/parser/CSSParserImpl.cpp:
        (WebCore::filterProperties):
        (WebCore::CSSParserImpl::consumeDeclaration):
        (WebCore::CSSParserImpl::consumeVariableValue):
        * css/parser/CSSVariableParser.cpp: Added.
        (WebCore::CSSVariableParser::isValidVariableName):
        (WebCore::classifyBlock):
        (WebCore::isValidVariableReference):
        (WebCore::classifyVariableRange):
        (WebCore::CSSVariableParser::containsValidVariableReferences):
        (WebCore::CSSVariableParser::parseDeclarationValue):
        * css/parser/CSSVariableParser.h: Added.

2016-09-13  Daniel Bates  <dabates@apple.com>

        Remove CSS keyword properties from CSSParser::parseValue(CSSPropertyID, bool)
        https://bugs.webkit.org/show_bug.cgi?id=161918

        Reviewed by Simon Fraser.

        CSSParser::parseValue(CSSPropertyID, bool) calls ASSERT_NOT_REACHED() when processing a CSS property
        that is known to accept only keyword values as a means to guide a person to add such a CSS property
        to the switch block in WebCore::isValidKeywordPropertyAndValue(). In theory this sounds good, but
        in practice it does not work out and the list of such properties is stale. We should remove the
        case statements for such properties and the maintenance burden they required, which was manual and
        error prone. We should think about a better way to enforce that all CSS properties are parsed/validated.

        The approach of calling ASSERT_NOT_REACHED is not beneficial to catching coding mistakes because
        CSSParser::parseValue() has a default case statement to parse/validate SVG CSS properties and hence
        does not allow the C++ compiler to validate that the switch block covers all CSSPropertyIDs.

        * css/parser/CSSParser.cpp:
        (WebCore::CSSParser::parseValue):

2016-09-13  Daniel Bates  <dabates@apple.com>

        Organize CSS keyword properties in WebCore::isKeywordPropertyID()
        https://bugs.webkit.org/show_bug.cgi?id=161917

        Reviewed by Simon Fraser.

        Group and sort compile-time feature keywords and move them to the end of the switch block
        to avoid the distraction of preprocessor statements scattered throughout the list. Sort
        all the other keyword properties to make it straightforward to find a property by name.

        * css/parser/CSSParser.cpp:
        (WebCore::isKeywordPropertyID):

2016-09-13  Nan Wang  <n_wang@apple.com>

        AX: Crash at AccessibilityRenderObject::computeAccessibilityIsIgnored const  + 552
        https://bugs.webkit.org/show_bug.cgi?id=161276

        Reviewed by Chris Fleizach.

        Sometimes when calling JavaScript removeChild or setAttribute on a node, it seems like
        the renderer is deallocated during the process of computeAccessibilityIsIgnored. It's 
        causing a crash when we are accessing the renderer after that. Since RenderObject is not ref
        counted and we cannot hold onto it for the duration of the function, fixed it by adding
        more nil checks.

        Despite my best efforts, I couldn't make a layout test that destroys the renderer within
        the computeAccessibilityIsIgnored function. 

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):

2016-09-12  Jer Noble  <jer.noble@apple.com>

        Media-source backed elements block load event; cause web-platform-test flakiness
        https://bugs.webkit.org/show_bug.cgi?id=161881

        Reviewed by Eric Carlson.

        Test: media/media-source/media-source-delaying-load-event.html

        The MSE specification has added an explicit step to their "attaching to media element"
        algorithm which tells the media element to stop delaying the load event. And indeed,
        the HTMLMediaElement blocks the load event when a MediaSource is attached but its data
        is never loaded.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::setPrivateAndOpen):
        * html/HTMLMediaElement.h:

2016-09-12  Zalan Bujtas  <zalan@apple.com>

        Input type object and the associated render can go out of sync.
        https://bugs.webkit.org/show_bug.cgi?id=161871
        <rdar://problem/28178094>

        Reviewed by Antti Koivisto.

        Bail out when we've got a mismatched renderer.

        Test: fast/forms/assert-on-input-type-change.html

        * html/ImageInputType.cpp:
        (WebCore::ImageInputType::altAttributeChanged):

2016-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Get rid of DataObjectGtk::forClipboard and cleanup pasteboard code
        https://bugs.webkit.org/show_bug.cgi?id=161907

        Reviewed by Michael Catanzaro.

        We don't really need to keep a DataObjectGtk for every clipboard, we could simply pass the DataObjectGtk to read
        and write methods of PasteboardHelper.

        * editing/gtk/EditorGtk.cpp:
        (WebCore::createFragmentFromPasteboardData): Update for DataObjectGtk API changes.
        * platform/Pasteboard.h:
        * platform/gtk/DataObjectGtk.cpp: Remove forClipboard() static method.
        * platform/gtk/DataObjectGtk.h: Ditto.
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::Pasteboard): Always create a new DataObjectGtk.
        (WebCore::Pasteboard::dataObject): Return a const reference instead of a pointer.
        (WebCore::Pasteboard::writePlainText): Pass the DataObjectGtk to PasteboardHelper.
        (WebCore::Pasteboard::write): Ditto.
        (WebCore::Pasteboard::writePasteboard): Ditto.
        (WebCore::Pasteboard::clear): Ditto.
        (WebCore::Pasteboard::read): Ditto.
        (WebCore::Pasteboard::hasData): Ditto.
        (WebCore::Pasteboard::types): Ditto.
        (WebCore::Pasteboard::readString): Ditto.
        (WebCore::Pasteboard::readFilenames): Ditto.
        * platform/gtk/PasteboardHelper.cpp:
        (WebCore::PasteboardHelper::getClipboardContents): Update the given DataObjectGtk.
        (WebCore::PasteboardHelper::fillSelectionData): Use a const reference to DataObjectGtk instead of a pointer.
        (WebCore::PasteboardHelper::targetListForDataObject): Ditto.
        (WebCore::PasteboardHelper::fillDataObjectFromDropData): Use a reference to DataObjectGtk instead of a pointer.
        (WebCore::ClipboardSetData::ClipboardSetData): Helper struct to pass DataObjectGtk and callback to clipboard callbacks.
        (WebCore::ClipboardSetData::~ClipboardSetData):
        (WebCore::getClipboardContentsCallback): Get the DataObjectGtk from ClipboardSetData struct passed as user data.
        (WebCore::clearClipboardContentsCallback): Get the DataObjectGtk and callback from ClipboardSetData struct
        passed as user data.
        (WebCore::PasteboardHelper::writeClipboardContents): Write the given DataObjectGtk.
        * platform/gtk/PasteboardHelper.h:

2016-09-13  Chris Dumez  <cdumez@apple.com>

        Drop support for <isindex>
        https://bugs.webkit.org/show_bug.cgi?id=7139

        Reviewed by Ryosuke Niwa.

        Drop support for <isindex> and <input name=isindex>. Those are no longer
        in the HTML specification and Chrome / Edge have already dropped their
        support. Firefox is also planning on dropping this.

        Test: imported/w3c/web-platform-tests/html/semantics/forms/historical.html

        * css/StyleResolver.cpp:
        (WebCore::elementTypeHasAppearanceFromUAStyle):
        * css/html.css:
        (input, textarea, keygen, select, button, meter, progress):
        (input, textarea, keygen, select, button):
        (#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS):
        (input::placeholder):
        (input:focus, textarea:focus, keygen:focus, select:focus):
        * dom/Element.cpp:
        (WebCore::Element::ieForbidsInsertHTML):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::HTMLInputElement):
        * html/HTMLTagNames.in:
        * html/parser/HTMLStackItem.h:
        (WebCore::isSpecialNode):
        * html/parser/HTMLTreeBuilder.cpp:
        (WebCore::HTMLTreeBuilder::processStartTagForInBody):
        (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag): Deleted.
        (WebCore::createCaseMap): Deleted.
        * html/parser/HTMLTreeBuilder.h:
        * platform/network/FormData.cpp:
        (WebCore::FormData::appendKeyValuePairItems):

2016-09-12  Per Arne Vollan  <pvollan@apple.com>

        [Win] Warning fix.
        https://bugs.webkit.org/show_bug.cgi?id=161858

        Reviewed by Brent Fulgham.

        Use exported constants from CoreText.dll, instead of creating copies.

        * PlatformAppleWin.cmake:
        * platform/spi/win/CoreTextSPIWin.cpp: Removed.
        * platform/spi/win/CoreTextSPIWin.h:

2016-09-12  Youenn Fablet  <youenn@apple.com>

        ScriptElement should use FetchOptions::mode according its crossOrigin attribute
        https://bugs.webkit.org/show_bug.cgi?id=161686

        Reviewed by Darin Adler.

        Setting ScriptElement fetch mode according its crossOrigin attribute.
        Removing LoadableClassicScriptchecking of CORS since this is now done at ResourceLoader/CachedResource level.

        Updating CachedResourceLoader to ensure that a resource that matches an on-going resource load but with different fetch mode/origin,
        always gets its loading started if the resource state is not Cached.

        Tests: fast/dom/script-crossorigin-loads-fail-origin.html
               http/tests/security/cross-origin-cached-images-parallel.html
               http/tests/security/cross-origin-cached-images.html
               http/tests/security/cross-origin-cached-scripts-parallel.html
               http/tests/security/cross-origin-cached-scripts.html
               http/tests/security/script-crossorigin-loads-correctly-credentials.html
               http/tests/security/script-with-dataurl.html

        * dom/LoadableClassicScript.cpp:
        (WebCore::LoadableClassicScript::create):
        (WebCore::LoadableClassicScript::notifyFinished): Checking CORS failures using the resource state.
        (WebCore::LoadableClassicScript::~LoadableClassicScript): Deleted.
        (WebCore::LoadableClassicScript::isLoaded): Deleted.
        * dom/LoadableClassicScript.h:
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::requestClassicScript):
        (WebCore::ScriptElement::requestScriptWithCache): Using CachedResourceRequest::setAsPotentiallyCrossOrigin to set fetch mode according crossOrigin attribute.
        * dom/ScriptElement.h:
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::setBodyDataFrom):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Adding support for script resources.
        (WebCore::CachedResourceLoader::requestResource): Ensuring that 'updated' resources gets actually loaded.
        * loader/cache/CachedScript.cpp:
        (WebCore::CachedScript::setBodyDataFrom): Implementing specific data copy from another CachedScript.
        * loader/cache/CachedScript.h:

2016-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Scrollbar  too large
        https://bugs.webkit.org/show_bug.cgi?id=161735

        Reviewed by Michael Catanzaro.

        We were not calculating the total scrollbar size correctly when the theme defines a minimum width/height. In
        that case we need to take the extra size into account (border, margin, padding), but not adding the minimum
        size. We were also adjusting the thumb position when rendering in indicator mode, but we really need to adjust
        the whole rectangle. This worked in Adwaita because it uses a transparent track when in indicator mode. We are
        also now taking into account the text direction when doing this adjustment for the indicator mode.

        * platform/gtk/ScrollbarThemeGtk.cpp:
        (WebCore::ScrollbarThemeGtk::paint):
        (WebCore::ScrollbarThemeGtk::scrollbarThickness):

2016-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Crash of WebProcess on the last WebView disconnect (take two)
        https://bugs.webkit.org/show_bug.cgi?id=161842

        Reviewed by Michael Catanzaro.

        The problem is that when PlatformDisplayX11 is destroyed, the sharing GL context is deleted and its destructor
        makes a downcast of PlatformDisplay to get the native X11 display. We could simply keep a pointer to the native
        X11 display in GLContextGLX, got at construction time from the PlatformDisplay, and ensure the sharing GL
        context is deleted before the native X11 display is closed.

        * platform/graphics/PlatformDisplay.h: Make m_sharingGLContext protected.
        * platform/graphics/glx/GLContextGLX.cpp:
        (WebCore::GLContextGLX::GLContextGLX): Initialize m_x11Display.
        (WebCore::GLContextGLX::~GLContextGLX): Use m_x11Display and remove confusing comment about possible crash with
        nviedia closed drivers.
        (WebCore::GLContextGLX::defaultFrameBufferSize): Use m_x11Display.
        (WebCore::GLContextGLX::makeContextCurrent): Ditto.
        (WebCore::GLContextGLX::swapBuffers): Ditto.
        (WebCore::GLContextGLX::swapInterval): Ditto.
        (WebCore::GLContextGLX::cairoDevice): Ditto.
        * platform/graphics/glx/GLContextGLX.h:
        * platform/graphics/x11/PlatformDisplayX11.cpp:
        (WebCore::PlatformDisplayX11::~PlatformDisplayX11): Delete the sharing GL context before closing the display.

2016-09-12  Chris Dumez  <cdumez@apple.com>

        Fix post-landing review comments after r205787
        https://bugs.webkit.org/show_bug.cgi?id=161885

        Reviewed by Darin Adler.

        Leverage new StringBuilder::append(CFStringRef) overload.

        * html/parser/HTMLParserIdioms.cpp:
        (WebCore::parseHTTPRefreshInternal):
        * page/CaptionUserPreferencesMediaAF.cpp:
        (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
        (WebCore::buildDisplayStringForTrackBase):
        * platform/network/mac/CookieJarMac.mm:
        (WebCore::cookiesForSession):
        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::mediaControlsStyleSheet):
        (WebCore::RenderThemeIOS::mediaControlsScript):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::mediaControlsStyleSheet):
        (WebCore::RenderThemeMac::mediaControlsScript):

2016-09-12  Alex Christensen  <achristensen@webkit.org>

        URLParser: Correctly ignore spaces before relative URLs with no scheme
        https://bugs.webkit.org/show_bug.cgi?id=161889

        Reviewed by Daniel Bates.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):

2016-09-12  Nan Wang  <n_wang@apple.com>

        AX: Crash at WebCore::Range::compareBoundaryPoints(WebCore::Range::CompareHow, WebCore::Range const&, int&) const + 23
        https://bugs.webkit.org/show_bug.cgi?id=161878

        Reviewed by Chris Fleizach.

        In function characterOffsetsInOrder(const CharacterOffset&, const CharacterOffset&), we are creating two
        ranges based on the nodes that are associated to the passed in CharacterOffsets. When the first node is a doctype
        node, the first range will be a nullptr, and dereferencing it leads to a crash. Fixed this by adding a 
        NULL check.

        Test: accessibility/mac/doctype-node-in-text-marker-crash.html

        * accessibility/AXObjectCache.cpp:
        (WebCore::characterOffsetsInOrder):
        (WebCore::resetNodeAndOffsetForReplacedNode):

2016-09-12  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Move the pixel data of ImageFrame to a separate class named ImageBackingStore
        https://bugs.webkit.org/show_bug.cgi?id=159679

        Reviewed by Simon Fraser.

        Move the pixel data manipulation part in ImageFrame into a separate class
        and allocate it on demand.

        * PlatformEfl.cmake:
        * PlatformGTK.cmake:
        * PlatformWinCairo.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        Add ImageBackingStoreCairo.cpp and remove ImageDecoderCairo.cpp from the
        WebKit projects.

        * platform/graphics/Color.cpp:
        (WebCore::premultipliedChannel): channel = channel * alpha / 255.
        (WebCore::unpremultipliedChannel): channel = channel * 255 / alpha.
        (WebCore::makePremultipliedRGBA): Un-premultiplied channels to premultiplied RGBA32.
        (WebCore::makeUnPremultipliedRGBA): Premultiplied channels to un-premultiplied RGBA32.
        (WebCore::colorFromPremultipliedARGB): Use makeUnPremultipliedRGBA.
        (WebCore::premultipliedARGBFromColor): Use makePremultipliedRGBA.
        * platform/graphics/Color.h:
        (WebCore::fastMultiplyBy255): x * 255 = x * 256 - x = x << 8 - x.

        * platform/graphics/ImageBackingStore.h: Added.
        (WebCore::ImageBackingStore::create): Creates a new ImageBackingStore.
        (WebCore::ImageBackingStore::setSize): Changes the pixels size.
        (WebCore::ImageBackingStore::setFrameRect): This will always just be the entire buffer except for GIF and PNG frames.
        (WebCore::ImageBackingStore::size): Returns the pixels size.
        (WebCore::ImageBackingStore::frameRect): Returns the pixels frame rectangle.
        (WebCore::ImageBackingStore::clear): Clears the entire image.
        (WebCore::ImageBackingStore::clearRect): Clears a rectangle in the image.
        (WebCore::ImageBackingStore::repeatFirstRow): Repeats the first row in a rectangle in the image.
        (WebCore::ImageBackingStore::pixelAt): Returns a pointer to a pixel data.
        (WebCore::ImageBackingStore::setPixel): Sets the color of a pixel in the image.
        (WebCore::ImageBackingStore::blendPixel): Blend a color with a pixel in the image.
        (WebCore::ImageBackingStore::inBounds): Checks if a rectangle is in the bounds of the image.
        (WebCore::ImageBackingStore::isOverSize): Checks whether a size could not be allocated for an image.
        (WebCore::ImageBackingStore::ImageBackingStore):

        * platform/graphics/cg/NativeImageCG.cpp:
        (WebCore::nativeImageHasAlpha): Implement this function. See comments in https://bugs.webkit.org/show_bug.cgi?id=158684.

        * platform/image-decoders/ImageDecoder.cpp:
        (WebCore::ImageFrame::operator=): copyBitmapData() now copies the frameRect of the ImageBackingStore.
        (WebCore::ImageFrame::clearPixelData): The pixels data and the pointer to these pixels are now included in the ImageBackingStore.
        (WebCore::ImageFrame::zeroFillPixelData): Clearing the image pixels are now in ImageBackingStore::clear().
        (WebCore::ImageFrame::zeroFillFrameRect): Clearing the image pixels are now in ImageBackingStore::clearRect().
        (WebCore::ImageFrame::copyBitmapData): We either need to create a new ImageBackingStore or nullify the current one.
        (WebCore::ImageFrame::setSize): ImageFrame::setSize() is supposed to be called once and to create the ImageBackingStore.
        (WebCore::ImageFrame::setOriginalFrameRect): Delegate this call to ImageBackingStore::setFrameRect().
        (WebCore::ImageDecoder::frameBytesAtIndex): ImageFrame::PixelData can be replaced by RGBA32.

        * platform/image-decoders/ImageDecoder.h:
        (WebCore::ImageFrame::copyRowNTimes): The implementation was moved to ImageBackingStore::repeatFirstRow().
        (WebCore::ImageFrame::size): Gets the size of an image from its ImageBackingStore.
        (WebCore::ImageFrame::asNewNativeImage): Gets a NtaiveImagePtr from the ImageBackingStore.
        (WebCore::ImageFrame::backingStore): Returns a raw pointer to the ImageBackingStore.
        (WebCore::ImageFrame::hasBackingStore): Returns whether the ImageFrame has an ImageBackingStore.
        (WebCore::ImageFrame::originalFrameRect): Returns the frameRect of the image from its ImageBackingStore.
        (WebCore::ImageFrame::pixelAt): Delegates the call to the ImageBackingStore.
        (WebCore::ImageFrame::setPixel): Delegates the call to the ImageBackingStore.
        (WebCore::ImageFrame::blendPixel): Delegates the call to the ImageBackingStore.
        
        (WebCore::ImageDecoder::setSize): setSize() now takes an IntSize.
        (WebCore::ImageFrame::setOriginalFrameRect): Deleted. Moved to ImageDecoder.cpp.
        (WebCore::ImageFrame::setRGBA): Deleted. Renamed to ImageFrame::setPixel().
        (WebCore::ImageFrame::getAddr): Deleted. Renamed to ImageFrame::pixelAt().
        (WebCore::ImageFrame::hasPixelData): Deleted. Renamed to ImageFrame::hasBackingStore().
        (WebCore::ImageFrame::fixPointUnsignedMultiply): Deleted.
        (WebCore::ImageFrame::divide255): Deleted. Replaced by fastDivideBy255() from Color.h.
        (WebCore::ImageFrame::overRGBA): Deleted. Renamed to ImageFrame::blendPixel().
        (WebCore::ImageFrame::width): Deleted.
        (WebCore::ImageFrame::height): Deleted.
        (WebCore::ImageDecoder::isOverSize): Deleted. Moved to ImageBackingStore::isOverSize().

        * platform/image-decoders/bmp/BMPImageReader.cpp:
        (WebCore::BMPImageReader::decodeBMP):
        (WebCore::BMPImageReader::processInfoHeader):
        (WebCore::BMPImageReader::processNonRLEData):
        * platform/image-decoders/bmp/BMPImageReader.h:
        (WebCore::BMPImageReader::setI):
        (WebCore::BMPImageReader::setPixel):
        (WebCore::BMPImageReader::fillRGBA):
        (WebCore::BMPImageReader::setRGBA): Deleted.
        * platform/image-decoders/cairo/ImageBackingStoreCairo.cpp: Added.
        (WebCore::ImageBackingStore::image):
        * platform/image-decoders/cairo/ImageDecoderCairo.cpp: Removed.
        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::setSize):
        (WebCore::GIFImageDecoder::haveDecodedRow):
        (WebCore::GIFImageDecoder::initFrameBuffer):
        * platform/image-decoders/gif/GIFImageDecoder.h:
        * platform/image-decoders/gif/GIFImageReader.cpp:
        (GIFImageReader::parse):
        * platform/image-decoders/ico/ICOImageDecoder.cpp:
        (WebCore::ICOImageDecoder::setSize):
        (WebCore::ICOImageDecoder::processDirectoryEntries):
        * platform/image-decoders/ico/ICOImageDecoder.h:
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageReader::decode):
        (WebCore::JPEGImageDecoder::setSize):
        (WebCore::setPixel):
        (WebCore::JPEGImageDecoder::outputScanlines):
        * platform/image-decoders/jpeg/JPEGImageDecoder.h:
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::setSize):
        (WebCore::PNGImageDecoder::headerAvailable):
        (WebCore::setPixelRGB):
        (WebCore::setPixelRGBA):
        (WebCore::setPixelPremultipliedRGBA):
        (WebCore::PNGImageDecoder::rowAvailable):
        (WebCore::PNGImageDecoder::initFrameBuffer):
        (WebCore::PNGImageDecoder::frameComplete):
        * platform/image-decoders/png/PNGImageDecoder.h:
        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::decode):
        - Send an IntSize to ImageFrame::setSize() and ImageDecoder::setSize().
        - Replace ImageFrame::PixelData by RGBA32.
        - No need to call ImageFrame::setOriginalFrameRect() if this sets the
          frameRect to the entire image rectangle since this is done by default
          in ImageBackingStore::setSize().
        - ImageBackingStore::image() now replaces ImageFrame::asNewNativeImage().
        - ImageFrame::setPixel() now replaces ImageFrame::setRGBA().
        - ImageFrame::blendPixel() now replaces ImageFrame::overRGBA().
        - ImageFrame::pixelAt() now replaces ImageFrame::getAddr().

2016-09-12  Joseph Pecoraro  <pecoraro@apple.com>

        HTMLButtonElement.prototype.click should be HTMLElement.prototype.click
        https://bugs.webkit.org/show_bug.cgi?id=161874

        Reviewed by Chris Dumez.

        Test: fast/dom/HTMLButtonElement/click.html

        * html/HTMLButtonElement.idl:
        Remove the unnecessary 'click' definition. It already exists in HTMLElement.
        If this was needed for ObjC code generation on DOMHTMLButtonElement, then
        the extra definition is no longer needed now that ObjC bindings have moved.

2016-09-12  Alex Christensen  <achristensen@webkit.org>

        URLParser: Fix relative URLs containing only fragments
        https://bugs.webkit.org/show_bug.cgi?id=161882

        Reviewed by Brady Eidson.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):

2016-09-12  Alex Christensen  <achristensen@webkit.org>

        URLParser: Correctly handle relative URLs that are just a scheme and a colon
        https://bugs.webkit.org/show_bug.cgi?id=161876

        Reviewed by Brady Eidson.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):

2016-09-12  Dean Jackson  <dino@apple.com>

        Remove OptionalColor
        https://bugs.webkit.org/show_bug.cgi?id=161853
        <rdar://problem/28252385>

        Reviewed by Alex Christensen.

        OptionalColor isn't used. The concept will be implemented
        in a different manner.

        * platform/graphics/Color.h:

2016-09-12  Simon Fraser  <simon.fraser@apple.com>

        Add Intersection Observer to the features.json file.

        * features.json:

2016-09-12  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Reduce uses of CGFonts in favor of CTFonts
        https://bugs.webkit.org/show_bug.cgi?id=161809

        Reviewed by Daniel Bates.

        Eventually, we want to remove the cgFont() member of PlatformFontData for both memory
        savings and conceptual clarity. Because there is no performance loss from moving from
        CGFontGetGlyphsForUnichars() to CTFontGetGlyphsForCharacters(), making this switch
        gets us closer to reducing the uses of cgFont().

        No new tests because there is no behavior change.

        * platform/graphics/Font.cpp:
        (WebCore::createAndFillGlyphPage):
        * platform/graphics/GlyphPage.h:
        (WebCore::GlyphData::GlyphData):
        * platform/graphics/mac/GlyphPageMac.cpp:
        (WebCore::shouldFillWithVerticalGlyphs):
        (WebCore::GlyphPage::fill):
        (WebCore::shouldUseCoreText): Deleted.

2016-09-12  Alex Christensen  <achristensen@webkit.org>

        Remove trailing control characters and spaces before parsing a URL
        https://bugs.webkit.org/show_bug.cgi?id=161870

        Reviewed by Tim Horton.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::bufferView):
        (WebCore::URLParser::parse):

2016-09-12  Chris Dumez  <cdumez@apple.com>

        window.performance object resets script-applied properties
        https://bugs.webkit.org/show_bug.cgi?id=137407

        Reviewed by Darin Adler.

        Make sure the window.performance wrapper stays alive for as long as the
        associated frame, similarly to what we do for window.screen.

        Test: fast/performance/performance-object-gc.html

        * page/Performance.idl:

2016-09-12  Saam Barati  <sbarati@apple.com>

        Add WebKit support for an option in Safari's debug menu similar to "Get Bytecode Profile" but for the Sampling Profiler's data
        https://bugs.webkit.org/show_bug.cgi?id=161785

        Reviewed by Tim Horton.

        * ForwardingHeaders/runtime/SamplingProfiler.h: Added.

2016-09-12  Dave Hyatt  <hyatt@apple.com>

        [CSS Parser] Add support for the parsing of the HTML sizes attribute
        https://bugs.webkit.org/show_bug.cgi?id=161868

        Reviewed by Dean Jackson.

        This patch adds the parsers for the sizes attribute. This code is heavily modified
        from Blink, and it really only makes use of the tokenization/parsing code. What is done
        with the results involves the same original code that we used over in SourceSizeList.cpp.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/parser/SizesAttributeParser.cpp: Added.
        (WebCore::SizesAttributeParser::computeLength):
        (WebCore::SizesAttributeParser::SizesAttributeParser):
        (WebCore::SizesAttributeParser::length):
        (WebCore::SizesAttributeParser::calculateLengthInPixels):
        (WebCore::SizesAttributeParser::mediaConditionMatches):
        (WebCore::SizesAttributeParser::parse):
        (WebCore::SizesAttributeParser::effectiveSize):
        (WebCore::SizesAttributeParser::effectiveSizeDefaultValue):
        * css/parser/SizesAttributeParser.h: Added.
        * css/parser/SizesCalcParser.cpp: Added.
        (WebCore::SizesCalcParser::SizesCalcParser):
        (WebCore::SizesCalcParser::result):
        (WebCore::operatorPriority):
        (WebCore::SizesCalcParser::handleOperator):
        (WebCore::SizesCalcParser::appendNumber):
        (WebCore::SizesCalcParser::appendLength):
        (WebCore::SizesCalcParser::appendOperator):
        (WebCore::SizesCalcParser::calcToReversePolishNotation):
        (WebCore::operateOnStack):
        (WebCore::SizesCalcParser::calculate):
        * css/parser/SizesCalcParser.h: Added.
        (WebCore::SizesCalcValue::SizesCalcValue):
        (WebCore::SizesCalcParser::isValid):

2016-09-12  Jer Noble  <jer.noble@apple.com>

        Fix failing mediasource-play.html and mediasource-config-change-mp4-v-bitrate.html tests
        https://bugs.webkit.org/show_bug.cgi?id=161819

        Reviewed by Eric Carlson.

        Fixes tests: imported/w3c/web-platform-tests/media-source/mediasource-play.html
                     imported/w3c/web-platform-tests/media-source/mediasource-sourcebuffer-mode.html

        The newest revision of the web-platform-test suite for Media Source tests new behavior
        added to the MSE specification. Specifically, setting a MediaSource's duration will no
        longer implicitly truncate the source's active SourceBuffer objects.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::setDuration): Return exception if issued by setDurationInternal.
        (WebCore::MediaSource::setDurationInternal): Bring "duration change" algorithm up to spec.
        * Modules/mediasource/MediaSource.h:
        * Modules/mediasource/SampleMap.h:
        (WebCore::PresentationOrderSampleMap::begin): Add const accessor.
        (WebCore::PresentationOrderSampleMap::end): Ditto.
        (WebCore::PresentationOrderSampleMap::rbegin): Ditto.
        (WebCore::PresentationOrderSampleMap::rend): DItto.
        (WebCore::DecodeOrderSampleMap::begin): Ditto.
        (WebCore::DecodeOrderSampleMap::end): Ditto.
        (WebCore::DecodeOrderSampleMap::rbegin): Ditto.
        (WebCore::DecodeOrderSampleMap::rend): Ditto.
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::highestPresentationTimestamp): Added convenience method.
        (WebCore::SourceBuffer::removeCodedFrames): Drive-by fix; use .values() rather than
            pulling the value out of each HashMap iterator.
        * Modules/mediasource/SourceBuffer.h:

2016-09-12  Chris Dumez  <cdumez@apple.com>

        Switch remaining users of Document::inPageCache() to pageCacheState()
        https://bugs.webkit.org/show_bug.cgi?id=161865

        Reviewed by Darin Adler.

        Switch remaining users of Document::inPageCache() to pageCacheState() as
        the former one is confusing (given that it returns true while the
        pagehide event is being fired).

        * dom/Document.cpp:
        (WebCore::Document::scheduleStyleRecalc):
        (WebCore::Document::fontsNeedUpdate):
        (WebCore::Document::removeFocusedNodeOfSubtree):
        (WebCore::Document::setFocusedElement):
        (WebCore::Document::takeDOMWindowFrom):
        (WebCore::Document::topDocument):
        (WebCore::Document::webkitWillEnterFullScreenForElement):
        (WebCore::Document::webkitDidEnterFullScreenForElement):
        (WebCore::Document::webkitWillExitFullScreenForElement):
        (WebCore::Document::webkitDidExitFullScreenForElement):
        * dom/Document.h:
        (WebCore::Document::needsStyleRecalc):
        (WebCore::Document::inPageCache): Deleted.
        * history/CachedFrame.cpp:
        (WebCore::CachedFrame::CachedFrame):
        (WebCore::CachedFrame::clear):
        (WebCore::CachedFrame::destroy):
        * html/HTMLMediaElement.cpp:
        (WebCore::mediaElementIsAllowedToAutoplay):
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::createElementRenderer):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::addSubresourceLoader):
        * loader/HistoryController.cpp:
        (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::decrementScrollEventListenersCount):
        * page/FrameView.cpp:
        (WebCore::FrameView::layout):
        * page/animation/AnimationBase.cpp:
        (WebCore::AnimationBase::setNeedsStyleRecalc):
        * page/animation/AnimationController.cpp:
        (WebCore::AnimationControllerPrivate::updateAnimations):
        (WebCore::AnimationControllerPrivate::addElementChangeToDispatch):
        (WebCore::AnimationController::cancelAnimations):
        (WebCore::AnimationController::updateAnimations):
        * page/animation/ImplicitAnimation.cpp:
        (WebCore::ImplicitAnimation::sendTransitionEvent):
        * page/animation/KeyframeAnimation.cpp:
        (WebCore::KeyframeAnimation::sendAnimationEvent):
        * page/scrolling/AsyncScrollingCoordinator.cpp:
        (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
        * rendering/RenderElement.cpp:
        (WebCore::shouldRepaintForImageAnimation):
        (WebCore::RenderElement::newImageAnimationFrameAvailable):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::imageChanged):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateCompositingLayers):
        (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
        (WebCore::RenderLayerCompositor::didAddScrollingLayer):
        * rendering/RenderObject.cpp:
        (WebCore::printRenderTreeForLiveDocuments):
        (WebCore::printLayerTreeForLiveDocuments):
        * rendering/RenderView.cpp:
        (WebCore::RenderView::lazyRepaintTimerFired):
        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):

2016-09-12  Keith Rollin  <krollin@apple.com>

        Enhance Network logging
        https://bugs.webkit.org/show_bug.cgi?id=161771

        Reviewed by Antti Koivisto.

        Modify current logging statements to follow a consistent pattern in
        order to enhance readability and parsing.

        No new tests -- there are no tests for logging.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::prepareForLoadStart):
        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):

2016-09-12  Brady Eidson  <beidson@apple.com>

        Crash in com.apple.WebCore: WebCore::NavigatorGamepad::gamepadFromPlatformGamepad.
        <rdar://problem/28018073> and https://bugs.webkit.org/show_bug.cgi?id=161694

        Reviewed by Alex Christensen.

        No new tests (Caught by existing tests in some configurations).

        * Modules/gamepad/GamepadManager.cpp:
        (WebCore::GamepadManager::platformGamepadInputActivity): Null check.

2016-09-12  Alex Christensen  <achristensen@webkit.org>

        Fix more URLParser quirks
        https://bugs.webkit.org/show_bug.cgi?id=161834

        Reviewed by Brady Eidson.

        Added new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        Skip some tabs and newlines.  The spec says to remove them before processing the String,
        but to reduce allocations I am skipping them whenever we increment an iterator.
        Fix a few other quirks to be more web platform conformant.

2016-09-09  Alex Christensen  <achristensen@webkit.org>

        Optimize URLParser performance
        https://bugs.webkit.org/show_bug.cgi?id=161837

        Reviewed by Brady Eidson.

        No change in behavior.  Existing behavior covered by API tests and added a new API test.

        * platform/URLParser.cpp:
        (WebCore::isDefaultPort):
        Use switch statements instead of HashMap lookups.
        (WebCore::isSpecialScheme):
        Use switch statements instead of repeated String comparisons.
        (WebCore::URLParser::parsePort):
        Reduce String allocation.

2016-09-12  Simon Fraser  <simon.fraser@apple.com>

        Make -webkit-transition-* and -webkit-animation-* properties be pure aliases of the unprefixed ones
        https://bugs.webkit.org/show_bug.cgi?id=160478

        Reviewed by Dean Jackson.
        
        Remove the custom -webkit prefixed transition and animation properties, and just make
        them aliases of the unprefixed ones, as we do for transforms.
        
        -webkit-animation-trigger remains as the only prefixed-only animation property.
        
        This is mostly code deletion.

        Test: fast/css/longhand-overrides-shorthand-prefixing.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::propertyValue):
        * css/CSSProperty.h:
        (WebCore::prefixingVariantForPropertyId): Deleted.
        * css/CSSPropertyNames.in:
        * css/CSSToStyleMap.cpp:
        (WebCore::CSSToStyleMap::mapAnimationDelay):
        (WebCore::CSSToStyleMap::mapAnimationDirection):
        (WebCore::CSSToStyleMap::mapAnimationDuration):
        (WebCore::CSSToStyleMap::mapAnimationFillMode):
        (WebCore::CSSToStyleMap::mapAnimationIterationCount):
        (WebCore::CSSToStyleMap::mapAnimationName):
        (WebCore::CSSToStyleMap::mapAnimationPlayState):
        (WebCore::CSSToStyleMap::mapAnimationProperty):
        (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
        * css/PropertySetCSSStyleDeclaration.cpp:
        (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
        (WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
        * css/StyleProperties.cpp:
        (WebCore::StyleProperties::getPropertyValue):
        (WebCore::MutableStyleProperties::removeShorthandProperty):
        (WebCore::StyleProperties::asText):
        * css/StylePropertyShorthand.cpp:
        (WebCore::animationShorthandForParsing):
        * css/StylePropertyShorthand.h:
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::styleForKeyframe):
        * css/parser/CSSParser.cpp:
        (WebCore::CSSParser::parseValue):
        (WebCore::CSSParser::parseAnimationShorthand):
        (WebCore::CSSParser::parseTransitionShorthand):
        (WebCore::CSSParser::parseAnimationProperty):
        (WebCore::CSSParser::addPropertyWithPrefixingVariant): Deleted.
        * css/parser/CSSParser.h:
        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlPanelElement::makeOpaque):
        (WebCore::MediaControlPanelElement::makeTransparent):

2016-09-12  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed build fix after r205090.

        * platform/cf/MediaAccessibilitySoftLink.cpp:

2016-09-12  Javier Fernandez  <jfernandez@igalia.com>

        [css-align] Initial values are parsed as invalid for some Alignment properties
        https://bugs.webkit.org/show_bug.cgi?id=161303

        Reviewed by Darin Adler.

        Due to the implementation of the new CSS Box Alignment specification,
        some properties have now new values allowed, which are not valid
        according to the Flexible Box Layout specification.

        In r205102 we have get back the keywordID parsing, originally implemented for
        the Flexbible Box Layout specification. Even though the new valued would be
        parsed as invalid when they are set, the 'initial' values will be assigned
        in any case.

        This patch verifies that the 'initial' values depend on whether the Grid
        Layout is enabled or not and verifying such values are parsed as valid.

        Additionally, it gets back as well they keywordID parsing for the Content
        Alignment properties (align-content and justify-content). This required to
        touch a bit the StyleBuilderConverter logic, since we will have to deal with
        either the complex CSSContentDistributionValue complex or the  simpler
        CSSPrimitiveValue.

        Test: fast/css/ensure-flexbox-compatibility-with-initial-values.html

        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertContentAlignmentData): Handling a primitive value if Grid Layout is not enabled.
        * css/parser/CSSParser.cpp:
        (WebCore::isValidKeywordPropertyAndValue): Simpler parsing of alignment properties if Grid Layout is not enabled.
        (WebCore::isKeywordPropertyID): Alignment properties are defined as keyword if Grid Layout is no enabled.
        (WebCore::CSSParser::parseValue): Assert Grid Layout is enabled when using the complex parsing.
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::isCSSGridLayoutEnabled): Checking out the Grid Layout runtime flags.
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::initialDefaultAlignment): Initial value will depend on whether Grid Layout is enabled or not.
        (WebCore::RenderStyle::initialContentAlignment): Initial value will depend on whether Grid Layout is enabled or not.

2016-09-12  Chris Dumez  <cdumez@apple.com>

        ol.start may return incorrect value for reversed lists when not explicitly set
        https://bugs.webkit.org/show_bug.cgi?id=161713

        Reviewed by Ryosuke Niwa.

        Fix style nit after r205689.

        * html/HTMLOListElement.cpp:
        (WebCore::HTMLOListElement::itemCount):
        (WebCore::HTMLOListElement::itemCountAfterLayout):
        * html/HTMLOListElement.h:

2016-09-12  Chris Dumez  <cdumez@apple.com>

        Start using Document::pageCacheState() instead of Document::inPageCache()
        https://bugs.webkit.org/show_bug.cgi?id=161851

        Reviewed by Ryosuke Niwa.

        Start using Document::pageCacheState() instead of Document::inPageCache()
        as the latter one is confusing (given that it is true when firing the
        pagehide event, when the document is about to enter page cache).

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::closeURL):
        (WebCore::FrameLoader::clear):
        (WebCore::FrameLoader::dispatchUnloadEvents):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load):
        * page/Page.cpp:
        (WebCore::incrementFrame): Deleted.
        * page/Page.h:

2016-09-11  Chris Dumez  <cdumez@apple.com>

        HTMLTrackElement.kind's invalid value default should be the metadata state
        https://bugs.webkit.org/show_bug.cgi?id=161840

        Reviewed by Eric Carlson.

        HTMLTrackElement.kind's invalid value default should be the metadata state,
        not the subtitles state:
        - https://html.spec.whatwg.org/#attr-track-kind

        Chrome agrees with the specification.

        No new tests, rebaselined existing tests.

        * html/track/TextTrack.cpp:
        (WebCore::TextTrack::setKindKeywordIgnoringASCIICase):

2016-09-11  Dave Hyatt  <hyatt@apple.com>

        [CSS Parser] Add the main parser implementation
        https://bugs.webkit.org/show_bug.cgi?id=161813

        Reviewed by Dean Jackson.

        This patch adds the main CSSParserImpl that handles stylesheet and rule parsing. All parsing starts with this
        class (it will eventually be invoked from the CSSParser). This patch also adds @supports parsing.

        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSKeyframeRule.cpp:
        (WebCore::StyleKeyframe::StyleKeyframe):
        * css/CSSKeyframeRule.h:
        * css/StyleRule.cpp:
        (WebCore::StyleRuleBase::destroy):
        (WebCore::StyleRuleBase::copy):
        (WebCore::StyleRuleBase::createCSSOMWrapper):
        (WebCore::StyleRuleCharset::StyleRuleCharset):
        (WebCore::StyleRuleCharset::~StyleRuleCharset):
        (WebCore::StyleRuleNamespace::StyleRuleNamespace):
        (WebCore::StyleRuleNamespace::~StyleRuleNamespace):
        * css/StyleRule.h:
        (WebCore::StyleRuleBase::isNamespaceRule):
        (isType):
        (WebCore::StyleRuleBase::isKeyframesRule): Deleted.
        * css/StyleSheetContents.cpp:
        (WebCore::traverseSubresourcesInRules):
        * css/parser/CSSParserImpl.cpp: Added.
        (WebCore::CSSParserImpl::CSSParserImpl):
        (WebCore::CSSParserImpl::parseValue):
        (WebCore::CSSParserImpl::parseVariableValue):
        (WebCore::filterProperties):
        (WebCore::createStyleProperties):
        (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
        (WebCore::CSSParserImpl::parseDeclarationList):
        (WebCore::CSSParserImpl::parseRule):
        (WebCore::CSSParserImpl::parseStyleSheet):
        (WebCore::CSSParserImpl::parsePageSelector):
        (WebCore::CSSParserImpl::parseCustomPropertySet):
        (WebCore::CSSParserImpl::parseKeyframeKeyList):
        (WebCore::CSSParserImpl::supportsDeclaration):
        (WebCore::CSSParserImpl::parseDeclarationListForInspector):
        (WebCore::CSSParserImpl::parseStyleSheetForInspector):
        (WebCore::computeNewAllowedRules):
        (WebCore::CSSParserImpl::consumeRuleList):
        (WebCore::CSSParserImpl::consumeAtRule):
        (WebCore::CSSParserImpl::consumeQualifiedRule):
        (WebCore::consumeStringOrURI):
        (WebCore::CSSParserImpl::consumeCharsetRule):
        (WebCore::CSSParserImpl::consumeImportRule):
        (WebCore::CSSParserImpl::consumeNamespaceRule):
        (WebCore::CSSParserImpl::consumeMediaRule):
        (WebCore::CSSParserImpl::consumeSupportsRule):
        (WebCore::CSSParserImpl::consumeViewportRule):
        (WebCore::CSSParserImpl::consumeFontFaceRule):
        (WebCore::CSSParserImpl::consumeKeyframesRule):
        (WebCore::CSSParserImpl::consumePageRule):
        (WebCore::CSSParserImpl::consumeKeyframeStyleRule):
        (WebCore::observeSelectors):
        (WebCore::CSSParserImpl::consumeStyleRule):
        (WebCore::CSSParserImpl::consumeDeclarationList):
        (WebCore::CSSParserImpl::consumeDeclaration):
        (WebCore::CSSParserImpl::consumeVariableValue):
        (WebCore::CSSParserImpl::consumeDeclarationValue):
        (WebCore::CSSParserImpl::consumeKeyframeKeyList):
        * css/parser/CSSParserImpl.h: Added.
        * css/parser/CSSParserValues.cpp:
        (WebCore::CSSParserSelector::parsePagePseudoSelector):
        * css/parser/CSSParserValues.h:
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::CSSPropertyParser::parseValue):
        * css/parser/CSSSupportsParser.cpp: Added.
        (WebCore::CSSSupportsParser::supportsCondition):
        (WebCore::CSSSupportsParser::consumeCondition):
        (WebCore::CSSSupportsParser::consumeNegation):
        (WebCore::CSSSupportsParser::consumeConditionInParenthesis):
        * css/parser/CSSSupportsParser.h: Added.
        (WebCore::CSSSupportsParser::CSSSupportsParser):

2016-09-11  Tim Horton  <timothy_horton@apple.com>

        Candidates that don't end in spaces shouldn't have spaces arbitrarily appended to them
        https://bugs.webkit.org/show_bug.cgi?id=161846
        <rdar://problem/28245097>

        Reviewed by Beth Dakin.

        Tests: editing/mac/spelling/accept-candidate-without-adding-space.html,
               editing/mac/spelling/accept-candidate-allows-autocorrect-on-next-word.html

        * editing/Editor.cpp:
        (WebCore::Editor::handleAcceptedCandidate):
        Stop appending a space just because the candidate doesn't end in a space.
        There are languages where that doesn't make sense, and the platform
        guarantees that candidates will always have spaces if they need them.

        Also, adjust the way we compute the AcceptedCandidate document marker range.
        There were two problems with the existing code: it expanded outward from
        the post-insertion cursor in *both* directions, instead of just backwards,
        and it used the length of the replaced text, not the length of the newly
        inserted text (more of the confusion mentioned in r205765).

2016-09-10  Chris Dumez  <cdumez@apple.com>

        parseHTMLInteger() should take a StringView in parameter
        https://bugs.webkit.org/show_bug.cgi?id=161669

        Reviewed by Ryosuke Niwa.

        parseHTMLInteger() should take a StringView in parameter instead of a
        const String&.

        * css/parser/CSSParser.cpp:
        (WebCore::CSSParser::parseFontFaceSrcLocal):
        * css/parser/CSSParserValues.h:
        (WebCore::CSSParserString::toStringView):
        Add toStringView() to avoid unnecessarily constructing a String for
        calling StringBuilder::append().

        * html/parser/HTMLParserIdioms.cpp:
        (WebCore::parseHTMLInteger):
        (WebCore::parseHTMLNonNegativeInteger):
        (WebCore::parseHTTPRefreshInternal):
        * html/parser/HTMLParserIdioms.h:
        (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
        (WebCore::limitToOnlyHTMLNonNegative):
        Take a StringView in parameter instead of a const String&.

        * platform/sql/SQLiteStatement.cpp:
        (WebCore::SQLiteStatement::isColumnDeclaredAsBlob):
        Avoid unnecessarily constructing a String to call equalLettersIgnoringASCIICase()
        by leveraging the StringView constructor taking a 'const char*' in parameter.

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::constructTextRun):
        * rendering/RenderBlock.h:
        Add constructTextRun() overload taking an AtomicString. It was otherwise ambiguous
        because both a String or a StringView could be constructed from an AtomicString.

        * page/CaptionUserPreferencesMediaAF.cpp:
        (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
        (WebCore::buildDisplayStringForTrackBase):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::mediaControlsStyleSheet):
        (WebCore::RenderThemeMac::mediaControlsScript):
        Explicitly construct a String from NSString / CFStringRef types as such calls are
        now ambiguous.

2016-09-10  Chris Dumez  <cdumez@apple.com>

        It is possible for Document::m_frame pointer to become stale
        https://bugs.webkit.org/show_bug.cgi?id=161812
        <rdar://problem/27745023>

        Reviewed by Ryosuke Niwa.

        Document::m_frame is supposed to get cleared by Document::prepareForDestruction().
        The Frame destructor calls Frame::setView(nullptr) which is supposed to call the
        prepareForDestruction() on the Frame's associated document. However,
        Frame::setView(nullptr) was calling prepareForDestruction() only if
        Document::inPageCache() returned true. This is because, we allow Documents to
        stay alive in the PageCache even though they don't have a frame.

        The issue is that Document::m_inPageCache flag was set to true right before
        firing the pagehide event, so technically before really entering PageCache.
        Therefore, we can run into problems if a Frame gets destroyed by a pagehide
        EventHandler because ~Frame() will not call Document::prepareForDestruction()
        due to Document::m_inPageCache being true. After the frame is destroyed,
        Document::m_frame becomes stale and any action on the document will likely
        lead to crashes (such as the one in the layout test and the radar which
        happens when trying to unregister event listeners from the document).

        The solution adopted in this patch is to replace the m_inPageCache boolean
        with a m_pageCacheState enumeration that has 3 states:
        - NotInPageCache
        - AboutToEnterPageCache
        - InPageCache

        Frame::setView() / Frame::setDocument() were then updated to call
        Document::prepareForDestruction() on the associated document whenever
        the document's pageCacheState is not InPageCache. This means that we
        will now call Document::prepareForDestruction() when the document is
        being detached from its frame while firing the pagehide event.

        Note that I tried to keep this patch minimal. Therefore, I kept
        the Document::inPageCache() getter for now. I plan to switch all its
        calls sites to the new Document::pageCacheState() getter in a follow-up
        patch so that we can finally drop the confusing Document::inPageCache().

        Test: fast/history/pagehide-remove-iframe-crash.html

        * dom/Document.cpp:
        (WebCore::Document::Document):
        (WebCore::Document::~Document):
        (WebCore::Document::createRenderTree):
        (WebCore::Document::destroyRenderTree):
        (WebCore::Document::setFocusedElement):
        (WebCore::Document::setPageCacheState):
        (WebCore::Document::topDocument):
        * dom/Document.h:
        (WebCore::Document::pageCacheState):
        (WebCore::Document::inPageCache):
        * history/CachedFrame.cpp:
        (WebCore::CachedFrame::destroy):
        * history/PageCache.cpp:
        (WebCore::setPageCacheState):
        (WebCore::PageCache::addIfCacheable):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::stopAllLoaders):
        (WebCore::FrameLoader::open):
        * loader/HistoryController.cpp:
        (WebCore::HistoryController::invalidateCurrentItemCachedPage):
        * page/Frame.cpp:
        (WebCore::Frame::setView):

2016-09-10  Wenson Hsieh  <wenson_hsieh@apple.com>

        Apple.com keynote does not display media controls
        https://bugs.webkit.org/show_bug.cgi?id=161833
        <rdar://problem/28230123>

        Reviewed by Tim Horton.

        Tweaks the main content check so that we can distinguish between main content for the purposes of determining
        autoplay policy vs. main content for the purposes of showing media controls. Namely, we make the latter less
        restrictive than the former in terms of the maximum aspect ratio a video can have to be considered the right
        size for main content.

        New unit test in TestWebKitAPI.

        * html/HTMLMediaElement.cpp:
        (WebCore::mediaElementSessionInfoForSession):
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::canShowControlsManager):
        (WebCore::MediaElementSession::isLargeEnoughForMainContent):
        (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForMediaControls):
        (WebCore::isMainContentForPurposesOfAutoplay):
        (WebCore::isElementLargeEnoughForMainContent):
        (WebCore::MediaElementSession::updateIsMainContent):
        (WebCore::isMainContent): Deleted.
        * html/MediaElementSession.h:

2016-09-09  Alex Christensen  <achristensen@webkit.org>

        URLParser: Keep track of cannot-be-a-base-url according to spec
        https://bugs.webkit.org/show_bug.cgi?id=161830

        Reviewed by Tim Horton.

        Covered by new API tests.

        * platform/URL.cpp:
        (WebCore::URL::invalidate):
        * platform/URL.h:
        Add a boolean required by the spec.
        This will not add to sizeof(URL) because we already have some bit fields.
        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        (WebCore::URLParser::allValuesEqual):

2016-09-09  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r205771.
        https://bugs.webkit.org/show_bug.cgi?id=161823

        Broke Windows build (Requested by litherum on #webkit).

        Reverted changeset:

        "Remove unused member of GlyphBuffer"
        https://bugs.webkit.org/show_bug.cgi?id=161814
        http://trac.webkit.org/changeset/205771

2016-09-09  Alex Christensen  <achristensen@webkit.org>

        URLParser should convert ASCII hosts to lowercase
        https://bugs.webkit.org/show_bug.cgi?id=161820

        Reviewed by Geoffrey Garen.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::domainToASCII):
        The fast path for domains that are already ASCII and do not need punycode encoding
        should convert the domain to lowercase.
        This matches behavior in URL::parse if isCanonicalHostnameLowercaseForScheme is true,
        and RFC 5890.

2016-09-09  Myles C. Maxfield  <mmaxfield@apple.com>

        Remove unused member of GlyphBuffer
        https://bugs.webkit.org/show_bug.cgi?id=161814

        Reviewed by Simon Fraser.

        This m_offsets member never actually affected anything. It just made
        FontCascade::drawGlyphBuffer() slower.

        No new tests because there is no behavior change.

        * platform/graphics/FontCascade.cpp:
        (WebCore::FontCascade::drawGlyphBuffer):
        * platform/graphics/GlyphBuffer.h:
        (WebCore::GlyphBuffer::clear):
        (WebCore::GlyphBuffer::advanceAt):
        (WebCore::GlyphBuffer::add):
        (WebCore::GlyphBuffer::shrink):
        (WebCore::GlyphBuffer::swap):
        (WebCore::GlyphBuffer::offsetAt): Deleted.
        * platform/graphics/win/UniscribeController.cpp:
        (WebCore::UniscribeController::shapeAndPlaceItem):

2016-09-09  Tim Horton  <timothy_horton@apple.com>

        Text replacement candidates don't always overwrite the entire original string
        https://bugs.webkit.org/show_bug.cgi?id=161779
        <rdar://problem/28033492>

        Reviewed by Simon Fraser.

        New test: editing/mac/spelling/accept-candidate-replacing-multiple-words.html.

        * editing/Editor.cpp:
        (WebCore::Editor::contextRangeForCandidateRequest):
        Factor contextRangeForCandidateRequest out of the WebKits, into Editor.
        This just expands to paragraph boundaries from the cursor.

        (WebCore::Editor::selectTextCheckingResult):
        Add selectTextCheckingResult, which, given a TextCheckingResult,
        selects the range represented by the result's location and length, which
        indicate the portion of the context string that the result refers to.
        In the case of accepting a candidate, we want to select that range
        so that our insertion will overwrite it.

        (WebCore::Editor::handleAcceptedCandidate):
        Make use of selectTextCheckingResult instead of just assuming that we want
        to replace the word to the left of the insertion point.

        (WebCore::Editor::stringForCandidateRequest): Deleted.
        * editing/Editor.h:

        * testing/Internals.cpp:
        (WebCore::Internals::handleAcceptedCandidate):
        * testing/Internals.h:
        * testing/Internals.idl:
        Internals' handleAcceptedCandidate assumed (wrongly) that the length
        of a TextCheckerResult was the length of the candidate, when really it is
        the length of the text that the candidate would replace. Adjust this,
        and expose the replacement range to JavaScript, so we can test this.

2016-09-09  Brady Eidson  <beidson@apple.com>

        Soft-link GameController.framework.
        <rdar://problem/28219953> and https://bugs.webkit.org/show_bug.cgi?id=161802

        Reviewed by Brian Burg.

        No new tests (No change in behavior).

        * Configurations/WebCore.xcconfig:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
        (WebCore::GameControllerGamepadProvider::startMonitoringGamepads):

2016-09-09  Jiewen Tan  <jiewen_tan@apple.com>

        Rename Key to CryptoKey
        https://bugs.webkit.org/show_bug.cgi?id=161665
        <rdar://problem/28083391>

        Reviewed by Brent Fulgham.

        A link to the spec: https://www.w3.org/TR/WebCryptoAPI/#cryptokey-interface

        * crypto/CryptoKey.idl:
        Remove some unnecessary IDL attributes and reorder KeyType enum to match the spec.
        * crypto/CryptoKeyType.h:

2016-09-09  Alex Christensen  <achristensen@webkit.org>

        URLParser: Fix and optimize parsing file URLs ending with a host but no slash
        https://bugs.webkit.org/show_bug.cgi?id=161815

        Reviewed by Geoffrey Garen.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::bufferView):
        (WebCore::URLParser::copyURLPartsUntil):
        (WebCore::URLParser::parse):

2016-09-09  Alex Christensen  <achristensen@webkit.org>

        URLParser: Handle \ in path according to spec
        https://bugs.webkit.org/show_bug.cgi?id=161805

        Reviewed by Andy Estes.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):

2016-09-09  Youenn Fablet  <youenn@apple.com>

        TextTrackLoader should use FetchOptions::mode according its crossOrigin attribute
        https://bugs.webkit.org/show_bug.cgi?id=161792

        Reviewed by Eric Carlson.

        Covered by existing and updated tests.

        Updating text track loader to use fetch mode according crossOrigin value.

        Removed the check done in the case the crossOrigin value is not set.
        Previously cross-origin loads were forbidden, now this is authorized.
        This change allows aligning with the spec.
        Also, this check could be bypassed in the case of a same-origin URL redirecting to a cross-origin one.

        * loader/TextTrackLoader.cpp:
        (WebCore::TextTrackLoader::notifyFinished): Checking resource error in lieu of doing CORS checks on its own.
        (WebCore::TextTrackLoader::load): Using CachedResourceRequest::setAsPotentiallyCrossOrigin
        * loader/TextTrackLoader.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::loadFrom): Setting loading and status values as would be done when load is finished.
        (WebCore::CachedResource::setBodyDataFrom): Default implementation is to copy the shared buffer.
        * loader/cache/CachedResource.h:
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Enabling resource update when mode or origin is different for TextTrack resources.

2016-09-09  Alex Christensen  <achristensen@webkit.org>

        URLParser should parse URLs with non-special schemes
        https://bugs.webkit.org/show_bug.cgi?id=161786

        Reviewed by Andy Estes.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        There's no reason for a SchemeEndCheckForSlashes state now that we can copy iterators.
        It's not in the spec and not needed.
        Also, move things around a little so parsing special or non-special schemes
        followed by one or two slashes works correctly.

2016-09-09  Chris Dumez  <cdumez@apple.com>

        Regression(r186020): Null dereference in getStartDate()
        https://bugs.webkit.org/show_bug.cgi?id=161733

        Reviewed by Eric Carlson.

        Update HTMLMediaElement::getStartDate() to return NaN if m_player is null,
        instead of crashing.

        Test: fast/media/getStartDate-NaN.html

        * bindings/js/IDBBindingUtilities.cpp:
        (WebCore::toJS):
        Add a FIXME comment as this code is using jsDateOrNull() but should
        probably be using jsDate() as per:
        - http://w3c.github.io/IndexedDB/#request-convert-a-key-to-a-value

        * bindings/js/JSDOMBinding.cpp:
        (WebCore::jsDate):
        (WebCore::jsDateOrNull):
        * bindings/js/JSDOMBinding.h:
        - Rename jsDateOrNaN() to jsDate() as this is the default behavior. Also,
          return new Date(NaN) instead of NaN if the implementation returns NaN.
          The IDL says we should return a Date, not a number.
        - Update jsDateOrNull() to only return jsNull() if the native value is
          NaN, instead of doing so for every value that is not finite. Our
          convention is to use NaN as special value to represent null in JS.

        * bindings/scripts/CodeGeneratorJS.pm:
        (NativeToJSValue):
        When converting a native value (double) into a Date, rely on the fact
        that the type is nullable when deciding if we should call jsDate() or
        jsDateOrNull() to convert. This way, we no longe need a WebKit specific
        [TreatReturnedDateAs=Null|NaN] IDL extended attribute.

        * bindings/scripts/IDLAttributes.txt:
        * html/HTMLInputElement.idl:
        Mark valueAsDate attribute as nullable, as per the specification:
        - https://html.spec.whatwg.org/#htmlinputelement

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::getStartDate):
        Return NaN if m_player is null instead of crashing. The reason I decided
        to return NaN is because the specification [1] says to return a new Date
        object representing the current timeline offset. The spec of timeline
        offset [2] says that the initial timeline offset value is NaN.
        [1] https://html.spec.whatwg.org/#dom-media-getstartdate
        [2] https://html.spec.whatwg.org/#timeline-offset

        * bindings/scripts/IDLAttributes.txt:
        * html/HTMLMediaElement.idl:
        Drop [TreatReturnedDateAs] attribute as it is no longer supported.

2016-09-09  Youenn Fablet  <youenn@apple.com>

        ASSERTION FAILED: promise.inherits(JSPromise::info())
        https://bugs.webkit.org/show_bug.cgi?id=161632
        <rdar://problem/28184743>

        Reviewed by Mark Lam.

        Test: fetch/fetch-worker-crash.html

        * bindings/js/JSDOMPromise.h:
        (WebCore::callPromiseFunction): Returning early if created promise is null.
        Passing directly a DeferredWrapper to the generated code.
        * bindings/scripts/CodeGeneratorJS.pm: Updated to take a DeferredWrapper.
        (GenerateImplementation):
        (GenerateReturnParameters):
        * bindings/scripts/test/JS/JSTestObj.cpp: Rebasing expectations.
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):

2016-09-09  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Improve performance of glyph advance metrics gathering
        https://bugs.webkit.org/show_bug.cgi?id=161119

        Reviewed by Simon Fraser.

        Most of the glyphs in a GlyphPage are never read from. Therefore, we can get a performance boost
        by not populating as many items in the GlyphPage. Because of the performance characteristics of
        CTFontGetGlyphsForCharacters(), a better size for a GlyphPage is 16 items. This, coupled with
        using CTFontGetUnsummedAdvancesForGlyphsAndStyle(), causes between a 0.01%-0.5% speedup on PLT.

        No new tests because there is no behavior change.

        * platform/graphics/Font.cpp:
        (WebCore::Font::initCharWidths):
        (WebCore::Font::platformGlyphInit):
        (WebCore::createAndFillGlyphPage):
        * platform/graphics/Font.h:
        (WebCore::Font::widthForGlyph):
        * platform/graphics/GlyphMetricsMap.h:
        * platform/graphics/GlyphPage.h:
        * platform/graphics/cocoa/FontCocoa.mm:
        * platform/spi/cocoa/CoreTextSPI.h:
        (WebCore::Font::platformWidthForGlyph):
        (WebCore::canUseFastGlyphAdvanceGetter): Deleted.

2016-09-09  Antti Koivisto  <antti@apple.com>

        v3: WebContent crash due to RELEASE_ASSERT in WebCore: WebCore::StyleResolver::styleForElement
        https://bugs.webkit.org/show_bug.cgi?id=161689

        Reviewed by Andreas Kling.

        These crashes happen because synchronously triggered resource loads generate callbacks that may end up
        deleting the resource loader.

        Stop triggering resource loads from StyleResolver. Instead trigger them when applying style to render tree.

        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::~StyleResolver):

            Replace the RELEASE_ASSERT against deletion during resource loads by a general isDeleted assert.

        (WebCore::StyleResolver::styleForElement):
        (WebCore::StyleResolver::styleForKeyframe):
        (WebCore::StyleResolver::pseudoStyleForElement):
        (WebCore::StyleResolver::styleForPage):
        (WebCore::StyleResolver::applyMatchedProperties):
        (WebCore::StyleResolver::loadPendingResources): Deleted.
        * css/StyleResolver.h:
        * page/animation/KeyframeAnimation.cpp:
        (WebCore::KeyframeAnimation::KeyframeAnimation):
        (WebCore::KeyframeAnimation::resolveKeyframeStyles):

            Ensure resource load for all animation frames.

        * page/animation/KeyframeAnimation.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::createFor):
        (WebCore::RenderElement::initializeStyle):

            Load resources when renderer initializes a style.

        (WebCore::RenderElement::setStyle):
        (WebCore::RenderElement::getUncachedPseudoStyle):

            Load resources for pseudo styles.

        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::RenderImage):
        (WebCore::RenderImage::styleWillChange):

            Shuffle image resource initialization out from constructor so initializeStyle gets called before.

        * rendering/RenderImage.h:
        * rendering/style/StyleCachedImage.cpp:
        (WebCore::StyleCachedImage::StyleCachedImage):

            Track pending status with a bit instead of implicitly by the existence of CachedResource.
            This is useful for asserts.

        (WebCore::StyleCachedImage::load):
        (WebCore::StyleCachedImage::isPending):
        (WebCore::StyleCachedImage::addClient):
        (WebCore::StyleCachedImage::removeClient):
        (WebCore::StyleCachedImage::image):
        * rendering/style/StyleCachedImage.h:

2016-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>

        ScriptRunner should be driven by PendingScript rather than ScriptElement
        https://bugs.webkit.org/show_bug.cgi?id=161726

        Reviewed by Ryosuke Niwa.

        Tests: js/dom/document-write-in-error-event.html
               js/dom/document-write-in-load-event.html

        ScriptRunner is driven by ScriptElement::notifyFinished. While ScriptRunner is driven by this,
        HTMLScriptRunner does not use it. Instead, HTMLScriptRunner uses PendingScriptClient. As a result,
        ScriptElement::notifyFinished is used only when the script is annotated with "defer" or "async"
        while all the external script will load the LoadableScript. It is confusing.
        This patch removes ScriptElement::notifyFinished and use PendingScript's observability
        in ScriptRunner instead.

        This patch also fixes the behavior about ignore-destructive-writes counter[1]. When dispatching
        the load and error events, this ignore-destructive-writes counter should not be incremeneted by
        this execution. The added tests ensure this behavior.

        [1]: https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block

        * dom/ScriptElement.cpp: Drop LoadableScriptClient interface.
        (WebCore::ScriptElement::prepareScript): Do not use addClient. ScriptRunner use PendingScript::{setClient,clearClient} instead.
        (WebCore::ScriptElement::executeScriptForScriptRunner): IgnoreDestructiveWriteCountIncrementer will be done in ScriptElement::executeScript.
        So no need to do it here, that's duplicated.
        (WebCore::ScriptElement::~ScriptElement): Deleted. ScriptElement does not use addClient/removeClient.
        (WebCore::ScriptElement::stopLoadRequest): Deleted.
        (WebCore::ScriptElement::executeScriptForHTMLScriptRunner): Deleted. executeScriptForHTMLScriptRunner and executeScriptForScriptRunner are
        merged into executeScriptForRunner.
        (WebCore::ScriptElement::notifyFinished): Deleted.
        * dom/ScriptElement.h:
        (WebCore::ScriptElement::~ScriptElement):
        (WebCore::ScriptElement::willExecuteInOrder): Used in ScriptRunner to determine whether the script is async or defer.
        (WebCore::ScriptElement::willExecuteWhenDocumentFinishedParsing): Deleted.
        * dom/ScriptRunner.cpp:
        (WebCore::ScriptRunner::~ScriptRunner): HashSet's iterator will return `const PendingScript&`.
        Another option is using HashSet<RefPtr<PendingScript>>. Here, we use a little bit weired const_cast.
        (WebCore::ScriptRunner::queueScriptForExecution): Use PendingScript::setClient to wait loading.
        (WebCore::ScriptRunner::notifyFinished): Notify the script ready here.
        (WebCore::ScriptRunner::timerFired): Use executeScriptForScriptRunner.
        (WebCore::ScriptRunner::notifyScriptReady): Deleted.
        * dom/ScriptRunner.h:
        * html/parser/HTMLScriptRunner.cpp:
        (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Use executeScriptForScriptRunner.

2016-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] HashTable's rehash is not compatible to Ref<T> and ASan
        https://bugs.webkit.org/show_bug.cgi?id=161763

        Reviewed by Mark Lam.

        Include wtf/text/StringHash.h to avoid linking errors in EFL port.

        * loader/ResourceLoadStatistics.h:

2016-09-08  Chris Dumez  <cdumez@apple.com>

        HTMLObjectElement.hspace / vspace attributes should be unsigned
        https://bugs.webkit.org/show_bug.cgi?id=161766

        Reviewed by Ryosuke Niwa.

        HTMLObjectElement.hspace / vspace attributes should be unsigned:
        - https://html.spec.whatwg.org/#HTMLObjectElement-partial

        Firefox agrees with the specification but those were signed in WebKit.

        No new tests, rebaselined existing test.

        * html/HTMLObjectElement.idl:

2016-09-08  Chris Dumez  <cdumez@apple.com>

        HTMLObjectElement.codebase attribute should reflect as a URL
        https://bugs.webkit.org/show_bug.cgi?id=161768

        Reviewed by Alex Christensen.

        HTMLObjectElement.codebase attribute should reflect as a URL:
        - https://html.spec.whatwg.org/#dom-applet-codebase

        Chrome and Firefox agree with the specification.

        No new test, rebaselined existing test.

        * html/HTMLObjectElement.idl:

2016-09-08  Chris Dumez  <cdumez@apple.com>

        ol.start may return incorrect value for reversed lists when not explicitly set
        https://bugs.webkit.org/show_bug.cgi?id=161713

        Reviewed by Zalan Bujtas.

        ol.start may return incorrect value for reversed lists when not explicitly set.
        This is because we're supposed to return the number of rendered <li> child
        elements, which relies on layout. However, we did not make sure the layout is
        up-to-date before counting the number of li child elements. This patch fixes
        the issue.

        No new tests, rebaselined existing tests.

        * html/HTMLOListElement.h:

2016-09-08  Chris Dumez  <cdumez@apple.com>

        Add support for HTMLIframeElement.allowFullscreen attribute
        https://bugs.webkit.org/show_bug.cgi?id=161757

        Reviewed by Sam Weinig.

        Add support for HTMLIframeElement.allowFullscreen attribute:
        - https://html.spec.whatwg.org/#dom-iframe-allowfullscreen

        Firefox and Chrome already support it, unprefixed.

        Note that the HTMLIframeElement.allowFullscreen attribute reflects the
        allowfullscreen content attribute which we already support.

        Test: fullscreen/full-screen-iframe-allowFullscreen.html

        * html/HTMLIFrameElement.idl:

2016-09-08  Chris Dumez  <cdumez@apple.com>

        frame.longDesc / iframe.longDesc should reflect as a URL
        https://bugs.webkit.org/show_bug.cgi?id=161764

        Reviewed by Alex Christensen.

        frame.longDesc / iframe.longDesc should reflect as a URL:
        - https://html.spec.whatwg.org/#dom-iframe-longdesc
        - https://html.spec.whatwg.org/#dom-frame-longdesc

        They already do in Chrome and Firefox.

        No new tests, rebaselined existing tests.

        * html/HTMLFrameElement.idl:
        * html/HTMLIFrameElement.idl:

2016-09-08  Alex Christensen  <achristensen@webkit.org>

        URLParser: Handle \ in paths of special URLs according to spec
        https://bugs.webkit.org/show_bug.cgi?id=161781

        Reviewed by Tim Horton.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::bufferView):
        (WebCore::URLParser::copyURLPartsUntil):
        (WebCore::URLParser::parse):
        * platform/URLParser.h:

2016-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Move the BitmapImage platform dependent code to a new file named NativeImage[CG|Cairo].cpp
        https://bugs.webkit.org/show_bug.cgi?id=158684

        Reviewed by Simon Fraser.

        This is a refactoring patch. It moves the BitmapImage platform dependent
        code from BitmapImage to NativeImage[CG|Cairo].cpp. The new APIs are
        responsible of drawing a NativeImagePtr and answering some metadata queries.

        No new tests -- Code refactoring, no behavior change.

        * PlatformAppleWin.cmake:
        * PlatformEfl.cmake:
        * PlatformGTK.cmake:
        * PlatformMac.cmake:
        * PlatformWinCairo.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * loader/cache/MemoryCache.h:
        * loader/icon/IconDatabaseBase.h:
        * page/mac/TextIndicatorWindow.mm:
        (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
        (createContentCrossfadeAnimation):
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::BitmapImage):
        (WebCore::BitmapImage::destroyDecodedData):
        (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
        (WebCore::BitmapImage::dataChanged):
        (WebCore::BitmapImage::ensureFrameAtIndexIsCached):
        (WebCore::BitmapImage::frameImageAtIndex):
        (WebCore::BitmapImage::nativeImage):
        (WebCore::BitmapImage::nativeImageForCurrentFrame):
        (WebCore::BitmapImage::nativeImageOfSize):
        (WebCore::BitmapImage::framesNativeImages):
        (WebCore::BitmapImage::frameIsCompleteAtIndex):
        (WebCore::BitmapImage::frameDurationAtIndex):
        (WebCore::BitmapImage::frameHasAlphaAtIndex):
        (WebCore::BitmapImage::frameOrientationAtIndex):
        (WebCore::BitmapImage::singlePixelSolidColor):
        (WebCore::BitmapImage::draw):
        (WebCore::BitmapImage::drawPattern):
        (WebCore::BitmapImage::canAnimate):
        (WebCore::BitmapImage::clearTimer):
        (WebCore::BitmapImage::startTimer):
        (WebCore::BitmapImage::stopAnimation):
        (WebCore::BitmapImage::resetAnimation):
        (WebCore::BitmapImage::hasSingleSecurityOrigin): Deleted.
        (WebCore::BitmapImage::filenameExtension): Deleted.
        (WebCore::BitmapImage::ensureFrameIsCached): Deleted.
        * platform/graphics/BitmapImage.h:
        (WebCore::FrameData::FrameData):
        m_hasAlpha can be initialized with false because it is accessed only in
        BitmapImage::frameHasAlphaAtIndex() and it is guarded by m_haveMetadata.
        Both m_haveMetadata and m_hasAlpha are set in BitmapImage constructor
        and in BitmapImage::cacheFrame().
        
        (WebCore::FrameData::~FrameData):
        (WebCore::FrameData::clear):
        * platform/graphics/Icon.h:
        * platform/graphics/Image.h:
        (WebCore::Image::nativeImage):
        (WebCore::Image::nativeImageOfSize):
        (WebCore::Image::framesNativeImages):
        (WebCore::Image::orientationForCurrentFrame): Deleted.
        (WebCore::Image::getCGImageRef): Deleted.
        (WebCore::Image::getFirstCGImageRefOfSize): Deleted.
        (WebCore::Image::getCGImageArray): Deleted.
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::calculateMaximumSubsamplingLevel):
        (WebCore::ImageSource::size):
        (WebCore::ImageSource::sizeRespectingOrientation):
        * platform/graphics/ImageSource.h:
        * platform/graphics/MediaPlayer.h:
        * platform/graphics/NativeImage.h: Added.
        * platform/graphics/NativeImagePtr.h: Removed.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage):
        * platform/graphics/cairo/BitmapImageCairo.cpp: Removed.
        * platform/graphics/cairo/NativeImageCairo.cpp: Added.
        (WebCore::nativeImageSize):
        (WebCore::nativeImageHasAlpha):
        (WebCore::nativeImageSinglePixelSolidColor):
        (WebCore::subsamplingScale):
        (WebCore::drawNativeImage):
        (WebCore::clearNativeImageSubImages):
        * platform/graphics/cg/BitmapImageCG.cpp: Removed.
        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::ImageDecoder::size):
        * platform/graphics/cg/ImageDecoderCG.h:
        * platform/graphics/cg/NativeImageCG.cpp: Added.
        (WebCore::nativeImageSize):
        (WebCore::nativeImageHasAlpha):
        (WebCore::nativeImageSinglePixelSolidColor):
        (WebCore::subsamplingScale):
        (WebCore::drawNativeImage):
        (WebCore::clearNativeImageSubImages):
        * platform/graphics/cg/PatternCG.cpp:
        (WebCore::Pattern::createPlatformPattern):
        * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
        (TextTrackRepresentationCocoa::update):
        * platform/graphics/mac/ImageMac.mm:
        (WebCore::BitmapImage::getTIFFRepresentation):
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
        (WebCore::MockRealtimeVideoSourceMac::updatePlatformLayer):
        (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
        * platform/win/DragImageCGWin.cpp:
        (WebCore::createDragImageFromImage):

2016-09-08  Alex Christensen  <achristensen@webkit.org>

        URLParser: Parsing empty URLs with a base URL should return the base URL
        https://bugs.webkit.org/show_bug.cgi?id=161777

        Reviewed by Tim Horton.

        Covered by an API test and progress towards passing all web platform tests when using URLParser.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):

2016-09-08  Alex Christensen  <achristensen@webkit.org>

        URLParser failures should preserve the original input string
        https://bugs.webkit.org/show_bug.cgi?id=161769

        Reviewed by Tim Horton.

        No new tests, but covered by updates to API tests.
        This also represents many newly passing web platform tests when using URLParser.

        * platform/URLParser.cpp:
        (WebCore::URLParser::failure):
        (WebCore::URLParser::parse):
        * platform/URLParser.h:

2016-09-08  Alex Christensen  <achristensen@webkit.org>

        URLParser should parse URLs with a user but no password
        https://bugs.webkit.org/show_bug.cgi?id=161773

        Reviewed by Brady Eidson.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parseAuthority):

2016-09-08  Alex Christensen  <achristensen@webkit.org>

        Fix URLs after r205669.
        https://bugs.webkit.org/show_bug.cgi?id=161731

        * platform/URLParser.cpp:
        (WebCore::URLParser::enabled):
        I accidentally committed enabling the URLParser by default.  Not ready yet.

2016-09-08  Chris Dumez  <cdumez@apple.com>

        Align proto getter / setter behavior with other browsers
        https://bugs.webkit.org/show_bug.cgi?id=161455

        Reviewed by Saam Barati.

        Align cross-origin __proto__ getter / setter behavior with other
        browsers and the specification:

        [[SetPrototypeOf]] should throw a TypeError:
        - https://html.spec.whatwg.org/#windowproxy-setprototypeof
        - https://html.spec.whatwg.org/#location-setprototypeof
        - https://tc39.github.io/ecma262/#sec-object.setprototypeof (step 5)

        [[GetPrototypeOf]] should return null cross-origin:
        - https://html.spec.whatwg.org/#windowproxy-getprototypeof
        - https://html.spec.whatwg.org/#location-getprototypeof

        Test: js/dom/setPrototypeOf-location-window.html

        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::JSDOMWindowBase): Deleted.
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::setPrototype):
        (WebCore::JSDOMWindow::getPrototype):
        (WebCore::JSDOMWindow::preventExtensions):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::setPrototype):
        (WebCore::JSLocation::getPrototype):
        * bindings/js/JSWorkerGlobalScopeBase.cpp:
        (WebCore::JSWorkerGlobalScopeBase::supportsRichSourceInfo): Deleted.
        * bindings/js/JSWorkerGlobalScopeBase.h:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        * bindings/scripts/IDLAttributes.txt:
        * page/DOMWindow.idl:
        * page/Location.idl:

2016-09-08  Alex Christensen  <achristensen@webkit.org>

        URLParser should parse ports after IPv4 and IPv6 hosts
        https://bugs.webkit.org/show_bug.cgi?id=161731

        Reviewed by Brady Eidson.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parsePort):
        (WebCore::URLParser::parseHost):

2016-09-08  Alex Christensen  <achristensen@webkit.org>

        URLParser should correctly handle \ in path
        https://bugs.webkit.org/show_bug.cgi?id=161762

        Reviewed by Brady Eidson.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::isSpecialScheme):
        (WebCore::bufferView):
        (WebCore::URLParser::parse):
        Treat \ as / in the path of special URLs as described in the spec and tested in web platform tests.
        Also a slight performance improvement using StringViews instead of copied Strings.

2016-09-08  Alex Christensen  <achristensen@webkit.org>

        URLParser should handle URLs with empty authority
        https://bugs.webkit.org/show_bug.cgi?id=161711

        Reviewed by Brady Eidson.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        (WebCore::URLParser::parseAuthority):

2016-09-08  Chris Dumez  <cdumez@apple.com>

        HTMLImageElement.hspace / vspace attributes should be unsigned
        https://bugs.webkit.org/show_bug.cgi?id=161754

        Reviewed by Alex Christensen.

        HTMLImageElement.hspace / vspace attributes should be unsigned:
        - https://html.spec.whatwg.org/#HTMLImageElement-partial

        Firefox agrees with the specification, however, those were signed in
        webKit.

        No new tests, rebaselined existing test.

        * html/HTMLImageElement.idl:

2016-09-08  Chris Dumez  <cdumez@apple.com>

        Update parseHTMLNonNegativeInteger() to return an unsigned value
        https://bugs.webkit.org/show_bug.cgi?id=161759

        Reviewed by Alex Christensen.

        Update parseHTMLNonNegativeInteger() to return an unsigned value instead
        of a signed one as the value can never be negative.

        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::parseBorderWidthAttribute):
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::width):
        (WebCore::HTMLImageElement::height):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::maxLengthAttributeChanged):
        (WebCore::HTMLInputElement::minLengthAttributeChanged):
        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
        (WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
        * html/ImageInputType.cpp:
        (WebCore::ImageInputType::height):
        (WebCore::ImageInputType::width):
        * html/parser/HTMLParserIdioms.cpp:
        (WebCore::parseHTMLNonNegativeInteger):
        (WebCore::parseHTTPRefreshInternal):
        * html/parser/HTMLParserIdioms.h:

2016-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Get rid of the color profile from ImageFrame and ImageDecoder
        https://bugs.webkit.org/show_bug.cgi?id=159699

        Reviewed by Simon Fraser.

        The color profile is set but it is never used.

        * platform/image-decoders/ImageDecoder.cpp:
        (WebCore::ImageFrame::setColorProfile): Deleted.
        * platform/image-decoders/ImageDecoder.h:
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageReader::decode):
        (WebCore::JPEGImageDecoder::outputScanlines):
        (WebCore::readColorProfile): Deleted.
        * platform/image-decoders/jpeg/JPEGImageDecoder.h:
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::headerAvailable):
        (WebCore::PNGImageDecoder::rowAvailable):
        (WebCore::readColorProfile): Deleted.

2016-09-08  Dave Hyatt  <hyatt@apple.com>

        [CSS Parser] Add support for new CSS selector parsing
        https://bugs.webkit.org/show_bug.cgi?id=161749

        Reviewed by Dean Jackson.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * contentextensions/ContentExtensionParser.cpp:
        (WebCore::ContentExtensions::isValidSelector):
        * css/CSSDefaultStyleSheets.cpp:
        (WebCore::parseUASheet):
        * css/CSSFontFaceSet.cpp:
        (WebCore::CSSFontFaceSet::matchingFaces):
        * css/CSSGrammar.y.in:
        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::selectorText):
        * css/CSSSelector.h:
        * css/DOMCSSNamespace.cpp:
        (WebCore::DOMCSSNamespace::supports):
        * css/FontFace.cpp:
        (WebCore::FontFace::parseString):
        (WebCore::FontFace::setVariant):
        * css/MediaList.cpp:
        (WebCore::MediaQuerySet::internalParse):
        (WebCore::MediaQuerySet::parse):
        * css/SelectorChecker.cpp:
        (WebCore::SelectorChecker::matchRecursively):
        * css/SelectorFilter.cpp:
        (WebCore::SelectorFilter::collectIdentifierHashes):
        * css/SelectorPseudoClassAndCompatibilityElementMap.in:
        * css/SelectorPseudoTypeMap.h:
        * css/SourceSizeList.cpp:
        (WebCore::parseSizesAttribute):
        * css/StyleProperties.cpp:
        (WebCore::MutableStyleProperties::MutableStyleProperties):
        * css/StyleProperties.h:
        * css/StyleRuleImport.cpp:
        (WebCore::StyleRuleImport::setCSSStyleSheet):
        * css/StyleSheetContents.cpp:
        (WebCore::StyleSheetContents::StyleSheetContents):
        (WebCore::StyleSheetContents::parserAddNamespace):
        (WebCore::StyleSheetContents::namespaceURIFromPrefix):
        (WebCore::StyleSheetContents::determineNamespace): Deleted.
        * css/StyleSheetContents.h:
        * css/WebKitCSSMatrix.cpp:
        (WebCore::WebKitCSSMatrix::setMatrixValue):
        * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
        * css/parser/CSSParser.cpp:
        (WebCore::strictCSSParserContext):
        (WebCore::CSSParserContext::CSSParserContext):
        (WebCore::CSSParser::parseColor):
        (WebCore::CSSParser::shouldAcceptUnitLessValues):
        (WebCore::CSSParser::parseValue):
        (WebCore::CSSParser::parseColumnWidth):
        (WebCore::CSSParser::parseColumnCount):
        (WebCore::CSSParser::parseFontWeight):
        (WebCore::CSSParser::parseColorParameters):
        (WebCore::CSSParser::parseHSLParameters):
        (WebCore::CSSParser::parseShadow):
        (WebCore::CSSParser::parseBorderImageSlice):
        (WebCore::CSSParser::parseBorderImageQuad):
        (WebCore::CSSParser::parseDeprecatedLinearGradient):
        (WebCore::CSSParser::parseLinearGradient):
        (WebCore::CSSParser::parseTransformValue):
        (WebCore::CSSParser::parseBuiltinFilterArguments):
        (WebCore::CSSParser::determineNameInNamespace):
        * css/parser/CSSParser.h:
        (WebCore::CSSParser::inStrictMode):
        (WebCore::CSSParser::inQuirksMode):
        * css/parser/CSSParserMode.h:
        (WebCore::isQuirksModeBehavior):
        (WebCore::isUASheetBehavior):
        (WebCore::isUnitLessLengthParsingEnabledForMode):
        (WebCore::isCSSViewportParsingEnabledForMode):
        (WebCore::strictToCSSParserMode):
        (WebCore::isStrictParserMode):
        * css/parser/CSSParserValues.cpp:
        (WebCore::CSSParserSelector::parsePseudoElementSelectorFromStringView):
        (WebCore::CSSParserSelector::parsePseudoClassSelectorFromStringView):
        (WebCore::CSSParserSelector::setSelectorList):
        (WebCore::CSSParserSelector::appendTagHistory):
        (WebCore::CSSParserSelector::releaseTagHistory):
        (WebCore::CSSParserSelector::isHostPseudoSelector):
        * css/parser/CSSParserValues.h:
        (WebCore::CSSParserSelector::match):
        (WebCore::CSSParserSelector::pseudoElementType):
        (WebCore::CSSParserSelector::selectorList):
        (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
        * css/parser/CSSPropertyParser.h:
        (WebCore::CSSPropertyParser::inQuirksMode):
        * css/parser/CSSSelectorParser.cpp: Added.
        (WebCore::CSSSelectorParser::parseSelector):
        (WebCore::CSSSelectorParser::CSSSelectorParser):
        (WebCore::CSSSelectorParser::consumeComplexSelectorList):
        (WebCore::CSSSelectorParser::consumeCompoundSelectorList):
        (WebCore::CSSSelectorParser::consumeComplexSelector):
        (WebCore::CSSSelectorParser::consumeCompoundSelector):
        (WebCore::CSSSelectorParser::consumeSimpleSelector):
        (WebCore::CSSSelectorParser::consumeName):
        (WebCore::CSSSelectorParser::consumeId):
        (WebCore::CSSSelectorParser::consumeClass):
        (WebCore::CSSSelectorParser::consumeAttribute):
        (WebCore::CSSSelectorParser::consumePseudo):
        (WebCore::CSSSelectorParser::consumeCombinator):
        (WebCore::CSSSelectorParser::consumeAttributeMatch):
        (WebCore::CSSSelectorParser::consumeAttributeFlags):
        (WebCore::CSSSelectorParser::consumeANPlusB):
        (WebCore::CSSSelectorParser::defaultNamespace):
        (WebCore::CSSSelectorParser::determineNamespace):
        (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
        (WebCore::CSSSelectorParser::addSimpleSelectorToCompound):
        (WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
        * css/parser/CSSSelectorParser.h: Added.
        (WebCore::CSSSelectorParser::DisallowPseudoElementsScope::DisallowPseudoElementsScope):
        (WebCore::CSSSelectorParser::DisallowPseudoElementsScope::~DisallowPseudoElementsScope):
        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
        * dom/StyledElement.cpp:
        (WebCore::StyledElement::rebuildPresentationAttributeStyle):
        * svg/SVGFontFaceElement.cpp:
        (WebCore::SVGFontFaceElement::SVGFontFaceElement):

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

        Don't run transitions to or from undefined Lengths
        https://bugs.webkit.org/show_bug.cgi?id=161750
        rdar://problem/28170460

        Reviewed by Zalan Bujtas.

        For properties like max-height whose default value is 'none', we would erroneously
        attempt to run transitions/animations, and then assert when one of the endpoints
        was undefined.

        So don't attempt to blend such Length values, just as do when they are auto.

        Fixes some transitions on apple.com and developer.apple.com.

        Test: transitions/transition-to-from-undefined.html

        * page/animation/CSSPropertyAnimation.cpp:
        (WebCore::CSSPropertyAnimation::blendProperties):
        * platform/Length.cpp:
        (WebCore::blend):

2016-09-08  Myles C. Maxfield  <mmaxfield@apple.com>

        Support new emoji group candidates
        https://bugs.webkit.org/show_bug.cgi?id=161664
        <rdar://problem/24802695>
        <rdar://problem/27666433>

        Reviewed by Simon Fraser.

        Support more emoji group candidates. This includes joining groups into a single glyph, as
        well as atomic deletions of the entire group when the backspace key is pressed.

        Tests: editing/deleting/delete-emoji.html:
               fast/text/emoji-num-glyphs.html:

        * platform/text/CharacterProperties.h:
        (WebCore::isEmojiGroupCandidate):

2016-09-08  Chris Dumez  <cdumez@apple.com>

        HTMLImageElement.width / height attributes should be unsigned
        https://bugs.webkit.org/show_bug.cgi?id=161730

        Reviewed by Alex Christensen.

        HTMLImageElement.width / height attributes should be unsigned as per
        the HTML specification:
        - https://html.spec.whatwg.org/#htmlimageelement

        However, they are signed in WebKit. Firefox agrees with the
        specification.

        No new tests, rebaselined existing test.

        * bindings/js/JSImageConstructor.cpp:
        (WebCore::JSImageConstructor::construct):
        (WebCore::createImageConstructor): Deleted.
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::createForJSConstructor):
        (WebCore::HTMLImageElement::width):
        (WebCore::HTMLImageElement::height):
        (WebCore::HTMLImageElement::setHeight):
        (WebCore::HTMLImageElement::setWidth):
        * html/HTMLImageElement.h:
        * html/HTMLImageElement.idl:
        * html/ImageDocument.cpp:
        (WebCore::ImageDocument::restoreImageSize):

2016-09-08  Filip Pizlo  <fpizlo@apple.com>

        Move JSMap/JSSet over to Auxiliary MarkedSpace
        https://bugs.webkit.org/show_bug.cgi?id=161744

        Reviewed by Saam Barati.

        No new tests because no change in behavior.

        * bindings/js/SerializedScriptValue.cpp:

2016-09-08  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r205652.
        https://bugs.webkit.org/show_bug.cgi?id=161748

        Crashing under ASan (Requested by yusukesuzuki on #webkit).

        Reverted changeset:

        "ScriptRunner should be driven by PendingScript rather than
        ScriptElement"
        https://bugs.webkit.org/show_bug.cgi?id=161726
        http://trac.webkit.org/changeset/205652

2016-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>

        ScriptRunner should be driven by PendingScript rather than ScriptElement
        https://bugs.webkit.org/show_bug.cgi?id=161726

        Reviewed by Ryosuke Niwa.

        ScriptRunner is driven by ScriptElement::notifyFinished. While ScriptRunner is driven by this,
        HTMLScriptRunner does not use it. Instead, HTMLScriptRunner uses PendingScriptClient. As a result,
        ScriptElement::notifyFinished is used only when the script is annotated with "defer" or "async"
        while all the external script will load the LoadableScript. It is confusing.
        This patch removes ScriptElement::notifyFinished and use PendingScript's observability
        in ScriptRunner instead.

        This patch also fixes the behavior about ignore-destructive-writes counter[1]. When dispatching
        the load and error events, this ignore-destructive-writes counter should not be incremeneted by
        this execution. The added tests ensure this behavior.

        [1]: https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block

        * dom/ScriptElement.cpp: Drop LoadableScriptClient interface.
        (WebCore::ScriptElement::prepareScript): Do not use addClient. ScriptRunner use PendingScript::{setClient,clearClient} instead.
        (WebCore::ScriptElement::executeScriptForScriptRunner): IgnoreDestructiveWriteCountIncrementer will be done in ScriptElement::executeScript.
        So no need to do it here, that's duplicated.
        (WebCore::ScriptElement::~ScriptElement): Deleted. ScriptElement does not use addClient/removeClient.
        (WebCore::ScriptElement::stopLoadRequest): Deleted.
        (WebCore::ScriptElement::executeScriptForHTMLScriptRunner): Deleted. executeScriptForHTMLScriptRunner and executeScriptForScriptRunner are
        merged into executeScriptForRunner.
        (WebCore::ScriptElement::notifyFinished): Deleted.
        * dom/ScriptElement.h:
        (WebCore::ScriptElement::~ScriptElement):
        (WebCore::ScriptElement::willExecuteInOrder): Used in ScriptRunner to determine whether the script is async or defer.
        (WebCore::ScriptElement::willExecuteWhenDocumentFinishedParsing): Deleted.
        * dom/ScriptRunner.cpp:
        (WebCore::ScriptRunner::~ScriptRunner): HashSet's iterator will return `const PendingScript&`.
        Another option is using HashSet<RefPtr<PendingScript>>. Here, we use a little bit weired const_cast.
        (WebCore::ScriptRunner::queueScriptForExecution): Use PendingScript::setClient to wait loading.
        (WebCore::ScriptRunner::notifyFinished): Notify the script ready here.
        (WebCore::ScriptRunner::timerFired): Use executeScriptForScriptRunner.
        (WebCore::ScriptRunner::notifyScriptReady): Deleted.
        * dom/ScriptRunner.h:
        * html/parser/HTMLScriptRunner.cpp:
        (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Use executeScriptForScriptRunner.

2016-09-08  Alex Christensen  <achristensen@webkit.org>

        Re-land r205580 after r205649 fixed the test failures
        https://bugs.webkit.org/show_bug.cgi?id=161668

        Re-landing changesets:

        "Punycode encode non-ascii hosts in URLParser"
        https://bugs.webkit.org/show_bug.cgi?id=161655
        http://trac.webkit.org/changeset/205521

        "Fix query-only and fragment-only relative URLs when using
        URLParser"
        https://bugs.webkit.org/show_bug.cgi?id=161657
        http://trac.webkit.org/changeset/205526

        "URLParser should parse / as a relative URL"
        https://bugs.webkit.org/show_bug.cgi?id=161667
        http://trac.webkit.org/changeset/205532

2016-09-08  Alex Christensen  <achristensen@webkit.org>

        Add range check in URLParser's serializeIPv6
        https://bugs.webkit.org/show_bug.cgi?id=161743

        Reviewed by David Kilzer.

        No new tests, but this fixes API tests in some release builds after
        the patch from https://bugs.webkit.org/show_bug.cgi?id=161668 is recommitted.

        * platform/URLParser.cpp:
        (WebCore::serializeIPv6):
        Don't go out of bounds.  Don't assume that the memory immediately after the end of the array will be empty.

2016-09-07  Alex Christensen  <achristensen@webkit.org>

        Roll out r205580 and r205582.
        https://bugs.webkit.org/show_bug.cgi?id=161668

        I need to figure out why this is failing on the bots before landing any more URLParser progress.

2016-09-07  Yusuke Suzuki  <utatane.tea@gmail.com>

        Unreviewed, EFL build fix after r205581
        https://bugs.webkit.org/show_bug.cgi?id=161674

        * dom/LoadableClassicScript.cpp:
        (WebCore::LoadableClassicScript::notifyFinished):

2016-09-07  Alex Christensen  <achristensen@webkit.org>

        Fix API tests after r205580
        https://bugs.webkit.org/show_bug.cgi?id=161668

        No new tests, but this fixes API tests on bots.

        * platform/URLParser.cpp:
        (WebCore::domainToASCII):
        This function seems to be appending characters to strings sometimes on some configurations.
        This definitely needs further investigation, but this will fix the bots, and nothing else
        will be affected because the URLParser is disabled by default.

2016-09-07  Yusuke Suzuki  <utatane.tea@gmail.com>

        Introduce abstract class LoadableScript for classic script and module graph
        https://bugs.webkit.org/show_bug.cgi?id=161674

        Reviewed by Ryosuke Niwa.

        To prepare for ScriptModuleGraph, we introduce the abstract class over the classic script
        and the module script, LoadableScript.

        No behavior change.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/LoadableClassicScript.cpp: Added. LoadableClassicScript is the derived class from the
        LoadableScript. In the module patch, we will introduce LoadableScriptModuleGraph which is also
        the derived class from the LoadableScript. It is used for the external classic script.
        A CachedResourceHandle used here alone does not prevent the underlying CachedResource from purging its
        data buffer. This LoadableClassicScript holds a client until this class is destroyed in order to
        guarantee that the data buffer will not be purged.
        (WebCore::LoadableClassicScript::create):
        (WebCore::LoadableClassicScript::LoadableClassicScript):
        (WebCore::LoadableClassicScript::~LoadableClassicScript):
        (WebCore::LoadableClassicScript::isLoaded):
        (WebCore::LoadableClassicScript::wasErrored): Beyond the boolean value, this can return the detail
        of the error. This detailed information will be used to report it to the inspector in the ScriptElement.
        (WebCore::LoadableClassicScript::wasCanceled):
        (WebCore::LoadableClassicScript::notifyFinished): Nosniff and cross-origin loading errors are handled here,
        instead of exposing CachedScript*.
        (WebCore::LoadableClassicScript::execute): Execute the cached script by using the given ScriptElement.
        * dom/LoadableClassicScript.h: Copied from Source/WebCore/dom/PendingScript.h.
        (isType):
        * dom/LoadableScript.cpp: Copied from Source/WebCore/dom/ScriptRunner.h. New wrapper for CachedScript
        and ScriptModuleGraph. We introduce a new wrapper to handle the above 2 things in the same way.
        We take the way to introduce a new wrapper instead of introducing a new interface that is inherited by
        CachedScript and ScriptModuleGraph. This is because ScriptModuleGraph is ref-counted while CachedScript
        is managed by CachedResourceHandle. While this patch does not contain ScriptModuleGraph part, this
        should be added in the module patch and at that time, this should be managed by this LoadableScript's
        subclass. And we introduce TypeCasts traits for LoadableScript to allow `is<>` and `downcast<>`.
        (WebCore::LoadableScript::addClient):
        (WebCore::LoadableScript::removeClient):
        (WebCore::LoadableScript::notifyClientFinished):
        * dom/LoadableScript.h: Copied from Source/WebCore/dom/ScriptRunner.h.
        (WebCore::LoadableScript::~LoadableScript):
        (WebCore::LoadableScript::isClassicScript):
        (WebCore::LoadableScript::isModuleGraph):
        * dom/LoadableScriptClient.h: Copied from Source/WebCore/dom/ScriptRunner.h.
        (WebCore::LoadableScriptClient::~LoadableScriptClient):
        * dom/PendingScript.cpp: Use LoadableScript instead of CachedScript.
        (WebCore::PendingScript::create):
        (WebCore::PendingScript::PendingScript):
        (WebCore::PendingScript::~PendingScript):
        (WebCore::PendingScript::loadableScript):
        (WebCore::PendingScript::notifyFinished):
        (WebCore::PendingScript::isLoaded):
        (WebCore::PendingScript::wasErrored):
        (WebCore::PendingScript::cachedScript): Deleted.
        * dom/PendingScript.h:
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::ScriptElement):
        (WebCore::ScriptElement::handleSourceAttribute): Change sourceUrl to sourceURL to be consistent.
        (WebCore::ScriptElement::prepareScript):
        (WebCore::ScriptElement::requestClassicScript): requestScript is renamed to requestClassicScript.
        (WebCore::ScriptElement::requestScriptWithCache): Extract the code requesting the
        CachedScript from requestScript. This will also be used by the module fetcher.
        (WebCore::ScriptElement::executeScript): Now inspector error reporting is also done in this function.
        When an error occurs, LoadableScript::wasErrored() returns the error which may include the information
        to report the error to the inspector. nosniff and cross-origin loading errors are now detected by the
        LoadableClassicScript and reported through this wasErrored().
        (WebCore::ScriptElement::stopLoadRequest):
        (WebCore::ScriptElement::executeScriptAndDispatchEvent):
        (WebCore::ScriptElement::executeScriptForScriptRunner): Move the code from ScriptRunner. This function
        calls removeClient(*this) because ScriptRunner is driven by the ScriptElement's notification. Only when using
        ScriptRunner, we call addClient(*this) for ScriptElement. This is tricky, we should refactor this in the separated
        bug (https://bugs.webkit.org/show_bug.cgi?id=161726).
        (WebCore::ScriptElement::executeScriptForHTMLScriptRunner): Move the code from HTMLScriptRunner.
        (WebCore::ScriptElement::notifyFinished):
        (WebCore::ScriptElement::requestScript): Deleted.
        (WebCore::ScriptElement::execute): Deleted.
        * dom/ScriptElement.h:
        (WebCore::ScriptElement::loadableScript):
        (WebCore::ScriptElement::cachedScript): Deleted.
        * dom/ScriptRunner.cpp:
        (WebCore::ScriptRunner::queueScriptForExecution):
        (WebCore::ScriptRunner::timerFired): Use ScriptElement::executeScriptForScriptRunner.
        * dom/ScriptRunner.h:
        * html/parser/HTMLScriptRunner.cpp:
        (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
        (WebCore::requestPendingScript):
        (WebCore::HTMLScriptRunner::requestParsingBlockingScript):
        (WebCore::HTMLScriptRunner::sourceFromPendingScript): Deleted.
        * html/parser/HTMLScriptRunner.h: Use ScriptElement::executeScriptForHTMLScriptRunner.
        * xml/parser/XMLDocumentParserLibxml2.cpp: Currently, we do nothing about XMLDocument in this patch.
        We should support the module script, but before that, we should refactor this pending script handling.
        (WebCore::XMLDocumentParser::endElementNs):

2016-09-07  Alex Christensen  <achristensen@webkit.org>

        Unreviewed, revert r205533.
        https://bugs.webkit.org/show_bug.cgi?id=161668

        Re-landing changesets:

        "Punycode encode non-ascii hosts in URLParser"
        https://bugs.webkit.org/show_bug.cgi?id=161655
        http://trac.webkit.org/changeset/205521

        "Fix query-only and fragment-only relative URLs when using
        URLParser"
        https://bugs.webkit.org/show_bug.cgi?id=161657
        http://trac.webkit.org/changeset/205526

        "URLParser should parse / as a relative URL"
        https://bugs.webkit.org/show_bug.cgi?id=161667
        http://trac.webkit.org/changeset/205532

2016-09-07  Simon Fraser  <simon.fraser@apple.com>

        Enable the <meter> element on iOS
        https://bugs.webkit.org/show_bug.cgi?id=161714
        rdar://problem/8978410

        Reviewed by Tim Horton.

        Define ENABLE_METER_ELEMENT unconditionally now.
        
        Rendering falls back to html.css rendering, which makes <meter> looks similar between
        macOS and iOS.

        Tested by enabling existing tests.

        * Configurations/FeatureDefines.xcconfig:

2016-09-07  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] applyConstraints pt. 2 - advanced constraints
        https://bugs.webkit.org/show_bug.cgi?id=161715
        <rdar://problem/28195461>

        Reviewed by Dean Jackson.

        Test: fast/mediastream/apply-constraints-advanced.html

        * platform/mediastream/MediaConstraints.cpp:
        (WebCore::MediaConstraint::create): Return Ref<>, not RefPtr<>.
        (WebCore::MediaConstraint::copy): New
        (WebCore::IntConstraint::copy): Ditto.
        (WebCore::DoubleConstraint::copy): Ditto.
        (WebCore::BooleanConstraint::copy): Ditto.
        (WebCore::StringConstraint::copy): Ditto.
        (WebCore::StringConstraint::fitnessDistance): New, compute the fitness distance between the
          constraint and the specified value.
        (WebCore::StringConstraint::merge): New, merge value into constraint.
        (WebCore::FlattenedConstraint::set): New, add or replace a constraint.
        (WebCore::FlattenedConstraint::merge): New, merge or add a constraint.
        * platform/mediastream/MediaConstraints.h:
        (WebCore::MediaConstraint::fitnessDistance):
        (WebCore::MediaConstraint::merge):
        (WebCore::NumericConstraint::nearlyEqual):
        (WebCore::FlattenedConstraint::isEmpty):
        (WebCore::FlattenedConstraint::begin):
        (WebCore::FlattenedConstraint::end):
        (WebCore::MediaConstraint::~MediaConstraint): Deleted.
        (WebCore::MediaConstraint::find): Deleted.
        (WebCore::MediaConstraint::getIdeal): Deleted.

        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::fitnessDistance): Return the fitness distance between the source
          capabilities and a constraint.
        (WebCore::applyNumericConstraint): New, apply a numeric constraint.
        (WebCore::RealtimeMediaSource::applyConstraint): Use applyNumericConstraint.
        (WebCore::RealtimeMediaSource::selectSettings): New, implement the SelectSettings algorithm
        (WebCore::RealtimeMediaSource::applyConstraints):
        (WebCore::RealtimeMediaSource::supportsConstraint): Deleted.
        (WebCore::value): Deleted.
        * platform/mediastream/RealtimeMediaSource.h:

2016-09-07  Mark Lam  <mark.lam@apple.com>

        Add CatchScope and force all exception checks to be via ThrowScope or CatchScope.
        https://bugs.webkit.org/show_bug.cgi?id=161498

        Reviewed by Geoffrey Garen.

        No new test because there is no behavior change in general except for 1 bug fix.
        That bug is already caught by existing tests with the introduction of the CatchScope.

        Fixes a bug in JSEventListener::handleEvent() where the exception thrown from
        a failed attempt to get the handleEvent callback is not handled.

        * ForwardingHeaders/runtime/CatchScope.h: Added.
        * Modules/encryptedmedia/CDMSessionClearKey.cpp:
        (WebCore::CDMSessionClearKey::update):
        * Modules/indexeddb/IDBObjectStore.cpp:
        (WebCore::IDBObjectStore::putOrAdd):
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
        * Modules/mediastream/SDPProcessor.cpp:
        (WebCore::SDPProcessor::callScript):
        * Modules/plugins/QuickTimePluginReplacement.mm:
        (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
        (WebCore::QuickTimePluginReplacement::installReplacement):
        * bindings/js/ArrayValue.cpp:
        (WebCore::ArrayValue::get):
        * bindings/js/Dictionary.cpp:
        (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
        * bindings/js/IDBBindingUtilities.cpp:
        (WebCore::toJS):
        * bindings/js/JSApplePaySessionCustom.cpp:
        (WebCore::JSApplePaySession::completeShippingMethodSelection):
        (WebCore::JSApplePaySession::completeShippingContactSelection):
        (WebCore::JSApplePaySession::completePaymentMethodSelection):
        * bindings/js/JSAudioTrackCustom.cpp:
        (WebCore::JSAudioTrack::setKind):
        (WebCore::JSAudioTrack::setLanguage):
        * bindings/js/JSBlobCustom.cpp:
        (WebCore::constructJSBlob):
        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
        (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
        * bindings/js/JSCommandLineAPIHostCustom.cpp:
        (WebCore::getJSListenerFunctions):
        * bindings/js/JSCryptoAlgorithmDictionary.cpp:
        (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
        (WebCore::getHashAlgorithm):
        (WebCore::createAesCbcParams):
        (WebCore::createAesKeyGenParams):
        (WebCore::createHmacParams):
        (WebCore::createHmacKeyParams):
        (WebCore::createRsaKeyGenParams):
        (WebCore::createRsaOaepParams):
        (WebCore::createRsaSsaParams):
        * bindings/js/JSCryptoKeySerializationJWK.cpp:
        (WebCore::getJSArrayFromJSON):
        (WebCore::getStringFromJSON):
        (WebCore::getBooleanFromJSON):
        (WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
        (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
        (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
        (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
        (WebCore::JSCryptoKeySerializationJWK::keyData):
        (WebCore::buildJSONForRSAComponents):
        (WebCore::addUsagesToJSON):
        (WebCore::JSCryptoKeySerializationJWK::serialize):
        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::constructElement):
        (WebCore::constructCustomElementSynchronously):
        (WebCore::JSCustomElementInterface::upgradeElement):
        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::getCustomElementCallback):
        (WebCore::JSCustomElementRegistry::define):
        (WebCore::whenDefinedPromise):
        (WebCore::JSCustomElementRegistry::whenDefined):
        * bindings/js/JSDOMBinding.cpp:
        (WebCore::valueToUSVString):
        (WebCore::reportException):
        (WebCore::reportCurrentException):
        (WebCore::setDOMException):
        (WebCore::hasIteratorMethod):
        (WebCore::toSmallerInt):
        (WebCore::toSmallerUInt):
        (WebCore::toInt32EnforceRange):
        (WebCore::toUInt32EnforceRange):
        (WebCore::toInt64EnforceRange):
        (WebCore::toUInt64EnforceRange):
        (WebCore::throwNotSupportedError):
        (WebCore::throwInvalidStateError):
        (WebCore::throwSecurityError):
        * bindings/js/JSDOMBinding.h:
        (WebCore::toJSSequence):
        (WebCore::toJS):
        (WebCore::jsFrozenArray):
        (WebCore::NativeValueTraits<String>::nativeValue):
        (WebCore::NativeValueTraits<unsigned>::nativeValue):
        (WebCore::NativeValueTraits<float>::nativeValue):
        (WebCore::NativeValueTraits<double>::nativeValue):
        (WebCore::toNativeArray):
        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::makeThisTypeErrorForBuiltins):
        (WebCore::makeGetterTypeErrorForBuiltins):
        * bindings/js/JSDOMGlobalObjectTask.cpp:
        * bindings/js/JSDOMIterator.h:
        (WebCore::iteratorForEach):
        * bindings/js/JSDOMPromise.cpp:
        (WebCore::rejectPromiseWithExceptionIfAny):
        * bindings/js/JSDOMPromise.h:
        (WebCore::callPromiseFunction):
        * bindings/js/JSDOMStringMapCustom.cpp:
        (WebCore::JSDOMStringMap::putDelegate):
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowMicrotaskCallback::call):
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::setLocation):
        (WebCore::JSDOMWindow::open):
        (WebCore::JSDOMWindow::showModalDialog):
        (WebCore::handlePostMessage):
        (WebCore::JSDOMWindow::setTimeout):
        (WebCore::JSDOMWindow::setInterval):
        * bindings/js/JSDataCueCustom.cpp:
        (WebCore::constructJSDataCue):
        * bindings/js/JSDeviceMotionEventCustom.cpp:
        (WebCore::readAccelerationArgument):
        (WebCore::readRotationRateArgument):
        (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
        * bindings/js/JSDictionary.cpp:
        (WebCore::JSDictionary::tryGetProperty):
        (WebCore::JSDictionary::convertValue):
        * bindings/js/JSDictionary.h:
        (WebCore::JSDictionary::tryGetPropertyAndResult):
        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::JSDocument::getCSSCanvasContext):
        * bindings/js/JSEventListener.cpp:
        (WebCore::JSEventListener::handleEvent):
        * bindings/js/JSFileCustom.cpp:
        (WebCore::constructJSFile):
        * bindings/js/JSGeolocationCustom.cpp:
        (WebCore::createPositionOptions):
        (WebCore::JSGeolocation::getCurrentPosition):
        (WebCore::JSGeolocation::watchPosition):
        * bindings/js/JSHTMLAllCollectionCustom.cpp:
        (WebCore::callHTMLAllCollection):
        * bindings/js/JSHTMLCanvasElementCustom.cpp:
        (WebCore::get3DContextAttributes):
        (WebCore::JSHTMLCanvasElement::getContext):
        (WebCore::JSHTMLCanvasElement::probablySupportsContext):
        * bindings/js/JSHTMLElementCustom.cpp:
        (WebCore::constructJSHTMLElement):
        * bindings/js/JSHistoryCustom.cpp:
        (WebCore::JSHistory::pushState):
        (WebCore::JSHistory::replaceState):
        * bindings/js/JSIDBDatabaseCustom.cpp:
        (WebCore::JSIDBDatabase::createObjectStore):
        * bindings/js/JSLazyEventListener.cpp:
        (WebCore::JSLazyEventListener::initializeJSFunction):
        * bindings/js/JSMainThreadExecState.h:
        (WebCore::JSMainThreadExecState::linkAndEvaluateModule):
        (WebCore::JSMainThreadExecState::~JSMainThreadExecState):
        * bindings/js/JSMessageEventCustom.cpp:
        (WebCore::handleInitMessageEvent):
        * bindings/js/JSMessagePortCustom.cpp:
        (WebCore::fillMessagePortArray):
        * bindings/js/JSMessagePortCustom.h:
        (WebCore::handlePostMessage):
        * bindings/js/JSMockContentFilterSettingsCustom.cpp:
        (WebCore::JSMockContentFilterSettings::setDecisionPoint):
        (WebCore::toDecision):
        (WebCore::JSMockContentFilterSettings::setDecision):
        (WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):
        * bindings/js/JSNodeFilterCustom.cpp:
        (WebCore::JSNodeFilter::acceptNode):
        * bindings/js/JSNodeOrString.cpp:
        (WebCore::toNodeOrStringVector):
        * bindings/js/JSSQLTransactionCustom.cpp:
        (WebCore::JSSQLTransaction::executeSql):
        * bindings/js/JSSVGLengthCustom.cpp:
        (WebCore::JSSVGLength::convertToSpecifiedUnits):
        * bindings/js/JSStorageCustom.cpp:
        (WebCore::JSStorage::getOwnPropertyNames):
        (WebCore::JSStorage::putDelegate):
        * bindings/js/JSTextTrackCustom.cpp:
        (WebCore::JSTextTrack::setLanguage):
        * bindings/js/JSVideoTrackCustom.cpp:
        (WebCore::JSVideoTrack::setKind):
        (WebCore::JSVideoTrack::setLanguage):
        * bindings/js/JSWebGL2RenderingContextCustom.cpp:
        (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
        * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
        (WebCore::getObjectParameter):
        (WebCore::JSWebGLRenderingContextBase::getExtension):
        (WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
        (WebCore::JSWebGLRenderingContextBase::getParameter):
        (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
        (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
        (WebCore::toVector):
        (WebCore::dataFunctionf):
        (WebCore::dataFunctionMatrix):
        * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
        (WebCore::createAlgorithmFromJSValue):
        (WebCore::cryptoKeyFormatFromJSValue):
        (WebCore::cryptoKeyUsagesFromJSValue):
        (WebCore::JSWebKitSubtleCrypto::encrypt):
        (WebCore::JSWebKitSubtleCrypto::decrypt):
        (WebCore::JSWebKitSubtleCrypto::sign):
        (WebCore::JSWebKitSubtleCrypto::verify):
        (WebCore::JSWebKitSubtleCrypto::digest):
        (WebCore::JSWebKitSubtleCrypto::generateKey):
        (WebCore::importKey):
        (WebCore::JSWebKitSubtleCrypto::importKey):
        (WebCore::exportKey):
        (WebCore::JSWebKitSubtleCrypto::exportKey):
        (WebCore::JSWebKitSubtleCrypto::wrapKey):
        (WebCore::JSWebKitSubtleCrypto::unwrapKey):
        * bindings/js/JSWorkerCustom.cpp:
        (WebCore::constructJSWorker):
        * bindings/js/JSWorkerGlobalScopeCustom.cpp:
        (WebCore::JSWorkerGlobalScope::importScripts):
        (WebCore::JSWorkerGlobalScope::setTimeout):
        (WebCore::JSWorkerGlobalScope::setInterval):
        * bindings/js/ReadableStreamDefaultController.cpp:
        (WebCore::ReadableStreamDefaultController::invoke):
        (WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked):
        * bindings/js/ReadableStreamDefaultController.h:
        (WebCore::ReadableStreamDefaultController::enqueue):
        * bindings/js/ScheduledAction.cpp:
        (WebCore::ScheduledAction::create):
        * bindings/js/ScriptGlobalObject.cpp:
        (WebCore::ScriptGlobalObject::set):
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneBase::shouldTerminate):
        (WebCore::CloneDeserializer::deserialize):
        (WebCore::SerializedScriptValue::create):
        (WebCore::SerializedScriptValue::deserialize):
        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::evaluate):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateDictionaryImplementationContent):
        (GenerateImplementation):
        (GenerateParametersCheck):
        (GenerateImplementationFunctionCall):
        (GenerateConstructorDefinition):
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
        (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        (WebCore::JSTestEventConstructorConstructor::construct):
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        (WebCore::jsTestEventTargetPrototypeFunctionItem):
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        (WebCore::setJSTestGlobalObjectRegularAttribute):
        (WebCore::setJSTestGlobalObjectPublicAndPrivateAttribute):
        (WebCore::setJSTestGlobalObjectPublicAndPrivateConditionalAttribute):
        (WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttribute):
        (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
        (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1):
        (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2):
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        (WebCore::JSTestInterfaceConstructor::construct):
        (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
        (WebCore::setJSTestInterfaceImplementsStr2):
        (WebCore::setJSTestInterfaceImplementsStr3):
        (WebCore::setJSTestInterfaceImplementsNode):
        (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
        (WebCore::setJSTestInterfaceSupplementalStr2):
        (WebCore::setJSTestInterfaceSupplementalStr3):
        (WebCore::setJSTestInterfaceSupplementalNode):
        (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
        (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        (WebCore::JSTestNamedConstructorNamedConstructor::construct):
        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::setJSTestNodeName):
        * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
        (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
        (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
        (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
        (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::convertDictionary<TestObj::Dictionary>):
        (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
        (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
        (WebCore::convertDictionary<AlternateDictionaryName>):
        (WebCore::setJSTestObjConstructorStaticStringAttr):
        (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
        (WebCore::setJSTestObjEnumAttr):
        (WebCore::setJSTestObjByteAttr):
        (WebCore::setJSTestObjOctetAttr):
        (WebCore::setJSTestObjShortAttr):
        (WebCore::setJSTestObjClampedShortAttr):
        (WebCore::setJSTestObjEnforceRangeShortAttr):
        (WebCore::setJSTestObjUnsignedShortAttr):
        (WebCore::setJSTestObjLongAttr):
        (WebCore::setJSTestObjLongLongAttr):
        (WebCore::setJSTestObjUnsignedLongLongAttr):
        (WebCore::setJSTestObjStringAttr):
        (WebCore::setJSTestObjUsvstringAttr):
        (WebCore::setJSTestObjTestObjAttr):
        (WebCore::setJSTestObjTestNullableObjAttr):
        (WebCore::setJSTestObjLenientTestObjAttr):
        (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
        (WebCore::setJSTestObjUsvstringAttrTreatingNullAsEmptyString):
        (WebCore::setJSTestObjImplementationEnumAttr):
        (WebCore::setJSTestObjXMLObjAttr):
        (WebCore::setJSTestObjCreate):
        (WebCore::setJSTestObjReflectedStringAttr):
        (WebCore::setJSTestObjReflectedUSVStringAttr):
        (WebCore::setJSTestObjReflectedIntegralAttr):
        (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
        (WebCore::setJSTestObjReflectedBooleanAttr):
        (WebCore::setJSTestObjReflectedURLAttr):
        (WebCore::setJSTestObjReflectedUSVURLAttr):
        (WebCore::setJSTestObjReflectedCustomIntegralAttr):
        (WebCore::setJSTestObjReflectedCustomBooleanAttr):
        (WebCore::setJSTestObjReflectedCustomURLAttr):
        (WebCore::setJSTestObjEnabledAtRuntimeAttribute):
        (WebCore::setJSTestObjTypedArrayAttr):
        (WebCore::setJSTestObjAttrWithGetterException):
        (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
        (WebCore::setJSTestObjAttrWithSetterException):
        (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
        (WebCore::setJSTestObjStringAttrWithGetterException):
        (WebCore::setJSTestObjStringAttrWithSetterException):
        (WebCore::setJSTestObjCustomAttr):
        (WebCore::setJSTestObjOnfoo):
        (WebCore::setJSTestObjOnwebkitfoo):
        (WebCore::setJSTestObjWithScriptStateAttribute):
        (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute):
        (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
        (WebCore::setJSTestObjWithScriptStateAttributeRaises):
        (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
        (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
        (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
        (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
        (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
        (WebCore::setJSTestObjConditionalAttr1):
        (WebCore::setJSTestObjConditionalAttr2):
        (WebCore::setJSTestObjConditionalAttr3):
        (WebCore::setJSTestObjConditionalAttr4Constructor):
        (WebCore::setJSTestObjConditionalAttr5Constructor):
        (WebCore::setJSTestObjConditionalAttr6Constructor):
        (WebCore::setJSTestObjAnyAttribute):
        (WebCore::setJSTestObjMutablePoint):
        (WebCore::setJSTestObjImmutablePoint):
        (WebCore::setJSTestObjStrawberry):
        (WebCore::setJSTestObjId):
        (WebCore::setJSTestObjReplaceableAttribute):
        (WebCore::setJSTestObjNullableLongSettableAttribute):
        (WebCore::setJSTestObjNullableStringSettableAttribute):
        (WebCore::setJSTestObjNullableUSVStringSettableAttribute):
        (WebCore::setJSTestObjNullableStringValue):
        (WebCore::setJSTestObjAttributeWithReservedEnumType):
        (WebCore::setJSTestObjPutForwardsAttribute):
        (WebCore::setJSTestObjPutForwardsNullableAttribute):
        (WebCore::setJSTestObjStringifierAttribute):
        (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
        (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
        (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
        (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
        (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue):
        (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
        (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString):
        (WebCore::jsTestObjPrototypeFunctionSerializedValue):
        (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
        (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod):
        (WebCore::jsTestObjPrototypeFunctionAddEventListener):
        (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
        (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj):
        (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
        (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
        (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringAndDefaultValue):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNull):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLong):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZero):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLong):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZero):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
        (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
        (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
        (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
        (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
        (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
        (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
        (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
        (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
        (WebCore::jsTestObjPrototypeFunctionGetElementById):
        (WebCore::jsTestObjPrototypeFunctionConvert3):
        (WebCore::jsTestObjPrototypeFunctionConvert4):
        (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
        (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
        (WebCore::jsTestObjPrototypeFunctionAny):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
        (WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
        (WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
        (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
        (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
        (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        (WebCore::constructJSTestOverloadedConstructors1):
        (WebCore::constructJSTestOverloadedConstructors2):
        (WebCore::constructJSTestOverloadedConstructors4):
        (WebCore::constructJSTestOverloadedConstructors5):
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
        (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        (WebCore::setJSTestSerializedScriptValueInterfaceValue):
        (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        (WebCore::JSTestTypedefsConstructor::construct):
        (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
        (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
        (WebCore::setJSTestTypedefsAttrWithGetterException):
        (WebCore::setJSTestTypedefsAttrWithSetterException):
        (WebCore::setJSTestTypedefsStringAttrWithGetterException):
        (WebCore::setJSTestTypedefsStringAttrWithSetterException):
        (WebCore::jsTestTypedefsPrototypeFunctionFunc):
        (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
        (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
        (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg):
        (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
        (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
        (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
        (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
        * bridge/NP_jsobject.cpp:
        (_NPN_InvokeDefault):
        (_NPN_Invoke):
        (_NPN_Evaluate):
        (_NPN_GetProperty):
        (_NPN_SetProperty):
        (_NPN_RemoveProperty):
        (_NPN_HasProperty):
        (_NPN_HasMethod):
        (_NPN_Enumerate):
        (_NPN_Construct):
        * bridge/c/c_instance.cpp:
        (JSC::Bindings::CInstance::moveGlobalExceptionToExecState):
        * bridge/objc/WebScriptObject.mm:
        (WebCore::addExceptionToConsole):
        (-[WebScriptObject callWebScriptMethod:withArguments:]):
        (-[WebScriptObject evaluateWebScript:]):
        (-[WebScriptObject setValue:forKey:]):
        (-[WebScriptObject valueForKey:]):
        (-[WebScriptObject removeWebScriptKey:]):
        (-[WebScriptObject hasWebScriptKey:]):
        (-[WebScriptObject webScriptValueAtIndex:]):
        (-[WebScriptObject setWebScriptValueAtIndex:value:]):
        * contentextensions/ContentExtensionParser.cpp:
        (WebCore::ContentExtensions::getDomainList):
        (WebCore::ContentExtensions::getTypeFlags):
        (WebCore::ContentExtensions::loadTrigger):
        (WebCore::ContentExtensions::loadAction):
        (WebCore::ContentExtensions::loadEncodedRules):
        * html/HTMLMediaElement.cpp:
        (WebCore::controllerJSValue):
        (WebCore::HTMLMediaElement::updateCaptionContainer):
        (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
        (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
        (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
        (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):

2016-09-07  Chris Dumez  <cdumez@apple.com>

        Fix handling of negative radius in HTMLAreaElement's coords when in circle state
        https://bugs.webkit.org/show_bug.cgi?id=161690

        Reviewed by Daniel Bates.

        Fix handling of negative radius in HTMLAreaElement's coords when in
        circle state:
        - https://html.spec.whatwg.org/#attr-area-shape-circle

        The radius must be non-negative as per the specification. However, our
        code fails to check.

        Firefox and Chrome both reject negative radius.

        No new tests, rebaselined existing test.

        * html/HTMLAreaElement.cpp:
        (WebCore::HTMLAreaElement::getRegion):

2016-09-07  Chris Dumez  <cdumez@apple.com>

        Align HTMLAreaElement shape parsing with the specification
        https://bugs.webkit.org/show_bug.cgi?id=161698

        Reviewed by Daniel Bates.

        Align HTMLAreaElement shape parsing with the specification:
        - https://html.spec.whatwg.org/#attr-area-shape

        In particular, add support for circ / polygon non conforming shapes
        and use rectangle as default state.

        This also aligns our behavior with Chrome.

        No new tests, rebaselined existing test.

        * html/HTMLAreaElement.cpp:
        (WebCore::HTMLAreaElement::parseAttribute):

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

        Fix WebCore build when building for device with iOS 10 beta SDK

        Define SPI macro kIOReturnSuccess.

        * platform/spi/cocoa/IOReturnSPI.h:

2016-09-07  Michael Catanzaro  <mcatanzaro@igalia.com>

        [EFL] Switch to ENABLE_NETWORK_CACHE
        https://bugs.webkit.org/show_bug.cgi?id=152676

        Reviewed by Alex Christensen.

        * PlatformEfl.cmake: Add GRefPtrSoup to build.
        * platform/network/soup/SoupNetworkSession.cpp:
        (WebCore::SoupNetworkSession::clearOldSoupCache): Renamed from clearCache.
        (WebCore::SoupNetworkSession::setCache): Deleted.
        (WebCore::SoupNetworkSession::cache): Deleted.
        (WebCore::SoupNetworkSession::clearCache): Deleted.
        * platform/network/soup/SoupNetworkSession.h:

2016-09-07  Chris Dumez  <cdumez@apple.com>

        Drop legacy canvas.probablySupportsContext()
        https://bugs.webkit.org/show_bug.cgi?id=161692

        Reviewed by Alex Christensen.

        Drop legacy canvas.probablySupportsContext() as it is no longer in the specification:
        - https://html.spec.whatwg.org/#htmlcanvaselement

        Firefox and Chrome do not support canvas.probablySupportsContext().

        No new tests, rebaselined existing test.

        * bindings/js/JSHTMLCanvasElementCustom.cpp:
        (WebCore::JSHTMLCanvasElement::probablySupportsContext): Deleted.
        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::getContext):
        (WebCore::HTMLCanvasElement::probablySupportsContext): Deleted.
        * html/HTMLCanvasElement.h:
        * html/HTMLCanvasElement.idl:

2016-09-07  Simon Fraser  <simon.fraser@apple.com>

        Rename ScrollBehavior to ScrollAlignment::Behavior
        https://bugs.webkit.org/show_bug.cgi?id=161677

        Reviewed by Tim Horton.

        Free up ScrollBehavior for future use with CSS OM View scrolling by renaming the
        existing ScrollBehavior, which is about alignment when scrolling into view.

        Renamed ScrollBehavior* to ScrollAlignment.*, and made ScrollBehavior an enum class
        in the struct.

        No behavior change.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * editing/FrameSelection.h:
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::getRectToExpose):
        * rendering/RenderObject.h:
        * rendering/RenderingAllInOne.cpp:
        * rendering/ScrollAlignment.cpp: Renamed from Source/WebCore/rendering/ScrollBehavior.cpp.
        * rendering/ScrollAlignment.h: Renamed from Source/WebCore/rendering/ScrollBehavior.h.
        (WebCore::ScrollAlignment::getVisibleBehavior):
        (WebCore::ScrollAlignment::getPartialBehavior):
        (WebCore::ScrollAlignment::getHiddenBehavior):
        * rendering/ScrollBehavior.h:
        (WebCore::ScrollAlignment::getVisibleBehavior): Deleted.
        (WebCore::ScrollAlignment::getPartialBehavior): Deleted.
        (WebCore::ScrollAlignment::getHiddenBehavior): Deleted.

2016-09-07  Dave Hyatt  <hyatt@apple.com>

        Add CSSAtRule id info for new parser
        https://bugs.webkit.org/show_bug.cgi?id=161695

        Reviewed by Sam Weinig.

        * WebCore.xcodeproj/project.pbxproj:
        * css/parser/CSSAtRuleID.cpp: Added.
        (WebCore::cssAtRuleID):
        * css/parser/CSSAtRuleID.h: Added.

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

        [Streams API] Separate compile flag for ReadableStream and WritableStream
        https://bugs.webkit.org/show_bug.cgi?id=161044

        Reviewed by Alex Christensen.

        Moving from STREAMS_API to READABLE_STREAM_API and WRITABLE_STREAM_API compilation flags.
        No change of behavior.

        * CMakeLists.txt: Triggering regeneration of builtin wrapper files based on individual builtin header file content change to cope with @conditional changes.
        * Configurations/FeatureDefines.xcconfig:
        * DerivedSources.cpp:
        * DerivedSources.make: Triggering regeneration of builtin wrapper files based on file content change to cope with @conditional changes.
        * Modules/fetch/FetchBody.cpp:
        * Modules/fetch/FetchBody.h:
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::isDisturbed):
        (WebCore::FetchBodyOwner::blobLoadingSucceeded):
        (WebCore::FetchBodyOwner::blobLoadingFailed):
        (WebCore::FetchBodyOwner::blobChunk):
        * Modules/fetch/FetchBodyOwner.h:
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::BodyLoader::didSucceed):
        (WebCore::FetchResponse::BodyLoader::didFail):
        (WebCore::FetchResponse::BodyLoader::didReceiveData):
        * Modules/fetch/FetchResponse.h:
        * Modules/fetch/FetchResponse.idl:
        * Modules/fetch/FetchResponse.js:
        (initializeFetchResponse):
        * Modules/fetch/FetchResponseSource.cpp:
        * Modules/fetch/FetchResponseSource.h:
        * Modules/streams/ByteLengthQueuingStrategy.idl:
        * Modules/streams/ByteLengthQueuingStrategy.js:
        * Modules/streams/CountQueuingStrategy.idl:
        * Modules/streams/CountQueuingStrategy.js:
        * Modules/streams/ReadableStream.idl:
        * Modules/streams/ReadableStream.js:
        * Modules/streams/ReadableStreamDefaultController.idl:
        * Modules/streams/ReadableStreamDefaultController.js:
        * Modules/streams/ReadableStreamDefaultReader.idl:
        * Modules/streams/ReadableStreamDefaultReader.js:
        * Modules/streams/ReadableStreamInternals.js:
        * Modules/streams/ReadableStreamSource.h:
        * Modules/streams/ReadableStreamSource.idl:
        * Modules/streams/StreamInternals.js:
        * Modules/streams/WritableStream.idl:
        * Modules/streams/WritableStream.js:
        * Modules/streams/WritableStreamInternals.js:
        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
        * bindings/js/JSReadableStreamPrivateConstructors.cpp:
        * bindings/js/JSReadableStreamPrivateConstructors.h:
        * bindings/js/JSReadableStreamSourceCustom.cpp:
        * bindings/js/ReadableStreamDefaultController.cpp:
        * bindings/js/ReadableStreamDefaultController.h:
        * testing/Internals.cpp:
        * testing/Internals.h:
        * testing/Internals.idl:

2016-09-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Crash of WebProcess on the last WebView disconnect
        https://bugs.webkit.org/show_bug.cgi?id=161605

        Reviewed by Michael Catanzaro.

        Stop tracking X11 GL contexts to be cleanered on an exit handler. This was added to work around bugs on drivers,
        and it's assuming that all GLContext not deleted when the exit handler is called are leaked, which is no longer
        true, because PlatformDisplay now owns a GLContext and is deleted after exit handlers.

        * platform/graphics/GLContext.cpp:
        (WebCore::GLContext::GLContext):
        (WebCore::GLContext::~GLContext):
        (WebCore::activeContextList): Deleted.
        (WebCore::GLContext::addActiveContext): Deleted.
        (WebCore::GLContext::removeActiveContext): Deleted.
        (WebCore::GLContext::cleanupActiveContextsAtExit): Deleted.

2016-09-07  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>

        Templatize JS bindings code generator of functions with variadic parameters
        https://bugs.webkit.org/show_bug.cgi?id=158835

        Reviewed by Darin Adler.

        Add template functions to handle function with variadic parameter for DOM objects.

        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::addTrack):
        * Modules/mediastream/RTCPeerConnection.h:
        * bindings/js/JSDOMBinding.h:
        (WebCore::VariadicHelperBase::convert):
        (WebCore::toArguments):
        (WebCore::jsFrozenArray):
        (WebCore::toRefPtrNativeArray):
        (WebCore::toNativeArray):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateParametersCheck):
        (GetVariadicType):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
        (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
        (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
        (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
        (WebCore::jsTestObjPrototypeFunctionAny):
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        (WebCore::constructJSTestOverloadedConstructors5):

2016-09-06  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r205521, r205526, and r205532.
        https://bugs.webkit.org/show_bug.cgi?id=161668

        broke API tests (Requested by alexchristensen on #webkit).

        Reverted changesets:

        "Punycode encode non-ascii hosts in URLParser"
        https://bugs.webkit.org/show_bug.cgi?id=161655
        http://trac.webkit.org/changeset/205521

        "Fix query-only and fragment-only relative URLs when using
        URLParser"
        https://bugs.webkit.org/show_bug.cgi?id=161657
        http://trac.webkit.org/changeset/205526

        "URLParser should parse / as a relative URL"
        https://bugs.webkit.org/show_bug.cgi?id=161667
        http://trac.webkit.org/changeset/205532

2016-09-06  Alex Christensen  <achristensen@webkit.org>

        URLParser should parse / as a relative URL
        https://bugs.webkit.org/show_bug.cgi?id=161667

        Reviewed by Tim Horton.

        Covered by a new API test.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):

2016-09-06  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Avoid linkifying some schemes in console logs
        https://bugs.webkit.org/show_bug.cgi?id=161648
        <rdar://problem/16413270>

        Reviewed by Brian Burg.

        * inspector/InspectorFrontendHost.cpp:
        (WebCore::InspectorFrontendHost::openInNewTab):
        If a javascript: link is passed just ignore it.

2016-09-06  Alex Christensen  <achristensen@webkit.org>

        Fix query-only and fragment-only relative URLs when using URLParser
        https://bugs.webkit.org/show_bug.cgi?id=161657

        Reviewed by Tim Horton.

        Covered by new API tests and progress towards passing the web platform tests when using URLParser.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):

2016-09-06  Chris Dumez  <cdumez@apple.com>

        Add support for input.minLength / textArea.minLength
        https://bugs.webkit.org/show_bug.cgi?id=161644

        Reviewed by Darin Adler.

        Add support for input.minLength / textArea.minLength:
        - https://html.spec.whatwg.org/#dom-input-minlength
        - https://html.spec.whatwg.org/#dom-textarea-minlength

        Chrome implements this, Firefox does not yet.

        No new tests, rebaselined existing tests.

        * html/FormAssociatedElement.cpp:
        (WebCore::FormAssociatedElement::tooShort):
        (WebCore::FormAssociatedElement::valid):
        (WebCore::FormAssociatedElement::typeMismatch): Deleted.
        * html/FormAssociatedElement.h:
        * html/HTMLAttributeNames.in:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::HTMLInputElement):
        (WebCore::HTMLInputElement::isValidValue):
        (WebCore::HTMLInputElement::tooShort):
        (WebCore::HTMLInputElement::tooLong):
        (WebCore::HTMLInputElement::parseAttribute):
        (WebCore::HTMLInputElement::effectiveMaxLength):
        (WebCore::HTMLInputElement::maxLengthAttributeChanged):
        (WebCore::HTMLInputElement::minLengthAttributeChanged):
        (WebCore::HTMLInputElement::patternMismatch): Deleted.
        (WebCore::parseAcceptAttribute): Deleted.
        (WebCore::HTMLInputElement::isEnumeratable): Deleted.
        (WebCore::HTMLInputElement::supportLabels): Deleted.
        * html/HTMLInputElement.h:
        (WebCore::HTMLInputElement::supportsMinLength):
        (WebCore::HTMLInputElement::supportsMaxLength): Deleted.
        * html/HTMLInputElement.idl:
        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::parseAttribute):
        (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
        (WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
        (WebCore::HTMLTextAreaElement::validationMessage):
        (WebCore::HTMLTextAreaElement::tooShort):
        (WebCore::HTMLTextAreaElement::tooLong):
        (WebCore::HTMLTextAreaElement::isValidValue):
        * html/HTMLTextAreaElement.h:
        * html/HTMLTextAreaElement.idl:
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::setMaxLength):
        (WebCore::HTMLTextFormControlElement::setMinLength):
        * html/HTMLTextFormControlElement.h:
        (WebCore::HTMLTextFormControlElement::maxLength):
        (WebCore::HTMLTextFormControlElement::setMaxLength):
        (WebCore::HTMLTextFormControlElement::minLength):
        (WebCore::HTMLTextFormControlElement::setMinLength):
        * html/InputType.cpp:
        (WebCore::InputType::validationMessage):
        * html/ValidityState.idl:
        * platform/LocalizedStrings.cpp:
        (WebCore::validationMessageTooShortText):
        * platform/LocalizedStrings.h:

2016-09-06  Alex Christensen  <achristensen@webkit.org>

        Punycode encode non-ascii hosts in URLParser
        https://bugs.webkit.org/show_bug.cgi?id=161655

        Reviewed by Tim Horton.

        Covered by new API tests based on the web platform tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        (WebCore::containsOnlyASCII):
        (WebCore::domainToASCII):

2016-09-06  Saam Barati  <sbarati@apple.com>

        Make JSMap and JSSet faster
        https://bugs.webkit.org/show_bug.cgi?id=160989

        Reviewed by Filip Pizlo.

        * ForwardingHeaders/runtime/HashMapImpl.h: Added.
        * ForwardingHeaders/runtime/MapBase.h: Added.
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneSerializer::serialize):
        (WebCore::CloneDeserializer::deserialize):

2016-09-06  Myles C. Maxfield  <mmaxfield@apple.com>

        Strikethrough positions are erroneously snapped twice
        https://bugs.webkit.org/show_bug.cgi?id=161647
        <rdar://problem/11542470>

        Reviewed by Zalan Bujtas.

        Because we're using an int for the position of the baseline, the math to calculate the
        strikethrough position is snapped. Then, we snap it again inside GraphicsContext.

        Test: fast/text/strikethrough-int.html

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paintDecoration):
        * rendering/TextDecorationPainter.h:
        (WebCore::TextDecorationPainter::setBaseline):

2016-09-06  David Kilzer  <ddkilzer@apple.com>

        [iOS] Remove soft linking of MobileCoreServices.framework
        <https://webkit.org/b/161641>
        <rdar://problem/10420118>

        Reviewed by Darin Adler.

        * Configurations/WebCore.xcconfig: Add hard link to
        MobileCoreServices.framework.

        * editing/ios/EditorIOS.mm: Change #include to #import.
        * platform/graphics/cg/ImageSourceCGMac.mm:
        * platform/graphics/mac/ImageMac.mm:
        * platform/ios/PasteboardIOS.mm:
        * platform/ios/PlatformPasteboardIOS.mm:
        * platform/network/ios/WebCoreURLResponseIOS.mm:
        * platform/network/mac/UTIUtilities.mm:
        - Rearrange import statements as needed.
        - Remove soft link to MobileCoreServices.framework.
        - Add import of <MobileCoreServices/MobileCoreServices.h> as
          needed.

        * rendering/RenderThemeIOS.mm: Remove unused soft link to
        MobileCoreServices.framework.

2016-09-06  Chris Dumez  <cdumez@apple.com>

        Align srcset attribute parsing with the HTML specification
        https://bugs.webkit.org/show_bug.cgi?id=161636

        Reviewed by Darin Adler.

        Align srcset attribute parsing with the HTML specification:
        - https://html.spec.whatwg.org/#parse-a-srcset-attribute

        The new behavior is also consistent with Firefox and Chrome
        as all 3 browsers now pass 100% of the checks at:
        - http://w3c-test.org/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html

        No new tests, rebaselined existing tests.

        * html/parser/HTMLParserIdioms.cpp:
        (WebCore::parseValidHTMLNonNegativeIntegerInternal):
        (WebCore::parseValidHTMLNonNegativeInteger):
        (WebCore::parseValidHTMLFloatingPointNumberInternal):
        (WebCore::parseValidHTMLFloatingPointNumber):
        * html/parser/HTMLParserIdioms.h:
        Add convenience for parsing *valid* HTML non-negative integers and
        *valid* floating point number values.

        * html/parser/HTMLSrcsetParser.cpp:
        (WebCore::parseDescriptors):
        - Use parseValidHTMLFloatingPointNumber() to parse density so that the value
          is parsed as a valid HTML floating point number value, as per the spec.
        - Use parseValidHTMLNonNegativeInteger() to parse width and height so that
          the value is parsed as a valid HTML non-negative integer value, as per the
          spec.
        - Return false if descriptor does not have a h, w and x at the end as per:
          https://html.spec.whatwg.org/#parse-a-srcset-attribute (step 13: Anything else)
        - Return false if height is set but not width, as per:
          https://html.spec.whatwg.org/#parse-a-srcset-attribute (step 14)

        (WebCore::parseImageCandidatesFromSrcsetAttribute):
        - Skip whitespace if URL does not end with a comma instead of assuming there is
          a single space character, as per:
          https://html.spec.whatwg.org/#parse-a-srcset-attribute (step 8. Otherwise 1.)

2016-09-06  Fujii Hironori  <Hironori.Fujii@sony.com>

        [CMake] Decouple generating bindings of WebCore and WebCoreTestSupport
        https://bugs.webkit.org/show_bug.cgi?id=161474

        Generating bindings of WebCore and WebCoreTestSupport shares a
        single supplementalDependencyFile.  But, nothing supplements any
        IDL of WebCoreTestSupport.  This introduces unnecessary
        dependencies.

        Reviewed by Alex Christensen.

        * CMakeLists.txt: Do not input any IDL of WebCoreTestSupport to
        preprocess-idls.pl.  Do not use supplementalDependencyFile to
        generate bindings of WebCoreTestSupport.  Add SettingsMacros.h as
        a source file of WebCoreDerivedSources to ensure make_settings.pl
        is finished before compiling WebCoreDerivedSources.

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

        ASSERTION FAILED: !paintInfo.overlapTestRequests->contains(this) in WebCore::RenderWidget::paintContents
        https://bugs.webkit.org/show_bug.cgi?id=135602
        <rdar://problem/27701733>

        Reviewed by Simon Fraser.

        ASSERT is updated to support multiple fragments painting. We just have to ensure that the FrameView's rect
        has not changed between the 2 paintContents calls.  

        Test: fast/layers/assert-on-overlap-testing-with-frames-inside-columns.html

        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::paintContents):

2016-09-06  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r205504.
        https://bugs.webkit.org/show_bug.cgi?id=161645

        Broke the iOS device build (Requested by ryanhaddad on
        #webkit).

        Reverted changeset:

        "Make JSMap and JSSet faster"
        https://bugs.webkit.org/show_bug.cgi?id=160989
        http://trac.webkit.org/changeset/205504

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

        Remove unused overlap checking functions from FrameView.
        https://bugs.webkit.org/show_bug.cgi?id=161635

        Reviewed by Simon Fraser.

        No change in functionality.

        * page/FrameView.cpp:
        (WebCore::FrameView::isOverlappedIncludingAncestors): Deleted.
        * page/FrameView.h:

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

        Align element.scroll() / scrollTo() / scrollBy() with the CSSOM specification
        https://bugs.webkit.org/show_bug.cgi?id=161610

        Reviewed by Darin Adler, Chris Dumez.

        Implement Element.scroll(), scrollBy() and scrollTo() with x,y and ScrollToOptions
        on Element, according to <https://drafts.csswg.org/cssom-view/#element-scrolling-members>

        WebKit's behavior of treating scrolls on the body element in both quirks and strict mode
        is preserved.

        Tests: fast/dom/Element/scrolling-funtions-on-body-quirks.html
               fast/dom/Element/scrolling-funtions-on-body.html
               fast/dom/Element/scrolling-funtions-on-element.html

        * dom/Element.cpp:
        (WebCore::Element::scrollBy):
        (WebCore::normalizeNonFiniteValue):
        (WebCore::Element::scrollTo):
        * dom/Element.h:
        * dom/Element.idl:
        * html/HTMLBodyElement.cpp:
        (WebCore::HTMLBodyElement::scrollTo):
        * html/HTMLBodyElement.h:

2016-09-06  Saam Barati  <sbarati@apple.com>

        Make JSMap and JSSet faster
        https://bugs.webkit.org/show_bug.cgi?id=160989

        Reviewed by Filip Pizlo.

        * ForwardingHeaders/runtime/HashMapImpl.h: Added.
        * ForwardingHeaders/runtime/MapBase.h: Added.
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneSerializer::serialize):
        (WebCore::CloneDeserializer::deserialize):

2016-09-05  Alex Christensen  <achristensen@webkit.org>

        Implement relative file urls and begin implementing character encoding in URLParser
        https://bugs.webkit.org/show_bug.cgi?id=161618

        Reviewed by Tim Horton.

        Covered by new API tests.
        Also, this is a significant step towards passing the URL web platform tests when using the URLParser,
        which is still off by default.

        * platform/URLParser.cpp:
        (WebCore::isInSimpleEncodeSet):
        (WebCore::isInDefaultEncodeSet):
        (WebCore::isInUserInfoEncodeSet):
        (WebCore::isInvalidDomainCharacter):
        (WebCore::shouldCopyFileURL):
        (WebCore::percentEncode):
        (WebCore::utf8PercentEncode):
        (WebCore::encodeQuery):
        (WebCore::isDefaultPort):
        (WebCore::isPercentEncodedDot):
        (WebCore::URLParser::parse):
        (WebCore::percentDecode):
        (WebCore::domainToASCII):
        (WebCore::hasInvalidDomainCharacter):
        (WebCore::URLParser::parsePort):
        (WebCore::URLParser::parseHost):
        (WebCore::isTabOrNewline): Deleted.
        * platform/URLParser.h:

2016-09-06  Daniel Bates  <dabates@apple.com>

        Fix the Apple-internal build following <https://trac.webkit.org/changeset/205488>
        (https://bugs.webkit.org/show_bug.cgi?id=161090)

        Use the default linkage for QuartzCore constants to match the linkage used for such constants
        in the Apple-internal SDK.

        * platform/spi/cocoa/QuartzCoreSPI.h:

2016-09-06  Daniel Bates  <dabates@apple.com>

        <table> inside <div align="right"> with large content inside = no scrollbar
        https://bugs.webkit.org/show_bug.cgi?id=3352

        Reviewed by Brent Fulgham.

        Respect "right" text-alignment only if the width of the child does not overflow the
        width of its containing block. This makes our margin computation more closely conform
        to section "Block-level, non-replaced elements in normal flow" of the CSS 2.1
        spec., <http://www.w3.org/TR/CSS21/>, and to the behavior observed in Firefox, Chrome,
        IE version 9 or later and Microsoft Edge.

        Test: fast/block/align-overflow-child.html

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::computeInlineDirectionMargins):

2016-09-06  Daniel Bates  <dabates@apple.com>

        Remove EXTERN_C from WTF
        https://bugs.webkit.org/show_bug.cgi?id=161090

        Reviewed by Brent Fulgham.

        Guard external C declarations in WTF_EXTERN_C_BEGIN, WTF_EXTERN_C_END.

        * platform/spi/cf/CFLocaleSPI.h:
        * platform/spi/cf/CFNetworkConnectionCacheSPI.h:
        * platform/spi/cf/CFNetworkSPI.h: Additionally, remove the workaround for <rdar://problem/18337182>
        as this bug was fixed in El Capitan.
        * platform/spi/cf/CFUtilitiesSPI.h:
        * platform/spi/cocoa/CoreTextSPI.h:
        * platform/spi/cocoa/DataDetectorsCoreSPI.h:
        * platform/spi/cocoa/IOPMLibSPI.h:
        * platform/spi/cocoa/MachVMSPI.h:
        * platform/spi/cocoa/QuartzCoreSPI.h:
        * platform/spi/ios/MobileGestaltSPI.h:
        * platform/spi/ios/QuickLookSPI.h:
        * platform/spi/win/CoreTextSPIWin.cpp:
        * platform/spi/win/CoreTextSPIWin.h:

2016-09-06  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r205407.

        Not the correct way to implement this functionality

        Reverted changeset:

        "Consult with the FrameLoaderClient about whether or not
        content extensions should be enabled when loading this URL."
        https://bugs.webkit.org/show_bug.cgi?id=161441
        http://trac.webkit.org/changeset/205407

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

        http/tests/security/contentSecurityPolicy/worker-csp-blocks-xhr-redirect-cross-origin.html is flaky
        https://bugs.webkit.org/show_bug.cgi?id=161627

        Reviewed by Darin Adler.

        Covered by changed expectation.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::redirectReceived): Clearing the resource in lieu of clearing the request. This will stop the resource load.
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::didReceiveResponse): Adding an ASSERT to ensure that no valid redirect responses is mistakenly processed here.

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

        ASSERTION FAILED: !currBox->needsLayout() in WebCore::RenderBlock::checkPositionedObjectsNeedLayout
        https://bugs.webkit.org/show_bug.cgi?id=120291
        <rdar://problem/27683456>

        Reviewed by David Hyatt.

        This patch ensures that we always set the 'positioned child needs layout' bit on the containing block
        when a new positioned descendant gets inserted. It fixes cases for simplified layout when
        we ended up not laying out the descendant element. 

        Test: fast/block/positioning/assert-when-positioned-descendant-is-not-getting-laid-out.html

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

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

        CachedResourceLoader is not taking into account fetch options to use or not cached resources
        https://bugs.webkit.org/show_bug.cgi?id=161389

        Reviewed by Darin Adler.

        Tests: http/tests/fetch/fetching-same-resource-with-diffferent-options.html
               http/tests/security/cross-origin-cached-resource-parallel.html
               http/tests/security/cross-origin-cached-resource.html
               http/tests/security/load-image-after-redirection-2.html
               http/tests/security/shape-outside-and-cached-resources.html

        Adding CORS checks for the response in case of CORS fetch mode, in SubresourceLoader.
        Removing the CORS checks in Image and DocumentThreadableLoader.

        The direction of this patch is to make CachedResource origin-specific/fetch mode specific.

        This will remove the need for CachedResource clients to do CORS checks when receiving the notifyFinished call.
        This will also make the computation of whether a resource is clean or not much easier since the CachedResource knowd its origin and its response tainting.

        Removing the CORS checks at ImageLoader creates the risk of using some cached resources loaded from previously no-cors mode without doing the actual CORS check.
        Note that the risk was already there in case of a resource loaded through redirections.
        Reusing a cached resource for a load with different options also leads to bad computation of the resource tainting.

        As a first step, improvements are done but only for CachedImage resources.

        This patch limits the direct reuse of cached resources as follow:
        - If the request and existing resources have different origins.
        - If the fetch mode is different between request and existing resource.

        In those cases, a new CachedResource is created with the correct options and origin.
        The data and response of the CachedResource found in the cache are copied efficiently in the new CachedResource, if the matching CachedResource finished loading (CachedImage specific).

        If the matching CachedResource is still loading, we trigger a reload (with caching=false to not disturb the being loaded resource).
        This should be made more efficient at some point, especially if the matching CachedResource already has its response set.

        This triggers a change of behavior: previously, the CORS checks were done by the ImageLoader when the resource was finished loading.
        The CORS checks were controlled by the crossOrigin attribute, which may be set or unset between the load start and the load end.

        Now the crossOrigin attribute is checked at load start. If it is set, the CORS checks will happen even if the attribute is unset before the end of the load.
        This is more consistent as the actual request was built with CORS enabled.

        * loader/CrossOriginPreflightChecker.cpp:
        (WebCore::CrossOriginPreflightChecker::startPreflight): Setting correctly the preflight options as per fetch spec.
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::didReceiveResponse): Removing CORS check.
        (WebCore::DocumentThreadableLoader::loadRequest): Adding CORS check in sync mode.
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::updateFromElement):
        (WebCore::ImageLoader::notifyFinished):
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::didReceiveResponse): Adding CORS checks to the response
        (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl): Helper routine to do CORS checks
        * loader/SubresourceLoader.h:
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::cloneData): Responsible to set image content from another CachedImage.
        * loader/cache/CachedImage.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::computeOrigin): Helper routine to set the origin and whether the resource is cross-origin or not.
        (WebCore::CachedResource::load): Using computeOrigin.
        (WebCore::CachedResource::loadFrom): Loading from a CachedResource from the same type and which finished loading.
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::cloneData):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Helper routine responsible to adapt the CachedResource
        that can be reused to the origin and options of a new request.
        (WebCore::CachedResourceLoader::requestResource): Calling updateCachedResourceWithCurrentRequest before actually returning the resource.
        (WebCore::CachedResourceLoader::determineRevalidationPolicy): Space clean-up.
        * loader/cache/CachedResourceLoader.h:
        * loader/cache/CachedResourceRequest.h:
        (WebCore::CachedResourceRequest::setCachingPolicy):
        * style/StylePendingResources.cpp:
        (WebCore::Style::loadPendingImage): Allowing data URLs for ShapeOutside data.

2016-09-05  Darin Adler  <darin@apple.com>

        More bindings improvements, particularly things not needed for JavaScript bindings
        https://bugs.webkit.org/show_bug.cgi?id=161572

        Reviewed by Sam Weinig.

        * WebCore.xcodeproj/project.pbxproj: Export a couple of files needed for legacy bindings.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::addCrossOriginWindowPropertyNames): Mark array const.
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::addCrossOriginLocationPropertyNames): Ditto.

        * dom/DOMImplementation.cpp:
        (WebCore::addString): Deleted.
        (WebCore::isSupportedSVG10Feature): Deleted.
        (WebCore::isSupportedSVG11Feature): Deleted.
        (WebCore::DOMImplementation::hasFeature): Deleted.

        * dom/DOMImplementation.h: Changed hasFeature to take no arguments and to always
        return true, as specified in the DOM spec.

        * dom/DOMImplementation.idl: Removed the arguments to hasFeature.

        * dom/Document.cpp:
        (WebCore::Document::defaultCharsetForLegacyBindings): Renamed from
        defaultCharsetForBindings, because this function is used only by the
        non-JavaScript bindings.
        * dom/Document.h: Updated for the above.

        * dom/DocumentType.h: Removed entitiesForBindings,
        notationsForBindings, and internalSubsetForBindings, all of which were
        empty functions. The empty implementations are now in the legacy bindings.

        * dom/Element.cpp:
        (WebCore::Element::dispatchSimulatedClickForBindings): Deleted.
        This code is now at the single call site, in HTMLElement.
        * dom/Element.h: Updated for the above change.

        * dom/Node.cpp:
        (WebCore::Node::isSupportedForBindings): Deleted. This is only used in the
        legacy bindings, and since it only returns a value other than "true" for
        SVG features, it is now in the SVGTests class.
        * dom/Node.h: Updated for the above change.

        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::click): Call simulateClick with the appropriate
        arguments rather than calling dispatchSimulatedClickForBindings.

        * svg/SVGTests.cpp:
        (WebCore::supportedSVGFeatures): Added. Moved here from DOMImplementation,
        but also refactored.
        (WebCore::SVGTests::isValid): Changed to use the function above, rather than
        calling DOMImplementation::hasFeature. This change fixes a bug where feature names
        that do not look like valid SVG feature names, names such as "xxx", were returning
        true claiming that the feature was supported. This behavior was helpful in the
        general DOMImplementation function, but harmful here. This bug was causing test
        failures in some of our SVG tests.
        (WebCore::SVGTests::hasFeatureForLegacyBindings): Added. Uses the set above to
        implement the legacy behavior of hasFeature. It's better to have this in parallel
        with the SVGTests::isValid function rather than having either depend on the other.

        * svg/SVGTests.h: Added exported SVGTests::isValid function.

2016-09-05  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r205450.
        https://bugs.webkit.org/show_bug.cgi?id=161614

        Made tests flaky, causing false positives on EWS (Requested by
        ap on #webkit).

        Reverted changeset:

        "CachedResourceLoader is not taking into account fetch options
        to use or not cached resources"
        https://bugs.webkit.org/show_bug.cgi?id=161389
        http://trac.webkit.org/changeset/205450

2016-08-31  Filip Pizlo  <fpizlo@apple.com>

        Butterflies should be allocated in Auxiliary MarkedSpace instead of CopiedSpace and we should rewrite as much of the GC as needed to make this not a regression
        https://bugs.webkit.org/show_bug.cgi?id=160125

        Reviewed by Geoffrey Garen and Keith Miller.

        No new tests because no new WebCore behavior.
        
        Just rewiring #includes.

        * ForwardingHeaders/heap/HeapInlines.h: Added.
        * ForwardingHeaders/interpreter/Interpreter.h: Removed.
        * ForwardingHeaders/runtime/AuxiliaryBarrierInlines.h: Added.
        * Modules/indexeddb/IDBCursorWithValue.cpp:
        * Modules/indexeddb/client/TransactionOperation.cpp:
        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        * bindings/js/JSApplePayPaymentAuthorizedEventCustom.cpp:
        * bindings/js/JSApplePayPaymentMethodSelectedEventCustom.cpp:
        * bindings/js/JSApplePayShippingContactSelectedEventCustom.cpp:
        * bindings/js/JSApplePayShippingMethodSelectedEventCustom.cpp:
        * bindings/js/JSClientRectCustom.cpp:
        * bindings/js/JSDOMBinding.cpp:
        * bindings/js/JSDOMBinding.h:
        * bindings/js/JSDeviceMotionEventCustom.cpp:
        * bindings/js/JSDeviceOrientationEventCustom.cpp:
        * bindings/js/JSErrorEventCustom.cpp:
        * bindings/js/JSIDBCursorWithValueCustom.cpp:
        * bindings/js/JSIDBIndexCustom.cpp:
        * bindings/js/JSPopStateEventCustom.cpp:
        * bindings/js/JSWebGL2RenderingContextCustom.cpp:
        * bindings/js/JSWorkerGlobalScopeCustom.cpp:
        * bindings/js/WorkerScriptController.cpp:
        * contentextensions/ContentExtensionParser.cpp:
        * dom/ErrorEvent.cpp:
        * html/HTMLCanvasElement.cpp:
        * html/MediaDocument.cpp:
        * inspector/CommandLineAPIModule.cpp:
        * loader/EmptyClients.cpp:
        * page/CaptionUserPreferences.cpp:
        * page/Frame.cpp:
        * page/PageGroup.cpp:
        * page/UserContentController.cpp:
        * platform/mock/mediasource/MockBox.cpp:
        * testing/GCObservation.cpp:

2016-09-05  Fujii Hironori  <Hironori.Fujii@sony.com>

        run-bindings-tests fails since r205422
        https://bugs.webkit.org/show_bug.cgi?id=161595

        Reviewed by Darin Adler.

        Rebaseline binding tests after r205422.

        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        * bindings/scripts/test/JS/JSInterfaceName.h:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
        * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        * bindings/scripts/test/JS/JSTestEventConstructor.h:
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        * bindings/scripts/test/JS/JSTestEventTarget.h:
        * bindings/scripts/test/JS/JSTestException.cpp:
        * bindings/scripts/test/JS/JSTestException.h:
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.h:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestInterface.h:
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        * bindings/scripts/test/JS/JSTestIterable.h:
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        * bindings/scripts/test/JS/JSTestNamedConstructor.h:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestNode.h:
        * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
        * bindings/scripts/test/JS/JSTestNondeterministic.h:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestObj.h:
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.h:
        * bindings/scripts/test/JS/JSattribute.cpp:
        * bindings/scripts/test/JS/JSattribute.h:
        * bindings/scripts/test/JS/JSreadonly.cpp:
        * bindings/scripts/test/JS/JSreadonly.h:

2016-09-05  Fujii Hironori  <Hironori.Fujii@sony.com>

        [CMake] Duplicated IDL files in WebCore_IDL_FILES
        https://bugs.webkit.org/show_bug.cgi?id=161592

        Reviewed by Darin Adler.

        * CMakeLists.txt: Removed duplicated IDL files.
        * DerivedSources.cpp: Added #if ENABLE(USER_MESSAGE_HANDLERS)

2016-09-05  Joseph Pecoraro  <pecoraro@apple.com>

        [Mac] Static Analyzer warnings about unused values in CDMSessionAVStreamSession.mm
        https://bugs.webkit.org/show_bug.cgi?id=161598

        Reviewed by Darin Adler.

        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
        (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
        Make this parameter a reference again, accidentally lost in r195410.
        Now assignments to the parameter make sense.

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

        Clean CSS stylesheets should be accessible from JavaScript
        https://bugs.webkit.org/show_bug.cgi?id=158728

        Reviewed by Darin Adler.

        Covered by updated tests.

        Making use of the resource response type to evaluate whether to make the CSS stylesheets visible
        for stylesheet link elements and for stylesheet processing instructions.
        Ideally, the origin flag should be a boolean.

        To keep behavior consistent in cors-check-unaware cases, the flag might remain unset.
        In that case, the behavior remains the same (checking of the stylesheet URL).
        The origin flag is set to true or false only in case of fetch mode being set to cors using the crossorigin attribute.

        Updated CSSStyleSheet::create to take a Node reference. Updated callers accordingly.

        * contentextensions/ContentExtensionStyleSheet.cpp:
        (WebCore::ContentExtensions::ContentExtensionStyleSheet::ContentExtensionStyleSheet): Updated to pass a Node reference and not pointer.
        * css/CSSStyleSheet.cpp:
        (WebCore::CSSStyleSheet::create): Makes origin flag undefined if boolean parameter is not passed.
        Otherwise origin flag is set according given boolean value.
        (WebCore::CSSStyleSheet::createInline): Makes origin flag set to true.
        (WebCore::CSSStyleSheet::CSSStyleSheet): Adding origin flag initialization.
        (WebCore::CSSStyleSheet::canAccessRules): Returning according the origin flag if set.
        Returning as before in case the flag is not set.
        * css/CSSStyleSheet.h: Adding origin clean flag.
        * dom/ExtensionStyleSheets.cpp:
        (WebCore::ExtensionStyleSheets::addUserStyleSheet):
        (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
        (WebCore::ExtensionStyleSheets::maybeAddContentExtensionSheet):
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::initializeStyleSheet): Helper routine used in setCSSStyleSheet.
        Sets origin clean flag if the resource is clean.
        (WebCore::HTMLLinkElement::setCSSStyleSheet): Making use of initializeStyleSheet.
        * html/HTMLLinkElement.h:

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

        CachedResourceLoader is not taking into account fetch options to use or not cached resources
        https://bugs.webkit.org/show_bug.cgi?id=161389

        Reviewed by Darin Adler.

        Tests: http/tests/fetch/fetching-same-resource-with-diffferent-options.html
               http/tests/security/cross-origin-cached-resource-parallel.html
               http/tests/security/cross-origin-cached-resource.html
               http/tests/security/load-image-after-redirection-2.html
               http/tests/security/shape-outside-and-cached-resources.html

        Adding CORS checks for the response in case of CORS fetch mode, in SubresourceLoader.
        Removing the CORS checks in Image and DocumentThreadableLoader.

        The direction of this patch is to make CachedResource origin-specific/fetch mode specific.

        This will remove the need for CachedResource clients to do CORS checks when receiving the notifyFinished call.
        This will also make the computation of whether a resource is clean or not much easier since the CachedResource knowd its origin and its response tainting.

        Removing the CORS checks at ImageLoader creates the risk of using some cached resources loaded from previously no-cors mode without doing the actual CORS check.
        Note that the risk was already there in case of a resource loaded through redirections.
        Reusing a cached resource for a load with different options also leads to bad computation of the resource tainting.

        As a first step, improvements are done but only for CachedImage resources.

        This patch limits the direct reuse of cached resources as follow:
        - If the request and existing resources have different origins.
        - If the fetch mode is different between request and existing resource.

        In those cases, a new CachedResource is created with the correct options and origin.
        The data and response of the CachedResource found in the cache are copied efficiently in the new CachedResource, if the matching CachedResource finished loading (CachedImage specific).

        If the matching CachedResource is still loading, we trigger a reload (with caching=false to not disturb the being loaded resource).
        This should be made more efficient at some point, especially if the matching CachedResource already has its response set.

        This triggers a change of behavior: previously, the CORS checks were done by the ImageLoader when the resource was finished loading.
        The CORS checks were controlled by the crossOrigin attribute, which may be set or unset between the load start and the load end.

        Now the crossOrigin attribute is checked at load start. If it is set, the CORS checks will happen even if the attribute is unset before the end of the load.
        This is more consistent as the actual request was built with CORS enabled.

        * loader/CrossOriginPreflightChecker.cpp:
        (WebCore::CrossOriginPreflightChecker::startPreflight): Setting correctly the preflight options as per fetch spec.
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::didReceiveResponse): Removing CORS check.
        (WebCore::DocumentThreadableLoader::loadRequest): Adding CORS check in sync mode.
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::updateFromElement):
        (WebCore::ImageLoader::notifyFinished):
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::didReceiveResponse): Adding CORS checks to the response
        (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl): Helper routine to do CORS checks
        * loader/SubresourceLoader.h:
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::cloneData): Responsible to set image content from another CachedImage.
        * loader/cache/CachedImage.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::computeOrigin): Helper routine to set the origin and whether the resource is cross-origin or not.
        (WebCore::CachedResource::load): Using computeOrigin.
        (WebCore::CachedResource::loadFrom): Loading from a CachedResource from the same type and which finished loading.
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::cloneData):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Helper routine responsible to adapt the CachedResource
        that can be reused to the origin and options of a new request.
        (WebCore::CachedResourceLoader::requestResource): Calling updateCachedResourceWithCurrentRequest before actually returning the resource.
        (WebCore::CachedResourceLoader::determineRevalidationPolicy): Space clean-up.
        * loader/cache/CachedResourceLoader.h:
        * loader/cache/CachedResourceRequest.h:
        (WebCore::CachedResourceRequest::setCachingPolicy):
        * style/StylePendingResources.cpp:
        (WebCore::Style::loadPendingImage): Allowing data URLs for ShapeOutside data.

2016-09-05  Frederic Wang  <fwang@igalia.com>

        More refactoring of RenderMathMLScripts
        https://bugs.webkit.org/show_bug.cgi?id=161371

        Reviewed by Darin Adler.

        This is a follow-up of bug 161084. The function getScriptMetricsAndLayoutIfNeeded was quite
        complicated and it was not obvious that we have to call it twice with the same reference
        to a struture holding vertical metrics. We extract the part retrieving layout parameters
        into verticalParameters and move its layoutIfNeeded calls into layoutBlock. Then it can
        be reduced to a simple function that retrieve the vertical metrics in one call.
        We also improve getBaseAndScripts to make clear that it is performing validation. It returns
        a ReferenceChildren structure encapsulating pointers to important children so that we no
        longer pass these pointers as function parameters. We continue to need them to browse the
        list of prescripts & postscripts but we refactor a bit the loop to avoid explicit mention
        of RenderBox*.

        No new tests, already covered by existing tests.

        * rendering/mathml/RenderMathMLScripts.cpp:
        (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren): We now store the pointers to
        the base, firstPostScript and firstPreScript children in the ReferenceChildren structure. We
        also add a pointer to the prescriptDelimiter for convenience.
        (WebCore::RenderMathMLScripts::italicCorrection): Use the ReferenceChildren structure so that
        we are sure the base has been validated before calling this function.
        (WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Retrieve the reference
        children with validateAndGetReferenceChildren instead of calling getBaseAndScripts and use
        ReferenceChildren to handle these children and to call italicCorrection. The loops for
        SubSup, UnderOver, Multiscripts are also rewritten a bit to avoid declaring a null RenderBox*
        outside of them and hence allow to use auto.
        (WebCore::RenderMathMLScripts::verticalParameters): This part to extract the layout
        parameters is extracted from getScriptMetricsAndLayoutIfNeeded. The parameters are returned
        as a VerticalParameters struct.
        (WebCore::RenderMathMLScripts::verticalMetrics): This is the remaining part of
        getScriptMetricsAndLayoutIfNeeded It used to call layoutIfNeeded on children and to
        calculate maximum vertical metrics. For Multiscripts it was called twice: We did a first
        call to handle the prescripts and then pass the result again in the second call to handle
        the postscripts. We modify a bit the loop so that all the scripts are handled in one call and
        hence we can directly return a VerticalMetrics. Again, the reference children are now handled
        using the ReferenceChildren structure passed as a parameter.
        (WebCore::RenderMathMLScripts::layoutBlock): We retrieve the reference children with
        validateAndGetReferenceChildren instead of calling getBaseAndScripts and use
        ReferenceChildren to handle these children and to call italicCorrection. We layout all the
        children if needed in one loop at the beginning instead of doing that when their vertical
        metrics are needed. We can now also retrieve vertical metrics with a single call.
        (WebCore::RenderMathMLScripts::getBaseAndScripts): Renamed validateAndGetReferenceChildren.
        (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): Deleted. Split into
        verticalParameters and verticalMetrics.
        * rendering/mathml/RenderMathMLScripts.h: New structure to handle the pointers to reference
        children. Update the signature of getBaseAndScripts to use this struture and give a clearer
        name. Update the signature of italicCorrection to use this structure too. Add a new structure
        VerticalParameters and declare the helper function to retrieve them. Rename ScriptMetrics
        to VerticalMetrics and update the signature of the function needed to retrieve it.

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

        MediaPlayerPrivateGStreamerBase: improve build guards in nativeImageForCurrentTime()
        https://bugs.webkit.org/show_bug.cgi?id=161594

        Reviewed by Philippe Normand.

        Guard the uses of cairo-gl API in nativeImageForCurrentTime() with the
        USE(CAIRO) && ENABLE(ACCELERATED_2D_CANVAS) pair of build guards. This
        API is only made available when the ACCELERATED_2D_CANVAS option is
        enabled. Placing the guards this way thus avoids compilation errors
        when compiling USE_GSTREAMER_GL code without the accelerated 2D canvas
        support enabled.

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

2016-09-04  Sam Weinig  <sam@webkit.org>

        Remove the CREATE_DOM_WRAPPER macro
        https://bugs.webkit.org/show_bug.cgi?id=161580

        Reviewed by Dan Bernstein.

        The CREATE_DOM_WRAPPER has irritated me for too long! Replace it
        with direct calls to createWrapper<ImplementationType>, which has
        been upgraded to not require specifying both the implementation type
        and the wrapper type by way of the new JSDOMWrapperConverterTraits
        struct which provides mapping from ImplementationType -> JSWrapper.
        createWrapper<ImplementationType> has also been upgraded to have a
        specialization for when the object being passed in needs to be casted.

        * bindings/js/JSAnimationTimelineCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSBlobCustom.cpp:
        (WebCore::toJSNewlyCreated):
        (WebCore::constructJSBlob):
        * bindings/js/JSCSSRuleCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSCSSValueCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSDataCueCustom.cpp:
        (WebCore::constructJSDataCue):
        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::createNewDocumentWrapper):
        * bindings/js/JSDocumentFragmentCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSElementCustom.cpp:
        (WebCore::createNewElementWrapper):
        * bindings/js/JSEventCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSFileCustom.cpp:
        (WebCore::constructJSFile):
        * bindings/js/JSHTMLCollectionCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSHTMLDocumentCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSIDBCursorCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSImageDataCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSNodeCustom.cpp:
        (WebCore::createWrapperInline):
        * bindings/js/JSNodeListCustom.cpp:
        (WebCore::createWrapper):
        * bindings/js/JSPerformanceEntryCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSSVGPathSegCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSStyleSheetCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSTextCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSTextTrackCueCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSXMLDocumentCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * dom/make_names.pl:
        (printWrapperFunctions):
        (printWrapperFactoryCppFile):
        Replace CREATE_DOM_WRAPPER with direct calls to createWrapper.

        * bindings/js/JSWorkerGlobalScopeBase.h:
        Add #include of JSDOMWrapper.h to allow generated subclasses to use 
        JSDOMWrapperConverterTraits.

        * bindings/js/JSDOMBinding.h:
        (WebCore::castDOMObjectForWrapperCreation): Deleted.
        Remove CREATE_DOM_WRAPPER and castDOMObjectForWrapperCreation and 
        specialize createWrapper.

        * bindings/js/JSDOMWrapper.h:
        Forward declare JSDOMWrapperConverterTraits.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        Add specialization of JSDOMWrapperConverterTraits for each header.

        (GenerateImplementation):
        (GenerateConstructorDefinition):
        Replace CREATE_DOM_WRAPPER with direct calls to createWrapper.

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

        Remove Style::PendingResources
        https://bugs.webkit.org/show_bug.cgi?id=161574

        Reviewed by Andreas Kling.

        RenderStyle contains all the information needed to initialize resource loads. There is no need for this side structure.

        * css/CSSFilterImageValue.cpp:
        (WebCore::CSSFilterImageValue::loadSubimages):

            Load external SVG resources along with any image resources.

        * css/CSSToStyleMap.cpp:
        (WebCore::CSSToStyleMap::styleImage):
        (WebCore::CSSToStyleMap::mapFillImage):
        (WebCore::CSSToStyleMap::mapNinePieceImage):
        * css/CSSToStyleMap.h:
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertStyleImage):
        (WebCore::StyleBuilderConverter::convertShapeValue):
        * css/StyleBuilderCustom.h:
        (WebCore::StyleBuilderCustom::applyValueCursor):
        (WebCore::StyleBuilderCustom::applyValueContent):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::State::clear):
        (WebCore::StyleResolver::styleImage):
        (WebCore::StyleResolver::createFilterOperations):
        (WebCore::StyleResolver::loadPendingResources):
        (WebCore::StyleResolver::State::ensurePendingResources): Deleted.
        (WebCore::StyleResolver::styleCachedImageFromValue): Deleted.
        (WebCore::StyleResolver::styleGeneratedImageFromValue): Deleted.
        * css/StyleResolver.h:
        (WebCore::StyleResolver::State::takePendingResources): Deleted.
        * platform/graphics/filters/FilterOperation.cpp:
        (WebCore::ReferenceFilterOperation::loadExternalDocumentIfNeeded):
        (WebCore::ReferenceFilterOperation::getOrCreateCachedSVGDocumentReference): Deleted.
        * platform/graphics/filters/FilterOperation.h:
        (WebCore::ReferenceFilterOperation::cachedSVGDocumentReference):
        * rendering/style/StyleCachedImage.cpp:
        (WebCore::StyleCachedImage::StyleCachedImage):
        * style/StylePendingResources.cpp:
        (WebCore::Style::loadPendingResources):

            Trigger resource loads by checking pending resources in RenderStyle unconditionally. Keeping track of them
            separately wasn't necessary or a meaningful optimization.

        (WebCore::Style::loadPendingImages): Deleted.
        (WebCore::Style::loadPendingSVGFilters): Deleted.
        * style/StylePendingResources.h:

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

        Reverse ownership relation of StyleCachedImage and CSSImageValue
        https://bugs.webkit.org/show_bug.cgi?id=161447

        Reviewed by Andreas Kling.

        Currently StyleCachedImage (which represents an image in RenderStyle) has a weak ref to the
        underlying CSSImageValue/CSSImageSetValue which actually owns it. This is awkwards especially since
        StyleGeneratedImage, the other StyleImage subclass has reversed relationship where it refs
        the underlying CSSImageGeneratorValue.

        This patch makes StyleCachedImage similar to StyleGeneratedImage. StyleCachedImage now refs the
        underlying CSSImageValue/CSSImageSetValue. CSSImageValues no longer need to know about StyleCachedImage.
        Instead they reference CachedImages (memory cache objects) directly. StyleCachedImage instances are now
        conceptually unique to RenderStyle instances. Actual resources are shared as before by sharing CachedImages.

        * css/CSSCursorImageValue.cpp:
        (WebCore::CSSCursorImageValue::loadImage):
        (WebCore::CSSCursorImageValue::cachedImage):
        (WebCore::CSSCursorImageValue::styleImage): Deleted.
        * css/CSSCursorImageValue.h:
        * css/CSSImageGeneratorValue.cpp:
        (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
        * css/CSSImageSetValue.cpp:
        (WebCore::CSSImageSetValue::~CSSImageSetValue):
        (WebCore::CSSImageSetValue::loadBestFitImage):
        (WebCore::CSSImageSetValue::traverseSubresources):
        (WebCore::CSSImageSetValue::styleImage): Deleted.
        * css/CSSImageSetValue.h:
        * css/CSSImageValue.cpp:
        (WebCore::CSSImageValue::CSSImageValue):
        (WebCore::CSSImageValue::~CSSImageValue):
        (WebCore::CSSImageValue::isPending):
        (WebCore::CSSImageValue::loadImage):
        (WebCore::CSSImageValue::traverseSubresources):
        (WebCore::CSSImageValue::knownToBeOpaque):
        (WebCore::CSSImageValue::styleImage): Deleted.
        * css/CSSImageValue.h:
        * css/StyleBuilderCustom.h:
        (WebCore::StyleBuilderCustom::applyValueContent):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::styleImage):
        (WebCore::StyleResolver::styleCachedImageFromValue):
        (WebCore::StyleResolver::styleGeneratedImageFromValue):
        (WebCore::StyleResolver::cachedOrPendingFromValue): Deleted.
        (WebCore::StyleResolver::generatedOrPendingFromValue): Deleted.
        (WebCore::StyleResolver::setOrPendingFromValue): Deleted.
        (WebCore::StyleResolver::cursorOrPendingFromValue): Deleted.
        * css/StyleResolver.h:
        * editing/TextIterator.cpp:
        (WebCore::fullyClipsContents):
        * page/PageSerializer.cpp:
        (WebCore::PageSerializer::retrieveResourcesForProperties):
        * rendering/style/FillLayer.cpp:
        (WebCore::FillLayer::imagesIdentical):

            Compare data equality instead of pointer equality for StyleImages (since StyleImages are no longer shared).

        (WebCore::layerImagesIdentical): Deleted.
        * rendering/style/StyleCachedImage.cpp:
        (WebCore::StyleCachedImage::StyleCachedImage):
        (WebCore::StyleCachedImage::~StyleCachedImage):
        (WebCore::StyleCachedImage::cachedImage):
        (WebCore::StyleCachedImage::cssValue):
        (WebCore::StyleCachedImage::canRender):
        (WebCore::StyleCachedImage::isPending):
        (WebCore::StyleCachedImage::isLoaded):
        (WebCore::StyleCachedImage::errorOccurred):
        (WebCore::StyleCachedImage::imageSize):
        (WebCore::StyleCachedImage::imageHasRelativeWidth):
        (WebCore::StyleCachedImage::imageHasRelativeHeight):
        (WebCore::StyleCachedImage::computeIntrinsicDimensions):
        (WebCore::StyleCachedImage::usesImageContainerSize):
        (WebCore::StyleCachedImage::setContainerSizeForRenderer):
        (WebCore::StyleCachedImage::addClient):
        (WebCore::StyleCachedImage::removeClient):
        (WebCore::StyleCachedImage::image):
        (WebCore::StyleCachedImage::knownToBeOpaque):
        (WebCore::StyleCachedImage::setCachedImage): Deleted.
        * rendering/style/StyleCachedImage.h:

2016-09-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Media controls behave strangely when videos mute from within a playing handler
        https://bugs.webkit.org/show_bug.cgi?id=161559
        <rdar://problem/28018438>

        Reviewed by Darin Adler.

        Defer showing media controls until after the media element has fired its onplaying handler. This handles cases
        where videos that autoplay may initially meet the criteria for main content, but once the video begins to play,
        the page may change the media in some way (e.g. muting) that makes the video no longer main content. This causes
        media controls to flicker in and out.

        These changes are covered by existing unit tests, which have been refactored to check media controller state
        after all autoplaying videos have begun playing. Also adds an additional unit test.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::notifyAboutPlaying):
        (WebCore::HTMLMediaElement::hasEverNotifiedAboutPlaying):
        * html/HTMLMediaElement.h:
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::canShowControlsManager):

2016-09-03  Ryosuke Niwa  <rniwa@webkit.org>

        Update the semantics of defined-ness of custom elements per spec changes
        https://bugs.webkit.org/show_bug.cgi?id=161570

        Reviewed by Darin Adler.

        This patch adds the notion of a custom element that failed to construct or upgrade so that :defined
        doesn't apply to such an element. We also set the defined flag inside the HTMLElement constructor in
        the case of synchronous construction instead of waiting for the custom element constructor to finish.
        https://dom.spec.whatwg.org/#concept-create-element

        Conceptually, there are four distinct states for an element:
        1. The element is a built-in element
        2. The element is a custom element yet to be defined (an upgrade candidate).
        3. The element is a well-defined custom element (constructed or upgraded).
        4. The element has failed to construct or upgrade as a custom element (because the custom element
        constructor threw an exception or returned an unexpected object).

        In the latest DOM/HTML specifications, these states are called as 1. "uncustomized", 2. "undefined",
        3. "custom", and 4. "failed": https://dom.spec.whatwg.org/#concept-element-defined

        This patch refactors Node flags to introduce these distinct states as the following:
        1. Neither IsCustomElement nor IsEditingTextOrUnresolvedCustomElementFlag is set.
        2. IsCustomElement and IsEditingTextOrUnresolvedCustomElementFlag are set.
        isCustomElementUpgradeCandidate() and isUndefinedCustomElement() return true.
        3. IsCustomElement is set and IsEditingTextOrUnresolvedCustomElementFlag is unset.
        isDefinedCustomElement() returns true.
        4. IsCustomElement is unset and IsEditingTextOrUnresolvedCustomElementFlag is set.
        isFailedCustomElement() and isUndefinedCustomElement() return true.

        Per a spec change, this patch also makes :defined applied to a synchronously constructed custom element
        immediately after super() call in the constructor. When the constructor throws an exception or fails to
        return the right element, the HTML parser marks the fallback element with setIsUndefinedCustomElement.

        Tests: fast/custom-elements/defined-pseudo-class.html
               fast/custom-elements/defined-rule.html
               fast/custom-elements/upgrading/Node-cloneNode.html

        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::constructElement): Don't set :defined flag here since that's done
        in the HTMLElement constructor now.
        (WebCore::JSCustomElementInterface::upgradeElement): Mark the element as failed-to-upgrade as needed.
        * bindings/js/JSElementCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSHTMLElementCustom.cpp:
        (WebCore::constructJSHTMLElement):
        * css/SelectorCheckerTestFunctions.h:
        (WebCore::isDefinedElement):
        * dom/CustomElementReactionQueue.cpp:
        (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Enqueue custom element reactions
        only if the element is well defined (successfully constructed or upgraded).
        (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Ditto.
        (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Ditto.
        (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Ditto.
        (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Ditto.
        * dom/CustomElementRegistry.cpp:
        (WebCore::enqueueUpgradeInShadowIncludingTreeOrder):
        * dom/Document.cpp:
        (WebCore::createUpgradeCandidateElement):
        (WebCore::createFallbackHTMLElement):
        * dom/Element.cpp:
        (WebCore::Element::attributeChanged):
        (WebCore::Element::didMoveToNewDocument):
        (WebCore::Element::insertedInto):
        (WebCore::Element::removedFrom):
        (WebCore::Element::setCustomElementIsResolved): Deleted.
        (WebCore::Element::setIsDefinedCustomElement): Renamed from setCustomElementIsResolved.
        (WebCore::Element::setIsFailedCustomElement): Added.
        (WebCore::Element::setIsCustomElementUpgradeCandidate): Added.
        (WebCore::Element::customElementInterface):
        * dom/Element.h:
        * dom/Node.h:
        (WebCore::Node::setIsCustomElement): Deleted.
        (WebCore::Node::isUndefinedCustomElement): Renamed from isUnresolvedCustomElement.
        (WebCore::Node::setIsUnresolvedCustomElement): Deleted.
        (WebCore::Node::isCustomElementUpgradeCandidate): Added.
        (WebCore::Node::isDefinedCustomElement): Renamed from isCustomElement.
        (WebCore::Node::isFailedCustomElement): Added.
        * dom/make_names.pl:
        (printWrapperFactoryCppFile): Use the HTMLElement wrapper on upgrade candidates. When a custom element
        failed to upgrade, the HTMLElement constructor would have created the wrapper so we never run this code.
        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): 
        * html/parser/HTMLDocumentParser.cpp:
        (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Mark the HTMLUnknownElement created when
        the custom element constructor failed to run successfully as a failed custom element so that :define
        wouldn't apply to this element.

2016-09-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Refactor the heuristic for showing media controls to take all media sessions into account
        https://bugs.webkit.org/show_bug.cgi?id=161503
        <rdar://problem/28033783>

        Reviewed by Darin Adler.

        Currently, when selecting a media session to show playback controls for, we grab the first media session that
        passes our heuristic. Using this method, we are unable to take additional factors into account, such as whether
        another media session's element is scrolled in view, or if another media session has been interacted with more
        recently. To address this, we make the following changes:

            1.  Consider the list of all MediaElementSessions.

            2.  Select only the MediaElementSessions capable of showing media controls and sort the list by a special
                heuristic that takes visibility and time of last user interaction into account. The first element on
                this list is the strongest candidate for main content.

            3.  If this strongest candidate is visible in the viewport, or it is playing with audio, we return this
                as the chosen candidate. Otherwise, we return this session only if no other non-candidate video could be
                confused as the main content (i.e. the non-candidate video is not only visible in the viewport, but also
                large enough to be considered main content).

        Using this new method of determining the video to show controls for, we retain previous behavior for pages with
        a single video. On pages with multiple videos, the above logic ensures that if the current controlled video is
        paused, scrolled out of view, and then a new video is scrolled into view, we will either hide media controls to
        avoid confusion if that video could be confused for main content (using the mechanism in step 3), or we
        hook up the media controls to the new video if it satisfies main content (using the mechanism in step 2).

        This patch also adds 6 new TestWebKitAPI unit tests.

        * html/HTMLMediaElement.cpp:
        (WebCore::mediaElementSessionInfoForSession):
        (WebCore::preferMediaControlsForCandidateSessionOverOtherCandidateSession):
        (WebCore::mediaSessionMayBeConfusedWithMainContent):
        (WebCore::bestMediaSessionForShowingPlaybackControlsManager):
        (WebCore::HTMLMediaElement::didAttachRenderers):
        (WebCore::HTMLMediaElement::layoutSizeChanged):
        (WebCore::HTMLMediaElement::isVisibleInViewportChanged):
        (WebCore::HTMLMediaElement::resetPlaybackSessionState):
        (WebCore::HTMLMediaElement::isVisibleInViewport):
        (WebCore::HTMLMediaElement::updatePlaybackControlsManager):
        * html/HTMLMediaElement.h:
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::removeBehaviorRestriction):
        (WebCore::MediaElementSession::canShowControlsManager):
        (WebCore::MediaElementSession::isLargeEnoughForMainContent):
        (WebCore::MediaElementSession::mostRecentUserInteractionTime):
        (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForMediaControls):
        (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForAutoplay):
        (WebCore::MediaElementSession::resetPlaybackSessionState):
        (WebCore::MediaElementSession::canControlControlsManager): Deleted.
        * html/MediaElementSession.h:
        * platform/audio/PlatformMediaSession.h:
        (WebCore::PlatformMediaSession::resetPlaybackSessionState):
        (WebCore::PlatformMediaSession::canControlControlsManager): Deleted.
        * platform/audio/PlatformMediaSessionManager.cpp:
        (WebCore::PlatformMediaSessionManager::currentSessionsMatching):
        (WebCore::PlatformMediaSessionManager::currentSessionMatching): Deleted.
        * platform/audio/PlatformMediaSessionManager.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        (WebPlaybackSessionModelMediaElement::setMediaElement):

2016-09-03  Darin Adler  <darin@apple.com>

        Streamline DOMImplementation, and move it to our new DOM exception system
        https://bugs.webkit.org/show_bug.cgi?id=161295

        Reviewed by Ryosuke Niwa.

        * WebCore.xcodeproj/project.pbxproj: Added new headers to project.

        * bindings/js/JSDOMBinding.h:
        (WebCore::toJS): Added an overload for ExceptionOr<>; this handles the
        exception case here so it doesn't need to be handled in generated code
        for the binding. Implemented here so that ExceptionOr.h does not know
        about bindings. But since this is a template, it will only compile when
        instantiated and there is no need to include ExceptionOr.h and indirectly
        the Variant.h header in this header.
        (WebCore::toJSNewlyCreated): Ditto.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateCallbackImplementation): Refer to JSC::Exception with explicit
        namespace to avoid ambiguity with WebCore::Exception.

        * dom/DOMImplementation.cpp:
        (WebCore::DOMImplementation::createDocumentType): Changed to return
        ExceptionOr.
        (WebCore::createXMLDocument): Added. Helper used in createDocument.
        (WebCore::DOMImplementation::getInterface): Deleted. This was unused.
        (WebCore::DOMImplementation::createDocument): Changed to return
        ExceptionOr.
        (WebCore::DOMImplementation::createCSSStyleSheet): Removed the unused
        ExceptionCode out argument.
        (WebCore::isValidXMLMIMETypeChar): Deleted. Moved to MIMETypeRegistry.
        (WebCore::DOMImplementation::isXMLMIMEType): Ditto.
        (WebCore::DOMImplementation::isTextMIMEType): Ditto.

        * dom/DOMImplementation.h: Changed functions as described above to
        return ExceptionOr values. Also removed unused getInterface function,
        and isXMLMIMEType and isTextMIMEType, which both moved to the
        MIMETypeRegistry class alongside all the other similar MIME type
        functions.

        * dom/DOMImplementation.idl: Reorganized this to match the IDL files
        in the specifications a little better. Also removed [RaisesException]
        since that is only needed for the old legacy ExceptionCode& style.

        * dom/Document.cpp:
        (WebCore::Document::setXMLVersion): Removed call to the
        DOMImplementation::hasFeature function since the values passed in
        unconditionally result in the return value "true". This is left over
        either from specification language, or from an ancient version of this
        code that worked in a "no XML supported" mode.
        (WebCore::Document::setXMLStandalone): Ditto.

        * dom/Document.h: Removed the ExceptionCode& out argument from setXMLStandalone.
        * dom/Document.idl: Removed [SetterRaisesException] from xmlStandalone.

        * dom/Exception.h: Added.
        * dom/ExceptionOr.h: Added.

        * html/HTMLTemplateElement.cpp: Removed unneeded include of DOMImplementation.h.

        * inspector/InspectorPageAgent.cpp:
        (WebCore::createXHRTextDecoder): Use isXMLMIMEType in its new location in
        MIMETypeRegistry.
        * inspector/NetworkResourcesData.cpp:
        (WebCore::createOtherResourceTextDecoder): Ditto.

        * loader/FrameLoader.cpp: Removed unneeded include of DOMImplementation.h.

        * loader/TextResourceDecoder.cpp:
        (WebCore::TextResourceDecoder::determineContentType): Use isXMLMIMEType in its
        new location in MIMETypeRegistry.

        * platform/MIMETypeRegistry.cpp:
        (WebCore::MIMETypeRegistry::isTextMIMEType): Added. Moved here from
        DOMImplementation.
        (WebCore::isValidXMLMIMETypeChar): Ditto.
        (WebCore::MIMETypeRegistry::isXMLMIMEType): Ditto.

        * platform/MIMETypeRegistry.h: Added isXMLMIMEType and isTextMIMEType.
        Made isUnsupportedTextMIMEType private.

        * svg/SVGElement.cpp:
        (WebCore::SVGElement::isSupported): Deleted. This function was never called.
        * svg/SVGElement.h: Updated for the above change.

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::responseIsXML): Use isXMLMIMEType in its new
        location in MIMETypeRegistry.

        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::XMLDocumentParser::startDocument): Updated since setXMLStandalone
        no longer can raise an exception.

2016-09-03  Ryosuke Niwa  <rniwa@webkit.org>

        Unbreak customElements.whenDefined after r205383 with a crash fix
        https://bugs.webkit.org/show_bug.cgi?id=161562

        Reviewed by Darin Adler.

        The crash was caused by DeferredWrapper::contextDestroyed not calling ContextDestructionObserver::contextDestroyed.

        This caused m_scriptExecutionContext to not being set to nullptr when the Document was destroyed before DOMWindow
        during a single GC sweeping, and resulted in a use-after-free in ContextDestructionObserver's destructor.

        Fixed the crash and reverted r205383.

        Tests: fast/custom-elements/CustomElementRegistry.html

        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::whenDefinedPromise):
        * bindings/js/JSDOMPromise.cpp:
        (WebCore::DeferredWrapper::contextDestroyed): Fixed the crash.
        * dom/CustomElementRegistry.cpp:
        (WebCore::CustomElementRegistry::addElementDefinition):
        * dom/CustomElementRegistry.h:
        (WebCore::CustomElementRegistry::promiseMap):

2016-09-03  Chris Dumez  <cdumez@apple.com>

        Align cross-Origin Object.getOwnPropertyNames() with the HTML specification
        https://bugs.webkit.org/show_bug.cgi?id=161457

        Reviewed by Darin Adler.

        Align cross-Origin Object.getOwnPropertyNames() with the HTML specification:
        - https://html.spec.whatwg.org/#windowproxy-ownpropertykeys
        - https://html.spec.whatwg.org/#location-ownpropertykeys
        - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)

        We should list cross origin properties.

        Firefox complies with the specification. However, WebKit was returning an
        empty array and logs a security error message.

        No new tests, updated existing test.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::addCrossOriginPropertyNames):
        (WebCore::JSDOMWindow::getOwnPropertyNames):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::addCrossOriginPropertyNames):
        (WebCore::JSLocation::getOwnPropertyNames):

2016-09-03  Frédéric Wang  <fwang@igalia.com>

        Constructors of MathML renderers should only accept MathMLPresentationElement-derived classes
        https://bugs.webkit.org/show_bug.cgi?id=161378

        Reviewed by Darin Adler.

        We update constructors of RenderMathMLBlock, to only accept MathMLPresentationElement
        instances as a parameter. Similarly, we make the constructor of RenderMathMLToken only
        accept MathMLTokenElement instances.

        No new tests, behavior is unchanged.

        * rendering/mathml/RenderMathMLBlock.cpp:
        (WebCore::RenderMathMLBlock::RenderMathMLBlock):
        * rendering/mathml/RenderMathMLBlock.h:
        * rendering/mathml/RenderMathMLToken.cpp:
        (WebCore::RenderMathMLToken::RenderMathMLToken):
        * rendering/mathml/RenderMathMLToken.h:

2016-09-03  Brian Weinstein  <bweinstein@apple.com>

        Consult with the FrameLoaderClient about whether or not content extensions should be enabled when loading this URL.
        https://bugs.webkit.org/show_bug.cgi?id=161441

        Reviewed by Darin Adler.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::startLoadingMainResource): If content extensions aren't already disabled, consult with the
        FrameLoaderClient about whether or not we should use content extensions for this URL.
        * loader/FrameLoaderClient.h: Add the FrameLoaderClient call to determine if we should use content extensions for a given
        URL...
        * loader/EmptyClients.h: ... And add a stub implementation.

2016-09-03  Michael Catanzaro  <mcatanzaro@igalia.com>

        Silence -Wparentheses warning triggered by r205266

        Unreviewed

        * platform/URL.cpp:
        (WebCore::URL::URL):

2016-09-03  Joseph Pecoraro  <pecoraro@apple.com>

        Use ASCIILiteral in some more places
        https://bugs.webkit.org/show_bug.cgi?id=161557

        Reviewed by Darin Adler.

        * Modules/indexeddb/IDBDatabaseException.cpp:
        (WebCore::IDBDatabaseException::getErrorName):
        (WebCore::IDBDatabaseException::getErrorDescription):
        * Modules/websockets/WebSocket.cpp:
        (WebCore::WebSocket::binaryType):
        * css/FontFace.cpp:
        (WebCore::FontFace::stretch):
        (WebCore::FontFace::unicodeRange):
        (WebCore::FontFace::featureSettings):
        * html/canvas/WebGLRenderingContextBase.cpp:
        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::initiatorFor):
        * loader/FormSubmission.cpp:
        (WebCore::FormSubmission::Attributes::parseEncodingType):
        * page/SecurityOrigin.cpp:
        (WebCore::SecurityOrigin::toRawString):
        * platform/graphics/cg/ImageBufferCG.cpp:
        (WebCore::CGImageToDataURL):
        (WebCore::ImageBuffer::toDataURL):
        (WebCore::ImageDataToDataURL):
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::filenameExtension):

2016-09-03  Chris Dumez  <cdumez@apple.com>

        Object.preventExtensions(window) should throw a TypeError
        https://bugs.webkit.org/show_bug.cgi?id=161554

        Reviewed by Darin Adler.

        Object.preventExtensions(window) should throw a TypeError.

        [[PreventExtensions]] should return false for Window:
        - https://html.spec.whatwg.org/#windowproxy-preventextensions

        EcmaScript says that Object.preventExtensions() should throw a TypeError
        if [[PreventExtension]] returns false:
        - https://tc39.github.io/ecma262/#sec-object.preventextensions

        No new tests, updated existing test.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::preventExtensions):

2016-09-03  Chris Dumez  <cdumez@apple.com>

        Align meta element http-equiv="refresh" parsing with the HTML specification
        https://bugs.webkit.org/show_bug.cgi?id=161543

        Reviewed by Darin Adler.

        Align meta element http-equiv="refresh" parsing with the HTML specification:
        - https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh

        Tests: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html

        * dom/Document.cpp:
        (WebCore::Document::processHttpEquiv):
        * html/parser/HTMLParserIdioms.cpp:
        (WebCore::parseHTTPRefreshInternal):
        (WebCore::parseMetaHTTPEquivRefresh):
        * html/parser/HTMLParserIdioms.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::receivedFirstData):
        * platform/network/HTTPParsers.cpp:
        (WebCore::skipWhiteSpace):
        (WebCore::skipEquals):
        (WebCore::parseHTTPRefresh):
        (WebCore::parseXSSProtectionHeader):
        (WebCore::skipValue): Deleted.
        * platform/network/HTTPParsers.h:

2016-09-02  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Distinguish between paint advances and base advances
        https://bugs.webkit.org/show_bug.cgi?id=160892

        Reviewed by Simon Fraser.

        This patch introduces the concept of a layout (or "base") advance which is distinct
        from a painting advance. In extremely complicated scripts such as Urdu, it is common
        for a glyph advance to be negative in the horizontal direction, and have large advances
        in the vertical direction. In particular, in cursive scripts, the glyph placement is
        only indirectly related to where the actual characters lie. Conceptually, these glyph
        locations are correct for painting, but are not correct when performing width
        measurements.

        In many text engines, glyph shaping actually can be split into two phases: adjusting
        advances, and then placing glyphs relative to those advances. The secondary glyph
        placement step is much more context-sensitive than the first step. In addition, when
        multiple glyphs combine to form a character, it is common for one glyph to own the
        full base advance for the character, and for the other glyphs in the character to
        have zero base advances. (Then, in the glyph placement phase, the other glyphs get
        placed all around.)

        Because of the context-insensitivity of the base advances, it is valuable to use
        these for text measurement. Then, when we want to paint, we should add in the extra
        origins. This dramatically improves the layout of complex fonts like Noto Nastaliq.

        This patch migrates WebKit to use this two-phase shaping.

        No new tests just yet, because I have to create a font which exercises the
        advanced glyph placement support.

        * platform/graphics/GlyphBuffer.h:
        (WebCore::GlyphBufferAdvance::setHeight):
        (WebCore::GlyphBufferAdvance::setWidth): Deleted.
        * platform/graphics/TextRun.h:
        (WebCore::TextRun::TextRun):
        (WebCore::TextRun::shouldDisableLayoutSpecificAdvances):
        (WebCore::TextRun::setShouldDisableLayoutSpecificAdvances):
        (WebCore::TextRun::spacingDisabled): Deleted.
        (WebCore::TextRun::setCharacterScanForCodePath): Deleted.
        * platform/graphics/cocoa/FontCascadeCocoa.mm:
        (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
        * platform/graphics/mac/ComplexTextController.cpp:
        (WebCore::ComplexTextController::ComplexTextController):
        (WebCore::ComplexTextController::offsetForPosition):
        (WebCore::ComplexTextController::collectComplexTextRuns):
        (WebCore::ComplexTextController::ComplexTextRun::setIsNonMonotonic):
        (WebCore::ComplexTextController::runWidthSoFarFraction):
        (WebCore::ComplexTextController::advance):
        (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
        * platform/graphics/mac/ComplexTextController.h:
        (WebCore::ComplexTextController::ComplexTextRun::create):
        (WebCore::ComplexTextController::ComplexTextRun::baseAdvances):
        (WebCore::ComplexTextController::ComplexTextRun::glyphOrigins):
        (WebCore::ComplexTextController::useLayoutSpecificAdvances):
        (WebCore::ComplexTextController::finalRoundingWidth): Deleted.
        (WebCore::ComplexTextController::ComplexTextRun::advances): Deleted.
        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
        (SOFT_LINK):
        (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
        (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
        * platform/spi/cocoa/CoreTextSPI.h:

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

        Should never be reached failure in WebCore::floatValueForLength
        https://bugs.webkit.org/show_bug.cgi?id=139397
        <rdar://problem/27704376>

        Reviewed by Simon Fraser.

        floatValueForLength can't resolve unspecified Length types. Filter them out and return 0 as if they were auto.

        Test: svg/css/assert-on-non-resolvable-dimension.html

        * svg/SVGLengthContext.cpp:
        (WebCore::SVGLengthContext::valueForLength):

2016-09-02  Joseph Pecoraro  <pecoraro@apple.com>

        [Mac] Remove unnecessary RetainPtr in NeverDestroyed value
        https://bugs.webkit.org/show_bug.cgi?id=161553

        Reviewed by Daniel Bates.

        * platform/ios/WebCoreMotionManager.mm:
        (+[WebCoreMotionManager sharedManager]):

2016-09-02  Alex Christensen  <achristensen@webkit.org>

        URLParser should parse file URLs
        https://bugs.webkit.org/show_bug.cgi?id=161556

        Reviewed by Tim Horton.

        Added new API tests.

        * platform/URLParser.cpp:
        (WebCore::isWindowsDriveLetter):
        (WebCore::shouldCopyFileURL):
        (WebCore::URLParser::parse):
        (WebCore::URLParser::parseHost):
        * platform/URLParser.h:

2016-09-02  Ryosuke Niwa  <rniwa@webkit.org>

        Add validations for a synchronously constructed custom element
        https://bugs.webkit.org/show_bug.cgi?id=161528

        Reviewed by Yusuke Suzuki.

        The latest DOM specification has sanity checks when creating an element with the synchronous custom elements flag set
        in 6.1.3 through 10:
        3. If result does not implement the HTMLElement interface, throw a TypeError.
        4. If result's attribute list is not empty, then throw a NotSupportedError.
        5. If result has children, then throw a NotSupportedError.
        6. If result's parent is not null, then throw a NotSupportedError.
        7. If result's node document is not document, then throw a NotSupportedError.
        8. If result's namespace is not the HTML namespace, then throw a NotSupportedError.
        9. If result's local name is not equal to localName, then throw a NotSupportedError.

        Add all these checks to JSCustomElementInterface::constructElement.

        Tests: fast/custom-elements/Document-createElement.html

        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::constructElement): Report the exception thrown during parsing instead of just
        clearing and ignoring it.
        (WebCore::constructCustomElementSynchronously): Extracted out of constructElement so that we can also catch TypeError
        and NotSupportedError we throw in constructElement for the parser.

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

        ASSERT_NOT_REACHED() is touched in WebCore::valueForLength
        https://bugs.webkit.org/show_bug.cgi?id=123337
        <rdar://problem/27684121>

        Reviewed by Simon Fraser.

        Do not try to use unspecified height value while resolving logical height for table row.

        Test: fast/table/assert-on-non-resolvable-row-dimension.html

        * rendering/RenderTableCell.h:
        (WebCore::RenderTableCell::logicalHeightForRowSizing):

2016-09-02  Ryosuke Niwa  <rniwa@webkit.org>

        Temporarily break customElements.whenDefined to remove flaky crashes
        https://bugs.webkit.org/show_bug.cgi?id=161555

        Reviewed by Chris Dumez.

        Remove HashMap of DeferredWrapper which causes a crash during destruction.
        This breaks the semantics of "whenDefined" for now.

        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::whenDefinedPromise):
        * dom/CustomElementRegistry.cpp:
        (WebCore::CustomElementRegistry::addElementDefinition):
        * dom/CustomElementRegistry.h:
        (WebCore::CustomElementRegistry::promiseMap): Deleted.

2016-09-02  Ryan Haddad  <ryanhaddad@apple.com>
        Unreviewed, rolling out r205373.

        This change causes LayoutTest crashes under GuardMalloc

        Reverted changeset:

        "[Cocoa] Distinguish between paint advances and base advances"
        https://bugs.webkit.org/show_bug.cgi?id=160892
        http://trac.webkit.org/changeset/205373

2016-09-02  Beth Dakin  <bdakin@apple.com>

        Need to updateEditorState if an element change edit-ability without changing 
        selection
        https://bugs.webkit.org/show_bug.cgi?id=161546
        -and corresponding-
        rdar://problem/27806012

        Reviewed by Ryosuke Niwa.

        Call into the client in case edited state needs to be updated. 
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::updateAppearanceAfterLayout):
        * loader/EmptyClients.h:
        * page/EditorClient.h:

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

        ASSERTION FAILED: !m_committedWidth in WebCore::LineWidth::fitBelowFloats
        https://bugs.webkit.org/show_bug.cgi?id=149462
        <rdar://problem/27710841>

        Reviewed by David Hyatt.

        In certain cases (multiple spans on the same line with negativ marings), the LineWidth::m_committedWidth > 0
        check is not sufficient to decide if some content has already been committed to the current line.
        This patch adds a flag to indicate if we ever committed to the current line. 

        Test: fast/text/assert-when-text-with-negative-margin-sibling-does-not-fit.html

        * rendering/line/BreakingContext.h:
        (WebCore::BreakingContext::handleText):
        * rendering/line/LineWidth.h:
        (WebCore::LineWidth::hasCommitted):

2016-09-02  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Distinguish between paint advances and base advances
        https://bugs.webkit.org/show_bug.cgi?id=160892

        Reviewed by Simon Fraser.

        This patch introduces the concept of a layout (or "base") advance which is distinct
        from a painting advance. In extremely complicated scripts such as Urdu, it is common
        for a glyph advance to be negative in the horizontal direction, and have large advances
        in the vertical direction. In particular, in cursive scripts, the glyph placement is
        only indirectly related to where the actual characters lie. Conceptually, these glyph
        locations are correct for painting, but are not correct when performing width
        measurements.

        In many text engines, glyph shaping actually can be split into two phases: adjusting
        advances, and then placing glyphs relative to those advances. The secondary glyph
        placement step is much more context-sensitive than the first step. In addition, when
        multiple glyphs combine to form a character, it is common for one glyph to own the
        full base advance for the character, and for the other glyphs in the character to
        have zero base advances. (Then, in the glyph placement phase, the other glyphs get
        placed all around.)

        Because of the context-insensitivity of the base advances, it is valuable to use
        these for text measurement. Then, when we want to paint, we should add in the extra
        origins. This dramatically improves the layout of complex fonts like Noto Nastaliq.

        This patch migrates WebKit to use this two-phase shaping.

        No new tests just yet, because I have to create a font which exercises the
        advanced glyph placement support.

        * platform/graphics/GlyphBuffer.h:
        (WebCore::GlyphBufferAdvance::setHeight):
        (WebCore::GlyphBufferAdvance::setWidth): Deleted.
        * platform/graphics/TextRun.h:
        (WebCore::TextRun::TextRun):
        (WebCore::TextRun::shouldDisableLayoutSpecificAdvances):
        (WebCore::TextRun::setShouldDisableLayoutSpecificAdvances):
        (WebCore::TextRun::spacingDisabled): Deleted.
        (WebCore::TextRun::setCharacterScanForCodePath): Deleted.
        * platform/graphics/cocoa/FontCascadeCocoa.mm:
        (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
        * platform/graphics/mac/ComplexTextController.cpp:
        (WebCore::ComplexTextController::ComplexTextController):
        (WebCore::ComplexTextController::offsetForPosition):
        (WebCore::ComplexTextController::collectComplexTextRuns):
        (WebCore::ComplexTextController::ComplexTextRun::setIsNonMonotonic):
        (WebCore::ComplexTextController::runWidthSoFarFraction):
        (WebCore::ComplexTextController::advance):
        (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
        * platform/graphics/mac/ComplexTextController.h:
        (WebCore::ComplexTextController::ComplexTextRun::create):
        (WebCore::ComplexTextController::ComplexTextRun::baseAdvances):
        (WebCore::ComplexTextController::ComplexTextRun::glyphOrigins):
        (WebCore::ComplexTextController::useLayoutSpecificAdvances):
        (WebCore::ComplexTextController::finalRoundingWidth): Deleted.
        (WebCore::ComplexTextController::ComplexTextRun::advances): Deleted.
        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
        (SOFT_LINK):
        (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
        (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
        * platform/spi/cocoa/CoreTextSPI.h:

2016-09-02  Chris Dumez  <cdumez@apple.com>

        Unreviewed, roll out r205354 because it caused JSC test failures

        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::shouldAllowAccessFrom):
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::preventExtensions): Deleted.
        (WebCore::JSDOMWindow::setLocation): Deleted.
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::preventExtensions): Deleted.
        (WebCore::JSLocationPrototype::putDelegate): Deleted.
        (WebCore::JSLocationPrototype::defineOwnProperty): Deleted.
        * bindings/js/JSWorkerGlobalScopeBase.cpp:
        (WebCore::JSWorkerGlobalScopeBase::allowsAccessFrom):
        * bindings/js/JSWorkerGlobalScopeBase.h:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        * bindings/scripts/IDLAttributes.txt:
        * page/DOMWindow.idl:
        * page/Location.idl:

2016-09-02  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Provide a way to open an inspector frontend for a remote target
        https://bugs.webkit.org/show_bug.cgi?id=161515
        <rdar://problem/13182127>

        Reviewed by Brian Burg.

        Previously WebKit inspector frontend clients could only
        create a frontend for a web page with the latest protocol.
        Now it may create a frontend for a "javascript" or "web"
        debuggable that may be current or an older protocol.

        The frontend already supports these configurations by
        checking and calling InspectorFrontendHost methods
        that may or may not have existed previously:

        - debuggableType was always "web" but frontend supports "javascript"
        - inspectorBackendCommandsURLs was absent so the frontend used the most current
            - rename this to backendCommandsURL
        
        Formalize the methods and have them delegate to the
        frontend client opening the frontend.

        * inspector/InspectorFrontendClient.h:
        (WebCore::InspectorFrontendClient::backendCommandsURL):
        (WebCore::InspectorFrontendClient::debuggableType):
        * inspector/InspectorFrontendHost.cpp:
        (WebCore::InspectorFrontendHost::localizedStringsURL):
        (WebCore::InspectorFrontendHost::backendCommandsURL):
        (WebCore::InspectorFrontendHost::debuggableType):
        * inspector/InspectorFrontendHost.h:
        * inspector/InspectorFrontendHost.idl:
        Formalize and give default values to InspectorFrontentHost methods.

2016-09-02  Dave Hyatt  <hyatt@apple.com>

        Add support for media query parsing using new CSS Parser
        https://bugs.webkit.org/show_bug.cgi?id=161537

        Reviewed by Dean Jackson.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/MediaQueryExp.cpp:
        (WebCore::featureWithValidIdent):
        (WebCore::featureWithValidDensity):
        (WebCore::featureWithValidPositiveLength):
        (WebCore::featureWithPositiveInteger):
        (WebCore::featureWithPositiveNumber):
        (WebCore::featureWithZeroOrOne):
        (WebCore::isFeatureValidWithIdentifier):
        (WebCore::MediaQueryExpression::MediaQueryExpression):
        * css/MediaQueryExp.h:
        * css/parser/CSSParserIdioms.cpp: Added.
        (WebCore::convertToASCIILowercaseInPlace):
        * css/parser/CSSParserIdioms.h:
        * css/parser/CSSParserToken.cpp:
        (WebCore::convertToASCIILowercaseInPlace):
        * css/parser/MediaQueryBlockWatcher.cpp: Added.
        (WebCore::MediaQueryBlockWatcher::MediaQueryBlockWatcher):
        (WebCore::MediaQueryBlockWatcher::handleToken):
        * css/parser/MediaQueryBlockWatcher.h: Added.
        (WebCore::MediaQueryBlockWatcher::blockLevel):
        * css/parser/MediaQueryParser.cpp: Added.
        (WebCore::MediaQueryParser::parseMediaQuerySet):
        (WebCore::MediaQueryParser::parseMediaCondition):
        (WebCore::MediaQueryParser::MediaQueryParser):
        (WebCore::MediaQueryParser::~MediaQueryParser):
        (WebCore::MediaQueryParser::setStateAndRestrict):
        (WebCore::MediaQueryParser::readRestrictor):
        (WebCore::MediaQueryParser::readMediaNot):
        (WebCore::isRestrictorOrLogicalOperator):
        (WebCore::MediaQueryParser::readMediaType):
        (WebCore::MediaQueryParser::commitMediaQuery):
        (WebCore::MediaQueryParser::readAnd):
        (WebCore::MediaQueryParser::readFeatureStart):
        (WebCore::MediaQueryParser::readFeature):
        (WebCore::MediaQueryParser::readFeatureColon):
        (WebCore::MediaQueryParser::readFeatureValue):
        (WebCore::MediaQueryParser::readFeatureEnd):
        (WebCore::MediaQueryParser::skipUntilComma):
        (WebCore::MediaQueryParser::skipUntilBlockEnd):
        (WebCore::MediaQueryParser::done):
        (WebCore::MediaQueryParser::handleBlocks):
        (WebCore::MediaQueryParser::processToken):
        (WebCore::MediaQueryParser::parseInternal):
        (WebCore::MediaQueryData::MediaQueryData):
        (WebCore::MediaQueryData::clear):
        (WebCore::MediaQueryData::addExpression):
        (WebCore::MediaQueryData::tryAddParserToken):
        (WebCore::MediaQueryData::setMediaType):
        * css/parser/MediaQueryParser.h: Added.
        (WebCore::MediaQueryData::restrictor):
        (WebCore::MediaQueryData::expressions):
        (WebCore::MediaQueryData::mediaType):
        (WebCore::MediaQueryData::currentMediaQueryChanged):
        (WebCore::MediaQueryData::setRestrictor):
        (WebCore::MediaQueryData::setMediaFeature):

2016-07-08  Jer Noble  <jer.noble@apple.com>

        Refactor WebPlaybackSessionModelMediaElement to be client based.
        https://bugs.webkit.org/show_bug.cgi?id=159580

        Reviewed by Eric Carlson.

        Add client callback interfaces to both WebPlaybackSessionModel and WebVideoFullscreenModel, where each object
        can have multiple clients, and so the object will both store current values and also notify those clients
        when the values change. After this change, there is no need to have the models know about their associated
        interfaces explicitly.

        * platform/cocoa/WebPlaybackSessionInterface.h:
        * platform/cocoa/WebPlaybackSessionModel.h:
        (WebCore::WebPlaybackSessionModelClient::~WebPlaybackSessionModelClient):
        (WebCore::WebPlaybackSessionModelClient::durationChanged):
        (WebCore::WebPlaybackSessionModelClient::currentTimeChanged):
        (WebCore::WebPlaybackSessionModelClient::bufferedTimeChanged):
        (WebCore::WebPlaybackSessionModelClient::rateChanged):
        (WebCore::WebPlaybackSessionModelClient::seekableRangesChanged):
        (WebCore::WebPlaybackSessionModelClient::canPlayFastReverseChanged):
        (WebCore::WebPlaybackSessionModelClient::audioMediaSelectionOptionsChanged):
        (WebCore::WebPlaybackSessionModelClient::legibleMediaSelectionOptionsChanged):
        (WebCore::WebPlaybackSessionModelClient::externalPlaybackChanged):
        (WebCore::WebPlaybackSessionModelClient::wirelessVideoPlaybackDisabledChanged):
        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        (WebPlaybackSessionModelMediaElement::setMediaElement):
        (WebPlaybackSessionModelMediaElement::updateForEventName):
        (WebPlaybackSessionModelMediaElement::addClient):
        (WebPlaybackSessionModelMediaElement::removeClient):
        (WebPlaybackSessionModelMediaElement::updateLegibleOptions):
        (WebPlaybackSessionModelMediaElement::observedEventNames):
        (WebPlaybackSessionModelMediaElement::eventNameAll):
        (WebPlaybackSessionModelMediaElement::audioMediaSelectionOptions):
        (WebPlaybackSessionModelMediaElement::audioMediaSelectedIndex):
        (WebPlaybackSessionModelMediaElement::legibleMediaSelectedIndex):
        (WebPlaybackSessionModelMediaElement::externalPlaybackEnabled):
        (WebPlaybackSessionModelMediaElement::externalPlaybackTargetType):
        (WebPlaybackSessionModelMediaElement::externalPlaybackLocalizedDeviceName):
        (WebPlaybackSessionModelMediaElement::wirelessVideoPlaybackDisabled):
        (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface): Deleted.
        * platform/cocoa/WebVideoFullscreenInterface.h:
        * platform/cocoa/WebVideoFullscreenModel.h:
        (WebCore::WebVideoFullscreenModelClient::~WebVideoFullscreenModelClient):
        * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
        (WebCore::WebVideoFullscreenModelVideoElement::create):
        (WebCore::WebVideoFullscreenModelVideoElement::playbackSessionModel): Deleted.
        * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
        (WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement):
        (WebVideoFullscreenModelVideoElement::setVideoElement):
        (WebVideoFullscreenModelVideoElement::updateForEventName):
        (WebVideoFullscreenModelVideoElement::addClient):
        (WebVideoFullscreenModelVideoElement::removeClient):
        (WebVideoFullscreenModelVideoElement::setHasVideo):
        (WebVideoFullscreenModelVideoElement::setVideoDimensions):
        (WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface): Deleted.
        * platform/ios/WebAVPlayerController.h:
        * platform/ios/WebAVPlayerController.mm:
        (-[WebAVPlayerController resetState]): Deleted.
        * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
        (WebCore::WebPlaybackSessionInterfaceAVKitClient::~WebPlaybackSessionInterfaceAVKitClient): Deleted.
        * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
        (WebCore::WebPlaybackSessionInterfaceAVKit::WebPlaybackSessionInterfaceAVKit):
        (WebCore::WebPlaybackSessionInterfaceAVKit::~WebPlaybackSessionInterfaceAVKit):
        (WebCore::WebPlaybackSessionInterfaceAVKit::resetMediaState):
        (WebCore::WebPlaybackSessionInterfaceAVKit::durationChanged):
        (WebCore::WebPlaybackSessionInterfaceAVKit::currentTimeChanged):
        (WebCore::WebPlaybackSessionInterfaceAVKit::bufferedTimeChanged):
        (WebCore::WebPlaybackSessionInterfaceAVKit::rateChanged):
        (WebCore::WebPlaybackSessionInterfaceAVKit::seekableRangesChanged):
        (WebCore::WebPlaybackSessionInterfaceAVKit::canPlayFastReverseChanged):
        (WebCore::WebPlaybackSessionInterfaceAVKit::audioMediaSelectionOptionsChanged):
        (WebCore::WebPlaybackSessionInterfaceAVKit::legibleMediaSelectionOptionsChanged):
        (WebCore::WebPlaybackSessionInterfaceAVKit::externalPlaybackChanged):
        (WebCore::WebPlaybackSessionInterfaceAVKit::wirelessVideoPlaybackDisabledChanged):
        (WebCore::WebPlaybackSessionInterfaceAVKit::invalidate):
        (WebCore::WebPlaybackSessionInterfaceAVKit::setWebPlaybackSessionModel): Deleted.
        (WebCore::WebPlaybackSessionInterfaceAVKit::setDuration): Deleted.
        (WebCore::WebPlaybackSessionInterfaceAVKit::setCurrentTime): Deleted.
        (WebCore::WebPlaybackSessionInterfaceAVKit::setBufferedTime): Deleted.
        (WebCore::WebPlaybackSessionInterfaceAVKit::setRate): Deleted.
        (WebCore::WebPlaybackSessionInterfaceAVKit::setSeekableRanges): Deleted.
        (WebCore::WebPlaybackSessionInterfaceAVKit::setCanPlayFastReverse): Deleted.
        (WebCore::WebPlaybackSessionInterfaceAVKit::setAudioMediaSelectionOptions): Deleted.
        (WebCore::WebPlaybackSessionInterfaceAVKit::setLegibleMediaSelectionOptions): Deleted.
        (WebCore::WebPlaybackSessionInterfaceAVKit::setExternalPlayback): Deleted.
        (WebCore::WebPlaybackSessionInterfaceAVKit::setWirelessVideoPlaybackDisabled): Deleted.
        (WebCore::WebPlaybackSessionInterfaceAVKit::wirelessVideoPlaybackDisabled): Deleted.
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        (WebVideoFullscreenControllerContext::didSetupFullscreen):
        (WebVideoFullscreenControllerContext::didExitFullscreen):
        (WebVideoFullscreenControllerContext::didCleanupFullscreen):
        (WebVideoFullscreenControllerContext::durationChanged):
        (WebVideoFullscreenControllerContext::currentTimeChanged):
        (WebVideoFullscreenControllerContext::bufferedTimeChanged):
        (WebVideoFullscreenControllerContext::rateChanged):
        (WebVideoFullscreenControllerContext::hasVideoChanged):
        (WebVideoFullscreenControllerContext::videoDimensionsChanged):
        (WebVideoFullscreenControllerContext::seekableRangesChanged):
        (WebVideoFullscreenControllerContext::canPlayFastReverseChanged):
        (WebVideoFullscreenControllerContext::audioMediaSelectionOptionsChanged):
        (WebVideoFullscreenControllerContext::legibleMediaSelectionOptionsChanged):
        (WebVideoFullscreenControllerContext::externalPlaybackChanged):
        (WebVideoFullscreenControllerContext::wirelessVideoPlaybackDisabledChanged):
        (WebVideoFullscreenControllerContext::addClient):
        (WebVideoFullscreenControllerContext::removeClient):
        (WebVideoFullscreenControllerContext::requestFullscreenMode):
        (WebVideoFullscreenControllerContext::setVideoLayerFrame):
        (WebVideoFullscreenControllerContext::setVideoLayerGravity):
        (WebVideoFullscreenControllerContext::fullscreenModeChanged):
        (WebVideoFullscreenControllerContext::isVisible):
        (WebVideoFullscreenControllerContext::hasVideo):
        (WebVideoFullscreenControllerContext::videoDimensions):
        (WebVideoFullscreenControllerContext::play):
        (WebVideoFullscreenControllerContext::pause):
        (WebVideoFullscreenControllerContext::togglePlayState):
        (WebVideoFullscreenControllerContext::beginScrubbing):
        (WebVideoFullscreenControllerContext::endScrubbing):
        (WebVideoFullscreenControllerContext::seekToTime):
        (WebVideoFullscreenControllerContext::fastSeek):
        (WebVideoFullscreenControllerContext::beginScanningForward):
        (WebVideoFullscreenControllerContext::beginScanningBackward):
        (WebVideoFullscreenControllerContext::endScanning):
        (WebVideoFullscreenControllerContext::selectAudioMediaOption):
        (WebVideoFullscreenControllerContext::selectLegibleMediaOption):
        (WebVideoFullscreenControllerContext::duration):
        (WebVideoFullscreenControllerContext::currentTime):
        (WebVideoFullscreenControllerContext::bufferedTime):
        (WebVideoFullscreenControllerContext::isPlaying):
        (WebVideoFullscreenControllerContext::playbackRate):
        (WebVideoFullscreenControllerContext::seekableRanges):
        (WebVideoFullscreenControllerContext::canPlayFastReverse):
        (WebVideoFullscreenControllerContext::audioMediaSelectionOptions):
        (WebVideoFullscreenControllerContext::audioMediaSelectedIndex):
        (WebVideoFullscreenControllerContext::legibleMediaSelectionOptions):
        (WebVideoFullscreenControllerContext::legibleMediaSelectedIndex):
        (WebVideoFullscreenControllerContext::externalPlaybackEnabled):
        (WebVideoFullscreenControllerContext::externalPlaybackTargetType):
        (WebVideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName):
        (WebVideoFullscreenControllerContext::wirelessVideoPlaybackDisabled):
        (WebVideoFullscreenControllerContext::setUpFullscreen):
        (WebVideoFullscreenControllerContext::exitFullscreen):
        (WebVideoFullscreenControllerContext::requestHideAndExitFullscreen):
        (WebVideoFullscreenControllerContext::resetMediaState): Deleted.
        (WebVideoFullscreenControllerContext::setDuration): Deleted.
        (WebVideoFullscreenControllerContext::setCurrentTime): Deleted.
        (WebVideoFullscreenControllerContext::setBufferedTime): Deleted.
        (WebVideoFullscreenControllerContext::setRate): Deleted.
        (WebVideoFullscreenControllerContext::setVideoDimensions): Deleted.
        (WebVideoFullscreenControllerContext::setSeekableRanges): Deleted.
        (WebVideoFullscreenControllerContext::setCanPlayFastReverse): Deleted.
        (WebVideoFullscreenControllerContext::setAudioMediaSelectionOptions): Deleted.
        (WebVideoFullscreenControllerContext::setLegibleMediaSelectionOptions): Deleted.
        (WebVideoFullscreenControllerContext::setExternalPlayback): Deleted.
        (WebVideoFullscreenControllerContext::setWirelessVideoPlaybackDisabled): Deleted.
        (WebVideoFullscreenSessionModel::play): Deleted.
        (WebVideoFullscreenSessionModel::pause): Deleted.
        (WebVideoFullscreenSessionModel::togglePlayState): Deleted.
        (WebVideoFullscreenSessionModel::beginScrubbing): Deleted.
        (WebVideoFullscreenSessionModel::endScrubbing): Deleted.
        (WebVideoFullscreenSessionModel::seekToTime): Deleted.
        (WebVideoFullscreenSessionModel::fastSeek): Deleted.
        (WebVideoFullscreenSessionModel::beginScanningForward): Deleted.
        (WebVideoFullscreenSessionModel::beginScanningBackward): Deleted.
        (WebVideoFullscreenSessionModel::endScanning): Deleted.
        (WebVideoFullscreenSessionModel::selectAudioMediaOption): Deleted.
        (WebVideoFullscreenSessionModel::selectLegibleMediaOption): Deleted.
        * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebVideoFullscreenInterfaceAVKit::~WebVideoFullscreenInterfaceAVKit):
        (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel):
        (WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenChangeObserver):
        (WebVideoFullscreenInterfaceAVKit::hasVideoChanged):
        (WebVideoFullscreenInterfaceAVKit::videoDimensionsChanged):
        (WebVideoFullscreenInterfaceAVKit::externalPlaybackChanged):
        (WebVideoFullscreenInterfaceAVKit::resetMediaState): Deleted.
        (WebVideoFullscreenInterfaceAVKit::setDuration): Deleted.
        (WebVideoFullscreenInterfaceAVKit::setCurrentTime): Deleted.
        (WebVideoFullscreenInterfaceAVKit::setBufferedTime): Deleted.
        (WebVideoFullscreenInterfaceAVKit::setRate): Deleted.
        (WebVideoFullscreenInterfaceAVKit::setVideoDimensions): Deleted.
        (WebVideoFullscreenInterfaceAVKit::setSeekableRanges): Deleted.
        (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse): Deleted.
        (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): Deleted.
        (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): Deleted.
        (WebVideoFullscreenInterfaceAVKit::setExternalPlayback): Deleted.
        (WebVideoFullscreenInterfaceAVKit::externalPlaybackEnabledChanged): Deleted.
        (WebVideoFullscreenInterfaceAVKit::setWirelessVideoPlaybackDisabled): Deleted.
        (WebVideoFullscreenInterfaceAVKit::wirelessVideoPlaybackDisabled): Deleted.
        * platform/mac/WebPlaybackSessionInterfaceMac.h:
        (WebCore::WebPlaybackSessionInterfaceMacClient::~WebPlaybackSessionInterfaceMacClient): Deleted.
        * platform/mac/WebPlaybackSessionInterfaceMac.mm:
        (WebCore::WebPlaybackSessionInterfaceMac::create):
        (WebCore::WebPlaybackSessionInterfaceMac::WebPlaybackSessionInterfaceMac):
        (WebCore::WebPlaybackSessionInterfaceMac::~WebPlaybackSessionInterfaceMac):
        (WebCore::WebPlaybackSessionInterfaceMac::durationChanged):
        (WebCore::WebPlaybackSessionInterfaceMac::currentTimeChanged):
        (WebCore::WebPlaybackSessionInterfaceMac::rateChanged):
        (WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
        (WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
        (WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
        (WebCore::WebPlaybackSessionInterfaceMac::invalidate):
        (WebCore::WebPlaybackSessionInterfaceMac::setWebPlaybackSessionModel): Deleted.
        (WebCore::WebPlaybackSessionInterfaceMac::setClient): Deleted.
        (WebCore::WebPlaybackSessionInterfaceMac::setDuration): Deleted.
        (WebCore::WebPlaybackSessionInterfaceMac::setCurrentTime): Deleted.
        (WebCore::WebPlaybackSessionInterfaceMac::setRate): Deleted.
        (WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges): Deleted.
        (WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions): Deleted.
        (WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions): Deleted.
        * platform/mac/WebVideoFullscreenInterfaceMac.h:
        * platform/mac/WebVideoFullscreenInterfaceMac.mm:
        (WebCore::WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac):
        (WebCore::WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac):
        (WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenModel):
        (WebCore::WebVideoFullscreenInterfaceMac::externalPlaybackChanged):
        (WebCore::WebVideoFullscreenInterfaceMac::hasVideoChanged):
        (WebCore::WebVideoFullscreenInterfaceMac::videoDimensionsChanged):
        (WebCore::WebVideoFullscreenInterfaceMac::setDuration): Deleted.
        (WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime): Deleted.
        (WebCore::WebVideoFullscreenInterfaceMac::setRate): Deleted.
        (WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges): Deleted.
        (WebCore::WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions): Deleted.
        (WebCore::WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions): Deleted.
        (WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback): Deleted.
        (WebCore::WebVideoFullscreenInterfaceMac::setVideoDimensions): Deleted.

2016-09-02  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r204839): [mac-wk1] LayoutTest webgl/max-active-contexts-webglcontextlost-prevent-default.html is a flaky timeout
        https://bugs.webkit.org/show_bug.cgi?id=161205

        Reviewed by Geoffrey Garen.

        Fixes several issues:
        - Add missing isReachableFromOpaqueRoots() implementation for JSWebGLRenderingContextBase.
          It used to rely on the one from its JSCanvasRenderingContext base. However, that base
          was dropped in r204839.
        - Update JSWebGLRenderingContextBase::visitAdditionalChildren() to add its canvas
          object as opaque root as well. This used to be taken care of by
          JSCanvasRenderingContext::visitAdditionalChildren() but it got dropped in r204839.

        This also refactors the code a bit for clarity.

        No new tests, unskipped existing test.

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSCanvasRenderingContext.h: Removed.
        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::JSDocument::getCSSCanvasContext):
        * bindings/js/JSHTMLCanvasElementCustom.cpp:
        (WebCore::JSHTMLCanvasElement::getContext):
        * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
        (WebCore::toJSNewlyCreated):
        (WebCore::toJS):
        (WebCore::JSWebGLRenderingContextBaseOwner::isReachableFromOpaqueRoots):
        (WebCore::JSWebGLRenderingContextBase::visitAdditionalChildren):
        * html/canvas/CanvasRenderingContext.h:
        (WebCore::CanvasRenderingContext::is3d):
        * html/canvas/WebGLRenderingContextBase.h:
        * html/canvas/WebGLRenderingContextBase.idl:

2016-09-02  Chris Dumez  <cdumez@apple.com>

        Object.preventExtensions() should throw cross-origin
        https://bugs.webkit.org/show_bug.cgi?id=161486

        Reviewed by Geoffrey Garen.

        Object.preventExtensions() should throw cross-origin:
        - https://html.spec.whatwg.org/#windowproxy-preventextensions
        - https://html.spec.whatwg.org/#location-preventextensions
        - http://www.ecma-international.org/ecma-262/6.0/#sec-object.preventextensions

        Firefox and Chrome both throw in the cross-origin case. Firefox also throws
        a TypeError in the same-origin case for Window, as per the specification.
        However, Firefox does not seem to throw yet in the same-origin case for
        Location yet.

        Test: http/tests/security/preventExtensions-window-location.html

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::preventExtensions):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::preventExtensions):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        * bindings/scripts/IDLAttributes.txt:
        * page/DOMWindow.idl:
        * page/Location.idl:

2016-09-02  Chris Dumez  <cdumez@apple.com>

        Object.defineProperty() should throw cross-origin
        https://bugs.webkit.org/show_bug.cgi?id=161460

        Reviewed by Geoffrey Garen.

        Object.defineProperty() should throw cross-origin to match Firefox and
        Chrome.

        The specification is in the process of being updated to match the
        behavior of browsers.

        Test: http/tests/security/window-defineProperty-crossOrigin.html

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::defineOwnProperty):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::defineOwnProperty):

2016-09-02  Brady Eidson  <beidson@apple.com>

        Weak link the GameController.framework on macOS but differently than before.

        Reviewed by Dan Bernstein.
        
        * Configurations/WebCore.xcconfig:

2016-09-02  Chris Dumez  <cdumez@apple.com>

        Align proto getter / setter behavior with other browsers
        https://bugs.webkit.org/show_bug.cgi?id=161455

        Reviewed by Mark Lam.

        Align cross-origin __proto__ getter / setter behavior with other
        browsers and the specification:

        [[SetPrototypeOf]] should throw a TypeError:
        - https://html.spec.whatwg.org/#windowproxy-setprototypeof
        - https://html.spec.whatwg.org/#location-setprototypeof
        - https://tc39.github.io/ecma262/#sec-object.setprototypeof (step 5)

        [[GetPrototypeOf]] should return null cross-origin:
        - https://html.spec.whatwg.org/#windowproxy-getprototypeof
        - https://html.spec.whatwg.org/#location-getprototypeof

        Test: js/dom/setPrototypeOf-location-window.html

        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::JSDOMWindowBase): Deleted.
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::setPrototype):
        (WebCore::JSDOMWindow::getPrototype):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::setPrototype):
        (WebCore::JSLocation::getPrototype):
        * bindings/js/JSWorkerGlobalScopeBase.cpp:
        (WebCore::JSWorkerGlobalScopeBase::supportsRichSourceInfo): Deleted.
        * bindings/js/JSWorkerGlobalScopeBase.h:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        * bindings/scripts/IDLAttributes.txt:
        * page/DOMWindow.idl:
        * page/Location.idl:

2016-09-02  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] applyConstraints pt. 1 - mandatory constraints
        https://bugs.webkit.org/show_bug.cgi?id=161469
        <rdar://problem/28109325>

        Reviewed by Jer Noble.

        Tests: fast/mediastream/apply-constraints-audio.html
               fast/mediastream/apply-constraints-video.html

        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::MediaStreamTrack): Initialize the weak pointer factory.
        (WebCore::MediaStreamTrack::applyConstraints): Make it work.
        * Modules/mediastream/MediaStreamTrack.h:
        * Modules/mediastream/MediaStreamTrack.idl:

        * WebCore.xcodeproj/project.pbxproj: Add JSMediaDevicesCustom.h.

        * bindings/js/JSMediaDevicesCustom.cpp:
        (WebCore::createStringConstraint): Add name parameter.
        (WebCore::createBooleanConstraint): Ditto.
        (WebCore::createDoubleConstraint): Ditto.
        (WebCore::createIntConstraint): Ditto.
        (WebCore::parseMediaTrackConstraintSetForKey): Drop type parameter because we don't need to
          filter by source media type.
        (WebCore::parseAdvancedConstraints): Ditto.
        (WebCore::parseMediaConstraintsDictionary): Renamed from parseConstraints.
        (WebCore::JSMediaDevices::getUserMedia): Don't throw exceptions, always return a promise.
        (WebCore::parseConstraints): Deleted.
        * bindings/js/JSMediaDevicesCustom.h: Added.

        * bindings/js/JSMediaStreamTrackCustom.cpp:
        (WebCore::JSMediaStreamTrack::getSettings): Don't include aspect ratio if the value is 0.
        (WebCore::capabilityValue): asULong -> asInt.
        (WebCore::JSMediaStreamTrack::applyConstraints): New.
        (WebCore::JSMediaStreamTrack::getConstraints): New.

        * bindings/js/WebCoreBuiltinNames.h: Add "mediaStreamTrackConstraints".

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::setSrcObject): Drive by fix: don't call DOMURL::createPublicURL(null).

        * platform/mediastream/MediaConstraints.cpp:
        (WebCore::MediaConstraint::create): Pass name to constructors.
        (WebCore::StringConstraint::find): New.
        * platform/mediastream/MediaConstraints.h:

        * platform/mediastream/MediaStreamTrackPrivate.cpp:
        (WebCore::MediaStreamTrackPrivate::applyConstraints): Add callback parameters.
        * platform/mediastream/MediaStreamTrackPrivate.h:

        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::RealtimeMediaSource): Initialize weak pointer factory.
        (WebCore::RealtimeMediaSource::settingsDidChange): Don't call observers immediately so we can
         coalesce multiple changes in the same runloop cycle.
        (WebCore::RealtimeMediaSource::supportsConstraint): New.
        (WebCore::value): Return the most appropriate value from a numeric constraint.
        (WebCore::RealtimeMediaSource::applyConstraint): New, apply one constraint.
        (WebCore::RealtimeMediaSource::applyConstraints): New, validate and apply constraints.
        (WebCore::RealtimeMediaSource::setWidth): New.
        (WebCore::RealtimeMediaSource::setHeight): New.
        (WebCore::RealtimeMediaSource::setFrameRate): New.
        (WebCore::RealtimeMediaSource::setAspectRatio): New.
        (WebCore::RealtimeMediaSource::setFacingMode): New.
        (WebCore::RealtimeMediaSource::setVolume): New.
        (WebCore::RealtimeMediaSource::setSampleRate): New.
        (WebCore::RealtimeMediaSource::setSampleSize): New.
        (WebCore::RealtimeMediaSource::setEchoCancellation) New.:
        (WebCore::RealtimeMediaSource::scheduleDeferredTask): New.
        * platform/mediastream/RealtimeMediaSource.h:

        * platform/mediastream/RealtimeMediaSourceCapabilities.h:
        (WebCore::CapabilityValueOrRange::CapabilityValueOrRange): "unsigned long" -> "int"

        * platform/mediastream/RealtimeMediaSourceSettings.cpp:
        (WebCore::userFacing): New.
        (WebCore::environmentFacing): New.
        (WebCore::leftFacing): New.
        (WebCore::rightFacing): New.
        (WebCore::RealtimeMediaSourceSettings::facingMode):
        (WebCore::RealtimeMediaSourceSettings::videoFacingModeEnum):
        * platform/mediastream/RealtimeMediaSourceSettings.h:

        * platform/mediastream/mac/AVAudioCaptureSource.mm:
        (WebCore::AVAudioCaptureSource::initializeCapabilities): Volume range is 0.0 .. 1.0.

        * platform/mediastream/mac/AVMediaCaptureSource.h:
        (WebCore::AVMediaCaptureSource::createWeakPtr): Deleted.
        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Don't need the weak ptr factory, it is
          in the base class.
        (WebCore::AVMediaCaptureSource::scheduleDeferredTask): Deleted.

        * platform/mediastream/mac/AVVideoCaptureSource.h:
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::applySize): New.
        (WebCore::AVVideoCaptureSource::applyFrameRate): New.
        (WebCore::AVVideoCaptureSource::setupCaptureSession):
        (WebCore::AVVideoCaptureSource::setFrameRateConstraint): Deleted.
        (WebCore::AVVideoCaptureSource::applyConstraints): Deleted.

        * platform/mock/MockRealtimeAudioSource.cpp:
        (WebCore::MockRealtimeAudioSource::updateSettings): Set volume and echoCancellation to the
          current values.
        (WebCore::MockRealtimeAudioSource::initializeCapabilities): Volume takes a float, not an int.
        * platform/mock/MockRealtimeAudioSource.h:

        * platform/mock/MockRealtimeMediaSource.cpp: Minor cleanup.
        * platform/mock/MockRealtimeMediaSource.h:

        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Initialize frame rate.
        (WebCore::MockRealtimeVideoSource::startProducingData): m_size -> size().
        (WebCore::MockRealtimeVideoSource::updateSettings): Use accessors because instance variables
          have been moved to the base class.
        (WebCore::MockRealtimeVideoSource::initializeCapabilities): Ditto.
        (WebCore::MockRealtimeVideoSource::applyFrameRate): New.
        (WebCore::MockRealtimeVideoSource::applySize):
        (WebCore::MockRealtimeVideoSource::drawAnimation):
        (WebCore::MockRealtimeVideoSource::drawBoxes):
        (WebCore::MockRealtimeVideoSource::drawText):
        (WebCore::MockRealtimeVideoSource::generateFrame):
        (WebCore::MockRealtimeVideoSource::imageBuffer):
        (WebCore::MockRealtimeVideoSource::setFrameRate): Deleted.
        (WebCore::MockRealtimeVideoSource::setSize): Deleted.
        * platform/mock/MockRealtimeVideoSource.h:
        (WebCore::MockRealtimeVideoSource::size): Deleted.

2016-09-02  Brady Eidson  <beidson@apple.com>

        Weak link the GameController.framework on macOS.

        Reviewed by Tim Horton.
        
        * Configurations/WebCore.xcconfig:

2016-09-02  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r205344.
        https://bugs.webkit.org/show_bug.cgi?id=161533

        Hitting assertions under CachedResource::removeClient in a few
        tests (Requested by anttik on #webkit).

        Reverted changeset:

        "Reverse ownership relation of StyleCachedImage and
        CSSImageValue"
        https://bugs.webkit.org/show_bug.cgi?id=161447
        http://trac.webkit.org/changeset/205344

2016-09-02  Antti Koivisto  <antti@apple.com>

        Reverse ownership relation of StyleCachedImage and CSSImageValue
        https://bugs.webkit.org/show_bug.cgi?id=161447

        Reviewed by Andreas Kling.

        Currently StyleCachedImage (which represents an image in RenderStyle) has a weak ref to the
        underlying CSSImageValue/CSSImageSetValue which actually owns it. This is awkwards especially since
        StyleGeneratedImage, the other StyleImage subclass has reversed relationship where it refs
        the underlying CSSImageGeneratorValue.

        This patch makes StyleCachedImage similar to StyleGeneratedImage. StyleCachedImage now refs the
        underlying CSSImageValue/CSSImageSetValue. CSSImageValues no longer need to know about StyleCachedImage.
        Instead they reference CachedImages (memory cache objects) directly. StyleCachedImage instances are now
        conceptually unique to RenderStyle instances. Actual resources are shared as before by sharing CachedImages.

        * css/CSSCursorImageValue.cpp:
        (WebCore::CSSCursorImageValue::loadImage):
        (WebCore::CSSCursorImageValue::cachedImage):
        (WebCore::CSSCursorImageValue::styleImage): Deleted.
        * css/CSSCursorImageValue.h:
        * css/CSSImageGeneratorValue.cpp:
        (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
        * css/CSSImageSetValue.cpp:
        (WebCore::CSSImageSetValue::~CSSImageSetValue):
        (WebCore::CSSImageSetValue::loadBestFitImage):
        (WebCore::CSSImageSetValue::traverseSubresources):
        (WebCore::CSSImageSetValue::styleImage): Deleted.
        * css/CSSImageSetValue.h:
        * css/CSSImageValue.cpp:
        (WebCore::CSSImageValue::CSSImageValue):
        (WebCore::CSSImageValue::~CSSImageValue):
        (WebCore::CSSImageValue::isPending):
        (WebCore::CSSImageValue::loadImage):
        (WebCore::CSSImageValue::traverseSubresources):
        (WebCore::CSSImageValue::knownToBeOpaque):
        (WebCore::CSSImageValue::styleImage): Deleted.
        * css/CSSImageValue.h:
        * css/StyleBuilderCustom.h:
        (WebCore::StyleBuilderCustom::applyValueContent):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::styleImage):
        (WebCore::StyleResolver::styleCachedImageFromValue):
        (WebCore::StyleResolver::styleGeneratedImageFromValue):
        (WebCore::StyleResolver::cachedOrPendingFromValue): Deleted.
        (WebCore::StyleResolver::generatedOrPendingFromValue): Deleted.
        (WebCore::StyleResolver::setOrPendingFromValue): Deleted.
        (WebCore::StyleResolver::cursorOrPendingFromValue): Deleted.
        * css/StyleResolver.h:
        * editing/TextIterator.cpp:
        (WebCore::fullyClipsContents):
        * page/PageSerializer.cpp:
        (WebCore::PageSerializer::retrieveResourcesForProperties):
        * rendering/style/FillLayer.cpp:
        (WebCore::FillLayer::imagesIdentical):

            Compare data equality instead of pointer equality for StyleImages (since StyleImages are no longer shared).

        (WebCore::layerImagesIdentical): Deleted.
        * rendering/style/StyleCachedImage.cpp:
        (WebCore::StyleCachedImage::StyleCachedImage):
        (WebCore::StyleCachedImage::~StyleCachedImage):
        (WebCore::StyleCachedImage::cachedImage):
        (WebCore::StyleCachedImage::cssValue):
        (WebCore::StyleCachedImage::canRender):
        (WebCore::StyleCachedImage::isPending):
        (WebCore::StyleCachedImage::isLoaded):
        (WebCore::StyleCachedImage::errorOccurred):
        (WebCore::StyleCachedImage::imageSize):
        (WebCore::StyleCachedImage::imageHasRelativeWidth):
        (WebCore::StyleCachedImage::imageHasRelativeHeight):
        (WebCore::StyleCachedImage::computeIntrinsicDimensions):
        (WebCore::StyleCachedImage::usesImageContainerSize):
        (WebCore::StyleCachedImage::setContainerSizeForRenderer):
        (WebCore::StyleCachedImage::addClient):
        (WebCore::StyleCachedImage::removeClient):
        (WebCore::StyleCachedImage::image):
        (WebCore::StyleCachedImage::knownToBeOpaque):
        (WebCore::StyleCachedImage::setCachedImage): Deleted.
        * rendering/style/StyleCachedImage.h:

2016-09-01  Ryosuke Niwa  <rniwa@webkit.org>

        Only update connected custom elements
        https://bugs.webkit.org/show_bug.cgi?id=161480

        Reviewed by Yusuke Suzuki.

        In the latest specs, creating an element only upgrades an element if the custom element had already been defined:
        https://dom.spec.whatwg.org/#concept-create-element

        Otherwise, an element remains unresolved until it gets connected to the document associated with the global object:
        https://dom.spec.whatwg.org/#concept-node-insert

        This patch removes the upgrade candidate map in CustomElementRegistry, and traverses the entire document associated
        with global object (DOMWindow) in addElementDefinition: https://html.spec.whatwg.org/#dom-customelementregistry-define

        The traversal is done in the shadow-including tree order (different from depth-first preorder traversal of flat tree)
        since it doesn't enter slots and children of shadow hosts are always visited even if they are not assigned to a slot:
        https://dom.spec.whatwg.org/#concept-shadow-including-tree-order

        Test: fast/custom-elements/enqueue-custom-element-upgrade-reaction.html

        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::upgradeElement): Assert that the element being upgraded as the same qualified name
        as the custom element interface.
        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::JSCustomElementRegistry::define): Moved the code to resolve the promise from here to addElementDefinition.
        Also cleaned up the code to extract callbacks a little.
        * dom/CustomElementReactionQueue.cpp:
        (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): Added an assertion.
        (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Added. Upgrade an element if the custom element
        had already been defined.
        * dom/CustomElementReactionQueue.h:
        * dom/CustomElementRegistry.cpp:
        (WebCore::CustomElementRegistry::create): Stores the reference to DOMWindow to find its document in addElementDefinition.
        (WebCore::CustomElementRegistry::CustomElementRegistry): Ditto.
        (WebCore::enqueueUpgradeInShadowIncludingTreeOrder): Added. Enqueue upgrade reactions in shadow-including tree order.
        (WebCore::CustomElementRegistry::addElementDefinition): Upgrade all unresolved elements that matches this definition and
        resolve the the promise returned by "whenDefined" if there is any.
        (WebCore::CustomElementRegistry::addUpgradeCandidate): Deleted.
        (WebCore::CustomElementRegistry::findInterface): Added a new variant that takes an element.
        * dom/CustomElementRegistry.h:
        * dom/Document.cpp:
        (WebCore::createUpgradeCandidateElement): No longer takes DOMWindow since we don't upgrade synchronously here. It's also
        wrong not to mark the element as unresolved custom element in a document without a browsing context per new semantics.
        (WebCore::createHTMLElementWithNameValidation): Ditto.
        (WebCore::createFallbackHTMLElement): Ditto.
        * dom/Element.cpp:
        (WebCore::Element::insertedInto): Enqueue an upgrade reaction if this is an unsolved custom element and there is now
        a definition for it (the latter condition is checked in enqueueElementUpgradeIfDefined).
        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): Don't upgrade this element until it gets
        connected to a document in Element::insertedInto.
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::ensureCustomElementRegistry):

2016-09-01  Yusuke Suzuki  <utatane.tea@gmail.com>

        Add toJS for JSC::PrivateName
        https://bugs.webkit.org/show_bug.cgi?id=161522

        Reviewed by Ryosuke Niwa.

        JSC::PrivateName is the wrapper to create and hold the ES6 Symbol instance.
        This patch adds toJS support for JSC::PrivateName.
        Later, the module integration patch will use this feature to call
        DeferredWrapper::{resolve,reject} with JSC::PrivateName.

        * bindings/js/JSDOMBinding.h:
        (WebCore::toJS):

2016-09-01  Dan Bernstein  <mitz@apple.com>

        Build fix.

        * Configurations/FeatureDefines.xcconfig:
        * Configurations/WebCore.xcconfig:
        * WebCore.xcodeproj/project.pbxproj:

2016-09-01  Ricky Mondello  <rmondello@apple.com>

        YouTube Flash plug-in replacement facility should not insert showinfo=0 into iframe URLs
        https://bugs.webkit.org/show_bug.cgi?id=161478
        <rdar://problem/28050847>

        Reviewed by Eric Carlson.

        * Modules/plugins/YouTubePluginReplacement.cpp:
        (WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL): Stop adding the query parameter.

2016-09-01  Mark Lam  <mark.lam@apple.com>

        Move some JSObject and JSArray inline functions to their respective Inlines.h files.
        https://bugs.webkit.org/show_bug.cgi?id=161499

        Reviewed by Saam Barati.

        No new tests because there is no behavior change.

        * ForwardingHeaders/runtime/JSObjectInlines.h: Added.
        * bindings/js/JSDOMBinding.h:
        * bindings/js/JSSQLTransactionCustom.cpp:
        * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
        * contentextensions/ContentExtensionParser.cpp:

2016-09-01  Michael Catanzaro  <mcatanzaro@igalia.com>

        Fix ENABLE(CSS_GRID_LAYOUT) guards harder after r205102/r205292

        Unreviewed. Silence unused function warning.

        * css/CSSComputedStyleDeclaration.cpp:

2016-09-01  Alex Christensen  <achristensen@webkit.org>

        Avoid unneeded string copy when parsing URL hosts
        https://bugs.webkit.org/show_bug.cgi?id=161511

        Reviewed by Tim Horton.

        No change in behavior.  Covered by existing API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        (WebCore::URLParser::parseAuthority):
        (WebCore::URLParser::parseHost):
        (WebCore::URLParser::authorityEndReached): Deleted.
        (WebCore::URLParser::hostEndReached): Deleted.
        * platform/URLParser.h:

2016-09-01  Ryosuke Niwa  <rniwa@webkit.org>

        Add "whenDefined" to CustomElementRegistry
        https://bugs.webkit.org/show_bug.cgi?id=161425

        Reviewed by Yusuke Suzuki.

        Add the support for "whenDefined" method on CustomElementRegistry: 
        https://html.spec.whatwg.org/#dom-customelementregistry-whendefined

        Because it needs to store the newly created promise when the queried custom element has not been defined yet,
        we need to write custom binding code instead of relying on the binding generator.

        Tests: fast/custom-elements/CustomElementRegistry.html

        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::validateCustomElementNameAndThrowIfNeeded): Extracted out of JSCustomElementRegistry::define.
        (WebCore::JSCustomElementRegistry::define): Fulfill the "whenDefined" promise when the definition succeeds.
        (WebCore::whenDefinedPromise): Added. Return an existing promise if there is one, or create a new promise.
        We cache the created promise only if the custom element had not been defined yet since we'll indefinitely
        retain the resolved promise otherwise.
        (WebCore::JSCustomElementRegistry::whenDefined): Added. Calls whenDefinedPromise and returns a rejected
        promise when there was an exception.
        * dom/CustomElementRegistry.cpp:
        * dom/CustomElementRegistry.h:
        (WebCore::CustomElementRegistry::promiseMap): Added.
        * dom/CustomElementRegistry.idl:

2016-09-01  Alex Christensen  <achristensen@webkit.org>

        URLParser should handle . and .. in URL paths
        https://bugs.webkit.org/show_bug.cgi?id=161443

        Reviewed by Brady Eidson.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::isSingleDotPathSegment):
        (WebCore::isDoubleDotPathSegment):
        (WebCore::consumeSingleDotPathSegment):
        (WebCore::consumeDoubleDotPathSegment):
        (WebCore::URLParser::parse):
        (WebCore::URLParser::copyURLPartsUntil): Deleted.

2016-09-01  Alex Christensen  <achristensen@webkit.org>

        Fix Mac CMake build.

        * PlatformMac.cmake:

2016-09-01  Ricky Mondello  <rmondello@apple.com>

        YouTube Flash plug-in replacement facility should more gracefully handle malformed queries
        https://bugs.webkit.org/show_bug.cgi?id=161476
        <rdar://problem/28050847>

        Reviewed by Eric Carlson.

        Some YouTube Flash embeds use '&' instead of '?' to start the query portion of the URL. Before this patch,
        our implementation discards all parts of the path after the '&', which could drop important query information
        like the start time for the video. This patch treats anything after that '&' as a "malformed query" and uses
        it as the query to restore to the transformed URL if there was no actual query in the original URL.

        * Modules/plugins/YouTubePluginReplacement.cpp:
        (WebCore::processAndCreateYouTubeURL): Add an out-parameter for the path after the first ampersand.
        (WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL): If the input URL had no query, append
            the possibly malformed one found after the first ampersand to the replacement URL.

2016-09-01  Alex Christensen  <achristensen@webkit.org>

        Fix Mac CMake build after r205266.

        * PlatformMac.cmake:
        * platform/cocoa/URLParserCocoa.mm: Removed.

2016-09-01  Javier Fernandez  <jfernandez@igalia.com>

        Unreviewed build fix after r205102.

        The change made in r205102 caused compilation failures on
        builds with the CSS_GRID_LAYOUT compilation flag disabled.

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::propertyValue):
        (WebCore::resolveJustifySelfAuto): Deleted.
        * css/CSSPropertyNames.in:
        * css/parser/CSSParser.cpp:
        (WebCore::isKeywordPropertyID):
        (WebCore::CSSParser::parseValue):

2016-09-01  Fujii Hironori  <Hironori.Fujii@sony.com>

        Fix the Mac cmake clean build issue
        https://bugs.webkit.org/show_bug.cgi?id=157261

        Reviewed by Michael Catanzaro.

        Building WebCoreDerivedSources target failed due to the race
        condition with building ForwardingHeaders of JavaScriptCore.

        * CMakeLists.txt: Make WebCoreDerivedSources depends on JavaScriptCore.

2016-09-01  Andreas Kling  <akling@apple.com>

        FocusController should pass KeyboardEvent around by reference.
        <https://webkit.org/b/161461>

        Reviewed by Sam Weinig.

        Clean up FocusController to pass KeyboardEvent& around internally.

        Also make FocusController::setInitialFocus() synthesize a dummy KeyboardEvent
        if one isn't provided, just like nextFocusableElement()/previousFocusableElement() does.
        This way we can feel confident about dereferencing the formerly KeyboardEvent* everywhere.

        * page/EventHandler.cpp:
        (WebCore::EventHandler::defaultArrowEventHandler):
        (WebCore::EventHandler::defaultTabEventHandler):
        * page/FocusController.cpp:
        (WebCore::isFocusableElementOrScopeOwner):
        (WebCore::isNonFocusableScopeOwner):
        (WebCore::isFocusableScopeOwner):
        (WebCore::shadowAdjustedTabIndex):
        (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
        (WebCore::FocusController::setInitialFocus):
        (WebCore::FocusController::advanceFocus):
        (WebCore::FocusController::advanceFocusInDocumentOrder):
        (WebCore::FocusController::findFocusableElementAcrossFocusScope):
        (WebCore::FocusController::findFocusableElementWithinScope):
        (WebCore::FocusController::nextFocusableElementWithinScope):
        (WebCore::FocusController::previousFocusableElementWithinScope):
        (WebCore::FocusController::findFocusableElementOrScopeOwner):
        (WebCore::FocusController::findElementWithExactTabIndex):
        (WebCore::nextElementWithGreaterTabIndex):
        (WebCore::previousElementWithLowerTabIndex):
        (WebCore::FocusController::nextFocusableElement):
        (WebCore::FocusController::previousFocusableElement):
        (WebCore::FocusController::nextFocusableElementOrScopeOwner):
        (WebCore::FocusController::previousFocusableElementOrScopeOwner):
        (WebCore::FocusController::findFocusCandidateInContainer):
        (WebCore::FocusController::advanceFocusDirectionallyInContainer):
        (WebCore::FocusController::advanceFocusDirectionally):
        * page/FocusController.h:

2016-09-01  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Streams API] Align internal structure of ReadableStream with spec
        https://bugs.webkit.org/show_bug.cgi?id=160299

        Reviewed by Xabier Rodriguez-Calvar.

        Aligned internal structure of ReadableStream with spec. Various
        internal properties have been moved to ReadableStreamDefaultController.
        In addition, various behaviors had to be updated. Several other changes
        will have to be performed in order to align with spec, e.g. changing
        functions names. This patch does not change them in order to make the
        structural changes easier to follow.

        No change in functionality except support for 1 specific case where
        an error was not thrown while it should have been. Changed corresponding
        test expectation (now PASS instead of FAIL).
        Modified test expectation: web-platform-tests/streams/readable-streams/general.https-expected.txt

        * Modules/fetch/FetchResponse.js:
        (initializeFetchResponse): Replaced reference to underlyingSource as no
        more a property of readableStream (use readableStreamController instead,
        as defined by spec).
        * Modules/streams/ReadableStream.js:
        (initializeReadableStream): Removed various properties now hanlded by
        ReadableStreamDefaultController.
        * Modules/streams/ReadableStreamDefaultController.js:
        (enqueue): Updated based on new properties repartition between reader and controller. 
        (error): Updated based on new properties repartition between reader and controller. 
        (close): Updated based on new properties repartition between reader and controller. 
        (desiredSize): Updated based on new properties repartition between reader and controller. 
        * Modules/streams/ReadableStreamInternals.js:
        (privateInitializeReadableStreamDefaultController): Added various properties now handled by
        ReadableStreamDefaultController, as well as an internal pull function defined by spec.
        (readableStreamDefaultControllerError): Added based on spec (error handling at controller level).
        (teeReadableStream): Fixed typo and use readableStreamDefaultControllerError instead of errorReadableStream.
        (doStructuredClone): Added "use strict";.
        (teeReadableStreamPullFunction): Use readableStreamDefaultControllerClose instead of closeReadableStream.
        (isReadableStream): Replaced check of underlyingSource by check that object is actually an instance of
        ReadableStream (spec requires checking that readableStreamController slot is present, but this cannot
        be checked).
        (isReadableStreamDefaultReader): Replaced check of ownerReadableStream presence by check of readRequests,
        in line with spec.
        (isReadableStreamDefaultController): Replaced check of controlledReadableStream presence by check of unerlyingSource,
        in line with spec.
        (errorReadableStream): Updated based on new properties repartition between reader and controller.
        (requestReadableStreamPull): Updated based on new properties repartition between reader and controller.
        (readableStreamDefaultControllerGetDesiredSize): Replaces getReadableStreamDesiredSize (size now depends
        on controller; new function name aligned with spec).
        (cancelReadableStream): Updated based on new properties repartition between reader and controller. 
        (readableStreamDefaultControllerClose): Added based on spec (closing controller).
        (closeReadableStream): Updated based on new properties repartition between reader and controller. 
        (enqueueInReadableStream): Updated based on new properties repartition between reader and controller. 
        (readFromReadableStreamDefaultReader): Updated based on new properties repartition between reader and controller. 
        * bindings/js/WebCoreBuiltinNames.h: Added pull (internal function of ReadableStreamDefaultController)
        and readableStreamController (defined by spec)

2016-09-01  Csaba Osztrogonác  <ossy@webkit.org>

        Unreviewed, fix the !ENABLE(SVG_FONTS) and !ENABLE(XSLT) build after r205269.

        * loader/LinkLoader.cpp:
        (WebCore::createLinkPreloadResourceClient):

2016-09-01  Csaba Osztrogonác  <ossy@webkit.org>

        URTBF after r205161 to fix !ENABLE(WEB_TIMING) build.

        * bindings/js/JSPerformanceTimingCustom.cpp:

2016-09-01  Myles C. Maxfield  <mmaxfield@apple.com>

        Clean up TextRun-related code
        https://bugs.webkit.org/show_bug.cgi?id=161473

        Reviewed by Simon Fraser.

        Some assorted cleanup, including:
        - Renaming "AllowTrailingExpansion | ForbidLeadingExpansion" to "DefaultExpansion"
        - Migrating from pointers to references
        - Migrating from ints to unsigneds
        - Using proper character names from CharacterNames.h
        - Simplifying CoreTextSPI.h

        No new tests because there is no behavior change.

        * platform/graphics/TextRun.h:
        (WebCore::TextRun::TextRun):
        * platform/graphics/mac/ComplexTextController.cpp:
        (WebCore::TextLayout::isNeeded):
        (WebCore::TextLayout::constructTextRun):
        * platform/spi/cocoa/CoreTextSPI.h:
        * platform/text/TextFlags.h:
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::constructTextRun):
        * rendering/RenderBlock.h:
        * rendering/RenderListMarker.cpp:
        (WebCore::RenderListMarker::computePreferredLogicalWidths):
        (WebCore::RenderListMarker::getRelativeMarkerRect):
        * rendering/RenderMenuList.cpp:
        (RenderMenuList::updateOptionsWidth):
        * rendering/RenderText.cpp:
        (WebCore::RenderText::widthFromCache):
        (WebCore::RenderText::trimmedPrefWidths):
        (WebCore::hyphenWidth):
        (WebCore::maxWordFragmentWidth):
        (WebCore::RenderText::computePreferredLogicalWidths):
        (WebCore::RenderText::width):
        * rendering/RenderText.h:
        * rendering/RenderThemeIOS.mm:
        * rendering/line/BreakingContext.h:
        (WebCore::textWidth):
        (WebCore::tryHyphenating):
        * rendering/svg/SVGInlineTextBox.cpp:
        (WebCore::SVGInlineTextBox::offsetForPositionInFragment):
        (WebCore::SVGInlineTextBox::selectionRectForTextFragment):
        (WebCore::SVGInlineTextBox::localSelectionRect):
        (WebCore::SVGInlineTextBox::paintSelectionBackground):
        (WebCore::SVGInlineTextBox::paint):
        (WebCore::SVGInlineTextBox::acquirePaintingResource):
        (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
        (WebCore::SVGInlineTextBox::constructTextRun):
        (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
        (WebCore::SVGInlineTextBox::paintTextWithShadows):
        (WebCore::SVGInlineTextBox::paintText):
        * rendering/svg/SVGInlineTextBox.h:

2016-08-31  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Move GObject DOM bindings to WebKit2 layer and stop auto generating them
        https://bugs.webkit.org/show_bug.cgi?id=161438

        Reviewed by Michael Catanzaro.

        Remove the scripts to generate GObject DOM bindings and the tests. Also remove all GObject ifdefs from the idl files.

        * PlatformGTK.cmake:
        * bindings/gobject: Removed.
        * bindings/scripts/CodeGeneratorGObject.pm: Removed.
        * bindings/scripts/test/GObject: Removed.
        * css/CSSStyleSheet.idl:
        * css/RGBColor.idl:
        * dom/DOMCoreException.idl:
        * dom/DOMImplementation.idl:
        * dom/Document.idl:
        * dom/DocumentType.idl:
        * dom/Element.idl:
        * dom/Event.idl:
        * dom/EventTarget.idl:
        * dom/KeyboardEvent.idl:
        * dom/MessageEvent.idl:
        * dom/MessagePort.idl:
        * dom/MouseEvent.idl:
        * dom/NamedNodeMap.idl:
        * dom/Node.idl:
        * dom/Range.idl:
        * dom/Slotable.idl:
        * dom/WheelEvent.idl:
        * fileapi/FileException.idl:
        * html/HTMLAppletElement.idl:
        * html/HTMLCanvasElement.idl:
        * html/HTMLCollection.idl:
        * html/HTMLDocument.idl:
        * html/HTMLElement.idl:
        * html/HTMLEmbedElement.idl:
        * html/HTMLFieldSetElement.idl:
        * html/HTMLFormElement.idl:
        * html/HTMLIFrameElement.idl:
        * html/HTMLInputElement.idl:
        * html/HTMLMediaElement.idl:
        * html/HTMLOptionElement.idl:
        * html/HTMLOptionsCollection.idl:
        * html/HTMLSelectElement.idl:
        * html/HTMLTableCellElement.idl:
        * html/HTMLTableColElement.idl:
        * html/HTMLTextAreaElement.idl:
        * html/HTMLVideoElement.idl:
        * html/ImageData.idl:
        * html/URLUtils.idl:
        * html/track/TextTrack.idl:
        * page/DOMSelection.idl:
        * page/DOMWindow.idl:
        * svg/SVGDocument.idl:
        * svg/SVGElement.idl:
        * svg/SVGException.idl:
        * workers/DedicatedWorkerGlobalScope.idl:
        * workers/Worker.idl:
        * workers/WorkerGlobalScope.idl:
        * xml/XPathException.idl:

2016-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Add initiator parameter to module pipeline
        https://bugs.webkit.org/show_bug.cgi?id=161470

        Reviewed by Saam Barati.

        No user-observable behavior change.

        We rename JSModuleLoader to ScriptModuleLoader.
        The name "JSModuleLoader" is misleading since it seems like this is a JS object.
        "ModuleLoader" is not good since there is CSS modules.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::moduleLoaderResolve):
        (WebCore::JSDOMWindowBase::moduleLoaderFetch):
        (WebCore::JSDOMWindowBase::moduleLoaderEvaluate):
        * bindings/js/JSDOMWindowBase.h:
        * bindings/js/JSMainThreadExecState.h:
        (WebCore::JSMainThreadExecState::loadModule):
        (WebCore::JSMainThreadExecState::linkAndEvaluateModule):
        * bindings/js/JSModuleLoader.cpp:
        (WebCore::JSModuleLoader::JSModuleLoader): Deleted.
        (WebCore::JSModuleLoader::resolve): Deleted.
        (WebCore::JSModuleLoader::fetch): Deleted.
        (WebCore::JSModuleLoader::evaluate): Deleted.
        * bindings/js/JSModuleLoader.h:
        (WebCore::JSModuleLoader::document): Deleted.
        * bindings/js/ScriptModuleLoader.cpp: Renamed from Source/WebCore/bindings/js/JSModuleLoader.cpp.
        (WebCore::ScriptModuleLoader::ScriptModuleLoader):
        (WebCore::ScriptModuleLoader::resolve):
        (WebCore::ScriptModuleLoader::fetch):
        (WebCore::ScriptModuleLoader::evaluate):
        * bindings/js/ScriptModuleLoader.h: Renamed from Source/WebCore/bindings/js/JSModuleLoader.h.
        (WebCore::ScriptModuleLoader::document):
        * dom/Document.cpp:
        (WebCore::Document::Document):
        * dom/Document.h:
        (WebCore::Document::moduleLoader):

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

        ASSERTION FAILED: !flow->layer() && !flow->isInlineElementContinuation() in WebCore::RenderBlock::addContinuationWithOutline
        https://bugs.webkit.org/show_bug.cgi?id=151022
        <rdar://problem/27710993>

        Reviewed by Simon Fraser.

        Certain CSS properties like opacity, mask etc (graphical group members) require the layer to be a non-normal flow,
        self painting layer so that we can manage painting properly. However in addition to those CSS properties, some of the will-change
        values (again, graphical group members) also require the layer to be non-normal flow, self painting.
        This patch ensures that when deciding whether a layer should be a normal flow layer, we take the will-change values into account as well.

        Tests: compositing/layer-creation/assert-on-inline-element-with-will-change.html
               compositing/layer-creation/will-change-on-normal-flow-content.html

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::calculateClipRects):
        * rendering/style/WillChangeData.cpp:
        (WebCore::propertyCreatesGraphicalGroup):
        (WebCore::WillChangeData::addFeature):
        * rendering/style/WillChangeData.h:
        (WebCore::WillChangeData::canCreateGraphicalGroup):
        (WebCore::WillChangeData::canTriggerCompositingOnInline): Deleted.

2016-08-31  Keith Rollin  <krollin@apple.com>

        WebKit should set a subsystem for os_log so it's easier to filter for WebKit log messages
        https://bugs.webkit.org/show_bug.cgi?id=160969
        <rdar://problem/26068734>

        Reviewed by Simon Fraser.

        - Specify a channel when using RELEASE_LOG macros
        - Add a new channel so that we have something to pass to the
          RELEASE_LOG macros (Layers).
        - Enable subsystem- and channel-related data and functions when using
          RELEASE_LOG macros.
        - Use the DECLARE_LOG_CHANNEL, DEFINE_LOG_CHANNEL, and
          LOG_CHANNEL_ADDRESS macros that are now defined in WTF.

        No new tests. There are no tests for logging.

        * loader/FrameLoader.cpp:
        * platform/LogInitialization.h:
        * platform/LogMacros.h:
        * platform/Logging.cpp:
        * platform/Logging.h:
        * platform/MemoryPressureHandler.cpp:
        (WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::drawNativeImage):
        * platform/graphics/cocoa/IOSurface.mm:
        (WebCore::IOSurface::IOSurface):
        * platform/mac/LoggingMac.mm:
        * platform/unix/LoggingUnix.cpp:
        * platform/win/LoggingWin.cpp:
        * testing/js/WebCoreTestSupport.cpp:
        (WebCoreTestSupport::initializeLogChannelsIfNecessary):

2016-08-31  Ricky Mondello  <rmondello@apple.com>

        Enable the YouTube Flash plug-in replacement behavior on all Cocoa ports
        https://bugs.webkit.org/show_bug.cgi?id=161453
        <rdar://problem/28050847>

        Reviewed by Eric Carlson.

        Now that we have some tests for the URL transformation logic (r205212) and the ability to enable the YouTube
        Flash plug-in replacement behavior independently from the QuickTime plug-in replacement behavior (r205214 and
        r205271), enable the YouTube Flash plug-in replacement behavior for Cocoa ports. We can and will continue to
        improve it.

        * page/Settings.cpp: Enable the feature for PLATFORM(COCOA), rather than just PLATFORM(IOS).

2016-08-31  Alex Christensen  <achristensen@webkit.org>

        Implement IPv6 parsing in URLParser
        https://bugs.webkit.org/show_bug.cgi?id=161390

        Reviewed by Darin Adler.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::zeroSequenceLength):
        (WebCore::findLongestZeroSequence):
        (WebCore::nibbleToHex):
        (WebCore::serializeIPv6Piece):
        (WebCore::serializeIPv6):
        (WebCore::parseIPv6Host):
        (WebCore::URLParser::hostEndReached):

2016-08-31  Ricky Mondello  <rmondello@apple.com>

        Break pluginReplacementEnabled into youTubeFlashPluginReplacementEnabled and quickTimePluginReplacementEnabled
        https://bugs.webkit.org/show_bug.cgi?id=161424
        <rdar://problem/28050847>

        Reviewed by Dean Jackson.

        Replace the single pluginReplacementEnabled setting with individual settings for the YouTube Flash plug-in
        behavior and the QuickTime plug-in behavior. Unless otherwise noted, this change copies the existing plumbing
        for pluginReplacementEnabled and renames it twice. The default values for these settings remain the same.

        * Modules/plugins/PluginReplacement.h:
        (WebCore::ReplacementPlugin::ReplacementPlugin): Augment the constructor.
        (WebCore::ReplacementPlugin::isEnabledBySettings): Added.
        * Modules/plugins/QuickTimePluginReplacement.h: Declare a static member function.
        * Modules/plugins/QuickTimePluginReplacement.mm:
        (WebCore::QuickTimePluginReplacement::registerPluginReplacement): Properly create a ReplacementPlugin instance.
        (WebCore::QuickTimePluginReplacement::isEnabledBySettings): Added.
        * Modules/plugins/YouTubePluginReplacement.cpp:
        (WebCore::YouTubePluginReplacement::registerPluginReplacement): Properly create a ReplacementPlugin instance.
        (WebCore::YouTubePluginReplacement::isEnabledBySettings): Added.
        * Modules/plugins/YouTubePluginReplacement.h: Declare a static member function.
        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::requestObject): Ask the ReplacementPlugin whether it's enabled, rather than assume
            all plug-in replacement is guarded by a single run-time setting.
        * page/Settings.cpp: Declare values for defaults for both settings.
        * page/Settings.in: Declare two settings.
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::Backup::Backup): Handle both settings.
        (WebCore::InternalSettings::Backup::restoreTo): Ditto.
        (WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Added.
        (WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Added.
        (WebCore::InternalSettings::setPluginReplacementEnabled): Deleted.
        * testing/InternalSettings.h: Duplicate and rename.
        * testing/InternalSettings.idl: Ditto.

2016-08-31  Yoav Weiss  <yoav@yoav.ws>

        Add event support for link preload.
        https://bugs.webkit.org/show_bug.cgi?id=158466

        Reviewed by Alex Christensen.

        Add onload/onerror support for link rel preload to align it with the spec
        and enable various resource loading use-cases.
        This patch also fixes XHR matching issues by replacing LinkPreload with RawResource.

        Tests: http/tests/misc/script_onload_delays_window_onload.html
               http/tests/preload/delaying_onload_link_preload_after_discovery.html
               http/tests/preload/delaying_onload_link_preload_after_discovery_image.html
               http/tests/preload/not_delaying_window_onload_before_discovery.html
               http/tests/preload/onerror_event.html
               http/tests/preload/onload_event.html

        * CMakeLists.txt: Add LinkPreloadResourceClients.{h,cpp}
        * WebCore.xcodeproj/project.pbxproj: Add LinkPreloadResourceClients.{h,cpp}.
        * html/HTMlLinkElement.cpp:
        (WebCore::linkErrorEventSender): Add an eventSender for the error event.
        (WebCore::HTMLLinkElement::HTMLLinkElement): s/m_loadedSheet/m_loadedResource/
        (WebCore::HTMLLinkElement::~HTMLLinkElement): Cancel the error event when the element gets destructed.
        (WebCore::HTMLLinkElement::linkLoaded): dispatch the event in an async manner.
        (WebCore::HTMLLinkElement::linkLoadingErrored): dispatch the event in an async manner.
        (WebCore::HTMLLinkElement::dispatchPendingEvent): Call dispatchEvent directly.
        (WebCore::HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources): s/m_loadedSheet/m_loadedResource/
        * html/HTMLLinkElement.h: s/m_loadedSheet/m_loadedResource/
        * html/parser/HTMLResourcePreloader.cpp:
        (WebCore::HTMLResourcePreloader::preload): Call preload as ImplicitPreload, to distinguish it from declarative preload.
        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::LinkLoader): Get rid of unnecessary event timers and add a weakPtrFactory.
        (WebCore::LinkLoader::triggerEvents): Add a triggerEvents function that can be called from notifyFinished as well as the
        LinkPreloadResourceClients.
        (WebCore::LinkLoader::notifyFinished): Call the triggerEvents function.
        (WebCore::LinkLoader::resourceTypeFromAsAttribute): Replace LinkPreload with RawResource to avoid XHR resource matching issues.
        (WebCore::createLinkPreloadResourceClient): Create a resource client for link preload.
        (WebCore::LinkLoader::preloadIfNeeded): Trigger an error when `as` is unknown. Make sure that preload resources don't delay window.onload
        before discovery. Get the resource back from calling preload and create a client for that resource.
        (WebCore::LinkLoader::linkLoadTimerFired): Deleted.
        (WebCore::LinkLoader::linkLoadingErrorTimerFired): Deleted.
        (WebCore::preloadIfNeeded): Deleted.
        * loader/LinkLoader.h:
        (WebCore::LinkLoader::createWeakPtr):
        * loader/LinkPreloadResourceClients.cpp: Added.
        (WebCore::LinkPreloadResourceClient::LinkPreloadResourceClient): Create a LinkPreloadResourceClient and assign with with a weakPtr of
        LinkLoader.
        (WebCore::LinkPreloadResourceClient::triggerEvents): Call LinkLoader's triggerEvents.
        * loader/LinkPreloadResourceClients.h: Added.
        (WebCore::LinkPreloadResourceClient::~LinkPreloadResourceClient):
        (WebCore::LinkPreloadResourceClient::addResource): Add as resource's client.
        (WebCore::LinkPreloadResourceClient::clearResource): Remove as resource's client and clear ref to resource.
        (WebCore::LinkPreloadResourceClient::ownedResource): Return ref to resource.
        * loader/ResourceLoadInfo.cpp:
        (WebCore::toResourceType): Removed LinkPreload.
        * loader/SubresourceLoader.cpp:
        (WebCore::logResourceLoaded): Removed LinkPreload.
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::defaultPriorityForResourceType): Removed LinkPreload.
        * loader/cache/CachedResource.h: Removed LinkPreload.
        (WebCore::CachedResource::ignoreForRequestCount): Don't delay window.onload for requests that opted out of that.
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::checkInsecureContent): Removed LinkPreload.
        (WebCore::CachedResourceLoader::requestResource): Make sure that discovered preload resources do block window.onload.
        (WebCore::CachedResourceLoader::preload): Make sure that explicitly preloaded subresources can be fetched even if there are parser
        blocking resources still in flight. Return the preloaded resource.
        (WebCore::CachedResourceLoader::requestPreload): Make sure that preloaded fonts get requested. Return preloaded resource.
        (WebCore::createResource): Removed LinkPreload.
        (WebCore::contentTypeFromResourceType): Removed LinkPreload.
        (WebCore::CachedResourceLoader::canRequest): Removed LinkPreload.
        * loader/cache/CachedResourceLoader.h:
        * platform/network/ResourceRequestBase.h:
        (WebCore::ResourceRequestBase::ignoreForRequestCount): Get the flag saying if a resource should block window.onload.
        (WebCore::ResourceRequestBase::setIgnoreForRequestCount): Set the flag saying if a resource should block window.onload.

2016-08-31  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: XHR with text but responseType = "blob" shows blank content
        https://bugs.webkit.org/show_bug.cgi?id=161422
        <rdar://problem/28066869>

        Reviewed by Brian Burg.

        Test: inspector/network/xhr-json-blob-has-content.html

        When an XMLHttpRequest finished loading it was always setting the Inspector's
        content for that load at the end. However, if the XHR was loading binary data
        then it was passing an empty string to the inspector and overwriting the
        data the inspector already had for the resource. Avoid this overwriting.

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::didFinishLoading):
        When loading binary content we have no decoded text to send to the inspector.

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didFinishXHRLoading):
        Switch to an Optional string, and if it is not available don't
        call through to the NetworkAgent expecting decoded text.

        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::didFinishXHRLoading):
        * inspector/InspectorNetworkAgent.h:
        Improve variable name.

2016-08-31  Alex Christensen  <achristensen@webkit.org>

        Add runtime flag for using URLParser
        https://bugs.webkit.org/show_bug.cgi?id=161363

        Reviewed by Sam Weinig.

        No new tests.  No change in default behavior.

        * PlatformMac.cmake:
        * platform/URL.cpp:
        (WebCore::URL::URL):
        (WebCore::URL::init):
        (WebCore::URL::setProtocol):
        (WebCore::URL::setHost):
        (WebCore::URL::removePort):
        (WebCore::URL::setPort):
        (WebCore::URL::setHostAndPort):
        (WebCore::URL::setUser):
        (WebCore::URL::setPass):
        (WebCore::URL::setFragmentIdentifier):
        (WebCore::URL::removeFragmentIdentifier):
        (WebCore::URL::setQuery):
        (WebCore::URL::setPath):
        (WebCore::URL::parse):
        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        (WebCore::URLParser::setEnabled):
        (WebCore::URLParser::enabled):
        * platform/URLParser.h:
        * platform/cf/URLCF.cpp:
        (WebCore::URL::URL):
        * platform/cocoa/URLParserCocoa.mm: Added.
        (WebCore::URLParser::URLParserEnabled):
        * platform/mac/URLMac.mm:
        (WebCore::URL::URL):

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

        [Fetch API] Fetch API should be able to load data URL in Same Origin mode
        https://bugs.webkit.org/show_bug.cgi?id=161434

        Reviewed by Sam Weinig.

        Tests: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-to-dataurl-worker.html
               imported/w3c/web-platform-tests/fetch/api/redirect/redirect-to-dataurl.html
        Covered also by added sub-test.

        Moving SameDataURLOrigin option from ThreadableLoaderOptions to ResourceLoaderOptions.
        This allows doing some of the checks in CachedResourceLoader/CachedResource.
        This also allows setting this options in CachedResourceLoader clients, ImageLoader in that case.

        * Modules/fetch/FetchLoader.cpp:
        (WebCore::FetchLoader::start): Setting sameOriginDataURL as ResourceLoader option.
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::updateFromElement): Setting sameOriginDataURL as specificied in
        https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element.
        * loader/ResourceLoaderOptions.h: Adding sameOriginDataURL as ResourceLoader option.
        * loader/ThreadableLoader.cpp:
        (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Removing sameOriginDataURL option.
        * loader/ThreadableLoader.h:
        * loader/WorkerThreadableLoader.cpp: Setting sameOriginDataURL as ResourceLoader option.
        (WebCore::LoaderTaskOptions::LoaderTaskOptions):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load): If resource URL is a data url, we previously marked the resource as same origin.
        We only do that now if the sameOriginDataURL flag is set as per fetch specification.
        See https://fetch.spec.whatwg.org/#main-fetch.
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::isSameOriginDataURL): Helper function.
        (WebCore::CachedResourceLoader::canRequest): Allowing same origin loads of data URLs if flag is set and no redirection happens.
        See https://fetch.spec.whatwg.org/#http-redirect-fetch for why we check redirection.

2016-08-31  Ryosuke Niwa  <rniwa@webkit.org>

        HTML constructor must throw when newTarget is itself
        https://bugs.webkit.org/show_bug.cgi?id=161430

        Reviewed by Antti Koivisto.

        Per https://github.com/w3c/webcomponents/issues/541, we must throw a TypeError when the HTMLElement constructor
        is called with new.target set to itself (i.e. new HTMLElement after registering it with a custom element).

        Note that we can't check this at the time of customElements.define because it could be a Proxy object.

        Also see: https://html.spec.whatwg.org/#html-element-constructors

        Tests: fast/custom-elements/CustomElementRegistry.html
               fast/custom-elements/HTMLElement-constructor.html

        * bindings/js/JSHTMLElementCustom.cpp:
        (WebCore::constructJSHTMLElement): Throw a TypeError when NewTarget is HTMLElement constructor itself.

2016-08-31  Ryosuke Niwa  <rniwa@webkit.org>

        Rebaseline binding tests after r205257.

        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):

2016-08-31  Ryosuke Niwa  <rniwa@webkit.org>

        Add the check for reentrancy to CustomElementRegistry
        https://bugs.webkit.org/show_bug.cgi?id=161423

        Reviewed by Antti Koivisto.

        Added the "element definition is running" flag to JSCustomElementRegistry:
        https://html.spec.whatwg.org/multipage/scripting.html#element-definition-is-running

        And added an exception for when this flag is set during JSCustomElementRegistry::define:
        https://html.spec.whatwg.org/multipage/scripting.html#dom-customelementregistry-define

        Tests: fast/custom-elements/CustomElementRegistry.html

        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::JSCustomElementRegistry::define): Throw NotSupportedError when m_elementDefinitionIsRunning is true.
        * dom/CustomElementRegistry.h:
        (WebCore::CustomElementRegistry::elementDefinitionIsRunning): Added.

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

        Avoid using strong reference in JSDOMPromise’s DeferredWrapper
        https://bugs.webkit.org/show_bug.cgi?id=161426
        <rdar://problem/28091123>

        Reviewed by Geoffrey Garen.

        Replace JSC::Strong in DeferredWrapper by JSC::Weak, and make the global object own JSPromiseDeferred.

        DeferredWrapper adds itself to JSDOMGlobalObject's newly added HashSet when it's created and clears itself
        from the HashSet inside its destructor as well as when the promise is resolved or rejected.
        This is so that JSDOMGlobalObject's visitChildren can visit every live DeferredWrapper.

        Because this operation is rather expense, this patch turns DeferredWrapper into a RefCounted object to avoid
        HashMap churns. Most of code changes in this patch is due to this type change, and the fact lambda cannot
        capture Ref<DeferredWrapper> since its copy constructor doesn't exist.

        We also create a write barrier from the global object to JSPromiseDeferred so that they won't be collected
        during an eden collection when it happens before JSDOMGlobalObject's visitChildren is invoked.

        Note that it's possible for the entire DOM wrapper world of the promise to go away before the promise is
        resolved or rejected by a ref-counted C++ object. In this case, m_deferred and m_globalObject become dead.
        Various member resolve* and reject functions of DeferredWrapper have been modified to check this condition.

        Because JSDOMGlobalObject can be finalized before DeferredWrapper is finalized. DeferredWrapper's destructor,
        which calls DeferredWrapper::clear, should only remove itself from m_globalObject when m_globalObject is alive.

        Finally, this patch makes DeferredWrapper inherit from ActiveDOMCallback so that it won't try to execute scripts
        when the active DOM objects have been suspended; e.g. after a page navigation.

        No new tests since there should be no author/user visible behavioral change.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
        * Modules/applepay/ApplePaySession.h:
        * Modules/fetch/DOMWindowFetch.cpp:
        (WebCore::DOMWindowFetch::fetch):
        * Modules/fetch/DOMWindowFetch.h:
        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::arrayBuffer):
        (WebCore::FetchBody::blob):
        (WebCore::FetchBody::json):
        (WebCore::FetchBody::text):
        (WebCore::FetchBody::consume):
        (WebCore::FetchBody::consumeArrayBuffer):
        (WebCore::FetchBody::consumeArrayBufferView):
        (WebCore::FetchBody::consumeText):
        (WebCore::FetchBody::consumeBlob):
        (WebCore::FetchBody::loadingFailed):
        (WebCore::FetchBody::loadingSucceeded):
        * Modules/fetch/FetchBody.h:
        (WebCore::FetchBody::formData):
        (WebCore::FetchBody::cleanConsumePromise):
        (WebCore::FetchBody): Use RefPtr<DeferredWrapper> instead of Optional<DeferredWrapper> now that DeferredWrapper
        is ref counted. Perhaps we could use Optional<Ref<DeferredWrapper>> here but that seemed rather verbose.
        * Modules/fetch/FetchBodyConsumer.cpp:
        (WebCore::FetchBodyConsumer::resolveWithData):
        (WebCore::FetchBodyConsumer::resolve):
        * Modules/fetch/FetchBodyConsumer.h:
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::arrayBuffer):
        (WebCore::FetchBodyOwner::blob):
        (WebCore::FetchBodyOwner::formData):
        (WebCore::FetchBodyOwner::json):
        (WebCore::FetchBodyOwner::text):
        * Modules/fetch/FetchBodyOwner.h:
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::consume):
        (WebCore::FetchResponse::finishConsumingStream):
        * Modules/fetch/FetchResponse.h:
        * Modules/fetch/WorkerGlobalScopeFetch.cpp:
        (WebCore::WorkerGlobalScopeFetch::fetch):
        * Modules/fetch/WorkerGlobalScopeFetch.h:
        * Modules/mediastream/UserMediaPermissionCheck.h:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject): Added.
        (WebCore::JSDOMGlobalObject::visitChildren): Added visits to each JSPromiseDeferred owned by this global object.
        * bindings/js/JSDOMGlobalObject.h:
        (WebCore::JSDOMGlobalObject::deferredWrappers): Added. This map is only used by JSDOMGlobalObject's visitChildren.
        * bindings/js/JSDOMPromise.cpp:
        (WebCore::DeferredWrapper::DeferredWrapper):
        (WebCore::DeferredWrapper::~DeferredWrapper): Calls clear. When the global object has already been finalized,
        m_globalObject is dead. In that case, there is no need to remove itself from the global object. When m_deferred
        has been cleared, either clear() has already been called (1) or the callback is dead (2). Since (2) happens only
        when the global object itself is dead (as its visitChildren would have visited m_deferred otherwise), again, there
        is no need to remove itself from global object.
        (WebCore::DeferredWrapper::clear): Added. Clears m_deferred and removes itself from JSDOMGlobalObject.
        (WebCore::DeferredWrapper::contextDestroyed): ScriptExecutionContext has been destroyed. We must call clear().
        (WebCore::DeferredWrapper::callFunction): Check canInvokeCallback in ActiveDOMCallback.
        (WebCore::DeferredWrapper::reject): Exit early when isSuspended() is true. See below.
        (WebCore::rejectPromiseWithExceptionIfAny):
        (WebCore::fulfillPromiseWithJSON):
        (WebCore::fulfillPromiseWithArrayBuffer):
        * bindings/js/JSDOMPromise.h:
        (WebCore::DeferredWrapper::create): Added.
        (WebCore::DeferredWrapper::isSuspended): Added. Returns true iff the DOM wrapper world has gone away or active DOM
        objects have been suspended.
        (WebCore::DeferredWrapper::globalObject): Made this inline.
        (WebCore::DeferredWrapper::visitAggregate): Added. Called by JSDOMGlobalObject::visitChildren.
        (WebCore::DOMPromise::resolve):
        (WebCore::DOMPromise::reject):
        (WebCore::DeferredWrapper::resolveWithValue): Exit early when isSuspended() is true.
        (WebCore::DeferredWrapper::resolveWithNewlyCreated): Ditto.
        (WebCore::DeferredWrapper::rejectWithValue): Ditto.
        (WebCore::DeferredWrapper::resolve): Ditto.
        (WebCore::DeferredWrapper::reject): Ditto.
        * bindings/js/JSFontFaceCustom.cpp:
        (WebCore::JSFontFace::loaded):
        * bindings/js/JSFontFaceSetCustom.cpp:
        (WebCore::JSFontFaceSet::ready):
        * bindings/js/JSMediaDevicesCustom.cpp:
        (WebCore::JSMediaDevices::getUserMedia):
        * bindings/js/JSReadableStreamSourceCustom.cpp:
        (WebCore::JSReadableStreamSource::start):
        * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
        (WebCore::JSWebKitSubtleCrypto::encrypt):
        (WebCore::JSWebKitSubtleCrypto::decrypt):
        (WebCore::JSWebKitSubtleCrypto::sign):
        (WebCore::JSWebKitSubtleCrypto::verify):
        (WebCore::JSWebKitSubtleCrypto::digest):
        (WebCore::JSWebKitSubtleCrypto::generateKey):
        (WebCore::JSWebKitSubtleCrypto::importKey):
        (WebCore::JSWebKitSubtleCrypto::exportKey):
        (WebCore::JSWebKitSubtleCrypto::wrapKey):
        (WebCore::JSWebKitSubtleCrypto::unwrapKey):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateReturnParameters):

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

        [Fetch API] Request construction failure should not set "bodyUsed"
        https://bugs.webkit.org/show_bug.cgi?id=161432

        Reviewed by Alex Christensen.

        Covered by added sub-test coming from chromium fetch test suite.

        * Modules/fetch/FetchRequest.cpp:
        (WebCore::methodCanHaveBody):
        (WebCore::FetchRequest::setBody): Check whether request can have a body before disturbing the passed request.
        (WebCore::validateBodyAndMethod): Deleted.

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

        [Fetch API] Response bodyUsed should check for its body disturbed state
        https://bugs.webkit.org/show_bug.cgi?id=161429

        Reviewed by Alex Christensen.

        Test: http/tests/fetch/bodyUsed-worker.html

        Implementing bodyUsed as a JS Builtin.
        This allows using directly @isReadableStreamDisturbed if response has a body.

        Renaming isDisturbed to isDisturbedOrLocked to better match fetch spec terminology.

        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::isDisturbedOrLocked): Renaming isDisturbed to isDisturbedOrLocked.
        (WebCore::FetchBodyOwner::arrayBuffer): Ditto.
        (WebCore::FetchBodyOwner::blob): Ditto.
        (WebCore::FetchBodyOwner::formData): Ditto.
        (WebCore::FetchBodyOwner::json): Ditto.
        (WebCore::FetchBodyOwner::text): Ditto.
        (WebCore::FetchBodyOwner::isDisturbed): Ditto.
        * Modules/fetch/FetchBodyOwner.h:
        (WebCore::FetchBodyOwner::isDisturbed): Ditto.
        * Modules/fetch/FetchRequest.cpp:
        (WebCore::FetchRequest::initializeWith): Ditto.
        (WebCore::FetchRequest::clone): Ditto.
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::cloneForJS): Ditto.
        (WebCore::FetchResponse::createReadableStreamSource): Only asserting for isDisturbed.
        * Modules/fetch/FetchResponse.idl: Marking bodyUsed as JS builtin.
        * Modules/fetch/FetchResponse.js: Adding bodyUsed.
        (bodyUsed):
        (clone):

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

        [Fetch API] Blob type should be correctly set in case of empty body
        https://bugs.webkit.org/show_bug.cgi?id=161431

        Reviewed by Alex Christensen.

        Tests: http/tests/fetch/fetch-as-blob-worker.html
               http/tests/fetch/fetch-as-blob.html

        * Modules/fetch/FetchBodyConsumer.cpp:
        (WebCore::FetchBodyConsumer::takeAsBlob): Set blob type with contentType even if blob has no data.
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::blob): Ditto for empty bodies.

2016-08-31  Andreas Kling  <akling@apple.com>

        DOM event handling should pass Event around by reference.
        <https://webkit.org/b/161398>

        Reviewed by Chris Dumez.

        Start with making Node::defaultEventHandler() take an Event& instead of an Event*,
        and then spread out from there, propagating the referenceness.

        * dom/Element.cpp:
        (WebCore::Element::isKeyboardFocusable):
        * dom/Element.h:
        * dom/EventDispatcher.cpp:
        (WebCore::callDefaultEventHandlersInTheBubblingOrder):
        * dom/Node.cpp:
        (WebCore::Node::dispatchDOMActivateEvent):
        (WebCore::Node::defaultEventHandler):
        * dom/Node.h:
        * editing/Editor.cpp:
        (WebCore::Editor::handleKeyboardEvent):
        (WebCore::Editor::handleInputMethodKeydown):
        (WebCore::Editor::handleTextEvent):
        * editing/Editor.h:
        * html/BaseCheckableInputType.cpp:
        (WebCore::BaseCheckableInputType::handleKeydownEvent):
        (WebCore::BaseCheckableInputType::handleKeypressEvent):
        * html/BaseCheckableInputType.h:
        * html/BaseChooserOnlyDateAndTimeInputType.cpp:
        (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
        (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
        (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent):
        (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeyupEvent):
        * html/BaseChooserOnlyDateAndTimeInputType.h:
        * html/BaseClickableWithKeyInputType.cpp:
        (WebCore::BaseClickableWithKeyInputType::handleKeydownEvent):
        (WebCore::BaseClickableWithKeyInputType::handleKeypressEvent):
        (WebCore::BaseClickableWithKeyInputType::handleKeyupEvent):
        * html/BaseClickableWithKeyInputType.h:
        * html/BaseDateAndTimeInputType.cpp:
        (WebCore::BaseDateAndTimeInputType::isKeyboardFocusable):
        * html/BaseDateAndTimeInputType.h:
        * html/CheckboxInputType.cpp:
        (WebCore::CheckboxInputType::handleKeyupEvent):
        * html/CheckboxInputType.h:
        * html/ColorInputType.cpp:
        (WebCore::ColorInputType::handleDOMActivateEvent):
        * html/ColorInputType.h:
        * html/FileInputType.cpp:
        (WebCore::FileInputType::handleDOMActivateEvent):
        * html/FileInputType.h:
        * html/HTMLAnchorElement.cpp:
        (WebCore::HTMLAnchorElement::isKeyboardFocusable):
        (WebCore::HTMLAnchorElement::defaultEventHandler):
        (WebCore::HTMLAnchorElement::handleClick):
        (WebCore::HTMLAnchorElement::eventType):
        (WebCore::isEnterKeyKeydownEvent):
        * html/HTMLAnchorElement.h:
        * html/HTMLAreaElement.cpp:
        (WebCore::HTMLAreaElement::isKeyboardFocusable):
        * html/HTMLAreaElement.h:
        * html/HTMLButtonElement.cpp:
        (WebCore::HTMLButtonElement::defaultEventHandler):
        * html/HTMLButtonElement.h:
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::isKeyboardFocusable):
        * html/HTMLFormControlElement.h:
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::submitImplicitly):
        (WebCore::submitElementFromEvent):
        (WebCore::HTMLFormElement::validateInteractively):
        (WebCore::HTMLFormElement::prepareForSubmission):
        * html/HTMLFormElement.h:
        * html/HTMLFrameOwnerElement.cpp:
        (WebCore::HTMLFrameOwnerElement::isKeyboardFocusable):
        * html/HTMLFrameOwnerElement.h:
        * html/HTMLFrameSetElement.cpp:
        (WebCore::HTMLFrameSetElement::defaultEventHandler):
        * html/HTMLFrameSetElement.h:
        * html/HTMLIFrameElement.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::isKeyboardFocusable):
        (WebCore::HTMLInputElement::isTextFormControlKeyboardFocusable):
        (WebCore::HTMLInputElement::willDispatchEvent):
        (WebCore::HTMLInputElement::defaultEventHandler):
        * html/HTMLInputElement.h:
        * html/HTMLLabelElement.cpp:
        (WebCore::HTMLLabelElement::defaultEventHandler):
        * html/HTMLLabelElement.h:
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::defaultEventHandler):
        * html/HTMLLinkElement.h:
        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::defaultEventHandler):
        (WebCore::HTMLPlugInElement::isKeyboardFocusable):
        * html/HTMLPlugInElement.h:
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::defaultEventHandler):
        * html/HTMLPlugInImageElement.h:
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::isKeyboardFocusable):
        (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
        (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
        (WebCore::HTMLSelectElement::defaultEventHandler):
        * html/HTMLSelectElement.h:
        * html/HTMLSummaryElement.cpp:
        (WebCore::HTMLSummaryElement::defaultEventHandler):
        * html/HTMLSummaryElement.h:
        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::isKeyboardFocusable):
        (WebCore::HTMLTextAreaElement::defaultEventHandler):
        (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
        * html/HTMLTextAreaElement.h:
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::forwardEvent):
        * html/HTMLTextFormControlElement.h:
        * html/ImageInputType.cpp:
        (WebCore::ImageInputType::handleDOMActivateEvent):
        * html/ImageInputType.h:
        * html/InputType.cpp:
        (WebCore::InputType::handleClickEvent):
        (WebCore::InputType::handleMouseDownEvent):
        (WebCore::InputType::handleDOMActivateEvent):
        (WebCore::InputType::handleKeydownEvent):
        (WebCore::InputType::handleKeypressEvent):
        (WebCore::InputType::handleKeyupEvent):
        (WebCore::InputType::handleBeforeTextInsertedEvent):
        (WebCore::InputType::handleTouchEvent):
        (WebCore::InputType::forwardEvent):
        (WebCore::InputType::shouldSubmitImplicitly):
        (WebCore::InputType::dispatchSimulatedClickIfActive):
        (WebCore::InputType::isKeyboardFocusable):
        * html/InputType.h:
        * html/MediaDocument.cpp:
        (WebCore::MediaDocument::defaultEventHandler):
        * html/MediaDocument.h:
        * html/NumberInputType.cpp:
        (WebCore::NumberInputType::handleKeydownEvent):
        * html/NumberInputType.h:
        * html/RadioInputType.cpp:
        (WebCore::RadioInputType::handleClickEvent):
        (WebCore::RadioInputType::handleKeydownEvent):
        (WebCore::RadioInputType::handleKeyupEvent):
        (WebCore::RadioInputType::isKeyboardFocusable):
        * html/RadioInputType.h:
        * html/RangeInputType.cpp:
        (WebCore::RangeInputType::handleMouseDownEvent):
        (WebCore::RangeInputType::handleTouchEvent):
        (WebCore::RangeInputType::handleKeydownEvent):
        * html/RangeInputType.h:
        * html/ResetInputType.cpp:
        (WebCore::ResetInputType::handleDOMActivateEvent):
        * html/ResetInputType.h:
        * html/SearchInputType.cpp:
        (WebCore::SearchInputType::handleKeydownEvent):
        * html/SearchInputType.h:
        * html/SubmitInputType.cpp:
        (WebCore::SubmitInputType::handleDOMActivateEvent):
        * html/SubmitInputType.h:
        * html/TextFieldInputType.cpp:
        (WebCore::TextFieldInputType::isKeyboardFocusable):
        (WebCore::TextFieldInputType::handleKeydownEvent):
        (WebCore::TextFieldInputType::handleKeydownEventForSpinButton):
        (WebCore::TextFieldInputType::forwardEvent):
        (WebCore::TextFieldInputType::shouldSubmitImplicitly):
        (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
        * html/TextFieldInputType.h:
        * html/shadow/AutoFillButtonElement.cpp:
        (WebCore::AutoFillButtonElement::defaultEventHandler):
        * html/shadow/AutoFillButtonElement.h:
        * html/shadow/MediaControlElementTypes.cpp:
        (WebCore::MediaControlMuteButtonElement::defaultEventHandler):
        (WebCore::MediaControlSeekButtonElement::defaultEventHandler):
        (WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
        * html/shadow/MediaControlElementTypes.h:
        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlPanelElement::defaultEventHandler):
        (WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
        (WebCore::MediaControlPanelMuteButtonElement::defaultEventHandler):
        (WebCore::MediaControlPlayButtonElement::defaultEventHandler):
        (WebCore::MediaControlOverlayPlayButtonElement::defaultEventHandler):
        (WebCore::MediaControlRewindButtonElement::defaultEventHandler):
        (WebCore::MediaControlReturnToRealtimeButtonElement::defaultEventHandler):
        (WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
        (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
        (WebCore::MediaControlTimelineElement::defaultEventHandler):
        (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
        (WebCore::MediaControlFullscreenVolumeMinButtonElement::defaultEventHandler):
        (WebCore::MediaControlFullscreenVolumeMaxButtonElement::defaultEventHandler):
        * html/shadow/MediaControlElements.h:
        * html/shadow/MediaControls.cpp:
        (WebCore::MediaControls::defaultEventHandler):
        (WebCore::MediaControls::containsRelatedTarget):
        * html/shadow/MediaControls.h:
        * html/shadow/MediaControlsApple.cpp:
        (WebCore::MediaControlsApple::defaultEventHandler):
        (WebCore::MediaControlsApple::handleClickEvent):
        (WebCore::MediaControlsAppleEventListener::handleEvent):
        * html/shadow/MediaControlsApple.h:
        * html/shadow/SliderThumbElement.cpp:
        (WebCore::SliderThumbElement::defaultEventHandler):
        (WebCore::SliderThumbElement::handleTouchStart):
        (WebCore::SliderThumbElement::handleTouchMove):
        (WebCore::SliderThumbElement::handleTouchEndAndCancel):
        (WebCore::SliderThumbElement::handleTouchEvent):
        * html/shadow/SliderThumbElement.h:
        * html/shadow/SpinButtonElement.cpp:
        (WebCore::SpinButtonElement::defaultEventHandler):
        (WebCore::SpinButtonElement::forwardEvent):
        * html/shadow/SpinButtonElement.h:
        * html/shadow/TextControlInnerElements.cpp:
        (WebCore::TextControlInnerTextElement::defaultEventHandler):
        (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
        (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
        * html/shadow/TextControlInnerElements.h:
        * html/shadow/mac/ImageControlsButtonElementMac.cpp:
        (WebCore::ImageControlsButtonElementMac::defaultEventHandler):
        * html/shadow/mac/ImageControlsButtonElementMac.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
        * mathml/MathMLElement.cpp:
        (WebCore::MathMLElement::defaultEventHandler):
        (WebCore::MathMLElement::isKeyboardFocusable):
        * mathml/MathMLElement.h:
        * mathml/MathMLSelectElement.cpp:
        (WebCore::MathMLSelectElement::defaultEventHandler):
        * mathml/MathMLSelectElement.h:
        * page/EventHandler.cpp:
        (WebCore::didScrollInScrollableArea):
        (WebCore::handleWheelEventInAppropriateEnclosingBox):
        (WebCore::EventHandler::defaultWheelEventHandler):
        (WebCore::EventHandler::keyEvent):
        (WebCore::handleKeyboardSelectionMovement):
        (WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
        (WebCore::EventHandler::defaultKeyboardEventHandler):
        (WebCore::EventHandler::defaultTextInputEventHandler):
        (WebCore::EventHandler::defaultSpaceEventHandler):
        (WebCore::EventHandler::defaultBackspaceEventHandler):
        (WebCore::EventHandler::defaultArrowEventHandler):
        (WebCore::EventHandler::defaultTabEventHandler):
        * page/EventHandler.h:
        * page/FocusController.cpp:
        (WebCore::isFocusableElementOrScopeOwner):
        (WebCore::isNonFocusableScopeOwner):
        (WebCore::isFocusableScopeOwner):
        (WebCore::FocusController::advanceFocusInDocumentOrder):
        (WebCore::FocusController::findFocusCandidateInContainer):
        * rendering/RenderFrameSet.cpp:
        (WebCore::RenderFrameSet::userResize):
        * rendering/RenderFrameSet.h:
        * svg/SVGAElement.cpp:
        (WebCore::SVGAElement::defaultEventHandler):
        (WebCore::SVGAElement::isKeyboardFocusable):
        * svg/SVGAElement.h:

2016-08-31  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Streams API] Align getReader() with spec
        https://bugs.webkit.org/show_bug.cgi?id=160508

        Reviewed by Xabier Rodriguez-Calvar.

        Aligned getReader() with spec following replacement of ReadableStreamReader by
        ReadableStreamDefaultReader.

        Test: streams/readable-stream-getReader.html

        * Modules/streams/ReadableStream.js:
        (getReader):

2016-08-31  Brady Eidson  <beidson@apple.com>

        WK2 Gamepad provider on iOS.
        https://bugs.webkit.org/show_bug.cgi?id=161412

        Reviewed by Tim Horton.

        No new tests (Native framework backends not directly testable)

        * Configurations/FeatureDefines.xcconfig:

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

        REGRESSION (r201701): Unable to copy from CodeMirror editor version used in Jenkins install website
        https://bugs.webkit.org/show_bug.cgi?id=161386
        <rdar://problem/27590077>

        Reviewed by Dan Bernstein.

        This CodeMirror version uses a hidden <textarea> to implement copy/paste. The textarea has width:1px; border-width:1px.
        Jenkins page has also has a stylesheet that contains * { box-sizing:border-box } and as a result the textarea content
        width gets computed as 0. With r201701 we use content size instead of box size for clipping and the textarea content is
        (correctly) considered invisible.

        Add a quirk that allows this to continue working.

        Test: editing/text-iterator/hidden-textarea-selection-quirk.html

        * editing/TextIterator.cpp:
        (WebCore::fullyClipsContents):

2016-08-31  Joseph Pecoraro  <pecoraro@apple.com>

        Remove unused member variable in WebCore::File
        https://bugs.webkit.org/show_bug.cgi?id=161420

        Reviewed by Alex Christensen.

        * fileapi/File.h:

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

        Add "get" to CustomElementsRegistry
        https://bugs.webkit.org/show_bug.cgi?id=161421

        Reviewed by Yusuke Suzuki.

        Add the support for "get" method on CustomElementsRegistry, which returns the constructor
        of the custom element with the given name:
        https://html.spec.whatwg.org/multipage/scripting.html#dom-customelementregistry-get

        Tests: fast/custom-elements/CustomElementRegistry.html

        * dom/CustomElementRegistry.cpp:
        (WebCore::CustomElementRegistry::get): Added.
        * dom/CustomElementRegistry.h:
        * dom/CustomElementRegistry.idl:

2016-08-30  Yusuke Suzuki  <utatane.tea@gmail.com>

        Make PendingScript as ref-counted
        https://bugs.webkit.org/show_bug.cgi?id=161350

        Reviewed by Ryosuke Niwa.

        Currently, while PendingScript is copyable, PendingScript is also CachedResourceClient.
        So when copying this, the client registration is done in PendingScript's operator= etc.
        However, this copying functionality is not effectively used.
        In this patch, we change this PendingScript to ref-counted class and make it noncopyable.
        This change makes things simple (dropping this copying functionality), and drops unnecessary
        addClient / removeClient calls. And we also simplify PendingScript class. Since we can offer
        all the members at the construction time, we do not need any setters like setCachedScript,
        setElement etc. This prevents us from accidentally generating the half-baked pending script.

        Furthermore, by changing PendingScript noncopyable & ref-counted, we easily make it
        observable. In this patch, we add PendingScriptClient to receive the notification from
        PendingScript. Previously, we directly used CachedScript in PendingScript to receive the
        notification. When introducing ScriptModuleGraph and making this PendingScript the container
        of the both CachedScript and ScriptModuleGraph, hiding the raw CachedScript operations is
        useful.

        No behavior changes.

        * WebCore.xcodeproj/project.pbxproj:
        * dom/PendingScript.cpp:
        (WebCore::PendingScript::create): These factory functions take all the information needed
        to construct the PendingScript. So the setters of PendingScript are dropped. This is better
        since we now do not expose any half-baked pending script accidentally.
        (WebCore::PendingScript::PendingScript):
        (WebCore::PendingScript::~PendingScript):
        (WebCore::PendingScript::notifyClientFinished):
        (WebCore::PendingScript::notifyFinished):
        (WebCore::PendingScript::isLoaded): When introducing ScriptModuleGraph, this will query to
        either CachedScript or ScriptModuleGraph. PendingScript will become the container for the
        both types.
        (WebCore::PendingScript::setClient):
        (WebCore::PendingScript::clearClient): PendingScript is now observable by PendingScriptClient.
        This avoids touching CachedScript in PendingScript directly. That is good when we introduce
        ScriptModuleGraph and make PendingScript the container of the both CachedScript and ScriptModuleGraph.
        (WebCore::PendingScript::releaseElementAndClear): Deleted. Previously, PendingScript is not ref-counted.
        So when we would like to say "this pending script is empty", we used the pending script with
        `m_element = nullptr`. This releaseElementAndClear cleared this m_element and made the pending
        script empty. Now, we use RefPtr<PendingScript> and empty one is just represented by the nullptr.
        This function is no longer necessary. Dropped.
        (WebCore::PendingScript::setCachedScript): Deleted. The fields are set in the constructor.
        So this setter is no longer necessary. Dropped.
        * dom/PendingScript.h:
        * dom/PendingScriptClient.h: Copied from Source/WebCore/html/parser/HTMLScriptRunnerHost.h.
        (WebCore::PendingScriptClient::~PendingScriptClient):
        * dom/ScriptRunner.cpp:
        (WebCore::ScriptRunner::queueScriptForExecution):
        (WebCore::ScriptRunner::notifyScriptReady):
        (WebCore::ScriptRunner::timerFired): We use `std::exchange` to retrieve the RefPtr<PendingScript>
        and make the original vector element nullptr. Without this, all the PendingScript is held until
        the iteration finishes. We keep the original semantics here that the pending script can be
        released per iteration.
        * dom/ScriptRunner.h:
        * html/parser/HTMLDocumentParser.cpp:
        (WebCore::HTMLDocumentParser::watchForLoad):
        (WebCore::HTMLDocumentParser::stopWatchingForLoad): Use PendingScript instead of touching
        CachedScript directly.
        (WebCore::HTMLDocumentParser::notifyFinished):
        * html/parser/HTMLDocumentParser.h:
        * html/parser/HTMLScriptRunner.cpp:
        (WebCore::HTMLScriptRunner::~HTMLScriptRunner):
        (WebCore::HTMLScriptRunner::sourceFromPendingScript):
        (WebCore::HTMLScriptRunner::isPendingScriptReady):
        (WebCore::HTMLScriptRunner::executeParsingBlockingScript):
        (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): As the previous comment describes,
        we used releaseElementAndClear to make the current pending script empty. Instead of doing so, we now
        explicitly clear executeParsingBlockingScript (by assigning nullptr to m_parserBlockingScript).
        (WebCore::HTMLScriptRunner::watchForLoad):
        (WebCore::HTMLScriptRunner::stopWatchingForLoad): Previously, we used CachedScript::addClient directly
        in the m_host.watchForLoad. This means that we did not have a quick way to query whether the pending
        script is watched. In the old implementation, we have the `m_watchingForLoad : bool` flag in PendingScript
        to hold the watching status for the given pending script. This `pendingScript.setWatchingForLoad(true)`
        just made this flag `true`. But now, we do not use CachedScript::addClient directly. Instead, we have
        the PendingScriptClient and PendingScript::{setClient,clearClient}. We can know whether this pending
        script is watched by checking `m_client != nullptr`. This makes `m_watchingForLoad` unnecessary.
        So this patch drops `m_watchingForLoad` and `pendingScript.setWatchingForLoad(true)` call.
        (WebCore::HTMLScriptRunner::hasParserBlockingScript):
        (WebCore::HTMLScriptRunner::executeParsingBlockingScripts): We clear the m_parserBlockingScript here
        instead of the middle of the executePendingScriptAndDispatchEvent.
        (WebCore::HTMLScriptRunner::executeScriptsWaitingForLoad):
        (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
        (WebCore::requestPendingScript):
        (WebCore::HTMLScriptRunner::requestParsingBlockingScript): Setting m_parsingBlockingScript is now done
        in this caller side.
        (WebCore::HTMLScriptRunner::requestDeferredScript):
        (WebCore::HTMLScriptRunner::runScript):
        (WebCore::HTMLScriptRunner::requestPendingScript): Instead of configuring the passed PendingScript&,
        we return the pending script and the caller sets it to m_parserBlockingScript or holds it. And we now
        change this function to static location one and drop the member function. Previously, we always make
        PendingScript& valid by always calling `setElement(...)`. I think this is the bug since we accidentally
        exposed the half-baked pending script. But this bug is not shown since `!cachedScript` path is dead code!
        This requestPendingScript is called from two places, requestDeferredScript and requestParsingBlockingScript.
        And these functions are called if the script has `willBeParserExecuted` flag. In the case of the script
        tag having "src" attribute, this flag is only set if `cachedScript` is correctly instantiated. So when
        these functions are called, we can ensure that `cachedScript` is correctly instantiated for the given script.
        In the case of the script tag not having "src" attribute, these functions are won't be called. This is
        because if such a script tag has `willBeParserExecuted` flag, it also has `m_readyToBeParserExecuted`
        and it does not have `m_willExecuteWhenDocumentFinishedParsing` flag, and in that case the both
        functions are never called. So we drop that path and insert the assertion to ensure the above conditions.
        * html/parser/HTMLScriptRunner.h:
        * html/parser/HTMLScriptRunnerHost.h:

2016-08-30  Ricky Mondello  <rmondello@apple.com>

        "pluginReplacementEnabled" should be a Setting, not a RuntimeEnabledFeature
        https://bugs.webkit.org/show_bug.cgi?id=161416
        <rdar://problem/28050847>

        Reviewed by Simon Fraser.

        Mostly mechanical. Tested by running LayoutTests/plugins/quicktime-plugin-replacement.html and manually toggling
        defaultPluginReplacementEnabled and observing a behavior change.

        * bindings/generic/RuntimeEnabledFeatures.cpp:
        (WebCore::RuntimeEnabledFeatures::reset): Purged of the pluginReplacementEnabled setting.
        * bindings/generic/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setPluginReplacementEnabled): Deleted.
        (WebCore::RuntimeEnabledFeatures::pluginReplacementEnabled): Deleted.
        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::requestObject): Use the setting.
        * page/Settings.cpp: Supply different values for iOS and other platforms, matching the RuntimeEnabledFeature values,
            enabled for iOS and disabled otherwise.
        * page/Settings.in: Declare the setting.
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::Backup::Backup): Use the setting.
        (WebCore::InternalSettings::Backup::restoreTo): Ditto.
        (WebCore::InternalSettings::setPluginReplacementEnabled): Ditto.
        * testing/InternalSettings.h: Can now throw an exception, like other Settings-backed members.
        * testing/InternalSettings.idl: Declare this as possibly throwing an exception.

2016-08-30  Ricky Mondello  <rmondello@apple.com>

        YouTubePluginReplacementTest's URL transformation logic should have tests
        https://bugs.webkit.org/show_bug.cgi?id=161406
        <rdar://problem/28050847>

        Reviewed by Eric Carlson.

        Refactor most of YouTubePluginReplacement::youTubeURL into a static method that can be used by TestWebKitAPI.

        * Modules/plugins/YouTubePluginReplacement.cpp:
        (WebCore::YouTubePluginReplacement::youTubeURL): Now implemented in terms of youTubeURLFromAbsoluteURL.
        (WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL): Absorbs most of youTubeURL.
        * Modules/plugins/YouTubePluginReplacement.h: Declare a public method, for the benefit of testing.
        * WebCore.xcodeproj/project.pbxproj: Make some heads private for TestWebKitAPI's benefit.

2016-08-30  Frederic Wang  <fwang@igalia.com>

        Move some code from MathMLElement to MathMLPresentationElement
        https://bugs.webkit.org/show_bug.cgi?id=161377

        Reviewed by Darin Adler.

        The following code is only used in presentation MathML classes. We then move it from
        MathMLElement to MathMLPresentationElement:
        - testing whether a child is a phrasing/flow element.
        - parsing of length attributes.
        - parsing of boolean attributes.
        - parsing of mathvariant attributes.

        No new tests, already covered by existing tests.

        * mathml/MathMLElement.cpp:
        (WebCore::MathMLElement::isPhrasingContent): Deleted.
        (WebCore::MathMLElement::isFlowContent): Deleted.
        (WebCore::MathMLElement::parseNumberAndUnit): Deleted.
        (WebCore::MathMLElement::parseNamedSpace): Deleted.
        (WebCore::MathMLElement::parseMathMLLength): Deleted.
        (WebCore::MathMLElement::cachedMathMLLength): Deleted.
        (WebCore::MathMLElement::cachedBooleanAttribute): Deleted.
        (WebCore::MathMLElement::parseMathVariantAttribute): Deleted.
        (WebCore::MathMLElement::specifiedDisplayStyle): Deleted.
        (WebCore::MathMLElement::specifiedMathVariant): Deleted.
        * mathml/MathMLElement.h:
        (WebCore::MathMLElement::specifiedDisplayStyle):
        (WebCore::MathMLElement::specifiedMathVariant):
        (WebCore::MathMLElement::acceptsDisplayStyleAttribute): Deleted.
        (WebCore::MathMLElement::acceptsMathVariantAttribute): Deleted.
        (WebCore::MathMLElement::toOptionalBool): Deleted.
        * mathml/MathMLPresentationElement.cpp:
        (WebCore::MathMLPresentationElement::isPhrasingContent):
        (WebCore::MathMLPresentationElement::isFlowContent):
        (WebCore::MathMLPresentationElement::cachedBooleanAttribute):
        (WebCore::MathMLPresentationElement::parseNumberAndUnit):
        (WebCore::MathMLPresentationElement::parseNamedSpace):
        (WebCore::MathMLPresentationElement::parseMathMLLength):
        (WebCore::MathMLPresentationElement::cachedMathMLLength):
        (WebCore::MathMLPresentationElement::specifiedDisplayStyle):
        (WebCore::MathMLPresentationElement::parseMathVariantAttribute):
        (WebCore::MathMLPresentationElement::specifiedMathVariant):
        * mathml/MathMLPresentationElement.h:
        (WebCore::MathMLPresentationElement::toOptionalBool):
        (WebCore::MathMLPresentationElement::acceptsMathVariantAttribute):

2016-08-30  Frederic Wang  <fwang@igalia.com>

        Introduce a MathMLUnknownElement class
        https://bugs.webkit.org/show_bug.cgi?id=161298

        Reviewed by Darin Adler.

        For consistency with SVG and HTML, we make MathML elements use a
        fallback MathMLUnknownElement class. Like SVG, we ensure that unknown
        MathML elements do not create any renderer.

        Test: mathml/mathml-unknown.xhtml

        * mathml/MathMLUnknownElement.h: Added. This is a simple class for
        unknown MathML elements, preventing the creation of renderers.
        * mathml/mathtags.in: Map fallbackInterfaceName to MathMLUnknownElement.

2016-08-30  Chris Dumez  <cdumez@apple.com>

        [[Delete]] should throw for cross-origin Window / Location objects
        https://bugs.webkit.org/show_bug.cgi?id=161397

        Reviewed by Ryosuke Niwa.

        [[Delete]] should throw for cross-origin Window / Location objects:
        - https://github.com/whatwg/html/pull/1728

        Firefox and Chrome already throw. Previously, WebKit was merely
        ignoring the call and logging an error message.

        No new tests, updated existing test.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::deleteProperty):
        (WebCore::JSDOMWindow::deletePropertyByIndex):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::deleteProperty):
        (WebCore::JSLocation::deletePropertyByIndex):

2016-08-30  Brady Eidson  <beidson@apple.com>

        GameController.framework backend for gamepad API.
        https://bugs.webkit.org/show_bug.cgi?id=161086

        Reviewed by Alex Christensen.

        No new tests (Native framework backends not directly testable)

        * WebCore.xcodeproj/project.pbxproj:
        
        * platform/gamepad/cocoa/GameControllerGamepad.h: Copied from Source/WebKit2/UIProcess/Gamepad/mac/UIGamepadProviderHID.cpp.
        * platform/gamepad/cocoa/GameControllerGamepad.mm: Added.
        (WebCore::GameControllerGamepad::GameControllerGamepad):
        (WebCore::GameControllerGamepad::setupAsExtendedGamepad):
        (WebCore::GameControllerGamepad::setupAsGamepad):
        
        * platform/gamepad/cocoa/GameControllerGamepadProvider.h: Added.
        * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: Added.
        (WebCore::GameControllerGamepadProvider::singleton):
        (WebCore::GameControllerGamepadProvider::GameControllerGamepadProvider):
        (WebCore::GameControllerGamepadProvider::controllerDidConnect):
        (WebCore::GameControllerGamepadProvider::controllerDidDisconnect):
        (WebCore::GameControllerGamepadProvider::startMonitoringGamepads):
        (WebCore::GameControllerGamepadProvider::stopMonitoringGamepads):
        (WebCore::GameControllerGamepadProvider::indexForNewlyConnectedDevice):
        (WebCore::GameControllerGamepadProvider::gamepadHadInput):
        (WebCore::GameControllerGamepadProvider::makeInvisibileGamepadsVisible):
        (WebCore::GameControllerGamepadProvider::inputNotificationTimerFired):

2016-08-30  Mark Lam  <mark.lam@apple.com>

        Introduce the ThrowScope and force every throw site to instantiate a ThrowScope.
        https://bugs.webkit.org/show_bug.cgi?id=161171

        Reviewed by Filip Pizlo and Geoffrey Garen.

        No new tests because this is only an internal API change. If it builds, it should be good.

        * bindings/js/JSApplePaySessionCustom.cpp:
        (WebCore::JSApplePaySession::completeShippingMethodSelection):
        (WebCore::JSApplePaySession::completeShippingContactSelection):
        (WebCore::JSApplePaySession::completePaymentMethodSelection):
        * bindings/js/JSBlobCustom.cpp:
        (WebCore::constructJSBlob):
        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
        (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
        * bindings/js/JSCryptoAlgorithmDictionary.cpp:
        (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
        (WebCore::createAesCbcParams):
        (WebCore::createAesKeyGenParams):
        (WebCore::createHmacParams):
        (WebCore::createHmacKeyParams):
        (WebCore::createRsaKeyGenParams):
        (WebCore::createRsaOaepParams):
        (WebCore::createRsaSsaParams):
        * bindings/js/JSCryptoCustom.cpp:
        (WebCore::JSCrypto::getRandomValues):
        * bindings/js/JSCryptoKeySerializationJWK.cpp:
        (WebCore::getJSArrayFromJSON):
        (WebCore::getStringFromJSON):
        (WebCore::getBooleanFromJSON):
        (WebCore::getBigIntegerVectorFromJSON):
        (WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
        (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
        (WebCore::tryJWKKeyOpsValue):
        (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
        (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
        (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
        (WebCore::JSCryptoKeySerializationJWK::keyData):
        (WebCore::addJWKAlgorithmToJSON):
        (WebCore::JSCryptoKeySerializationJWK::serialize):
        * bindings/js/JSCryptoOperationData.cpp:
        (WebCore::cryptoOperationDataFromJSValue):
        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::upgradeElement):
        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::getCustomElementCallback):
        (WebCore::JSCustomElementRegistry::define):
        * bindings/js/JSDOMBinding.cpp:
        (WebCore::setDOMException):
        (WebCore::enforceRange):
        (WebCore::toSmallerInt):
        (WebCore::toSmallerUInt):
        (WebCore::canAccessDocument):
        (WebCore::throwTypeError):
        (WebCore::throwNotSupportedError):
        (WebCore::throwInvalidStateError):
        (WebCore::throwSecurityError):
        (WebCore::throwArgumentMustBeEnumError):
        (WebCore::throwArgumentMustBeFunctionError):
        (WebCore::throwArgumentTypeError):
        (WebCore::throwArrayElementTypeError):
        (WebCore::throwAttributeTypeError):
        (WebCore::throwConstructorScriptExecutionContextUnavailableError):
        (WebCore::throwSequenceTypeError):
        (WebCore::throwNonFiniteTypeError):
        (WebCore::throwGetterTypeError):
        (WebCore::throwSetterTypeError):
        (WebCore::throwThisTypeError):
        (WebCore::callThrowTypeError):
        * bindings/js/JSDOMBinding.h:
        (WebCore::toJSSequence):
        (WebCore::toRefPtrNativeArray):
        (WebCore::toNativeArray):
        * bindings/js/JSDOMConstructor.h:
        (WebCore::JSDOMConstructorNotConstructable::callThrowTypeError):
        (WebCore::JSBuiltinConstructor<JSClass>::callConstructor):
        * bindings/js/JSDOMConvert.h:
        (WebCore::convertWrapperType):
        * bindings/js/JSDOMIterator.h:
        (WebCore::iteratorCreate):
        (WebCore::iteratorForEach):
        (WebCore::JSDOMIteratorPrototype<JSWrapper>::next):
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
        (WebCore::JSDOMWindow::put):
        (WebCore::JSDOMWindow::showModalDialog):
        (WebCore::handlePostMessage):
        (WebCore::JSDOMWindow::setTimeout):
        (WebCore::JSDOMWindow::setInterval):
        * bindings/js/JSDataCueCustom.cpp:
        (WebCore::constructJSDataCue):
        * bindings/js/JSDictionary.cpp:
        (WebCore::JSDictionary::convertValue):
        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::JSDocument::createTouchList):
        (WebCore::JSDocument::getCSSCanvasContext):
        * bindings/js/JSFileCustom.cpp:
        (WebCore::constructJSFile):
        * bindings/js/JSHTMLAllCollectionCustom.cpp:
        (WebCore::JSHTMLAllCollection::item):
        * bindings/js/JSHTMLCanvasElementCustom.cpp:
        (WebCore::JSHTMLCanvasElement::getContext):
        (WebCore::JSHTMLCanvasElement::probablySupportsContext):
        * bindings/js/JSHTMLDocumentCustom.cpp:
        (WebCore::JSHTMLDocument::open):
        * bindings/js/JSHTMLElementCustom.cpp:
        (WebCore::constructJSHTMLElement):
        * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
        (WebCore::JSHTMLFormControlsCollection::namedItem):
        * bindings/js/JSHTMLInputElementCustom.cpp:
        (WebCore::JSHTMLInputElement::selectionStart):
        (WebCore::JSHTMLInputElement::setSelectionStart):
        (WebCore::JSHTMLInputElement::selectionEnd):
        (WebCore::JSHTMLInputElement::setSelectionEnd):
        (WebCore::JSHTMLInputElement::selectionDirection):
        (WebCore::JSHTMLInputElement::setSelectionDirection):
        (WebCore::JSHTMLInputElement::setSelectionRange):
        * bindings/js/JSHistoryCustom.cpp:
        (WebCore::JSHistory::pushState):
        (WebCore::JSHistory::replaceState):
        * bindings/js/JSIDBDatabaseCustom.cpp:
        (WebCore::JSIDBDatabase::createObjectStore):
        * bindings/js/JSImageConstructor.cpp:
        (WebCore::JSImageConstructor::construct):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::getOwnPropertySlotDelegate):
        * bindings/js/JSMediaDevicesCustom.cpp:
        (WebCore::JSMediaDevices::getUserMedia):
        * bindings/js/JSMediaStreamTrackCustom.cpp:
        (WebCore::JSMediaStreamTrack::getSettings):
        (WebCore::JSMediaStreamTrack::getCapabilities):
        * bindings/js/JSMessagePortCustom.cpp:
        (WebCore::fillMessagePortArray):
        * bindings/js/JSMessagePortCustom.h:
        (WebCore::handlePostMessage):
        * bindings/js/JSMockContentFilterSettingsCustom.cpp:
        (WebCore::JSMockContentFilterSettings::setDecisionPoint):
        (WebCore::toDecision):
        * bindings/js/JSModuleLoader.cpp:
        (WebCore::JSModuleLoader::evaluate):
        * bindings/js/JSMutationObserverCustom.cpp:
        (WebCore::constructJSMutationObserver):
        * bindings/js/JSNodeCustom.cpp:
        (WebCore::JSNode::insertBefore):
        (WebCore::JSNode::replaceChild):
        (WebCore::JSNode::removeChild):
        (WebCore::JSNode::appendChild):
        * bindings/js/JSNodeFilterCustom.cpp:
        (WebCore::JSNodeFilter::acceptNode):
        * bindings/js/JSPluginElementFunctions.cpp:
        (WebCore::pluginElementPropertyGetter):
        * bindings/js/JSReadableStreamPrivateConstructors.cpp:
        (WebCore::constructJSReadableStreamDefaultController):
        (WebCore::constructJSReadableStreamDefaultReader):
        * bindings/js/JSSVGLengthCustom.cpp:
        (WebCore::JSSVGLength::setValue):
        (WebCore::JSSVGLength::convertToSpecifiedUnits):
        * bindings/js/JSWebGL2RenderingContextCustom.cpp:
        (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
        * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
        (WebCore::getObjectParameter):
        (WebCore::JSWebGLRenderingContextBase::getAttachedShaders):
        (WebCore::JSWebGLRenderingContextBase::getExtension):
        (WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
        (WebCore::JSWebGLRenderingContextBase::getParameter):
        (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
        (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
        (WebCore::JSWebGLRenderingContextBase::getUniform):
        (WebCore::dataFunctionf):
        (WebCore::dataFunctioni):
        (WebCore::dataFunctionMatrix):
        * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
        (WebCore::cryptoKeyFormatFromJSValue):
        (WebCore::cryptoKeyUsagesFromJSValue):
        (WebCore::JSWebKitSubtleCrypto::encrypt):
        (WebCore::JSWebKitSubtleCrypto::decrypt):
        (WebCore::JSWebKitSubtleCrypto::sign):
        (WebCore::JSWebKitSubtleCrypto::verify):
        (WebCore::JSWebKitSubtleCrypto::digest):
        (WebCore::JSWebKitSubtleCrypto::generateKey):
        (WebCore::importKey):
        (WebCore::JSWebKitSubtleCrypto::importKey):
        (WebCore::exportKey):
        (WebCore::JSWebKitSubtleCrypto::exportKey):
        (WebCore::JSWebKitSubtleCrypto::wrapKey):
        (WebCore::JSWebKitSubtleCrypto::unwrapKey):
        * bindings/js/JSWorkerCustom.cpp:
        (WebCore::constructJSWorker):
        * bindings/js/JSWorkerGlobalScopeCustom.cpp:
        (WebCore::JSWorkerGlobalScope::setTimeout):
        (WebCore::JSWorkerGlobalScope::setInterval):
        * bindings/js/ReadableStreamDefaultController.cpp:
        (WebCore::ReadableStreamDefaultController::invoke):
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneBase::throwStackOverflow):
        (WebCore::CloneDeserializer::throwValidationError):
        (WebCore::SerializedScriptValue::maybeThrowExceptionIfSerializationFailed):
        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::evaluate):
        (WebCore::WorkerScriptController::setException):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateEnumerationImplementationContent):
        (GenerateDictionaryImplementationContent):
        (GenerateOverloadedFunctionOrConstructor):
        (GenerateImplementation):
        (GenerateFunctionCastedThis):
        (GenerateArgumentsCountCheck):
        (GenerateParametersCheck):
        (GenerateConstructorDefinition):
        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        (WebCore::jsInterfaceNameConstructor):
        (WebCore::setJSInterfaceNameConstructor):
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        (WebCore::jsTestActiveDOMObjectExcitingAttr):
        (WebCore::jsTestActiveDOMObjectConstructor):
        (WebCore::setJSTestActiveDOMObjectConstructor):
        (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
        (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
        (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
        (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
        (WebCore::jsTestCustomNamedGetterConstructor):
        (WebCore::setJSTestCustomNamedGetterConstructor):
        (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        (WebCore::JSTestEventConstructorConstructor::construct):
        (WebCore::jsTestEventConstructorAttr1):
        (WebCore::jsTestEventConstructorAttr2):
        (WebCore::jsTestEventConstructorAttr3):
        (WebCore::jsTestEventConstructorConstructor):
        (WebCore::setJSTestEventConstructorConstructor):
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        (WebCore::jsTestEventTargetConstructor):
        (WebCore::setJSTestEventTargetConstructor):
        (WebCore::jsTestEventTargetPrototypeFunctionItem):
        * bindings/scripts/test/JS/JSTestException.cpp:
        (WebCore::jsTestExceptionName):
        (WebCore::jsTestExceptionConstructor):
        (WebCore::setJSTestExceptionConstructor):
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        (WebCore::jsTestGenerateIsReachableConstructor):
        (WebCore::setJSTestGenerateIsReachableConstructor):
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        (WebCore::jsTestGlobalObjectRegularAttribute):
        (WebCore::jsTestGlobalObjectPublicAndPrivateAttribute):
        (WebCore::jsTestGlobalObjectPublicAndPrivateConditionalAttribute):
        (WebCore::jsTestGlobalObjectEnabledAtRuntimeAttribute):
        (WebCore::jsTestGlobalObjectConstructor):
        (WebCore::setJSTestGlobalObjectConstructor):
        (WebCore::setJSTestGlobalObjectRegularAttribute):
        (WebCore::setJSTestGlobalObjectPublicAndPrivateAttribute):
        (WebCore::setJSTestGlobalObjectPublicAndPrivateConditionalAttribute):
        (WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttribute):
        (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
        (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1):
        (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2):
        (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
        (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunction):
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        (WebCore::JSTestInterfaceConstructor::construct):
        (WebCore::jsTestInterfaceConstructorImplementsStaticReadOnlyAttr):
        (WebCore::jsTestInterfaceConstructorImplementsStaticAttr):
        (WebCore::jsTestInterfaceImplementsStr1):
        (WebCore::jsTestInterfaceImplementsStr2):
        (WebCore::jsTestInterfaceImplementsStr3):
        (WebCore::jsTestInterfaceImplementsNode):
        (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
        (WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
        (WebCore::jsTestInterfaceSupplementalStr1):
        (WebCore::jsTestInterfaceSupplementalStr2):
        (WebCore::jsTestInterfaceSupplementalStr3):
        (WebCore::jsTestInterfaceSupplementalNode):
        (WebCore::jsTestInterfaceConstructor):
        (WebCore::setJSTestInterfaceConstructor):
        (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
        (WebCore::setJSTestInterfaceImplementsStr2):
        (WebCore::setJSTestInterfaceImplementsStr3):
        (WebCore::setJSTestInterfaceImplementsNode):
        (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
        (WebCore::setJSTestInterfaceSupplementalStr2):
        (WebCore::setJSTestInterfaceSupplementalStr3):
        (WebCore::setJSTestInterfaceSupplementalNode):
        (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod1):
        (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
        (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod3):
        (WebCore::jsTestInterfaceConstructorFunctionImplementsMethod4):
        (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1):
        (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
        (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod3):
        (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4):
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        (WebCore::jsTestIterableConstructor):
        (WebCore::setJSTestIterableConstructor):
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom):
        (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom):
        (WebCore::jsTestJSBuiltinConstructorConstructor):
        (WebCore::setJSTestJSBuiltinConstructorConstructor):
        (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
        (WebCore::jsTestJSBuiltinConstructorPrototypeFunctionTestCustomFunction):
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        (WebCore::jsTestMediaQueryListListenerConstructor):
        (WebCore::setJSTestMediaQueryListListenerConstructor):
        (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        (WebCore::JSTestNamedConstructorNamedConstructor::construct):
        (WebCore::jsTestNamedConstructorConstructor):
        (WebCore::setJSTestNamedConstructorConstructor):
        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::JSTestNodeConstructor::construct):
        (WebCore::jsTestNodeName):
        (WebCore::jsTestNodeConstructor):
        (WebCore::setJSTestNodeConstructor):
        (WebCore::setJSTestNodeName):
        * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
        (WebCore::jsTestNondeterministicNondeterministicReadonlyAttr):
        (WebCore::jsTestNondeterministicNondeterministicWriteableAttr):
        (WebCore::jsTestNondeterministicNondeterministicExceptionAttr):
        (WebCore::jsTestNondeterministicNondeterministicGetterExceptionAttr):
        (WebCore::jsTestNondeterministicNondeterministicSetterExceptionAttr):
        (WebCore::jsTestNondeterministicConstructor):
        (WebCore::setJSTestNondeterministicConstructor):
        (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
        (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
        (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
        (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
        (WebCore::jsTestNondeterministicPrototypeFunctionNondeterministicZeroArgFunction):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::convert<TestObj::EnumType>):
        (WebCore::convert<TestObj::Optional>):
        (WebCore::convert<AlternateEnumName>):
        (WebCore::convert<TestObj::EnumA>):
        (WebCore::convert<TestObj::EnumB>):
        (WebCore::convert<TestObj::EnumC>):
        (WebCore::convert<TestObj::Kind>):
        (WebCore::convert<TestObj::Size>):
        (WebCore::convert<TestObj::Confidence>):
        (WebCore::convertDictionary<TestObj::Dictionary>):
        (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
        (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
        (WebCore::convertDictionary<AlternateDictionaryName>):
        (WebCore::JSTestObjConstructor::construct):
        (WebCore::jsTestObjReadOnlyLongAttr):
        (WebCore::jsTestObjReadOnlyStringAttr):
        (WebCore::jsTestObjReadOnlyTestObjAttr):
        (WebCore::jsTestObjConstructorStaticReadOnlyLongAttr):
        (WebCore::jsTestObjConstructorStaticStringAttr):
        (WebCore::jsTestObjConstructorTestSubObj):
        (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
        (WebCore::jsTestObjEnumAttr):
        (WebCore::jsTestObjByteAttr):
        (WebCore::jsTestObjOctetAttr):
        (WebCore::jsTestObjShortAttr):
        (WebCore::jsTestObjClampedShortAttr):
        (WebCore::jsTestObjEnforceRangeShortAttr):
        (WebCore::jsTestObjUnsignedShortAttr):
        (WebCore::jsTestObjLongAttr):
        (WebCore::jsTestObjLongLongAttr):
        (WebCore::jsTestObjUnsignedLongLongAttr):
        (WebCore::jsTestObjStringAttr):
        (WebCore::jsTestObjUsvstringAttr):
        (WebCore::jsTestObjTestObjAttr):
        (WebCore::jsTestObjTestNullableObjAttr):
        (WebCore::jsTestObjLenientTestObjAttr):
        (WebCore::jsTestObjUnforgeableAttr):
        (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString):
        (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString):
        (WebCore::jsTestObjImplementationEnumAttr):
        (WebCore::jsTestObjXMLObjAttr):
        (WebCore::jsTestObjCreate):
        (WebCore::jsTestObjReflectedStringAttr):
        (WebCore::jsTestObjReflectedUSVStringAttr):
        (WebCore::jsTestObjReflectedIntegralAttr):
        (WebCore::jsTestObjReflectedUnsignedIntegralAttr):
        (WebCore::jsTestObjReflectedBooleanAttr):
        (WebCore::jsTestObjReflectedURLAttr):
        (WebCore::jsTestObjReflectedUSVURLAttr):
        (WebCore::jsTestObjReflectedCustomIntegralAttr):
        (WebCore::jsTestObjReflectedCustomBooleanAttr):
        (WebCore::jsTestObjReflectedCustomURLAttr):
        (WebCore::jsTestObjEnabledAtRuntimeAttribute):
        (WebCore::jsTestObjTypedArrayAttr):
        (WebCore::jsTestObjAttrWithGetterException):
        (WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
        (WebCore::jsTestObjAttrWithSetterException):
        (WebCore::jsTestObjAttrWithSetterExceptionWithMessage):
        (WebCore::jsTestObjStringAttrWithGetterException):
        (WebCore::jsTestObjStringAttrWithSetterException):
        (WebCore::jsTestObjCustomAttr):
        (WebCore::jsTestObjOnfoo):
        (WebCore::jsTestObjOnwebkitfoo):
        (WebCore::jsTestObjWithScriptStateAttribute):
        (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute):
        (WebCore::jsTestObjWithScriptExecutionContextAttribute):
        (WebCore::jsTestObjWithScriptStateAttributeRaises):
        (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
        (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
        (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
        (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
        (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute):
        (WebCore::jsTestObjConditionalAttr1):
        (WebCore::jsTestObjConditionalAttr2):
        (WebCore::jsTestObjConditionalAttr3):
        (WebCore::jsTestObjConditionalAttr4Constructor):
        (WebCore::jsTestObjConditionalAttr5Constructor):
        (WebCore::jsTestObjConditionalAttr6Constructor):
        (WebCore::jsTestObjCachedAttribute1):
        (WebCore::jsTestObjCachedAttribute2):
        (WebCore::jsTestObjAnyAttribute):
        (WebCore::jsTestObjContentDocument):
        (WebCore::jsTestObjMutablePoint):
        (WebCore::jsTestObjImmutablePoint):
        (WebCore::jsTestObjStrawberry):
        (WebCore::jsTestObjDescription):
        (WebCore::jsTestObjId):
        (WebCore::jsTestObjHash):
        (WebCore::jsTestObjReplaceableAttribute):
        (WebCore::jsTestObjNullableDoubleAttribute):
        (WebCore::jsTestObjNullableLongAttribute):
        (WebCore::jsTestObjNullableBooleanAttribute):
        (WebCore::jsTestObjNullableStringAttribute):
        (WebCore::jsTestObjNullableLongSettableAttribute):
        (WebCore::jsTestObjNullableStringSettableAttribute):
        (WebCore::jsTestObjNullableUSVStringSettableAttribute):
        (WebCore::jsTestObjNullableStringValue):
        (WebCore::jsTestObjAttribute):
        (WebCore::jsTestObjAttributeWithReservedEnumType):
        (WebCore::jsTestObjPutForwardsAttribute):
        (WebCore::jsTestObjPutForwardsNullableAttribute):
        (WebCore::jsTestObjStringifierAttribute):
        (WebCore::jsTestObjConstructor):
        (WebCore::setJSTestObjConstructor):
        (WebCore::setJSTestObjConstructorStaticStringAttr):
        (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
        (WebCore::setJSTestObjEnumAttr):
        (WebCore::setJSTestObjByteAttr):
        (WebCore::setJSTestObjOctetAttr):
        (WebCore::setJSTestObjShortAttr):
        (WebCore::setJSTestObjClampedShortAttr):
        (WebCore::setJSTestObjEnforceRangeShortAttr):
        (WebCore::setJSTestObjUnsignedShortAttr):
        (WebCore::setJSTestObjLongAttr):
        (WebCore::setJSTestObjLongLongAttr):
        (WebCore::setJSTestObjUnsignedLongLongAttr):
        (WebCore::setJSTestObjStringAttr):
        (WebCore::setJSTestObjUsvstringAttr):
        (WebCore::setJSTestObjTestObjAttr):
        (WebCore::setJSTestObjTestNullableObjAttr):
        (WebCore::setJSTestObjLenientTestObjAttr):
        (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
        (WebCore::setJSTestObjUsvstringAttrTreatingNullAsEmptyString):
        (WebCore::setJSTestObjImplementationEnumAttr):
        (WebCore::setJSTestObjXMLObjAttr):
        (WebCore::setJSTestObjCreate):
        (WebCore::setJSTestObjReflectedStringAttr):
        (WebCore::setJSTestObjReflectedUSVStringAttr):
        (WebCore::setJSTestObjReflectedIntegralAttr):
        (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
        (WebCore::setJSTestObjReflectedBooleanAttr):
        (WebCore::setJSTestObjReflectedURLAttr):
        (WebCore::setJSTestObjReflectedUSVURLAttr):
        (WebCore::setJSTestObjReflectedCustomIntegralAttr):
        (WebCore::setJSTestObjReflectedCustomBooleanAttr):
        (WebCore::setJSTestObjReflectedCustomURLAttr):
        (WebCore::setJSTestObjEnabledAtRuntimeAttribute):
        (WebCore::setJSTestObjTypedArrayAttr):
        (WebCore::setJSTestObjAttrWithGetterException):
        (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
        (WebCore::setJSTestObjAttrWithSetterException):
        (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
        (WebCore::setJSTestObjStringAttrWithGetterException):
        (WebCore::setJSTestObjStringAttrWithSetterException):
        (WebCore::setJSTestObjCustomAttr):
        (WebCore::setJSTestObjOnfoo):
        (WebCore::setJSTestObjOnwebkitfoo):
        (WebCore::setJSTestObjWithScriptStateAttribute):
        (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute):
        (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
        (WebCore::setJSTestObjWithScriptStateAttributeRaises):
        (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
        (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
        (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
        (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
        (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
        (WebCore::setJSTestObjConditionalAttr1):
        (WebCore::setJSTestObjConditionalAttr2):
        (WebCore::setJSTestObjConditionalAttr3):
        (WebCore::setJSTestObjConditionalAttr4Constructor):
        (WebCore::setJSTestObjConditionalAttr5Constructor):
        (WebCore::setJSTestObjConditionalAttr6Constructor):
        (WebCore::setJSTestObjAnyAttribute):
        (WebCore::setJSTestObjMutablePoint):
        (WebCore::setJSTestObjImmutablePoint):
        (WebCore::setJSTestObjStrawberry):
        (WebCore::setJSTestObjId):
        (WebCore::setJSTestObjReplaceableAttribute):
        (WebCore::setJSTestObjNullableLongSettableAttribute):
        (WebCore::setJSTestObjNullableStringSettableAttribute):
        (WebCore::setJSTestObjNullableUSVStringSettableAttribute):
        (WebCore::setJSTestObjNullableStringValue):
        (WebCore::setJSTestObjAttributeWithReservedEnumType):
        (WebCore::setJSTestObjPutForwardsAttribute):
        (WebCore::setJSTestObjPutForwardsNullableAttribute):
        (WebCore::setJSTestObjStringifierAttribute):
        (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
        (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
        (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
        (WebCore::jsTestObjPrototypeFunctionVoidMethod):
        (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionByteMethod):
        (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionOctetMethod):
        (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionLongMethod):
        (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionObjMethod):
        (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
        (WebCore::jsTestObjInstanceFunctionUnforgeableMethod):
        (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
        (WebCore::jsTestObjPrototypeFunctionNullableStringMethod):
        (WebCore::jsTestObjConstructorFunctionNullableStringStaticMethod):
        (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
        (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue):
        (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
        (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString):
        (WebCore::jsTestObjPrototypeFunctionSerializedValue):
        (WebCore::jsTestObjPrototypeFunctionOptionsObject):
        (WebCore::jsTestObjPrototypeFunctionMethodWithException):
        (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
        (WebCore::jsTestObjPrototypeFunctionCustomMethod):
        (WebCore::jsTestObjPrototypeFunctionCustomMethodWithArgs):
        (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
        (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod):
        (WebCore::jsTestObjPrototypeFunctionAddEventListener):
        (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
        (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoid):
        (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj):
        (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidException):
        (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
        (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
        (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
        (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
        (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
        (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack):
        (WebCore::jsTestObjPrototypeFunctionWithDocumentArgument):
        (WebCore::jsTestObjPrototypeFunctionWithCallerDocumentArgument):
        (WebCore::jsTestObjPrototypeFunctionWithCallerWindowArgument):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringAndDefaultValue):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNull):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyString):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLong):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZero):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLong):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZero):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAny):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapper):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperIsNull):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
        (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
        (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionAndOptionalArg):
        (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArg):
        (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg):
        (WebCore::jsTestObjPrototypeFunctionConditionalMethod1):
        (WebCore::jsTestObjPrototypeFunctionConditionalMethod2):
        (WebCore::jsTestObjPrototypeFunctionConditionalMethod3):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
        (WebCore::jsTestObjConstructorFunctionClassMethod):
        (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
        (WebCore::jsTestObjConstructorFunctionClassMethod2):
        (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
        (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
        (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
        (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
        (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
        (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
        (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
        (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
        (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
        (WebCore::jsTestObjPrototypeFunctionGetElementById):
        (WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
        (WebCore::jsTestObjPrototypeFunctionConvert1):
        (WebCore::jsTestObjPrototypeFunctionConvert2):
        (WebCore::jsTestObjPrototypeFunctionConvert3):
        (WebCore::jsTestObjPrototypeFunctionConvert4):
        (WebCore::jsTestObjPrototypeFunctionMutablePointFunction):
        (WebCore::jsTestObjPrototypeFunctionImmutablePointFunction):
        (WebCore::jsTestObjPrototypeFunctionOrange):
        (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
        (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
        (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
        (WebCore::jsTestObjPrototypeFunctionAny):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
        (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
        (WebCore::jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack):
        (WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
        (WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
        (WebCore::jsTestObjPrototypeFunctionConditionalOverload):
        (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
        (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
        (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload):
        (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
        (WebCore::jsTestObjPrototypeFunctionToString):
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        (WebCore::constructJSTestOverloadedConstructors1):
        (WebCore::constructJSTestOverloadedConstructors2):
        (WebCore::constructJSTestOverloadedConstructors3):
        (WebCore::constructJSTestOverloadedConstructors4):
        (WebCore::constructJSTestOverloadedConstructors5):
        (WebCore::JSTestOverloadedConstructorsConstructor::construct):
        (WebCore::jsTestOverloadedConstructorsConstructor):
        (WebCore::setJSTestOverloadedConstructorsConstructor):
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
        (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
        (WebCore::JSTestOverloadedConstructorsWithSequenceConstructor::construct):
        (WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
        (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        (WebCore::jsTestOverrideBuiltinsConstructor):
        (WebCore::setJSTestOverrideBuiltinsConstructor):
        (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        (WebCore::jsTestSerializedScriptValueInterfaceValue):
        (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
        (WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
        (WebCore::jsTestSerializedScriptValueInterfacePorts):
        (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
        (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
        (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
        (WebCore::setJSTestSerializedScriptValueInterfaceValue):
        (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        (WebCore::JSTestTypedefsConstructor::construct):
        (WebCore::jsTestTypedefsUnsignedLongLongAttr):
        (WebCore::jsTestTypedefsImmutableSerializedScriptValue):
        (WebCore::jsTestTypedefsConstructorTestSubObj):
        (WebCore::jsTestTypedefsAttrWithGetterException):
        (WebCore::jsTestTypedefsAttrWithSetterException):
        (WebCore::jsTestTypedefsStringAttrWithGetterException):
        (WebCore::jsTestTypedefsStringAttrWithSetterException):
        (WebCore::jsTestTypedefsConstructor):
        (WebCore::setJSTestTypedefsConstructor):
        (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
        (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
        (WebCore::setJSTestTypedefsAttrWithGetterException):
        (WebCore::setJSTestTypedefsAttrWithSetterException):
        (WebCore::setJSTestTypedefsStringAttrWithGetterException):
        (WebCore::setJSTestTypedefsStringAttrWithSetterException):
        (WebCore::jsTestTypedefsPrototypeFunctionFunc):
        (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
        (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
        (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg):
        (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
        (WebCore::jsTestTypedefsPrototypeFunctionImmutablePointFunction):
        (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
        (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
        (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
        (WebCore::jsTestTypedefsPrototypeFunctionMethodWithException):
        * bindings/scripts/test/JS/JSattribute.cpp:
        (WebCore::jsattributeReadonly):
        (WebCore::jsattributeConstructor):
        (WebCore::setJSattributeConstructor):
        * bindings/scripts/test/JS/JSreadonly.cpp:
        (WebCore::jsreadonlyConstructor):
        (WebCore::setJSreadonlyConstructor):
        * bridge/c/c_instance.cpp:
        (JSC::Bindings::CInstance::moveGlobalExceptionToExecState):
        (JSC::Bindings::CInstance::invokeMethod):
        (JSC::Bindings::CInstance::invokeDefaultMethod):
        (JSC::Bindings::CInstance::invokeConstruct):
        (JSC::Bindings::CInstance::toJSPrimitive):
        * bridge/objc/objc_instance.mm:
        (ObjcInstance::moveGlobalExceptionToExecState):
        (ObjcInstance::invokeMethod):
        * bridge/objc/objc_runtime.mm:
        (JSC::Bindings::ObjcField::valueFromInstance):
        (JSC::Bindings::ObjcField::setValueToInstance):
        (JSC::Bindings::ObjcArray::setValueAt):
        (JSC::Bindings::ObjcArray::valueAt):
        (JSC::Bindings::callObjCFallbackObject):
        * bridge/objc/objc_utility.h:
        * bridge/objc/objc_utility.mm:
        (JSC::Bindings::throwError):
        * bridge/runtime_array.cpp:
        (JSC::RuntimeArray::lengthGetter):
        (JSC::RuntimeArray::put):
        (JSC::RuntimeArray::putByIndex):
        * bridge/runtime_method.cpp:
        (JSC::RuntimeMethod::lengthGetter):
        (JSC::callRuntimeMethod):
        * bridge/runtime_object.cpp:
        (JSC::Bindings::RuntimeObject::fallbackObjectGetter):
        (JSC::Bindings::RuntimeObject::fieldGetter):
        (JSC::Bindings::RuntimeObject::methodGetter):
        (JSC::Bindings::RuntimeObject::getOwnPropertySlot):
        (JSC::Bindings::RuntimeObject::put):
        (JSC::Bindings::RuntimeObject::defaultValue):
        (JSC::Bindings::RuntimeObject::getOwnPropertyNames):
        (JSC::Bindings::RuntimeObject::throwInvalidAccessError):
        * bridge/runtime_object.h:

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

        Use of uninitialised memory in TransformationMatrx::blend4()
        https://bugs.webkit.org/show_bug.cgi?id=134621
        <rdar://problem/27337539>

        Reviewed by Dean Jackson.

        Change is based on the Blink change (patch by <alancutter@chromium.org>):
        <https://src.chromium.org/viewvc/blink?revision=177453&view=revision>

        TransformationMatrix::blend() was attempting to blend between non-invertable
        matricies. This resulted in garbage stack variables being used.
        This patch ensures that blend() will fall back to a 50% step interpolation
        when one of the sides are not invertable.

        Tested by new TransformationMatrix test in TestWebKitAPI.

        * platform/graphics/transforms/TransformationMatrix.cpp:
        (WebCore::TransformationMatrix::blend2): Properly handle failure in the
        decompose method calls.
        (WebCore::TransformationMatrix::blend4): Ditto.

2016-08-30  Alex Christensen  <achristensen@webkit.org>

        URLParser should handle relative URLs that start with //
        https://bugs.webkit.org/show_bug.cgi?id=161364

        Reviewed by Darin Adler.

        Covered by an API test.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):

2016-08-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        Fix a typo introduced in r205184.
        https://bugs.webkit.org/show_bug.cgi?id=161380

        Reviewed by Tim Horton.

        Fixes a typo in an accessibility string: "Exit fullscreen" => "Exit Fullscreen"

        * platform/LocalizedStrings.cpp:
        (WebCore::exitFullScreenButtonAccessibilityTitle):

2016-08-30  Youenn Fablet  <youenn@apple.com>

        [Fetch API] Blob not found URL should result in a network error
        https://bugs.webkit.org/show_bug.cgi?id=161381

        Reviewed by Sam Weinig.

        Covered by rebased and updated tests.

        Raising a network error if no blob can be found from the URL.
        It is no longer notified by a 404 response.

        Updated FileReaderLoader to generate the correct exception.

        Made some clean-up in the code, in particular adding an enum class for BlobResourceHandle errors.

        * fileapi/FileReaderLoader.cpp:
        (WebCore::FileReaderLoader::didFail):
        (WebCore::FileReaderLoader::toErrorCode):
        (WebCore::FileReaderLoader::httpStatusCodeToErrorCode):
        * fileapi/FileReaderLoader.h:
        * platform/network/BlobResourceHandle.cpp:
        (WebCore::BlobResourceHandle::loadResourceSynchronously):
        (WebCore::BlobResourceHandle::doStart):
        (WebCore::BlobResourceHandle::didGetSize):
        (WebCore::BlobResourceHandle::readSync):
        (WebCore::BlobResourceHandle::readFileSync):
        (WebCore::BlobResourceHandle::readAsync):
        (WebCore::BlobResourceHandle::didOpen):
        (WebCore::BlobResourceHandle::didRead):
        (WebCore::BlobResourceHandle::failed):
        (WebCore::BlobResourceHandle::notifyResponse):
        (WebCore::BlobResourceHandle::notifyResponseOnError):
        (WebCore::BlobResourceHandle::notifyFail):
        * platform/network/BlobResourceHandle.h:

2016-08-30  Youenn Fablet  <youenn@apple.com>

        [Fetch API] Body mix-in text() should decode data as UTF-8
        https://bugs.webkit.org/show_bug.cgi?id=161372

        Reviewed by Sam Weinig.

        Test: imported/w3c/web-platform-tests/fetch/api/basic/text-utf8.html

        UsingTextResourceDecoder to decode data as UTF-8.
        Making sure to prepend BOM if there is none, as specified in https://encoding.spec.whatwg.org/#utf-8-decode.

        * Modules/fetch/FetchBodyConsumer.cpp:
        (WebCore::shouldPrependBOM):
        (WebCore::textFromUTF8):
        (WebCore::FetchBodyConsumer::resolveWithData):
        (WebCore::FetchBodyConsumer::takeAsText):

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

        ASSERTION FAILED: opportunitiesInRun <= expansionOpportunityCount in WebCore::computeExpansionForJustifiedText
        https://bugs.webkit.org/show_bug.cgi?id=139393
        <rdar://problem/27704243>

        Reviewed by Myles C. Maxfield.

        This patch ensures that we always remove a valid 'after expansion' opportunity (even when the last entry
        in the opportunities list is 0).

        Test: fast/text/assert-on-expansion-opportunity.html

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

2016-08-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        Exit fullscreen button in fullscreen media playback needs an accessibility string
        https://bugs.webkit.org/show_bug.cgi?id=161380

        Reviewed by Beth Dakin.

        Adds an accessibility string for the exit fullscreen button.

        * English.lproj/Localizable.strings:
        * platform/LocalizedStrings.cpp:
        (WebCore::exitFullScreenButtonAccessibilityTitle):
        * platform/LocalizedStrings.h:

2016-08-30  Antti Koivisto  <antti@apple.com>

        Remove StylePendingImage
        https://bugs.webkit.org/show_bug.cgi?id=161245

        Reviewed by Andreas Kling.

        Instances of this confusing type are used as placeholders during style resolution.
        We can get rid of it and make "pending" a state of StyleImage. This simplies the code and
        will allow further improvements.

        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSCrossfadeValue.cpp:
        (WebCore::CSSCrossfadeValue::isPending):
        (WebCore::CSSCrossfadeValue::blend):
        * css/CSSCrossfadeValue.h:
        * css/CSSCursorImageValue.cpp:
        (WebCore::CSSCursorImageValue::CSSCursorImageValue):
        (WebCore::CSSCursorImageValue::~CSSCursorImageValue):

            Save the original URL since the underlying CSSImageValue may change.

        (WebCore::CSSCursorImageValue::updateCursorElement):
        (WebCore::CSSCursorImageValue::cursorElementRemoved):
        (WebCore::CSSCursorImageValue::cursorElementChanged):
        (WebCore::CSSCursorImageValue::loadImage):
        (WebCore::CSSCursorImageValue::styleImage):
        (WebCore::CSSCursorImageValue::isSVGCursor):
        (WebCore::CSSCursorImageValue::cachedImageURL):
        (WebCore::CSSCursorImageValue::updateCachedImage):
        (WebCore::CSSCursorImageValue::detachPendingImage): Deleted.
        (WebCore::CSSCursorImageValue::cachedImage): Deleted.
        (WebCore::CSSCursorImageValue::cachedOrPendingImage): Deleted.
        (WebCore::CSSCursorImageValue::clearCachedImage): Deleted.
        * css/CSSCursorImageValue.h:
        * css/CSSFilterImageValue.cpp:
        (WebCore::CSSFilterImageValue::isPending):
        * css/CSSFilterImageValue.h:
        * css/CSSImageGeneratorValue.cpp:
        (WebCore::CSSImageGeneratorValue::isPending):
        (WebCore::CSSImageGeneratorValue::subimageIsPending):
        (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
        * css/CSSImageGeneratorValue.h:
        * css/CSSImageSetValue.cpp:
        (WebCore::CSSImageSetValue::~CSSImageSetValue):
        (WebCore::CSSImageSetValue::loadBestFitImage):
        (WebCore::CSSImageSetValue::styleImage):
        (WebCore::CSSImageSetValue::traverseSubresources):
        (WebCore::CSSImageSetValue::detachPendingImage): Deleted.
        (WebCore::CSSImageSetValue::bestFitImage): Deleted.
        (WebCore::CSSImageSetValue::cachedOrPendingImageSet): Deleted.
        * css/CSSImageSetValue.h:
        * css/CSSImageValue.cpp:
        (WebCore::CSSImageValue::CSSImageValue):
        (WebCore::CSSImageValue::~CSSImageValue):
        (WebCore::CSSImageValue::isPending):
        (WebCore::CSSImageValue::styleImage):
        (WebCore::CSSImageValue::loadImage):
        (WebCore::CSSImageValue::traverseSubresources):
        (WebCore::CSSImageValue::detachPendingImage): Deleted.
        (WebCore::CSSImageValue::cachedOrPendingImage): Deleted.
        (WebCore::CSSImageValue::cachedImage): Deleted.
        * css/CSSImageValue.h:
        (WebCore::CSSImageValue::create):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::cachedOrPendingFromValue):
        (WebCore::StyleResolver::generatedOrPendingFromValue):
        (WebCore::StyleResolver::setOrPendingFromValue):
        (WebCore::StyleResolver::cursorOrPendingFromValue):
        * page/PageSerializer.cpp:
        (WebCore::PageSerializer::retrieveResourcesForProperties):
        * page/animation/CSSPropertyAnimation.cpp:
        (WebCore::blendFilter):
        (WebCore::crossfadeBlend):
        * rendering/RenderImageResourceStyleImage.cpp:
        (WebCore::RenderImageResourceStyleImage::image):
        * rendering/shapes/ShapeOutsideInfo.cpp:
        (WebCore::ShapeOutsideInfo::createShapeForImage):
        * rendering/style/StyleCachedImage.cpp:
        (WebCore::StyleCachedImage::StyleCachedImage):
        (WebCore::StyleCachedImage::~StyleCachedImage):
        (WebCore::StyleCachedImage::setCachedImage):
        (WebCore::StyleCachedImage::cssValue):
        (WebCore::StyleCachedImage::canRender):
        (WebCore::StyleCachedImage::isPending):
        (WebCore::StyleCachedImage::isLoaded):
        (WebCore::StyleCachedImage::errorOccurred):
        (WebCore::StyleCachedImage::imageSize):
        (WebCore::StyleCachedImage::imageHasRelativeWidth):
        (WebCore::StyleCachedImage::imageHasRelativeHeight):
        (WebCore::StyleCachedImage::computeIntrinsicDimensions):
        (WebCore::StyleCachedImage::usesImageContainerSize):
        (WebCore::StyleCachedImage::setContainerSizeForRenderer):
        (WebCore::StyleCachedImage::addClient):
        (WebCore::StyleCachedImage::removeClient):
        (WebCore::StyleCachedImage::image):
        (WebCore::StyleCachedImage::knownToBeOpaque):
        * rendering/style/StyleCachedImage.h:
        * rendering/style/StyleGeneratedImage.cpp:
        (WebCore::StyleGeneratedImage::isPending):
        * rendering/style/StyleGeneratedImage.h:
        * rendering/style/StyleImage.h:
        (WebCore::StyleImage::isCachedImage):
        (WebCore::StyleImage::StyleImage):
        (WebCore::StyleImage::canRender): Deleted.
        (WebCore::StyleImage::isPendingImage): Deleted.
        * rendering/style/StylePendingImage.h: Removed.
        * style/StylePendingResources.cpp:
        (WebCore::Style::loadPendingImage):
        (WebCore::Style::loadPendingImages):

2016-08-30  Philippe Normand  <pnormand@igalia.com>

        [GStreamer] bump required version to 1.2.3
        https://bugs.webkit.org/show_bug.cgi?id=159667

        Reviewed by Xabier Rodriguez Calvar.

        GStreamer 1.0.3 was released almost 4 years ago. GStreamer 1.2.3
        being the version shipped in the Ubuntu LTS (14.04) it
        feels reasonable to bump our requirement. Other major
        distributions like Debian Jessie and Fedora ship GStreamer 1.4.x
        already.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Deleted.
        * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
        (webkitVideoSinkProposeAllocation): Deleted.
        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (webKitWebSrcQueryWithParent): Deleted.

2016-08-29  Alex Christensen  <achristensen@webkit.org>

        Fix Windows build after r205161

        * bindings/js/JSPerformanceTimingCustom.cpp:

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

        We should throw a SecurityError when denying setting a cross-origin Location property
        https://bugs.webkit.org/show_bug.cgi?id=161368

        Reviewed by Ryosuke Niwa.

        We should throw a SecurityError when denying setting a cross-origin
        Location property:
        - https://html.spec.whatwg.org/#location-set
        - https://html.spec.whatwg.org/#crossoriginset-(-o,-p,-v,-receiver-)
        - https://html.spec.whatwg.org/#location-getownproperty

        Firefox and Chrome already throw. We currently ignore and log an error
        message.

        No new tests, updated existing tests.

        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::putDelegate):

2016-08-29  Brent Fulgham  <bfulgham@apple.com>

        Avoid holding GlyphData in MathOperator
        https://bugs.webkit.org/show_bug.cgi?id=161256
        <rdar://problem/28033400>

        Reviewed by Myles C. Maxfield.

        Do not cache GlyphData in MathOperator elements, because the fonts referenced in the
        GlyphData may be purged during low-memory conditions. Instead, we should store either
        the relevant CodePoint, or the fallback Glyph (for the current system font).

        Added an initialization function for GlyphAssemblyData, since unions containing structs
        do not properly call constructors, resulting in garbage font/glyph content.

        No new tests. Changes are covered by existing MathML test suite.

        * rendering/mathml/MathOperator.cpp:
        (WebCore::MathOperator::GlyphAssemblyData::initialize): Added.
        (WebCore::MathOperator::MathOperator): Initialize m_assembly/m_variant.
        (WebCore::MathOperator::setSizeVariant): Only store the glyph, not the font.
        (WebCore::glyphDataForCodePointOrFallbackGlyph): Added helper function.
        (WebCore::MathOperator::setGlyphAssembly): Do not rely on stored GlyphData.
        (WebCore::MathOperator::calculateGlyphAssemblyFallback): Remove unneeded argument. Check
        if a fallback glyph is being used and remember for later.
        (WebCore::MathOperator::calculateStretchyData): Do not rely on stored GlyphData.
        (WebCore::MathOperator::fillWithVerticalExtensionGlyph): Ditto.
        (WebCore::MathOperator::fillWithHorizontalExtensionGlyph): Ditto.
        (WebCore::MathOperator::paintVerticalGlyphAssembly): Ditto.
        (WebCore::MathOperator::paintHorizontalGlyphAssembly): Ditto.
        (WebCore::MathOperator::paint): Ditto.
        * rendering/mathml/MathOperator.h:
        (WebCore::MathOperator::GlyphAssemblyData::hasExtension): Added.
        (WebCore::MathOperator::GlyphAssemblyData::hasMiddle): Added.
        (WebCore::MathOperator::MathOperator): Deleted.

2016-08-29  Dean Jackson  <dino@apple.com>

        JSON.stringify returns empty when used with performance.timing.
        https://bugs.webkit.org/show_bug.cgi?id=151813
        <rdar://problem/28066067>

        Reviewed by Sam Weinig.

        While we are waiting for our bindings generator to handle
        "serializer", add a custom toJSON function that allows
        performance.timing to be stringified.

        Test: fast/dom/webtiming-performance-timing-stringify.html

        * CMakeLists.txt: New file added.
        * WebCore.xcodeproj/project.pbxproj: New file added.
        * bindings/js/JSPerformanceTimingCustom.cpp: Added. Implements toJSON.
        (WebCore::JSPerformanceTiming::toJSON):
        * page/PerformanceTiming.idl: Add toJSON().

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

        Regression(r204923): It should be possible to set 'Location.href' cross origin
        https://bugs.webkit.org/show_bug.cgi?id=161343
        <rdar://problem/28063361>

        Reviewed by Ryosuke Niwa.

        It should be possible to set 'Location.href' cross origin:
        - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)

        Firefox and Chrome allow this but we throw a SecurityError.

        We already allow setting crossOrigin.window.location which is equivalent.

        No new tests, updated existing test.

        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::putDelegate):
        Refactor the [Put] delegate so that it does not log a security error
        when setting 'href' attribute, given that setting it works as expected.
        This fixes a bug in shipping Safari where setting 'href' would work but
        log an error message anyway.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):
        Add support for [DoNotCheckSecurityOnSetter] IDL extended attribute,
        in addition to the already supported [DoNotCheckSecurity] and
        [DoNotCheckSecurityOnGetter].

        * page/Location.idl:
        Use [DoNotCheckSecurityOnSetter] on 'href' attribute as it can be
        set cross-origin. This fixes the regression introduced in r204923.

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

        We should throw a SecurityError when denying setting a cross-origin Window property
        https://bugs.webkit.org/show_bug.cgi?id=161339

        Reviewed by Geoffrey Garen.

        We should throw a SecurityError when denying setting a cross-origin Window property:
        - https://html.spec.whatwg.org/#crossoriginset-(-o,-p,-v,-receiver-)
        - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)

        e.g. crossOriginWindow.name = "" should throw.

        Firefox and Chrome already throw but WebKit merely ignores the call and logs an
        error message.

        No new tests, updated existing tests.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::put):

2016-08-29  Alex Christensen  <achristensen@webkit.org>

        URLParser should parse about:blank
        https://bugs.webkit.org/show_bug.cgi?id=161324

        Reviewed by Brady Eidson.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):

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

        document.createEvent("popstateevent") should create a PopStateEvent
        https://bugs.webkit.org/show_bug.cgi?id=161321

        Reviewed by Darin Adler.

        document.createEvent("popstateevent") should create a PopStateEvent as per:
        - https://dom.spec.whatwg.org/#dom-document-createevent

        Firefox and Chrome match the specification but WebKit throws an exception,
        which is risky compatibility-wise.

        No new tests, rebaselined existing tests.

        * dom/Document.cpp:
        (WebCore::Document::createEvent):
        * dom/PopStateEvent.cpp:
        (WebCore::PopStateEvent::createForBindings):
        * dom/PopStateEvent.h:

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

        We should throw a SecurityError when denying access to cross-origin Window properties
        https://bugs.webkit.org/show_bug.cgi?id=161316

        Reviewed by Darin Adler.

        We should throw a SecurityError when denying access to cross-origin Window properties:
        - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
        - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)

        Firefox and Chrome already throw.

        No new tests, updated existing tests.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):

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

        Image Loader should use FetchOptions::mode according its crossOrigin attribute
        https://bugs.webkit.org/show_bug.cgi?id=161309

        Reviewed by Darin Adler.

        Test: http/tests/security/load-image-after-redirection.html

        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::updateFromElement): Using CachedResourceRequest::setAsPotentiallyCrossOrigin to set fetch mode.

2016-08-29  Frederic Wang  <fwang@igalia.com>

        Use MathMLPresentationElement for all MathML presentation tags
        https://bugs.webkit.org/show_bug.cgi?id=161297

        Reviewed by Darin Adler.

        Some tabular MathML elements as well as unsupported presentation MathML markup currently
        create a generic MathMLElement instance. We make them instead use the
        MathMLPresentationElement class since they are presentation MathML elements. This also
        allows to make MathMLElement::isPresentationMathML always return false.

        No new tests, already covered by existing tests.

        * mathml/MathMLElement.cpp:
        (WebCore::MathMLElement::isPresentationMathML): Deleted. Moved into the header file.
        * mathml/MathMLElement.h:
        (WebCore::MathMLElement::isPresentationMathML): Make this always return false now that all
        presentation markup are handled by MathMLPresentationElement.
        * mathml/MathMLPresentationElement.cpp:
        (WebCore::MathMLPresentationElement::createElementRenderer): Make the fallback always call
        MathMLElement::createElementRenderer. This preserves the behavior for the new elements
        handled here and does not affect the old ones (table is handled above while all the others
        are already handled in the derived class).
        * mathml/mathtags.in: Use MathMLPresentationElement for all MathML presentation tags.

2016-08-29  Alex Christensen  <achristensen@webkit.org>

        API test URLParserTest.ParserFailures failing ASSERT_NOT_REACHED
        https://bugs.webkit.org/show_bug.cgi?id=161317

        Reviewed by Brady Eidson.

        Added an API test.

        * platform/URLParser.cpp:
        (WebCore::URLParser::parse):
        Turns out, this state can be reached.

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

        [Fetch API] Response cloning should structureClone when teeing Response stream
        https://bugs.webkit.org/show_bug.cgi?id=161147

        Reviewed by Darin Adler.

        Covered by updated test.

        Implementing structure cloning for ArrayBuffer and ArrayBufferView objects.
        Using this structure cloning in ReadableStream to support structureClone in the case of Fetch API.

        * CMakeLists.txt: Adding StructureClone.cpp
        * Modules/fetch/FetchResponse.js:
        (clone): Setting structureClone to true
        * Modules/streams/ReadableStreamInternals.js:
        (doStructuredClone): Added to clone ArrayBuffer/ArrayBufferView chunks. Throwing exception otherwise.
        (teeReadableStreamPullFunction): Using @doStructuredClone
        * WebCore.xcodeproj/project.pbxproj: Adding StructureClone.cpp/.h
        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Adding @ArrayBuffer and structuredCloneArrayBuffer and structuredCloneArrayBufferView private properties.
        * bindings/js/StructuredClone.cpp: Added.
        (WebCore::structuredCloneArrayBuffer): Cloning of ArrayBuffer as per
        http://w3c.github.io/html/infrastructure.html#section-structuredclone step 11.
       (WebCore::structuredCloneArrayBufferView): Cloning of ArrayBufferView as
       perhttp://w3c.github.io/html/infrastructure.html#section-structuredclone, step 12.
        * bindings/js/StructuredClone.h: Added.
        * bindings/js/WebCoreBuiltinNames.h: 

2016-08-16  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Accelerated compositing does not work in Wayland
        https://bugs.webkit.org/show_bug.cgi?id=115803

        Reviewed by Michael Catanzaro.

        The Wayland implementation in WebKit2 uses a nested display running in the UI process so that GL contexts created
        in the web process need to be created in the nested display. We currently have a shared platform display that
        should represent the connection to the actual display all applications connect to. This patch refactors the
        GLContext API to ensure that GL contexts are always attached to a particular platform display. The create
        methods receive an optional PlatformDisplay that will be used as the display of all GL operations of the created
        GL context. The sharing GL context should also share the same display, it can't be global to the process, but to
        the display, so it's now created on demand by the PlatformDisplay. In addition to the global shared display,
        it's now possible to set a shared display for compositing that can be used when creating GL contexts. This makes
        it possible to use a different display for compositing, connected to the nested display in wayland, even in non
        wayland environments.
        The patch also adds support for surfaceless EGL contexts that can be used for offscreen contexts. It also adds
        support for offscreen wayland contexts, as a fallback in wayland in case surfaceless is not supported.
        Some wayland code that is specific to the WebKit2 implementation has been moved to the WebKit2 layer.

        * PlatformGTK.cmake:
        * platform/graphics/GLContext.cpp:
        (WebCore::initializeOpenGLShimsIfNeeded):
        (WebCore::GLContext::createContextForWindow):
        (WebCore::GLContext::createOffscreenContext):
        (WebCore::GLContext::createSharingContext):
        (WebCore::GLContext::GLContext):
        (WebCore::GLContext::~GLContext):
        (WebCore::GLContext::current):
        (WebCore::activeContextList): Deleted.
        * platform/graphics/GLContext.h:
        (WebCore::GLContext::display):
        * platform/graphics/GraphicsContext3DPrivate.cpp:
        (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
        (WebCore::GraphicsContext3DPrivate::platformContext):
        (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
        * platform/graphics/PlatformDisplay.cpp:
        (WebCore::PlatformDisplay::createPlatformDisplay): Always use the default wayland display created by GTK+ for
        the global shared display.
        (WebCore::PlatformDisplay::sharedDisplayForCompositing):
        (WebCore::PlatformDisplay::setSharedDisplayForCompositing):
        (WebCore::PlatformDisplay::sharingGLContext):
        (WebCore::eglDisplays): Helper HashSet to keep track of all PlatformDisplays with an EGL display intialized to
        properly termimate them at exit.
        (WebCore::PlatformDisplay::initializeEGLDisplay): Remove eglBindAPI() from display initialization, since it's
        not a display initialization and it's thread specific, so it needs to be called on every thread where EGL is used.
        (WebCore::PlatformDisplay::terminateEGLDisplay):
        (WebCore::PlatformDisplay::eglDisplay): Deleted.
        * platform/graphics/PlatformDisplay.h:
        * platform/graphics/cairo/ImageBufferCairo.cpp:
        (WebCore::ImageBufferData::~ImageBufferData):
        (WebCore::ImageBufferData::createCompositorBuffer):
        (WebCore::ImageBufferData::swapBuffersIfNeeded):
        (WebCore::ImageBufferData::createCairoGLSurface):
        (WebCore::ImageBufferData::paintToTextureMapper):
        (WebCore::ImageBuffer::copyToPlatformTexture):
        * platform/graphics/egl/GLContextEGL.cpp:
        (WebCore::GLContextEGL::getEGLConfig):
        (WebCore::GLContextEGL::createWindowContext):
        (WebCore::GLContextEGL::createPbufferContext):
        (WebCore::GLContextEGL::createSurfacelessContext):
        (WebCore::GLContextEGL::createPixmapContext):
        (WebCore::GLContextEGL::createWaylandContext):
        (WebCore::GLContextEGL::createContext):
        (WebCore::GLContextEGL::createSharingContext):
        (WebCore::GLContextEGL::GLContextEGL):
        (WebCore::GLContextEGL::~GLContextEGL):
        (WebCore::GLContextEGL::defaultFrameBufferSize):
        (WebCore::GLContextEGL::makeContextCurrent):
        (WebCore::GLContextEGL::swapBuffers):
        (WebCore::GLContextEGL::cairoDevice):
        * platform/graphics/egl/GLContextEGL.h:
        * platform/graphics/glx/GLContextGLX.cpp:
        (WebCore::GLContextGLX::createWindowContext):
        (WebCore::GLContextGLX::createPbufferContext):
        (WebCore::GLContextGLX::createPixmapContext):
        (WebCore::GLContextGLX::createContext):
        (WebCore::GLContextGLX::createSharingContext):
        (WebCore::GLContextGLX::GLContextGLX):
        (WebCore::GLContextGLX::~GLContextGLX):
        (WebCore::GLContextGLX::defaultFrameBufferSize):
        (WebCore::GLContextGLX::makeContextCurrent):
        (WebCore::GLContextGLX::swapBuffers):
        (WebCore::GLContextGLX::cairoDevice):
        (WebCore::GLContextGLX::waitNative): Deleted.
        * platform/graphics/glx/GLContextGLX.h:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
        (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
        * platform/graphics/wayland/PlatformDisplayWayland.cpp:
        (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
        (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):
        (WebCore::PlatformDisplayWayland::initialize):
        (WebCore::PlatformDisplayWayland::registryGlobal):
        (WebCore::PlatformDisplayWayland::createSurface):
        * platform/graphics/wayland/PlatformDisplayWayland.h:
        (WebCore::PlatformDisplayWayland::native): Deleted.
        * platform/graphics/wayland/WaylandEventSource.cpp: Removed.
        * platform/graphics/wayland/WaylandSurface.cpp: Removed.
        * platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml: Removed.
        * platform/graphics/wayland/WlUniquePtr.h: Make it possible to use std::unique_ptr with Wayland objects.
        (WebCore::WlPtrDeleter::operator()):

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

        [Fetch API] Add support for BufferSource bodies
        https://bugs.webkit.org/show_bug.cgi?id=161087

        Reviewed by Darin Adler.

        Covered by updated tests.

        Added support for ArrayBuffer, ArrayBufferView and FormData upload.
        Added support for consuming ArrayBufferView.

        To support FormData upload, FetchBOdy is now storing a FormData computed from the DOMFormData passed to the constructor.
        This allows setting the content-type for FormData correctly with the boundary parameter.

        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::bodyForInternalRequest): Adding support for FormData upload.
        (WebCore::FetchBody::FetchBody): Adding ArrayBuffer and ArrayBufferView constructors.
        (WebCore::FetchBody::extract): Extracting in case of BufferSource (i.e. ArrayBuffer or ArrayBufferView) and FormData.
        (WebCore::FetchBody::consume): Adding support to consume ArrayBufferView.
        (WebCore::FetchBody::consumeAsStream): Adding support to consume ArrayBufferView as a stream.
        Cloned the ArrayBuffer before enqueuing it in  the stream.
        (WebCore::FetchBody::consumeArrayBuffer): Cleaning m_data after being consumed.
        (WebCore::FetchBody::consumeArrayBufferView): Adding support to consume ArrayBufferView.
        (WebCore::FetchBody::consumeText): Cleaning m_text after being consumed.
        (WebCore::FetchBody::consumeBlob): Ditto for m_blob.
        (WebCore::FetchBody::bodyForInternalRequest): Adding support for ArrayBuffer and ArrayBufferView upload.
        * Modules/fetch/FetchBody.h:
        * Modules/fetch/FetchRequest.cpp:
        (WebCore::FetchRequest::internalRequest): Passing ScriptExecutionContext as this is needed for FormData upload.
        (WebCore::FetchRequest::setBody): Ditto.
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::initializeWith): Ditto.
        (WebCore::FetchResponse::fetch): Removing FormData upload rejection check.

2016-08-26  Sergio Villar Senin  <svillar@igalia.com>

        [css-grid] Do not recursively call layout during auto repeat computation
        https://bugs.webkit.org/show_bug.cgi?id=161234

        Reviewed by Manuel Rego Casasnovas.

        The computation of auto repeat tracks was incorrectly recursively triggering
        a layout in order to compute the available size. That was happening whenever
        the width was indefinite. In such cases we should treat the width always as
        indefinite without having to run any extra code. During the layout phase
        we'll have the actual width available.

        This fix also unveiled a few errors in one of the imported mozilla tests which were
        incorrectly passing when they should not.

        Test: fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash.html

        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::layoutBlock):
        (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
        (WebCore::RenderGrid::computeAutoRepeatTracksCount):
        (WebCore::RenderGrid::placeItemsOnGrid):
        * rendering/RenderGrid.h:

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

        data:// URL behavior of XHR does not match spec
        https://bugs.webkit.org/show_bug.cgi?id=109199

        Reviewed by Darin Adler.

        Covered by rebased tests.

        Making data URLs same origin for XHR and fetch API.
        This is the behavior when https://fetch.spec.whatwg.org/#same-origin-data-url-flag is set.
        As per the specs, this flag is set for fetch API and XMLHttpRequest.
        Introducing this flag in ThreadableLoader options, default value being false.
        Setting flag for XHR and fetch API.

        Fixing accuracy of data URL loading by setting status code and content-type HTTP header as per fetch specification.

        As can be seen from the rebased tests, no constraint is put on the method used as the fetch specification is about to allow all methods for data URLs.

        * Modules/fetch/FetchLoader.cpp:
        (WebCore::FetchLoader::start): Setting same-origin-data-url-flag to true.
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Making data URLs same origin if flag is set.
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::loadDataURL): Setting status code and content-type header according specification.
        * loader/ThreadableLoader.cpp:
        (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Adding same-origin-data-url-flag option.
        * loader/ThreadableLoader.h:
        * loader/WorkerThreadableLoader.cpp:
        (WebCore::LoaderTaskOptions::LoaderTaskOptions): Ensuring flag is preserved when going to the main thread.
        * platform/network/DataURLDecoder.cpp:
        (WebCore::DataURLDecoder::parseMediaType): Setting mediaType value, used by ResourceLoader to set the content-type header.
        * platform/network/DataURLDecoder.h:
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::createRequest): Setting same-origin-data-url-flag to true.

2016-08-25  Frederic Wang  <fwang@igalia.com>

        Add support for non-BMP operators U+1EEF0 and U+1EEF1
        https://bugs.webkit.org/show_bug.cgi?id=153984

        Reviewed by Darin Adler.

        Tests: mathml/presentation/non-bmp-operators-spacing.html
               mathml/presentation/non-bmp-operators-stretching.html

        * mathml/MathMLOperatorDictionary.cpp: We move the definition of operator dictionary Entry
        here as it is not used by external code.
        We now also accept non-BMP operators and add entries for U+1EEF0 and U+1EEF1.
        (WebCore::extractProperty): Helper function to convert from Entry structure to a Property
        structure.
        (WebCore::MathMLOperatorDictionary::search): This function now accepts a non-BMP parameter
        and returns a Property structure.
        (WebCore::MathMLOperatorDictionary::isVertical): This function now accepts a non-BMP parameter.
        * mathml/MathMLOperatorDictionary.h: Replace the Entry structure with a Property structure
        which was used by MathMLOperatorElement. Update the signatures of search and isVertical.
        * mathml/MathMLOperatorElement.cpp:
        (WebCore::MathMLOperatorElement::parseOperatorChar): Remove the special case that excludes
        non-BMP operators.
        (WebCore::MathMLOperatorElement::computeDictionaryProperty): Rename the property structure
        to use the one moved into MathMLOperatorDictionary.h. We no longer need to convert the result
        of the search call.
        (WebCore::MathMLOperatorElement::dictionaryProperty): Rename the property structure.
        * mathml/MathMLOperatorElement.h: Make OperatorChar accept non-BMP operators.
        MathMLOperatorElement::DictionaryProperty is now moved into MathMLOperatorDictionary
        and renamed Property.
        * rendering/mathml/MathOperator.cpp: Accept non-BMP operators.
        * rendering/mathml/MathOperator.h: Ditto.
        * rendering/mathml/RenderMathMLFencedOperator.cpp:
        (WebCore::RenderMathMLFencedOperator::updateOperatorContent):  Adjust code to use the new
        return type of MathMLOperatorDictionary::search.
        * rendering/mathml/RenderMathMLFencedOperator.h: Accept non-BMP operators.
        * rendering/mathml/RenderMathMLOperator.cpp: Ditto.
        * rendering/mathml/RenderMathMLOperator.h: Ditto.

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

        [Fetch API] Ensure response cloning works when data is loading
        https://bugs.webkit.org/show_bug.cgi?id=161137

        Reviewed by Darin Adler.

        Test: http/tests/fetch/clone-after-load-is-finished.html and updated wpt test

        FetchBody is only able to clone data when requested by Response in case the data is already there.
        If data is loaded from FetchLoader, each received chunk should be given to each cloned response.
        The simplest approach is to create a ReadableStream body for the cloned Response and use it for the teeing.

        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::BodyLoader::didSucceed): Postpone stream closing if there is still data to enqueue in the FetchBody.
        * Modules/fetch/FetchResponse.h:
        * Modules/fetch/FetchResponse.idl:
        * Modules/fetch/FetchResponse.js:
        (clone): If response is being loaded, create a ReadableStream body so that loaded data cloning is handled by ReadableStream tee.
        * Modules/streams/ReadableStreamInternals.js: Restrict firstReadCallback to the case of a readable ReadableStream.
        If stream is errored or closed, FetchResponse will already have disposed of its source.
        (readFromReadableStreamDefaultReader):
        * bindings/js/WebCoreBuiltinNames.h:

2016-08-28  Andreas Kling  <akling@apple.com>

        document.title setter can't throw.
        <https://webkit.org/b/161302>

        Reviewed by Antti Koivisto.

        Remove [SetterRaisesException] from document.title and replace
        ExceptionCode propagation with ASSERT_NO_EXCEPTION.

        Setting the .textContent of a SVGTitleElement or HTMLTitleElement
        will never fail, so there's no exception to propagate.

        * dom/Document.cpp:
        (WebCore::Document::setTitle):
        * dom/Document.h:
        * dom/Document.idl:
        * html/ImageDocument.cpp:
        (WebCore::ImageDocument::finishedParsing):

2016-08-23  Frederic Wang  <fwang@igalia.com>

        MathML renderers should use struct to pass long list of LayoutUnits
        https://bugs.webkit.org/show_bug.cgi?id=161084

        Reviewed by Darin Adler.

        RenderMathMLFraction, RenderMathMLMenclose, RenderMathMLScripts and RenderMathMLUnderOver
        have helper functions to retrieve a list of LayoutUnit parameters. We gather them in a single
        struct instead of using a long list of LayoutUnit& parameters.

        No new tests, behavior is unchanged.

        * rendering/mathml/RenderMathMLFraction.cpp:
        (WebCore::RenderMathMLFraction::getFractionParameters):
        (WebCore::RenderMathMLFraction::getStackParameters):
        (WebCore::RenderMathMLFraction::layoutBlock):
        * rendering/mathml/RenderMathMLFraction.h:
        * rendering/mathml/RenderMathMLMenclose.cpp:
        (WebCore::RenderMathMLMenclose::getSpaceAroundContent):
        (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths):
        (WebCore::RenderMathMLMenclose::layoutBlock):
        * rendering/mathml/RenderMathMLMenclose.h:
        * rendering/mathml/RenderMathMLScripts.cpp:
        (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded):
        (WebCore::RenderMathMLScripts::layoutBlock):
        * rendering/mathml/RenderMathMLScripts.h:
        * rendering/mathml/RenderMathMLUnderOver.cpp:
        (WebCore::RenderMathMLUnderOver::getVerticalParameters):
        (WebCore::RenderMathMLUnderOver::layoutBlock):
        * rendering/mathml/RenderMathMLUnderOver.h:

2016-08-28  Andreas Kling  <akling@apple.com>

        Clean up some .text attribute setters that don't throw.
        <https://webkit.org/b/161292>

        Reviewed by Darin Adler.

        Remove [SetterRaisesException] for three .text attributes
        and replace them with ASSERT_NO_EXCEPTION.

        These setters behave like .textContent, which can't throw as
        it's always okay to replace an Element's children with a Text.

        * html/HTMLAnchorElement.cpp:
        (WebCore::HTMLAnchorElement::setText):
        * html/HTMLAnchorElement.h:
        * html/HTMLAnchorElement.idl:
        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::setText):
        * html/HTMLOptionElement.h:
        * html/HTMLOptionElement.idl:
        * html/HTMLTitleElement.cpp:
        (WebCore::HTMLTitleElement::setText):
        * html/HTMLTitleElement.h:
        * html/HTMLTitleElement.idl:

2016-08-24  Dave Hyatt  <hyatt@apple.com>

        Initial landing of CSS Parser Tokenization (and files to support that). Not used yet.
        https://bugs.webkit.org/show_bug.cgi?id=161174

        This code is imported from Blink and is their CSS parser (modified to work in WebKit).
        It is from commit e4bb90df7f2ed8a63975b5ed27a1b488cb9b146f, Mon Aug 22 2016.

        Reviewed by Simon Fraser.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSMarkup.cpp: Added.
        (WebCore::isCSSTokenizerIdentifier):
        (WebCore::serializeCharacter):
        (WebCore::serializeCharacterAsCodePoint):
        (WebCore::serializeIdentifier):
        (WebCore::serializeString):
        (WebCore::serializeURI):
        (WebCore::serializeFontFamily):
        * css/CSSMarkup.h: Added.
        * css/CSSOMUtils.cpp: Removed.
        * css/CSSOMUtils.h: Removed.
        * css/CSSSelector.cpp:
        * css/parser/CSSParserFastPaths.cpp: Added.
        * css/parser/CSSParserFastPaths.h: Added.
        * css/parser/CSSParserIdioms.h: Added.
        (WebCore::isCSSSpace):
        (WebCore::isNameStartCodePoint):
        (WebCore::isNameCodePoint):
        * css/parser/CSSParserObserver.h: Added.
        (WebCore::CSSParserObserver::~CSSParserObserver):
        * css/parser/CSSParserObserverWrapper.cpp: Added.
        (WebCore::CSSParserObserverWrapper::startOffset):
        (WebCore::CSSParserObserverWrapper::previousTokenStartOffset):
        (WebCore::CSSParserObserverWrapper::endOffset):
        (WebCore::CSSParserObserverWrapper::skipCommentsBefore):
        (WebCore::CSSParserObserverWrapper::yieldCommentsBefore):
        * css/parser/CSSParserObserverWrapper.h: Added.
        (WebCore::CSSParserObserverWrapper::CSSParserObserverWrapper):
        (WebCore::CSSParserObserverWrapper::observer):
        (WebCore::CSSParserObserverWrapper::addComment):
        (WebCore::CSSParserObserverWrapper::addToken):
        (WebCore::CSSParserObserverWrapper::finalizeConstruction):
        * css/parser/CSSParserToken.cpp: Added.
        (WebCore::cssPrimitiveValueUnitFromTrie):
        (WebCore::stringToUnitType):
        (WebCore::CSSParserToken::CSSParserToken):
        (WebCore::CSSParserToken::convertToDimensionWithUnit):
        (WebCore::CSSParserToken::convertToPercentage):
        (WebCore::CSSParserToken::delimiter):
        (WebCore::CSSParserToken::numericSign):
        (WebCore::CSSParserToken::numericValueType):
        (WebCore::CSSParserToken::numericValue):
        (WebCore::CSSParserToken::parseAsUnresolvedCSSPropertyID):
        (WebCore::CSSParserToken::id):
        (WebCore::CSSParserToken::functionId):
        (WebCore::CSSParserToken::hasStringBacking):
        (WebCore::CSSParserToken::copyWithUpdatedString):
        (WebCore::CSSParserToken::valueDataCharRawEqual):
        (WebCore::CSSParserToken::operator==):
        (WebCore::CSSParserToken::serialize):
        * css/parser/CSSParserToken.h: Added.
        (WebCore::CSSParserToken::operator!=):
        (WebCore::CSSParserToken::type):
        (WebCore::CSSParserToken::value):
        (WebCore::CSSParserToken::getHashTokenType):
        (WebCore::CSSParserToken::getBlockType):
        (WebCore::CSSParserToken::unitType):
        (WebCore::CSSParserToken::unicodeRangeStart):
        (WebCore::CSSParserToken::unicodeRangeEnd):
        (WebCore::CSSParserToken::initValueFromStringView):
        * css/parser/CSSParserTokenRange.cpp: Added.
        (WebCore::CSSParserTokenRange::eofToken):
        (WebCore::CSSParserTokenRange::makeSubRange):
        (WebCore::CSSParserTokenRange::consumeBlock):
        (WebCore::CSSParserTokenRange::consumeComponentValue):
        (WebCore::CSSParserTokenRange::serialize):
        * css/parser/CSSParserTokenRange.h: Added.
        (WebCore::CSSParserTokenRange::CSSParserTokenRange):
        (WebCore::CSSParserTokenRange::atEnd):
        (WebCore::CSSParserTokenRange::end):
        (WebCore::CSSParserTokenRange::peek):
        (WebCore::CSSParserTokenRange::consume):
        (WebCore::CSSParserTokenRange::consumeIncludingWhitespace):
        (WebCore::CSSParserTokenRange::consumeWhitespace):
        (WebCore::CSSParserTokenRange::begin):
        * css/parser/CSSPropertyParser.cpp: Added.
        (WebCore::hasPrefix):
        (WebCore::cssPropertyID):
        (WebCore::cssPropertyNameIOSAliasing):
        (WebCore::isAppleLegacyCssValueKeyword):
        (WebCore::cssValueKeywordID):
        (WebCore::unresolvedCSSPropertyID):
        * css/parser/CSSPropertyParser.h: Added.
        (WebCore::CSSPropertyParser::inQuirksMode):
        * css/parser/CSSPropertyParserHelpers.cpp: Added.
        * css/parser/CSSPropertyParserHelpers.h: Added.
        (WebCore::CSSPropertyParserHelpers::identMatches):
        (WebCore::CSSPropertyParserHelpers::consumeIdent):
        (WebCore::CSSPropertyParserHelpers::isCSSWideKeyword):
        * css/parser/CSSTokenizer.cpp: Added.
        (WebCore::CSSTokenizer::Scope::Scope):
        (WebCore::CSSTokenizer::Scope::tokenRange):
        (WebCore::CSSTokenizer::Scope::tokenCount):
        (WebCore::isNewLine):
        (WebCore::twoCharsAreValidEscape):
        (WebCore::CSSTokenizer::CSSTokenizer):
        (WebCore::CSSTokenizer::reconsume):
        (WebCore::CSSTokenizer::consume):
        (WebCore::CSSTokenizer::whiteSpace):
        (WebCore::CSSTokenizer::blockStart):
        (WebCore::CSSTokenizer::blockEnd):
        (WebCore::CSSTokenizer::leftParenthesis):
        (WebCore::CSSTokenizer::rightParenthesis):
        (WebCore::CSSTokenizer::leftBracket):
        (WebCore::CSSTokenizer::rightBracket):
        (WebCore::CSSTokenizer::leftBrace):
        (WebCore::CSSTokenizer::rightBrace):
        (WebCore::CSSTokenizer::plusOrFullStop):
        (WebCore::CSSTokenizer::asterisk):
        (WebCore::CSSTokenizer::lessThan):
        (WebCore::CSSTokenizer::comma):
        (WebCore::CSSTokenizer::hyphenMinus):
        (WebCore::CSSTokenizer::solidus):
        (WebCore::CSSTokenizer::colon):
        (WebCore::CSSTokenizer::semiColon):
        (WebCore::CSSTokenizer::hash):
        (WebCore::CSSTokenizer::circumflexAccent):
        (WebCore::CSSTokenizer::dollarSign):
        (WebCore::CSSTokenizer::verticalLine):
        (WebCore::CSSTokenizer::tilde):
        (WebCore::CSSTokenizer::commercialAt):
        (WebCore::CSSTokenizer::reverseSolidus):
        (WebCore::CSSTokenizer::asciiDigit):
        (WebCore::CSSTokenizer::letterU):
        (WebCore::CSSTokenizer::nameStart):
        (WebCore::CSSTokenizer::stringStart):
        (WebCore::CSSTokenizer::endOfFile):
        (WebCore::CSSTokenizer::nextToken):
        (WebCore::CSSTokenizer::consumeNumber):
        (WebCore::CSSTokenizer::consumeNumericToken):
        (WebCore::CSSTokenizer::consumeIdentLikeToken):
        (WebCore::CSSTokenizer::consumeStringTokenUntil):
        (WebCore::CSSTokenizer::consumeUnicodeRange):
        (WebCore::isNonPrintableCodePoint):
        (WebCore::CSSTokenizer::consumeUrlToken):
        (WebCore::CSSTokenizer::consumeBadUrlRemnants):
        (WebCore::CSSTokenizer::consumeSingleWhitespaceIfNext):
        (WebCore::CSSTokenizer::consumeUntilCommentEndFound):
        (WebCore::CSSTokenizer::consumeIfNext):
        (WebCore::CSSTokenizer::consumeName):
        (WebCore::CSSTokenizer::consumeEscape):
        (WebCore::CSSTokenizer::nextTwoCharsAreValidEscape):
        (WebCore::CSSTokenizer::nextCharsAreNumber):
        (WebCore::CSSTokenizer::nextCharsAreIdentifier):
        (WebCore::CSSTokenizer::registerString):
        * css/parser/CSSTokenizer.h: Added.
        (WebCore::CSSTokenizer::Scope::storeString):
        * css/parser/CSSTokenizerInputStream.cpp: Added.
        (WebCore::CSSTokenizerInputStream::CSSTokenizerInputStream):
        (WebCore::CSSTokenizerInputStream::advanceUntilNonWhitespace):
        (WebCore::CSSTokenizerInputStream::getDouble):
        * css/parser/CSSTokenizerInputStream.h: Added.
        (WebCore::CSSTokenizerInputStream::nextInputChar):
        (WebCore::CSSTokenizerInputStream::peekWithoutReplacement):
        (WebCore::CSSTokenizerInputStream::advance):
        (WebCore::CSSTokenizerInputStream::pushBack):
        (WebCore::CSSTokenizerInputStream::skipWhilePredicate):
        (WebCore::CSSTokenizerInputStream::length):
        (WebCore::CSSTokenizerInputStream::offset):
        (WebCore::CSSTokenizerInputStream::rangeAt):
        * platform/Length.h:

2016-08-28  Javier Fernandez  <jfernandez@igalia.com>

        Should never be reached failure in WebCore::RenderFlexibleBox::alignChildren
        https://bugs.webkit.org/show_bug.cgi?id=151591
        <rdar://problem/27711829>

        Reviewed by Darin Adler.

        The align-self and align-items CSS properties were originally defined in the
        Flexbible Box specification. The new CSS Box Alignment specification tries
        to generalize them so they can be used by other layout models, as it's  the
        case of the GridLayout spec.

        Since we have implemented the Grid Layout spec behind a runtime flag, we should
        do the same with the new syntax of these properties.

        Test: css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html

        * css/CSSParser.cpp:
        (WebCore::isValidKeywordPropertyAndValue):
        (WebCore::isKeywordPropertyID):
        (WebCore::CSSParser::parseValue):
        * rendering/RenderFlexibleBox.cpp:
        (WebCore::RenderFlexibleBox::alignChildren):

2016-08-28  Frederic Wang  <fwang@igalia.com>

        Improve parsing of the menclose notation attribute value
        https://bugs.webkit.org/show_bug.cgi?id=161045

        Reviewed by Darin Adler.

        We improve the way the list of menclose notations is parsed to avoid allocating a vector and
        accept any whitespace as separators.

        New test cases in mathml/presentation/menclose-notation-equivalence.html

        * mathml/MathMLMencloseElement.cpp: Include HTMLParserIdioms.h to use isHTMLSpace.
        (WebCore::MathMLMencloseElement::addNotationFlags): Helper function to perform the relevant
        addNotation calls from a notation name.
        (WebCore::MathMLMencloseElement::parseNotationAttribute): Use only simple string operations
        to determine the list of notations.
        * mathml/MathMLMencloseElement.h: Declare the new helper function.

2016-08-28  Frederic Wang  <fwang@igalia.com>

        Make MathMLSpaceElement and MathMLTokenElement inherit from MathMLPresentationElement
        https://bugs.webkit.org/show_bug.cgi?id=161232

        Reviewed by Darin Adler.

        The mrow-like features of MathMLPresentationElement are now moved into RenderMathMLRow.
        Hence we make MathMLSpaceElement and MathMLTokenElement inherit from the generic class
        MathMLPresentationElement for presentation MathML elements.

        No new tests, already covered by existing tests.

        * mathml/MathMLSpaceElement.cpp:
        (WebCore::MathMLSpaceElement::MathMLSpaceElement): Derive from MathMLPresentationElement.
        (WebCore::MathMLSpaceElement::parseAttribute): Ditto.
        * mathml/MathMLSpaceElement.h: Ditto. Override acceptsDisplayStyleAttribute as a small
        optimization. isPresentationMathML is no longer needed.
        * mathml/MathMLTokenElement.cpp:
        (WebCore::MathMLTokenElement::MathMLTokenElement): Derive from MathMLPresentationElement.
        (WebCore::MathMLTokenElement::didAttachRenderers): Ditto.
        (WebCore::MathMLTokenElement::childrenChanged): Ditto.
        (WebCore::MathMLTokenElement::parseAttribute): Deleted. No need to override this function
        any more since it's already implemented in MathMLPresentationElement.
        * mathml/MathMLTokenElement.h: Derive from MathMLPresentationElement. Override
        acceptsDisplayStyleAttribute as a small optimization. isPresentationMathML is no longer
        needed.

2016-08-28  Frederic Wang  <fwang@igalia.com>

        RenderMathMLRow::firstLineBaseline does not need to be overridden in RenderMathMLMenclose
        https://bugs.webkit.org/show_bug.cgi?id=161127

        Reviewed by Darin Adler.

        RenderMathMLRow::firstLineBaseline already provides the correct calculation of ascent for
        non-empty menclose elements. Empty menclose elements are not used in practice so the
        calculated value is irrelevant. Aligning on mrow (i.e. leaving firstLineBaseline to 0)
        is fine. This change allows to get rid of the m_ascent member and helps to keep good baseline
        alignment when the zoom level changes (bug 161126).

        No new tests, already covered by existing tests.

        * rendering/mathml/RenderMathMLMenclose.cpp:
        (WebCore::RenderMathMLMenclose::RenderMathMLMenclose): Remove initialization of m_ascent.
        (WebCore::RenderMathMLMenclose::layoutBlock): No need to calculate m_ascent. The height and
        content location can be determined without introducing local variables ascent or descent.
        (WebCore::RenderMathMLMenclose::firstLineBaseline): Deleted. We just use the implementation
        from RenderMathMLRow.
        * rendering/mathml/RenderMathMLMenclose.h: Delete m_ascent and do not override
        firstLineBaseline.

2016-08-28  Frederic Wang  <fwang@igalia.com>

        More cleanup for the mpadded implementation
        https://bugs.webkit.org/show_bug.cgi?id=161136

        Reviewed by Darin Adler.

        We perform the following cleanup for the mpadded renderer class:
        1) We do not store the ascent on the class. This may make update more reliable and will
        help for general improvement of MathML ascents (bug 155879).
        2) We split resolveWidth/resolveAttributes into smaller functions and improve the coding
        style. This helps to calculate firstLineBaseline in 1).
        3) We do not override updateFromElement and styleDidChange to perform setNeedsLayout calls.
        These calls already seem unnecessary and can be removed even more safely after 1).

        We add a test for style change. Change of attributes as well as metrics calcuation of empty
        and non-empty mpadded elements are already covered by other tests.

        Test: mathml/presentation/mpadded-style-change.html

        * rendering/mathml/RenderMathMLPadded.cpp:
        (WebCore::RenderMathMLPadded::voffset): New helper function to resolve voffset.
        (WebCore::RenderMathMLPadded::lspace): Ditto for lspace.
        (WebCore::RenderMathMLPadded::mpaddedWidth): Ditto for width.
        (WebCore::RenderMathMLPadded::mpaddedHeight): Ditto for height.
        (WebCore::RenderMathMLPadded::mpaddedDepth): Ditto for detph.
        (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): Use mpaddedWidth().
        (WebCore::RenderMathMLPadded::layoutBlock): Use the new helper functions.
        (WebCore::RenderMathMLPadded::firstLineBaseline): Use voffset or mpaddedHeight for baseline
        calculation instead of m_padded.
        (WebCore::RenderMathMLPadded::resolveWidth): Deleted. Renamed mpaddedWidth.
        (WebCore::RenderMathMLPadded::resolveAttributes): Deleted. Split into smaller functions.
        (WebCore::RenderMathMLPadded::updateFromElement): Deleted. We do not need to call
        setNeedsLayout.
        (WebCore::RenderMathMLPadded::styleDidChange): Deleted. Ditto.
        * rendering/mathml/RenderMathMLPadded.h: Update function declaration and remove m_ascent.

2016-08-27  Alex Christensen  <achristensen@webkit.org>

        URLParser should parse relative URLs
        https://bugs.webkit.org/show_bug.cgi?id=161282

        Reviewed by Darin Adler.

        Partially covered by new API tests, but once the parser is complete enough we can
        use the url web platform tests to more fully test this.  It's still a work in
        progress only used by tests.

        * platform/URLParser.cpp:
        (WebCore::URLParser::urlLengthUntilPart):
        (WebCore::URLParser::copyURLPartsUntil):
        Added some helper functions to reduce redundant code.  When parsing relative URLs,
        we often want to copy large parts of the base URL, but the stopping point differs.
        (WebCore::URLParser::parse):
        The parser now returns a URL instead of an Optional<URL> because a URL has a m_isValid which behaves like Optional.
        * platform/URLParser.h:
        (WebCore::URLParser::parse):

2016-08-27  Chris Dumez  <cdumez@apple.com>

        Update generated bindings to throw a SecurityError when denying cross-origin access to properties
        https://bugs.webkit.org/show_bug.cgi?id=161270

        Reviewed by Darin Adler.

        Update generated bindings to throw a SecurityError when denying cross-origin
        access to properties, as per the HTML specification:
        - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
        - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)

        Firefox and Chrome already throw but Webkit was logging an error message and
        returning undefined instead.

        No new tests, updated existing tests.

        * bindings/js/JSDOMBinding.cpp:
        (WebCore::canAccessDocument):
        (WebCore::BindingSecurity::shouldAllowAccessToNode):
        * bindings/js/JSDOMBinding.h:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):

2016-08-27  Chris Dumez  <cdumez@apple.com>

        Follow-up fixes after r205030.
        https://bugs.webkit.org/show_bug.cgi?id=161216

        Reviewed by Darin Adler.

        * html/parser/HTMLParserIdioms.cpp:
        (WebCore::isHTMLSpaceOrDelimiter):
        (WebCore::isNumberStart):
        (WebCore::parseHTMLListOfOfFloatingPointNumberValues):
        * html/parser/HTMLParserIdioms.h:

2016-08-27  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>

        Add final keyword to final classes and overriden methods in WebCore/css
        https://bugs.webkit.org/show_bug.cgi?id=161182

        Reviewed by Darin Adler.

        - Mark classes in the WebCore/css directory final as appropriate.
        - Update WebCore/css classes so that overriden methods in final classes are marked final.

        * css/CSSAnimationTriggerScrollValue.h:
        * css/CSSAspectRatioValue.h:
        * css/CSSBasicShapes.h:
        * css/CSSBorderImageSliceValue.h:
        * css/CSSCalculationValue.cpp:
        (WebCore::determineCategory):
        * css/CSSCalculationValue.h:
        * css/CSSCanvasValue.h:
        * css/CSSCharsetRule.h:
        * css/CSSComputedStyleDeclaration.h:
        * css/CSSContentDistributionValue.h:
        * css/CSSCrossfadeValue.h:
        * css/CSSCursorImageValue.h:
        * css/CSSCustomPropertyValue.h:
        * css/CSSFilterImageValue.h:
        * css/CSSFontFaceLoadEvent.h:
        * css/CSSFontFaceSrcValue.h:
        * css/CSSFontFeatureValue.h:
        * css/CSSFontSelector.h:
        * css/CSSFontValue.h:
        * css/CSSFunctionValue.h:
        * css/CSSGradientValue.h:
        * css/CSSGridAutoRepeatValue.h:
        * css/CSSGridLineNamesValue.h:
        * css/CSSGridTemplateAreasValue.h:
        * css/CSSImageSetValue.h:
        * css/CSSImageValue.h:
        * css/CSSInheritedValue.h:
        * css/CSSInitialValue.h:
        * css/CSSKeyframeRule.h:
        * css/CSSKeyframesRule.h:
        * css/CSSLineBoxContainValue.h:
        * css/CSSNamedImageValue.h:
        * css/CSSPrimitiveValue.h:
        * css/CSSReflectValue.h:
        * css/CSSRevertValue.h:
        * css/CSSRuleList.h:
        * css/CSSSegmentedFontFace.h:
        * css/CSSShadowValue.h:
        * css/CSSStyleSheet.cpp:
        * css/CSSStyleSheet.h:
        * css/CSSSupportsRule.h:
        * css/CSSTimingFunctionValue.h:
        * css/CSSUnicodeRangeValue.h:
        * css/CSSUnknownRule.h:
        * css/CSSUnsetValue.h:
        * css/CSSValue.cpp:
        * css/CSSVariableDependentValue.h:
        * css/CSSVariableValue.h:
        * css/Counter.h:
        * css/DOMCSSNamespace.h:
        * css/DashboardRegion.h:
        * css/LengthRepeat.h:
        * css/MediaList.h:
        * css/MediaQueryList.h:
        * css/MediaQueryMatcher.h:
        * css/Pair.h:
        * css/PropertySetCSSStyleDeclaration.h:
        * css/RGBColor.h:
        * css/Rect.h:
        * css/StyleMedia.h:
        * css/StyleProperties.h:
        * css/StyleRule.h:
        * css/StyleRuleImport.h:
        * css/StyleSheetContents.h:
        * css/StyleSheetList.h:
        * css/ViewportStyleResolver.h:
        * css/WebKitCSSFilterValue.h:
        * css/WebKitCSSRegionRule.h:
        * css/WebKitCSSTransformValue.h:
        * css/WebKitCSSViewportRule.h:

2016-08-27  Simon Fraser  <simon.fraser@apple.com>

        Add more Editing logging
        https://bugs.webkit.org/show_bug.cgi?id=161287

        Reviewed by Darin Adler.

        Add logging which tracks how key events get from the UI process to the
        web process, and down to form fields.

        * editing/Editor.cpp:
        (WebCore::Editor::handleTextEvent):
        (WebCore::Editor::appliedEditing):
        * editing/TypingCommand.cpp:
        (WebCore::TypingCommand::insertText):
        (WebCore::TypingCommand::insertTextAndNotifyAccessibility):
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
        * page/EventHandler.cpp:
        (WebCore::EventHandler::keyEvent):
        (WebCore::EventHandler::handleTextInputEvent):

2016-08-27  Sam Weinig  <sam@webkit.org>

        Remove more custom JavaScript bindings
        https://bugs.webkit.org/show_bug.cgi?id=161293

        Reviewed by Darin Adler.

        Remove custom bindings for AudioContext, DOMFormData, MediaSession and WebKitPoint.

        * Modules/mediasession/MediaSession.cpp:
        (WebCore::MediaSession::MediaSession):
        * Modules/mediasession/MediaSession.h:
        Change to take Document explicitly, since that is what it 
        expecting.

        * Modules/webaudio/AudioContext.cpp:
        (WebCore::AudioContext::create):
        * Modules/webaudio/AudioContext.h:
        Remove unused ExceptionCode parameter.

        * Modules/webaudio/AudioContext.idl:
        * html/DOMFormData.idl:
        * html/HTMLFormElement.idl:
        * page/WebKitPoint.idl:
        Switch to use the generated constructor.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        Remove files.
        
        * bindings/js/JSAudioContextCustom.cpp: Removed.
        * bindings/js/JSDOMFormDataCustom.cpp: Removed.
        * bindings/js/JSMediaSessionCustom.cpp: Removed.
        * bindings/js/JSWebKitPointCustom.cpp: Removed.
        Remove in favor of generated variants.

        * bindings/js/JSHTMLInputElementCustom.h: Removed.
        Remove unused header.

        * page/WebKitPoint.h:
        (WebCore::WebKitPoint::create):
        (WebCore::WebKitPoint::WebKitPoint):
        Move NaN replacement into the implementation and out of the bindings.

2016-08-27  Ryosuke Niwa  <rniwa@webkit.org>

        Add adopted callback for custom elements
        https://bugs.webkit.org/show_bug.cgi?id=161284

        Reviewed by Antti Koivisto.

        Added the support for adoptedCallback: https://dom.spec.whatwg.org/#concept-node-adopt
        For now, we only support this callback on appendChild.

        Test: fast/custom-elements/adopted-callback.html

        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::invokeCallback): Added JSDOMGlobalObject* as an argument to the callback so that
        we can invoke toJS on Document in invokeAdoptedCallback.
        (WebCore::JSCustomElementInterface::setAdoptedCallback): Added.
        (WebCore::JSCustomElementInterface::invokeAdoptedCallback): Added.
        (WebCore::JSCustomElementInterface::setAttributeChangedCallback):
        * bindings/js/JSCustomElementInterface.h:
        (WebCore::JSCustomElementInterface::hasConnectedCallback): Added.
        (WebCore::JSCustomElementInterface::hasDisconnectedCallback): Added.
        (WebCore::JSCustomElementInterface::hasAdoptedCallback): Added.
        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::JSCustomElementRegistry::define):
        * dom/CustomElementReactionQueue.cpp:
        (WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem): Added a variant that takes two documents.
        (WebCore::CustomElementReactionQueueItem::invoke):
        (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Fixed a bug that this function was always
        enqueuing a callback even when the interface didn't have connectedCallback. Also, there is no need to check
        the nullity of the interface since it should never be null.
        (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Ditto.
        (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Added.
        (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Assert that the interface is never
        null instead of exiting early.
        * dom/CustomElementReactionQueue.h:
        * dom/Element.cpp:
        (WebCore::Element::didMoveToNewDocument): Added a call to enqueueAdoptedCallbackIfNeeded.

2016-08-27  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        Fix the !PLATFORM(WIN) && USE(CURL) build.
        https://bugs.webkit.org/show_bug.cgi?id=161281

        Reviewed by Alex Christensen.

        * platform/network/curl/ResourceHandleCurl.cpp:

2016-08-27  Youenn Fablet  <youenn@apple.com>

        [Fetch API] Opaque responses should not have any body
        https://bugs.webkit.org/show_bug.cgi?id=161130

        Reviewed by Sam Weinig.

        Covered by updated test.

        Added a new ThreadableLoader option to receive or not opaque response body.
        By default, option is set to Receive.
        FetchLoader is setting it to DoNotReceive.

        * Modules/fetch/FetchLoader.cpp:
        (WebCore::FetchLoader::start):
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::didReceiveResponse): Calling didFinishLoading just after didReceiveResponse in case of Opaque responses.
        * loader/ThreadableLoader.cpp:
        (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
        * loader/ThreadableLoader.h:
        * loader/WorkerThreadableLoader.cpp:
        (WebCore::LoaderTaskOptions::LoaderTaskOptions):

2016-08-27  Youenn Fablet  <youenn@apple.com>

        [Fetch API] opaqueredirect responses should have their URL set to the original URL
        https://bugs.webkit.org/show_bug.cgi?id=161194

        Reviewed by Sam Weinig.

        Covered by updated tests.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::didReceiveResponse):
        * loader/SubresourceLoader.cpp: Removing isNull ASSERT since we now set the response URL.
        (WebCore::SubresourceLoader::willSendRequestInternal): Setting opaqueredirect response URL to the original URL.

2016-08-27  Andreas Kling  <akling@apple.com>

        script.text should behave like script.textContent on setting
        <https://webkit.org/b/148852>

        Reviewed by Chris Dumez.

        HTMLScriptElement.text should behave just like .textContent when setting,
        so just forward setText() to setTextContent().

        Test: import/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-text.html

        * html/HTMLScriptElement.cpp:
        (WebCore::HTMLScriptElement::setText):

2016-08-27  Youenn Fablet  <youenn@apple.com>

        [Fetch API] Blob type should be set from Response/Request contentType header
        https://bugs.webkit.org/show_bug.cgi?id=161228

        Reviewed by Alex Christensen.

        Covered by updated tests.

        Renaming FetchBody::m_mimeType to m_contentType since that better relates to Content-Type header.
        Updated FetchRequest and FetchResponse to set m_contentType according request/response headers.
        Handled the case of a Request created from JS, a Response created from JS and a Response created internally to
        be used as resolve value in the fetch promise.

        In case Content-Type is set but is empty, its empty value should be used for blob type.
        Updated contentType checks to use isNull in lieu of isEmpty.

        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::updateContentType): Routine to synchronize headers with m_contentType.
        (WebCore::FetchBody::FetchBody): Renamed m_mimeType to m_contentType.
        (WebCore::FetchBody::blob): Ditto.
        * Modules/fetch/FetchBody.h: Ditto.
        (WebCore::FetchBody::contentType):
        (WebCore::FetchBody::setMimeType): Deleted.
        (WebCore::FetchBody::mimeType): Deleted.
        * Modules/fetch/FetchRequest.cpp:
        (WebCore::FetchRequest::setBody): set FetchBody::m_contentType according HTTP headers.
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::initializeWith): Ditto.
        (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Ditto.

2016-08-26  Alex Christensen  <achristensen@webkit.org>

        Fix Windows build after r205065.

        * Modules/webaudio/BiquadFilterNode.idl:
        * Modules/webaudio/PannerNode.idl:
        There's no WEB_AUDIO on Windows.

2016-08-26  Devin Rousso  <dcrousso+webkit@gmail.com>

        REGRESSION (r203535): Web Inspector: Inspector overlay node info has disappeared
        https://bugs.webkit.org/show_bug.cgi?id=161264

        Reviewed by Joseph Pecoraro.

        No new tests.  Fixing JavaScript error in Inspector overlay.

        * inspector/InspectorOverlay.cpp:
        (evaluateCommandInOverlay):
        (WebCore::InspectorOverlay::evaluateInOverlay):
        Add ASSERT to ensure that errors in the Inspector overlay will cause tests to crash.

        * inspector/InspectorOverlayPage.js:
        (DOMBuilder.prototype.appendTextNode):
        Move textContent value to parameter of document.createTextNode.

2016-08-26  Sam Weinig  <sam@webkit.org>

        Remove support for ENABLE_LEGACY_WEB_AUDIO
        https://bugs.webkit.org/show_bug.cgi?id=161262

        Reviewed by Anders Carlsson.

        * Configurations/FeatureDefines.xcconfig:
        Remove ENABLE_LEGACY_WEB_AUDIO.

        * Modules/webaudio/AudioBufferSourceNode.cpp:
        (WebCore::AudioBufferSourceNode::noteGrainOn): Deleted.
        * Modules/webaudio/AudioBufferSourceNode.h:
        * Modules/webaudio/AudioBufferSourceNode.idl:
        (WebCore::AudioScheduledSourceNode::noteOn): Deleted.
        (WebCore::AudioScheduledSourceNode::noteOff): Deleted.
        * Modules/webaudio/AudioScheduledSourceNode.h:
        * Modules/webaudio/AudioScheduledSourceNode.cpp:
        Remove the looping attribute, as well as the noteOn, noteOff, and noteGrainOn functions.

        * Modules/webaudio/AudioContext.idl:
        Remove the createGainNode, createDelayNode and createJavaScriptNode functions.

        * Modules/webaudio/AudioParam.idl:
        Remove the setTargetValueAtTime function.

        * Modules/webaudio/BiquadDSPKernel.cpp:
        (WebCore::BiquadDSPKernel::updateCoefficientsIfNecessary):
        * Modules/webaudio/BiquadFilterNode.cpp:
        (WebCore::BiquadFilterNode::type):
        (WebCore::BiquadFilterNode::setType):
        (WebCore::BiquadFilterNode::getFrequencyResponse):
        * Modules/webaudio/BiquadFilterNode.h:
        * Modules/webaudio/BiquadFilterNode.idl:
        * Modules/webaudio/BiquadProcessor.cpp:
        (WebCore::BiquadProcessor::BiquadProcessor):
        (WebCore::BiquadProcessor::setType):
        (WebCore::BiquadProcessor::getFrequencyResponse):
        * Modules/webaudio/BiquadProcessor.h:
        (WebCore::BiquadProcessor::type):
        * bindings/js/JSBiquadFilterNodeCustom.cpp: Removed.
        Rename BiquadProcessor::FilterType to BiquadFilterType and use it
        directly from the IDL. Remove legacy filter constants from the IDL
        and the need for a custom binding for the type attribute.

        * Modules/webaudio/OscillatorNode.cpp:
        (WebCore::OscillatorNode::OscillatorNode):
        (WebCore::OscillatorNode::setType):
        (WebCore::OscillatorNode::setPeriodicWave):
        (WebCore::OscillatorNode::type): Deleted.
        * Modules/webaudio/OscillatorNode.h:
        (WebCore::OscillatorNode::type):
        * Modules/webaudio/OscillatorNode.idl:
        * Modules/webaudio/PeriodicWave.cpp:
        (WebCore::PeriodicWave::createSine):
        (WebCore::PeriodicWave::createSquare):
        (WebCore::PeriodicWave::createSawtooth):
        (WebCore::PeriodicWave::createTriangle):
        (WebCore::PeriodicWave::generateBasicWaveform):
        * Modules/webaudio/PeriodicWave.h:
        * bindings/js/JSOscillatorNodeCustom.cpp: Removed.
        Remove noteOn and noteOff functions and the type integer constants.
        Remove the need for a custom binding for the type attribute by renaming
        the type enum OscillatorNode::Type and putting the enum in the IDL.

        * Modules/webaudio/PannerNode.cpp:
        (WebCore::PannerNode::PannerNode):
        (WebCore::PannerNode::process):
        (WebCore::PannerNode::setPanningModel):
        (WebCore::PannerNode::distanceModel):
        (WebCore::PannerNode::setDistanceModel):
        (WebCore::PannerNode::panningModel): Deleted.
        * Modules/webaudio/PannerNode.h:
        (WebCore::PannerNode::panningModel):
        * Modules/webaudio/PannerNode.idl:
        * bindings/js/JSPannerNodeCustom.cpp: Removed.
        * platform/audio/Distance.cpp:
        (WebCore::DistanceEffect::DistanceEffect):
        (WebCore::DistanceEffect::gain):
        * platform/audio/Distance.h:
        (WebCore::DistanceEffect::model):
        (WebCore::DistanceEffect::setModel):
        * platform/audio/EqualPowerPanner.cpp:
        (WebCore::EqualPowerPanner::EqualPowerPanner):
        * platform/audio/HRTFPanner.cpp:
        (WebCore::HRTFPanner::HRTFPanner):
        * platform/audio/Panner.cpp:
        (WebCore::Panner::create):
        * platform/audio/Panner.h:
        (WebCore::Panner::panningModel):
        (WebCore::Panner::Panner):
        Replace the panning model and distance model integer constants
        with IDL enum support, removing the need for a custom binding.
        Rename the supporting C++ enums to work with the bindings.

        * bindings/js/JSAudioContextCustom.cpp:
        (WebCore::constructJSAudioContext):
        Remove deprecated way of creating an offline context.

        * WebCore.xcodeproj/project.pbxproj:
        Update files.

2016-08-26  Johan K. Jensen  <johan_jensen@apple.com>

        Web Inspector: Frontend should have access to Resource Timing information
        https://bugs.webkit.org/show_bug.cgi?id=160095

        Reviewed by Alex Christensen.

        Show correct information with Resource Timing information
        from ResourceLoader rather than DocumentLoader.

        No new tests, frontend doesn't use the timing data yet.

        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::buildObjectForTiming):
        (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
        (WebCore::InspectorNetworkAgent::buildObjectForCachedResource):
        (WebCore::InspectorNetworkAgent::willSendRequest):
        (WebCore::InspectorNetworkAgent::didReceiveResponse):
        (WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache):
        (WebCore::buildObjectForTiming): Deleted.
        (WebCore::buildObjectForResourceResponse): Deleted.
        (WebCore::buildObjectForCachedResource): Deleted.
        Use ResourceLoader instead of DocumentLoader to get Resource Timing information.
        Move functions to member functions to access the executionStopWatch.

        (WebCore::InspectorNetworkAgent::didFinishLoading):
        Use the load timing finishTime and convert to elapsed time for frontend.

        * inspector/InspectorNetworkAgent.h:
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::didFinishLoading):
        Pass the web process load timing on to the inspector.

2016-08-26  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix Windows build after r205048.

        * bindings/scripts/CodeGeneratorJS.pm:
        (getConditionalForFunctionConsideringOverloads):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
        (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
        (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload):
        * bindings/scripts/test/TestObj.idl:

2016-08-23  Ryosuke Niwa  <rniwa@webkit.org>

        Adopted custom element's callbacks should continue to work
        https://bugs.webkit.org/show_bug.cgi?id=161065

        Reviewed by Andreas Kling.

        When a custom element is adopted into another document, its reaction callbacks need to continue to work.
        Because a different document may have its own global object, each custom element needs to remember its
        original global object or JSCustomElementInterface. This patch adds the latter to the element rare data.

        Tests: fast/custom-elements/connected-callbacks.html
               fast/custom-elements/disconnected-callbacks.html

        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::constructElement):
        (WebCore::JSCustomElementInterface::upgradeElement):
        * dom/CustomElementReactionQueue.cpp:
        (WebCore::findInterfaceForCustomElement): Deleted.
        (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
        (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
        (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
        * dom/Element.cpp:
        (WebCore::Element::insertedInto): Invoke callbacks even when the current document is not a HTML document.
        (WebCore::Element::removedFrom): Ditto.
        (WebCore::Element::setCustomElementIsResolved): Moved from Node. Add the element interface to the rare data.
        (WebCore::Element::customElementInterface): Added.
        * dom/Element.h:
        * dom/ElementRareData.cpp:
        * dom/ElementRareData.h:
        (WebCore::ElementRareData::customElementInterface): Added.
        (WebCore::ElementRareData::setCustomElementInterface): Added.
        * dom/Node.h:
        ((WebCore::Node::setCustomElementIsResolved): Deleted.

2016-08-26  Zalan Bujtas  <zalan@apple.com>

        ASSERT_NOT_REACHED() is touched in WebCore::minimumValueForLength
        https://bugs.webkit.org/show_bug.cgi?id=125781
        <rdar://problem/27684457>

        Reviewed by Simon Fraser.

        RenderTableSection::calcRowLogicalHeight misused minimumValueForLength to fallback to 0 for non-fixed values.
        While this patch fixes the assertion, the table section code needs works to support calc values. See webkit.org/b/161273.   

        Test: fast/table/assert-on-min-max-content-values.html

        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::calcRowLogicalHeight):

2016-08-26  Andreas Kling  <akling@apple.com>

        REGRESSION (r204987): fast/canvas-composite-* tests are now flaky assertion failures
        <https://webkit.org/b/161259>

        Reviewed by Joseph Pecoraro.

        Fix a blunder where HTMLCanvasElement::memoryCost() wasn't forwarding the inquiry
        to ImageBuffer but HTMLCanvasElement::externalMemoryCost() was.

        This fixes flaky "externalMemorySize() <= extraMemorySize()" assertions on debug bots.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::memoryCost):

2016-08-26  Andreas Kling  <akling@apple.com>

        The :enabled/:disabled selectors should only match elements that can be disabled.
        <https://webkit.org/b/161255>

        Reviewed by Chris Dumez.

        Per the HTML spec, only the following elements can be actually disabled:

            button, input, select, textarea, optgroup, option, menuitem, fieldset

        Since HTMLOutputElement inherits from HTMLFormControlElement, it had some
        misguided ideas about being disableable. This was causing it to get matched
        by :enabled and :disabled selectors.

        Test: imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/disabled.html

        * css/SelectorChecker.cpp:
        (WebCore::SelectorChecker::checkOne):
        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::addPseudoClassType):
        * css/SelectorCheckerTestFunctions.h:
        (WebCore::matchesDisabledPseudoClass):
        (WebCore::matchesEnabledPseudoClass): Renamed from isEnabled/isDisabled. Now only allows
        :enabled and :disabled selectors to match elements that are actually disableable.

        * html/HTMLElement.h:
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::canBeActuallyDisabled):
        (WebCore::HTMLElement::isActuallyDisabled): Added supporting functions for the aforementioned selectors.

        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::parseAttribute): Don't care about disabled state
        changes in elements that are not disableable in the first place.

2016-08-26  Chris Dumez  <cdumez@apple.com>

        REGRESSION(r204028): Fix unused-but-set-variable warning in generated JSNavigator.cpp
        https://bugs.webkit.org/show_bug.cgi?id=161252

        Reviewed by Ryosuke Niwa.

        Improve support for [Conditional] with overloaded operations in the IDL.

        No new tests, updated bindings tests.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        (GeneratePropertiesHashTable):
        (getConditionalForFunctionConsideringOverloads):
        (GenerateOverloadedFunctionOrConstructor):
        (GenerateImplementation):
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation): Deleted.
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
        (WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
        (WebCore::jsTestObjPrototypeFunctionConditionalOverload):
        (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation): Deleted.
        (WebCore::jsTestObjConstructorFunctionOverloadedMethod1): Deleted.
        * bindings/scripts/test/TestObj.idl:

2016-08-26  Beth Dakin  <bdakin@apple.com>

        charactersAroundPosition can be wrong because it crosses editing boundaries
        https://bugs.webkit.org/show_bug.cgi?id=161215
        -and corresponding-
        rdar://problem/27933564

        Reviewed by Ryosuke Niwa.

        charactersAroundPosition() should not cross editing boundaries. This patch fixes 
        that by making nextCharacterBoundaryInDirection() take an 
        EditingBoundaryCrossingRule parameter to pass onto VisiblePosition::next() and 
        VisiblePosition::previous().

        * editing/VisibleUnits.cpp:
        (WebCore::nextCharacterBoundaryInDirection):
        (WebCore::positionOfNextBoundaryOfGranularity):
        (WebCore::charactersAroundPosition):

2016-08-26  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Test and address issues in IndexedDB.requestData
        https://bugs.webkit.org/show_bug.cgi?id=161178
        <rdar://problem/28002467>

        Reviewed by Brian Burg.

        Test: inspector/indexeddb/requestData.html

        * inspector/InspectorIndexedDBAgent.cpp:
        (idbKeyRangeFromKeyRange):
        Parsing was too strict. "lower" and "upper" keys are optional.

        (WebCore::DataLoader::execute):
        Ensure the skip count is passed forward.

2016-08-25  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Provide a way to clear an IndexedDB object store
        https://bugs.webkit.org/show_bug.cgi?id=161167
        <rdar://problem/27996932>

        Reviewed by Brian Burg.

        Test: inspector/indexeddb/clearObjectStore.html

        * inspector/InspectorIndexedDBAgent.cpp:
        Make the transaction for clearing an object store readwrite
        instead of readonly, and activate it.

2016-08-26  Chris Dumez  <cdumez@apple.com>

        Calling crossOriginWindow.toString() should not be allowed
        https://bugs.webkit.org/show_bug.cgi?id=161225

        Reviewed by Andreas Kling.

        Calling crossOriginWindow.toString() should not be allowed:
        - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)

        In WebKit, we were printing a security error in the console but
        returning "[object Window]" anyway.

        In Firefox and Chrome, it throws an exception.

        No new tests, updated existing test.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):

2016-08-26  Devin Rousso  <dcrousso+webkit@gmail.com>

        Web Inspector: Some CSS selectors in the UI aren't escaped
        https://bugs.webkit.org/show_bug.cgi?id=151378

        Reviewed by Joseph Pecoraro.

        No new tests, but logic and results of existing tests updated:
        * inspector/dom/content-node-region-info.html:
        * inspector/dom/content-node-region-info-expected.txt:
        * inspector/dom/highlightNode-expected.txt:
        * inspector/dom/highlightSelector.html:
        * inspector/dom/highlightSelector-expected.txt:

        * inspector/InspectorOverlay.cpp:
        (WebCore::buildObjectForElementData):

        * inspector/InspectorOverlayPage.css:
        (.pseudo-type):
        (.tag-name): Deleted.

        * inspector/InspectorOverlayPage.js:
        (_createElementTitle):

2016-08-25  Brent Fulgham  <bfulgham@apple.com>

        Crash when getting font bounding rect
        https://bugs.webkit.org/show_bug.cgi?id=161202
        <rdar://problem/27986981>

        Reviewed by Myles C. Maxfield.

        We should never store GlyphData objects for later use, because they contain raw pointers to Font elements
        contained in caches, and those font caches get periodically purged.

        Instead, we should hold onto the ‘key’ representing the GlyphData, and simply ask the system for the
        GlyphData the next time it is needed.

        Tested by existing MathML tests under ASAN and GuardMalloc.

        * rendering/mathml/RenderMathMLToken.cpp:
        (WebCore::RenderMathMLToken::RenderMathMLToken): Clean up constructors.
        (WebCore::RenderMathMLToken::computePreferredLogicalWidths): Use keys to get correct GlyphData when needed.
        (WebCore::RenderMathMLToken::updateMathVariantGlyph): Ditto.
        (WebCore::RenderMathMLToken::firstLineBaseline): Ditto.
        (WebCore::RenderMathMLToken::layoutBlock): Ditto.
        (WebCore::RenderMathMLToken::paint): Ditto.
        (WebCore::RenderMathMLToken::paintChildren): Ditto.
        * rendering/mathml/RenderMathMLToken.h:

2016-08-26  Chris Dumez  <cdumez@apple.com>

        HTMLAreaElement's coords attributes parsing does not comply with the HTML specification
        https://bugs.webkit.org/show_bug.cgi?id=161216

        Reviewed by Andreas Kling.

        HTMLAreaElement's coords attributes parsing does not comply with the HTML specification:
        - https://html.spec.whatwg.org/#attr-area-coords

        This patch aligns our parsing of this attribute with the specification and Chrome.

        No new tests, rebaselined existing test.

        * html/HTMLAreaElement.cpp:
        (WebCore::HTMLAreaElement::HTMLAreaElement):
        (WebCore::HTMLAreaElement::parseAttribute):
        (WebCore::HTMLAreaElement::getRegion):
        * html/HTMLAreaElement.h:
        * html/parser/HTMLParserIdioms.cpp:
        (WebCore::isHTMLSpaceOrDelimiter):
        (WebCore::isNumberStart):
        (WebCore::parseHTMLListOfOfFloatingPointNumberValuesInternal):
        (WebCore::parseHTMLListOfOfFloatingPointNumberValues):
        (WebCore::parseHTMLNonNegativeInteger): Deleted.
        * html/parser/HTMLParserIdioms.h:

2016-08-26  Csaba Osztrogonác  <ossy@webkit.org>

        Fix the !ENABLE(WEB_SOCKETS) build
        https://bugs.webkit.org/show_bug.cgi?id=161251

        Reviewed by Alex Christensen.

        * page/SocketProvider.h:

2016-08-26  Csaba Osztrogonác  <ossy@webkit.org>

        Fix the !ENABLE(WEB_TIMING) build
        https://bugs.webkit.org/show_bug.cgi?id=161250

        Reviewed by Alex Christensen.

        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::didFinishLoading):
        * loader/cache/CachedResourceLoader.h:
        (WebCore::CachedResourceLoader::resourceTimingInformation):

2016-08-26  Chris Dumez  <cdumez@apple.com>

        Trying to access cross-origin Location properties should throw a SecurityError
        https://bugs.webkit.org/show_bug.cgi?id=161248

        Reviewed by Alex Christensen.

        Trying to access cross-origin Location properties should throw a SecurityError:
        - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
        - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)

        Firefox and Chrome already throw. However, WebKit was logging an error message
        and returning undefined.

        No new tests, updated existing tests.

        * bindings/js/JSDOMBinding.cpp:
        (WebCore::throwSecurityError):
        * bindings/js/JSDOMBinding.h:
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::getOwnPropertySlotDelegate):

2016-08-26  Per Arne Vollan  <pvollan@apple.com>

        [Win] Warning fixes.
        https://bugs.webkit.org/show_bug.cgi?id=161241

        Reviewed by Brent Fulgham.

        MSVC warns about potential use of uninitialized variables.

        * accessibility/AXObjectCache.cpp:
        * css/parser/CSSParserValues.cpp:

2016-08-26  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Add support for OverConstrainedErrorEvent
        https://bugs.webkit.org/show_bug.cgi?id=161199
        <rdar://problem/28011819>

        Reviewed by Jer Noble.

        Test: fast/events/constructors/overconstrained-error-event-constructor.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/mediastream/OverconstrainedErrorEvent.h: Added.
        (WebCore::OverconstrainedErrorEvent::~OverconstrainedErrorEvent):
        (WebCore::OverconstrainedErrorEvent::create):
        (WebCore::OverconstrainedErrorEvent::createForBindings):
        (WebCore::OverconstrainedErrorEvent::error):
        (WebCore::OverconstrainedErrorEvent::eventInterface):
        (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
        * Modules/mediastream/OverconstrainedErrorEvent.idl: Added.

        * WebCore.xcodeproj/project.pbxproj: Add new files.

        * bindings/js/JSDictionary.cpp:
        (WebCore::JSDictionary::convertValue): Add OverconstrainedErrorEvent converter.
        * bindings/js/JSDictionary.h:

        * dom/EventNames.in: Add OverconstrainedErrorEvent.

2016-08-26  Frederic Wang  <fwang@igalia.com>

        The annotation-xml element does not need to be behave as an mrow
        https://bugs.webkit.org/show_bug.cgi?id=161230

        Reviewed by Manuel Rego Casasnovas.

        In r204779, MathMLAnnotationElement was made a MathMLRowElement just because the
        annotation-xml element is generating a RenderMathMLRow. This later point is actually not
        needed since annotation-xml is just a wrapper for foreign elements and so does not need to
        handle special MathML features like operator spacing or stretching. We can thus move back
        MathMLAnnotationElement to a generic MathMLPresentationElement and instead make the
        annotation-xml element generate a generic RenderMathMLBlock renderer.

        No new tests, semantics annotations already covered by existing tests.

        * mathml/MathMLAnnotationElement.cpp: Replace RenderMathMLRow.h with RenderMathMLBlock.h
        (WebCore::MathMLAnnotationElement::MathMLAnnotationElement): Inherit from
        MathMLPresentationElement instead of MathMLRowElement.
        (WebCore::MathMLAnnotationElement::createElementRenderer): Make annotation-xml create a
        RenderMathMLBlock instead of a RenderMathMLRow.
        (WebCore::MathMLAnnotationElement::attributeChanged): Inherit from MathMLPresentationElement
        instead of MathMLRowElement.
        * mathml/MathMLAnnotationElement.h: Ditto.

2016-08-26  Csaba Osztrogonác  <ossy@webkit.org>

        Typo fix after r56209
        https://bugs.webkit.org/show_bug.cgi?id=161246

        Reviewed by Gyuyoung Kim.

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

2016-08-26  Per Arne Vollan  <pvollan@apple.com>

        [Win] Warning fixes.
        https://bugs.webkit.org/show_bug.cgi?id=161077

        Reviewed by Brent Fulgham.

        * css/CSSGrammar.y.includes:
        * css/RuleFeature.cpp:
        (WebCore::makeAttributeSelectorKey):
        * editing/TextIterator.cpp:
        (WebCore::SearchBuffer::SearchBuffer):
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::textToFragment):
        * html/MediaElementSession.h:
        * platform/URL.cpp:
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        * platform/network/HTTPParsers.cpp:
        (WebCore::parseHTTPHeader):
        * rendering/InlineIterator.h:
        (WebCore::InlineIterator::clear):
        * rendering/RenderDeprecatedFlexibleBox.cpp:
        (WebCore::FlexBoxIterator::reset):
        * rendering/RenderText.cpp:
        (WebCore::RenderText::secureText):
        * rendering/mathml/RenderMathMLToken.cpp:
        (WebCore::mathVariant):
        * style/InlineTextBoxStyle.cpp:
        (WebCore::visualOverflowForDecorations):
        * xml/XPathGrammar.y:

2016-08-26  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>

        Make custom constructors consistent with generated bindings code
        https://bugs.webkit.org/show_bug.cgi?id=159550

        Reviewed by Youenn Fablet.

        Add assertion to check DOMConstructorObject* passed in ExecState is not null.
        Rename throwConstructorDocumentUnavailableError to throwConstructorScriptExecutionContextUnavailableError since
        ScriptExecutionContext is not necessarily a Document.
        Modify error message in case of argument error to be consistent with generated binding code: replace calls to
        throwVMError with calls to throwConstructorScriptExecutionContextUnavailableError and throwArgumentTypeError.

        No new test required. Modify tests and tests expectations to align with new error messages.

        * bindings/js/JSAudioContextCustom.cpp:
        (WebCore::constructJSAudioContext):
        * bindings/js/JSBlobCustom.cpp:
        (WebCore::constructJSBlob):
        * bindings/js/JSDOMBinding.cpp:
        (WebCore::throwConstructorScriptExecutionContextUnavailableError):
        * bindings/js/JSDOMBinding.h:
        * bindings/js/JSDOMConstructor.h:
        (WebCore::JSBuiltinConstructor<JSClass>::callConstructor):
        * bindings/js/JSDOMFormDataCustom.cpp:
        (WebCore::constructJSDOMFormData):
        * bindings/js/JSDataCueCustom.cpp:
        (WebCore::constructJSDataCue):
        * bindings/js/JSFileCustom.cpp:
        (WebCore::constructJSFile):
        * bindings/js/JSHTMLElementCustom.cpp:
        (WebCore::constructJSHTMLElement):
        * bindings/js/JSMediaSessionCustom.cpp:
        (WebCore::constructJSMediaSession):
        * bindings/js/JSMutationObserverCustom.cpp:
        (WebCore::constructJSMutationObserver):
        * bindings/js/JSReadableStreamPrivateConstructors.cpp:
        (WebCore::constructJSReadableStreamDefaultReader):
        * bindings/js/JSWorkerCustom.cpp:
        (WebCore::constructJSWorker):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateCallbackImplementation):
        (NativeToJSValue):
        (GenerateHashTableValueArray):
        (GenerateConstructorDefinition):
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        (WebCore::JSTestEventConstructorConstructor::construct):
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        (WebCore::JSTestInterfaceConstructor::construct):
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        (WebCore::JSTestNamedConstructorNamedConstructor::construct):
        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::JSTestNodeConstructor::construct):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::JSTestObjConstructor::construct):
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        (WebCore::constructJSTestOverloadedConstructors1):
        (WebCore::constructJSTestOverloadedConstructors2):
        (WebCore::constructJSTestOverloadedConstructors3):
        (WebCore::constructJSTestOverloadedConstructors4):
        (WebCore::constructJSTestOverloadedConstructors5):
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
        (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        (WebCore::JSTestTypedefsConstructor::construct):

2016-08-25  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK+ build after r204986 and r204996.

        * page/DOMWindow.idl:

2016-08-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        Dragging against the end of the inline media scrubber causes the media scrubber to hide
        https://bugs.webkit.org/show_bug.cgi?id=161207

        Reviewed by Eric Carlson.

        Previously, we would re-enable behavior restrictions when firing an ended event. However, if the ended event is
        caused by the user seeking to the end of the video, the media controls would be taken away from under the user.
        To prevent this, we don't add the relevant behavior restrictions upon media ended if media was seeking before
        firing the event.

        Tweaked an existing WebKit API test to cover this change.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
        (WebCore::HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary):
        * html/HTMLMediaElement.h:
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::canControlControlsManager):

2016-08-25  Andreas Kling  <akling@apple.com>

        REGRESSION: RELEASE_ASSERT in ResourceUsageThread::platformThreadBody when ASan is enabled
        <https://webkit.org/b/161203>
        <rdar://problem/28011251>

        Reviewed by Joseph Pecoraro.

        * page/cocoa/ResourceUsageThreadCocoa.mm:
        (WebCore::ResourceUsageThread::platformThreadBody): Remove overly optimistic assertions about
        "GC owned" memory never being higher than total malloc memory usage. This accounting is not
        really exact and pretending otherwise will just lead to crashes.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::externalMemoryCost): Hook up HTMLCanvasElement to the ImageBuffer
        helper for reporting external memory cost. This makes accounting slightly more correct.

2016-08-25  Chris Dumez  <cdumez@apple.com>

        Regression(r203623): Breaks App Store application
        https://bugs.webkit.org/show_bug.cgi?id=161206
        <rdar://problem/28015060>

        Reviewed by Ryosuke Niwa.

        Add quirks for the App Store application so that we log an error message
        when passing a Document node to Window.getComputedStyle() instead of
        throwing an exception.

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::getComputedStyle):
        * page/DOMWindow.h:
        * page/DOMWindow.idl:
        * platform/RuntimeApplicationChecks.h:
        * platform/RuntimeApplicationChecks.mm:
        (WebCore::MacApplication::isAppStore):

2016-08-25  Said Abou-Hallawa  <sabouhallawa@apple.com>

        REGRESSION (r203378): [iOS] The PDF image is rendered stretched if a sub image of it is cached first
        https://bugs.webkit.org/show_bug.cgi?id=160617

        Reviewed by Tim Horton.

        When caching only a sub-image of the PDF ensure the source rectangle starts
        at the top-left of the cached sub-image rectangle. When drawing the cached 
        sub-image to the destination context ensure the destination rectangle is the
        sub-image rectangle so no stretching or shrinking happens.

        Test: fast/images/cached-clipped-pdf.html

        * page/Settings.cpp:
        (WebCore::Settings::Settings):
        (WebCore::Settings::setCachedPDFImageEnabled): Deleted.
        * page/Settings.h:
        (WebCore::Settings::isCachedPDFImageEnabled): Deleted.
        * page/Settings.in:
        Change the boolean setting CachedPDFImageEnabled to be enum property and
        rename it PDFImageCachingPolicy. Allow the "PDFImageCachingBelowMemoryLimit"
        option to be available on a;; platforms. The "PDFImageCachingClipBoundsOnly"
        option is added for testing purpose. If forces recaching the PDF with each
        draw and it sets the cached image rectangle to the clipping rectangle.
        
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::setPdfImageCachingPolicy): Take an enum instead of boolean.
        (WebCore::cachedImageRect): 
        (WebCore::PDFDocumentImage::decodedSizeChanged): Enable PDFImageCachingBelowMemoryLimit
        on all platforms.
        (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Fix the source rectangle
        when caching a sub-image of the PDF.
        (WebCore::PDFDocumentImage::draw): Fix the destination rectangle when drawing
        a sub-image to the destination context.
        (WebCore::PDFDocumentImage::setCachedPDFImageEnabled): Deleted.
        * platform/graphics/cg/PDFDocumentImage.h:
        
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintIntoRect):
        
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::Backup::Backup):
        (WebCore::InternalSettings::Backup::restoreTo):
        (WebCore::InternalSettings::setPDFImageCachingPolicy):
        (WebCore::InternalSettings::setCachedPDFImageEnabled): Deleted.
        * testing/InternalSettings.h:
        * testing/InternalSettings.idl:
        Change the internal setting CachedPDFImageEnabled to PDFImageCachingPolicy.

2016-08-25  Zalan Bujtas  <zalan@apple.com>

        Infinite recursion crash in WebCore::RenderBlockFlow::layoutBlock
        https://bugs.webkit.org/show_bug.cgi?id=139474
        <rdar://problem/27705190>

        Reviewed by David Hyatt.

        We should just give up trying to avoid widow when the page is too small to break line.

        Test: fast/multicol/assert-on-small-page-height-with-widow.html

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::clearShouldBreakAtLineToAvoidWidowIfNeeded):
        (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
        * rendering/RenderBlockFlow.h:

2016-08-24  Sam Weinig  <sam@webkit.org>

        Add the ability to override the implementation name of IDL enums and dictionaries
        https://bugs.webkit.org/show_bug.cgi?id=161185

        Reviewed by Anders Carlsson.

        * bindings/scripts/CodeGenerator.pm:
        (ProcessDocument):
        Build a dictionary of IDL name -> implementation name overrides
        for enums and dictionaries up front based on ImplementedAs extended
        attribute.

        (HasEnumImplementationNameOverride):
        (GetEnumImplementationNameOverride):
        (HasDictionaryImplementationNameOverride):
        (GetDictionaryImplementationNameOverride):
        Expose predicate and getter for name overrides.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GetEnumerationClassName):
        (GetDictionaryClassName):
        Use the override names as necessary.

        * bindings/scripts/test/TestObj.idl:
        Add tests for enums and dictionaries with ImplementedAs extended
        attributes.

2016-08-25  Johan K. Jensen  <johan_jensen@apple.com>

        Don't store networkLoadTiming in the disk cache
        https://bugs.webkit.org/show_bug.cgi?id=161161

        Reviewed by Antti Koivisto.

        No functionality changed. So, no new tests.

        * platform/network/ResourceResponseBase.h:
        (WebCore::ResourceResponseBase::encode):
        (WebCore::ResourceResponseBase::decode):

2016-08-25  Johan K. Jensen  <johan_jensen@apple.com>

        Update the Resource Timing implementation
        https://bugs.webkit.org/show_bug.cgi?id=161068

        Reviewed by Alex Christensen.

        Tests: imported/w3c/web-platform-tests/resource-timing/resource-timing.html
               imported/w3c/web-platform-tests/resource-timing/test_resource_timing.html

        Update the Resource Timing implementation for better compatibility with the Resource Timing API spec.
        Use LoadTiming for general timing information about a resources load timeline.
        Mark timestamps for newly loaded resources as well as cached resources.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::startLoadingMainResource):
        StartTime and fetchStart should be equal initially.

        * loader/LoadTiming.cpp:
        (WebCore::LoadTiming::LoadTiming): Moved member initialization out. Removed constructor.
        * loader/LoadTiming.h:
        (WebCore::LoadTiming::markStartTimeAndFetchStart):
        Mark startTime and fetchStart simultaneously.

        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::init):
        Mark the start time of resources.

        * loader/ResourceLoader.h:
        (WebCore::ResourceLoader::loadTiming):
        Add LoadTiming info to handle a resources load timing.

        * loader/ResourceTimingInformation.cpp:
        (WebCore::ResourceTimingInformation::addResourceTiming):
        * loader/ResourceTimingInformation.h:
        Only pass in the URL from the ResourceRequest.
        Pass LoadTiming instead of timestamps.

        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::willSendRequestInternal):
        Mark redirects.

        (WebCore::SubresourceLoader::didFinishLoading):
        Mark the responseEnd timestamp.
        Add the ResourceEntry to the timeline before notifyDone is called.

        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestResource):
        (WebCore::CachedResourceLoader::revalidateResource):
        (WebCore::CachedResourceLoader::loadDone):
        Mark timestamps for cached resources and use them instead of a cached LoadTiming.

        * loader/cache/CachedResourceLoader.h:
        (WebCore::CachedResourceLoader::resourceTimingInformation):
        Add ResourceTimingInformation getter so SubresourceLoader.cpp can add entries before callbacks.

        * page/Performance.cpp:
        (WebCore::Performance::addResourceTiming):
        * page/Performance.h:
        Update signature: URLs and LoadTiming instead of timestamps.

        * page/PerformanceResourceTiming.cpp:
        (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
        (WebCore::PerformanceResourceTiming::redirectStart):
        (WebCore::PerformanceResourceTiming::redirectEnd):
        (WebCore::PerformanceResourceTiming::fetchStart):
        (WebCore::PerformanceResourceTiming::domainLookupStart):
        (WebCore::PerformanceResourceTiming::domainLookupEnd):
        (WebCore::PerformanceResourceTiming::connectStart):
        (WebCore::PerformanceResourceTiming::connectEnd):
        (WebCore::PerformanceResourceTiming::requestStart):
        (WebCore::PerformanceResourceTiming::responseStart):
        (WebCore::PerformanceResourceTiming::responseEnd):
        (WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds):
        * page/PerformanceResourceTiming.h:
        Update signatures and properties to use LoadTiming.
        Use LoadTiming’s redirectStart/End, fetchStart, responseStart/End.
        Make sure dns and connection timestamps are in increasing order, even when cached.

        * page/PerformanceResourceTiming.idl:
        Add responseStart.

2016-08-24  Anders Carlsson  <andersca@apple.com>

        Simplify createMouseEvent in DragController
        https://bugs.webkit.org/show_bug.cgi?id=161168

        Reviewed by Dan Bernstein.

        * page/DragController.cpp:
        (WebCore::createMouseEvent):
        * platform/DragData.cpp:
        (WebCore::DragData::modifierKeyState): Deleted.
        * platform/DragData.h:

2016-08-25  Chris Dumez  <cdumez@apple.com>

        DOMTokenList.value should be a stringifier attribute
        https://bugs.webkit.org/show_bug.cgi?id=161195

        Reviewed by Darin Adler.

        DOMTokenList.value should be a stringifier attribute:
        - https://dom.spec.whatwg.org/#domtokenlist

        No new tests, this change is not observable from the Web.

        * html/DOMTokenList.h:
        (WebCore::DOMTokenList::toString): Deleted.
        * html/DOMTokenList.idl:
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::iconSizes): Deleted.
        * html/HTMLLinkElement.h:

2016-08-25  Csaba Osztrogonác  <ossy@webkit.org>

        [Mac][cmake] Unreviewed speculative buildfix after r204852, just for fun.

        * PlatformMac.cmake:

2016-08-24  Frederic Wang  <fwang@igalia.com>

        Do not store layout parameters on the RenderMathMLRoot class
        https://bugs.webkit.org/show_bug.cgi?id=161132

        Reviewed by Darin Adler.

        Storing layout parameters on the RenderMathMLRoot class is not really needed since reading
        the parameters from the MATH table is not too expensive and updateStyle() is currently always
        called in layoutBlock() and computePreferredLogicalWidths(). Most of these parameters are
        actually only used in layoutBlock(). We separate horizontal and vertical parameters since
        the latter are not needed for preferred width calculations. This removes the need for calling
        an updateStyle functions and may also fix update issues when zooming in or out.

        No new tests, already covered by existing tests.

        * rendering/mathml/MathMLStyle.cpp:
        (WebCore::MathMLStyle::updateStyleIfNeeded): No need to update layout parameters for the
        RenderMathMLRoot class.
        * rendering/mathml/RenderMathMLRoot.cpp:
        (WebCore::RenderMathMLRoot::styleDidChange): No need to update layout parameters.
        (WebCore::RenderMathMLRoot::horizontalParameters): Move code from updateStyle to retrieve the
        horizontal parameters.
        (WebCore::RenderMathMLRoot::verticalParameters): Ditto for vertical parameters.
        (WebCore::RenderMathMLRoot::computePreferredLogicalWidths): Call horizontalParameters() to
        get the kernings of the index instead of calling updateStyle().
        (WebCore::RenderMathMLRoot::layoutBlock): Call horizontalParameters() and
        verticalParameters() to get the layout parameters instead of calling updateStyle().
        (WebCore::RenderMathMLRoot::paint): Call horizontalParameters() and verticalParameters()
        to get the layout parameters.
        (WebCore::RenderMathMLRoot::updateFromElement): Deleted. No need to call updateStyle().
        (WebCore::RenderMathMLRoot::updateStyle): Deleted.
        * rendering/mathml/RenderMathMLRoot.h: Do not override updateFromElement(). Replace some
        layout parameters stored on the class with struct and helper functions to manipulate them.

2016-08-24  Chris Dumez  <cdumez@apple.com>

        WorkerLocation.prototype.toString() should be enumerable
        https://bugs.webkit.org/show_bug.cgi?id=161183

        Reviewed by Ryosuke Niwa.

        WorkerLocation.prototype.toString() should be enumerable:
        - https://html.spec.whatwg.org/#workerlocation
        - http://heycam.github.io/webidl/#es-stringifier

        No new tests, updated existing test.

        * workers/WorkerLocation.h:
        (WebCore::WorkerLocation::toString): Deleted.
        * workers/WorkerLocation.idl:
        Also use USVString string type instead of DOMString to match the
        specification. There is no behavior change because those attributes
        are readonly.

2016-08-24  Chris Dumez  <cdumez@apple.com>

        Location.toString() should be enumerable
        https://bugs.webkit.org/show_bug.cgi?id=161179

        Reviewed by Geoffrey Garen.

        Location.toString() should be enumerable as per:
        - https://html.spec.whatwg.org/#location
        - http://heycam.github.io/webidl/#es-stringifier

        This patch stops hard-coding the toString() operation on the Location
        interface and makes the 'href' attribute a stringifier attribute instead,
        as per the specification. The generated toString() has the same behavior
        as it used to but it is now enumerable, as it should.

        No new tests, updated existing test.

        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::toStringFunction): Deleted.
        * page/Location.idl:

2016-08-24  Joseph Pecoraro  <pecoraro@apple.com>

        Implement `CSS.escape` as per CSSOM
        https://bugs.webkit.org/show_bug.cgi?id=126337

        Reviewed by Dean Jackson.

        Test: css3/escape-dom-api.html

        * css/CSSOMUtils.cpp:
        (WebCore::serializeIdentifier):
        Update serialization to match the latest version of the spec:
        <https://drafts.csswg.org/cssom/#serialize-an-identifier>
        New handling for 0x0, 0x7f, just "-", and "--" is now allowed.

        * css/DOMCSSNamespace.cpp:
        (WebCore::DOMCSSNamespace::escape):
        * css/DOMCSSNamespace.h:
        * css/DOMCSSNamespace.idl:
        New CSS.escape method.

2016-08-24  Zalan Bujtas  <zalan@apple.com>

        ASSERTION FAILED: contentSize >= 0 in WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax
        https://bugs.webkit.org/show_bug.cgi?id=155700
        <rdar://problem/27720727>

        Reviewed by David Hyatt.

        RenderBox::m_minPreferredLogicalWidth/m_maxPreferredLogicalWidth don't need special initial value since
        preferredLogicalWidthsDirty flag guards them. -1 as initial value can cause problems for renderers that don't
        override RenderBox::computePreferredLogicalWidths().    

        Test: fast/ruby/assert-when-content-size-is-negative.html

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::RenderBox):
        (WebCore::RenderBox::dirtyLineBoxes):
        (WebCore::RenderBox::deleteLineBoxWrapper):
        * rendering/RenderBox.h:

2016-08-24  Alex Christensen  <achristensen@webkit.org>

        Import w3c URL tests
        https://bugs.webkit.org/show_bug.cgi?id=161177

        Reviewed by Tim Horton.

        Tests: imported/w3c/web-platform-tests/url/a-element-xhtml.xhtml
               imported/w3c/web-platform-tests/url/a-element.html
               imported/w3c/web-platform-tests/url/historical.html
               imported/w3c/web-platform-tests/url/interfaces.html
               imported/w3c/web-platform-tests/url/url-constructor.html
               imported/w3c/web-platform-tests/url/url-domainToUnicode.html
               imported/w3c/web-platform-tests/url/url-setters.html
               imported/w3c/web-platform-tests/url/urlsearchparams-append.html
               imported/w3c/web-platform-tests/url/urlsearchparams-constructor.html
               imported/w3c/web-platform-tests/url/urlsearchparams-delete.html
               imported/w3c/web-platform-tests/url/urlsearchparams-get.html
               imported/w3c/web-platform-tests/url/urlsearchparams-getall.html
               imported/w3c/web-platform-tests/url/urlsearchparams-has.html
               imported/w3c/web-platform-tests/url/urlsearchparams-set.html
               imported/w3c/web-platform-tests/url/urlsearchparams-stringifier.html

        * platform/URL.cpp:
        (WebCore::URL::setQuery):

2016-08-24  Ryan Haddad  <ryanhaddad@apple.com>

        Rebaseline bindings tests after r204923.

        Unreviewed test gardening.

        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        (WebCore::jsTestActiveDOMObjectExcitingAttr):
        (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):

2016-08-24  Jonathan Bedard  <jbedard@apple.com>

        FocusController multiple dereferenced NULL pointers
        https://bugs.webkit.org/show_bug.cgi?id=160808

        Reviewed by Darin Adler.

        No new tests needed, fix does not change functionality.

        This change fixes a number of NULL pointer dereferences which occur in FocusController.

        * page/FocusController.cpp:
        (WebCore::isFocusableElementOrScopeOwner): Changed KeyboardEvent reference to pointer.
        (WebCore::isNonFocusableScopeOwner): Ditto.
        (WebCore::isFocusableScopeOwner): Ditto.
        (WebCore::shadowAdjustedTabIndex): Ditto.

        (WebCore::FocusController::findFocusableElementAcrossFocusScope): Pass pointer instead of reference to KeyboardEvent.
        (WebCore::FocusController::nextFocusableElementWithinScope): Ditto.
        (WebCore::FocusController::previousFocusableElementWithinScope): Ditto.
        (WebCore::FocusController::findElementWithExactTabIndex): Ditto.
        (WebCore::nextElementWithGreaterTabIndex): Ditto.
        (WebCore::previousElementWithLowerTabIndex): Ditto.
        (WebCore::FocusController::nextFocusableElementOrScopeOwner): Ditto.
        (WebCore::FocusController::previousFocusableElementOrScopeOwner): Ditto.
        (WebCore::relinquishesEditingFocus): Ditto.

2016-08-24  Nan Wang  <n_wang@apple.com>

        AX: VoiceOver on iOS ignores aria-checked on menuitemradio and menuitemcheckbox
        https://bugs.webkit.org/show_bug.cgi?id=161118

        Reviewed by Chris Fleizach.

        Added checkboxOrRadioValue and toggle trait to menuitemradio and menuitemcheckbox.

        Test: accessibility/ios-simulator/menuitem-checked.html

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper accessibilityTraits]):
        (-[WebAccessibilityObjectWrapper accessibilityValue]):

2016-08-24  Chris Dumez  <cdumez@apple.com>

        Assertion hit: ASSERT(!m_parserScheduler) in ~HTMLDocumentParser()
        https://bugs.webkit.org/show_bug.cgi?id=161083
        <rdar://problem/27986937>

        Reviewed by Darin Adler.

        Call cancelParsing() right before re-creating the new parser in
        Document::implicitOpen(). We would previously call removeChildren()
        in between which is was an issue because it can cause JS to be
        executed and therefore the parser to be re-created after we have
        cancelled parsing.

        No new tests, unskipped html/browsers/browsing-the-web/unloading-documents/004.html
        which was consistently crashing.

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

2016-08-24  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Add support for OverConstrained Error
        https://bugs.webkit.org/show_bug.cgi?id=160790
        <rdar://problem/27815715>

        Reviewed by Jer Noble.

        Existing tests updated.

        * DerivedSources.make:
        * Modules/mediastream/OverconstrainedError.h: Added.
        (WebCore::OverconstrainedError::create):
        (WebCore::OverconstrainedError::constraint):
        (WebCore::OverconstrainedError::message):
        (WebCore::OverconstrainedError::OverconstrainedError):
        * Modules/mediastream/OverconstrainedError.idl: Added.
        * WebCore.xcodeproj/project.pbxproj:

2016-08-24  Anders Carlsson  <andersca@apple.com>

        Build the platform name dynamically for the phony WebKitLegacy framework
        https://bugs.webkit.org/show_bug.cgi?id=161163

        Reviewed by Dan Bernstein.

        * Configurations/WebKitLegacyStub.iOS.tbd:
        * WebCore.xcodeproj/project.pbxproj:

2016-08-24  Chris Dumez  <cdumez@apple.com>

        It should not be possible to access Location attributes cross origin
        https://bugs.webkit.org/show_bug.cgi?id=161125
        <rdar://problem/27982472>

        Reviewed by Brent Fulgham.

        It should not be possible to access Location attributes cross origin:
        - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)

        We allow access to replace() as per the specification and consistently
        with Firefox. The specification seems to indicate we should allow access
        to 'href' but Firefox does not and we previously did not so I am not
        allowing it in this patch.

        Test: http/tests/security/location-cross-origin.html

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):
        * page/Location.idl:

2016-08-24  Joseph Pecoraro  <pecoraro@apple.com>

        Add User Timing to the feature status page
        https://bugs.webkit.org/show_bug.cgi?id=161154

        Reviewed by Darin Adler.

        * features.json:

2016-08-24  Andreas Kling  <akling@apple.com>

        Leaks bot hits an assertion in ResourceUsageThread::platformThreadBody
        <https://webkit.org/b/160534>

        Reviewed by Joseph Pecoraro.

        Use the correct malloc bucket when bmalloc is disabled (which is the case on leaks bots.)

        * page/cocoa/ResourceUsageThreadCocoa.mm:
        (WebCore::ResourceUsageThread::platformThreadBody):

2016-08-24  Filip Pizlo  <fpizlo@apple.com>

        Unreviewed, roll out r204901, r204897, r204866, r204856, r204854.

        * ForwardingHeaders/heap/HeapInlines.h: Removed.
        * ForwardingHeaders/interpreter/Interpreter.h: Added.
        * ForwardingHeaders/runtime/AuxiliaryBarrierInlines.h: Removed.
        * Modules/indexeddb/IDBCursorWithValue.cpp:
        * Modules/indexeddb/client/TransactionOperation.cpp:
        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        * bindings/js/JSApplePayPaymentAuthorizedEventCustom.cpp:
        * bindings/js/JSApplePayPaymentMethodSelectedEventCustom.cpp:
        * bindings/js/JSApplePayShippingContactSelectedEventCustom.cpp:
        * bindings/js/JSApplePayShippingMethodSelectedEventCustom.cpp:
        * bindings/js/JSClientRectCustom.cpp:
        * bindings/js/JSDOMBinding.cpp:
        * bindings/js/JSDOMBinding.h:
        * bindings/js/JSDeviceMotionEventCustom.cpp:
        * bindings/js/JSDeviceOrientationEventCustom.cpp:
        * bindings/js/JSErrorEventCustom.cpp:
        * bindings/js/JSIDBCursorWithValueCustom.cpp:
        * bindings/js/JSIDBIndexCustom.cpp:
        * bindings/js/JSPopStateEventCustom.cpp:
        * bindings/js/JSWebGL2RenderingContextCustom.cpp:
        * bindings/js/JSWorkerGlobalScopeCustom.cpp:
        * bindings/js/WorkerScriptController.cpp:
        * contentextensions/ContentExtensionParser.cpp:
        * dom/ErrorEvent.cpp:
        * html/HTMLCanvasElement.cpp:
        * html/MediaDocument.cpp:
        * inspector/CommandLineAPIModule.cpp:
        * loader/EmptyClients.cpp:
        * page/CaptionUserPreferences.cpp:
        * page/Frame.cpp:
        * page/PageGroup.cpp:
        * page/UserContentController.cpp:
        * platform/mock/mediasource/MockBox.cpp:
        * testing/GCObservation.cpp:

2016-08-24  Zalan Bujtas  <zalan@apple.com>

        ASSERTION FAILED: childrenInline() in WebCore::RenderBlockFlow::hasLines
        https://bugs.webkit.org/show_bug.cgi?id=139396
        <rdar://problem/27704339>

        Reviewed by David Hyatt.

        RenderBlockFlow::hasLines() should be able to handle the block-children case.

        Test: fast/ruby/assert-with-block-rt-child-and-emphasis.html

        * rendering/RenderBlock.h:
        (WebCore::RenderBlock::hasLines): Deleted.
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::hasLines):
        * rendering/RenderBlockFlow.h:

2016-08-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GObject DOM bindings API break after r204624 and r204648.

        prefix, namespaceURI and localName attributes were moved from Node to Attr/Element in r204624 and prefix was
        also made readonly in r204648.

        * bindings/gobject/WebKitDOMDeprecated.cpp:
        (webkit_dom_node_get_namespace_uri):
        (webkit_dom_node_get_prefix):
        (webkit_dom_node_set_prefix):
        (webkit_dom_node_get_local_name):
        * bindings/gobject/WebKitDOMDeprecated.h:
        * bindings/gobject/WebKitDOMDeprecated.symbols:
        * bindings/gobject/webkitdom.symbols:

2016-08-23  Simon Fraser  <simon.fraser@apple.com>

        Add some logging for WKSelectionDrawingInfo
        https://bugs.webkit.org/show_bug.cgi?id=161055

        Reviewed by Tim Horton.

        Add TextStream dumping for SelectionRect.

        * platform/ios/SelectionRect.cpp:
        (WebCore::operator<<):
        * platform/ios/SelectionRect.h:

2016-08-23  Frederic Wang  <fwang@igalia.com>

        More consistent header inclusions in the MathML module
        https://bugs.webkit.org/show_bug.cgi?id=161080

        Reviewed by Darin Adler.

        We adjust header inclusion in the MathML module so that:
        - implementation file's own header is outside the #if ENABLE(MATHML)
        - There is always a blank line after the #if ENABLE(MATHML)

        No new tests, behavior is unchanged.

        * mathml/MathMLAnnotationElement.cpp:
        * mathml/MathMLAnnotationElement.h:
        * mathml/MathMLElement.cpp:
        * mathml/MathMLFractionElement.cpp:
        * mathml/MathMLFractionElement.h:
        * mathml/MathMLMathElement.cpp:
        * mathml/MathMLMathElement.h:
        * mathml/MathMLMencloseElement.cpp:
        * mathml/MathMLMencloseElement.h:
        * mathml/MathMLOperatorDictionary.cpp:
        * mathml/MathMLOperatorElement.cpp:
        * mathml/MathMLOperatorElement.h:
        * mathml/MathMLPaddedElement.cpp:
        * mathml/MathMLPaddedElement.h:
        * mathml/MathMLPresentationElement.cpp:
        * mathml/MathMLPresentationElement.h:
        * mathml/MathMLRowElement.cpp:
        * mathml/MathMLRowElement.h:
        * mathml/MathMLScriptsElement.cpp:
        * mathml/MathMLScriptsElement.h:
        * mathml/MathMLSelectElement.h:
        * mathml/MathMLSpaceElement.cpp:
        * mathml/MathMLSpaceElement.h:
        * mathml/MathMLTokenElement.cpp:
        * mathml/MathMLUnderOverElement.cpp:
        * mathml/MathMLUnderOverElement.h:
        * rendering/mathml/MathMLStyle.cpp:
        * rendering/mathml/MathOperator.cpp:
        * rendering/mathml/MathOperator.h:
        * rendering/mathml/RenderMathMLBlock.cpp:
        * rendering/mathml/RenderMathMLFenced.cpp:
        * rendering/mathml/RenderMathMLFencedOperator.cpp:
        * rendering/mathml/RenderMathMLFraction.cpp:
        * rendering/mathml/RenderMathMLMath.cpp:
        * rendering/mathml/RenderMathMLMenclose.cpp:
        * rendering/mathml/RenderMathMLMenclose.h:
        * rendering/mathml/RenderMathMLOperator.cpp:
        * rendering/mathml/RenderMathMLRoot.cpp:
        * rendering/mathml/RenderMathMLRow.cpp:
        * rendering/mathml/RenderMathMLScripts.cpp:
        * rendering/mathml/RenderMathMLUnderOver.cpp:

2016-08-23  Zalan Bujtas  <zalan@apple.com>

        ASSERTION FAILED: !view().layoutStateEnabled() || style().styleType() == FIRST_LETTER in WebCore::RenderInline::clippedOverflowRectForRepaint
        https://bugs.webkit.org/show_bug.cgi?id=155363
        <rdar://problem/27720434>

        Reviewed by David Hyatt.

        Loosen ASSERT to include calls when the inline has a self painting layer. It's valid to end up here during layout when
        the layer's composite state changes.

        Test: fast/layers/assert-on-self-painting-inline-with-scrolling.html

        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::clippedOverflowRectForRepaint):

2016-08-23  Anders Carlsson  <andersca@apple.com>

        Create a phony WebKitLegacy framework that the WebCoreTestSupport dylib can find
        https://bugs.webkit.org/show_bug.cgi?id=161123

        Reviewed by Dan Bernstein.

        * Configurations/WebCore.xcconfig:
        Use the WebKitLegacy.tbd file from the phony framework.

        * Configurations/WebCoreTestSupport.xcconfig:
        Look for WebKitLegacy.framework in the phony framework path.

        * WebCore.xcodeproj/project.pbxproj:
        Add a new phase that creates a phony WebKitLegacy framework.

2016-08-23  Chris Dumez  <cdumez@apple.com>

        Add support for CanvasRenderingContext2D.resetTransform()
        https://bugs.webkit.org/show_bug.cgi?id=161089

        Reviewed by Simon Fraser.

        Add support for CanvasRenderingContext2D.resetTransform():
        - https://html.spec.whatwg.org/#dom-context-2d-resettransform

        Firefox and Chrome already support this.

        Tests:
        imported/blink/fast/canvas/canvas-resetTransform.html
        imported/w3c/web-platform-tests/2dcontext/transformations/canvas_transformations_reset_001.html

        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::setTransform):
        (WebCore::CanvasRenderingContext2D::resetTransform):
        * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/CanvasRenderingContext2D.idl:

2016-08-23  Said Abou-Hallawa  <sabouhallawa@apple.com>

        REGRESSION: SVG clip-path doesn't work on root <svg>
        https://bugs.webkit.org/show_bug.cgi?id=129180

        Reviewed by Tim Horton.

        Build the resources cache for the RenderSVGRoot element when it's been
        inserted in the render tree. Remove the resources cache before removing
        the RenderSVGRoot from the render tree. No worries for the child <svg>
        elements since their renderers are of type RenderSVGViewportContainer.

        Tests: svg/clip-path/clip-path-on-svg-003.svg
               svg/clip-path/clip-path-on-svg-004.svg

        * rendering/svg/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::insertedIntoTree):
        (WebCore::RenderSVGRoot::willBeRemovedFromTree):
        * rendering/svg/RenderSVGRoot.h:
        These changes are very similar to what we do for adding and removing the
        child SVG elements in RenderSVGRoot::addChild() and removeChild().

2016-08-23  Chris Dumez  <cdumez@apple.com>

        HTMLAreaElement should have a stringifier
        https://bugs.webkit.org/show_bug.cgi?id=161105

        Reviewed by Geoffrey Garen.

        HTMLAreaElement should have a stringifier:
        - https://html.spec.whatwg.org/multipage/embedded-content.html#htmlareaelement
        - https://html.spec.whatwg.org/multipage/semantics.html#htmlhyperlinkelementutils
        - http://heycam.github.io/webidl/#idl-stringifiers
        - http://heycam.github.io/webidl/#es-stringifier

        Chrome and Firefox already support this.

        This patch does the following:
        - Add support for stringifier on attributes to our bindings generator.
        - Add stringifier to the HTMLHyperlinkElementUtils.href attribute as
          per the specification
        - Drops the explicit toString on HTMLAnchorElement as HTMLAnchorElement
          implements HTMLHyperlinkElementUtils.

        Test: fast/dom/toString_attributes.html

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateInterface):
        (AddStringifierOperationIfNeeded):
        * bindings/scripts/IDLParser.pm:
        (parseAttributeOrOperationOrIterator):
        * html/HTMLAnchorElement.cpp:
        (WebCore::HTMLAnchorElement::toString): Deleted.
        * html/HTMLAnchorElement.h:
        * html/HTMLAnchorElement.idl:
        * html/HTMLHyperlinkElementUtils.idl:

2016-08-23  Alex Christensen  <achristensen@webkit.org>

        Fix clean Windows build.

        * PlatformWin.cmake:
        Add another forwarding headers directory.

2016-08-23  Zalan Bujtas  <zalan@apple.com>

        ASSERTION FAILED: hasOverflowingCell == this->hasOverflowingCell() in WebCore::RenderTableSection::computeOverflowFromCells
        https://bugs.webkit.org/show_bug.cgi?id=155702
        <rdar://problem/27720731>

        Reviewed by David Hyatt.

        The simplified layout path for table/section should also clear the slow path flag for visual overflow (since it recomputes
        the overflow for the descendant cells). 

        Test: fast/table/assert-when-visual-overflow-is-cleared.html

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

2016-08-23  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Reduce uses of CGFonts
        https://bugs.webkit.org/show_bug.cgi?id=160896

        Reviewed by Darin Adler.

        There are a few places where we unnecessarily use CGFonts instead of
        CTFonts. We have had an ongoing effort throughout the past few years
        of elliminating all of our uses of CGFonts, and this patch moves us
        in that direction.

        Most of the changes in this patch are straightforward (e.g.
        CGFontGetUnitsPerEm() -> CTFontGetUnitsPerEm()). However, there is
        one notable change: from CGContextShowGlyphsWithAdvances() to
        CTFontDrawGlyphs(). This migration does not cause a performance
        regression.

        No new tests because there is no behavior change.

        * WebCore.xcodeproj/project.pbxproj: Delete unnecessary
        FontServicesIOS files.
        * platform/graphics/FontMetrics.h:
        (WebCore::FontMetrics::xHeight): Migrate to Optional<float>
        (WebCore::FontMetrics::setXHeight):
        (WebCore::FontMetrics::hasXHeight):
        (WebCore::FontMetrics::hasCapHeight): Ditto.
        (WebCore::FontMetrics::floatCapHeight):
        (WebCore::FontMetrics::setCapHeight):
        (WebCore::FontMetrics::capHeight):
        (WebCore::FontMetrics::setZeroWidth): No one ever used the
        m_hasZeroWidth variable, so this patch removes it.
        (WebCore::FontMetrics::reset):
        (WebCore::FontMetrics::FontMetrics): Deleted.
        (WebCore::FontMetrics::setHasXHeight): Deleted. No one ever calls
        this, so this patch removes it.
        (WebCore::FontMetrics::hasZeroWidth): Deleted.
        (WebCore::FontMetrics::setHasZeroWidth): Deleted.
        * platform/graphics/cocoa/FontCascadeCocoa.mm:
        (WebCore::TextMatrixRestorer::TextMatrixRestorer): Rather than leaving
        the text matrix stale after using it, this class cleans it up after us.
        This means that the text matrix doesn't have to be reset in other places
        which draw text.
        (WebCore::TextMatrixRestorer::~TextMatrixRestorer):
        (WebCore::TextMatrixRestorer::savedMatrix):
        (WebCore::showGlyphsWithAdvances): Migrate from
        CGContextShowGlyphsWithAdvances() to CTFontDrawGlyphs()
        (WebCore::FontCascade::drawGlyphs): See above comment about the text
        matrix.
        (WebCore::RenderingStyleSaver::RenderingStyleSaver): Deleted.
        (WebCore::RenderingStyleSaver::~RenderingStyleSaver): Deleted.
        * platform/graphics/cocoa/FontCocoa.mm:
        (WebCore::shouldUseAdjustment): Taken from FontServicesIOS.
        (WebCore::Font::platformInit): Migrate from CG to CT for some direct
        replacement API calls.
        (WebCore::Font::platformCharWidthInit): Ditto.
        (WebCore::Font::determinePitch): Ditto.
        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
        (WebCore::FontPlatformData::openTypeTable): Ditto.
        (WebCore::FontPlatformData::description): Ditto.
        * platform/graphics/ios/FontServicesIOS.h: Removed. No longer needed
        after migrating from CGContextShowGlyphsWithAdvances() to
        CTFontDrawGlyphs().
        (WebCore::FontServicesIOS::ascent): Deleted.
        (WebCore::FontServicesIOS::descent): Deleted.
        (WebCore::FontServicesIOS::lineGap): Deleted.
        (WebCore::FontServicesIOS::lineSpacing): Deleted.
        (WebCore::FontServicesIOS::xHeight): Deleted.
        (WebCore::FontServicesIOS::capHeight): Deleted.
        (WebCore::FontServicesIOS::unitsPerEm): Deleted.
        * platform/graphics/ios/FontServicesIOS.mm: Removed. Moved into
        Font::platformInit().
        (WebCore::shouldUseAdjustment): Deleted.
        (WebCore::isCourier): Deleted.
        (WebCore::FontServicesIOS::FontServicesIOS): Deleted.
        * platform/graphics/opentype/OpenTypeCG.cpp:
        (WebCore::OpenType::tryGetTypoMetrics): Migrate from CG to CT for some
        direct replacement API calls.
        * platform/graphics/opentype/OpenTypeCG.h: Ditto.
        * platform/graphics/win/FontCGWin.cpp:
        (WebCore::FontCascade::drawGlyphs): Restore the text matrix.
        * platform/graphics/win/SimpleFontDataCGWin.cpp:
        (WebCore::Font::platformWidthForGlyph): Deleted.
        * platform/spi/cg/CoreGraphicsSPI.h:
        * platform/spi/cocoa/CoreTextSPI.h:
        * rendering/RenderThemeIOS.mm:
        (WebCore::paintAttachmentText): Deleted.
        * rendering/RenderThemeMac.mm:
        (WebCore::paintAttachmentTitle): Deleted.
        (WebCore::paintAttachmentSubtitle): Deleted.

2016-08-23  Alex Christensen  <achristensen@webkit.org>

        Fix CMake build after r204852.

        * CMakeLists.txt:
        There were some non-ASCII characters here causing problems.

2016-08-22  Filip Pizlo  <fpizlo@apple.com>

        Butterflies should be allocated in Auxiliary MarkedSpace instead of CopiedSpace and we should rewrite as much of the GC as needed to make this not a regression
        https://bugs.webkit.org/show_bug.cgi?id=160125

        Reviewed by Geoffrey Garen.

        No new tests because no new WebCore behavior.
        
        Just rewiring #includes.

        * ForwardingHeaders/heap/HeapInlines.h: Added.
        * ForwardingHeaders/runtime/AuxiliaryBarrierInlines.h: Added.
        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        * bindings/js/JSApplePayPaymentAuthorizedEventCustom.cpp:
        * bindings/js/JSApplePayPaymentMethodSelectedEventCustom.cpp:
        * bindings/js/JSApplePayShippingContactSelectedEventCustom.cpp:
        * bindings/js/JSApplePayShippingMethodSelectedEventCustom.cpp:
        * bindings/js/JSClientRectCustom.cpp:
        * bindings/js/JSDOMBinding.h:
        * bindings/js/JSDOMStringListCustom.cpp:
        * bindings/js/JSErrorEventCustom.cpp:
        * bindings/js/JSPopStateEventCustom.cpp:
        * bindings/js/JSWebGL2RenderingContextCustom.cpp:
        * contentextensions/ContentExtensionParser.cpp:
        * dom/ErrorEvent.cpp:
        * inspector/CommandLineAPIModule.cpp:
        * testing/GCObservation.cpp:
        (WebCore::GCObservation::GCObservation):

2016-08-23  Brady Eidson  <beidson@apple.com>

        WK2 Gamepad layout test support.
        https://bugs.webkit.org/show_bug.cgi?id=134671

        Reviewed by Alex Christensen.

        No new tests (Covered by changes to existing tests).

        Add a MockGamepadProvider and expose it in WebCoreTestSupport.
        
        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:

        * Modules/gamepad/Gamepad.cpp:
        (WebCore::Gamepad::Gamepad):

        * bindings/generic/RuntimeEnabledFeatures.cpp:
        (WebCore::RuntimeEnabledFeatures::reset): Deleted. Gamepads should either always be enabled during tests
          (As in Mac WK2), or never enabled (As in all other platforms).
        * bindings/generic/RuntimeEnabledFeatures.h:

        * platform/gamepad/GamepadProvider.h:
        (WebCore::GamepadProvider::isMockGamepadProvider):

        * testing/MockGamepad.cpp: Copied from Source/WebKit2/Shared/Gamepad/GamepadData.cpp.
        (WebCore::MockGamepad::MockGamepad):
        (WebCore::MockGamepad::updateDetails):
        (WebCore::MockGamepad::setAxisValue):
        (WebCore::MockGamepad::setButtonValue):
        * testing/MockGamepad.h: Copied from Source/WebKit2/UIProcess/Gamepad/UIGamepad.h.

        * testing/MockGamepadProvider.cpp: Added.
        (WebCore::MockGamepadProvider::singleton):
        (WebCore::MockGamepadProvider::MockGamepadProvider):
        (WebCore::MockGamepadProvider::startMonitoringGamepads):
        (WebCore::MockGamepadProvider::stopMonitoringGamepads):
        (WebCore::MockGamepadProvider::setMockGamepadDetails):
        (WebCore::MockGamepadProvider::connectMockGamepad):
        (WebCore::MockGamepadProvider::disconnectMockGamepad):
        (WebCore::MockGamepadProvider::setMockGamepadAxisValue):
        (WebCore::MockGamepadProvider::setMockGamepadButtonValue):
        (WebCore::MockGamepadProvider::gamepadInputActivity):

        * testing/MockGamepadProvider.h: Copied from Source/WebKit2/WebProcess/Gamepad/WebGamepadProvider.h.
        (WebCore::MockGamepadProvider::~MockGamepadProvider):

        * testing/js/WebCoreTestSupport.cpp:
        (WebCoreTestSupport::installMockGamepadProvider):
        (WebCoreTestSupport::connectMockGamepad):
        (WebCoreTestSupport::disconnectMockGamepad):
        (WebCoreTestSupport::setMockGamepadDetails):
        (WebCoreTestSupport::setMockGamepadAxisValue):
        (WebCoreTestSupport::setMockGamepadButtonValue):
        * testing/js/WebCoreTestSupport.h:

2016-08-23  Dave Hyatt  <hyatt@apple.com>

        Add pref for enabling new CSS parsing and move parser files into subdirectory.
        https://bugs.webkit.org/show_bug.cgi?id=161095

        Reviewed by Sam Weinig.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSParser.cpp: Removed.
        * css/CSSParser.h: Removed.
        * css/CSSParserMode.h: Removed.
        * css/CSSParserValues.cpp: Removed.
        * css/CSSParserValues.h: Removed.
        * css/SVGCSSParser.cpp: Removed.
        * css/parser: Added.
        * css/parser/CSSParser.cpp: Copied from css/CSSParser.cpp.
        * css/parser/CSSParser.h: Copied from css/CSSParser.h.
        * css/parser/CSSParserMode.h: Copied from css/CSSParserMode.h.
        * css/parser/CSSParserValues.cpp: Copied from css/CSSParserValues.cpp.
        * css/parser/CSSParserValues.h: Copied from css/CSSParserValues.h.
        * css/parser/SVGCSSParser.cpp: Copied from css/SVGCSSParser.cpp.
        * page/Settings.in:

2016-08-23  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Templatize MediaConstraint
        https://bugs.webkit.org/show_bug.cgi?id=161092

        Reviewed by Jer Noble.

        No new tests, no functional change.

        * platform/mediastream/MediaConstraints.cpp:
        (WebCore::BooleanConstraint::getExact):
        (WebCore::BooleanConstraint::getIdeal):
        (WebCore::MediaConstraint::getMin): Deleted.
        (WebCore::MediaConstraint::getMax): Deleted.
        (WebCore::MediaConstraint::getExact): Deleted.
        (WebCore::MediaConstraint::getIdeal): Deleted.
        (WebCore::IntConstraint::create): Deleted.
        (WebCore::IntConstraint::setMin): Deleted.
        (WebCore::IntConstraint::setMax): Deleted.
        (WebCore::IntConstraint::setExact): Deleted.
        (WebCore::IntConstraint::setIdeal): Deleted.
        (WebCore::IntConstraint::getMin): Deleted.
        (WebCore::IntConstraint::getMax): Deleted.
        (WebCore::IntConstraint::getExact): Deleted.
        (WebCore::IntConstraint::getIdeal): Deleted.
        (WebCore::DoubleConstraint::create): Deleted.
        (WebCore::DoubleConstraint::setMin): Deleted.
        (WebCore::DoubleConstraint::setMax): Deleted.
        (WebCore::DoubleConstraint::setExact): Deleted.
        (WebCore::DoubleConstraint::setIdeal): Deleted.
        (WebCore::DoubleConstraint::getMin): Deleted.
        (WebCore::DoubleConstraint::getMax): Deleted.
        (WebCore::DoubleConstraint::getExact): Deleted.
        (WebCore::DoubleConstraint::getIdeal): Deleted.
        (WebCore::BooleanConstraint::create): Deleted.
        (WebCore::BooleanConstraint::setExact): Deleted.
        (WebCore::BooleanConstraint::setIdeal): Deleted.
        (WebCore::StringConstraint::create): Deleted.
        * platform/mediastream/MediaConstraints.h:
        (WebCore::MediaConstraint::getMin):
        (WebCore::MediaConstraint::getMax):
        (WebCore::MediaConstraint::getExact):
        (WebCore::MediaConstraint::getIdeal):
        (WebCore::NumericConstraint::setMin):
        (WebCore::NumericConstraint::setMax):
        (WebCore::NumericConstraint::setExact):
        (WebCore::NumericConstraint::setIdeal):
        (WebCore::NumericConstraint::setHasMin): Deleted.
        (WebCore::NumericConstraint::setHasMax): Deleted.
        (WebCore::NumericConstraint::setHasExact): Deleted.
        (WebCore::NumericConstraint::setHasIdeal): Deleted.
        (WebCore::NumericConstraint::hasMin): Deleted.
        (WebCore::NumericConstraint::hasMax): Deleted.
        (WebCore::NumericConstraint::hasExact): Deleted.
        (WebCore::NumericConstraint::hasIdeal): Deleted.

2016-08-23  Anders Carlsson  <andersca@apple.com>

        Add a workaround for iOS Frameworks that expect DOM bindings to be in WebCore
        https://bugs.webkit.org/show_bug.cgi?id=161093

        Reviewed by Dan Bernstein.

        Create a text-based stub library that looks enough like WebKitLegacy that we can trick the linker
        into creating a LC_REEXPORT_DYLIB load command in WebCore.

        * Configurations/WebCore.xcconfig:
        Link against this WebKitLegacyStub tbd file on iOS 9.0, 9.3 and 10.0.

        * Configurations/WebKitLegacyStub.iOS.tbd:
        Add new tbd file.

        * WebCore.xcodeproj/project.pbxproj:
        Add new files.

2016-08-23  Chris Dumez  <cdumez@apple.com>

        CanvasRenderingContext2D should not have a CanvasRenderingContext parent interface
        https://bugs.webkit.org/show_bug.cgi?id=161054

        Reviewed by Ryosuke Niwa.

        CanvasRenderingContext2D should not have a CanvasRenderingContext parent interface
        as per:
        - https://html.spec.whatwg.org/multipage/scripting.html#canvasrenderingcontext2d

        Firefox and Chrome agree with the specification.

        No new tests, rebaselined existing test.

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSCanvasRenderingContext.h: Renamed from Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp.
        (WebCore::toJS):
        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
        (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
        (WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):
        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::JSDocument::getCSSCanvasContext):
        (WebCore::JSDocument::createTouchList): Deleted.
        * bindings/js/JSHTMLCanvasElementCustom.cpp:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):
        * dom/Document.idl:
        * html/canvas/CanvasRenderingContext.idl: Removed.
        * html/canvas/CanvasRenderingContext2D.idl:
        * html/canvas/WebGL2RenderingContext.idl:
        * html/canvas/WebGLRenderingContext.idl:
        * html/canvas/WebGLRenderingContextBase.idl:

2016-08-03  Frederic Wang  <fwang@igalia.com>

        Share and improve extraction of character for operator and token elements
        https://bugs.webkit.org/show_bug.cgi?id=160462

        Reviewed by Darin Adler.

        No new tests, already covered by existing tests.

        * mathml/MathMLElement.cpp:
        (WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Make this a protected member of
        MathMLElement so that it can be used in MathMLTokenElement.
        (WebCore::skipLeadingAndTrailingWhitespace): Deleted.
        * mathml/MathMLElement.h: Declare stripLeadingAndTrailingWhitespace.
        * mathml/MathMLOperatorElement.cpp:
        (WebCore::MathMLOperatorElement::parseOperatorChar): Use convertToSingleCodePoint to extract
        a code point more efficiently. For now, we continue to only handle BMP characters.
        * mathml/MathMLTokenElement.cpp:
        (WebCore::MathMLTokenElement::convertToSingleCodePoint): Helper function to try and convert a
        string to a single code point after having removed leading and trailing space.
        * mathml/MathMLTokenElement.h: Declare convertToSingleCodePoint.
        * rendering/mathml/RenderMathMLToken.cpp:
        (WebCore::RenderMathMLToken::updateMathVariantGlyph): Use convertToSingleCodePoint to extract
        a code point more efficiently.

2016-08-23  Frederic Wang  <fwang@igalia.com>

        Rename MathMLInlineContainerElement to MathMLPresentationElement
        https://bugs.webkit.org/show_bug.cgi?id=161053

        Reviewed by Manuel Rego Casasnovas.

        MathMLInlineContainerElement sounds a bad name for something that is now going to produce
        RenderMathMLBlocks. MathML has two kinds of markup (presentation MathML and content MathML).
        We only implement presentation MathML and most of the MathML elements are currently
        implemented as MathMLInlineContainerElement. Hence we rename MathMLInlineContainerElement
        to MathMLPresentationElement and will move more code from MathMLElement into that new class
        in follow-up bugs. Also, other elements in the MathML namespace could be handled by a
        separate MathMLUnknownElement class for consistency with SVG and HTML classes.

        No new tests, behavior is unchanged.

        * CMakeLists.txt: Rename MathMLInlineContainerElement to MathMLPresentationElement.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * mathml/MathMLAllInOne.cpp: Ditto.
        * mathml/MathMLFractionElement.cpp: Ditto.
        * mathml/MathMLFractionElement.h: Ditto.
        * mathml/MathMLPresentationElement.cpp: Ditto.
        * mathml/MathMLPresentationElement.h: Ditto.
        * mathml/MathMLRowElement.cpp: Ditto.
        * mathml/MathMLRowElement.h: Ditto.
        * mathml/MathMLScriptsElement.cpp: Ditto.
        * mathml/MathMLScriptsElement.h: Ditto.
        * mathml/mathtags.in: Ditto.
        * rendering/mathml/RenderMathMLFraction.h: Remove useless include.

2016-08-23  Youenn Fablet  <youenn@apple.com>

        Implement redirect support post CORS-preflight
        https://bugs.webkit.org/show_bug.cgi?id=159056

        Reviewed by Alex Christensen.

        Tests: imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-preflight-worker.html
               imported/w3c/web-platform-tests/fetch/api/cors/cors-redirect-preflight.html
        Covered also by rebased tests.

        Enabling to follow cross-origin redirections for not-simple requests, through preflight checks.
        Making sure that same-origin redirections to cross-origin resources use preflight if they are not simple.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::redirectReceived):

2016-08-23  Frederic Wang  <fred.wang@free.fr>

        Introduce a MathMLRowElement class for mrow-like elements
        https://bugs.webkit.org/show_bug.cgi?id=161050

        Reviewed by Darin Adler.

        We introduce a MathMLRowElement class for elements creating RenderMathMLRow renderers.
        We also force constructors of the corresponding renderer classes to accept MathMLRowElement.
        It's not clear whether semantics-xml really needs to create RenderMathMLRow but for now
        we make MathMLAnnotationElement inherits from MathMLRowElement to preserve that behavior.

        No new tests, behavior is unchanged.

        * CMakeLists.txt: Add MathMLRowElement files.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * mathml/MathMLAllInOne.cpp: Ditto.
        * mathml/MathMLInlineContainerElement.cpp: Remove unused headers.
        (WebCore::MathMLInlineContainerElement::createElementRenderer): Handle some mrow-like
        elements in the MathMLRowElement class.
        (WebCore::MathMLInlineContainerElement::acceptsDisplayStyleAttribute): Ditto.
        (WebCore::MathMLInlineContainerElement::childrenChanged): Deleted. We only need to calculate
        the form for operators inside a MathMLRowElement.
        (WebCore::MathMLInlineContainerElement::acceptsMathVariantAttribute): Deleted. mstyle is
        handled in the MathMLRowElement class.
        * mathml/MathMLInlineContainerElement.h: Update function declarations.
        * mathml/MathMLMathElement.cpp: Make this class inherits from MathMLRowElement.
        * mathml/MathMLMathElement.h: Ditto.
        * mathml/MathMLPaddedElement.cpp: Ditto.
        * mathml/MathMLPaddedElement.h: Ditto.
        * mathml/MathMLSelectElement.cpp: Ditto.
        * mathml/MathMLSelectElement.h: Ditto.
        * mathml/MathMLAnnotationElement.cpp: Ditto.
        * mathml/MathMLAnnotationElement.h: Ditto.
        * mathml/MathMLRowElement.cpp: New class for mrow-like element.
        (WebCore::MathMLRowElement::MathMLRowElement):
        (WebCore::MathMLRowElement::create):
        (WebCore::MathMLRowElement::childrenChanged): Move code from MathMLInlineContainerElement.
        (WebCore::MathMLRowElement::createElementRenderer): Ditto.
        (WebCore::MathMLRowElement::acceptsDisplayStyleAttribute): Ditto.
        (WebCore::MathMLRowElement::acceptsMathVariantAttribute): Ditto.
        * mathml/MathMLRowElement.h:
        * mathml/mathtags.in: Map tags creating RenderMathMLRow renderers to MathMLRowElement.
        * rendering/mathml/RenderMathMLFenced.cpp: Force the constructor to take MathMLRowElement.
        * rendering/mathml/RenderMathMLFenced.h: Ditto.
        * rendering/mathml/RenderMathMLMath.cpp: Ditto.
        * rendering/mathml/RenderMathMLMath.h: Ditto.
        * rendering/mathml/RenderMathMLMenclose.cpp: Force the constructor to take MathMLMencloseElement.
        * rendering/mathml/RenderMathMLMenclose.h: Ditto.
        * rendering/mathml/RenderMathMLRoot.cpp: Force the constructor to take MathMLRowElement.
        * rendering/mathml/RenderMathMLRoot.h: Ditto.
        * rendering/mathml/RenderMathMLRow.cpp: Ditto and add an helper function element() to
        retrieve the MathMLRowElement.
        * rendering/mathml/RenderMathMLRow.h: Ditto.

2016-08-22  Chris Dumez  <cdumez@apple.com>

        Drop TextTrackCue's constructor as per the latest specification
        https://bugs.webkit.org/show_bug.cgi?id=161061

        Reviewed by Alex Christensen.

        Drop TextTrackCue's constructor as per the latest specification:
        - https://html.spec.whatwg.org/#texttrackcue

        Firefox and Chrome do not have this constructor. Web Authors
        are supposed to use the VTTCue constructor instead.

        No new tests, rebaselined existing tests.

        * html/track/TextTrackCue.cpp:
        (WebCore::TextTrackCue::TextTrackCue): Deleted.
        * html/track/TextTrackCue.h:
        (WebCore::TextTrackCue::cueShadowPseudoId): Deleted.
        * html/track/TextTrackCue.idl:

2016-08-22  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r204745.

        Broke the Windows build

        Reverted changeset:

        "CanvasRenderingContext2D should not have a
        CanvasRenderingContext parent interface"
        https://bugs.webkit.org/show_bug.cgi?id=161054
        http://trac.webkit.org/changeset/204745

2016-08-22  Chris Dumez  <cdumez@apple.com>

        CanvasRenderingContext2D should not have a CanvasRenderingContext parent interface
        https://bugs.webkit.org/show_bug.cgi?id=161054

        Reviewed by Ryosuke Niwa.

        CanvasRenderingContext2D should not have a CanvasRenderingContext parent interface
        as per:
        - https://html.spec.whatwg.org/multipage/scripting.html#canvasrenderingcontext2d

        Firefox and Chrome agree with the specification.

        No new tests, rebaselined existing test.

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSCanvasRenderingContext.h: Renamed from Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp.
        (WebCore::toJS):
        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
        (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
        (WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):
        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::JSDocument::getCSSCanvasContext):
        (WebCore::JSDocument::createTouchList): Deleted.
        * bindings/js/JSHTMLCanvasElementCustom.cpp:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):
        * dom/Document.idl:
        * html/canvas/CanvasRenderingContext.idl: Removed.
        * html/canvas/CanvasRenderingContext2D.idl:
        * html/canvas/WebGL2RenderingContext.idl:
        * html/canvas/WebGLRenderingContext.idl:
        * html/canvas/WebGLRenderingContextBase.idl:

2016-08-22  Johan K. Jensen  <johan_jensen@apple.com>

        Make NetworkLoadTiming use double for higher precision in Resource Timing
        https://bugs.webkit.org/show_bug.cgi?id=161051

        Reviewed by Alex Christensen.

        Test: http/tests/misc/resource-timing-resolution.html

        * page/Performance.h:
        * page/Performance.cpp:
        (WebCore::Performance::now):
        (WebCore::Performance::reduceTimeResolution):
        Add new function to reduce time resolution.

        * page/PerformanceResourceTiming.cpp:
        (WebCore::monotonicTimeToDocumentMilliseconds):
        (WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds):
        Only use the reduced timing resolution for full timestamps and deltas.

        (WebCore::PerformanceResourceTiming::connectStart): Use doubles.
        * page/PerformanceResourceTiming.h: Use doubles.
        * page/PerformanceTiming.cpp: Use doubles.
        (WebCore::toIntegerMilliseconds): Use doubles.
        (WebCore::PerformanceTiming::connectStart): Use doubles.
        (WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart): Use doubles.
        * page/PerformanceTiming.h: Use doubles.
        * platform/network/NetworkLoadTiming.h: Use doubles.
        * platform/network/curl/ResourceHandleManager.cpp: Use doubles.
        (WebCore::milisecondsSinceRequest): Use doubles.
        (WebCore::calculateWebTimingInformations): Use doubles.
        * platform/network/soup/ResourceHandleSoup.cpp: Use doubles.
        (WebCore::milisecondsSinceRequest): Use doubles.
        (WebCore::networkEventCallback): Use doubles.

2016-08-22  Alex Christensen  <achristensen@webkit.org>

        Fix Mac CMake build after r204717.

        * PlatformMac.cmake:

2016-08-22  Javier Fernandez  <jfernandez@igalia.com>

        [css-grid] Stretch alignment doesn't work for orthogonal flows
        https://bugs.webkit.org/show_bug.cgi?id=160076

        Reviewed by Darin Adler.

        After implementing orthogonal flow support for track sizing and basic
        alignment logic, we can now implement stretching logic in orthogonal
        scenarios, which was not allowed so far.

        Thanks to the recent changes which made the grid layout code more
        independent to the grid container's and its children's flow, the
        implementation of the stretching logic can be done in a clearer way.

        This patch implements the missing logic and performs some refactoring
        so it became flow direction independent.

        Test: fast/css-grid-layout/grid-align-justify-stretch-with-orthogonal-flows.html

        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):


2016-08-19  Brent Fulgham  <bfulgham@apple.com>

        Invalid resource load statistics iterator when redirecting
        https://bugs.webkit.org/show_bug.cgi?id=161021
        <rdar://problem/27856875>

        Reviewed by Dean Jackson.

        If a load is the result of a redirect, an additional entry is added to the HashSet
        containing the visited domains. This invalidates any existing iterators, so we
        need to get a new iterator for further updates.

        No change in functionality.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::logSubresourceLoading):

2016-08-22  Ryosuke Niwa  <rniwa@webkit.org>

        Rename CustomElementsRegistry to CustomElementRegistry
        https://bugs.webkit.org/show_bug.cgi?id=161028

        Reviewed by Darin Adler.

        Renamed CustomElementsRegistry to CustomElementRegistry per https://github.com/w3c/webcomponents/issues/548.

        Also hide window.customElements and CustomElementRegistry interface behind a runtime enabled.

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSCustomElementRegistryCustom.cpp: Renamed from JSCustomElementsRegistryCustom.cpp.
        (WebCore::getCustomElementCallback):
        (WebCore::JSCustomElementRegistry::define):
        * bindings/js/JSHTMLElementCustom.cpp:
        (WebCore::constructJSHTMLElement):
        * dom/CustomElementReactionQueue.cpp:
        (WebCore::findInterfaceForCustomElement):
        * dom/CustomElementRegistry.cpp: Renamed from CustomElementsRegistry.cpp.
        (WebCore::CustomElementRegistry::create):
        (WebCore::CustomElementRegistry::CustomElementRegistry):
        (WebCore::CustomElementRegistry::~CustomElementRegistry):
        (WebCore::CustomElementRegistry::addElementDefinition):
        (WebCore::CustomElementRegistry::addUpgradeCandidate):
        (WebCore::CustomElementRegistry::findInterface):
        (WebCore::CustomElementRegistry::containsConstructor):
        * dom/CustomElementRegistry.h: Renamed from CustomElementsRegistry.h.
        * dom/CustomElementRegistry.idl: Renamed from CustomElementsRegistry.idl.
        * dom/Document.cpp:
        (WebCore::createUpgradeCandidateElement):
        (WebCore::createHTMLElementWithNameValidation):
        (WebCore::createFallbackHTMLElement):
        * dom/Element.cpp:
        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::ensureCustomElementRegistry):
        * page/DOMWindow.h:
        * page/DOMWindow.idl:

2016-08-22  Chris Dumez  <cdumez@apple.com>

        Add support for GlobalEventHandlers.oncuechange attribute
        https://bugs.webkit.org/show_bug.cgi?id=161046

        Reviewed by Alex Christensen.

        Add support for GlobalEventHandlers.oncuechange attribute:
        - https://html.spec.whatwg.org/#handler-oncuechange

        Test: fast/media/window-oncuechange.html

        * dom/GlobalEventHandlers.idl:

2016-08-22  Alex Christensen  <achristensen@webkit.org>

        Fix bindings tests after r204717.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        There was an extra space.

2016-08-22  Alex Christensen  <achristensen@webkit.org>

        Mostly fix Mac CMake build after r204717.

        * PlatformMac.cmake:

2016-08-22  Antti Koivisto  <antti@apple.com>

        Can't style descendants in shadow tree using the :host pseudo class
        https://bugs.webkit.org/show_bug.cgi?id=160754

        Reviewed by Darin Adler.

        "The :host pseudo-class, when evaluated in the context of a shadow tree, matches the shadow tree’s shadow host."

        Currently :host() works for styling the host element itself (:host(.foo) { ... }). It should also be usable
        for styling elements in the shadow tree:

            :host(.foo) div { ... }

        Test: fast/shadow-dom/css-scoping-host-descendant.html

        * css/SelectorChecker.cpp:
        (WebCore::SelectorChecker::matchHostPseudoClass):
        (WebCore::localContextForParent):

            Move to shadow host if we are matching :host and are at the root of the shadow tree.
            Set didMoveToShadowHost bit in the context.

        (WebCore::SelectorChecker::matchRecursively):
        (WebCore::SelectorChecker::checkOne):

            Call the existing matchHostPseudoClass to do :host matching if didMoveToShadowHost bit has been set.

        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::addPseudoClassType):

            Disallow :host in the compiler (cases where it would match didn't reach the compiler before).

2016-08-22  Frederic Wang  <fwang@igalia.com>

        Use memoize pattern for the menclose notation attribute
        https://bugs.webkit.org/show_bug.cgi?id=160461

        Reviewed by Darin Adler.

        Currently, MathMLMencloseElement::parseAttribute parse the "notation" attribute each time it
        is changed. We change this to use the memoize pattern as done for other MathML attributes:
        We store m_notationFlags in an Optional<uint16_t> where Optnull means that the
        attribute is dirty and must be parsed again.

        No new tests, already covered by existing tests.

        * mathml/MathMLMencloseElement.cpp:
        (WebCore::MathMLMencloseElement::parseNotationAttribute): Move parsing of the "notation"
        attribute from parseAttribute into this separate helper function.
        (WebCore::MathMLMencloseElement::hasNotation): This now check whether the attribute and
        dirty and parse it if necessary.
        (WebCore::MathMLMencloseElement::parseAttribute): Just make the attribute dirty rather than
        parsing it immediately.
        * mathml/MathMLMencloseElement.h: hasNotation is no longer const as it may update the
        m_notationsFlags. We declare parseNotationAttribute(). Finally, we wrap m_notationFlags
        in an Optional<uint16_t> and make addNotation extract the value.

2016-08-22  Daniel Bates  <dabates@apple.com>

        [iOS] <a ping> and <area ping> tests time out
        https://bugs.webkit.org/show_bug.cgi?id=156857

        Reviewed by Simon Fraser.

        Export HTMLAreaElement::imageElement() so that we can make use of it in WebKit2.

        * html/HTMLAreaElement.h:

2016-08-22  Darin Adler  <darin@apple.com>

        [Cocoa] Move Objective-C DOM bindings from WebCore to legacy WebKit
        https://bugs.webkit.org/show_bug.cgi?id=160654

        Reviewed by Alex Christensen.

        * DerivedSources.cpp: Removed ExceptionCodeDescription.h from the list here.
        It will be included by the .cpp files as appropriate and should not be included
        without including config.h first.

        * WebCore.xcodeproj/project.pbxproj: Removed the Objective-C DOM source files.
        Added private exports of various headers that are now used directly or indirectly
        by legacy WebKit to implement the bindings. Moved WebScriptObject.* files from
        bindings/objc to bridge/objc. Moved WebKitAvailability.h into platform/cocoa; it
        can be moved to WebKit of we move the Objective-C bridge there too. Also ran
        sort-Xcode-project-file.

        * bindings/js/JSDOMBinding.cpp:
        (WebCore::valueToUSVString): Fixed a comment typo.

        * bindings/js/JSDOMWindowShell.cpp:
        (WebCore::JSDOMWindowShell::toWrapped): Added.
        * bindings/js/JSDOMWindowShell.h: Added a toWrapped function for use by the
        Objective-C bindings.

        * bindings/js/JSMainThreadExecState.h: Exported symbols needed by the Objective-C bindings.
        * bindings/js/JSNamedNodeMapCustom.cpp: Updated includes since NamedNodeMap.h no longer
        includes Attr.h.

        * bindings/js/ScriptController.h: Exported symbols needed by the Objective-C bindings.

        * bindings/js/ScriptControllerMac.mm:
        (WebCore::ScriptController::windowScriptObject): Removed code that asserted the type of the
        object; this assertion can't be done in WebCore any more and is not critical to keep.
        (WebCore::ScriptController::disconnectPlatformScriptObjects): Use the new
        disconnectWindowWrapper function to call up to the Objective-C bindings code in WebKit.

        * bindings/objc/*: Moved all these files to WebKit/mac/DOM, except for a few that were moved
        to bridge/objc.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader): Added support for the new ExportToWrappedFunction attribute so
        classes that need to can export what is needed by WebKit.

        * bindings/scripts/IDLAttributes.txt: Added ExportToWrappedFunction.

        * bridge/objc/WebScriptObject.h: Moved from bindings/objc.
        * bridge/objc/WebScriptObject.mm: Moved from bindings/objc.
        (WebCore::initializeDOMWrapperHooks): Added. Used by WebKit to add the hooks needed so that
        WebScriptObject can integrate with the DOM bindings.
        (WebCore::disconnectWindowWrapper): Added.
        (+[WebScriptObject scriptObjectForJSObject:originRootObject:rootObject:]): Added code that
        uses createDOMWrapperFunction to set up wrappers that are found or created by WebKit.
        * bridge/objc/WebScriptObjectPrivate.h: Moved from bindings/objc.

        * css/CSSFontFaceRule.h: Exported symbols needed by the Objective-C bindings.
        * css/CSSGroupingRule.h: Ditto.
        * css/CSSImportRule.h: Ditto.
        * css/CSSMediaRule.h: Ditto.
        * css/CSSPageRule.h: Ditto.
        * css/CSSPrimitiveValue.h: Ditto.
        * css/CSSRule.h: Ditto.
        * css/CSSRule.idl: Ditto.
        * css/CSSRuleList.idl: Ditto.
        * css/CSSStyleRule.h: Ditto.
        * css/CSSStyleSheet.h: Ditto.
        * css/CSSValue.h: Ditto.
        * css/CSSValue.idl: Ditto.
        * css/Counter.idl: Ditto.
        * css/MediaList.h: Ditto.
        * css/MediaList.idl: Ditto.
        * css/MediaQueryEvaluator.h: Ditto.
        * css/RGBColor.h: Ditto.
        * css/RGBColor.idl: Ditto.
        * css/Rect.idl: Ditto.
        * css/StyleSheet.idl: Ditto.
        * css/StyleSheetList.h: Ditto.
        * css/StyleSheetList.idl: Ditto.
        * dom/Attr.h: Ditto.
        * dom/CharacterData.h: Ditto.
        * dom/CollectionIndexCache.h: Ditto.
        * dom/ContainerNode.h: Ditto.
        * dom/DOMImplementation.cpp: Ditto.
        * dom/DOMImplementation.h: Ditto.
        * dom/DOMImplementation.idl: Ditto.
        * dom/Document.h: Ditto.
        * dom/DocumentFragment.h: Ditto.
        * dom/Element.h: Ditto.
        * dom/Event.h: Ditto.
        * dom/Event.idl: Ditto.
        * dom/EventTarget.h: Ditto.
        * dom/KeyboardEvent.h: Ditto.
        * dom/LifecycleCallbackQueue.h: Ditto.
        * dom/MouseEvent.h: Ditto.
        * dom/MouseRelatedEvent.h: Ditto.
        * dom/MutationEvent.h: Ditto.
        * dom/NamedNodeMap.h: Ditto.
        * dom/NamedNodeMap.idl: Ditto.
        * dom/NativeNodeFilter.h: Ditto.
        * dom/Node.h: Ditto.
        * dom/NodeIterator.h: Ditto.
        * dom/NodeIterator.idl: Ditto.
        * dom/NodeList.idl: Ditto.
        * dom/NodeTraversal.h: Ditto.
        * dom/OverflowEvent.h: Ditto.
        * dom/QualifiedName.h: Ditto.
        * dom/Range.h: Ditto.
        * dom/ScriptElement.h: Ditto.
        * dom/Text.h: Ditto.
        * dom/TextEvent.h: Ditto.
        * dom/TreeScope.h: Ditto.
        * dom/TreeWalker.h: Ditto.
        * dom/TreeWalker.idl: Ditto.
        * dom/UIEvent.h: Ditto.
        * dom/WheelEvent.h: Ditto.
        * dom/make_dom_exceptions.pl: Ditto.
        * editing/EditingStyle.h: Ditto.
        * editing/FrameSelection.h: Ditto.

        * editing/ios/EditorIOS.mm: Removed unneeded include of Objective-C DOM header.
        * editing/mac/EditorMac.mm: Ditto.

        * fileapi/Blob.h: Exported symbols needed by the Objective-C bindings.
        * fileapi/File.h: Ditto.
        * fileapi/FileList.h: Ditto.
        * html/DOMTokenList.h: Ditto.
        * html/HTMLAnchorElement.h: Ditto.
        * html/HTMLAreaElement.h: Ditto.
        * html/HTMLBaseElement.h: Ditto.
        * html/HTMLButtonElement.h: Ditto.
        * html/HTMLCanvasElement.h: Ditto.
        * html/HTMLCollection.h: Ditto.
        * html/HTMLCollection.idl: Ditto.
        * html/HTMLDocument.h: Ditto.
        * html/HTMLElement.h: Ditto.
        * html/HTMLFormControlElement.h: Ditto.
        * html/HTMLFormElement.h: Ditto.
        * html/HTMLFrameElementBase.h: Ditto.
        * html/HTMLFrameOwnerElement.h: Ditto.
        * html/HTMLImageElement.h: Ditto.
        * html/HTMLInputElement.h: Ditto.

        * html/HTMLLabelElement.cpp:
        (WebCore::HTMLLabelElement::setActive): Tweaked types a bit.
        (WebCore::HTMLLabelElement::setHovered): Ditto.
        (WebCore::HTMLLabelElement::defaultEventHandler): Ditto.
        (WebCore::HTMLLabelElement::willRespondToMouseClickEvents): Ditto.
        (WebCore::HTMLLabelElement::focus): Ditto.
        (WebCore::HTMLLabelElement::accessKeyAction): Ditto.

        * html/HTMLLabelElement.h: Exported symbols needed by the Objective-C bindings.
        * html/HTMLLinkElement.h: Ditto.
        * html/HTMLMapElement.h: Ditto.
        * html/HTMLMarqueeElement.h: Ditto.
        * html/HTMLMediaElement.h: Ditto.
        * html/HTMLOListElement.h: Ditto.
        * html/HTMLOptionElement.h: Ditto.
        * html/HTMLOptionsCollection.h: Ditto.
        * html/HTMLOptionsCollection.idl: Ditto.
        * html/HTMLScriptElement.h: Ditto.
        * html/HTMLSelectElement.h: Ditto.
        * html/HTMLStyleElement.h: Ditto.
        * html/HTMLTableCellElement.h: Ditto.
        * html/HTMLTableColElement.h: Ditto.
        * html/HTMLTableElement.h: Ditto.
        * html/HTMLTableRowElement.h: Ditto.
        * html/HTMLTableSectionElement.h: Ditto.
        * html/HTMLTextAreaElement.h: Ditto.
        * html/HTMLTextFormControlElement.h: Ditto.
        * html/HTMLTitleElement.h: Ditto.
        * html/HTMLVideoElement.h: Ditto.
        * html/LabelableElement.h: Ditto.

        * loader/EmptyClients.h: Updated documentFragmentFromDelegate, which was
        returning a newly created document fragment with a raw pointer. This works
        because the implementation internally uses Objective-C and autorelease, but
        is too fragile to rely on for the future.

        * page/DOMWindow.h: Exported symbols needed by the Objective-C bindings.

        * page/EditorClient.h: Updated document fragment functions.

        * page/Frame.h: Removed indexCountOfWordPrecedingSelection, already unused.
        Removed innerLineHeight and styleAtSelectionStart, formerly used by legacy WebKit,
        which used Objective-C DOM objects in their interfaces.

        * page/ios/FrameIOS.mm:
        (WebCore::Frame::indexCountOfWordPrecedingSelection): Deleted.
        (WebCore::Frame::innerLineHeight): Deleted.
        (WebCore::Frame::styleAtSelectionStart): Deleted.

        * platform/DragImage.h: Exported symbols needed by the Objective-C bindings.
        * platform/ScrollView.h: Ditto.
        * platform/URL.h: Ditto.

        * platform/cocoa/WebKitAvailability.h: Moved from bindings/objc.

        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm: Removed unneeded includes
        of Objective-C DOM headers.
        * platform/cocoa/WebVideoFullscreenModelVideoElement.mm: Ditto.
        * platform/ios/PasteboardIOS.mm: Ditto.

        * platform/ios/wak/WebCoreThread.mm:
        (StartWebThread): Took out the call to WebCoreObjCDeallocOnWebThread for DOMObject.
        This class is now defined in legacy WebKit, so we do the code there there along
        with the other WebKit classes.

        * platform/ios/wak/WebCoreThreadSafe.h: Removed the unwise additional definition of
        WebScriptObject and DOMObject in this file. Really this entire file needs to go.

        * platform/text/TextEncoding.h: Exported symbols needed by the Objective-C bindings.
        * rendering/HitTestResult.h: Ditto.
        * rendering/RenderLayer.h: Ditto.
        * rendering/RenderObject.h: Ditto.

        * rendering/RenderThemeGtk.cpp: Rewrote code that was unnecessarily using
        NamedNodeMap and Attr nodes just to get the value of an attribute.

        * rendering/style/RenderStyle.h: Exported symbols needed by the Objective-C bindings.

        * xml/XMLHttpRequest.cpp: Added include needed now that XMLDocument.h is not
        included by DOMImplementation.h.

        * xml/XPathExpression.h: Exported symbols needed by the Objective-C bindings.
        * xml/XPathExpression.idl: Ditto.
        * xml/XPathNSResolver.h: Ditto.

        * xml/XPathResult.cpp:
        (WebCore::XPathResult::snapshotLength): Use unsigned instead of unsigned long.
        (WebCore::XPathResult::snapshotItem): Ditto.
        * xml/XPathResult.h: Exported symbols needed by the Objective-C bindings. Also
        updated types as above.
        * xml/XPathResult.idl: Ditto.

2016-08-22  Frederic Wang  <fwang@igalia.com>

        Rename MathMLTextElement to MathMLTokenElement
        https://bugs.webkit.org/show_bug.cgi?id=160542

        Reviewed by Darin Adler.

        No new tests, behavior is unchanged.

        * CMakeLists.txt: Rename MathMLTextElement to MathMLTokenElement.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * mathml/MathMLAllInOne.cpp: Ditto.
        * mathml/MathMLOperatorElement.cpp: Ditto.
        * mathml/MathMLOperatorElement.h: Ditto.
        * mathml/MathMLTokenElement.cpp: Ditto. Also remove dead code in childShouldCreateRenderer
        to handle the case of mspace since that element uses its own class and forbids child creation
        in RenderMathMLSpace::isChildAllowed.
        * mathml/MathMLTokenElement.h: Rename MathMLTextElement to MathMLTokenElement.
        * mathml/mathtags.in: Ditto.
        * rendering/mathml/RenderMathMLToken.cpp: Move inclusion of MathMLTokenElement.h and
        implementation of element() here.
        * rendering/mathml/RenderMathMLToken.h: Do not implement element() in the header so that
        we only need need to predeclare MathMLTokenElement instead of including its header.

2016-08-21  Alex Christensen  <achristensen@webkit.org>

        Use Document& instead of Document* when getting cookies
        https://bugs.webkit.org/show_bug.cgi?id=161011

        Reviewed by Darin Adler.

        No change in behavior.

        * Modules/websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::processBuffer):
        * Modules/websockets/WebSocketHandshake.cpp:
        (WebCore::WebSocketHandshake::clientHandshakeMessage):
        (WebCore::WebSocketHandshake::clientHandshakeRequest):
        * dom/Document.cpp:
        (WebCore::Document::cookie):
        (WebCore::Document::setCookie):
        (WebCore::Document::referrer):
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::getCookies):
        (WebCore::InspectorPageAgent::deleteCookie):
        (WebCore::InspectorPageAgent::getResourceTree):
        * loader/CookieJar.cpp:
        (WebCore::networkingContext):
        (WebCore::storageSession):
        (WebCore::cookies):
        (WebCore::setCookies):
        (WebCore::cookiesEnabled):
        (WebCore::cookieRequestHeaderFieldValue):
        (WebCore::getRawCookies):
        (WebCore::deleteCookie):
        (WebCore::addCookie):
        * loader/CookieJar.h:
        * page/Navigator.cpp:
        (WebCore::Navigator::cookieEnabled):
        (WebCore::Navigator::javaEnabled):

2016-08-21  Alex Christensen  <achristensen@webkit.org>

        URLParser should parse IPv4 addresses
        https://bugs.webkit.org/show_bug.cgi?id=161023

        Reviewed by Darin Adler.

        Covered by new API tests because URLParser isn't used anywhere in WebCore yet.

        * platform/URLParser.cpp:
        (WebCore::URLParser::authorityEndReached):
        (WebCore::serializeIPv4):
        (WebCore::parseIPv4Number):
        (WebCore::pow256):
        (WebCore::parseIPv4Host):
        (WebCore::parseIPv6Host):
        (WebCore::URLParser::hostEndReached):

2016-08-21  Sam Weinig  <sam@webkit.org>

        Remove a few custom bindings
        https://bugs.webkit.org/show_bug.cgi?id=161039

        Reviewed by Darin Adler.

        Remove custom bindings for CanvasRenderingContext2D's webkitLineDash attribute and commit function.

        * WebCore.xcodeproj/project.pbxproj:
        Sort files.

        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
        (WebCore::JSCanvasRenderingContext2D::commit): Deleted.
        (WebCore::JSCanvasRenderingContext2D::webkitLineDash): Deleted.
        (WebCore::JSCanvasRenderingContext2D::setWebkitLineDash): Deleted.
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::webkitLineDashOffset): Deleted.
        (WebCore::CanvasRenderingContext2D::setWebkitLineDashOffset): Deleted.
        * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/CanvasRenderingContext2D.idl:

2016-08-21  Youenn Fablet  <youenn@apple.com>

        cross-origin requests redirected fail or drop author requested headers
        https://bugs.webkit.org/show_bug.cgi?id=112471

        Reviewed by Alex Christensen.

        Test: http/tests/xmlhttprequest/redirections-and-user-headers.html

        Storing original headers in DocumentThreadableLoader.
        In case of cross-origin redirection in CORS mode, set the new request headers to the original headers.
        Add a special handling to Authorization header that should not be used when it is already removed by the network layer.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::redirectReceived):
        (WebCore::DocumentThreadableLoader::loadRequest):
        * loader/DocumentThreadableLoader.h:

2016-08-21  Frederic Wang  <fwang@igalia.com>

        Introduce a MathMLAnnotationElement class for the annotation/annotation-xml elements
        https://bugs.webkit.org/show_bug.cgi?id=160540

        Reviewed by Darin Adler.

        The <annotation> element can only contain text whereas the <annotation-xml> element can
        contain some elements as described in the HTML5 RelaxNG schema. For this reason, they have
        been implemented in the separate MathMLTextElement and MathMLInlineContainerElement
        respectively. However, they are actually closer to each other than to token elements or
        presentation containers. In particular they support very different attributes and are
        considered by the <semantics> tag. Hence we move their implementations in a new
        MathMLAnnotation class.

        No new tests, already covered by existing tests.

        * CMakeLists.txt: Add MathMLAnnotationElement.
        * mathml/MathMLAllInOne.cpp: Ditto.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * mathml/MathMLAnnotationElement.cpp: Added.
        (WebCore::MathMLAnnotationElement::MathMLAnnotationElement): ASSERT that this class is only
        for annotation and annotation-xml.
        (WebCore::MathMLAnnotationElement::create):
        (WebCore::MathMLAnnotationElement::createElementRenderer): Move implementation from
        MathMLTextElement and MathMLInlineContainerElement.
        (WebCore::MathMLAnnotationElement::childShouldCreateRenderer): Move implementation from
        MathMLTextElement and MathMLElement.
        (WebCore::MathMLAnnotationElement::attributeChanged): Move implementation from MathMLElement.
        * mathml/MathMLAnnotationElement.h: Override isSemanticAnnotation and isPresentationMathML
        to return true.
        * mathml/MathMLElement.cpp:
        (WebCore::MathMLElement::childShouldCreateRenderer): Move the annotation-xml case into
        MathMLAnnotationElement.
        (WebCore::MathMLElement::attributeChanged): Deleted. This was only used for semantic
        annotations and so the code is moved into MathMLAnnotationElement.
        * mathml/MathMLElement.h:
        (WebCore::MathMLElement::isMathMLToken): Return false and let derived class override this.
        (WebCore::MathMLElement::isSemanticAnnotation): Ditto.
        (WebCore::MathMLElement::updateSelectedChild): Make this public so that is can be used
        by MathMLAnnotationElement::attributeChanged.
        * mathml/MathMLInlineContainerElement.cpp:
        (WebCore::MathMLInlineContainerElement::createElementRenderer): The annotation-xml case is
        now handled in MathMLAnnotationElement.
        * mathml/MathMLTextElement.cpp:
        (WebCore::MathMLTextElement::createElementRenderer): The annotation case is handled is now
        handled in  MathMLAnnotationElement.
        (WebCore::MathMLTextElement::childShouldCreateRenderer): Ditto.
        * mathml/MathMLTextElement.h: Override isToken to return true.
        * mathml/mathtags.in: Map annotation and annotation-xml to MathMLAnnotationElement.

2016-08-21  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Clean up CursorGtk.cpp
        https://bugs.webkit.org/show_bug.cgi?id=157794

        Reviewed by Darin Adler.

        We use GdkCursorType extensively in CursorGtk.cpp, but GTK+ does not support this anymore
        and they're only sure to work under X11. Instead, use supported CSS cursor names. This
        follows the grand tradition of replacing constants with hardcoded string values, but such
        is the new best practice in GTK+ world.

        Also, we have a bunch of custom cursors copied from Firefox. Each of these cursors is
        nowadays guaranteed to be provided by GTK+, so we don't need any of these anymore.

        * platform/gtk/CursorGtk.cpp:
        (WebCore::createNamedCursor):
        (WebCore::Cursor::ensurePlatformCursor):
        * platform/gtk/CursorGtk.h: Removed.

2016-08-20  Sam Weinig  <sam@webkit.org>

        Fix the build.

        * dom/UIEvent.h:

2016-08-20  Darin Adler  <darin@apple.com>

        Removed Objective-C specific attributes from IDL, made conditionals more consistent
        https://bugs.webkit.org/show_bug.cgi?id=160900

        Reviewed by Sam Weinig.

        Removed all Objective-C-specific attributes from all the various IDL files where
        they were used. Except, oops, Sam already did that, and so everything just merged!
        Now that Objective-C is gone, made all the conditionals be based on LANGUAGE_GOBJECT
        specifically. Later we should cut these down because many were not actually needed
        for the GObject bindings, actually only for Objective-C. Also made the style of
        conditional consistent. Also re-sorted attributes in alphabetical order in many cases
        and made formatting more consistent without fancy indentation. Also removed old comments
        that tried to document where various operations and attributes were defined; it's not
        helpful to track "this was part of DOM level 2" at this point. Also fixed a variety of
        types to explicitly state the values are nullable in cases where the generated code
        is currently not affected by that; mostly read-only attribute types.

        * Modules/mediasession/HTMLMediaElementMediaSession.idl:
        * Modules/mediastream/HTMLMediaElementMediaStream.idl:
        * animation/AnimationTimeline.idl:
        * animation/DocumentAnimation.idl:
        * bindings/scripts/IDLAttributes.txt:
        * css/CSSMediaRule.idl:
        * css/CSSPrimitiveValue.idl:
        * css/CSSRule.idl:
        * css/CSSStyleDeclaration.idl:
        * css/CSSStyleSheet.idl:
        * css/CSSValue.idl:
        * css/RGBColor.idl:
        * css/StyleSheet.idl:
        * dom/CharacterData.idl:
        * dom/DOMCoreException.idl:
        * dom/DOMImplementation.idl:
        * dom/Document.idl:
        * dom/DocumentType.idl:
        * dom/Element.idl:
        * dom/Event.idl:
        * dom/EventListener.idl:
        * dom/EventTarget.idl:
        * dom/KeyboardEvent.idl:
        * dom/MessageEvent.idl:
        * dom/MessagePort.idl:
        * dom/MouseEvent.idl:
        * dom/MutationEvent.idl:
        * dom/NamedNodeMap.idl:
        * dom/Node.idl:
        * dom/NodeFilter.idl:
        * dom/NonElementParentNode.idl:
        * dom/Range.idl:
        * dom/Slotable.idl:
        * dom/UIEvent.idl:
        * dom/WheelEvent.idl:
        * fileapi/FileException.idl:
        * html/DOMTokenList.idl:
        * html/HTMLAnchorElement.idl:
        * html/HTMLAppletElement.idl:
        * html/HTMLCollection.idl:
        * html/HTMLDocument.idl:
        * html/HTMLElement.idl:
        * html/HTMLEmbedElement.idl:
        * html/HTMLFormElement.idl:
        * html/HTMLInputElement.idl:
        * html/HTMLMediaElement.idl:
        * html/HTMLOptionElement.idl:
        * html/HTMLOptionsCollection.idl:
        * html/HTMLSelectElement.idl:
        * html/HTMLTableColElement.idl:
        * html/HTMLVideoElement.idl:
        * html/ImageData.idl:
        * html/URLUtils.idl:
        * html/track/TextTrack.idl:
        * page/AbstractView.idl:
        * page/DOMSelection.idl:
        * page/DOMWindow.idl:
        * page/Location.idl:
        * svg/SVGDocument.idl:
        * svg/SVGElement.idl:
        * svg/SVGException.idl:
        * svg/SVGExternalResourcesRequired.idl:
        * svg/SVGFilterPrimitiveStandardAttributes.idl:
        * svg/SVGFitToViewBox.idl:
        * svg/SVGPathSeg.idl:
        * svg/SVGTests.idl:
        * svg/SVGURIReference.idl:
        * svg/SVGZoomAndPan.idl:
        * workers/DedicatedWorkerGlobalScope.idl:
        * workers/Worker.idl:
        * workers/WorkerGlobalScope.idl:
        * xml/XPathException.idl:
        * xml/XPathExpression.idl:
        * xml/XPathNSResolver.idl:
        See above for summary of changes.

2016-08-20  Sam Weinig  <sam@webkit.org>

        Remove Objective-C specific extended attributes from the bindings
        https://bugs.webkit.org/show_bug.cgi?id=161034

        Reviewed by Dan Bernstein.

        - Removes ObjCPolymorphic, ObjCProtocol, ObjCLegacyUnnamedParameters and ObjCExplicitAtomicString
          extended attributes.

        * animation/AnimationTimeline.idl:
        * css/CSSMediaRule.idl:
        * css/CSSPrimitiveValue.idl:
        * css/CSSRule.idl:
        * css/CSSStyleDeclaration.idl:
        * css/CSSStyleSheet.idl:
        * css/CSSValue.idl:
        * css/StyleSheet.idl:
        * dom/CharacterData.idl:
        * dom/DOMImplementation.idl:
        * dom/Document.idl:
        * dom/Element.idl:
        * dom/Event.idl:
        * dom/EventListener.idl:
        * dom/EventTarget.idl:
        * dom/MouseEvent.idl:
        * dom/MutationEvent.idl:
        * dom/NamedNodeMap.idl:
        * dom/Node.idl:
        * dom/NodeFilter.idl:
        * dom/NonElementParentNode.idl:
        * dom/Range.idl:
        * dom/UIEvent.idl:
        * html/HTMLCollection.idl:
        * html/HTMLSelectElement.idl:
        * svg/SVGExternalResourcesRequired.idl:
        * svg/SVGFilterPrimitiveStandardAttributes.idl:
        * svg/SVGFitToViewBox.idl:
        * svg/SVGPathSeg.idl:
        * svg/SVGTests.idl:
        * svg/SVGURIReference.idl:
        * svg/SVGZoomAndPan.idl:
        * xml/XPathExpression.idl:
        * xml/XPathNSResolver.idl:

2016-08-20  Sam Weinig  <sam@webkit.org>

        Roll out r204683.

2016-08-20  Sam Weinig  <sam@webkit.org>

        Remove Objective-C specific extended attributes / features from the bindings
        https://bugs.webkit.org/show_bug.cgi?id=161034

        Reviewed by Dan Bernstein.

        - Removes ObjCPolymorphic, ObjCProtocol, ObjCLegacyUnnamedParameters and ObjCExplicitAtomicString
          extended attributes.
        - Remove support for multiple inheritance from the IDLParser.

        * bindings/scripts/CodeGenerator.pm:
        * bindings/scripts/IDLParser.pm:
        * animation/AnimationTimeline.idl:
        * css/CSSMediaRule.idl:
        * css/CSSPrimitiveValue.idl:
        * css/CSSRule.idl:
        * css/CSSStyleDeclaration.idl:
        * css/CSSStyleSheet.idl:
        * css/CSSValue.idl:
        * css/StyleSheet.idl:
        * dom/CharacterData.idl:
        * dom/DOMImplementation.idl:
        * dom/Document.idl:
        * dom/Element.idl:
        * dom/Event.idl:
        * dom/EventListener.idl:
        * dom/EventTarget.idl:
        * dom/MouseEvent.idl:
        * dom/MutationEvent.idl:
        * dom/NamedNodeMap.idl:
        * dom/Node.idl:
        * dom/NodeFilter.idl:
        * dom/NonElementParentNode.idl:
        * dom/Range.idl:
        * dom/UIEvent.idl:
        * html/HTMLCollection.idl:
        * html/HTMLSelectElement.idl:
        * svg/SVGExternalResourcesRequired.idl:
        * svg/SVGFilterPrimitiveStandardAttributes.idl:
        * svg/SVGFitToViewBox.idl:
        * svg/SVGPathSeg.idl:
        * svg/SVGTests.idl:
        * svg/SVGURIReference.idl:
        * svg/SVGZoomAndPan.idl:
        * xml/XPathExpression.idl:
        * xml/XPathNSResolver.idl:

2016-08-20  Sam Weinig  <sam@webkit.org>

        Stop pretending that AbstractView is a thing, it's not
        https://bugs.webkit.org/show_bug.cgi?id=161032

        Reviewed by Dan Bernstein.

        Remove AbstractView.idl, the AbstractView typedef of DOMWindow, and
        all special casing of the name AbstractView in the JS code generator.

        No change in behavior.

        * DerivedSources.make:
        * Modules/indieui/UIRequestEvent.cpp:
        (WebCore::UIRequestEvent::createForBindings):
        (WebCore::UIRequestEvent::create):
        (WebCore::UIRequestEvent::UIRequestEvent):
        * Modules/indieui/UIRequestEvent.h:
        (WebCore::UIRequestEvent::receiver):
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/scripts/CodeGeneratorGObject.pm:
        * bindings/scripts/CodeGeneratorJS.pm:
        (ShouldGenerateToJSDeclaration):
        (GetImplClassName):
        * dom/CompositionEvent.cpp:
        (WebCore::CompositionEvent::CompositionEvent):
        (WebCore::CompositionEvent::~CompositionEvent):
        (WebCore::CompositionEvent::initCompositionEvent):
        * dom/CompositionEvent.h:
        * dom/FocusEvent.cpp:
        (WebCore::FocusEvent::isFocusEvent):
        (WebCore::FocusEvent::FocusEvent):
        * dom/FocusEvent.h:
        * dom/KeyboardEvent.cpp:
        (WebCore::KeyboardEvent::KeyboardEvent):
        (WebCore::KeyboardEvent::~KeyboardEvent):
        (WebCore::KeyboardEvent::initKeyboardEvent):
        * dom/KeyboardEvent.h:
        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::createForBindings):
        (WebCore::MouseEvent::create):
        (WebCore::MouseEvent::MouseEvent):
        (WebCore::MouseEvent::~MouseEvent):
        (WebCore::MouseEvent::initMouseEvent):
        * dom/MouseEvent.h:
        * dom/MouseRelatedEvent.cpp:
        (WebCore::MouseRelatedEvent::MouseRelatedEvent):
        (WebCore::contentsScrollOffset):
        * dom/MouseRelatedEvent.h:
        * dom/SimulatedClick.cpp:
        * dom/TextEvent.cpp:
        (WebCore::TextEvent::createForBindings):
        (WebCore::TextEvent::create):
        (WebCore::TextEvent::createForPlainTextPaste):
        (WebCore::TextEvent::createForFragmentPaste):
        (WebCore::TextEvent::createForDrop):
        (WebCore::TextEvent::createForDictation):
        (WebCore::TextEvent::TextEvent):
        (WebCore::TextEvent::~TextEvent):
        (WebCore::TextEvent::initTextEvent):
        * dom/TextEvent.h:
        * dom/TouchEvent.h:
        * dom/UIEvent.cpp:
        (WebCore::UIEvent::UIEvent):
        (WebCore::UIEvent::~UIEvent):
        (WebCore::UIEvent::initUIEvent):
        * dom/UIEvent.h:
        (WebCore::UIEvent::create):
        (WebCore::UIEvent::createForBindings):
        (WebCore::UIEvent::view):
        (WebCore::UIEvent::detail):
        * dom/UIEventWithKeyState.h:
        (WebCore::UIEventWithKeyState::UIEventWithKeyState):
        * dom/WheelEvent.cpp:
        (WebCore::WheelEvent::WheelEvent):
        (WebCore::WheelEvent::initWheelEvent):
        (WebCore::WheelEvent::initWebKitWheelEvent):
        * dom/WheelEvent.h:
        * page/AbstractView.idl: Removed.

2016-08-19  Sam Weinig  <sam@webkit.org>

        Location.ancestorOrigins should return a FrozenArray<USVString>
        https://bugs.webkit.org/show_bug.cgi?id=161018

        Reviewed by Ryosuke Niwa and Chris Dumez.

        Updated tests: fast/dom/Window/Location/ancestor-origins.html
                       fast/dom/indexed-getters-returning-string.html

        * Modules/indexeddb/IDBDatabase.cpp:
        (WebCore::IDBDatabase::createObjectStore):
        (WebCore::IDBDatabase::transaction):
        (WebCore::IDBDatabase::deleteObjectStore):
        * Modules/indexeddb/IDBDatabase.h:
        Remove unused ScriptExecutionContext parameter.

        * Modules/indexeddb/IDBDatabase.idl:
        There is no need for a custom implementation anymore.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        Remove JSDOMStringListCustom.cpp, which is no longer needed.

        * bindings/js/JSDOMBinding.cpp:
        (WebCore::jsArray): Deleted.
        Remove overload of jsArray that took a DOMStringList.

        * bindings/js/JSDOMBinding.h:
        (WebCore::jsFrozenArray):
        Add jsFrozenArray which returns an JSArray which has had the moral 
        equivalent of Object.freeze() called on it. This follows 
        http://heycam.github.io/webidl/#es-frozen-array.

        * bindings/js/JSDOMStringListCustom.cpp:
        Removed.

        * bindings/js/JSIDBDatabaseCustom.cpp:
        (WebCore::JSIDBDatabase::transaction): Deleted.
        Remove no longer necessary custom implementation of transaction.

        * bindings/scripts/CodeGenerator.pm:
        (IsRefPtrType):
        (IsSVGAnimatedType):
        (IsSequenceType):
        (GetSequenceType):
        (IsFrozenArrayType):
        (GetFrozenArrayInnerType):
        * bindings/scripts/CodeGeneratorJS.pm:
        (AreTypesDistinguishableForOverloadResolution):
        (GenerateOverloadedFunctionOrConstructor):
        (GetNativeType):
        (GetNativeVectorInnerType):
        (GetNativeTypeForCallbacks):
        (JSValueToNative):
        (NativeToJSValue):
        * bindings/scripts/IDLParser.pm:
        (parseNonAnyType):
        Add support for FrozenArray, closely matching the sequence code.

        * bindings/scripts/test/JS/JSTestCallback.cpp:
        * bindings/scripts/test/JS/JSTestCallback.h:
        * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunction.h:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        Updated bindings test results.

        * dom/DOMStringList.idl:
        Remove JSCustomToNativeObject, which is no longer needed.

        * inspector/InspectorIndexedDBAgent.cpp:
        Update calls to IDBDatabase::transaction.

        * page/Location.cpp:
        (WebCore::Location::ancestorOrigins):
        * page/Location.h:
        Change ancestorOrigins to return a Vector<String> rather than
        a DOMStringList.

        * page/Location.idl:
        Change ancestorOrigins to return a FrozenArray<USVString>, matching
        the HTML5 spec.

2016-08-19  Chris Dumez  <cdumez@apple.com>

        Mark CanvasPath operations' parameters as mandatory when they should be
        https://bugs.webkit.org/show_bug.cgi?id=161014

        Reviewed by Sam Weinig.

        Mark CanvasPath operations as mandatory when they should be:
        - https://html.spec.whatwg.org/multipage/scripting.html#canvaspath

        This patch moves the CanvasPath methods from CanvasRenderingContext2D
        and Path2D to a new CanvasPath interface, to avoid duplication and
        match the specification.

        The parameters were correctly marked as mandatory in WebKit on
        CanvasRenderingContext2D but not on Path2D.

        Those parameters are correctly marked as mandatory in Chrome and Firefox.

        No new tests, rebaselined existing test.

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * html/canvas/CanvasPath.cpp: Renamed from Source/WebCore/html/canvas/CanvasPathMethods.cpp.
        (WebCore::CanvasPath::closePath):
        (WebCore::CanvasPath::moveTo):
        (WebCore::CanvasPath::lineTo):
        (WebCore::CanvasPath::quadraticCurveTo):
        (WebCore::CanvasPath::bezierCurveTo):
        (WebCore::CanvasPath::arcTo):
        (WebCore::normalizeAngles):
        (WebCore::CanvasPath::arc):
        (WebCore::CanvasPath::ellipse):
        (WebCore::CanvasPath::rect):
        * html/canvas/CanvasPath.h: Renamed from Source/WebCore/html/canvas/CanvasPathMethods.h.
        (WebCore::CanvasPath::~CanvasPath):
        (WebCore::CanvasPath::CanvasPath):
        (WebCore::CanvasPath::hasInvertibleTransform):
        * html/canvas/CanvasPath.idl: Added.
        * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/CanvasRenderingContext2D.idl:
        * html/canvas/DOMPath.h:
        * html/canvas/DOMPath.idl:

2016-08-19  Zalan Bujtas  <zalan@apple.com>

        RenderObject::containingBlock() cleanup.
        https://bugs.webkit.org/show_bug.cgi?id=161013

        Reviewed by Simon Fraser.

        Move ::containingBlockForAbsolutePosition and ::containingBlockForFixedPosition
        to RenderElement after tightening containingBlock() callsites.

        No change in functionality.

        * dom/Element.cpp:
        (WebCore::layoutOverflowRectContainsAllDescendants):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::containingBlockForFixedPosition):
        (WebCore::RenderElement::containingBlockForAbsolutePosition):
        * rendering/RenderElement.h:
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::styleWillChange):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::containingBlock):
        (WebCore::RenderObject::containingBlockForFixedPosition): Deleted.
        (WebCore::RenderObject::containingBlockForAbsolutePosition): Deleted.
        * rendering/RenderObject.h:

2016-08-19  Dean Jackson  <dino@apple.com>

        Implement preferLowPowerToHighPerformance for WebGL
        https://bugs.webkit.org/show_bug.cgi?id=161017
        <rdar://problem/26819135>

        Reviewed by Myles Maxfield.

        Implement preferLowPowerToHighPerformance on macOS by
        passing the correct CGL attribute when creating the
        pixel format.

        * bindings/js/JSHTMLCanvasElementCustom.cpp:
        (WebCore::get3DContextAttributes):
        * platform/graphics/mac/GraphicsContext3DMac.mm:
        (WebCore::setPixelFormat):
        (WebCore::GraphicsContext3D::GraphicsContext3D):

2016-08-19  Joseph Pecoraro  <pecoraro@apple.com>

        Remove empty files and empty namespace blocks
        https://bugs.webkit.org/show_bug.cgi?id=160990

        Reviewed by Alex Christensen.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/DOMAllInOne.cpp:
        * dom/MessagePortChannel.cpp: Removed.
        * page/DatabaseProvider.h:
        * platform/mock/mediasource/MockTracks.cpp: Removed.

2016-08-19  Myles C. Maxfield  <mmaxfield@apple.com>

        Addressing post-review comments after r204592
        https://bugs.webkit.org/show_bug.cgi?id=160895

        Unreviewed.

        No new tests because there is no behavior change.

        * page/cocoa/ResourceUsageOverlayCocoa.mm:
        (WebCore::showText):
        * platform/graphics/ca/PlatformCALayer.cpp:
        (WebCore::PlatformCALayer::drawTextAtPoint):
        * platform/ios/LegacyTileCache.mm:
        (WebCore::LegacyTileCache::drawLayer):

2016-08-19  Ryan Haddad  <ryanhaddad@apple.com>

        Attempt to fix the Windows build after r204652.

        Unreviewed build fix.

        * dom/DOMAllInOne.cpp:

2016-08-19  Myles C. Maxfield  <mmaxfield@apple.com>

        Migrate from ints to unsigneds in a few more places in rendering code
        https://bugs.webkit.org/show_bug.cgi?id=161006

        Reviewed by Alex Christensen.

        No new tests because there is no behavior change.

        * platform/graphics/GraphicsContext.cpp:
        (WebCore::GraphicsContext::drawBidiText):
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::drawText):
        * platform/text/BidiResolver.h:
        (WebCore::BidiCharacterRun::BidiCharacterRun):
        (WebCore::BidiCharacterRun::start):
        (WebCore::BidiCharacterRun::stop):
        * rendering/BidiRun.cpp:
        (WebCore::BidiRun::BidiRun):
        * rendering/BidiRun.h:
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::setLogicalWidthForTextRun):
        (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
        (WebCore::findFirstTrailingSpace):
        (WebCore::RenderBlockFlow::handleTrailingSpaces):
        * rendering/line/BreakingContext.h:

2016-08-19  Myles C. Maxfield  <mmaxfield@apple.com>

        Migrate RenderText::stringView() to unsigneds
        https://bugs.webkit.org/show_bug.cgi?id=161005

        Reviewed by Alex Christensen.

        No new tests because there is no behavior change.

        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
        * rendering/RenderText.cpp:
        (WebCore::RenderText::stringView):
        * rendering/RenderText.h:

2016-08-18  Ryosuke Niwa  <rniwa@webkit.org>

        Rename LifecycleCallback to CustomElementReaction
        https://bugs.webkit.org/show_bug.cgi?id=160991

        Reviewed by Chris Dumez.

        Renamed LifecycleCallbackQueue and CustomElementLifecycleProcessingStack
        to CustomElementReactionQueue and CustomElementReactionStack per the latest spec:
        https://html.spec.whatwg.org/#custom-element-reactions

        No new tests since this is just a rename of classes which are not exposed to the Web.

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

        * bindings/js/JSCustomElementsRegistryCustom.cpp:
        (WebCore::getCallback): Renamed from getLifecycleCallback.
        (WebCore::JSCustomElementsRegistry::define):
        (WebCore::getLifecycleCallback): Deleted.

        * bindings/js/JSMainThreadExecState.h:
        (WebCore::JSMainThreadNullState):

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):

        * bindings/scripts/test/JS/JSTestObj.cpp: Rebaselined.
        * bindings/scripts/test/TestObj.idl:

        * dom/CustomElementReactionQueue.cpp: Moved from Source/WebCore/dom/LifecycleCallbackQueue.cpp.
        (WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem):
        (WebCore::CustomElementReactionQueue::CustomElementReactionQueue):
        (WebCore::CustomElementReactionQueue::~CustomElementReactionQueue):
        (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
        (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
        (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
        (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
        (WebCore::CustomElementReactionQueue::invokeAll):
        (WebCore::CustomElementReactionStack::ensureCurrentQueue):
        (WebCore::CustomElementReactionStack::processQueue):

        * dom/CustomElementReactionQueue.h: Moved from Source/WebCore/dom/LifecycleCallbackQueue.h.
        (WebCore::CustomElementReactionStack::CustomElementReactionStack):
        (WebCore::CustomElementReactionStack::~CustomElementReactionStack):
        (WebCore::CustomElementReactionStack::hasCurrentProcessingStack):

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

        * dom/Element.cpp:
        (WebCore::Element::attributeChanged):
        (WebCore::Element::insertedInto):
        (WebCore::Element::removedFrom):

2016-08-19  Chris Dumez  <cdumez@apple.com>

        Attr.prefix / Element.prefix attribute should be readonly
        https://bugs.webkit.org/show_bug.cgi?id=160998

        Reviewed by Daniel Bates.

        Attr.prefix / Element.prefix attribute should be readonly:
        - https://dom.spec.whatwg.org/#element
        - https://dom.spec.whatwg.org/#attr

        Firefox and Chrome agree with the specification.

        No new tests, rebaselined existing test.

        * dom/Attr.idl:
        * dom/Element.idl:

2016-08-19  Chris Dumez  <cdumez@apple.com>

        <command> should be an HTMLUnknownElement and <basefont> should be an HTMLElement
        https://bugs.webkit.org/show_bug.cgi?id=161004

        Reviewed by Daniel Bates.

        <command> should be an HTMLUnknownElement and <basefont> should be an HTMLElement as per:
        - https://html.spec.whatwg.org/multipage/dom.html#elements-in-the-dom:element-interface

        <basefont> is already an HTMLElement in Firefox and Chrome. <command> is an
        HTMLUnknownElement in Firefox but an HTMLElement in Chrome.

        No new tests, rebaselined existing test.

        * html/HTMLTagNames.in:

2016-08-19  Nan Wang  <n_wang@apple.com>

        AX: iOS, Wrong axLabel on static text if heading has multiple children
        https://bugs.webkit.org/show_bug.cgi?id=160981

        Reviewed by Chris Fleizach.

        Headings are using textUnderElement to compute the accessibilityLabel on iOS, so normally it's
        the concatenation of all the children's accessibilityLabel. Therefore, we shouldn't use accessibilityLabel
        to check for user defined text on headings. Instead, baseAccessibilityDescription will return the 
        alternate text we want.

        Changes are covered in the modified test.

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):

2016-08-19  Johan K. Jensen  <johan_jensen@apple.com>

        Resource Timing: Make PerformanceEntryList a sequence as per spec
        https://bugs.webkit.org/show_bug.cgi?id=160963

        Reviewed by Alex Christensen.

        Change PerformanceEntryList to be a sequence of PerformanceEntry instead of an object.

        Test: http/tests/performance/performance-resource-timing-entries-iterable.html

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * PlatformGTK.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/scripts/CodeGeneratorGObject.pm:
        Remove references to {JS,}PerformanceEntryList.{cpp,h,idl}.

        * page/Performance.cpp:
        (WebCore::Performance::getEntries):
        (WebCore::Performance::getEntriesByType):
        (WebCore::Performance::getEntriesByName):
        * page/Performance.h:
        Methods now operate on a Vector of PerformanceEntry.

        * page/Performance.idl:
        Typedef PerformanceEntryList as a sequence of PerformanceEntry.

        * page/PerformanceEntryList.cpp: Removed.
        (WebCore::PerformanceEntryList::PerformanceEntryList): Deleted.
        (WebCore::PerformanceEntryList::~PerformanceEntryList): Deleted.
        (WebCore::PerformanceEntryList::length): Deleted.
        (WebCore::PerformanceEntryList::item): Deleted.
        (WebCore::PerformanceEntryList::append): Deleted.
        (WebCore::PerformanceEntryList::appendAll): Deleted.
        (WebCore::PerformanceEntryList::sort): Deleted.
        * page/PerformanceEntryList.h: Removed.
        (WebCore::PerformanceEntryList::create): Deleted.
        * page/PerformanceEntryList.idl: Removed.

2016-08-19  Eric Carlson  <eric.carlson@apple.com>

        [Mac] fix PiP context menu typos
        https://bugs.webkit.org/show_bug.cgi?id=160999
        <rdar://problem/27885070>

        Reviewed by Jer Noble.

        * English.lproj/Localizable.strings: "Picture-in-Picture" -> "Picture in Picture".

        * platform/LocalizedStrings.cpp:
        (WebCore::contextMenuItemTagEnterVideoEnhancedFullscreen): Ditto.
        (WebCore::contextMenuItemTagExitVideoEnhancedFullscreen): Ditto.

2016-08-16  Simon Fraser  <simon.fraser@apple.com>

        Rename didLayout(LayoutMilestones) to didReachLayoutMilestone(), and related WK2 functions
        https://bugs.webkit.org/show_bug.cgi?id=160923

        Reviewed by Tim Horton.

        didLayout(LayoutMilestones) -> didReachLayoutMilestone(LayoutMilestones)
        dispatchDidLayout(LayoutMilestones) -> dispatchDidReachLayoutMilestone(LayoutMilestones)

        * dom/Document.cpp:
        (WebCore::Document::setVisualUpdatesAllowed):
        * loader/EmptyClients.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::didReachLayoutMilestone):
        (WebCore::FrameLoader::didLayout): Deleted.
        * loader/FrameLoader.h:
        * loader/FrameLoaderClient.h:
        * page/FrameView.cpp:
        (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
        (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
        * page/LayoutMilestones.h: Formatting
        * page/Page.cpp:
        (WebCore::Page::addRelevantRepaintedObject):

2016-08-19  Chris Dumez  <cdumez@apple.com>

        DumpRenderTree crashed in com.apple.WebCore: WebCore::DOMWindow::resetDOMWindowProperties + 607
        https://bugs.webkit.org/show_bug.cgi?id=160983
        <rdar://problem/26768524>

        Reviewed by Brent Fulgham.

        Update DOMWindow::frameDestroyed() to ref the window object as the crash
        traces seem to indicate it can get destroyed during the execution of this
        method. Also update the code in the ~Frame destructor to not iterate over
        the list of FrameDestructionObservers because observers remove themselves
        from the list when they get destroyed.

        No new tests, do not know how to reproduce.

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::frameDestroyed):
        * page/Frame.cpp:
        (WebCore::Frame::~Frame):

2016-08-19  Chris Dumez  <cdumez@apple.com>

        WebKit should unset event propagation flags after dispatch
        https://bugs.webkit.org/show_bug.cgi?id=160853

        Reviewed by Ryosuke Niwa.

        WebKit should unset event propagation flags after dispatch to reflect
        the latest DOM specification:
        - https://github.com/whatwg/dom/commit/806d4aab584f6fc38c21f8e088b51b8ba3e27e20

        No new tests, rebaselined existing tests.

        * dom/Event.h:
        (WebCore::Event::resetPropagationFlags):
        * dom/EventDispatcher.cpp:
        (WebCore::EventDispatcher::dispatchEvent):
        * dom/EventTarget.cpp:
        (WebCore::EventTarget::dispatchEvent):

2016-08-18  Daniel Bates  <dabates@apple.com>

        Ld warns of non-existent PrivateFrameworks directory when building WebKit with the public iOS 9.3 SDK
        https://bugs.webkit.org/show_bug.cgi?id=160979

        Rubber-stamped by Simon Fraser.

        Only add the SDK PrivateFrameworks directory to the FRAMEWORK_SEARCH_PATH when building for
        iOS Simulator, building with an iOS SDK that does not support text-based stubs, or building
        an Apple-internal build.

        * Configurations/Base.xcconfig: Define WK_TARGET_IOS_VERSION_MAJOR.
        * Configurations/WebCore.xcconfig:

2016-08-18  Sam Weinig  <sam@webkit.org>

        Re-landing:

        Support WebIDL unions (Part 1)
        https://bugs.webkit.org/show_bug.cgi?id=160769

        Reviewed by Chris Dumez.

        This is the first part of an effort to add support for union types
        in our code generators. This change:
        - Adds a domType struct to hold the parsed type information. For now, we only
          use it temporarily while parsing, and don't expose it to the code generators,
          but that will change in a later patch.
        - Remove support for scoped identifiers for types. They are not supported by WebIDL.
        - Make debugging the parser easier by providing backtraces when asserting.

        There should be no observable changes.

        * bindings/scripts/IDLParser.pm:

2016-08-18  Chris Dumez  <cdumez@apple.com>

        Move prefix / namespaceURI / localName attributes from Node to Attr / Element
        https://bugs.webkit.org/show_bug.cgi?id=160988

        Reviewed by Ryosuke Niwa.

        Move prefix / namespaceURI / localName attributes from Node to Attr / Element
        as per the latest DOM specification:
        - https://dom.spec.whatwg.org/#element
        - https://dom.spec.whatwg.org/#attr

        Firefox and Chrome match the specification.

        No new tests, rebaselined existing tests.

        * dom/Attr.h:
        * dom/Attr.idl:
        * dom/Element.h:
        * dom/Element.idl:
        * dom/Node.idl:

2016-08-18  Jonathan Bedard  <jbedard@apple.com>

        Binding NULL pointer to reference in WebCore::RenderObject
        https://bugs.webkit.org/show_bug.cgi?id=160830

        Reviewed by Myles C. Maxfield.

        No new tests needed, existing functionality not changed.

        Fixes a dereferenced NULL pointer bound to a reference through a minor re-factor.

        * rendering/InlineIterator.h:
        (WebCore::InlineIterator::clear): Explicit clear occurs, instead of a call to moveTo.
        (WebCore::InlineIterator::moveToStartOf): Swapped pointer for reference.
        (WebCore::InlineIterator::moveTo): Swapped pointer for reference.
        (WebCore::InlineIterator::increment): Explicitly call clear for clarity.
        * rendering/line/BreakingContext.h:
        (WebCore::BreakingContext::commitLineBreakClear): Commit a line break and clear the iterator.
        (WebCore::BreakingContext::commitLineBreakAtCurrentWidth): Swapped pointer for reference.
        (WebCore::BreakingContext::InlineIteratorHistory::moveTo): Swapped pointer for reference.
        (WebCore::BreakingContext::increment): Explicitly call clear for clarity.
        (WebCore::BreakingContext::handleBR): Swapped pointer for passed reference.
        (WebCore::BreakingContext::handleReplaced): Explicitly call clear for clarity.
        (WebCore::tryHyphenating): Swapped pointer for passed reference.
        (WebCore::BreakingContext::handleText): Replaced all render object passing with references.  Note that the caller explicitly checks if m_current.renderer() exists before calling this function.
        (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded): Explicitly call clear for clarity.
        (WebCore::BreakingContext::handleEndOfLine): Explicitly call clear for clarity.

2016-08-18  Ryosuke Niwa  <rniwa@webkit.org>

        Windows build fix after r204611. Use the fully qualified name to avoid the ambiguity in VC++.

        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::invokeCallback):
        * bindings/js/JSCustomElementInterface.h:
        (WebCore::JSCustomElementInterface::invokeCallback):

2016-08-18  Dean Jackson  <dino@apple.com>

        Support passing preferLowPowerToHighPerformance and failIfMajorPerformanceCaveat
        https://bugs.webkit.org/show_bug.cgi?id=160982
        <rdar://problem/27915946>

        Reviewed by Simon Fraser.

        Update WebGLContextAttributes to be compliant with the specification,
        by adding preferLowPowerToHighPerformance and failIfMajorPerformanceCaveat.
        They are not implemented yet, so asking the created context what
        values it used should give the default.

        Test: fast/canvas/webgl/context-creation-attributes.html

        * html/canvas/WebGLContextAttributes.cpp:
        (WebCore::WebGLContextAttributes::preferLowPowerToHighPerformance):
        (WebCore::WebGLContextAttributes::setPreferLowPowerToHighPerformance):
        (WebCore::WebGLContextAttributes::failIfMajorPerformanceCaveat):
        (WebCore::WebGLContextAttributes::setFailIfMajorPerformanceCaveat):
        * html/canvas/WebGLContextAttributes.h:
        * html/canvas/WebGLContextAttributes.idl:
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::create): Deleted.
        * platform/graphics/GraphicsContext3D.h:
        (WebCore::GraphicsContext3D::Attributes::Attributes): Deleted.

2016-08-18  Anders Carlsson  <andersca@apple.com>

        Move an NPAPI-only function from WebCore to WebKit
        https://bugs.webkit.org/show_bug.cgi?id=160967

        Reviewed by Sam Weinig.

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::createScriptObjectForPluginElement): Deleted.
        * bindings/js/ScriptController.h:
        * bridge/NP_jsobject.h:

2016-08-18  Ryosuke Niwa  <rniwa@webkit.org>

        Binding test fix after r204611.

        * bindings/scripts/test/TestObj.idl:

2016-08-18  Chris Dumez  <cdumez@apple.com>

        Unreviewed, nit fix after r204605 reported by Darin.

        * platform/text/TextCodecICU.cpp:

2016-08-17  Ryosuke Niwa  <rniwa@webkit.org>

        Add basic support for connected and disconnected callbacks
        https://bugs.webkit.org/show_bug.cgi?id=160950

        Reviewed by Chris Dumez.

        Added the basic support for custom elements' connectedCallback and disconnectedCallback. These callbacks
        are enqueued by inserting and removing a node as spec'ed by https://dom.spec.whatwg.org/#concept-node-insert
        and https://dom.spec.whatwg.org/#concept-node-remove

        For now, we only support callbacks on appendChild and removeChild to limit the amount of code changes and
        tests that need to be included in this patch.

        This patch also renames InvokesCustomElementLifecycleCallbacks IDL attribute to CEReactions to match
        the latest specification: https://html.spec.whatwg.org/multipage/scripting.html#cereactions

        Tests: fast/custom-elements/connected-callbacks.html
               fast/custom-elements/disconnected-callbacks.html

        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::invokeCallback): Extracted from invokeAttributeChangedCallback.
        (WebCore::JSCustomElementInterface::setConnectedCallback): Added.
        (WebCore::JSCustomElementInterface::invokeConnectedCallback): Added.
        (WebCore::JSCustomElementInterface::setDisconnectedCallback): Added.
        (WebCore::JSCustomElementInterface::invokeDisconnectedCallback): Added.
        (WebCore::JSCustomElementInterface::setAttributeChangedCallback):
        (WebCore::JSCustomElementInterface::invokeAttributeChangedCallback): Renamed from attributeChanged.
        * bindings/js/JSCustomElementInterface.h: Added m_connectedCallback and m_disconnectedCallback as instance
        variables. Also removed the superfluous mutable qualifier from m_constructor m_attributeChangedCallback.
        * bindings/js/JSCustomElementsRegistryCustom.cpp:
        (WebCore::JSCustomElementsRegistry::define): Store connectedCallback and disconnectedCallback.
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):
        * bindings/scripts/IDLAttributes.txt:
        * dom/CustomElementsRegistry.idl:
        * dom/Element.cpp:
        (WebCore::Element::insertedInto): Call enqueueConnectedCallbackIfNeeded.
        (WebCore::Element::removedFrom): Call enqueueDisconnectedCallbackIfNeeded.
        * dom/Element.idl:
        * dom/LifecycleCallbackQueue.cpp:
        (WebCore::LifecycleQueueItem::invoke): Added calls to invokeConnectedCallback and invokeDisconnectedCallback.
        (WebCore::findInterfaceForCustomElement): Extracted from enqueueAttributeChangedCallbackIfNeeded.
        (WebCore::LifecycleCallbackQueue::enqueueConnectedCallbackIfNeeded): Added.
        (WebCore::LifecycleCallbackQueue::enqueueDisconnectedCallbackIfNeeded): Added.
        (WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallbackIfNeeded):
        (WebCore::CustomElementLifecycleProcessingStack::ensureCurrentQueue):
        * dom/LifecycleCallbackQueue.h:
        * dom/Node.idl:

2016-08-18  Beth Dakin  <bdakin@apple.com>

        Update the accessibility titles for list insertion
        https://bugs.webkit.org/show_bug.cgi?id=160972
        -and corresponding-
        rdar://problem/27750446

        Reviewed by Chris Fleizach.

        Update accessibility titles based on feedback.
        * English.lproj/Localizable.strings:
        * platform/LocalizedStrings.cpp:
        (WebCore::insertListTypeNone):
        (WebCore::insertListTypeBulleted):
        (WebCore::insertListTypeBulletedAccessibilityTitle):
        (WebCore::insertListTypeNumbered):
        (WebCore::insertListTypeNumberedAccessibilityTitle):
        (WebCore::insertListTypeNoneAccessibilityTitle): Deleted.
        * platform/LocalizedStrings.h:

2016-08-18  Chris Dumez  <cdumez@apple.com>

        Align our encoding labels with the encoding specification
        https://bugs.webkit.org/show_bug.cgi?id=160931

        Reviewed by Darin Adler.

        Align our encoding labels with the encoding specification:
        - https://encoding.spec.whatwg.org/#names-and-labels

        This also aligns with Firefox and Chrome.

        No new tests, rebaselined existing test.

        * platform/text/TextCodecICU.cpp:
        (WebCore::TextCodecICU::registerEncodingNames):
        * platform/text/TextCodecLatin1.cpp:
        (WebCore::TextCodecLatin1::registerEncodingNames):
        (WebCore::newStreamingTextDecoderWindowsLatin1): Deleted.
        (WebCore::TextCodecLatin1::registerCodecs): Deleted.
        * platform/text/TextCodecUTF8.cpp:
        (WebCore::TextCodecUTF8::registerEncodingNames):

2016-08-18  Andy Estes  <aestes@apple.com>

        [Cocoa] Add SPI to WKProcessPool for enabling cookie storage partitioning
        https://bugs.webkit.org/show_bug.cgi?id=160964

        Reviewed by Brent Fulgham.

        * page/Settings.cpp:
        (WebCore::Settings::setCookieStoragePartitioningEnabled): Deleted.
        * page/Settings.h:
        (WebCore::Settings::cookieStoragePartitioningEnabled): Deleted.
        * platform/network/NetworkStorageSession.h:
        * platform/network/cf/NetworkStorageSessionCFNet.cpp: Defined cookieStoragePartitioningEnabled.
        (WebCore::NetworkStorageSession::setCookieStoragePartitioningEnabled): Set cookieStoragePartitioningEnabled.
        (WebCore::cookieStoragePartition): Used cookieStoragePartitioningEnabled instead of Settings::cookieStoragePartitioningEnabled().

2016-08-18  Eric Carlson  <eric.carlson@apple.com>

        AX: Audio Description tracks are not labeled correctly, causing user confusion
        https://bugs.webkit.org/show_bug.cgi?id=160652
        <rdar://problem/27742208>

        Reviewed by Antoine Quint.

        * http/tests/media/hls/hls-accessiblity-describes-video-menu-expected.txt: Added.
        * http/tests/media/hls/hls-accessiblity-describes-video-menu.html: Added.

        * media/trackmenu-test.js:
        (clickCCButton): Fail immediately if "video" is null or not a media element. Make failure 
        logging more descriptive.

        * platform/gtk/TestExpectations: Skip new test.

        * platform/ios-simulator/media/video-controls-captions-trackmenu-expected.txt: Updated for
        clickCCButton error message change.
        * platform/ios-simulator/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Ditto.
        * platform/ios-simulator/media/video-controls-captions-trackmenu-localized-expected.txt: Ditto.
        * platform/ios-simulator/media/video-controls-captions-trackmenu-sorted-expected.txt: Ditto.

2016-08-18  Alex Christensen  <achristensen@webkit.org>

        Fix WinCairo build after r204592.

        * PlatformAppleWin.cmake:
        * PlatformWin.cmake:

2016-08-18  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] cleanup MediaConstraints
        https://bugs.webkit.org/show_bug.cgi?id=160957

        Reviewed by Antoine Quint.

        No new tests, no behavior change.

        * Modules/mediastream/CaptureDeviceManager.cpp:
        (CaptureDeviceManager::sessionSupportsConstraint): Use MediaConstraint::type

        * bindings/js/JSMediaDevicesCustom.cpp:
        (WebCore::initializeStringConstraintWithList): MediaConstraint::create now takes the constraint
        type, not name.
        (WebCore::createStringConstraint): Ditto.
        (WebCore::createBooleanConstraint): Ditto.
        (WebCore::createDoubleConstraint): Ditto.
        (WebCore::createIntConstraint): Ditto.
        (WebCore::parseMediaTrackConstraintSetForKey): Pass constraint type.

        * platform/mediastream/MediaConstraints.cpp:
        (WebCore::MediaConstraint::create): MediaConstraint constructor now takes the constraint.
        (WebCore::IntConstraint::create): Take type, not name.
        (WebCore::IntConstraint::setMin): Ditto.
        (WebCore::DoubleConstraint::create): Ditto.
        (WebCore::BooleanConstraint::create): Ditto.
        (WebCore::StringConstraint::create): Ditto.
        * platform/mediastream/MediaConstraints.h:

        * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
        (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint): Make static.
        (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName): Ditto.
        * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:

        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
        (WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Use MediaConstraint::type

        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::applyConstraints): nameForConstraint is a static method. Add
        error logging.

        * platform/mock/MediaConstraintsMock.cpp:
        (WebCore::isSatisfiable): Use constraint type.

2016-08-18  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>

        [web-animations] Add Animatable, AnimationEffect, KeyframeEffect and Animation interface
        https://bugs.webkit.org/show_bug.cgi?id=156096

        Reviewed by Dean Jackson.

        Adds:
        - Animatable interface and implementation of getAnimations in Element.
        - Interface and implementation for Document getAnimations method.
        - AnimationEffect interface and class stub.
        - KeyframeEffect interface and constructor implementation.
        - 'Animation' interface, constructor and query methods for effect and timeline.
        - Remove runtime condition on Web animation interfaces (compile time flag is specified).

        Test: webanimations/Document.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * PlatformGTK.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * animation/Animatable.idl: Copied from Source/WebCore/animation/AnimationTimeline.idl.
        * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/AnimationTimeline.cpp.
        (WebCore::AnimationEffect::AnimationEffect):
        (WebCore::AnimationEffect::~AnimationEffect):
        (WebCore::AnimationEffect::setAnimation):
        (WebCore::AnimationEffect::isCurrent):
        (WebCore::AnimationEffect::isInEffect):
        * animation/AnimationEffect.h: Copied from Source/WebCore/animation/DocumentTimeline.cpp.
        * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/DocumentAnimation.idl.
        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::destroy):
        (WebCore::AnimationTimeline::attachAnimation):
        (WebCore::AnimationTimeline::detachAnimation):
        * animation/AnimationTimeline.h:
        * animation/AnimationTimeline.idl:
        * animation/DocumentAnimation.cpp:
        (WebCore::DocumentAnimation::timeline):
        (WebCore::DocumentAnimation::getAnimations):
        (WebCore::DocumentAnimation::addAnimation):
        (WebCore::DocumentAnimation::removeAnimation):
        * animation/DocumentAnimation.h:
        (WebCore::DocumentAnimation::getAnimations):
        * animation/DocumentAnimation.idl:
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::create):
        (WebCore::DocumentTimeline::DocumentTimeline):
        (WebCore::DocumentTimeline::attach):
        (WebCore::DocumentTimeline::detach):
        * animation/DocumentTimeline.h:
        * animation/DocumentTimeline.idl:
        * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/DocumentTimeline.cpp.
        (WebCore::KeyframeEffect::create):
        (WebCore::KeyframeEffect::KeyframeEffect):
        (WebCore::KeyframeEffect::~KeyframeEffect):
        * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/DocumentTimeline.h.
        * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/DocumentTimeline.idl.
        * animation/WebAnimation.cpp: Copied from Source/WebCore/animation/DocumentAnimation.cpp.
        (WebCore::WebAnimation::create):
        (WebCore::WebAnimation::WebAnimation):
        (WebCore::WebAnimation::~WebAnimation):
        * animation/WebAnimation.h: Copied from Source/WebCore/animation/DocumentAnimation.h.
        * animation/WebAnimation.idl: Copied from Source/WebCore/animation/DocumentTimeline.idl.
        * bindings/scripts/CodeGeneratorGObject.pm:
        * dom/Element.cpp:
        (WebCore::Element::getAnimations):
        * dom/Element.h:
        * dom/Element.idl:

2016-08-17  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Migrate off of deprecated CoreGraphics API CGContextSelectFont() and CGContextShowTextAtPoint()
        https://bugs.webkit.org/show_bug.cgi?id=160895

        Reviewed by Dean Jackson.

        Migrate to CTLineDraw() instead.

        This patch also adds support for linking to the existing CoreText framework on Windows.

        No new tests because there is no behavior change.

        * PlatformWin.cmake:
        * page/cocoa/ResourceUsageOverlayCocoa.mm:
        (WebCore::showText):
        * platform/graphics/ca/PlatformCALayer.cpp:
        (WebCore::PlatformCALayer::drawTextAtPoint):
        * platform/ios/LegacyTileCache.mm:
        (WebCore::LegacyTileCache::drawLayer):
        * platform/spi/win/CoreTextSPIWin.cpp: Added.
        * platform/spi/win/CoreTextSPIWin.h: Added.

2016-08-17  Benjamin Poulain  <benjamin@webkit.org>

        [CSS] The parser should not get rid of empty namespace specification in front of element name selectors
        https://bugs.webkit.org/show_bug.cgi?id=160936

        Reviewed by Chris Dumez.

        There are two places where you can specify an empty namespace
        in selectors:
            - Element name (e.g. "|name")
            - Attribute name (e.g. "[|name]")
        In the first case, if we have an empty namespace, the selector
        should match that.
        In the second case, the default namespace of attribute is already
        empty so it is just the same as "[name]".

        Our code was just discarding any empty namespace. This is fine
        for attributes but for names that is transforming "|name" into "name"
        which is invalid.

        This patch updates those cases to differentiate:
        - Null prefix -> There was no namespace specified.
        - Empty prefix -> There was a namespace prefix and it is empty.

        Test: fast/selectors/empty-namespace-with-element-selector.html

        * css/CSSGrammar.y.in:
        * css/CSSParser.cpp:
        (WebCore::CSSParser::determineNameInNamespace):
        (WebCore::CSSParser::rewriteSpecifiersWithNamespaceIfNeeded):
        (WebCore::CSSParser::rewriteSpecifiersWithElementName):
        * css/CSSParser.h:
        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::selectorText):
        * css/CSSSelectorList.cpp:
        (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
        * css/StyleSheetContents.cpp:
        (WebCore::StyleSheetContents::determineNamespace): Deleted.

2016-08-17  Chris Dumez  <cdumez@apple.com>

        [Web IDL] Add support for dictionary members of dictionary types
        https://bugs.webkit.org/show_bug.cgi?id=160902

        Reviewed by Sam Weinig.

        Add support for dictionary members of dictionary types.

        No new tests, updated bindings tests.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateDictionaryImplementationContent):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::convertDictionary<TestObj::Dictionary>):
        (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
        * bindings/scripts/test/TestObj.idl:

2016-08-17  Anders Carlsson  <andersca@apple.com>

        Add support for additional networks
        https://bugs.webkit.org/show_bug.cgi?id=160951
        rdar://problem/27807479

        Reviewed by Sam Weinig.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::createSupportedNetworks):
        (WebCore::createPaymentRequest):
        (WebCore::ApplePaySession::create):
        * Modules/applepay/PaymentRequest.cpp:
        (WebCore::isAdditionalValidSupportedNetwork):
        (WebCore::PaymentRequest::isValidSupportedNetwork):
        * Modules/applepay/PaymentRequest.h:
        (WebCore::PaymentRequest::supportedNetworks):
        (WebCore::PaymentRequest::setSupportedNetworks):
        * Modules/applepay/PaymentRequestValidator.cpp:
        (WebCore::PaymentRequestValidator::validateSupportedNetworks):
        * Modules/applepay/PaymentRequestValidator.h:

2016-08-17  Anders Carlsson  <andersca@apple.com>

        Remove a couple of unused WKSI function pointers
        https://bugs.webkit.org/show_bug.cgi?id=160946

        Reviewed by Dan Bernstein.

        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:

2016-08-17  Anders Carlsson  <andersca@apple.com>

        Move WKSignedPublicKeyAndChallengeString into WebCore and make it proper C++
        https://bugs.webkit.org/show_bug.cgi?id=160945

        Reviewed by Dan Bernstein.

        * platform/mac/SSLKeyGeneratorMac.mm:
        (WebCore::getSubjectPublicKey):
        (WebCore::signPublicKeyAndChallenge):
        (WebCore::signedPublicKeyAndChallengeString):

2016-08-17  Antti Koivisto  <antti@apple.com>

        Remove CSS_IMAGE_SET feature define
        https://bugs.webkit.org/show_bug.cgi?id=160944

        Reviewed by Dean Jackson.

        This seems to be enabled everywhere already (except Mac cmake build which it keep breaking).

        * css/CSSCursorImageValue.cpp:
        (WebCore::CSSCursorImageValue::CSSCursorImageValue):
        (WebCore::CSSCursorImageValue::cachedImage):
        (WebCore::CSSCursorImageValue::cachedOrPendingImage):
        * css/CSSImageSetValue.cpp:
        (WebCore::CSSImageSetValue::cloneForCSSOM):
        * css/CSSImageSetValue.h:
        * css/CSSParser.cpp:
        (WebCore::CSSParser::parseVariableDependentValue):
        (WebCore::isImageSetFunctionValue):
        (WebCore::CSSParser::parseValue):
        (WebCore::CSSParser::parseContent):
        (WebCore::CSSParser::parseFillImage):
        (WebCore::CSSParser::parseBorderImage):
        (WebCore::CSSParser::parseImageResolution):
        (WebCore::CSSParser::parseImageSet):
        * css/CSSParser.h:
        * css/CSSToStyleMap.cpp:
        (WebCore::CSSToStyleMap::mapNinePieceImage):
        * css/CSSValue.cpp:
        (WebCore::CSSValue::traverseSubresources):
        (WebCore::CSSValue::equals):
        (WebCore::CSSValue::cssText):
        (WebCore::CSSValue::destroy):
        (WebCore::CSSValue::cloneForCSSOM):
        * css/CSSValue.h:
        (WebCore::CSSValue::isImageGeneratorValue):
        (WebCore::CSSValue::isGradientValue):
        (WebCore::CSSValue::isNamedImageValue):
        (WebCore::CSSValue::isImageSetValue):
        (WebCore::CSSValue::isImageValue):
        (WebCore::CSSValue::isInheritedValue):
        * css/StyleBuilderConverter.h:
        (WebCore::isImageShape):
        * css/StyleBuilderCustom.h:
        (WebCore::StyleBuilderCustom::applyValueContent):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::styleImage):
        (WebCore::StyleResolver::generatedOrPendingFromValue):
        (WebCore::StyleResolver::setOrPendingFromValue):
        (WebCore::StyleResolver::cursorOrPendingFromValue):
        * css/StyleResolver.h:
        (WebCore::StyleResolver::applyPropertyToRegularStyle):
        * css/makeprop.pl:
        (generateFillLayerPropertyValueSetter):
        * rendering/style/StyleCachedImage.cpp:
        (WebCore::StyleCachedImage::cssValue):
        * rendering/style/StylePendingImage.h:
        * style/StylePendingResources.cpp:
        (WebCore::Style::loadPendingImage):

2016-08-17  Antti Koivisto  <antti@apple.com>

        Try to fix CMake build.

        * rendering/style/StyleCachedImage.cpp:
        (WebCore::StyleCachedImage::cssValue):

2016-08-17  Chris Fleizach  <cfleizach@apple.com>

        AX: Support abbreviations in iOS
        https://bugs.webkit.org/show_bug.cgi?id=160907

        Reviewed by Joanmarie Diggs.

        Expose the expandedTextValue attribute for iOS, so that VoiceOver can speak abbreviations correctly.

        Test: accessibility/ios-simulator/abbreviation.html

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper textMarkersForRange:]):
        (-[WebAccessibilityObjectWrapper accessibilityExpandedTextValue]):
        (-[WebAccessibilityObjectWrapper accessibilityIdentifier]):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (AXAttributeStringSetSpelling):
        (AXAttributeStringSetExpandedTextValue):
        (AXAttributedStringAppendText):
        (AXAttributeStringSetexpandedTextValue): Deleted.

2016-08-17  Antti Koivisto  <antti@apple.com>

        Remove StyleCachedImageSet
        https://bugs.webkit.org/show_bug.cgi?id=160941

        Reviewed by Simon Fraser.

        It is almost the same as StyleCachedImage. Just use that.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSCursorImageValue.cpp:
        (WebCore::CSSCursorImageValue::cachedImage):
        * css/CSSImageSetValue.cpp:
        (WebCore::CSSImageSetValue::detachPendingImage):
        (WebCore::CSSImageSetValue::~CSSImageSetValue):
        (WebCore::CSSImageSetValue::fillImageSet):
        (WebCore::CSSImageSetValue::bestImageForScaleFactor):
        (WebCore::CSSImageSetValue::bestFitImage):
        (WebCore::CSSImageSetValue::cachedOrPendingImageSet):
        (WebCore::CSSImageSetValue::customCSSText):
        (WebCore::CSSImageSetValue::traverseSubresources):
        (WebCore::CSSImageSetValue::cachedImageSet): Deleted.
        * css/CSSImageSetValue.h:
        (WebCore::CSSImageSetValue::create):
        (WebCore::CSSImageSetValue::compareByScaleFactor):
        * css/StyleResolver.cpp:
        * page/EventHandler.cpp:
        * rendering/style/ShapeValue.cpp:
        (WebCore::ShapeValue::isImageValid):
        * rendering/style/StyleAllInOne.cpp:
        * rendering/style/StyleCachedImage.cpp:
        (WebCore::StyleCachedImage::StyleCachedImage):

            Add scale factor and CSSImageSetValue backpointer, the only additional features of StyleCachedImageSet.

        (WebCore::StyleCachedImage::cssValue):
        (WebCore::StyleCachedImage::imageSize):
        (WebCore::StyleCachedImage::imageHasRelativeWidth):
        * rendering/style/StyleCachedImage.h:
        * rendering/style/StyleCachedImageSet.cpp: Removed.
        * rendering/style/StyleCachedImageSet.h: Removed.
        * rendering/style/StyleImage.h:
        (WebCore::StyleImage::isCachedImage):
        (WebCore::StyleImage::isPendingImage):
        (WebCore::StyleImage::isGeneratedImage):
        (WebCore::StyleImage::StyleImage):
        (WebCore::StyleImage::isCachedImageSet): Deleted.
        * style/StylePendingResources.cpp:
        (WebCore::Style::loadPendingImage):

2016-08-17  Per Arne Vollan  <pvollan@apple.com>

        [Win] Add tests for linked fonts.
        https://bugs.webkit.org/show_bug.cgi?id=160898

        Reviewed by Brent Fulgham.

        Add tests for https://trac.webkit.org/changeset/204502.

        * platform/graphics/win/FontCacheWin.cpp:
        (WebCore::appendLinkedFonts):
        (WebCore::getLinkedFonts):

2016-08-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GObject DOM bindings API break after r204449, r204450 and r204451.

        Attributes designMode, embeds, plugins, scripts and compatMode have been moved from HTMLDocument to Document.

        * bindings/gobject/WebKitDOMDeprecated.cpp:
        (webkit_dom_html_document_get_design_mode):
        (webkit_dom_html_document_set_design_mode):
        (webkit_dom_html_document_get_compat_mode):
        (webkit_dom_html_document_get_embeds):
        (webkit_dom_html_document_get_plugins):
        (webkit_dom_html_document_get_scripts):
        * bindings/gobject/WebKitDOMDeprecated.h:
        * bindings/gobject/WebKitDOMDeprecated.symbols:
        * bindings/gobject/webkitdom.symbols:

2016-08-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GObject DOM bindings API break after r204312.

        HTMLInputElement capture attribute now returns the actual capture value, instead of whether it's present or
        not. This patch renames webkit_dom_html_input_element_get_capture as
        webkit_dom_html_input_element_get_capture_type and deprecates webkit_dom_html_input_element_get_capture.

        * bindings/gobject/WebKitDOMDeprecated.cpp:
        (webkit_dom_html_input_element_get_capture):
        * bindings/gobject/WebKitDOMDeprecated.h:
        * bindings/gobject/WebKitDOMDeprecated.symbols:
        * bindings/gobject/webkitdom.symbols:
        * bindings/scripts/CodeGeneratorGObject.pm:
        (GenerateProperty):
        (GetEffectiveFunctionName):

2016-08-16  Ryosuke Niwa  <rniwa@webkit.org>

        customElements.define should retrieve lifecycle callbacks
        https://bugs.webkit.org/show_bug.cgi?id=160797

        Reviewed by Chris Dumez.

        Updated JSCustomElementInterface to invoke Get(constructor, "prototype") and Get(prototype, callbackName)
        for each lifecycle callback as required by the latest specification:
        https://html.spec.whatwg.org/#dom-customelementsregistry-define

        Also added the support for "observedAttributes" property on the custom elements constructor which defines
        the list of attributes for which attributeChangedCallback is invoked.

        Test: fast/custom-elements/CustomElementsRegistry.html

        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::setAttributeChangedCallback): Added.
        (WebCore::JSCustomElementInterface::attributeChanged): Invoke m_attributeChangedCallback instead of on the
        result of Get(element, "attributeChangedCallback").
        * bindings/js/JSCustomElementInterface.h:
        (WebCore::JSCustomElementInterface::observesAttribute): Added.

        * bindings/js/JSCustomElementsRegistryCustom.cpp:
        (WebCore::getLifecycleCallback): Added.
        (WebCore::JSCustomElementsRegistry::define): Invoke Get(prototype, callbackName) for each callback. Also
        store attributedChangedCallback and observedAttributes to JSCustomElementInterface. Other callbacks will
        be stored in the future when the support for those callbacks are added.

        * dom/Element.cpp:
        (WebCore::Element::attributeChanged): Moved more code into enqueueAttributeChangedCallbackIfNeeded.

        * dom/LifecycleCallbackQueue.cpp:
        (WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallbackIfNeeded): Added an early exit for when
        the given attribute is not observed by the custom element. Also moved the logic to retrieve
        JSCustomElementInterface from Element::attributeChanged and renamed it from enqueueAttributeChangedCallback.

        * bindings/js/JSDOMBinding.h:
        (WebCore::toNativeArray): Throw a TypeError when the argument is not an object.
        * bindings/js/JSDOMConvert.h:
        (WebCore::Converter<Vector<T>>::convert): Removed a FIXME comment.

2016-08-16  Zalan Bujtas  <zalan@apple.com>

        Subpixel rendering: Cleanup RenderLayerBacking::updateGeometry.
        https://bugs.webkit.org/show_bug.cgi?id=156860
        <rdar://problem/25432352>

        Reviewed by Simon Fraser.

        This patch cleans up the subpixel adjustment computation for the graphics layers
        in RenderLayerBacking::updateGeometry.
        It also fixes subpixel jiggling with clipping layers (both ancestor and child containment layers). 

        Tests: compositing/hidpi-ancestor-subpixel-clipping.html
               compositing/hidpi-sibling-composited-content-offset.html
               compositing/hidpi-subpixel-transform-origin.html
               fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor.html

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::beginTransparencyLayers):
        (WebCore::RenderLayer::paint):
        (WebCore::RenderLayer::clipToRect):
        (WebCore::RenderLayer::setupClipPath):
        (WebCore::RenderLayer::paintLayerByApplyingTransform):
        (WebCore::RenderLayer::paintBackgroundForFragments):
        (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
        (WebCore::RenderLayer::paintOutlineForFragments):
        (WebCore::RenderLayer::paintMaskForFragments):
        (WebCore::RenderLayer::paintChildClippingMaskForFragments):
        (WebCore::RenderLayer::paintOverflowControlsForFragments):
        (WebCore::RenderLayer::calculateClipRects):
        * rendering/RenderLayer.h:
        * rendering/RenderLayerBacking.cpp:
        (WebCore::subpixelOffsetFromRendererChanged):
        (WebCore::subpixelForLayerPainting):
        (WebCore::computeOffsetFromRenderer):
        (WebCore::snappedGraphicsLayerRect):
        (WebCore::computeOffsetFromAncestorGraphicsLayer):
        (WebCore::ComputedOffsets::ComputedOffsets): This is a helper class to hold offset values.
        (WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
        (WebCore::ComputedOffsets::fromParentGraphicsLayer):
        (WebCore::ComputedOffsets::fromPrimaryGraphicsLayer):
        (WebCore::RenderLayerBacking::computePrimaryGraphicsLayerRect):
        (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
        (WebCore::RenderLayerBacking::updateGeometry):
        (WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
        (WebCore::RenderLayerBacking::contentOffsetInCompostingLayer):
        (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
        (WebCore::RenderLayerBacking::paintIntoLayer):
        (WebCore::RenderLayerBacking::paintContents):
        (WebCore::devicePixelFractionGapFromRendererChanged): Deleted.
        (WebCore::pixelFractionForLayerPainting): Deleted.
        (WebCore::calculateDevicePixelOffsetFromRenderer): Deleted.
        (WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread): Deleted.
        * rendering/RenderLayerBacking.h:

2016-08-16  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r204540, r204545, and r204547.
        https://bugs.webkit.org/show_bug.cgi?id=160932

        Broke Windows builds (Requested by rniwa on #webkit).

        Reverted changesets:

        "customElements.define should retrieve lifecycle callbacks"
        https://bugs.webkit.org/show_bug.cgi?id=160797
        http://trac.webkit.org/changeset/204540

        "Windows build fix attempt after r204540."
        http://trac.webkit.org/changeset/204545

        "Another Windows build fix attempt. The error message doesn't
        make any sense to me."
        http://trac.webkit.org/changeset/204547

2016-08-16  Hunseop Jeong  <hs85.jeong@samsung.com>

        Unreviewed, CMake build fix after r204532

        * PlatformMac.cmake:

2016-08-16  Hunseop Jeong  <hs85.jeong@samsung.com>

        Unreviewed, CMake build fix

        * PlatformMac.cmake:

2016-08-16  Ryosuke Niwa  <rniwa@webkit.org>

        Another Windows build fix attempt. The error message doesn't make any sense to me.

        * bindings/js/JSCustomElementsRegistryCustom.cpp:
        (WebCore::JSCustomElementsRegistry::define):

2016-08-16  Ryosuke Niwa  <rniwa@webkit.org>

        Windows build fix attempt after r204540.

        * bindings/js/JSBindingsAllInOne.cpp:

2016-08-16  Alex Christensen  <achristensen@webkit.org>

        URLParser should parse URLs without credentials
        https://bugs.webkit.org/show_bug.cgi?id=160913

        Reviewed by Brady Eidson.

        When parsing a URL, after the scheme we do not know if we are parsing a username and password
        or if we are parsing the host until we hit a '@' indicating the end of the credentials or a /, ?, or #
        indicating the end of the host.  Because there are significantly different rules for serializing usernames,
        passwords, and hosts (all of which have yet to be implemented in URLParser) we put the code points after the 
        scheme in a special buffer that will be processed once we know what we are parsing.
        
        In the future, this could be optimized by assuming that we are parsing the host and if we encounter a '@' character,
        then do some extra work.  This would save us the effort of copying the host twice because most URLs don't have credentials.

        This is covered by a new URLParser API test.

        * platform/Logging.h:
        * platform/URLParser.cpp:
        (WebCore::isC0Control):
        (WebCore::isC0ControlOrSpace):
        (WebCore::isTabOrNewline):
        (WebCore::isSpecialScheme):
        (WebCore::URLParser::parse):
        (WebCore::URLParser::authorityEndReached):
        (WebCore::URLParser::hostEndReached):
        (WebCore::URLParser::allValuesEqual):
        (WebCore::isASCIIDigit): Deleted.
        (WebCore::isASCIIAlpha): Deleted.
        (WebCore::isASCIIAlphanumeric): Deleted.
        * platform/URLParser.h:
        (WebCore::URLParser::parse):

2016-08-16  Chris Dumez  <cdumez@apple.com>

        Add support for ShadowRoot.mode attribute
        https://bugs.webkit.org/show_bug.cgi?id=160919

        Reviewed by Ryosuke Niwa.

        Add support for ShadowRoot.mode attribute:
        - https://dom.spec.whatwg.org/#interface-shadowroot

        Test: fast/shadow-dom/ShadowRoot-mode.html

        * css/ElementRuleCollector.cpp:
        (WebCore::ElementRuleCollector::collectMatchingRules):
        * css/SelectorChecker.cpp:
        (WebCore::SelectorChecker::matchRecursively):
        * dom/Element.cpp:
        (WebCore::Element::bindingsOffsetParent):
        (WebCore::Element::addShadowRoot):
        (WebCore::Element::attachShadow):
        (WebCore::Element::shadowRootForBindings):
        (WebCore::Element::userAgentShadowRoot):
        (WebCore::Element::ensureUserAgentShadowRoot):
        * dom/Node.cpp:
        (WebCore::Node::isUnclosedNode):
        (WebCore::Node::assignedSlotForBindings):
        (WebCore::Node::isInUserAgentShadowTree):
        * dom/ShadowRoot.cpp:
        (WebCore::ShadowRoot::ShadowRoot):
        (WebCore::ShadowRoot::styleResolver):
        * dom/ShadowRoot.h:
        * dom/ShadowRoot.idl:
        * dom/SlotAssignment.cpp:
        (WebCore::SlotAssignment::didChangeSlot):
        * html/HTMLSummaryElement.cpp:
        (WebCore::HTMLSummaryElement::create):
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::shadowRootType):
        (WebCore::InspectorDOMAgent::buildObjectForNode):
        * rendering/HitTestResult.cpp:
        (WebCore::moveOutOfUserAgentShadowTree):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::selectionPseudoStyle):
        * rendering/RenderLayer.cpp:
        (WebCore::rendererForScrollbar):
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::correspondingUseElement):
        * testing/Internals.cpp:
        (WebCore::Internals::shadowRootType):

2016-08-16  Ryosuke Niwa  <rniwa@webkit.org>

        customElements.define should retrieve lifecycle callbacks
        https://bugs.webkit.org/show_bug.cgi?id=160797

        Reviewed by Chris Dumez.

        Updated JSCustomElementInterface to invoke Get(constructor, "prototype") and Get(prototype, callbackName)
        for each lifecycle callback as required by the latest specification:
        https://html.spec.whatwg.org/#dom-customelementsregistry-define

        Also added the support for "observedAttributes" property on the custom elements constructor which defines
        the list of attributes for which attributeChangedCallback is invoked.

        Test: fast/custom-elements/CustomElementsRegistry.html

        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::setAttributeChangedCallback): Added.
        (WebCore::JSCustomElementInterface::attributeChanged): Invoke m_attributeChangedCallback instead of on the
        result of Get(element, "attributeChangedCallback").
        * bindings/js/JSCustomElementInterface.h:
        (WebCore::JSCustomElementInterface::observesAttribute): Added.

        * bindings/js/JSCustomElementsRegistryCustom.cpp:
        (WebCore::getLifecycleCallback): Added.
        (WebCore::JSCustomElementsRegistry::define): Invoke Get(prototype, callbackName) for each callback. Also
        store attributedChangedCallback and observedAttributes to JSCustomElementInterface. Other callbacks will
        be stored in the future when the support for those callbacks are added.

        * dom/Element.cpp:
        (WebCore::Element::attributeChanged): Moved more code into enqueueAttributeChangedCallbackIfNeeded.

        * dom/LifecycleCallbackQueue.cpp:
        (WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallbackIfNeeded): Added an early exit for when
        the given attribute is not observed by the custom element. Also moved the logic to retrieve
        JSCustomElementInterface from Element::attributeChanged and renamed it from enqueueAttributeChangedCallback.

        * bindings/js/JSDOMBinding.h:
        (WebCore::toNativeArray): Throw a TypeError when the argument is not an object.
        * bindings/js/JSDOMConvert.h:
        (WebCore::Converter<Vector<T>>::convert): Removed a FIXME comment.

2016-08-16  Anders Carlsson  <andersca@apple.com>

        Fix build.

        * Configurations/WebCore.xcconfig:

2016-08-16  Chris Dumez  <cdumez@apple.com>

        Align isDefaultNamespace() / lookupPrefix() / lookupNamespaceURI() with the specification
        https://bugs.webkit.org/show_bug.cgi?id=160911

        Reviewed by Ryosuke Niwa.

        Align isDefaultNamespace() / lookupPrefix() / lookupNamespaceURI() with the specification:
        - https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace
        - https://dom.spec.whatwg.org/#dom-node-lookupprefix
        - https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri

        Our implementation now matches closely the text of the DOM specification
        and we pass more W3C tests as it fixes the following bug:
        - i