ChangeLog-2018-01-01   [plain text]


2017-12-22  Jeff Miller  <jeffm@apple.com>

        Update user-visible copyright strings to include 2018
        https://bugs.webkit.org/show_bug.cgi?id=181141

        Reviewed by Dan Bernstein.

        * Info.plist:

2017-12-30  Simon Fraser  <simon.fraser@apple.com>

        REGRESSION (r225122): fePointLights don't work
        https://bugs.webkit.org/show_bug.cgi?id=181142

        Reviewed by Dan Bates.

        r225122 refactored the initialLightingData code, but failed to set the lighting
        color in the return value of PointLightSource::computePixelLightingData, so fePointLights
        always used black.

        Also fix a spelling error in initialLightingData.

        Tests: svg/filters/fePointLight-color.svg

        * platform/graphics/filters/DistantLightSource.cpp:
        (WebCore::DistantLightSource::initPaintingData):
        (WebCore::DistantLightSource::computePixelLightingData const):
        * platform/graphics/filters/FELighting.cpp:
        (WebCore::FELighting::drawLighting):
        * platform/graphics/filters/LightSource.h:
        * platform/graphics/filters/PointLightSource.cpp:
        (WebCore::PointLightSource::computePixelLightingData const):
        * platform/graphics/filters/SpotLightSource.cpp:
        (WebCore::SpotLightSource::computePixelLightingData const):

2017-12-31  Simon Fraser  <simon.fraser@apple.com>

        Bottom right pixel of feDiffuseLighting has the wrong color
        https://bugs.webkit.org/show_bug.cgi?id=181203

        Reviewed by Antti Koivisto.

        The lower right pixel of a feDiffuseLighting was the wrong color, because the kernel
        values didn't match the spec for the bottom right Y values.

        Test: svg/filters/feDiffuseLighting-bottomRightPixel.html

        * platform/graphics/filters/FELighting.cpp:
        (WebCore::FELighting::LightingData::bottomRightNormal const):

2017-12-30  Simon Fraser  <simon.fraser@apple.com>

        SVG lighting colors need to be converted into linearSRGB
        https://bugs.webkit.org/show_bug.cgi?id=181196

        Reviewed by Dan Bates.

        SVG filters, like feLighting, that poke values directly into buffers rather than going
        through CG like feFlood, need to convert colors into the operating color space. So add
        conversion functions to go between linear and sRGB colors, and use these in feLighting,
        and in ImageBuffer (which is only used for non-CG platforms).

        Tests: svg/filters/feSpotLight-color.svg

        * platform/graphics/ColorUtilities.cpp:
        (WebCore::linearToSRGBColorComponent):
        (WebCore::sRGBToLinearColorComponent):
        (WebCore::linearToSRGBColor):
        (WebCore::sRGBToLinearColor):
        * platform/graphics/ColorUtilities.h:
        * platform/graphics/ImageBuffer.cpp:
        (WebCore::ImageBuffer::transformColorSpace):
        * platform/graphics/filters/FELighting.cpp:
        (WebCore::FELighting::drawLighting):

2017-12-31  Jiewen Tan  <jiewen_tan@apple.com>

        [WebCrypto] Avoid promises being destroyed in secondary threads
        https://bugs.webkit.org/show_bug.cgi?id=180499
        <rdar://problem/35890680>

        Reviewed by Youenn Fablet.

        This patch adds pending promise queue to SubtleCrypto such that it no longer
        passes promises around different threads, which could cause crashes when
        promises are destroyed in secondary threads.

        Covered by existing tests.

        * crypto/SubtleCrypto.cpp:
        (WebCore::getPromise):
        (WebCore::SubtleCrypto::encrypt):
        (WebCore::SubtleCrypto::decrypt):
        (WebCore::SubtleCrypto::sign):
        (WebCore::SubtleCrypto::verify):
        (WebCore::SubtleCrypto::digest):
        (WebCore::SubtleCrypto::generateKey):
        (WebCore::SubtleCrypto::deriveKey):
        (WebCore::SubtleCrypto::deriveBits):
        (WebCore::SubtleCrypto::importKey):
        (WebCore::SubtleCrypto::exportKey):
        (WebCore::SubtleCrypto::wrapKey):
        (WebCore::SubtleCrypto::unwrapKey):
        * crypto/SubtleCrypto.h:

2017-12-30  Dan Bernstein  <mitz@apple.com>

        REGRESSION (r225494): Mouse pointer reappears shortly after hiding when scrolling using arrow keys
        https://bugs.webkit.org/show_bug.cgi?id=181193

        Reviewed by Alexey Proskuryakov.

        * page/EventHandler.cpp:
        (WebCore::EventHandler::cancelAutoHideCursorTimer): Removed a call to unhide the cursor
          here.

2017-12-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Remove current macOS support for dragging file-backed attachments
        https://bugs.webkit.org/show_bug.cgi?id=181188

        Reviewed by Dan Bernstein.

        Support for dragging attachments out as files on the NSPasteboard was introduced in r181760. However, this is
        (1) a macOS-specific implementation, and (2) does not support attachments whose files are backed by inline data
        rather than a filepath. As part of adding further WebKit attachment element support, subsequent patches will
        reimplement support for dragging attachment elements in a cross-Cocoa-platform way that also allows for either
        data- or file-backed blobs to be written to the pasteboard.

        No new functionality; no new tests. All existing layout and API tests still pass.

        * page/DragClient.h:
        (WebCore::DragClient::declareAndWriteDragImage):
        (WebCore::DragClient::declareAndWriteAttachment): Deleted.
        * page/DragController.cpp:
        (WebCore::DragController::startDrag):
        * page/DragController.h:
        (WebCore::DragController::draggingImageURL const):
        (WebCore::DragController::draggingAttachmentURL const): Deleted.
        * page/gtk/DragControllerGtk.cpp:
        (WebCore::DragController::declareAndWriteAttachment): Deleted.
        * page/mac/DragControllerMac.mm:
        (WebCore::DragController::declareAndWriteAttachment): Deleted.
        * page/win/DragControllerWin.cpp:
        (WebCore::DragController::declareAndWriteAttachment): Deleted.
        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::absoluteAttachmentURL const): Deleted.
        * rendering/HitTestResult.h:

2017-12-28  Zalan Bujtas  <zalan@apple.com>

        RenderTreeUpdater::GeneratedContent should hold a weak reference to RenderQuote.
        https://bugs.webkit.org/show_bug.cgi?id=181185
        <rdar://problem/36235307>

        Reviewed by David Kilzer.

        Test: fast/css/content/content-quotes-crash-with-details.html

        * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
        (WebCore::RenderTreeUpdater::GeneratedContent::updateQuotesUpTo):
        * rendering/updating/RenderTreeUpdaterGeneratedContent.h:
        (): Deleted.

2017-12-28  Brady Eidson  <beidson@apple.com>

        Add a ProcessIdentifier, vended from the UI process, to each child process
        https://bugs.webkit.org/show_bug.cgi?id=181155

        Reviewed by Brent Fulgham.

        No new tests (Not yet testable)

        More than once we've needed to create an identifier for an object that is unique across
        all processes no matter which process it came from.
        
        Sometimes we have an object or proxy object to the UI, Storage, or Network process
        that allows us to augment a process-unique identifier to be globally unique. Due to multiple
        sessions even this isn't good enough. Other times we have to create more hair-brained solutions.
        
        In upcoming MessagePort work (Next step is https://bugs.webkit.org/show_bug.cgi?id=181172)
        there was no truly workable solution for this.
        
        By introducing a new ProcessIdentifier to each WK2 child processes that is guaranteed to be 
        unique over the run of a given UI process, we can easily create an object in any process and
        identify it uniquely across all processes.
        
        Obviously "process identifier" brings to mind a processes PID but that isn't good enough.
        The number of PIDs on the system is fairly low and they are global across all
        processes on the system. It is easy to see how a given UI process that runs for long enough
        (such as a web browser that the user rarely quits) will start to run in to recycled PIDs, 
        therefore breaking the uniqueness guarantee that is required.
        
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/Process.cpp: Added.
        (WebCore::Process::setIdentifier): Sets the process-wise identifier (to be used during WK2
          child process initialization)
        (WebCore::Process::identifier): Get the process-wide identifier.
        * platform/Process.h: Added.

2017-12-28  Yusuke Suzuki  <utatane.tea@gmail.com>

        Remove std::chrono if it is not used for ArgumentCoder or PersistentCoder
        https://bugs.webkit.org/show_bug.cgi?id=181174

        Reviewed by Konstantin Tokarev.

        We would like to remove std::chrono as much as possible due to the danger of
        its overflow unawareness. This patch removes std::chrono if it is not used
        for ArgumentCoder or PersistentCoder.

        No behavior change.

        * fileapi/FileReader.cpp:
        (WebCore::FileReader::didReceiveData):
        * fileapi/FileReader.h:
        * inspector/InspectorOverlay.cpp:
        (WebCore::InspectorOverlay::showPaintRect):
        (WebCore::InspectorOverlay::updatePaintRectsTimerFired):
        * inspector/InspectorOverlay.h:
        * page/ResourceUsageThread.cpp:
        (WebCore::ResourceUsageThread::threadBody):
        * page/cocoa/MemoryReleaseCocoa.mm:
        (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
        * platform/network/curl/SocketStreamHandleImpl.h:
        * platform/network/curl/SocketStreamHandleImplCurl.cpp:
        (WebCore::SocketStreamHandleImpl::waitForAvailableData):
        (WebCore::SocketStreamHandleImpl::startThread):

2017-12-28  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win][CMake] Use add_custom_command to copy each forwarding header files
        https://bugs.webkit.org/show_bug.cgi?id=180921

        Reviewed by Brent Fulgham.

        No new tests because there is no behavior change.

        * PlatformWin.cmake: Use WEBKIT_MAKE_FORWARDING_HEADERS.

2017-12-27  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        Build fix after r226299
        https://bugs.webkit.org/show_bug.cgi?id=181160

        Unreviewed build fix.

        No new tests, its a build fix.

        * platform/graphics/FontSelectionAlgorithm.h: Add missing include.

2017-12-26  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        REGRESSION(r225769): Build error with constexpr std::max // std::min in libdstdc++4
        https://bugs.webkit.org/show_bug.cgi?id=181160

        Reviewed by Myles C. Maxfield.

        No new tests, its a build fix.

        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
        (WebCore::MediaPlayerPrivateAVFoundationCF::currentMediaTime const): Disambiguate usage of max (Use the version from stdlib).
        * platform/graphics/FontSelectionAlgorithm.h:
        (WebCore::FontSelectionValue::clampFloat): Use WTF::min and WTF::max for constexpr result.
        * platform/graphics/win/UniscribeController.cpp:
        (WebCore::UniscribeController::shapeAndPlaceItem): Disambiguate usage of min and max (Use the version from stdlib).

2017-12-25  Dan Bernstein  <mitz@apple.com>

        [macOS] On Retina displays, icon used as drag image for large image is scaled down
        https://bugs.webkit.org/show_bug.cgi?id=181154

        Reviewed by Wenson Hsieh.

        * page/DragController.cpp:
        (WebCore::DragController::doImageDrag): When using an icon for the drag image, also adjust
          its size for the device scale factor, like we do in the not-icon case.

2017-12-24  David Kilzer  <ddkilzer@apple.com>

        WebKit fixes to enable -Wstrict-prototypes for Safari
        <https://webkit.org/b/181146>

        Reviewed by Dan Bernstein.

        * platform/ios/wak/WebCoreThread.h:
        (WebThreadLockFromAnyThread):
        (WebThreadLockFromAnyThreadNoLog):
        (WebThreadUnlockFromAnyThread):
        (WebThreadUnlockGuardForMail):
        (WebThreadSetShouldYield):
        - Add 'void' to C function declarations.
        * platform/ios/wak/WebCoreThread.mm:
        (WebThreadLockFromAnyThread):
        (WebThreadLockFromAnyThreadNoLog):
        (WebThreadUnlockFromAnyThread):
        (WebThreadUnlockGuardForMail):
        - Add 'void' to C function implementations.
        * platform/ios/wak/WebCoreThreadRun.cpp:
        (class WebThreadBlock): Add 'void' to block declarations.
        Rename 'task' to 'block' for consistency.
        (_WebThreadRun): Add 'void' to block declaration.  Make
        argument name match declaration by changing 'task' to 'block'.
        (WebThreadRun): Ditto.
        * platform/ios/wak/WebCoreThreadRun.h:
        (WebThreadRun): Add 'void' to block declaration.

2017-12-22  Antoine Quint  <graouts@apple.com>

        [Web Animations] Implement Element.animate()
        https://bugs.webkit.org/show_bug.cgi?id=180402
        <rdar://problem/35851353>

        Reviewed by Dean Jackson.

        Now that we have added support for play() (webkit.org/b/178932) on Animation and parsing of multiple keyframes
        (webkit.org/b/179708), we can add support Element.animate(). To support this simple task, we must add a series
        of new IDL interfaces to support option parameters for Element.animate() (KeyframeAnimationOptions),
        AnimationEffect (AnimationEffectTimingProperties), KeyframeEffect (KeyframeEffectOptions) and supporting
        types CompositeOperation, FillMode, IterationCompositeOperation and PlaybackDirection. While we do not support
        most parameters of those types, we at least define them for future support.

        To support the most used form of the Element.animate() constructor across the WPT tests, we add support for
        specifying the duration of an animation when constructing both a KeyframeEffect and calling Element.animate(),
        either via a property on an options dictionary or as a double value.

        The implementation of Element.animate() itself is relatively straightforward, we just need to create a supporting
        KeyframeEffect based on the options provided, then an Animation with that effect set on it, and finally call play().

        We also fix one crash that came up in WPT tests where we would try to access the DOMWindow when none was available
        in http/wpt/web-animations/interfaces/Animatable/animate-no-browsing-context.html.

        * CMakeLists.txt: Add new IDL files.
        * DerivedSources.make: Add new IDL files.
        * Sources.txt: Add new generated JS bindings.
        * WebCore.xcodeproj/project.pbxproj: Add new IDL, header and C++ files.
        * animation/Animatable.idl: Expose the animate() method.
        * animation/AnimationEffectTiming.cpp:
        (WebCore::AnimationEffectTiming::setBindingsDuration): Make the duration property spec-compliant and expect the right
        kind of type (unrestricted double or DOMString).
        * animation/AnimationEffectTiming.h:
        * animation/AnimationEffectTiming.idl:
        * animation/AnimationEffectTimingProperties.h: Added.
        * animation/AnimationEffectTimingProperties.idl: Added.
        * animation/CompositeOperation.h: Added.
        * animation/CompositeOperation.idl: Added.
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::currentTime): Check that there is DOMWindow before proceeding to querying the current time
        through it, fixes a newly-apparent crash.
        * animation/FillMode.h: Added.
        * animation/FillMode.idl: Added.
        * animation/IterationCompositeOperation.h: Added.
        * animation/IterationCompositeOperation.idl: Added.
        * animation/KeyframeAnimationOptions.h: Added.
        * animation/KeyframeAnimationOptions.idl: Added.
        * animation/KeyframeEffect.cpp: Update types that are no longer defined under KeyframeEffect.
        (WebCore::processIterableKeyframes):
        (WebCore::processPropertyIndexedKeyframes):
        (WebCore::KeyframeEffect::create): Add support for duration provided either directly as a double or through KeyframeEffectOptions.
        * animation/KeyframeEffect.h:
        * animation/KeyframeEffect.idl:
        * animation/KeyframeEffectOptions.h: Added.
        * animation/KeyframeEffectOptions.idl: Added.
        * animation/PlaybackDirection.h: Added.
        * animation/PlaybackDirection.idl: Added.
        * dom/Element.cpp:
        (WebCore::Element::animate): Implement Element.animate().
        * dom/Element.h:

2017-12-23  Minsheng Liu  <lambda@liu.ms>

        Add comments and improve code styles for RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren() and related functions
        https://bugs.webkit.org/show_bug.cgi?id=180923

        Reviewed by Frédéric Wang.

        The patch improves the code for RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren()
        and related function, incorporating the following suggestions from bug 179682:

        - Remove several lines of trailing spaces.
        - Change several pointers to references.
        - Rewrite horizontalStretchyOperator() (formerly toHorizontalStretchyOperator()) 
          to make it more conforming to WebKit's coding style.
        - Make unembellishedOperator() a const method.
        - Add comments for stretchHorizontalOperatorsAndLayoutChildren().
        - Eliminate an unnecessary call to fixLayoutAfterStretch() in stretchHorizontalOperatorsAndLayoutChildren().

        Add one more case for the test "mathml/opentype/munderover-stretch-width.html" 
        to handle the corner case where all components of <munderover>/<munder>/<mover> are stretchy.

        Since there is no behavior change, no new test is required.

        * rendering/mathml/RenderMathMLBlock.h:
        (WebCore::RenderMathMLBlock::unembellishedOperator const):
        (WebCore::RenderMathMLBlock::unembellishedOperator): Deleted.
        * rendering/mathml/RenderMathMLFraction.cpp:
        (WebCore::RenderMathMLFraction::unembellishedOperator const):
        (WebCore::RenderMathMLFraction::unembellishedOperator): Deleted.
        * rendering/mathml/RenderMathMLFraction.h:
        * rendering/mathml/RenderMathMLOperator.cpp:
        (WebCore::RenderMathMLOperator::resetStretchSize):
        * rendering/mathml/RenderMathMLOperator.h:
        * rendering/mathml/RenderMathMLScripts.cpp:
        (WebCore::RenderMathMLScripts::unembellishedOperator const):
        (WebCore::RenderMathMLScripts::unembellishedOperator): Deleted.
        * rendering/mathml/RenderMathMLScripts.h:
        * rendering/mathml/RenderMathMLUnderOver.cpp:
        (WebCore::horizontalStretchyOperator):
        (WebCore::fixLayoutAfterStretch):
        (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
        (WebCore::RenderMathMLUnderOver::layoutBlock):
        (WebCore::toHorizontalStretchyOperator): Deleted.

2017-12-22  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, try to fix the build on recent SDKs after r226274.

        Unused variables captured in a lambda now cause warnings the latest SDKs. It seems that after r226274, the block
        in `SWContextManager::terminateWorker` no longer accesses `this->m_workerMap`, so `this` is now unused.

        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::terminateWorker):

2017-12-22  Wenson Hsieh  <wenson_hsieh@apple.com>

        Fix build failures due to using deprecated AppKit symbols
        https://bugs.webkit.org/show_bug.cgi?id=181110
        <rdar://problem/36162865>

        Reviewed by Dan Bernstein and Tim Horton.

        Fixes the build for recent SDKs (post-AppKit-deprecation) via a combination of adopting modern AppKit versions
        of deprecated interfaces, or folding deprecated symbols behind helper functions (for deprecated pasteboard
        types). Introduces LegacyNSPasteboardTypes.h, which contains functions to wrap around deprecated NSPasteboard
        types. This allows us to replace all deprecated NS*PboardTypes with calls to the helper functions, and limit
        -Wdeprecated-declarations of legacy pasteboard types to this new header.

        * WebCore.xcodeproj/project.pbxproj:
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (CreateCGColorIfDifferent):
        * editing/mac/EditorMac.mm:
        (WebCore::Editor::takeFindStringFromSelection):
        (WebCore::Editor::dataSelectionForPasteboard):
        * platform/cocoa/PasteboardCocoa.mm:
        (WebCore::bitmapPNGFileType):
        (WebCore::cocoaTypeToImageType):
        (WebCore::convertTIFFToPNG):
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        (PlatformCALayer::drawLayerContents):
        * platform/graphics/cocoa/GraphicsContextCocoa.mm:
        (WebCore::GraphicsContext::drawLineForDocumentMarker):
        * platform/ios/wak/WAKAppKitStubs.h:
        * platform/mac/DragDataMac.mm:
        (WebCore::rtfPasteboardType):
        (WebCore::rtfdPasteboardType):
        (WebCore::stringPasteboardType):
        (WebCore::urlPasteboardType):
        (WebCore::htmlPasteboardType):
        (WebCore::colorPasteboardType):
        (WebCore::pdfPasteboardType):
        (WebCore::tiffPasteboardType):
        (WebCore::DragData::asFilenames const):
        (WebCore::DragData::containsPlainText const):
        (WebCore::DragData::containsCompatibleContent const):
        (WebCore::DragData::containsPromise const):
        (WebCore::DragData::asURL const):
        * platform/mac/DragImageMac.mm:
        (WebCore::createDragImageForLink):
        * platform/mac/LegacyNSPasteboardTypes.h: Added.
        (WebCore::legacyStringPasteboardType):
        (WebCore::legacyFilenamesPasteboardType):
        (WebCore::legacyTIFFPasteboardType):
        (WebCore::legacyRTFPasteboardType):
        (WebCore::legacyFontPasteboardType):
        (WebCore::legacyColorPasteboardType):
        (WebCore::legacyRTFDPasteboardType):
        (WebCore::legacyHTMLPasteboardType):
        (WebCore::legacyURLPasteboardType):
        (WebCore::legacyPDFPasteboardType):
        (WebCore::legacyFilesPromisePasteboardType):
        * platform/mac/LocalCurrentGraphicsContext.mm:
        (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
        * platform/mac/PasteboardMac.mm:
        (WebCore::writableTypesForURL):
        (WebCore::writableTypesForImage):
        (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
        (WebCore::Pasteboard::write):
        (WebCore::Pasteboard::writePlainText):
        (WebCore::writeURLForTypes):
        (WebCore::writeFileWrapperAsRTFDAttachment):
        (WebCore::Pasteboard::read):
        (WebCore::absoluteURLsFromPasteboardFilenames):
        (WebCore::Pasteboard::readPlatformValueAsString):
        (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
        (WebCore::Pasteboard::writeString):
        * platform/mac/PasteboardWriter.mm:
        (WebCore::createPasteboardWriter):
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::PlatformPasteboard::numberOfFiles const):
        (WebCore::pasteboardMayContainFilePaths):
        (WebCore::PlatformPasteboard::stringForType const):
        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
        (WebCore::PlatformPasteboard::platformPasteboardTypeForSafeTypeForDOMToReadAndWrite):
        (WebCore::PlatformPasteboard::color):
        (WebCore::PlatformPasteboard::setStringForType):
        * platform/mac/ThemeMac.mm:
        (WebCore::updateStates):
        (WebCore::createToggleButtonCell):
        (WebCore::drawCellFocusRingWithFrameAtTime):
        (WebCore::leakButtonCell):
        (WebCore::setUpButtonCell):
        (WebCore::paintButton):
        (WebCore::ThemeMac::inflateControlPaintRect const):
        * platform/mac/WebWindowAnimation.mm:
        (setScaledFrameForWindow):
        * platform/mac/WidgetMac.mm:
        (WebCore::Widget::paint):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const):
        (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
        (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
        (WebCore::convertNSColorToColor):
        (WebCore::menuBackgroundColor):
        (WebCore::RenderThemeMac::updateCheckedState):
        (WebCore::RenderThemeMac::levelIndicatorStyleFor const):
        (WebCore::RenderThemeMac::levelIndicatorFor const):
        (WebCore::RenderThemeMac::servicesRolloverButtonCell const):

2017-12-22  Dan Bernstein  <mitz@apple.com>

        Crash beneath ScriptedAnimationController::serviceScriptedAnimations after a requestAnimationFrame callback removes the requesting iframe
        https://bugs.webkit.org/show_bug.cgi?id=181132
        <rdar://problem/35143540>

        Reviewed by Simon Fraser.

        Test: fast/animation/request-animation-frame-remove-iframe-in-callback.html

        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::serviceScriptedAnimations): Hold a reference to the
          document and pass that along to InspectorInstrumentation::willFireAnimationFrame rather
          than dereferencing the m_document member, which may have gotten cleared by an earlier
          callback.

2017-12-22  Chris Dumez  <cdumez@apple.com>

        importScripts() inside a service worker should ensure that the response has a JavaScript MIME type
        https://bugs.webkit.org/show_bug.cgi?id=181103

        Reviewed by Youenn Fablet.

        importScripts() inside a service worker should ensure that the response has a JavaScript
        MIME type, as per:
        - https://w3c.github.io/ServiceWorker/#importscripts (step 6)

        No new tests, rebaselined existing test.

        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::importScripts):
        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::didReceiveResponse):
        * workers/WorkerScriptLoader.h:
        (WebCore::WorkerScriptLoader::responseMIMEType const):

2017-12-22  Chris Dumez  <cdumez@apple.com>

        [Service Workers] Implement "Soft Update" algorithm
        https://bugs.webkit.org/show_bug.cgi?id=180702
        <rdar://problem/36163461>

        Reviewed by Youenn Fablet.

        Implement "Soft Update" algorithm:
        - https://w3c.github.io/ServiceWorker/#soft-update-algorithm

        Call softUpdate at the end of "Handle Fetch", as per:
        - https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm

        No new tests, rebaselined existing test.

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::postTaskTo):
        * dom/ScriptExecutionContext.h:
        * workers/service/SWClientConnection.cpp:
        (WebCore::SWClientConnection::failedFetchingScript):
        (WebCore::SWClientConnection::registrationJobResolvedInServer):
        (WebCore::SWClientConnection::startScriptFetchForServer):
        * workers/service/SWClientConnection.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::updateRegistration):
        (WebCore::ServiceWorkerContainer::jobFailedWithException):
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
        (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
        (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::ServiceWorkerJob):
        * workers/service/ServiceWorkerJob.h:
        (WebCore::ServiceWorkerJob::create):
        (WebCore::ServiceWorkerJob::data const):
        (WebCore::ServiceWorkerJob::promise):
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::softUpdate):
        * workers/service/ServiceWorkerRegistration.h:
        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::terminateWorker):
        (WebCore::SWContextManager::postTaskToServiceWorker):
        * workers/service/context/SWContextManager.h:
        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
        * workers/service/context/ServiceWorkerFetch.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::startScriptFetch):
        * workers/service/server/SWServer.h:

2017-12-22  Zalan Bujtas  <zalan@apple.com>

        [RenderTreeBuilder] Move RenderMenuList::addChild() tree mutation to RenderTreeBuilder
        https://bugs.webkit.org/show_bug.cgi?id=181130
        <rdar://problem/36196266>

        Reviewed by Antti Koivisto.

        This patch also creates a dedicated class for form control related tree mutations.

        Covered by existing tests.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * rendering/RenderButton.cpp:
        (WebCore::RenderButton::setInnerRenderer): Update the style here instead.
        * rendering/RenderMenuList.cpp:
        (WebCore::RenderMenuList::setInnerRenderer):
        (RenderMenuList::addChild):
        (RenderMenuList::showPopup): We should't really call showPopup on a detached renderer.
        (WebCore::RenderMenuList::createInnerBlock): Deleted.
        * rendering/RenderMenuList.h:
        * rendering/updating/RenderTreeBuilder.cpp:
        (WebCore::RenderTreeBuilder::RenderTreeBuilder):
        (WebCore::RenderTreeBuilder::insertChild):
        (WebCore::createInnerRendererForButtonIfNeeded): Deleted.
        * rendering/updating/RenderTreeBuilder.h:
        (WebCore::RenderTreeBuilder::formControlsBuilder):
        * rendering/updating/RenderTreeBuilderFormControls.cpp: Copied from Source/WebCore/rendering/updating/RenderTreeBuilder.h.
        (WebCore::RenderTreeBuilder::FormControls::FormControls):
        (WebCore::RenderTreeBuilder::FormControls::createInnerRendererIfNeeded):
        * rendering/updating/RenderTreeBuilderFormControls.h: Copied from Source/WebCore/rendering/updating/RenderTreeBuilder.h.

2017-12-21  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r223678): Cannot copy & paste a web page content into Yahoo! Mail
        https://bugs.webkit.org/show_bug.cgi?id=181114

        Reviewed by Geoffrey Garen.

        Turns out converting all URLs to blob isn't Web compatible. Don't do this conversion on HTTP, HTTP, and data URLs
        since websites tend to have access to contents accessible via those protocols, and blob URL conversion would break
        Yahoo! Mail, Gmail, and other major online email services.

        We've also considered using data URLs instead of blob URLs for conversion but pasting a large image converted into
        a data URL seems to break WordPress (it stores an empty post instead of the one with the image) so it's not likely
        to be Web compatible either.

        This patch therefore disables the blob conversion in sanitizeMarkupWithArchive for HTTP, HTTPS, data URLs for
        cross-origin content, restoring the behavior prior to r223678. For contents converted from attributed strings,
        we continue to convert to blob URL since there is no other way for websites to read local files or images references
        by an in-memory web archive.

        Tests: http/tests/security/clipboard/copy-paste-html-cross-in-origin-iframe-across-origin.html

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::shouldConvertToBlob): Added.
        (WebCore::sanitizeMarkupWithArchive):

2017-12-22  Michael Catanzaro  <mcatanzaro@igalia.com>

        Credentials warning spam when running CodeGenerator.pm
        https://bugs.webkit.org/show_bug.cgi?id=181127

        Unreviewed, update WebCore_IDL_INCLUDES.

        * CMakeLists.txt:

2017-12-22  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds
        https://bugs.webkit.org/show_bug.cgi?id=179914

        Reviewed by Carlos Garcia Campos.

        * CMakeLists.txt: Test for WebCore_LIBRARY_TYPE rather than SHARED_CORE.

2017-12-22  Zalan Bujtas  <zalan@apple.com>

        [RenderTreeBuilder] Move RenderButton::addChild() tree mutation to RenderTreeBuilder
        https://bugs.webkit.org/show_bug.cgi?id=181109
        <rdar://problem/36188262>

        Reviewed by Antti Koivisto.

        Covered by existing tests.

        * rendering/RenderButton.cpp:
        (WebCore::RenderButton::setInnerRenderer):
        (WebCore::RenderButton::updateAnonymousChildStyle const):
        (WebCore::RenderButton::addChild): Deleted.
        * rendering/RenderButton.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::propagateStyleToAnonymousChildren):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::updateAnonymousChildStyle const):
        * rendering/updating/RenderTreeBuilder.cpp:
        (WebCore::RenderTreeBuilder::insertChild):

2017-12-22  Ms2ger  <Ms2ger@igalia.com>

        REGRESSION(r226228) Build error with unqualified isfinite() in MediaCapabilities.cpp
        https://bugs.webkit.org/show_bug.cgi?id=181118

        Unreviewed build fix.

        * Modules/mediacapabilities/MediaCapabilities.cpp:
        (WebCore::isValidVideoConfiguration): qualify the one unqualified isfinite() call.

2017-12-21  Youenn Fablet  <youenn@apple.com>

        com.apple.WebKit.WebContent.Development crashed in com.apple.WebCore: WebCore::UserMediaRequest::stop + 126
        https://bugs.webkit.org/show_bug.cgi?id=181057
        <rdar://problem/36167175>

        Unreviewed.

        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::stop): Fixed comment typo.

2017-12-21  Youenn Fablet  <youenn@apple.com>

        ServiceWorkerThreadProxy should set the correct cookie and cache partitioning options
        https://bugs.webkit.org/show_bug.cgi?id=181000

        Reviewed by Chris Dumez.

        Covered by rebased test.

        Add a way to set the domain for cache partition explicitly on a ScriptExecutionContext.
        This is used by ServiceWorkerThreadProxy document to mimick the fact that it may be
        a service worker used by iframes that have a cross origin top document.
        Updated code to use that new utility routine.

        * Modules/websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::connect):
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::domainForCachePartition const):
        * dom/ScriptExecutionContext.h:
        (WebCore::ScriptExecutionContext::setDomainForCachePartition):
        * html/DOMURL.cpp:
        (WebCore::DOMURL::revokeObjectURL):
        * inspector/agents/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::cachedResource):
        * loader/EmptyFrameLoaderClient.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadURL):
        * loader/archive/cf/LegacyWebArchive.cpp:
        (WebCore::LegacyWebArchive::create):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::setDomainForCachePartition):
        * testing/Internals.cpp:
        (WebCore::Internals::isLoadingFromMemoryCache):
        * workers/service/context/ServiceWorkerThreadProxy.cpp:
        (WebCore::topOriginURL):
        (WebCore::createPageForServiceWorker):
        (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
        * workers/service/context/ServiceWorkerThreadProxy.h:
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::createRequest):

2017-12-21  Christopher Reid  <chris.reid@sony.com>

        [WinCairo] fix build after r226245
        https://bugs.webkit.org/show_bug.cgi?id=181113

        Unreviewed build fix.

        No new tests, no change in behavior.

        * html/AttachmentTypes.h: Added an include for std::optional

2017-12-21  Brady Eidson  <beidson@apple.com>

        Refactor MessagePortChannel family classes for an easier multi-process split.
        https://bugs.webkit.org/show_bug.cgi?id=180981

        Reviewed by Andy Estes.

        No new tests (Refactor, no behavior change)

        - Make MessagePortChannel an abstract class instead of a wrapper around a mysterious "platform" class.
        - Implement the "in-process" channel for WK1 and WK2-for-now.
        - Other random cleanup and modernization of this code.
        
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        
        * dom/InProcessMessagePortChannel.cpp: Added.
        (WebCore::InProcessMessagePortChannel::createChannelBetweenPorts):
        (WebCore::InProcessMessagePortChannel::create):
        (WebCore::InProcessMessagePortChannel::InProcessMessagePortChannel):
        (WebCore::InProcessMessagePortChannel::~InProcessMessagePortChannel):
        (WebCore::InProcessMessagePortChannel::postMessageToRemote):
        (WebCore::InProcessMessagePortChannel::takeAllMessagesFromRemote):
        (WebCore::InProcessMessagePortChannel::isConnectedTo):
        (WebCore::InProcessMessagePortChannel::entangleIfOpen):
        (WebCore::InProcessMessagePortChannel::disentangle):
        (WebCore::InProcessMessagePortChannel::hasPendingActivity):
        (WebCore::InProcessMessagePortChannel::locallyEntangledPort):
        (WebCore::InProcessMessagePortChannel::takeEntangledChannel):
        (WebCore::InProcessMessagePortChannel::close):
        (WebCore::InProcessMessagePortChannel::setRemotePort):
        * dom/InProcessMessagePortChannel.h: Added.
        (WebCore::InProcessMessagePortChannel::MessagePortQueue::create):
        (WebCore::InProcessMessagePortChannel::MessagePortQueue::takeAllMessages):
        (WebCore::InProcessMessagePortChannel::MessagePortQueue::appendAndCheckEmpty):
        (WebCore::InProcessMessagePortChannel::MessagePortQueue::isEmpty):
        (WebCore::InProcessMessagePortChannel::MessagePortQueue::MessagePortQueue):
        
        * dom/MessageChannel.cpp:
        (WebCore::MessageChannel::MessageChannel):
        * dom/MessageChannel.h:
        (WebCore::MessageChannel::create):
        (WebCore::MessageChannel::port1 const):
        (WebCore::MessageChannel::port2 const):
        
        * dom/MessagePort.cpp:
        (WebCore::MessagePort::postMessage):
        (WebCore::MessagePort::disentangle):
        (WebCore::MessagePort::entangle):
        (WebCore::MessagePort::hasPendingActivity const):
        * dom/MessagePort.h:
        
        * dom/MessagePortChannel.cpp: Added.
        (WebCore::MessagePortChannel::createChannelBetweenPorts):
        (WebCore::MessagePortChannel::MessagePortChannel):
        * dom/MessagePortChannel.h:
        (WebCore::MessagePortChannel::EventData::EventData):
        (WebCore::MessagePortChannel::~MessagePortChannel):
        
        * dom/default/PlatformMessagePortChannel.cpp: Removed.
        * dom/default/PlatformMessagePortChannel.h: Removed.
        * workers/service/context/ServiceWorkerThread.h:

2017-12-21  Ryosuke Niwa  <rniwa@webkit.org>

        Rename NoEventDispatchAssertion to ScriptDisallowedScope
        https://bugs.webkit.org/show_bug.cgi?id=181102

        Reviewed by Zalan Bujtas.

        Renamed the class.

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::canExecuteScripts):
        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion):
        (WebCore::ContainerNode::removeNodeWithScriptAssertion):
        (WebCore::executeNodeInsertionWithScriptAssertion):
        (WebCore::ContainerNode::removeDetachedChildren):
        (WebCore::ContainerNode::insertBeforeCommon):
        (WebCore::ContainerNode::appendChildCommon):
        (WebCore::ContainerNode::removeBetween):
        (WebCore::dispatchChildInsertionEvents):
        (WebCore::dispatchChildRemovalEvents):
        * dom/ContainerNodeAlgorithms.cpp:
        (WebCore::notifyChildNodeInserted):
        (WebCore::notifyChildNodeRemoved):
        * dom/Document.cpp:
        (WebCore::Document::resolveStyle):
        (WebCore::isSafeToUpdateStyleOrLayout):
        (WebCore::Document::updateStyleIfNeeded):
        (WebCore::Document::nodeChildrenWillBeRemoved):
        (WebCore::Document::nodeWillBeRemoved):
        (WebCore::Document::dispatchWindowEvent):
        (WebCore::Document::dispatchWindowLoadEvent):
        (WebCore::Document::applyPendingXSLTransformsTimerFired):
        * dom/Element.cpp:
        (WebCore::Element::addShadowRoot):
        (WebCore::Element::attachAttributeNodeIfNeeded):
        (WebCore::Element::setAttributeNode):
        (WebCore::Element::setAttributeNodeNS):
        (WebCore::Element::dispatchFocusInEvent):
        (WebCore::Element::dispatchFocusOutEvent):
        * dom/ElementIteratorAssertions.h:
        (WebCore::ElementIteratorAssertions::ElementIteratorAssertions):
        * dom/EventDispatcher.cpp:
        (WebCore::EventDispatcher::dispatchEvent):
        * dom/EventTarget.cpp:
        (WebCore::EventTarget::fireEventListeners):
        * dom/NoEventDispatchAssertion.h: Removed.
        * dom/Node.cpp:
        (WebCore::Node::dispatchSubtreeModifiedEvent):
        (WebCore::Node::dispatchDOMActivateEvent):
        * dom/ScriptDisallowedScope.h: Copied from Source/WebCore/dom/NoEventDispatchAssertion.h.
        (WebCore::ScriptDisallowedScope::ScriptDisallowedScope):
        (WebCore::ScriptDisallowedScope::~ScriptDisallowedScope):
        (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree):
        (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed):
        (WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion): Deleted.
        (WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion): Deleted.
        (WebCore::NoEventDispatchAssertion::isEventAllowedInMainThread): Deleted.
        (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Deleted.
        (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Deleted.
        (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Deleted.
        (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): Deleted.
        (WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Deleted.
        (WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Deleted.
        (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Deleted.
        (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Deleted.
        (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::DisableAssertionsInScope): Deleted.
        (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::~DisableAssertionsInScope): Deleted.
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::executeClassicScript):
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
        (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
        (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
        (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
        * history/CachedPage.cpp:
        (WebCore::CachedPage::restore):
        * history/PageCache.cpp:
        (WebCore::PageCache::addIfCacheable):
        * html/HTMLElement.cpp:
        (WebCore::textToFragment):
        (WebCore::HTMLElement::setInnerText):
        * html/HTMLMediaElement.cpp:
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::setInnerTextValue):
        * html/track/VTTCue.cpp:
        (WebCore::VTTCue::createCueRenderingTree):
        (WebCore::VTTCue::updateDisplayTree):
        (WebCore::VTTCue::removeDisplayTree):
        * loader/FormSubmission.cpp:
        * loader/cache/CachedSVGFont.cpp:
        (WebCore::CachedSVGFont::ensureCustomFontData):
        * page/LayoutContext.cpp:
        (WebCore::LayoutContext::layout):
        * rendering/RenderFrameBase.cpp:
        (WebCore::RenderFrameBase::performLayoutWithFlattening):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::scrollRectToVisible):
        * svg/SVGTRefElement.cpp:
        (WebCore::SVGTRefElement::updateReferencedText):
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::clearShadowTree):
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::draw):

2017-12-21  Maciej Stachowiak  <mjs@apple.com>

        Update Service Workers status to Supported in Preview
        https://bugs.webkit.org/show_bug.cgi?id=181093

        Reviewed by Andy Estes.

        * features.json:

2017-12-21  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed test fix after r226224.
        <rdar://problem/36185975>

        Pasteboard data is more than a dictionary. We have to whitelist NSString
        and NSArray as well. Change method name to reflect that we take a whitelist
        of classes that are allowed to be unarchived in the call.

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::write): Use revised method.
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.

2017-12-21  Zalan Bujtas  <zalan@apple.com>

        [RenderTreeBuilder] Move RenderRubyAsInline::addChild mutation to a RenderTreeBuilder
        https://bugs.webkit.org/show_bug.cgi?id=181101
        <rdar://problem/36184788>

        Reviewed by Antti Koivisto.

        * rendering/RenderRuby.cpp:
        (WebCore::isRubyBeforeBlock): Deleted.
        (WebCore::isRubyAfterBlock): Deleted.
        (WebCore::rubyBeforeBlock): Deleted.
        (WebCore::rubyAfterBlock): Deleted.
        (WebCore::createAnonymousRubyInlineBlock): Deleted.
        (WebCore::lastRubyRun): Deleted.
        (WebCore::RenderRubyAsInline::addChild): Deleted.
        * rendering/RenderRuby.h:
        * rendering/updating/RenderTreeBuilder.cpp:
        (WebCore::RenderTreeBuilder::insertChild):
        * rendering/updating/RenderTreeBuilderRuby.cpp:
        (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
        * rendering/updating/RenderTreeBuilderRuby.h:

2017-12-21  Jiewen Tan  <jiewen_tan@apple.com>

        Update Credential Management API for WebAuthentication
        https://bugs.webkit.org/show_bug.cgi?id=181082
        <rdar://problem/36055239>

        Reviewed by Daniel Bates.

        Part 1/2

        In this patch, it restructure a bit for existing Credential Management API codebase:
        1. Rename the folder from credentials to credentialmanagement for better understanding.
        2. Remove unneeded dummy codes, i.e. PasswordCredential and FederatedCredential.
        3. Core API and layout tests are updated correspondingly as well.

        Rebaseline test results.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/credentialmanagement/BasicCredential.cpp: Renamed from Source/WebCore/Modules/credentials/BasicCredential.cpp.
        (WebCore::BasicCredential::BasicCredential):
        (WebCore::BasicCredential::type const):
        * Modules/credentialmanagement/BasicCredential.h: Renamed from Source/WebCore/Modules/credentials/BasicCredential.h.
        (WebCore::BasicCredential::id const):
        * Modules/credentialmanagement/BasicCredential.idl: Renamed from Source/WebCore/Modules/credentials/BasicCredential.idl.
        * Modules/credentialmanagement/CredentialCreationOptions.h: Renamed from Source/WebCore/Modules/credentials/CredentialData.h.
        * Modules/credentialmanagement/CredentialCreationOptions.idl: Renamed from Source/WebCore/Modules/credentials/CredentialData.idl.
        * Modules/credentialmanagement/CredentialRequestOptions.h: Renamed from Source/WebCore/Modules/credentials/CredentialRequestOptions.h.
        * Modules/credentialmanagement/CredentialRequestOptions.idl: Renamed from Source/WebCore/Modules/credentials/CredentialRequestOptions.idl.
        * Modules/credentialmanagement/CredentialsContainer.cpp: Renamed from Source/WebCore/Modules/credentials/CredentialsContainer.cpp.
        (WebCore::CredentialsContainer::get):
        (WebCore::CredentialsContainer::store):
        (WebCore::CredentialsContainer::isCreate):
        (WebCore::CredentialsContainer::preventSilentAccess):
        * Modules/credentialmanagement/CredentialsContainer.h: Renamed from Source/WebCore/Modules/credentials/CredentialsContainer.h.
        (WebCore::CredentialsContainer::create):
        (WebCore::CredentialsContainer::CredentialsContainer):
        * Modules/credentialmanagement/CredentialsContainer.idl: Renamed from Source/WebCore/Modules/credentials/CredentialsContainer.idl.
        * Modules/credentialmanagement/NavigatorCredentials.cpp: Renamed from Source/WebCore/Modules/credentials/NavigatorCredentials.cpp.
        (WebCore::NavigatorCredentials::supplementName):
        (WebCore::NavigatorCredentials::credentials):
        (WebCore::NavigatorCredentials::from):
        * Modules/credentialmanagement/NavigatorCredentials.h: Renamed from Source/WebCore/Modules/credentials/NavigatorCredentials.h.
        * Modules/credentialmanagement/NavigatorCredentials.idl: Renamed from Source/WebCore/Modules/credentials/NavigatorCredentials.idl.
        * Modules/credentials/CredentialCreationOptions.h: Removed.
        * Modules/credentials/CredentialCreationOptions.idl: Removed.
        * Modules/credentials/CredentialUserData.h: Removed.
        * Modules/credentials/CredentialUserData.idl: Removed.
        * Modules/credentials/FederatedCredential.cpp: Removed.
        * Modules/credentials/FederatedCredential.h: Removed.
        * Modules/credentials/FederatedCredential.idl: Removed.
        * Modules/credentials/FederatedCredentialInit.h: Removed.
        * Modules/credentials/FederatedCredentialInit.idl: Removed.
        * Modules/credentials/FederatedCredentialRequestOptions.h: Removed.
        * Modules/credentials/FederatedCredentialRequestOptions.idl: Removed.
        * Modules/credentials/PasswordCredential.cpp: Removed.
        * Modules/credentials/PasswordCredential.h: Removed.
        * Modules/credentials/PasswordCredential.idl: Removed.
        * Modules/credentials/PasswordCredentialData.h: Removed.
        * Modules/credentials/PasswordCredentialData.idl: Removed.
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/WebCoreBuiltinNames.h:

2017-12-21  John Wilander  <wilander@apple.com>

        Storage Access API: Allow requests from non-sandboxed iframes
        https://bugs.webkit.org/show_bug.cgi?id=181099
        <rdar://problem/36184501>

        Reviewed by Brent Fulgham.

        No new tests. Changed existing tests.

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

2017-12-21  Ryosuke Niwa  <rniwa@webkit.org>

        Minor cleanup in WebContentReaderCocoa after r226213
        https://bugs.webkit.org/show_bug.cgi?id=181104

        Reviewed by Wenson Hsieh.

        Deployed early exists in the case of attachment replacements to make the code easier to read.

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::createFragmentAndAddResources):
        (WebCore::markupForFragmentInDocument): Extracted out of sanitizeMarkupWithArchive.
        (WebCore::sanitizeMarkupWithArchive):
        (WebCore::WebContentReader::readImage): Simplified the return logic.

2017-12-21  Zalan Bujtas  <zalan@apple.com>

        [RenderTreeBuilder] Move RenderRubyAsBlock::addChild mutation to a RenderTreeBuilder
        https://bugs.webkit.org/show_bug.cgi?id=181090
        <rdar://problem/36180916>

        Reviewed by Antti Koivisto.

        This is in preparation for moving all ruby mutation code here.

        Covered by existing tests.

        * rendering/RenderRuby.cpp:
        (WebCore::RenderRubyAsBlock::addChild): Deleted.
        * rendering/RenderRuby.h:
        * rendering/updating/RenderTreeBuilder.cpp:
        (WebCore::RenderTreeBuilder::insertChild):
        * rendering/updating/RenderTreeBuilderRuby.cpp:
        (WebCore::isAnonymousRubyInlineBlock):
        (WebCore::isRubyBeforeBlock):
        (WebCore::isRubyAfterBlock):
        (WebCore::isRubyChildForNormalRemoval):
        (WebCore::rubyBeforeBlock):
        (WebCore::rubyAfterBlock):
        (WebCore::createAnonymousRubyInlineBlock):
        (WebCore::lastRubyRun):
        (WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
        * rendering/updating/RenderTreeBuilderRuby.h:

2017-12-21  Jeremy Jones  <jeremyj@apple.com>

        Update FULLSCREEN_API feature defines.
        https://bugs.webkit.org/show_bug.cgi?id=181015

        Reviewed by Tim Horton.

        Change enabled iphone sdk for FULLSCREEN_API.

        * Configurations/FeatureDefines.xcconfig:

2017-12-21  Chris Dumez  <cdumez@apple.com>

        ononline, onoffline and navigator.onLine don't work if Parallels or VMWare is installed
        https://bugs.webkit.org/show_bug.cgi?id=32327

        Reviewed by Alexey Proskuryakov.

        When determining if we are online, ignore virtual interfaces added on the host machine
        by Parallels and VMWare. This is needed because those interfaces are always up, whether
        or not the virtual machine is running. This was causing navigator.onLine to always return
        true on the host machine when Parallels or VMWare was installed.

        Note that it is safe to ignore these interfaces and that it does not cause issues when
        running Safari inside the virtual machine because those virtual interfaces are only
        exposed on the host machine. Inside, the virtual machine, we see the usual en0 interface.

        * platform/network/mac/NetworkStateNotifierMac.cpp:
        (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):

2017-12-21  Zalan Bujtas  <zalan@apple.com>

        [RenderTreeBuilder] Move repeating code to RenderTreeBuilder::insertInternal
        https://bugs.webkit.org/show_bug.cgi?id=181094

        Reviewed by Antti Koivisto.

        * rendering/updating/RenderTreeBuilder.cpp:
        (WebCore::RenderTreeBuilder::insertChild):

2017-12-21  Jeremy Jones  <jeremyj@apple.com>

        Build fix after r226223
        https://bugs.webkit.org/show_bug.cgi?id=181088

        Unreviewed.

        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
        (VideoFullscreenInterfaceAVKit::exitFullscreen):

2017-12-21  John Wilander  <wilander@apple.com>

        Storage Access API: Make DocumentLoader::willSendRequest() and WebFrameLoaderClient::detachedFromParent2() tell the network process to get rid of any sub frame access entries
        https://bugs.webkit.org/show_bug.cgi?id=180728
        <rdar://problem/36009288>

        Reviewed by Youenn Fablet.

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

        This change calls the network process to clear any storage access
        entries when a subframe navigates or is detached.

        * dom/Document.cpp:
        (WebCore::Document::hasStorageAccess):
        (WebCore::Document::requestStorageAccess):
        (WebCore::Document::hasFrameSpecificStorageAccess):
        (WebCore::Document::setHasFrameSpecificStorageAccess):
        * dom/Document.h:
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::willSendRequest):
        * loader/EmptyFrameLoaderClient.h:
        * loader/FrameLoaderClient.h:
        * platform/network/NetworkStorageSession.h:
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::removeStorageAccess):

2017-12-21  Antoine Quint  <graouts@apple.com>

        [Web Animations] Complete support for keyframe animations
        https://bugs.webkit.org/show_bug.cgi?id=179708

        Reviewed by Dean Jackson.

        We implement section 5.10.3 "Processing a keyframes argument" of the Web Animations spec to handle
        multiple keyframes, rather than only two, provided either in iterable (ie. array) or property-index
        (ie. dictionary) form. Although we don't currently support timing function or composite operations,
        we parse them as well.

        While there are minimal test changes, there will be a host of changes in the next patch in which
        we turn Element.animate() on.

        * animation/KeyframeEffect.cpp:
        (WebCore::IDLAttributeNameToAnimationPropertyName): New utility to convert an IDL-parsed JS property
        into a WebCore CSSPropertyID.
        (WebCore::computeMissingKeyframeOffsets): Converts "null" offsets into computed offset values as specified
        in section 4.4.2. "Calculating computed keyframes".
        (WebCore::processIterableKeyframes): Process the iterable form of the keyframes argument.
        (WebCore::processKeyframeLikeObject): Process a keyframe-like object found in the property-indexed form.
        (WebCore::processPropertyIndexedKeyframes): Process the property-indexed form of the keyframes argument.
        (WebCore::KeyframeEffect::setKeyframes): Since this method and processKeyframes() share the same signature,
        we can just return the value from processKeyframes() directly.
        (WebCore::KeyframeEffect::processKeyframes): Process the keyframes argument as specified.
        (WebCore::KeyframeEffect::applyAtLocalTime): Delegate blending to the new setAnimatedPropertiesInStyle()
        since this task is now more complex due to handling of multiple keyframes.
        (WebCore::KeyframeEffect::getAnimatedStyle): Delegate blending to the new setAnimatedPropertiesInStyle()
        since this task is now more complex due to handling of multiple keyframes.
        (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): Handle multiple and implicit start and end keyframes.
        * animation/KeyframeEffect.h: Add some new structures used for parsing purposes.
        * animation/KeyframeEffect.idl: Expose the CompositeOperation enum and the BasePropertyIndexedKeyframe dictionary
        used in processKeyframeLikeObject().
        * css/CSSStyleDeclaration.cpp:
        (WebCore::CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName):
        * css/CSSStyleDeclaration.h:
        * page/animation/CSSPropertyAnimation.cpp:
        (WebCore::CSSPropertyAnimation::isPropertyAnimatable):
        * page/animation/CSSPropertyAnimation.h:

2017-12-21  Jer Noble  <jer.noble@apple.com>

        Add initial DOM support for Media Capabilities
        https://bugs.webkit.org/show_bug.cgi?id=181064

        Reviewed by Eric Carlson.

        Test: media/mediacapabilities/mediacapabilities-types.html

        Add basic, cross-platform, DOM facing type and API support for Media Capabilities API.

        * bindings/scripts/CodeGenerator.pm:
        (WK_ucfirst):
        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/mediacapabilities/AudioConfiguration.h: Added.
        * Modules/mediacapabilities/AudioConfiguration.idl: Added.
        * Modules/mediacapabilities/MediaCapabilities.cpp: Added.
        (WebCore::bucketMIMETypes):
        (WebCore::isValidMIMEType):
        (WebCore::isValidVideoConfiguration):
        (WebCore::isValidAudioConfiguration):
        (WebCore::isValidMediaConfiguration):
        (WebCore::MediaCapabilities::decodingInfo):
        (WebCore::MediaCapabilities::encodingInfo):
        * Modules/mediacapabilities/MediaCapabilities.h: Added.
        * Modules/mediacapabilities/MediaCapabilities.idl: Added.
        * Modules/mediacapabilities/MediaCapabilitiesInfo.h: Added.
        (WebCore::MediaCapabilitiesInfo::supported const):
        (WebCore::MediaCapabilitiesInfo::setSupported):
        (WebCore::MediaCapabilitiesInfo::smooth const):
        (WebCore::MediaCapabilitiesInfo::setSmooth):
        (WebCore::MediaCapabilitiesInfo::powerEfficient const):
        (WebCore::MediaCapabilitiesInfo::setPowerEfficient):
        * Modules/mediacapabilities/MediaCapabilitiesInfo.idl: Added.
        * Modules/mediacapabilities/MediaConfiguration.h: Added.
        * Modules/mediacapabilities/MediaConfiguration.idl: Added.
        * Modules/mediacapabilities/MediaDecodingConfiguration.h: Added.
        * Modules/mediacapabilities/MediaDecodingConfiguration.idl: Added.
        * Modules/mediacapabilities/MediaDecodingType.h: Added.
        * Modules/mediacapabilities/MediaDecodingType.idl: Added.
        * Modules/mediacapabilities/MediaEncodingConfiguration.h: Added.
        * Modules/mediacapabilities/MediaEncodingConfiguration.idl: Added.
        * Modules/mediacapabilities/MediaEncodingType.h: Added.
        * Modules/mediacapabilities/MediaEncodingType.idl: Added.
        * Modules/mediacapabilities/NavigatorMediaCapabilities.cpp: Added.
        (WebCore::NavigatorMediaCapabilities::NavigatorMediaCapabilities):
        (WebCore::NavigatorMediaCapabilities::supplementName):
        (WebCore::NavigatorMediaCapabilities::from):
        (WebCore::NavigatorMediaCapabilities::mediaCapabilities):
        (WebCore::NavigatorMediaCapabilities::mediaCapabilities const):
        * Modules/mediacapabilities/NavigatorMediaCapabilities.h: Added.
        * Modules/mediacapabilities/NavigatorMediaCapabilities.idl: Added.
        * Modules/mediacapabilities/ScreenColorGamut.h: Added.
        * Modules/mediacapabilities/ScreenColorGamut.idl: Added.
        * Modules/mediacapabilities/ScreenLuminance.h: Added.
        (WebCore::ScreenLuminance::min const):
        (WebCore::ScreenLuminance::setMin):
        (WebCore::ScreenLuminance::max const):
        (WebCore::ScreenLuminance::setMax):
        (WebCore::ScreenLuminance::maxAverage const):
        (WebCore::ScreenLuminance::setMaxAverage):
        * Modules/mediacapabilities/ScreenLuminance.idl: Added.
        * Modules/mediacapabilities/VideoConfiguration.h: Added.
        * Modules/mediacapabilities/VideoConfiguration.idl: Added.
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/WebCoreBuiltinNames.h:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setMediaCapabilitiesEnabled):
        (WebCore::RuntimeEnabledFeatures::mediaCapabilitiesEnabled const):
        * page/Settings.yaml:

2017-12-21  Keith Rollin  <krollin@apple.com>

        Add optional logging of per-resource cookie information
        https://bugs.webkit.org/show_bug.cgi?id=180883
        <rdar://problem/35802295>

        Reviewed by Brent Fulgham.

        In order to support the tracking of the efficacy of Intelligent
        Tracking Protection, add some logging of the cookie information
        associated with each loaded resource. This logging is off by default
        and is enabled with `defaults write -g WebKitLogCookieInformation
        -bool true`.

        No new tests -- no new user functionality added. Only new logging has
        been added.

        * platform/Cookie.h:
        (WebCore::Cookie::Cookie):
        (WebCore::Cookie::isNull const):
        (WebCore::Cookie::encode const):
        (WebCore::Cookie::decode):
        * platform/network/cf/CookieJarCFNet.cpp:
        (WebCore::canonicalCookieTime):
        (WebCore::cookieCreatedTime):
        (WebCore::cookieExpirationTime):
        (WebCore::getRawCookies):
        * platform/network/cocoa/CookieCocoa.mm:
        (WebCore::cookieCreated):
        (WebCore::Cookie::Cookie):
        * platform/network/soup/CookieJarSoup.cpp:
        (WebCore::getRawCookies):

2017-12-21  Brent Fulgham  <bfulgham@apple.com>

        Adopt new secure coding APIs in WebCore
        https://bugs.webkit.org/show_bug.cgi?id=178484
        <rdar://problem/34837193>

        Reviewed by Eric Carlson.

        Switch to new NSKeyed[Un]Archiver methods that use NSSecureCoding by default.

        Most of the new API is wrapped in a set of convenience methods so we can
        build without the new API on older systems.

        No change in behavior.

        * editing/cocoa/EditorCocoa.mm:
        (WebCore::archivedDataForAttributedString): Use new convenience method
        to archive the string object.
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::write): Use new secure API.
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.

2017-12-21  Zalan Bujtas  <zalan@apple.com>

        [RenderTreeBuilder] Move ruby mutation code to a dedicated class.
        https://bugs.webkit.org/show_bug.cgi?id=181066
        <rdar://problem/36167692>

        Reviewed by Antti Koivisto.

        This is in preparation for moving all ruby mutation code here.

        No change in functionality.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * rendering/updating/RenderTreeBuilder.cpp:
        (WebCore::RenderTreeBuilder::insertChild):
        (WebCore::RenderTreeBuilder::rubyRunInsertChild): Deleted.
        * rendering/updating/RenderTreeBuilder.h:
        (WebCore::RenderTreeBuilder::rubyBuilder):
        * rendering/updating/RenderTreeBuilderRuby.cpp: Added.
        (WebCore::RenderTreeBuilder::Ruby::Ruby):
        (WebCore::RenderTreeBuilder::Ruby::insertChild):
        * rendering/updating/RenderTreeBuilderRuby.h: Copied from Source/WebCore/rendering/updating/RenderTreeBuilder.h.

2017-12-21  Ms2ger  <Ms2ger@igalia.com>

        Replace a FIXME comment in CanvasGradient::addColorStop().
        https://bugs.webkit.org/show_bug.cgi?id=181034

        Reviewed by Daniel Bates.

        Tests: LayoutTests/imported/w3c/canvas/2d.gradient.object.current.html

        * html/canvas/CanvasGradient.cpp:
        (WebCore::CanvasGradient::addColorStop):

2017-12-21  Jeremy Jones  <jeremyj@apple.com>

        Enable picture-in-picture from inline element on suspend.
        https://bugs.webkit.org/show_bug.cgi?id=180942
        rdar://problem/34745234

        Reviewed by Jer Noble.

        When a element goes into element fullscreen mode, a descendant video element gains the ability to automatically enter picture-in-picture on application suspend.

        This adds support for video fullscreen standby mode, which creates a VideoFullscreenInterfaceAVKit so that it can
        trigger auto-pip on application suspend while the element is not actually presenting in video fullscreen mode.

        VideoFullscreenInterfaceAVKit has a new state transition system that will replace the existing one to enable the increased
        number and complexity of state transitions. Until we are ready to completely commit to this new code path, this implementation is
        conditionalized to keep the existing code path working.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::enterFullscreen):
        (WebCore::HTMLMediaElement::exitFullscreen):
        (WebCore::HTMLMediaElement::setVideoFullscreenStandby):
        (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
        * html/HTMLMediaElement.h:
        * page/ChromeClient.h:
        * platform/cocoa/VideoFullscreenChangeObserver.h:
        * platform/ios/VideoFullscreenInterfaceAVKit.h:
        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
        (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
        (-[WebAVPlayerLayer layoutSublayers]):
        (allocWebAVPictureInPicturePlayerLayerViewInstance):
        (allocWebAVPlayerLayerViewInstance):
        (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
        (VideoFullscreenInterfaceAVKit::setupFullscreen):
        (VideoFullscreenInterfaceAVKit::enterFullscreen):
        (VideoFullscreenInterfaceAVKit::exitFullscreen):
        (VideoFullscreenInterfaceAVKit::cleanupFullscreen):
        (VideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
        (VideoFullscreenInterfaceAVKit::preparedToReturnToInline):
        (VideoFullscreenInterfaceAVKit::mayAutomaticallyShowVideoPictureInPicture const):
        (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
        (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
        (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
        (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
        (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
        (VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
        (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
        (VideoFullscreenInterfaceAVKit::setMode):
        (VideoFullscreenInterfaceAVKit::clearMode):
        (VideoFullscreenInterfaceAVKit::setHasVideoContentLayer):
        (VideoFullscreenInterfaceAVKit::setInlineRect):
        (VideoFullscreenInterfaceAVKit::doSetup):
        (VideoFullscreenInterfaceAVKit::finalizeSetup):
        (VideoFullscreenInterfaceAVKit::doEnterFullscreen):
        (VideoFullscreenInterfaceAVKit::doExitFullscreen):
        (VideoFullscreenInterfaceAVKit::exitFullscreenHandler):
        (VideoFullscreenInterfaceAVKit::enterFullscreenHandler):
        (VideoFullscreenInterfaceAVKit::returnToStandby):
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        (VideoFullscreenControllerContext::requestUpdateInlineRect):
        (VideoFullscreenControllerContext::requestVideoContentLayer):
        (VideoFullscreenControllerContext::returnVideoContentLayer):
        (VideoFullscreenControllerContext::didSetupFullscreen):
        (VideoFullscreenControllerContext::didExitFullscreen):
        (VideoFullscreenControllerContext::setUpFullscreen):

2017-12-20  Ryosuke Niwa  <rniwa@webkit.org>

        DeferredLoadingScope incorrectly disabled images or enables deferred loading
        https://bugs.webkit.org/show_bug.cgi?id=181077

        Reviewed by Wenson Hsieh.

        Fixed the bug that DeferredLoadingScope::~DeferredLoadingScope was checking the wrong flag
        for restoring the disabledness of images and deferred loading.

        Test: editing/pasteboard/pasting-with-images-disabled-should-not-enable-deferred-loading.html

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::DeferredLoadingScope::~DeferredLoadingScope): Fixed the bug.
        * testing/Internals.cpp:
        (WebCore::Internals::pageDefersLoading): Added for testing.
        * testing/Internals.h:
        * testing/Internals.idl: Added pageDefersLoading.

2017-12-20  Ryosuke Niwa  <rniwa@webkit.org>

        isSafari check should take Safari Technology Preview into account
        https://bugs.webkit.org/show_bug.cgi?id=181076

        Reviewed by Alex Christensen.

        Fixed isSafari() so that it returns true for Safari Technology Preview. This bug resulted in the custom pasteboard
        types not being enabled in Safari Technology Preview. In long term, we should eliminate these isSafari() checks.

        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
        (WebCore::MacApplication::isSafari):

2017-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Attachment replacement logic should not depend on subresource URL attribute replacement
        https://bugs.webkit.org/show_bug.cgi?id=181068
        <rdar://problem/36168313>

        Reviewed by Ryosuke Niwa.

        Refactors attachment replacement logic, so that it doesn't require us to first replace element attributes that
        contain subresource URLs with blob URLs before performing attachment element replacement. See below comments for
        more detail.

        Covered by existing API tests in WKAttachmentTests.

        * editing/WebContentReader.h:
        (WebCore::BlobReplacementInfo::isEmpty const): Deleted.

        Remove BlobReplacementInfo. Instead, augment `replaceRichContentWithAttachments` so that it takes in the list of
        subresources directly and generates blobs for each subresource.

        * editing/cocoa/EditorCocoa.mm:
        (WebCore::Editor::replaceSelectionWithAttributedString):
        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::shouldReplaceRichContentWithAttachments):
        (WebCore::createFragmentForImageAttachment):
        (WebCore::replaceRichContentWithAttachments):
        (WebCore::createFragmentAndAddResources):
        (WebCore::sanitizeMarkupWithArchive):

        In these helper functions that currently convert subresource URLs to blob URLs, if attachment elements are not
        defined out, and the runtime feature for attachment elements is enabled, then use an alternate codepath to
        adjust the markup (via replaceRichContentWithAttachments).

        Otherwise, fall back to default subresource URL conversion logic, which (at the moment) still converts
        subresources to blobs, but will soon be changed to emit data URLs instead.

        (WebCore::WebContentReader::readWebArchive):
        (WebCore::WebContentMarkupReader::readWebArchive):
        (WebCore::WebContentReader::readRTFD):
        (WebCore::WebContentMarkupReader::readRTFD):
        (WebCore::WebContentReader::readRTF):
        (WebCore::WebContentMarkupReader::readRTF):
        (WebCore::WebContentReader::readImage):

        Remove the createFragmentFromAttributedString helper and revert to just calling createFragmentAndAddResources.

        (WebCore::createFragmentFromAttributedString): Deleted.

2017-12-20  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Add screen capture IDL and stub functions
        https://bugs.webkit.org/show_bug.cgi?id=181070
        <rdar://problem/35555184>

        Reviewed by Youenn Fablet.

        Tests: fast/mediastream/screencapture-disabled.html
               fast/mediastream/screencapture-enabled.html

        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::MediaDevices::getDisplayMedia const):
        (WebCore::MediaDevices::getSupportedConstraints):
        * Modules/mediastream/MediaDevices.h:
        * Modules/mediastream/MediaDevices.idl:
        * Modules/mediastream/MediaTrackConstraints.cpp:
        (WebCore::convertToInternalForm):
        * Modules/mediastream/MediaTrackConstraints.h:
        * Modules/mediastream/MediaTrackConstraints.idl:
        * Modules/mediastream/MediaTrackSupportedConstraints.h:
        * Modules/mediastream/MediaTrackSupportedConstraints.idl:
        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::start):
        (WebCore::UserMediaRequest::allow):
        (WebCore::UserMediaRequest::deny):
        * Modules/mediastream/UserMediaRequest.h:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::screenCaptureEnabled const):
        (WebCore::RuntimeEnabledFeatures::setScreenCaptureEnabled):
        * platform/mediastream/CaptureDevice.h:
        * platform/mediastream/MediaConstraints.cpp:
        (WebCore::MediaTrackConstraintSetMap::set):
        * platform/mediastream/MediaConstraints.h:
        (WebCore::MediaTrackConstraintSetMap::displaySurface const):
        (WebCore::MediaTrackConstraintSetMap::logicalSurface const):
        (WebCore::MediaTrackConstraintSetMap::encode const):
        (WebCore::MediaTrackConstraintSetMap::decode):
        * platform/mediastream/MediaStreamRequest.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::fitnessDistance):
        (WebCore::RealtimeMediaSource::applyConstraint):
        (WebCore::RealtimeMediaSource::supportsConstraint const):
        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
        (WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID):
        * platform/mediastream/RealtimeMediaSourceSettings.h:
        (WebCore::RealtimeMediaSourceSettings::supportsDisplaySurface const):
        (WebCore::RealtimeMediaSourceSettings::displaySurface const):
        (WebCore::RealtimeMediaSourceSettings::setDisplaySurface):
        (WebCore::RealtimeMediaSourceSettings::supportsLogicalSurface const):
        (WebCore::RealtimeMediaSourceSettings::logicalSurface const):
        (WebCore::RealtimeMediaSourceSettings::setLogicalSurface):
        * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
        (WebCore::RealtimeMediaSourceSupportedConstraints::supportsConstraint const):
        * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
        (WebCore::RealtimeMediaSourceSupportedConstraints::supportsDisplaySurface const):
        (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsDisplaySurface):
        (WebCore::RealtimeMediaSourceSupportedConstraints::supportsLogicalSurface const):
        (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsLogicalSurface):
        (WebCore::RealtimeMediaSourceSupportedConstraints::encode const):
        (WebCore::RealtimeMediaSourceSupportedConstraints::decode):
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        * platform/mock/MockRealtimeVideoSource.cpp:
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::Backup::Backup):
        (WebCore::InternalSettings::Backup::restoreTo):
        (WebCore::InternalSettings::setScreenCaptureEnabled):
        * testing/InternalSettings.h:
        * testing/InternalSettings.idl:

2017-12-20  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r225656.

        The test has been a flaky timout since being added.

        Reverted changeset:

        "WebAssembly: sending module to iframe fails"
        https://bugs.webkit.org/show_bug.cgi?id=179263
        https://trac.webkit.org/changeset/225656

2017-12-20  Don Olmstead  <don.olmstead@sony.com>

        [Win] Use WCharStringExtras functions in WebCore
        https://bugs.webkit.org/show_bug.cgi?id=180963

        Reviewed by Alex Christensen.

        No new tests. No change in behavior.

        * platform/graphics/win/FontCacheWin.cpp:
        (WebCore::appendLinkedFonts):
        (WebCore::getLinkedFonts):
        (WebCore::FontCache::systemFallbackForCharacters):
        (WebCore::FontCache::fontFromDescriptionAndLogFont):
        * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/graphics/win/IconWin.cpp:
        (WebCore::Icon::createIconForFiles):
        * platform/network/win/DownloadBundleWin.cpp:
        (WebCore::DownloadBundle::appendResumeData):
        (WebCore::DownloadBundle::extractResumeData):
        * platform/text/win/LocaleWin.cpp:
        (WebCore::LCIDFromLocaleInternal):
        (WebCore::LCIDFromLocale):
        * platform/win/ClipboardUtilitiesWin.cpp:
        (WebCore::getWebLocData):
        (WebCore::createGlobalData):
        (WebCore::getFileDescriptorData):
        (WebCore::getURL):
        (WebCore::getCFData):
        (WebCore::setCFData):
        * platform/win/DragDataWin.cpp:
        (WebCore::DragData::asFilenames const):
        * platform/win/DragImageWin.cpp:
        (WebCore::createDragImageIconForCachedImageFilename):
        (WebCore::dragLabelFont):
        * platform/win/FileSystemWin.cpp:
        (WebCore::FileSystem::getFindData):
        (WebCore::FileSystem::createSymbolicLink):
        (WebCore::FileSystem::deleteFile):
        (WebCore::FileSystem::deleteEmptyDirectory):
        (WebCore::FileSystem::moveFile):
        (WebCore::FileSystem::pathByAppendingComponent):
        (WebCore::FileSystem::makeAllDirectories):
        (WebCore::FileSystem::pathGetFileName):
        (WebCore::FileSystem::openTemporaryFile):
        (WebCore::FileSystem::openFile):
        (WebCore::FileSystem::hardLinkOrCopyFile):
        * platform/win/MIMETypeRegistryWin.cpp:
        (WebCore::mimeTypeForExtension):
        (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
        * platform/win/PasteboardWin.cpp:
        (WebCore::Pasteboard::read):
        (WebCore::createGlobalHDropContent):
        * platform/win/PathWalker.cpp:
        (WebCore::PathWalker::PathWalker):
        * platform/win/SSLKeyGeneratorWin.cpp:
        (WebCore::WebCore::signedPublicKeyAndChallengeString):
        * platform/win/SharedBufferWin.cpp:
        (WebCore::SharedBuffer::createFromReadingFile):
        * rendering/RenderThemeWin.cpp:
        (WebCore::fillFontDescription):

2017-12-20  Youenn Fablet  <youenn@apple.com>

        com.apple.WebKit.WebContent.Development crashed in com.apple.WebCore: WebCore::UserMediaRequest::stop + 126
        https://bugs.webkit.org/show_bug.cgi?id=181057

        Reviewed by Eric Carlson.

        Covered by fast/mediastream tests to not crash anymore.

        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::stop):

2017-12-20  Brady Eidson  <beidson@apple.com>

        Assertion failure in MessagePort::contextDestroyed in http/tests/security/MessagePort/event-listener-context.html, usually attributed to later tests.
        https://bugs.webkit.org/show_bug.cgi?id=94458

        Reviewed by Chris Dumez.

        No new tests (Changed existing test to reliably crash before this change, and work after it)

        There was already a glaring FIXME that said "MessagePorts should be ActiveDOMObjects"
        
        It was right, and it fixes up this subtle lifetime issue.
        
        * dom/MessagePort.cpp:
        (WebCore::MessagePort::MessagePort):
        (WebCore::MessagePort::hasPendingActivity const):
        (WebCore::MessagePort::locallyEntangledPort const):
        (WebCore::MessagePort::activeDOMObjectName const):
        (WebCore::MessagePort::hasPendingActivity): Deleted.
        (WebCore::MessagePort::locallyEntangledPort): Deleted.
        * dom/MessagePort.h:

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
        (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
        (WebCore::ScriptExecutionContext::hasPendingActivity const):

2017-12-20  Youenn Fablet  <youenn@apple.com>

        Do not search for service worker registration in case of non HTTP navigation loads
        https://bugs.webkit.org/show_bug.cgi?id=180976
        <rdar://problem/36157322>

        Unreviewed.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::startLoadingMainResource): Removing unneeded spaces.

2017-12-20  Alex Christensen  <achristensen@webkit.org>

        Remove some SVN files accidentally committed with r226160
        https://bugs.webkit.org/show_bug.cgi?id=180934

        * WebCore.xcodeproj/project.pbxproj.orig: Removed.
        * WebCore.xcodeproj/project.pbxproj.rej: Removed.

2017-12-20  Zalan Bujtas  <zalan@apple.com>

        [RenderTreeBuilder] Replace remaining addChild calls with RenderTreeBuilder::insert
        https://bugs.webkit.org/show_bug.cgi?id=181044
        <rdar://problem/36157613>

        Reviewed by Antti Koivisto.

        Covered by existing test cases.

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::addChildIgnoringContinuation):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::addChildIgnoringContinuation):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::addChildIgnoringContinuation): Deleted.

2017-12-20  Daniel Bates  <dabates@apple.com>

        Cleanup: Dereference value of optional directly instead of using checked value in WebCore::subdivide()
        https://bugs.webkit.org/show_bug.cgi?id=181050

        Reviewed by Simon Fraser.

        It is sufficient and more efficient to dereference a std::optional directly when we know that it has
        a value as opposed to using the checked dereference member function std::optional<>::value().

        No functionality changed. So, no new tests.

        * rendering/MarkerSubrange.cpp:
        (WebCore::subdivide):

2017-12-20  Daniel Bates  <dabates@apple.com>

        MarkerSubrange.SubdivideGrammarAndSelectionOverlap{Frontmost, FrontmostWithLongestEffectiveRange} are failing
        https://bugs.webkit.org/show_bug.cgi?id=181014

        Reviewed by Simon Fraser.

        Fixes an issue in the subdivision algorithm where the returned subranges may not be paint order
        or reverse paint order when using the default overlap strategy (OverlapStrategy::None) and
        either OverlapStrategy::Frontmost or OverlapStrategy::FrontmostWithLongestEffectiveRange, respectively.

        Currently we compute the overlapping subranges up to some point p_i on the line by sweeping from the
        start of the line through all the unclosed subranges. The unclosed subranges are sorted along the line.
        That is, they are not sorted by paint order or reverse paint order. Therefore we must take care to
        ensure that we return the computed overlapping subranges with respect to paint order/reverse paint order.

        * rendering/MarkerSubrange.cpp:
        (WebCore::subdivide):

2017-12-20  Youenn Fablet  <youenn@apple.com>

        LayoutTest imported/w3c/web-platform-tests/service-workers/cache-storage/serviceworker/cache-match.https.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=179137
        <rdar://problem/35337335>

        Reviewed by Chris Dumez.

        Covered by unflaked test.

        * workers/service/context/ServiceWorkerThreadProxy.cpp:
        (WebCore::ServiceWorkerThreadProxy::postTaskToLoader): ThreadableBlobRegistry is using callOnMainThread.
        Use it also for postTaskToLoader so that there is no race condition between registering a blob and reading it.

2017-12-20  Youenn Fablet  <youenn@apple.com>

        Support service worker interception of request with blob body
        https://bugs.webkit.org/show_bug.cgi?id=181035

        Reviewed by Chris Dumez.

        Covered by updated test.

        Add support for getting blob request bodies within service worker.
        Disable interception of requests with form datas.

        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::fromFormData):
        * Modules/fetch/FetchBody.h:
        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
        * workers/service/context/ServiceWorkerFetch.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::postFetchTask):

2017-12-20  Jeremy Jones  <jeremyj@apple.com>

        Send fullscreenChange earlier, in webkitWillEnterFullscreen
        https://bugs.webkit.org/show_bug.cgi?id=181016

        Reviewed by Jer Noble.

        Sending the event earlier, allows pages to update their interface state before the fullscreen animation.
        
        * dom/Document.cpp:
        (WebCore::Document::webkitWillEnterFullScreenForElement):
        (WebCore::Document::webkitDidEnterFullScreenForElement):

2017-12-20  Daniel Bates  <dabates@apple.com>

        Remove Alternative Presentation Button
        https://bugs.webkit.org/show_bug.cgi?id=180500
        <rdar://problem/35891047>

        Reviewed by Simon Fraser.

        We no longer need the alternative presentation button.

        * Configurations/FeatureDefines.xcconfig:
        * DerivedSources.make:
        * English.lproj/Localizable.strings:
        * SourcesCocoa.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/Element.h:
        * editing/Editor.cpp:
        (WebCore::Editor::clear):
        (WebCore::Editor::substituteWithAlternativePresentationButton): Deleted.
        (WebCore::Editor::removeAlternativePresentationButton): Deleted.
        (WebCore::Editor::elementsReplacedByAlternativePresentationButton): Deleted.
        (WebCore::Editor::didInsertAlternativePresentationButtonElement): Deleted.
        (WebCore::Editor::didRemoveAlternativePresentationButtonElement): Deleted.
        * editing/Editor.h:
        * editing/cocoa/AlternativePresentationButtonSubstitution.cpp: Removed.
        * editing/cocoa/AlternativePresentationButtonSubstitution.h: Removed.
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::updateType):
        (WebCore::HTMLInputElement::parseAttribute):
        (WebCore::HTMLInputElement::willAttachRenderers):
        (WebCore::HTMLInputElement::alternativePresentationButtonElement const): Deleted.
        (WebCore::HTMLInputElement::setTypeWithoutUpdatingAttribute): Deleted.
        (WebCore::HTMLInputElement::createInputType): Deleted.
        * html/HTMLInputElement.h:
        * html/InputType.h:
        (WebCore::InputType::alternativePresentationButtonElement const): Deleted.
        * html/InputTypeNames.cpp:
        (WebCore::InputTypeNames::alternativePresentationButton): Deleted.
        * html/InputTypeNames.h:
        * html/shadow/cocoa/AlternativePresentationButtonElement.cpp: Removed.
        * html/shadow/cocoa/AlternativePresentationButtonElement.h: Removed.
        * html/shadow/cocoa/AlternativePresentationButtonInputType.cpp: Removed.
        * html/shadow/cocoa/AlternativePresentationButtonInputType.h: Removed.
        * page/ChromeClient.h:
        * platform/LocalizedStrings.cpp:
        (WebCore::AXAlternativePresentationButtonLabel): Deleted.
        (WebCore::alternativePresentationButtonTitle): Deleted.
        (WebCore::alternativePresentationButtonSubtitle): Deleted.
        * platform/LocalizedStrings.h:
        * testing/Internals.cpp:
        (WebCore::Internals::substituteWithAlternativePresentationButton): Deleted.
        (WebCore::Internals::removeAlternativePresentationButton): Deleted.
        (WebCore::Internals::elementsReplacedByAlternativePresentationButton): Deleted.
        * testing/Internals.h:
        * testing/Internals.idl:

2017-12-20  Chris Dumez  <cdumez@apple.com>

        Do not reuse resource for memory cache if selected service worker differs
        https://bugs.webkit.org/show_bug.cgi?id=181042

        Reviewed by Youenn Fablet.

        No new tests, rebaselined existing test.

        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::options const):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::determineRevalidationPolicy const):

2017-12-20  Youenn Fablet  <youenn@apple.com>

        Do not search for service worker registration in case of non HTTP navigation loads
        https://bugs.webkit.org/show_bug.cgi?id=180976

        Reviewed by Chris Dumez.

        Covered by manual testing using perf test app uploaded in https://bugs.webkit.org/show_bug.cgi?id=180929.
        In case we are sure there is no possiblity for getting a service worker, skip the search step.
        Simialrly, do not report any Document as a Service Worker client if it can never be controlled.
        A follow-up patch should handle the case of local URLs service worker selection.

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

2017-12-20  Andy Estes  <aestes@apple.com>

        [Apple Pay] Tell PassKit whether Apple Pay JS or Payment Request was used to start an Apple Pay session
        https://bugs.webkit.org/show_bug.cgi?id=181001
        <rdar://problem/35479106>

        Reviewed by Tim Horton.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::convertAndValidate):
        * Modules/applepay/ApplePaySessionPaymentRequest.h:
        (WebCore::ApplePaySessionPaymentRequest::requester const):
        (WebCore::ApplePaySessionPaymentRequest::setRequester):
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::ApplePayPaymentHandler::show):

2017-12-20  Zalan Bujtas  <zalan@apple.com>

        [RenderTreeBuilder] Move finding-the-parent/creating-wrapper logic from RenderTable::addChild to RenderTreeBuilder
        https://bugs.webkit.org/show_bug.cgi?id=181018
        <rdar://problem/36148601>

        Reviewed by Antti Koivisto.

        This is in preparation for removing all tree mutation from renderering code.

        Covered by existing tests.

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::addChildIgnoringContinuation):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::addChild):
        * rendering/updating/RenderTreeBuilder.cpp:
        (WebCore::RenderTreeBuilder::insertChild):
        * rendering/updating/RenderTreeBuilderTable.cpp:
        (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
        * rendering/updating/RenderTreeBuilderTable.h:

2017-12-20  Frederic Wang  <fwang@igalia.com>

        Split layout of RenderMathMLRow into smaller steps
        https://bugs.webkit.org/show_bug.cgi?id=180348

        Reviewed by Manuel Rego Casasnovas.

        Currently, RenderMathMLRow mixes too many steps in the same layout functions: layout children,
        calculate stretch size, stretch vertical operators, calculate final ascent/descent, handle
        out-of-flow positioned children, set logical height, set logical width for non-display
        <math> tag, center display <math> tag etc This situation is inherited from the old flexbox
        implementation but it makes difficult to read the code and to re-use layout & metrics
        calculation for follow-up work on <mrow>-like elements (<menclose>, <mapdded>, <msqrt> or
        <math>). See for example bug 160547 for <math> or bug 161126 for <menclose>.
        This patch rewrites RenderMathMLRow into smaller steps:
        - stretchVerticalOperatorsAndLayoutChildren() which calls layoutIfNeeded() or
        insertPositionedObject() on children and stretch vertical operators.
        - getContentBoundingBox() to determine the metrics of the mrow-like element without calling
        layout on children or positioning them, so that we can improve mrow-like element in the
        future.
        - layoutRowItems() which sets the position of children.

        Setting the logical width/height or centering children is now moved into layoutBlock() since
        derived class overriding layoutBlock() will do their own adjustment for width, height and
        positions.

        Test: mathml/mrow-preferred-width-with-out-of-flow-child.html
        The rest of the behavior is unchanged and already covered by existing tests.

        * rendering/mathml/RenderMathMLMenclose.cpp:
        (WebCore::RenderMathMLMenclose::layoutBlock): Use the new function and get contentWidth
        directly from getContentBoundingBox().
        * rendering/mathml/RenderMathMLPadded.cpp:
        (WebCore::RenderMathMLPadded::layoutBlock): Ditto.
        * rendering/mathml/RenderMathMLRoot.cpp:
        (WebCore::RenderMathMLRoot::layoutBlock): Ditto, also remove useless statement
        baseAscent = baseDescent.
        * rendering/mathml/RenderMathMLRow.cpp:
        (WebCore::toVerticalStretchyOperator): New helper function to cast to a vertical stretchy
        operator.
        (WebCore::RenderMathMLRow::stretchVerticalOperatorsAndLayoutChildren): New helper function
        to ensure layoutIfNeeded()/insertPositionedObject() is called on children and that the
        vertical operators are stretched.
        (WebCore::RenderMathMLRow::getContentBoundingBox const): New helper function to determine
        the width/ascent/descent to use for the mrow content.
        (WebCore::RenderMathMLRow::computePreferredLogicalWidths): Skip out-of-flow children in the
        preferred width calculation. This is verified by the new test.
        (WebCore::RenderMathMLRow::layoutRowItems): Only keep the positioning of children with the
        specified width and ascent.
        (WebCore::RenderMathMLRow::layoutBlock): Center children for <math display="block"> tag and
        set the logical width in other cases. Also set the logical height here.
        (WebCore::RenderMathMLRow::computeLineVerticalStretch): Deleted. This work is included in
        stretchVerticalOperatorsAndLayoutChildren() now.
        * rendering/mathml/RenderMathMLRow.h: Update declaration of functions.

2017-12-20  Antti Koivisto  <antti@apple.com>

        Move list and multicolumn building code from RenderTreeUpdater to RenderTreeBuilder
        https://bugs.webkit.org/show_bug.cgi?id=181021

        Reviewed by Zalan Bujtas.

        RenderTreeUpdater::ListItem -> RenderTreeBuilder::List
        RenderTreeUpdater::MultiColumn -> RenderTreeBuilder::MultiColumn

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * rendering/TextAutoSizing.cpp:
        (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
        * rendering/updating/RenderTreeBuilder.cpp:
        (WebCore::RenderTreeBuilder::RenderTreeBuilder):
        (WebCore::RenderTreeBuilder::updateAfterDescendants):
        * rendering/updating/RenderTreeBuilder.h:
        (WebCore::RenderTreeBuilder::listBuilder):
        (WebCore::RenderTreeBuilder::multiColumnBuilder):
        * rendering/updating/RenderTreeBuilderList.cpp: Copied from Source/WebCore/rendering/updating/RenderTreeUpdaterListItem.cpp.
        (WebCore::RenderTreeBuilder::List::List):
        (WebCore::RenderTreeBuilder::List::updateItemMarker):
        (WebCore::RenderTreeUpdater::ListItem::updateMarker): Deleted.
        * rendering/updating/RenderTreeBuilderList.h: Copied from Source/WebCore/rendering/updating/RenderTreeUpdaterListItem.h.
        * rendering/updating/RenderTreeBuilderMultiColumn.cpp: Copied from Source/WebCore/rendering/updating/RenderTreeUpdaterMultiColumn.cpp.
        (WebCore::RenderTreeBuilder::MultiColumn::MultiColumn):
        (WebCore::RenderTreeBuilder::MultiColumn::updateAfterDescendants):
        (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
        (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
        (WebCore::RenderTreeUpdater::MultiColumn::update): Deleted.
        (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow): Deleted.
        (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow): Deleted.
        * rendering/updating/RenderTreeBuilderMultiColumn.h: Copied from Source/WebCore/rendering/updating/RenderTreeUpdaterMultiColumn.h.
        * rendering/updating/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::commit):
        (WebCore::RenderTreeUpdater::updateAfterDescendants):
        * rendering/updating/RenderTreeUpdater.h:
        * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
        (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
        * rendering/updating/RenderTreeUpdaterListItem.cpp: Removed.
        * rendering/updating/RenderTreeUpdaterListItem.h: Removed.
        * rendering/updating/RenderTreeUpdaterMultiColumn.cpp: Removed.
        * rendering/updating/RenderTreeUpdaterMultiColumn.h: Removed.

2017-12-20  Ms2ger  <Ms2ger@igalia.com>

        REGRESSION(r226160) Build broken when MEDIA_STREAM is disabled with MediaStreamRequest namespace confusion
        https://bugs.webkit.org/show_bug.cgi?id=181026

        Unreviewed build fix.

        * platform/mediastream/MediaStreamRequest.h: Fix namespace, unconditionally include header.

2017-12-20  Frederic Wang  <fwang@igalia.com>

        Refactor RenderMathMLFraction to remove members modified during layout
        https://bugs.webkit.org/show_bug.cgi?id=180151

        Reviewed by Manuel Rego Casasnovas.

        Currently, RenderMathMLFraction has three LayoutUnit members m_defaultLineThickness,
        m_lineThickness and m_ascent that are set during layout. In the past such members have caused
        MathML rendering bugs due to update issues. This patch refactors the layout of MathML
        fractions so that it does not require to store and keep these LayoutUnit members up-to-date.
        New helper functions are introduced to perform the simple arithmetic calculations required.

        No new tests, behavior unchanged and already covered by existing tests.

        * rendering/mathml/RenderMathMLFraction.cpp: We add new helper functions to calculate line
        thickness values. This allows to remove updateLineThickness(), m_defaultLineThickness and
        m_lineThickness. We also introduce the ascentOverHorizontalAxis() helper function to
        calculate the ascent over the middle of its fraction bar or stack gap. This allows to remove
        the m_ascent member.
        (WebCore::RenderMathMLFraction::defaultLineThickness const): Helper function to calculate
        the default thickness of the fraction bar given in the MATH table or a fallback value.
        This replaces the use of m_defaultLineThickness.
        (WebCore::RenderMathMLFraction::lineThickness const): Helper function to resolve the
        actual thickness based on the @linethickness attribute and the default value. This replaces
        the use of m_lineThickness.
        (WebCore::RenderMathMLFraction::relativeLineThickness const): Rewrite this function using
        the new helper functions.
        (WebCore::RenderMathMLFraction::fractionParameters const): Make this const and replaces
        isStack() with !lineThickness().
        (WebCore::RenderMathMLFraction::stackParameters const): Ditto. Also move from layoutBlock
        the adjustment of parameters to ensure a minimum gap. Doing so assumes that the fraction is
        valid so we add an ASSERT.
        (WebCore::RenderMathMLFraction::horizontalOffset const): Make this a const since it does not
        mutate anything.
        (WebCore::RenderMathMLFraction::ascentOverHorizontalAxis const): Move this code from
        layoutBlock() to determine the middle of the stack gap or of the fraction bar. This helper
        function replaces m_ascent - mathAxisHeight(). Note that the adjustment of topShiftUp is now
        done in stackParameters().
        (WebCore::RenderMathMLFraction::layoutBlock): Remove the call to updateLineThickness().
        Rely on stackParameters() and ascentOverHorizontalAxis() to perform the necessary calculation
        of bottomShiftDown and ascent respectively.
        (WebCore::RenderMathMLFraction::paint): Use lineThickness() and ascentOverHorizontalAxis()
        instead of m_lineThickness, m_ascent and isStack().
        (WebCore::RenderMathMLFraction::firstLineBaseline const): Use ascentOverHorizontalAxis() and
        mathAxisHeight() instead of m_ascent.
        (WebCore::RenderMathMLFraction::updateLineThickness): Deleted.
        * rendering/mathml/RenderMathMLFraction.h: Declare new helper functions for line thickness
        values and ascent and remove the old LayoutUnit members. Make horizontalOffset(),
        fractionParameter() and stackParameters() const since they do not modify anything and the two
        last are used in the const function ascentOverHorizontalAxis(), itself used in
        firstLineBaseline().

2017-12-20  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][Clang] Build fix after r226138
        https://bugs.webkit.org/show_bug.cgi?id=180984

        Unreviewed build fix.

        No new tests, its a build fix.

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

2017-12-20  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r222699): Drag & drop from a web page to Gmail fails
        https://bugs.webkit.org/show_bug.cgi?id=181019

        Reviewed by Wenson Hsieh.

        The bug was caused by imageTypeToFakeFilename returning "image/png" instead of "image.png" for
        the filename for a PING image converted from a TIFF image. Fixed the bug by correcting this typo.

        Tests: PasteImage.PasteLegacyTIFFImage
               PasteImage.PasteTIFFImage 

        * platform/cocoa/PasteboardCocoa.mm:
        (WebCore::imageTypeToFakeFilename):

2017-12-19  Myles C. Maxfield  <mmaxfield@apple.com>

        Refactor user-installed font setting for clarity
        https://bugs.webkit.org/show_bug.cgi?id=181013

        Reviewed by Simon Fraser.

        Pave the way for https://bugs.webkit.org/show_bug.cgi?id=180951.

        This patch renames the Setting to not have so many grammatical negatives, and moves
        some CoreText-specific FontCache function signatures into a new FontCacheCoreText.h
        header file. It also uses the AllowUserInstalledFonts enum class in more places instead
        of the old boolean we were using, and puts this enum class in the common TextFlags.h
        header.

        No new tests because there is no behavior change.

        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSFontFaceSet.cpp:
        (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::initializeFontStyle):
        * page/Settings.yaml:
        * platform/graphics/FontCache.h:
        (WebCore::SynthesisPair::SynthesisPair): Deleted.
        (WebCore::SynthesisPair::boldObliquePair const): Deleted.
        * platform/graphics/FontDescription.cpp:
        (WebCore::m_shouldAllowUserInstalledFonts):
        (WebCore::m_mayRepresentUserInstalledFont): Deleted.
        * platform/graphics/FontDescription.h:
        (WebCore::FontDescription::shouldAllowUserInstalledFonts const):
        (WebCore::FontDescription::setShouldAllowUserInstalledFonts):
        (WebCore::FontDescription::operator== const):
        (WebCore::FontDescription::mayRepresentUserInstalledFont const): Deleted.
        (WebCore::FontDescription::setMayRepresentUserInstalledFont): Deleted.
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::FontDatabase::singleton):
        (WebCore::FontDatabase::singletonAllowingUserInstalledFonts):
        (WebCore::FontDatabase::singletonDisallowingUserInstalledFonts):
        (WebCore::FontDatabase::FontDatabase):
        (WebCore::platformFontLookupWithFamily):
        (WebCore::fontWithFamily):
        * platform/graphics/cocoa/FontCacheCoreText.h: Added.
        (WebCore::SynthesisPair::SynthesisPair):
        (WebCore::SynthesisPair::boldObliquePair const):
        * platform/text/TextFlags.h:
        * style/StyleResolveForDocument.cpp:
        (WebCore::Style::resolveForDocument):

2017-12-19  Youenn Fablet  <youenn@apple.com>

        UserMediaRequest should stop a request when Document is being stopped
        https://bugs.webkit.org/show_bug.cgi?id=180962

        Reviewed by Eric Carlson.

        Covered by fast/mediastream/destroy-document-while-enumerating-devices.html not crashing anymore under guardmalloc.
        Stopping to wait for the media stream to be active whenDocument goes away.

        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::UserMediaRequest):
        (WebCore::UserMediaRequest::stop):
        (WebCore::UserMediaRequest::activeDOMObjectName const):
        (WebCore::UserMediaRequest::canSuspendForDocumentSuspension const):
        (WebCore::UserMediaRequest::contextDestroyed): Deleted.
        * Modules/mediastream/UserMediaRequest.h:

2017-12-19  Antti Koivisto  <antti@apple.com>

        Move first-letter building code to RenderTreeBuilder
        https://bugs.webkit.org/show_bug.cgi?id=180992

        Reviewed by Zalan Bujtas.

        All special case tree building logic should go to RenderTreeBuilder.

        - RenderTreeUpdater::FirstLetter -> RenderTreeBuilder::FirstLetter
        - Make the builder non-static and stop using RenderTreeBuilder::current() there.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * rendering/TextAutoSizing.cpp:
        (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
        * rendering/updating/RenderTreeBuilder.cpp:
        (WebCore::RenderTreeBuilder::RenderTreeBuilder):
        (WebCore::RenderTreeBuilder::insertChild):
        (WebCore::RenderTreeBuilder::updateAfterDescendants):
        * rendering/updating/RenderTreeBuilder.h:
        (WebCore::RenderTreeBuilder::firstLetterBuilder):
        (WebCore::RenderTreeBuilder::tableBuilder):
        * rendering/updating/RenderTreeBuilderFirstLetter.cpp: Copied from rendering/updating/RenderTreeUpdaterFirstLetter.cpp.
        (WebCore::supportsFirstLetter):
        (WebCore::RenderTreeBuilder::FirstLetter::FirstLetter):
        (WebCore::RenderTreeBuilder::FirstLetter::updateAfterDescendants):
        (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
        (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
        (WebCore::updateFirstLetterStyle): Deleted.
        (WebCore::createFirstLetterRenderer): Deleted.
        (WebCore::RenderTreeUpdater::FirstLetter::update): Deleted.
        * rendering/updating/RenderTreeBuilderFirstLetter.h: Copied from rendering/updating/RenderTreeUpdaterFirstLetter.h.
        * rendering/updating/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateAfterDescendants):
        * rendering/updating/RenderTreeUpdater.h:
        * rendering/updating/RenderTreeUpdaterFirstLetter.cpp: Removed.
        * rendering/updating/RenderTreeUpdaterFirstLetter.h: Removed.

2017-12-19  Chris Dumez  <cdumez@apple.com>

        [Fetch] Extracting a body of type Blob should not set Content-Type to the empty string
        https://bugs.webkit.org/show_bug.cgi?id=180991

        Reviewed by Youenn Fablet.

        Extracting a body of type Blob should not set Content-Type to the empty string as per:
        - https://fetch.spec.whatwg.org/#concept-bodyinit-extract

        No new tests, rebaselined existing test.

        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::extract):

2017-12-19  Commit Queue  <commit-queue@webkit.org>

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

        No longer needed to build without error. (Requested by xenon
        on #webkit).

        Reverted changeset:

        "[GTK][WPE] Conditionalize libTASN1 use behind
        ENABLE_SUBTLE_CRYPTO in the CMake files"
        https://bugs.webkit.org/show_bug.cgi?id=180949
        https://trac.webkit.org/changeset/226094

2017-12-19  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Clean up RealtimeMediaSource interfaces
        https://bugs.webkit.org/show_bug.cgi?id=180934
        <rdar://problem/36108648>

        Reviewed by Youenn Fablet.

        No new tests, updated http/tests/media/media-stream/disconnected-frame.html.
        
        Wrap video and audio constraints in a struct instead of passing both around as separate
        parameters. Cleanup up the interface to RealTimeMediaSourceCenter.

        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::MediaDevices::getUserMedia const):
        * Modules/mediastream/MediaDevicesRequest.cpp:
        (WebCore::MediaDevicesRequest::start):
        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::create):
        (WebCore::UserMediaRequest::UserMediaRequest):
        (WebCore::UserMediaRequest::start):
        (WebCore::UserMediaRequest::allow):
        (WebCore::UserMediaRequest::contextDestroyed):
        * Modules/mediastream/UserMediaRequest.h:
        (WebCore::UserMediaRequest::request const):
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/CaptureDevice.h:
        (WebCore::CaptureDevice::persistentId const):
        (WebCore::CaptureDevice::label const):
        (WebCore::CaptureDevice::groupId const):
        (WebCore::CaptureDevice::type const):
        (WebCore::CaptureDevice::setPersistentId): Deleted.
        (WebCore::CaptureDevice::setLabel): Deleted.
        (WebCore::CaptureDevice::setGroupId): Deleted.
        (WebCore::CaptureDevice::setType): Deleted.
        * platform/mediastream/CaptureDeviceManager.cpp:
        (CaptureDeviceManager::getAudioSourcesInfo): Deleted.
        (CaptureDeviceManager::getVideoSourcesInfo): Deleted.
        (CaptureDeviceManager::deviceWithUID): Deleted.
        * platform/mediastream/CaptureDeviceManager.h:
        (WebCore::CaptureDeviceManager::captureDeviceWithPersistentID):
        (WebCore::CaptureDeviceManager::refreshCaptureDevices):
        * platform/mediastream/MediaStreamRequest.h: Copied from Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDevice.mm.
        (WebCore::MediaStreamRequest::encode const):
        (WebCore::MediaStreamRequest::decode):
        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::createMediaStream):
        (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
        (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
        (WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID):
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        * platform/mediastream/RealtimeMediaSourceSettings.h:
        * platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:
        (WebCore::AVAudioSessionCaptureDevice::AVAudioSessionCaptureDevice):
        * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h:
        * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
        (WebCore::AVAudioSessionCaptureDeviceManager::captureDevices):
        (WebCore::AVAudioSessionCaptureDeviceManager::captureDeviceWithPersistentID):
        * platform/mediastream/mac/AVCaptureDeviceManager.h:
        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
        (WebCore::AVCaptureDeviceManager::captureDevicesInternal):
        (WebCore::AVCaptureDeviceManager::captureDevices):
        (WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType):
        (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
        (WebCore::AVCaptureDeviceManager::deviceDisconnected):
        (WebCore::AVCaptureDeviceManager::getAudioSourcesInfo): Deleted.
        (WebCore::AVCaptureDeviceManager::getVideoSourcesInfo): Deleted.
        * platform/mediastream/mac/CoreAudioCaptureDevice.cpp:
        (WebCore::CoreAudioCaptureDevice::CoreAudioCaptureDevice):
        * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
        (WebCore::CoreAudioCaptureDeviceManager::captureDevices):
        (WebCore::CoreAudioCaptureDeviceManager::captureDeviceWithPersistentID):
        (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
        * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        * platform/mock/MockRealtimeAudioSource.cpp:
        (WebCore::MockRealtimeAudioSource::startProducingData):
        (WebCore::MockRealtimeAudioSource::createMuted): Deleted.
        * platform/mock/MockRealtimeAudioSource.h:
        * platform/mock/MockRealtimeMediaSource.cpp:
        (WebCore::deviceMap):
        (WebCore::MockRealtimeMediaSource::captureDeviceWithPersistentID):
        (WebCore::MockRealtimeMediaSource::audioDevices):
        (WebCore::MockRealtimeMediaSource::videoDevices):
        (WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
        * platform/mock/MockRealtimeMediaSource.h:
        (WebCore::MockRealtimeMediaSource::device const):
        (WebCore::MockRealtimeMediaSource::deviceIndex): Deleted.
        * platform/mock/MockRealtimeMediaSourceCenter.h:
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
        (WebCore::MockRealtimeVideoSource::initializeCapabilities):
        (WebCore::MockRealtimeVideoSource::generateFrame):
        (WebCore::MockRealtimeVideoSource::createMuted): Deleted.
        * platform/mock/MockRealtimeVideoSource.h:

2017-12-19  Ryosuke Niwa  <rniwa@webkit.org>

        Don't convert pasted content to use blob URL in WebKit1
        https://bugs.webkit.org/show_bug.cgi?id=180969

        Reviewed by Wenson Hsieh.

        Turns out that some WebKit1 clients are relying on being able to see the original URLs of the pasted content;
        e.g. not storing content referenced by HTTP/HTTPS protocol as opposed to local files.

        This patch restores the behavior prior to r223440 and r222839 for WebKit1 clients by overriding resources in
        DocumentLoader instead of converting URLs used in the pasted contents by blob URLs. In addition, this patch
        disables the pasteboard sanitization and custom data transfer types for WebKit1 clients as the feature poses
        a compatibility concern for WebKit1 clients.

        Tests: WebKitLegacy.AccessingImageInPastedRTFD
               WebKitLegacy.AccessingImageInPastedWebArchive

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::createFragmentAndAddResources):
        (WebCore::WebContentReader::readWebArchive):
        * page/DeprecatedGlobalSettings.cpp:
        (WebCore::DeprecatedGlobalSettings::defaultCustomPasteboardDataEnabled):

2017-12-19  Jer Noble  <jer.noble@apple.com>

        Playing media elements which call "pause(); play()" will have the play promise rejected.
        https://bugs.webkit.org/show_bug.cgi?id=180781
        <rdar://problem/33191377>

        Reviewed by Eric Carlson.

        Follow-up to address failing iOS API tests. Rather than skipping the call to
        prepareForLoad() in the case where media elements are not allowed to load data,
        unconditionally call prepareForLoad(), but conditionally call selectMediaResource() inside
        that function only if the media elemnet is allowed to load. This ensures that the
        MediaPlayer is created when play(), pause(), or load() are called during a user gesture
        later, and selectMediaResource() (which depends on having a non-null m_player) is called.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::parseAttribute):
        (WebCore::HTMLMediaElement::insertedIntoAncestor):
        (WebCore::HTMLMediaElement::load):
        (WebCore::HTMLMediaElement::prepareForLoad):
        (WebCore::HTMLMediaElement::playInternal):

2017-12-19  Timothy Hatcher  <timothy@hatcher.name>

        Build failure in WebGL2 when Video feature is disabled
        https://bugs.webkit.org/show_bug.cgi?id=180946

        Reviewed by Brian Burg.

        * html/canvas/WebGL2RenderingContext.h: Make TexImageSource conditional on ENABLE(VIDEO).
        * html/canvas/WebGL2RenderingContext.idl: Ditto.

2017-12-19  Chris Dumez  <cdumez@apple.com>

        scopeURL should start with the provided scriptURL
        https://bugs.webkit.org/show_bug.cgi?id=180983

        Reviewed by Youenn Fablet.

        scopeURL should start with the provided scriptURL, as per:
        - https://w3c.github.io/ServiceWorker/#update (steps 7.8 to 7.18)

        No new tests, rebaselined existing tests.

        * platform/network/HTTPHeaderNames.in:
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::didReceiveResponse):

2017-12-19  Zalan Bujtas  <zalan@apple.com>

        [RenderTreeBuilder] Move finding-the-parent/creating-wrapper logic from RenderTableSection::addChild to RenderTreeBuilder
        https://bugs.webkit.org/show_bug.cgi?id=180994
        <rdar://problem/36139222>

        Reviewed by Antti Koivisto.

        This is in preparation for removing all tree mutation from renderering code.

        Covered by existing tests.

        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::addChild):
        * rendering/updating/RenderTreeBuilder.cpp:
        (WebCore::RenderTreeBuilder::insertChild):
        * rendering/updating/RenderTreeBuilderTable.cpp:
        (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
        * rendering/updating/RenderTreeBuilderTable.h:

2017-12-19  Daniel Bates  <dabates@apple.com>

        Implement InlineTextBox painting using marker subranges
        https://bugs.webkit.org/show_bug.cgi?id=180984
        <rdar://problem/36139364>

        Reviewed by David Hyatt.

        As a step towards implementing CSS Pseudo-Elements Module Level 4, explicitly decompose a
        text line into subrange objects that may be styled (say, to give the appearance of selected
        text) and painted.

        No functionality changed. So, no new tests.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::localSelectionRect const): Update comments.

        (WebCore::InlineTextBox::MarkerSubrangeStyle::operator== const):
        (WebCore::InlineTextBox::MarkerSubrangeStyle::operator!= const):
        (WebCore::InlineTextBox::StyledMarkerSubrange::StyledMarkerSubrange):
        Define a subclass to represent a marker subrange that has associated style information.
        We will make use of the style information when painting the subrange.

        (WebCore::createMarkerSubrangeFromSelectionInBox): Convenience function to instantiate a
        MarkerSubrange instance from the current selection of a specified text box.

        (WebCore::InlineTextBox::paint): Write in terms of MarkerSubrange. We keep composition backgrounds
        and composition underlines as special cases for now. We represent all other subranges of the line
        as MarkerSubrange instances, including unmarked text (i.e. non-selected text without an associated
        document marker). The subranges for the gaps between document markers and selection are implicitly
        created by subdividing the entire line. Support for PaintBehaviorExcludeSelection is implemented
        by subdividing the entire line with the selection subrange and then removing the selection subrange
        from the resulting list of subdivisions before painting with the resulting list.

        (WebCore::InlineTextBox::paintPlatformDocumentMarkers): Renamed; formerly named paintDocumentMarkers.
        (WebCore::InlineTextBox::paintPlatformDocumentMarker): Renamed; formerly named paintDocumentMarker.

        (WebCore::InlineTextBox::computeStyleForUnmarkedMarkerSubrange const): Convenience function to
        compute the style for unmarked text.

        (WebCore::InlineTextBox::resolveStyleForSubrange): Added

        (WebCore::InlineTextBox::subdivideAndResolveStyle): Subdivides the list of marker subranges and
        coalesces subranges of the same type (e.g. selection) or with the same style. The latter strategy
        preserves the optimization of drawing the text of the entire line in one draw command when we know
        that the selected text looks identical to non-selected text. This optimization was performed in TextPainter::paint().

        (WebCore::InlineTextBox::collectSubrangesForDraggedContent): Added.
        (WebCore::InlineTextBox::collectSubrangesForDocumentMarkers): Added.
        (WebCore::InlineTextBox::textOriginFromBoxRect const): Added.

        (WebCore::InlineTextBox::paintMarkerSubranges):
        (WebCore::InlineTextBox::paintTextSubrangeBackground):
        (WebCore::InlineTextBox::paintTextSubrangeForeground):
        (WebCore::InlineTextBox::paintTextSubrangeDecoration):
        Paint the marker subrange.

        (WebCore::InlineTextBox::paintCompositionBackground): Moved function to group it with the logic to
        paint composition underlines. Modified to pass clamped offsets to paintTextSubrangeBackground() as
        paintTextSubrangeBackground() now expects them.

        (WebCore::mirrorRTLSegment): Moved function to be above paintCompositionUnderline() as it is the only
        function that makes use of it.

        (WebCore::InlineTextBox::paintSelection): Deleted.
        (WebCore::InlineTextBox::paintTextMatchMarker): Deleted.
        (WebCore::InlineTextBox::paintDecoration): Deleted.
        (WebCore::InlineTextBox::paintDocumentMarker): Deleted; renamed to paintPlatformDocumentMarker.
        (WebCore::InlineTextBox::paintDocumentMarkers): Deleted; renamed to paintPlatformDocumentMarkers.
        * rendering/InlineTextBox.h:
        (WebCore::InlineTextBox::paintMarkerSubranges): Added.
        * rendering/MarkerSubrange.h:
        (WebCore::MarkerSubrange::isEmpty const): Added.
        (WebCore::MarkerSubrange::operator!= const): Added.
        (WebCore::MarkerSubrange::operator== const): Added.
        * rendering/SimpleLineLayoutFunctions.cpp:
        (WebCore::SimpleLineLayout::paintFlow): Updated code as we no longer need to pass the text run length
        to TextPainter::paint(). Also modernize the code while I am here.
        * rendering/TextDecorationPainter.cpp:
        (WebCore::TextDecorationPainter::Styles::operator== const): Added.
        (WebCore::TextDecorationPainter::TextDecorationPainter): Modified to take an optional TextDecorationPainter::Styles
        instance as an argument and removed the unused parameter for PseudoId.
        * rendering/TextDecorationPainter.h:
        (WebCore::TextDecorationPainter::Styles::operator!= const): Added.
        * rendering/TextPaintStyle.cpp:
        (WebCore::TextPaintStyle::operator== const): Added.
        (WebCore::computeTextSelectionPaintStyle): Removed the now unused out-arguments paintSelectedTextOnly, paintSelectedTextSeparately,
        and paintNonSelectedTextOnly. The values stored in these out-arguments were intended to be used by the caller to
        minimize the number of drawing commands. The value of paintSelectedTextSeparately indicated whether selected text
        would look identical to non-selected text so that a caller could use one paint command to draw the entire line
        instead of issuing two or more drawing commands to paint non-selected and selected text separately. We now
        accomplish the same optimization by coalescing subrange styles in InlineTextBox::subdivideAndResolveStyle().
        The value of paintNonSelectedTextOnly, as its name states, indicated whether a caller should only paint non-selected
        text and hence skip painting of selected text. This value was only used when painting dragged content (i.e. DocumentMarker::DraggedContent
        markers) and its effect is now more directly achieved by the dragged content logic in InlineTextBox::paint().
        * rendering/TextPaintStyle.h:
        (WebCore::TextPaintStyle::operator!= const): Added.
        * rendering/TextPainter.cpp:
        (WebCore::TextPainter::paint): Implemented in terms TextPainter::paintRange() now that InlineTextBox::paint() optimizes
        for the number of drawing calls. See remarks for WebCore::computeTextSelectionPaintStyle() for more details.
        * rendering/TextPainter.h: Group together related member functions.
        (WebCore::TextPainter::setSelectionStyle): Deleted.
        (WebCore::TextPainter::setSelectionShadow): Deleted.

2017-12-19  Daniel Bates  <dabates@apple.com>

        Add support for computing the frontmost longest effective marker subrange
        https://bugs.webkit.org/show_bug.cgi?id=180985

        Reviewed by Dave Hyatt.

        Add a new subdivision overlap strategy to return the minimum list of maximal length non-
        overlapping subranges. We will make use of this strategy together with an algorithm to
        coalesce adjacent subranges with visually indistinct styles to minimize the total number
        of drawing commands needed to paint an entire line of text. We are not making use of
        this functionality now. We will make use of it to simplify the patch for <https://bugs.webkit.org/show_bug.cgi?id=180984>.

        * rendering/MarkerSubrange.cpp:
        (WebCore::subdivide):
        * rendering/MarkerSubrange.h:

2017-12-19  Chris Dumez  <cdumez@apple.com>

        Handle Fetch should wait for the service worker's state to become activated
        https://bugs.webkit.org/show_bug.cgi?id=180959

        Reviewed by Youenn Fablet.

        Handle Fetch should wait for the service worker's state to become activated when
        it is currently activating.

        Specification:
        - https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (Step 16)

        No new tests, rebaselined existing test.

        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::~SWServerWorker):
        (WebCore::SWServerWorker::whenActivated):
        (WebCore::SWServerWorker::setState):
        (WebCore::SWServerWorker::callWhenActivatedHandler):
        * workers/service/server/SWServerWorker.h:

2017-12-19  Yusuke Suzuki  <utatane.tea@gmail.com>

        [YARR] Yarr should return ErrorCode instead of error messages (const char*)
        https://bugs.webkit.org/show_bug.cgi?id=180966

        Reviewed by Mark Lam.

        Remove unnecessary String creation.

        No behavior change.

        * contentextensions/URLFilterParser.cpp:
        (WebCore::ContentExtensions::URLFilterParser::addPattern):

2017-12-19  Zalan Bujtas  <zalan@apple.com>

        [RenderTreeBuilder] Move finding-the-parent/creating-wrapper logic from RenderTableRow::addChild to RenderTreeBuilder
        https://bugs.webkit.org/show_bug.cgi?id=180964
        <rdar://problem/36123315>

        Reviewed by Antti Koivisto.

        This is in preparation for removing all tree mutation from renderering code.

        Covered by existing tests.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::addChild):
        * rendering/updating/RenderTreeBuilder.cpp:
        (WebCore::RenderTreeBuilder::insertChild):
        * rendering/updating/RenderTreeBuilder.h:
        * rendering/updating/RenderTreeBuilderTable.cpp: Added.
        (WebCore::RenderTreeBuilder::Table::findOrCreateParentForChild):
        * rendering/updating/RenderTreeBuilderTable.h: Copied from Source/WebCore/rendering/updating/RenderTreeBuilder.h.

2017-12-19  Youenn Fablet  <youenn@apple.com>

        Service Worker should not clean HTTP headers added by the application or by fetch specification before service worker interception
        https://bugs.webkit.org/show_bug.cgi?id=180939

        Reviewed by Chris Dumez.

        Covered by modified WPT test.

        Add support to clean only specific headers in cleanHTTPRequestHeadersForAccessControl,
        renamed from cleanRedirectedRequestForAccessControl.
        Compute the list of headers to keep in DocumentThreadableLoader.
        Add a specific rule for Accept header which is set prior service worker interception and for
        HTTP headers set by DocumentThreadableLoader clients.

        * loader/CrossOriginAccessControl.cpp:
        (WebCore::httpHeadersToKeepFromCleaning):
        (WebCore::cleanRedirectedRequestForAccessControl):
        * loader/CrossOriginAccessControl.h:
        (WebCore::cleanRedirectedRequestForAccessControl):
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
        * loader/ResourceLoaderOptions.h:
        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
        * workers/service/context/ServiceWorkerFetch.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::postFetchTask):
        * workers/service/context/ServiceWorkerThread.h:

2017-12-19  Andy Estes  <aestes@apple.com>

        [Apple Pay] Stop maintaining a list of payment networks
        https://bugs.webkit.org/show_bug.cgi?id=180965
        <rdar://problem/34696560>

        Reviewed by Tim Horton.

        Instead of maintaining the list of valid payment networks in WebCore, allow the client to
        provide the list when constructing a PaymentCoordinator. Then, use PaymentCoordinator's list
        to validate ApplePaySessionPaymentRequests.

        Validation will now be done case-insensitively since Cocoa clients will provide a list of
        network names that differ in capitalization from the names formerly accepted by WebCore.

        Added new test cases to http/tests/ssl/applepay/ApplePaySession.html.

        * Modules/applepay/ApplePayRequestBase.cpp:
        (WebCore::convertAndValidate): Changed to return a Vector of validated strings.
        (WebCore::validate): Renamed to convertAndValidate.
        * Modules/applepay/ApplePayRequestBase.h:
        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::convertAndValidate):
        (WebCore::ApplePaySession::create):
        * Modules/applepay/ApplePaySessionPaymentRequest.cpp:
        (WebCore::ApplePaySessionPaymentRequest::isValidSupportedNetwork): Deleted.
        * Modules/applepay/ApplePaySessionPaymentRequest.h:
        * Modules/applepay/PaymentCoordinator.cpp:
        (WebCore::toHashSet):
        (WebCore::PaymentCoordinator::PaymentCoordinator): Converted availablePaymentNetworks to a
        case-insensitive HashSet and stored in m_availablePaymentNetworks.
        (WebCore::PaymentCoordinator::validatedPaymentNetwork const): Added special cases for "jcb"
        and "carteBancaire" for API compatibility. For other networks, checked m_availablePaymentNetworks.
        * Modules/applepay/PaymentCoordinator.h:
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::ApplePayPaymentHandler::show):
        * page/MainFrame.cpp:
        (WebCore::MainFrame::MainFrame): Constructed m_paymentCoordinator with configuration.availablePaymentNetworks.
        * page/PageConfiguration.h:
        * testing/Internals.cpp:
        (WebCore::Internals::Internals):
        * testing/MockPaymentCoordinator.cpp:
        * testing/MockPaymentCoordinator.h:

2017-12-19  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, try to fix the Windows build after r226097.

        * editing/markup.cpp:
        (WebCore::StyledMarkupAccumulator::appendCustomAttributes):

2017-12-18  Andy Estes  <aestes@apple.com>

        [Apple Pay] Only include phonetic name properties in ApplePayPaymentContact when version >= 3
        https://bugs.webkit.org/show_bug.cgi?id=180925
        <rdar://problem/35907596>

        Reviewed by Tim Horton.

        No tests possible. The fix involves converting PKContacts, which we can't create in our test harness.

        * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
        (WebCore::ApplePayPaymentAuthorizedEvent::ApplePayPaymentAuthorizedEvent):
        * Modules/applepay/ApplePayPaymentAuthorizedEvent.h:
        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::ApplePaySession::create):
        (WebCore::ApplePaySession::ApplePaySession):
        (WebCore::ApplePaySession::version const):
        (WebCore::ApplePaySession::didAuthorizePayment):
        (WebCore::ApplePaySession::didSelectShippingContact):
        * Modules/applepay/ApplePaySession.h:
        * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
        (WebCore::ApplePayShippingContactSelectedEvent::ApplePayShippingContactSelectedEvent):
        * Modules/applepay/ApplePayShippingContactSelectedEvent.h:
        * Modules/applepay/Payment.h:
        * Modules/applepay/PaymentContact.h:
        * Modules/applepay/PaymentCoordinator.cpp:
        (WebCore::PaymentCoordinator::supportsVersion const):
        (WebCore::PaymentCoordinator::supportsVersion): Deleted.
        * Modules/applepay/PaymentCoordinator.h:
        * Modules/applepay/PaymentSession.h:
        * Modules/applepay/cocoa/PaymentCocoa.mm:
        (WebCore::convert):
        (WebCore::Payment::toApplePayPayment const):
        * Modules/applepay/cocoa/PaymentContactCocoa.mm:
        (WebCore::convert):
        (WebCore::PaymentContact::toApplePayPaymentContact const):
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::ApplePayPaymentHandler::document const):
        (WebCore::ApplePayPaymentHandler::paymentCoordinator const):
        (WebCore::ApplePayPaymentHandler::version const):
        (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
        (WebCore::ApplePayPaymentHandler::didSelectShippingContact):
        (WebCore::ApplePayPaymentHandler::document): Deleted.
        (WebCore::ApplePayPaymentHandler::paymentCoordinator): Deleted.
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:

2017-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] The 'webkitattachmentbloburl' attribute should not persist after markup serialization
        https://bugs.webkit.org/show_bug.cgi?id=180924
        <rdar://problem/36099093>

        Reviewed by Tim Horton.

        Work towards dragging Blob-backed attachment elements as files on iOS and Mac. It doesn't make sense for the
        attachment blob URL to stick around on the element after markup serialization, so this patch removes logic that
        eagerly sets the blob URL upon setting an attachment's File. Instead, we just append this attribute when
        generating markup.

        This patch also augments existing WKAttachmentTests to ensure that these attributes are not present.

        * editing/markup.cpp:
        (WebCore::StyledMarkupAccumulator::appendCustomAttributes):
        (WebCore::createFragmentFromMarkup):
        * html/HTMLAttachmentElement.cpp:
        (WebCore::HTMLAttachmentElement::setFile):
        * rendering/HitTestResult.cpp:

        Fixes a related issue where an attachment is backed by Blob data (and not a file path) would specify "file:///"
        as its attachment file path in DragController when starting a drag. Instead, if there is no file path, fall back
        to the blob URL.

        This will be tested in a future patch once a WK2 dragging simulator for Mac is implemented, and support for
        dragging out Blob-backed attachments as (platform) files is implemented.

        (WebCore::HitTestResult::absoluteAttachmentURL const):

2017-12-18  Chris Dumez  <cdumez@apple.com>

        Default scope used when registering a service worker is wrong
        https://bugs.webkit.org/show_bug.cgi?id=180961

        Reviewed by Youenn Fablet.

        The default scope we used when registering a service worker was wrong, it did not match:
        - https://w3c.github.io/ServiceWorker/#start-register (Step 4)

        This patch aligns our behavior with the specification.

        No new tests, rebaselined existing test.

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):

2017-12-18  Ryosuke Niwa  <rniwa@webkit.org>

        Assertion hit in DocumentOrderedMap::get while removing a form element
        https://bugs.webkit.org/show_bug.cgi?id=137959
        <rdar://problem/27702012>

        Reviewed by Brent Fulgham.

        The assertion failure was caused by FormAssociatedElement::findAssociatedForm calling TreeScope::getElementById
        for a form associated element inside FormAttributeTargetObserver::idTargetChanged during the removal of
        the owner form element, or the first non-form element with the matching ID. If there are other elements with
        the same ID in the removed tree at that moment, MapEntry's count for the ID can be higher than it needs to be
        since Element::removedFromAncestor has not been called on those elements yet.

        Fixed the bug by checking this condition explicitly. This patch introduces ContainerChildRemovalScope which
        keeps track of the container node from which a subtree was removed as well as the root of the removed subtree.
        DocumentOrderedMap::get then checks whether the matching element can be found in this removed subtree, and its
        isConnected() still returns true (the evidence that Element::removedFromAncestor has not been called) when
        count > 0 and there was no matching element in the tree scope.

        In the long term, we should refactor the way FormAssociatedElement and HTMLFormElement refers to each other
        and avoid calling DocumentOrderedMap::get before finish calling removedFromAncestor on the removed subtree.

        Tests: fast/forms/update-form-owner-in-moved-subtree-assertion-failure-5.html
               fast/forms/update-form-owner-in-moved-subtree-assertion-failure-6.html

        * dom/ContainerNodeAlgorithms.cpp:
        (WebCore::notifyChildNodeRemoved):
        * dom/ContainerNodeAlgorithms.h:
        (WebCore::ContainerChildRemovalScope): Added.
        (WebCore::ContainerChildRemovalScope::ContainerChildRemovalScope):
        (WebCore::ContainerChildRemovalScope::~ContainerChildRemovalScope):
        (WebCore::ContainerChildRemovalScope::parentOfRemovedTree):
        (WebCore::ContainerChildRemovalScope::removedChild):
        (WebCore::ContainerChildRemovalScope::currentScope):
        * dom/DocumentOrderedMap.cpp:
        (WebCore::DocumentOrderedMap::get const): Added a special early exit when this function is called during
        a node removal.

2017-12-18  Timothy Hatcher  <timothy@hatcher.name>

        [GTK][WPE] Conditionalize libTASN1 use behind ENABLE_SUBTLE_CRYPTO in the CMake files
        https://bugs.webkit.org/show_bug.cgi?id=180949

        Reviewed by Carlos Alberto Lopez Perez.

        * PlatformGTK.cmake: Move the include path and library additions to conditional ENABLE_SUBTLE_CRYPTO section.
        * PlatformWPE.cmake: Ditto.

2017-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Support representing pasted or dropped content using attachment elements
        https://bugs.webkit.org/show_bug.cgi?id=180892
        <rdar://problem/36064210>

        Reviewed by Tim Horton.

        Support dropping and pasting attributed strings that contain NSTextAttachments. Teaches
        replaceRichContentWithAttachmentsIfNecessary to replace object elements with attachments; see comments below for
        more details.

        Test: WKAttachmentTests.InsertPastedAttributedStringContainingMultipleAttachments

        * editing/WebContentReader.h:

        Add BlobReplacementInfo, which contains a map of blob URLs to replacement Blobs, as well as a map of blob URLs
        to replaced subresource URLs.

        (WebCore::BlobReplacementInfo::isEmpty const):
        * editing/cocoa/EditorCocoa.mm:
        (WebCore::Editor::replaceSelectionWithAttributedString):
        * editing/cocoa/WebArchiveResourceFromNSAttributedString.h:
        * editing/cocoa/WebArchiveResourceFromNSAttributedString.mm:

        Implement -[WebArchiveResourceFromNSAttributedString MIMEType]. UIFoundation asks for -MIMEType in the process
        of generating markup from NSTextAttachments; this currently causes the web process to crash on an unrecognized
        selector.

        Additionally, work around <rdar://problem/36074429>, a UIFoundation bug in which all but a few hard-coded file
        extensions actually yield MIME types that are more specific than "application/octet-stream". This can safely be
        removed once <rdar://problem/36074429> is addressed.

        (-[WebArchiveResourceFromNSAttributedString MIMEType]):
        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::replaceRichContentWithAttachmentsIfNecessary):

        Try to replace object elements with attachments, and also tweak the title of the attachment's File to use the
        replaced subresource's filename if possible. Additionally, abstracts out information for replacing object or
        image elements (formerly a pair of { File, Element }) into a separate struct, and add a AttachmentDisplayMode
        parameter to determine whether the attachment should be presented in-line (in the case of images), or as an icon.

        (WebCore::attributesForAttributedStringConversion):

        Only exclude object elements from being generated from NSTextAttachments if the attachment element runtime
        feature is disabled, or !ENABLE(ATTACHMENT_ELEMENT).

        (WebCore::createFragmentAndAddResources):

        Additionally keep track of a mapping from blob URL => replaced subresource URL. In all the places where we
        previously only plumbed a map of blob URL => Blob, use a BlobReplacementInfo struct instead, which now includes
        a map from blob URL => replaced URL.

        (WebCore::sanitizeMarkupWithArchive):
        (WebCore::WebContentReader::readWebArchive):
        (WebCore::WebContentMarkupReader::readWebArchive):
        (WebCore::WebContentReader::readRTFD):
        (WebCore::WebContentMarkupReader::readRTFD):
        (WebCore::WebContentReader::readRTF):
        (WebCore::WebContentMarkupReader::readRTF):
        (WebCore::WebContentReader::readImage):

2017-12-18  Youenn Fablet  <youenn@apple.com>

        Service worker served response tainting should keep its tainting
        https://bugs.webkit.org/show_bug.cgi?id=180952

        Reviewed by Chris Dumez.

        Covered by rebased tests.

        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::setResponse):

2017-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, attempt to fix watch and TV builds after r226085

        Explicitly include a header in WebContentReaderCocoa.mm.

        * editing/cocoa/WebContentReaderCocoa.mm:

2017-12-18  Brady Eidson  <beidson@apple.com>

        Add ability to API test Service Workers via a custom protocol.
        https://bugs.webkit.org/show_bug.cgi?id=180911

        Reviewed by Chris Dumez.

        Covered by API test ServiceWorkers.Basic

        This adds a set of "Service Workers can handle this" schemes to the scheme registry
        and uses it for SW decisions instead of a handful of previous techniques.

        * bindings/scripts/CodeGeneratorJS.pm:
        (NeedsRuntimeCheck):
        (GenerateRuntimeEnableConditionalString):
        * bindings/scripts/IDLAttributes.json:

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::hasServiceWorkerScheme):
        * dom/ScriptExecutionContext.h:

        * page/NavigatorServiceWorker.idl:

        * platform/SchemeRegistry.cpp:
        (WebCore::serviceWorkerSchemesLock):
        (WebCore::serviceWorkerSchemes):
        (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
        (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme):
        (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme):
        * platform/SchemeRegistry.h:

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):

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

2017-12-18  Chris Dumez  <cdumez@apple.com>

        We should use "error" redirect mode for fetching service worker scripts
        https://bugs.webkit.org/show_bug.cgi?id=180950

        Reviewed by Youenn Fablet.

        We should use "error" redirect mode for fetching service worker scripts, as per:
        - https://w3c.github.io/ServiceWorker/#update (Step 7.5)

        No new tests, rebaselined existing test.

        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::willSendRequestInternal):
        * workers/Worker.cpp:
        (WebCore::Worker::create):
        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::loadAsynchronously):
        * workers/WorkerScriptLoader.h:
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::fetchScriptWithContext):

2017-12-18  Chris Dumez  <cdumez@apple.com>

        ExtendableMessageEvent constructor fails to initialize the 'source' attribute
        https://bugs.webkit.org/show_bug.cgi?id=180954

        Reviewed by Youenn Fablet.

        No new tests, rebaselined existing test.

        * workers/service/ExtendableMessageEvent.cpp:
        (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):

2017-12-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Insert images as inline attachments when pasting and dropping
        https://bugs.webkit.org/show_bug.cgi?id=180853
        <rdar://problem/35756268>

        Reviewed by Tim Horton.

        Adds support for transforming dropped and pasted web content fragments prior to insertion, such that inline
        elements (so far, only images) are replaced with attachment elements that have an inline representation. See
        below comments for more detail.

        Tests: WKAttachmentTests.InsertPastedImageAsAttachment
               WKAttachmentTests.InsertPastedAttributedStringContainingImage
               WKAttachmentTestsMac.InsertPastedFileURLsAsAttachments
               WKAttachmentTestsIOS.InsertDroppedImageAsAttachment
               WKAttachmentTestsIOS.InsertDroppedAttributedStringContainingAttachment

        * editing/WebContentReader.h:
        * editing/cocoa/EditorCocoa.mm:
        (WebCore::Editor::replaceSelectionWithAttributedString):

        Add a new helper to replace elements in a DOM fragment with inline attachment elements instead, using the given
        Blobs. So far, we only replace image elements with these attachments, by mapping the source of each image to a
        Blob, and constructing a replacement attachment backed by a File constructed from the image's corresponding
        Blob. However, this mechanism can be generalized in the future to handle transformations from arbitrary elements
        to attachment elements capable of representing the same elements using inline display mode.

        This function is a noop if the attachment elements are disabled via runtime-enabled features.

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::replaceRichContentWithAttachmentsIfNecessary):
        (WebCore::createFragmentAndAddResources):
        (WebCore::sanitizeMarkupWithArchive):

        Add out-params to both of these helper functions that capture the map of blob URLs to Blobs being used to
        replace subresource URLs in the pasted/dropped DOM fragment.

        (WebCore::WebContentReader::readWebArchive):
        (WebCore::WebContentMarkupReader::readWebArchive):
        (WebCore::createFragmentFromAttributedString):
        (WebCore::WebContentReader::readRTFD):
        (WebCore::WebContentMarkupReader::readRTFD):
        (WebCore::WebContentReader::readRTF):
        (WebCore::WebContentMarkupReader::readRTF):
        (WebCore::WebContentReader::readImage):

        In these places where we swap out subresource URLs for blob URLs, collect a map of blob URL => Blob, and use it
        to replace images in the DOM with attachments (if needed, and possible).

        * editing/mac/WebContentReaderMac.mm:
        (WebCore::WebContentReader::readFilenames):

        Augment existing logic to generate attachment elements when pasting or dropping file URLs, so that the generated
        attachment elements also have titles, subtitles, and content type information.

        * html/HTMLAttachmentElement.cpp:
        (WebCore::HTMLAttachmentElement::setFile):

        Add an optional second param, UpdateDisplayAttributes. If UpdateDisplayAttributes::Yes is passed in, then we set
        the elements's attributes that are displayed in the attachment representation (title, subtitle, and type) using
        the given File.

        (WebCore::HTMLAttachmentElement::updateFileWithData):
        (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):

        Make a small tweak to correctly handle the case where an attachment with a content type that is a UTI is being
        displayed inline. Content type can either be a UTI or a MIME type, but the code to construct the shadow tree of
        an attachment element only handles MIME types.

        * html/HTMLAttachmentElement.h:

2017-12-18  Youenn Fablet  <youenn@apple.com>

        SameOrigin and CORS fetch should fail on opaque responses served from ServiceWorker
        https://bugs.webkit.org/show_bug.cgi?id=180941

        Reviewed by Chris Dumez.

        Covered by rebased tests.

        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):

2017-12-18  Dean Jackson  <dino@apple.com>

        Make some functions in GraphicsContextCG use call_once for statics
        https://bugs.webkit.org/show_bug.cgi?id=180841
        <rdar://problem/36058448>

        Reviewed by Antoine Quint.

        In preparation for making OffscreenCanvas operate inside a Worker,
        make sure GraphicsContext is thread safe. Change some functions
        that use a static to call_once.

        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::sRGBColorSpaceRef):
        (WebCore::linearRGBColorSpaceRef):
        (WebCore::extendedSRGBColorSpaceRef):
        (WebCore::displayP3ColorSpaceRef):

2017-12-18  Chris Dumez  <cdumez@apple.com>

        ExtendableMessageEvent.data should return the value it was initialized to
        https://bugs.webkit.org/show_bug.cgi?id=180868

        Reviewed by Geoffrey Garen.

        No new tests, rebaselined existing test.

        * bindings/js/JSExtendableMessageEventCustom.cpp:
        (WebCore::constructJSExtendableMessageEvent):
        * workers/service/ExtendableMessageEvent.cpp:
        (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
        * workers/service/ExtendableMessageEvent.idl:

2017-12-18  Megan Gardner  <megan_gardner@apple.com>

        Support Autoscrolling in contenteditable for WK2
        https://bugs.webkit.org/show_bug.cgi?id=180789

        Reviewed by Simon Frasier and Wenson Hsieh..

        Activate the autoscrollController to scroll to the position provided to us by the
        UIProcess. Allows for scrolling in contentEditable for WebKit2

        Test: fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html

        * page/AutoscrollController.cpp:
        (WebCore::AutoscrollController::autoscrollTimerFired):
        * page/EventHandler.cpp:
        (WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded):
        (WebCore::EventHandler::targetPositionForSelectionAutoscroll const):
        (WebCore::EventHandler::shouldUpdateAutoscroll):
        (WebCore::EventHandler::effectiveMousePositionForSelectionAutoscroll const): Deleted.
        * page/EventHandler.h:
        * page/ios/EventHandlerIOS.mm:
        (WebCore::EventHandler::startTextAutoscroll):
        (WebCore::EventHandler::cancelTextAutoscroll):
        (WebCore::EventHandler::targetPositionForSelectionAutoscroll const):
        (WebCore::EventHandler::shouldUpdateAutoscroll):
        * page/mac/EventHandlerMac.mm:
        (WebCore::EventHandler::targetPositionForSelectionAutoscroll const):
        (WebCore::EventHandler::effectiveMousePositionForSelectionAutoscroll const): Deleted.

2017-12-18  Youenn Fablet  <youenn@apple.com>

        Add support for response blob given to fetch events
        https://bugs.webkit.org/show_bug.cgi?id=180894

        Reviewed by Darin Adler.

        Covered by updated test expectations.

        Adding support for getting a blob URL from a FormData that only contains one blob.
        Adding support to create a FetcLoader from a ServiceWorkerThreadProxy

        * Modules/fetch/FetchLoader.cpp:
        (WebCore::FetchLoader::start):
        (WebCore::FetchLoader::startLoadingBlobURL):
        * Modules/fetch/FetchLoader.h:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/network/FormData.cpp:
        (WebCore::FormData::asBlobURL const):
        * platform/network/FormData.h:
        * workers/service/context/ServiceWorkerThreadProxy.cpp:
        (WebCore::ServiceWorkerThreadProxy::createBlobLoader):
        * workers/service/context/ServiceWorkerThreadProxy.h:

2017-12-18  Zalan Bujtas  <zalan@apple.com>

        [SVG] Detach list wrappers before resetting the base value.
        https://bugs.webkit.org/show_bug.cgi?id=180912
        <rdar://problem/36017970>

        Reviewed by Simon Fraser.

        Before resetting the animation value (and destroying the assigned SVG object -SVGLengthValue in this case),
        we need to check if there's an associated tear off wrapper for the said SVG object and make a copy of it.
        This is currently done in the wrong order through animValDidChange.

        Test: svg/animations/crash-when-animation-is-running-while-getting-value.html

        * svg/SVGAnimatedTypeAnimator.h:
        (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValue):
        * svg/properties/SVGAnimatedPropertyTearOff.h:
        * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
        (WebCore::SVGAnimatedStaticPropertyTearOff::synchronizeWrappersIfNeeded):

2017-12-18  Brady Eidson  <beidson@apple.com>

        REGRESSION: ASSERTION FAILED: !m_importCompleted
        https://bugs.webkit.org/show_bug.cgi?id=180935

        Unreviewed bot gardening.

        No new tests (Covered by existing tests)

        The ASSERT was invalid for database pushes failing to open databases like this, so skip it for that scenario.

        * workers/service/server/RegistrationStore.cpp:
        (WebCore::RegistrationStore::databaseFailedToOpen):
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::registrationStoreDatabaseFailedToOpen):
        * workers/service/server/SWServer.h:

2017-12-18  Jer Noble  <jer.noble@apple.com>

        Playing media elements which call "pause(); play()" will have the play promise rejected.
        https://bugs.webkit.org/show_bug.cgi?id=180781

        Reviewed by Eric Carlson.

        Test: media/video-pause-play-resolve.html

        When scheduling a rejection or resolution of existing play promises, move() the existing
        promises into the block. This ensures that valid promises aren't added to the play promise
        vector between when a rejection is scheduled and when it runs.

        Drive-by fix: Don't return false from playInternal() just so the newly created promise will
        get rejected. The pause() command will reject the promise, so just make sure it's added to
        the m_pendingPlayPromises before calling playInternal().

        Drive-by fix #2: The spec referenced by playInternal() and pauseInternal() doesn't say to
        call the "Media Element Load Algorithm" (i.e., prepareForLoad()); it says to call the
        "Resource Selection Algorithm" (i.e., selectMediaResource()). But fixing this bug caused
        an assertion crash when the resource selection task was fired and m_player was null. This
        was because the algorithm is being run at stop() time due to stop() calling pause(). The
        solution to this ASSERT is to stop the m_resourceSelectionTaskQueue in stop().

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::scheduleRejectPendingPlayPromises):
        (WebCore::HTMLMediaElement::rejectPendingPlayPromises):
        (WebCore::HTMLMediaElement::resolvePendingPlayPromises):
        (WebCore::HTMLMediaElement::scheduleNotifyAboutPlaying):
        (WebCore::HTMLMediaElement::notifyAboutPlaying):
        (WebCore::HTMLMediaElement::noneSupported):
        (WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
        (WebCore::HTMLMediaElement::play):
        (WebCore::HTMLMediaElement::playInternal):
        (WebCore::HTMLMediaElement::pauseInternal):
        (WebCore::HTMLMediaElement::stop):
        * html/HTMLMediaElement.h:

2017-12-18  Daniel Bates  <dabates@apple.com>

        Add SPI to query for the current and last auto fill button type and pass user data object to _webView:focusShouldStartInputSession:
        https://bugs.webkit.org/show_bug.cgi?id=180774
        <rdar://problem/36033832>

        Reviewed by Tim Horton.

        Expose a way for an embedding client to query for the auto fill button type of a specific
        input element as it may not be feasible for a client to track such state themselves. For
        similar reasons track and expose SPI to query for the last auto fill button type for a
        specific field.

        Test: fast/forms/auto-fill-button/last-auto-fill-button-type.html

        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::HTMLInputElement):
        (WebCore::HTMLInputElement::setShowAutoFillButton):
        Update the last auto fill button type.

        * html/HTMLInputElement.h:
        (WebCore::HTMLInputElement::lastAutoFillButtonType const): Added.

        * testing/Internals.cpp:
        (WebCore::toAutoFillButtonType):
        (WebCore::toInternalsAutoFillButtonType):
        (WebCore::Internals::autoFillButtonType):
        (WebCore::Internals::lastAutoFillButtonType):
        * testing/Internals.h:
        * testing/Internals.idl:
        Add functions for testing.

2017-12-17  John Wilander  <wilander@apple.com>

        Storage Access API: Make document.hasStorageAccess() retrieve current status from the network process
        https://bugs.webkit.org/show_bug.cgi?id=180681
        <rdar://problem/35982161>

        Reviewed by Alex Christensen.

        Tests: http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-non-recent-user-interaction.html
               http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-recent-user-interaction.html

        This change makes an asynchronous request to the network process
        to see if storage access has been granted for this frame, on this
        page, for this domain.

        * dom/Document.cpp:
        (WebCore::Document::hasStorageAccess):
        * page/ChromeClient.h:

2017-12-17  Chris Dumez  <cdumez@apple.com>

        Strip fragment identifier from ServiceWorker's scriptURL
        https://bugs.webkit.org/show_bug.cgi?id=180887

        Reviewed by Darin Adler.

        Strip fragment identifier from ServiceWorker's scriptURL to match Firefox and Chrome.
        This behavior does not appear to be specified so I filed:
        - https://github.com/w3c/ServiceWorker/issues/1249

        No new tests, rebaselined existing test.

        * workers/service/server/SWServerWorker.cpp:
        (WebCore::m_script):

2017-12-17  Antti Koivisto  <antti@apple.com>

        Move render tree updating related files under rendering/updating/
        https://bugs.webkit.org/show_bug.cgi?id=180918

        Reviewed by Darin Adler.

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * rendering/RenderTreeBuilder.cpp: Removed.
        * rendering/RenderTreeBuilder.h: Removed.
        * rendering/updating: Added.
        * rendering/updating/RenderTreeBuilder.cpp: Copied from Source/WebCore/rendering/RenderTreeBuilder.cpp.
        * rendering/updating/RenderTreeBuilder.h: Copied from Source/WebCore/rendering/RenderTreeBuilder.h.
        * rendering/updating/RenderTreePosition.cpp: Copied from Source/WebCore/style/RenderTreePosition.cpp.
        * rendering/updating/RenderTreePosition.h: Copied from Source/WebCore/style/RenderTreePosition.h.
        * rendering/updating/RenderTreeUpdater.cpp: Copied from Source/WebCore/style/RenderTreeUpdater.cpp.
        * rendering/updating/RenderTreeUpdater.h: Copied from Source/WebCore/style/RenderTreeUpdater.h.
        * rendering/updating/RenderTreeUpdaterFirstLetter.cpp: Copied from Source/WebCore/style/RenderTreeUpdaterFirstLetter.cpp.
        * rendering/updating/RenderTreeUpdaterFirstLetter.h: Copied from Source/WebCore/style/RenderTreeUpdaterFirstLetter.h.
        * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp: Copied from Source/WebCore/style/RenderTreeUpdaterGeneratedContent.cpp.
        * rendering/updating/RenderTreeUpdaterGeneratedContent.h: Copied from Source/WebCore/style/RenderTreeUpdaterGeneratedContent.h.
        * rendering/updating/RenderTreeUpdaterListItem.cpp: Copied from Source/WebCore/style/RenderTreeUpdaterListItem.cpp.
        * rendering/updating/RenderTreeUpdaterListItem.h: Copied from Source/WebCore/style/RenderTreeUpdaterListItem.h.
        * rendering/updating/RenderTreeUpdaterMultiColumn.cpp: Copied from Source/WebCore/style/RenderTreeUpdaterMultiColumn.cpp.
        * rendering/updating/RenderTreeUpdaterMultiColumn.h: Copied from Source/WebCore/style/RenderTreeUpdaterMultiColumn.h.
        * style/RenderTreePosition.cpp: Removed.
        * style/RenderTreePosition.h: Removed.
        * style/RenderTreeUpdater.cpp: Removed.
        * style/RenderTreeUpdater.h: Removed.
        * style/RenderTreeUpdaterFirstLetter.cpp: Removed.
        * style/RenderTreeUpdaterFirstLetter.h: Removed.
        * style/RenderTreeUpdaterGeneratedContent.cpp: Removed.
        * style/RenderTreeUpdaterGeneratedContent.h: Removed.
        * style/RenderTreeUpdaterListItem.cpp: Removed.
        * style/RenderTreeUpdaterListItem.h: Removed.
        * style/RenderTreeUpdaterMultiColumn.cpp: Removed.
        * style/RenderTreeUpdaterMultiColumn.h: Removed.

2017-12-17  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC][WebCore][CSSJIT] Remove VM reference in CSSJIT
        https://bugs.webkit.org/show_bug.cgi?id=180917

        Reviewed by Sam Weinig.

        Remove VM reference in CSSJIT. CSSJIT should not be
        bound to a specific VM.

        No behavior change.

        * css/ElementRuleCollector.cpp:
        (WebCore::ElementRuleCollector::ruleMatches):
        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::compileSelector):
        * cssjit/SelectorCompiler.h:
        * dom/SelectorQuery.cpp:
        (WebCore::SelectorDataList::compileSelector):
        (WebCore::SelectorDataList::execute const):
        * dom/SelectorQuery.h:

2017-12-16  Dan Bernstein  <mitz@apple.com>

        WKWebView has no equivalent of -[WebView setAlwaysShowVerticalScroller:]
        https://bugs.webkit.org/show_bug.cgi?id=180613
        <rdar://problem/35946124>

        Reviewed by Geoff Garen.

        Test: TestWebKitAPI/Tests/WebKitCocoa/WKWebViewAlwaysShowsScroller.mm

        * platform/ScrollView.h: Exported setScrollbarModes.

2017-12-16  Antti Koivisto  <antti@apple.com>

        Introduce RenderTreeBuilder
        https://bugs.webkit.org/show_bug.cgi?id=180817

        Reviewed by Zalan Bujtas.

        RenderTreeBuilder is responsible of building the render tree, including construction of various anonymous
        renderers. Renderer subtype specific render tree construction code will eventually move there.

        This patch adds RenderTreeBuilder class and passes it as a parameter for all addChild implementations.
        Future patches can then mechanically move the building code from renderers to RenderTreeBuilder.

        It also moves one addChild implementation (RenderRuby::addChild -> RenderTreeBuilder::rubyRunInsertChild)
        to RenderTreeBuilder as a test.

        * WebCore.xcodeproj/project.pbxproj:
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::addChildToContinuation):
        (WebCore::RenderBlock::addChild):
        (WebCore::RenderBlock::addChildIgnoringContinuation):
        * rendering/RenderBlock.h:
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::addChild):
        * rendering/RenderBlockFlow.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::moveChildTo):
        * rendering/RenderButton.cpp:
        (WebCore::RenderButton::addChild):
        (WebCore::RenderButton::setText):
        * rendering/RenderButton.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::addChild):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::addChildIgnoringContinuation):
        * rendering/RenderFullScreen.cpp:
        (WebCore::RenderFullScreen::wrapNewRenderer):
        (WebCore::RenderFullScreen::wrapExistingRenderer):
        (WebCore::RenderFullScreen::unwrapRenderer):
        (WebCore::RenderFullScreen::createPlaceholder):
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::addChild):
        * rendering/RenderGrid.h:
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::addChild):
        (WebCore::RenderInline::addChildIgnoringContinuation):
        (WebCore::RenderInline::splitInlines):
        (WebCore::RenderInline::splitFlow):
        (WebCore::RenderInline::addChildToContinuation):
        (WebCore::RenderInline::childBecameNonInline):
        * rendering/RenderInline.h:
        * rendering/RenderMenuList.cpp:
        (WebCore::RenderMenuList::createInnerBlock):
        (RenderMenuList::addChild):
        (RenderMenuList::setText):
        * rendering/RenderMenuList.h:
        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
        * rendering/RenderQuote.cpp:
        (WebCore::RenderQuote::updateTextRenderer):
        (WebCore::RenderQuote::updateRenderer):
        * rendering/RenderQuote.h:
        * rendering/RenderRuby.cpp:
        (WebCore::RenderRubyAsInline::addChild):
        (WebCore::RenderRubyAsBlock::addChild):
        * rendering/RenderRuby.h:
        * rendering/RenderRubyBase.h:
        * rendering/RenderRubyRun.cpp:
        (WebCore::RenderRubyRun::rubyBaseSafe):
        (WebCore::RenderRubyRun::addChild): Deleted.
        * rendering/RenderRubyRun.h:
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::addChild):
        * rendering/RenderTable.h:
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::addChild):
        * rendering/RenderTableRow.h:
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::addChild):
        * rendering/RenderTableSection.h:
        * rendering/RenderTreeBuilder.cpp: Added.
        (WebCore::RenderTreeBuilder::RenderTreeBuilder):
        (WebCore::RenderTreeBuilder::~RenderTreeBuilder):
        (WebCore::RenderTreeBuilder::insertChild):
        (WebCore::RenderTreeBuilder::rubyRunInsertChild):
        * rendering/RenderTreeBuilder.h: Added.
        (WebCore::RenderTreeBuilder::current):
        * rendering/TextAutoSizing.cpp:
        (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
        * rendering/mathml/RenderMathMLFenced.cpp:
        (WebCore::RenderMathMLFenced::updateFromElement):
        (WebCore::RenderMathMLFenced::makeFences):
        (WebCore::RenderMathMLFenced::addChild):
        * rendering/mathml/RenderMathMLFenced.h:
        * rendering/svg/RenderSVGContainer.cpp:
        (WebCore::RenderSVGContainer::addChild):
        * rendering/svg/RenderSVGContainer.h:
        * rendering/svg/RenderSVGInline.cpp:
        (WebCore::RenderSVGInline::addChild):
        * rendering/svg/RenderSVGInline.h:
        * rendering/svg/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::addChild):
        * rendering/svg/RenderSVGRoot.h:
        * rendering/svg/RenderSVGText.cpp:
        (WebCore::RenderSVGText::addChild):
        * rendering/svg/RenderSVGText.h:
        * style/RenderTreePosition.cpp:
        (WebCore::RenderTreePosition::insert): Deleted.
        * style/RenderTreePosition.h:
        (WebCore::RenderTreePosition::RenderTreePosition):
        (WebCore::RenderTreePosition::nextSibling const):
        (WebCore::RenderTreePosition::canInsert const): Deleted.
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateAfterDescendants):
        (WebCore::RenderTreeUpdater::createRenderer):
        (WebCore::RenderTreeUpdater::createTextRenderer):
        (WebCore::RenderTreeUpdater::updateTextRenderer):
        (WebCore::createTextRenderer): Deleted.
        * style/RenderTreeUpdater.h:
        * style/RenderTreeUpdaterFirstLetter.cpp:
        (WebCore::updateFirstLetterStyle):
        (WebCore::createFirstLetterRenderer):
        * style/RenderTreeUpdaterGeneratedContent.cpp:
        (WebCore::RenderTreeUpdater::GeneratedContent::updateQuotesUpTo):
        (WebCore::createContentRenderers):
        (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
        * style/RenderTreeUpdaterListItem.cpp:
        (WebCore::RenderTreeUpdater::ListItem::updateMarker):
        * style/RenderTreeUpdaterListItem.h:
        * style/RenderTreeUpdaterMultiColumn.cpp:
        (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
        (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):

2017-12-16  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Fix filling of descriptor from queue
        https://bugs.webkit.org/show_bug.cgi?id=172717

        Reviewed by Youenn Fablet.

        Fixed the filling of descriptor from queue (step 10.d at [1]). When first implemented,
        spec comprised a bug and code was not reachable. Spec has now been fixed and code can
        now be reached.

        [1] https://streams.spec.whatwg.org/#readable-byte-stream-controller-fill-pull-into-descriptor-from-queue

        No new tests (covered by WPT tests, whose expectations have been updated).

        * Modules/streams/ReadableByteStreamInternals.js:
        (readableByteStreamControllerFillDescriptorFromQueue): Updated.

2017-12-16  Brady Eidson  <beidson@apple.com>

        Implement getting ServiceWorker registrations for the WKWebsiteDataStore API
        https://bugs.webkit.org/show_bug.cgi?id=180886

        Reviewed by Chris Dumez.

        No new tests (API test coming soon).

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::registrationStoreImportComplete):
        (WebCore::SWServer::SWServer):
        (WebCore::SWServer::getOriginsWithRegistrations):
        (WebCore::SWServer::performGetOriginsWithRegistrationsCallbacks):
        * workers/service/server/SWServer.h:

2017-12-16  Yusuke Suzuki  <utatane.tea@gmail.com>

        Remove unnecessary boolean result of start() functions
        https://bugs.webkit.org/show_bug.cgi?id=180856

        Reviewed by Darin Adler.

        No behavior change.

        * Modules/webaudio/AsyncAudioDecoder.cpp:
        (WebCore::AsyncAudioDecoder::~AsyncAudioDecoder):
        * Modules/webdatabase/DatabaseContext.cpp:
        (WebCore::DatabaseContext::databaseThread):
        * Modules/webdatabase/DatabaseThread.cpp:
        (WebCore::DatabaseThread::start):
        Now `Thread::create` always succeeds (if it fails, WebKit crashes).
        DatabaseThread::start() now always returns true. So, we do not need
        to return bool.

        * Modules/webdatabase/DatabaseThread.h:
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::start):
        * platform/network/curl/CurlDownload.h:
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::start):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::start):
        * platform/network/curl/ResourceHandleCurlDelegate.h:

2017-12-16  Chris Dumez  <cdumez@apple.com>

        Add optimization when updating a SW registration results in the exact same script
        https://bugs.webkit.org/show_bug.cgi?id=180891

        Reviewed by Geoffrey Garen.

        Add optimization when updating a SW registration results in the exact same script:
        - https://w3c.github.io/ServiceWorker/#update-algorithm (step 8)

        No new tests, rebaselined existing test.

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

2017-12-16  Youenn Fablet  <youenn@apple.com>

        Service worker script fetch request should set the Service-Worker header
        https://bugs.webkit.org/show_bug.cgi?id=180889

        Reviewed by Chris Dumez.

        Test: http/wpt/service-workers/check-service-worker-header.https.html

        Update WorkerScriptLoader to take a request instead of an URL.
        Updates Worker implementation and use it in ServiceWorkerJob to set the missing request header.

        * workers/Worker.cpp:
        (WebCore::Worker::create):
        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::loadAsynchronously):
        * workers/WorkerScriptLoader.h:
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::fetchScriptWithContext):

2017-12-15  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r225969.

        This change introduced LayoutTest crashes.

        Reverted changeset:

        "Introduce RenderTreeBuilder"
        https://bugs.webkit.org/show_bug.cgi?id=180817
        https://trac.webkit.org/changeset/225969

2017-12-15  Chris Dumez  <cdumez@apple.com>

        Support updating a service worker registration's updateViaCache flag
        https://bugs.webkit.org/show_bug.cgi?id=180888

        Reviewed by Brady Eidson.

        Support updating a service worker registration's updateViaCache flag to match other browsers:
        - https://github.com/w3c/ServiceWorker/issues/1189

        No new tests, rebaselined existing test.

        * workers/service/SWClientConnection.cpp:
        (WebCore::SWClientConnection::setRegistrationUpdateViaCache):
        * workers/service/SWClientConnection.h:
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::setUpdateViaCache):
        * workers/service/ServiceWorkerRegistration.h:
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::runRegisterJob):
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::setUpdateViaCache):
        * workers/service/server/SWServerRegistration.h:

2017-12-15  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r225941.

        This change introduced LayoutTest crashes and assertion
        failures.

        Reverted changeset:

        "Web Inspector: replace HTMLCanvasElement with
        CanvasRenderingContext for instrumentation logic"
        https://bugs.webkit.org/show_bug.cgi?id=180770
        https://trac.webkit.org/changeset/225941

2017-12-15  Ryosuke Niwa  <rniwa@webkit.org>

        Add a release assert that Timer::m_wasDeleted is false in setNextFireTime
        https://bugs.webkit.org/show_bug.cgi?id=180860
        <rdar://problem/36066500>

        Reviewed by David Kilzer.

        Turn an exist debug-only assertion into a release assertion to help diagnose a crash
        which appears to be caused by a freed timer getting scheduled back into the timer heap.

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

2017-12-15  Simon Fraser  <simon.fraser@apple.com>

        Elements animated on-screen are missing sometimes
        https://bugs.webkit.org/show_bug.cgi?id=180773
        rdar://problem/34923438

        Reviewed by Zalan Bujtas.
        
        After r225310 it was still possible for elements to be missing backing store when brought
        on-screen via an animation. This occurred if a child element was outside the bounds of the
        element being animated.

        Fix by making sure that GraphicsLayer's "animatedExtent" took composited child layers into account.

        As for r225310, no test because this is timing sensitive and hard to reliably make a test for.

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/RenderLayer.h:
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateGeometry):

2017-12-15  Chris Dumez  <cdumez@apple.com>

        imported/w3c/web-platform-tests/service-workers/service-worker/update.https.html is sometimes crashing in Debug builds
        https://bugs.webkit.org/show_bug.cgi?id=180867

        Reviewed by Brady Eidson.

        Fix assertion to make sure the worker is terminating if it is already in m_runningOrTerminatingWorkers.

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

2017-12-15  Chris Dumez  <cdumez@apple.com>

        Service Worker Registration promise is sometimes not rejected when the script load fails
        https://bugs.webkit.org/show_bug.cgi?id=180849

        Reviewed by Brady Eidson.

        Service Worker Registration promise is sometimes not rejected when the script load fails.
        This was caused by the ServiceWorkerJob sometimes passing a null ResourceError to the
        StorageProcess, even though the load failed.

        No new tests, rebaselined exisiting tests.

        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::notifyError):
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::notifyFinished):

2017-12-15  Youenn Fablet  <youenn@apple.com>

        WebRTC Stats should not be console logged from a background thread
        https://bugs.webkit.org/show_bug.cgi?id=180845

        Reviewed by Eric Carlson.

        Ensuring console log are done in the main thread.

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

2017-12-15  Antti Koivisto  <antti@apple.com>

        Introduce RenderTreeBuilder
        https://bugs.webkit.org/show_bug.cgi?id=180817

        Reviewed by Zalan Bujtas.

        RenderTreeBuilder is responsible of building the render tree, including construction of various anonymous
        renderers. Renderer subtype specific render tree construction code will eventually move there.

        This patch adds RenderTreeBuilder class and passes it as a parameter for all addChild implementations.
        Future patches can then mechanically move the building code from renderers to RenderTreeBuilder.

        It also moves one addChild implementation (RenderRuby::addChild -> RenderTreeBuilder::rubyRunInsertChild)
        to RenderTreeBuilder as a test.

        * WebCore.xcodeproj/project.pbxproj:
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::addChildToContinuation):
        (WebCore::RenderBlock::addChild):
        (WebCore::RenderBlock::addChildIgnoringContinuation):
        * rendering/RenderBlock.h:
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::addChild):
        * rendering/RenderBlockFlow.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::moveChildTo):
        * rendering/RenderButton.cpp:
        (WebCore::RenderButton::addChild):
        (WebCore::RenderButton::setText):
        * rendering/RenderButton.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::addChild):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::addChildIgnoringContinuation):
        * rendering/RenderFullScreen.cpp:
        (WebCore::RenderFullScreen::wrapNewRenderer):
        (WebCore::RenderFullScreen::wrapExistingRenderer):
        (WebCore::RenderFullScreen::unwrapRenderer):
        (WebCore::RenderFullScreen::createPlaceholder):
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::addChild):
        * rendering/RenderGrid.h:
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::addChild):
        (WebCore::RenderInline::addChildIgnoringContinuation):
        (WebCore::RenderInline::splitInlines):
        (WebCore::RenderInline::splitFlow):
        (WebCore::RenderInline::addChildToContinuation):
        (WebCore::RenderInline::childBecameNonInline):
        * rendering/RenderInline.h:
        * rendering/RenderMenuList.cpp:
        (WebCore::RenderMenuList::createInnerBlock):
        (RenderMenuList::addChild):
        (RenderMenuList::setText):
        * rendering/RenderMenuList.h:
        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
        * rendering/RenderQuote.cpp:
        (WebCore::RenderQuote::updateTextRenderer):
        (WebCore::RenderQuote::updateRenderer):
        * rendering/RenderQuote.h:
        * rendering/RenderRuby.cpp:
        (WebCore::RenderRubyAsInline::addChild):
        (WebCore::RenderRubyAsBlock::addChild):
        * rendering/RenderRuby.h:
        * rendering/RenderRubyBase.h:
        * rendering/RenderRubyRun.cpp:
        (WebCore::RenderRubyRun::rubyBaseSafe):
        (WebCore::RenderRubyRun::addChild): Deleted.
        * rendering/RenderRubyRun.h:
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::addChild):
        * rendering/RenderTable.h:
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::addChild):
        * rendering/RenderTableRow.h:
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::addChild):
        * rendering/RenderTableSection.h:
        * rendering/RenderTreeBuilder.cpp: Added.
        (WebCore::RenderTreeBuilder::RenderTreeBuilder):
        (WebCore::RenderTreeBuilder::~RenderTreeBuilder):
        (WebCore::RenderTreeBuilder::insertChild):
        (WebCore::RenderTreeBuilder::rubyRunInsertChild):
        * rendering/RenderTreeBuilder.h: Added.
        (WebCore::RenderTreeBuilder::current):
        * rendering/TextAutoSizing.cpp:
        (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
        * rendering/mathml/RenderMathMLFenced.cpp:
        (WebCore::RenderMathMLFenced::updateFromElement):
        (WebCore::RenderMathMLFenced::makeFences):
        (WebCore::RenderMathMLFenced::addChild):
        * rendering/mathml/RenderMathMLFenced.h:
        * rendering/svg/RenderSVGContainer.cpp:
        (WebCore::RenderSVGContainer::addChild):
        * rendering/svg/RenderSVGContainer.h:
        * rendering/svg/RenderSVGInline.cpp:
        (WebCore::RenderSVGInline::addChild):
        * rendering/svg/RenderSVGInline.h:
        * rendering/svg/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::addChild):
        * rendering/svg/RenderSVGRoot.h:
        * rendering/svg/RenderSVGText.cpp:
        (WebCore::RenderSVGText::addChild):
        * rendering/svg/RenderSVGText.h:
        * style/RenderTreePosition.cpp:
        (WebCore::RenderTreePosition::insert): Deleted.
        * style/RenderTreePosition.h:
        (WebCore::RenderTreePosition::RenderTreePosition):
        (WebCore::RenderTreePosition::nextSibling const):
        (WebCore::RenderTreePosition::canInsert const): Deleted.
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateAfterDescendants):
        (WebCore::RenderTreeUpdater::createRenderer):
        (WebCore::RenderTreeUpdater::createTextRenderer):
        (WebCore::RenderTreeUpdater::updateTextRenderer):
        (WebCore::createTextRenderer): Deleted.
        * style/RenderTreeUpdater.h:
        * style/RenderTreeUpdaterFirstLetter.cpp:
        (WebCore::updateFirstLetterStyle):
        (WebCore::createFirstLetterRenderer):
        * style/RenderTreeUpdaterGeneratedContent.cpp:
        (WebCore::RenderTreeUpdater::GeneratedContent::updateQuotesUpTo):
        (WebCore::createContentRenderers):
        (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
        * style/RenderTreeUpdaterListItem.cpp:
        (WebCore::RenderTreeUpdater::ListItem::updateMarker):
        * style/RenderTreeUpdaterListItem.h:
        * style/RenderTreeUpdaterMultiColumn.cpp:
        (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
        (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):

2017-12-14  Youenn Fablet  <youenn@apple.com>

        Implement <iframe allow="camera; microphone">
        https://bugs.webkit.org/show_bug.cgi?id=167430

        Reviewed by Eric Carlson.

        Tests: imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-default-feature-policy.https.sub.html

        Adding allow attribute to HTMLIFrameElement as per https://wicg.github.io/feature-policy/#iframe-allow-attribute.
        Cross-origin iframes will get access to camera/microphone based on this attribute value.
        Same-origin iframes do not need any attribute.
        In case getUserMedia requests both camera and microphone, and allow attribute is only one of these,
        getUserMedia access is denied. This goes against the tests but is not very clear from the specification.

        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::isSecure):
        (WebCore::isAllowedToUse):
        (WebCore::canCallGetUserMedia):
        (WebCore::UserMediaRequest::start):
        * html/HTMLAttributeNames.in:
        * html/HTMLIFrameElement.cpp:
        (WebCore::HTMLIFrameElement::parseAttribute):
        * html/HTMLIFrameElement.h:
        * html/HTMLIFrameElement.idl:

2017-12-14  Zalan Bujtas  <zalan@apple.com>

        Inconsistent section grid could lead to CrashOnOverflow
        https://bugs.webkit.org/show_bug.cgi?id=180850
        <rdar://problem/34064811>

        Reviewed by Simon Fraser.

        Each RenderTableSection maintains a grid of rows and columns. The number of columns in this grid equals the
        maximum number of columns in the entire table (taking spans and multiple sections into account).
        Since the maximum number of columns might change while re-computing the sections, we need to
        adjust them accordingly at the end (otherwise it could lead to inconsistent grids where rows have different number of columns).

        Test: fast/table/table-row-oveflow-crash.html

        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::recalcSections const):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::removeRedundantColumns):
        * rendering/RenderTableSection.h:

2017-12-14  David Kilzer  <ddkilzer@apple.com>

        Enable -Wstrict-prototypes for WebKit
        <https://webkit.org/b/180757>
        <rdar://problem/36024132>

        Rubber-stamped by Joseph Pecoraro.

        * Configurations/Base.xcconfig:
        (CLANG_WARN_STRICT_PROTOTYPES): Add. Set to YES.

2017-12-14  Youenn Fablet  <youenn@apple.com>

        srflx and relay ICE candidates lack raddr (rel-addr) and rport (rel-port) attributes if getUserMedia access has not been granted
        https://bugs.webkit.org/show_bug.cgi?id=180842

        Reviewed by Jon Lee.

        Manually tested since there is no way to gather reflexive or stun candidates in WebKit CI.

        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::filterICECandidate):

2017-12-14  Commit Queue  <commit-queue@webkit.org>

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

        Introduced a crash in HTMLPictureElement. We're taking a
        different approach for webkit.org/b/180769 (Requested by rniwa
        on #webkit).

        Reverted changeset:

        "Crash inside ImageLoader::updateFromElement()"
        https://bugs.webkit.org/show_bug.cgi?id=180769
        https://trac.webkit.org/changeset/225878

2017-12-14  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r225931.

        Breaks internal builds.

        Reverted changeset:

        "Fix Mac CMake build"
        https://bugs.webkit.org/show_bug.cgi?id=180835
        https://trac.webkit.org/changeset/225931

2017-12-14  Simon Fraser  <simon.fraser@apple.com>

        Another Windows build fix.

        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::extendedSRGBColorSpaceRef):

2017-12-14  Simon Fraser  <simon.fraser@apple.com>

        Fix Windows build after r225915.

        Windows doens't have dispatch_once with blocks. Switch to use lambda functions instead.

        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::sRGBColorSpaceRef):
        (WebCore::linearRGBColorSpaceRef):
        (WebCore::extendedSRGBColorSpaceRef):
        (WebCore::displayP3ColorSpaceRef):

2017-12-14  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: replace HTMLCanvasElement with CanvasRenderingContext for instrumentation logic
        https://bugs.webkit.org/show_bug.cgi?id=180770

        Reviewed by Joseph Pecoraro.

        No change in functionality.

        * html/canvas/CanvasRenderingContext.h:
        * html/canvas/CanvasRenderingContext.cpp:
        (WebCore::CanvasRenderingContext::~CanvasRenderingContext):
        Instead of waiting on the HTMLCanvasElement to destruct to call willDestroyCanvasRenderingContext
        we can call out in the destructor and know that the CanvasRenderingContext will be destroyed
        immediately thereafter.

        * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::create):
        * html/canvas/ImageBitmapRenderingContext.h:
        * html/canvas/ImageBitmapRenderingContext.cpp:
        (WebCore::ImageBitmapRenderingContext::create):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::create):
        * html/canvas/WebGLRenderingContext.h:
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::create):
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::create):
        * html/canvas/WebGPURenderingContext.cpp:
        (WebCore::WebGPURenderingContext::create):
        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::createContext2d):
        (WebCore::HTMLCanvasElement::createContextWebGL):
        (WebCore::HTMLCanvasElement::createContextWebGPU):
        (WebCore::HTMLCanvasElement::createContextBitmapRenderer):
        (WebCore::HTMLCanvasElement::paint):
        (WebCore::HTMLCanvasElement::setImageBuffer const):
        Instead of adding didCreateCanvasRenderingContext calls at the construction sites of each
        context, we can make the constructors private and force the usage of static `create` functions.
        This way, we have access to the fully constructed object and have a guaranteed path for creation.

        * inspector/InspectorCanvas.h:
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::create):
        (WebCore::InspectorCanvas::InspectorCanvas):
        (WebCore::InspectorCanvas::canvasElement):
        (WebCore::InspectorCanvas::resetRecordingData):
        (WebCore::InspectorCanvas::recordAction):
        (WebCore::InspectorCanvas::buildObjectForCanvas):
        (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
        (WebCore::InspectorCanvas::buildInitialState):
        
        * inspector/InspectorShaderProgram.h:
        * inspector/InspectorShaderProgram.cpp:
        (WebCore::InspectorShaderProgram::context const):

        * inspector/agents/InspectorCanvasAgent.h:
        * inspector/agents/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
        (WebCore::InspectorCanvasAgent::enable):
        (WebCore::InspectorCanvasAgent::disable):
        (WebCore::InspectorCanvasAgent::requestNode):
        (WebCore::InspectorCanvasAgent::requestContent):
        (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
        (WebCore::contextAsScriptValue):
        (WebCore::InspectorCanvasAgent::resolveCanvasContext):
        (WebCore::InspectorCanvasAgent::startRecording):
        (WebCore::InspectorCanvasAgent::stopRecording):
        (WebCore::InspectorCanvasAgent::updateShader):
        (WebCore::InspectorCanvasAgent::frameNavigated):
        (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
        (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
        (WebCore::InspectorCanvasAgent::willDestroyCanvasRenderingContext):
        (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
        (WebCore::InspectorCanvasAgent::recordCanvasAction):
        (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
        (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
        (WebCore::InspectorCanvasAgent::didEnableExtension):
        (WebCore::InspectorCanvasAgent::didCreateProgram):
        (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
        (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired):
        (WebCore::InspectorCanvasAgent::clearCanvasData):
        (WebCore::InspectorCanvasAgent::unbindCanvas):
        (WebCore::InspectorCanvasAgent::findInspectorCanvas):
        (WebCore::InspectorCanvasAgent::unbindProgram):
        (WebCore::InspectorCanvasAgent::didCreateCSSCanvas): Deleted.
        (WebCore::InspectorCanvasAgent::canvasDestroyed): Deleted.

        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
        (WebCore::InspectorInstrumentation::willDestroyCanvasRenderingContext):
        (WebCore::InspectorInstrumentation::didChangeCanvasMemory):
        (WebCore::InspectorInstrumentation::recordCanvasAction):
        (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrame):
        (WebCore::InspectorInstrumentation::didEnableExtension):
        (WebCore::InspectorInstrumentation::didCreateProgram):
        (WebCore::InspectorInstrumentation::willDeleteProgram):
        (WebCore::InspectorInstrumentation::isShaderProgramDisabled):
        (WebCore::InspectorInstrumentation::consoleStartRecordingCanvas):
        (WebCore::InspectorInstrumentation::didCreateCSSCanvas): Deleted.
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::consoleStartRecordingCanvasImpl):
        (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
        (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
        (WebCore::InspectorInstrumentation::willDestroyCanvasRenderingContextImpl):
        (WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl):
        (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
        (WebCore::InspectorInstrumentation::didEnableExtensionImpl):
        (WebCore::InspectorInstrumentation::didCreateProgramImpl):
        (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl): Deleted.

        * page/PageConsoleClient.cpp:
        (WebCore::PageConsoleClient::record):
        (WebCore::PageConsoleClient::recordEnd):

        * dom/Document.h:
        * dom/Document.cpp:
        (WebCore::Document::getCSSCanvasElement):
        (WebCore::Document::nameForCSSCanvasElement const):
        We have no reason to save the CSS canvas name for each InspectorCanvas object, so instead we
        can just query for the name based on the CanvasRenderingContext's HTMLCanvasElement (assuming
        it is not an OffscreenCanvas) when we need it.

2017-12-14  Chris Dumez  <cdumez@apple.com>

        self.importScripts() should obey updateViaCache inside service workers
        https://bugs.webkit.org/show_bug.cgi?id=180826

        Reviewed by Youenn Fablet.

        self.importScripts() should obey updateViaCache inside service workers, as per:
        - https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts

        Tests: http/tests/workers/service/registration-updateViaCache-all-importScripts.html
               http/tests/workers/service/registration-updateViaCache-imports-importScripts.html
               http/tests/workers/service/registration-updateViaCache-none-importScripts.html

        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::importScripts):
        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::loadSynchronously):
        * workers/WorkerScriptLoader.h:
        * workers/service/SWClientConnection.cpp:
        (WebCore::SWClientConnection::setRegistrationLastUpdateTime):
        * workers/service/SWClientConnection.h:
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::lastUpdateTime const):
        (WebCore::ServiceWorkerRegistration::setLastUpdateTime):
        * workers/service/ServiceWorkerRegistration.h:
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::setLastUpdateTime):
        * workers/service/server/SWServerRegistration.h:

2017-12-14  Yusuke Suzuki  <utatane.tea@gmail.com>

        Drop Thread::tryCreate
        https://bugs.webkit.org/show_bug.cgi?id=180808

        Reviewed by Darin Adler.

        This change reveals that nobody cares the WorkerThread::start's failure.
        We should use `Thread::create` to ensure thread is actually starting.

        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::start):
        * workers/WorkerThread.h:

2017-12-14  Alicia Boya García  <aboya@igalia.com>

        [MSE] Add isValid() check before using trackBuffer.lastEnqueuedPresentationTime
        https://bugs.webkit.org/show_bug.cgi?id=180258

        Reviewed by Jer Noble.

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

2017-12-14  John Wilander  <wilander@apple.com>

        Storage Access API: Implement frame-specific access in the document.cookie layer
        https://bugs.webkit.org/show_bug.cgi?id=180682
        <rdar://problem/35982257>

        Reviewed by Alex Christensen.

        No new tests. Changed expected result from existing test.

        CookiesStrategy::cookiesForDOM(), CookiesStrategy::setCookiesFromDOM(),
        CookiesStrategy::cookieRequestHeaderFieldValue(), and
        CookiesStrategy::getRawCookies() now take optional parameters for
        frameID and pageID to allow frame-specific scoping of cookies.

        This change makes the return values of FrameLoaderClient::frameID()
        and FrameLoaderClient::pageID() std::optional<uint64_t> so that
        WebCore can call those getters and get the right return values in
        WebKit and std:nullopt in WebKitLegacy.

        * dom/Document.cpp:
        (WebCore::Document::requestStorageAccess):
        * loader/CookieJar.cpp:
        (WebCore::cookies):
        (WebCore::setCookies):
        (WebCore::cookieRequestHeaderFieldValue):
        (WebCore::getRawCookies):
        * loader/EmptyFrameLoaderClient.h:
        * loader/FrameLoaderClient.h:
        * platform/CookiesStrategy.h:
        * platform/network/CacheValidation.cpp:
        (WebCore::headerValueForVary):
        * platform/network/PlatformCookieJar.h:
        * platform/network/cf/CookieJarCFNet.cpp:
        (WebCore::setCookiesFromDOM):
        (WebCore::cookiesForDOM):
        (WebCore::cookieRequestHeaderFieldValue):
        (WebCore::getRawCookies):
        * platform/network/curl/CookieJarCurl.cpp:
        (WebCore::CookieJarCurlFileSystem::setCookiesFromDOM):
        (WebCore::CookieJarCurlFileSystem::cookiesForDOM):
        (WebCore::CookieJarCurlFileSystem::cookieRequestHeaderFieldValue):
        (WebCore::CookieJarCurlFileSystem::getRawCookies):
        (WebCore::cookiesForDOM):
        (WebCore::setCookiesFromDOM):
        (WebCore::cookieRequestHeaderFieldValue):
        (WebCore::getRawCookies):
        * platform/network/curl/CookieJarCurl.h:
        * platform/network/mac/CookieJarMac.mm:
        (WebCore::cookiesInPartitionForURL):
        (WebCore::cookiesForURL):
        (WebCore::cookiesForSession):
        (WebCore::cookiesForDOM):
        (WebCore::cookieRequestHeaderFieldValue):
        (WebCore::setCookiesFromDOM):
        (WebCore::getRawCookies):
        * platform/network/soup/CookieJarSoup.cpp:
        (WebCore::setCookiesFromDOM):
        (WebCore::cookiesForDOM):
        (WebCore::cookieRequestHeaderFieldValue):
        (WebCore::getRawCookies):

2017-12-14  Alex Christensen  <achristensen@webkit.org>

        Fix Mac CMake build
        https://bugs.webkit.org/show_bug.cgi?id=180835

        Reviewed by Andy Estes.

        * PlatformMac.cmake:
        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:

2017-12-14  Antoine Quint  <graouts@apple.com>

        [Web Animations] Use is<> when possible
        https://bugs.webkit.org/show_bug.cgi?id=180832

        Reviewed by Dean Jackson.

        Adopt is<> when possible.

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::setEffect):
        (WebCore::WebAnimation::setTimeline):
        (WebCore::WebAnimation::startOrStopAccelerated):

2017-12-14  Antoine Quint  <graouts@apple.com>

        [Web Animations] Bring timeline and currentTime setters closer to compliance
        https://bugs.webkit.org/show_bug.cgi?id=180834

        Reviewed by Dean Jackson.

        Now that we've added support for the concept of a hold time, pending tasks
        and updating the finished state, adopt those in places we had already implemented
        but weren't fully compliant.

        Web Platform Tests cover these behaviors, but we're currently failing those tests
        due to lacking an implementation for Element.animate().

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::setTimeline): Add some spec comments to clarify the code behavior
        and implement step 4 of the "setting the timeline" procedure where we reset the hold time
        to an unresolved value if the start time is resolved, as well as step 5 where we update the
        finished state. Finally, we also ensure we update the pending tasks as the ready state is
        dependent on a timeline being set.
        (WebCore::WebAnimation::bindingsStartTime const): Invert the way we test for an unresolved
        value to match prior review comments by Dean Jackson.
        (WebCore::WebAnimation::setBindingsStartTime): Use a boolean check rather than checking
        equality with std::nullopt.
        (WebCore::WebAnimation::setBindingsCurrentTime): Do not raise an exception when setting
        an unresolved time.

2017-12-14  Antoine Quint  <graouts@apple.com>

        [Web Animations] Implement the cancel() method on Animation
        https://bugs.webkit.org/show_bug.cgi?id=180830
        <rdar://problem/36055816>

        Reviewed by Dean Jackson.

        We implement the cancel() method on the Animation interface with full spec text defining
        the normative behavior of those methods and code matching those steps. Implementing the
        cancel() method required implementing the notion of "resetting pending tasks",
        which the Web Animations spec defines as well.

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::setEffect):
        (WebCore::WebAnimation::cancel):
        (WebCore::WebAnimation::resetPendingTasks):
        * animation/WebAnimation.h:
        * animation/WebAnimation.idl:

2017-12-14  Jer Noble  <jer.noble@apple.com>

        "Click to exit fullscreen" text not legible on High Sierra
        https://bugs.webkit.org/show_bug.cgi?id=180825
        <rdar://problem/32839983>

        Reviewed by Eric Carlson.

        Explicitly set the NSVisualAffectView's .appearance property.

        * platform/mac/WebCoreFullScreenPlaceholderView.mm:
        (-[WebCoreFullScreenPlaceholderView initWithFrame:]):

2017-12-14  Antoine Quint  <graouts@apple.com>

        [Web Animations] Implement the finish() method on Animation
        https://bugs.webkit.org/show_bug.cgi?id=180822
        <rdar://problem/36053282>

        Reviewed by Dean Jackson.

        We implement the finish() method on the Animation interface with full spec text defining
        the normative behavior of those methods and code matching those steps. Implementing the
        finish() method required implementing the notion of "silently setting the current time",
        which the Web Animations spec defines as well.

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::silentlySetCurrentTime):
        (WebCore::WebAnimation::setCurrentTime):
        (WebCore::WebAnimation::finish):
        * animation/WebAnimation.h:
        * animation/WebAnimation.idl:

2017-12-14  Chris Dumez  <cdumez@apple.com>

        Service worker script fetching currently always uses the network cache
        https://bugs.webkit.org/show_bug.cgi?id=180816

        Reviewed by Alex Christensen.

        Service worker script fetching currently always uses the network cache. This is incorrect as per:
        - https://w3c.github.io/ServiceWorker/#update-algorithm (step 7.2)

        Tests: http/tests/workers/service/registration-updateViaCache-all.html
               http/tests/workers/service/registration-updateViaCache-none.html

        * workers/Worker.cpp:
        (WebCore::Worker::create):
        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::loadAsynchronously):
        * workers/WorkerScriptLoader.h:
        * workers/service/SWClientConnection.cpp:
        (WebCore::SWClientConnection::startScriptFetchForServer):
        * workers/service/SWClientConnection.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::startScriptFetch):
        (WebCore::ServiceWorkerJob::fetchScriptWithContext):
        * workers/service/ServiceWorkerJob.h:
        * workers/service/ServiceWorkerJobClient.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::startScriptFetch):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::runUpdateJob):
        * workers/service/server/SWServerRegistration.h:
        (WebCore::SWServerRegistration::lastUpdateTime const):

2017-12-14  Simon Fraser  <simon.fraser@apple.com>

        Remove ColorSpaceDeviceRGB and most users of the obsolete deviceRGB colorspace
        https://bugs.webkit.org/show_bug.cgi?id=180689

        Reviewed by Darin Adler.
        
        Address issues noted by Darin in r225797:
        
        Existing and new code mistakenly allocated colorspaces on every call, because
        they didn't initialize the static variable on the first call. Avoid this mistake
        by using dispatch_once() in these functions.

        Fix a case where the extendedSRGBColorSpaceRef() fallback was returning deviceRGB
        instead of sRGB.

        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::sRGBColorSpaceRef):
        (WebCore::linearRGBColorSpaceRef):
        (WebCore::extendedSRGBColorSpaceRef):
        (WebCore::displayP3ColorSpaceRef):
        * platform/graphics/cocoa/GraphicsContextCocoa.mm:
        (WebCore::linearRGBColorSpaceRef):

2017-12-13  Keith Miller  <keith_miller@apple.com>

        JSObjects should have a mask for loading indexed properties
        https://bugs.webkit.org/show_bug.cgi?id=180768

        Reviewed by Mark Lam.

        * bindings/js/JSDOMConvertSequences.h:
        (WebCore::Detail::NumericSequenceConverter::convertArray):
        (WebCore::Detail::SequenceConverter::convertArray):

2017-12-13  Antoine Quint  <graouts@apple.com>

        [Web Animations] Implement the play() and pause() methods on Animation
        https://bugs.webkit.org/show_bug.cgi?id=178932
        <rdar://problem/35271069>

        Reviewed by Eric Carlson.

        We implement the play() and pause() methods of the Animation interface with full spec text defining
        the normative behavior of those methods and code matching those steps. Playing and pausing animations
        incur running a play or pause task when conditions are met, specifically here when the timeline is ready.
        So we add the notion of pending tasks and provide a proper implementation of pending() which we had
        introduced in an earlier patch with a constant false return value.

        Note that the play() method exposes an auto-rewinding flag which we always set to true, but other specs,
        namely CSS Animations, do not require the rewinding behavior, so we expose it for future use.

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::play):
        (WebCore::WebAnimation::setTimeToRunPendingPlayTask):
        (WebCore::WebAnimation::runPendingPlayTask):
        (WebCore::WebAnimation::pause):
        (WebCore::WebAnimation::setTimeToRunPendingPauseTask):
        (WebCore::WebAnimation::runPendingPauseTask):
        (WebCore::WebAnimation::updatePendingTasks):
        * animation/WebAnimation.h:
        * animation/WebAnimation.idl:

2017-12-14  Frederic Wang  <fwang@igalia.com>

        Make GraphicsLayer::dumpProperties dump m_offsetFromRenderer
        https://bugs.webkit.org/show_bug.cgi?id=180473

        Reviewed by Antonio Gomes.

        No new tests, this is just a new debug info.

        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::GraphicsLayer::dumpProperties const): Dump the offset from renderer if nonzero.

2017-12-12  Yusuke Suzuki  <utatane.tea@gmail.com>

        REGRESSION(r225769): Build errors with constexpr std::tie on older gcc
        https://bugs.webkit.org/show_bug.cgi?id=180692

        Reviewed by Carlos Garcia Campos.

        * platform/graphics/FontSelectionAlgorithm.h:
        (WebCore::FontSelectionRange::operator== const):
        (WebCore::FontSelectionRequest::tied const):
        (WebCore::FontSelectionCapabilities::tied const):
        (WebCore::FontSelectionSpecifiedCapabilities:: const):

2017-12-13  Daniel Bates  <dabates@apple.com>

        Fix the Windows build after <https://trac.webkit.org/changeset/225879>
        (https://bugs.webkit.org/show_bug.cgi?id=180651)

        * html/TextFieldInputType.cpp:
        (WebCore::autoFillButtonTypeToAccessibilityLabel):
        (WebCore::autoFillButtonTypeToAutoFillButtonText):
        (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):

2017-12-13  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: add instrumentation for ImageBitmapRenderingContext
        https://bugs.webkit.org/show_bug.cgi?id=180736

        Reviewed by Joseph Pecoraro.

        Tests: inspector/canvas/create-context-bitmaprenderer.html
               inspector/canvas/requestContent-bitmaprenderer.html
               inspector/canvas/resolveCanvasContext-bitmaprenderer.html

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::getContext):
        (WebCore::HTMLCanvasElement::createContextBitmapRenderer):
        Support passing an optional settings dictionary when creating an ImageBitmapRenderingContext.

        * inspector/agents/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::requestContent):
        (WebCore::contextAsScriptValue):

        * bindings/js/CallTracerTypes.h:

        * inspector/InspectorCanvas.h:
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::buildObjectForCanvas):
        (WebCore::InspectorCanvas::indexForData):
        (WebCore::InspectorCanvas::buildAction):
        (WebCore::InspectorCanvas::buildArrayForImageBitmap): Deleted.

2017-12-13  Daniel Bates  <dabates@apple.com>

        Add more auto fill button types
        https://bugs.webkit.org/show_bug.cgi?id=180651
        <rdar://problem/35891125>
        And
        <rdar://problem/35977943>

        Reviewed by Brent Fulgham.

        Tests: fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button.html
               fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button.html
               fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons.html
               fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons.html
               fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button.html
               fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html

        * English.lproj/Localizable.strings:
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Add strings for new auto fill button types.

        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::selectorText const):
        * css/CSSSelector.h:
        * css/SelectorChecker.cpp:
        (WebCore::SelectorChecker::checkOne const):
        * css/SelectorCheckerTestFunctions.h:
        (WebCore::isAutofilledStrongPassword):
        * css/SelectorPseudoClassAndCompatibilityElementMap.in:
        * css/html.css:
        (input::-webkit-strong-password-auto-fill-button):
        (input:-webkit-autofill-strong-password):
        (input:-webkit-autofill, input:-webkit-autofill-strong-password):
        (input:-webkit-autofill): Deleted.
        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::addPseudoClassType):
        Add new CSS pseudo class and CSS styles.

        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::reset): Hide the auto fill button when the form is reset. This is also called
        whenever we suspend the page to put it into the page cache.
        (WebCore::HTMLInputElement::setShowAutoFillButton): Modified to update the editability of the inner text element
        and invalidate styles for the subtree as the editability may have changed depending on the auto fill button type.

        (WebCore::autoFillStrongPasswordMaskImage):
        (WebCore::HTMLInputElement::createInnerTextStyle):
        (WebCore::HTMLInputElement::createInnerTextStyle const): Deleted.
        Adjust the look of the inner text field. This function is not const because we may need to resolve style to
        generate a mask image.

        * html/HTMLInputElement.h:
        (WebCore::HTMLInputElement::autoFillButtonType const): Fix style nit; use a C++ style cast while I am in
        this area.
        (WebCore::HTMLInputElement::hasAutoFillStrongPasswordButton const): Added.

        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::createInnerTextStyle):
        (WebCore::HTMLTextAreaElement::createInnerTextStyle const): Deleted.
        Made this non-const because HTMLInputElement::createInnerTextStyle() needs to be non-const. See above.

        * html/HTMLTextAreaElement.h:
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::isInnerTextElementEditable const):
        (WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
        Extract out the query to determine if the inner text element is editable into a virtual function isInnerTextElementEditable()
        and have updateInnerTextElementEditability() make use of it. By default a field is considered editable if it is not disabled
        or read-only. We override updateInnerTextElementEditability() in HTMLInputElement to also consider the auto fill button type.

        * html/HTMLTextFormControlElement.h:
        * html/TextFieldInputType.cpp:
        (WebCore::autoFillButtonTypeToAccessibilityLabel):
        (WebCore::autoFillButtonTypeToAutoFillButtonText):
        (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
        (WebCore::isAutoFillButtonTypeChanged):
        (WebCore::TextFieldInputType::createAutoFillButton):
        (WebCore::TextFieldInputType::updateAutoFillButton):
        Support having text for the auto fill button.

        * platform/LocalizedStrings.cpp:
        (WebCore::AXAutoFillStrongPasswordLabel):
        (WebCore::AXAutoFillStrongConfirmationPasswordLabel):
        (WebCore::autoFillStrongPasswordLabel):
        * platform/LocalizedStrings.h:
        Add localized strings.

        * rendering/RenderTextControlSingleLine.h: Disallow scrolling depending on the auto fill button type.

        * testing/Internals.cpp:
        (WebCore::toAutoFillButtonType):
        * testing/Internals.h:
        * testing/Internals.idl:
        Add support for testing.

2017-12-13  Ryosuke Niwa  <rniwa@webkit.org>

        Crash inside ImageLoader::updateFromElement()
        https://bugs.webkit.org/show_bug.cgi?id=180769
        <rdar://problem/35278782>

        Reviewed by Antti Koivisto.

        Fixed the crash by moving all call sites of ImageLoader::updateFromElement() to be post insertion callbacks
        where it's safe to execute arbitrary scripts.

        No new test since existing tests cover this with a newly added release assert in ImageLoader.

        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::insertedIntoAncestor):
        (WebCore::HTMLImageElement::didFinishInsertingNode): Extracted from insertedIntoAncestor to call
        selectImageSource or updateFromElement.
        * html/HTMLImageElement.h: Made many member functions final.
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::didAttachRenderers): Delay the call to ImageLoader::updateFromElement() in
        ImageInputType using a post style resolution callback.
        * html/HTMLMetaElement.h:
        * html/HTMLPictureElement.cpp:
        (WebCore::HTMLPictureElement::sourcesChanged): Store the list of child image elements into a vector before
        calling selectImageSource since each call may execute arbitrary scripts.
        * html/HTMLSourceElement.cpp:
        (WebCore::HTMLSourceElement::insertedIntoAncestor): Delay the call to ImageLoader::updateFromElement()
        using a post style resolution callback.
        (WebCore::HTMLSourceElement::didFinishInsertingNode): Extracted from insertedIntoAncestor.
        * html/HTMLSourceElement.h:
        * html/HTMLVideoElement.cpp:
        (WebCore::HTMLVideoElement::didAttachRenderers):
        (WebCore::HTMLVideoElement::updateAfterStyleResolution): Extracted from didAttachRenderers.
        * html/HTMLVideoElement.h:
        * html/ImageInputType.cpp:
        (WebCore::ImageInputType::needsPostStyleResolutionCallback): Added. Returns true so that HTMLInputElement's
        didAttachRenderers would register a post style resolution callback.
        (WebCore::ImageInputType::updateAfterStyleResolution): Extracted from attach.
        (WebCore::ImageInputType::attach): Deleted.
        * html/ImageInputType.h:
        * html/InputType.cpp:
        (WebCore::InputType::needsPostStyleResolutionCallback): Added. All but ImageInputType returns false.
        (WebCore::InputType::updateAfterStyleResolution): Added.
        (WebCore::InputType::attach): Deleted.
        * html/InputType.h:
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::updateFromElement): Added a release assertion. There is no direct security implication
        so there is no need to use RELEASE_ASSERT_WITH_SECURITY_IMPLICATION here.
        * svg/SVGImageElement.cpp:
        (WebCore::SVGImageElement::insertedIntoAncestor):
        (WebCore::SVGImageElement::didFinishInsertingNode):
        * svg/SVGImageElement.h:

2017-12-13  Zalan Bujtas  <zalan@apple.com>

        RenderImage can be destroyed even before setting the style on it.
        https://bugs.webkit.org/show_bug.cgi?id=180767
        <rdar://problem/33965995>

        Reviewed by Simon Fraser.

        In certain cases, when the newly constructed renderer can't be inserted into the tree (parent can only have specific type of children etc),
        RenderTreeUpdater destroys it right away. While destroying a RenderImage, the associated image resource assumes
        that the image renderer has been initialized through RenderElement::initializeStyle(). This is an incorrect
        assumption.
        This patch also makes RenderImageResource's m_renderer a weak pointer.
           
        Test: fast/images/crash-when-image-renderer-is-destroyed-before-calling-initializeStyle.html

        * rendering/RenderImageResource.cpp:
        (WebCore::RenderImageResource::initialize):
        (WebCore::RenderImageResource::setCachedImage):
        (WebCore::RenderImageResource::resetAnimation):
        (WebCore::RenderImageResource::image const):
        (WebCore::RenderImageResource::setContainerContext):
        (WebCore::RenderImageResource::imageSize const):
        * rendering/RenderImageResource.h:
        (WebCore::RenderImageResource::renderer const):
        * rendering/RenderImageResourceStyleImage.cpp:
        (WebCore::RenderImageResourceStyleImage::shutdown):

2017-12-13  Ryosuke Niwa  <rniwa@webkit.org>

        Update the SVG use element's shadow trees explicitly before the style recall
        https://bugs.webkit.org/show_bug.cgi?id=180729
        <rdar://problem/36009806>

        Reviewed by Antti Koivisto.

        Update the SVG use element's shadow trees before start resolving styles. Document now has a hash set of all
        connected SVG use elements with invalidated shadow trees. SVGUseElement adds itself to this set when its
        shadow tree gets invalidated, or it gets newly connected to a document with the invalidated shadow tree.
        SVGUseElement removes itself from this set when it updates its shadow tree or it gets disconnected from
        a document with the invalidated shadow tree.

        No new tests. Covered by existing tests.

        * dom/Document.cpp:
        (WebCore::Document::~Document): Assert that m_svgUseElements has been cleared.
        (WebCore::Document::resolveStyle): Update the shadow trees of SVG use elements with invalidated shadow trees.
        (WebCore::Document::addSVGUseElement): Added.
        (WebCore::Document::removeSVGUseElement): Added.
        * dom/Document.h:
        (WebCore::Document::svgUseElements const): Added.
        * dom/Element.cpp:
        (WebCore::Element::cloneElementWithChildren): Removed EventAllowedScope since the SVG use element's shadow
        tree is no longer updated when there is a NoEventDispatchAssertion in the stack.
        (WebCore::Element::cloneElementWithoutChildren): Ditto.
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::resolveComposedTree): No longer drops the assertion now that SVG use element's
        shadow tree is updated before calling this function.
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::insertedIntoAncestor): Add the element to the document's hash set if this use element's
        shadow tree needs to be updated (m_shadowTreeNeedsUpdate is set), and it got newly connected.
        (WebCore::SVGUseElement::removedFromAncestor): Ditto for removal. We have to check m_shadowTreeNeedsUpdate before
        calling SVGGraphicsElement::removedFromAncestor or updateExternalDocument since either function can invoke
        m_shadowTreeNeedsUpdate to true.
        (WebCore::SVGUseElement::willRecalcStyle): Deleted. We no longer call updateShadowTree during style recalc.
        (WebCore::SVGUseElement::updateShadowTree): Remove this element from the document's hah set. We can't clear all
        the entries in the map at once in Document::resolveStyle because updating the shadow trees of a SVG use element
        can result in a sync IPC in ImageLoader::updateFromElement, which end up executing arbitrary author scripts.
        (WebCore::SVGUseElement::cloneTarget const): Removed EventAllowedScope since the SVG use element's shadow tree
        is no longer updated when there is a NoEventDispatchAssertion in the stack.
        (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
        (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
        (WebCore::SVGUseElement::invalidateShadowTree): Add the element to the document's hash set if it's connected.
        * svg/SVGUseElement.h:

2017-12-13  Per Arne Vollan  <pvollan@apple.com>

        REGRESSION(225597): Can't select a text box or web view on a page when VO is on.
        https://bugs.webkit.org/show_bug.cgi?id=180756
        <rdar://problem/35996158>

        Reviewed by Brent Fulgham.

        No new tests.

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

2017-12-13  Antoine Quint  <graouts@apple.com>

        [Web Animations] Implement the "updating the finished state" procedure
        https://bugs.webkit.org/show_bug.cgi?id=180743
        <rdar://problem/36017232>

        Reviewed by Simon Fraser.

        The Web Animations spec defines a procedure for "updating the finished state", which should run as the timeline time
        changes and is responsible for ultimately triggering finish events and fulfil the "finished" promise. The procedure
        allows for two flags to control its behavior: didSeek and synchronouslyNotify. When synchronouslyNotify is true, the
        "finish notification steps" procedure is ran right away, otherwise it's queued as a microtask.

        In this patch we introduce the notion of "hold time", which is the time held while an animation is paused. It will be
        set by the pause() and play() method in future patches.

        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::updateAnimations): Update the finished state as the timeline time changes with both flags
        set to false.
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::currentTime const): Add a private currentTime(bool) variant which allows for the hold time to
        be ignored in case updateFinishedState() was called with the didSeek flag set to false.
        (WebCore::WebAnimation::updateFinishedState): Implement the procedure as specified with all spec-mandated steps inline.
        (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Schedule a microtask to complete the "finish notification steps"
        if we haven't scheduled a microtask before.
        (WebCore::WebAnimation::performMicrotask): Perform the microtask if the "finish notification steps" procedure hasn't
        been canceled after it was originally scheduled, as tracked by the m_finishNotificationStepsMicrotaskPending flag, since
        microtasks are not presently cancelable.
        (WebCore::WebAnimation::finishNotificationSteps): Implement the procedure as specified with all spec-mandated steps inline,
        dispatching a "finish" events and fulfilling the "finished" promise.
        * animation/WebAnimation.h:
        * animation/WebAnimation.idl:
        * dom/EventNames.h:

2017-12-13  Simon Fraser  <simon.fraser@apple.com>

        Fix crash under Document::visualUpdatesSuppressionTimerFired()
        https://bugs.webkit.org/show_bug.cgi?id=180758
        Document::visualUpdatesSuppressionTimerFired

        Reviewed by Zalan Bujtas.

        Speculative fix for crash under visualUpdatesSuppressionTimerFired() where view()
        can be null. Add null checks for the view() in all code called from this function.

        * dom/Document.cpp:
        (WebCore::Document::setVisualUpdatesAllowed):
        (WebCore::Document::visualUpdatesSuppressionTimerFired):

2017-12-13  Zalan Bujtas  <zalan@apple.com>

        ASSERT(LayoutDisallowedScope::isLayoutAllowed()) whenever hitting Enter in Web Inspector console
        https://bugs.webkit.org/show_bug.cgi?id=180690

        Reviewed by Simon Fraser.

        Defer text replacement notification until after layout is done to avoid unexpected forced layouts.

        Covered by existing tests.

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::disableAccessibility):
        (WebCore::AXObjectCache::remove):
        (WebCore::filterMapForRemoval):
        (WebCore::filterListForRemoval):
        (WebCore::AXObjectCache::prepareForDocumentDestruction):
        (WebCore::AXObjectCache::performDeferredCacheUpdate):
        (WebCore::AXObjectCache::deferTextReplacementNotificationForTextControl):
        (WebCore::filterForRemoval): Deleted.
        * accessibility/AXObjectCache.h: Need to use the base (Element) class since
        we can't call is<HTMLTextFormControlElement> in Node d'tor.
        (WebCore::AXObjectCache::deferTextReplacementNotificationForTextControl):
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::setInnerTextValue):

2017-12-13  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r225836.

        Broke the Windows build.

        Reverted changeset:

        "Unify some WebGL sources"
        https://bugs.webkit.org/show_bug.cgi?id=180726
        https://trac.webkit.org/changeset/225836

2017-12-13  Andy Estes  <aestes@apple.com>

        [Payment Request] Remove ApplePayPaymentMethodUpdateEvent and use PaymentDetailsModifiers instead
        https://bugs.webkit.org/show_bug.cgi?id=180737
        <rdar://problem/36013152>

        Reviewed by Brady Eidson.

        Instead of firing a non-standard "applepaypaymentmethodupdate" event when the payment method
        changes, use the PaymentDetailsModifier mechanism to allow the merchant to specify override
        totals and additional display items per payment method type.

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

        * DerivedSources.make:
        * Modules/applepay/ApplePayLineItem.idl:
        * Modules/applepay/ApplePayPaymentMethod.h:
        * Modules/applepay/ApplePayPaymentMethod.idl:
        * Modules/applepay/ApplePayPaymentMethodType.h: Added.
        * Modules/applepay/ApplePayPaymentMethodType.idl: Added.
        * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
        * Modules/applepay/paymentrequest/ApplePayModifier.h: Added.
        * Modules/applepay/paymentrequest/ApplePayModifier.idl: Added.
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::ApplePayPaymentHandler::show):
        (WebCore::ApplePayPaymentHandler::computeTotalAndLineItems):
        (WebCore::ApplePayPaymentHandler::detailsUpdated):
        (WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
        (WebCore::ApplePayPaymentHandler::shippingOptionUpdated):
        (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
        (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
        * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp: Removed.
        * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h: Removed.
        * Modules/paymentrequest/PaymentRequest.h:
        * Modules/paymentrequest/PaymentRequest.idl:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/EventNames.h:
        * dom/EventNames.in:
        * testing/MockPaymentCoordinator.cpp:
        (WebCore::convert):
        (WebCore::MockPaymentCoordinator::updateTotalAndLineItems):
        (WebCore::MockPaymentCoordinator::completeShippingMethodSelection):
        (WebCore::MockPaymentCoordinator::completeShippingContactSelection):
        (WebCore::MockPaymentCoordinator::completePaymentMethodSelection):
        * testing/MockPaymentCoordinator.h:
        * testing/MockPaymentCoordinator.idl:

2017-12-12  Zalan Bujtas  <zalan@apple.com>

        is<HTMLTextFormControlElement> reports the input type.
        https://bugs.webkit.org/show_bug.cgi?id=180721
        <rdar://problem/36005123>

        Reviewed by Ryosuke Niwa.

        This patch ensures that is<HTMLTextFormControlElement> consistently returns true even
        when the input type changes from text to non-text (checkbox etc).

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::selectText):
        * dom/Element.h:
        (WebCore::Element::isTextFormControlElement const):
        (WebCore::Element::isTextField const):
        (WebCore::Element::isTextFormControl const): Deleted.
        * editing/Editor.cpp:
        (WebCore::Editor::selectionForCommand):
        (WebCore::Editor::setBaseWritingDirection):
        (WebCore::findFirstMarkable):
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::selectAll):
        * html/FormController.cpp:
        (WebCore::FormController::formElementsCharacterCount const):
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::directionality const):
        * html/HTMLInputElement.h:
        * html/HTMLTextAreaElement.h:
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
        (WebCore::HTMLTextFormControlElement::selectedText const):
        (WebCore::HTMLTextFormControlElement::setSelectionRange):
        (WebCore::HTMLTextFormControlElement::selectionStart const):
        (WebCore::HTMLTextFormControlElement::computeSelectionStart const):
        (WebCore::HTMLTextFormControlElement::selectionEnd const):
        (WebCore::HTMLTextFormControlElement::computeSelectionEnd const):
        (WebCore::HTMLTextFormControlElement::selectionDirection const):
        (WebCore::HTMLTextFormControlElement::computeSelectionDirection const):
        (WebCore::HTMLTextFormControlElement::selection const):
        (WebCore::HTMLTextFormControlElement::selectionChanged):
        (WebCore::HTMLTextFormControlElement::lastChangeWasUserEdit const):
        (WebCore::HTMLTextFormControlElement::setInnerTextValue):
        (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks const):
        (WebCore::enclosingTextFormControl):
        * html/HTMLTextFormControlElement.h:
        (isType):
        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::isOverTextInsideFormControlElement const):

2017-12-12  Dean Jackson  <dino@apple.com>

        Unify some WebGL sources
        https://bugs.webkit.org/show_bug.cgi?id=180726

        Rubber-stamped by Keith, weeks ago.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * html/canvas/WebGLRenderingContextBase.cpp:

2017-12-12  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix !ENABLE(MEDIA_STREAM) build after r225822
        https://bugs.webkit.org/show_bug.cgi?id=180666
        <rdar://problem/36008948>

        * html/HTMLMediaElement.cpp:

2017-12-12  Alex Christensen  <achristensen@webkit.org>

        Fix possible out-of-bounds read in protocolIsInHTTPFamily
        https://bugs.webkit.org/show_bug.cgi?id=180688

        Reviewed by Daniel Bates.

        It wouldn't read very far out of bounds, and it would just change a bool return value,
        but it's still out of bounds.  Covered by an API test that ASAN wouldn't like.

        * platform/URL.cpp:
        (WebCore::protocolIsInHTTPFamily):
        Check bounds before reading a string.

2017-12-12  Youenn Fablet  <youenn@apple.com>

        getUserMedia is resolving before the document knows it is capturing
        https://bugs.webkit.org/show_bug.cgi?id=180699

        Reviewed by Eric Carlson.

        Covered by updated test.

        Ensure the document state is capturing when getUserMedia promise is resolved by doing the following:
        - Promise is resolved when MediaStream is producing data.
        - MediaStream asks Document to update its state when MediaStream state is updated.

        Introduce PendingActivationMediaStream for waiting for the MediaStream to produce data.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::statusDidChange):
        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::allow):
        (WebCore::UserMediaRequest::contextDestroyed):
        (WebCore::UserMediaRequest::PendingActivationMediaStream::PendingActivationMediaStream):
        (WebCore::UserMediaRequest::PendingActivationMediaStream::~PendingActivationMediaStream):
        (WebCore::UserMediaRequest::PendingActivationMediaStream::characteristicsChanged):
        (WebCore::UserMediaRequest::mediaStreamIsReady):
        * Modules/mediastream/UserMediaRequest.h:
        (WebCore::UserMediaRequest::PendingActivationMediaStream::create):
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        * WebCore/WebCore.xcodeproj/project.pbxproj:

2017-12-12  John Wilander  <wilander@apple.com>

        Storage Access API: Implement frame-specific access in the network storage session layer
        https://bugs.webkit.org/show_bug.cgi?id=180679
        <rdar://problem/35982116>

        Reviewed by Alex Christensen.

        Tests: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-non-recent-user-interaction-and-try-access-from-right-frame.html
               http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-non-recent-user-interaction-but-try-access-from-wrong-frame.html

        This changes adds frameID and pageID to what is communicated for
        storage access and also stored in the network process' table of
        partitioning exceptions.

        * dom/Document.cpp:
        (WebCore::Document::hasStorageAccess):
            Now makes use of the new m_hasFrameSpecificStorageAccess to check
            if access has already been granted to this document's domain and
            frame.
        (WebCore::Document::requestStorageAccess):
            Now submits frameID and pageID in the request call and sets
            m_hasFrameSpecificStorageAccess upon granted access callback.
        * dom/Document.h:
        * page/ChromeClient.h:
        * platform/network/NetworkStorageSession.h:
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::cookieStoragePartition const):
        (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
        (WebCore::NetworkStorageSession::isStorageAccessGranted const):
        (WebCore::NetworkStorageSession::setStorageAccessGranted):
            Now makes use of frameID and pageID for partitioning exceptions.
        * platform/network/mac/CookieJarMac.mm:
        (WebCore::cookiesInPartitionForURL):
        (WebCore::setCookiesFromDOM):
            Submits std::nullopt for frameID and pageID.
            Follow-up work tracked in https://bugs.webkit.org/show_bug.cgi?id=180682. 
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded):
            Submits std::nullopt for frameID and pageID.
            Follow-up work tracked in https://bugs.webkit.org/show_bug.cgi?id=180682. 

2017-12-12  Youenn Fablet  <youenn@apple.com>

        Playing webrtc video tracks should prevent from display to got to sleep
        https://bugs.webkit.org/show_bug.cgi?id=180666

        Reviewed by Darin Adler.

        Done through manual testing by checking screen assertions taken on webrtc sites.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::shouldDisableSleep const):

2017-12-12  Dean Jackson  <dino@apple.com>

        Add CanvasRenderingContext2DBase class and OffscreenCanvasRenderingContext2D
        https://bugs.webkit.org/show_bug.cgi?id=180718
        <rdar://problem/36004015>

        Reviewed by Sam Weinig.

        Add an OffscreenCanvasRenderingContext2D class, and in the process create a shared
        base class for it and CanvasRenderingContext2D, called CanvasRenderingContext2DBase.
        The base class has nearly all the functionality, with the exception of the text
        and focus rendering APIs, which are only exposed on CanvasRenderingContext2D.

        At the moment CanvasRenderingContext2DBase's implementation still expects the attached
        canvas to be an HTMLCanvasElement, but that's ok since you can't yet create an
        OffscreenCanvasRenderingContext2D. A subsequent patch will do the right thing.

        No change in functionality at the moment, so covered by the existing tests.

        * DerivedSources.make: Add the new IDL file.

        * Sources.txt: Add all the new files to compile.
        * WebCore.xcodeproj/project.pbxproj:

        * bindings/js/JSCanvasRenderingContext2DCustom.cpp: Removed some unnecessary headers, and
        added JSC:: where appropriate.
        (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
        (WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):

        * bindings/js/JSOffscreenCanvasRenderingContext2DCustom.cpp: Copied from Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp.
        (WebCore::root): New root function that just returns the address of the OffscreenCanvas.
        (WebCore::JSOffscreenCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
        (WebCore::JSOffscreenCanvasRenderingContext2D::visitAdditionalChildren):

        * bindings/js/JSWorkerNavigatorCustom.cpp: Add JSC:: to fix a compilation error.
        (WebCore::JSWorkerNavigator::visitAdditionalChildren):

        * bindings/js/WebCoreBuiltinNames.h: New IDL types.

        * html/OffscreenCanvas.idl: Explicitly generates an IsReachable.

        * html/canvas/CanvasRenderingContext.h:
        (WebCore::CanvasRenderingContext::isOffscreen2d const): Helper for is<> trait.

        * html/canvas/CanvasRenderingContext2D.cpp: Nearly everything has been moved to the Base class.
        * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/CanvasRenderingContext2DBase.cpp: Copied from Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp.
        * html/canvas/CanvasRenderingContext2DBase.h: Copied from Source/WebCore/html/canvas/CanvasRenderingContext2D.h.

        * html/canvas/OffscreenCanvasRenderingContext2D.cpp: Added. Basic implementation that
        just uses the Base class.
        (WebCore::OffscreenCanvasRenderingContext2D::OffscreenCanvasRenderingContext2D):
        * html/canvas/OffscreenCanvasRenderingContext2D.h: Added.
        * html/canvas/OffscreenCanvasRenderingContext2D.idl: Added.

2017-12-12  Jer Noble  <jer.noble@apple.com>

        [EME] Support FPS-over-HLS in the Modern EME API
        https://bugs.webkit.org/show_bug.cgi?id=180707

        Reviewed by Eric Carlson.

        Add support for the "skd" initDataType, where the initData is the URI provided in the 
        EXT-X-KEY tag in a HLS manifest:

        * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
        (WebCore::CDMPrivateFairPlayStreaming::sinfName):
        (WebCore::CDMPrivateFairPlayStreaming::skdName):
        (WebCore::extractSinfData):
        (WebCore::CDMPrivateFairPlayStreaming::sanitizeSkd):
        (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSkd):
        (WebCore::validInitDataTypes):
        (WebCore::CDMFactory::platformRegisterFactories):
        (WebCore::CDMPrivateFairPlayStreaming::supportsInitDataType const):
        (WebCore::CDMPrivateFairPlayStreaming::supportsConfiguration const):
        (WebCore::CDMPrivateFairPlayStreaming::supportsInitData const):
        (WebCore::sinfName): Deleted.

        Add support for creating a AVContentKeyRequest from a skd key URI rather than from
        initialization data, and for extracting keyIDs from the AVContentKeyRequest identifier.

        * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keyIDs):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestLicense):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):

        Add support for AVContentKeySession to MediaPlayerPrivateAVFoundationObjC, and for emitting
        initializationData messages when encountering a loading request for a "skd" URI.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceAttached):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceDetached):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):

2017-12-12  Antoine Quint  <graouts@apple.com>

        [Web Animations] Expose promises on Animation interface
        https://bugs.webkit.org/show_bug.cgi?id=180710
        <rdar://problem/36000604>

        Reviewed by Dean Jackson.

        Expose the "ready" and "finished" promises on Animation. A future patch will fulfil or reject them.

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::WebAnimation):
        (WebCore::WebAnimation::readyPromiseResolve):
        (WebCore::WebAnimation::finishedPromiseResolve):
        * animation/WebAnimation.h:
        * animation/WebAnimation.idl:

2017-12-12  Youenn Fablet  <youenn@apple.com>

        Fetch Event header filtering should apply in CORS mode only
        https://bugs.webkit.org/show_bug.cgi?id=180708

        Reviewed by Alex Christensen.

        Covered by no-longer failing test.

        * workers/service/context/ServiceWorkerFetch.cpp: cleaning headers only in case of CORS mode.

2017-12-12  Myles C. Maxfield  <mmaxfield@apple.com>

        REGRESSION (Safari 11): custom <font-face> tag crashes a page
        https://bugs.webkit.org/show_bug.cgi?id=177848

        Reviewed by Darin Adler.

        We currently use the CSS property parsers to parse SVG's <font-face> element attributes. Instead,
        we should be using the CSS descriptor parsers to parse these attributes. However, this is a
        fairly involved task, so until I can finish that, this patch fixes the crash. The crash is simple;
        the descriptors shouldn't accept the universal keywords ("initial", "inherit", etc.) and our
        font-face machinery assumes this. So the fix is just detect these keywords and explicitly disallow
        them.

        Test: svg/text/font-style-keyword.html

        * svg/SVGFontFaceElement.cpp:
        (WebCore::SVGFontFaceElement::parseAttribute):

2017-12-12  Antoine Quint  <graouts@apple.com>

        [Web Animations] Implement the playState property on Animation
        https://bugs.webkit.org/show_bug.cgi?id=180711
        <rdar://problem/36000982>

        Reviewed by Dean Jackson.

        Expose the playState and pending properties. The playState property has a complete implementation but
        has some test failures due to Animation lacking correct behavior while running animations which will
        be fixed in a followup patch. The pending property is a placeholder until we implement pending play
        and pause tasks in followup patches.

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::playState const):
        (WebCore::WebAnimation::effectEndTime const):
        * animation/WebAnimation.h:
        * animation/WebAnimation.idl:

2017-12-12  Javier Fernandez  <jfernandez@igalia.com>

        [css-grid] Implement alignment for absolute positioned grid items
        https://bugs.webkit.org/show_bug.cgi?id=180632

        Reviewed by Manuel Rego Casasnovas.

        We are changing how we compute the grid area's size of positioned
        items, trying to make the logic as independent as possible of the
        grid container's direction.

        The new way of placing absolute positioned elements in their grid area
        is based on the previously computed area's size. This provide a
        mechanism to place an item in its area respecting the offsets derived
        from the Content Alignment CSS properties and, which is more important,
        ignoring the grid container's direction.

        Additionally, we use the already implemented alignment logic that's
        used for regular grid items. This patch provides almost full alignment
        capabilities for positioned objects, with the exception of 'stretch'.

        It's worth mentioning that some of the test cases using vertical-rl
        writing mode will fail because of the bug 180633.

        Updated web-platform-tests results of the test cases that pass now.

        * rendering/GridLayoutFunctions.cpp:
       (WebCore::GridLayoutFunctions::hasOverrideContainingBlockContentSizeForChild):
        (WebCore::GridLayoutFunctions::overrideContainingBlockContentSizeForChild):
        * rendering/GridLayoutFunctions.h:
        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild const):
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::layoutBlock):
        (WebCore::RenderGrid::gridItemOffset const):
        (WebCore::RenderGrid::hasStaticPositionForChild const):
        (WebCore::RenderGrid::layoutPositionedObject):
        (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
        (WebCore::RenderGrid::columnAxisPositionForChild const):
        (WebCore::RenderGrid::rowAxisPositionForChild const):
        (WebCore::RenderGrid::columnAxisOffsetForChild const):
        (WebCore::RenderGrid::rowAxisOffsetForChild const):
        (WebCore::RenderGrid::gridPositionIsAutoForOutOfFlow const):
        (WebCore::RenderGrid::resolveAutoStartGridPosition const):
        (WebCore::RenderGrid::resolveAutoEndGridPosition const):
        (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
        (WebCore::RenderGrid::logicalOffsetForChild const):
        (WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
        (WebCore::RenderGrid::gridAreaPositionForInFlowChild const):
        (WebCore::RenderGrid::gridAreaPositionForChild const):
        (WebCore::RenderGrid::translateOutOfFlowRTLCoordinate const):
        (WebCore::RenderGrid::findChildLogicalPosition const):
        * rendering/RenderGrid.h:
        * rendering/style/GridPositionsResolver.cpp:
        (WebCore::adjustGridPositionsFromStyle):
        (WebCore::GridPositionsResolver::initialPositionSide):
        (WebCore::GridPositionsResolver::finalPositionSide):
        * rendering/style/GridPositionsResolver.h:

2017-12-12  Jer Noble  <jer.noble@apple.com>

        [EME] Support reporting and restoring persistent usage data.
        https://bugs.webkit.org/show_bug.cgi?id=180684

        Reviewed by Eric Carlson.

        Add support for reading and acknowledging persistent usage data from the MediaKeys storage
        directory.

        Add a mechanism for passing the storage location down to CDMPrivate and CDMInstance objects
        inside of the CDM class itself:

        * Modules/encryptedmedia/CDM.cpp:
        (WebCore::CDM::createInstance):
        (WebCore::CDM::storageDirectory const):
        * Modules/encryptedmedia/CDM.h:

        Support loading expired session data, acknowledging expired session data, closing sessions
        and removing usable key data.

        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
        (WebCore::isEqual):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::loadSession):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::closeSession):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::removeSessionData):

2017-12-12  Christopher Reid  <chris.reid@sony.com>

        WebGL TextureMapperShaderProgram shaders don't compile in MSVC
        https://bugs.webkit.org/show_bug.cgi?id=180709

        Reviewed by Myles C. Maxfield.

        No new tests, no change in behavior.

        Vertex and Fragment shaders were not compiling because TextureMapperShaderProgram.cpp was
        stringifying "#if USE(OPENGL_ES_2) ... #endif" into the shaders rather than evaluating these
        preprocessor directives before the STRINGIFY expansion.

        Moved these #if conditions outside of STRINGIFY to remove compiler ambiguity.

        * platform/graphics/texmap/TextureMapperShaderProgram.cpp:

2017-12-12  Zach Li  <zachli@apple.com>
        [WK2] Expose image via WKBundleHitTestResult API.
        https://bugs.webkit.org/show_bug.cgi?id=180552.
        rdar://problem/23951521

        Reviewed by Simon Fraser.

        * platform/graphics/ImageSource.h:
        This method will be used by clients outside WebCore, so
        add WEBCORE_EXPORT.

2017-12-12  Simon Fraser  <simon.fraser@apple.com>

        Remove ColorSpaceDeviceRGB and most users of the obsolete deviceRGB colorspace
        https://bugs.webkit.org/show_bug.cgi?id=180689

        Reviewed by Tim Horton.

        Remove the ColorSpaceDeviceRGB enum and users.

        ImageBuffer now uses sRGB instead of deviceRGB in the few cases that used the latter.

        Switch Windows CG code to use sRGBColorSpaceRef() instead of deviceRGBColorSpaceRef().

        Have linearRGBColorSpaceRef() use kCGColorSpaceLinearSRGB, which is present in iOS 9 and 10.11 and later.

        * page/win/FrameCGWin.cpp:
        (WebCore::imageFromRect):
        * platform/graphics/Color.cpp:
        (WebCore::operator<<):
        * platform/graphics/ColorSpace.h:
        * platform/graphics/ImageBuffer.cpp:
        (WebCore::ImageBuffer::transformColorSpace):
        * platform/graphics/cg/ColorCG.cpp:
        (WebCore::Color::Color):
        (WebCore::leakCGColor):
        (WebCore::createCGColorWithDeviceRGBA): Deleted.
        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::sRGBColorSpaceRef):
        (WebCore::linearRGBColorSpaceRef):
        (WebCore::extendedSRGBColorSpaceRef):
        (WebCore::displayP3ColorSpaceRef):
        (WebCore::deviceRGBColorSpaceRef): Deleted.
        * platform/graphics/cg/GraphicsContextCG.h:
        (WebCore::cachedCGColorSpace):
        * platform/graphics/cocoa/GraphicsContextCocoa.mm:
        * platform/graphics/win/GraphicsContextCGWin.cpp:
        (WebCore::CGContextWithHDC):
        (WebCore::GraphicsContext::releaseWindowsContext):
        (WebCore::GraphicsContext::drawWindowsBitmap):
        * platform/graphics/win/ImageCGWin.cpp:
        (WebCore::BitmapImage::create):
        (WebCore::BitmapImage::getHBITMAPOfSize):
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
        (WebCore::MockRealtimeVideoSourceMac::pixelBufferFromCGImage const):
        * platform/win/DragImageCGWin.cpp:
        (WebCore::allocImage):
        (WebCore::createCgContextFromBitmap):
        * rendering/svg/RenderSVGResourceFilter.cpp:
        (WebCore::RenderSVGResourceFilter::postApplyResource):
        * rendering/svg/RenderSVGResourceMasker.cpp:
        (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):

2017-12-12  Youenn Fablet  <youenn@apple.com>

        Navigation requests should use navigate fetch mode
        https://bugs.webkit.org/show_bug.cgi?id=179808

        Reviewed by Chris Dumez.

        Covered by existing tests.

        * Modules/fetch/FetchRequest.cpp:
        (WebCore::buildOptions): Update to throw only if init.mode is Navigate.
        * Modules/fetch/FetchRequestInit.h:
        (WebCore::FetchRequestInit::hasMembers const): If init is present, set default values as per spec.
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::loadMainResource): Set fetch mode to navigate.
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Bypass preflight in case fetch mode is navigate.

2017-12-12  Simon Fraser  <simon.fraser@apple.com>

        HTML-page with <object type="image/svg+xml" data="foo.svg"> often is blank
        https://bugs.webkit.org/show_bug.cgi?id=180524
        <rdar://problem/35920554>

        Reviewed by Antti Koivisto.

        The test case has script that conditionalizes behavior on whether window.innerWidth/Height
        are zero during the load event. We didn't force layout in innerWidth/Height, so whether
        they would zero depended on whether the parent frame had laid out, which was timing-sensitive.

        Fix by triggering enough layout in the parent document so that the FrameView is resized before
        fetching its dimensions in innerWidth/Height. This causes our behavior to match Chrome and Firefox.

        Test: fast/dom/iframe-innerWidth.html

        * dom/EventDispatcher.cpp:
        (WebCore::EventDispatcher::dispatchEvent): Add some logging that helped me diagnose this.
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::innerHeight const):
        (WebCore::DOMWindow::innerWidth const):

2017-12-11  Antoine Quint  <graouts@apple.com>

        [Web Animations] Enqueue and dispatch animation events
        https://bugs.webkit.org/show_bug.cgi?id=180657
        <rdar://problem/35970103>

        Reviewed by Chris Dumez.

        Now that we have support for the AnimationPlaybackEvent interface, we need a way to enqueue
        such events for dispatch at the opportune time. The Web Animations spec defines two ways
        to queue and dispatch events.

        If the animation has a "document for timing", it should enqueue events on this document.
        In our implementation, if the animation timeline is set to a DocumentTimeline, that means
        it has a document for timing, and we let the DocumentTimeline enqueue those events, which
        will be dispatched through a dedicated GenericTaskQueue<Timer>. These events will be sorted
        by their respective timeline time before being dispatched.

        If there is no document for timing, events should be dispatched as a standalone task.

        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::~DocumentTimeline): Close the event dispatch task queue when the
        document timeline is torn down.
        (WebCore::DocumentTimeline::enqueueAnimationPlaybackEvent): Add the provided event to the
        pending animation events queue and, if one hasn't been registered yet, enqueue a task to
        dispatch events using a GenericTaskQueue<Timer>.
        (WebCore::compareAnimationPlaybackEvents): Comparator used to sort events in performEventDispatchTask()
        where events are sorted such that unresolved timeline times come first, and then from the
        earlier resolved timeline times to the later resolved timeline times. Events with unresolved
        timeline times and equal resolved timeline times are sorted in the order they were enqueued.
        (WebCore::DocumentTimeline::performEventDispatchTask): Run a stable sort on a copy of the pending list
        of events to dispatch and dispatch the events individually on their respective animations.
        * animation/DocumentTimeline.h:
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::create): Pass in the document to the constructor.
        (WebCore::WebAnimation::WebAnimation): Use the provided document to initialize ActiveDOMObject.
        (WebCore::WebAnimation::enqueueAnimationPlaybackEvent): Create an AnimationPlaybackEvent with
        the provided type, timeline time and animation time and enqueue it on the document timeline,
        if one is available, or dispatch on this animation as a standalone task.
        (WebCore::WebAnimation::acceleratedRunningStateDidChange):
        (WebCore::WebAnimation::activeDOMObjectName const):
        (WebCore::WebAnimation::canSuspendForDocumentSuspension const):
        (WebCore::WebAnimation::stop):
        * animation/WebAnimation.h: Define WebAnimation to be an EventTarget and an ActiveDOMObject.
        * animation/WebAnimation.idl: Define WebAnimation to be an EventTarget and an ActiveDOMObject.
        * dom/EventTargetFactory.in:

2017-12-12  Chris Dumez  <cdumez@apple.com>

        Simplify IPC code between WebProcess and StorageProcess for serviceWorker.postMessage()
        https://bugs.webkit.org/show_bug.cgi?id=180683

        Reviewed by Brady Eidson.

        Merge the 2 code paths from calling postMessage() from a ServiceWorkerClient and from
        a ServiceWorker. Also, postMessage() now only IPCs an identifier from the WebContent
        process to the StorageProcess. The ServiceWorkerClientData is looked up on Storage
        process side from the identifier before being sent to the context process.

        * workers/service/SWClientConnection.h:
        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::postMessage):
        * workers/service/ServiceWorkerTypes.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::clientByID const):
        (WebCore::SWServer::matchAll):
        (WebCore::SWServer::forEachClientForOrigin):
        (WebCore::SWServer::claim):
        (WebCore::SWServer::registerServiceWorkerClient):
        (WebCore::SWServer::unregisterServiceWorkerClient):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::findClientByIdentifier):
        * workers/service/server/SWServerWorker.h:

2017-12-12  Youenn Fablet  <youenn@apple.com>

        Allow AudioContext to start when getUserMedia is on
        https://bugs.webkit.org/show_bug.cgi?id=180680

        Reviewed by Eric Carlson.

        Test: webrtc/getUserMedia-webaudio-autoplay.html

        * Modules/webaudio/AudioContext.cpp:
        (WebCore::AudioContext::willBeginPlayback):

2017-12-12  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Throw RangeError if a size is provided when creating a readable byte stream
        https://bugs.webkit.org/show_bug.cgi?id=180470

        Reviewed by Youenn Fablet.

        Throw a RangeError if a ReadableStream is created with type 'bytes' and with a
        non-undefined strategy size, as per latest spec:
        - https://github.com/whatwg/streams/pull/856
        - https://streams.spec.whatwg.org/#rs-constructor (step 4.c)

        One new test imported from WPT to check that RangeError is thrown.

        * Modules/streams/ReadableStream.js:
        (initializeReadableStream): Check strategy size and throw RangeError if needed.

2017-12-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][WebRTC] Stop warning with so much verbosity about not implemented RealtimeMediaSourceCenter
        https://bugs.webkit.org/show_bug.cgi?id=180694

        Reviewed by Youenn Fablet.

        No new tests -- no change in functionality.

        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::singleton):

2017-12-12  Ms2ger  <Ms2ger@igalia.com>

        Implement {DOMMimeTypeArray, DOMPluginArray}::supportedPropertyNames().
        https://bugs.webkit.org/show_bug.cgi?id=180471

        Reviewed by Darin Adler.

        Test: imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator-pluginarray.html

        * plugins/DOMMimeTypeArray.cpp:
        (WebCore::DOMMimeTypeArray::supportedPropertyNames):
        * plugins/DOMPluginArray.cpp:
        (WebCore::DOMPluginArray::supportedPropertyNames):

2017-12-12  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Thread::create should have Thread::tryCreate
        https://bugs.webkit.org/show_bug.cgi?id=180333

        Reviewed by Darin Adler.

        No behavior change.

        * bindings/js/GCController.cpp:
        (WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
        * platform/audio/ReverbConvolver.cpp:
        (WebCore::ReverbConvolver::ReverbConvolver):
        * platform/audio/ReverbConvolver.h:
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::start):

2017-12-11  Manuel Rego Casasnovas  <rego@igalia.com>

        [css-grid] Automatic minimum size is not clamped if min track sizing function is auto
        https://bugs.webkit.org/show_bug.cgi?id=180283

        Reviewed by Darin Adler.

        We were not clamping the automatic minimum size when
        the min track sizing function was intrinsic (e.g. minmax(auto, 0px)).
        However the spec (https://drafts.csswg.org/css-grid/#min-size-auto)
        is very clear regarding that.

        This patch modifies
        GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem(),
        so in the case of a fixed max track sizing function it clamps
        the automatic minimum size of the item to the stretch fit
        of the grid area's size.
        It needs to take into account if the item has fixed size, margin, border
        and/or padding as those cannot be clamped.

        Using WPT tests to verify this behavior,
        and corrected a bunch of other tests that were wrong.

        Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-017.html
              imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-022.html
              imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-minimum-size-grid-items-023.html

        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
        * rendering/GridTrackSizingAlgorithm.h:
        (WebCore::GridTrack::growthLimitIsInfinite const):
        * rendering/style/GridTrackSize.h:
        (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes):
        (WebCore::GridTrackSize::hasFixedMaxTrackBreadth const):

2017-12-11  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Cairo::clipToImageBuffer() should operate on a cairo_surface_t
        https://bugs.webkit.org/show_bug.cgi?id=180665

        Reviewed by Michael Catanzaro.

        Have the Cairo::clipToImageBuffer() function in the CairoUtilities code
        operate on a cairo_surface_t object, instead of an Image object.

        Call site in GraphicsContext::clipToImageBuffer() is adjusted to first
        ensure a non-null Image object, and then retrieve a cairo_surface_t
        object from that, passing it on to Cairo::clipToImageBuffer().

        No new tests -- no change in functionality.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::clipToImageBuffer):
        * platform/graphics/cairo/CairoOperations.h:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::clipToImageBuffer):

2017-12-11  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Don't use a static cairo_surface_t object for CairoPath contexts
        https://bugs.webkit.org/show_bug.cgi?id=180663

        Reviewed by Michael Catanzaro.

        Instead of using a single cairo_surface_t object and sharing it between
        different cairo_t objects handled by CairoPath, create a new mock 1x1px
        alpha-only surface for each cairo_t object that's allocated in the
        CairoPath constructor.

        This avoids potential issues in how Cairo's state handling internally
        uses these surfaces, which is completely opaque to us and out of our
        control. This also avoids crashes when using this one cairo_surface_t
        object through different CairoPath objects across different threads.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/PlatformPathCairo.cpp:
        (WebCore::CairoPath::CairoPath):
        (WebCore::pathSurface): Deleted.
        * platform/graphics/cairo/PlatformPathCairo.h:
        (WebCore::CairoPath::context):

2017-12-11  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Move UpdateAtlas, AreaAllocator into the platform layer
        https://bugs.webkit.org/show_bug.cgi?id=180641

        Reviewed by Michael Catanzaro.

        Move the UpdateAtlas and AreaAllocator classes and their source files
        into the platform layer. This still means using the WebCore namespace,
        but apart from that these two classes have no dependency on anything in
        the WebKit layer, so they can be moved from there.

        No new tests -- no change in functionality.

        * platform/TextureMapper.cmake:
        * platform/graphics/texmap/coordinated/AreaAllocator.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp.
        (WebCore::AreaAllocator::AreaAllocator):
        (WebCore::AreaAllocator::~AreaAllocator):
        (WebCore::AreaAllocator::expand):
        (WebCore::AreaAllocator::expandBy):
        (WebCore::AreaAllocator::release):
        (WebCore::AreaAllocator::overhead const):
        (WebCore::AreaAllocator::roundAllocation const):
        (WebCore::GeneralAreaAllocator::GeneralAreaAllocator):
        (WebCore::GeneralAreaAllocator::~GeneralAreaAllocator):
        (WebCore::GeneralAreaAllocator::freeNode):
        (WebCore::GeneralAreaAllocator::expand):
        (WebCore::fitsWithin):
        (WebCore::GeneralAreaAllocator::allocate):
        (WebCore::GeneralAreaAllocator::allocateFromNode):
        (WebCore::GeneralAreaAllocator::splitNode):
        (WebCore::GeneralAreaAllocator::updateLargestFree):
        (WebCore::GeneralAreaAllocator::release):
        (WebCore::GeneralAreaAllocator::overhead const):
        * platform/graphics/texmap/coordinated/AreaAllocator.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h.
        (WebCore::nextPowerOfTwo):
        (WebCore::AreaAllocator::size const):
        (WebCore::AreaAllocator::minimumAllocation const):
        (WebCore::AreaAllocator::setMinimumAllocation):
        (WebCore::AreaAllocator::margin const):
        (WebCore::AreaAllocator::setMargin):
        * platform/graphics/texmap/coordinated/UpdateAtlas.cpp: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp.
        (WebCore::UpdateAtlas::UpdateAtlas):
        (WebCore::UpdateAtlas::~UpdateAtlas):
        (WebCore::UpdateAtlas::buildLayoutIfNeeded):
        (WebCore::UpdateAtlas::didSwapBuffers):
        (WebCore::UpdateAtlas::getCoordinatedBuffer):
        * platform/graphics/texmap/coordinated/UpdateAtlas.h: Renamed from Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h.
        (WebCore::UpdateAtlas::size const):
        (WebCore::UpdateAtlas::supportsAlpha const):
        (WebCore::UpdateAtlas::addTimeInactive):
        (WebCore::UpdateAtlas::isInactive const):
        (WebCore::UpdateAtlas::isInUse const):

2017-12-11  Ryosuke Niwa  <rniwa@webkit.org>

        Disable NoEventDispatchAssertion release assertion in WebKit1
        https://bugs.webkit.org/show_bug.cgi?id=180616

        Reviewed by Zalan Bujtas.

        Disabled the release assertion for NoEventDispatchAssertion in WebKit1 since there are many
        delegate callbacks that happen at unsafe timing, and we don't have any hope of fixing them
        in short term.

        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::canExecuteScripts):
        * dom/Document.cpp:
        (WebCore::isSafeToUpdateStyleOrLayout):
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::executeClassicScript):
        * platform/RuntimeApplicationChecks.h:
        (WebCore::isInWebProcess):
        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
        (WebCore::isInWebProcess): Extracted from IOSApplication::isWebProcess.
        (WebCore::IOSApplication::isWebProcess):

2017-12-11  Darin Adler  <darin@apple.com>

        Improve FontSelectionAlgorithm, including moving from IntegerHasher to Hasher
        https://bugs.webkit.org/show_bug.cgi?id=180340

        Reviewed by Dan Bates.

        * css/CSSFontFaceSet.h: Moved FontSelectionRequestKey and FontSelectionRequestKeyHash
        here to be private members, and used a std::optional instead of a class for this.
        Also use the new Hasher to compute the hash. Also added FontSelectionRequestKeyHashTraits.

        * platform/graphics/FontDescription.cpp:
        (WebCore::FontDescription::FontDescription): Updated since FontSelectionRequest
        does not always have a constructor any more.

        * platform/graphics/FontSelectionAlgorithm.h: Tweaked comments. Used "using" instead
        of typedef. Formatted some trivial functions as single lines. Stopped using
        NeverDestroyed for simple classes like FontSelectionValue; it's not needed unless
        there is a destructor. Got rid of some incorrect use of const. Replaced some member
        functions with non-member functions. Moved some function bodies out of class definitions.
        Used a lot of constexpr functions.
        (WebCore::FontSelectionRequest::tied const): Added so we can easily write both == and the
        hash function without listing the data members.
        (WebCore::add): Added an overload so we can hash things that include FontSelectionRequest.
        (WebCore::FontSelectionRequestKey::FontSelectionRequestKey): Changed this class to
        use std::optional instead of a separate boolean for deleted values.
        (WebCore::FontSelectionRequestKey::isHashTableDeletedValue const): Ditto.
        (WebCore::FontSelectionRequestKey::operator== const): Ditto.
        (WebCore::FontSelectionRequestKeyHash::hash): Ditto.
        (WebCore::FontSelectionRequestKeyHash::equal): Ditto.
        (WebCore::FontSelectionCapabilities::tied const): Added so we can easily write both ==
        and the hash function without listing the data members.
        (WebCore::FontSelectionSpecifiedCapabilities::tied const): Ditto.
        (WebCore::FontSelectionAlgorithm::FontSelectionAlgorithm): Use make_unique instead of new.

        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::findClosestFont): Move in the vector instead of copying it when creating a
        FontSelectionAlgorithm object.

2017-12-11  Jer Noble  <jer.noble@apple.com>

        [EME] support update() for FairPlayStreaming in Modern EME API
        https://bugs.webkit.org/show_bug.cgi?id=180542

        Reviewed by Eric Carlson.

        Support the updateLicense() method in CDMInstanceFairPlayStreaming. Also, support adding a
        AVStreamDataParser to the AVContentKeySession.

        Drive-by fixes:

        - Sometimes, AVFoundation will give us a base64 encoded string with spaces url-disallowed
        characters, so use base64Decode() rather than base64URLDecode().

        * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
        (WebCore::validFairPlayStreamingSchemes):
        (WebCore::extractSinfData):
        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstance const):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
        (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):

2017-12-11  Eric Carlson  <eric.carlson@apple.com>

        Web Inspector: Optionally log WebKit log parameters as JSON
        https://bugs.webkit.org/show_bug.cgi?id=180529
        <rdar://problem/35909462>

        Reviewed by Joseph Pecoraro.

        * dom/Document.cpp:
        (WebCore::Document::didLogMessage):Update for API change. Don't check for main thread, that
        is already done in addConsoleMessage.
        * dom/Document.h:

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::updatePlayState): Cleanup logging.

        * html/track/DataCue.cpp:
        (WebCore::DataCue::toJSONString const): Serialize to JSON string.
        (WebCore::DataCue::toString const): Deleted.
        * html/track/DataCue.h:
        (WTF::LogArgument<WebCore::DataCue>::toString):

        * html/track/TextTrackCue.cpp:
        (WebCore::TextTrackCue::toJSON const): Ditto.
        (WebCore::TextTrackCue::toJSONString const):
        (WebCore::TextTrackCue::toString const): Deleted.
        * html/track/TextTrackCue.h:
        (WTF::LogArgument<WebCore::TextTrackCue>::toString):

        * html/track/TextTrackCueGeneric.cpp:
        (WebCore::TextTrackCueGeneric::toJSONString const): Ditto.
        (WebCore::TextTrackCueGeneric::toString const): Deleted.
        * html/track/TextTrackCueGeneric.h:
        (WTF::LogArgument<WebCore::TextTrackCueGeneric>::toString):

        * html/track/VTTCue.cpp:
        (WebCore::VTTCue::toJSONString const): Ditto.
        (WebCore::VTTCue::toString const): Deleted.
        * html/track/VTTCue.h:
        (WTF::LogArgument<WebCore::VTTCue>::toString):

        * platform/graphics/InbandTextTrackPrivateClient.h:
        (WebCore::GenericCueData::toJSONString const): Ditto.
        (WTF::LogArgument<WebCore::GenericCueData>::toString):
        (WebCore::GenericCueData::toString const): Deleted.

        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
        (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Cleanup logging.
        (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues): Ditto.
        (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Log the entire cue.
        (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): Cleanup logging.

        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable const): Don't log, it isn't
        interesting and happens frequently.
        (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable const): Ditto.

        * platform/graphics/iso/ISOVTTCue.cpp:
        (WebCore::ISOWebVTTCue::toJSONString const): Serialize to JSON string.

        * platform/graphics/iso/ISOVTTCue.h:
        (WTF::LogArgument<WebCore::ISOWebVTTCue>::toString): Ditto.

2017-12-11  Youenn Fablet  <youenn@apple.com>

        Use VCP H264 encoder for platforms supporting it
        https://bugs.webkit.org/show_bug.cgi?id=179076
        rdar://problem/35180773

        Reviewed by Eric Carlson.

        Covered by existing test coverage.

        * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp:
        (WebCore::VideoToolboxVideoEncoderFactory::setActive):
        (WebCore::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder):
        (WebCore::VideoToolboxVideoEncoderFactory::DestroyVideoEncoder):
        * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.h:

2017-12-11  Chris Dumez  <cdumez@apple.com>

        Merge ServiceWorkerClientIdentifier into ServiceWorkerClientData
        https://bugs.webkit.org/show_bug.cgi?id=180669

        Reviewed by Youenn Fablet.

        Merge ServiceWorkerClientIdentifier into ServiceWorkerClientData, for consistency with
        ServiceWorkerIdentifier / ServiceWorkerData, and start simplifying the postMessage() code.

        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::Document::setServiceWorkerConnection):
        * workers/service/SWClientConnection.h:
        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::postMessage):
        * workers/service/ServiceWorkerClient.cpp:
        (WebCore::ServiceWorkerClient::getOrCreate):
        (WebCore::ServiceWorkerClient::ServiceWorkerClient):
        * workers/service/ServiceWorkerClient.h:
        (WebCore::ServiceWorkerClient::identifier const):
        * workers/service/ServiceWorkerClientData.cpp:
        (WebCore::ServiceWorkerClientData::isolatedCopy const):
        (WebCore::ServiceWorkerClientData::from):
        * workers/service/ServiceWorkerClientData.h:
        (WebCore::ServiceWorkerClientData::encode const):
        (WebCore::ServiceWorkerClientData::decode):
        * workers/service/ServiceWorkerClientInformation.h: Removed.
        * workers/service/ServiceWorkerClients.cpp:
        (WebCore::didFinishGetRequest):
        (WebCore::ServiceWorkerClients::get):
        (WebCore::matchAllCompleted):
        * workers/service/ServiceWorkerTypes.h:
        * workers/service/ServiceWorkerWindowClient.cpp:
        (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
        * workers/service/ServiceWorkerWindowClient.h:
        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::postMessageToServiceWorker):
        * workers/service/context/SWContextManager.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::findClientByIdentifier):
        (WebCore::SWServer::matchAll):
        (WebCore::SWServer::claim):
        (WebCore::SWServer::registerServiceWorkerClient):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerToContextConnection.h:
        * workers/service/server/SWServerWorker.h:

2017-12-11  Daniel Bates  <dabates@apple.com>

        Fix the macOS Sierra build following r225179
        (https://bugs.webkit.org/show_bug.cgi?id=180011)

        Substitute TARGET_MAC_OS_X_VERSION_LESS_THAN_101300 for TARGET_MAC_OS_X_VERSION_LESS_THAN_1013000.

        * Configurations/WebCore.xcconfig:

2017-12-11  Zalan Bujtas  <zalan@apple.com>

        Make FrameView objects IsoHeap allocated
        https://bugs.webkit.org/show_bug.cgi?id=180668
        <rdar://problem/35976738>

        Reviewed by Simon Fraser.

        Related to <https://trac.webkit.org/changeset/225719/webkit>

        * page/FrameView.cpp:
        * page/FrameView.h:

2017-12-11  Antoine Quint  <graouts@apple.com>

        [Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
        https://bugs.webkit.org/show_bug.cgi?id=180647

        Reviewed by Dean Jackson.

        Actually fix Windows build this time.

        * animation/AnimationPlaybackEventInit.h:

2017-12-11  Antoine Quint  <graouts@apple.com>

        [Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
        https://bugs.webkit.org/show_bug.cgi?id=180647
        <rdar://problem/35966325>

        Reviewed by Dean Jackson.

        Unreviewed, fix Windows build.

        * animation/AnimationPlaybackEventInit.h:

2017-12-11  Zalan Bujtas  <zalan@apple.com>

        FloatingObjects/FloatingObject classes should hold weak references to renderers
        https://bugs.webkit.org/show_bug.cgi?id=180627
        <rdar://problem/35954069>

        Reviewed by Antti Koivisto.

        * rendering/FloatingObjects.cpp:
        (WebCore::FloatingObject::FloatingObject):
        (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
        (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter):
        (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter):
        (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
        (WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
        (WebCore::FloatingObjects::findNextFloatLogicalBottomBelow):
        (WebCore::FloatingObjects::findNextFloatLogicalBottomBelowForBlock):
        (WebCore::FloatingObjects::FloatingObjects):
        (WebCore::FloatingObjects::clearLineBoxTreePointers):
        (WebCore::FloatingObjects::logicalLeftOffsetForPositioningFloat):
        (WebCore::FloatingObjects::logicalRightOffsetForPositioningFloat):
        (WebCore::FloatingObjects::logicalLeftOffset):
        (WebCore::FloatingObjects::logicalRightOffset):
        (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
        (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
        (WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatTypeValue>::heightRemaining const):
        (WebCore::ComputeFloatOffsetAdapter<FloatTypeValue>::collectIfNeeded):
        (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
        (WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
        * rendering/FloatingObjects.h:
        (WebCore::FloatingObject::renderer const):
        (WebCore::FloatingObjects::renderer const):

2017-12-11  David Quesada  <david_quesada@apple.com>

        Turn on ENABLE_APPLICATION_MANIFEST
        https://bugs.webkit.org/show_bug.cgi?id=180562
        rdar://problem/35924737

        Reviewed by Geoffrey Garen.

        * Configurations/FeatureDefines.xcconfig:
        * loader/LinkLoader.cpp:
        (WebCore::createLinkPreloadResourceClient):
        * loader/cached/CachedResourceRequest.cpp:
            Add a missing #include that was implicitly added in the unified source when
            the feature is disabled.

2017-12-11  Dean Jackson  <dino@apple.com>

        Add a runtime feature flag for ImageBitmap and OffscreenCanvas
        https://bugs.webkit.org/show_bug.cgi?id=180652
        <rdar://problem/35969611>

        Reviewed by Antoine Quint.

        Add a RuntimeEnabledFeature for these interfaces, and link the bindings
        to the feature.

        Test: fast/canvas/offscreen-enabled.html

        * bindings/js/WebCoreBuiltinNames.h:
        * html/ImageBitmap.idl:
        * html/OffscreenCanvas.idl:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setImageBitmapOffscreenCanvasEnabled):
        (WebCore::RuntimeEnabledFeatures::imageBitmapOffscreenCanvasEnabled const):
        * page/WindowOrWorkerGlobalScope.idl:

2017-12-11  Antoine Quint  <graouts@apple.com>

        [Web Animations] Implement AnimationPlaybackEvent and AnimationPlaybackEventInit
        https://bugs.webkit.org/show_bug.cgi?id=180647
        <rdar://problem/35966325>

        Reviewed by Dean Jackson.

        We implement the AnimationPlaybackEvent interface and AnimationPlaybackEventInit dictionary
        as the first step towards dispatching animation "finish" and "cancel" events.

        Animation playback events will be dispatched on Animation objects and expose the timeline time
        and animation current time at the time they were constructed. Dispatch itself, which will be
        the focus of the next patch, is not synchronous, so it's important to track those values
        at creation time.

        No new tests yet, followup patches will enable event dispatch and existing Web Platform Tests
        will show progressions.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * animation/AnimationPlaybackEvent.cpp: Added.
        (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
        (WebCore::AnimationPlaybackEvent::bindingsCurrentTime const):
        (WebCore::AnimationPlaybackEvent::bindingsTimelineTime const):
        * animation/AnimationPlaybackEvent.h: Added.
        * animation/AnimationPlaybackEvent.idl: Added.
        * animation/AnimationPlaybackEventInit.h: Added.
        * animation/AnimationPlaybackEventInit.idl: Added.
        * bindings/js/WebCoreBuiltinNames.h:
        * dom/EventNames.in:

2017-12-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [WinCairo] DumpRenderTree times out for all non-http tests
        https://bugs.webkit.org/show_bug.cgi?id=180571

        Reviewed by Alex Christensen.

        Bug fix on processing the curl event for file protocol.

        No new tests. This fix is to run existing tests.

        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::completeDidReceiveResponse):
        * platform/network/curl/CurlRequest.h:
        (WebCore::CurlRequest::isCompleted const):
        (WebCore::CurlRequest::isCancelled const):
        (WebCore::CurlRequest::isCompletedOrCancelled const):

2017-12-11  Manuel Rego Casasnovas  <rego@igalia.com>

        REGRESSION(r221931): Row stretch doesn't work for grid container with min-height
        https://bugs.webkit.org/show_bug.cgi?id=180287

        Reviewed by Darin Adler.

        In r221931 we moved the stretch phase as the last step of
        the track sizing algorithm.
        However this introduced a regression as we were no longer
        taking into account the grid container min-width|height constraints
        during this step.

        The CSS WG modified the spec so it now defines what to do
        in these situations (https://drafts.csswg.org/css-grid/#algo-stretch):
          "If the free space is indefinite, but the grid container
           has a definite min-width/height, use that size to calculate
           the free space for this step instead."

        This patch adds a new method
        GridTrackSizingAlgorithmStrategy::freeSpaceForStretchAutoTracksStep().
        When we're in the DefiniteSizeStrategy it just returns the current
        free space.
        For the IndefiniteSizeStrategy in the columns case we don't need
        any special computation (the same that happens in
        recomputeUsedFlexFractionIfNeeded()); for rows it uses the min size
        of the grid container (respecting min-width|height properties)
        to calculate the free space.

        Test: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-stretch-respects-min-size-001.html

        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep const):
        (WebCore::DefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep const):
        (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks):
        * rendering/GridTrackSizingAlgorithm.h:

2017-12-10  Minsheng Liu  <lambda@liu.ms>

        Incorrect bounds inside <mover>/<munder> when a stretchy operator is present
        https://bugs.webkit.org/show_bug.cgi?id=179682

        Reviewed by Frédéric Wang.

        Currently a stretchy operator inside <mover>/<munder>/<munderover> is stretched
        during paint() rather than layout(), which leads to both end user confusion
        and many unexpected behaviors. This patch rewrites
        RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren()
        to both eliminate the issue and make operator stretching more standard
        conforming.

        A test is added to check the stretch width of stretchy operators in various
        scenarios:
        mathml/opentype/munderover-stretch-width.html

        A previous test is updated:
        mathml/opentype/opentype-stretchy-horizontal.html

        * rendering/mathml/RenderMathMLOperator.cpp:
        (WebCore::RenderMathMLOperator::stretchTo):
        (WebCore::RenderMathMLOperator::resetStretchSize):
        (WebCore::RenderMathMLOperator::paint):
        * rendering/mathml/RenderMathMLOperator.h:
        (WebCore::RenderMathMLOperator::setStretchWidthLocked):
        (WebCore::RenderMathMLOperator::isStretchWidthLocked const):
        * rendering/mathml/RenderMathMLUnderOver.cpp:
        (WebCore::toHorizontalStretchyOperator):
        (WebCore::fixLayoutAfterStretch):
        (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):

2017-12-10  Yusuke Suzuki  <utatane.tea@gmail.com>

        Unreviewed, follow-up patch after r225470
        https://bugs.webkit.org/show_bug.cgi?id=180308

        * Modules/webdatabase/SQLTransaction.cpp:
        (WebCore::SQLTransaction::checkAndHandleClosedDatabase):
        Use consistent operands.

        * bindings/js/JSCallbackData.h:
        (WebCore::JSCallbackData::JSCallbackData):
        Use class field initializer.

        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::openFunc):
        Use consistent operands.

2017-12-09  Ryosuke Niwa  <rniwa@webkit.org>

        iOS: Crash in Document::updateLayout() via Document::processViewport
        https://bugs.webkit.org/show_bug.cgi?id=180619
        <rdar://problem/35717575>

        Reviewed by Zalan Bujtas.

        The crash is caused by modern media controls updating the layout in the middle of insertedIntoAncestor
        via HTMLMediaElement::setControllerJSProperty inside Document::pageScaleFactorChangedAndStable.

        Fixed the crash by delaying the work to update the viewport configuration until didFinishInsertingNode
        since updating the viewport configuration results in a lot of related code running in response,
        and making sure all that code never tries to execute an author script is not attainable in the short term,
        and a maintenance nightmare in the long term.

        Test: media/ios/viewport-change-with-video.html

        * html/HTMLMetaElement.cpp:
        (WebCore::HTMLMetaElement::insertedIntoAncestor):
        (WebCore::HTMLMetaElement::didFinishInsertingNode): Added.
        * html/HTMLMetaElement.h:

2017-12-08  Zalan Bujtas  <zalan@apple.com>

        Document::updateLayout() could destroy current frame.
        https://bugs.webkit.org/show_bug.cgi?id=180525
        <rdar://problem/35906836>

        Reviewed by Simon Fraser.

        Early return when Document::updateLayout() triggers Frame destruction.

        Test: fast/frames/crash-when-iframe-is-remove-in-eventhandler.html

        * dom/TreeScope.cpp:
        (WebCore::absolutePointIfNotClipped):

2017-12-08  Chris Dumez  <cdumez@apple.com>

        ServiceWorkerGlobalScope is a global object and should be marked as [ImplicitThis] in the IDL
        https://bugs.webkit.org/show_bug.cgi?id=180615

        Reviewed by Brady Eidson.

        ServiceWorkerGlobalScope is a global object and should be marked as [ImplicitThis] in the IDL, similarly to what we do for Window.
        This allows a getter to be fallback to the global object as ThisValue when the cast of the ThisValue to the expected type fails.

        No new tests, rebaselined existing test.

        * workers/DedicatedWorkerGlobalScope.idl:
        * workers/WorkerGlobalScope.idl:
        * workers/service/ServiceWorkerGlobalScope.idl:

2017-12-08  Brady Eidson  <beidson@apple.com>

        Delay some service worker operations until after the database import completes.
        https://bugs.webkit.org/show_bug.cgi?id=180573

        Reviewed by Chris Dumez.

        No new tests (Not testable yet).

        Right after the storage process launches it starts importing registration records.
        During this time, a lot of the decisions we make regarding registrations, fetch, etc.
        are invalid, as they rely on those in-memory records being in place.
        
        This patch delays certain things until after the initial origin table import is complete.
        
        * workers/service/server/RegistrationStore.cpp:
        (WebCore::RegistrationStore::databaseOpenedAndRecordsImported):

        * workers/service/server/SWOriginStore.h:

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::registrationStoreImportComplete): Tell the origin store the initial
          import was completed.
        (WebCore::SWServer::addRegistrationFromStore):
        * workers/service/server/SWServer.h:

2017-12-08  Youenn Fablet  <youenn@apple.com>

        Service Worker should use a correct user agent
        https://bugs.webkit.org/show_bug.cgi?id=180566
        <rdar://problem/35926295>

        Reviewed by Chris Dumez.

        Test: http/wpt/service-workers/useragent.https.html

        Make ServiceWorkerFrameLoaderClient return a valid UserAgent.
        Pass user agent to ServiceWorkerThread so that navigation.userAgent is correctly initialized.
        Allow ServiceWorkerFrameLoaderClient to clean itself when no longer needed.

        * loader/EmptyFrameLoaderClient.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::ServiceWorkerThread):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/context/ServiceWorkerThreadProxy.cpp:
        (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
        (WebCore::ServiceWorkerThreadProxy::frameLoaderClient):
        * workers/service/context/ServiceWorkerThreadProxy.h:

2017-12-07  Simon Fraser  <simon.fraser@apple.com>

        Wrong caret position for input field inside a fixed position parent on iOS 11
        https://bugs.webkit.org/show_bug.cgi?id=176896
        rdar://problem/33726145

        Reviewed by Tim Horton.

        In r219668 I added code to compute a layout viewport rect in the web process, so that
        after programmatic scrolling, getBoundingClientRect() would return the correct values.
        However, that computation sometimes used a different visual viewport than the UI process,
        resulting in a different layout viewport being set. This would happen when the keyboard
        was visible, and the combination of this and zooming when focusing an input would result
        in a state where the scrolling tree contained notes computed with the bad layout viewport.
        This could cause apparently offset fixed elements, and bad caret positioning if those fixed
        elements contained the focused input.

        Fix by passing to the web process the same visual viewport rect that the UI process is using,
        namely "unobscuredContentRectRespectingInputViewBounds". This was already being set in
        VisibleContentRectUpdateInfo but wasn't encoded/decoded, so fix that. Set it as an optional<>
        on FrameView when different from the normal visual viewport, and return it from
        visualViewportRect().

        Some other minor logging changes.

        Test: fast/visual-viewport/ios/caret-after-focus-in-fixed.html

        * page/FrameView.cpp:
        (WebCore::FrameView::setVisualViewportOverrideRect):
        (WebCore::FrameView::updateLayoutViewport):
        (WebCore::FrameView::visualViewportRect const):
        * page/FrameView.h:
        * page/scrolling/mac/ScrollingTreeFixedNode.mm:
        (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):

2017-12-08  Zalan Bujtas  <zalan@apple.com>

        Make inline box objects IsoHeap allocated.
        https://bugs.webkit.org/show_bug.cgi?id=180556
        <rdar://problem/35923629>

        Reviewed by Filip Pizlo.

        * rendering/EllipsisBox.cpp:
        * rendering/EllipsisBox.h:
        * rendering/InlineBox.cpp:
        * rendering/InlineBox.h:
        * rendering/InlineElementBox.cpp:
        * rendering/InlineElementBox.h:
        * rendering/InlineFlowBox.cpp:
        * rendering/InlineFlowBox.h:
        * rendering/InlineTextBox.cpp:
        * rendering/InlineTextBox.h:
        * rendering/RootInlineBox.cpp:
        * rendering/RootInlineBox.h:
        * rendering/TrailingFloatsRootInlineBox.h:
        * rendering/svg/SVGInlineFlowBox.cpp:
        * rendering/svg/SVGInlineFlowBox.h:
        * rendering/svg/SVGInlineTextBox.cpp:
        * rendering/svg/SVGInlineTextBox.h:
        * rendering/svg/SVGRootInlineBox.cpp:
        * rendering/svg/SVGRootInlineBox.h:

2017-12-08  Chris Dumez  <cdumez@apple.com>

        Clearing all Website Data should remove service worker registrations on disk
        https://bugs.webkit.org/show_bug.cgi?id=180558

        Reviewed by Youenn Fablet.

        Clear service worker registrations on disk in addition to the ones in memory.

        * workers/service/server/RegistrationDatabase.cpp:
        (WebCore::v1RecordsTableSchema):
        (WebCore::v1RecordsTableSchemaAlternate):
        (WebCore::databaseFilename):
        Make sure these always get called from the background thread since they use
        a static string.

        (WebCore::RegistrationDatabase::RegistrationDatabase):
        Call importRecordsIfNecessary() instead of openSQLiteDatabase(). importRecordsIfNecessary()
        only calls openSQLiteDatabase() if the database file exists, to avoid creating a database
        file unnecessarily.

        (WebCore::RegistrationDatabase::databasePath const):
        New method which returns the database file path.

        (WebCore::RegistrationDatabase::openSQLiteDatabase):

        (WebCore::RegistrationDatabase::importRecordsIfNecessary):
        New methods which imports records if the database file exist. It the database file does
        not exist, it does not create it.

        (WebCore::RegistrationDatabase::pushChanges):
        Call completion handler when changes are pushed.

        (WebCore::RegistrationDatabase::clearAll):
        Close the database if it is open, then remove the database files.

        (WebCore::RegistrationDatabase::doPushChanges):
        If the database is not already open, we now open it when trying to write changes for
        the first time.

        * workers/service/server/RegistrationDatabase.h:
        * workers/service/server/RegistrationStore.cpp:
        (WebCore::RegistrationStore::clearAll):
        (WebCore::RegistrationStore::flushChanges):
        * workers/service/server/RegistrationStore.h:

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::clearAll):
        (WebCore::SWServer::clear):
        Also clear the database.

        * workers/service/server/SWServer.h:

        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::terminate):
        Only call SWServer::terminateWorker() if the worker is running. Otherwise, we hit
        an assertion when clearing a registration would worker was already terminated.

2017-12-08  Joseph Pecoraro  <pecoraro@apple.com>

        ServiceWorker Inspector: Various issues inspecting service worker on mobile.twitter.com
        https://bugs.webkit.org/show_bug.cgi?id=180520
        <rdar://problem/35900764>

        Reviewed by Brian Burg.

        * inspector/agents/worker/ServiceWorkerAgent.cpp:
        (WebCore::ServiceWorkerAgent::getInitializationInfo):
        * inspector/agents/worker/ServiceWorkerAgent.h:
        Add initial script content to initialization so we always at least have main resource content.

2017-12-08  Joseph Pecoraro  <pecoraro@apple.com>

        ServiceWorker Inspector: Should be able to see image content from CacheStorage.add(url) network request
        https://bugs.webkit.org/show_bug.cgi?id=180506

        Reviewed by Brian Burg.

        No test as this only happens inside a ServiceWorker inspector which
        we don't yet have a way to test. In a Page Inspector, the
        CacheStorage.add network request already behaves as expected.

        * inspector/NetworkResourcesData.cpp:
        (WebCore::NetworkResourcesData::responseReceived):
        (WebCore::shouldBufferResourceData):
        * inspector/NetworkResourcesData.h:
        (WebCore::NetworkResourcesData::ResourceData::forceBufferData const):
        (WebCore::NetworkResourcesData::ResourceData::setForceBufferData):
        Provide a way to force buffering in NetworkResourceData.

        * inspector/agents/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::didReceiveResponse):
        * inspector/agents/InspectorNetworkAgent.h:
        * inspector/agents/page/PageNetworkAgent.h:
        * inspector/agents/worker/WorkerNetworkAgent.h:
        Enable force buffering in a Worker Network Agent.

2017-12-08  Daniel Bates  <dabates@apple.com>

        Remove unnecessary prefix from AutoFillButtonType enumerators
        https://bugs.webkit.org/show_bug.cgi?id=180512

        Reviewed by Tim Horton.

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

2017-12-08  Dean Jackson  <dino@apple.com>

        Implement transferToImageBitmap for WebGL offscreen canvas objects
        https://bugs.webkit.org/show_bug.cgi?id=180603
        <rdar://problem/34147143>

        Reviewed by Sam Weinig.

        Implement the basic version of creating an ImageBitmap from an
        OffscreenCanvas that is using a WebGL context.

        Tests: http/wpt/offscreen-canvas/transferToImageBitmap-empty.html
               http/wpt/offscreen-canvas/transferToImageBitmap-webgl.html

        * html/ImageBitmap.cpp:
        (WebCore::ImageBitmap::create): Add a new constructor to be used by OffscreenCanvas.
        Creates a blank ImageBitmap.
        * html/ImageBitmap.h:

        * html/OffscreenCanvas.cpp:
        (WebCore::OffscreenCanvas::transferToImageBitmap): Create a new ImageBitmap
        and paint the current canvas into it.

2017-12-08  Youenn Fablet  <youenn@apple.com>

        WebServiceWorkerProvider should use Cancellation error to notify DTL that it cannot handle a fetch
        https://bugs.webkit.org/show_bug.cgi?id=180584

        Reviewed by Alex Christensen.

        Previously, for each cross origin fetch that is going through a service worker and service worker is not handling the fetch,
        we return an AccessControl error so that DocumentThreadableLoader will do preflight and regular load through the network.
        This error is wrongly logged in the Inspector.
        Change error type to Cancellation so that the Inspector does not log it.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::didFail):

2017-12-08  Youenn Fablet  <youenn@apple.com>

        Service Worker should use a correct SessionID
        https://bugs.webkit.org/show_bug.cgi?id=180585

        Reviewed by Alex Christensen.

        Test: http/tests/workers/service/serviceworker-private-browsing.https.html

        Store SessionID in SWServer and send it as part of service worker instantiation.

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::SWServer):
        (WebCore::SWServer::installContextData):
        (WebCore::SWServer::runServiceWorker):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerToContextConnection.h:

2017-12-08  Youenn Fablet  <youenn@apple.com>

        FetchResponse should keep unfiltered ResourceResponse so that it can be used in Service Worker
        https://bugs.webkit.org/show_bug.cgi?id=179641
        <rdar://problem/35923570>

        Reviewed by Alex Christensen.

        Covered by existing rebased tests.

        FetchResponse will now store an unfiltered response.
        If it needs to expose it to JavaScript, it will create a filtered response lazily.
        This allows service worker to send back to web pages, opaque responses containing every information.

        Updating Document::initSecurityContext so that any document loaded with a response whose tainting is Opaque gets a unique origin.
        This ensures cross-origin checks to work if service worker returns such a response on a same origin URL.

        Updated SubresourceLoader to check cross origin service worker responses based on their tainting.

        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::create):
        (WebCore::FetchResponse::error):
        (WebCore::FetchResponse::redirect):
        (WebCore::FetchResponse::FetchResponse):
        (WebCore::FetchResponse::clone):
        (WebCore::FetchResponse::url const):
        (WebCore::FetchResponse::filteredResponse const):
        (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
        (WebCore::FetchResponse::resourceResponse const):
        * Modules/fetch/FetchResponse.h:
        (WebCore::FetchResponse::create): Deleted.
        * dom/Document.cpp:
        (WebCore::Document::initSecurityContext):
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::willSendRequestInternal):
        (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):

2017-12-08  David Quesada  <david_quesada@apple.com>

        ApplicationManifestParser should strip whitespace from the raw input
        https://bugs.webkit.org/show_bug.cgi?id=180539
        rdar://problem/35915075

        Reviewed by Joseph Pecoraro.

        * Modules/applicationmanifest/ApplicationManifestParser.cpp:
        (WebCore::ApplicationManifestParser::parseManifest):

2017-12-08  Eric Carlson  <eric.carlson@apple.com>

        Move Logger from PAL to WTF so it can be used outside of WebCore
        https://bugs.webkit.org/show_bug.cgi?id=180561

        Reviewed by Alex Christensen.

        No new tests, existing API test updated.

        * Modules/mediastream/PeerConnectionBackend.h:
        * Modules/mediastream/RTCPeerConnection.h:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        (PAL::LogArgument<webrtc::RTCStats>::toString): Deleted.
        * dom/Document.cpp:
        * dom/Document.h:
        * html/HTMLMediaElement.cpp:
        (PAL::LogArgument<WebCore::URL>::toString): Deleted.
        * html/HTMLMediaElement.h:
        * html/HTMLMediaElementEnums.h:
        (PAL::LogArgument<WebCore::HTMLMediaElementEnums::ReadyState>::toString): Deleted.
        (PAL::LogArgument<WebCore::HTMLMediaElementEnums::NetworkState>::toString): Deleted.
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::logger const):
        * html/MediaElementSession.h:
        * html/track/DataCue.h:
        (PAL::LogArgument<WebCore::DataCue>::toString): Deleted.
        * html/track/TextTrackCue.h:
        (PAL::LogArgument<WebCore::TextTrackCue>::toString): Deleted.
        * html/track/TextTrackCueGeneric.h:
        (PAL::LogArgument<WebCore::TextTrackCueGeneric>::toString): Deleted.
        * html/track/TrackBase.cpp:
        (WebCore::nullLogger):
        (WebCore::TrackBase::TrackBase):
        * html/track/TrackBase.h:
        * html/track/VTTCue.h:
        (PAL::LogArgument<WebCore::VTTCue>::toString): Deleted.
        * platform/graphics/InbandTextTrackPrivate.h:
        * platform/graphics/InbandTextTrackPrivateClient.h:
        (PAL::LogArgument<WebCore::GenericCueData>::toString): Deleted.
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::nullLogger):
        (WebCore::MediaPlayer::mediaPlayerLogger):
        * platform/graphics/MediaPlayer.h:
        (WTF::LogArgument<MediaTime>::toString):
        (PAL::LogArgument<WTF::MediaTime>::toString): Deleted.
        * platform/graphics/MediaPlayerEnums.h:
        (PAL::LogArgument<WebCore::MediaPlayerEnums::ReadyState>::toString): Deleted.
        (PAL::LogArgument<WebCore::MediaPlayerEnums::NetworkState>::toString): Deleted.
        * platform/graphics/TrackPrivateBase.cpp:
        (WebCore::TrackPrivateBase::setLogger):
        * platform/graphics/TrackPrivateBase.h:
        * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
        * platform/mediastream/RTCIceConnectionState.h:
        (PAL::LogArgument<WebCore::RTCIceConnectionState>::toString): Deleted.
        * platform/mediastream/RTCIceGatheringState.h:
        (PAL::LogArgument<WebCore::RTCIceGatheringState>::toString): Deleted.
        * platform/mediastream/RTCPeerConnectionState.h:
        (PAL::LogArgument<WebCore::RTCPeerConnectionState>::toString): Deleted.
        * platform/mediastream/RTCSignalingState.h:
        (PAL::LogArgument<WebCore::RTCSignalingState>::toString): Deleted.
        * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:

2017-12-08  Yusuke Suzuki  <utatane.tea@gmail.com>

        Remove pthread_once in favor of dispatch_once
        https://bugs.webkit.org/show_bug.cgi?id=180591

        Reviewed by Saam Barati.

        No behavior change.

        * platform/mac/WebCoreNSURLExtras.mm:
        (WebCore::allCharactersInIDNScriptWhiteList):
        (WebCore::readIDNScriptWhiteList): Deleted.

2017-12-08  Chris Dumez  <cdumez@apple.com>

        Improve error handling in RegistrationDatabase
        https://bugs.webkit.org/show_bug.cgi?id=180587

        Reviewed by Brady Eidson.

        * workers/service/server/RegistrationDatabase.cpp:
        (WebCore::RegistrationDatabase::openSQLiteDatabase):
        (WebCore::RegistrationDatabase::doPushChanges):

2017-12-07  Darin Adler  <darin@apple.com>

        Simplify and streamline some Color-related code to prepare for some Color/ExtendedColor work
        https://bugs.webkit.org/show_bug.cgi?id=180569

        Reviewed by Sam Weinig.

        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::colorValue const): Use valueAsColor instead of
        having custom code here to parse the color string.

        * css/CSSGradientValue.cpp:
        (WebCore::interpolate): Deleted.
        (WebCore::CSSGradientValue::computeStops): Call blend instead of interpolate. The only
        difference is that the interpolate function truncated when converting from floating point
        to integer, and the blend function rounds instead.

        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::colorFromPrimitiveValue const): Removed unneeded special case
        for identifier of 0, since StyleColor::colorFromKeyword already handles that correctly.
        Also got rid of unneded local variable "state".

        * html/ColorInputType.cpp:
        (WebCore::isValidSimpleColor): Rewrote to take a StringView instead of a String and
        to stay with a single loop since this does not need the extra efficiency of a separate
        8-bit and 16-bit character version. Renamed to more closely match what the specification
        calls this algorithm.
        (WebCore::parseSimpleColorValue): Added. To be used instead of relying on the behavior of
        the Color constructor that takes a String, so we can remove that later.
        (WebCore::ColorInputType::sanitizeValue const): Updated for name change.
        (WebCore::ColorInputType::valueAsColor const): Use parseSimpleColorValue instead of the
        Color constructor that takes a string.
        (WebCore::ColorInputType::typeMismatchFor const): Updated for name change.
        (WebCore::ColorInputType::selectColor): Updated to take a StringView instead of a Color.
        Note that this function is used for testing only.

        * html/ColorInputType.h: Marked everything final instead of override. Updated the
        selectColor function to take a StringView instead of a Color.

        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::selectColor): Take a StringView instead of a Color.
        * html/HTMLInputElement.h: Ditto.

        * html/InputType.cpp:
        (WebCore::InputType::selectColor): Take a StringView instead of a Color.
        * html/InputType.h: Ditto.

        * testing/Internals.cpp:
        (WebCore::Internals::selectColorInColorChooser): Pass the string directly instead of
        constructing a Color with it.
        (WebCore::Internals::setViewBaseBackgroundColor): Instead of pasring the passed in string
        with the Color constructor, implemented the two names that are actually used with this
        function in tests: "transparent" and "white".

2017-12-08  Konstantin Tokarev  <annulen@yandex.ru>

        Unreviewed, fix wrong letter case in #import HTMLIframeElement.h

        * editing/cocoa/WebContentReaderCocoa.mm:

2017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>

        Use WTF::RecursiveLockAdapter instead of using pthread_mutex_t with recursive lock option
        https://bugs.webkit.org/show_bug.cgi?id=180449

        Reviewed by Mark Lam.

        Use WTF::RecursiveLockAdapter<StaticLock> instead. We can remove pthread_mutex_xxx,
        pthread_once and FontLocker wrapper.

        * platform/graphics/FontCache.cpp:
        (WebCore::FontCache::getCachedFontPlatformData):
        (WebCore::FontCache::fontForPlatformData):
        (WebCore::FontCache::purgeInactiveFontData):
        (WebCore::FontCache::inactiveFontCount):
        (initFontCacheLockOnce): Deleted.
        (FontLocker::FontLocker): Deleted.
        (FontLocker::~FontLocker): Deleted.

2017-12-07  Eric Carlson  <eric.carlson@apple.com>

        Simplify log channel configuration UI
        https://bugs.webkit.org/show_bug.cgi?id=180527
        <rdar://problem/35908382>

        Reviewed by Joseph Pecoraro.

        No new tests, updated existing test.

        * inspector/agents/WebConsoleAgent.cpp:
        (WebCore::WebConsoleAgent::getLoggingChannels):
        (WebCore::channelConfigurationForString):

2017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>

        Use StaticLock instead of NeverDestroyed<Lock>
        https://bugs.webkit.org/show_bug.cgi?id=180507

        Reviewed by Saam Barati.

        StaticLock can be used instead of using NeverDestroyed<Lock>.

        No behavior change.

        * Modules/webdatabase/Database.cpp:
        (WebCore::Database::performOpenAndVerify):
        * Modules/webdatabase/DatabaseTracker.cpp:
        (WebCore::DatabaseTracker::openDatabaseMutex):
        (WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskWillBeScheduled):
        (WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskDidFinish):
        (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
        (WebCore::DatabaseTracker::scheduleForNotification):
        (WebCore::DatabaseTracker::notifyDatabasesChanged):
        (WebCore::notificationMutex): Deleted.
        * Modules/webdatabase/DatabaseTracker.h:
        * platform/URL.cpp:
        (WebCore::registerDefaultPortForProtocolForTesting):
        (WebCore::clearDefaultPortForProtocolMapForTesting):
        (WebCore::defaultPortForProtocol):
        (WebCore::defaultPortForProtocolMapForTestingLock): Deleted.
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::buildMediaEnginesVector):
        (WebCore::installedMediaEngines):
        (WebCore::MediaPlayer::resetMediaEngines):
        (WebCore::mediaEngineVectorLock): Deleted.
        * platform/ios/QuickLook.mm:
        (WebCore::removeQLPreviewConverterForURL):
        (WebCore::addQLPreviewConverterWithFileForURL):
        (WebCore::qlPreviewConverterDictionaryMutex): Deleted.
        * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
        (+[WebDatabaseTransactionBackgroundTaskController startBackgroundTask]):
        (+[WebDatabaseTransactionBackgroundTaskController endBackgroundTask]):
        (transactionBackgroundTaskIdentifierLock): Deleted.
        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlShareHandle::lockCallback):
        (WebCore::CurlShareHandle::unlockCallback):
        (WebCore::CurlShareHandle::mutexFor):
        * platform/network/curl/CurlContext.h:

2017-12-07  Brady Eidson  <beidson@apple.com>

        Read registrations in from disk.
        https://bugs.webkit.org/show_bug.cgi?id=180543

        Reviewed by Andy Estes.

        No new tests (Not testable quite yet)

        On launch, read through the database.

        Set up enough objects in the SWServer necessary to cause fetches and postMessages to
        go to a worker that has never run before.

        * workers/service/ServiceWorkerContextData.cpp:
        (WebCore::ServiceWorkerContextData::isolatedCopy const):
        * workers/service/ServiceWorkerContextData.h:
        (WebCore::ServiceWorkerContextData::encode const):
        (WebCore::ServiceWorkerContextData::decode):

        * workers/service/ServiceWorkerRegistrationKey.cpp:
        (WebCore::ServiceWorkerRegistrationKey::toDatabaseKey const):
        (WebCore::ServiceWorkerRegistrationKey::fromDatabaseKey):
        * workers/service/ServiceWorkerRegistrationKey.h:

        * workers/service/server/RegistrationDatabase.cpp:
        (WebCore::stringToUpdateViaCache):
        (WebCore::stringToWorkerType):
        (WebCore::RegistrationDatabase::doPushChanges):
        (WebCore::RegistrationDatabase::importRecords):
        (WebCore::RegistrationDatabase::addRegistrationToStore):
        * workers/service/server/RegistrationDatabase.h:

        * workers/service/server/RegistrationStore.cpp:
        (WebCore::RegistrationStore::RegistrationStore):
        (WebCore::RegistrationStore::addRegistrationFromDatabase):
        * workers/service/server/RegistrationStore.h:

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::addRegistrationFromStore):
        (WebCore::SWServer::SWServer):
        (WebCore::SWServer::updateWorker):
        (WebCore::SWServer::tryInstallContextData):
        (WebCore::SWServer::installContextData):
        (WebCore::generateServiceWorkerIdentifier): Deleted.
        * workers/service/server/SWServer.h:

        * workers/service/server/SWServerRegistration.h:

        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::contextData const):

2017-12-07  Yusuke Suzuki  <utatane.tea@gmail.com>

        Use WTF Locking primitives in WebThread and drop pthread_xxx use
        https://bugs.webkit.org/show_bug.cgi?id=180445

        Reviewed by Saam Barati.

        We remove use of pthread locking primitives from WebThread implementation,
        and use WTF Lock and Condition instead.

        No behavior change.

        * platform/ios/wak/WebCoreThread.mm:
        (HandleDelegateSource):
        (SendDelegateMessage):
        (WebThreadRunOnMainThread):
        (WebThreadAdoptAndRelease):
        (WebCoreObjCDeallocOnWebThreadImpl):
        (WebCoreObjCDeallocWithWebThreadLockImpl):
        (HandleWebThreadReleaseSource):
        (_WebThreadAutoLock):
        (WebRunLoopLockInternal):
        (CurrentThreadContext):
        Use WTF::ThreadSpecific.

        (StartWebThread):
        (_WebThreadLock):
        Remove `shouldTry` parameter since it is always `false`. We clean up code based on `shouldTry = false`,
        and rename it from _WebTryThreadLock to _WebThreadLock since it does not try now.

        (_WebThreadLockFromAnyThread):
        (WebThreadUnlockFromAnyThread):
        (_WebThreadUnlock):
        (lockWebCoreReleaseLock): Deleted.
        (unlockWebCoreReleaseLock): Deleted.
        (WebTimedConditionLock): Deleted.
        (_WebTryThreadLock): Deleted.

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

        Fix API test after r225645.
        https://bugs.webkit.org/show_bug.cgi?id=180544

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadURL):
        (WebCore::FrameLoader::loadWithDocumentLoader):
        The API test WebKitLegacy.FragmentNavigation started failing after r225645.
        It does call the completion handler with ignore to cancel fragment navigation.
        To make this work and increase compatibility, only synchronously continue with
        fragment navigations if we haven't received a synchronous answer to the
        decidePolicyForNavigationAction callback.

2017-12-07  Oleksandr Skachkov  <gskachkov@gmail.com>

        WebAssembly: sending module to iframe fails
        https://bugs.webkit.org/show_bug.cgi?id=179263

        Reviewed by JF Bastien.

        Allow use WebAssembly.Module as input parameters for postMessage 
        in window and iframe object.

        Tests: wasm/iframe-postmessage.html
               wasm/window-postmessage.html

        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneSerializer::dumpIfTerminal):
        * bindings/js/SerializedScriptValue.h:
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::postMessage):

2017-12-07  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Fix style in remote inspector classes
        https://bugs.webkit.org/show_bug.cgi?id=180545

        Reviewed by Youenn Fablet.

        * page/PageDebuggable.h:
        * workers/service/context/ServiceWorkerDebuggable.h:

2017-12-07  Antti Koivisto  <antti@apple.com>

        Move security origin filtering for getMatchedCSSRules out of StyleResolver
        https://bugs.webkit.org/show_bug.cgi?id=180468

        Reviewed by Zalan Bujtas.

        The non-standard getMatchedCSSRules API should not return rules from stylesheets in different security origins.
        To implement this we currently have lots of invasive code in StyleResolver, RuleSets and ElementRuleCollector
        basically passing around a bit. This also makes RuleSets document specific blocking optimizations.

        This patches replaces the mechanism with a bit in StyleRule which is much simpler.

        * css/DocumentRuleSets.cpp:
        (WebCore::makeRuleSet):
        * css/ElementRuleCollector.cpp:
        (WebCore::ElementRuleCollector::collectMatchingRulesForList):
        * css/ElementRuleCollector.h:
        (WebCore::ElementRuleCollector::setPseudoStyleRequest):
        (WebCore::ElementRuleCollector::setSameOriginOnly): Deleted.
        * css/RuleFeature.cpp:
        (WebCore::RuleFeatureSet::collectFeatures):
        * css/RuleFeature.h:
        (WebCore::RuleFeature::RuleFeature):
        * css/RuleSet.cpp:
        (WebCore::RuleData::RuleData):
        (WebCore::RuleSet::addRule):
        (WebCore::RuleSet::addChildRules):
        (WebCore::RuleSet::addRulesFromSheet):
        (WebCore::RuleSet::addStyleRule):
        * css/RuleSet.h:
        (WebCore::RuleData::linkMatchType const):
        (WebCore::RuleData::hasDocumentSecurityOrigin const): Deleted.
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::pseudoStyleRulesForElement):
        * css/StyleResolver.h:
        * css/StyleRule.cpp:
        (WebCore::StyleRule::StyleRule):
        (WebCore::StyleRule::createForSplitting):
        (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount const):
        (WebCore::StyleRule::create): Deleted.
        * css/StyleRule.h:
        (WebCore::StyleRuleBase::StyleRuleBase):
        (WebCore::StyleRuleBase::hasDocumentSecurityOrigin const):

            Add a bit.

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

            Include hasDocumentSecurityOrigin bit to parser context. This means that a stylesheet data structures
            can't be shared between a contexts where this differs. This likely very rare in practice.

        (WebCore::operator==):
        * css/parser/CSSParserImpl.cpp:
        (WebCore::CSSParserImpl::consumeStyleRule):
        * css/parser/CSSParserMode.h:
        (WebCore::CSSParserContextHash::hash):
        * editing/EditingStyle.cpp:
        (WebCore::EditingStyle::mergeStyleFromRules):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::getMatchedCSSRules const):

            Filter out rules from different security origin after getting them from style resolver.

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

        AX: Document::existingAXObjectCache() should always return the existing AXObjectCache.
        https://bugs.webkit.org/show_bug.cgi?id=180548
        <rdar://problem/35917755>

        Reviewed by Chris Fleizach.

        Currently the AX cache becomes unreachable through Document::existingAXObjectCache soon after the render tree is destroyed.
        From this point, the Node objects can't deregister themselves from the AX cache anymore. In some cases, it's
        redundant/not advised to notify the cache about certain changes when the document is being destroyed, but the
        callsites should make that decision.

        Covered by existing tests.

        * dom/Document.cpp:
        (WebCore::Document::existingAXObjectCacheSlow const):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::takeChildInternal):

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

        Fix erroneous ASSERT in DocumentThreadableLoader::didFail
        https://bugs.webkit.org/show_bug.cgi?id=180549

        Reviewed by Alex Christensen.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::didFail): ASSERT was checking whether the optional was null.
        This could never be the case since we move the value of the optional, not the optional itself.
        Ensure that the optional value is null so that we are sure request is being loaded and make the optional null just after that.

2017-12-07  Ryosuke Niwa  <rniwa@webkit.org>

        iOS: Many AMP pages crash inside Document::updateStyleIfNeeded
        https://bugs.webkit.org/show_bug.cgi?id=180550
        <rdar://problem/35410390>

        Reviewed by Zalan Bujtas.

        The crash was caused when updatign the layout of an non-flattened frame inside a flattened frame.
        In those cases, isInChildFrameWithFrameFlattening is false on the inner frame.

        No new tests for now.

        * dom/NoEventDispatchAssertion.h:
        * rendering/RenderFrameBase.cpp:
        (WebCore::RenderFrameBase::performLayoutWithFlattening): Disable the assertion temporarily here.
        In theory, we should be able to remove the check for isInChildFrameWithFrameFlattening but we err
        on the safer side for now.

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

        Always synchronously continue with fragment navigations
        https://bugs.webkit.org/show_bug.cgi?id=180544
        <rdar://problem/34815986> and <rdar://problem/35126690>

        Reviewed by Geoffrey Garen.

        Test: http/tests/dom/document-fragment.html

        When a decidePolicyForNavigationAction completionHandler is called asynchronously,
        the document's URL has not changed yet when JavaScript execution continues.  This causes
        significant web incompatibility because all browsers change the document's URL immediately
        during fragment navigations.  In order to make WebKit applications more web compatible,
        we now immediately continue to have the state consistent.  To keep compatibility with any
        WebView, UIWebView, or WKWebView applications that use these delegate callbacks to update
        state, we still call decidePolicyForNavigationAction.  This would break a theoretical app
        that would cancel fragment navigations, but it fixes apps that continue fragment navigations
        asynchronously.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadURL):
        (WebCore::FrameLoader::loadWithDocumentLoader):

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

        Activate IDB and WebSockets in service workers
        https://bugs.webkit.org/show_bug.cgi?id=180534

        Reviewed by Brady Eidson.

        Tests: http/tests/workers/service/serviceworker-idb.https.html
               http/tests/workers/service/serviceworker-websocket.https.html

        Using the dummy document used for loading to also fuel IDB and WebSocket.

        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::ServiceWorkerThread):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/context/ServiceWorkerThreadProxy.cpp:
        (WebCore::idbConnectionProxy):
        (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):

2017-12-07  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r225634.

        This caused layout tests to time out.

        Reverted changeset:

        "Simplify log channel configuration UI"
        https://bugs.webkit.org/show_bug.cgi?id=180527
        https://trac.webkit.org/changeset/225634

2017-12-07  Jer Noble  <jer.noble@apple.com>

        [EME] Support the 'encrypted' event for FPS encrypted streams
        https://bugs.webkit.org/show_bug.cgi?id=180480

        Reviewed by Eric Carlson.

        Test: platform/mac/media/encrypted-media/fps-encrypted-event.html

        Pass initData and initDataType up to HTMLMediaElement from SourceBufferPrivateAVFObjC.

        Drive-by fix: initialize the initData and initDataType values of MediaEncryptedEvent from
        values in its initializer struct.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
        (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
        * html/MediaEncryptedEvent.cpp:
        (WebCore::MediaEncryptedEvent::MediaEncryptedEvent):
        (WebCore::MediaEncryptedEvent::initDataType): Deleted.
        (WebCore::MediaEncryptedEvent::initData): Deleted.
        * html/MediaEncryptedEvent.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):

2017-12-07  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Add SPI to disallow user-installed fonts
        https://bugs.webkit.org/show_bug.cgi?id=180062
        <rdar://problem/35042408>

        Reviewed by Simon Fraser.

        This hooks up a WK2 preference, ShouldDisallowUserInstalledFonts, to our font selection
        code. This preference works by specifying an attribute to our font selection code which
        will prohibit user-installed fonts from ever being selected. This works both to disallow
        newly installed fonts, as well as disallowing user-installed fonts which "shadow" (or
        have the same name as) existing fonts, so that the existing font is selected instead.

        The goal of this setting is to decrease the fingerprinting surface area which trackers
        can use to identify users on the open Web.

        Tests: fast/text/user-installed-font.html
               fast/text/user-installed-fonts/disable.html
               fast/text/user-installed-fonts/shadow-disable.html
               fast/text/user-installed-fonts/shadow-family-disable.html
               fast/text/user-installed-fonts/shadow-family.html
               fast/text/user-installed-fonts/shadow-postscript-disable.html
               fast/text/user-installed-fonts/shadow-postscript-family-disable.html
               fast/text/user-installed-fonts/shadow-postscript-family.html
               fast/text/user-installed-fonts/shadow-postscript.html
               fast/text/user-installed-fonts/shadow.html

        * css/CSSFontFaceSet.cpp:
        (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::initializeFontStyle):
        * page/Settings.yaml:
        * platform/graphics/FontCache.h:
        * platform/graphics/FontDescription.cpp:
        (WebCore::FontDescription::FontDescription):
        * platform/graphics/FontDescription.h:
        (WebCore::FontDescription::mayRepresentUserInstalledFont const):
        (WebCore::FontDescription::setMayRepresentUserInstalledFont):
        (WebCore::FontDescription::operator== const):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::FontDatabase::singleton):
        (WebCore::FontDatabase::singletonAllowingUserInstalledFonts):
        (WebCore::FontDatabase::singletonDisallowingUserInstalledFonts):
        (WebCore::FontDatabase::collectionForFamily):
        (WebCore::FontDatabase::fontForPostScriptName):
        (WebCore::FontDatabase::FontDatabase):
        (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
        (WebCore::platformFontLookupWithFamily):
        (WebCore::invalidateFontCache):
        (WebCore::fontWithFamily):
        * style/StyleResolveForDocument.cpp:
        (WebCore::Style::resolveForDocument):
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::setShouldDisallowUserInstalledFonts):
        * testing/InternalSettings.h:
        * testing/InternalSettings.idl:

2017-12-07  David Quesada  <david_quesada@apple.com>

        [Web App Manifest] Support display-mode media feature
        https://bugs.webkit.org/show_bug.cgi?id=180376
        rdar://problem/35837993

        Reviewed by Geoffrey Garen.

        Tests: applicationmanifest/display-mode-subframe.html
               applicationmanifest/display-mode.html

        * Modules/applicationmanifest/ApplicationManifest.h:
        (WebCore::ApplicationManifest::encode const):
        (WebCore::ApplicationManifest::decode):
        * Modules/applicationmanifest/ApplicationManifestParser.cpp:
        (WebCore::ApplicationManifestParser::parseManifest):
        (WebCore::ApplicationManifestParser::parseDisplay):
        * Modules/applicationmanifest/ApplicationManifestParser.h:
            Add a 'display' property to ApplicationManifest and have ApplicationManifestParser
            populate it by parsing the 'display' property from the raw manifest.

        * css/CSSValueKeywords.in:
        * css/MediaFeatureNames.h:
        * css/MediaQueryEvaluator.cpp:
        (WebCore::displayModeEvaluate):
            To evaluate whether a display-mode query matches, compare the parameter to the
            display mode of the manifest applied to the main frame. If there is no manifest,
            use the fallback display mode 'browser' - the spec mandates that display-mode
            must be exposed even if there is no applied manifest.
        * css/MediaQueryExpression.cpp:
        (WebCore::featureWithValidIdent):
        (WebCore::isFeatureValidWithoutValue):

2017-12-07  Jer Noble  <jer.noble@apple.com>

        Creating a second AVPlayerItemVideoOutput causes flakey failures
        https://bugs.webkit.org/show_bug.cgi?id=177119
        <rdar://problem/34507977>

        Reviewed by Dean Jackson.

        Rather than having two concurrent AVPlayerItemVideoOutputs when painting to OpenGL,
        use only one, but with the OpenGL compatibility flags enabled, for both 3D and 2D
        canvas painting.

        Of course, once this is fixed, the test breaks again because VideoTextureCopierCV is
        stomping on top of some WebGL state set by the test. Rather than expand the
        VideoTextureCopierCV's GraphicsStateSaver, use a totally separate (but shared) GL context to
        implement the texture copy, so that its own state will not affect the state of the WebGL
        context.

        This necessitates adding a new createShared() factory for GraphicsContext3D. Since this is only
        used on Cocoa platforms (for now), make it platform specific, and modify the other implementations
        only so far as to throw assertions if somehow a shared context pointer is passed into their
        constructors.

        Drive-by fixes: 

        - These changes exposed some test failures, which were off-by-1-or-2 errors in the color
        output of videos painted into WebGL contexts. The Y' parameter needs to be scaled by 16/255
        for video-range conversions and the CbCr vales by 128/255 (rather than just 0.5). Make the
        color transforms a full 4x4 matrix and do the scaling in the matrix rather than tracked by a
        separate uniform.

        - There was a slight error in WebCoreDecompressionSession that could cause seeks to never
        complete because incoming frames would be skipped if their startTime was in the past
        (rather than their startTime + duration being in the past).

        - The matrix name comparison should use CFEqual rather than pointer equality to test.

        - iOS currently has a bug where the red and green color channels will be reversed when
        uploading BGRA pixel formatted data to a texture; work around this bug for now.

        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyContextVideoRenderer):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::videoOutputHasAvailableFrame):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::nativeImageForCurrentTime):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
        (WebCore::GraphicsContext3D::GraphicsContext3D):
        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
        (WebCore::GraphicsContext3D::createShared):
        (WebCore::GraphicsContext3D::GraphicsContext3D):
        * platform/graphics/cv/VideoTextureCopierCV.cpp:
        (WebCore::VideoTextureCopierCV::VideoTextureCopierCV):
        (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV):
        (WebCore::transferFunctionFromString):
        (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
        (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
        (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
        (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
        * platform/graphics/cv/VideoTextureCopierCV.h:
        (WebCore::VideoTextureCopierCV::context):
        * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
        (WebCore::GraphicsContext3D::GraphicsContext3D):

2017-12-07  Jer Noble  <jer.noble@apple.com>

        [EME] Support generateRequest() in CDMFairPlayStreaming
        https://bugs.webkit.org/show_bug.cgi?id=179752

        Reviewed by Eric Carlson.

        Tests: platform/mac/media/encrypted-media/fps-createSession.html
               platform/mac/media/encrypted-media/fps-generateRequest.html

        Add support for generating license requests from initialization data in
        CDMFairPlayStreaming. To do so, add explicit checks for FairPlay Steraming requirements:
        reqests will fail if no server certificate exists, and will fail if no content key id exists
        in the initialization data.

        * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
        (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSinf):
        (WebCore::CDMPrivateFairPlayStreaming::sanitizeSinf):
        (WebCore::CDMFactory::platformRegisterFactories):
        * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestLicense):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):

2017-12-07  Jer Noble  <jer.noble@apple.com>

        [EME] Possible deadlock when aborting a SourceBufferPrivateAVFObjC append operation
        https://bugs.webkit.org/show_bug.cgi?id=180486

        Reviewed by Eric Carlson.

        It's possible that an abort() operation which is blocked on the ongoing appendBuffer()
        operation completing will deadlock forever, with either the willProvideContentKeyRequest
        or didProvideContentKeyRequest callbacks blocking waiting to be run on the main thread
        (which is itself blocked waiting for the append operation to complete).

        To break this deadlock, add a new abortSemaphore which is signaled in the abort() method
        and have the willProvide... and didProvide... methods block both on their own semaphores
        as well as the abortSemaphore, allowing them to break out even if their main thread calls
        never get a chance to execute.

        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
        (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
        (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
        (WebCore::SourceBufferPrivateAVFObjC::abort):

2017-12-07  Eric Carlson  <eric.carlson@apple.com>

        Simplify log channel configuration UI
        https://bugs.webkit.org/show_bug.cgi?id=180527
        <rdar://problem/35908382>

        Reviewed by Joseph Pecoraro.

        No new tests -- no change in functionality.

        * inspector/agents/WebConsoleAgent.cpp:
        (WebCore::WebConsoleAgent::getLoggingChannels):
        (WebCore::channelConfigurationForString):

2017-12-07  Joseph Pecoraro  <pecoraro@apple.com>

        ServiceWorker Inspector: Use the SW's scope url for the remote inspection target metadata
        https://bugs.webkit.org/show_bug.cgi?id=180519

        Reviewed by Youenn Fablet.

        * workers/service/context/ServiceWorkerDebuggable.cpp:
        (WebCore::ServiceWorkerDebuggable::ServiceWorkerDebuggable):
        * workers/service/context/ServiceWorkerDebuggable.h:
        Switch to the scope URL for the remote inspector target info.

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

        Unreviewed Windows build fix.

        * PlatformWin.cmake:

2017-12-07  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] Freeze WebKit version in user agent
        https://bugs.webkit.org/show_bug.cgi?id=180475

        Reviewed by Carlos Garcia Campos.

        Apple has frozen the WebKit version in its user agent, so we should too, at the same point.

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

2017-12-07  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] Update user agent quirk version strings
        https://bugs.webkit.org/show_bug.cgi?id=180474

        Reviewed by Carlos Garcia Campos.

        * platform/UserAgentQuirks.cpp:
        (WebCore::UserAgentQuirks::stringForQuirk):
        * platform/glib/UserAgentGLib.cpp:
        (WebCore::platformVersionForUAString):

2017-12-06  Chris Dumez  <cdumez@apple.com>

        We should be able to recover after a Service Worker process crash
        https://bugs.webkit.org/show_bug.cgi?id=180477

        Reviewed by Brady Eidson and Youenn Fablet.

        Test: http/tests/workers/service/postmessage-after-sw-process-crash.https.html

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::serverToContextConnectionCreated):
        Once the connection with the context process is established, process "run service worker"
        requests that ocurred while establishing the connection.

        (WebCore::SWServer::runServiceWorkerIfNecessary):
        Take in a lambda function that gets called after the "run service worker" request
        is processed. We used to assert that we had a connection to the context process.
        We now wait for the connection to be established to process the request, thus
        making the operation asynchronous.

        (WebCore::SWServer::runServiceWorker):
        Split some logic out of runServiceWorkerIfNecessary() to reuse in serverToContextConnectionCreated().

        (WebCore::SWServer::markAllWorkersAsTerminated):
        Add method to mark all service workers as terminated. This is called when the Service
        Worker process crashes.

        * workers/service/server/SWServer.h:

2017-12-06  Saam Barati  <sbarati@apple.com>

        Unreviewed. Fix iOS (and maybe other platform) build

        * workers/service/server/RegistrationDatabase.cpp:
        (WebCore::RegistrationDatabase::openSQLiteDatabase):

2017-12-02  Darin Adler  <darin@apple.com>

        Modernize some aspects of text codecs, eliminate WebKit use of strcasecmp
        https://bugs.webkit.org/show_bug.cgi?id=180009

        Reviewed by Alex Christensen.

        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::consumeAsStream): Update to use size since the result of
        encode is now Vector rather than CString. And for the new UnencodableHandling.
        (WebCore::FetchBody::consumeText): Removed now-unneeded type cast. Ditto.
        (WebCore::FetchBody::bodyAsFormData const): Ditto.
        (WebCore::FetchBody::take): Pass result of encode directly to SharedBuffer::create.

        * Modules/websockets/WebSocketDeflater.cpp: Removed include of StringExtras.h.
        * bridge/IdentifierRep.h: Ditto.
        * bridge/c/c_instance.cpp: Ditto.

        * fileapi/BlobBuilder.cpp:
        (WebCore::BlobBuilder::append): Updated for CString to Vector change and
        for UnencodableHandling.

        * html/parser/HTMLMetaCharsetParser.cpp:
        (WebCore::HTMLMetaCharsetParser::checkForMetaCharset): Call the decode function
        with all the arguments since there is only one decode function now.

        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::computeContentSecurityPolicySHA256Hash): Updated for CString to Vector
        change and for UnencodableHandling.

        * loader/ResourceCryptographicDigest.cpp:
        (WebCore::cryptographicDigestForBytes): Changed argument type to const void*.
        * loader/ResourceCryptographicDigest.h: Ditto.

        * loader/TextResourceDecoder.cpp:
        (WebCore::TextResourceDecoder::TextResourceDecoder): Moved initialization of data
        members to class definition.
        (WebCore::TextResourceDecoder::create): Moved function body here from the header.
        (WebCore::TextResourceDecoder::setEncoding): Use equalLettersIgnoringASCIICase.
        (WebCore::TextResourceDecoder::shouldAutoDetect const): Updated for name change
        to m_parentFrameAutoDetectedEncoding, which obviates a comment.
        (WebCore::TextResourceDecoder::flush): Ditto.
        * loader/TextResourceDecoder.h: Moved initialization here from constructor.
        Moved function bodies out of the class. Renamed m_hintEncoding to
        m_parentFrameAutoDetectedEncoding since that is a more accurate description.

        * loader/appcache/ApplicationCacheStorage.cpp: Removed include of StringExtras.h.
        * page/FrameTree.cpp: Ditto.
        * page/PageSerializer.cpp: Ditto.
        (WebCore::PageSerializer::serializeFrame): Pass result of encode directly to
        StringBuffer::create and update for UnencodableHandling.
        (WebCore::PageSerializer::serializeCSSStyleSheet): Ditto.
        * page/csp/ContentSecurityPolicy.cpp:
        (WebCore::ContentSecurityPolicy::findHashOfContentInPolicies const): Ditto.

        * platform/FileHandle.cpp: Removed include of StringExtras.h.

        * platform/SharedBuffer.cpp:
        (WebCore::SharedBuffer::create): Added an overload that takes Vector<uint8_t>.
        * platform/SharedBuffer.h: Ditto.

        * platform/URLParser.cpp:
        (WebCore::URLParser::encodeQuery): Updated since encode returns a Vector instead
        of a CString now and for UnencodableHandling.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): Ditto.

        * platform/graphics/ca/PlatformCALayer.cpp: Removed include of StringExtras.h.

        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::handleDataURL): Updated for Vector instead
        of CString.

        * platform/network/FormData.cpp:
        (WebCore::FormData::create): Added new overload, and simplified some existing ones.
        (WebCore::normalizeStringData): Changed return type to Vector<uint8_t> and updated
        for UnencodableHandling.
        (WebCore::FormData::appendMultiPartStringValue): Updated for change in type of
        result of normalizeStringData.
        * platform/network/FormData.h: Updated for the above and updated comments.

        * platform/network/FormDataBuilder.cpp: Made this a namespace instead of a class.
        (WebCore::FormDataBuilder::append): Added an overload for Vector<uint8_t>.
        (WebCore::FormDataBuilder::appendQuoted): Renamed from appendQuotedString and
        changed the argument type.
        (WebCore::FormDataBuilder::appendFormURLEncoded): Moved logic up from the
        encodeStringAsFormData function into a new separate helper.
        (WebCore::FormDataBuilder::addFilenameToMultiPartHeader): Updated for change to
        UnencodableHandling.
        (WebCore::FormDataBuilder::beginMultiPartHeader): Changed argument type.
        (WebCore::FormDataBuilder::addKeyValuePairAsFormData): Ditto.
        (WebCore::FormDataBuilder::encodeStringAsFormData): Updated to call helper.
        * platform/network/FormDataBuilder.h: Updated for the above.

        * platform/text/DecodeEscapeSequences.h: Use Vector<uint8_t> instead of
        Vector<char>, also updated the code that calls encode for the new return type
        and updated for change to UnencodableHandler.

        * platform/text/TextCodec.cpp:
        (WebCore::TextCodec::getUnencodableReplacement): Updated since we are using
        std::array now, so the out argument is easier to understand, also updated for
        change to UnencodablaHandler.
        * platform/text/TextCodec.h: Use std::array for the UnencodableReplacementArray
        type, removed the overload of decode so there is only one decode function.

        * platform/text/TextCodecICU.cpp:
        (WebCore::ICUConverterWrapper::~ICUConverterWrapper): Deleted.
        Not needed any more since we use ICUConverterPtr instead now.
        (WebCore::cachedConverterICU): Deleted.
        (WebCore::TextCodecICU::create): Deleted. Callers just use make_unique
        directly now.
        (WebCore::TextCodecICU::registerCodecs): Rewrote to use lambdas instead
        of functions with void* pointers.
        (WebCore::TextCodecICU::TextCodecICU): Moved initializers into the header.
        (WebCore::TextCodecICU::~TextCodecICU): Moved the body of releaseICUConverter
        in here. Also greatly simplified it now that ICUConverterPtr handles closing
        it as needed.
        (WebCore::TextCodecICU::releaseICUConverter const): Deleted.
        (WebCore::TextCodecICU::createICUConverter const): Rewrote to simplfy now that
        we can use ICUConverterPtr.
        (WebCore::ErrorCallbackSetter::ErrorCallbackSetter): Take a reference instead
        of a pointer.
        (WebCore::ErrorCallbackSetter::~ErrorCallbackSetter): Ditto.
        (WebCore::TextCodecICU::decode): Use equalLettersIgnoringASCIICase instead of
        strcasecmp.
        (WebCore::TextCodecICU::encode): Return a Vector instead of a CString.
        Take a StringView instead of a pointer and length. Simplified
        the backslash-as-currency-symbol code by using String::replace.
        * platform/text/TextCodecICU.h: Updated for above. Fixed indentation.
        Added a new ICUConverterPtr typedef that uses std::unique_ptr to close the
        converter; combined with move semantics it simplifies things so we don't have
        to be so careful about calling ucnv_close.

        * platform/text/TextCodecLatin1.cpp: Renamed the Latin-1 to Unicode table from
        "table" to latin1ConversionTable.
        (WebCore::TextCodecLatin1::registerCodecs): Use a lambda.
        (WebCore::encodeComplexWindowsLatin1): Return a Vector instad of CString.
        Also use StringView::codePoints instead of our own U16_NEXT.
        (WebCore::TextCodecLatin1::encode): More of the same.
        * platform/text/TextCodecLatin1.h: Updated for the above.

        * platform/text/TextCodecReplacement.cpp:
        (WebCore::TextCodecReplacement::create): Deleted.
        (WebCore::TextCodecReplacement::TextCodecReplacement): Deleted.
        (WebCore::TextCodecReplacement::registerCodecs): Use a lambda.
        * platform/text/TextCodecReplacement.h: Updated for the above.

        * platform/text/TextCodecUTF16.cpp:
        (WebCore::newStreamingTextDecoderUTF16LE): Deleted.
        (WebCore::newStreamingTextDecoderUTF16BE): Deleted.
        (WebCore::TextCodecUTF16::registerCodecs): Use lambdas.
        (WebCore::TextCodecUTF16::encode): Return a Vector.
        * platform/text/TextCodecUTF16.h: Updated for the above.

        * platform/text/TextCodecUTF8.cpp:
        (WebCore::TextCodecUTF8::registerCodecs): Use a lambda.
        (WebCore::TextCodecUTF8::encode): Return a Vector.
        * platform/text/TextCodecUTF8.h: Updated for the above.

        * platform/text/TextCodecUserDefined.cpp:
        (WebCore::newStreamingTextDecoderUserDefined): Deleted.
        (WebCore::TextCodecUserDefined::registerCodecs): Use a lambda.
        (WebCore::encodeComplexUserDefined): Return a Vector.
        (WebCore::TextCodecUserDefined::encode): Ditto.
        * platform/text/TextCodecUserDefined.h: Updated for the above.

        * platform/text/TextEncoding.cpp: Changed TextCodecMap to just hold a
        WTF::Function instead of holding a function and an additional data pointer.
        (WebCore::TextEncoding::TextEncoding): Use equalLettersIgnoringASCIICase
        instead of a special isReplacementEncoding function.
        (WebCore::TextEncoding::encode const): Return a Vector instead of a CString.
        Pass StringView instead of a pointer and length.
        * platform/text/TextEncoding.h: Updated for the above.

        * platform/text/TextEncodingRegistry.cpp:
        (WebCore::addToTextCodecMap): Removed the additionalData pointer and used
        WTFMove since NewTextCodecFunction is now a WTF::Function rather than a C
        function pointer.
        (WebCore::isReplacementEncoding): Deleted.
        (WebCore::newTextCodec): Use find instead of get now that the fucntions in
        the map are WTF::Function and can't be copied.
        (WebCore::dumpTextEncodingNameMap): Deleted.
        * platform/text/TextEncodingRegistry.h: Updated for the above.

        * platform/text/win/TextCodecWin.cpp:
        (WebCore::TextCodecWin::encode): Updated comment.

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::send): Updated for change to UnencodableHandling.

        * xml/XSLTUnicodeSort.cpp: Removed include of StringExtras.h.
        * xml/parser/XMLDocumentParser.cpp: Ditto.
        * xml/parser/XMLDocumentParserLibxml2.cpp: Ditto.

2017-12-06  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Support the decoding="sync/async" syntax for image async attribute
        https://bugs.webkit.org/show_bug.cgi?id=179432

        Reviewed by Darin Adler.

        Support the HTMLElementImage decoding attribute to allow controlling the
        decoding of an image as per:
                https://github.com/whatwg/html/pull/3221
                https://whatpr.org/html/3221/images.html#decoding-images

        Tests: fast/images/decode-decoding-attribute-async-large-image.html
               fast/images/decoding-attribute-async-small-image.html
               fast/images/decoding-attribute-dynamic-async-small-image.html
               fast/images/decoding-attribute-sync-large-image.html

        * html/HTMLAttributeNames.in:
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::decodingMode const):
        * html/HTMLImageElement.h:
        * html/HTMLImageElement.idl:
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::draw):
        (WebCore::BitmapImage::internalStartAnimation):
        (WebCore::BitmapImage::advanceAnimation):
        (WebCore::BitmapImage::internalAdvanceAnimation):
        * platform/graphics/DecodingOptions.h:
        (WebCore::DecodingOptions::DecodingOptions):
        (WebCore::DecodingOptions::isAuto const):
        (WebCore::DecodingOptions::isAsynchronousCompatibleWith const):
        (WebCore::DecodingOptions::isNone const): Deleted.
        * platform/graphics/ImageDecoder.h:
        * platform/graphics/ImageFrame.cpp:
        (WebCore::ImageFrame::clearImage):
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::frameAtIndexCacheIfNeeded):
        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
        * platform/graphics/cg/ImageDecoderCG.h:
        * platform/graphics/win/ImageDecoderDirect2D.h:
        * platform/image-decoders/ScalableImageDecoder.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::decodingModeForImageDraw const):
        The element attributes and the document settings should be checked before
        checking our heuristics. And since the "decoding" attribute is per an image
        and isLargeImageAsyncDecodingEnabledForTesting() is a global setting, the
        decoding attribute should be checked first.

2017-12-06  David Quesada  <david_quesada@apple.com>

        [Web App Manifest] Add SPI for applying a manifest to a top-level browsing context
        https://bugs.webkit.org/show_bug.cgi?id=180368
        rdar://problem/34748067

        Reviewed by Geoffrey Garen.

        Support applying a manifest to a top-level browsing context by adding a manifest
        property on PageConfiguration to be stored on MainFrame instances created from the
        configuration.

        No new tests, no change in behavior.

        * page/MainFrame.cpp:
        (WebCore::MainFrame::MainFrame):
        * page/MainFrame.h:
        * page/PageConfiguration.h:

2017-12-06  Zalan Bujtas  <zalan@apple.com>

        Remove nodes from AXObjectCache when the associated subframe document is getting destroyed.
        https://bugs.webkit.org/show_bug.cgi?id=180503
        <rdar://problem/35891328

        Reviewed by Chris Fleizach.

        While AXObjectCache lives on the mainframe's document, it caches nodes from every subframe document.
        When a node is being destroyed, we deregister it from the AX cache through the Node's destructor.
        Soon after the document is detached from the frame/frame is detached from the frame tree, this codepath
        is no longer available (no access to the AXObjectCache object) and from this point we are unable to deregister
        nodes associated with the current document.
        In AXObjectCache::prepareForDocumentDestruction(), we preemptively remove all the cached nodes associated
        with the about-to-be-destroyed document.

        Covered by existing tests.

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::remove):
        (WebCore::filterForRemoval):
        (WebCore::AXObjectCache::prepareForDocumentDestruction): Collecting the nodes and removing them later is
        not the most performant way but in order to have a single code path for the de-registration (AXObjectCache::remove)
        I think it's worth going down the slower path -which should not really be that slower anyway since those
        lists tend to stay small.
        (WebCore::AXObjectCache::clearTextMarkerNodesInUse): Deleted.
        * accessibility/AXObjectCache.h:
        (WebCore::AXObjectCache::removeNodeForUse):
        (WebCore::AXObjectCache::remove):
        * dom/Document.cpp:
        (WebCore::Document::prepareForDestruction):
        * dom/Node.cpp:
        (WebCore::Node::willBeDeletedFrom):
        (WebCore::Node::moveNodeToNewDocument):

2017-12-06  Brady Eidson  <beidson@apple.com>

        Start writing ServiceWorker registrations to disk.
        https://bugs.webkit.org/show_bug.cgi?id=180488

        Reviewed by Chris Dumez.

        No new tests (No observable behavior change).

        As registrations changes occurs, we now write them to disk.
        We don't re-read them in yet.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

        * workers/service/ServiceWorkerRegistrationData.cpp:
        (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
        * workers/service/ServiceWorkerRegistrationData.h:
        (WebCore::ServiceWorkerRegistrationData::encode const):
        (WebCore::ServiceWorkerRegistrationData::decode):

        * workers/service/ServiceWorkerRegistrationKey.cpp:
        (WebCore::ServiceWorkerRegistrationKey::toDatabaseKey const):
        * workers/service/ServiceWorkerRegistrationKey.h:

        * workers/service/server/RegistrationDatabase.cpp: Added.
        (WebCore::v1RecordsTableSchema):
        (WebCore::v1RecordsTableSchemaAlternate):
        (WebCore::databaseFilename):
        (WebCore::RegistrationDatabase::RegistrationDatabase):
        (WebCore::RegistrationDatabase::~RegistrationDatabase):
        (WebCore::RegistrationDatabase::openSQLiteDatabase):
        (WebCore::RegistrationDatabase::ensureValidRecordsTable):
        (WebCore::updateViaCacheToString):
        (WebCore::workerTypeToString):
        (WebCore::RegistrationDatabase::pushChanges):
        (WebCore::RegistrationDatabase::doPushChanges):
        (WebCore::RegistrationDatabase::importRecords):
        (WebCore::RegistrationDatabase::databaseFailedToOpen):
        (WebCore::RegistrationDatabase::databaseOpenedAndRecordsImported):
        * workers/service/server/RegistrationDatabase.h: Copied from Source/WebCore/workers/service/ServiceWorkerRegistrationData.cpp.
        (WebCore::RegistrationDatabase::isClosed const):

        * workers/service/server/RegistrationStore.cpp: Added.
        (WebCore::RegistrationStore::RegistrationStore):
        (WebCore::RegistrationStore::~RegistrationStore):
        (WebCore::RegistrationStore::scheduleDatabasePushIfNecessary):
        (WebCore::RegistrationStore::pushChangesToDatabase):
        (WebCore::RegistrationStore::updateRegistration):
        (WebCore::RegistrationStore::removeRegistration):
        (WebCore::RegistrationStore::databaseFailedToOpen):
        (WebCore::RegistrationStore::databaseOpenedAndRecordsImported):
        * workers/service/server/RegistrationStore.h: Copied from Source/WebCore/workers/service/ServiceWorkerRegistrationData.cpp.

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::removeRegistration):
        (WebCore::SWServer::SWServer):
        (WebCore::SWServer::updateWorker):
        (WebCore::SWServer::installContextData):
        * workers/service/server/SWServer.h:

        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::data const):
        * workers/service/server/SWServerRegistration.h:
        (WebCore::SWServerRegistration::setLastUpdateTime):

2017-12-06  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix build after r225577.

        * bindings/js/JSDOMGlobalObject.cpp:

2017-12-06  David Quesada  <david_quesada@apple.com>

        [Web App Manifest] Add SPI for fetching the manifest
        https://bugs.webkit.org/show_bug.cgi?id=180294
        rdar://problem/34747968

        Reviewed by Geoffrey Garen.

        Test: applicationmanifest/developer-warnings.html

        * Modules/applicationmanifest/ApplicationManifest.h:
        (WebCore::ApplicationManifest::encode const):
        (WebCore::ApplicationManifest::decode):
        * Modules/applicationmanifest/ApplicationManifestParser.cpp:
        (WebCore::ApplicationManifestParser::logManifestPropertyNotAString):
        (WebCore::ApplicationManifestParser::logManifestPropertyInvalidURL):
            Drive-by wording changes. Since the warning is prefixed with "parsing
            application manifest:", remove a redundant use of "application manifest".

2017-12-06  Per Arne Vollan  <pvollan@apple.com>

        The WebProcess should use the NSRunLoop runloop type.
        https://bugs.webkit.org/show_bug.cgi?id=179804
        <rdar://problem/14012823>

        Reviewed by Brent Fulgham.

        No new tests.

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

2017-12-06  Antti Koivisto  <antti@apple.com>

        Prefer ids and classes over tag names in selector filter
        https://bugs.webkit.org/show_bug.cgi?id=180433
        <rdar://problem/35859103>

        Reviewed by Zalan Bujtas.

        There are only four slots in the filter and currently we just pick whatever identifiers we find traversing the selector
        from right to left. More specific selector types are on average more valuable (id > class > tag) so we should prefer them.

        This appears to be 4-5% StyleBench progression.

        * css/RuleSet.cpp:
        (WebCore::RuleData::RuleData):
        * css/SelectorFilter.cpp:
        (WebCore::collectSimpleSelectorHash):
        (WebCore::collectSelectorHashes):

            This function collects all hashes from the selector.

        (WebCore::chooseSelectorHashesForFilter):

            This function chooses the most valuable hashes to use with the filter.

        (WebCore::SelectorFilter::collectHashes):

            Factor into two separate steps.

        (WebCore::collectDescendantSelectorIdentifierHashes): Deleted.
        (WebCore::SelectorFilter::collectIdentifierHashes): Deleted.
        * css/SelectorFilter.h:
        (WebCore::SelectorFilter::fastRejectSelector const):

2017-12-06  Jer Noble  <jer.noble@apple.com>

        [EME] Make CDMInstance& parameter passed through MediaPlayer non-const
        https://bugs.webkit.org/show_bug.cgi?id=180484

        Reviewed by Jon Lee.

        One can only call const methods on const references, and the obvious intent
        of these methods is for the callee to call non-const methods on the parameters.

        * Modules/encryptedmedia/MediaKeys.h:
        (WebCore::MediaKeys::cdmInstance):
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::cdmInstanceAttached):
        (WebCore::MediaPlayer::cdmInstanceDetached):
        (WebCore::MediaPlayer::attemptToDecryptWithInstance):
        * platform/graphics/MediaPlayer.h:
        * platform/graphics/MediaPlayerPrivate.h:
        (WebCore::MediaPlayerPrivateInterface::cdmInstanceAttached):
        (WebCore::MediaPlayerPrivateInterface::cdmInstanceDetached):
        (WebCore::MediaPlayerPrivateInterface::attemptToDecryptWithInstance):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
        (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
        (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithInstance):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
        (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:

2017-12-06  Youenn Fablet  <youenn@apple.com>

        Preflight should bypass service worker
        https://bugs.webkit.org/show_bug.cgi?id=180463

        Reviewed by Alex Christensen.

        Covered by updated test.

        * loader/CrossOriginPreflightChecker.cpp:
        (WebCore::CrossOriginPreflightChecker::startPreflight): Ensure service worker is not used.
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::didFail): Tighten check and clear resource proactively to not hit loadRequest ASSERT.

2017-12-06  John Wilander  <wilander@apple.com>

        Storage Access API: Make document.hasStorageAccess a function and always allow access for same-origin iframes
        https://bugs.webkit.org/show_bug.cgi?id=176944
        <rdar://problem/34440658>

        Reviewed by Brent Fulgham.

        Test: http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-without-user-gesture.html

        This change introduces document.hasStorageAccess() as a function which
        returns a promise instead of being a property. Since cookie access can
        be due to both a granted request and recent user interaction as first
        party, the WebKit::WebResourceLoadStatisticsStore needs to be consulted.

        * dom/Document.cpp:
        (WebCore::Document::hasStorageAccess):
        (WebCore::Document::requestStorageAccess):
            Removed check of the previous m_hasStorageAccess member.
            Same-origin check done earlier. This was a request/suggestion
            from Mozilla.
        * dom/Document.h:
        (WebCore::Document::hasStorageAccess const): Deleted.
            Now uses a promise.
        * dom/Document.idl:
        * page/ChromeClient.h:

2017-12-06  Youenn Fablet  <youenn@apple.com>

        REGRESSION (r225537): Crash in WebCore::SWServerWorker::setHasPendingEvents(bool) + 68
        https://bugs.webkit.org/show_bug.cgi?id=180481

        Reviewed by Chris Dumez.

        Replacing ASSERT by if null check since there is no strong guarantee right now that there is a registration
        in SWServer registration map associated to a SWServerWorker.

        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::setHasPendingEvents):

2017-12-06  Chris Dumez  <cdumez@apple.com>

        ServiceWorkers API should reject promises when calling objects inside detached frames
        https://bugs.webkit.org/show_bug.cgi?id=180444

        Reviewed by Youenn Fablet.

        ServiceWorkers API should reject promises when calling objects inside detached frames.

        No new tests, rebaselined existing test.

        * bindings/js/JSDOMPromiseDeferred.h:
        (WebCore::callPromiseFunction):
        Use the caller's globalObject instead of the lexicalGlobalObject when constructing the
        deferred promise. The bug became visible when working on this service worker bug since
        rejecting the promise when the frame is detached did not actually work. The issue is
        that since the promise was created with the detached frame's globalObject, then it was
        suspended and would not run script.

        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::callerGlobalObject):
        (WebCore::incumbentDOMWindow):
        * bindings/js/JSDOMWindowBase.h:
        Add convenience function to get the caller's globalObject. It was carved out of
        incumbentDOMWindow().

        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::postMessage):
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::getRegistration):
        (WebCore::ServiceWorkerContainer::getRegistrations):
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::update):
        (WebCore::ServiceWorkerRegistration::unregister):
        Reject the promise when m_isStopped flag is set (i.e. ActiveDOMObject::stop()
        has been called).

2017-12-06  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [Mac] REGRESSION (r224527): Drawing a path with box-shadow takes double the blur-radius on Retina display
        https://bugs.webkit.org/show_bug.cgi?id=180460
        <rdar://problem/35869866>

        Reviewed by Daniel Bates.

        Disable using CGContextDrawPathDirect() for macOS High Sierra or earlier.
        This API has a bug when drawing a path with a shadow on Retina display.
        This bug is tracked internally by <rdar://problem/35620690>.


        * platform/graphics/cg/GraphicsContextCG.cpp:

2017-12-06  Youenn Fablet  <youenn@apple.com>

        Service Worker fetch should filter HTTP headers that are added by CachedResourceLoader/CachedResource
        https://bugs.webkit.org/show_bug.cgi?id=180462

        Reviewed by Geoffrey Garen.

        Coved by rebased test.

        * loader/CrossOriginAccessControl.cpp:
        (WebCore::cleanRedirectedRequestForAccessControl): Accept header is a safe header so it is fine to keep it.
        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::dispatchFetchEvent): Cleaning headers added by CachedResourceLoader/CachedResource.

2017-12-06  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Introduce Nicosia::PaintingContext, add Cairo implementation
        https://bugs.webkit.org/show_bug.cgi?id=180239

        Reviewed by Michael Catanzaro.

        As the next step in the Nicosia abstraction formation, we introduce
        Nicosia::PaintingContext. Implementations of this class will leverage a
        chosen 2D graphics library to paint (through GraphicsContext) into the
        memory area that's specified by a given Nicosia::Buffer object.

        Nicosia::Buffer is slimmed down to only control the memory that's
        required for rasterization of an RGBA32 painting output. It mimics the
        Cairo ImageBuffer implementation by using FastMalloc to allocate the
        necessary memory. In the future this class might become an interface of
        which different implementations will be providing memory that's
        allocated through different ways. For instance, when GLES3 is available,
        it would be possible to map GPU memory into the process memory space and
        rasterize into that, effectively eliminating need for GPU uploads.

        Since the ImageBuffer use in Nicosia::Buffer is dropped, the context()
        and uploadImage() methods are also removed. The functionality of
        ImageBuffer that was leveraged for CoordinatedGraphics rasterization
        still remains used through the PaintingContextCairo implementation. In
        the constructor of that class, with the target Nicosia::Buffer provided,
        we construct the cairo_surface_t and cairo_t objects that are necessary
        to create a combination of PlatformContextCairo and GraphicsContext
        objects that we can then use for rasterization.

        Reference of the passed-in Nicosia::Buffer object is increased for the
        lifetime of the cairo_surface_t object that will be drawing into that
        buffer's memory area. This ensures the memory area doesn't disappear
        from a live cairo_surface_t. Still, the expectation is that the
        cairo_surface_t object won't outlive the PaintingContextCairo object's
        lifetime, since the cairo_t object is also managed here and deleted in
        the destructor. To test that, we use a cairo_surface_t user data key
        that in its destroy callback dereferences the Nicosia::Buffer object and
        also marks the deletion process for the related PaintingContextCairo
        object as complete. This m_deletionComplete value is tested in the
        destructor of the class, once all the Cairo references are nulled out.

        The PaintingContext objects should be limited to a single scope,
        enabling the implementation resources to assume that the lifetime of the
        implementation object won't extend outside of the scope where it was
        created. To ensure that, the PaintingContext::paint() static function is
        added that creates the PaintingContext object and then executes the
        passed-in functor, passing it the GraphicsContext that should be used
        for drawing. Drawing is thus limited to that functor only, and the
        PaintingContext's create() function and the virtual graphicsContext()
        are not made public in the class.

        No new tests -- no change in functionality.

        * platform/TextureMapper.cmake:
        * platform/graphics/nicosia/NicosiaBuffer.cpp:
        (Nicosia::Buffer::Buffer):
        (Nicosia::Buffer::context): Deleted.
        (Nicosia::Buffer::uploadImage): Deleted.
        * platform/graphics/nicosia/NicosiaBuffer.h:
        (Nicosia::Buffer::stride const):
        (Nicosia::Buffer::data const):
        * platform/graphics/nicosia/NicosiaPaintingContext.cpp: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.cpp.
        (Nicosia::PaintingContext::create):
        * platform/graphics/nicosia/NicosiaPaintingContext.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.cpp.
        (Nicosia::PaintingContext::paint):
        * platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp: Added.
        (Nicosia::PaintingContextCairo::PaintingContextCairo):
        (Nicosia::PaintingContextCairo::~PaintingContextCairo):
        (Nicosia::PaintingContextCairo::graphicsContext):
        * platform/graphics/nicosia/NicosiaPaintingContextCairo.h: Copied from Source/WebCore/platform/graphics/nicosia/NicosiaBuffer.h.
        * platform/graphics/nicosia/NicosiaPaintingEngineBasic.cpp:
        (Nicosia::PaintingEngineBasic::paint):
        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
        (WebCore::CoordinatedImageBacking::update):

2017-12-05  Fujii Hironori  <Hironori.Fujii@sony.com>

        [GTK] Layout test media/track/track-in-band-duplicate-tracks-when-source-changes.html crashes and times out
        https://bugs.webkit.org/show_bug.cgi?id=160131

        Reviewed by Eric Carlson.

        Null dereference can be happen if VideoTrack and AudioTrack are
        disconnected from its media element.

        No new tests, no behavior change.

        * html/track/AudioTrack.cpp:
        (WebCore::AudioTrack::willRemove): Null-check mediaElement.
        * html/track/VideoTrack.cpp:
        (WebCore::VideoTrack::setLanguage): Ditto.

2017-12-05  Chris Dumez  <cdumez@apple.com>

        ServiceWorkerGlobalScope prototype chain should be immutable
        https://bugs.webkit.org/show_bug.cgi?id=180450

        Reviewed by Youenn Fablet.

        ServiceWorkerGlobalScope prototype chain should be immutable, similarly
        to what we do for DOMWindow. This is covered by a web-platform-test
        which was timing out because it was successfuly overwriting the
        ServiceWorkerGlobalScope prototype.

        No new tests, rebaselined existing test.

        * workers/DedicatedWorkerGlobalScope.idl:
        * workers/WorkerGlobalScope.idl:
        * workers/service/ServiceWorkerGlobalScope.idl:

2017-12-05  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        Fast binding generation by batching several files at once
        https://bugs.webkit.org/show_bug.cgi?id=179958

        Reviewed by Alex Christensen.

        Passing several files to the sub process at once and reducing the total cost of
        process generation. Especially Windows port has great speed improvement because
        its implementation of fork/exec is terrible.

        * bindings/scripts/generate-bindings-all.pl:
        (spawnGenerateBindingsIfNeeded):
        * bindings/scripts/generate-bindings.pl:
        (generateBindings):

2017-12-05  David Quesada  <david_quesada@apple.com>

        [Web App Manifest] Support fetching the app manifest 
        https://bugs.webkit.org/show_bug.cgi?id=180292

        Reviewed by Geoffrey Garen.

        Add support in WebCore for loading and parsing application manifests. This functionality
        is currently exposed with two methods: DocumentLoader::loadApplicationManifest() to call
        to start loading the manifest, and FrameLoaderClient::finishedLoadingApplicationManifest()
        for clients to override in order to be notified of the loaded manifest.

        No new tests, since no functionality is exposed to web content or embedders yet. The
        needed SPI will be added in an upcoming patch.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
            Added CachedApplicationManifest and ApplicationManifestLoader.
        * html/HTMLLinkElement.h:
        * html/LinkRelAttribute.cpp:
        (WebCore::LinkRelAttribute::LinkRelAttribute):
        (WebCore::LinkRelAttribute::isSupported):
            Add "manifest" as a supported 'rel' type for links.
        * html/LinkRelAttribute.h:
        * inspector/agents/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::resourceTypeJSON):
        (WebCore::InspectorPageAgent::inspectorResourceType):
        * inspector/agents/InspectorPageAgent.h:
        * loader/ApplicationManifestLoader.cpp: Added.
            Added a class ApplicationManifestLoader which handles creating a ResourceRequest,
            loading the resource from the CachedResourceLoader, and parsing the resulting text.
            This class and its relation to DocumentLoader are roughly based on that of IconLoader,
            which serves a similar purpose - requesting a resource on the page and ultimately
            providing it to the embedder.
        (WebCore::ApplicationManifestLoader::ApplicationManifestLoader):
        (WebCore::ApplicationManifestLoader::~ApplicationManifestLoader):
        (WebCore::ApplicationManifestLoader::startLoading):
        (WebCore::ApplicationManifestLoader::stopLoading):
        (WebCore::ApplicationManifestLoader::processManifest):
        (WebCore::ApplicationManifestLoader::notifyFinished):
        * loader/ApplicationManifestLoader.h: Copied from Source/WebCore/page/csp/ContentSecurityPolicyDirectiveNames.h.
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::stopLoading):
        (WebCore::DocumentLoader::loadApplicationManifest):
        (WebCore::DocumentLoader::finishedLoadingApplicationManifest):
        (WebCore::DocumentLoader::notifyFinishedLoadingApplicationManifest):
        * loader/DocumentLoader.h:
        * loader/FrameLoaderClient.h:
        * loader/LinkLoader.cpp:
        (WebCore::createLinkPreloadResourceClient):
        (WebCore::LinkLoader::isSupportedType):
        * loader/ResourceLoadInfo.cpp:
        (WebCore::toResourceType):
        * loader/SubresourceLoader.cpp:
        (WebCore::logResourceLoaded):
        * loader/cache/CachedApplicationManifest.cpp: Added.
        (WebCore::CachedApplicationManifest::CachedApplicationManifest):
        (WebCore::CachedApplicationManifest::finishLoading):
        (WebCore::CachedApplicationManifest::setEncoding):
        (WebCore::CachedApplicationManifest::encoding const):
        (WebCore::CachedApplicationManifest::process):
            Add a method to process the fetched text into an ApplicationManifest. CachedApplicationManifest
            does not store the resulting ApplicationManifest because the text of an application
            manifest can yield a different ApplicationManifest depending on the URL of the document
            processing it.
        * loader/cache/CachedApplicationManifest.h: Copied from Source/WebCore/page/csp/ContentSecurityPolicyDirectiveNames.h.
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::defaultPriorityForResourceType):
        * loader/cache/CachedResource.h:
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::createResource):
        (WebCore::CachedResourceLoader::requestApplicationManifest):
        (WebCore::contentTypeFromResourceType):
        (WebCore::CachedResourceLoader::checkInsecureContent const):
        (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
        * loader/cache/CachedResourceLoader.h:
        * page/DiagnosticLoggingKeys.cpp:
        (WebCore::DiagnosticLoggingKeys::applicationManifestKey):
        * page/DiagnosticLoggingKeys.h:
        * page/csp/ContentSecurityPolicy.cpp:
        (WebCore::ContentSecurityPolicy::allowManifestFromSource const):
        * page/csp/ContentSecurityPolicy.h:
        * page/csp/ContentSecurityPolicyDirectiveList.cpp:
        (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForManifest const):
        (WebCore::ContentSecurityPolicyDirectiveList::addDirective):
        * page/csp/ContentSecurityPolicyDirectiveList.h:
        * page/csp/ContentSecurityPolicyDirectiveNames.cpp:
        * page/csp/ContentSecurityPolicyDirectiveNames.h:

2017-12-05  Stephan Szabo  <stephan.szabo@sony.com>

        Switch windows build to Visual Studio 2017
        https://bugs.webkit.org/show_bug.cgi?id=172412

        Reviewed by Per Arne Vollan.

        Only changes proj file to update generator

        * WebCore.vcxproj/WebCore.proj:

2017-12-05  Brent Fulgham  <bfulgham@apple.com>

        Limit user agent versioning to an upper bound
        https://bugs.webkit.org/show_bug.cgi?id=180365
        <rdar://problem/34550617>

        Reviewed by Joseph Pecoraro.

        Freeze the version reported as User Agent to OS 10.13.4 (OS 11.3 on iOS) and WebKit 605.1.15
        for User Agent purposes.

        Test: fast/dom/navigator-userAgent-frozen.html

        * page/cocoa/UserAgent.h:
        * page/cocoa/UserAgent.mm:
        (WebCore::versionPredatesFreeze): Helper function. Returns true for Version 10.13.3 or older.
        (WebCore::systemMarketingVersionForUserAgentString):
        (WebCore::userAgentBundleVersion):
        (WebCore::userVisibleWebKitBundleVersionFromFullVersion): Deleted.
        (WebCore::userAgentBundleVersionFromFullVersionString): Deleted.
        * page/ios/UserAgentIOS.mm:
        (WebCore::standardUserAgentWithApplicationName): Don't take the WebKit bundle version
        as an argument, or pass it to the user agent string generator.
        * page/mac/UserAgentMac.mm:
        (WebCore::standardUserAgentWithApplicationName): Ditto. 

2017-12-05  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r225430.

        This caused an API failure on release.

        Reverted changeset:

        "Move DateComponents into WTF"
        https://bugs.webkit.org/show_bug.cgi?id=180211
        https://trac.webkit.org/changeset/225430

2017-12-05  Simon Fraser  <simon.fraser@apple.com>

        Composited frames incorrectly get requestAnimationFrame throttled
        https://bugs.webkit.org/show_bug.cgi?id=178396

        Reviewed by Zalan Bujtas.

        If a composited iframe was inside overflow:scroll, and the overflow was scrolled to the left
        further than the window width, then RenderLayer::childrenClipRect() would return an empty rectangle
        and we'd incorrectly consider the iframe out of view, and thus throttle its requestAnimationFrame.

        childrenClipRect() was taking unscaledDocumentRect(), applying the clip, and then mapping the result
        from local to absolute coordinates (which mapped it through the overflow scroll offset). This is incorrect
        because it considers the unscaledDocumentRect() to be in local coordinates, which it is not.

        Instead, start with the infinite rect, which essentially tells us if we have any clipping, and then
        intersect that with the document rect at the end. Something similar is done in other places that call.
        calculateRects().

        Test: fast/animation/request-animation-frame-throttle-inside-overflow-scroll.html

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

2017-12-05  Michael Saboff  <msaboff@apple.com>

        Make WebKit build for ARM64_32
        https://bugs.webkit.org/show_bug.cgi?id=180447

        Reviewed by Mark Lam.

        No new test as this isn't a change to functionality.

        * platform/graphics/transforms/TransformationMatrix.cpp:
        (WebCore::TransformationMatrix::multiply): Fallback to the C++ version for
        ARM64_32.

2017-12-05  Chris Dumez  <cdumez@apple.com>

        XMLHttpRequest should not be exposed to service workers
        https://bugs.webkit.org/show_bug.cgi?id=180446

        Reviewed by Youenn Fablet.

        Stop exposing XMLHttpRequest to service workers, as per:
        - https://xhr.spec.whatwg.org/#interface-xmlhttprequest

        * xml/XMLHttpRequest.idl:

2017-12-05  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: content views for resources loaded through XHR do not reflect declared mime-type
        https://bugs.webkit.org/show_bug.cgi?id=141389
        <rdar://problem/19767070>

        Reviewed by Brian Burg.

        Updated: http/tests/inspector/network/xhr-response-body.html:
                 http/tests/inspector/network/fetch-response-body.html:

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::didFinishLoading):
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl): Deleted.
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didFinishXHRLoading): Deleted.
        Remove special handling of XHR content that decoded output as text.

        * inspector/NetworkResourcesData.h:
        (WebCore::NetworkResourcesData::ResourceData::requestId const):
        (WebCore::NetworkResourcesData::ResourceData::loaderId const):
        (WebCore::NetworkResourcesData::ResourceData::frameId const):
        (WebCore::NetworkResourcesData::ResourceData::url const):
        (WebCore::NetworkResourcesData::ResourceData::content const):
        (WebCore::NetworkResourcesData::ResourceData::isContentEvicted const):
        (WebCore::NetworkResourcesData::ResourceData::textEncodingName const):
        * inspector/NetworkResourcesData.cpp:
        (WebCore::NetworkResourcesData::ResourceData::ResourceData):
        (WebCore::NetworkResourcesData::ResourceData::decodeDataToContent):
        (WebCore::NetworkResourcesData::responseReceived):
        (WebCore::NetworkResourcesData::setResourceContent):
        (WebCore::shouldBufferResourceData):
        (WebCore::NetworkResourcesData::maybeAddResourceData):
        (WebCore::NetworkResourcesData::maybeDecodeDataToContent):

        Make NetworkResourcesData only create a text decoder for resources we
        really think are text, and buffer resource data if it is text data
        or if it is a resource that would otherwise not be buffered by WebCore
        (such as XHRs with a DoNotBufferData policy). This ensures that the
        Inspector will have data to show for resources that won't be cached.

        * inspector/agents/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::resourceContent):
        (WebCore::InspectorPageAgent::sourceMapURLForResource):
        (WebCore::InspectorPageAgent::searchInResource):
        (WebCore::InspectorPageAgent::searchInResources):
        (WebCore::hasTextContent): Deleted.
        (WebCore::InspectorPageAgent::cachedResourceContent): Deleted.
        (WebCore::InspectorPageAgent::createTextDecoder): Deleted.
        (WebCore::textContentForCachedResource): Deleted.
        * inspector/agents/InspectorPageAgent.h:
        * inspector/agents/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::didReceiveData):
        (WebCore::InspectorNetworkAgent::willDestroyCachedResource):
        (WebCore::InspectorNetworkAgent::getResponseBody):
        (WebCore::InspectorNetworkAgent::shouldTreatAsText):
        (WebCore::InspectorNetworkAgent::createTextDecoder):
        (WebCore::InspectorNetworkAgent::textContentForCachedResource):
        (WebCore::InspectorNetworkAgent::cachedResourceContent):
        (WebCore::textContentForResourceData):
        (WebCore::InspectorNetworkAgent::searchOtherRequests):
        (WebCore::isErrorStatusCode): Deleted.
        (WebCore::InspectorNetworkAgent::didFinishXHRLoading): Deleted.
        * inspector/agents/InspectorNetworkAgent.h:
        Move static PageAgent functions related to the generic data tuple
        (content, base64Encoded) to NetworkAgent. Also generalize it to
        not rely on the CachedResourceType, but instead rely on the MIME type.
        This has a few changes in behavior:

            - Images, may now be text if they have a text mime type (image/svg+xml).
            - XHR / Fetch / Other may be sent as text if they have a text mime type.
            - XHR / Fetch / Other are not assumed to be text, and may be sent as base64 encoded.
        
        For this to be useful the frontend should also check the mime type and
        display an appropriate ContentView.

2017-12-05  Youenn Fablet  <youenn@apple.com>

        Implement https://w3c.github.io/ServiceWorker/#clients-claim
        https://bugs.webkit.org/show_bug.cgi?id=180261

        Reviewed by Chris Dumez.

        Test: http/tests/workers/service/serviceworkerclients-claim.https.html

        Implement claim by going to the storage process and then iterate over clients to see whether active worker can be set.
        Update SWServerWorker to call registration tryClear/tryActivate whenever a service worker has no pending event.

        * workers/service/ServiceWorkerClients.cpp:
        (WebCore::ServiceWorkerClients::claim):
        * workers/service/context/SWContextManager.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::claim):
        (WebCore::SWServer::doRegistrationMatching):
        (WebCore::SWServer::doRegistrationMatching const): Deleted.
        * workers/service/server/SWServer.h:
        (WebCore::SWServer::Connection::doRegistrationMatching):
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::controlClient):
        * workers/service/server/SWServerRegistration.h:
        * workers/service/server/SWServerToContextConnection.cpp:
        (WebCore::SWServerToContextConnection::claim):
        * workers/service/server/SWServerToContextConnection.h:
        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::claim):
        * workers/service/server/SWServerWorker.h:

2017-12-05  Per Arne Vollan  <pvollan@apple.com>

        [Win] Scrollbars are sometimes not rendered in accelerated compositing mode.
        https://bugs.webkit.org/show_bug.cgi?id=180431
        <rdar://problem/34531264>

        Reviewed by Simon Fraser.

        No new tests, covered by existing tests.

        When a scroll layer is required, we will create an overflow control hosts layer.
        In this case the method RenderLayerCompositor::shouldCompositeOverflowControls()
        should return true, otherwise the scrollbars will not be rendered.
 
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):

2017-12-05  Youenn Fablet  <youenn@apple.com>

        Call "Terminate Service Worker" on all workers when all their clients are gone
        https://bugs.webkit.org/show_bug.cgi?id=179552
        <rdar://problem/35836323>

        Unreviewed.

        * workers/service/server/SWServer.cpp: Reducing from 60_s to 10_s based on bugzilla comment.

2017-12-05  Chris Dumez  <cdumez@apple.com>

        Add support for ServiceWorkerContainer.prototype.ready
        https://bugs.webkit.org/show_bug.cgi?id=180383

        Reviewed by Youenn Fablet.

        Add support for ServiceWorkerContainer.prototype.ready:
        - https://w3c.github.io/ServiceWorker/#navigator-service-worker-ready

        No new tests, rebaselined existing test.

        * workers/service/SWClientConnection.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
        (WebCore::ServiceWorkerContainer::ready):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerRegistrationKey.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::resolveRegistrationReadyRequests):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::activate):
        (WebCore::SWServerRegistration::setIsUninstalling):
        * workers/service/server/SWServerRegistration.h:

2017-12-05  Yusuke Suzuki  <utatane.tea@gmail.com>

        Modernize WebThread code for further refactoring
        https://bugs.webkit.org/show_bug.cgi?id=180344

        Reviewed by Alex Christensen.

        When touching Thread and its initialization component, we need to touch
        web thread initialization code too. However, since web thread code is old,
        it's style is not following to WebKit coding style guidelines.

        This patch first modernizes WebThread code for further refactoring.

        1. `Type*` instead of `Type *`.
        2. Use std::call_once instead of pthread_once.
        3. Use static_cast instead of C-cast.
        4. Use nullptr instead of NULL.
        5. Use `ret` or `!ret` instead of `ret != 0` or `ret == 0`.
        6. Do not use #pragma unused.
        7. if-else with one statement should not have braces.

        In this patch, we do not change pthread_condition_t to WTF::Condition and
        pthread_mutex_t to WTF::Lock since web thread code requires extra care about
        threading.

        No behavior change.

        * platform/ios/wak/WebCoreThread.mm:
        (-[NSObject releaseOnMainThread]):
        (SendMessage):
        (HandleDelegateSource):
        (SendDelegateMessage):
        (WebThreadAdoptAndRelease):
        (lockWebCoreReleaseLock):
        (unlockWebCoreReleaseLock):
        (WebCoreObjCDeallocOnWebThreadImpl):
        (WebCoreObjCDeallocWithWebThreadLockImpl):
        (HandleWebThreadReleaseSource):
        (WebThreadCallDelegate):
        (WebThreadPostNotification):
        (WebThreadCallDelegateAsync):
        (WebThreadMakeNSInvocation):
        (MainRunLoopAutoUnlock):
        (_WebThreadAutoLock):
        (WebRunLoopLock):
        (WebRunLoopUnlock):
        (MainRunLoopUnlockGuard):
        (CurrentThreadContext):
        (RunWebThread):
        (StartWebThread):
        (WebTimedConditionLock):
        (_WebTryThreadLock):
        (WebThreadUnlockFromAnyThread):
        (WebThreadUnlockGuardForMail):
        (_WebThreadUnlock):
        (WebThreadIsLocked):
        (WebThreadLockPopModal):
        (WebThreadCurrentContext):
        (WebThreadEnable):
        (FreeThreadContext): Deleted.
        (InitThreadContextKey): Deleted.

2017-12-05  Alex Christensen  <achristensen@webkit.org>

        Fix non-unified build after r225381
        https://bugs.webkit.org/show_bug.cgi?id=180434

        Reviewed by Keith Miller.

        * loader/ResourceTimingInformation.cpp:
        FrameLoader.h is included in other files that are combined with this file in unified builds,
        but we need to merge r225381 to a branch that doesn't use unified builds.  This build failure
        would've come up randomly in the future when we add files, too.

2017-12-05  Simon Fraser  <simon.fraser@apple.com>

        Remove webkitGetImageDataHD and webkitPutImageDataHD from canvas API
        https://bugs.webkit.org/show_bug.cgi?id=180387

        Reviewed by Dean Jackson.

        CanvasRenderingContext2D.webkitGetImageDataHD and webkitPutImageDataHD were never standardized,
        and Blink removed support in 2014 (https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/FOPH5dloGG8).

        Since our canvas backing store is always 1x, they have no use anyway, so remove them.

        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::putImageData):
        (WebCore::CanvasRenderingContext2D::webkitGetImageDataHD const): Deleted.
        (WebCore::CanvasRenderingContext2D::webkitPutImageDataHD): Deleted.
        * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/CanvasRenderingContext2D.idl:

2017-12-05  Youenn Fablet  <youenn@apple.com>

        Implement setting of service worker to client in SWServer without going to WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=180382

        Reviewed by Chris Dumez.

        No change of behavior.

        This patch removes the notification of active worker setting from ScriptExecution/WebProcess up to SWServer/StorageProcess.
        Instead, active worker setting is fully done/controlled in SWServer.
        Whenever there is a change, SWServer notifies WebProcess and ScriptExecutionContext gets updated accordingly.

        * dom/Document.cpp:
        (WebCore::Document::setServiceWorkerConnection):
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::setActiveServiceWorker):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::commitData):
        * workers/service/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::setClientActiveWorker):
        (WebCore::SWServer::registerServiceWorkerClient):
        (WebCore::SWServer::registrationFromServiceWorkerIdentifier):
        (WebCore::SWServer::unregisterServiceWorkerClient):
        (WebCore::SWServer::Connection::serviceWorkerStartedControllingClient): Deleted.
        (WebCore::SWServer::Connection::serviceWorkerStoppedControllingClient): Deleted.
        (WebCore::SWServer::serviceWorkerStartedControllingClient): Deleted.
        (WebCore::SWServer::serviceWorkerStoppedControllingClient): Deleted.
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::activate):

2017-12-01  Filip Pizlo  <fpizlo@apple.com>

        GC constraint solving should be parallel
        https://bugs.webkit.org/show_bug.cgi?id=179934

        Reviewed by JF Bastien.

        No new tests because no change in behavior. This change is best tested using DOM-GC-intensive
        benchmarks like Speedometer and Dromaeo.
        
        This parallelizes the DOM's output constraint, and makes some small changes to make this more
        scalable.

        * ForwardingHeaders/heap/SimpleMarkingConstraint.h: Added.
        * ForwardingHeaders/heap/VisitingTimeout.h: Removed.
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/DOMGCOutputConstraint.cpp: Added.
        (WebCore::DOMGCOutputConstraint::DOMGCOutputConstraint):
        (WebCore::DOMGCOutputConstraint::~DOMGCOutputConstraint):
        (WebCore::DOMGCOutputConstraint::executeImpl):
        (WebCore::DOMGCOutputConstraint::doParallelWorkImpl):
        (WebCore::DOMGCOutputConstraint::finishParallelWorkImpl):
        * bindings/js/DOMGCOutputConstraint.h: Added.
        * bindings/js/WebCoreJSClientData.cpp:
        (WebCore::JSVMClientData::initNormalWorld):
        * dom/Node.cpp:
        (WebCore::Node::eventTargetDataConcurrently):
        (WebCore::Node::ensureEventTargetData):
        (WebCore::Node::clearEventTargetData):

2017-12-05  Antoine Quint  <graouts@apple.com>

        <video> and scale() transforms yield shrunk small or clipped controls
        https://bugs.webkit.org/show_bug.cgi?id=180358
        <rdar://problem/34436124>

        Unreviewed.

        Use DOMMatrix vs. WebKitCSSMatrix per Simon's post-commit review feedback.

        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController.prototype._updateControlsSize):

2017-12-04  Chris Dumez  <cdumez@apple.com>

        Support container.getRegistration() / getRegistrations() inside service workers
        https://bugs.webkit.org/show_bug.cgi?id=180360

        Reviewed by Youenn Fablet.

        Support container.getRegistration() / getRegistrations() inside service workers
        by making sure we hop to the right thread when needed.

        Test: http/tests/workers/service/ServiceWorkerGlobalScope_getRegistration.html

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::postTaskTo):
        * dom/ScriptExecutionContext.h:
        * workers/service/SWClientConnection.cpp:
        (WebCore::SWClientConnection::jobRejectedInServer):
        (WebCore::SWClientConnection::registrationJobResolvedInServer):
        (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
        (WebCore::SWClientConnection::startScriptFetchForServer):
        (WebCore::SWClientConnection::clearPendingJobs):
        * workers/service/SWClientConnection.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::getRegistration):
        (WebCore::ServiceWorkerContainer::didFinishGetRegistrationRequest):
        (WebCore::ServiceWorkerContainer::getRegistrations):
        (WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):
        (WebCore::ServiceWorkerContainer::stop):
        * workers/service/ServiceWorkerContainer.h:

2017-12-04  Simon Fraser  <simon.fraser@apple.com>

        Cleanup code that computes iframe content offsets in FrameView
        https://bugs.webkit.org/show_bug.cgi?id=180385

        Reviewed by Zalan Bujtas.

        The coordinate conversion functions in FrameView explicitly added borderLeft/paddingLeft
        and borderTop/paddingTop to compute the offset from the contents of a frame to its parent renderer.
        
        This is equivalent to the call to contextBoxRect() that RenderWidget::updateWidgetGeometry() does,
        which also takes left-side scrollbars into account.
        
        Coordinate offsets don't need height and width, so add RenderBox::contentBoxLocation() that just
        computes the top left, and use it in FrameView.

        * page/FrameView.cpp:
        (WebCore::FrameView::invalidateRect):
        (WebCore::FrameView::convertToContainingView const):
        (WebCore::FrameView::convertFromContainingView const):
        * platform/graphics/FloatPoint.h:
        (WebCore::FloatPoint::scaled const):
        (WebCore::FloatPoint::scaled): Deleted.
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::contentBoxLocation const):
        * rendering/RenderBox.h:

2017-12-04  Nan Wang  <n_wang@apple.com>

        AX: AOM: Implement relation type properties
        https://bugs.webkit.org/show_bug.cgi?id=179500

        Reviewed by Ryosuke Niwa.

        Accessibility Object Model
        Explainer: https://wicg.github.io/aom/explainer.html
        Spec: https://wicg.github.io/aom/spec/

        Implemented the AOM support for activeDescendant, details and errorMessage.
        The corresponding ARIA attributes all take IDREFs, and the AOM properties
        take references to AccessibleNodes instead.

        Test: accessibility/mac/AOM-relation-property.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::getAttribute const):
        (WebCore::AccessibilityObject::hasProperty const):
        (WebCore::AccessibilityObject::stringValueForProperty const):
        (WebCore::AccessibilityObject::boolValueForProperty const):
        (WebCore::AccessibilityObject::intValueForProperty const):
        (WebCore::AccessibilityObject::unsignedValueForProperty const):
        (WebCore::AccessibilityObject::doubleValueForProperty const):
        (WebCore::AccessibilityObject::elementValueForProperty const):
        (WebCore::AccessibilityObject::supportsARIAAttributes const):
        (WebCore::AccessibilityObject::elementsFromProperty const):
        (WebCore::AccessibilityObject::elementsReferencedByProperty const):
        (WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const):
        (WebCore::AccessibilityObject::ariaDetailsElements const):
        (WebCore::AccessibilityObject::ariaDetailsReferencingElements const):
        (WebCore::AccessibilityObject::ariaErrorMessageElements const):
        (WebCore::AccessibilityObject::ariaErrorMessageReferencingElements const):
        * accessibility/AccessibilityObject.h:
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::activeDescendant const):
        * accessibility/AccessibleNode.cpp:
        (WebCore::ariaAttributeMap):
        (WebCore::isPropertyValueRelation):
        (WebCore::AccessibleNode::attributeFromAXPropertyName):
        (WebCore::AccessibleNode::setRelationProperty):
        (WebCore::AccessibleNode::singleRelationValueForProperty):
        (WebCore::AccessibleNode::activeDescendant const):
        (WebCore::AccessibleNode::setActiveDescendant):
        (WebCore::AccessibleNode::details const):
        (WebCore::AccessibleNode::setDetails):
        (WebCore::AccessibleNode::errorMessage const):
        (WebCore::AccessibleNode::setErrorMessage):
        * accessibility/AccessibleNode.h:
        * accessibility/AccessibleNode.idl:
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

2017-12-04  Simon Fraser  <simon.fraser@apple.com>

        Minor DisplayRefreshMonitor-related cleanup
        https://bugs.webkit.org/show_bug.cgi?id=179802

        Reviewed by Sam Weinig.

        New trace point for when the CVDisplayLink fires on its own thread.

        Some #pragma once, and put all the WellKnownRunLoopOrders in one place.

        * inspector/agents/InspectorTimelineAgent.cpp:
        (WebCore::InspectorTimelineAgent::internalStart):
        * platform/cf/RunLoopObserver.h:
        * platform/graphics/DisplayRefreshMonitor.cpp:
        (WebCore::DisplayRefreshMonitor::displayDidRefresh):
        * platform/graphics/ca/LayerFlushScheduler.h:
        * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
        (WebCore::LayerFlushScheduler::LayerFlushScheduler):

2017-12-04  David Quesada  <david_quesada@apple.com>

        Add a class for parsing application manifests
        https://bugs.webkit.org/show_bug.cgi?id=177973
        rdar://problem/34747949

        Reviewed by Geoffrey Garen.

        Add a new struct ApplicationManifest, along with ApplicationManifestParser to initialize
        ApplicationManifests from JSON data, according to the App Manifest spec. Just a basic subset
        of the manifests's properties are implemented to start with.

        ApplicationManifestParser is tested by new unit tests in TestWebKitAPI.

        * Configurations/FeatureDefines.xcconfig: Add ENABLE_APPLICATION_MANIFEST feature flag.
        * Modules/applicationmanifest/ApplicationManifest.h: Added.
        * Modules/applicationmanifest/ApplicationManifestParser.cpp: Added.
        (WebCore::ApplicationManifestParser::parse):
        The main entry point for eventual clients (and currently the unit tests) to invoke
        ApplicationManifestParser. There is a variant that accepts a ScriptExecutionContext that
        uses the context exclusively for logging console warnings while parsing the manifest, and
        not for actually executing any scripts.
        (WebCore::ApplicationManifestParser::ApplicationManifestParser):
        (WebCore::ApplicationManifestParser::parseManifest):
        (WebCore::ApplicationManifestParser::logManifestPropertyNotAString):
        (WebCore::ApplicationManifestParser::logManifestPropertyInvalidURL):
        (WebCore::ApplicationManifestParser::logDeveloperWarning):
        (WebCore::ApplicationManifestParser::parseStartURL):
        (WebCore::ApplicationManifestParser::parseName):
        (WebCore::ApplicationManifestParser::parseDescription):
        (WebCore::ApplicationManifestParser::parseShortName):
        (WebCore::isInScope):
        (WebCore::ApplicationManifestParser::parseScope):
        (WebCore::ApplicationManifestParser::parseGenericString):
        * Modules/applicationmanifest/ApplicationManifestParser.h: Added.
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * features.json: Change the Web App Manifest feature status to "In Development"

2017-12-04  Zalan Bujtas  <zalan@apple.com>

        RenderMultiColumnFlow::fragmentedFlowDescendantInserted should not destroy incoming newDescendant
        https://bugs.webkit.org/show_bug.cgi?id=180181

        Reviewed by Antti Koivisto.

        This is in preparation for having all multicolumn related tree mutation in RenderTreeUpdaterMultiColumn.

        Covered by fast/multicol/column-span-range-crash.html

        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
        * rendering/RenderMultiColumnFlow.h:
        * style/RenderTreeUpdaterMultiColumn.cpp:
        (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):

2017-12-04  JF Bastien  <jfbastien@apple.com>

        Update std::expected to match libc++ coding style
        https://bugs.webkit.org/show_bug.cgi?id=180264

        Reviewed by Alex Christensen.

        Update various uses of Expected, mostly renaming valueOr and
        hasValue to the STL naming convention.

        * Modules/cache/DOMCache.cpp:
        (WebCore::DOMCache::retrieveRecords):
        (WebCore::DOMCache::batchDeleteOperation):
        (WebCore::DOMCache::batchPutOperation):
        * Modules/cache/DOMCacheStorage.cpp:
        (WebCore::DOMCacheStorage::retrieveCaches):
        (WebCore::DOMCacheStorage::open):
        (WebCore::DOMCacheStorage::remove):
        * Modules/cache/WorkerCacheStorageConnection.cpp:
        (WebCore::WorkerCacheStorageConnection::doRemove):
        (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
        (WebCore::recordsDataOrErrorFromRecords):
        (WebCore::recordsOrErrorFromRecordsData):
        * bindings/js/CachedScriptFetcher.cpp:
        (WebCore::CachedScriptFetcher::requestScriptWithCache const):
        * contentextensions/ContentExtensionCompiler.cpp:
        (WebCore::ContentExtensions::compileRuleList):
        * contentextensions/ContentExtensionParser.cpp:
        (WebCore::ContentExtensions::getDomainList):
        (WebCore::ContentExtensions::loadTrigger):
        (WebCore::ContentExtensions::loadRule):
        (WebCore::ContentExtensions::loadEncodedRules):
        (WebCore::ContentExtensions::parseRuleList):
        * 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/CallbackResult.h:
        (WebCore::CallbackResult<ReturnType>::type const):
        (WebCore::CallbackResult<ReturnType>::releaseReturnValue):
        * dom/Element.cpp:
        (WebCore::Element::getIntegralAttribute const):
        (WebCore::Element::getUnsignedIntegralAttribute const):
        * dom/ExceptionOr.h:
        (WebCore::ExceptionOr<ReturnType>::hasException const):
        (WebCore::ExceptionOr<void>::hasException const):
        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::checkStyleSheet):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::maxLengthAttributeChanged):
        (WebCore::HTMLInputElement::minLengthAttributeChanged):
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::process):
        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
        (WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
        * html/parser/HTMLParserIdioms.cpp:
        (WebCore::parseHTMLNonNegativeInteger):
        * html/parser/HTMLParserIdioms.h:
        (WebCore::limitToOnlyHTMLNonNegative):
        * loader/CrossOriginPreflightChecker.cpp:
        (WebCore::CrossOriginPreflightChecker::startPreflight):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::loadMainResource):
        * 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/TextTrackLoader.cpp:
        (WebCore::TextTrackLoader::load):
        * loader/cache/CachedSVGDocumentReference.cpp:
        (WebCore::CachedSVGDocumentReference::load):
        * loader/icon/IconLoader.cpp:
        (WebCore::IconLoader::startLoading):
        * platform/URLParser.cpp:
        (WebCore::URLParser::parseIPv4Host):
        * 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):

2017-12-04  Zalan Bujtas  <zalan@apple.com>

        REGRESSION (r211531): Text flow changes and overlaps other text after double-click selecting paragraph
        https://bugs.webkit.org/show_bug.cgi?id=180377
        <rdar://problem/34337967>

        Reviewed by Antti Koivisto.

        Take floats into account when computing the available width for a certain vertical position.

        Test: fast/block/float/simple-line-layout-float-shrink-line.html

        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::updateLineConstrains):

2017-12-04  Antoine Quint  <graouts@apple.com>

        <video> and scale() transforms yield shrunk small or clipped controls
        https://bugs.webkit.org/show_bug.cgi?id=180358
        <rdar://problem/34436124>

        Reviewed by Dean Jackson.

        To compute the bounds of the media controls, we would call getBoundingClientRect()
        on the root-most element in the shadow root, which is styled to have width and height
        set to 100%, which allows to match the metrics of the host media element, without
        the borders.

        However, if the host media element has CSS transforms applied, these would be factored
        into calls to getBoundingClientRect() and the controls would be too large and clipped,
        in case the scale was more than 1, or shrunk, in case the scale was less than 1.

        To obtain correct metrics, we computed the complete transformation matrix applied to
        the host media element, and apply its inverted matrix to each corner point of the
        bounds returned for the root-most container element in the shadow root.

        Then we compute the width and height of this transformed rectangle and set those to
        be our media controls' metrics.

        Test: media/modern-media-controls/css/transformed-media.html

        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController.prototype._updateControlsSize):
        (MediaController.prototype._controlsWidth): Deleted.

2017-12-04  Antoine Quint  <graouts@apple.com>

        Cursor is not visible after exiting full screen video
        https://bugs.webkit.org/show_bug.cgi?id=180247
        <rdar://problem/33885922>

        Reviewed by Dean Jackson.

        There is a dedicated NSCursor method to temporarily hide the mouse cursor while the mouse is idle,
        so we use this platform functionality, already exposed through the page chrome, instead which
        implements the expected behavior. Now, the mouse cursor is hidden while the mouse is stationary
        when a <video> is fullscreen, as before, but as soon as the user exits fullscreen, the mouse cursor
        reappears.

        No test provided as I don't believe this platform behavior can be tested, there is no API to query
        whether the cursor is visible.

        * page/EventHandler.cpp:
        (WebCore::EventHandler::cancelAutoHideCursorTimer):
        (WebCore::EventHandler::autoHideCursorTimerFired):

2017-12-04  Chris Dumez  <cdumez@apple.com>

        ServiceWorkerGlobalScope::skipWaiting(Ref<DeferredPromise>&&) is unsafe
        https://bugs.webkit.org/show_bug.cgi?id=180372

        Reviewed by Youenn Fablet.

        Ref the WorkerThread and capture it in the lambda. Keep the pending promises in
        a HashMap on the ServiceWorkerGlobalScope so that they stay on the worker thread.

        * workers/service/ServiceWorkerGlobalScope.cpp:
        (WebCore::ServiceWorkerGlobalScope::skipWaiting):
        * workers/service/ServiceWorkerGlobalScope.h:

2017-12-04  Brady Eidson  <beidson@apple.com>

        Get a directory path to SWServers for storing ServiceWorker registrations.
        https://bugs.webkit.org/show_bug.cgi?id=180362

        Reviewed by Chris Dumez.

        No new tests (No observable behavior change yet).

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

2017-12-04  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: provide method for recording CanvasRenderingContext2D from JavaScript
        https://bugs.webkit.org/show_bug.cgi?id=175166
        <rdar://problem/34040740>

        Reviewed by Joseph Pecoraro.

        No new tests, updated existing tests.

        * inspector/InspectorCanvas.h:
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::resetRecordingData):

        * inspector/InspectorCanvasAgent.h:
        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
        (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):

        * inspector/InspectorInstrumentation.h:
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::consoleStartRecordingCanvas):
        (WebCore::InspectorInstrumentation::consoleStartRecordingCanvasImpl):

        * page/PageConsoleClient.h:
        * page/PageConsoleClient.cpp:
        (WebCore::PageConsoleClient::record):
        (WebCore::PageConsoleClient::recordEnd):

        * workers/WorkerConsoleClient.h:
        * workers/WorkerConsoleClient.cpp:
        (WebCore::WorkerConsoleClient::record):
        (WebCore::WorkerConsoleClient::recordEnd):

2017-12-04  Youenn Fablet  <youenn@apple.com>

        Call "Terminate Service Worker" on all workers when all their clients are gone
        https://bugs.webkit.org/show_bug.cgi?id=179552

        Reviewed by Chris Dumez.

        Tested manually.

        When SWServer detects that there is no longer any client for a given client origin,
        it iterates through the running workers to terminate them if they have the given client origin.
        A timer of 60 seconds is used in case a user closes a tab or a window, and reopens one with the same origin shortly after.

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::findClientByIdentifier):
        (WebCore::SWServer::matchAll):
        (WebCore::SWServer::registerServiceWorkerClient):
        (WebCore::SWServer::unregisterServiceWorkerClient):
        * workers/service/server/SWServer.h:

2017-12-04  Antti Koivisto  <antti@apple.com>

        Enable selector filtering for ::before and ::after pseudo element resolution
        https://bugs.webkit.org/show_bug.cgi?id=180364

        Reviewed by Ryosuke Niwa.

        Since these pseudo elements are now resolved by TreeResolver we can use selector filter for them.

        This is 10%+ progression in StyleBench pseudo element subtest.

        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::pseudoStyleForElement):
        * css/StyleResolver.h:
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::resolvePseudoStyle):

2017-12-04  Youenn Fablet  <youenn@apple.com>

        Add support https://w3c.github.io/ServiceWorker/#on-client-unload-algorithm
        https://bugs.webkit.org/show_bug.cgi?id=180359

        Reviewed by Chris Dumez.

        This algorithm is needed for implementation of claim.
        As per specification, it is run for every client unload, hence why this is put in removeClientUsingRegistration.

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

2017-12-04  Antti Koivisto  <antti@apple.com>

        Remove duplicates from selector filter hashes
        https://bugs.webkit.org/show_bug.cgi?id=180354

        Reviewed by Simon Fraser.

        We have only four slots for hashes in RuleSet and adding more regresses performance. To use the limited slots
        better we should eliminate duplicates.

        This patch also switches to using std::array instead of a C array for the hashes.

        The patch reduces the number of selectors passing through the selector filter in StyleBench by ~0.4%.

        * css/ElementRuleCollector.cpp:
        (WebCore::ElementRuleCollector::collectMatchingRulesForList):
        * css/RuleSet.cpp:
        (WebCore::RuleData::RuleData):
        * css/RuleSet.h:
        (WebCore::RuleData::descendantSelectorIdentifierHashes const):
        * css/SelectorFilter.cpp:
        (WebCore::collectDescendantSelectorIdentifierHashes):
        (WebCore::SelectorFilter::collectIdentifierHashes):
        * css/SelectorFilter.h:
        (WebCore::SelectorFilter::fastRejectSelector const):

2017-12-04  Youenn Fablet  <youenn@apple.com>

        WorkerCacheStorageConnection should handle the case of terminated workers
        https://bugs.webkit.org/show_bug.cgi?id=180304

        Reviewed by Chris Dumez.

        No web page observable change of behavior.

        Reworked WorkerCacheStorageConnection hopping.
        Instead of refing/unrefing itself, it refs the worker thread and the main thread connection.
        This worker thread is then used on the way back from the main thread.

        * Modules/cache/WorkerCacheStorageConnection.cpp:
        (WebCore::WorkerCacheStorageConnection::create):
        (WebCore::WorkerCacheStorageConnection::WorkerCacheStorageConnection):
        (WebCore::WorkerCacheStorageConnection::doOpen):
        (WebCore::WorkerCacheStorageConnection::doRemove):
        (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
        (WebCore::WorkerCacheStorageConnection::reference):
        (WebCore::WorkerCacheStorageConnection::dereference):
        (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
        (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
        (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
        * Modules/cache/WorkerCacheStorageConnection.h:
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::cacheStorageConnection):
        * workers/WorkerGlobalScope.h:

2017-12-04  Frederic Wang  <fwang@igalia.com>

        Make ScrollingTreeNode::enclosingFrameNode return the node itself for frame nodes
        https://bugs.webkit.org/show_bug.cgi?id=180353

        Reviewed by Antonio Gomes.

        This function was introduced in bug 175135 to solve a rendering bug with fixed positioned
        nodes in overflow nodes. For a frame node, the reference frame to use for fixed nodes is
        actually the frame node itself or otherwise we will get the same rendering bug. This patch
        makes enclosingFrameNode return the node itself when it is a frame node and renames it to
        clarify this behavior. Currently, enclosingFrameNode is not used for frame nodes so the
        behavior is unchanged.

        No new tests, behavior is unchanged.

        * page/scrolling/ScrollingTreeNode.cpp:
        (WebCore::ScrollingTreeNode::enclosingFrameNodeIncludingSelf): Start the search from a frame
        scrolling node from the node itself. Renamed to make explicit that this function may include
        the node itself.
        * page/scrolling/ScrollingTreeNode.h: Renamed.

2017-12-04  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] Implement PAL::SleepDisabler
        https://bugs.webkit.org/show_bug.cgi?id=178485

        Reviewed by Carlos Garcia Campos.

        Add a comment to warn about some odd use of SleepDisabler in HTMLMediaElement.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::shouldDisableSleep const):

2017-12-04  Frederic Wang  <fwang@igalia.com>

        Bug 161300 - Move RenderMathMLRoot:RootType and RenderMathMLScripts:ScriptsType to element classes
        https://bugs.webkit.org/show_bug.cgi?id=161300

        Reviewed by Darin Adler.

        RenderMathMLRoot::m_kind and RenderMathMLScripts::m_scriptType are initialized in the
        constructors of the renderer classes from the tag name of the corresponding elements.
        This patch moves them into the corresponding element classes and makes them const members
        parsed in the constructors. It also introduces a MathMLRootElement class deriving from
        MathMLRowElement to store the new member. Finally, the types are redefined as enum classes.

        No new tests, behavior unchanged and already covered by existing tests.

        * Sources.txt: Add MathMLRootElement files.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * mathml/MathMLAllInOne.cpp: Ditto.
        * mathml/MathMLRootElement.cpp:
        (WebCore::element): Override this function to downcast to MathMLRootElement.
        (WebCore::rootTypeOf): Helper function to parse the root type, moved from RenderMathMLRoot.
        (WebCore::MathMLRootElement::MathMLRootElement): Initialize the root type.
        (WebCore::MathMLRootElement::create):
        (WebCore::MathMLRootElement::createElementRenderer): Moved from MathMLRowElement.
        * mathml/MathMLRootElement.h: New class deriving from MathMLRowElement, with a RootType
        member exposed to the renderer class.
        * mathml/MathMLRowElement.cpp: Remove header for RenderMathMLRoot.h.
        (WebCore::MathMLRowElement::createElementRenderer): Moved to MathMLRootElement.
        * mathml/MathMLScriptsElement.cpp: Introduce a script type.
        (WebCore::scriptTypeOf): Helper function to parse the script type, moved from
        RenerMathMLScripts.
        (WebCore::MathMLScriptsElement::MathMLScriptsElement): Initialize the script type.
        * mathml/MathMLScriptsElement.h: Add new script type member.
        (WebCore::MathMLScriptsElement::scriptType const): Expose the script type to the renderer
        class.
        * mathml/mathtags.in: Map <msqrt> and <mroot> to MathMLRootElement.
        * rendering/mathml/RenderMathMLRoot.cpp:
        (WebCore::RenderMathMLRoot::RenderMathMLRoot): Use MathMLRootElement and remove parsing of
        the root type.
        (WebCore::RenderMathMLRoot::rootType const): Helper function to access the root type from
        the element class.
        (WebCore::RenderMathMLRoot::isValid const): Use rootType() and add prefix for enum class
        values.
        (WebCore::RenderMathMLRoot::getBase const): Ditto.
        (WebCore::RenderMathMLRoot::getIndex const): Ditto.
        (WebCore::RenderMathMLRoot::horizontalParameters): Ditto.
        (WebCore::RenderMathMLRoot::verticalParameters): Ditto.
        (WebCore::RenderMathMLRoot::computePreferredLogicalWidths): Ditto.
        (WebCore::RenderMathMLRoot::layoutBlock): Ditto.
        (WebCore::RenderMathMLRoot::paint): Ditto.
        * rendering/mathml/RenderMathMLRoot.h: Define root type as an enum class, replace
        MathMLRowElement with MathMLRootElement, declare and use new rootType() function and remove
        the m_kind member.
        * rendering/mathml/RenderMathMLScripts.cpp:
        (WebCore::RenderMathMLScripts::RenderMathMLScripts): Remove parsing of script type.
        (WebCore::RenderMathMLScripts::scriptType const): Helper function to access the script type
        from the element class.
        (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren): Use scriptType() and add
        prefix for enum class values.
        (WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Ditto.
        (WebCore::RenderMathMLScripts::verticalMetrics): Ditto.
        (WebCore::RenderMathMLScripts::layoutBlock): Ditto.
        * rendering/mathml/RenderMathMLScripts.h: Define root type as an enum class, declare the
        scriptType() function and remove the m_scriptType member.
        * rendering/mathml/RenderMathMLUnderOver.cpp:
        (WebCore::RenderMathMLUnderOver::isValid const): Use scriptType() and add prefix for enum
        class values.
        (WebCore::RenderMathMLUnderOver::under const): Ditto.
        (WebCore::RenderMathMLUnderOver::over const): Ditto.
        (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths): Ditto.
        (WebCore::RenderMathMLUnderOver::hasAccent const): Ditto.
        (WebCore::RenderMathMLUnderOver::layoutBlock): Ditto.

2017-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GStreamer] More leaks in TextCombinerGStreamer
        https://bugs.webkit.org/show_bug.cgi?id=180331

        Reviewed by Michael Catanzaro.

        I've noticed more leaks reading the code, but I couldn't check them with valgrind, because I don't know how to
        trigger that code path. This patch cleans up the file using smart pointer everywhere.

        * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
        (webkit_text_combiner_pad_init):
        (webkitTextCombinerPadEvent):
        (webkitTextCombinerReleasePad):

2017-12-04  Jer Noble  <jer.noble@apple.com>

        Include 'video/*' in image request Accept header if browser supports video media in image contexts.
        https://bugs.webkit.org/show_bug.cgi?id=179178

        Reviewed by Alex Christensen.

        Test: http/tests/images/image-supports-video.html

        Ensure that 'video/*' is included in the Accept header by asking the ImageDecoder whether "Video"
        media is supported. The ImageDecoder will ask all it's constituent decoders, which aside from
        ImageDecoderAVFObjC will say only support the "Image" media type.

        Drive-by fix: Make sure the MIMETypeRegistry includes all the types supported by AVFoundation when
        ImageDecoderAVFObjC is enabled. Also, now that Image reports it can support video mime types, check
        whether MediaDocument can support a given mime type before asking ImageDocument.

        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::isSupportedType):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::acceptHeaderValueFromType):
        * platform/MIMETypeRegistry.cpp:
        (WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType):
        (WebCore::MIMETypeRegistry::isSupportedImageOrSVGMIMEType): Deleted.
        * platform/MIMETypeRegistry.h:
        * platform/graphics/ImageDecoder.cpp:
        (WebCore::ImageDecoder::supportsMediaType):
        * platform/graphics/ImageDecoder.h:
        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
        (WebCore::ImageDecoderAVFObjC::supportsMediaType):
        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
        (WebCore::ImageDecoderAVFObjC::supportsContentType):
        * platform/graphics/cg/ImageDecoderCG.h:
        * platform/graphics/win/ImageDecoderDirect2D.h:
        * platform/image-decoders/ScalableImageDecoder.h:
        (WebCore::ScalableImageDecoder::supportsMediaType):
        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):

2017-12-03  Yusuke Suzuki  <utatane.tea@gmail.com>

        WTF shouldn't have both Thread and ThreadIdentifier
        https://bugs.webkit.org/show_bug.cgi?id=180308

        Reviewed by Darin Adler.

        No behavior change.

        * Modules/indexeddb/IDBActiveDOMObject.h:
        (WebCore::IDBActiveDOMObject::originThread const):
        (WebCore::IDBActiveDOMObject::performCallbackOnOriginThread):
        (WebCore::IDBActiveDOMObject::callFunctionOnOriginThread):
        (WebCore::IDBActiveDOMObject::originThreadID const): Deleted.
        * Modules/indexeddb/IDBCursor.cpp:
        (WebCore::IDBCursor::IDBCursor):
        (WebCore::IDBCursor::~IDBCursor):
        (WebCore::IDBCursor::sourcesDeleted const):
        (WebCore::IDBCursor::transaction const):
        (WebCore::IDBCursor::update):
        (WebCore::IDBCursor::advance):
        (WebCore::IDBCursor::continueFunction):
        (WebCore::IDBCursor::uncheckedIterateCursor):
        (WebCore::IDBCursor::deleteFunction):
        (WebCore::IDBCursor::setGetResult):
        * Modules/indexeddb/IDBDatabase.cpp:
        (WebCore::IDBDatabase::~IDBDatabase):
        (WebCore::IDBDatabase::hasPendingActivity const):
        (WebCore::IDBDatabase::name const):
        (WebCore::IDBDatabase::version const):
        (WebCore::IDBDatabase::objectStoreNames const):
        (WebCore::IDBDatabase::renameObjectStore):
        (WebCore::IDBDatabase::renameIndex):
        (WebCore::IDBDatabase::createObjectStore):
        (WebCore::IDBDatabase::transaction):
        (WebCore::IDBDatabase::deleteObjectStore):
        (WebCore::IDBDatabase::close):
        (WebCore::IDBDatabase::connectionToServerLost):
        (WebCore::IDBDatabase::maybeCloseInServer):
        (WebCore::IDBDatabase::activeDOMObjectName const):
        (WebCore::IDBDatabase::canSuspendForDocumentSuspension const):
        (WebCore::IDBDatabase::stop):
        (WebCore::IDBDatabase::startVersionChangeTransaction):
        (WebCore::IDBDatabase::didStartTransaction):
        (WebCore::IDBDatabase::willCommitTransaction):
        (WebCore::IDBDatabase::didCommitTransaction):
        (WebCore::IDBDatabase::willAbortTransaction):
        (WebCore::IDBDatabase::didAbortTransaction):
        (WebCore::IDBDatabase::didCommitOrAbortTransaction):
        (WebCore::IDBDatabase::fireVersionChangeEvent):
        (WebCore::IDBDatabase::dispatchEvent):
        (WebCore::IDBDatabase::didCreateIndexInfo):
        (WebCore::IDBDatabase::didDeleteIndexInfo):
        * Modules/indexeddb/IDBIndex.cpp:
        (WebCore::IDBIndex::IDBIndex):
        (WebCore::IDBIndex::~IDBIndex):
        (WebCore::IDBIndex::name const):
        (WebCore::IDBIndex::setName):
        (WebCore::IDBIndex::objectStore):
        (WebCore::IDBIndex::keyPath const):
        (WebCore::IDBIndex::unique const):
        (WebCore::IDBIndex::multiEntry const):
        (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
        (WebCore::IDBIndex::openCursor):
        (WebCore::IDBIndex::openKeyCursor):
        (WebCore::IDBIndex::doCount):
        (WebCore::IDBIndex::doGet):
        (WebCore::IDBIndex::doGetKey):
        (WebCore::IDBIndex::getAll):
        (WebCore::IDBIndex::getAllKeys):
        (WebCore::IDBIndex::markAsDeleted):
        * Modules/indexeddb/IDBObjectStore.cpp:
        (WebCore::IDBObjectStore::IDBObjectStore):
        (WebCore::IDBObjectStore::~IDBObjectStore):
        (WebCore::IDBObjectStore::name const):
        (WebCore::IDBObjectStore::setName):
        (WebCore::IDBObjectStore::keyPath const):
        (WebCore::IDBObjectStore::indexNames const):
        (WebCore::IDBObjectStore::transaction):
        (WebCore::IDBObjectStore::autoIncrement const):
        (WebCore::IDBObjectStore::openCursor):
        (WebCore::IDBObjectStore::openKeyCursor):
        (WebCore::IDBObjectStore::get):
        (WebCore::IDBObjectStore::getKey):
        (WebCore::IDBObjectStore::putOrAdd):
        (WebCore::IDBObjectStore::doDelete):
        (WebCore::IDBObjectStore::clear):
        (WebCore::IDBObjectStore::createIndex):
        (WebCore::IDBObjectStore::index):
        (WebCore::IDBObjectStore::deleteIndex):
        (WebCore::IDBObjectStore::doCount):
        (WebCore::IDBObjectStore::getAll):
        (WebCore::IDBObjectStore::getAllKeys):
        (WebCore::IDBObjectStore::markAsDeleted):
        (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
        * Modules/indexeddb/IDBOpenDBRequest.cpp:
        (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest):
        (WebCore::IDBOpenDBRequest::onError):
        (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish):
        (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
        (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
        (WebCore::IDBOpenDBRequest::dispatchEvent):
        (WebCore::IDBOpenDBRequest::onSuccess):
        (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
        (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess):
        (WebCore::IDBOpenDBRequest::requestCompleted):
        (WebCore::IDBOpenDBRequest::requestBlocked):
        * Modules/indexeddb/IDBRequest.cpp:
        (WebCore::IDBRequest::~IDBRequest):
        (WebCore:: const):
        (WebCore::IDBRequest::setSource):
        (WebCore::IDBRequest::setVersionChangeTransaction):
        (WebCore::IDBRequest::transaction const):
        (WebCore::IDBRequest::sourceObjectStoreIdentifier const):
        (WebCore::IDBRequest::sourceIndexIdentifier const):
        (WebCore::IDBRequest::requestedObjectStoreRecordType const):
        (WebCore::IDBRequest::requestedIndexRecordType const):
        (WebCore::IDBRequest::eventTargetInterface const):
        (WebCore::IDBRequest::activeDOMObjectName const):
        (WebCore::IDBRequest::canSuspendForDocumentSuspension const):
        (WebCore::IDBRequest::hasPendingActivity const):
        (WebCore::IDBRequest::stop):
        (WebCore::IDBRequest::enqueueEvent):
        (WebCore::IDBRequest::dispatchEvent):
        (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
        (WebCore::IDBRequest::setResult):
        (WebCore::IDBRequest::setResultToStructuredClone):
        (WebCore::IDBRequest::setResultToUndefined):
        (WebCore::IDBRequest::resultCursor):
        (WebCore::IDBRequest::willIterateCursor):
        (WebCore::IDBRequest::didOpenOrIterateCursor):
        (WebCore::IDBRequest::completeRequestAndDispatchEvent):
        (WebCore::IDBRequest::onError):
        (WebCore::IDBRequest::onSuccess):
        * Modules/indexeddb/IDBTransaction.cpp:
        (WebCore::IDBTransaction::IDBTransaction):
        (WebCore::IDBTransaction::~IDBTransaction):
        (WebCore::IDBTransaction::objectStoreNames const):
        (WebCore::IDBTransaction::db):
        (WebCore::IDBTransaction::error const):
        (WebCore::IDBTransaction::objectStore):
        (WebCore::IDBTransaction::abortDueToFailedRequest):
        (WebCore::IDBTransaction::transitionedToFinishing):
        (WebCore::IDBTransaction::abort):
        (WebCore::IDBTransaction::internalAbort):
        (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
        (WebCore::IDBTransaction::activeDOMObjectName const):
        (WebCore::IDBTransaction::canSuspendForDocumentSuspension const):
        (WebCore::IDBTransaction::hasPendingActivity const):
        (WebCore::IDBTransaction::stop):
        (WebCore::IDBTransaction::isActive const):
        (WebCore::IDBTransaction::isFinishedOrFinishing const):
        (WebCore::IDBTransaction::addRequest):
        (WebCore::IDBTransaction::removeRequest):
        (WebCore::IDBTransaction::scheduleOperation):
        (WebCore::IDBTransaction::schedulePendingOperationTimer):
        (WebCore::IDBTransaction::pendingOperationTimerFired):
        (WebCore::IDBTransaction::operationCompletedOnServer):
        (WebCore::IDBTransaction::scheduleCompletedOperationTimer):
        (WebCore::IDBTransaction::completedOperationTimerFired):
        (WebCore::IDBTransaction::commit):
        (WebCore::IDBTransaction::commitOnServer):
        (WebCore::IDBTransaction::finishAbortOrCommit):
        (WebCore::IDBTransaction::didStart):
        (WebCore::IDBTransaction::notifyDidAbort):
        (WebCore::IDBTransaction::didAbort):
        (WebCore::IDBTransaction::didCommit):
        (WebCore::IDBTransaction::fireOnComplete):
        (WebCore::IDBTransaction::fireOnAbort):
        (WebCore::IDBTransaction::enqueueEvent):
        (WebCore::IDBTransaction::dispatchEvent):
        (WebCore::IDBTransaction::createObjectStore):
        (WebCore::IDBTransaction::createObjectStoreOnServer):
        (WebCore::IDBTransaction::didCreateObjectStoreOnServer):
        (WebCore::IDBTransaction::renameObjectStore):
        (WebCore::IDBTransaction::renameObjectStoreOnServer):
        (WebCore::IDBTransaction::didRenameObjectStoreOnServer):
        (WebCore::IDBTransaction::createIndex):
        (WebCore::IDBTransaction::createIndexOnServer):
        (WebCore::IDBTransaction::didCreateIndexOnServer):
        (WebCore::IDBTransaction::renameIndex):
        (WebCore::IDBTransaction::renameIndexOnServer):
        (WebCore::IDBTransaction::didRenameIndexOnServer):
        (WebCore::IDBTransaction::requestOpenCursor):
        (WebCore::IDBTransaction::doRequestOpenCursor):
        (WebCore::IDBTransaction::openCursorOnServer):
        (WebCore::IDBTransaction::didOpenCursorOnServer):
        (WebCore::IDBTransaction::iterateCursor):
        (WebCore::IDBTransaction::iterateCursorOnServer):
        (WebCore::IDBTransaction::didIterateCursorOnServer):
        (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
        (WebCore::IDBTransaction::requestGetAllIndexRecords):
        (WebCore::IDBTransaction::getAllRecordsOnServer):
        (WebCore::IDBTransaction::didGetAllRecordsOnServer):
        (WebCore::IDBTransaction::requestGetRecord):
        (WebCore::IDBTransaction::requestGetValue):
        (WebCore::IDBTransaction::requestGetKey):
        (WebCore::IDBTransaction::requestIndexRecord):
        (WebCore::IDBTransaction::getRecordOnServer):
        (WebCore::IDBTransaction::didGetRecordOnServer):
        (WebCore::IDBTransaction::requestCount):
        (WebCore::IDBTransaction::getCountOnServer):
        (WebCore::IDBTransaction::didGetCountOnServer):
        (WebCore::IDBTransaction::requestDeleteRecord):
        (WebCore::IDBTransaction::deleteRecordOnServer):
        (WebCore::IDBTransaction::didDeleteRecordOnServer):
        (WebCore::IDBTransaction::requestClearObjectStore):
        (WebCore::IDBTransaction::clearObjectStoreOnServer):
        (WebCore::IDBTransaction::didClearObjectStoreOnServer):
        (WebCore::IDBTransaction::requestPutOrAdd):
        (WebCore::IDBTransaction::putOrAddOnServer):
        (WebCore::IDBTransaction::didPutOrAddOnServer):
        (WebCore::IDBTransaction::deleteObjectStore):
        (WebCore::IDBTransaction::deleteObjectStoreOnServer):
        (WebCore::IDBTransaction::didDeleteObjectStoreOnServer):
        (WebCore::IDBTransaction::deleteIndex):
        (WebCore::IDBTransaction::deleteIndexOnServer):
        (WebCore::IDBTransaction::didDeleteIndexOnServer):
        (WebCore::IDBTransaction::operationCompletedOnClient):
        (WebCore::IDBTransaction::establishOnServer):
        (WebCore::IDBTransaction::activate):
        (WebCore::IDBTransaction::deactivate):
        * Modules/indexeddb/client/IDBConnectionProxy.cpp:
        (WebCore::IDBClient::removeItemsMatchingCurrentThread):
        * Modules/indexeddb/client/TransactionOperation.h:
        (WebCore::IDBClient::TransactionOperation::~TransactionOperation):
        (WebCore::IDBClient::TransactionOperation::perform):
        (WebCore::IDBClient::TransactionOperation::transitionToCompleteOnThisThread):
        (WebCore::IDBClient::TransactionOperation::transitionToComplete):
        (WebCore::IDBClient::TransactionOperation::doComplete):
        (WebCore::IDBClient::TransactionOperation::originThread const):
        (WebCore::IDBClient::TransactionOperation::originThreadID const): Deleted.
        * Modules/webaudio/AudioContext.cpp:
        (WebCore::AudioContext::AudioContext):
        (WebCore::AudioContext::lock):
        (WebCore::AudioContext::tryLock):
        (WebCore::AudioContext::unlock):
        (WebCore::AudioContext::isAudioThread const):
        (WebCore::AudioContext::isGraphOwner const):
        * Modules/webaudio/AudioContext.h:
        (WebCore::AudioContext::setAudioThread):
        (WebCore::AudioContext::audioThread const):
        * Modules/webaudio/AudioDestinationNode.cpp:
        (WebCore::AudioDestinationNode::render):
        * Modules/webdatabase/Database.cpp:
        (WebCore::Database::performClose):
        (WebCore::Database::securityOrigin):
        * Modules/webdatabase/DatabaseDetails.h:
        (WebCore::DatabaseDetails::DatabaseDetails):
        (WebCore::DatabaseDetails::operator=):
        (WebCore::DatabaseDetails::thread const):
        (WebCore::DatabaseDetails::threadID const): Deleted.
        * Modules/webdatabase/DatabaseManager.cpp:
        (WebCore::DatabaseManager::detailsForNameAndOrigin):
        * Modules/webdatabase/DatabaseThread.cpp:
        (WebCore::DatabaseThread::databaseThread):
        (WebCore::DatabaseThread::recordDatabaseOpen):
        (WebCore::DatabaseThread::recordDatabaseClosed):
        * Modules/webdatabase/DatabaseThread.h:
        (WebCore::DatabaseThread::getThread):
        (WebCore::DatabaseThread::getThreadID): Deleted.
        * Modules/webdatabase/SQLTransaction.cpp:
        (WebCore::SQLTransaction::checkAndHandleClosedDatabase):
        * Modules/webdatabase/SQLTransactionBackend.cpp:
        (WebCore::SQLTransactionBackend::doCleanup):
        (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown):
        * bindings/js/JSCallbackData.h:
        (WebCore::JSCallbackData::JSCallbackData):
        (WebCore::JSCallbackData::~JSCallbackData):
        * bindings/js/ScheduledAction.cpp:
        (WebCore::ScheduledAction::execute):
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::createdMessagePort):
        (WebCore::ScriptExecutionContext::destroyedMessagePort):
        * page/ResourceUsageOverlay.h:
        * page/scrolling/ScrollingThread.cpp:
        (WebCore::ScrollingThread::isCurrentThread):
        * platform/Supplementable.h:
        (WebCore::Supplementable::provideSupplement):
        (WebCore::Supplementable::removeSupplement):
        (WebCore::Supplementable::requireSupplement):
        (WebCore::Supplementable::Supplementable): Deleted.
        * platform/Timer.cpp:
        (WebCore::TimerBase::TimerBase):
        (WebCore::TimerBase::start):
        (WebCore::TimerBase::stop):
        (WebCore::TimerBase::setNextFireTime):
        * platform/Timer.h:
        (WebCore::TimerBase::isActive const):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::shouldAutoActivateFontIfNeeded):
        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
        (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread):
        (WebCore::TextureMapperPlatformLayerProxy::invalidate):
        (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer):
        (WebCore::TextureMapperPlatformLayerProxy::appendToUnusedBuffers):
        (WebCore::TextureMapperPlatformLayerProxy::swapBuffer):
        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
        (): Deleted.
        * platform/ios/wak/WebCoreThread.mm:
        (RunWebThread):
        (StartWebThread):
        * platform/sql/SQLiteDatabase.cpp:
        (WebCore::SQLiteDatabase::open):
        (WebCore::SQLiteDatabase::close):
        * platform/sql/SQLiteDatabase.h:
        (WebCore::SQLiteDatabase::sqlite3Handle const):
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
        (WebCore::WorkerGlobalScope::isContextThread const):
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
        (WebCore::WorkerMessagingProxy::~WorkerMessagingProxy):
        * workers/WorkerRunLoop.cpp:
        (WebCore::WorkerRunLoop::runInMode):
        (WebCore::WorkerRunLoop::runCleanupTasks):
        * workers/WorkerThread.h:
        (WebCore::WorkerThread::thread const):
        (WebCore::WorkerThread::threadID const): Deleted.
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
        (WebCore::ServiceWorkerContainer::scheduleJob):
        (WebCore::ServiceWorkerContainer::jobFailedWithException):
        (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent):
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
        (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
        (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
        (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
        (WebCore::ServiceWorkerContainer::jobDidFinish):
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::removeRegistration):
        (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent):
        (WebCore::ServiceWorkerContainer::contextIdentifier):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::~ServiceWorkerJob):
        (WebCore::ServiceWorkerJob::failedWithException):
        (WebCore::ServiceWorkerJob::resolvedWithRegistration):
        (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
        (WebCore::ServiceWorkerJob::startScriptFetch):
        (WebCore::ServiceWorkerJob::fetchScriptWithContext):
        (WebCore::ServiceWorkerJob::didReceiveResponse):
        (WebCore::ServiceWorkerJob::notifyFinished):
        * workers/service/ServiceWorkerJob.h:
        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::matchFunc):
        (WebCore::openFunc):
        (WebCore::initializeXMLParser):
        (WebCore::XMLParserContext::createStringParser):
        (WebCore::XMLParserContext::createMemoryParser):

2017-12-03  Youenn Fablet  <youenn@apple.com>

        WebSocketChannel should ensure its client is live when calling it in error case
        https://bugs.webkit.org/show_bug.cgi?id=180285

        Reviewed by Darin Adler.

        No observable change of behavior.
        This makes it consistent with other calls of didReceiveMessageError.

        * Modules/websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::fail):

2017-12-03  Alexey Proskuryakov  <ap@apple.com>

        WebArchiveResourceWebResourceHandler leaks when pasting
        https://bugs.webkit.org/show_bug.cgi?id=180339

        Reviewed by Joseph Pecoraro.

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::attributesForAttributedStringConversion):

2017-12-03  Chris Dumez  <cdumez@apple.com>

        Support serviceWorker.postMessage() inside service workers
        https://bugs.webkit.org/show_bug.cgi?id=180328

        Reviewed by Darin Adler.

        Support serviceWorker.postMessage() inside service workers.

        No new tests, unskipped and rebaselined existing test that is
        now passing.

        * workers/service/SWClientConnection.h:
        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::postMessage):
        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::postMessageToServiceWorker):
        * workers/service/context/SWContextManager.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::fireMessageEvent):
        (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
        * workers/service/context/ServiceWorkerThread.h:

2017-12-03  Chris Dumez  <cdumez@apple.com>

        Implement self.skipWaiting() inside service workers
        https://bugs.webkit.org/show_bug.cgi?id=180329

        Reviewed by Darin Adler.

        Implement self.skipWaiting() inside service workers:
        - https://w3c.github.io/ServiceWorker/#service-worker-global-scope-skipwaiting

        Also fixes a bug where tryActivate() was calling activate() even though the
        registration's active worker was "in use":
        - https://w3c.github.io/ServiceWorker/#try-activate-algorithm

        No new tests, rebaselined existing tests.

        * workers/service/ServiceWorkerGlobalScope.cpp:
        (WebCore::ServiceWorkerGlobalScope::skipWaiting):
        * workers/service/context/SWContextManager.h:
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::tryActivate):
        * workers/service/server/SWServerToContextConnection.cpp:
        (WebCore::SWServerToContextConnection::skipWaiting):
        * workers/service/server/SWServerToContextConnection.h:
        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::skipWaiting):
        * workers/service/server/SWServerWorker.h:
        (WebCore::SWServerWorker::isSkipWaitingFlagSet const):

2017-12-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GStreamer] GstPad leaked in WebKitTextCombiner
        https://bugs.webkit.org/show_bug.cgi?id=180314

        Reviewed by Michael Catanzaro.

        gst_element_get_static_pad() returns a full reference that si never freed, because gst_ghost_pad_new doesn't
        take the ownership of the given pad.

        * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
        (webkit_text_combiner_init):

2017-12-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GStreamer] GstCaps leaked in MediaPlayerPrivateGStreamer::createGSTPlayBin
        https://bugs.webkit.org/show_bug.cgi?id=180311

        Reviewed by Michael Catanzaro.

        gst_caps_new_empty_simple() is passed directly to g_object_set(). The returned caps should be freed with
        gst_caps_unref().

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

2017-12-02  Youenn Fablet  <youenn@apple.com>

        Move registration activation and clearing from SWServerJobQueue to SWServerRegistration
        https://bugs.webkit.org/show_bug.cgi?id=180325

        Reviewed by Chris Dumez.

        No change of behavior.

        These algorithms fit naturally in SWServerRegistration and will be used as part of clients.claim.

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::clearAll):
        (WebCore::SWServer::didFinishActivation):
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptFetchFinished):
        (WebCore::SWServerJobQueue::scriptContextFailedToStart):
        (WebCore::SWServerJobQueue::didFinishInstall):
        (WebCore::SWServerJobQueue::runUnregisterJob):
        (WebCore::SWServerJobQueue::tryActivate): Deleted.
        (WebCore::SWServerJobQueue::activate): Deleted.
        (WebCore::SWServerJobQueue::didFinishActivation): Deleted.
        (WebCore::SWServerJobQueue::tryClearRegistration): Deleted.
        (WebCore::clearRegistrationWorker): Deleted.
        (WebCore::SWServerJobQueue::clearRegistration): Deleted.
        * workers/service/server/SWServerJobQueue.h:
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::tryClear):
        (WebCore::clearRegistrationWorker):
        (WebCore::SWServerRegistration::clear):
        (WebCore::SWServerRegistration::tryActivate):
        (WebCore::SWServerRegistration::activate):
        (WebCore::SWServerRegistration::didFinishActivation):
        * workers/service/server/SWServerRegistration.h:

2017-12-02  Chris Dumez  <cdumez@apple.com>

        Support container.register() / registration.unregister() /  inside service workers
        https://bugs.webkit.org/show_bug.cgi?id=180326

        Reviewed by Youenn Fablet.

        Support container.register() / registration.unregister() /  inside service workers.
        This is mostly about removing the is<Document>() checks and adding testing given
        that most of the work was done in r225455.

        Test: http/tests/workers/service/ServiceWorkerGlobalScope_register.html

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::update):
        (WebCore::ServiceWorkerRegistration::unregister):

2017-12-02  Chris Dumez  <cdumez@apple.com>

        Support serviceWorkerRegistration.update() inside service workers
        https://bugs.webkit.org/show_bug.cgi?id=180215

        Reviewed by Darin Adler.

        Support serviceWorkerRegistration.update() inside service workers. The code paths
        for job scheduling and resolution have been made thread safe by hopping to the right
        thread when necessary. In particular, ServiceWorkerContainer always makes sure to to
        a callOnMainThread() before calling methods on the SWClientConnection. Also, the
        SWClientConnection relies on a new postTaskTo() method before calling methods on the
        job.

        Test: http/tests/workers/service/self_registration_update.html

        * workers/service/SWClientConnection.cpp:
        (WebCore::SWClientConnection::scheduleJob):
        (WebCore::SWClientConnection::finishedFetchingScript):
        (WebCore::SWClientConnection::failedFetchingScript):
        (WebCore::SWClientConnection::jobRejectedInServer):
        (WebCore::SWClientConnection::registrationJobResolvedInServer):
        (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
        (WebCore::SWClientConnection::startScriptFetchForServer):
        (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
        (WebCore::SWClientConnection::updateRegistrationState):
        (WebCore::SWClientConnection::updateWorkerState):
        (WebCore::SWClientConnection::fireUpdateFoundEvent):
        (WebCore::SWClientConnection::notifyClientsOfControllerChange):
        (WebCore::SWClientConnection::clearPendingJobs):
        (WebCore::SWClientConnection::postTaskTo):
        * workers/service/SWClientConnection.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::scheduleJob):
        (WebCore::ServiceWorkerContainer::jobFailedWithException):
        (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent):
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
        (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
        (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
        (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
        (WebCore::ServiceWorkerContainer::jobDidFinish):
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::removeRegistration):
        (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent):
        (WebCore::ServiceWorkerContainer::contextIdentifier):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::ServiceWorkerJob):
        * workers/service/ServiceWorkerJob.h:
        (WebCore::ServiceWorkerJob::contextIdentifier):
        * workers/service/ServiceWorkerJobClient.h:
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::update):
        * workers/service/ServiceWorkerTypes.h:

2017-12-02  Simon Fraser  <simon.fraser@apple.com>

        Make IOSurface::Locker and use it in ImageBufferDataCG
        https://bugs.webkit.org/show_bug.cgi?id=180317

        Reviewed by Zalan Bujtas.

        Add an RAII IOSurface::Locker which can lock readonly or readwrite. Access
        to the IOSurface base address is through the locker.
        
        Add IOSurface::bytesPerRow() to wrap IOSurfaceGetBytesPerRow().
        
        After this, there is only one location where we access the IOSurfaceRef
        directly, in WebGL code.

        * platform/graphics/cg/ImageBufferDataCG.cpp:
        (WebCore::ImageBufferData::toBGRAData const):
        (WebCore::ImageBufferData::getData const):
        (WebCore::ImageBufferData::putData):
        * platform/graphics/cocoa/IOSurface.h:
        * platform/graphics/cocoa/IOSurface.mm:
        (WebCore::IOSurface::bytesPerRow const):

2017-12-02  Simon Fraser  <simon.fraser@apple.com>

        Add an AlphaPremultiplication enum and use it consistently
        https://bugs.webkit.org/show_bug.cgi?id=180316

        Reviewed by Zalan Bujtas.

        ImageBuffer-related code sometimes used the 'Multiply' enum, and sometimes
        a bool to represent alpha premultiplication. Make an enum class and use it
        everywhere. Re-order and rename some parameters to clarify the meaning of this
        argument.

        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::putImageData):
        * platform/graphics/GraphicsTypes.cpp:
        (WebCore::operator<<):
        * platform/graphics/GraphicsTypes.h:
        * platform/graphics/ImageBuffer.cpp:
        (WebCore::ImageBuffer::genericConvertToLuminanceMask):
        * platform/graphics/ImageBuffer.h:
        * platform/graphics/ShadowBlur.cpp:
        (WebCore::ShadowBlur::blurShadowBuffer):
        * platform/graphics/cairo/ImageBufferCairo.cpp:
        (WebCore::getImageData):
        (WebCore::ImageBuffer::getUnmultipliedImageData const):
        (WebCore::ImageBuffer::getPremultipliedImageData const):
        (WebCore::ImageBuffer::putByteArray):
        * platform/graphics/cg/ImageBufferCG.cpp:
        (WebCore::ImageBuffer::getUnmultipliedImageData const):
        (WebCore::ImageBuffer::getPremultipliedImageData const):
        (WebCore::ImageBuffer::putByteArray):
        * platform/graphics/cg/ImageBufferDataCG.cpp:
        (WebCore::ImageBufferData::getData const):
        (WebCore::ImageBufferData::putData):
        * platform/graphics/cg/ImageBufferDataCG.h:
        * platform/graphics/filters/FEColorMatrix.cpp:
        (WebCore::FEColorMatrix::platformApplySoftware):
        * platform/graphics/filters/FEDropShadow.cpp:
        (WebCore::FEDropShadow::platformApplySoftware):
        * platform/graphics/filters/FilterEffect.cpp:
        (WebCore::FilterEffect::imageBufferResult):
        * platform/graphics/win/ImageBufferDataDirect2D.cpp:
        (WebCore::ImageBufferData::getData const):
        (WebCore::ImageBufferData::putData):
        * platform/graphics/win/ImageBufferDataDirect2D.h:
        * platform/graphics/win/ImageBufferDirect2D.cpp:
        (WebCore::ImageBuffer::getUnmultipliedImageData const):
        (WebCore::ImageBuffer::getPremultipliedImageData const):
        (WebCore::ImageBuffer::putByteArray):

2017-12-02  Youenn Fablet  <youenn@apple.com>

        Implement https://w3c.github.io/ServiceWorker/#clients-getall
        https://bugs.webkit.org/show_bug.cgi?id=180276

        Reviewed by Chris Dumez.

        Test: http/tests/workers/service/serviceworkerclients-matchAll.https.html

        Move Clients QueryOptions to its own class since it is used by various parties.
        Add encoder/decoder routines.

        Add a ServieWorkerClientInformation which replaces SWServer::ClientInformation structure.
        This is what is sent back as a result to matchAll requests.
        Add encoder/decoder routines.

        Implement matchAll by hopping to the main thread, making IPC to the storage process.
        SWServer in storage process then iterates through the relevant service workers and does some filtering.
        Additional filtering and information should be gathered in future patches to fully implement the algorithm.

        Add to SWServer a HashMap to easily identify by which service worker a client is controlled, if any.
        This map is updated at the same time registrations are updated.

        matchAll is given a callback as in the future, window client information will be retrieved asynchronously.

        * WebCore.xcodeproj/project.pbxproj:
        * workers/service/ServiceWorkerClientInformation.h: Added.
        (WebCore::ServiceWorkerClientInformation::isolatedCopy const):
        (WebCore::ServiceWorkerClientInformation::encode const):
        (WebCore::ServiceWorkerClientInformation::decode):
        * workers/service/ServiceWorkerClientQueryOptions.h: Added.
        (WebCore::ServiceWorkerClientQueryOptions::encode const):
        (WebCore::ServiceWorkerClientQueryOptions::decode):
        * workers/service/ServiceWorkerClients.cpp:
        (WebCore::ServiceWorkerClients::matchAll):
        * workers/service/ServiceWorkerClients.h:
        * workers/service/context/SWContextManager.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::matchAll):
        (WebCore::SWServer::registerServiceWorkerClient):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerToContextConnection.cpp:
        (WebCore::SWServerToContextConnection::matchAll):
        * workers/service/server/SWServerToContextConnection.h:
        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::matchAll):
        * workers/service/server/SWServerWorker.h:

2017-12-02  Brady Eidson  <beidson@apple.com>

        Factor out the "databaseTaskQueue" parts of IDBServer into something reusable.
        https://bugs.webkit.org/show_bug.cgi?id=180298

        Reviewed by Chris Dumez.

        No new tests (Refactor only).

        * Modules/indexeddb/server/IDBServer.cpp:
        (WebCore::IDBServer::IDBServer::IDBServer):
        (WebCore::IDBServer::IDBServer::postDatabaseTask):
        (WebCore::IDBServer::IDBServer::postDatabaseTaskReply):
        (WebCore::IDBServer::IDBServer::databaseRunLoop): Deleted.
        (WebCore::IDBServer::IDBServer::handleTaskRepliesOnMainThread): Deleted.
        * Modules/indexeddb/server/IDBServer.h:
        (): Deleted.

2017-12-02  Simon Fraser  <simon.fraser@apple.com>

        Add a log channel for viewports
        https://bugs.webkit.org/show_bug.cgi?id=180295

        Reviewed by Zalan Bujtas.

        Add a "Viewports" log channel to log viewport scaling information, and enhance the
        WebKit "VisibleRects" channel to log additional data for the same reason.

        * dom/Document.cpp:
        (WebCore::Document::processViewport):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::finishedParsing):
        (WebCore::FrameLoader::completed):
        * page/FrameView.cpp:
        (WebCore::FrameView::resetScrollbarsAndClearContentsSize):
        (WebCore::FrameView::scrollToAnchor):
        (WebCore::FrameView::maintainScrollPositionAtAnchor):
        (WebCore::FrameView::setScrollPosition):
        (WebCore::FrameView::autoSizeIfEnabled):
        (WebCore::FrameView::setWasScrolledByUser):
        * page/LayoutContext.cpp:
        (WebCore::LayoutContext::layout):
        * page/Page.cpp:
        (WebCore::Page::setPageScaleFactor):
        * page/ViewportConfiguration.cpp:
        (WebCore::ViewportConfiguration::setContentsSize):
        (WebCore::ViewportConfiguration::setViewportArguments):
        (WebCore::ViewportConfiguration::updateConfiguration):
        (WebCore::operator<<):
        (WebCore::ViewportConfiguration::description const):
        (WebCore::ViewportConfiguration::dump const):
        * page/ViewportConfiguration.h:
        * platform/Logging.h:
        * platform/ScrollView.cpp:
        (WebCore::ScrollView::setFixedLayoutSize):

2017-12-01  Alicia Boya García  <aboya@igalia.com>

        [MSE] Use correct range end checks in sourceBufferPrivateDidReceiveSample()
        https://bugs.webkit.org/show_bug.cgi?id=179690

        Reviewed by Jer Noble.

        The Coded Frame Processing algorithm as defined in
        https://www.w3.org/TR/media-source/#sourcebuffer-coded-frame-processing states:

        1.14. Remove existing coded frames in track buffer:
         -> If highest end timestamp for track buffer is not set:
               [...]
         -> If highest end timestamp for track buffer is set and less than or
            equal to presentation timestamp:
               Remove all coded frames from track buffer that have a
               presentation timestamp greater than or equal to highest end
               timestamp and less than frame end timestamp.

        Note the removal range is closed-open [a, b). WebKit is actually removing
        frames using an open-closed range (a, b], which causes frames not to be removed
        in situations where they should and frames to be removed in situations when
        they should not.

        Tests: media/media-source/media-source-range-end-frame-not-removed.html
               media/media-source/media-source-range-start-frame-replaced.html

        * Modules/mediasource/SampleMap.cpp:
        (WebCore::PresentationOrderSampleMap::findSamplesBetweenPresentationTimesFromEnd):
        * Modules/mediasource/SampleMap.h:
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):

2017-12-01  Simon Fraser  <simon.fraser@apple.com>

        Reduce the number of calls to ViewportConfiguration::updateConfiguration()
        https://bugs.webkit.org/show_bug.cgi?id=180299

        Reviewed by Zalan Bujtas.

        There are several calls to ViewportConfiguration::setDefaultConfiguration() during loading
        with the same arguments. We can avoid unnecessary calls to updateConfiguration() by returning
        early if the configuration hasn't changed.

        * page/ViewportConfiguration.cpp:
        (WebCore::ViewportConfiguration::setDefaultConfiguration):
        * page/ViewportConfiguration.h:
        (WebCore::ViewportConfiguration::Parameters::operator== const):

2017-12-01  Aishwarya Nirmal  <anirmal@apple.com>

        [Touch Bar Web API] Object representing Touch Bar Menu to send between Web and UI Processes
        https://bugs.webkit.org/show_bug.cgi?id=179714

        Reviewed by Wenson Hsieh.

        These changes allow the HTMLMenuElement and HTMLMenuItemElement to parse attributes relating
        to the touch bar and convey changes to the elements that will eventually be propogated to the
        UI process.

        No new tests at this point because the changes to HTMLMenuElement and HTMLMenuItemElement are
        new properties, which might not be worth testing, and overriden methods for insertedIntoAncestor
        and removedFromAncestor, which are involved in sending a message to a UI process but might be
        difficult to test at this point since the UI process only receives (and does not yet process)
        the message.

        * html/HTMLMenuElement.cpp:
        (WebCore::HTMLMenuElement::insertedIntoAncestor):
        (WebCore::HTMLMenuElement::removedFromAncestor):
        (WebCore::HTMLMenuElement::parseAttribute):
        * html/HTMLMenuElement.h:
        * html/HTMLMenuItemElement.cpp:
        (WebCore::HTMLMenuItemElement::insertedIntoAncestor):
        (WebCore::HTMLMenuItemElement::removedFromAncestor):
        * html/HTMLMenuItemElement.h:
        * page/ChromeClient.h:

2017-12-01  Daniel Bates  <dabates@apple.com>

        AlternativePresentationButtonSubstitution::unapply() may not undo substitution
        https://bugs.webkit.org/show_bug.cgi?id=180279
        <rdar://problem/35800599>

        Reviewed by Simon Fraser.

        Fixes an issue where removing an alternative presentation button substituted for a non-HTML input
        element did not restore the original appearance of the element before the substitution.

        To substitute the alternative presentation button for a non-HTML input element we attach a
        user-agent shadow root to it. Adding a shadow root, including a user-agent shadow root,
        tears down the existing renderers for the element. Currently when we unapply such a substitution
        we ultimately just remove the shadow root and do not create new renderers for the subtree
        that the shadow root was removed from. We need to create new renderers for this subtree
        to restore the original appearance of the element before the substitution.

        * editing/cocoa/AlternativePresentationButtonSubstitution.cpp:
        (WebCore::AlternativePresentationButtonSubstitution::unapply):

2017-12-01  Christopher Reid  <chris.reid@sony.com>

        Move DateComponents into WTF
        https://bugs.webkit.org/show_bug.cgi?id=180211

        Reviewed by Myles C. Maxfield.

        No new tests no change in behavior.

        Moved DateComponents from platform into WTF.

        * Sources.txt: Removed DateComponents
        * WebCore.xcodeproj/project.pbxproj: Removed DateComponents
        * dom/Document.cpp:
        * html/BaseDateAndTimeInputType.h:
        * html/DateTimeInputType.h: Fixed a call to the wrong parent constructor
        * html/HTMLInputElement.h:
        * html/InputType.cpp:
        * html/InputType.h:
        * platform/text/PlatformLocale.cpp:
        * platform/text/PlatformLocale.h:
        * platform/text/ios/LocalizedDateCache.h:
        * platform/text/mac/LocaleMac.h:
        * platform/text/win/LocaleWin.cpp:
        * platform/text/win/LocaleWin.h:
        * rendering/RenderThemeIOS.mm:

2017-12-01  Daniel Bates  <dabates@apple.com>

        Alternative Presentation Button: Provide a way to query for the replaced elements
        https://bugs.webkit.org/show_bug.cgi?id=180114
        <rdar://problem/35710539>

        Reviewed by Tim Horton.

        Add SPI to query for the elements that were replaced by an Alternative Presentation Button.

        Test: fast/forms/alternative-presentation-button/replaced-elements.html

        * editing/Editor.cpp:
        (WebCore::Editor::elementsReplacedByAlternativePresentationButton): Added.
        * editing/Editor.h:
        * editing/cocoa/AlternativePresentationButtonSubstitution.cpp:
        (WebCore::AlternativePresentationButtonSubstitution::replacedElements): Added.
        * editing/cocoa/AlternativePresentationButtonSubstitution.h:
        * testing/Internals.cpp:
        (WebCore::Internals::elementsReplacedByAlternativePresentationButton): Added.
        * testing/Internals.h:
        * testing/Internals.idl: Expose internals function elementsReplacedByAlternativePresentationButton()
        so as to test Editor::elementsReplacedByAlternativePresentationButton().

2017-12-01  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Rename ImageFrameCache to ImageSource
        https://bugs.webkit.org/show_bug.cgi?id=180172

        Reviewed by Per Arne Vollan.

        This is a follow-up for r225300. ImageSource is the intended name after
        merging ImageFrameCache and ImageSource.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::BitmapImage):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/ImageFrame.h:
        * platform/graphics/ImageFrameCache.cpp: Removed.
        * platform/graphics/ImageFrameCache.h: Removed.
        * platform/graphics/ImageSource.cpp: Added.
        (WebCore::ImageSource::ImageSource):
        (WebCore::ImageSource::~ImageSource):
        (WebCore::ImageSource::ensureDecoderAvailable):
        (WebCore::ImageSource::setData):
        (WebCore::ImageSource::resetData):
        (WebCore::ImageSource::dataChanged):
        (WebCore::ImageSource::isAllDataReceived):
        (WebCore::ImageSource::destroyDecodedData):
        (WebCore::ImageSource::destroyIncompleteDecodedData):
        (WebCore::ImageSource::clearFrameBufferCache):
        (WebCore::ImageSource::decodedSizeChanged):
        (WebCore::ImageSource::decodedSizeIncreased):
        (WebCore::ImageSource::decodedSizeDecreased):
        (WebCore::ImageSource::decodedSizeReset):
        (WebCore::ImageSource::didDecodeProperties):
        (WebCore::ImageSource::growFrames):
        (WebCore::ImageSource::setNativeImage):
        (WebCore::ImageSource::cacheMetadataAtIndex):
        (WebCore::ImageSource::cacheNativeImageAtIndex):
        (WebCore::ImageSource::cacheNativeImageAtIndexAsync):
        (WebCore::ImageSource::decodingQueue):
        (WebCore::ImageSource::frameRequestQueue):
        (WebCore::ImageSource::canUseAsyncDecoding):
        (WebCore::ImageSource::startAsyncDecodingQueue):
        (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex):
        (WebCore::ImageSource::isAsyncDecodingQueueIdle const):
        (WebCore::ImageSource::stopAsyncDecodingQueue):
        (WebCore::ImageSource::frameAtIndexCacheIfNeeded):
        (WebCore::ImageSource::clearMetadata):
        (WebCore::ImageSource::sourceURL const):
        (WebCore::ImageSource::mimeType const):
        (WebCore::ImageSource::expectedContentLength const):
        (WebCore::ImageSource::metadata):
        (WebCore::ImageSource::frameMetadataAtIndex):
        (WebCore::ImageSource::frameMetadataAtIndexCacheIfNeeded):
        (WebCore::ImageSource::encodedDataStatus):
        (WebCore::ImageSource::frameCount):
        (WebCore::ImageSource::repetitionCount):
        (WebCore::ImageSource::uti):
        (WebCore::ImageSource::filenameExtension):
        (WebCore::ImageSource::hotSpot):
        (WebCore::ImageSource::size):
        (WebCore::ImageSource::sizeRespectingOrientation):
        (WebCore::ImageSource::singlePixelSolidColor):
        (WebCore::ImageSource::maximumSubsamplingLevel):
        (WebCore::ImageSource::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex):
        (WebCore::ImageSource::frameDecodingStatusAtIndex):
        (WebCore::ImageSource::frameHasAlphaAtIndex):
        (WebCore::ImageSource::frameHasFullSizeNativeImageAtIndex):
        (WebCore::ImageSource::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex):
        (WebCore::ImageSource::frameSubsamplingLevelAtIndex):
        (WebCore::ImageSource::frameSizeAtIndex):
        (WebCore::ImageSource::frameBytesAtIndex):
        (WebCore::ImageSource::frameDurationAtIndex):
        (WebCore::ImageSource::frameOrientationAtIndex):
        (WebCore::ImageSource::setTargetContext):
        (WebCore::ImageSource::createFrameImageAtIndex):
        (WebCore::ImageSource::frameImageAtIndex):
        (WebCore::ImageSource::frameImageAtIndexCacheIfNeeded):
        (WebCore::ImageSource::dump):
        * platform/graphics/ImageSource.h: Added.
        (WebCore::ImageSource::create):
        (WebCore::ImageSource::decodedSize const):
        (WebCore::ImageSource::destroyAllDecodedData):
        (WebCore::ImageSource::destroyAllDecodedDataExcludeFrame):
        (WebCore::ImageSource::destroyDecodedDataBeforeFrame):
        (WebCore::ImageSource::clearImage):
        (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex):
        (WebCore::ImageSource::hasAsyncDecodingQueue const):
        (WebCore::ImageSource::isSizeAvailable):
        (WebCore::ImageSource::isDecoderAvailable const):
        (WebCore::ImageSource::frameAtIndexCacheIfNeeded):
        (WebCore::ImageSource::ImageFrameRequest::operator== const):
        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
        (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
        * platform/graphics/cg/GraphicsContext3DCG.cpp:
        (WebCore::GraphicsContext3D::ImageExtractor::extractImage):

2017-12-01  Youenn Fablet  <youenn@apple.com>

        Implement https://w3c.github.io/ServiceWorker/#clients-get
        https://bugs.webkit.org/show_bug.cgi?id=180167

        Reviewed by Chris Dumez.

        Test: http/tests/workers/service/serviceworkerclients-get.https.html

        Implement clients get by having service worker clients do the following:
        - Go to main thread to query the SWClientConnection for getting the client.
        - SWClientConnection requests it through IPC to StorageProcess SWServer.
        - SWServer looks at its client map and returns client data based on the given identifier.
        - SWClientConnection sends it back to the right clients for resolving the promise.

        Identifier is parsed at service worker process level.

        Made ServiceWorkerClients no longer an ActiveDOMObject since it is owned by ServiceWorkerGlobalScope
        and is only exposed in service workers.

        * workers/service/ServiceWorkerClientIdentifier.h:
        (WebCore::ServiceWorkerClientIdentifier::fromString):
        * workers/service/ServiceWorkerClients.cpp:
        (WebCore::ServiceWorkerClients::ServiceWorkerClients):
        (WebCore::ServiceWorkerClients::get):
        * workers/service/ServiceWorkerClients.h:
        (WebCore::ServiceWorkerClients::create):
        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::postTaskToServiceWorker):
        * workers/service/context/SWContextManager.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::getClientFromId):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerToContextConnection.cpp:
        (WebCore::SWServerToContextConnection::findClientByIdentifier):
        * workers/service/server/SWServerToContextConnection.h:
        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::origin const):
        (WebCore::SWServerWorker::findClientByIdentifier):
        * workers/service/server/SWServerWorker.h:

2017-12-01  Brian Burg  <bburg@apple.com>

        Web Inspector: move Inspector::Protocol::Array<T> to JSON namespace
        https://bugs.webkit.org/show_bug.cgi?id=173662

        Reviewed by Joseph Pecoraro.

        Adopt new type names.

        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::recordAction):
        (WebCore::InspectorCanvas::releaseFrames):
        (WebCore::InspectorCanvas::releaseData):
        (WebCore::InspectorCanvas::indexForData):
        (WebCore::buildArrayForAffineTransform):
        (WebCore::buildArrayForVector):
        (WebCore::InspectorCanvas::buildInitialState):
        (WebCore::InspectorCanvas::buildAction):
        (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
        (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
        (WebCore::InspectorCanvas::buildArrayForImageData):
        (WebCore::InspectorCanvas::buildArrayForImageBitmap):
        * inspector/InspectorCanvas.h:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::buildObjectForHighlightedNodes const):
        * inspector/InspectorController.h:
        * inspector/InspectorOverlay.cpp:
        (WebCore::buildObjectForHighlight):
        (WebCore::InspectorOverlay::drawPaintRects):
        (WebCore::buildArrayForRendererFragments):
        (WebCore::buildObjectForElementData):
        (WebCore::InspectorOverlay::buildHighlightObjectForNode const):
        (WebCore::InspectorOverlay::buildObjectForHighlightedNodes const):
        * inspector/InspectorOverlay.h:
        * inspector/InspectorStyleSheet.cpp:
        (WebCore::fillMediaListChain):
        (WebCore::InspectorStyle::buildArrayForComputedStyle const):
        (WebCore::InspectorStyle::styleWithProperties const):
        (WebCore::buildObjectForSelectorHelper):
        (WebCore::selectorsFromSource):
        (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
        (WebCore::InspectorStyleSheet::buildObjectForRule):
        (WebCore::InspectorStyleSheet::buildObjectForStyle):
        (WebCore::InspectorStyleSheet::buildArrayForRuleList):
        * inspector/InspectorStyleSheet.h:
        * inspector/agents/InspectorApplicationCacheAgent.cpp:
        (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
        (WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources):
        * inspector/agents/InspectorApplicationCacheAgent.h:
        * inspector/agents/InspectorCSSAgent.cpp:
        (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
        (WebCore::InspectorCSSAgent::getComputedStyleForNode):
        (WebCore::InspectorCSSAgent::getAllStyleSheets):
        (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
        (WebCore::InspectorCSSAgent::getSupportedSystemFontFamilyNames):
        (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
        * inspector/agents/InspectorCSSAgent.h:
        * inspector/agents/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
        * inspector/agents/InspectorCanvasAgent.h:
        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::querySelectorAll):
        (WebCore::InspectorDOMAgent::pushNodePathToFrontend):
        (WebCore::InspectorDOMAgent::getEventListenersForNode):
        (WebCore::InspectorDOMAgent::getSearchResults):
        (WebCore::InspectorDOMAgent::getAttributes):
        (WebCore::InspectorDOMAgent::buildObjectForNode):
        (WebCore::InspectorDOMAgent::buildArrayForElementAttributes):
        (WebCore::InspectorDOMAgent::buildArrayForContainerChildren):
        (WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
        (WebCore::InspectorDOMAgent::processAccessibilityChildren):
        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
        (WebCore::InspectorDOMAgent::styleAttributeInvalidated):
        * inspector/agents/InspectorDOMAgent.h:
        * inspector/agents/InspectorDOMStorageAgent.cpp:
        (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
        * inspector/agents/InspectorDOMStorageAgent.h:
        * inspector/agents/InspectorDatabaseAgent.cpp:
        (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
        * inspector/agents/InspectorDatabaseAgent.h:
        * inspector/agents/InspectorIndexedDBAgent.cpp:
        (WebCore::Inspector::keyPathFromIDBKeyPath):
        (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
        * inspector/agents/InspectorLayerTreeAgent.cpp:
        (WebCore::InspectorLayerTreeAgent::layersForNode):
        (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy):
        (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderLayerHierarchy):
        * inspector/agents/InspectorLayerTreeAgent.h:
        * inspector/agents/InspectorMemoryAgent.cpp:
        (WebCore::InspectorMemoryAgent::collectSample):
        * inspector/agents/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::searchOtherRequests):
        (WebCore::InspectorNetworkAgent::searchInRequest):
        * inspector/agents/InspectorNetworkAgent.h:
        * inspector/agents/InspectorPageAgent.cpp:
        (WebCore::buildArrayForCookies):
        (WebCore::InspectorPageAgent::getCookies):
        (WebCore::InspectorPageAgent::searchInResource):
        (WebCore::InspectorPageAgent::searchInResources):
        (WebCore::InspectorPageAgent::buildObjectForFrameTree):
        * inspector/agents/InspectorPageAgent.h:
        * inspector/agents/WebConsoleAgent.cpp:
        (WebCore::WebConsoleAgent::getLoggingChannels):
        * inspector/agents/WebConsoleAgent.h:

2017-12-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Implement SPI for clients to update a given attachment's data
        https://bugs.webkit.org/show_bug.cgi?id=180184
        <rdar://problem/35355731>

        Reviewed by Tim Horton.

        Add native API support for Mail to update the data (and optionally, the name and type) of a given attachment
        element. See per-method comments below for more detail.

        Test: WKAttachmentTests.ChangeAttachmentDataAndFileInformation
              WKAttachmentTests.ChangeAttachmentDataUpdatesWithInPlaceDisplay

        * editing/Editor.cpp:
        (WebCore::Editor::insertAttachment):
        * html/HTMLAttachmentElement.cpp:
        (WebCore::HTMLAttachmentElement::setFile):
        (WebCore::HTMLAttachmentElement::invalidateShadowRootChildrenIfNecessary):

        Pull out logic to hide and reset shadow DOM state into a separate helper, and additionally hide both the image
        and video child elements if they exist. This prevents us from getting into a state where both image and video
        elements may appear side-by-side when changing data from an image to a video or vice versa.

        (WebCore::HTMLAttachmentElement::updateFileWithData):

        Add a new helper to update the backing File of an attachment element from data, optionally updating the filename
        and content type as well.

        (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):
        * html/HTMLAttachmentElement.h:

2017-12-01  Chris Dumez  <cdumez@apple.com>

        Get rid of microtask in ServiceWorkerContainer::jobResolvedWithRegistration()
        https://bugs.webkit.org/show_bug.cgi?id=180263

        Reviewed by Youenn Fablet.

        Get rid of microtask in ServiceWorkerContainer::jobResolvedWithRegistration(). It
        is no longer needed and MicrotaskQueue::mainThreadQueue() is only safe to use from
        the main thread, as its name suggest. ServiceWorkerContainer are also instantiated
        in Service worker threads nowadays.

        * workers/service/SWClientConnection.cpp:
        (WebCore::SWClientConnection::registrationJobResolvedInServer):
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::resolvedWithRegistration):
        * workers/service/ServiceWorkerJob.h:
        * workers/service/ServiceWorkerJobClient.h:

2017-12-01  Myles C. Maxfield  <mmaxfield@apple.com>

        Free FontFaceSets may include fonts that were never actually added to them
        https://bugs.webkit.org/show_bug.cgi?id=180164

        Reviewed by Simon Fraser.

        There are two circumstances where this can occur:

        - If script makes a so-called "free" FontFaceSet, by using "new FontFaceSet". This object is not
        associated with the document, and should therefore only include fonts which have been manually
        added to it from script. However, today, this object includes preinstalled fonts which have the
        same names as any fonts manually added to it. (So, if you manually add "Helvetica", the object
        would have two objects - the one you just added and the preinstalled version too).

        - For the document's FontFaceSet, the same thing would happen. This one is a little trickier
        because the spec is not clear whether or not the document's FontFaceSet should include these
        preinstalled fonts. However, running this test in Firefox and Chrome, they both agree that 
        preinstalled fonts should not be present, so this patch adheres to this behavior.

        We can't actually remove the preinstalled fonts from the document's FontFaceSet (because that's
        how normal font lookups are performed), but we can filter them out at the point they meet the
        Javascript API. And, for "free" FontFaceSets, we can avoid adding them in the first place for
        performance.

        Test: fast/text/font-face-api-preinstalled.html

        * css/CSSFontFaceSet.cpp:
        (WebCore::CSSFontFaceSet::CSSFontFaceSet):
        (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
        (WebCore::CSSFontFaceSet::addToFacesLookupTable):
        (WebCore::CSSFontFaceSet::matchingFacesExcludingPreinstalledFonts):
        (WebCore::CSSFontFaceSet::check):
        (WebCore::CSSFontFaceSet::matchingFaces): Deleted.
        * css/CSSFontFaceSet.h:
        * css/CSSFontSelector.cpp:
        (WebCore::CSSFontSelector::CSSFontSelector):
        * css/FontFaceSet.cpp:
        (WebCore::FontFaceSet::load):

2017-12-01  Dean Jackson  <dino@apple.com>

        Attempted build fix.

        * platform/graphics/ANGLEWebKitBridge.cpp:
        (WebCore::ANGLEWebKitBridge::compileShaderSource):
        * platform/graphics/ANGLEWebKitBridge.h:
        * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
        (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):

2017-12-01  Dean Jackson  <dino@apple.com>

        Use SH_INITIALIZE_UNINITIALIZED_LOCALS now that ANGLE has been updated
        https://bugs.webkit.org/show_bug.cgi?id=177929
        <rdar://problem/34866210>

        Reviewed by Sam Weinig.

        Test: fast/canvas/webgl/uninitialized-locals.html

        * platform/graphics/ANGLEWebKitBridge.cpp:
        (WebCore::ANGLEWebKitBridge::compileShaderSource):
        * platform/graphics/ANGLEWebKitBridge.h:
        * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
        (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):

2017-12-01  Youenn Fablet  <youenn@apple.com>

        Many imported/w3c/web-platform-tests/service-workers/ test are failing together intermittently
        https://bugs.webkit.org/show_bug.cgi?id=180227

        Reviewed by Mark Lam.

        No observable change.

        * bindings/js/JSDOMPromise.cpp:
        (WebCore::callFunction):

2017-12-01  Brady Eidson  <beidson@apple.com>

        Add Internals.terminateServiceWorker, and the ability to restart service workers for postMessage.
        https://bugs.webkit.org/show_bug.cgi?id=180170

        Reviewed by Chris Dumez.

        Test: http/tests/workers/service/postmessage-after-terminate.https.html

        * dom/ActiveDOMObject.cpp:
        (WebCore::ActiveDOMObject::~ActiveDOMObject):

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

        * workers/service/SWClientConnection.h:

        * workers/service/ServiceWorker.idl:

        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
        (WebCore::SWContextManager::terminateWorker):
        * workers/service/context/SWContextManager.h:

        * workers/service/context/ServiceWorkerThreadProxy.h:

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::workerByID const):
        (WebCore::SWServer::Connection::syncTerminateWorker):
        (WebCore::SWServer::installContextData):
        (WebCore::SWServer::invokeRunServiceWorker):
        (WebCore::SWServer::terminateWorker):
        (WebCore::SWServer::syncTerminateWorker):
        (WebCore::SWServer::terminateWorkerInternal):
        (WebCore::SWServer::workerContextTerminated):
        * workers/service/server/SWServer.h:
        (WebCore::SWServer::workerByID const): Deleted.

        * workers/service/server/SWServerToContextConnection.h:

        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::contextData const):
        * workers/service/server/SWServerWorker.h:
        (WebCore::SWServerWorker::isRunning const):
        (WebCore::SWServerWorker::isTerminating const):
        (WebCore::SWServerWorker::setState):
        (WebCore::SWServerWorker::server):

2017-12-01  Zalan Bujtas  <zalan@apple.com>

        Nullptr deref in WebCore::RenderTableCaption::containingBlockLogicalWidthForContent
        https://bugs.webkit.org/show_bug.cgi?id=180251
        <rdar://problem/34138562>

        Reviewed by Simon Fraser.

        containingBlockLogicalWidthForContent should check whether the renderer is actually
        attached to the tree.

        Test: fast/table/caption-crash-when-layer-backed.html

        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::containingBlockLogicalWidthForContent const):
        * rendering/RenderTableCaption.h:
        (WebCore::RenderTableCaption::containingBlockLogicalWidthForContent const):

2017-12-01  Youenn Fablet  <youenn@apple.com>

        Clear WebSWClientConnection in case storage process IPC connection is closing
        https://bugs.webkit.org/show_bug.cgi?id=180210

        Reviewed by Chris Dumez.

        No observable change of behavior.

        * dom/Document.h: Keeping a ref since object may be deleted otherwise.

2017-12-01  Chris Dumez  <cdumez@apple.com>

        Drop clientCreationURL from ServiceWorkerRegistrationKey
        https://bugs.webkit.org/show_bug.cgi?id=180255

        Reviewed by Youenn Fablet.

        Drop clientCreationURL from ServiceWorkerRegistrationKey. It is not needed and leads to
        wrong behavior when using the Service Worker API from inside service workers.

        * workers/service/ServiceWorkerJobData.cpp:
        (WebCore::ServiceWorkerJobData::registrationKey const):
        * workers/service/ServiceWorkerRegistrationKey.cpp:
        (WebCore::ServiceWorkerRegistrationKey::ServiceWorkerRegistrationKey):
        (WebCore::ServiceWorkerRegistrationKey::hash const):
        (WebCore::ServiceWorkerRegistrationKey::operator== const):
        (WebCore::ServiceWorkerRegistrationKey::isolatedCopy const):
        (WebCore::ServiceWorkerRegistrationKey::loggingString const):
        * workers/service/ServiceWorkerRegistrationKey.h:
        (WebCore::ServiceWorkerRegistrationKey::scope const):
        (WebCore::ServiceWorkerRegistrationKey::setScope):
        (WebCore::ServiceWorkerRegistrationKey::encode const):
        (WebCore::ServiceWorkerRegistrationKey::decode):
        (WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::constructDeletedValue):
        (WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::isDeletedValue):
        (WebCore::ServiceWorkerRegistrationKey::clientCreationURL const): Deleted.
        (WebCore::ServiceWorkerRegistrationKey::setClientCreationURL): Deleted.

2017-12-01  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] Wrongly placed scroll bars in HiDPI
        https://bugs.webkit.org/show_bug.cgi?id=180066

        Reviewed by Žan Doberšek.

        PlatformContextCairo wasn't properly initialized. It should have a
        pointer to GraphicsContextPrivate in WinCairo port to paint
        controls in right places.

        No new tests, no behavior change.

        * platform/graphics/win/GraphicsContextCairoWin.cpp:
        (WebCore::GraphicsContext::platformInit): Call PlatformContextCairo::setGraphicsContextPrivate.

2017-12-01  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Use CaptureDevice instead of device ID to identify devices
        https://bugs.webkit.org/show_bug.cgi?id=180206
        <rdar://problem/35775758>

        Reviewed by Youenn Fablet.

        No new tests, no change in behavior.

        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::allow):
        * Modules/mediastream/UserMediaRequest.h:
        (WebCore::UserMediaRequest::allowedAudioDeviceUID const): Deleted.
        (WebCore::UserMediaRequest::allowedVideoDeviceUID const): Deleted.
        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::createMediaStream):
        (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        * platform/mock/MockRealtimeAudioSource.cpp:
        * platform/mock/MockRealtimeVideoSource.cpp:

2017-11-30  Alex Christensen  <achristensen@webkit.org>

        Extra PerformanceEntryList entry after iframe navigation
        https://bugs.webkit.org/show_bug.cgi?id=178433

        Reviewed by Joseph Pecoraro.

        Test: http/tests/security/PerformanceEntryList-parent-only-first-navigation.html

        When an iframe is loaded, its main resource load should be reported to the parent frame's PerformanceEntryList.
        Subsequent main resource loads should not.

        * loader/FrameLoader.h:
        (WebCore::FrameLoader::shouldReportResourceTimingToParentFrame):
        * loader/ResourceTimingInformation.cpp:
        (WebCore::ResourceTimingInformation::addResourceTiming):

2017-11-30  Zalan Bujtas  <zalan@apple.com>

        [Simple line layout] Incorrect repaint rect with vertically shrinking content and bottom-padding.
        https://bugs.webkit.org/show_bug.cgi?id=180223
        <rdar://problem/34122210>

        Reviewed by Simon Fraser.

        Repaint rect should be extended all the way to bottom border/padding.

        Test: fast/repaint/simple-line-layout-shrinking-content.html

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::layoutSimpleLines):

2017-11-30  Stephan Szabo  <stephan.szabo@sony.com>

        Make LegacyCustomProtocolManager optional for network process
        https://bugs.webkit.org/show_bug.cgi?id=176230

        Reviewed by Alex Christensen.

        No new tests, only sets up feature define

        * Configurations/FeatureDefines.xcconfig:

2017-11-30  Joseph Pecoraro  <pecoraro@apple.com>

        [Cocoa] Fix CVPixelBuffer leak
        https://bugs.webkit.org/show_bug.cgi?id=180224

        Reviewed by Youenn Fablet.

        * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp:
        (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
        Adopt the newly created pixel buffer.

        (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
        Release the format description as soon as we are done with it. Otherwise
        we could have bailed before releasing it.

2017-11-30  Simon Fraser  <simon.fraser@apple.com>

        Improve filter logging
        https://bugs.webkit.org/show_bug.cgi?id=180182

        Reviewed by Sam Weinig.

        Add a parameter to FilterEffect::externalRepresentation() so that we can log extra
        data without breaking layout tests.

        Add TextStream output for ColorSpace.
        
        Improve logging of FEComponentTransfer ComponentTransferFunctions by logging the data
        that's appropriate for the function type, and rebaseline affected tests.

        * platform/graphics/Color.cpp:
        (WebCore::operator<<):
        * platform/graphics/Color.h:
        * platform/graphics/filters/FEBlend.cpp:
        (WebCore::FEBlend::externalRepresentation const):
        * platform/graphics/filters/FEBlend.h:
        * platform/graphics/filters/FEColorMatrix.cpp:
        (WebCore::FEColorMatrix::externalRepresentation const):
        * platform/graphics/filters/FEColorMatrix.h:
        * platform/graphics/filters/FEComponentTransfer.cpp:
        (WebCore::operator<<):
        (WebCore::FEComponentTransfer::externalRepresentation const):
        * platform/graphics/filters/FEComponentTransfer.h:
        * platform/graphics/filters/FEComposite.cpp:
        (WebCore::FEComposite::externalRepresentation const):
        * platform/graphics/filters/FEComposite.h:
        * platform/graphics/filters/FEConvolveMatrix.cpp:
        (WebCore::FEConvolveMatrix::externalRepresentation const):
        * platform/graphics/filters/FEConvolveMatrix.h:
        * platform/graphics/filters/FEDiffuseLighting.cpp:
        (WebCore::FEDiffuseLighting::externalRepresentation const):
        * platform/graphics/filters/FEDiffuseLighting.h:
        * platform/graphics/filters/FEDisplacementMap.cpp:
        (WebCore::FEDisplacementMap::externalRepresentation const):
        * platform/graphics/filters/FEDisplacementMap.h:
        * platform/graphics/filters/FEDropShadow.cpp:
        (WebCore::FEDropShadow::externalRepresentation const):
        * platform/graphics/filters/FEDropShadow.h:
        * platform/graphics/filters/FEFlood.cpp:
        (WebCore::FEFlood::externalRepresentation const):
        * platform/graphics/filters/FEFlood.h:
        * platform/graphics/filters/FEGaussianBlur.cpp:
        (WebCore::FEGaussianBlur::externalRepresentation const):
        * platform/graphics/filters/FEGaussianBlur.h:
        * platform/graphics/filters/FEMerge.cpp:
        (WebCore::FEMerge::externalRepresentation const):
        * platform/graphics/filters/FEMerge.h:
        * platform/graphics/filters/FEMorphology.cpp:
        (WebCore::FEMorphology::externalRepresentation const):
        * platform/graphics/filters/FEMorphology.h:
        * platform/graphics/filters/FEOffset.cpp:
        (WebCore::FEOffset::externalRepresentation const):
        * platform/graphics/filters/FEOffset.h:
        * platform/graphics/filters/FESpecularLighting.cpp:
        (WebCore::FESpecularLighting::externalRepresentation const):
        * platform/graphics/filters/FESpecularLighting.h:
        * platform/graphics/filters/FETile.cpp:
        (WebCore::FETile::externalRepresentation const):
        * platform/graphics/filters/FETile.h:
        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::FETurbulence::externalRepresentation const):
        * platform/graphics/filters/FETurbulence.h:
        * platform/graphics/filters/FilterEffect.cpp:
        (WebCore::FilterEffect::externalRepresentation const):
        (WebCore::operator<<):
        * platform/graphics/filters/FilterEffect.h:
        * platform/graphics/filters/SourceAlpha.cpp:
        (WebCore::SourceAlpha::externalRepresentation const):
        * platform/graphics/filters/SourceAlpha.h:
        * platform/graphics/filters/SourceGraphic.cpp:
        (WebCore::SourceGraphic::externalRepresentation const):
        * platform/graphics/filters/SourceGraphic.h:
        * rendering/svg/RenderSVGResourceFilter.cpp:
        (WebCore::RenderSVGResourceFilter::applyResource):
        * svg/graphics/filters/SVGFEImage.cpp:
        (WebCore::FEImage::externalRepresentation const):
        * svg/graphics/filters/SVGFEImage.h:

2017-11-30  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed build fix, removed unused lambda captures.

        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::postFetchTask):
        (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):

2017-11-30  Chris Dumez  <cdumez@apple.com>

        Move SWClientConnection class out of server/ folder
        https://bugs.webkit.org/show_bug.cgi?id=180217

        Reviewed by Brady Eidson.

        Move SWClientConnection class out of server/ folder since the client connection
        lives in the WebProcess, not the Storage process.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * workers/service/SWClientConnection.cpp: Renamed from Source/WebCore/workers/service/server/SWClientConnection.cpp.
        (WebCore::SWClientConnection::scheduleJob):
        (WebCore::SWClientConnection::finishedFetchingScript):
        (WebCore::SWClientConnection::failedFetchingScript):
        (WebCore::SWClientConnection::jobRejectedInServer):
        (WebCore::SWClientConnection::registrationJobResolvedInServer):
        (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
        (WebCore::SWClientConnection::startScriptFetchForServer):
        (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
        (WebCore::SWClientConnection::forEachContainer):
        (WebCore::SWClientConnection::updateRegistrationState):
        (WebCore::SWClientConnection::updateWorkerState):
        (WebCore::SWClientConnection::fireUpdateFoundEvent):
        (WebCore::SWClientConnection::notifyClientsOfControllerChange):
        * workers/service/SWClientConnection.h: Renamed from Source/WebCore/workers/service/server/SWClientConnection.h.
        * workers/service/ServiceWorkerContainer.cpp:

2017-11-30  Chris Dumez  <cdumez@apple.com>

        ServiceWorkerThread's m_extendedEvents gets destroyed on the wrong thread
        https://bugs.webkit.org/show_bug.cgi?id=180216

        Reviewed by Brady Eidson.

        ServiceWorkerThread's m_extendedEvents gets destroyed on the wrong thread. Those events live on the worker
        thread so we should destroy them on the worker thread, not the main thread. To address the issue, m_extendedEvents
        was moved to ServiceWorkerGlobalScope, which actually lives on the right thread.

        * workers/service/ServiceWorkerGlobalScope.cpp:
        (WebCore::ServiceWorkerGlobalScope::updateExtendedEventsSet):
        * workers/service/ServiceWorkerGlobalScope.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::postFetchTask):
        (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
        (WebCore::ServiceWorkerThread::updateExtendedEventsSet): Deleted.
        * workers/service/context/ServiceWorkerThread.h:
        (WebCore::ServiceWorkerThread::hasPendingEvents const): Deleted.

2017-11-30  Chris Dumez  <cdumez@apple.com>

        SWServerToContextConnection / SWServerWorker do not need to be ThreadSafeRefCounted
        https://bugs.webkit.org/show_bug.cgi?id=180214

        Reviewed by Brady Eidson.

        SWServerToContextConnection / SWServerWorker do not need to be ThreadSafeRefCounted.
        RefCounted is sufficient as there is no longer any multithreading on server side.

        * workers/service/server/SWServerToContextConnection.h:
        * workers/service/server/SWServerWorker.h:

2017-11-30  Chris Dumez  <cdumez@apple.com>

        ServiceWorkerGlobalScope::skipWaiting() should resolve its promise
        https://bugs.webkit.org/show_bug.cgi?id=180204

        Reviewed by Brady Eidson.

        ServiceWorkerGlobalScope::skipWaiting() should resolve its promise, even if it is not
        implemented yet. For now, always reject the promise.

        * workers/service/ServiceWorkerGlobalScope.cpp:
        (WebCore::ServiceWorkerGlobalScope::skipWaiting):

2017-11-30  Chris Dumez  <cdumez@apple.com>

        Mark a few heap-allocated service worker types as WTF_MAKE_FAST_ALLOCATED
        https://bugs.webkit.org/show_bug.cgi?id=180212

        Reviewed by Geoffrey Garen.

        Mark a few heap-allocated service worker types as WTF_MAKE_FAST_ALLOCATED for performance.

        * workers/service/server/SWOriginStore.h:
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.h:
        * workers/service/server/SWServerRegistration.h:

2017-11-30  Brady Eidson  <beidson@apple.com>

        Make WorkerThread lifetime much more predictable.
        https://bugs.webkit.org/show_bug.cgi?id=180203

        Reviewed by Chris Dumez.

        No new tests (Fixes flakiness in existing and future tests).

        The family of classes related to Workers has a complicated ownership model.

        For Dedicated Workers, the WorkerThread object is owned by the WorkerMessagingProxy,
        which manages its own lifetime. Additionally, other object(s) have raw C++ references
        to it, and the expected lifetimes are described in comments scattered through a few files.

        What it boils down to is that the "Worker" DOM object - which lives on the main thread - 
        is the key to the proper destruction of all of these objects.

        For ServiceWorkers running in their own context process, there is no "Worker" on the main thread.

        As a result, ServiceWorkers can get into a situation where their WorkerThread can be destroyed before
        their ServiceWorkerGlobalScope is destroyed on the running background thread.

        There's no reason to not have WorkerThread guarantee its own lifetime until its background thread
        has actually completed.

        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::workerThread): Protect the WorkerThread object during the entire runtime
          of the background thread itself, and release that protection on the main thread.
        * workers/WorkerThread.h:

2017-11-30  Chris Dumez  <cdumez@apple.com>

        Populate self.registration.installing/waiting/active inside service workers
        https://bugs.webkit.org/show_bug.cgi?id=180168

        Reviewed by Brady Eidson.

        Populate self.registration.installing/waiting/active inside service workers.
        Also make sure the ServiceWorker's state properly gets updated inside
        service workers.

        No new tests, extended existing test for self.registration.

        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::scheduleTaskToUpdateState):
        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::forEachServiceWorkerThread):
        * workers/service/context/SWContextManager.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::fireInstallEvent):
        (WebCore::ServiceWorkerThread::fireActivateEvent):
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::updateRegistrationState):
        (WebCore::SWClientConnection::updateWorkerState):
        (WebCore::SWClientConnection::fireUpdateFoundEvent):
        * workers/service/server/SWClientConnection.h:

2017-11-30  Chris Dumez  <cdumez@apple.com>

        Rename RegistrationOptions to ServiceWorkerRegistrationOptions
        https://bugs.webkit.org/show_bug.cgi?id=180207

        Reviewed by Geoffrey Garen.

        Rename RegistrationOptions to ServiceWorkerRegistrationOptions as the name
        RegistrationOptions is too generic and likely to conflict. Also modernize
        ServiceWorkerRegistrationOptions' IPC decoder.

        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerJobData.h:
        (WebCore::ServiceWorkerJobData::decode):
        * workers/service/ServiceWorkerRegistrationOptions.cpp:
        (WebCore::ServiceWorkerRegistrationOptions::isolatedCopy const):
        * workers/service/ServiceWorkerRegistrationOptions.h:
        (WebCore::ServiceWorkerRegistrationOptions::encode const):
        (WebCore::ServiceWorkerRegistrationOptions::decode):

2017-11-30  Darin Adler  <darin@apple.com>

        [Mac] remove unneeded RetainPtr use introduced in r225142
        https://bugs.webkit.org/show_bug.cgi?id=180202

        Reviewed by Tim Horton.

        * editing/mac/DictionaryLookup.h: Changed out arguments back to NSDictionary ** instead
        of RetainPtr because these use autorelease.

        * editing/mac/DictionaryLookup.mm:
        (WebCore::tokenRange): Use NSDictionary **.
        (WebCore::DictionaryLookup::rangeForSelection): Ditto.
        (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto.
        (WebCore::DictionaryLookup::stringForPDFSelection): Ditto.

2017-11-30  Chris Dumez  <cdumez@apple.com>

        Mark ServiceWorkerGlobalScope as final
        https://bugs.webkit.org/show_bug.cgi?id=180201

        Reviewed by Alex Christensen.

        * workers/service/ServiceWorkerGlobalScope.h:

2017-11-30  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Move CoordinatedGraphicsLayer painting behind Nicosia::PaintingEngine
        https://bugs.webkit.org/show_bug.cgi?id=180141

        Reviewed by Carlos Garcia Campos.

        Introduce a painting engine concept that's used to perform painting
        for a given GraphicsLayer object.

        The Nicosia::PaintingEngine object is leveraged in the
        CoordinatedGraphicsLayer::updateContentBuffers() method. It's retrieved
        through the CoordinatedGraphicsLayerClient interface, with a new method
        introduced there for this purpose.

        The Nicosia::PaintingEngine interface is kept simple for now, with only
        a single paint() method. The only current implementation is the
        PaintingEngineBasic class, which simply reuses the code that was
        previously in CoordinatedGraphicsLayer::updateContentBuffers(),
        maintaining the current functionality.

        The Nicosia::PaintingEngine::create() function returns a new
        PaintingEngine object. For now it defaults to PaintingEngineBasic, but
        it could be configured at configure-time or even runtime in the future
        to return a more advanced engine implementation.

        No new tests -- no change in behavior.

        * platform/TextureMapper.cmake:
        * platform/graphics/nicosia/NicosiaPaintingEngine.cpp: Added.
        (Nicosia::PaintingEngine::create):
        * platform/graphics/nicosia/NicosiaPaintingEngine.h: Added.
        * platform/graphics/nicosia/NicosiaPaintingEngineBasic.cpp: Added.
        (Nicosia::PaintingEngineBasic::paint):
        * platform/graphics/nicosia/NicosiaPaintingEngineBasic.h: Added.
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

2017-11-30  Adrian Perez de Castro  <aperez@igalia.com>

        [GStreamer] Builds fails with ENABLE_VIDEO=OFF due to GStreamer usage
        https://bugs.webkit.org/show_bug.cgi?id=179373

        Reviewed by Xabier Rodriguez-Calvar.

        This allows to build with WebAudio enabled even if video support is
        disabled by guarding usage of HTMLMediaElement with ENABLE(VIDEO).

        No new tests needed.

        * page/DeprecatedGlobalSettings.cpp:
        (WebCore::DeprecatedGlobalSettings::setGStreamerEnabled): Guard usage of HTMLMediaElement.

2017-11-29  Chris Dumez  <cdumez@apple.com>

        ServiceWorker WebProcess sometimes crashes in JSVMClientData::~JSVMClientData()
        https://bugs.webkit.org/show_bug.cgi?id=180173

        Reviewed by Alex Christensen.

        The leak was caused by EventListeners remaining when destroying the VM, because
        JSEventListener refs the DOMWrapperWorld. To address the issue, we now call
        removeAllEventListeners() in the stop() method of ServiceWorkerContainer,
        ServiceWorkerRegistration and ServiceWorker. Those event listeners are no
        longer needed after ActiveDOMObject::stop() is called since the script
        execution context is about to be destroyed.

        This is the same pattern used in IDBDatabase::stop(), IDBRequest::stop().

        No new tests, already covered by existing test.

        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::stop):
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::stop):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::stop):

2017-11-29  Filip Pizlo  <fpizlo@apple.com>

        GC should support isoheaps
        https://bugs.webkit.org/show_bug.cgi?id=179288

        Reviewed by Saam Barati.

        No new tests because no new behavior.
        
        Adopting changes in JSC Subspace API.

        * ForwardingHeaders/runtime/JSDestructibleObjectHeapCellType.h: Added.
        * ForwardingHeaders/runtime/JSSegmentedVariableObjectHeapCellType.h: Added.
        * bindings/js/JSDOMWrapper.cpp:
        (WebCore::outputConstraintSubspaceFor):
        (WebCore::globalObjectOutputConstraintSubspaceFor):
        * bindings/js/JSDOMWrapper.h:
        * bindings/js/WebCoreJSClientData.cpp:
        (WebCore::JSVMClientData::JSVMClientData):
        * bindings/js/WebCoreJSClientData.h:
        (WebCore::JSVMClientData::outputConstraintSpace):
        (WebCore::JSVMClientData::globalObjectOutputConstraintSpace):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):

2017-11-29  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Clean up audio and video capture factories
        https://bugs.webkit.org/show_bug.cgi?id=180156
        <rdar://problem/35753435>

        Reviewed by Youenn Fablet.

        No new tests, no behavior change.

        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::setAudioFactory): Deleted.
        (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory): Deleted.
        (WebCore::RealtimeMediaSourceCenter::audioFactory): Deleted.
        (WebCore::RealtimeMediaSourceCenter::setVideoFactory): Deleted.
        (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory): Deleted.
        (WebCore::RealtimeMediaSourceCenter::videoFactory): Deleted.
        (WebCore::RealtimeMediaSourceCenter::setAudioCaptureDeviceManager): Deleted.
        (WebCore::RealtimeMediaSourceCenter::unsetAudioCaptureDeviceManager): Deleted.
        (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager): Deleted.
        (WebCore::RealtimeMediaSourceCenter::setVideoCaptureDeviceManager): Deleted.
        (WebCore::RealtimeMediaSourceCenter::unsetVideoCaptureDeviceManager): Deleted.
        (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager): Deleted.
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
        (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
        * platform/mediastream/RealtimeMediaSourceSettings.cpp:
        (WebCore::RealtimeMediaSourceSettings::facingMode):
        (WebCore::RealtimeMediaSourceSettings::videoFacingModeEnum):
        (WebCore::userFacing): Deleted.
        (WebCore::environmentFacing): Deleted.
        (WebCore::leftFacing): Deleted.
        (WebCore::rightFacing): Deleted.
        * platform/mediastream/RealtimeMediaSourceSettings.h:
        (WebCore::RealtimeMediaSourceSettings::RealtimeMediaSourceSettings): Deleted.
        * platform/mediastream/mac/AVVideoCaptureSource.h:
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::create):
        (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
        (WebCore::AVVideoCaptureSource::setupCaptureSession):
        (): Deleted.
        (WebCore::AVVideoCaptureSourceFactory::setVideoCapturePageState): Deleted.
        (WebCore::avVideoCaptureSourceFactory): Deleted.
        (WebCore::AVVideoCaptureSource::factory): Deleted.
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::videoCaptureSourceFactory):
        (WebCore::RealtimeMediaSourceCenterMac::audioFactory):
        (WebCore::RealtimeMediaSourceCenterMac::videoFactory):
        (WebCore::RealtimeMediaSourceCenterMac::audioCaptureDeviceManager):
        (WebCore::RealtimeMediaSourceCenterMac::videoCaptureDeviceManager):
        (WebCore::RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac): Deleted.
        (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory): Deleted.
        (WebCore::RealtimeMediaSourceCenterMac::defaultVideoFactory): Deleted.
        (WebCore::RealtimeMediaSourceCenterMac::defaultAudioCaptureDeviceManager): Deleted.
        (WebCore::RealtimeMediaSourceCenterMac::defaultVideoCaptureDeviceManager): Deleted.
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
        * platform/mock/MockRealtimeAudioSource.cpp:
        (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
        (WebCore::MockRealtimeAudioSource::startProducingData):
        * platform/mock/MockRealtimeMediaSourceCenter.h:
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource):
        (WebCore::MockRealtimeVideoSource::startProducingData):
        * platform/mock/MockRealtimeVideoSource.h:

2017-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Implement SPI for clients to make an attachment element display in-place
        https://bugs.webkit.org/show_bug.cgi?id=180153
        <rdar://problem/35735252>

        Reviewed by Tim Horton.

        Adds SPI support for inserting attachments using in-place display style, and updating display options for
        existing attachments. See comments below for more detail.

        Tests: WKAttachmentTests.InPlaceImageAttachmentToggleDisplayMode
               WKAttachmentTests.InPlaceImageAttachmentParagraphInsertion
               WKAttachmentTests.InPlaceVideoAttachmentInsertionWithinList
               WKAttachmentTests.InPlacePDFAttachmentCutAndPaste

        * WebCore.xcodeproj/project.pbxproj:
        * editing/Editor.cpp:
        (WebCore::Editor::insertAttachment):
        (WebCore::Editor::insertAttachmentFromFile):

        Update display options for the attachment before inserting into the document.

        * editing/Editor.h:
        * html/AttachmentTypes.h: Added.

        Add a new header to define the new attachment display types. This lets us avoid importing HTMLAttachmentElement.h
        and instead just import AttachmentTypes.h in some places in WebKit that only deal with plumbing
        AttachmentDisplayOptions to the web process.

        (WebCore::AttachmentDisplayOptions::encode const):
        (WebCore::AttachmentDisplayOptions::decode):

        Support serializing and deserializing attachment display options.

        * html/HTMLAttachmentElement.cpp:
        (WebCore::HTMLAttachmentElement::setFile):

        Regenerate the shadow root if needed when setting the file.

        (WebCore::HTMLAttachmentElement::updateDisplayMode):

        Introduce a new method to update the display mode of an attachment element. This builds up the shadow root of
        the attachment if it is displayed in-place.

        (WebCore::HTMLAttachmentElement::ensureInnerImage):
        (WebCore::HTMLAttachmentElement::ensureInnerVideo):

        Helpers to insert image and video elements into the shadow root if needed, and return the image or video element.

        (WebCore::HTMLAttachmentElement::innerImage const):
        (WebCore::HTMLAttachmentElement::innerVideo const):

        Helpers to retrieve existing image and video elements in the shadow root.

        (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):

        Appends and configures the attachment element's shadow root for inline display, initializing an image or video
        element or neither, depending on the attachment type.

        * html/HTMLAttachmentElement.h:

        Introduce an AttachmentDisplayOptions struct which mirrors _WKAttachmentDisplayOptions in the WebKit layer. For
        now, this only contains a display mode enum.

        * platform/audio/ios/AudioSessionIOS.mm:

        Avoid this AVAudioSession assertion when targeting iOS simulator. AVAudioSession always throws this error when
        setting an audio session category in the simulator, even in a basic test app, since AVFoundation doesn't support
        audio sessions in the simulator.

        (WebCore::AudioSession::setCategory):

2017-11-29  Simon Fraser  <simon.fraser@apple.com>

        Missing layer content when animating elements on-screen
        https://bugs.webkit.org/show_bug.cgi?id=180178
        rdar://problem/34923438

        Reviewed by Dean Jackson.

        If a delayed animation starts, that animates layers from offscreen, then we would fail
        to run the logic that ensures that those layers have backing store.

        Fix by ensuring that if any layer starts or ends a transform animation, we re-evaluate
        backing store attachment on all its descendants.

        I tried to make a test, but layer flushing is timing-sensitive and the test would have taken
        5s, and not been reliable. There's a manual test in the bug.

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

2017-11-29  Youenn Fablet  <youenn@apple.com>

        ServiceWorkerClient objects should be reused if there is already one existing with the same identifier
        https://bugs.webkit.org/show_bug.cgi?id=180143

        Reviewed by Chris Dumez.

        Covered by updated tests.

        ServiceWorkerGlobalScope keeps a map of all live ServiceWorkerClient objects.
        Before creating a new client, it checks whether the map has one such object with the same identifier.
        If so, it reuses this object. Otherwise it creates either a ServiceWorkerWindowClient or ServiceWorkerClient.

        Add support for using a ServiceWorkerClientIdentifier as a HashMap key.

        * workers/service/ServiceWorkerClient.cpp:
        (WebCore::ServiceWorkerClient::ServiceWorkerClient):
        (WebCore::ServiceWorkerClient::~ServiceWorkerClient):
        * workers/service/ServiceWorkerClient.h:
        (WebCore::ServiceWorkerClient::getOrCreate):
        * workers/service/ServiceWorkerClientIdentifier.h:
        (WebCore::ServiceWorkerClientIdentifier::hash const):
        (WTF::ServiceWorkerClientIdentifierHash::hash):
        (WTF::ServiceWorkerClientIdentifierHash::equal):
        (WTF::HashTraits<WebCore::ServiceWorkerClientIdentifier>::emptyValue):
        (WTF::HashTraits<WebCore::ServiceWorkerClientIdentifier>::constructDeletedValue):
        (WTF::HashTraits<WebCore::ServiceWorkerClientIdentifier>::isDeletedValue):
        * workers/service/ServiceWorkerGlobalScope.cpp:
        (WebCore::ServiceWorkerGlobalScope::serviceWorkerClient):
        (WebCore::ServiceWorkerGlobalScope::addServiceWorkerClient):
        (WebCore::ServiceWorkerGlobalScope::removeServiceWorkerClient):
        * workers/service/ServiceWorkerGlobalScope.h:
        * workers/service/ServiceWorkerWindowClient.cpp:
        (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
        * workers/service/ServiceWorkerWindowClient.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):

2017-11-29  Zalan Bujtas  <zalan@apple.com>

        Add missing WTF_MAKE_ISO_ALLOCATED macros
        https://bugs.webkit.org/show_bug.cgi?id=180165
        <rdar://problem/35755617>

        Reviewed by Simon Fraser.

        * rendering/RenderFrame.h:
        * rendering/RenderFullScreen.cpp:
        * rendering/RenderIFrame.h:

2017-11-29  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Remove the ImageSource from the class hierarchy that connects BitmapImage to ImageFrame
        https://bugs.webkit.org/show_bug.cgi?id=175595

        Reviewed by Darin Adler.

        The class hierarchy that connects BitmapImage to ImageFrame has been
        troublesome. ImageSource does not have a clear responsibility other than
        a bridge that connects BitmapIamge to ImageFrameCache. Sharing the 
        ImageDecoder between ImageSource and ImageFrameCache is ugly and caused
        few crashes in the past.

        This patch will do the first step for fixing this issue. First get rid of
        ImageSource by moving its APIs to ImageFrameCache and BitmapImage. Replace
        all the instances of ImageSource by ImageFrameCache. The next step will
        be to rename ImageFrameCache to ImageSource. But this will be done in a
        follow-up patch

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::BitmapImage):
        (WebCore::BitmapImage::~BitmapImage):
        (WebCore::BitmapImage::destroyDecodedData):
        (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
        (WebCore::BitmapImage::dataChanged):
        (WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded):
        (WebCore::BitmapImage::draw):
        (WebCore::BitmapImage::canUseAsyncDecodingForLargeImages const):
        (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages const):
        (WebCore::BitmapImage::subsamplingLevelForScaleFactor):
        (WebCore::BitmapImage::canDestroyDecodedData):
        (WebCore::BitmapImage::internalStartAnimation):
        (WebCore::BitmapImage::stopAnimation):
        (WebCore::BitmapImage::decode):
        (WebCore::BitmapImage::imageFrameAvailableAtIndex):
        (WebCore::BitmapImage::dump const):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::ImageFrameCache):
        (WebCore::ImageFrameCache::ensureDecoderAvailable):
        (WebCore::ImageFrameCache::setData):
        (WebCore::ImageFrameCache::resetData):
        (WebCore::ImageFrameCache::dataChanged):
        (WebCore::ImageFrameCache::isAllDataReceived):
        (WebCore::ImageFrameCache::clearFrameBufferCache):
        (WebCore::ImageFrameCache::canUseAsyncDecoding):
        (WebCore::ImageFrameCache::maximumSubsamplingLevel):
        (WebCore::ImageFrameCache::setTargetContext):
        (WebCore::ImageFrameCache::createFrameImageAtIndex):
        (WebCore::ImageFrameCache::dump):
        (WebCore::ImageFrameCache::setDecoder): Deleted.
        (WebCore::ImageFrameCache::decoder const): Deleted.
        * platform/graphics/ImageFrameCache.h:
        (WebCore::ImageFrameCache::create):
        (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
        * platform/graphics/ImageSource.cpp: Removed.
        * platform/graphics/ImageSource.h: Removed.
        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
        (WebCore::GraphicsContext3D::ImageExtractor::~ImageExtractor):
        (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
        * platform/graphics/cg/GraphicsContext3DCG.cpp:
        (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
        * platform/graphics/cg/ImageSourceCG.h:

2017-11-29  Brady Eidson  <beidson@apple.com>

        When managing context startups, make ServiceWorkerJobDataIdentifier's optional.
        https://bugs.webkit.org/show_bug.cgi?id=180166

        Reviewed by Chris Dumez.

        No new tests (No behavior change).

        We'll sometimes be starting SW contexts without an associated job, so ServiceWorkerContextData
        should not required actually having a job identifier.

        * workers/service/ServiceWorkerContextData.h:
        (WebCore::ServiceWorkerContextData::decode):

        * workers/service/context/SWContextManager.h:

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::scriptContextFailedToStart):
        (WebCore::SWServer::scriptContextStarted):
        (WebCore::SWServer::didFinishInstall):
        * workers/service/server/SWServer.h:

        * workers/service/server/SWServerToContextConnection.cpp:
        (WebCore::SWServerToContextConnection::scriptContextFailedToStart):
        (WebCore::SWServerToContextConnection::scriptContextStarted):
        (WebCore::SWServerToContextConnection::didFinishInstall):
        * workers/service/server/SWServerToContextConnection.h:

        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::scriptContextFailedToStart):
        (WebCore::SWServerWorker::scriptContextStarted):
        (WebCore::SWServerWorker::didFinishInstall):
        * workers/service/server/SWServerWorker.h:

2017-11-29  Youenn Fablet  <youenn@apple.com>

        Add support for service worker generated redirections
        https://bugs.webkit.org/show_bug.cgi?id=179498

        Reviewed by Darin Adler.

        Test: http/tests/workers/service/service-worker-redirection-fetch.https.html

        Added redirection routines following fetch specification to:
        - check whether a response is a redirection
        - generate a redirected request from a request and its redirection response.
        Added some specific redirect request generation following existing WebKit networking code.

        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::redirect):
        (WebCore::isRedirectStatus): Deleted.
        * platform/network/ResourceRequestBase.cpp:
        (WebCore::shouldUseGet):
        (WebCore::ResourceRequestBase::redirectedRequest const):
        * platform/network/ResourceRequestBase.h:
        * platform/network/ResourceResponseBase.h:
        (WebCore::ResourceResponseBase::isRedirectionStatusCode):
        (WebCore::ResourceResponseBase::isRedirection const):

2017-11-29  Chris Dumez  <cdumez@apple.com>

        Start exposing self.registration inside service workers
        https://bugs.webkit.org/show_bug.cgi?id=180162

        Reviewed by Brady Eidson.

        Start exposing self.registration inside service workers as per:
        - https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope-interface

        This is very initial support:
        - The operations on the registration (such as update) will reject the promise for now.
        - The registration's service workers are not yet populated.

        This will be implemented in a follow-up.

        Tests: http/tests/workers/service/ServiceWorkerGlobalScope_registration_SameObject.html
               http/tests/workers/service/self_registration.html

        * bindings/js/JSServiceWorkerGlobalScopeCustom.cpp:
        (WebCore::JSServiceWorkerGlobalScope::visitAdditionalChildren):
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):
        * workers/service/ServiceWorkerContextData.cpp:
        (WebCore::ServiceWorkerContextData::isolatedCopy const):
        * workers/service/ServiceWorkerContextData.h:
        (WebCore::ServiceWorkerContextData::encode const):
        (WebCore::ServiceWorkerContextData::decode):
        * workers/service/ServiceWorkerGlobalScope.cpp:
        (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
        * workers/service/ServiceWorkerGlobalScope.h:
        (WebCore::ServiceWorkerGlobalScope::registration):
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::updateWorker):
        (WebCore::SWServer::installContextData):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptFetchFinished):

2017-11-29  Youenn Fablet  <youenn@apple.com>

        Add support for FetchEvent.clientId
        https://bugs.webkit.org/show_bug.cgi?id=180052

        Reviewed by Chris Dumez.

        Covered by updated test.

        Add script execution context identifier as a FetchOptions parameter.
        This is then sent to the service worker process which can then set FetchEvent.clientId appropriately.
        If the fetch is for a subresource, clientId is used directly.
        If it is a navigation, clientId is set to targetClientId.

        * loader/FetchOptions.h:
        (WebCore::FetchOptions::encode const):
        (WebCore::FetchOptions::decode):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::prepareFetch):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::setClientIdentifierIfNeeded):
        * loader/cache/CachedResourceRequest.h:
        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
        * workers/service/context/ServiceWorkerFetch.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::postFetchTask):
        * workers/service/context/ServiceWorkerThread.h:

2017-11-29  Youenn Fablet  <youenn@apple.com>

        Flaky crash in WebCore::DOMGuardedObject::clear() during service worker tests
        https://bugs.webkit.org/show_bug.cgi?id=180045
        <rdar://problem/35737288>

        Reviewed by Chris Dumez.

        Manually tested by running concurrently service worker tests using FetchEvents which store promise references.

        Before the patch, on workers, clearing of DOMGuardedObjects happens at the time WorkerGlobalScope is destroyed.
        This is too late as it is expected that the JSDOMGlobalObject is still alive.

        This patch adds a clearDOMGuardedObjects method on JSWorkerGlobalScopeBase.
        It is called when stopping a WorkerThread, just before releasing the strong reference to JSWorkerGlobalScopeBase.

        * bindings/js/JSDOMGuardedObject.h:
        * bindings/js/JSWorkerGlobalScopeBase.cpp:
        (WebCore::JSWorkerGlobalScopeBase::clearDOMGuardedObjects):
        * bindings/js/JSWorkerGlobalScopeBase.h:
        * bindings/js/WorkerScriptController.cpp:

2017-11-29  Alex Christensen  <achristensen@webkit.org>

        Fix Mac CMake build.

        * PlatformMac.cmake:

2017-11-29  Simon Fraser  <simon.fraser@apple.com>

        REGRESSION (r213590): Scrolling to anchors broken in web views when content loaded via HTML string
        https://bugs.webkit.org/show_bug.cgi?id=180155
        rdar://problem/34220827

        Reviewed by Zalan Bujtas.
        
        When content is loaded in a UIWebView or WKWebView via an HTML string, history().currentItem()
        is null so itemAllowsScrollRestoration() would return false, preventing scrolling to anchors.

        Fix by allowing scroll restoration if the the history item is null.

        Tested by WebKit.NoHistoryItemScrollToFragment API test.

        * loader/FrameLoader.cpp:
        (WebCore::itemAllowsScrollRestoration):

2017-11-29  Chris Dumez  <cdumez@apple.com>

        Introduce ServiceWorkerContainer::ensureSWClientConnection()
        https://bugs.webkit.org/show_bug.cgi?id=180146

        Reviewed by Youenn Fablet.

        Introduce ServiceWorkerContainer::ensureSWClientConnection() to reduce
        code duplication. Also use callOnMainThread() in preparation for this
        getting called from a service worker thread (now that ServiceWorkerContainer
        is exposed to service workers). This is needed because constructing the
        SWClientConnection initializes the IPC connection from the WebProcess to
        the StorageProcess, which involves a synchronous IPC with the UIProcess.
        Doing a synchronous IPC from a background thread is unsupported.

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::getRegistration):
        (WebCore::ServiceWorkerContainer::getRegistrations):
        (WebCore::ServiceWorkerContainer::ensureSWClientConnection):
        * workers/service/ServiceWorkerContainer.h:

2017-11-29  Antoine Quint  <graouts@apple.com>

        [iOS] Media controls should stop updating while media is playing in fullscreen
        https://bugs.webkit.org/show_bug.cgi?id=180144
        <rdar://problem/35060379>

        Reviewed by Eric Carlson.

        Updating inline media controls while playing media in fullscreen is useless since we're guaranteed not to
        have those controls visible, and hurtful since this has impact on battery life. To avoid this, we remove
        all media event listeners while in fullscreen on iOS, which will prevent the UI to be udpated since all
        updates are driven by media events.

        To implement this, we remove the MediaControllerSupport destroy() method and make it a disable() method,
        and factor code out of the MediaControllerSupport constructor into an enable() method that registers the
        media event listeners. Then, as we enter and exit fullscreen, we call the disable() and enable() method
        on the various MediaControllerSupport objects that were created to support the iOS inline media controls.

        Test: media/modern-media-controls/media-controller/ios/media-controller-stop-updates-in-fullscreen.html

        * Modules/modern-media-controls/media/controls-visibility-support.js:
        (ControlsVisibilitySupport):
        (ControlsVisibilitySupport.prototype.enable):
        (ControlsVisibilitySupport.prototype.disable):
        (ControlsVisibilitySupport.prototype.destroy): Deleted.
        * Modules/modern-media-controls/media/media-controller-support.js:
        (MediaControllerSupport):
        (MediaControllerSupport.prototype.enable):
        (MediaControllerSupport.prototype.disable):
        (MediaControllerSupport.prototype.destroy): Deleted.
        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController.prototype.handleEvent):
        (MediaController.prototype._updateControlsIfNeeded):
        (MediaController.prototype._updateSupportingObjectsEnabledState):
        (MediaController):

2017-11-29  Simon Fraser  <simon.fraser@apple.com>

        Viewport unit values affected by Comand-+ zoom
        https://bugs.webkit.org/show_bug.cgi?id=145614

        Reviewed by Zalan Bujtas.
        
        Don't apply zooming when resolving viewport-relative lengths, since they should not
        change based on the zoom level.

        Test: fast/css/viewport-units-zoom.html

        * css/CSSPrimitiveValue.cpp:
        (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):

2017-11-29  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed test fix after r225264.
        <rdar://problem/35750689>

        The changes in r225264 were meant to have no changes in behavior. However, I mistakenly
        switched to a secure coding API call in the PlatformPasteboard::write method. This should
        have used the 'insecure' version of this function.

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

2017-11-29  Youenn Fablet  <youenn@apple.com>

        LibWebRTCPeerConnectionBackend should clean its stats promises when being cleaned
        https://bugs.webkit.org/show_bug.cgi?id=180101

        Reviewed by Eric Carlson.

        No change of behavior.

        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::doStop): Cleaning stat promises hash map.

2017-11-29  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Rename CoordinatedBuffer to Nicosia::Buffer
        https://bugs.webkit.org/show_bug.cgi?id=180135

        Reviewed by Carlos Garcia Campos.

        Rename CoordinatedBuffer to Nicosia::Buffer, starting an abstraction
        layer that will in the future allow us to prototype and potentially
        support different 2D rasterization libraries. The layer is envisioned
        as separate from the CoordinatedGraphics code, but will in the mid-term
        only be used there.

        In order to keep CMake changes to a minimum for now, the source code is
        included in the build along with the CoordinatedGraphics source files,
        in TextureMapper.cmake.

        No new tests -- no change in functionality.

        * platform/TextureMapper.cmake:
        * platform/graphics/nicosia/NicosiaBuffer.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp.
        (Nicosia::Buffer::create):
        (Nicosia::Buffer::Buffer):
        (Nicosia::Buffer::context):
        (Nicosia::Buffer::uploadImage):
        * platform/graphics/nicosia/NicosiaBuffer.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedBuffer.h.
        (Nicosia::Buffer::size const):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
        (WebCore::CoordinatedImageBacking::update):
        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
        * platform/graphics/texmap/coordinated/Tile.h:

2017-11-29  Antoine Quint  <graouts@apple.com>

        Pressing the space bar while watching a fullscreen video doesn't play or pause
        https://bugs.webkit.org/show_bug.cgi?id=180033
        <rdar://problem/33610443>

        Reviewed by Eric Carlson.

        We register a "keydown" event to track when the space bar is pressed, and if the media is playing
        in fullscreen, we toggle playback. This does not interfere with full keyboard access since activating
        one of the media controls using the keyboard will not let the events we register for be dispatched
        this far along the event dispatch phase.

        Test: media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html

        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController):
        (MediaController.prototype.togglePlayback): Add a catch() statement since calling play() could sometime
        lead to some extraneous unhandled promise console logging that pollutes test output.
        (MediaController.prototype.handleEvent):

2017-11-28  Brent Fulgham  <bfulgham@apple.com>

        Adopt updated NSKeyed[Un]Archiver API when available
        https://bugs.webkit.org/show_bug.cgi?id=180127
        <rdar://problem/35710738>

        Reviewed by Alex Christensen.

        Switch to new NSKeyed[Un]Archiver methods when available. We do not attempt
        to adopt secure coding in places we were not under the original API.

        Most of the new API is wrapped in a set of convenience methods so we can
        build without the new API on older systems.

        No change in behavior.

        * editing/cocoa/EditorCocoa.mm:
        (WebCore::archivedDataForAttributedString): Use new convenience method
        to archive the string object.
        * loader/archive/cf/LegacyWebArchiveMac.mm:
        (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
        use secure coding where possible.
        (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::write): Use new secure API.
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
        * testing/cocoa/WebArchiveDumpSupport.mm:
        (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
        secure coding API where possible.

2017-11-28  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Cleanup Inspector classes be more consistent about using fast malloc / noncopyable
        https://bugs.webkit.org/show_bug.cgi?id=180119

        Reviewed by Devin Rousso.

        * inspector/InspectorCanvas.cpp:
        * inspector/InspectorDatabaseResource.cpp:
        * inspector/InspectorFrontendClientLocal.cpp:
        * inspector/InspectorFrontendClientLocal.h:
        * inspector/InspectorFrontendHost.cpp:
        * inspector/InspectorHistory.h:
        * inspector/InspectorInstrumentation.cpp:
        * inspector/InspectorOverlay.cpp:
        * inspector/InspectorShaderProgram.cpp:
        * inspector/InspectorStyleSheet.cpp:
        * inspector/InstrumentingAgents.cpp:
        * inspector/PageScriptDebugServer.h:
        * inspector/TimelineRecordFactory.cpp:
        * inspector/WebInjectedScriptManager.cpp:
        * inspector/WebInjectedScriptManager.h:
        * inspector/WorkerScriptDebugServer.cpp:
        * inspector/WorkerScriptDebugServer.h:
        * inspector/agents/*
        Be more consistent about namespace / fast malloc / noncopyable.

2017-11-28  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Limit the number of active contexts in GraphicsContext3DCairo
        https://bugs.webkit.org/show_bug.cgi?id=166968

        Reviewed by Alex Christensen.

        Cairo's implementation of GraphicsContext3D should follow the Mac's
        and limit the number of active GraphicsContext3D objects.

        The active contexts are listed in a global Deque, with the first
        among them being recycled when the GraphicsContext3D::create()
        function sees that the limit has been reached. That function still
        returns null if even after recycling the number of contexts didn't
        decrease.

        Finally, in the GraphicsContext3D destructor, the context being
        destroyed is removed from the list of active contexts.

        No new tests -- relevant tests are now passing.

        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
        (WebCore::activeContexts):
        (WebCore::GraphicsContext3D::create):
        (WebCore::GraphicsContext3D::~GraphicsContext3D):

2017-11-28  Zalan Bujtas  <zalan@apple.com>

        Clean up spanners before creating nested column context
        https://bugs.webkit.org/show_bug.cgi?id=180107
        <rdar://problem/35686655>
        
        Reviewed by Antti Koivisto.

        When an existing spanner placeholder is moved into a newly constructed (and nested)
        multicolumn context, we figure it's not valid anymore and end up destroying it
        (see RenderMultiColumnFlow::fragmentedFlowDescendantInserted).
        This is very unfortunate since as we climb back on the stack, we could hit this renderer as
        the newly inserted child. 

        This patch proactively removes the invalid placeholders and moves the associated spanners back to their
        original position. 

        Test: fast/multicol/crash-when-constructing-nested-columns.html

        * rendering/RenderMultiColumnFlow.h:
        * style/RenderTreeUpdaterMultiColumn.cpp:
        (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow): 
        RenderTreeUpdater::MultiColumn::destroyFragmentedFlow still relies on the placeholder removal
        logic in RenderMultiColumnFlow::fragmentedFlowDescendantInserted.

2017-11-28  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (High Sierra): Layout Test fast/multicol/newmulticol/spanner2.html is a flaky image failure on WK1
        https://bugs.webkit.org/show_bug.cgi?id=177826
        <rdar://problem/34876498>

        Reviewed by Alexey Proskuryakov.

        No new tests, fixes some already-broken tests.

        * platform/graphics/mac/PDFDocumentImageMac.mm:
        (WebCore::PDFDocumentImage::drawPDFPage):
        Save and restore one more piece of context state that
        PDFKit mutates while drawing.

2017-11-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        Allow attachment elements with no appearance to defer rendering to child nodes
        https://bugs.webkit.org/show_bug.cgi?id=180117
        <rdar://problem/35735339>

        Reviewed by Tim Horton.

        Test: fast/attachment/attachment-without-appearance.html

        When -webkit-appearance: none; is specified on an attachment element, allow it to fall back to rendering its
        subtree. Currently, attachment elements without an appearance don't allow this and truncate the render tree at
        the RenderAttachment, since RenderAttachment cannot have any children.

        In a followup, this will enable us to render a shadow subtree under the attachment element to display in-place
        attachment content, and easily toggle between in-place and icon display by changing the appearance.

        * html/HTMLAttachmentElement.cpp:
        (WebCore::HTMLAttachmentElement::createElementRenderer):

        If no appearance is specified, emit a RenderBlockFlow instead of a RenderAttachment.

        (WebCore::HTMLAttachmentElement::setFile):
        (WebCore::HTMLAttachmentElement::attachmentRenderer const):

        Renamed from renderer(). HTMLAttachmentElement::renderer() now uses the superclass' implementation, and no
        longer returns a RenderAttachment in all circumstances. Instead, places that expect a RenderAttachment now go
        through HTMLAttachmentElement::renderAttachment() instead.

        (WebCore::HTMLAttachmentElement::parseAttribute):
        * html/HTMLAttachmentElement.h:
        * page/DragController.cpp:
        (WebCore::DragController::startDrag):
        * rendering/RenderAttachment.h:
        (WebCore::HTMLAttachmentElement::renderer const): Deleted.

2017-11-28  Youenn Fablet  <youenn@apple.com>

        Register Documents as ServiceWorker clients to the StorageProcess
        https://bugs.webkit.org/show_bug.cgi?id=180047

        Reviewed by Brady Eidson.

        No change of behavior.
        These changes will be covered when implementing ServiceWorker Clients API.

        Registering a document when being created by DocumentLoader.
        In the future, we may restrict registration to only documents related to origins that have some ongoing service worker activity.
        This would require to keep track of which documents are registered so that we unregister these ones.
        This would also require to register existing documents when one of the document with the same origin starts registering a service worker.
        Unregistering a document inside prepareForDestruction.

        Storing all clients in SWServer as a HasMap keyed by ClientOrigin.
        Processing will then iterate through the list of clients scoped by the client origin.

        Adding a ClientOrigin class as a pair of top origin and frame origin since service workers will be related based on that information.

        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::Document::prepareForDestruction):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::commitData):
        * page/ClientOrigin.h: Added.
        (WebCore::ClientOrigin::emptyKey):
        (WebCore::ClientOrigin::hash const):
        (WebCore::ClientOrigin::operator== const):
        (WTF::ClientOriginKeyHash::hash):
        (WTF::ClientOriginKeyHash::equal):
        (WTF::HashTraits<WebCore::ClientOrigin>::emptyValue):
        (WTF::HashTraits<WebCore::ClientOrigin>::constructDeletedValue):
        (WTF::HashTraits<WebCore::ClientOrigin>::isDeletedValue):
        * workers/service/ServiceWorkerClientIdentifier.h:
        (WebCore::ServiceWorkerClientIdentifier::operator== const):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::registerServiceWorkerClient):
        (WebCore::SWServer::unregisterServiceWorkerClient):
        * workers/service/server/SWServer.h:

2017-11-28  Chris Dumez  <cdumez@apple.com>

        ServiceWorkerGlobalScope.clients should always return the same object
        https://bugs.webkit.org/show_bug.cgi?id=180116

        Reviewed by Geoffrey Garen.

        ServiceWorkerGlobalScope.clients should always return the same object, as per the specification:
        - https://w3c.github.io/ServiceWorker/#serviceworkerglobalscope-interface

        Test: http/tests/workers/service/ServiceWorkerGlobalScope_clients_SameObject.html

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSServiceWorkerGlobalScopeCustom.cpp: Added.
        (WebCore::JSServiceWorkerGlobalScope::visitAdditionalChildren):
        * workers/service/ServiceWorkerClients.idl:
        * workers/service/ServiceWorkerGlobalScope.idl:

2017-11-28  Chris Dumez  <cdumez@apple.com>

        Get rid of ServiceWorker::allWorkers() hashmap
        https://bugs.webkit.org/show_bug.cgi?id=180111

        Reviewed by Brady Eidson.

        Get rid of ServiceWorker::allWorkers() hashmap as it is not thread safe and we'll soon have
        ServiceWorker objects living in various service worker threads.

        Instead, we now have a per-ScriptExecutionContext map, which is inherently thread-safe.

        No new tests, no web-facing behavior change.

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::registerServiceWorker):
        (WebCore::ScriptExecutionContext::unregisterServiceWorker):
        * dom/ScriptExecutionContext.h:
        (WebCore::ScriptExecutionContext::serviceWorker):
        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::getOrCreate):
        (WebCore::ServiceWorker::ServiceWorker):
        (WebCore::ServiceWorker::~ServiceWorker):
        (WebCore::ServiceWorker::stop):
        * workers/service/ServiceWorker.h:
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::updateWorkerState):

2017-11-28  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [CG] PostScript images should be supported if they are sub-resource images
        https://bugs.webkit.org/show_bug.cgi?id=178502
        <rdar://problem/35102988>

        Reviewed by Simon Fraser.

        Make CachedImage detect the PostScript mime type and the file extension.
        Let PDFDocumentImage replaces the PostScript data with the equivalent PDF
        data and use it when creating the PDFDocument.

        Test: fast/images/eps-as-image.html

        * WebCore.xcodeproj/project.pbxproj:
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::isPDFRequest const):
        (WebCore::CachedImage::isPostScriptRequest const):
        These functions return whether the request is for a PDF or a PostScript 
        image. They check for the same conditions we do in WebPage::createPlugin().

        (WebCore::CachedImage::createImage): Create a PDFDocumentImage for either
        a PDF or a PostScript image. For PostScript, the data will be converted
        to PDF when all the data is received.

        (WebCore::CachedImage::updateBufferInternal): Use the size() of m_data
        instead of using the m_image->data() to setEncodedSize(). Image::m_data
        and CachedImage::m_data point to the same SharedBuffer.

        (WebCore::CachedImage::convertedDataIfNeeded const): Convert the PostScript
        data to PDF if the system can convert it. If the same can't convert it,
        return null so loading the image will be canceled.

        (WebCore::CachedImage::updateImageData): Get rid of the data argument since
        we always send the member m_data to this function.

        (WebCore::CachedImage::finishLoading): Convert the PostScript data to PDF 
        data since all the data is received. Use m_data to set setEncodedSize().

        * loader/cache/CachedImage.h:
        * platform/MIMETypeRegistry.cpp:
        (WebCore::MIMETypeRegistry::isPostScriptMIMEType):
        (WebCore::MIMETypeRegistry::isPDFOrPostScriptMIMEType):
        * platform/MIMETypeRegistry.h:
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::PDFDocumentImage):
        (WebCore::PDFDocumentImage::convertPostScriptDataToPDF):
        * platform/graphics/cg/PDFDocumentImage.h:

2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>

        Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
        https://bugs.webkit.org/show_bug.cgi?id=173793

        Reviewed by Joseph Pecoraro.

        Based on patch by Brian Burg.

        * ForwardingHeaders/inspector/InspectorValues.h: Removed.
        * Modules/encryptedmedia/InitDataRegistry.cpp:
        (WebCore::extractKeyIDsKeyids):
        (WebCore::sanitizeKeyids):
        * html/parser/XSSAuditorDelegate.cpp:
        (WebCore::XSSAuditorDelegate::generateViolationReport):
        * inspector/CommandLineAPIHost.cpp:
        (WebCore::CommandLineAPIHost::inspect):
        * inspector/CommandLineAPIHost.h:
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::recordAction):
        (WebCore::InspectorCanvas::releaseData):
        (WebCore::InspectorCanvas::indexForData):
        (WebCore::buildArrayForVector):
        (WebCore::InspectorCanvas::buildInitialState):
        (WebCore::InspectorCanvas::buildAction):
        (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
        (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
        (WebCore::InspectorCanvas::buildArrayForImageData):
        (WebCore::InspectorCanvas::buildArrayForImageBitmap):
        * inspector/InspectorCanvas.h:
        * inspector/InspectorDatabaseResource.cpp:
        * inspector/InspectorOverlay.cpp:
        (WebCore::evaluateCommandInOverlay):
        (WebCore::InspectorOverlay::evaluateInOverlay):
        * inspector/InspectorOverlay.h:
        * inspector/InspectorShaderProgram.h:
        * inspector/InspectorStyleSheet.h:
        (WebCore::InspectorCSSId::InspectorCSSId):
        * inspector/TimelineRecordFactory.cpp:
        (WebCore::TimelineRecordFactory::createGenericRecord):
        (WebCore::TimelineRecordFactory::createFunctionCallData):
        (WebCore::TimelineRecordFactory::createConsoleProfileData):
        (WebCore::TimelineRecordFactory::createProbeSampleData):
        (WebCore::TimelineRecordFactory::createEventDispatchData):
        (WebCore::TimelineRecordFactory::createGenericTimerData):
        (WebCore::TimelineRecordFactory::createTimerInstallData):
        (WebCore::TimelineRecordFactory::createEvaluateScriptData):
        (WebCore::TimelineRecordFactory::createTimeStampData):
        (WebCore::TimelineRecordFactory::createAnimationFrameData):
        (WebCore::createQuad):
        (WebCore::TimelineRecordFactory::createPaintData):
        (WebCore::TimelineRecordFactory::appendLayoutRoot):
        * inspector/TimelineRecordFactory.h:
        * inspector/agents/InspectorApplicationCacheAgent.cpp:
        * inspector/agents/InspectorApplicationCacheAgent.h:
        * inspector/agents/InspectorCSSAgent.cpp:
        (WebCore::computePseudoClassMask):
        (WebCore::InspectorCSSAgent::setStyleText):
        (WebCore::InspectorCSSAgent::setRuleSelector):
        (WebCore::InspectorCSSAgent::forcePseudoState):
        * inspector/agents/InspectorCSSAgent.h:
        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::parseColor):
        (WebCore::parseConfigColor):
        (WebCore::parseQuad):
        (WebCore::InspectorDOMAgent::performSearch):
        (WebCore::InspectorDOMAgent::setSearchingForNode):
        (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
        (WebCore::InspectorDOMAgent::setInspectModeEnabled):
        (WebCore::InspectorDOMAgent::highlightRect):
        (WebCore::InspectorDOMAgent::highlightQuad):
        (WebCore::InspectorDOMAgent::innerHighlightQuad):
        (WebCore::InspectorDOMAgent::highlightSelector):
        (WebCore::InspectorDOMAgent::highlightNode):
        (WebCore::InspectorDOMAgent::highlightNodeList):
        (WebCore::InspectorDOMAgent::highlightFrame):
        * inspector/agents/InspectorDOMAgent.h:
        * inspector/agents/InspectorDOMDebuggerAgent.cpp:
        (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
        (WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode):
        (WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode):
        (WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr):
        (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
        (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
        (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
        * inspector/agents/InspectorDOMDebuggerAgent.h:
        * inspector/agents/InspectorDOMStorageAgent.cpp:
        (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
        (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
        (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
        (WebCore::InspectorDOMStorageAgent::findStorageArea):
        * inspector/agents/InspectorDOMStorageAgent.h:
        * inspector/agents/InspectorDatabaseAgent.cpp:
        * inspector/agents/InspectorIndexedDBAgent.cpp:
        (WebCore::Inspector::idbKeyFromInspectorObject):
        (WebCore::Inspector::idbKeyRangeFromKeyRange):
        (WebCore::InspectorIndexedDBAgent::requestData):
        * inspector/agents/InspectorIndexedDBAgent.h:
        * inspector/agents/InspectorNetworkAgent.cpp:
        (WebCore::buildObjectForHeaders):
        (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
        (WebCore::InspectorNetworkAgent::setExtraHTTPHeaders):
        * inspector/agents/InspectorNetworkAgent.h:
        * inspector/agents/InspectorPageAgent.cpp:
        * inspector/agents/InspectorPageAgent.h:
        * inspector/agents/InspectorTimelineAgent.cpp:
        (WebCore::InspectorTimelineAgent::setInstruments):
        (WebCore::InspectorTimelineAgent::internalStart):
        (WebCore::InspectorTimelineAgent::didInvalidateLayout):
        (WebCore::InspectorTimelineAgent::willLayout):
        (WebCore::InspectorTimelineAgent::didScheduleStyleRecalculation):
        (WebCore::InspectorTimelineAgent::willRecalculateStyle):
        (WebCore::InspectorTimelineAgent::willComposite):
        (WebCore::InspectorTimelineAgent::willPaint):
        (WebCore::InspectorTimelineAgent::addRecordToTimeline):
        (WebCore::InspectorTimelineAgent::setFrameIdentifier):
        (WebCore::InspectorTimelineAgent::appendRecord):
        (WebCore::InspectorTimelineAgent::sendEvent):
        (WebCore::InspectorTimelineAgent::createRecordEntry):
        (WebCore::InspectorTimelineAgent::pushCurrentRecord):
        * inspector/agents/InspectorTimelineAgent.h:
        * page/csp/ContentSecurityPolicy.cpp:
        (WebCore::ContentSecurityPolicy::reportViolation const):
        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::parseJSONObject):
        (WebCore::parseLicenseFormat):
        (WebCore::parseLicenseReleaseAcknowledgementFormat):
        (WebCore::CDMInstanceClearKey::updateLicense):
        (WebCore::CDMInstanceClearKey::removeSessionData):
        * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
        (WebCore::extractSinfData):
        * testing/Internals.cpp:

2017-11-28  Simon Fraser  <simon.fraser@apple.com>

        Use the TextStream indent manipulator in more places
        https://bugs.webkit.org/show_bug.cgi?id=180065

        Reviewed by Sam Weinig.

        Replace writeIndent() with << indent, and use an IndentScope in a few places.

        * dom/ViewportArguments.cpp:
        (WebCore::operator<<):
        * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
        (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
        * page/scrolling/ScrollingStateNode.cpp:
        (WebCore::ScrollingStateNode::dump const):
        * platform/graphics/FloatRoundedRect.cpp:
        (WebCore::operator<<):
        * platform/graphics/transforms/TransformationMatrix.cpp:
        (WebCore::operator<<):

2017-11-28  Noah Chase  <nchase@gmail.com>

        Web Audio's AnalyserNode.fftSize cannot be greater than 2048 in Safari; spec says it can be up to 32768
        https://bugs.webkit.org/show_bug.cgi?id=180040

        Reviewed by Alex Christensen.

        I fixed up the existing test/output for realtimeanalyser-fft-sizing.
        one thing that I'm a bit unsure of here is whether or not there are other
        places in WebKit's Web Audio implementation that use fftSize and
        should have the wider range available (instead of capping out at
        2048). based on a quick naive scan I think that there are.

        * Modules/webaudio/RealtimeAnalyser.cpp:

2017-11-28  Daniel Bates  <dabates@apple.com>

        Add WebKitAdditions extension point to add user-agent stylesheet
        https://bugs.webkit.org/show_bug.cgi?id=179702
        <rdar://problem/35711147>

        Reviewed by Andy Estes.

        * DerivedSources.make: Write user agent stylesheet generation recipe in terms of the
        automatic variable $^, which represents the list of the names of all prerequisites
        for the rule. Make automatically expands the names in $^ up to their full absolute
        path.

2017-11-28  Daniel Bates  <dabates@apple.com>

        [Cocoa] First pass at implementing alternative presentation button element
        https://bugs.webkit.org/show_bug.cgi?id=179785
        Part of <rdar://problem/34917108>

        Reviewed by Brent Fulgham.

        Implement support for substituting a button for one or more elements in a page.
        This is a first pass. We will refine the logic and the API/SPI in subsequent
        commits.

        Tests: accessibility/alternative-presentation-button-input-type.html
               accessibility/alternative-presentation-button.html
               fast/forms/alternative-presentation-button/replace-and-remove.html
               fast/forms/alternative-presentation-button/replacement.html

        * English.lproj/Localizable.strings: Add placeholder strings for localization.
        * SourcesCocoa.txt: Add some files.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * dom/Element.h:
        * editing/Editor.cpp:
        (WebCore::Editor::clear): Clear out all substitutions. This is called whenever
        we are navigating between pages.
        (WebCore::Editor::substituteWithAlternativePresentationButton): Added.
        (WebCore::Editor::removeAlternativePresentationButton): Added.
        (WebCore::Editor::didInsertAlternativePresentationButtonElement): Added.
        (WebCore::Editor::didRemoveAlternativePresentationButtonElement): Added.
        * editing/Editor.h:
        * editing/cocoa/AlternativePresentationButtonSubstitution.cpp: Added.
        (WebCore::AlternativePresentationButtonSubstitution::AlternativePresentationButtonSubstitution):
        (WebCore::AlternativePresentationButtonSubstitution::initializeSavedDisplayStyles):
        (WebCore::AlternativePresentationButtonSubstitution::apply):
        (WebCore::AlternativePresentationButtonSubstitution::unapply):
        * editing/cocoa/AlternativePresentationButtonSubstitution.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::alternativePresentationButtonElement const): Added.
        (WebCore::HTMLInputElement::setTypeWithoutUpdatingAttribute): Added.
        (WebCore::HTMLInputElement::createInputType): Extracted the logic to create the InputType from
        HTMLInputElement::updateType() to here and added logic to create the input type for the
        alternative presentation button. This input type is not web exposed.
        (WebCore::HTMLInputElement::updateType): Modified to take the name of the InputType object to
        create as an argument and pass it through to HTMLInputElement::createInputType() to actually
        create it. Reordered the logic for destroying the shadow tree of the old InputType, deallocating
        the old InputType, and assigning the new InputType such that we assign the new InputType,
        destroy the shadow tree of the old InputType, and deallocate the old InputType. This ordering
        allows AlternativePresentationButtonSubstitution::substitute() to avoid restoring the input
        type saved before the substitution when the input type is changed by the page as opposed to
        by SPI.
        (WebCore::HTMLInputElement::parseAttribute): Pass the parsed type.
        (WebCore::HTMLInputElement::willAttachRenderers): Ditto.
        * html/HTMLInputElement.h: Change visibility of removeShadowRoot() from private to public so
        that it can be called from AlternativePresentationButtonSubstitution.
        * html/InputType.h:
        (WebCore::InputType::alternativePresentationButtonElement const): Added.
        * html/InputTypeNames.cpp:
        (WebCore::InputTypeNames::alternativePresentationButton): Added.
        * html/InputTypeNames.h:
        * html/shadow/cocoa/AlternativePresentationButtonElement.cpp: Added.
        (WebCore::AlternativePresentationButtonElement::create):
        (WebCore::AlternativePresentationButtonElement::AlternativePresentationButtonElement):
        (WebCore::AlternativePresentationButtonElement::insertedIntoAncestor):
        (WebCore::AlternativePresentationButtonElement::removedFromAncestor):
        (WebCore::AlternativePresentationButtonElement::didFinishInsertingNode):
        (WebCore::AlternativePresentationButtonElement::defaultEventHandler):
        * html/shadow/cocoa/AlternativePresentationButtonElement.h:
        * html/shadow/cocoa/AlternativePresentationButtonInputType.cpp: Added.
        (WebCore::AlternativePresentationButtonInputType::AlternativePresentationButtonInputType):
        (WebCore::AlternativePresentationButtonInputType::formControlType const):
        (WebCore::AlternativePresentationButtonInputType::appendFormData const):
        (WebCore::AlternativePresentationButtonInputType::supportsValidation const):
        (WebCore::AlternativePresentationButtonInputType::isTextButton const):
        (WebCore::AlternativePresentationButtonInputType::alternativePresentationButtonElement const):
        (WebCore::AlternativePresentationButtonInputType::createShadowSubtree):
        (WebCore::AlternativePresentationButtonInputType::destroyShadowSubtree):
        * html/shadow/cocoa/AlternativePresentationButtonInputType.h:
        * page/ChromeClient.h:
        * platform/LocalizedStrings.cpp:
        (WebCore::AXAlternativePresentationButtonLabel):
        (WebCore::alternativePresentationButtonTitle):
        (WebCore::alternativePresentationButtonSubtitle):
        * platform/LocalizedStrings.h:
        * testing/Internals.cpp:
        (WebCore::Internals::substituteWithAlternativePresentationButton): Added.
        (WebCore::Internals::removeAlternativePresentationButton): Added.
        * testing/Internals.h:
        * testing/Internals.idl:

2017-11-28  Commit Queue  <commit-queue@webkit.org>

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

        Tests are still timing out (Requested by ap on #webkit).

        Reverted changeset:

        "Pressing the space bar while watching a fullscreen video
        doesn't play or pause"
        https://bugs.webkit.org/show_bug.cgi?id=180033
        https://trac.webkit.org/changeset/225209

2017-11-28  Chris Dumez  <cdumez@apple.com>

        Start exposing navigator.serviceWorker inside service workers
        https://bugs.webkit.org/show_bug.cgi?id=180087

        Reviewed by Brady Eidson.

        Start exposing navigator.serviceWorker inside service workers as per:
        - https://w3c.github.io/ServiceWorker/#navigator-serviceworker

        Although the property is now exposed, the API on ServiceWorkerContainer is not
        supported yet inside service workers and the promise will be rejected. This will
        be implemented in a follow-up.

        Test: http/tests/workers/service/WorkerNavigator_serviceWorker.html

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSWorkerNavigatorCustom.cpp: Added.
        (WebCore::JSWorkerNavigator::visitAdditionalChildren):
        * page/WorkerNavigator.idl:
        * workers/service/ServiceWorker.idl:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::controller const):
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::getRegistration):
        (WebCore::ServiceWorkerContainer::getRegistrations):
        * workers/service/ServiceWorkerContainer.idl:
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::update):
        (WebCore::ServiceWorkerRegistration::unregister):
        * workers/service/ServiceWorkerRegistration.idl:

2017-11-28  Simon Fraser  <simon.fraser@apple.com>

        Modernize GraphicsLayer dumping
        https://bugs.webkit.org/show_bug.cgi?id=180067

        Reviewed by Sam Weinig.

        Use the indent stream manipulator, and TextStream's built-in indent amount
        for GraphicsLayer dumping.

        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::GraphicsLayer::dumpLayer const):
        (WebCore::dumpChildren):
        (WebCore::GraphicsLayer::dumpProperties const):
        (WebCore::GraphicsLayer::layerTreeAsText const):
        * platform/graphics/GraphicsLayer.h:
        (WebCore::GraphicsLayer::dumpAdditionalProperties const):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::dumpInnerLayer):
        (WebCore::GraphicsLayerCA::dumpAdditionalProperties const):
        * platform/graphics/ca/GraphicsLayerCA.h:

2017-11-28  Antoine Quint  <graouts@apple.com>

        Remove dead debugging code in modern media controls
        https://bugs.webkit.org/show_bug.cgi?id=180079

        Reviewed by Eric Carlson.

        This debug utility is no longer necessary and is just dead code.

        * Modules/modern-media-controls/controls/scheduler.js:
        (const.scheduler.new.prototype.scheduleLayout):
        (const.scheduler.new.prototype.unscheduleLayout):
        (const.scheduler.new.prototype._requestFrameIfNeeded):
        (const.scheduler.new.prototype._frameDidFire):
        (const.scheduler.new.prototype._layout):

2017-11-28  Antoine Quint  <graouts@apple.com>

        Skip back and forward buttons should not hard-code their numeric amount in localised strings
        https://bugs.webkit.org/show_bug.cgi?id=180077

        Reviewed by Eric Carlson.

        Split out the numeric value used in the skip forward and skip back localized strings to make
        it easier to localized the numeric value itself.

        Test: media/modern-media-controls/localized-strings/replaced-string.html

        * English.lproj/modern-media-controls-localized-strings.js:
        * Modules/modern-media-controls/main.js:
        (UIString):

2017-11-28  Antoine Quint  <graouts@apple.com>

        Pressing the space bar while watching a fullscreen video doesn't play or pause
        https://bugs.webkit.org/show_bug.cgi?id=180033
        <rdar://problem/33610443>

        Reviewed by Eric Carlson.

        We register a "keydown" event to track when the space bar is pressed, and if the media is playing
        in fullscreen, we toggle playback. This does not interfere with full keyboard access since activating
        one of the media controls using the keyboard will not let the events we register for be dispatched
        this far along the event dispatch phase.

        Test: media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html

        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController):
        (MediaController.prototype.togglePlayback): Add a catch() statement since calling play() could sometime
        lead to some extraneous unhandled promise console logging that pollutes test output.
        (MediaController.prototype.handleEvent):

2017-11-27  Tim Horton  <timothy_horton@apple.com>

        Web Content process crashes when dragging a link in recovery mode
        https://bugs.webkit.org/show_bug.cgi?id=180058
        <rdar://problem/35172170>

        Reviewed by Alexey Proskuryakov.

        * platform/mac/DragImageMac.mm:
        (WebCore::LinkImageLayout::LinkImageLayout):
        LinkPresentation isn't available in the base system. Make it optional,
        and fall back to the full URL like we do on platforms where it doesn't
        exist at all.

2017-11-27  Chris Dumez  <cdumez@apple.com>

        Move callOnMainThreadAndWait() from SocketStreamHandleImplCFNet.cpp to MainThread.h
        https://bugs.webkit.org/show_bug.cgi?id=180060

        Reviewed by Alex Christensen.

        Move callOnMainThreadAndWait() from SocketStreamHandleImplCFNet.cpp to MainThread.h so that it can be reused.

        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
        (WebCore::callOnMainThreadAndWait): Deleted.

2017-11-27  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r225201.

        This caused multiple tests to timeout consistently.

        Reverted changeset:

        "Pressing the space bar while watching a fullscreen video
        doesn't play or pause"
        https://bugs.webkit.org/show_bug.cgi?id=180033
        https://trac.webkit.org/changeset/225201

2017-11-27  Chris Dumez  <cdumez@apple.com>

        NavigatorBase::serviceWorker() should return a reference instead of a raw pointer
        https://bugs.webkit.org/show_bug.cgi?id=180059

        Reviewed by Geoffrey Garen.

        NavigatorBase::serviceWorker() should return a reference instead of a raw pointer
        as it can never return null.

        * bindings/js/JSNavigatorCustom.cpp:
        (WebCore::JSNavigator::visitAdditionalChildren):
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::serviceWorkerContainer):
        * page/NavigatorBase.cpp:
        (WebCore::NavigatorBase::serviceWorker):
        * page/NavigatorBase.h:

2017-11-27  Antoine Quint  <graouts@apple.com>

        Pressing the space bar while watching a fullscreen video doesn't play or pause
        https://bugs.webkit.org/show_bug.cgi?id=180033
        <rdar://problem/33610443>

        Reviewed by Eric Carlson.

        We register a "keydown" event to track when the space bar is pressed, and if the media is playing
        in fullscreen, we toggle playback. This does not interfere with full keyboard access since activating
        one of the media controls using the keyboard will not let the events we register for be dispatched
        this far along the event dispatch phase.

        Test: media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html

        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController):
        (MediaController.prototype.togglePlayback): Add a catch() statement since calling play() could sometime
        lead to some extraneous unhandled promise console logging that pollutes test output.
        (MediaController.prototype.handleEvent):

2017-11-27  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r225173.

        This caused multiple tests to timeout consistently.

        Reverted changeset:

        "Pressing the space bar while watching a fullscreen video
        doesn't play or pause"
        https://bugs.webkit.org/show_bug.cgi?id=180033
        https://trac.webkit.org/changeset/225173

2017-11-27  Chris Dumez  <cdumez@apple.com>

        ASSERTION FAILED: addResult.isNewEntry WebCore::SWServerRegistration::addClientUsingRegistration(WebCore::ServiceWorkerClientIdentifier const&) + 141
        https://bugs.webkit.org/show_bug.cgi?id=180049

        Reviewed by Brady Eidson.

        SWServer::serviceWorkerStoppedControllingClient() was failing to remove the client from the
        SWServerRegistration in some cases. This is because we relied on the Service Worker Identifier
        to get the SWServerRegistration, via the corresponding SWServerServiceWorker object. However,
        It is possible for the SWServerServiceWorker to have been destroyed already.

        In serviceWorkerStartedControllingClient / serviceWorkerStoppedControllingClient, we now
        pass the registration identifier, so that we are able to look up the registration directly,
        without going through the service worker object.

        No new tests, already covered by imported/w3c/web-platform-tests/service-workers/service-worker/claim-affect-other-registration.https.html.

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::setActiveServiceWorker):
        * workers/service/ServiceWorker.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::removeRegistration):
        * workers/service/ServiceWorkerData.cpp:
        (WebCore::ServiceWorkerData::isolatedCopy const):
        * workers/service/ServiceWorkerData.h:
        (WebCore::ServiceWorkerData::encode const):
        (WebCore::ServiceWorkerData::decode):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::addRegistration):
        (WebCore::SWServer::removeRegistration):
        (WebCore::SWServer::clearAll):
        (WebCore::SWServer::Connection::addServiceWorkerRegistrationInServer):
        (WebCore::SWServer::Connection::removeServiceWorkerRegistrationInServer):
        (WebCore::SWServer::Connection::serviceWorkerStartedControllingClient):
        (WebCore::SWServer::Connection::serviceWorkerStoppedControllingClient):
        (WebCore::SWServer::addClientServiceWorkerRegistration):
        (WebCore::SWServer::removeClientServiceWorkerRegistration):
        (WebCore::SWServer::serviceWorkerStartedControllingClient):
        (WebCore::SWServer::serviceWorkerStoppedControllingClient):
        (WebCore::SWServer::installContextData):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::SWServerWorker):
        * workers/service/server/SWServerWorker.h:

2017-11-27  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r225142): Crashes when command clicking or force touching links
        https://bugs.webkit.org/show_bug.cgi?id=180055
        <rdar://problem/35703910>

        Reviewed by Wenson Hsieh.

        No new tests; affects an existing API test.

        * editing/mac/DictionaryLookup.mm:
        (WebCore::tokenRange):
        The 'options' out argument from tokenRangeForString is autoreleased.

2017-11-27  Dean Jackson  <dino@apple.com>

        Implement OffscreenCanvas.getContext("webgl")
        https://bugs.webkit.org/show_bug.cgi?id=180050
        <rdar://problem/35705473>

        Reviewed by Sam Weinig.

        Implement enough of getContext("webgl") to actually return an
        active WebGLRenderingContext, even though it isn't actually
        hooked up to draw.

        Introduce a new type, WebGLCanvas, which is a variant of HTMLCanvasElement
        and OffscreenCanvas, so that it can be exposed by the 'canvas' attribute
        on WebGLRenderingContext.

        At the moment we still assume that all uses of WebGLRenderingContext come
        from HTMLCanvasElement, so add a bunch of logic to detect that case.

        Updated the existing (proposed) WPT.

        * html/OffscreenCanvas.cpp:
        (WebCore::OffscreenCanvas::getContext): Implement enough of getContext to
        return a WebGLRenderingContext.
        * html/OffscreenCanvas.h: Use the new OffscreenRenderingContext type, even
        though it's just a WebGLRenderingContext at the moment.

        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::canvas): Now returns a WebGLCanvas.
        (WebCore::WebGLRenderingContextBase::htmlCanvas): Helper to get the HTMLCanvasElement if it exists.
        (WebCore::WebGLRenderingContextBase::offscreenCanvas): Ditto for OffscreenCanvas.
        (WebCore::WebGLRenderingContextBase::checkForContextLossHandling): Guard for htmlCanvas().
        (WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
        (WebCore::WebGLRenderingContextBase::setupFlags):
        (WebCore::WebGLRenderingContextBase::addActivityStateChangeObserverIfNecessary):
        (WebCore::WebGLRenderingContextBase::removeActivityStateChangeObserver):
        (WebCore::WebGLRenderingContextBase::markContextChanged):
        (WebCore::WebGLRenderingContextBase::markContextChangedAndNotifyCanvasObserver):
        (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
        (WebCore::WebGLRenderingContextBase::reshape):
        (WebCore::WebGLRenderingContextBase::compileShader):
        (WebCore::WebGLRenderingContextBase::isContextLostOrPending):
        (WebCore::WebGLRenderingContextBase::readPixels):
        (WebCore::WebGLRenderingContextBase::loseContextImpl):
        (WebCore::WebGLRenderingContextBase::printToConsole):
        (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
        (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
        (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
        (WebCore::WebGLRenderingContextBase::clampedCanvasSize):
        * html/canvas/WebGLRenderingContextBase.h: Define WebGLCanvas.
        * html/canvas/WebGLRenderingContextBase.idl:

        * inspector/InspectorInstrumentation.h: Handle the variant options, although leave OffscreenCanvas
        unimplemented for the moment.
        (WebCore::InspectorInstrumentation::didEnableExtension):
        (WebCore::InspectorInstrumentation::didCreateProgram):
        (WebCore::InspectorInstrumentation::willDeleteProgram):
        (WebCore::InspectorInstrumentation::isShaderProgramDisabled):
        * inspector/agents/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::didEnableExtension):
        (WebCore::InspectorCanvasAgent::didCreateProgram):

2017-11-27  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix an improper #include

        * platform/network/soup/NetworkStorageSessionSoup.cpp:

2017-11-27  Alex Christensen  <achristensen@webkit.org>

        imported/w3c/web-platform-tests/url/failure.html crashes on debug builds
        https://bugs.webkit.org/show_bug.cgi?id=172337

        Reviewed by Chris Dumez.

        There were two problems:
        1. Invalid URLs can contain non-ASCII characters in its UTF8 representation.
        We should not put these URLs into content extension finite state machines.  They won't load anyways.
        2. If we don't have any content extensions installed, we still call String.utf8 unnecessarily.  Let's not.

        * contentextensions/ContentExtensionsBackend.cpp:
        (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):

2017-11-27  Simon Fraser  <simon.fraser@apple.com>

        Use TextStream's indent tracking, rather than passing indent to all the externalRepresentation() functions
        https://bugs.webkit.org/show_bug.cgi?id=180027

        Reviewed by Jon Lee.

        Remove all the indent arguments, and make use of TextStream::IndentScope to control
        output indentation.
        
        Add an indent stream manipulator so you can say
          ts << indent << "text"
        to write the indent.

        * platform/graphics/filters/FEBlend.cpp:
        (WebCore::FEBlend::externalRepresentation const):
        * platform/graphics/filters/FEBlend.h:
        * platform/graphics/filters/FEColorMatrix.cpp:
        (WebCore::FEColorMatrix::externalRepresentation const):
        * platform/graphics/filters/FEColorMatrix.h:
        * platform/graphics/filters/FEComponentTransfer.cpp:
        (WebCore::FEComponentTransfer::externalRepresentation const):
        * platform/graphics/filters/FEComponentTransfer.h:
        * platform/graphics/filters/FEComposite.cpp:
        (WebCore::FEComposite::externalRepresentation const):
        * platform/graphics/filters/FEComposite.h:
        * platform/graphics/filters/FEConvolveMatrix.cpp:
        (WebCore::FEConvolveMatrix::externalRepresentation const):
        * platform/graphics/filters/FEConvolveMatrix.h:
        * platform/graphics/filters/FEDiffuseLighting.cpp:
        (WebCore::FEDiffuseLighting::externalRepresentation const):
        * platform/graphics/filters/FEDiffuseLighting.h:
        * platform/graphics/filters/FEDisplacementMap.cpp:
        (WebCore::FEDisplacementMap::externalRepresentation const):
        * platform/graphics/filters/FEDisplacementMap.h:
        * platform/graphics/filters/FEDropShadow.cpp:
        (WebCore::FEDropShadow::externalRepresentation const):
        * platform/graphics/filters/FEDropShadow.h:
        * platform/graphics/filters/FEFlood.cpp:
        (WebCore::FEFlood::externalRepresentation const):
        * platform/graphics/filters/FEFlood.h:
        * platform/graphics/filters/FEGaussianBlur.cpp:
        (WebCore::FEGaussianBlur::externalRepresentation const):
        * platform/graphics/filters/FEGaussianBlur.h:
        * platform/graphics/filters/FEMerge.cpp:
        (WebCore::FEMerge::externalRepresentation const):
        * platform/graphics/filters/FEMerge.h:
        * platform/graphics/filters/FEMorphology.cpp:
        (WebCore::FEMorphology::externalRepresentation const):
        * platform/graphics/filters/FEMorphology.h:
        * platform/graphics/filters/FEOffset.cpp:
        (WebCore::FEOffset::externalRepresentation const):
        * platform/graphics/filters/FEOffset.h:
        * platform/graphics/filters/FESpecularLighting.cpp:
        (WebCore::FESpecularLighting::externalRepresentation const):
        * platform/graphics/filters/FESpecularLighting.h:
        * platform/graphics/filters/FETile.cpp:
        (WebCore::FETile::externalRepresentation const):
        * platform/graphics/filters/FETile.h:
        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::FETurbulence::externalRepresentation const):
        * platform/graphics/filters/FETurbulence.h:
        * platform/graphics/filters/FilterEffect.cpp:
        (WebCore::FilterEffect::externalRepresentation const):
        * platform/graphics/filters/FilterEffect.h:
        * platform/graphics/filters/SourceAlpha.cpp:
        (WebCore::SourceAlpha::externalRepresentation const):
        * platform/graphics/filters/SourceAlpha.h:
        * platform/graphics/filters/SourceGraphic.cpp:
        (WebCore::SourceGraphic::externalRepresentation const):
        * platform/graphics/filters/SourceGraphic.h:
        * rendering/RenderTreeAsText.cpp:
        (WebCore::write):
        (WebCore::writeLayer):
        (WebCore::writeLayerRenderers):
        (WebCore::writeLayers):
        (WebCore::externalRepresentation):
        * rendering/RenderTreeAsText.h:
        * rendering/svg/SVGRenderTreeAsText.cpp:
        (WebCore::writeSVGInlineTextBox):
        (WebCore::writeSVGInlineTextBoxes):
        (WebCore::writeStandardPrefix):
        (WebCore::writeChildren):
        (WebCore::writeSVGResourceContainer):
        (WebCore::writeSVGContainer):
        (WebCore::write):
        (WebCore::writeSVGText):
        (WebCore::writeSVGInlineText):
        (WebCore::writeSVGImage):
        (WebCore::writeSVGGradientStop):
        (WebCore::writeResources):
        * rendering/svg/SVGRenderTreeAsText.h:
        * svg/graphics/filters/SVGFEImage.cpp:
        (WebCore::FEImage::externalRepresentation const):
        * svg/graphics/filters/SVGFEImage.h:

2017-11-27  Chris Dumez  <cdumez@apple.com>

        Give Document a strongly typed identifier instead of a uint64_t
        https://bugs.webkit.org/show_bug.cgi?id=180041

        Reviewed by Youenn Fablet.

        Give Document a strongly typed identifier instead of a uint64_t, for clarity.

        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::m_identifier):
        * dom/Document.h:
        (WebCore::Document::identifier const):
        * dom/DocumentIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h.
        * workers/service/ServiceWorkerClientIdentifier.h:
        (WebCore::ServiceWorkerClientIdentifier::toString const):
        (WebCore::ServiceWorkerClientIdentifier::encode const):
        (WebCore::ServiceWorkerClientIdentifier::decode):
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
        (WebCore::SWClientConnection::notifyClientsOfControllerChange):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::serviceWorkerStartedControllingClient):
        (WebCore::SWServer::Connection::serviceWorkerStoppedControllingClient):
        (WebCore::SWServer::serviceWorkerStartedControllingClient):
        (WebCore::SWServer::serviceWorkerStoppedControllingClient):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::addClientUsingRegistration):
        (WebCore::SWServerRegistration::removeClientUsingRegistration):
        * workers/service/server/SWServerRegistration.h:

2017-11-27  Simon Fraser  <simon.fraser@apple.com>

        Optimize FEDisplacementMap
        https://bugs.webkit.org/show_bug.cgi?id=180023

        Reviewed by Sam Weinig.

        Make FEDisplacementMap about 3x faster by operating on whole pixels rather than
        individual channels. There's no per-channel logic once the srcX and srcY are computed.
        
        Other sundry cleanup.

        * platform/graphics/ColorUtilities.h:
        (WebCore::byteOffsetOfPixel): Will use this in more places in future.
        * platform/graphics/filters/FEDisplacementMap.cpp:
        (WebCore::FEDisplacementMap::platformApplySoftware):
        * platform/graphics/filters/FEDisplacementMap.h:
        (WebCore::FEDisplacementMap::xChannelIndex const):
        (WebCore::FEDisplacementMap::yChannelIndex const):

2017-11-27  Tim Horton  <timothy_horton@apple.com>

        One too many zeroes in macOS version number in FeatureDefines
        https://bugs.webkit.org/show_bug.cgi?id=180011

        Reviewed by Dan Bernstein.

        * Configurations/FeatureDefines.xcconfig:

2017-11-27  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] CoordinatedGraphicsLayer doesn't need to inherit from TextureMapperPlatformLayer::Client
        https://bugs.webkit.org/show_bug.cgi?id=180036

        Reviewed by Carlos Garcia Campos.

        There's no reason CoordinatedGraphicsLayer should inherit from
        TextureMapperPlatformLayer::Client. CoordinatedGraphicsLayer objects are
        not used anywhere through that type, and all the overridden methods are
        empty anyway. The TextureMapperPlatformLayer::Client class (along with
        TextureMapperPlatformLayer) is nowadays only used in the direct
        TextureMapper implementation of GraphicsLayer.

        No new tests -- no change in behavior.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::platformLayerWillBeDestroyed): Deleted.
        (WebCore::CoordinatedGraphicsLayer::setPlatformLayerNeedsDisplay): Deleted.
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

2017-11-27  Antoine Quint  <graouts@apple.com>

        Pressing the space bar while watching a fullscreen video doesn't play or pause
        https://bugs.webkit.org/show_bug.cgi?id=180033
        <rdar://problem/33610443>

        Reviewed by Eric Carlson.

        We register a "keydown" event to track when the space bar is pressed, and if the media is playing
        in fullscreen, we toggle playback. This does not interfere with full keyboard access since activating
        one of the media controls using the keyboard will not let the events we register for be dispatched
        this far along the event dispatch phase.

        Test: media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html

        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController):
        (MediaController.prototype.togglePlayback): Add a catch() statement since calling play() could sometime
        lead to some extraneous unhandled promise console logging that pollutes test output.
        (MediaController.prototype.handleEvent):

2017-11-27  Simon Fraser  <simon.fraser@apple.com>

        Optimize FEMorphology
        https://bugs.webkit.org/show_bug.cgi?id=180020

        Reviewed by Sam Weinig.

        Use const PaintingData&.
        Compute all components at once.
        Avoid Vector<> capacity changes during the pixel loop.
        Tweak the parallel jobs scaling.
        Templatize the the inner loop functions that compute min or max based
        on the filter type to avoid conditionals in tight loops.
        
        This is about a 4x speedup before the parallel jobs tweaking. With fixed parallelism,
        a 200x200 filter went from 15ms to about 1ms with these changes.

        * platform/graphics/ColorUtilities.h:
        (WebCore::ColorComponents::fromRGBA):
        (WebCore::ColorComponents::toRGBA const):
        (WebCore::perComponentMax):
        (WebCore::perComponentMin):
        * platform/graphics/filters/FEColorMatrix.cpp:
        (WebCore::FEColorMatrix::platformApplySoftware): Remove some old perf logging code.
        TimingScope now does something similar.
        * platform/graphics/filters/FEMorphology.cpp:
        (WebCore::pixelArrayIndex):
        (WebCore::minOrMax):
        (WebCore::columnExtremum):
        (WebCore::kernelExtremum):
        (WebCore::FEMorphology::platformApplyGeneric):
        (WebCore::FEMorphology::platformApplyWorker):
        (WebCore::FEMorphology::platformApply):
        (WebCore::FEMorphology::platformApplySoftware):
        (WebCore::shouldSupersedeExtremum): Deleted.
        * platform/graphics/filters/FEMorphology.h:

2017-11-27  Yacine Bandou  <yacine.bandou_ext@softathome.com>

        [EME][GStreamer] Change the ClearKey's SystemID value
        https://bugs.webkit.org/show_bug.cgi?id=180007

        Reviewed by Xabier Rodriguez-Calvar.

        Use 1077efec-c0b2-4d02-ace3-3c1e52e2fb4b instead of
        58147ec8-0423-4659-92e6-f52c5ce8c3cc, as is specified in W3C.
        https://www.w3.org/TR/eme-initdata-cenc/#common-system-definition

        * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:

2017-11-27  Javier Fernandez  <jfernandez@igalia.com>

        [css-grid] Display issues with child with max-width
        https://bugs.webkit.org/show_bug.cgi?id=178973

        Reviewed by Darin Adler.

        We have an utility function to compute the grid item's margins
        when the item still needs to layout. We used the function
        RenderStyle::hasMarings to decide whether such margin computation
        worths. However, we need that function to operate on a specific
        axis, hence I added a new function adding such logic.

        Additionally, we must treat any 'auto' margin as 0px during the
        tracks sizing algorithm, as the CSS Grid spec states:

          - https://drafts.csswg.org/css-grid/#auto-margins

        Test: fast/css-grid-layout/auto-margins-ignored-during-track-sizing.html

        * rendering/GridLayoutFunctions.cpp:
        (WebCore::GridLayoutFunctions::childHasMargin): New funciton with axis dependent logic.
        (WebCore::GridLayoutFunctions::computeMarginLogicalSizeForChild): Ignore auto margins.
        (WebCore::GridLayoutFunctions::marginLogicalSizeForChild): Ignore auto margins.

2017-11-26  Simon Fraser  <simon.fraser@apple.com>

        feImage as filter input has skewed colors
        https://bugs.webkit.org/show_bug.cgi?id=180021

        Reviewed by Sam Weinig.
        
        Using an <feImage> as a filter input sometimes results in incorrect colors, because
        the image is being sourced as linearRGB when it should always be sRGB.
        
        Fix by setting the result colorspace in FEImage before we allocate the output
        buffer.

        Tests: svg/filters/feImage-color-fidelity-expected.svg
               svg/filters/feImage-color-fidelity.svg

        * svg/graphics/filters/SVGFEImage.cpp:
        (WebCore::FEImage::platformApplySoftware):

2017-11-26  Minsheng Liu  <lambda@liu.ms>

        Cleanup code for RenderMathMLUnderOver::layoutBlock
        https://bugs.webkit.org/show_bug.cgi?id=179681

        Reviewed by Frédéric Wang.

        The patch removes some unnecessary calls to layoutIfNeeds() and guards the change
        with assertion. Since there is no behavior change, no new tests are required.

        * rendering/mathml/RenderMathMLUnderOver.cpp:
        (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
        (WebCore::RenderMathMLUnderOver::layoutBlock):
        (WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Deleted.
        * rendering/mathml/RenderMathMLUnderOver.h:

2017-11-26  Simon Fraser  <simon.fraser@apple.com>

        Use more Uint8ClampedArray& and constness in filter and image buffer code
        https://bugs.webkit.org/show_bug.cgi?id=180008

        Reviewed by Darin Adler.

        Use references to Uint8ClampedArrays rather than pointers where necessary.
        
        Use const for source data buffers when possible, and uint8_t for the underlying
        data type.
        
        Fix a bug in FEGaussianBlur where the output of the last blur pass wasn't
        copied to the result buffer, which required a test adjustment.

        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::putImageData):
        * platform/graphics/ImageBuffer.cpp:
        (WebCore::ImageBuffer::genericConvertToLuminanceMask):
        * platform/graphics/ImageBuffer.h:
        * platform/graphics/ShadowBlur.cpp:
        (WebCore::ShadowBlur::blurShadowBuffer):
        * platform/graphics/cairo/ImageBufferCairo.cpp:
        (WebCore::ImageBuffer::putByteArray):
        * platform/graphics/cg/ImageBufferCG.cpp:
        (WebCore::ImageBuffer::putByteArray):
        * platform/graphics/cg/ImageBufferDataCG.cpp:
        (WebCore::ImageBufferData::getData const):
        (WebCore::ImageBufferData::putData):
        * platform/graphics/cg/ImageBufferDataCG.h:
        * platform/graphics/cpu/arm/filters/FEBlendNEON.h:
        (WebCore::FEBlend::platformApplySoftware):
        * platform/graphics/cpu/arm/filters/FECompositeArithmeticNEON.h:
        (WebCore::FEComposite::computeArithmeticPixelsNeon):
        (WebCore::FEComposite::platformArithmeticNeon):
        * platform/graphics/cpu/arm/filters/FEGaussianBlurNEON.h:
        (WebCore::boxBlurNEON):
        * platform/graphics/cpu/arm/filters/NEONHelpers.h:
        (WebCore::loadRGBA8AsFloat):
        * platform/graphics/filters/FEColorMatrix.cpp:
        (WebCore::effectApplyAccelerated):
        (WebCore::effectType):
        (WebCore::FEColorMatrix::platformApplySoftware):
        * platform/graphics/filters/FEComponentTransfer.cpp:
        (WebCore::FEComponentTransfer::platformApplySoftware):
        * platform/graphics/filters/FEComposite.cpp:
        (WebCore::computeArithmeticPixels):
        (WebCore::FEComposite::platformArithmeticSoftware):
        (WebCore::FEComposite::platformApplySoftware):
        * platform/graphics/filters/FEComposite.h:
        * platform/graphics/filters/FEConvolveMatrix.cpp:
        (WebCore::setDestinationPixels):
        (WebCore::FEConvolveMatrix::fastSetInteriorPixels):
        (WebCore::FEConvolveMatrix::fastSetOuterPixels):
        (WebCore::FEConvolveMatrix::platformApplySoftware):
        * platform/graphics/filters/FEConvolveMatrix.h:
        * platform/graphics/filters/FEDisplacementMap.cpp:
        (WebCore::FEDisplacementMap::platformApplySoftware):
        * platform/graphics/filters/FEDropShadow.cpp:
        (WebCore::FEDropShadow::platformApplySoftware):
        * platform/graphics/filters/FEGaussianBlur.cpp:
        (WebCore::boxBlurAlphaOnly):
        (WebCore::boxBlur):
        (WebCore::accelerateBoxBlur):
        (WebCore::standardBoxBlur):
        (WebCore::FEGaussianBlur::platformApplyGeneric):
        (WebCore::FEGaussianBlur::platformApplyWorker):
        (WebCore::FEGaussianBlur::platformApply):
        (WebCore::FEGaussianBlur::platformApplySoftware):
        * platform/graphics/filters/FEGaussianBlur.h:
        * platform/graphics/filters/FELighting.cpp:
        (WebCore::FELighting::drawLighting):
        (WebCore::FELighting::platformApplySoftware):
        * platform/graphics/filters/FELighting.h:
        * platform/graphics/filters/FEMorphology.cpp:
        (WebCore::columnExtremum):
        (WebCore::FEMorphology::platformApplyGeneric):
        (WebCore::FEMorphology::platformApplyDegenerate):
        (WebCore::FEMorphology::platformApplySoftware):
        * platform/graphics/filters/FEMorphology.h:
        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::FETurbulence::fillRegion const):
        (WebCore::FETurbulence::fillRegionWorker):
        (WebCore::FETurbulence::platformApplySoftware):
        * platform/graphics/filters/FETurbulence.h:
        * platform/graphics/filters/FilterEffect.cpp:
        (WebCore::FilterEffect::forceValidPreMultipliedPixels):
        (WebCore::FilterEffect::imageBufferResult):
        (WebCore::FilterEffect::unmultipliedResult):
        (WebCore::FilterEffect::premultipliedResult):
        (WebCore::FilterEffect::copyImageBytes const):
        (WebCore::copyPremultiplyingAlpha):
        (WebCore::copyUnpremultiplyingAlpha):
        (WebCore::FilterEffect::copyUnmultipliedResult):
        (WebCore::FilterEffect::copyPremultipliedResult):
        * platform/graphics/filters/FilterEffect.h:
        * platform/graphics/win/ImageBufferDataDirect2D.cpp:
        (WebCore::ImageBufferData::putData):
        * platform/graphics/win/ImageBufferDataDirect2D.h:

2017-11-25  Zalan Bujtas  <zalan@apple.com>

        Make RenderSnapshottedPlugIn ISO allocated
        https://bugs.webkit.org/show_bug.cgi?id=180010
        <rdar://problem/35671977>

        Reviewed by David Kilzer.

        RenderEmbeddedObject, the base class is ISO allocated since r224537. 

        * rendering/RenderSnapshottedPlugIn.cpp:
        * rendering/RenderSnapshottedPlugIn.h:

2016-08-05  Darin Adler  <darin@apple.com>

        Fix some minor problems in the StringImpl header
        https://bugs.webkit.org/show_bug.cgi?id=160630

        Reviewed by Brent Fulgham.

        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::text): Use stripLeadingAndTrailingHTMLSpaces
        instead of stripWhiteSpace(isHTMLSpace).
        (WebCore::HTMLOptionElement::value): Ditto.
        (WebCore::HTMLOptionElement::label): Ditto.
        (WebCore::HTMLOptionElement::displayLabel): Ditto.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::didBeginDocument): Use stripLeadingAndTrailingHTMLSpaces
        instead of calling the general purpose one and passing isHTMLSpace.
        * platform/network/HTTPParsers.h:
        (WebCore::stripLeadingAndTrailingHTTPSpaces): Updated to use the
        new name, stripLeadingAndTrailingCharacters.

2017-11-23  Darin Adler  <darin@apple.com>

        Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby
        https://bugs.webkit.org/show_bug.cgi?id=179981

        Reviewed by Sam Weinig.

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::rangeMatchesTextNearRange): Pass { } instead of 0.
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Use { }
        instead of | to construct value.
        * editing/Editor.cpp:
        (WebCore::Editor::findString): Use contains instead of & to test an option.
        (WebCore::Editor::rangeOfString): Ditto.
        (WebCore::Editor::countMatchesForText): Ditto.
        * editing/EditorCommand.cpp:
        (WebCore::executeFindString): Use { } instead of | to construct value.
        * editing/FindOptions.h: Use OptionSet for type.
        * editing/TextIterator.cpp:
        (WebCore::SearchBuffer::SearchBuffer): Use contains instead of &. Also use -= instead
        of &= coupled with ~ to remove a flag.
        (WebCore::SearchBuffer::isWordEndMatch const): Ditto.
        (WebCore::SearchBuffer::isWordStartMatch const): Ditto.
        (WebCore::SearchBuffer::search): Ditto.
        (WebCore::findIteratorOptions): Ditto.
        (WebCore::findClosestPlainText): Ditto.
        (WebCore::findPlainText): Ditto.

        * editing/mac/DictionaryLookup.h: Changed optional dictionary out arguments to
        RetainPtr<NSDictionary>. Before, they were returning a retained object, but callers
        did not seem to realize that.
        * editing/mac/DictionaryLookup.mm:
        (WebCore::tokenRange): Added helper. Takes care of doing adoptNS on the options
        dictionary, and also handles the Objective-C exception possibility cleanly. Also
        fixed the exception case to return NSNotFound instead of a zero-length range at
        the location we are searching, which is what the code expects.
        (WebCore::DictionaryLookup::rangeForSelection): Refactored to use the tokenRange
        helper function, and also to do much less work when the options pointer is null.
        (WebCore::DictionaryLookup::rangeAtHitTestResult): Use the tokenRange helper
        function and also use auto a bunch to tighten up the code a bit.
        (WebCore::DictionaryLookup::stringForPDFSelection): Ditto.

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::find const): Use |= instead of | to build find options.
        * page/Page.cpp:
        (WebCore::Page::findString): Use contains instead of & and also - instead of
        & combined with ~.
        (WebCore::Page::findStringMatchingRanges): Ditto.
        (WebCore::Page::rangeOfString): Ditto.

        * page/mac/EventHandlerMac.mm:
        (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
        Pass nullptr to indicate we don't need the options dictionary. The code before
        was passing a pointer to a null, which meant we would do the work to get the
        options dictionary, not use it, and also leak it.

        * testing/Internals.cpp:
        (WebCore::Internals::rangeOfStringNearLocation): Pass { } instead of 0.
        (WebCore::Internals::rangeForDictionaryLookupAtLocation): Pass nullptr to
        indicate we don't need the options dictionary as above.
        (WebCore::parseFindOptions): Initialize options without an explicit 0, since
        an OptionSet starts out empty rather than uninitialized.

2017-11-24  Antti Koivisto  <antti@apple.com>

        Style resolution spin due to calc() values always comparing inequal (seen on arstechnica.com)
        https://bugs.webkit.org/show_bug.cgi?id=179982
        <rdar://problem/35677991>

        Reviewed by Darin Adler.

        Test: transitions/transition-with-calc-spin.html

        Something like calc(100% - 10px) would compare inequal to itself. This causes the implicit animation engine think that
        there is a new target value after style resolution and restart the transition. Starting the transition triggers another style
        resolution on zero duration timer and so on.

        * platform/CalculationValue.cpp:
        (WebCore::operator==):
        * platform/CalculationValue.h:

        Deep compare the child vectors.

2017-11-24  Antoine Quint  <graouts@apple.com>

        Captions move when <video> with no controls is hovered
        https://bugs.webkit.org/show_bug.cgi?id=178600
        <rdar://problem/35112309>

        Reviewed by Jer Noble.

        We should only reduce the text tracks container height to make room for the controls
        bar when controls are enabled.

        Tests: media/modern-media-controls/text-tracks/text-tracks-height-no-controls.html
               media/modern-media-controls/text-tracks/text-tracks-height-with-controls.html

        * Modules/modern-media-controls/controls/text-tracks.css:
        (video[controls]::-webkit-media-text-track-container.visible-controls-bar):
        (video::-webkit-media-text-track-container.visible-controls-bar): Deleted.

2017-11-23  Simon Fraser  <simon.fraser@apple.com>

        Some FilterEffect cleanup and logging
        https://bugs.webkit.org/show_bug.cgi?id=179932

        Reviewed by Darin Adler.
        
        Rename the FilterEffect functions that get the result of the filter
        to have "result" in the name.
        
        Re-order FilterEffect member variables and use initializers. webkit.org/b/45614
        is closed so remove the comment about things moving to RenderSVGResourceFilterPrimitive.
        
        Add a virtual filterName() function for use by logging.
        
        Add a Filters log channel. Log some stuff.
        
        Rename RenderSVGResourceFilter::m_filter to m_rendererFilterDataMap.

        * platform/Logging.h:
        * platform/graphics/cpu/arm/filters/FEBlendNEON.h:
        (WebCore::FEBlend::platformApplySoftware):
        * platform/graphics/filters/FEBlend.cpp:
        (WebCore::FEBlend::platformApplySoftware):
        * platform/graphics/filters/FEBlend.h:
        * platform/graphics/filters/FEColorMatrix.cpp:
        (WebCore::FEColorMatrix::platformApplySoftware):
        * platform/graphics/filters/FEColorMatrix.h:
        * platform/graphics/filters/FEComponentTransfer.cpp:
        (WebCore::FEComponentTransfer::platformApplySoftware):
        * platform/graphics/filters/FEComponentTransfer.h:
        * platform/graphics/filters/FEComposite.cpp:
        (WebCore::FEComposite::platformApplySoftware):
        * platform/graphics/filters/FEComposite.h:
        * platform/graphics/filters/FEConvolveMatrix.cpp:
        (WebCore::FEConvolveMatrix::platformApplySoftware):
        * platform/graphics/filters/FEConvolveMatrix.h:
        * platform/graphics/filters/FEDisplacementMap.cpp:
        (WebCore::FEDisplacementMap::platformApplySoftware):
        * platform/graphics/filters/FEDisplacementMap.h:
        * platform/graphics/filters/FEDropShadow.cpp:
        (WebCore::FEDropShadow::platformApplySoftware):
        * platform/graphics/filters/FEDropShadow.h:
        * platform/graphics/filters/FEFlood.h:
        * platform/graphics/filters/FEGaussianBlur.cpp:
        (WebCore::FEGaussianBlur::platformApplySoftware):
        * platform/graphics/filters/FEGaussianBlur.h:
        * platform/graphics/filters/FELighting.cpp:
        (WebCore::FELighting::platformApplySoftware):
        * platform/graphics/filters/FELighting.h:
        * platform/graphics/filters/FEMerge.cpp:
        (WebCore::FEMerge::platformApplySoftware):
        * platform/graphics/filters/FEMerge.h:
        * platform/graphics/filters/FEMorphology.cpp:
        (WebCore::FEMorphology::platformApplyDegenerate):
        (WebCore::FEMorphology::platformApplySoftware):
        * platform/graphics/filters/FEMorphology.h:
        * platform/graphics/filters/FEOffset.cpp:
        (WebCore::FEOffset::platformApplySoftware):
        * platform/graphics/filters/FEOffset.h:
        * platform/graphics/filters/FETile.cpp:
        (WebCore::FETile::platformApplySoftware):
        * platform/graphics/filters/FETile.h:
        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::operator<<):
        * platform/graphics/filters/FETurbulence.h:
        * platform/graphics/filters/FilterEffect.cpp:
        (WebCore::FilterEffect::FilterEffect):
        (WebCore::FilterEffect::imageBufferResult):
        (WebCore::FilterEffect::unmultipliedResult):
        (WebCore::FilterEffect::premultipliedResult):
        (WebCore::FilterEffect::copyImageBytes const): This can be const. It'a also crazy
        to mark a large, slow function like this as 'inline'.
        (WebCore::FilterEffect::copyUnmultipliedResult):
        (WebCore::FilterEffect::copyPremultipliedResult):
        (WebCore::FilterEffect::createImageBufferResult):
        (WebCore::FilterEffect::createUnmultipliedImageResult):
        (WebCore::FilterEffect::createPremultipliedImageResult):
        (WebCore::FilterEffect::transformResultColorSpace):
        (WebCore::FilterEffect::asImageBuffer): Deleted.
        (WebCore::FilterEffect::asUnmultipliedImage): Deleted.
        (WebCore::FilterEffect::asPremultipliedImage): Deleted.
        (WebCore::FilterEffect::copyImageBytes): Deleted.
        (WebCore::FilterEffect::copyUnmultipliedImage): Deleted.
        (WebCore::FilterEffect::copyPremultipliedImage): Deleted.
        * platform/graphics/filters/FilterEffect.h:
        * platform/graphics/filters/SourceAlpha.cpp:
        (WebCore::SourceAlpha::platformApplySoftware):
        * platform/graphics/filters/SourceAlpha.h:
        * platform/graphics/filters/SourceGraphic.h:
        * rendering/FilterEffectRenderer.cpp:
        (WebCore::FilterEffectRenderer::output const):
        * rendering/svg/RenderSVGResourceFilter.cpp:
        (WebCore::RenderSVGResourceFilter::removeAllClientsFromCache):
        (WebCore::RenderSVGResourceFilter::removeClientFromCache):
        (WebCore::RenderSVGResourceFilter::applyResource):
        (WebCore::RenderSVGResourceFilter::postApplyResource):
        (WebCore::RenderSVGResourceFilter::primitiveAttributeChanged):
        (WebCore::RenderSVGResourceFilter::drawingRegion const):
        (WebCore::operator<<):
        * rendering/svg/RenderSVGResourceFilter.h:
        (WebCore::FilterData::FilterData): Deleted.
        * svg/graphics/filters/SVGFEImage.h:

2017-11-24  Antoine Quint  <graouts@apple.com>

        [Web Animations] Allow getComputedStyle() to return animated values for accelerated animations
        https://bugs.webkit.org/show_bug.cgi?id=179975
        <rdar://problem/35676811>

        Reviewed by Dean Jackson.

        In case we're running an accelerated animation, we are not blending RenderStyles as the animation
        progresses and thus we need to hook into computeRenderStyleForProperty() to query the DocumentTimeline
        for the animated style of running accelerated animations where we blend styles manually for the
        animation's current time.

        Test: http/wpt/wk-web-animations/interfaces/keyframe-effect-getComputedStyle.html

        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::animatedStyleForRenderer): Iterate through all running accelerated animations
        for the element to which the provided renderer is attached and ask for their animated styles.
        * animation/DocumentTimeline.h:
        * animation/KeyframeEffect.cpp:
        (WebCore::KeyframeEffect::getAnimatedStyle): Manually blend all animated properties and populate the provided
        RenderStyle with their values, creating the RenderStyle if needed.
        * animation/KeyframeEffect.h:
        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::computeRenderStyleForProperty): Query the DocumentTimeline for accelerated animated properties in
        case such animations are running, otherwise let the CSS animation controller report the animated values.

2017-11-24  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] CoordinatedGraphicsLayer::updateContentBuffers() should always assume a non-null CoordinatedBuffer
        https://bugs.webkit.org/show_bug.cgi?id=179977

        Reviewed by Carlos Garcia Campos.

        CoordinatedGraphicsLayer::updateContentBuffers() retrieves a RefPtr<CoordinatedBuffer>
        from the CompositingCoordinator. This pointer should never be null since if no
        existing UpdateAtlas can provide the necessary memory area, a fresh UpdateAtlas is
        created and its buffer returned. This can't fail in theory since the tiles that are
        being updated are smaller than the UpdateAtlas area.

        The CoordinatedGraphicsLayerClient::getCoordinatedBuffer() method is updated to
        always return a Ref<CoordinatedBuffer> value. Code in updateContentBuffers() is
        updated to remove a null-check on what is now the Ref<CoordinatedBuffer> value.

        No new tests -- no change in functionality.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

2017-11-23  Antoine Quint  <graouts@apple.com>

        [Web Animations] Perform accelerated animations when possible
        https://bugs.webkit.org/show_bug.cgi?id=179973
        <rdar://problem/34953922>

        Reviewed by Dean Jackson.

        When we're entering and leaving the active duration of an animation effect, we now check
        whether the animation can be accelerated, using the existing CSSPropertyAnimation::animationOfPropertyIsAccelerated()
        utility, and start and stop animations using the startAnimation() and animationFinished() functions on RenderBoxModelObject.

        This patch is only a first step towards full support for accelerated animations,
        there are two known issues at the moment. Because we're not blending the styles to perform
        the animation, getComputedStyle() will not return the animated value (webkit.org/b/179974).
        Additionally, if other animations happen to run later during the active state of an animation
        that can run accelerated, we will not fall back to software-only animation for this
        element and these animations will appear not to run (webkit.org/b/179975). These will be
        addressed in follow-up patches.

        Tests: webanimations/left-and-opacity-animation-yields-no-compositing.html
               webanimations/opacity-animation-no-longer-composited-upon-completion.html
               webanimations/opacity-animation-yields-compositing.html
               webanimations/width-and-opacity-separate-animation-yields-no-compositing.html

        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::updateAnimations): Check in the map of pending accelerated animations
        to see if any animation requires toggling their active state after their styles have been invalidated.
        (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): New function to
        let animations indicate that they need to have their accelerated backing animation toggled after
        style invalidation has been completed.
        (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated): This function is used
        in RenderLayerCompositor::requiresCompositingForAnimation() to identify whether an element requires
        hardware compositing due to running accelerated animations. We check all running animations for the
        provided element to see if they can all be running accelerated and return true in this situation only.
        * animation/DocumentTimeline.h:
        * animation/KeyframeEffect.cpp:
        (WebCore::KeyframeEffect::applyAtLocalTime): Identify if we're crossing into or out of the active state
        for an animation and check if it will be or has been running accelerated such that we can notify the
        DocumentTimeline, through the associated animation, that the accelerated backing animation will need to
        be toggled after style invalidation has been completed.
        (WebCore::KeyframeEffect::shouldRunAccelerated): Check that all properties for this animation
        effect can be accelerated according to CSSPropertyAnimation::animationOfPropertyIsAccelerated().
        (WebCore::KeyframeEffect::startOrStopAccelerated): Start or stop the associated accelerated
        animation through the associated element's RenderBoxModelObject renderer.
        * animation/KeyframeEffect.h:
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::acceleratedRunningStateDidChange): Called from AnimationEffect::applyAtLocalTime(),
        we forward to the DocumentTimeline the information that the animation will cross an active state boundary while
        allowing to be backed by hardware compositing.
        (WebCore::WebAnimation::startOrStopAccelerated): Forward to the associated KeyframeEffect that accelerated
        animation backing should be toggled.
        * animation/WebAnimation.h:
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): Check via the renderer's element's
        DocumentTimeline that all running animations for this particular element are accelerated to ensure that
        the element will be hardware-composited.

2017-11-23  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win] PasteboardWin.cpp(653): error C2039: 'containsOnlyASCII': is not a member of 'WTF::String'
        https://bugs.webkit.org/show_bug.cgi?id=179991

        Unreviewed build fix.

        No new tests (No behaviour change).

        * platform/win/PasteboardWin.cpp:
        (WebCore::Pasteboard::writeURLToDataObject): Renamed containsOnlyASCII() to isAllASCII().

2017-11-23  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK] [Debug] Fix build after r225117.
        https://bugs.webkit.org/show_bug.cgi?id=179907

        Unreviewed build fix.

        r225117 renamed containsOnlyASCII() to isAllASCII().
        And this reference was not updated for the GTK Debug build.

        No new tests, its a build fix.

        * loader/archive/mhtml/MHTMLArchive.cpp:
        (WebCore::MHTMLArchive::generateMHTMLData):

2017-11-23  Simon Fraser  <simon.fraser@apple.com>

        FELighting cleanup and optimization
        https://bugs.webkit.org/show_bug.cgi?id=179933

        Reviewed by Darin Adler.

        Make FELighting about 25% faster by maintaining an "alpha" window of the alpha
        values of the 9 pixels surrounding the current pixel, and sliding this window over
        when moving to the next pixel. This avoids reading the same alpha values from the original
        buffer multiple times.

        Clean up LightSource and subclasses, adding SPECIALIZE_TYPE_TRAITS macros,
        and turning updatePaintingData() into a function with no side effects that returns
        the required data.

        Remove explicit 'inline' keywords, allowing the compiler to make inlining decisions.

        * platform/graphics/cpu/arm/filters/FELightingNEON.h:
        (WebCore::FELighting::platformApplyNeon):
        * platform/graphics/filters/DistantLightSource.cpp:
        (WebCore::DistantLightSource::initPaintingData):
        (WebCore::DistantLightSource::computePixelLightingData const):
        (WebCore::DistantLightSource::updatePaintingData): Deleted.
        * platform/graphics/filters/DistantLightSource.h:
        * platform/graphics/filters/FELighting.cpp:
        (WebCore::FELighting::LightingData::interiorNormal const):
        (WebCore::FELighting::setPixel):
        (WebCore::FELighting::setPixelInternal):
        (WebCore::FELighting::platformApplyGenericPaint):
        (WebCore::FELighting::platformApplyGeneric):
        (WebCore::FELighting::platformApply):
        (WebCore::FELighting::drawLighting):
        (WebCore::FELighting::inlineSetPixel): Deleted.
        * platform/graphics/filters/FELighting.h:
        (WebCore::FELighting::AlphaWindow::topLeft const):
        (WebCore::FELighting::AlphaWindow::left const):
        (WebCore::FELighting::AlphaWindow::bottomLeft const):
        (WebCore::FELighting::AlphaWindow::top const):
        (WebCore::FELighting::AlphaWindow::center const):
        (WebCore::FELighting::AlphaWindow::bottom const):
        (WebCore::FELighting::AlphaWindow::setTop):
        (WebCore::FELighting::AlphaWindow::setCenter):
        (WebCore::FELighting::AlphaWindow::setBottom):
        (WebCore::FELighting::AlphaWindow::setTopRight):
        (WebCore::FELighting::AlphaWindow::setRight):
        (WebCore::FELighting::AlphaWindow::setBottomRight):
        (WebCore::FELighting::AlphaWindow::shiftRow):
        (WebCore::FELighting::AlphaWindow::shift):
        * platform/graphics/filters/LightSource.h:
        * platform/graphics/filters/PointLightSource.cpp:
        (WebCore::PointLightSource::computePixelLightingData const):
        (WebCore::PointLightSource::updatePaintingData): Deleted.
        * platform/graphics/filters/PointLightSource.h:
        * platform/graphics/filters/SpotLightSource.cpp:
        (WebCore::SpotLightSource::initPaintingData):
        (WebCore::SpotLightSource::computePixelLightingData const):
        (WebCore::SpotLightSource::updatePaintingData): Deleted.
        * platform/graphics/filters/SpotLightSource.h:

2017-11-23  Simon Fraser  <simon.fraser@apple.com>

        Add support for CanvasPattern.setTransform()
        https://bugs.webkit.org/show_bug.cgi?id=179935

        Reviewed by Sam Weinig.
        
        Add support for setTransform() on CanvasPattern, per
        <https://html.spec.whatwg.org/multipage/canvas.html#dom-canvaspattern-settransform>
        It uses [MayThrowException] since the "validate and fixup" steps for DOMMatrix can throw
        an exception.
        
        Under the hood, the transform is just pushed onto Pattern as the patternSpaceTransform().
        
        Minor cleanup in Pattern.

        Test: fast/canvas/canvas-pattern-with-transform.html

        * html/canvas/CanvasPattern.cpp:
        (WebCore::CanvasPattern::setTransform):
        * html/canvas/CanvasPattern.h:
        * html/canvas/CanvasPattern.idl:
        * platform/graphics/Pattern.h:

2017-11-23  Sam Weinig  <sam@webkit.org>

        Remove unneeded ScriptController::processingUserGesture() forwarding functions
        https://bugs.webkit.org/show_bug.cgi?id=179954

        Reviewed by Darin Adler.

        Replace ScriptController::processingUserGesture() and ScriptController::processingUserGestureForMedia()
        with direct calls to the corresponding UserGestureIndicator functions.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::ApplePaySession::create):
        (WebCore::ApplePaySession::openPaymentSetup):
        * Modules/speech/SpeechSynthesis.cpp:
        (WebCore::SpeechSynthesis::speak):
        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::processingUserGesture): Deleted.
        (WebCore::ScriptController::processingUserGestureForMedia): Deleted.
        * bindings/js/ScriptController.h:
        * dom/Document.cpp:
        (WebCore::Document::processingUserGestureForMedia const):
        * html/BaseChooserOnlyDateAndTimeInputType.cpp:
        (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
        * html/ColorInputType.cpp:
        (WebCore::ColorInputType::handleDOMActivateEvent):
        * html/FileInputType.cpp:
        (WebCore::FileInputType::handleDOMActivateEvent):
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::submitFromJavaScript):
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
        (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::submitForm):
        (WebCore::shouldOpenExternalURLsPolicyToApply):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::allowPopUp):
        (WebCore::DOMWindow::setLocation):
        (WebCore::DOMWindow::createWindow):
        (WebCore::DOMWindow::open):
        * page/PointerLockController.cpp:
        (WebCore::PointerLockController::requestPointerLock):

2017-11-22  Dean Jackson  <dino@apple.com>

        Add a base class for HTMLCanvasElement and OffscreenCanvas
        https://bugs.webkit.org/show_bug.cgi?id=179701
        <rdar://problem/35545195>

        Post-review updates from Darin Adler review.

        * html/CanvasBase.cpp:
        (WebCore::CanvasBase::asHTMLCanvasElement): Deleted. Replaced by having the call
        sites get the reference and do the correct downcast<>.
        * html/CanvasBase.h: Remove asHTMLCanvasElement. Add pure virtual ref/deref functions
        so they can be overridden by subclasses. Unfortunately they can't be called ref/deref otherwise
        they conflict with Node.
        * html/HTMLCanvasElement.h: Add the type traits, so is<HTMLCanvasElement>(canvasBase) will
        work.
        * html/HTMLTagNames.in: Specify the <canvas> element as having custom type traits.
        * html/OffscreenCanvas.h: Lots of overrides to finals.
        * html/canvas/CanvasRenderingContext.cpp: Use canvasBase.de/refCanvasBase rather than
        casting.
        (WebCore::CanvasRenderingContext::ref):
        (WebCore::CanvasRenderingContext::deref):
        * html/canvas/CanvasRenderingContext.h: Lots of overrides to finals.
        * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/ImageBitmapRenderingContext.cpp:
        (WebCore::ImageBitmapRenderingContext::canvas const):
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::create):
        (WebCore::WebGLRenderingContextBase::canvas):
        * html/canvas/WebGPURenderingContext.cpp:
        (WebCore::WebGPURenderingContext::canvas const):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::recordCanvasAction):
        * inspector/agents/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::recordCanvasAction):

2017-11-23  Darin Adler  <darin@apple.com>

        Reduce WTF::String operations that do unnecessary Unicode operations instead of ASCII
        https://bugs.webkit.org/show_bug.cgi?id=179907

        Reviewed by Sam Weinig.

        * Modules/plugins/YouTubePluginReplacement.cpp:
        (WebCore::hasCaseInsensitivePrefix): Deleted.
        (WebCore::processAndCreateYouTubeURL): Use startsWithLettersIgnoringASCIICase.

        * Modules/websockets/WebSocketHandshake.cpp:
        (WebCore::WebSocketHandshake::readHTTPHeaders): Use isAllASCII.

        * accessibility/atk/AccessibilityObjectAtk.cpp:
        (WebCore::AccessibilityObject::getLengthForTextRange const): Use text().length().

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::traverseToOffsetInRange): Use isHTMLSpace instead of
        isSpaceOrNewline since the code is trying to skip collapsible HTML spaces, not
        arbitrary Unicode whitespace.
        * accessibility/AccessibilityList.cpp:
        (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers): Use
        isAllSpecialCharacters<isHTMLSpace> for the same reason as above.

        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::isSearchField const): Use containsIgnoringASCIICase.

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::accessibilityObjectContainsText const): Use
        new findPlainText function exported from TextIterator so this can share the
        same search matching logic used to find text in webpages.
        (WebCore::AccessibilityObject::selectText): Use capitalize and its return value
        rather than makeCapitalize modifying a string in place.

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::objectInclusionFromAltText): Use isAllSpecialCharacters<isHTMLSpace>
        for the same reason as above.
        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const): Ditto.

        * bindings/js/JSDOMConvertStrings.cpp:
        (WebCore::stringToByteString): Use isAllLatin1.

        * contentextensions/ContentExtensionParser.cpp:
        (WebCore::ContentExtensions::containsOnlyASCIIWithNoUppercase): Use
        StringView::codeUnits instead of String::at.

        * contentextensions/ContentExtensionsBackend.cpp:
        (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
        Use isAllASCII.
        * contentextensions/URLFilterParser.cpp:
        (WebCore::ContentExtensions::URLFilterParser::addPattern): Ditto.

        * css/CSSFontFaceSrcValue.cpp:
        (WebCore::CSSFontFaceSrcValue::isSupportedFormat const): Use protocolIs and
        endsWithIgnoringASCIICase.

        * css/DOMCSSNamespace.cpp:
        (WebCore::valueWithoutImportant): Use endsWithIgnoringASCIICase.

        * css/parser/CSSPropertyParser.cpp:
        (WebCore::parseGridTemplateAreasRow): Use isAllSpecialCharacters<isCSSSpace>,
        for the preflight, which matches what the actual parsing code uses.

        * dom/CharacterData.cpp:
        (WebCore::CharacterData::containsOnlyWhitespace const): Deleted. Callers can
        efficiently get at the data and do this kind of check on the data directly.
        * dom/CharacterData.h: Updated for the above.

        * dom/DataTransfer.cpp:
        (WebCore::normalizeType): Use startsWith since the string is already converted
        to ASCII lowercase.

        * dom/Position.cpp:
        (WebCore::Position::leadingWhitespacePosition const): Use isHTMLSpace since
        since the code is trying to check for collapsible HTML spaces, not general
        Unicode spaces. Other call sites of isSpaceOrNewline need to be checked for
        this, but I did not fix them all at this time.
        (WebCore::Position::trailingWhitespacePosition const): Ditto.

        * editing/Editor.cpp:
        (WebCore::Editor::editorUIUpdateTimerFired): Use noBreakSpace.

        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::debugRenderer const): Use text().length() instead
        of textLength.
        (WebCore::FrameSelection::selectionAtWordStart const): Use noBreakSpace.
        (WebCore::FrameSelection::wordSelectionContainingCaretSelection): Ditto.
        (WebCore::FrameSelection::actualSelectionAtSentenceStart const): Ditto.

        * editing/TextIterator.cpp:
        (WebCore::textNodeOffsetInFlow): Use text().length().
        (WebCore::TextIterator::handleTextNode): Ditto.
        (WebCore::collapsedSpaceLength): Updated since RenderText::text now returns
        a reference rather than a pointer.
        (WebCore::findPlainText): Added. Uses SearchBuffer to search for one string
        within another. Exported so accessibility code can do this operation.
        * editing/TextIterator.h: Updated for the above.

        * editing/TypingCommand.cpp:
        (WebCore::TypingCommand::markMisspellingsAfterTyping): Use noBreakSpace.

        * editing/VisibleUnits.cpp:
        (WebCore::findStartOfParagraph): Updated since RenderText::text now returns
        a reference.
        (WebCore::findEndOfParagraph): Ditto.

        * editing/cocoa/HTMLConverter.mm:
        (HTMLConverter::_processText): Use String::characterAt instead of String::at.
        Use capitalize instead of makeCapitalized.

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::stripMicrosoftPrefix): Use findIgnoringASCIICase.

        * html/Autofill.cpp:
        (WebCore::AutofillData::createFromHTMLFormControlElement): Use
        startsWithLettersIgnoringASCIICase.

        * html/BaseTextInputType.cpp:
        (WebCore::BaseTextInputType::patternMismatch const): Removed explicit
        TextCaseSensitive since it now is the default, and needed to touch this anyway
        because the enumeration is now in a different namespace.

        * html/EmailInputType.cpp:
        (WebCore::isValidEmailAddress): Updated to use JSC::Yarr::TextCaseInsensitive.

        * html/HTMLObjectElement.cpp:
        (WebCore::HTMLObjectElement::hasFallbackContent const): Use
        isAllSpecialCharacters<isHTMLSpace>.
        (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Use
        startsWithLettersIgnoringASCIICase.
        (WebCore::HTMLObjectElement::hasValidClassId): Use protocolIs.
        (WebCore::preventsParentObjectFromExposure): Use isAllSpecialCharacters<isHTMLSpace>.

        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::HTMLConstructionSite::setCompatibilityModeFromDoctype):
        Use startsWithLettersIgnoringASCIICase.

        * html/parser/HTMLMetaCharsetParser.cpp:
        (WebCore::extractCharset): Use findIgnoringASCIICase.

        * html/parser/XSSAuditor.cpp:
        (WebCore::XSSAuditor::isContainedInRequest): Use containsIgnoringASCIICase.

        * html/track/WebVTTParser.cpp:
        (WebCore::WebVTTParser::hasRequiredFileIdentifier): Don't pass the length to
        the String::startsWith function. There has never been a version of that function
        that takes the length, there is no need to pass the length since the function
        handles null-terminated strings like the one here, and in the past the length
        has been getting converted to a boolean making the comparison be case sensitive.
        Removing the argument entirely leaves it case sensitive.

        * inspector/InspectorNodeFinder.cpp:
        (WebCore::InspectorNodeFinder::matchesElement): Use startsWithIgnoringASCIICase
        and endsWithIgnoringASCIICase.

        * inspector/InspectorStyleSheet.cpp:
        (WebCore::selectorsFromSource): Use JSC::Yarr::TextCaseSensitive.

        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::containsOnlyHTMLWhitespace): Made this a non-member function
        and reimplemented using isAllSpecialCharacters<isHTMLSpace>().
        (WebCore::InspectorDOMAgent::innerFirstChild): Use containsOnlyHTMLWhitespace.
        (WebCore::InspectorDOMAgent::innerNextSibling): Ditto.
        (WebCore::InspectorDOMAgent::innerPreviousSibling): Ditto.
        (WebCore::InspectorDOMAgent::innerChildNodeCount): Ditto.
        (WebCore::InspectorDOMAgent::didInsertDOMNode): Ditto.
        (WebCore::InspectorDOMAgent::didRemoveDOMNode): Ditto.
        * inspector/agents/InspectorDOMAgent.h: Updated for above change.

        * loader/appcache/ApplicationCacheStorage.cpp:
        (WebCore::ApplicationCacheStorage::shouldStoreResourceAsFlatFile):
        Use startsWithLettersIgnoringASCIICase.

        * page/Base64Utilities.cpp:
        (WebCore::Base64Utilities::btoa): Use isAllLatin1.

        * page/Frame.cpp:
        (WebCore::createRegExpForLabels): Removed TextCaseSensitive argument since
        that is now the default and also used JSC::Yarr::TextCaseInsensitive.
        (WebCore::matchLabelsAgainstString): More of the same.

        * page/FrameView.cpp:
        (WebCore::countRenderedCharactersInRenderObjectWithThreshold): Use
        text().length().

        * page/SecurityOrigin.cpp:
        (WebCore::isFeedWithNestedProtocolInHTTPFamily): Use
        startsWithLettersIgnoringASCIICase.

        * page/UserContentURLPattern.cpp:
        (WebCore::UserContentURLPattern::matchesHost const):
        Use endsWithIgnoringASCIICase.
        * page/csp/ContentSecurityPolicySource.cpp:
        (WebCore::ContentSecurityPolicySource::hostMatches const): Ditto.

        * page/csp/ContentSecurityPolicySourceList.cpp:
        (WebCore::ContentSecurityPolicySourceList::parseNonceSource):
        Use startsWithIgnoringASCIICase.

        * page/ios/FrameIOS.mm:
        (WebCore::Frame::wordsInCurrentParagraph const): Use noBreakSpace.

        * platform/ContentType.cpp:
        (WebCore::ContentType::parameter const): Use findIgnoringASCIICase.

        * platform/MIMETypeRegistry.cpp:
        (WebCore::MIMETypeRegistry::isSupportedFontMIMEType): Use
        startsWithLettersIgnoringASCIICase.
        (WebCore::MIMETypeRegistry::isSupportedJSONMIMEType): Use
        mimeType.endsWithIgnoringASCIICase.
        (WebCore::MIMETypeRegistry::isTextMIMEType): Use
        startsWithLettersIgnoringASCIICase.
        (WebCore::MIMETypeRegistry::isXMLMIMEType): Use endsWithIgnoringASCIICase.
        (WebCore::MIMETypeRegistry::isJavaAppletMIMEType): Use
        startsWithLettersIgnoringASCIICase.
        (WebCore::MIMETypeRegistry::canShowMIMEType): Ditto.

        * platform/URL.cpp:
        (WebCore::isAllASCII): Renamed from containsOnlyASCII.
        (WebCore::appendEncodedHostname): Use isAllASCII.

        * platform/URLParser.cpp:
        (WebCore::containsOnlyASCII): Deleted.
        (WebCore::URLParser::domainToASCII): Use StringImpl::isAllASCII. Changed
        to take StringImpl& to guarantee we won't keep doing null checks since
        the caller already checks for null.
        (WebCore::URLParser::parseHostAndPort): Pass StringImpl&.
        * platform/URLParser.h: Updated for above.

        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::supportsType): Use endsWithIgnoringASCIICase
        and startsWithLettersIgnoringASCIICase.

        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
        (WebCore::validKeySystemRE): Use JSC::Yarr::TextCaseInsensitive.

        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::FontCache::similarFont): Use containsIgnoringASCIICase for
        the Geeza font special cases.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::shouldRejectMIMEType): Use startsWithLettersIgnoringASCIICase.

        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::getUnmangledInfoLog): Removed
        TextCaseSensitive since it now is the default.

        * platform/mac/PublicSuffixMac.mm:
        (WebCore::topPrivatelyControlledDomain): Use isAllASCII.

        * platform/mac/SSLKeyGeneratorMac.mm:
        (WebCore::signedPublicKeyAndChallengeString): Use isAllASCII.

        * platform/mac/StringUtilities.mm:
        (WebCore::stringMatchesWildcardString): Use JSC::Yarr::TextCaseInsensitive.

        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::addStringToSHA1): Use isAllASCII.

        * platform/network/CacheValidation.cpp:
        (WebCore::parseCacheControlDirectives): Use containsIgnoringASCIICase.

        * platform/network/HTTPParsers.cpp:
        (WebCore::parseHTTPRefresh): Use findIgnoringASCIICase.
        (WebCore::findCharsetInMediaType): Ditto.
        (WebCore::parseRange): Use startsWithLettersIgnoringASCIICase.

        * platform/network/curl/AuthenticationChallengeCurl.cpp:
        (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
        Use findIgnoringASCIICase.
        * platform/network/curl/MultipartHandle.cpp:
        (WebCore::MultipartHandle::extractBoundary): Ditto.
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::handleDataURL): Use
        endsWithIgnoringASCIICase.
        * platform/network/curl/ResourceResponseCurl.cpp:
        (WebCore::ResourceResponse::isAppendableHeader): Use
        startsWithLettersIgnoringASCIICase.
        (WebCore::ResourceResponse::appendHTTPHeaderField): Ditto.

        * platform/win/ClipboardUtilitiesWin.cpp:
        (WebCore::extractMarkupFromCFHTML): Use findIgnoringASCIICase.
        (WebCore::fragmentFromCFHTML): Ditto.

        * rendering/BidiRun.cpp:
        (WebCore::BidiRun::BidiRun): Use text().length().
        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::absolutePDFURL const): Use
        endsWithIgnoringASCIICase.
        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection): Use text().length().
        * rendering/InlineIterator.h:
        (WebCore::InlineIterator::fastIncrementInTextNode): Ditto.
        (WebCore::InlineIterator::increment): Dtto.
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::isLineBreak const): Updated since RenderText::text
        now returns a StringImpl&.
        (WebCore::InlineTextBox::selectionStartEnd const): Use text().length().
        (WebCore::InlineTextBox::text const): Updated since RenderText::text
        now returns a StringImpl&.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::constructTextRun): Use text().length().
        * rendering/RenderBlockFlow.cpp:
        (WebCore::isVisibleRenderText): Use isAllSpecialCharacters<isHTMLSpace>().
        (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
        Use the new trimmedPreferredWidths that returns a structure instead of the
        old one with lots of arguments. Also use text().length().
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::endsWithHTMLSpaces): Renamed and changed to use isHTMLSpace
        instead of isASCIISpace.
        (WebCore::reachedEndOfTextRenderer): Use endsWithHTMLSpaces.
        (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
        Updated for hcanges to RenderText.
        (WebCore::RenderBlockFlow::handleTrailingSpaces): Ditto.
        (WebCore::RenderBlockFlow::determineStartPosition): Ditto.

        * rendering/RenderCombineText.cpp:
        (WebCore::RenderCombineText::combineTextIfNeeded): Use
        isAllSpecialCharacters<isHTMLSpace>.
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::calculateClipRects const): Ditto.

        * rendering/RenderListBox.cpp:
        (WebCore::bolder): Added. Helper function.
        (WebCore::RenderListBox::updateFromElement): Rewrote to
        only compute the bolder font once rather than for every item.
        (WebCore::RenderListBox::paintItemForeground): Updated for
        change to applyTextTransform.

        * rendering/RenderMenuList.cpp:
        (WebCore::RenderMenuList::adjustInnerStyle): Updated for change
        to RenderText::text.
        (RenderMenuList::updateOptionsWidth): Updated for change to
        applyTextTransform.
        (RenderMenuList::itemText const): Ditto.

        * rendering/RenderText.cpp:
        (WebCore::capitalize): Renamed from makeCapitalized. Changed to
        take and return a String instead of taking a String*.
        (WebCore::RenderText::RenderText): Use isAllASCII. Also moved
        initialization of most non-bitfield members to the class definition.
        (WebCore::RenderText::positionForPoint): Use text().
        (WebCore::RenderText::widthFromCache const): Ditto.
        (WebCore::RenderText::hangablePunctuationStartWidth const): Ditto.
        (WebCore::RenderText::hangablePunctuationEndWidth const): Ditto.
        (WebCore::RenderText::isHangableStopOrComma): Ditto.
        (WebCore::RenderText::firstCharacterIndexStrippingSpaces const): Ditto.
        (WebCore::RenderText::lastCharacterIndexStrippingSpaces const): Ditto.
        (WebCore::RenderText::trimmedPreferredWidths): Changed to return values
        in a structure instead of taking lots of arguments.
        (WebCore::RenderText::computePreferredLogicalWidths): Updated to use
        the text() function.
        (WebCore::isAllCollapsibleWhitespace): Added.
        (WebCore::RenderText::isAllCollapsibleWhitespace const): Updated to
        use a tighter loop.
        (WebCore::isAllPossiblyCollapsibleWhitespace): Added.
        (WebCore::RenderText::containsOnlyHTMLWhitespace const): Updated to
        use a tighter loop. Renamed from containsOnlyWhitespace.
        (WebCore::RenderText::setTextWithOffset): Updated to  use text().
        (WebCore::isInlineFlowOrEmptyText): Rewrote to be easier to read.
        (WebCore::RenderText::previousCharacter const): Got rid of unneeded
        null check and simplified.
        (WebCore::applyTextTransform): Changed to return a String rather
        than modifying one that is passed in.
        (WebCore::RenderText::setRenderedText): Updated use of applyTextTransform.
        (WebCore::RenderText::secureText): More of the same.
        (WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const): Ditto.
        (WebCore::RenderText::textWithoutConvertingBackslashToYenSymbol const): Ditto.
        (WebCore::RenderText::width const): Ditto.
        (WebCore::RenderText::collectSelectionRectsForLineBoxes): Ditto.
        (WebCore::RenderText::previousOffset const): Ditto.
        (WebCore::RenderText::previousOffsetForBackwardDeletion const): Ditto.
        (WebCore::RenderText::nextOffset const): Ditto.
        (WebCore::RenderText::computeCanUseSimpleFontCodePath const): Ditto.
        (WebCore::RenderText::stringView const): Ditto.

        * rendering/RenderText.h: Made some more members private and final.
        Updated for above, including adding the Widths structure. Got rid of the
        textLength function, which existed as a workaround before we could mark
        a function like length final. Made the text function return a StringImpl&,
        which is good since the m_text string is never null, and so callers end
        up using StringImpl directly and saving null checks. Removed functions
        that are not needed, including is8Bit, characters8, characters16,
        uncheckedCharacterAt, operator[], and isAllASCII.

        * rendering/RenderTextFragment.cpp:
        (WebCore::RenderTextFragment::setText): Use text().length().
        * rendering/RenderTextLineBoxes.cpp:
        (WebCore::RenderTextLineBoxes::caretMaxOffset const): Ditto.
        (WebCore::RenderTextLineBoxes::positionForPoint const): Ditto.
        (WebCore::RenderTextLineBoxes::setSelectionState): Ditto.
        (WebCore::RenderTextLineBoxes::absoluteQuads const): Ditto.
        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::canUseForFontAndText): Ditto.
        * rendering/SimpleLineLayoutCoverage.cpp:
        (WebCore::SimpleLineLayout::textLengthForSubtree): Ditto.
        (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows): Ditto.
        * rendering/SimpleLineLayoutFlowContents.cpp:
        (WebCore::SimpleLineLayout::initializeSegments): Ditto.
        * rendering/SimpleLineLayoutFunctions.cpp:
        (WebCore::SimpleLineLayout::textOffsetForPoint): Ditto.
        * rendering/SimpleLineLayoutFunctions.h:
        (WebCore::SimpleLineLayout::findCaretMaximumOffset): Ditto.
        * rendering/line/BreakingContext.h:
        (WebCore::shouldAddBorderPaddingMargin): Ditto.
        (WebCore::shouldSkipWhitespaceAfterStartObject): Ditto.
        (WebCore::iteratorIsBeyondEndOfRenderCombineText): Ditto.
        (WebCore::textWidth): Ditto.
        (WebCore::BreakingContext::handleText): Ditto.
        (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Ditto.
        * rendering/line/TrailingObjects.cpp:
        (WebCore::TrailingObjects::updateWhitespaceCollapsingTransitionsForTrailingBoxes): Ditto.

        * rendering/mathml/RenderMathMLFenced.cpp:
        (WebCore::RenderMathMLFenced::updateFromElement): Removed stray use of "unsigned int".

        * rendering/svg/RenderSVGInlineText.cpp:
        (WebCore::RenderSVGInlineText::characterStartsNewTextChunk const): Use text().length().
        (WebCore::RenderSVGInlineText::positionForPoint): Ditto.
        * rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
        (WebCore::processRenderSVGInlineText): Ditto.
        * rendering/svg/SVGTextLayoutEngine.cpp:
        (WebCore::SVGTextLayoutEngine::currentLogicalCharacterAttributes): Ditto.
        * rendering/svg/SVGTextQuery.cpp:
        (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures const): Ditto.

        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateRenderTree): Use isAllSpecialCharacters<isHTMLSpace>.
        (WebCore::RenderTreeUpdater::textRendererIsNeeded): Ditto.

        * svg/SVGTests.cpp:
        (WebCore::SVGTests::hasFeatureForLegacyBindings): Use startsWithLettersIgnoringASCIICase.
        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::shouldAllowExternalLoad): Ditto.

2017-11-23  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Simplify CoordinatedGraphicsLayer's content buffer updates
        https://bugs.webkit.org/show_bug.cgi?id=179972

        Reviewed by Carlos Garcia Campos.

        During layer flushes, when a CoordinatedGraphicsLayer's tiled backing store
        has dirty tiles that need to be updated, the following chain of calls would
        be invoked to perform the painting, starting in
        CoordinatedGraphicsLayer::updateContentBuffers():
        |- CoordinatedGraphicsLayer::updateContentBuffers()
         |- TiledBackingStore::updateTileBuffers()
          |- Tile::updateBackBuffer()
           |- CoordinatedGraphicsLayer::paintToSurface()
            |- CompositingCoordinator::paintToSurface()
             |- UpdateAtlas::paintOnAvailableBuffer()
              |- ThreadSafeCoordinatedSurface::paintToSurface()
               |- Tile::paintToSurfaceContext()
                |- CoordinatedGraphicsLayer::tiledBackingStorePaint()
                 |- GraphicsLayer::paintGraphicsLayerContents()

        That's a bit much.

        In CoordinatedGraphicsLayer::updateContentBuffers(), we now first retrieve
        all the dirty layers in our TiledBackingStore. We then iterate through them,
        first establishing their ID and then retrieving an available CoordinatedBuffer
        that we can use for painting. The CoordinatedBuffer is retrieved through
        CompositingCoordinator, which is still caching these buffers via UpdateAtlas
        objects.

        With a CoordinatedBuffer available, we can then proceed with painting. The
        painting context has to be properly set up to paint into the correct area of
        the given buffer, and the alpha channel, if necessary, has to be addressed.
        After properly positioning and scaling ourselves on the given context, we
        can proceed with the GraphicsLayer::paintGraphicsLayerContents() call.

        What's left is filling out the missing SurfaceUpdateInfo information which is
        then passed to the updateTile() method that properly registers the tile
        update we've just performed. The tile itself is marked clean. After the
        iteration, we call the didUpdateTileBuffers() method in case any successful
        tile update was indeed performed, incrementing the repaint counter.

        That's it -- we clipped 8 calls from the call chain. We can now also remove
        the CoordinatedBuffer::Client interface, as well as slim down the
        TiledBackingStore interface. The Tile class is cleaned up a bit, with methods
        shifted into a more sensible order.

        No new tests -- no change in functionality.

        * platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp:
        * platform/graphics/texmap/coordinated/CoordinatedBuffer.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
        (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
        (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaint): Deleted.
        (WebCore::CoordinatedGraphicsLayer::paintToSurface): Deleted.
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
        * platform/graphics/texmap/coordinated/Tile.cpp:
        (WebCore::Tile::ensureTileID):
        (WebCore::Tile::isDirty const):
        (WebCore::Tile::invalidate):
        (WebCore::Tile::markClean):
        (WebCore::Tile::updateBackBuffer): Deleted.
        (WebCore::Tile::paintToSurfaceContext): Deleted.
        * platform/graphics/texmap/coordinated/Tile.h:
        (WebCore::Tile::tileID const):
        (WebCore::Tile::dirtyRect const):
        * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
        (WebCore::TiledBackingStore::dirtyTiles):
        (WebCore::TiledBackingStore::updateTileBuffers): Deleted.
        * platform/graphics/texmap/coordinated/TiledBackingStore.h:
        * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:

2017-11-23  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Remove relay CoordinatedBuffer::Client implementations
        https://bugs.webkit.org/show_bug.cgi?id=179970

        Reviewed by Carlos Garcia Campos.

        Drop CoordinatedBuffer::painToSurface() in favor of a simpler
        GraphicsContext reference getter that returns a reference to the
        GraphicsContext object of the internal ImageBuffer.

        Remove the ImageBackingSurfaceClient class that only acted as a relay
        that enabled a CoordinatedBuffer to draw an image through its context.
        Instead, we use the GraphicsContext of the allocated CoordinatedBuffer
        to draw the image directly. We still use a rectangle whose size
        matches the size of the given Image as the clipping area and as the
        source and destination rectangle for the image.

        No new tests -- no change in behavior.

        * platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp:
        (WebCore::CoordinatedBuffer::context):
        (WebCore::CoordinatedBuffer::paintToSurface): Deleted.
        * platform/graphics/texmap/coordinated/CoordinatedBuffer.h:
        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
        (WebCore::CoordinatedImageBacking::update):
        (WebCore::ImageBackingSurfaceClient::ImageBackingSurfaceClient): Deleted.

2017-11-23  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] TiledBackingStore: use a reference to the client
        https://bugs.webkit.org/show_bug.cgi?id=179969

        Reviewed by Carlos Garcia Campos.

        TiledBackingStore should keep a C++ reference to the TiledBackingStoreClient
        object, and not a pointer. client() method is updated to reflect that, and
        uses of this method and the member variable are updated accordingly.

        No new tests -- no change in behavior.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::createBackingStore):
        * platform/graphics/texmap/coordinated/Tile.cpp:
        (WebCore::Tile::~Tile):
        (WebCore::Tile::updateBackBuffer):
        (WebCore::Tile::paintToSurfaceContext):
        * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
        (WebCore::TiledBackingStore::TiledBackingStore):
        (WebCore::TiledBackingStore::updateTileBuffers):
        (WebCore::TiledBackingStore::createTiles):
        * platform/graphics/texmap/coordinated/TiledBackingStore.h:
        (WebCore::TiledBackingStore::client):

2017-11-23  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Early tile buffer update in TiledBackingStore::createTiles() is unnecessary
        https://bugs.webkit.org/show_bug.cgi?id=179968

        Reviewed by Carlos Garcia Campos.

        Under CoordinatedGraphicsLayer::updateContentBuffers(), the TiledBackingStore
        object has the createTilesIfNeeded() method invoked, if necessary. This
        invokes createTiles(), where the edge tiles are resized if necessary, and
        the missing tiles are created. If any of those two cases is fulfilled, the
        updateTileBuffers() method is invoked, updating any dirty tiles (i.e. the
        ones that were resized or newly-created).

        This specific invocation of updateTileBuffers() is not needed since it's the
        very next method that's invoked on the TiledBackingStore object by
        CoordinatedGraphicsLayer::updateContentBuffers(). It's therefore removed,
        and the resizeEdgeTiles() method is changed to not return any value.

        No new tests -- no change in behavior.

        * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
        (WebCore::TiledBackingStore::createTiles):
        (WebCore::TiledBackingStore::resizeEdgeTiles):
        * platform/graphics/texmap/coordinated/TiledBackingStore.h:

2017-11-23  Antti Koivisto  <antti@apple.com>

        RenderBlockFlow::layoutRunsAndFloatsInRange is O(n^2) for runs of inlines without any text
        https://bugs.webkit.org/show_bug.cgi?id=179950

        Reviewed by Simon Fraser.

        It calls createBidiRunsForLine for each line. createBidiRunsForLine traverses past the end of the line until
        it finds the end of the current bidi run. If there is no text in the flow, it never finds anything and traverses
        the entire flow. This is O(n^2) for the number of renderers in the flow.

        Tested by PerformanceTests/Layout/inline-layout-no-text.html

        * platform/text/BidiResolver.h:
        (WebCore::BidiResolverBase::needsContinuePastEnd const):
        (WebCore::BidiResolverBase::needsContinuePastEndInternal const):
        (WebCore::DerivedClass>::createBidiRunsForLine):

            When past end of line call needsContinuePastEnd() to see if we need to continue searching for the end of the bidi run.

        * rendering/InlineIterator.h:
        (WebCore::InlineBidiResolver::needsContinuePastEndInternal const):

            InlineBidiResolver only returns runs up to the last renderer on the line and can bail out.

2017-11-23  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Replace CoordinatedSurface, ThreadSafeCoordinatedSurface with CoordinatedBuffer
        https://bugs.webkit.org/show_bug.cgi?id=179967

        Reviewed by Carlos Garcia Campos.

        Roll the CoordinatedSurface and ThreadSafeCoordinatedSurface classes
        into one CoordinatedBuffer class.

        CoordinatedBuffer class mimics CoordinatedSurface in providing the
        Client class that allows specifying how the client should paint using a
        GraphicsContext object. supportsAlpha() and size() methods are also
        present, as well as paintToSurface(). uploadImage() retrieves the
        Image that's created from the contained ImageBuffer, allowing the user
        to then manually upload the buffer data onto the GPU.

        CoordinatedBuffer otherwise serves as a drop-in replacement for the
        CoordinatedSurface class, and the remaining changes in the
        CoordiantedGraphics code reflect that.

        No new tests -- no change in behavior.

        * platform/TextureMapper.cmake:
        * platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp: Added.
        (WebCore::CoordinatedBuffer::create):
        (WebCore::CoordinatedBuffer::CoordinatedBuffer):
        (WebCore::CoordinatedBuffer::paintToSurface):
        (WebCore::CoordinatedBuffer::uploadImage):
        * platform/graphics/texmap/coordinated/CoordinatedBuffer.h: Added.
        (WebCore::CoordinatedBuffer::supportsAlpha const):
        (WebCore::CoordinatedBuffer::size const):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::paintToSurface):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
        (WebCore::CoordinatedImageBacking::update):
        (WebCore::CoordinatedImageBacking::releaseSurfaceIfNeeded):
        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
        * platform/graphics/texmap/coordinated/CoordinatedSurface.cpp: Removed.
        * platform/graphics/texmap/coordinated/CoordinatedSurface.h: Removed.
        * platform/graphics/texmap/coordinated/Tile.h:
        * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:

2017-11-22  Simon Fraser  <simon.fraser@apple.com>

        FEComponentTransfer cleanup and optimization
        https://bugs.webkit.org/show_bug.cgi?id=179952

        Reviewed by Darin Adler.

        Change terminology for FEComponentTransfer to be more explicit about the fact
        that it's creating and using lookup tables. Use std::array for the lookup tables.
        
        Use uint8_t instead of unsigned char.
        
        Avoid confusing arrays for channels in computeLookupTables; just setup the lut for
        each channel manually.
        
        This is about 1.25x faster than before.

        * platform/graphics/filters/FEComponentTransfer.cpp:
        (WebCore::FEComponentTransfer::computeIdentityTable):
        (WebCore::FEComponentTransfer::computeTabularTable):
        (WebCore::FEComponentTransfer::computeDiscreteTable):
        (WebCore::FEComponentTransfer::computeLinearTable):
        (WebCore::FEComponentTransfer::computeGammaTable):
        (WebCore::FEComponentTransfer::platformApplySoftware):
        (WebCore::FEComponentTransfer::computeLookupTables):
        (WebCore::operator<<):
        (WebCore::identity): Deleted.
        (WebCore::table): Deleted.
        (WebCore::discrete): Deleted.
        (WebCore::linear): Deleted.
        (WebCore::gamma): Deleted.
        (WebCore::FEComponentTransfer::getValues): Deleted.
        * platform/graphics/filters/FEComponentTransfer.h:
        (WebCore::ComponentTransferFunction::ComponentTransferFunction): Deleted.

2017-11-22  Javier Fernandez  <jfernandez@igalia.com>

        [css-grid] Refactoring and new namespace with grid related utility functions
        https://bugs.webkit.org/show_bug.cgi?id=179633

        Reviewed by Darin Adler.

        Added a new namespace with several utility functions to share logic
        between RenderGrid and GridTrackSizingAlgorithm.

        No new tests, since no new functionality is added.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * rendering/GridLayoutUtils.cpp: Added.
        (WebCore::GridLayoutUtils::computeMarginLogicalSizeForChild):
        (WebCore::GridLayoutUtils::marginLogicalSizeForChild):
        (WebCore::GridLayoutUtils::isOrthogonalChild):
        (WebCore::GridLayoutUtils::flowAwareDirectionForChild):
        * rendering/GridLayoutUtils.h: Added.
        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild const):
        (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
        (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
        (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
        (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
        (WebCore::DefiniteSizeStrategy::minLogicalWidthForChild const):
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::layoutBlock):
        (WebCore::RenderGrid::placeItemsOnGrid const):
        (WebCore::RenderGrid::layoutPositionedObject):
        (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching const):
        (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
        (WebCore::RenderGrid::isInlineBaselineAlignedChild const):
        (WebCore::RenderGrid::firstLineBaseline const):
        (WebCore::RenderGrid::columnAxisPositionForChild const):
        (WebCore::RenderGrid::rowAxisPositionForChild const):
        (WebCore::RenderGrid::columnAxisOffsetForChild const):
        (WebCore::RenderGrid::rowAxisOffsetForChild const):
        (WebCore::RenderGrid::findChildLogicalPosition const):

2017-11-22  Ali Juma  <ajuma@chromium.org>

        Implement VisualViewport API attributes
        https://bugs.webkit.org/show_bug.cgi?id=179385

        Reviewed by Frédéric Wang.

        Add a visualViewport attribute to Window, and implement the VisualViewport
        interface (https://wicg.github.io/visual-viewport/#the-visualviewport-interface).

        This is behind a newly-added VisualViewportAPI experimental feature flag.

        Tests: fast/visual-viewport/viewport-dimensions-exclude-custom-scrollbars.html
               fast/visual-viewport/viewport-dimensions-exclude-scrollbars.html
               fast/visual-viewport/viewport-dimensions-iframe.html
               fast/visual-viewport/viewport-dimensions-under-page-zoom.html
               fast/visual-viewport/viewport-dimensions.html

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/WebCoreBuiltinNames.h:
        * dom/EventTargetFactory.in:
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::~DOMWindow):
        (WebCore::DOMWindow::resetDOMWindowProperties):
        (WebCore::DOMWindow::visualViewport const):
        * page/DOMWindow.h:
        * page/DOMWindow.idl:
        * page/Settings.yaml:
        * page/VisualViewport.cpp: Added.
        (WebCore::VisualViewport::VisualViewport):
        (WebCore::VisualViewport::eventTargetInterface const):
        (WebCore::VisualViewport::scriptExecutionContext const):
        (WebCore::getFrameViewAndLayoutIfNonNull):
        (WebCore::VisualViewport::offsetLeft const):
        (WebCore::VisualViewport::offsetTop const):
        (WebCore::VisualViewport::pageLeft const):
        (WebCore::VisualViewport::pageTop const):
        (WebCore::VisualViewport::width const):
        (WebCore::VisualViewport::height const):
        (WebCore::VisualViewport::scale const):
        * page/VisualViewport.h: Added.
        * page/VisualViewport.idl: Added.

2017-11-22  Manuel Rego Casasnovas  <rego@igalia.com>

        Available height is wrong for positioned elements with "box-sizing: border-box"
        https://bugs.webkit.org/show_bug.cgi?id=178783

        Reviewed by Darin Adler.

        These methods were returning a wrong value for positioned items
        in combination with "box-sizing: border-box".
        The problem was that if the height of the element is given
        by its offset properties (top and bottom) we don't need to call
        adjustContentBoxLogicalHeightForBoxSizing().

        Tests: fast/box-sizing/fill-available.html
               fast/box-sizing/replaced.html

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
        (WebCore::RenderBox::availableLogicalHeightUsing const):

2017-11-22  Christopher Reid  <chris.reid@sony.com>

        WebCoreObjCExtras.h is being included in too many places
        https://bugs.webkit.org/show_bug.cgi?id=179931

        Reviewed by Darin Adler.

        No new tests no change in behavior.

        Fixing cases where WebCoreObjCExtras.h is imported but not used.

        * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        * platform/mac/WebCoreNSURLExtras.mm:

2017-11-22  Antoine Quint  <graouts@apple.com>

        [Web Animations] Adopt KeyframeList in KeyframeEffect
        https://bugs.webkit.org/show_bug.cgi?id=179941
        <rdar://problem/35666924>

        Reviewed by Darin Adler.

        KeyframeEffect used to model its keyframes by creating a new Keyframe struct and storing them in a Vector<Keyframe>.
        However, there already is a way to model keyframes in WebCore using the KeyframeList class. We now adopt this class
        in KeyframeEffect, which makes it possible to run hardware-composited animations using RenderBoxModelObject::startAnimation()
        in a follow-up patch, since this function expects a KeyframeList.

        No news tests, this is an internals change and does not yield any changes in Web content.

        * animation/KeyframeEffect.cpp:
        (WebCore::KeyframeEffect::KeyframeEffect): Create a default m_keyframes at construction time.
        (WebCore::KeyframeEffect::processKeyframes): Create a temporary KeyframeList as we parse keyframes passed from the JS API
        and assign it to m_keyframes upon successful parsing. We also use cssPropertyId to refer to a CSSPropertyID to make the code
        clearer and ensure there is no confusion with JS properties that we manipulate in this function.
        (WebCore::KeyframeEffect::computeStackingContextImpact): Use the list of CSS properties exposed on KeyframeList directly rather
        than enumerating each keyframe and use cssPropertyId to refer to individual CSSPropertyID values for consistency.
        (WebCore::KeyframeEffect::applyAtLocalTime): Use the list of CSS properties exposed on KeyframeList directly rather than
        using the properties specified on the first keyframe only. We also remove a stale FIXME comment which was addressed in r224957.
        * animation/KeyframeEffect.h: Remove the Keyframe struct and change the type of m_keyframes from Vector<Keyframe> to KeyframeList.
        * rendering/style/KeyframeList.h:
        (WebCore::KeyframeList::KeyframeList): We remove the default insertions at KeyframeList construction time since it requires
        an immediate call to clear() when doing any meaningful work with a KeyframeList. We also add the default move assignment operator
        to allow KeyframeEffect::processKeyframes() to make a move assignment from the temporary keyframe list we build at parsing to the
        member variable.

2017-11-22  Commit Queue  <commit-queue@webkit.org>

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

        Compilation failed on WinCairo 64-bit Release (Requested by
        fredw on #webkit).

        Reverted changeset:

        "Implement VisualViewport API attributes"
        https://bugs.webkit.org/show_bug.cgi?id=179385
        https://trac.webkit.org/changeset/225093

2017-11-21  Ali Juma  <ajuma@chromium.org>

        Implement VisualViewport API attributes
        https://bugs.webkit.org/show_bug.cgi?id=179385

        Reviewed by Frédéric Wang.

        Add a visualViewport attribute to Window, and implement the VisualViewport
        interface (https://wicg.github.io/visual-viewport/#the-visualviewport-interface).

        This is behind a newly-added VisualViewportAPI experimental feature flag.

        Tests: fast/visual-viewport/viewport-dimensions-exclude-custom-scrollbars.html
               fast/visual-viewport/viewport-dimensions-exclude-scrollbars.html
               fast/visual-viewport/viewport-dimensions-iframe.html
               fast/visual-viewport/viewport-dimensions-under-page-zoom.html
               fast/visual-viewport/viewport-dimensions.html

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/WebCoreBuiltinNames.h:
        * dom/EventTargetFactory.in:
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::~DOMWindow):
        (WebCore::DOMWindow::resetDOMWindowProperties):
        (WebCore::DOMWindow::visualViewport const):
        * page/DOMWindow.h:
        * page/DOMWindow.idl:
        * page/Settings.yaml:
        * page/VisualViewport.cpp: Added.
        (WebCore::VisualViewport::VisualViewport):
        (WebCore::VisualViewport::eventTargetInterface const):
        (WebCore::VisualViewport::scriptExecutionContext const):
        (WebCore::getFrameViewAndLayoutIfNonNull):
        (WebCore::VisualViewport::offsetLeft const):
        (WebCore::VisualViewport::offsetTop const):
        (WebCore::VisualViewport::pageLeft const):
        (WebCore::VisualViewport::pageTop const):
        (WebCore::VisualViewport::width const):
        (WebCore::VisualViewport::height const):
        (WebCore::VisualViewport::scale const):
        * page/VisualViewport.h: Added.
        * page/VisualViewport.idl: Added.

2017-11-21  Frederic Wang  <fwang@igalia.com>

        Async frame scrolling: handle fixed root backgrounds in frames
        https://bugs.webkit.org/show_bug.cgi?id=176261

        Based on patch by Simon Fraser <simon.fraser@apple.com>
        Reviewed by Antonio Gomes.

        For frames with tiled backing, we register a slow-repaint object because we hit
        RenderElement::styleWillChange() before we've made a backing for the iframe's RenderView so
        view().compositor().supportsFixedRootBackgroundCompositing() returns false. This patch
        ensures that this object is removed when setBackgroundLayerPaintsFixedRootBackground is
        called. It also removes the opaque background of non-main frames with tiled backing.
        This fixes a possible hit of ASSERT(!m_backgroundLayer) after r221615.

        Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html

        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateGeometry): Do not set opaque contents for frames with
        tiled backing. We keep !m_isMainFrameRenderViewLayer for backward compatibility with WK1.
        (WebCore::RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground): Add an early
        return when m_backgroundLayerPaintsFixedRootBackground is not changed. Remove the slow
        repaint object previously registered for this frame. Also add an ASSERT to ensure that a
        fixed root background is only set for frames with async scrolling.
        (WebCore::RenderLayerBacking::updateRootLayerConfiguration): Restrict some special handling
        of background and opaqueness to the main frame.

2017-11-21  Zan Dobersek  <zdobersek@igalia.com>

        Drop ENABLE_IMAGE_DECODER_DOWN_SAMPLING code
        https://bugs.webkit.org/show_bug.cgi?id=179921

        Reviewed by Carlos Garcia Campos.

        Drop the ENABLE_IMAGE_DECODER_DOWN_SAMPLING code, along with the build
        guard definitions in WTF and CMake.

        This was apparently in use in the Qt port, but since then no port
        enables this. It's not exposed in the Xcode build, and the CMake option
        is disabled by default, with no way to enable it through build-webkit.

        While the code guarded with this build guard is removed, there's still
        code in the ScalableImageDecoder class that only operated when this
        feature was enabled. This should be addressed in the future, after
        evaluating the need for this scaling capability.

        No new tests -- no change in behavior.

        * platform/graphics/Image.cpp:
        (WebCore::Image::adjustSourceRectForDownSampling const): Deleted.
        * platform/graphics/Image.h:
        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::drawNativeImage):
        * platform/image-decoders/ScalableImageDecoder.h:
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageReader::decode):
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::rowAvailable):
        (WebCore::PNGImageDecoder::frameComplete):

2017-11-21  Commit Queue  <commit-queue@webkit.org>

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

        This patch caused compilation failures (Requested by fredw on
        #webkit).

        Reverted changeset:

        "Async frame scrolling: handle fixed root backgrounds in
        frames"
        https://bugs.webkit.org/show_bug.cgi?id=176261
        https://trac.webkit.org/changeset/225089

2017-11-21  Frederic Wang  <fwang@igalia.com>

        Async frame scrolling: handle fixed root backgrounds in frames
        https://bugs.webkit.org/show_bug.cgi?id=176261

        Based on patch by Simon Fraser <simon.fraser@apple.com>
        Reviewed by Antonio Gomes.

        For frames with tiled backing, we register a slow-repaint object because we hit
        RenderElement::styleWillChange() before we've made a backing for the iframe's RenderView so
        view().compositor().supportsFixedRootBackgroundCompositing() returns false. This patch
        ensures that this object is removed when setBackgroundLayerPaintsFixedRootBackground is
        called. It also removes the opaque background of non-main frames with tiled backing.
        This fixes a possible hit of ASSERT(!m_backgroundLayer) after r221615.

        Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html

        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateGeometry): Do not set opaque contents for frames with
        tiled backing. We keep !m_isMainFrameRenderViewLayer for backward compatibility with WK1.
        (WebCore::RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground): Add an early
        return when m_backgroundLayerPaintsFixedRootBackground is not changed. Remove the slow
        repaint object previously registered for this frame. Also add an ASSERT to ensure that a
        fixed root background is only set for frames with async scrolling.
        (WebCore::RenderLayerBacking::updateRootLayerConfiguration): Restrict some special handling
        of background and opaqueness to the main frame.

2017-11-21  Simon Fraser  <simon.fraser@apple.com>

        Some FELighting cleanup
        https://bugs.webkit.org/show_bug.cgi?id=179924

        Reviewed by Sam Weinig.

        Make the normal-computation functions const and have them return an IntSize.
        Replace bit shifting with multiply by two (compilers know how to do this, folks).

        * platform/graphics/filters/FELighting.cpp:
        (WebCore::FELighting::LightingData::topLeftNormal const):
        (WebCore::FELighting::LightingData::topRowNormal const):
        (WebCore::FELighting::LightingData::topRightNormal const):
        (WebCore::FELighting::LightingData::leftColumnNormal const):
        (WebCore::FELighting::LightingData::interiorNormal const):
        (WebCore::FELighting::LightingData::rightColumnNormal const):
        (WebCore::FELighting::LightingData::bottomLeftNormal const):
        (WebCore::FELighting::LightingData::bottomRowNormal const):
        (WebCore::FELighting::LightingData::bottomRightNormal const):
        (WebCore::FELighting::inlineSetPixel):
        (WebCore::FELighting::setPixel):
        (WebCore::FELighting::platformApplyGenericPaint):
        (WebCore::FELighting::drawLighting):
        (WebCore::FELighting::LightingData::topLeft): Deleted.
        (WebCore::FELighting::LightingData::topRow): Deleted.
        (WebCore::FELighting::LightingData::topRight): Deleted.
        (WebCore::FELighting::LightingData::leftColumn): Deleted.
        (WebCore::FELighting::LightingData::interior): Deleted.
        (WebCore::FELighting::LightingData::rightColumn): Deleted.
        (WebCore::FELighting::LightingData::bottomLeft): Deleted.
        (WebCore::FELighting::LightingData::bottomRow): Deleted.
        (WebCore::FELighting::LightingData::bottomRight): Deleted.
        * platform/graphics/filters/FELighting.h:

2017-11-21  Christopher Reid  <chris.reid@sony.com>

        [PAL] Remove FileSystem's dependency on WebCoreNSStringExtras
        https://bugs.webkit.org/show_bug.cgi?id=179504

        Reviewed by Darin Adler.

        No new tests no change in behavior.

        Removed WebCoreNSStringExtras.
        Replaced calls to string helpers in WebCoreNSStringExtras with calls to WTF::String.
        Moved filenameByFixingIllegalCharacters into LoaderNSURLExtras.
        Moved preferredBundleLocalizationName into WebKitLegacy.

        * PlatformMac.cmake: Removed WebCoreNSStringExtras.mm
        * SourcesCocoa.txt: Removed WebCoreNSStringExtras.mm
        * WebCore.xcodeproj/project.pbxproj: Removed WebCoreNSStringExtras
        * loader/mac/LoaderNSURLExtras.h:
        * loader/mac/LoaderNSURLExtras.mm:
        * platform/graphics/mac/FontCacheMac.mm:
        * platform/mac/PasteboardMac.mm:
        * platform/mac/WebCoreNSURLExtras.mm:

2017-11-21  Simon Fraser  <simon.fraser@apple.com>

        Use vImage to do alpha premultiplication/unpremultiplication in FilterEffect
        https://bugs.webkit.org/show_bug.cgi?id=179928

        Reviewed by Tim Horton.

        The vImage functions are about twice as fast as the existing code.

        * platform/graphics/filters/FilterEffect.cpp:
        (WebCore::copyPremultiplyingAlpha):
        (WebCore::copyUnpremultiplyingAlpha):
        (WebCore::FilterEffect::copyUnmultipliedImage):
        (WebCore::FilterEffect::copyPremultipliedImage):

2017-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GLIB] Test FileMonitorTest.DetectChangeAndThenDelete sometimes crashes
        https://bugs.webkit.org/show_bug.cgi?id=179909

        Reviewed by Michael Catanzaro.

        The problem sems to be that the GFileMonitor is created in the main thread, but destroyed in the WorkQueue
        thread. We can create the monitor in the WorkQueue thread and do the monitoring there.

        Fixes unit test FileMonitorTest.DetectChangeAndThenDelete.

        * platform/glib/FileMonitorGLib.cpp:
        (WebCore::FileMonitor::FileMonitor): Create the GFileMonitor in the WorkQueue.
        (WebCore::FileMonitor::didChange): No need to dispatch the handler in the WorkQueue, since this is now called in
        the WorkQueue.

2017-11-21  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] drawNativeImage(), drawPattern() in CairoOperations should operate directly with cairo_surface_t objects
        https://bugs.webkit.org/show_bug.cgi?id=179888

        Reviewed by Carlos Garcia Campos.

        Cairo::drawNativeImage() should receive a valid cairo_surface_t pointer
        and work with that, instead of using a NativeImagePtr. Callers are thus
        forced to pass the pointer into the drawNativeImage() call, and the
        CairoOperations implementation file drops the need to know about the
        NativeImagePtr type alias.

        Cairo::drawPattern() now accepts pointer to the cairo_surface_t object,
        along with an IntSize object that descibes the surface's size. This way
        it's up to the caller to retrieve any valid native image for the current
        frame and pass that to the drawPattern() call. The need to use IntSize
        here is strange, but we should investigate this later.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::drawNativeImage):
        (WebCore::Cairo::drawPattern):
        * platform/graphics/cairo/CairoOperations.h: Include the Cairo header.
        Also fix forward declaration of Cairo::drawGlyphs().
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::drawNativeImage):
        (WebCore::GraphicsContext::drawPattern):
        * platform/graphics/cairo/NativeImageCairo.cpp:
        (WebCore::drawNativeImage): Execute operation through GraphicsContext,
        kicking into effect any recording that could be done this way.

2017-11-21  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Gradient::fill() should only operate on PlatformContextCairo
        https://bugs.webkit.org/show_bug.cgi?id=179887

        Reviewed by Carlos Garcia Campos.

        In Gradient::fill(), directly invoke Cairo::save() and Cairo::restore(),
        instead of doing so indirectly through GraphicsContext::save() and
        GraphicsContext::restore(). The latter pair stashes the internal state
        that's managed in GraphicsContext, but that doesn't get modified at all
        in this case.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/GradientCairo.cpp:
        (WebCore::Gradient::fill):

2017-11-21  Frederic Wang  <fwang@igalia.com>

        Remove unintentionally committed .orig file.
        https://bugs.webkit.org/show_bug.cgi?id=174131

        Unreviewed, fix previous commit.

        * rendering/mathml/RenderMathMLScripts.cpp.orig: Removed.

2017-11-21  Frederic Wang  <fwang@igalia.com>

        ASSERTION FAILED: !needsLayout() in WebCore::RenderMathMLScripts::firstLineBaseline
        https://bugs.webkit.org/show_bug.cgi?id=174131

        Reviewed by Alejandro G. Castro.

        RenderMathMLScripts::firstLineBaseline() has an ASSERT at the beginning to ensure that the function
        is called after the element was laid out. However, this is not respected by HTML table layout as
        RenderBlock::firstLineBaseline() is called for elements in a table cell before they are laid out.
        This happens for example for RenderGrid::firstLineBaseline() and probably for other renderers.
        Additionally, RenderMathMLScripts::firstLineBaseline() only involves calling firstLineBaseline();
        logicalTop() or logicalHeight() on the first child box so it is safe to call it before layout, even
        if the return value might be wrong at that time. This patch removes this too restrictive ASSERT for
        RenderMathMLScripts, for consistency with other implementations of firstLineBaseline().

        Test: mathml/cells-and-scripts-crash.html

        * rendering/mathml/RenderMathMLScripts.cpp:
        (WebCore::RenderMathMLScripts::firstLineBaseline const): Remove the ASSERT.

2017-11-20  Mario Sanchez Prada  <mario@endlessm.com>

        [GTK] New API to add, retrieve and delete cookies via WebKitCookieManager
        https://bugs.webkit.org/show_bug.cgi?id=177932

        Reviewed by Carlos Garcia Campos.

        Implemented setCookie(), getCookies() and deleteCookie() in the Soup
        backend, and refactored some utility functions and conversions out of
        NetworkStorageSessionSoup into a new CookieSoup.cpp file, so
        that we now can convert between SoupCookie* and WebCore::Cookie
        easily from anywhere (this is now needed from the UI Process).

        * platform/Cookie.h: Add declarations for the new conversions.
        * platform/SourcesSoup.txt: Add CookieSoup.cpp.
        * platform/network/soup/CookieSoup.cpp: Added.
        (WebCore::Cookie::Cookie): New constructor, creates a WebCore::Cookie out of a SoupCookie*.
        (WebCore::msToSoupDate): Moved from NetworkStorageSessionSoup.cpp.
        (WebCore::Cookie::toSoupCookie): New, based on toSoupCookie() from NetworkStorageSessionSoup.cpp.
        * platform/network/soup/NetworkStorageSessionSoup.cpp:
        (WebCore::NetworkStorageSession::setCookies): Used the new implicit conversion.
        (WebCore::NetworkStorageSession::setCookie): Newly implemented.
        (WebCore::NetworkStorageSession::deleteCookie): Newly implemented.
        (WebCore::NetworkStorageSession::getCookies): Newly implemented.

2017-11-20  Zalan Bujtas  <zalan@apple.com>

        Remove slow repaint object from FrameView when style changes.
        https://bugs.webkit.org/show_bug.cgi?id=179871

        Reviewed by Antti Koivisto.

        The "oldStyleSlowScroll" value does not need to be computed. We already know its value
        by checking the HashSet. This code is also unnecessarily complicated and error prone
        (could lead to UAF errors by leaving stale renderers in the slow paint list).

        Test: fast/repaint/slow-repaint-object-crash.html

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::styleWillChange):

2017-11-20  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [WPE] GLContextEGLWPE.cpp:44:96: error: invalid cast from type ‘GLNativeWindowType {aka long long unsigned int}’ to type ‘EGLNativeWindowType {aka unsigned int}
        https://bugs.webkit.org/show_bug.cgi?id=179511

        Reviewed by Žan Doberšek.

        r217208 changed the definition of GLNativeWindowType from EGLNativeWindowType to uint64_t for platform WPE.
        This built fine on a 64-bit platform since uint64_t matches the size of a pointer, but fails on 32-bits.

        This switches back the definition to EGLNativeWindowType.
        And we need to include <EGL/eglplatform.h> first in order to get a definition for EGLNativeWindowType itself.

        This commit pretty much reverts the changes r217208 did on platform/graphics/GLContext.h

        No new tests, it is a build fix.

        * platform/graphics/GLContext.h:

2017-11-20  Michael Catanzaro  <mcatanzaro@igalia.com>

        Remove ENABLE_ALLINONE_BUILD option
        https://bugs.webkit.org/show_bug.cgi?id=179823

        Reviewed by Darin Adler.

        * CMakeLists.txt:

2017-11-20  Emilio Cobos Álvarez  <emilio@crisal.io>

        Incorrect computed style in pseudo-elements with display: contents
        https://bugs.webkit.org/show_bug.cgi?id=179812

        Reviewed by Antti Koivisto.

        Bug 178513 gave them an anon renderer as the main renderer. Unfortunately, the
        style of that box is exposed via getComputedStyle, so that needs to be handled
        somehow to return the correct style.

        Tests: imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::styledRenderer const):
          Don't return a display: contents pseudo anon box.
        * dom/Element.cpp:
        (WebCore::Element::hasDisplayContents const):
          Just look at the rare data style.
        (WebCore::Element::existingComputedStyle const):
          Look at the rare data first. This also fixes an inefficiency in the
          sense that before then we'd compare the anon box style to the
          pseudo-element style during style update, that may be more changes
          than needed.
        * style/RenderTreeUpdaterGeneratedContent.cpp:
        (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::resolvePseudoStyle):
          Move the anon box creation to render tree update instead of style
          resolution.

2017-11-19  Tim Horton  <timothy_horton@apple.com>

        Remove unused TOUCH_ICON_LOADING feature flag
        https://bugs.webkit.org/show_bug.cgi?id=179873

        Reviewed by Simon Fraser.

        * Configurations/FeatureDefines.xcconfig:

2017-11-19  Tim Horton  <timothy_horton@apple.com>

        Remove unused LEGACY_VENDOR_PREFIXES feature flag
        https://bugs.webkit.org/show_bug.cgi?id=179872

        Reviewed by Darin Adler.

        * Configurations/FeatureDefines.xcconfig:

2017-11-18  Darin Adler  <darin@apple.com>

        Eliminate some cases of double hashing, other related refactoring
        https://bugs.webkit.org/show_bug.cgi?id=179867

        Reviewed by Sam Weinig.

        * Modules/indexeddb/IDBTransaction.cpp:
        (WebCore::IDBTransaction::objectStore): Use get instead of find.

        * Modules/mediasource/MediaSourceRegistry.cpp:
        (WebCore::MediaSourceRegistry::unregisterURL): Use take instead of find/remove.

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::~AXObjectCache): Call setAXObjectID instead of
        using the removeAXID, which doesn't do anything else useful in the destructor.
        (WebCore::AXObjectCache::remove): Use take instead of get/remove. Also rearrange
        logic to eliminate the removeAXID function.
        (WebCore::AXObjectCache::removeAXID): Deleted. This only did two things,
        setAXObjectID(0) and remove from m_idsInUse, and was only called in one place
        besides the destructor. Clearer to not have this funtion.
        (WebCore::AXObjectCache::visiblePositionForTextMarkerData): Use m_idsInUse
        directly instead of using a function.

        * accessibility/AXObjectCache.h: Deleted removeAXID and isIDinUse.

        * dom/Document.cpp:
        (WebCore::Document::removedLastRef): Call UserActionElementSet::clear instead
        of UserActionElementSet::documentDidRemoveLastRef; new name fo the same function.
        (WebCore::Document::updateHoverActiveState): Use a reference when calling
        setInActiveChain.

        * dom/Element.cpp:
        (WebCore::Element::isUserActionElementInActiveChain const): Pass reference
        instead of pointer.
        (WebCore::Element::isUserActionElementActive const): Ditto.
        (WebCore::Element::isUserActionElementFocused const): Ditto.
        (WebCore::Element::isUserActionElementHovered const): Ditto.
        (WebCore::Element::setActive): Ditto.
        (WebCore::Element::setFocus): Ditto.
        (WebCore::Element::setHovered): Ditto.
        (WebCore::Element::clearHoverAndActiveStatusBeforeDetachingRenderer): Ditto.

        * dom/GenericEventQueue.cpp:
        (WebCore::GenericEventQueue::resume): Removed unneeded speical case for
        empty vector.

        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::checkStyleSheet): Updated now that
        parseAttributes returns an optional instead of using a boolean "OK" out argument.

        * dom/SelectorQuery.cpp:
        (WebCore::SelectorQueryCache::add): Use get instead of find.

        * dom/UserActionElementSet.cpp:
        (WebCore::UserActionElementSet::didDetach): Deleted. Moved to class definition and
        named clearActiveAndHovered.
        (WebCore::UserActionElementSet::clear): Renamed documentDidRemoveLastRef to clear.
        (WebCore::UserActionElementSet::hasFlag const): Renamed from hasFlags and also
        take reference and enumeration instead of pointer and unsigned. Makes it clearer
        this does not allow null and that it works on a single flag, not a set of flags.
        (WebCore::UserActionElementSet::clearFlags): Changed argument types to reference
        and OptionSet to make it clear this works on a set of flags.
        (WebCore::UserActionElementSet::setFlags): Ditto.

        * dom/UserActionElementSet.h: Updated for changes above. Also made some name
        changes, and used an enum class instead of an enum.

        * html/BaseCheckableInputType.cpp:
        (WebCore::BaseCheckableInputType::saveFormControlState const): Updated since
        FormControlState is now just a vector, not a class.
        * html/FileInputType.cpp:
        (WebCore::FileInputType::filesFromFormControlState): Ditto.
        (WebCore::FileInputType::restoreFormControlState): Removed unneeded check that
        valueSize is a multiple of 2. Code will ignore any extra strings at the end, so
        there is no need for the validity check.

        * html/FormController.cpp:
        (WebCore::serializeFormControlStateTo): Made a non-member function since
        FormControlState is now just a vector, not a class.
        (WebCore::deserializeFormControlState): Ditto. Also return optional instead
        of relying on a special failure state.
        (WebCore::SavedFormState::deserialize): Updated for above changes.
        (WebCore::SavedFormState::serializeTo const): Ditto.
        (WebCore::SavedFormState::appendControlState): Use add instead of both find and add
        to avoid double hashing.
        (WebCore::SavedFormState::takeControlState): Removed unneeded check for empty
        hash table and tweaked coding style.
        (WebCore::SavedFormState::referencedFilePaths const): Renamed to remove "get".
        (WebCore::FormKeyGenerator::formKey): Use ensure instead of find and add.
        (WebCore::FormController::formElementsCharacterCount const): Don't call
        saveFormControlState for non-text-form-controls since we ignored those values.
        (WebCore::FormController::willDeleteForm): Take a reference.
        (WebCore::FormController::restoreControlStateFor): Update since FormControlState
        is now a vector.
        (WebCore::FormController::restoreControlStateIn): Use is/downcast and update
        since FormControlState is now a vector.
        (WebCore::FormController::referencedFilePaths): Renamed to remove "get".
        (WebCore::FormController::registerFormElementWithState):Take a reference.
        (WebCore::FormController::unregisterFormElementWithState): Ditto.

        * html/FormController.h: Removed FormControlState class since it was just a
        Vector<String> with various unneeded features, such as a "failure" state,
        and a never-looked-at type of "skip" or "restore". Updated for other changes
        above.

        * html/HTMLFormControlElementWithState.cpp:
        (WebCore::HTMLFormControlElementWithState::insertedIntoAncestor): Pass reference.
        (WebCore::HTMLFormControlElementWithState::removedFromAncestor): Ditto.
        * html/HTMLFormControlElementWithState.h: Updated for the above. Also added
        support for using is/downcast on this.

        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::~HTMLFormElement): Pass reference.

        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::saveFormControlState const): Use reserveInitialCapacit
        and uncheckedAppend.
        (WebCore::HTMLSelectElement::restoreFormControlState): Updated since state is now
        a vector.
        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::saveFormControlState const): Ditto.
        * html/HiddenInputType.cpp:
        (WebCore::HiddenInputType::saveFormControlState const): Ditto.
        * html/InputType.cpp:
        (WebCore::InputType::saveFormControlState const): Ditto.

        * inspector/agents/InspectorCSSAgent.cpp:
        (WebCore::InspectorCSSAgent::forcePseudoState): Use get instead of find/end and got
        rid of uneeded special case. In another overload, ue add and remove instead of
        a find followed by a set or a remove.
        (WebCore::InspectorCSSAgent::asInspectorStyleSheet): Use ensure instead of find/set.
        (WebCore::InspectorCSSAgent::didRemoveDOMNode): Use take instead of find/remove.
        (WebCore::InspectorCSSAgent::didModifyDOMAttr): Use get instead of find.
        * inspector/agents/InspectorCSSAgent.h: Removed unneeded NodeToInspectorStyleSheet
        typedef and changed value type to Ref instead of RefPtr.

        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::unbind): Use remove instead of contains/remove.
        (WebCore::InspectorDOMAgent::nodeForId): Use isValidKey instead of just checking for
        0 and use get instead of find.
        (WebCore::InspectorDOMAgent::setAttributesAsText): Take out bogus const.
        (WebCore::InspectorDOMAgent::moveTo): Ditto.
        (WebCore::InspectorDOMAgent::resolveNode): Ditto.
        (WebCore::InspectorDOMAgent::isWhitespace): Added FIXME. Use is<Text> instead of
        slower nodeType.
        * inspector/agents/InspectorDOMAgent.h: Removed bogus const.

        * inspector/agents/InspectorLayerTreeAgent.cpp:
        (WebCore::InspectorLayerTreeAgent::bind): Use ensure instead of get/set.
        (WebCore::InspectorLayerTreeAgent::unbind): Use take instead of find/remove.
        (WebCore::InspectorLayerTreeAgent::bindPseudoElement): Use ensure instead of get/set.
        (WebCore::InspectorLayerTreeAgent::unbindPseudoElement): Use take instead of
        find/remove.

        * inspector/agents/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::getCookies): Use add instead of contains/add.
        (WebCore::InspectorPageAgent::frameDetached): Use take instead of find/remove.
        (WebCore::InspectorPageAgent::frameId): Use ensure instead of get/set.
        (WebCore::InspectorPageAgent::loaderId): Use ensure instead of get/set.
        (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin): Got rid of unneeded
        local variable.

        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::sessionID const): Tweaked coding style and added
        a null check for page.
        (WebCore::CachedResourceLoader::requestResource): Call page directly on the frame
        instead of first getting the main frame. Also use take instead of find/remove.
        (WebCore::CachedResourceLoader::removeCachedResource): Rewrite assertion.

        * platform/graphics/FontGenericFamilies.cpp:
        (WebCore::setGenericFontFamilyForScript): Use remove instead of find/remove.
        Simplified the logic a bit in the add case.

        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::pauseAnimation): Use add instead of find/add.
        Removed code that said "if (action != Remove) action = Pause" since that is a
        no-op; there are only two actions, Remove and Pause.

        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::mediaControlsScript): Use makeString instead of StringBuilder.
        (WebCore::RenderThemeMac::systemColor const): Rewrote to use ensure instead of add.
        Also crunched the code a little.

        * testing/Internals.cpp:
        (WebCore::Internals::getReferencedFilePaths const): Updated function name.

        * xml/parser/XMLDocumentParser.h: Updated for change below.
        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::attributesStartElementNsHandler): Updated to use std::optional instead of
        a separate boolean for AttributeParseState.
        (WebCore::parseAttributes): Ditto. Also changed the return value to work the same way.

2017-11-19  Sam Weinig  <sam@webkit.org>

        Clean up gradient code in preparation for conic gradients
        https://bugs.webkit.org/show_bug.cgi?id=179595

        Reviewed by Darin Adler.

        - Switches Gradient to use a Varient with type specific data structs and makes the 
          points / radii immutable.
        - Replaces CSSGradientValue::addStops with template function CSSGradientValue::computeStops
          which dispatches to a helper adoptor struct which is passed in for gradient type specific
          values, rather than switching on type in the function itself. In addition, the function no
          longer mutates a Gradient, but rather mutates type specific the data struct (e.g. Linear or
          Radial for now).

        * css/CSSGradientValue.cpp:
        (WebCore::LinearGradientAdaptor::LinearGradientAdaptor):
        (WebCore::RadialGradientAdaptor::RadialGradientAdaptor):

            Add helper structs for the now templatized CSSGradientValue::computeStops that
            implement type specific functionality.

        (WebCore::CSSGradientValue::computeStops):
        
            Renamed from addStops. Now takes a GradientAdaptor wrapper which abstracts out
            the gradient type specific functionlity.
        
        (WebCore::CSSLinearGradientValue::createGradient):
        (WebCore::CSSRadialGradientValue::createGradient):
        (WebCore::CSSConicGradientValue::createGradient):
        
            Update to call computeStops and use new Gradient create function. 
        
        * css/CSSGradientValue.h:
        
            Update for new signature for computeStops.
        
        * html/canvas/CanvasGradient.cpp:
        (WebCore::CanvasGradient::CanvasGradient):
        
            Update to use new Gradient create function.
        
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
        
            Update to get gradient point / radii information from the data accessor.

        * platform/graphics/Gradient.cpp:
        (WebCore::Gradient::Gradient):
        
            Update constructors to the new data structs.
        
        (WebCore::Gradient::type const):
        
            Add helper to get the type of the varient, need for inspector code.
        
        (WebCore::Gradient::adjustParametersForTiledDrawing):
        (WebCore::Gradient::isZeroSize const):
        (WebCore::Gradient::hash const):
        
            Update to switch on the underlying variant to get data values.
        
        (WebCore::Gradient::addColorStop):
        
            Simplify by having one addColorStop call the other.
            
        (WebCore::Gradient::setSortedColorStops):
        
            Added. Replaces setStopsSorted. Used now that CSSGradientValue computes and sorts
            its color stops before creating the gradient.

        * platform/graphics/Gradient.h:
        (WebCore::Gradient::create):
        
            Replace create functions with ones that take data structs.
        
        (WebCore::Gradient::data const):

            Add accessor for the underlying variant.

        (WebCore::Gradient::isRadial const): Deleted.
        
            Replaced by type accessor.
        
        (WebCore::Gradient::p0 const): Deleted.
        (WebCore::Gradient::p1 const): Deleted.
        (WebCore::Gradient::setP0): Deleted.
        (WebCore::Gradient::setP1): Deleted.
        (WebCore::Gradient::startRadius const): Deleted.
        (WebCore::Gradient::endRadius const): Deleted.
        (WebCore::Gradient::setStartRadius): Deleted.
        (WebCore::Gradient::setEndRadius): Deleted.
        
            Point and radii are now immutable.
        
        (WebCore::Gradient::setStopsSorted): Deleted.
        
            Replaced by setSortedColorStops function.
        
        * platform/graphics/GraphicsContext.cpp:
        (WebCore::GraphicsContext::fillRect):
        
            Pass the GraphicsContext by reference.
        
        * platform/graphics/cairo/GradientCairo.cpp:
        (WebCore::Gradient::createPlatformGradient):

            Update to switch on the underlying variant to get data values.

        (WebCore::Gradient::fill):
        
            Pass the GraphicsContext by reference.
        
        * platform/graphics/cg/GradientCG.cpp:
        (WebCore::Gradient::platformDestroy):
        
            Use nullptr.
        
        (WebCore::Gradient::fill):
        
            Pass the GraphicsContext by reference.
        
        (WebCore::Gradient::paint):

            Update to switch on the underlying variant to get data values.

        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::fillPath):
        (WebCore::GraphicsContext::strokePath):
        (WebCore::GraphicsContext::fillRect):
        (WebCore::GraphicsContext::strokeRect):
        
            Pass the GraphicsContext by reference.
        
        * platform/graphics/win/GradientDirect2D.cpp:
        (WebCore::Gradient::generateGradient):

            Update to switch on the underlying variant to get data values.
        
        (WebCore::Gradient::fill):
    
            Pass the GraphicsContext by reference.
        
        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::paintProgressBar):
        * rendering/svg/RenderSVGResourceLinearGradient.cpp:
        (WebCore::RenderSVGResourceLinearGradient::buildGradient const):
        * rendering/svg/RenderSVGResourceRadialGradient.cpp:
        (WebCore::RenderSVGResourceRadialGradient::buildGradient const):
        
            Update for new Gradient create function signature.

2017-11-19  Simon Fraser  <simon.fraser@apple.com>

        Use TypedArrayView's setRange() in FETurbulence
        https://bugs.webkit.org/show_bug.cgi?id=179878

        Reviewed by Sam Weinig.

        Writing the 4 component values at once makes the function about 10% faster.

        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::FETurbulence::fillRegion const):

2017-11-18  Chris Dumez  <cdumez@apple.com>

        ASSERTION FAILED: registration in WebCore::SWServerJobQueue::scriptContextStarted(ServiceWorkerIdentifier)
        https://bugs.webkit.org/show_bug.cgi?id=179846

        Reviewed by Darin Adler.

        We have seen crashes on the bots in SWServerJobQueue because methods such as scriptContextStarted()
        can get called after the jobQueue has been cleared. This is because when a jobQueue is cleared,
        an asynchronous operation may be pending (e.g. script fetch, service worker starting, install event).

        To address the issue, we now pass the identifier of the job that started the asynchronous operation
        when calling the methods on SWServerJobQueue. If the identifier does not match the identifier of
        the current job in the JobQueue, we ignore it.

        This patch also starts using a strongly typed identifier (ServiceWorkerJobIdentifier) for
        ServiceWorkerJob, instead of a uint64_t. It also introduces a ServiceWorkerJobDataIdentifier type
        which contains both a SWServerConnectionIdentifier and a ServiceWorkerJobIdentifier. This is useful
        because ServiceWorkerJobData is passed to the StorageProcess and it needs a globally unique identifier.
        ServiceWorkerJobIdentifier is only guaranteed to be unique within a single WebProcess. Augmenting it
        with the SWServerConnectionIdentifier of the WebProcess makes it globally unique.

        No new tests, unskipped exiting test.

        * WebCore.xcodeproj/project.pbxproj:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::scheduleJob):
        (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
        (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
        (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
        (WebCore::ServiceWorkerContainer::jobDidFinish):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerContextData.cpp:
        (WebCore::ServiceWorkerContextData::isolatedCopy const):
        * workers/service/ServiceWorkerContextData.h:
        (WebCore::ServiceWorkerContextData::encode const):
        (WebCore::ServiceWorkerContextData::decode):
        * workers/service/ServiceWorkerFetchResult.h:
        (WebCore::ServiceWorkerFetchResult::encode const):
        (WebCore::ServiceWorkerFetchResult::decode):
        * workers/service/ServiceWorkerJob.h:
        (WebCore::ServiceWorkerJob::identifier const):
        * workers/service/ServiceWorkerJobData.cpp:
        (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
        (WebCore::ServiceWorkerJobData::isolatedCopy const):
        * workers/service/ServiceWorkerJobData.h:
        (WebCore::ServiceWorkerJobData::connectionIdentifier const):
        (WebCore::ServiceWorkerJobData::identifier const):
        (WebCore::ServiceWorkerJobData::encode const):
        (WebCore::ServiceWorkerJobData::decode):
        * workers/service/ServiceWorkerJobDataIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerFetchResult.h.
        (WebCore::ServiceWorkerJobDataIdentifier::operator== const):
        (WebCore::ServiceWorkerJobDataIdentifier::loggingString const):
        (WebCore::ServiceWorkerJobDataIdentifier::encode const):
        (WebCore::ServiceWorkerJobDataIdentifier::decode):
        * workers/service/ServiceWorkerTypes.h:
        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::registerServiceWorkerThreadForInstall):
        * workers/service/context/SWContextManager.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::fireInstallEvent):
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::scheduleJob):
        (WebCore::SWClientConnection::finishedFetchingScript):
        (WebCore::SWClientConnection::failedFetchingScript):
        (WebCore::SWClientConnection::jobRejectedInServer):
        (WebCore::SWClientConnection::registrationJobResolvedInServer):
        (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
        (WebCore::SWClientConnection::startScriptFetchForServer):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::scheduleJobInServer):
        (WebCore::SWServer::rejectJob):
        (WebCore::SWServer::resolveRegistrationJob):
        (WebCore::SWServer::startScriptFetch):
        (WebCore::SWServer::scriptFetchFinished):
        (WebCore::SWServer::scriptContextFailedToStart):
        (WebCore::SWServer::scriptContextStarted):
        (WebCore::SWServer::didFinishInstall):
        (WebCore::SWServer::updateWorker):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::isCurrentlyProcessingJob const):
        (WebCore::SWServerJobQueue::scriptFetchFinished):
        (WebCore::SWServerJobQueue::scriptContextFailedToStart):
        (WebCore::SWServerJobQueue::scriptContextStarted):
        (WebCore::SWServerJobQueue::didFinishInstall):
        * workers/service/server/SWServerJobQueue.h:
        * workers/service/server/SWServerToContextConnection.cpp:
        (WebCore::SWServerToContextConnection::scriptContextFailedToStart):
        (WebCore::SWServerToContextConnection::scriptContextStarted):
        (WebCore::SWServerToContextConnection::didFinishInstall):
        * workers/service/server/SWServerToContextConnection.h:
        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::scriptContextFailedToStart):
        (WebCore::SWServerWorker::scriptContextStarted):
        (WebCore::SWServerWorker::didFinishInstall):
        * workers/service/server/SWServerWorker.h:

2017-11-18  Nan Wang  <n_wang@apple.com>

        AX: AOM: Implement number type properties
        https://bugs.webkit.org/show_bug.cgi?id=179497

        Reviewed by Chris Fleizach.

        Accessibility Object Model
        Explainer: https://wicg.github.io/aom/explainer.html
        Spec: https://wicg.github.io/aom/spec/

        Implemented the number type properties for Accessibility Object Modal.

        Test: accessibility/mac/AOM-number-properties.html

        * accessibility/AXObjectCache.cpp:
        (WebCore::isNodeAriaVisible):
        * accessibility/AccessibilityARIAGrid.cpp:
        (WebCore::AccessibilityARIAGrid::isMultiSelectable const):
        * accessibility/AccessibilityARIAGridCell.cpp:
        (WebCore::AccessibilityARIAGridCell::rowIndexRange const):
        (WebCore::AccessibilityARIAGridCell::axRowSpanWithRowIndex const):
        (WebCore::AccessibilityARIAGridCell::columnIndexRange const):
        (WebCore::AccessibilityARIAGridCell::ariaRowSpanWithRowIndex const): Deleted.
        * accessibility/AccessibilityARIAGridCell.h:
        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::isEnabled const):
        (WebCore::AccessibilityNodeObject::isMultiSelectable const):
        (WebCore::AccessibilityNodeObject::isRequired const):
        (WebCore::AccessibilityNodeObject::headingLevel const):
        (WebCore::AccessibilityNodeObject::valueForRange const):
        (WebCore::AccessibilityNodeObject::maxValueForRange const):
        (WebCore::AccessibilityNodeObject::minValueForRange const):
        (WebCore::AccessibilityNodeObject::hierarchicalLevel const):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::intValueForProperty const):
        (WebCore::AccessibilityObject::unsignedValueForProperty const):
        (WebCore::AccessibilityObject::doubleValueForProperty const):
        (WebCore::AccessibilityObject::supportsSetSize const):
        (WebCore::AccessibilityObject::supportsPosInSet const):
        (WebCore::AccessibilityObject::setSize const):
        (WebCore::AccessibilityObject::posInSet const):
        (WebCore::AccessibilityObject::supportsARIASetSize const): Deleted.
        (WebCore::AccessibilityObject::supportsARIAPosInSet const): Deleted.
        (WebCore::AccessibilityObject::ariaSetSize const): Deleted.
        (WebCore::AccessibilityObject::ariaPosInSet const): Deleted.
        * accessibility/AccessibilityObject.h:
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
        (WebCore::AccessibilityRenderObject::liveRegionAtomic const):
        * accessibility/AccessibilityTable.cpp:
        (WebCore::AccessibilityTable::isDataTable const):
        (WebCore::AccessibilityTable::axColumnCount const):
        (WebCore::AccessibilityTable::axRowCount const):
        (WebCore::AccessibilityTable::ariaColumnCount const): Deleted.
        (WebCore::AccessibilityTable::ariaRowCount const): Deleted.
        * accessibility/AccessibilityTable.h:
        * accessibility/AccessibilityTableCell.cpp:
        (WebCore::AccessibilityTableCell::AccessibilityTableCell):
        (WebCore::AccessibilityTableCell::rowIndexRange const):
        (WebCore::AccessibilityTableCell::columnIndexRange const):
        (WebCore::AccessibilityTableCell::axColumnIndex const):
        (WebCore::AccessibilityTableCell::axRowIndex const):
        (WebCore::AccessibilityTableCell::axColumnSpan const):
        (WebCore::AccessibilityTableCell::axRowSpan const):
        (WebCore::AccessibilityTableCell::ariaColumnIndex const): Deleted.
        (WebCore::AccessibilityTableCell::ariaRowIndex const): Deleted.
        (WebCore::AccessibilityTableCell::ariaColumnSpan const): Deleted.
        (WebCore::AccessibilityTableCell::ariaRowSpan const): Deleted.
        * accessibility/AccessibilityTableCell.h:
        (WebCore::AccessibilityTableCell::setAXColIndexFromRow):
        (WebCore::AccessibilityTableCell::setARIAColIndexFromRow): Deleted.
        * accessibility/AccessibilityTableRow.cpp:
        (WebCore::AccessibilityTableRow::addChildren):
        (WebCore::AccessibilityTableRow::axColumnIndex const):
        (WebCore::AccessibilityTableRow::axRowIndex const):
        (WebCore::AccessibilityTableRow::ariaColumnIndex const): Deleted.
        (WebCore::AccessibilityTableRow::ariaRowIndex const): Deleted.
        * accessibility/AccessibilityTableRow.h:
        * accessibility/AccessibleNode.cpp:
        (WebCore::ariaAttributeMap):
        (WebCore::isPropertyValueInt):
        (WebCore::isPropertyValueUnsigned):
        (WebCore::isPropertyValueFloat):
        (WebCore::AccessibleNode::setProperty):
        (WebCore::AccessibleNode::setOptionalProperty):
        (WebCore::AccessibleNode::setStringProperty):
        (WebCore::AccessibleNode::optionalValueForProperty):
        (WebCore::AccessibleNode::effectiveBoolValueForElement):
        (WebCore::AccessibleNode::effectiveIntValueForElement):
        (WebCore::AccessibleNode::effectiveUnsignedValueForElement):
        (WebCore::AccessibleNode::effectiveDoubleValueForElement):
        (WebCore::AccessibleNode::atomic const):
        (WebCore::AccessibleNode::setAtomic):
        (WebCore::AccessibleNode::setAutocomplete):
        (WebCore::AccessibleNode::busy const):
        (WebCore::AccessibleNode::setBusy):
        (WebCore::AccessibleNode::setChecked):
        (WebCore::AccessibleNode::colCount const):
        (WebCore::AccessibleNode::setColCount):
        (WebCore::AccessibleNode::colIndex const):
        (WebCore::AccessibleNode::setColIndex):
        (WebCore::AccessibleNode::colSpan const):
        (WebCore::AccessibleNode::setColSpan):
        (WebCore::AccessibleNode::setCurrent):
        (WebCore::AccessibleNode::disabled const):
        (WebCore::AccessibleNode::setDisabled):
        (WebCore::AccessibleNode::expanded const):
        (WebCore::AccessibleNode::setExpanded):
        (WebCore::AccessibleNode::setHasPopUp):
        (WebCore::AccessibleNode::hidden const):
        (WebCore::AccessibleNode::setHidden):
        (WebCore::AccessibleNode::setInvalid):
        (WebCore::AccessibleNode::setKeyShortcuts):
        (WebCore::AccessibleNode::label const):
        (WebCore::AccessibleNode::setLabel):
        (WebCore::AccessibleNode::level const):
        (WebCore::AccessibleNode::setLevel):
        (WebCore::AccessibleNode::live const):
        (WebCore::AccessibleNode::setLive):
        (WebCore::AccessibleNode::modal const):
        (WebCore::AccessibleNode::setModal):
        (WebCore::AccessibleNode::multiline const):
        (WebCore::AccessibleNode::setMultiline):
        (WebCore::AccessibleNode::multiselectable const):
        (WebCore::AccessibleNode::setMultiselectable):
        (WebCore::AccessibleNode::setOrientation):
        (WebCore::AccessibleNode::setPlaceholder):
        (WebCore::AccessibleNode::posInSet const):
        (WebCore::AccessibleNode::setPosInSet):
        (WebCore::AccessibleNode::setPressed):
        (WebCore::AccessibleNode::readOnly const):
        (WebCore::AccessibleNode::setReadOnly):
        (WebCore::AccessibleNode::setRelevant):
        (WebCore::AccessibleNode::required const):
        (WebCore::AccessibleNode::setRequired):
        (WebCore::AccessibleNode::setRole):
        (WebCore::AccessibleNode::setRoleDescription):
        (WebCore::AccessibleNode::rowCount const):
        (WebCore::AccessibleNode::setRowCount):
        (WebCore::AccessibleNode::rowIndex const):
        (WebCore::AccessibleNode::setRowIndex):
        (WebCore::AccessibleNode::rowSpan const):
        (WebCore::AccessibleNode::setRowSpan):
        (WebCore::AccessibleNode::selected const):
        (WebCore::AccessibleNode::setSelected):
        (WebCore::AccessibleNode::setSize const):
        (WebCore::AccessibleNode::setSetSize):
        (WebCore::AccessibleNode::setSort):
        (WebCore::AccessibleNode::valueMax const):
        (WebCore::AccessibleNode::setValueMax):
        (WebCore::AccessibleNode::valueMin const):
        (WebCore::AccessibleNode::setValueMin):
        (WebCore::AccessibleNode::valueNow const):
        (WebCore::AccessibleNode::setValueNow):
        (WebCore::AccessibleNode::setValueText):
        (WebCore::AccessibleNode::boolValueForProperty): Deleted.
        (WebCore::AccessibleNode::setBoolProperty): Deleted.
        * accessibility/AccessibleNode.h:
        * accessibility/AccessibleNode.idl:
        * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
        (webkitAccessibleTableGetNColumns):
        (webkitAccessibleTableGetNRows):
        * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
        (webkitAccessibleTableCellGetPosition):
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper accessibilityARIARowCount]):
        (-[WebAccessibilityObjectWrapper accessibilityARIAColumnCount]):
        (-[WebAccessibilityObjectWrapper accessibilityARIARowIndex]):
        (-[WebAccessibilityObjectWrapper accessibilityARIAColumnIndex]):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

2017-11-18  Tim Horton  <timothy_horton@apple.com>

        Fix typos in closing ENABLE() comments
        https://bugs.webkit.org/show_bug.cgi?id=179869

        Unreviewed.

        * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h:
        * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:

2017-11-18  Maciej Stachowiak  <mjs@apple.com>

        Remove TEC support and all TEC-only encodings except EUC-TW (which now uses ICU)
        https://bugs.webkit.org/show_bug.cgi?id=179582

        Reviewed by Darin Adler.

        Already covered by fast/encoding/legacy-tec-encodings.html

        * platform/text/TextCodecICU.cpp: Add support for EUC-TW.

        Remove all vestiges of TEC text codec and its related autogeneration scripts.
        
        * DerivedSources.make:
        * PlatformMac.cmake:
        * SourcesMac.txt:
        * WebCore.order:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/ThreadGlobalData.cpp:
        (WebCore::ThreadGlobalData::ThreadGlobalData): No more cached TEC decoder.
        (WebCore::ThreadGlobalData::destroy): ditto
        * platform/ThreadGlobalData.h:
        (WebCore::ThreadGlobalData::ThreadGlobalData::cachedConverterTEC): Deleted.
        * platform/text/TextEncodingRegistry.cpp:
        (WebCore::extendTextCodecMaps): Don't add TEC decoders on MAc.
        * platform/text/mac/CharsetData.h: Removed.
        * platform/text/mac/TextCodecMac.cpp: Removed.
        * platform/text/mac/TextCodecMac.h: Removed.
        * platform/text/mac/character-sets.txt: Removed.
        * platform/text/mac/ios-encodings.txt: Removed.
        * platform/text/mac/mac-encodings.txt: Removed.
        * platform/text/mac/make-charset-table.pl: Removed.

2017-11-18  Simon Fraser  <simon.fraser@apple.com>

        Mechanical cleanup of FE* files
        https://bugs.webkit.org/show_bug.cgi?id=179868

        Reviewed by Wenson Hsieh.

        Remove unused dump() functions.
        Make overridden member functions in derived classes private.
        Make simple getters inline.
        
        Move common FESpecularLighting and FEDiffuseLighting functions into the 
        FELighting base class.

        * platform/graphics/filters/FEBlend.cpp:
        (WebCore::FEBlend::blendMode const): Deleted.
        (WebCore::FEBlend::dump): Deleted.
        * platform/graphics/filters/FEBlend.h:
        (WebCore::FEBlend::blendMode const):
        * platform/graphics/filters/FEColorMatrix.cpp:
        (WebCore::FEColorMatrix::type const): Deleted.
        (WebCore::FEColorMatrix::values const): Deleted.
        (WebCore::FEColorMatrix::dump): Deleted.
        * platform/graphics/filters/FEColorMatrix.h:
        (WebCore::FEColorMatrix::type const):
        (WebCore::FEColorMatrix::values const):
        * platform/graphics/filters/FEComponentTransfer.cpp:
        (WebCore::FEComponentTransfer::redFunction const): Deleted.
        (WebCore::FEComponentTransfer::greenFunction const): Deleted.
        (WebCore::FEComponentTransfer::blueFunction const): Deleted.
        (WebCore::FEComponentTransfer::alphaFunction const): Deleted.
        (WebCore::FEComponentTransfer::dump): Deleted.
        * platform/graphics/filters/FEComponentTransfer.h:
        (WebCore::FEComponentTransfer::redFunction const):
        (WebCore::FEComponentTransfer::greenFunction const):
        (WebCore::FEComponentTransfer::blueFunction const):
        (WebCore::FEComponentTransfer::alphaFunction const):
        * platform/graphics/filters/FEComposite.cpp:
        (WebCore::FEComposite::operation const): Deleted.
        (WebCore::FEComposite::k1 const): Deleted.
        (WebCore::FEComposite::k2 const): Deleted.
        (WebCore::FEComposite::k3 const): Deleted.
        (WebCore::FEComposite::k4 const): Deleted.
        (WebCore::FEComposite::dump): Deleted.
        * platform/graphics/filters/FEComposite.h:
        (WebCore::FEComposite::operation const):
        (WebCore::FEComposite::k1 const):
        (WebCore::FEComposite::k2 const):
        (WebCore::FEComposite::k3 const):
        (WebCore::FEComposite::k4 const):
        * platform/graphics/filters/FEConvolveMatrix.cpp:
        (WebCore::FEConvolveMatrix::kernelSize const): Deleted.
        (WebCore::FEConvolveMatrix::kernel const): Deleted.
        (WebCore::FEConvolveMatrix::divisor const): Deleted.
        (WebCore::FEConvolveMatrix::bias const): Deleted.
        (WebCore::FEConvolveMatrix::targetOffset const): Deleted.
        (WebCore::FEConvolveMatrix::edgeMode const): Deleted.
        (WebCore::FEConvolveMatrix::kernelUnitLength const): Deleted.
        (WebCore::FEConvolveMatrix::preserveAlpha const): Deleted.
        (WebCore::FEConvolveMatrix::dump): Deleted.
        * platform/graphics/filters/FEConvolveMatrix.h:
        (WebCore::FEConvolveMatrix::kernelSize const):
        (WebCore::FEConvolveMatrix::kernel const):
        (WebCore::FEConvolveMatrix::divisor const):
        (WebCore::FEConvolveMatrix::bias const):
        (WebCore::FEConvolveMatrix::targetOffset const):
        (WebCore::FEConvolveMatrix::edgeMode const):
        (WebCore::FEConvolveMatrix::kernelUnitLength const):
        (WebCore::FEConvolveMatrix::preserveAlpha const):
        * platform/graphics/filters/FEDiffuseLighting.cpp:
        (WebCore::FEDiffuseLighting::lightingColor const): Deleted.
        (WebCore::FEDiffuseLighting::setLightingColor): Deleted.
        (WebCore::FEDiffuseLighting::surfaceScale const): Deleted.
        (WebCore::FEDiffuseLighting::setSurfaceScale): Deleted.
        (WebCore::FEDiffuseLighting::diffuseConstant const): Deleted.
        (WebCore::FEDiffuseLighting::kernelUnitLengthX const): Deleted.
        (WebCore::FEDiffuseLighting::setKernelUnitLengthX): Deleted.
        (WebCore::FEDiffuseLighting::kernelUnitLengthY const): Deleted.
        (WebCore::FEDiffuseLighting::setKernelUnitLengthY): Deleted.
        (WebCore::FEDiffuseLighting::lightSource const): Deleted.
        (WebCore::FEDiffuseLighting::dump): Deleted.
        * platform/graphics/filters/FEDiffuseLighting.h:
        (WebCore::FEDiffuseLighting::diffuseConstant const):
        * platform/graphics/filters/FEDisplacementMap.cpp:
        (WebCore::FEDisplacementMap::xChannelSelector const): Deleted.
        (WebCore::FEDisplacementMap::yChannelSelector const): Deleted.
        (WebCore::FEDisplacementMap::scale const): Deleted.
        (WebCore::FEDisplacementMap::dump): Deleted.
        * platform/graphics/filters/FEDisplacementMap.h:
        (WebCore::FEDisplacementMap::xChannelSelector const):
        (WebCore::FEDisplacementMap::yChannelSelector const):
        (WebCore::FEDisplacementMap::scale const):
        * platform/graphics/filters/FEDropShadow.cpp:
        (WebCore::FEDropShadow::dump): Deleted.
        * platform/graphics/filters/FEDropShadow.h:
        * platform/graphics/filters/FEFlood.cpp:
        (WebCore::FEFlood::floodColor const): Deleted.
        (WebCore::FEFlood::floodOpacity const): Deleted.
        (WebCore::FEFlood::dump): Deleted.
        * platform/graphics/filters/FEFlood.h:
        (WebCore::FEFlood::floodColor const):
        (WebCore::FEFlood::floodOpacity const):
        * platform/graphics/filters/FEGaussianBlur.cpp:
        (WebCore::FEGaussianBlur::stdDeviationX const): Deleted.
        (WebCore::FEGaussianBlur::stdDeviationY const): Deleted.
        (WebCore::FEGaussianBlur::edgeMode const): Deleted.
        (WebCore::FEGaussianBlur::dump): Deleted.
        * platform/graphics/filters/FEGaussianBlur.h:
        (WebCore::FEGaussianBlur::stdDeviationX const):
        (WebCore::FEGaussianBlur::stdDeviationY const):
        (WebCore::FEGaussianBlur::edgeMode const):
        * platform/graphics/filters/FELighting.cpp:
        (WebCore::FELighting::setSurfaceScale):
        (WebCore::FELighting::setLightingColor):
        (WebCore::FELighting::setKernelUnitLengthX):
        (WebCore::FELighting::setKernelUnitLengthY):
        * platform/graphics/filters/FELighting.h:
        (WebCore::FELighting::surfaceScale const):
        (WebCore::FELighting::lightingColor const):
        (WebCore::FELighting::kernelUnitLengthX const):
        (WebCore::FELighting::kernelUnitLengthY const):
        (WebCore::FELighting::lightSource const):
        * platform/graphics/filters/FEMerge.cpp:
        (WebCore::FEMerge::dump): Deleted.
        * platform/graphics/filters/FEMerge.h:
        * platform/graphics/filters/FEMorphology.cpp:
        (WebCore::FEMorphology::dump): Deleted.
        * platform/graphics/filters/FEMorphology.h:
        * platform/graphics/filters/FEOffset.cpp:
        (WebCore::FEOffset::dx const): Deleted.
        (WebCore::FEOffset::dy const): Deleted.
        (WebCore::FEOffset::dump): Deleted.
        * platform/graphics/filters/FEOffset.h:
        (WebCore::FEOffset::dx const):
        (WebCore::FEOffset::dy const):
        * platform/graphics/filters/FESpecularLighting.cpp:
        (WebCore::FESpecularLighting::lightingColor const): Deleted.
        (WebCore::FESpecularLighting::setLightingColor): Deleted.
        (WebCore::FESpecularLighting::surfaceScale const): Deleted.
        (WebCore::FESpecularLighting::setSurfaceScale): Deleted.
        (WebCore::FESpecularLighting::specularConstant const): Deleted.
        (WebCore::FESpecularLighting::specularExponent const): Deleted.
        (WebCore::FESpecularLighting::kernelUnitLengthX const): Deleted.
        (WebCore::FESpecularLighting::setKernelUnitLengthX): Deleted.
        (WebCore::FESpecularLighting::kernelUnitLengthY const): Deleted.
        (WebCore::FESpecularLighting::setKernelUnitLengthY): Deleted.
        (WebCore::FESpecularLighting::lightSource const): Deleted.
        (WebCore::FESpecularLighting::dump): Deleted.
        * platform/graphics/filters/FESpecularLighting.h:
        (WebCore::FESpecularLighting::specularConstant const):
        (WebCore::FESpecularLighting::specularExponent const):
        * platform/graphics/filters/FETile.cpp:
        (WebCore::FETile::dump): Deleted.
        * platform/graphics/filters/FETile.h:
        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::FETurbulence::dump): Deleted.
        * platform/graphics/filters/FETurbulence.h:
        * platform/graphics/filters/FilterEffect.h:
        * platform/graphics/filters/SourceAlpha.cpp:
        (WebCore::SourceAlpha::dump): Deleted.
        * platform/graphics/filters/SourceAlpha.h:
        * platform/graphics/filters/SourceGraphic.cpp:
        (WebCore::SourceGraphic::dump): Deleted.
        * platform/graphics/filters/SourceGraphic.h:
        * svg/graphics/filters/SVGFEImage.cpp:
        (WebCore::FEImage::dump): Deleted.
        * svg/graphics/filters/SVGFEImage.h:

2017-11-18  Simon Fraser  <simon.fraser@apple.com>

        Attempt to fix Windows build failures seen in EWS.
        
        Remove default constructor for ColorComponents, which was ambiguous with the
        one that takes 4 values.

        * platform/graphics/ColorUtilities.h:

2017-11-18  Simon Fraser  <simon.fraser@apple.com>

        Line of garbage pixels at the bottom of an feTurbulence sometimes
        https://bugs.webkit.org/show_bug.cgi?id=179866

        Reviewed by Wenson Hsieh.
        
        The ParallelJobs logic was broken in that the sum of the computed job
        heights was one too short sometimes. Fix and clean up the logic.

        Test: svg/filters/feTurbulence-parallel-jobs.html

        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::FETurbulence::platformApplySoftware):

2017-11-18  Simon Fraser  <simon.fraser@apple.com>

        Use #pragma once in FE* files.
        
        Rubber-stamped by Dan Bates.

        * platform/graphics/filters/FEBlend.h:
        * platform/graphics/filters/FEColorMatrix.h:
        * platform/graphics/filters/FEComponentTransfer.h:
        * platform/graphics/filters/FEComposite.h:
        * platform/graphics/filters/FEConvolveMatrix.h:
        * platform/graphics/filters/FEDiffuseLighting.h:
        * platform/graphics/filters/FEDisplacementMap.h:
        * platform/graphics/filters/FEDropShadow.h:
        * platform/graphics/filters/FEFlood.h:
        * platform/graphics/filters/FEGaussianBlur.h:
        * platform/graphics/filters/FELighting.h:
        * platform/graphics/filters/FEMerge.h:
        * platform/graphics/filters/FEOffset.h:
        * platform/graphics/filters/FESpecularLighting.h:
        * platform/graphics/filters/FETile.h:

2017-11-18  Simon Fraser  <simon.fraser@apple.com>

        Remove a TimingScope that I left in by mistake.

        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::FETurbulence::platformApplySoftware):

2017-11-18  Simon Fraser  <simon.fraser@apple.com>

        FETurbulence: round the result according to the spec
        https://bugs.webkit.org/show_bug.cgi?id=179865

        Reviewed by Zalan Bujtas.

        The spec explicitly says that the floating point results are multiplied by 255 then
        clamped between 0 and 255, so do this instead of using lroundf().
        
        This is also faster (about 10%).

        * platform/graphics/ColorUtilities.h:
        (WebCore::ColorComponents::ColorComponents):
        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::toColorComponents):
        (WebCore::FETurbulence::calculateTurbulenceValueForPoint const):

2017-11-18  Simon Fraser  <simon.fraser@apple.com>

        More FETurbulence cleanup
        https://bugs.webkit.org/show_bug.cgi?id=179863

        Reviewed by Zalan Bujtas.
        
        Hoist computation of initial StitchData up to be done once per filter,
        not once per pixel. Passing initial StitchData by value to calculateTurbulenceValueForPoint()
        ensures that each pixel gets the initial state.
        
        Also, adjusted baseFrequencyX and baseFrequencyY can be computed just once at the start,
        and passed through via PaintingData.
        
        Change enum TurbulenceType to be an enum class (requiring casts in a couple of places)
        and undo the capitalization of the values.

        Fix spelling of TURBULANCE -> TURBULENCE in test output.

        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::FETurbulence::computeStitching const):
        (WebCore::FETurbulence::calculateTurbulenceValueForPoint const):
        (WebCore::FETurbulence::fillRegion const):
        (WebCore::FETurbulence::fillRegionWorker):
        (WebCore::FETurbulence::platformApplySoftware):
        (WebCore::operator<<):
        * platform/graphics/filters/FETurbulence.h:
        (WebCore::FETurbulence::PaintingData::PaintingData):
        (WebCore::FETurbulence::StitchData::StitchData): Deleted.
        * svg/SVGAnimatedEnumeration.cpp:
        (WebCore::enumerationValueForTargetAttribute):
        * svg/SVGFETurbulenceElement.cpp:
        (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
        (WebCore::SVGFETurbulenceElement::parseAttribute):
        * svg/SVGFETurbulenceElement.h:
        (WebCore::SVGPropertyTraits<TurbulenceType>::highestEnumValue):
        (WebCore::SVGPropertyTraits<TurbulenceType>::toString):
        (WebCore::SVGPropertyTraits<TurbulenceType>::fromString):

2017-11-18  Simon Fraser  <simon.fraser@apple.com>

        feTurbulence with stitchTiles is broken
        https://bugs.webkit.org/show_bug.cgi?id=179862

        Reviewed by Zalan Bujtas.
        
        The "stitchTiles" logic was broken, and not equivalent to the spec sample code,
        because it didn't compute and wrap the bx1 and by1 equivalents separately from
        bx0 and by0.
        
        Annotated the code with the equivalent sample code from the spec for ease of
        comparison.
        
        Also make some functions const.

        Test: svg/filters/feTurbulence-stitchTiles.html

        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::FETurbulence::noise2D const):
        (WebCore::FETurbulence::calculateTurbulenceValueForPoint const):
        (WebCore::FETurbulence::fillRegion const):
        (WebCore::checkNoise): Deleted.
        (WebCore::FETurbulence::noise2D): Deleted.
        (WebCore::FETurbulence::calculateTurbulenceValueForPoint): Deleted.
        (WebCore::FETurbulence::fillRegion): Deleted.
        * platform/graphics/filters/FETurbulence.h:
        * platform/graphics/filters/FilterEffect.h:
        (WebCore::FilterEffect::filter const):

2017-11-18  Antti Koivisto  <antti@apple.com>

        REGRESSION (r220646): REGRESSION (r220646): RenderTreePosition::computeNextSibling hits assertion with certain first-letter mutations
        https://bugs.webkit.org/show_bug.cgi?id=179855
        <rdar://problem/35464071>

        Reviewed by Zalan Bujtas.

        Test: fast/css-generated-content/first-letter-update-crash.html

        * style/RenderTreeUpdaterFirstLetter.cpp:
        (WebCore::styleForFirstLetter):
        (WebCore::updateFirstLetterStyle):
        (WebCore::createFirstLetterRenderer):

            Tighten these to take RenderBlock.

        (WebCore::supportsFirstLetter):

            Test exact conditions where first letter renderer is allowed for fast rejection.

        (WebCore::RenderTreeUpdater::FirstLetter::update):

            If update was called on a block that doesn't support first letter, getFirstLetter could in
            some cases return an ancestor of the block and we would end up mutating a first letter renderer
            that wasn't current block's descendant. This violates assumptions of the RenderTreeUpdater
            and could cause cached render tree position to become invalid.

            Fix by ensuring we are always updating first letter for the current block only.

2017-11-17  Chris Dumez  <cdumez@apple.com>

        [Service Workers] Implement "Notify Controller Change" algorithm
        https://bugs.webkit.org/show_bug.cgi?id=179822

        Reviewed by Youenn Fablet.

        Implement "Notify Controller Change" algorithm:
        - https://w3c.github.io/ServiceWorker/#notify-controller-change

        Use it to support step 7 of "Activate" algorithm:
        - https://w3c.github.io/ServiceWorker/#activate

        Test: http/tests/workers/service/controller-change.html

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::notifyClientsOfControllerChange):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::activate):
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::notifyClientsOfControllerChange):
        * workers/service/server/SWServerRegistration.h:

2017-11-17  Chris Dumez  <cdumez@apple.com>

        Unreviewed attempt to fix build after r225006.

        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::setStorageAccessGranted):

2017-11-17  Simon Fraser  <simon.fraser@apple.com>

        FETurbulence: compute all 4 channels at once
        https://bugs.webkit.org/show_bug.cgi?id=179833

        Reviewed by Sam Weinig.

        Introduce some new helper classes for storing float color components, and use
        them in calculateTurbulenceValueForPoint() and noise2D() for all the channels in one
        pass. This makes FETurbulence about twice as fast.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/graphics/ColorUtilities.cpp: Added.
        (WebCore::ColorComponents::ColorComponents):
        * platform/graphics/ColorUtilities.h: Added.
        (WebCore::FloatComponents::FloatComponents):
        (WebCore::FloatComponents::operator +=):
        (WebCore::FloatComponents::operator + const):
        (WebCore::FloatComponents::operator / const):
        (WebCore::FloatComponents::operator * const):
        (WebCore::FloatComponents::abs const):
        (WebCore::clampedColorComponent):
        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::FETurbulence::noise2D):
        (WebCore::FETurbulence::calculateTurbulenceValueForPoint):
        (WebCore::FETurbulence::fillRegion):
        (WebCore::FETurbulence::platformApplySoftware):
        * platform/graphics/filters/FETurbulence.h:

2017-11-17  Chris Dumez  <cdumez@apple.com>

        Use a strongly typed identifier for SWServer::Connection
        https://bugs.webkit.org/show_bug.cgi?id=179848

        Reviewed by Brady Eidson.

        Use a strongly typed identifier for SWServer::Connection, for clarity.

        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::postMessage):
        * workers/service/ServiceWorkerClient.cpp:
        (WebCore::ServiceWorkerClient::ServiceWorkerClient):
        (WebCore::ServiceWorkerClient::id const):
        (WebCore::ServiceWorkerClient::postMessage):
        * workers/service/ServiceWorkerClient.h:
        (WebCore::ServiceWorkerClient::create):
        (WebCore::ServiceWorkerClient::identifier const):
        * workers/service/ServiceWorkerClientData.cpp:
        (WebCore::ServiceWorkerClientData::isolatedCopy const):
        (WebCore::ServiceWorkerClientData::from):
        * workers/service/ServiceWorkerClientData.h:
        (WebCore::ServiceWorkerClientData::encode const):
        (WebCore::ServiceWorkerClientData::decode):
        * workers/service/ServiceWorkerClientIdentifier.h:
        (WebCore::ServiceWorkerClientIdentifier::toString const):
        (WebCore::ServiceWorkerClientIdentifier::decode):
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::removeRegistration):
        (WebCore::ServiceWorkerContainer::updateRegistration):
        (WebCore::ServiceWorkerContainer::connectionIdentifier):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerFetchResult.h:
        (WebCore::ServiceWorkerFetchResult::decode):
        * workers/service/ServiceWorkerJobClient.h:
        * workers/service/ServiceWorkerJobData.cpp:
        (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
        * workers/service/ServiceWorkerJobData.h:
        (WebCore::ServiceWorkerJobData::connectionIdentifier const):
        (WebCore::ServiceWorkerJobData::decode):
        * workers/service/ServiceWorkerTypes.h:
        * workers/service/ServiceWorkerWindowClient.cpp:
        (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
        * workers/service/ServiceWorkerWindowClient.h:
        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
        * workers/service/context/SWContextManager.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::Connection):
        (WebCore::SWServer::Connection::scheduleJobInServer):
        (WebCore::SWServer::rejectJob):
        (WebCore::SWServer::resolveRegistrationJob):
        (WebCore::SWServer::startScriptFetch):
        (WebCore::SWServer::scriptFetchFinished):
        * workers/service/server/SWServer.h:
        (WebCore::SWServer::Connection::identifier const):
        (WebCore::SWServer::getConnection):
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::forEachConnection):
        (WebCore::SWServerRegistration::addClientServiceWorkerRegistration):
        (WebCore::SWServerRegistration::removeClientServiceWorkerRegistration):
        (WebCore::SWServerRegistration::unregisterServerConnection):
        * workers/service/server/SWServerRegistration.h:

2017-11-17  John Wilander  <wilander@apple.com>

        Storage Access API: UI process should update network process about granted access
        https://bugs.webkit.org/show_bug.cgi?id=176943
        <rdar://problem/34440612>

        Reviewed by Alex Christensen.

        Tests: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-non-recent-user-interaction.html
               http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-recent-user-interaction.html

        * platform/network/NetworkStorageSession.h:
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::setStorageAccessAPIEnabled):
        (WebCore::NetworkStorageSession::cookieStoragePartition const):
            Now also checks if the resource has been granted storage access
            under this partition and if so, does not return a partition.
        (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
            Now clears storage access when it is told to clear first.
        (WebCore::NetworkStorageSession::isStorageAccessGranted const):
        (WebCore::NetworkStorageSession::setStorageAccessGranted):

2017-11-17  Simon Fraser  <simon.fraser@apple.com>

        Inadvertently swapped m_baseFrequencyX and m_baseFrequencyY in the previous commit.

        * platform/graphics/filters/FETurbulence.h:
        (WebCore::FETurbulence::baseFrequencyY const):
        (WebCore::FETurbulence::baseFrequencyX const):

2017-11-17  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(224348): [mac-wk1] LayoutTest media/video-src-remove.html is a flaky timeout
        https://bugs.webkit.org/show_bug.cgi?id=179806

        Reviewed by Jer Noble.

        In r224348 I used callOnMainThread to fix UIWebView which uses the web thread, but Mac doesn't
        use the web thread. Something about the timing of operations in the media stack requires that
        dispatch_async be used instead of performSelectorOnMainThread.
        
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
        Use callOnMainThread on iOS, dispatch_async on Mac.

2017-11-17  Per Arne Vollan  <pvollan@apple.com>

        [Win] Compile error in InbandTextTrackPrivateAVCF::readNativeSampleBuffer.
        https://bugs.webkit.org/show_bug.cgi?id=179845

        Reviewed by Jer Noble.

        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
        (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer):

2017-11-17  Chris Fleizach  <cfleizach@apple.com>

        AX: VoiceOver in Safari does not read table header for first cell in first body row
        https://bugs.webkit.org/show_bug.cgi?id=179780
        <rdar://problem/35590551>

        Reviewed by Joanmarie Diggs.

        A table cell shouldn't be considered a row header if it's in a row of other headers.

        Test: accessibility/table-header-calculation-for-header-rows.html

        * accessibility/AccessibilityTableRow.cpp:
        (WebCore::AccessibilityTableRow::headerObject):

2017-11-17  Simon Fraser  <simon.fraser@apple.com>

        Don't invert a matrix for every channel of every pixel of an FETurbulence filter
        https://bugs.webkit.org/show_bug.cgi?id=179829

        Reviewed by Dean Jackson.
        
        FETurbulence::fillRegion() called filter().mapAbsolutePointToLocalPoint(point) for each
        of the 4 channels on a point, which is stupid.
        
        Fix to invert the matrix once, and then map the point once for each pixel. This reduces
        the time in fillRegion() function by about 30%.

        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::FETurbulence::fillRegion):
        * platform/graphics/filters/Filter.h:
        (WebCore::Filter::absoluteTransform const):
        (WebCore::Filter::mapAbsolutePointToLocalPoint const): Deleted.

2017-11-17  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r224390): Revert unneeded Ref use.
        https://bugs.webkit.org/show_bug.cgi?id=179844
        <rdar://problem/35624718>

        Reviewed by Chris Dumez.

        A Ref was added to a simple code path used for type checking, which introduced a nullptr
        deref. The original change was not needed, so let's revert it.

        * html/HTMLFrameOwnerElement.cpp:
        (WebCore::HTMLFrameOwnerElement::contentDocument const): Use 'nullptr' instead of 0.
        (WebCore::HTMLFrameOwnerElement::contentWindow const): Ditto.
        (WebCore::HTMLFrameOwnerElement::getSVGDocument const): Revert to original code here.

2017-11-17  Nan Wang  <n_wang@apple.com>

        AX: AOM: Implement boolean type properties
        https://bugs.webkit.org/show_bug.cgi?id=179496

        Reviewed by Chris Fleizach.

        Accessibility Object Model
        Explainer: https://wicg.github.io/aom/explainer.html
        Spec: https://wicg.github.io/aom/spec/

        Implemented the boolean type properties for Accessibility Object Modal.

        Test: accessibility/mac/AOM-bool-properties.html

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::AXObjectCache):
        (WebCore::AXObjectCache::~AXObjectCache):
        (WebCore::AXObjectCache::findModalNodes):
        (WebCore::AXObjectCache::updateCurrentModalNode):
        (WebCore::AXObjectCache::modalNode):
        (WebCore::AXObjectCache::remove):
        (WebCore::AXObjectCache::handleMenuItemSelected):
        (WebCore::AXObjectCache::focusModalNode):
        (WebCore::AXObjectCache::focusModalNodeTimerFired):
        (WebCore::AXObjectCache::handleAttributeChanged):
        (WebCore::AXObjectCache::handleModalChange):
        (WebCore::isNodeAriaVisible):
        (WebCore::AXObjectCache::findAriaModalNodes): Deleted.
        (WebCore::AXObjectCache::updateCurrentAriaModalNode): Deleted.
        (WebCore::AXObjectCache::ariaModalNode): Deleted.
        (WebCore::AXObjectCache::focusAriaModalNode): Deleted.
        (WebCore::AXObjectCache::focusAriaModalNodeTimerFired): Deleted.
        (WebCore::AXObjectCache::handleAriaModalChange): Deleted.
        * accessibility/AXObjectCache.h:
        (WebCore::AXObjectCache::AXObjectCache):
        (WebCore::AXObjectCache::modalNode):
        (WebCore::AXObjectCache::focusModalNodeTimerFired):
        (WebCore::AXObjectCache::handleModalChange):
        (WebCore::AXObjectCache::ariaModalNode): Deleted.
        (WebCore::AXObjectCache::focusAriaModalNodeTimerFired): Deleted.
        (WebCore::AXObjectCache::handleAriaModalChange): Deleted.
        * accessibility/AccessibilityARIAGrid.cpp:
        (WebCore::AccessibilityARIAGrid::isMultiSelectable const):
        * accessibility/AccessibilityARIAGridCell.cpp:
        (WebCore::AccessibilityARIAGridCell::readOnlyValue const):
        (WebCore::AccessibilityARIAGridCell::ariaReadOnlyValue const): Deleted.
        * accessibility/AccessibilityARIAGridCell.h:
        * accessibility/AccessibilityListBoxOption.cpp:
        (WebCore::AccessibilityListBoxOption::isEnabled const):
        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::isEnabled const):
        (WebCore::AccessibilityNodeObject::isMultiSelectable const):
        (WebCore::AccessibilityNodeObject::isRequired const):
        (WebCore::shouldUseAccessibilityObjectInnerText):
        (WebCore::AccessibilityNodeObject::canSetValueAttribute const):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::supportsReadOnly const):
        (WebCore::AccessibilityObject::readOnlyValue const):
        (WebCore::AccessibilityObject::ariaIsMultiline const):
        (WebCore::AccessibilityObject::isModalDescendant const):
        (WebCore::AccessibilityObject::isModalNode const):
        (WebCore::AccessibilityObject::ignoredFromModalPresence const):
        (WebCore::AccessibilityObject::boolValueForProperty const):
        (WebCore::AccessibilityObject::supportsARIAAttributes const):
        (WebCore::AccessibilityObject::supportsExpanded const):
        (WebCore::AccessibilityObject::isExpanded const):
        (WebCore::AccessibilityObject::isAXHidden const):
        (WebCore::AccessibilityObject::defaultObjectInclusion const):
        (WebCore::AccessibilityObject::setIsIgnoredFromParentDataForChild):
        (WebCore::AccessibilityObject::supportsARIAReadOnly const): Deleted.
        (WebCore::AccessibilityObject::ariaReadOnlyValue const): Deleted.
        (WebCore::AccessibilityObject::isAriaModalDescendant const): Deleted.
        (WebCore::AccessibilityObject::isAriaModalNode const): Deleted.
        (WebCore::AccessibilityObject::ignoredFromARIAModalPresence const): Deleted.
        (WebCore::AccessibilityObject::isARIAHidden const): Deleted.
        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityObject::isHidden const):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
        (WebCore::AccessibilityRenderObject::isSelected const):
        (WebCore::AccessibilityRenderObject::canSetExpandedAttribute const):
        (WebCore::AccessibilityRenderObject::liveRegionAtomic const):
        (WebCore::AccessibilityRenderObject::isBusy const):
        * accessibility/AccessibleNode.cpp:
        (WebCore::ariaAttributeMap):
        (WebCore::isPropertyValueBoolean):
        (WebCore::AccessibleNode::effectiveBoolValueForElement):
        (WebCore::AccessibleNode::boolValueForProperty):
        (WebCore::AccessibleNode::setBoolProperty):
        (WebCore::AccessibleNode::atomic const):
        (WebCore::AccessibleNode::setAtomic):
        (WebCore::AccessibleNode::busy const):
        (WebCore::AccessibleNode::setBusy):
        (WebCore::AccessibleNode::disabled const):
        (WebCore::AccessibleNode::setDisabled):
        (WebCore::AccessibleNode::expanded const):
        (WebCore::AccessibleNode::setExpanded):
        (WebCore::AccessibleNode::hidden const):
        (WebCore::AccessibleNode::setHidden):
        (WebCore::AccessibleNode::modal const):
        (WebCore::AccessibleNode::setModal):
        (WebCore::AccessibleNode::multiline const):
        (WebCore::AccessibleNode::setMultiline):
        (WebCore::AccessibleNode::multiselectable const):
        (WebCore::AccessibleNode::setMultiselectable):
        (WebCore::AccessibleNode::readOnly const):
        (WebCore::AccessibleNode::setReadOnly):
        (WebCore::AccessibleNode::required const):
        (WebCore::AccessibleNode::setRequired):
        (WebCore::AccessibleNode::selected const):
        (WebCore::AccessibleNode::setSelected):
        * accessibility/AccessibleNode.h:
        * accessibility/AccessibleNode.idl:
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):
        (setAtkStateSetFromCoreObject):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

2017-11-17  Alex Christensen  <achristensen@webkit.org>

        Clean up URL.h
        https://bugs.webkit.org/show_bug.cgi?id=179710

        Reviewed by Brady Eidson.

        No change in behavior.

        * Modules/fetch/FetchRequest.cpp:
        (WebCore::FetchRequest::urlString const):
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::url const):
        * platform/URL.cpp:
        (WebCore::URL::serialize const): Deleted.
        * platform/URL.h:
        * platform/mac/URLMac.mm:
        (WebCore::URL::createCFURL const):

2017-11-17  Alex Christensen  <achristensen@webkit.org>

        Use RunLoop and Mode from NetworkingContext if they are given
        https://bugs.webkit.org/show_bug.cgi?id=179800
        <rdar://problem/35519421>

        Reviewed by Brady Eidson.

        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (callOnMainThreadOrSchedule):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

2017-11-17  Simon Fraser  <simon.fraser@apple.com>

        FETurbulence const and inline cleanup
        https://bugs.webkit.org/show_bug.cgi?id=179832

        Reviewed by Dean Jackson.

        Pass the PaintingData& around as const, and remove some 'inline', letting the compiler
        decide. Also declare a few variables closer to first use.
        
        Speeds up FETurbulence by about 1%.

        * platform/graphics/filters/FETurbulence.cpp:
        (WebCore::FETurbulence::initPaint):
        (WebCore::FETurbulence::noise2D):
        (WebCore::FETurbulence::calculateTurbulenceValueForPoint):
        (WebCore::FETurbulence::fillRegion):
        * platform/graphics/filters/FETurbulence.h:

2017-11-17  Antti Koivisto  <antti@apple.com>

        Move destroyLeftoverChildren call to RenderObject::destroy
        https://bugs.webkit.org/show_bug.cgi?id=179819

        Reviewed by Zalan Bujtas.

        This is currently called inconsistenly from various willBeDestroyed implementations.
        We should always call it before invoking willBeDestroyed.

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::willBeDestroyed):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::willBeDestroyed):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::setLastChild):
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::willBeDestroyed):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::~RenderLayer):

            Add some release asserts verifying layer has been detached before destruction.
            This would reveal cases where destroyLeftoverChildren was called too late.

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::destroy):

            Call destroyLeftoverChildren.

2017-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>

        SVG scrolling anchor should be reset if the fragmentIdentifier does not exist or is not provided
        https://bugs.webkit.org/show_bug.cgi?id=176577

        Reviewed by Simon Fraser.

        Because the SVGImage can be cached only once but used multiple times with
        different fragmentIdentifiers, SVGImage has to call FrameView::scrollToFragment()
        before the image is displayed. If the fragmentIdentifier is not provided
        in the URL or it does not exist in the SVGImage, FrameView::scrollToFragment()
        has to reset the scrolling anchor of the SVG as if it was not displayed before.
        We do not want the previous scrolling anchor to be used when the FrameView
        of SVGImage can't scroll to the current fragmentIdentifier for any reason.

        Test: http/tests/svg/svg-fragment-url-special-cases.html

        * page/FrameView.cpp:
        (WebCore::FrameView::scrollToFragment):
        (WebCore::FrameView::scrollToAnchor):
        (WebCore::FrameView::resetScrollAnchor):
        * page/FrameView.h:
        * platform/URL.cpp:
        (WebCore::URL::fragmentIdentifier const): Call hasFragmentIdentifier() 
        instead of repeating the same condition.
        (WebCore::decodeURLEscapeSequences):
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::findViewAnchor const):
        (WebCore::SVGSVGElement::findRootAnchor const):
        (WebCore::SVGSVGElement::scrollToAnchor): We want to know whether the SVG 
        root element could scroll to the fragmentIdentifier or not. If it could not,
        FrameView::scrollToAnchor() can still try one last time to do the scrolling
        only if anchorElement is not nullptr.
        (WebCore::SVGSVGElement::resetScrollAnchor): Reset the FrameView scrolling
        state to its initial value.
        * svg/SVGSVGElement.h:

2017-11-17  Youenn Fablet  <youenn@apple.com>

        ServiceWorker intercepted FetchRequest should have their referrer set appropriately.
        https://bugs.webkit.org/show_bug.cgi?id=179803

        Reviewed by Chris Dumez.

        Covered by updated tests.

        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::dispatchFetchEvent):

2017-11-17  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [GTK] Regression: accessibility/gtk/aria-keyshortcuts.html fails after r224953
        https://bugs.webkit.org/show_bug.cgi?id=179824

        Reviewed by Chris Fleizach.

        The failure was due to AXPropertyName::KeyShortcuts not being included in
        the group of properties whose value is a string. As a result, the new method
        to get string values, AccessibleNode::effectiveStringValueForElement(), was
        returning an empty String. This was not caught by the shared set of tests
        because at the present time, only WebKitGtk supports aria-keyshortcuts.

        No new tests needed. The regression was caught by an existing test.

        * accessibility/AccessibleNode.cpp:
        (WebCore::isPropertyValueString):

2017-11-17  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r224952.

        This change introduced LayoutTest failures on WK1.

        Reverted changeset:

        "Use RunLoop and Mode from NetworkingContext if they are
        given"
        https://bugs.webkit.org/show_bug.cgi?id=179800
        https://trac.webkit.org/changeset/224952

2017-11-16  Antoine Quint  <graouts@apple.com>

        [Web Animations] Force a stacking context during animations that animate properties that will force a stacking context
        https://bugs.webkit.org/show_bug.cgi?id=179811

        Reviewed by Dean Jackson.

        The Web Animations specification mandates in section 4.7 (w3c.github.io/web-animations/#side-effects-section) that
        "for every property targeted by at least one animation effect that is current or in effect, the user agent must act
        as if the will-change property ([css-will-change-1]) on the target element includes the property."

        After parsing new keyframes, we check if any of the CSS properties that get animated would end up forcing a stacking
        context, and if so, enforce a stacking context during the entire active lifetime of the animation.

        Test: webanimations/animation-opacity-animation-crash.html

        * animation/KeyframeEffect.cpp:
        (WebCore::KeyframeEffect::processKeyframes):
        (WebCore::KeyframeEffect::computeStackingContextImpact):
        (WebCore::KeyframeEffect::applyAtLocalTime):
        * animation/KeyframeEffect.h:

2017-11-17  Ali Juma  <ajuma@chromium.org>

        Update feature status for Visual Viewport API to "In Development"
        https://bugs.webkit.org/show_bug.cgi?id=179818

        Reviewed by Frédéric Wang.

        Work on this feature has started, tracked by bug 170982.

        No new tests since there's no change in behavior.

        * features.json:

2017-11-16  Yousuke Kimoto  <yousuke.kimoto@sony.com>

        [WinCairo] Add network (curl) files for wincairo webkit
        https://bugs.webkit.org/show_bug.cgi?id=179474

        Reviewed by Alex Christensen.

        No new behvaior, no new tests.

        * PlatformWinCairo.cmake:
        * platform/Curl.cmake:
        * platform/network/curl/CookieStorageCurl.cpp: Added.
        (WebCore::startObservingCookieChanges):
        (WebCore::stopObservingCookieChanges):
        * platform/network/curl/NetworkStorageSessionCurl.cpp: Added.
        (WebCore::NetworkStorageSession::~NetworkStorageSession):
        (WebCore::NetworkStorageSession::context const):
        (WebCore::defaultSession):
        (WebCore::NetworkStorageSession::ensureSession):
        (WebCore::NetworkStorageSession::switchToNewTestingSession):
        (WebCore::NetworkStorageSession::setCookies):
        (WebCore::NetworkStorageSession::setCookie):
        (WebCore::NetworkStorageSession::deleteCookie):
        (WebCore::NetworkStorageSession::getAllCookies):
        (WebCore::NetworkStorageSession::getCookies):
        (WebCore::NetworkStorageSession::flushCookieStore):

2017-11-16  Alex Christensen  <achristensen@webkit.org>

        Fix occasional crash when adding and removing videos
        https://bugs.webkit.org/show_bug.cgi?id=179792

        Reviewed by Geoffrey Garen.

        In taskCompleted we null out session, and in resume we call _restart on the main thread.
        If _restart is called after taskCompleted, we want to do nothing.
        Right now we are calling a method on self.session.loader which is a PlatformMediaResourceLoader&
        but in ObjC if session is null it will call PlatformMediaResourceLoader::requestResource with a
        null this pointer, which crashes.  Let's not crash.

        * platform/network/cocoa/WebCoreNSURLSession.mm:
        (-[WebCoreNSURLSessionDataTask _restart]):
        Early return if we don't have a session.

2017-11-16  Don Olmstead  <don.olmstead@sony.com>

        [WinCairo] Update WinCairoRequirements
        https://bugs.webkit.org/show_bug.cgi?id=179790

        Reviewed by Alex Christensen.

        No new tests. No change in behavior.

        * PlatformWin.cmake:

2017-11-16  Antoine Quint  <graouts@apple.com>

        [Web Animations] Allow KeyframeEffect to support CSS property animation blending
        https://bugs.webkit.org/show_bug.cgi?id=179810

        Reviewed by Tim Horton.

        We used to pass nullptr instead of a valid AnimationBase when calling CSSPropertyAnimation::blendProperties()
        in KeyframeEffect::applyAtLocalTime() when blending CSS styles during a keyframe animation. Without this
        AnimationBase, some blending functions would crash as certain supporting calls couldn't be made.

        We now add a new CSSPropertyBlendingClient virtual interface that both KeyframeEffect and AnimationBase
        implement and that CSSPropertyAnimation::blendProperties() take as a parameter in order to support
        blending code.

        * WebCore.xcodeproj/project.pbxproj:
        * animation/CSSPropertyBlendingClient.h: Added.
        * animation/KeyframeEffect.cpp:
        (WebCore::KeyframeEffect::applyAtLocalTime):
        (WebCore::KeyframeEffect::renderer const):
        (WebCore::KeyframeEffect::currentStyle const):
        * animation/KeyframeEffect.h:
        * page/animation/AnimationBase.h:
        (WebCore::AnimationBase::isAccelerated const):
        (WebCore::AnimationBase::transformFunctionListsMatch const):
        (WebCore::AnimationBase::filterFunctionListsMatch const):
        (WebCore::AnimationBase::backdropFilterFunctionListsMatch const):
        * page/animation/CSSPropertyAnimation.cpp:
        (WebCore::blendFunc):
        (WebCore::blendFilterOperations):
        (WebCore::blendFilter):
        (WebCore::crossfadeBlend):
        (WebCore::PropertyWrapperAcceleratedBackdropFilter::blend const):
        (WebCore::PropertyWrapperShadow::blendSimpleOrMatchedShadowLists const):
        (WebCore::PropertyWrapperShadow::blendMismatchedShadowLists const):
        (WebCore::CSSPropertyAnimation::blendProperties):
        * page/animation/CSSPropertyAnimation.h:

2017-11-16  Youenn Fablet  <youenn@apple.com>

        Service Worker should get the body of intercepted requests
        https://bugs.webkit.org/show_bug.cgi?id=179776

        Reviewed by Alex Christensen.

        Test: http/tests/workers/service/service-worker-request-with-body.https.html

        Make use of FetchBodyConsumer to store raw data for FetchRequest.
        This is used when setting FetchRequest body from a FormData.
        If FormData is only bytes (no blob, no file), FetchBodyConsumer will store that data.
        This allows Service Worker to get access to simple request bodies.

        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::fromFormData):
        (WebCore::FetchBody::consume):
        (WebCore::FetchBody::bodyAsFormData const): Making sure body is set appropriately when used to make fetch load.
        * Modules/fetch/FetchBody.h: Making some methods private.
        * Modules/fetch/FetchBodyConsumer.h: Adding accessors.
        (WebCore::FetchBodyConsumer::hasData const):
        (WebCore::FetchBodyConsumer::data const):
        * Modules/fetch/FetchRequest.h:
        (WebCore::FetchRequest::FetchRequest):
        * platform/network/FormData.cpp:
        (WebCore::FormData::asSharedBuffer const):
        * platform/network/FormData.h:
        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::dispatchFetchEvent): Setting FetchRequest body based on given FormData.

2017-11-16  Chris Dumez  <cdumez@apple.com>

        Make sure service workers get terminated between tests
        https://bugs.webkit.org/show_bug.cgi?id=179774

        Reviewed by Alex Christensen.

        Make sure service workers get terminated between tests. Previously, we
        would merely clear all registrations and job queues but it would not
        cause the registrations' service workers to get terminated.

        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::updateExtendedEventsSet):
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::clearAll):
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptFetchFinished):
        (WebCore::SWServerJobQueue::scriptContextFailedToStart):
        (WebCore::SWServerJobQueue::didFinishInstall):
        (WebCore::SWServerJobQueue::tryClearRegistration):
        (WebCore::SWServerJobQueue::clearRegistration):
        * workers/service/server/SWServerJobQueue.h:

2017-11-16  Youenn Fablet  <youenn@apple.com>

        FetchLoader should unregister its blob URL
        https://bugs.webkit.org/show_bug.cgi?id=179768

        Reviewed by Alex Christensen.

        No observable change.

        Keep the blob URL used for reading and unregister it in destructor.

        * Modules/fetch/FetchLoader.cpp:
        (WebCore::FetchLoader::~FetchLoader):
        (WebCore::FetchLoader::start):
        * Modules/fetch/FetchLoader.h:

2017-11-16  Nan Wang  <n_wang@apple.com>

        AX: AOM: Implement string type properties
        https://bugs.webkit.org/show_bug.cgi?id=179495

        Reviewed by Chris Fleizach.

        Implemented the rest of the string type properties for Accessibility
        Object Model.

        Test: accessibility/mac/AOM-string-properties.html

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::handleLiveRegionCreated):
        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::childrenChanged):
        (WebCore::AccessibilityNodeObject::isPressed const):
        (WebCore::AccessibilityNodeObject::isChecked const):
        (WebCore::AccessibilityNodeObject::valueDescription const):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
        (WebCore::AccessibilityObject::supportsAutoComplete const):
        (WebCore::AccessibilityObject::autoCompleteValue const):
        (WebCore::AccessibilityObject::invalidStatus const):
        (WebCore::AccessibilityObject::supportsCurrent const):
        (WebCore::AccessibilityObject::currentState const):
        (WebCore::AccessibilityObject::currentValue const):
        (WebCore::AccessibilityObject::roleDescription const):
        (WebCore::AccessibilityObject::keyShortcutsValue const):
        (WebCore::AccessibilityObject::placeholderValue const):
        (WebCore::AccessibilityObject::isInsideLiveRegion const):
        (WebCore::AccessibilityObject::liveRegionAncestor const):
        (WebCore::AccessibilityObject::supportsARIAAttributes const):
        (WebCore::AccessibilityObject::supportsLiveRegion const):
        (WebCore::AccessibilityObject::sortDirection const):
        (WebCore::AccessibilityObject::supportsHasPopup const):
        (WebCore::AccessibilityObject::hasPopupValue const):
        (WebCore::AccessibilityObject::supportsPressed const):
        (WebCore::AccessibilityObject::checkboxOrRadioValue const):
        (WebCore::AccessibilityObject::pressedIsPresent const):
        (WebCore::AccessibilityObject::buttonRoleType const):
        (WebCore::AccessibilityObject::supportsARIAAutoComplete const): Deleted.
        (WebCore::AccessibilityObject::ariaAutoCompleteValue const): Deleted.
        (WebCore::AccessibilityObject::supportsARIACurrent const): Deleted.
        (WebCore::AccessibilityObject::ariaCurrentState const): Deleted.
        (WebCore::AccessibilityObject::ariaCurrentValue const): Deleted.
        (WebCore::AccessibilityObject::ariaKeyShortcutsValue const): Deleted.
        (WebCore::AccessibilityObject::isInsideARIALiveRegion const): Deleted.
        (WebCore::AccessibilityObject::ariaLiveRegionAncestor const): Deleted.
        (WebCore::AccessibilityObject::supportsARIALiveRegion const): Deleted.
        (WebCore::AccessibilityObject::supportsARIAHasPopup const): Deleted.
        (WebCore::AccessibilityObject::ariaPopupValue const): Deleted.
        (WebCore::AccessibilityObject::supportsARIAPressed const): Deleted.
        (WebCore::AccessibilityObject::ariaPressedIsPresent const): Deleted.
        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityObject::hasPopup const):
        (WebCore::AccessibilityObject::liveRegionStatus const):
        (WebCore::AccessibilityObject::liveRegionRelevant const):
        (WebCore::AccessibilityObject::liveRegionAtomic const):
        (WebCore::AccessibilityObject::ariaHasPopup const): Deleted.
        (WebCore::AccessibilityObject::ariaLiveRegionStatus const): Deleted.
        (WebCore::AccessibilityObject::ariaLiveRegionRelevant const): Deleted.
        (WebCore::AccessibilityObject::ariaLiveRegionAtomic const): Deleted.
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::hasPopup const):
        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
        (WebCore::AccessibilityRenderObject::orientation const):
        (WebCore::AccessibilityRenderObject::textChanged):
        (WebCore::AccessibilityRenderObject::liveRegionStatus const):
        (WebCore::AccessibilityRenderObject::liveRegionRelevant const):
        (WebCore::AccessibilityRenderObject::liveRegionAtomic const):
        (WebCore::AccessibilityRenderObject::ariaHasPopup const): Deleted.
        (WebCore::AccessibilityRenderObject::ariaLiveRegionStatus const): Deleted.
        (WebCore::AccessibilityRenderObject::ariaLiveRegionRelevant const): Deleted.
        (WebCore::AccessibilityRenderObject::ariaLiveRegionAtomic const): Deleted.
        * accessibility/AccessibilityRenderObject.h:
        * accessibility/AccessibleNode.cpp:
        (WebCore::ariaAttributeMap):
        (WebCore::isPropertyValueString):
        (WebCore::AccessibleNode::notifyAttributeChanged):
        (WebCore::AccessibleNode::autocomplete const):
        (WebCore::AccessibleNode::setAutocomplete):
        (WebCore::AccessibleNode::checked const):
        (WebCore::AccessibleNode::setChecked):
        (WebCore::AccessibleNode::current const):
        (WebCore::AccessibleNode::setCurrent):
        (WebCore::AccessibleNode::hasPopUp const):
        (WebCore::AccessibleNode::setHasPopUp):
        (WebCore::AccessibleNode::invalid const):
        (WebCore::AccessibleNode::setInvalid):
        (WebCore::AccessibleNode::keyShortcuts const):
        (WebCore::AccessibleNode::setKeyShortcuts):
        (WebCore::AccessibleNode::live const):
        (WebCore::AccessibleNode::setLive):
        (WebCore::AccessibleNode::setLabel):
        (WebCore::AccessibleNode::orientation const):
        (WebCore::AccessibleNode::setOrientation):
        (WebCore::AccessibleNode::placeholder const):
        (WebCore::AccessibleNode::setPlaceholder):
        (WebCore::AccessibleNode::pressed const):
        (WebCore::AccessibleNode::setPressed):
        (WebCore::AccessibleNode::relevant const):
        (WebCore::AccessibleNode::setRelevant):
        (WebCore::AccessibleNode::role const):
        (WebCore::AccessibleNode::setRole):
        (WebCore::AccessibleNode::roleDescription const):
        (WebCore::AccessibleNode::setRoleDescription):
        (WebCore::AccessibleNode::sort const):
        (WebCore::AccessibleNode::setSort):
        (WebCore::AccessibleNode::valueText const):
        (WebCore::AccessibleNode::setValueText):
        * accessibility/AccessibleNode.h:
        (WebCore::AXPropertyHashTraits::constructDeletedValue):
        (WebCore::AXPropertyHashTraits::isDeletedValue):
        * accessibility/AccessibleNode.idl:
        * accessibility/atk/AXObjectCacheAtk.cpp:
        (WebCore::AXObjectCache::postPlatformNotification):
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):
        (atkRole):
        (setAtkStateSetFromCoreObject):
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper accessibilityHasPopup]):
        (-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionStatus]):
        (-[WebAccessibilityObjectWrapper accessibilityARIARelevantStatus]):
        (-[WebAccessibilityObjectWrapper accessibilityARIALiveRegionIsAtomic]):
        (-[WebAccessibilityObjectWrapper accessibilitySupportsARIAPressed]):
        (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
        (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

2017-11-16  Alex Christensen  <achristensen@webkit.org>

        Use RunLoop and Mode from NetworkingContext if they are given
        https://bugs.webkit.org/show_bug.cgi?id=179800
        <rdar://problem/35519421>

        Reviewed by Brady Eidson.

        We used to call [NSURLConnection scheduleInRunLoop:forMode:] before r224267.
        That change broke WebKitLegacy clients using custom run loop modes, which I partially fixed in r224687 and r224896,
        but that hangs if there are any non-scheduled calls to callOnMainThread and it ignores the CFRunLoop part of the SchedulePair.
        This is a more elegant solution that fixes all known bugs with custom run loop modes and makes the
        behavior as close to the pre-r224267 behavior as possible by using all parameters in a good way.

        I verified the bug in the radar is fixed, the API test WebKitLegacy.ScheduleInRunLoop still passes,
        and UIWebView still works on iOS.

        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (callOnMainThreadOrSchedule):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

2017-11-16  Daniel Bates  <dabates@apple.com>

        Add feature define for alternative presentation button element
        https://bugs.webkit.org/show_bug.cgi?id=179692
        Part of <rdar://problem/34917108>

        Reviewed by Andy Estes.

        Only enabled on Cocoa platforms by default.

        * Configurations/FeatureDefines.xcconfig:

2017-11-16  Chris Dumez  <cdumez@apple.com>

        [Service Worker] Implement "Try Clear Registration" algorithm
        https://bugs.webkit.org/show_bug.cgi?id=179791

        Reviewed by Youenn Fablet.

        Implement "Try Clear Registration" algorithm:
        - https://w3c.github.io/ServiceWorker/#try-clear-registration-algorithm

        In particular, a SWServerRegistration now knows if it is "in use" by a given
        service worker client (i.e. The registration's active service worker is
        controlling the service worker client). See:
        - https://w3c.github.io/ServiceWorker/#selection (last paragraph)

        No new tests, rebaselined existing tests.

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::setActiveServiceWorker):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::serviceWorkerStartedControllingClient):
        (WebCore::SWServer::Connection::serviceWorkerStoppedControllingClient):
        (WebCore::SWServer::serviceWorkerStartedControllingClient):
        (WebCore::SWServer::serviceWorkerStoppedControllingClient):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::tryClearRegistration):
        * workers/service/server/SWServerRegistration.h:
        (WebCore::SWServerRegistration::hasClientsUsingRegistration const):
        (WebCore::SWServerRegistration::addClientUsingRegistration):
        (WebCore::SWServerRegistration::removeClientUsingRegistration):

2017-11-16  Michael Catanzaro  <mcatanzaro@igalia.com>

        REGRESSION(r224179): layer flush now requires sync IPC to compute undo/redo availability in EditorState
        https://bugs.webkit.org/show_bug.cgi?id=179797

        Reviewed by Simon Fraser.

        Editor::canUndo and Editor::CanRedo no longer need to be exported.

        * editing/Editor.h:

2017-11-16  Chris Dumez  <cdumez@apple.com>

        Dispatching an event on a ServiceWorkerRegistration may fail or crash due to GC
        https://bugs.webkit.org/show_bug.cgi?id=179751

        Reviewed by Geoffrey Garen.

        Dispatching an event on a ServiceWorkerRegistration may fail or crash due to GC. We
        need to make sure that a ServiceWorkerRegistration's wrapper stays alive as long as
        we may dispatch events on it.

        Keep the wrapper alive by making ServiceWorker an ActiveDOMObject and making sure the
        implementation object keeps a PendingActivity alive while it may dispatch JS events.
        The only event dispatched on ServiceWorkerRegistration objects is the "updatefound"
        one. We may dispatch updatefound events on a ServiceWorkerRegistration until the
        registration gets cleared on server side, in which case the ServiceWorkerRegistration
        object ends up with no service worker. We therefore take a PendingActivity when the
        ServiceWorkerRegistration is constructed and we release it once the registration has
        no more associated ServiceWorker or the ActiveDOMObject is stopped (to avoid leaks on
        navigation).

        Test: http/tests/workers/service/service-worker-registration-gc-event.html

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent):
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::getOrCreate):
        (WebCore::ServiceWorkerRegistration::updateStateFromServer):
        (WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent):
        (WebCore::ServiceWorkerRegistration::stop):
        (WebCore::ServiceWorkerRegistration::updatePendingActivityForEventDispatch):
        * workers/service/ServiceWorkerRegistration.h:
        * workers/service/ServiceWorkerRegistration.idl:

2017-11-16  Chris Dumez  <cdumez@apple.com>

        Crash in WebCore::SWServerJobQueue::scriptFetchFinished(WebCore::SWServer::Connection&, WebCore::ServiceWorkerFetchResult const&) + 77
        https://bugs.webkit.org/show_bug.cgi?id=179394
        <rdar://problem/35478190>

        Reviewed by Youenn Fablet.

        In SWServerJobQueue::scriptFetchFinished(), make sure the job queue is still processing the
        job that triggered the fetch. If it is not, ignore the callback.

        This could happen when calling SWServer::clear() while a script fetch was pending.

        No new tests, already covered by existing tests that sometimes crash on the bots.

        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::isCurrentlyProcessingJob const):
        (WebCore::SWServerJobQueue::scriptFetchFinished):
        * workers/service/server/SWServerJobQueue.h:

2017-11-16  Brady Eidson  <beidson@apple.com>

        Crash in worker tests handling the m_stoppedCallback.
        <rdar://problem/35590875> and https://bugs.webkit.org/show_bug.cgi?id=179798

        Reviewed by Chris Dumez.

        No new tests (Covered by existing tests).

        Protect manipulation of m_stoppedCallback with m_threadCreationAndWorkerGlobalScopeMutex.

        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::workerThread):
        (WebCore::WorkerThread::stop):

2017-11-16  Antoine Quint  <graouts@apple.com>

        [Web Animations] Express time in milliseconds through the API
        https://bugs.webkit.org/show_bug.cgi?id=179799

        Reviewed by Simon Fraser.

        While internally we use seconds to specify times and durations, the Web Animations API
        uses milliseconds, so we have to convert times and durations from and to milliseconds.

        * animation/AnimationEffectTiming.h:
        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::bindingsCurrentTime):
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::bindingsStartTime const):
        (WebCore::WebAnimation::setBindingsStartTime):
        (WebCore::WebAnimation::bindingsCurrentTime const):
        (WebCore::WebAnimation::setBindingsCurrentTime):
        * testing/Internals.cpp:
        (WebCore::Internals::setTimelineCurrentTime):

2017-11-16  Michael Catanzaro  <mcatanzaro@igalia.com>

        REGRESSION(r224887): GCC 5 build broken
        https://bugs.webkit.org/show_bug.cgi?id=179750

        Reviewed by Jer Noble.

        Add a legacy FourCC constructor that will be used only when building with GCC 5. This is
        bad, but it seems acceptable for use with a fallback codepath.

        Unfortunately, this requires adjusting some initializations to avoid ambiguity with the
        uint32_t constructor.

        * platform/graphics/FourCC.h:
        (WebCore::FourCC::FourCC):
        * platform/graphics/iso/ISOBox.cpp:
        (WebCore::ISOBox::peekBox):
        * platform/graphics/iso/ISOBox.h:
        * platform/graphics/iso/ISOOriginalFormatBox.h:
        * platform/graphics/iso/ISOSchemeTypeBox.h:

2017-11-16  Andy Estes  <aestes@apple.com>

        [Payment Request] Update feature status to "Supported In Preview"
        https://bugs.webkit.org/show_bug.cgi?id=179793

        Reviewed by Tim Horton.

        * features.json:

2017-11-16  Antoine Quint  <graouts@apple.com>

        Clean up KeyframeEffect
        https://bugs.webkit.org/show_bug.cgi?id=179777

        Reviewed by Daniel Bates.

        A few review comments came in after https://bugs.webkit.org/show_bug.cgi?id=179707 landed,
        addressing them with this follow-up patch.

        * animation/KeyframeEffect.cpp:
        (WebCore::KeyframeEffect::create): Use "keyframeEffect" instead of "result" for clarity.
        (WebCore::KeyframeEffect::processKeyframes): Use consistent index and length types while iterating
        over properties in PropertyNameArray and explicitly size the properties array since we already
        know its final size.
        * dom/Element.cpp:
        (WebCore::Element::getAnimations):

2017-11-16  Zalan Bujtas  <zalan@apple.com>

        Always invoke RenderObject::insertedIntoTree/willBeRemovedFromTree
        https://bugs.webkit.org/show_bug.cgi?id=178007

        Reviewed by Antti Koivisto.

        Based on Antti Koivisto's patch:
        These call are currently skipped in some cases making them bug prone and difficult to reason about.
        This is done as an optimization that doesn't appear to be valuable anymore.

        Covered by existing tests.

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::makeChildrenNonInline):
        (WebCore::RenderBlock::dropAnonymousBoxChild):
        (WebCore::RenderBlock::takeChild):
        * rendering/RenderBlock.h:
        (WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::styleDidChange):
        (WebCore::RenderBlockFlow::moveAllChildrenIncludingFloatsTo):
        * rendering/RenderBlockFlow.h:
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::splitAnonymousBoxesAroundChild):
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::moveChildTo):
        (WebCore::RenderBoxModelObject::moveChildrenTo):
        * rendering/RenderBoxModelObject.h:
        (WebCore::RenderBoxModelObject::moveChildTo):
        (WebCore::RenderBoxModelObject::moveAllChildrenTo):
        (WebCore::RenderBoxModelObject::moveChildrenTo):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::addChild):
        (WebCore::RenderElement::takeChild):
        (WebCore::RenderElement::insertChildInternal):
        (WebCore::RenderElement::takeChildInternal):
        (WebCore::RenderElement::handleDynamicFloatPositionChange):
        * rendering/RenderElement.h:
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::splitInlines):
        (WebCore::RenderInline::splitFlow):
        (WebCore::RenderInline::childBecameNonInline):
        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
        * rendering/RenderRubyBase.cpp:
        (WebCore::RenderRubyBase::moveInlineChildren):
        (WebCore::RenderRubyBase::moveBlockChildren):
        * rendering/RenderRubyRun.cpp:
        (WebCore::RenderRubyRun::takeChild):
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows):
        * style/RenderTreeUpdaterMultiColumn.cpp:
        (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
        (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):

2017-11-14  Dean Jackson  <dino@apple.com>

        Add a base class for HTMLCanvasElement and OffscreenCanvas
        https://bugs.webkit.org/show_bug.cgi?id=179701
        <rdar://problem/35545195>

        Reviewed by Sam Weinig.

        In order for OffscreenCanvas to be able to create a WebGLRenderingContext,
        there needs to be a shared base class with HTMLCanvasElement. Add such a
        class called CanvasBase.

        There is a lot of potential for functionality to move into the base class, but
        unfortunately HTMLCanvasElement is a bit messy. It implements a lot of the 2d
        rendering context functionality, and also many const functions that actually
        cause changes. Thus, things like the canvas size have to remain in the subclasses
        for now.

        The existence of the new base class meant the canvas() accessor in CanvasRenderingContext
        had to move out into the subclasses, and do the correct casting. Eventually, at least
        for WebGLRenderingContext, this will have a change in behaviour, but for now we only
        ever use HTMLCanvasElements, so most of these changes are just for the sake of
        compilation.

        No behaviour change - covered by existing tests.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * html/CanvasBase.cpp: Copied from Source/WebCore/html/canvas/GPUBasedCanvasRenderingContext.h.
        (WebCore::CanvasBase::CanvasBase): New base class.
        (WebCore::CanvasBase::asHTMLCanvasElement): Casts to an HTMLCanvasElement*, which many of the
        rendering context code uses.
        * html/CanvasBase.h: Copied from Source/WebCore/html/canvas/GPUBasedCanvasRenderingContext.h.
        (WebCore::CanvasBase::isHTMLCanvasElement const):
        (WebCore::CanvasBase::isOffscreenCanvas const):
        (WebCore::CanvasBase::setOriginClean):
        (WebCore::CanvasBase::setOriginTainted):
        (WebCore::CanvasBase::originClean const):
        (WebCore::CanvasBase::securityOrigin const):
        (WebCore::CanvasBase::scriptExecutionContext const):

        * html/HTMLCanvasElement.cpp: Use the base class methods where possible.
        (WebCore::HTMLCanvasElement::HTMLCanvasElement):
        (WebCore::HTMLCanvasElement::toDataURL):
        (WebCore::HTMLCanvasElement::toBlob):
        (WebCore::HTMLCanvasElement::createImageBuffer const): Be explict as to
        which of the derived classes scriptExecutionContext() method we are calling.

        * html/HTMLCanvasElement.h: Use the base class, mark a few things as virtual,
        and remove the parts that are now in CanvasBase.

        * html/OffscreenCanvas.cpp: Use the base class.
        (WebCore::OffscreenCanvas::OffscreenCanvas):
        (WebCore::OffscreenCanvas::size const):
        (WebCore::OffscreenCanvas::setSize):
        * html/OffscreenCanvas.h:

        * html/canvas/CanvasRenderingContext.cpp:
        (WebCore::CanvasRenderingContext::CanvasRenderingContext):
        (WebCore::CanvasRenderingContext::ref): Call the correct ref/deref functions, depending
        on the base class type.
        (WebCore::CanvasRenderingContext::deref):
        (WebCore::CanvasRenderingContext::wouldTaintOrigin): We no longer have a canvas() method.
        (WebCore::CanvasRenderingContext::checkOrigin):

        * html/canvas/CanvasRenderingContext.h:
        (WebCore::CanvasRenderingContext::canvasBase const): Add this accessor to the base canvas object
        to replace the canvas() call.
        (WebCore::CanvasRenderingContext::checkOrigin):
        (WebCore::CanvasRenderingContext::ref): Deleted.
        (WebCore::CanvasRenderingContext::deref): Deleted.
        (WebCore::CanvasRenderingContext::canvas const): Deleted.

        * html/canvas/CanvasRenderingContext2D.cpp: Use the base class.
        (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D):
        * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/GPUBasedCanvasRenderingContext.h:
        (WebCore::GPUBasedCanvasRenderingContext::GPUBasedCanvasRenderingContext):
        * html/canvas/ImageBitmapRenderingContext.cpp:
        (WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
        (WebCore::ImageBitmapRenderingContext::canvas const):
        (WebCore::ImageBitmapRenderingContext::setOutputBitmap):
        * html/canvas/ImageBitmapRenderingContext.h:
        * html/canvas/PlaceholderRenderingContext.cpp:
        (WebCore::PlaceholderRenderingContext::PlaceholderRenderingContext):
        * html/canvas/PlaceholderRenderingContext.h:
        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::WebGL2RenderingContext):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::WebGLRenderingContext):

        * html/canvas/WebGLRenderingContext.h:
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::create): Assume that we're still getting an HTMLCanvasElement,
        but protect some of the logic just in case we don't.
        (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
        (WebCore::WebGLRenderingContextBase::canvas):
        (WebCore::WebGLRenderingContextBase::checkForContextLossHandling):
        (WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
        (WebCore::WebGLRenderingContextBase::setupFlags):
        (WebCore::WebGLRenderingContextBase::addActivityStateChangeObserverIfNecessary):
        (WebCore::WebGLRenderingContextBase::removeActivityStateChangeObserver):
        (WebCore::WebGLRenderingContextBase::markContextChanged):
        (WebCore::WebGLRenderingContextBase::markContextChangedAndNotifyCanvasObserver):
        (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
        (WebCore::WebGLRenderingContextBase::reshape):
        (WebCore::WebGLRenderingContextBase::compileShader):
        (WebCore::WebGLRenderingContextBase::isContextLostOrPending):
        (WebCore::WebGLRenderingContextBase::readPixels):
        (WebCore::WebGLRenderingContextBase::loseContextImpl):
        (WebCore::WebGLRenderingContextBase::printToConsole):
        (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
        (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
        (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
        (WebCore::WebGLRenderingContextBase::clampedCanvasSize):
        * html/canvas/WebGLRenderingContextBase.h:
        * html/canvas/WebGLRenderingContextBase.idl:
        * html/canvas/WebGPURenderingContext.cpp:
        (WebCore::WebGPURenderingContext::create):
        (WebCore::WebGPURenderingContext::WebGPURenderingContext):
        (WebCore::WebGPURenderingContext::canvas const):
        (WebCore::WebGPURenderingContext::clampedCanvasSize const):
        * html/canvas/WebGPURenderingContext.h:
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::recordCanvasAction):
        (WebCore::InspectorInstrumentation::didEnableExtension):
        (WebCore::InspectorInstrumentation::didCreateProgram):
        (WebCore::InspectorInstrumentation::willDeleteProgram):
        (WebCore::InspectorInstrumentation::isShaderProgramDisabled):
        * inspector/agents/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::recordCanvasAction):
        (WebCore::InspectorCanvasAgent::didEnableExtension):
        (WebCore::InspectorCanvasAgent::didCreateProgram):

2017-11-16  Colin Bendell  <colin@bendell.ca>

        Added mime type check to the picture source preloader to avoid downloading incompatible resources.
        https://bugs.webkit.org/show_bug.cgi?id=179231

        Reviewed by Alex Christensen.

        Test: http/tests/loading/preload-picture-type.html

        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): include type match state when selecting candidate imgs
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): added type attribute evaluation and matching

2017-11-16  Chris Dumez  <cdumez@apple.com>

        Dispatching an event on a ServiceWorker may fail or crash due to GC
        https://bugs.webkit.org/show_bug.cgi?id=179745

        Reviewed by Geoffrey Garen.

        Dispatching an event on a ServiceWorker may fail or crash due to GC. We need to make sure
        that a ServiceWorker's wrapper stays alive as long as we may dispatch events on it.

        Keep the wrapper alive by making ServiceWorker an ActiveDOMObject and making sure the
        implementation object keeps a PendingActivity alive while it may dispatch JS events.
        The only event dispatched on ServiceWorker objects is the "statechange" one. We may
        dispatch statechange events on a ServiceWorker until its state becomes "redundant".
        We therefore take a PendingActivity when the ServiceWorker's state is or becomes
        non-redundant (becoming non redundant can only happen when switching initially from
        redundant to installing, at which point the ServiceWorker object is not exposed to
        the JS yet). We release the PendingActivity when the ServiceWorker's state becomes
        redundant or the ActiveDOMObject is stopped (to avoid leaks on navigation).

        Test: http/tests/workers/service/service-worker-gc-event.html

        * workers/service/ServiceWorker.cpp:
        (WebCore::mutableAllWorkers):
        (WebCore::ServiceWorker::removeFromAllWorkers):
        (WebCore::ServiceWorker::getOrCreate):
        (WebCore::ServiceWorker::ServiceWorker):
        (WebCore::ServiceWorker::~ServiceWorker):
        (WebCore::ServiceWorker::scheduleTaskToUpdateState):
        (WebCore::ServiceWorker::activeDOMObjectName const):
        (WebCore::ServiceWorker::canSuspendForDocumentSuspension const):
        (WebCore::ServiceWorker::stop):
        (WebCore::ServiceWorker::updatePendingActivityForEventDispatch):
        * workers/service/ServiceWorker.h:
        * workers/service/ServiceWorker.idl:

2017-11-16  Frederic Wang  <fwang@igalia.com>

        Consider non-main frames for frameViewRootLayerDidChange
        https://bugs.webkit.org/show_bug.cgi?id=178508

        Reviewed by Antonio Gomes.

        No new tests, behavior unchanged.

        AsyncScrollingCoordinator::frameViewRootLayerDidChange assumes that frameView is always a
        main-frame. It calls ensureRootStateNodeForFrameView, which always attaches a frame node with
        null parent ID. It also has an ASSERT to check m_scrollingStateTree->rootStateNode(), instead
        of m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()). This patch makes the
        ASSERT more generic. It also adds an early return into ensureRootStateNodeForFrameView when the
        node already exists so that the call to attachToStateTree can be skipped. It turns out that that
        call is actually only necessary for main frame, so another ASSERT is added to verify it.

        * page/scrolling/AsyncScrollingCoordinator.cpp:
        (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange): Modify the ASSERT to
        verify the availability of a scrolling node for the frame, not just the root node.
        (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): Add an early return to
        skip the call to attachToStateTree when the node is actually already available. Add an ASSERT to
        ensure that attaching a new node is only necessary for main frames.

2017-11-16  Miguel Gomez  <magomez@igalia.com>

        [TexMap] Remove use of GraphicsContext3D
        https://bugs.webkit.org/show_bug.cgi?id=174860

        Reviewed by Žan Doberšek.

        Remove remaining uses of GC3D that are not WebGL related:
        - Remove the option to create a GC3D to render to the curren OpenGL context.
        - Remove the remaining usage of GC3D inside MediaPlayerPrivateGStreamerBase.
        - Replace the usage inside TextureMapper with direct OpenGL calls, and use a
        VAO when the OpenGL version is higher than 3.2.

        This also modifies TextureMapperContextAttributes so all the tested features are
        supported when using OpenGL, and we only check for the extensions when using GLES2.

        No new tests as there's no behavior change.

        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/GraphicsContext3DPrivate.cpp:
        (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
        * platform/graphics/GraphicsContext3DPrivate.h:
        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
        (WebCore::GraphicsContext3D::~GraphicsContext3D):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        * platform/graphics/texmap/TextureMapper.h:
        * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
        (WebCore::TextureMapperContextAttributes::initialize):
        * platform/graphics/texmap/TextureMapperContextAttributes.h:
        * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
        (WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
        (WebCore::TextureMapperGC3DPlatformLayer::makeContextCurrent):
        (WebCore::TextureMapperGC3DPlatformLayer::platformContext):
        (WebCore::TextureMapperGC3DPlatformLayer::swapBuffersIfNeeded):
        (WebCore::TextureMapperGC3DPlatformLayer::paintToTextureMapper):
        * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
        * platform/graphics/texmap/TextureMapperGL.cpp:
        (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData):
        (WebCore::TextureMapperGLData::TextureMapperGLData):
        (WebCore::TextureMapperGLData::~TextureMapperGLData):
        (WebCore::TextureMapperGLData::initializeStencil):
        (WebCore::TextureMapperGLData::getStaticVBO):
        (WebCore::TextureMapperGLData::getVAO):
        (WebCore::TextureMapperGLData::getShaderProgram):
        (WebCore::TextureMapperGL::TextureMapperGL):
        (WebCore::TextureMapperGL::beginPainting):
        (WebCore::TextureMapperGL::endPainting):
        (WebCore::TextureMapperGL::drawBorder):
        (WebCore::prepareFilterProgram):
        (WebCore::TextureMapperGL::drawTexture):
        (WebCore::TextureMapperGL::drawSolidColor):
        (WebCore::TextureMapperGL::clearColor):
        (WebCore::TextureMapperGL::drawEdgeTriangles):
        (WebCore::TextureMapperGL::drawUnitRect):
        (WebCore::TextureMapperGL::draw):
        (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
        (WebCore::TextureMapperGL::drawFiltered):
        (WebCore::TextureMapperGL::bindDefaultSurface):
        (WebCore::TextureMapperGL::beginClip):
        (WebCore::TextureMapperGL::createTexture):
        * platform/graphics/texmap/TextureMapperGL.h:

2017-11-16  Frederic Wang  <fwang@igalia.com>

        ASSERTION FAILED: !isAnonymous() in WebCore::RenderMathMLOperator::updateTokenContent
        https://bugs.webkit.org/show_bug.cgi?id=166011

        Reviewed by Alejandro G. Castro.

        RenderMathMLFencedOperator does not support mathvariant or displaystyle transforms. This is
        one of several issues of the mfenced element (see bug 160509). However,
        MathMLStyle::updateStyleIfNeeded() still tries to use the implementation of the parent
        RenderMathMLOperator class, which only works for non-anonymous operators. This patch skips
        the updateTokenContent() calls for anonymous mfenced operators in order to avoid ASSERTION
        failures.

        Test: mathml/mfenced-displaystyle-and-mathvariant-crash.html

        * rendering/mathml/MathMLStyle.cpp:
        (WebCore::MathMLStyle::updateStyleIfNeeded): Skip anonymous token elements.

2017-11-15  Brady Eidson  <beidson@apple.com>

        Implement basics of "Terminate Service Worker" algorithm.
        https://bugs.webkit.org/show_bug.cgi?id=179551

        Reviewed by Chris Dumez.

        No new tests (No observable behavior change yet).

        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::stopIndexedDatabase):

        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::workerThreadCreated):
        (WebCore::WorkerMessagingProxy::terminateWorkerGlobalScope):

        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::workerThread):
        (WebCore::WorkerThread::stop):
        * workers/WorkerThread.h:

        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::terminateWorker):
        * workers/service/context/SWContextManager.h:

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::workerContextTerminated):
        (WebCore::SWServer::terminateWorker):
        * workers/service/server/SWServer.h:

        * workers/service/server/SWServerToContextConnection.cpp:
        (WebCore::SWServerToContextConnection::workerTerminated):
        * workers/service/server/SWServerToContextConnection.h:

        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::terminate):
        (WebCore::SWServerWorker::contextTerminated):
        * workers/service/server/SWServerWorker.h:

2017-11-15  Eric Carlson  <eric.carlson@apple.com>

        Log media readyState and networkState as strings
        https://bugs.webkit.org/show_bug.cgi?id=179732

        Reviewed by Youenn Fablet.

        * html/HTMLMediaElement.cpp:
        (WebCore::convertEnumerationToString):
        (WebCore::HTMLMediaElement::scheduleDelayedAction): Fix logic error.
        (WebCore::HTMLMediaElement::pendingActionTimerFired): Fix incorrect log string.
        (WebCore::HTMLMediaElement::setNetworkState): Don't cast to int for logging.
        (WebCore::HTMLMediaElement::setReadyState): Ditto. Log when autoplay is blocked.

        * html/HTMLMediaElementEnums.h:
        (PAL::LogArgument<WebCore::HTMLMediaElementEnums::ReadyState>::toString): New.
        (PAL::LogArgument<WebCore::HTMLMediaElementEnums::NetworkState>::toString): New.

        * platform/graphics/MediaPlayer.cpp:
        (WebCore::convertEnumerationToString):
        * platform/graphics/MediaPlayerEnums.h:
        (PAL::LogArgument<WebCore::MediaPlayerEnums::ReadyState>::toString):
        (PAL::LogArgument<WebCore::MediaPlayerEnums::NetworkState>::toString):

        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        (WebCore::MediaPlayerPrivateAVFoundation::updateStates): Log strings.

2017-11-15  Youenn Fablet  <youenn@apple.com>

        Service Worker fetch should handle empty responses
        https://bugs.webkit.org/show_bug.cgi?id=179740

        Reviewed by Alex Christensen.

        Covered by updated test.

        * Modules/streams/ReadableStreamSink.cpp:
        (WebCore::ReadableStreamToSharedBufferSink::enqueue): Not create a buffer until actually needed.
        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::processResponse): Check for null buffers.

2017-11-15  Youenn Fablet  <youenn@apple.com>

        ReloadFromOrigin loads should not select any service worker
        https://bugs.webkit.org/show_bug.cgi?id=179736

        Reviewed by Brady Eidson.

        Test: http/tests/workers/service/shift-reload-navigation.html

        In case of ReloadFromOrigin (equivalent of shift reload), do not select any service worker.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::startLoadingMainResource):
        * loader/FrameLoader.h:
        (WebCore::FrameLoader::isReloadingFromOrigin const):

2017-11-15  Zalan Bujtas  <zalan@apple.com>

        AX triggers sync layout while building the render tree on www.macrumors.com.
        https://bugs.webkit.org/show_bug.cgi?id=179741
        rdar://problem/35462531

        Reviewed by Antti Koivisto.

        It's unsafe to issue layout while mutating the render tree. If a mutation
        requires AX to issue a layout, it needs to be issued in a delayed manner (which the render
        tree mutation will trigger anyway). 

        Unable to reproduce.

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::updateBackingStore):

2017-11-15  Antoine Quint  <graouts@apple.com>

        [Web Animations] Implement basic to-from animations
        https://bugs.webkit.org/show_bug.cgi?id=179707
        <rdar://problem/34932456>

        We can now actually perform an animation, in software only, when provided two keyframes on an AnimationEffect.
        To parse a keyframes object from JS, we use the StyleResolver to create RenderStyle objects based on the strings
        provided for the property names and values. Then, when the DocumentTimeline indicates that animations are ready
        to be updated, we invalidate the style of elements with animations, so that during style resolution we can perform
        blending between the RenderStyles for each keyframe.

        Reviewed by Dean Jackson.

        * animation/AnimationEffect.h:
        (WebCore::AnimationEffect::~AnimationEffect): Deleted.
        * animation/AnimationTimeline.h:
        (WebCore::AnimationTimeline::elementToAnimationsMap const):
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::animationResolutionTimerFired):
        (WebCore::DocumentTimeline::updateAnimations): Renamed from resolveAnimations() since we're not
        actually resolving animations, merely invalidating styles in preparation for resolution.
        (WebCore::DocumentTimeline::resolveAnimations): Deleted.
        * animation/DocumentTimeline.h:
        * animation/KeyframeEffect.cpp:
        (WebCore::KeyframeEffect::create): Pass the keyframes argument to setKeyframes() and forward the
        exception in case one was raised in the setter.
        (WebCore::KeyframeEffect::setKeyframes): Pass the keyframes argument to processKeyframes() and
        forward the exception in case one was raised during processing.
        (WebCore::KeyframeEffect::processKeyframes): Deal with exactly two keyframes, set at 0 and 1 offsets,
        specified in array forms for the keyframes object. As we parse the content of the provided JS object,
        we create RenderStyle objects using the element's StyleResolver from a CSS text string we create
        based on the property and values as strings.
        (WebCore::KeyframeEffect::applyAtLocalTime): Compute the progress based on the local time and duration,
        using the existing CSSPropertyAnimation::blendProperties() mechanics to perform the blend between the
        from and to keyframes.
        * animation/KeyframeEffect.h:
        * animation/KeyframeEffect.idl:
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::resolve):
        * animation/WebAnimation.h:
        * bindings/IDLTypes.h:
        (WebCore::IDLObject::nullValue): Make JSC::Strong an optional type.
        * dom/Document.h:
        (WebCore::Document::existingTimeline const): Provide an explicit method for call sites to check existence
        of a timeline before forcing one to be created if missing by calling timeline().
        * dom/Element.cpp:
        (WebCore::Element::getAnimations): Do not force the creation of a timeline if one isn't already created.
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::createAnimatedElementUpdate): When applying styles, account for any Web
        Animation applied to the provided element.

2017-11-15  Frederic Wang  <fwang@igalia.com>

        ASSERTION FAILED: !renderer->needsLayout() in WebCore::RenderBlock::checkPositionedObjectsNeedLayout with MathML
        https://bugs.webkit.org/show_bug.cgi?id=178865

        Reviewed by Manuel Rego Casasnovas.

        MathML token elements can contain HTML elements and hence MathML elements can contain
        out-of-flow positioned descendants. Also all MathML elements can be containing block and hence
        should position their out-of-flow positioned descendants before calling clearNeedsLayout().
        This patch does that in all places in the MathML renderer classes, except a few of them:
        - RenderMathMLSpace, which can not have descendants.
        - RenderMathMLToken and RenderMathMLOperator, since they will use the layout implementation
          of RenderMathMLBlock when they contain non-text children.
        The patch also fixes an ASSERTION failure in WebCore::RenderBlock::checkPositionedObjectsNeedLayout
        due to some descendants that are not laid out.

        Test: mathml/out-of-flow-in-token-crash.html

        * rendering/mathml/RenderMathMLBlock.cpp:
        (WebCore::RenderMathMLBlock::layoutBlock): Call layoutPositionedObjects.
        (WebCore::RenderMathMLBlock::layoutInvalidMarkup): Ditto and pass the relayoutChildren boolean.
        * rendering/mathml/RenderMathMLBlock.h: Add a relayoutChildren boolean to layoutInvalidMarkup.
        * rendering/mathml/RenderMathMLFraction.cpp:
        (WebCore::RenderMathMLFraction::layoutBlock): Pass the relayoutChildren boolean to layoutInvalidMarkup
        and call layoutPositionedObjects.
        * rendering/mathml/RenderMathMLRoot.cpp:
        (WebCore::RenderMathMLRoot::layoutBlock): Ditto.
        * rendering/mathml/RenderMathMLScripts.cpp:
        (WebCore::RenderMathMLScripts::layoutBlock): Ditto.
        * rendering/mathml/RenderMathMLUnderOver.cpp:
        (WebCore::RenderMathMLUnderOver::layoutBlock): Ditto.
        * rendering/mathml/RenderMathMLMenclose.cpp:
        (WebCore::RenderMathMLMenclose::layoutBlock): Call layoutPositionedObjects.
        * rendering/mathml/RenderMathMLPadded.cpp:
        (WebCore::RenderMathMLPadded::layoutBlock): Ditto.
        * rendering/mathml/RenderMathMLRow.cpp:
        (WebCore::RenderMathMLRow::layoutBlock): Ditto.

2017-11-15  Youenn Fablet  <youenn@apple.com>

        Add ServiceWorker to WebProcess plumbery for FormData fetch responses
        https://bugs.webkit.org/show_bug.cgi?id=179694

        Reviewed by Alex Christensen.

        No observable changes since we are not actually loading FormData right now.

        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::processResponse):
        * workers/service/context/ServiceWorkerFetch.h:

2017-11-15  Jer Noble  <jer.noble@apple.com>

        Add a compile-time-checked string literal initializer for FourCC.
        https://bugs.webkit.org/show_bug.cgi?id=179706

        Reviewed by Alex Christensen.

        Add a contexpr constructor for FourCC that takes a string literal and static_asserts that it
        is exactly 4 chars long. Use this string literal constructor everywhere instead of multi-
        character literals.

        * platform/graphics/FourCC.h:
        (WebCore::FourCC::FourCC):
        * platform/graphics/iso/ISOBox.cpp:
        (WebCore::ISOBox::parse):
        * platform/graphics/iso/ISOOriginalFormatBox.h:
        (WebCore::ISOOriginalFormatBox::boxTypeName):
        * platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
        (WebCore::ISOProtectionSchemeInfoBox::boxTypeName):
        * platform/graphics/iso/ISOSchemeInformationBox.h:
        (WebCore::ISOSchemeInformationBox::boxTypeName):
        * platform/graphics/iso/ISOSchemeTypeBox.h:
        (WebCore::ISOSchemeTypeBox::boxTypeName):
        * platform/graphics/iso/ISOTrackEncryptionBox.h:
        (WebCore::ISOTrackEncryptionBox::boxTypeName):
        * platform/graphics/iso/ISOVTTCue.h:
        (WebCore::ISOWebVTTCue::boxTypeName):

2017-11-15  Adrian Perez de Castro  <aperez@igalia.com>

        [Cairo] Clang warns about mismatched declaration type tag for GraphicsContextState
        https://bugs.webkit.org/show_bug.cgi?id=179729

        Reviewed by Michael Catanzaro.

        No new tests needed.

        * platform/graphics/cairo/CairoOperations.h: Make the forward declaration use "struct" 
        as the actual implementation of the type does.

2017-11-15  Chris Dumez  <cdumez@apple.com>

        [Service Workers] Implement Client API
        https://bugs.webkit.org/show_bug.cgi?id=179709

        Reviewed by Alex Christensen.

        Implement Client API as per:
        - https://w3c.github.io/ServiceWorker/#client-interface

        Tests:
        http/tests/workers/service/Client-properties.html
        http/tests/workers/service/Client-properties-subframe.html
        http/tests/workers/service/Client-properties-auxiliary.html

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::postMessage):
        * workers/service/ServiceWorkerClient.cpp:
        (WebCore::ServiceWorkerClient::ServiceWorkerClient):
        (WebCore::ServiceWorkerClient::url const):
        (WebCore::ServiceWorkerClient::type const):
        (WebCore::ServiceWorkerClient::frameType const):
        (WebCore::ServiceWorkerClient::id const):
        (WebCore::ServiceWorkerClient::postMessage):
        * workers/service/ServiceWorkerClient.h:
        (WebCore::ServiceWorkerClient::create):
        * workers/service/ServiceWorkerClientData.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerWindowClient.cpp.
        (WebCore::toServiceWorkerClientFrameType):
        (WebCore::ServiceWorkerClientData::isolatedCopy const):
        (WebCore::ServiceWorkerClientData::from):
        * workers/service/ServiceWorkerClientData.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.h.
        (WebCore::ServiceWorkerClientData::encode const):
        (WebCore::ServiceWorkerClientData::decode):
        * workers/service/ServiceWorkerClientIdentifier.h:
        (WebCore::ServiceWorkerClientIdentifier::encode const):
        (WebCore::ServiceWorkerClientIdentifier::decode):
        * workers/service/ServiceWorkerTypes.h:
        * workers/service/ServiceWorkerWindowClient.cpp:
        (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
        * workers/service/ServiceWorkerWindowClient.h:
        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
        * workers/service/context/SWContextManager.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/server/SWClientConnection.h:

2017-11-15  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r224863.

        Introduced LayoutTest crashes on iOS Simulator.

        Reverted changeset:

        "Move JSONValues to WTF and convert uses of InspectorValues.h
        to JSONValues.h"
        https://bugs.webkit.org/show_bug.cgi?id=173793
        https://trac.webkit.org/changeset/224863

2017-11-15  Youenn Fablet  <youenn@apple.com>

        Remove service worker selection based on registration
        https://bugs.webkit.org/show_bug.cgi?id=179705

        Reviewed by Alex Christensen.

        Covered by updated tests.

        Selection is now handled at navigation time.
        We can remove the selection/unselection of worker based on registration.

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):

2017-11-15  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] GraphicsContext::setPlatformShadow() has to update state's shadow offset when ignoring transforms
        https://bugs.webkit.org/show_bug.cgi?id=179725

        Reviewed by Carlos Garcia Campos.

        In r224753, GraphicsContext::setPlatformShadow() stopped updating the
        shadow offset value that's kept in GraphicsContextState. This regressed
        a few tests, so the adjustment of the shadow offset value in the
        GraphicsContext state is brought back.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::State::setShadowValues):
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::setPlatformShadow):

2017-11-15  Gabriel Ivascu  <givascu@igalia.com>

        [GTK] Automatically adjust font size when gtk-xft-dpi changes
        https://bugs.webkit.org/show_bug.cgi?id=142673

        Some follow-up fixes for the previous patch.

        Reviewed by Carlos Garcia Campos.

        * platform/PlatformScreen.h:
        * platform/gtk/PlatformScreenGtk.cpp:
        (WebCore::screenDPIObserverHandlersMap):
        (WebCore::gtkXftDPIChangedCallback):
        (WebCore::setScreenDPIObserverHandler):
        * platform/wpe/PlatformScreenWPE.cpp:
        (WebCore::setScreenDPIObserverHandler):

2017-11-14  Nan Wang  <n_wang@apple.com>

        AX: AOM: Implement AccessibleNode class and support label and role attributes
        https://bugs.webkit.org/show_bug.cgi?id=179494

        Reviewed by Ryosuke Niwa.

        Accessibility Object Model
        Explainer: https://wicg.github.io/aom/explainer.html
        Spec: https://wicg.github.io/aom/spec/

        This change adds an accessibleNode getter on Element, and implements
        the role and label properties of AccessibleNode. 

        In existing accessibility code, places where we previously retrieve an 
        ARIA attribute are replaced with a new function that first checks the 
        AOM property and then checks the equivalent ARIA attribute.

        Test: accessibility/accessibility-object-model.html

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * accessibility/AXObjectCache.cpp:
        (WebCore::nodeHasRole):
        (WebCore::AXObjectCache::handleLiveRegionCreated):
        * accessibility/AccessibilityAllInOne.cpp:
        * accessibility/AccessibilityImageMapLink.cpp:
        (WebCore::AccessibilityImageMapLink::roleValue const):
        (WebCore::AccessibilityImageMapLink::accessibilityDescription const):
        * accessibility/AccessibilityListBoxOption.cpp:
        (WebCore::AccessibilityListBoxOption::stringValue const):
        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::ariaAccessibilityDescription const):
        (WebCore::siblingWithAriaRole):
        (WebCore::AccessibilityNodeObject::textForLabelElement const):
        (WebCore::AccessibilityNodeObject::alternativeText const):
        (WebCore::AccessibilityNodeObject::alternativeTextForWebArea const):
        (WebCore::AccessibilityNodeObject::stringValue const):
        (WebCore::accessibleNameForNode):
        (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::hasProperty const):
        (WebCore::AccessibilityObject::stringValueForProperty const):
        (WebCore::AccessibilityObject::supportsARIAAttributes const):
        * accessibility/AccessibilityObject.h:
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::stringValue const):
        (WebCore::AccessibilityRenderObject::exposesTitleUIElement const):
        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
        * accessibility/AccessibleNode.cpp: Added.
        (WebCore::ariaAttributeMap):
        (WebCore::isPropertyValueString):
        (WebCore::AccessibleNode::hasProperty):
        (WebCore::AccessibleNode::valueForProperty):
        (WebCore::AccessibleNode::effectiveStringValueForElement):
        (WebCore::AccessibleNode::stringValueForProperty):
        (WebCore::AccessibleNode::setStringProperty):
        (WebCore::AccessibleNode::role const):
        (WebCore::AccessibleNode::setRole):
        (WebCore::AccessibleNode::label const):
        (WebCore::AccessibleNode::setLabel):
        * accessibility/AccessibleNode.h: Added.
        (WebCore::AXPropertyHashTraits::emptyValue):
        (WebCore::AXPropertyHashTraits::constructDeletedValue):
        (WebCore::AXPropertyHashTraits::isDeletedValue):
        (WebCore::AccessibleNode::AccessibleNode):
        (WebCore::AccessibleNode::ref):
        (WebCore::AccessibleNode::deref):
        * accessibility/AccessibleNode.idl: Added.
        * bindings/js/WebCoreBuiltinNames.h:
        * dom/Element.cpp:
        (WebCore::Element::canContainRangeEndPoint const):
        (WebCore::Element::accessibleNode):
        (WebCore::Element::existingAccessibleNode const):
        * dom/Element.h:
        * dom/Element.idl:
        * dom/ElementRareData.cpp:
        * dom/ElementRareData.h:
        (WebCore::ElementRareData::accessibleNode const):
        (WebCore::ElementRareData::setAccessibleNode):
        * editing/TextIterator.cpp:
        (WebCore::isRendererReplacedElement):
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setAccessibilityObjectModelEnabled):
        (WebCore::RuntimeEnabledFeatures::accessibilityObjectModelEnabled const):
        * rendering/RenderMenuList.cpp:
        (RenderMenuList::itemAccessibilityText const):

2017-11-14  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Add GraphicsContextImplCairo stub
        https://bugs.webkit.org/show_bug.cgi?id=179658

        Reviewed by Carlos Garcia Campos.

        Add the GraphicsContextImplCairo class, which at this point is still
        an empty implementation of the GraphicsContextImpl interface. Plan for
        the near future is to start mapping method invocations to CairoOperation
        functions, essentially mirroring what the Cairo-specific GraphicsContext
        methods do today.

        In the future this implementation would hopefully allow us to apply a
        recorded list of GraphicsContext commands against a PlatformContextCairo
        instance.

        * platform/SourcesCairo.txt:
        * platform/graphics/cairo/GraphicsContextImplCairo.cpp: Added.
        (WebCore::GraphicsContextImplCairo::GraphicsContextImplCairo):
        (WebCore::m_platformContext):
        (WebCore::GraphicsContextImplCairo::updateState):
        (WebCore::GraphicsContextImplCairo::clearShadow):
        (WebCore::GraphicsContextImplCairo::setLineCap):
        (WebCore::GraphicsContextImplCairo::setLineDash):
        (WebCore::GraphicsContextImplCairo::setLineJoin):
        (WebCore::GraphicsContextImplCairo::setMiterLimit):
        (WebCore::GraphicsContextImplCairo::fillRect):
        (WebCore::GraphicsContextImplCairo::fillRoundedRect):
        (WebCore::GraphicsContextImplCairo::fillRectWithRoundedHole):
        (WebCore::GraphicsContextImplCairo::fillPath):
        (WebCore::GraphicsContextImplCairo::fillEllipse):
        (WebCore::GraphicsContextImplCairo::strokeRect):
        (WebCore::GraphicsContextImplCairo::strokePath):
        (WebCore::GraphicsContextImplCairo::strokeEllipse):
        (WebCore::GraphicsContextImplCairo::clearRect):
        (WebCore::GraphicsContextImplCairo::drawGlyphs):
        (WebCore::GraphicsContextImplCairo::drawImage):
        (WebCore::GraphicsContextImplCairo::drawTiledImage):
        (WebCore::GraphicsContextImplCairo::drawNativeImage):
        (WebCore::GraphicsContextImplCairo::drawPattern):
        (WebCore::GraphicsContextImplCairo::drawRect):
        (WebCore::GraphicsContextImplCairo::drawLine):
        (WebCore::GraphicsContextImplCairo::drawLinesForText):
        (WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker):
        (WebCore::GraphicsContextImplCairo::drawEllipse):
        (WebCore::GraphicsContextImplCairo::drawPath):
        (WebCore::GraphicsContextImplCairo::drawFocusRing):
        (WebCore::GraphicsContextImplCairo::save):
        (WebCore::GraphicsContextImplCairo::restore):
        (WebCore::GraphicsContextImplCairo::translate):
        (WebCore::GraphicsContextImplCairo::rotate):
        (WebCore::GraphicsContextImplCairo::scale):
        (WebCore::GraphicsContextImplCairo::concatCTM):
        (WebCore::GraphicsContextImplCairo::beginTransparencyLayer):
        (WebCore::GraphicsContextImplCairo::endTransparencyLayer):
        (WebCore::GraphicsContextImplCairo::clip):
        (WebCore::GraphicsContextImplCairo::clipOut):
        (WebCore::GraphicsContextImplCairo::clipPath):
        (WebCore::GraphicsContextImplCairo::applyDeviceScaleFactor):
        * platform/graphics/cairo/GraphicsContextImplCairo.h: Added.

2017-11-14  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Clean up CairoOperations, GradientCairo, GraphicsContextCairo implementation files
        https://bugs.webkit.org/show_bug.cgi?id=179679

        Reviewed by Michael Catanzaro.

        Clean up random tidbits in the CairoOperations, GradientCairo and
        GraphicsContextCairo implementation files that I've been ravaging
        through over the last few days.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/CairoOperations.cpp:
        Add a missing <algorithms> include, drop an unnecessary empty line.
        (WebCore::Cairo::drawLine):
        * platform/graphics/cairo/GradientCairo.cpp:
        Add a missing CairoOperations.h include.
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        Drop unnecessary includes and a bunch of redundant helper functions.
        (WebCore::GraphicsContext::drawLineForText):
        Inline the DashArray object construction into the relay call.
        (WebCore::GraphicsContext::drawLinesForText):
        size_t can't be negative, so just check for DashArray being empty.
        (WebCore::fillRectWithColor): Deleted.
        (): Deleted.
        (WebCore::drawPathShadow): Deleted.
        (WebCore::fillCurrentCairoPath): Deleted.
        (WebCore::shadowAndFillCurrentCairoPath): Deleted.
        (WebCore::shadowAndStrokeCurrentCairoPath): Deleted.

2017-11-14  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, another attempt to fix builds after r224707
        https://bugs.webkit.org/show_bug.cgi?id=179499
        <rdar://problem/35445033>

        * PlatformWin.cmake:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-11-14  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r224860.

        This change broke the macOS and iOS builds.

        Reverted changeset:

        "Unreviewed, fix CMake debug builds after r224707"
        https://bugs.webkit.org/show_bug.cgi?id=179499
        https://trac.webkit.org/changeset/224860

2017-11-14  Antti Koivisto  <antti@apple.com>

        Media query with :host inside a custom elements doesn't get updated on window resize
        https://bugs.webkit.org/show_bug.cgi?id=176101
        <rdar://problem/34163850>

        Reviewed by Simon Fraser.

        If a media query containing :host or ::slotted stops applying we fail to update the style.

        * style/StyleScope.cpp:
        (WebCore::Style::invalidateHostAndSlottedStyleIfNeeded):

            Factor into function.

        (WebCore::Style::Scope::updateActiveStyleSheets):
        (WebCore::Style::Scope::scheduleUpdate):

            Invalidate elements that may match :host and ::slotted before clearing style resolver for full update.

2017-11-14  Carlos Garcia Campos  <cgarcia@igalia.com>

        Move JSONValues to WTF and convert uses of InspectorValues.h to JSONValues.h
        https://bugs.webkit.org/show_bug.cgi?id=173793

        Reviewed by Brian Burg.

        Based on patch by Brian Burg.

        * ForwardingHeaders/inspector/InspectorValues.h: Removed.
        * Modules/encryptedmedia/InitDataRegistry.cpp:
        (WebCore::extractKeyIDsKeyids):
        (WebCore::sanitizeKeyids):
        * html/parser/XSSAuditorDelegate.cpp:
        (WebCore::XSSAuditorDelegate::generateViolationReport):
        * inspector/CommandLineAPIHost.cpp:
        (WebCore::CommandLineAPIHost::inspect):
        * inspector/CommandLineAPIHost.h:
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::recordAction):
        (WebCore::InspectorCanvas::releaseData):
        (WebCore::InspectorCanvas::indexForData):
        (WebCore::buildArrayForVector):
        (WebCore::InspectorCanvas::buildInitialState):
        (WebCore::InspectorCanvas::buildAction):
        (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
        (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
        (WebCore::InspectorCanvas::buildArrayForImageData):
        (WebCore::InspectorCanvas::buildArrayForImageBitmap):
        * inspector/InspectorCanvas.h:
        * inspector/InspectorDatabaseResource.cpp:
        * inspector/InspectorOverlay.cpp:
        (WebCore::evaluateCommandInOverlay):
        (WebCore::InspectorOverlay::evaluateInOverlay):
        * inspector/InspectorOverlay.h:
        * inspector/InspectorShaderProgram.h:
        * inspector/InspectorStyleSheet.h:
        (WebCore::InspectorCSSId::InspectorCSSId):
        * inspector/TimelineRecordFactory.cpp:
        (WebCore::TimelineRecordFactory::createGenericRecord):
        (WebCore::TimelineRecordFactory::createFunctionCallData):
        (WebCore::TimelineRecordFactory::createConsoleProfileData):
        (WebCore::TimelineRecordFactory::createProbeSampleData):
        (WebCore::TimelineRecordFactory::createEventDispatchData):
        (WebCore::TimelineRecordFactory::createGenericTimerData):
        (WebCore::TimelineRecordFactory::createTimerInstallData):
        (WebCore::TimelineRecordFactory::createEvaluateScriptData):
        (WebCore::TimelineRecordFactory::createTimeStampData):
        (WebCore::TimelineRecordFactory::createAnimationFrameData):
        (WebCore::createQuad):
        (WebCore::TimelineRecordFactory::createPaintData):
        (WebCore::TimelineRecordFactory::appendLayoutRoot):
        * inspector/TimelineRecordFactory.h:
        * inspector/agents/InspectorApplicationCacheAgent.cpp:
        * inspector/agents/InspectorApplicationCacheAgent.h:
        * inspector/agents/InspectorCSSAgent.cpp:
        (WebCore::computePseudoClassMask):
        (WebCore::InspectorCSSAgent::setStyleText):
        (WebCore::InspectorCSSAgent::setRuleSelector):
        (WebCore::InspectorCSSAgent::forcePseudoState):
        * inspector/agents/InspectorCSSAgent.h:
        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::parseColor):
        (WebCore::parseConfigColor):
        (WebCore::parseQuad):
        (WebCore::InspectorDOMAgent::performSearch):
        (WebCore::InspectorDOMAgent::setSearchingForNode):
        (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
        (WebCore::InspectorDOMAgent::setInspectModeEnabled):
        (WebCore::InspectorDOMAgent::highlightRect):
        (WebCore::InspectorDOMAgent::highlightQuad):
        (WebCore::InspectorDOMAgent::innerHighlightQuad):
        (WebCore::InspectorDOMAgent::highlightSelector):
        (WebCore::InspectorDOMAgent::highlightNode):
        (WebCore::InspectorDOMAgent::highlightNodeList):
        (WebCore::InspectorDOMAgent::highlightFrame):
        * inspector/agents/InspectorDOMAgent.h:
        * inspector/agents/InspectorDOMDebuggerAgent.cpp:
        (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
        (WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode):
        (WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode):
        (WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr):
        (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
        (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
        (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
        * inspector/agents/InspectorDOMDebuggerAgent.h:
        * inspector/agents/InspectorDOMStorageAgent.cpp:
        (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
        (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
        (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
        (WebCore::InspectorDOMStorageAgent::findStorageArea):
        * inspector/agents/InspectorDOMStorageAgent.h:
        * inspector/agents/InspectorDatabaseAgent.cpp:
        * inspector/agents/InspectorIndexedDBAgent.cpp:
        (WebCore::Inspector::idbKeyFromInspectorObject):
        (WebCore::Inspector::idbKeyRangeFromKeyRange):
        (WebCore::InspectorIndexedDBAgent::requestData):
        * inspector/agents/InspectorIndexedDBAgent.h:
        * inspector/agents/InspectorNetworkAgent.cpp:
        (WebCore::buildObjectForHeaders):
        (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
        (WebCore::InspectorNetworkAgent::setExtraHTTPHeaders):
        * inspector/agents/InspectorNetworkAgent.h:
        * inspector/agents/InspectorPageAgent.cpp:
        * inspector/agents/InspectorPageAgent.h:
        * inspector/agents/InspectorTimelineAgent.cpp:
        (WebCore::InspectorTimelineAgent::setInstruments):
        (WebCore::InspectorTimelineAgent::internalStart):
        (WebCore::InspectorTimelineAgent::didInvalidateLayout):
        (WebCore::InspectorTimelineAgent::willLayout):
        (WebCore::InspectorTimelineAgent::didScheduleStyleRecalculation):
        (WebCore::InspectorTimelineAgent::willRecalculateStyle):
        (WebCore::InspectorTimelineAgent::willComposite):
        (WebCore::InspectorTimelineAgent::willPaint):
        (WebCore::InspectorTimelineAgent::addRecordToTimeline):
        (WebCore::InspectorTimelineAgent::setFrameIdentifier):
        (WebCore::InspectorTimelineAgent::appendRecord):
        (WebCore::InspectorTimelineAgent::sendEvent):
        (WebCore::InspectorTimelineAgent::createRecordEntry):
        (WebCore::InspectorTimelineAgent::pushCurrentRecord):
        * inspector/agents/InspectorTimelineAgent.h:
        * page/csp/ContentSecurityPolicy.cpp:
        (WebCore::ContentSecurityPolicy::reportViolation const):
        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::parseJSONObject):
        (WebCore::parseLicenseFormat):
        (WebCore::parseLicenseReleaseAcknowledgementFormat):
        (WebCore::CDMInstanceClearKey::updateLicense):
        (WebCore::CDMInstanceClearKey::removeSessionData):
        * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
        (WebCore::extractSinfData):
        * testing/Internals.cpp:

2017-11-14  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix CMake debug builds after r224707
        https://bugs.webkit.org/show_bug.cgi?id=179499
        <rdar://problem/35445033>

        * PlatformWin.cmake:
        * Sources.txt:

2017-11-14  Michael Catanzaro  <mcatanzaro@igalia.com>

        Another attempt to fix GTK/WPE debug builds
        https://bugs.webkit.org/show_bug.cgi?id=179660

        * platform/graphics/cairo/NativeImageCairo.cpp:
        (WebCore::drawNativeImage):

2017-11-14  Alex Christensen  <achristensen@webkit.org>

        Fix Windows build.

        * html/canvas/WebGLRenderingContext.h:

2017-11-14  Chris Dumez  <cdumez@apple.com>

        [Service Workers] Implement container.getRegistrations()
        https://bugs.webkit.org/show_bug.cgi?id=179672

        Reviewed by Brady Eidson.

        Implement container.getRegistrations():
        - https://w3c.github.io/ServiceWorker/#dom-serviceworkercontainer-getregistrations

        No new tests, rebaselined existing test.

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::getRegistration):
        (WebCore::ServiceWorkerContainer::getRegistrations):
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::getOrCreate):
        * workers/service/ServiceWorkerRegistration.h:
        * workers/service/ServiceWorkerRegistrationKey.cpp:
        (WebCore::ServiceWorkerRegistrationKey::isMatching const):
        (WebCore::ServiceWorkerRegistrationKey::originIsMatching const):
        * workers/service/ServiceWorkerRegistrationKey.h:
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::getRegistrations):
        * workers/service/server/SWServer.h:

2017-11-14  Alex Christensen  <achristensen@webkit.org>

        Fix Windows build.

        * html/canvas/WebGLRenderingContext.h:

2017-11-14  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix GTK/WPE debug builds even better after r224813
        https://bugs.webkit.org/show_bug.cgi?id=179660

        * platform/graphics/cairo/NativeImageCairo.cpp:
        (WebCore::drawNativeImage):

2017-11-14  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix GTK/WPE debug builds after r224813
        https://bugs.webkit.org/show_bug.cgi?id=179660

        * platform/graphics/cairo/NativeImageCairo.cpp:
        (WebCore::drawNativeImage):

2017-11-14  Youenn Fablet  <youenn@apple.com>

        Implement ServiceWorker handle fetch for navigation loads
        https://bugs.webkit.org/show_bug.cgi?id=179404

        Reviewed by Alex Christensen and Chris Dumez.

        Covered by rebased tests.

        Step 11 of https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm is implemented in DocumentLoader as it centralizes main request loading
        and knows about the context of it.

        For each main resource load in document loader, we first check whether there is a matching service worker.
        The fetch request is updated accordingly so that there is no difference in the handling of navigation vs. subresource requests after that point.

        Updated DocumentThreadableLoader::didReceiveResponse since it can now receive responses from service worker with various response types.
        A follow-up patch should properly handle cross origin responses.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::commitData):
        (WebCore::DocumentLoader::startLoadingMainResource):
        (WebCore::DocumentLoader::doLoadingMainResource):
        * loader/DocumentLoader.h:
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::didReceiveResponse):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::setNavigationServiceWorkerRegistrationData):
        * loader/cache/CachedResourceRequest.h:
        * platform/MIMETypeRegistry.h:
        * platform/network/cocoa/WebCoreNSURLSession.mm:
        (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):

2017-11-14  Alex Christensen  <achristensen@webkit.org>

        Log moveFile failure errors
        https://bugs.webkit.org/show_bug.cgi?id=179695

        Reviewed by Brady Eidson.

        Content extension tests are flaky. In r224790 I added logs to find out why, and they indicate that moveFile is failing.
        To further understand why, I'm adding logs to see what's happening sometimes on the bots.

        * platform/cocoa/FileSystemCocoa.mm:
        (WebCore::FileSystem::moveFile):

2017-11-14  Dean Jackson  <dino@apple.com>

        Fix Windows build.

        * html/OffscreenCanvas.cpp:
        * html/OffscreenCanvas.h:
        * html/OffscreenCanvas.idl:

2017-11-14  Alex Christensen  <achristensen@webkit.org>

        Remove Cocoa CFURLConnection loading code
        https://bugs.webkit.org/show_bug.cgi?id=179688

        Reviewed by Antti Koivisto.

        CFURLConnection is only used on the AppleWin port now.

        * PlatformMac.cmake:
        * SourcesCocoa.txt:
        * SourcesIOS.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * loader/DocumentLoader.h:
        * loader/EmptyFrameLoaderClient.h:
        * loader/FrameLoaderClient.h:
        * loader/ResourceLoader.cpp:
        * loader/ResourceLoader.h:
        * loader/SubresourceLoader.h:
        * loader/cf/ResourceLoaderCFNet.cpp:
        * loader/cocoa/SubresourceLoaderCocoa.mm:
        * loader/mac/DocumentLoaderMac.cpp:
        * loader/mac/ResourceLoaderMac.mm:
        * page/mac/PageMac.mm:
        (WebCore::Page::platformInitialize):
        (WebCore::Page::addSchedulePair):
        (WebCore::Page::removeSchedulePair):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
        (WebCore::WebCoreNSURLAuthenticationChallengeClient::create): Deleted.
        (WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient): Deleted.
        (): Deleted.
        * platform/network/ProtectionSpaceBase.cpp:
        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleInternal.h:
        * platform/network/cf/AuthenticationCF.cpp:
        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
        (WebCore::createCF):
        (WebCore::core):
        (): Deleted.
        * platform/network/cf/AuthenticationCF.h:
        * platform/network/cf/CookieJarCFNet.cpp:
        (WebCore::copyCookiesForURLWithFirstPartyURL):
        (WebCore::createCookies):
        (WebCore::deleteAllCookiesModifiedSince):
        * platform/network/cf/CookieStorageCFNet.cpp:
        * platform/network/cf/CredentialStorageCFNet.cpp:
        (WebCore::CredentialStorage::getFromPersistentStorage):
        * platform/network/cf/ResourceErrorCF.cpp:
        (WebCore::ResourceError::setCertificate):
        (WebCore::ResourceError::platformLazyInit):
        (WebCore::ResourceError::doPlatformIsolatedCopy):
        (WebCore::ResourceError::cfError const):
        * platform/network/cf/ResourceHandleCFNet.cpp:
        * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
        (WebCore::installHookToRemoveCFNetworkMessageBlockingMainThread):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupConnectionScheduling):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
        * platform/network/cocoa/CredentialCocoa.mm:
        (WebCore::Credential::cfCredential const): Deleted.
        * platform/network/cocoa/ProtectionSpaceCocoa.mm:
        (WebCore::ProtectionSpace::cfSpace const): Deleted.
        * platform/network/cocoa/ResourceRequestCocoa.mm:
        (WebCore::ResourceRequest::nsURLRequest const):
        (WebCore::ResourceRequest::clearOrUpdateNSURLRequest): Deleted.
        * platform/network/cocoa/ResourceResponseCocoa.mm:
        (WebCore::ResourceResponse::platformCertificateInfo const):
        (WebCore::ResourceResponse::ResourceResponse): Deleted.
        * platform/network/ios/ResourceHandleIOS.mm: Removed.
        * platform/network/mac/AuthenticationMac.mm:
        (WebCore::AuthenticationChallenge::authenticationClient const):
        (WebCore::mac):
        (-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]): Deleted.
        (-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]): Deleted.
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::synchronousWillSendRequestEnabled):
        * platform/network/mac/ResourceRequestMac.mm: Removed.

2017-11-14  Daniel Bates  <dabates@apple.com>

        Update comment in FeatureDefines.xcconfig to reflect location of Visual Studio property files
        for feature defines

        Following r195498 and r201917 the Visual Studio property files for feature defines have
        moved from directory WebKitLibraries/win/tools/vsprops to directory Source/cmake/tools/vsprops.
        Update the comment in FeatureDefines.xcconfig to reflect the new location and names of these
        files.

        * Configurations/FeatureDefines.xcconfig:

2017-11-14  Antti Koivisto  <antti@apple.com>

        Remove StyleResolver::State::document()
        https://bugs.webkit.org/show_bug.cgi?id=179678

        Reviewed by Antoine Quint.

        We don't need both StyleResolver::document() and StyleResolver::State::document().

        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::State::updateConversionData):
        (WebCore::StyleResolver::resolvedVariableValue):
        (WebCore::StyleResolver::colorFromPrimitiveValue const):
        (WebCore::StyleResolver::createFilterOperations):
        * css/StyleResolver.h:
        (WebCore::StyleResolver::State::document const): Deleted.

2017-11-14  Dean Jackson  <dino@apple.com>

        Stub implementations of OffscreenCanvas getContext and transferToImageBitmap
        https://bugs.webkit.org/show_bug.cgi?id=179671
        <rdar://problem/35534018>

        Reviewed by Antoine Quint.

        Empty implementations of getContext and transferToImageBitmap. At the moment
        only return a WebGLRenderingContext from getContext, since we don't
        have an Offscreen 2d context type yet.

        Tests: http/wpt/offscreen-canvas/getContext-webgl.html
               http/wpt/offscreen-canvas/transferToImageBitmap.html

        * html/OffscreenCanvas.cpp:
        (WebCore::OffscreenCanvas::getContext):
        (WebCore::OffscreenCanvas::transferToImageBitmap):
        * html/OffscreenCanvas.h:
        * html/OffscreenCanvas.idl:
        * html/canvas/GPUBasedCanvasRenderingContext.h: Drive-by parameter rename.
        (WebCore::GPUBasedCanvasRenderingContext::GPUBasedCanvasRenderingContext):

2017-11-14  Youenn Fablet  <youenn@apple.com>

        WebSWClientConnection should do IPC to StorageProcess if its WebSWOriginTable is not yet initialized
        https://bugs.webkit.org/show_bug.cgi?id=179668

        Reviewed by Chris Dumez.

        Covered by existing updated tests.

        Removing hasServiceWorkerRegisteredForOrigin and using hasServiceWorkerRegistration instead.
        The former is only checking the shared map which might not be initialized at the time the function is called.
        The latter is going to the StorageProcess if the map is not yet initialized.

        * testing/Internals.cpp:
        (WebCore::Internals::hasServiceWorkerRegisteredForOrigin): Deleted.
        * testing/Internals.h:
        * testing/Internals.idl:
        * workers/service/server/SWClientConnection.h:

2017-11-14  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Add a ServiceWorker domain to get information about an inspected ServiceWorker
        https://bugs.webkit.org/show_bug.cgi?id=179640
        <rdar://problem/35517361>

        Reviewed by Devin Rousso.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * inspector/InspectorAllInOne.cpp:
        New files.

        * inspector/WorkerInspectorController.cpp:
        (WebCore::WorkerInspectorController::createLazyAgents):
        Add a ServiceWorkerAgent when the Worker is a ServiceWorker.

        * inspector/agents/worker/ServiceWorkerAgent.h: Added.
        * inspector/agents/worker/ServiceWorkerAgent.cpp: Added.
        (WebCore::ServiceWorkerAgent::ServiceWorkerAgent):
        (WebCore::ServiceWorkerAgent::didCreateFrontendAndBackend):
        (WebCore::ServiceWorkerAgent::willDestroyFrontendAndBackend):
        (WebCore::ServiceWorkerAgent::getInitializationInfo):
        Populate initialization info.

2017-11-14  Brady Eidson  <beidson@apple.com>

        Remove some accidentally checked-in commented-out code.

        Unreviewed.

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

2017-11-14  Alex Christensen  <achristensen@webkit.org>

        Clean up old URL parser remnants
        https://bugs.webkit.org/show_bug.cgi?id=179573

        Reviewed by Darin Adler.

        When we transitioned to the new URLParser, we kept the old character tables which were less spec-conformant.
        Removing them and transitioning to URLParser's table makes more web platform tests pass!

        * fileapi/BlobURL.cpp:
        (WebCore::BlobURL::createBlobURL):
        There's no need to percent-encode an origin.  It's already ascii, and if it's not, then the URLParser will escape it.
        * loader/appcache/ApplicationCacheHost.cpp:
        (WebCore::ApplicationCacheHost::createFileURL):
        Removed comment that no longer applies.
        * platform/URL.cpp:
        (WebCore::URL::setProtocol):
        (WebCore::percentEncodeCharacters):
        (WebCore::URL::setUser):
        (WebCore::URL::setPass):
        Percent encode the userinfo character set from the URLParser according to https://url.spec.whatwg.org/#set-the-username and https://url.spec.whatwg.org/#set-the-password
        (WebCore::URL::setPath):
        A ? or a # are the only two characters that need to be pre-encoded when setting the path because they indicate the
        beginning of a query or fragment.  All other characters will be encoded if necessary during parsing.
        (WebCore::protocolIsInternal):
        (): Deleted.
        (WebCore::isSchemeFirstChar): Deleted.
        (WebCore::isSchemeChar): Deleted.
        (WebCore::isBadChar): Deleted.
        (WebCore::isTabNewline): Deleted.
        (WebCore::appendEscapedChar): Deleted.
        (WebCore::encodeWithURLEscapeSequences):
        Encode characters needed.  I used the user info set of characters because that was most similar to the BadChar set of the old parser.
        This isn't standardized, and it's only used for the search context menu item which certainly isn't standardized.
        (WebCore::isValidProtocol): Deleted.
        Remove a bunch of old unused functions.
        * platform/URLParser.cpp:
        (WebCore::URLParser::isInUserInfoEncodeSet):
        (WebCore::URLParser::parseAuthority):
        * platform/URLParser.h:
        Expose a few functions for URL.cpp to use.

2017-11-14  Antti Koivisto  <antti@apple.com>

        Enable display:contents by default
        https://bugs.webkit.org/show_bug.cgi?id=179655

        Reviewed by Sam Weinig.

        * page/RuntimeEnabledFeatures.h:

2017-11-14  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Move drawLine operation from GraphicsContextCairo to CairoOperations
        https://bugs.webkit.org/show_bug.cgi?id=179669

        Reviewed by Carlos Garcia Campos.

        Move the drawLine operation implementation into the CairoOperations
        implementation file, with the Cairo::drawLine() function only expecting
        a PlatformContextCairo object, two FloatingPoints, and a const reference
        to a GraphicsContextState object.

        As with drawLinesForText(), the drawLine() implementation utilized a few
        private GraphicsContext methods that we for now reimplement in the
        Cairo namespace as static functions, providing necessary state values to
        perform the computations. The GraphicsContext methods should be changed
        to become static public functions -- after that we'll be able to remove
        the new duplicated helper functions.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::dashedLineCornerWidthForStrokeWidth):
        (WebCore::Cairo::dashedLinePatternWidthForStrokeWidth):
        (WebCore::Cairo::dashedLinePatternOffsetForPatternAndStrokeWidth):
        (WebCore::Cairo::centerLineAndCutOffCorners):
        (WebCore::Cairo::drawLine):
        * platform/graphics/cairo/CairoOperations.h:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::drawLine):

2017-11-14  Tim Horton  <timothy_horton@apple.com>

        Long pressing a phone number with spaces in it results in a link sheet instead of a data detectors sheet
        https://bugs.webkit.org/show_bug.cgi?id=179646
        <rdar://problem/35337288>

        Reviewed by Simon Fraser.

        * editing/cocoa/DataDetection.h:
        * editing/cocoa/DataDetection.mm:
        (WebCore::DataDetection::canBePresentedByDataDetectors):
        (WebCore::DataDetection::isDataDetectorLink):
        Expose canBePresentedByDataDetectors, which tests if the URL's
        scheme is one of Data Detectors' known long-press schemes.

2017-11-14  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK][WPE] Don't require brotli
        https://bugs.webkit.org/show_bug.cgi?id=178122

        Reviewed by Frédéric Wang.

        Remove stray remaining use of brotli CMake variable.

        * CMakeLists.txt:

2017-11-14  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Move drawLinesForText operation from GraphicsContextCairo to CairoOperations
        https://bugs.webkit.org/show_bug.cgi?id=179661

        Reviewed by Carlos Garcia Campos.

        Encapsulate the drawLinesForText() operation in the WebCore::Cairo
        namespace. Apart from moving gist of the code from GraphicsContextCairo
        to CairoOperations, we also (for the moment) have to duplicate the
        GraphicsContext::computeLineBoundsAndAntialiasingModeForText() code.
        This is necessary because the given method is private on the
        GraphicsContext class, and relies on an underlying GraphicsContext
        object to retrieve the current CTM and stroke thickness values.

        The adjusted reimplementation uses PlatformContextCairo to retrieve
        the CTM (just like Cairo's GraphicsContext::getCTM() does), and
        requires the stroke thickness value to be passed in as an argument.
        Similar modifications will be proposed for the existing
        GraphicsContext::computeLineBoundsAndAntialiasingModeForText() code,
        and once that's approved the duplicated code will be eliminated.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::computeLineBoundsAndAntialiasingModeForText):
        (WebCore::Cairo::drawLinesForText):
        * platform/graphics/cairo/CairoOperations.h:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::drawLinesForText):

2017-11-14  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Move native image drawing operation to CairoOperations
        https://bugs.webkit.org/show_bug.cgi?id=179660

        Reviewed by Carlos Garcia Campos.

        Unify the native image drawing operation behavior between the
        Cairo-specific GraphicsContext and drawNativeImage() implementations and
        then move the code into the Cairo::drawNativeImage() function, inside
        the CairoOperations implementation file.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::cairoSurfaceHasAlpha):
        (WebCore::Cairo::drawNativeImage):
        * platform/graphics/cairo/CairoOperations.h:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::drawNativeImage):
        * platform/graphics/cairo/NativeImageCairo.cpp:
        (WebCore::drawNativeImage):

2017-11-14  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Perform GraphicsContextPlatformPrivate method calls from CairoOperations
        https://bugs.webkit.org/show_bug.cgi?id=179657

        Reviewed by Carlos Garcia Campos.

        To enable encapsulating remaining Cairo operations in static functions
        inside the WebCore::Cairo namespace, we have to work around the
        GraphicsContextPlatformPrivate methods that are invoked in the current
        GraphicsContext implementation for Cairo.

        A pointer to the GraphicsContextPlatformPrivate object is now kept on
        the PlatformContextCairo instance, and we take care of setting it up
        and clearing it out appropriate to the GraphicsContextPlatformPrivate
        lifetime (as managed in Cairo-specific GraphicsContext implementation).
        The GraphicsContextPlatformPrivate method invocations are then moved
        to the appropriate CairoOperations functions.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::State::setCTM):
        (WebCore::Cairo::save):
        (WebCore::Cairo::restore):
        (WebCore::Cairo::translate):
        (WebCore::Cairo::rotate):
        (WebCore::Cairo::scale):
        (WebCore::Cairo::concatCTM):
        (WebCore::Cairo::clip):
        (WebCore::Cairo::clipPath):
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::GraphicsContext):
        (WebCore::GraphicsContext::platformInit):
        (WebCore::GraphicsContext::platformDestroy):
        (WebCore::GraphicsContext::savePlatformState):
        (WebCore::GraphicsContext::restorePlatformState):
        (WebCore::GraphicsContext::clip):
        (WebCore::GraphicsContext::clipPath):
        (WebCore::GraphicsContext::translate):
        (WebCore::GraphicsContext::concatCTM):
        (WebCore::GraphicsContext::setCTM):
        (WebCore::GraphicsContext::rotate):
        (WebCore::GraphicsContext::scale):
        * platform/graphics/cairo/PlatformContextCairo.h:
        (WebCore::PlatformContextCairo::graphicsContextPrivate):
        (WebCore::PlatformContextCairo::setGraphicsContextPrivate):

2017-11-14  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Move simpler draw operations from GraphicsContextCairo to CairoOperations
        https://bugs.webkit.org/show_bug.cgi?id=179614

        Reviewed by Carlos Garcia Campos.

        Move operations that perform simpler drawing to the CairoOperations
        file. This isolates the Cairo code and encapsulates operation work
        into a limited scope. This patch only covers drawing patterns,
        rectangles, document marker lines and ellipses. A missing forward
        declaration for the drawGlyphs() function is also added in the
        CairoOperations header.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::drawPattern):
        (WebCore::Cairo::drawRect):
        (WebCore::Cairo::drawLineForDocumentMarker):
        (WebCore::Cairo::drawEllipse):
        * platform/graphics/cairo/CairoOperations.h:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::drawRect):
        (WebCore::GraphicsContext::drawEllipse):
        (WebCore::GraphicsContext::drawLineForDocumentMarker):
        (WebCore::GraphicsContext::drawPattern):

2017-11-13  Joseph Pecoraro  <pecoraro@apple.com>

        Give a ServiceWorker WebContentProcess a different display name
        https://bugs.webkit.org/show_bug.cgi?id=179653

        Reviewed by Brady Eidson.

        * English.lproj/Localizable.strings:

2017-11-13  Chris Dumez  <cdumez@apple.com>

        Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers
        https://bugs.webkit.org/show_bug.cgi?id=179649

        Reviewed by Brady Eidson.

        Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers so that the
        WebProcesses can correctly construct ServiceWorker objects, with the right attributes / state.

        No new tests, rebaselined existing tests.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::getOrCreate):
        (WebCore::ServiceWorker::ServiceWorker):
        (WebCore::ServiceWorker::~ServiceWorker):
        (WebCore::ServiceWorker::scheduleTaskToUpdateState):
        (WebCore::ServiceWorker::postMessage):
        * workers/service/ServiceWorker.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::scheduleTaskToUpdateRegistrationState):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerData.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerRegistrationData.cpp.
        (WebCore::ServiceWorkerData::isolatedCopy const):
        * workers/service/ServiceWorkerData.h: Copied from Source/WebCore/workers/service/server/SWServerWorker.cpp.
        (WebCore::ServiceWorkerData::encode const):
        (WebCore::ServiceWorkerData::decode):
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
        (WebCore::ServiceWorkerRegistration::updateStateFromServer):
        * workers/service/ServiceWorkerRegistration.h:
        * workers/service/ServiceWorkerRegistrationData.cpp:
        (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
        * workers/service/ServiceWorkerRegistrationData.h:
        (WebCore::ServiceWorkerRegistrationData::encode const):
        (WebCore::ServiceWorkerRegistrationData::decode):
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
        (WebCore::SWClientConnection::updateRegistrationState):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::updateRegistrationState):
        (WebCore::SWServerRegistration::data const):
        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::SWServerWorker):
        (WebCore::m_script):
        * workers/service/server/SWServerWorker.h:
        (WebCore::SWServerWorker::scriptURL const):
        (WebCore::SWServerWorker::type const):
        (WebCore::SWServerWorker::identifier const):
        (WebCore::SWServerWorker::state const):
        (WebCore::SWServerWorker::setState):
        (WebCore::SWServerWorker::data const):

2017-11-13  Ryosuke Niwa  <rniwa@webkit.org>

        iOS: Enable release asserts in updateStyleIfNeeded() and updateLayout() for WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=179651

        Reviewed by Antti Koivisto.

        r224604 disabled the release assertions on iOS entirely even though the underlying bug only affected iOS WebKit1 port
        due to various time constraints. Enable them back on iOS WebKit2 port.

        * dom/Document.cpp:
        (WebCore::isSafeToUpdateStyleOrLayout):
        (WebCore::Document::updateStyleIfNeeded):
        (WebCore::Document::updateLayout):

2017-11-13  Brady Eidson  <beidson@apple.com>

        Massive "Server-process-to-context-process" connection overhaul.
        https://bugs.webkit.org/show_bug.cgi?id=179554

        Reviewed by Chris Dumez.

        No new tests (Refactor, no behavior change).

        Having the SWServer::Connection object be overloaded to mean both client->server and server->context 
        was the wrong design and was starting to crumble under its own weight.

        So this patch introduces a SWServerToContextConnection to manage the StorageProcess-side of connections
        to context processes.

        Any message that is specifically about the connection between the StorageProcess and context process
        should use this connection going forward.

        Right now there is only one context process, but this design keeps us ready for that to change.

        This patch also gets rid of a lot of "server connection identifier" integers being passed amongst processes
        that were actually pointless.

        This patch is also a prerequisite for many things that are coming up soon, such as termination.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

        * workers/service/ServiceWorkerContextData.cpp:
        (WebCore::ServiceWorkerContextData::isolatedCopy const):
        * workers/service/ServiceWorkerContextData.h:
        (WebCore::ServiceWorkerContextData::encode const):
        (WebCore::ServiceWorkerContextData::decode):

        * workers/service/ServiceWorkerGlobalScope.cpp:
        (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
        * workers/service/ServiceWorkerGlobalScope.h:
        (WebCore::ServiceWorkerGlobalScope::serverConnectionIdentifier const): Deleted.

        * workers/service/ServiceWorkerTypes.h:

        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::ServiceWorkerThread):
        (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
        * workers/service/context/ServiceWorkerThread.h:
        (WebCore::ServiceWorkerThread::serverConnectionIdentifier const): Deleted.

        * workers/service/context/ServiceWorkerThreadProxy.cpp:
        (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
        (WebCore::ServiceWorkerThreadProxy::create): Deleted.
        * workers/service/context/ServiceWorkerThreadProxy.h:

        * workers/service/server/SWServer.cpp:
        (WebCore::generateServiceWorkerIdentifier):
        (WebCore::SWServer::~SWServer):
        (WebCore::SWServer::SWServer):
        (WebCore::SWServer::scriptContextFailedToStart):
        (WebCore::SWServer::scriptContextStarted):
        (WebCore::SWServer::didFinishInstall):
        (WebCore::SWServer::didFinishActivation):
        (WebCore::SWServer::didResolveRegistrationPromise):
        (WebCore::SWServer::updateWorker):
        (WebCore::SWServer::serverToContextConnectionCreated):
        (WebCore::SWServer::installContextData):
        (WebCore::SWServer::fireInstallEvent):
        (WebCore::SWServer::fireActivateEvent):
        (WebCore::SWServer::Connection::didFinishInstall): Deleted.
        (WebCore::SWServer::Connection::didFinishActivation): Deleted.
        (WebCore::SWServer::Connection::setServiceWorkerHasPendingEvents): Deleted.
        (WebCore::SWServer::Connection::scriptContextFailedToStart): Deleted.
        (WebCore::SWServer::Connection::scriptContextStarted): Deleted.
        (WebCore::SWServer::setServiceWorkerHasPendingEvents): Deleted.
        * workers/service/server/SWServer.h:

        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptContextFailedToStart):
        (WebCore::SWServerJobQueue::scriptContextStarted):
        (WebCore::SWServerJobQueue::install):
        (WebCore::SWServerJobQueue::didResolveRegistrationPromise):
        (WebCore::SWServerJobQueue::didFinishInstall):
        (WebCore::SWServerJobQueue::tryActivate):
        (WebCore::SWServerJobQueue::activate):
        * workers/service/server/SWServerJobQueue.h:

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

        * workers/service/server/SWServerToContextConnection.cpp: Added.
        (WebCore::generateServerToContextConnectionIdentifier):
        (WebCore::SWServerToContextConnection::SWServerToContextConnection):
        (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
        (WebCore::SWServerToContextConnection::connectionForIdentifier):
        (WebCore::SWServerToContextConnection::globalServerToContextConnection):
        (WebCore::SWServerToContextConnection::scriptContextFailedToStart):
        (WebCore::SWServerToContextConnection::scriptContextStarted):
        (WebCore::SWServerToContextConnection::didFinishInstall):
        (WebCore::SWServerToContextConnection::didFinishActivation):
        (WebCore::SWServerToContextConnection::setServiceWorkerHasPendingEvents):
        * workers/service/server/SWServerToContextConnection.h: Copied from Source/WebCore/workers/service/server/SWServerWorker.h.
        (WebCore::SWServerToContextConnection::identifier const):

        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::existingWorkerForIdentifier):
        (WebCore::SWServerWorker::SWServerWorker):
        (WebCore::SWServerWorker::~SWServerWorker):
        (WebCore::SWServerWorker::scriptContextFailedToStart):
        (WebCore::SWServerWorker::scriptContextStarted):
        (WebCore::SWServerWorker::didFinishInstall):
        (WebCore::SWServerWorker::didFinishActivation):
        * workers/service/server/SWServerWorker.h:
        (WebCore::SWServerWorker::create):
        (WebCore::SWServerWorker::registrationKey const):
        (WebCore::SWServerWorker::contextConnectionIdentifier const):

2017-11-13  Don Olmstead  <don.olmstead@sony.com>

        Unreviewed build fix after r224791.

        * platform/network/NetworkStorageSessionStub.cpp:
        (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Deleted.

2017-11-13  Simon Fraser  <simon.fraser@apple.com>

        Minor DisplayRefreshMonitor-related cleanup
        https://bugs.webkit.org/show_bug.cgi?id=179648

        Reviewed by Alex Christensen.

        Use more "#pragma once" and C++ initializers.

        Make more member functions of DisplayRefreshMonitor protected.

        Improve the ordering of member variables.

        Don't mix member variables and member functions in the declaration of ScriptedAnimationController.

        * dom/ScriptedAnimationController.h:
        * platform/graphics/DisplayRefreshMonitor.cpp:
        (WebCore::DisplayRefreshMonitor::DisplayRefreshMonitor):
        (WebCore::DisplayRefreshMonitor::displayDidRefresh):
        * platform/graphics/DisplayRefreshMonitor.h:
        (WebCore::DisplayRefreshMonitor::mutex):
        * platform/graphics/DisplayRefreshMonitorManager.h:
        * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
        (WebCore::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
        * platform/graphics/mac/DisplayRefreshMonitorMac.h:

2017-11-13  Simon Fraser  <simon.fraser@apple.com>

        When navigating back to a page, compositing layers may not use accelerated drawing
        https://bugs.webkit.org/show_bug.cgi?id=178749
        rdar://problem/35158946

        Reviewed by Dean Jackson.

        There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
        occurred on back navigation, related to the ordering of style recalcs and layout.

        First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
        its cacheAcceleratedCompositingFlags(), so any layers created during style update
        didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
        to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().

        We have to be careful to avoid m_forceCompositingMode flip-flopping between cacheAcceleratedCompositingFlags()
        and cacheAcceleratedCompositingFlagsAfterLayout(), since, for subframes, it depends on layout.

        Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
        before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
        the TileController.

        Test: compositing/accelerated-layers-after-back.html

        * page/FrameView.cpp:
        (WebCore::FrameView::updateCompositingLayersAfterLayout):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::willRecalcStyle):
        (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
        (WebCore::RenderLayerCompositor::updateCompositingLayers):
        * rendering/RenderLayerCompositor.h:

2017-11-13  Youenn Fablet  <youenn@apple.com>

        matchRegistration does not need to go to StorageProcess if no service worker is registered
        https://bugs.webkit.org/show_bug.cgi?id=179480

        Reviewed by Chris Dumez.

        Covered by existing tests.

        Moving the origin store in SWServer since they share the same session ID.
        This allows updating the origin store based on each registration map update.
        This also allows clearing the origin store when clearing the SWServer.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * workers/service/server/SWOriginStore.cpp: Added.
        (WebCore::SWOriginStore::add):
        (WebCore::SWOriginStore::remove):
        (WebCore::SWOriginStore::clear):
        (WebCore::SWOriginStore::clearAll):
        * workers/service/server/SWOriginStore.h: Added.
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::addRegistration):
        (WebCore::SWServer::removeRegistration):
        (WebCore::SWServer::OriginStore::add):
        (WebCore::SWServer::OriginStore::remove):
        (WebCore::SWServer::OriginStore::clear):
        (WebCore::SWServer::OriginStore::clearAll):
        (WebCore::SWServer::clearAll):
        (WebCore::SWServer::clear):
        (WebCore::SWServer::SWServer):
        * workers/service/server/SWServer.h:
        (WebCore::SWServer::originStore):

2017-11-13  Alex Christensen  <achristensen@webkit.org>

        Merge NetworkProcess::EnsurePrivateBrowsingSession and NetworkProcess::AddWebsiteDataStore into one message type
        https://bugs.webkit.org/show_bug.cgi?id=178751

        Reviewed by Brady Eidson.

        The creation of private browsing sessions and persistent browsing sessions has evolved to be the same thing
        with differences in parameters, like no sandbox extensions or paths to persistent storage locations for private browsing.
        These should be united to simplify future development of WebsiteDataStore construction.

        * platform/network/NetworkStorageSession.h:
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Deleted.
        * platform/network/soup/NetworkStorageSessionSoup.cpp:
        (WebCore::NetworkStorageSession::ensureSession):
        (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Deleted.

2017-11-07  Brian Burg  <bburg@apple.com>

        Web Automation: inViewCenterPoint should not include topContentInset when computed in viewport coordinates
        https://bugs.webkit.org/show_bug.cgi?id=179129
        <rdar://problem/35297038>

        Reviewed by Simon Fraser.

        Add or export some helpers needed to compute element layout for WebDriver.

        * dom/Element.h: Export the non-DOM version of getClientBounds().
        * page/FrameView.h:
        * page/FrameView.cpp:
        (WebCore::FrameView::clientToDocumentRect const):
        Added. This does the same thing as clientToDocumentPoint. Export it, too.

2017-11-13  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Include a NetworkAgent in ServiceWorkers for network debugging
        https://bugs.webkit.org/show_bug.cgi?id=179513
        <rdar://problem/35456402>

        Reviewed by Brian Burg.

        In order to show Network requests for a ServiceWorker, we need to add
        inspector networking hooks for Worker loads. While we show Network
        requests for DedicatedWorkers, we do that through the Page during Page
        inspection. In ServiceWorker inspection, the remote connection is
        connected to the ServiceWorkerThreadProxy, and interacts with the
        WorkerGlobalScope without making any assumptions about a Page existing.
        We don't want to make any assumptions about a Page/Document being needed
        for Network hooks, so we should add new hooks that will work in the
        WorkerGlobalScope's context.

        This patch adds InspectorInstrumentation networking hooks for workers inside
        of the WorkerThreadableLoader bridge. This is where the majority of Worker
        initiated network requests happen (Fetch/XHR, but not WebSockets). The hooks
        are simpler versions of the existing network hooks for a Page, and allow for
        complete inspector networking information (will send, did receive response,
        did receive data, success, failure, and timing metrics).

        This patch generalizes InspectorNetworkAgent to work for a Page and Worker.
        Some of the existing functionality was specific to a Page (frameId/loaderId)
        but did not make sense for a Worker. In order to handle these cases, all
        of the unique logic was extracted out into virtual methods that subclasses
        PageNetworkAgent and WorkerNetworkAgent provide as appropriate. The majority
        of NetworkAgent remains unchanged and algorithms are shared.

        We needed to change the existing InspectorInstrumentation networking hooks
        to allow for an optional DocumentLoader. This way we can keep all of the
        same hooks leading inside of NetworkAgent, but loads for a Page will have a
        DocumentLoader, and loads for a ServiceWorker will not.

        While the WorkerNetworkAgent would work for a DedicatedWorker, we still
        only create it for a ServiceWorker. The existing behavior of showing Network
        loads for a DedicatedWorker will continue to go through the Page inspector
        so we can avoid creating a NetworkAgent for DedicatedWorkers. If we created
        a way to directly inspect a DedicatedWorker we could look at making this
        always available, but it would require extra work to function perfectly.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * inspector/InspectorAllInOne.cpp:
        Add new files.

        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::InspectorController):
        (WebCore::InspectorController::createLazyAgents):
        Switch from InspectorNetworkAgent to PageNetworkAgent.

        * inspector/WorkerInspectorController.h:
        * inspector/WorkerInspectorController.cpp:
        (WebCore::WorkerInspectorController::WorkerInspectorController):
        (WebCore::WorkerInspectorController::workerAgentContext):
        (WebCore::WorkerInspectorController::createLazyAgents):
        Create a WorkerNetworkAgent when inside of a ServiceWorker.
        Also start the lazy agent pattern for agents that can defer
        creation until a frontend attached.

        (WebCore::WorkerInspectorController::connectFrontend):
        (WebCore::WorkerInspectorController::disconnectFrontend):
        When frontends connect/disconnect toggle the necessary states.
        Also start the execution stopwatch, otherwise it will always be at 0.

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::willSendRequestImpl):
        (WebCore::InspectorInstrumentation::willSendRequestOfTypeImpl):
        (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCacheImpl):
        (WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
        (WebCore::InspectorInstrumentation::didFinishLoadingImpl):
        (WebCore::InspectorInstrumentation::didFailLoadingImpl):
        (WebCore::InspectorInstrumentation::frameDetachedFromParentImpl):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::willSendRequest):
        (WebCore::InspectorInstrumentation::didReceiveResourceResponse):
        (WebCore::InspectorInstrumentation::didReceiveData):
        (WebCore::InspectorInstrumentation::didFinishLoading):
        (WebCore::InspectorInstrumentation::didFailLoading):
        Add Worker networking hooks that pass through to the same general hooks.

        * loader/WorkerThreadableLoader.cpp:
        (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
        (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse):
        (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData):
        (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
        (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):
        (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
        * loader/WorkerThreadableLoader.h:
        Use the new worker networking instrumentation hooks.

        * loader/ThreadableLoader.cpp:
        (WebCore::ThreadableLoader::create):
        Drive-by: use a move.

        * inspector/agents/InspectorNetworkAgent.h:
        * inspector/agents/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::InspectorNetworkAgent):
        (WebCore::InspectorNetworkAgent::willSendRequest):
        (WebCore::InspectorNetworkAgent::willSendRequestOfType):
        (WebCore::InspectorNetworkAgent::didReceiveResponse):
        (WebCore::InspectorNetworkAgent::didFinishLoading):
        (WebCore::InspectorNetworkAgent::didFailLoading):
        (WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache):
        (WebCore::InspectorNetworkAgent::buildInitiatorObject):
        (WebCore::InspectorNetworkAgent::enable):
        (WebCore::InspectorNetworkAgent::disable):
        (WebCore::InspectorNetworkAgent::setResourceCachingDisabled):
        (WebCore::InspectorNetworkAgent::loadResource):
        (WebCore::InspectorNetworkAgent::webSocketForRequestId):
        (WebCore::InspectorNetworkAgent::resolveWebSocket):
        (WebCore::InspectorNetworkAgent::mainFrameNavigated):
        Extract logic for subclasses. Transition to DocumentLoader being null.

        * inspector/agents/page/PageNetworkAgent.h:
        * inspector/agents/page/PageNetworkAgent.cpp: Added.
        (WebCore::PageNetworkAgent::PageNetworkAgent):
        (WebCore::PageNetworkAgent::loaderIdentifier):
        (WebCore::PageNetworkAgent::frameIdentifier):
        (WebCore::PageNetworkAgent::setResourceCachingDisabled):
        (WebCore::PageNetworkAgent::scriptExecutionContext):
        Extracted Page implementation. This is just moving from the original.

        * inspector/agents/worker/WorkerNetworkAgent.h:
        * inspector/agents/worker/WorkerNetworkAgent.cpp:
        (WebCore::WorkerNetworkAgent::WorkerNetworkAgent):
        (WebCore::WorkerNetworkAgent::loaderIdentifier):
        (WebCore::WorkerNetworkAgent::frameIdentifier):
        (WebCore::WorkerNetworkAgent::setResourceCachingDisabled):
        (WebCore::WorkerNetworkAgent::scriptExecutionContext):
        Implement for a worker.
        
        * inspector/agents/worker/WorkerDebuggerAgent.cpp:
        (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
        * inspector/agents/worker/WorkerConsoleAgent.cpp:
        (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
        * inspector/agents/worker/WorkerRuntimeAgent.cpp:
        (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
        Add some assertions for all Worker agents for clarify.

        * workers/WorkerDebuggerProxy.h:
        * workers/WorkerGlobalScope.h:
        (WebCore::WorkerGlobalScope::identifier const):
        (WebCore::WorkerGlobalScope::createUniqueIdentifier):
        Provide a way to get unique identifiers in a worker. For the Page
        this is done through the Page's ProgressTracker. For a Worker we just
        put this on the WorkerGlobalScope. This is used for request ids.

        * workers/WorkerMessagingProxy.h:
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::setResourceCachingDisabled):
        * workers/service/context/ServiceWorkerThreadProxy.h:
        * workers/service/context/ServiceWorkerThreadProxy.cpp:
        (WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabled):
        Add a debug method for disabling the resource cache from a worker.
        In service workers this sets the override flag on the hidden page.

2017-11-08  Keith Miller  <keith_miller@apple.com>

        Async iteration should only fetch the next method once and add feature flag
        https://bugs.webkit.org/show_bug.cgi?id=179451

        Reviewed by Geoffrey Garen.

        Add feature flag for Async iteration.

        * Configurations/FeatureDefines.xcconfig:

2017-11-13  Alex Christensen  <achristensen@webkit.org>

        Call willPerformHTTPRedirection on WebCoreNSURLSession's delegate
        https://bugs.webkit.org/show_bug.cgi?id=179539

        Reviewed by Jer Noble.

        This is now possible!
        This will allow AVFoundation to fix redirect-related bugs.

        * platform/network/cocoa/WebCoreNSURLSession.mm:
        (-[WebCoreNSURLSession addDelegateOperation:]):
        (-[WebCoreNSURLSession resetWithCompletionHandler:]):
        (-[WebCoreNSURLSession flushWithCompletionHandler:]):
        (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
        (-[WebCoreNSURLSessionDataTask resource:shouldCacheResponse:]):
        (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]):
        (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):
        (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]): Deleted.

2017-11-13  Chris Dumez  <cdumez@apple.com>

        Add some more assertions in SWServerJobQueue
        https://bugs.webkit.org/show_bug.cgi?id=179626

        Reviewed by Alex Christensen.

        Add some more assertions in SWServerJobQueue for extra safety.

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

2017-11-13  Per Arne Vollan  <pvollan@apple.com>

        The css properties stroke-width/stroke-color and -webkit-text-stroke-width/-webkit-text-stroke-color should not be mixed.
        https://bugs.webkit.org/show_bug.cgi?id=174737

        Reviewed by Antti Koivisto.

        Previously, the stroke width and stroke color would independently fall back to the -webkit-text-stroke-width and
        -webkit-text-stroke-color values if stroke-width and/or stroke-color were not explicitly specified. This is
        problematic, since we might end up mixing the new stroke properties with the legacy Webkit stroke properties.
        The new strategy is to use the stroke-width and stroke-color value combination only if stroke-color has been
        explicitly specified. This should work well, since there will be no visible stroke when specifying only
        stroke-width (because stroke-color by default is transparent). We can then safely fall back to the legacy Webkit
        stroke value combination. In the case where only stroke-color is specified, we should use the stroke-width/
        stroke-color combination, since stroke-width by default is 1, and we will then have a visible stroke. 

        No new tests, existing tests have been updated to reflect behavior changes.

        * rendering/TextDecorationPainter.cpp:
        (WebCore::decorationColor):
        * rendering/TextPaintStyle.cpp:
        (WebCore::computeTextPaintStyle):
        (WebCore::computeTextSelectionPaintStyle):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::computedStrokeWidth const):
        (WebCore::RenderStyle::hasPositiveStrokeWidth const):
        (WebCore::RenderStyle::computedStrokeColor const):
        * rendering/style/RenderStyle.h:

2017-11-13  Gabriel Ivascu  <givascu@igalia.com>

        [GTK] Automatically adjust font size when gtk-xft-dpi changes
        https://bugs.webkit.org/show_bug.cgi?id=142673

        Reviewed by Michael Catanzaro.

        * platform/PlatformScreen.h:
        * platform/gtk/PlatformScreenGtk.cpp:
        (WebCore::gtkXftDPIChangedCallback):
        (WebCore::setScreenDPIObserverHandler):
        * platform/wpe/PlatformScreenWPE.cpp:
        (WebCore::setScreenDPIObserverHandler):

2017-11-13  Commit Queue  <commit-queue@webkit.org>

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

        test fails on iOS (Requested by alexchristensen on #webkit).

        Reverted changeset:

        "Add tests to ensure that <source> tags are only preloaded
        when the `type`"
        https://bugs.webkit.org/show_bug.cgi?id=179231
        https://trac.webkit.org/changeset/224763

2017-11-13  Antti Koivisto  <antti@apple.com>

        Don't eliminate whitespace renderer if the previous sibling is a text renderer
        https://bugs.webkit.org/show_bug.cgi?id=179620

        Reviewed by Zalan Bujtas.

        Currently whitespace elimination code doesn't consider runs of text renderers. We should always make whitespace
        renderer if the previous renderer is a text renderer. The behavior should be the same as if those were a single
        renderer with merged text. This situation can happen easily with display:contents.

        This fixes the remaining flexbox failures in display:contents tests.

        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::textRendererIsNeeded):

        We need a renderer if the previous rendere is RenderText.

2017-11-13  Chris Dumez  <cdumez@apple.com>

        Implement "Service Worker Has No Pending Events" / "Update Service Worker Extended Events Set" algorithms
        https://bugs.webkit.org/show_bug.cgi?id=179618

        Reviewed by Brady Eidson.

        Implement "Service Worker Has No Pending Events" / "Update Service Worker Extended Events Set" algorithms:
        - https://w3c.github.io/ServiceWorker/#service-worker-has-no-pending-events-algorithm
        - https://w3c.github.io/ServiceWorker/#update-service-worker-extended-events-set-algorithm

        Test: http/tests/workers/service/basic-unregister-then-register-again-reuse.html

        * workers/service/context/SWContextManager.h:
        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
        * workers/service/context/ServiceWorkerFetch.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::postFetchTask):
        (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
        (WebCore::ServiceWorkerThread::updateExtendedEventsSet):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::setServiceWorkerHasPendingEvents):
        (WebCore::SWServer::setServiceWorkerHasPendingEvents):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::tryActivate):
        (WebCore::SWServerJobQueue::tryClearRegistration):
        * workers/service/server/SWServerWorker.h:
        (WebCore::SWServerWorker::hasPendingEvents const):
        (WebCore::SWServerWorker::setHasPendingEvents):

2017-11-13  Colin Bendell  <colin@bendell.ca>

        Added mime type check to the picture source preloader to avoid downloading incompatible resources.
        https://bugs.webkit.org/show_bug.cgi?id=179231

        Reviewed by Alex Christensen.

        Test: http/tests/loading/preload-picture-type.html

        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): include type match state when selecting candidate imgs
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): added type attribute evaluation and matching

2017-11-13  Antoine Quint  <graouts@apple.com>

        [Web Animations] Implement getAnimations()
        https://bugs.webkit.org/show_bug.cgi?id=179535
        <rdar://problem/34932475>

        Reviewed by Simon Fraser.

        We now allow a list of animations for a document, with Document.getAnimations(), or for an
        element, with Animatable.getAnimations(), to be returned. In order to support this, we maintain
        a map on AnimationTimeline of all animations for a given element. This map is invalidated
        when an animation's timeline changes and when an animation's effect changes. Note that the
        Web Animations spec mandates that an AnimationEffect can only be a single animation's effect.

        Tests: http/wpt/wk-web-animations/interfaces/document-get-animations.html
               http/wpt/wk-web-animations/interfaces/element-get-animations.html
               http/wpt/wk-web-animations/timing-model/animation-effect-unique-relationship.html

        * CMakeLists.txt: Add Animatable.idl.
        * DerivedSources.make: Add Animatable.idl.
        * WebCore.xcodeproj/project.pbxproj: Add Animatable.idl.
        * animation/Animatable.idl: A new interface that Element implements and which currently only exposes
        getAnimations(), the animate() method will be added later.
        * animation/AnimationEffect.h: Add a new m_animation member to reference the animation using this
        effect. This relationship is required so we guarantee that an effect is associated with a single
        animation at most.
        (WebCore::AnimationEffect::animation const):
        (WebCore::AnimationEffect::setAnimation):
        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::animationWasAddedToElement): New method to notify the timeline that an
        animation registered with this timeline has been associated with a new element through its effect.
        (WebCore::AnimationTimeline::animationWasRemovedFromElement): New method to notify the timeline that an
        animation registered with this timeline has been disassociated with an element through its effect.
        (WebCore::AnimationTimeline::animationsForElement): New method returning all animations registered with
        this timeline for a given element.
        * animation/AnimationTimeline.h:
        (WebCore::AnimationTimeline::animations const): All animations registered with this timeline.
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::DocumentTimeline):
        (WebCore::DocumentTimeline::detachFromDocument): Clear the reference between this timeline and its document.
        (WebCore::DocumentTimeline::currentTime): Protect against a null Document reference.
        (WebCore::DocumentTimeline::createDisplayRefreshMonitor const): Protect against a null Document reference.
        * animation/DocumentTimeline.h:
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::create):
        (WebCore::WebAnimation::setEffect): As an animation's effect changes, we need to ensure that the old
        effect no longer has an associated animation, and that the new effect is associated with this animation.
        Additionally, we update the element-to-animations map on the animation's timeline.
        (WebCore::WebAnimation::setTimeline): Update the element-to-animations map on the former and new timeline.
        * dom/Document.cpp:
        (WebCore::Document::prepareForDestruction): Clear the relationship between this document and its timeline.
        (WebCore::Document::getAnimations): Obtain all animations associated with this document's timeline.
        * dom/Document.h:
        * dom/Document.idl:
        * dom/Element.cpp:
        (WebCore::Element::getAnimations): Obtain all animations associated with this element.
        * dom/Element.h:
        * dom/Element.idl:
        * testing/Internals.cpp:

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * animation/Animatable.idl: 
        * animation/AnimationEffect.h:
        (WebCore::AnimationEffect::animation const):
        (WebCore::AnimationEffect::setAnimation):
        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::animationWasAddedToElement):
        (WebCore::AnimationTimeline::animationWasRemovedFromElement):
        (WebCore::AnimationTimeline::animationsForElement):
        * animation/AnimationTimeline.h:
        (WebCore::AnimationTimeline::animations const):
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::DocumentTimeline):
        (WebCore::DocumentTimeline::detachFromDocument):
        (WebCore::DocumentTimeline::currentTime):
        (WebCore::DocumentTimeline::createDisplayRefreshMonitor const):
        * animation/DocumentTimeline.h:
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::create):
        (WebCore::WebAnimation::setEffect):
        (WebCore::WebAnimation::setTimeline):
        * dom/Document.cpp:
        (WebCore::Document::prepareForDestruction):
        (WebCore::Document::getAnimations):
        * dom/Document.h:
        * dom/Document.idl:
        * dom/Element.cpp:
        (WebCore::Element::getAnimations):
        * dom/Element.h:
        * dom/Element.idl:
        * testing/Internals.cpp:

2017-11-13  Alex Christensen  <achristensen@webkit.org>

        Make DocumentLoader::willSendRequest asynchronous
        https://bugs.webkit.org/show_bug.cgi?id=179549

        Reviewed by Tim Horton.

        No change in behavior, except now redirects will wait for PolicyChecker::checkNavigationPolicy's completion handler.
        Before, they would just continue in DocumentLoader::redirectReceived hoping the client had responded to 
        decidePolicyForNavigationAction synchronously or that the client would have been ok with continuing.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::redirectReceived):
        (WebCore::DocumentLoader::willSendRequest):
        (WebCore::DocumentLoader::startLoadingMainResource):
        * loader/DocumentLoader.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadURL):
        (WebCore::FrameLoader::loadWithDocumentLoader):
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNavigationPolicy):
        * loader/PolicyChecker.h:

2017-11-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Implement SPI for clients to request data for a given attachment
        https://bugs.webkit.org/show_bug.cgi?id=179586
        <rdar://problem/35355720>

        Reviewed by Darin Adler.

        Adds support in WebCore for fetching data for a given attachment element. See per-method comments below for
        more detail.

        Test coverage by augmenting existing API tests in WKAttachmentTests, and adding 3 new tests.

        * dom/Document.cpp:
        (WebCore::Document::didInsertAttachmentElement):
        (WebCore::Document::didRemoveAttachmentElement):
        (WebCore::Document::attachmentForIdentifier const):

        Fetches an attachment element matching the given identifier. Using the identifier => attachment element map here
        allows us to avoid the cost of walking the DOM in search for HTMLAttachmentElements every time data is
        requested.

        * dom/Document.h:

        Add a map of attachment identifier => HTMLAttachmentElement in Document. This map is updated when attachment
        elements are connected to or disconnected from the document. Additionally, delegate attachment insertion and
        removal out to the Editor if possible.

        * editing/Editor.cpp:
        (WebCore::Editor::insertAttachmentFromFile):
        * editing/mac/WebContentReaderMac.mm:
        (WebCore::WebContentReader::readFilenames):
        * editing/markup.cpp:
        (WebCore::createFragmentFromMarkup):

        Tweak existing logic that transfers file-backed File objects when deserializing HTMLAttachmentElements from
        markup to handle the case where the attachment element is not file-backed. In this case, we construct a new
        File object using the deserializing constructor. To do this, we use the attachment element's blob URL to make
        sure that the new File references an existing blob matching that URL.

        * html/HTMLAttachmentElement.cpp:
        (WebCore::AttachmentDataReader::create):
        (WebCore::AttachmentDataReader::AttachmentDataReader):

        Introduce AttachmentDataReader, a helper class local to HTMLAttachmentElement that is responsible for loading
        an attachment element's file and invoking a given callback when loading has succeeded or failed.
        Each AttachmentDataReader is retained exclusively by its HTMLAttachmentElement, through the
        HTMLAttachmentElement's vector of unique_ptrs to AttachmentDataReaders.

        (WebCore::HTMLAttachmentElement::~HTMLAttachmentElement):
        (WebCore::HTMLAttachmentElement::blobURL const):

        Add a convenience getter for the blob URL of the attachment's backing File object.

        (WebCore::HTMLAttachmentElement::setFile):

        When setting an attachment element's file, set the blob URL attribute as well to the blob URL. Also, tweak this
        to take a RefPtr<File>&& instead of a raw File*.

        (WebCore::HTMLAttachmentElement::insertedIntoAncestor):
        (WebCore::HTMLAttachmentElement::removedFromAncestor):

        Instead of delegating attachment insertion and removal to the Editor, just call out to the Document, which will
        now call out to the Editor.

        (WebCore::HTMLAttachmentElement::attachmentPath const):

        Add a convenience getter for the attachment path attribute.

        (WebCore::HTMLAttachmentElement::requestData):
        (WebCore::HTMLAttachmentElement::destroyReader):

        Called when a AttachmentDataReader has completed (either with success or failure), and is ready to be removed
        from the attachment element's list of active data readers.

        (WebCore::AttachmentDataReader::~AttachmentDataReader):
        (WebCore::AttachmentDataReader::didFinishLoading):
        (WebCore::AttachmentDataReader::didFail):
        (WebCore::AttachmentDataReader::invokeCallbackAndFinishReading):

        When the reader is done loading, or has failed, or is about to be destroyed, fire the callback with loaded data
        (if any) and cancel the FileReaderLoader.

        * html/HTMLAttachmentElement.h:
        * html/HTMLAttributeNames.in:

        Adds a new "webkitattachmentbloburl" attribute that keeps track of an attachment element's file's blob URL. This
        is used to ensure that information about an attachment element's file is not lost between certain editing
        operations (for instance, deleting a line break) that involve serializing and then deserializing markup into
        DocumentFragments to then insert.

2017-11-13  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Remove GraphicsContext::mustUseShadowBlur()
        https://bugs.webkit.org/show_bug.cgi?id=179612

        Reviewed by Michael Catanzaro.

        Remove the Cairo-specific mustUseShadowBlur() method on the
        GraphicsContext class. It can now be implemented as a static function
        in CairoOperations, using only a PlatformContextCairo object and a
        const reference to the relevant GraphicsContextState.

        No new tests -- no change in behavior.

        * platform/graphics/GraphicsContext.cpp:
        (WebCore::GraphicsContext::mustUseShadowBlur const): Deleted.
        * platform/graphics/GraphicsContext.h:
        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::mustUseShadowBlur):
        (WebCore::Cairo::drawGlyphsShadow):
        (WebCore::Cairo::fillRectWithRoundedHole):
        (WebCore::Cairo::drawGlyphs):
        * platform/graphics/cairo/CairoOperations.h:
        * platform/graphics/cairo/FontCairo.cpp:
        (WebCore::FontCascade::drawGlyphs):
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::fillRectWithRoundedHole):

2017-11-13  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Move state change operations from GraphicsContextCairo to CairoOperations
        https://bugs.webkit.org/show_bug.cgi?id=179610

        Reviewed by Carlos Garcia Campos.

        Move operations that perform Cairo state changes to the CairoOperations
        file. This enforces only using the PlatformContextCairo object to
        achieve the state change, leveraging the cairo_t and ShadowBlur objects
        that are owned by PlatformContextCairo.

        Along with state modification operations, various state query operations
        are also placed under the Cairo::State namespace, again limited to the
        PlatformContextCairo object.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::State::setStrokeThickness):
        (WebCore::Cairo::State::setGlobalAlpha):
        (WebCore::Cairo::State::setCompositeOperation):
        (WebCore::Cairo::State::setShouldAntialias):
        (WebCore::Cairo::State::setImageInterpolationQuality):
        (WebCore::Cairo::State::setCTM):
        (WebCore::Cairo::State::getCTM):
        (WebCore::Cairo::State::setShadowValues):
        (WebCore::Cairo::State::clearShadow):
        (WebCore::Cairo::State::getClipBounds):
        (WebCore::Cairo::State::roundToDevicePixels):
        (WebCore::Cairo::State::isAcceleratedContext):
        * platform/graphics/cairo/CairoOperations.h:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::getCTM const):
        (WebCore::GraphicsContext::restorePlatformState):
        (WebCore::GraphicsContext::clipBounds const):
        (WebCore::GraphicsContext::roundToDevicePixels):
        (WebCore::GraphicsContext::setPlatformStrokeThickness):
        (WebCore::GraphicsContext::setCTM):
        (WebCore::GraphicsContext::setPlatformShadow):
        (WebCore::GraphicsContext::clearPlatformShadow):
        (WebCore::GraphicsContext::setPlatformAlpha):
        (WebCore::GraphicsContext::setPlatformCompositeOperation):
        (WebCore::GraphicsContext::setPlatformShouldAntialias):
        (WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
        (WebCore::GraphicsContext::isAcceleratedContext const):

2017-11-13  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Move glyph drawing operations from FontCairo to CairoOperations
        https://bugs.webkit.org/show_bug.cgi?id=179609

        Reviewed by Carlos Garcia Campos.

        Move operations that perform glyph drawing to the CairoOperations file.
        This limits operations to only work with a PlatformContextCairo object,
        along with other required parameters, and will help with future work
        that will rely on isolated Cairo-specific code.

        Along with moving the drawGlyphs() code, the helper functions are moved
        and adjusted to work specifically on a PlatformContextCairo object and
        a const GraphicsContextState reference, only using a GraphicsContext
        reference for any required shadowed glyph drawing.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::drawGlyphsToContext):
        (WebCore::Cairo::drawGlyphsShadow):
        (WebCore::Cairo::drawGlyphs):
        * platform/graphics/cairo/FontCairo.cpp:
        (WebCore::FontCascade::drawGlyphs):
        (WebCore::drawGlyphsToContext): Deleted.
        (WebCore::drawGlyphsShadow): Deleted.

2017-11-13  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Move focus ring drawing operations from GraphicsContextCairo to CairoOperations
        https://bugs.webkit.org/show_bug.cgi?id=179603

        Reviewed by Carlos Garcia Campos.

        Move operations that perform focus ring drawing to the CairoOperations
        file. This limits operations to only work with a PlatformContextCairo
        object, along with other required parameters, and will help with future
        work in this area.

        The Cairo::State namespace is introduced, with the setStrokeStyle()
        function placed there. The namespace will be used for operations that
        only change an aspect of the Cairo state. More functions will be added
        soon, and existing line and miter operations will likely move there as
        well.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::adjustFocusRingColor):
        (WebCore::Cairo::adjustFocusRingLineWidth):
        (WebCore::Cairo::focusRingStrokeStyle):
        (WebCore::Cairo::State::setStrokeStyle):
        (WebCore::Cairo::drawFocusRing):
        * platform/graphics/cairo/CairoOperations.h:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::drawFocusRing):
        (WebCore::GraphicsContext::setPlatformStrokeStyle):
        (WebCore::adjustFocusRingColor): Deleted.
        (WebCore::adjustFocusRingLineWidth): Deleted.
        (WebCore::focusRingStrokeStyle): Deleted.

2017-11-13  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix debug build with Touch Events enabled after r224740.

        * dom/EventContext.cpp:
        (WebCore::TouchEventContext::checkReachability const):

2017-11-12  Maciej Stachowiak  <mjs@apple.com>

        Remove support for UTF-32 variant text encodings
        https://bugs.webkit.org/show_bug.cgi?id=179435

        Reviewed by Darin Adler.

        Non-support for these encodings is covered by WPT tests.

        * platform/text/TextCodecICU.cpp: Remove UTF-32 variants.
        Technically, we should also ensure that UTF-32LE with a BOM
        gets sniffed as UTF-16LE instead of windows-1252. Chrome
        does this but Firefox doesn't yet. WPT tests cover it, and
        we can fix it later.

2017-11-12  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Move rectangle and path filling, stroking, clearing operations in GraphicsContextCairo to CairoOperations
        https://bugs.webkit.org/show_bug.cgi?id=179599

        Reviewed by Carlos Garcia Campos.

        Move operations that perform filling, stroking and clearing for
        specified rectangles and paths to the CairoOperations file. This limits
        operations to only work with a PlatformContextCairo object, along with
        any required parameter, and will help with future work in this area.

        Helper functions are copied along for the time being, but will later be
        removed from the GraphicsContextCairo implementation file.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::fillRectWithColor):
        (WebCore::Cairo::drawPathShadow):
        (WebCore::Cairo::fillCurrentCairoPath):
        (WebCore::Cairo::fillRect):
        (WebCore::Cairo::fillRoundedRect):
        (WebCore::Cairo::fillRectWithRoundedHole):
        (WebCore::Cairo::fillPath):
        (WebCore::Cairo::strokeRect):
        (WebCore::Cairo::strokePath):
        (WebCore::Cairo::clearRect):
        * platform/graphics/cairo/CairoOperations.h:
        * platform/graphics/cairo/GradientCairo.cpp:
        (WebCore::Gradient::fill):
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::fillPath):
        (WebCore::GraphicsContext::strokePath):
        (WebCore::GraphicsContext::fillRect):
        (WebCore::GraphicsContext::clearRect):
        (WebCore::GraphicsContext::strokeRect):
        (WebCore::GraphicsContext::platformFillRoundedRect):
        (WebCore::GraphicsContext::fillRectWithRoundedHole):

2017-11-12  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Move state stack, CTM, transparency layer operations in GraphicsContextCairo to CairoOperations
        https://bugs.webkit.org/show_bug.cgi?id=179598

        Reviewed by Carlos Garcia Campos.

        Move operations that save and restore state, adjust CTM and modify the
        transparency layer stack to the CairoOperations file. This limits
        operations to only work with a PlatformContextCairo object, along with
        any required parameter, and will help with future work in this area.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::save):
        (WebCore::Cairo::restore):
        (WebCore::Cairo::translate):
        (WebCore::Cairo::rotate):
        (WebCore::Cairo::scale):
        (WebCore::Cairo::concatCTM):
        (WebCore::Cairo::beginTransparencyLayer):
        (WebCore::Cairo::endTransparencyLayer):
        * platform/graphics/cairo/CairoOperations.h:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::savePlatformState):
        (WebCore::GraphicsContext::restorePlatformState):
        (WebCore::GraphicsContext::translate):
        (WebCore::GraphicsContext::concatCTM):
        (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
        (WebCore::GraphicsContext::endPlatformTransparencyLayer):
        (WebCore::GraphicsContext::rotate):
        (WebCore::GraphicsContext::scale):

2017-11-12  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Move line, miter operations in GraphicsContextCairo to CairoOperations
        https://bugs.webkit.org/show_bug.cgi?id=179597

        Reviewed by Carlos Garcia Campos.

        Move operations that adjust line cap, line dash, line join and miter
        limit to the CairoOperations file. This limits operations to only work
        with a PlatformContextCairo object, along with any required parameter,
        and will help with future work in this area.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::setLineCap):
        (WebCore::Cairo::setLineDash):
        (WebCore::Cairo::setLineJoin):
        (WebCore::Cairo::setMiterLimit):
        * platform/graphics/cairo/CairoOperations.h:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::setLineCap):
        (WebCore::GraphicsContext::setLineDash):
        (WebCore::GraphicsContext::setLineJoin):
        (WebCore::GraphicsContext::setMiterLimit):
        (WebCore::isDashArrayAllZero): Deleted.

2017-11-12  Chris Dumez  <cdumez@apple.com>

        [Service Workers] Activate algorithm says terminate the active worker if it exists
        https://bugs.webkit.org/show_bug.cgi?id=179559

        Reviewed by Darin Adler.

        Activate algorithm says terminate the active worker if it exists:
        - https://w3c.github.io/ServiceWorker/#activation-algorithm (Step 2.1)

        No new tests, no-op for now as the terminate() function is not implemented
        yet.

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

2017-11-12  Darin Adler  <darin@apple.com>

        More is<> and downcast<>, less static_cast<>
        https://bugs.webkit.org/show_bug.cgi?id=179600

        Reviewed by Chris Dumez.

        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::extract): Use downcast instead of static_cast.
        (WebCore::FetchBody::bodyAsFormData const): Ditto.
        * Modules/indexeddb/IDBObjectStore.cpp:
        (WebCore::IDBObjectStore::putOrAdd): Ditto.
        * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
        (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): Ditto.
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::libWebRTCProvider): Ditto.

        * accessibility/AccessibilityMediaControls.cpp:
        (WebCore::AccessibilityMediaTimeDisplay::stringValue const): Got rid of local
        variable and used std::abs instead of fabsf. Did not use downcast here because
        it doesn't exist for this class.

        * bindings/js/JSEventTargetCustom.h:
        (WebCore::IDLOperation<JSEventTarget>::call): Use downcast instead of toDOMWindow.
        * dom/DocumentEventQueue.cpp:
        (WebCore::DocumentEventQueue::dispatchEvent): Ditto.

        * dom/Element.h: Added is/downcast for EventTarget.

        * dom/EventContext.cpp:
        (WebCore::TouchEventContext::checkReachability const): Use downcast instead
        of toNode.
        * dom/EventContext.h:
        (WebCore::EventContext::isUnreachableNode const): Ditto.
        * dom/EventPath.cpp:
        (WebCore::shouldEventCrossShadowBoundary): Ditto.
        (WebCore::EventPath::setRelatedTarget): Ditto.
        (WebCore::EventPath::retargetTouch): Ditto.
        (WebCore::EventPath::EventPath): Ditto.

        * dom/EventTarget.cpp:
        (WebCore::EventTarget::toNode): Deleted.
        (WebCore::EventTarget::isNode const): Added.
        (WebCore::EventTarget::toDOMWindow): Deleted.
        (WebCore::EventTarget::isMessagePort const): Deleted. This was not used.
        (WebCore::EventTarget::addEventListener): Use downcast instead of toDOMWindow
        and toNode.
        * dom/EventTarget.h: Updated for the above.

        * dom/MessagePort.h: Deleted unused isMessagePort.

        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::toElement const): Use downcast instead of toNode.
        Also refactored to make function a little smaller.
        (WebCore::MouseEvent::fromElement const): Ditto.

        * dom/MouseRelatedEvent.cpp:
        (WebCore::MouseRelatedEvent::computeRelativePosition): Use downcast
        instead of toNode.

        * dom/Node.cpp:
        (WebCore::Node::isNode const): Added.
        (WebCore::Node::toNode): Deleted.
        * dom/Node.h: Updated for the above. Also added SPECIALIZE_TYPE_TRAITS
        so we can do is/downcast.

        * dom/ScopedEventQueue.cpp:
        (WebCore::ScopedEventQueue::enqueueEvent): Use is instead of toNode.
        (WebCore::ScopedEventQueue::dispatchEvent const): Use downcast instead of toNode.

        * dom/make_names.pl:
        (printTypeHelpers): Added support for is/downcast from EventTarget.

        * editing/Editor.cpp:
        (WebCore::Editor::selectionForCommand): Use is/downcast instead of toNode.
        * editing/EditorCommand.cpp:
        (WebCore::targetFrame): Ditto.
        * html/HTMLAnchorElement.cpp:
        (WebCore::appendServerMapMousePosition): Ditto.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::createContextWebGL): Use downcast instead of
        static_cast.
        (WebCore::HTMLCanvasElement::getContextWebGL): Ditto.
        (WebCore::HTMLCanvasElement::getImageData): Ditto.

        * html/HTMLElement.h: Added support for is/downcast from EventTarget.

        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::handleLocalEvents): Use is instead of toNode.
        (WebCore::submitElementFromEvent): Deleted. Was a duplicate of findSubmitButton.
        (WebCore::HTMLFormElement::prepareForSubmission): Rewrote code that calls
        submitElementFromEvent to call findSubmitButton instead. Also don't bother
        finding the submit button unless we are going to validate, since all we do
        after finding it is reconsider whether we should validate.
        (WebCore::HTMLFormElement::findSubmitButton const): Rewrote to use is,
        downcast, and lineageOfType rather than a handwritten loop and toNode.
        Relies on the fact that the target is an element, never a text node.

        * html/HTMLLabelElement.cpp:
        (WebCore::HTMLLabelElement::defaultEventHandler): Use is and downcast instead
        of toNode.

        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const): Changed argument
        type to EventTarget so we can do the type checking and casting here instead of at
        each of the callers.
        * html/HTMLPlugInImageElement.h: Updated for the above.

        * html/HTMLSummaryElement.cpp:
        (WebCore::isClickableControl): Changed argument type to EventTarget so we can do
        the type checking and casting here instead of at each of the callers.
        (WebCore::HTMLSummaryElement::defaultEventHandler): Removed call to toNode.

        * html/HTMLTextFormControlElement.h: Added support for is/downcast from EventTarget.

        * html/MediaDocument.cpp:
        (WebCore::MediaDocument::defaultEventHandler): Use is/downcast instead of toNode.
        * html/RangeInputType.cpp:
        (WebCore::RangeInputType::handleMouseDownEvent): Ditto.
        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler): Ditto.
        (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler): Ditto.
        Also use get instead of find/end.

        * html/shadow/MediaControls.cpp:
        (WebCore::MediaControls::containsRelatedTarget): Use is/downcast instead of toNode.
        * inspector/InspectorFrontendHost.cpp:
        (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent): Ditto.
        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::didAddEventListener): Ditto.
        (WebCore::InspectorDOMAgent::willRemoveEventListener): Ditto.
        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::maybeCreateContextMenu): Ditto.

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::toDOMWindow): Deleted.
        * page/DOMWindow.h: Updated for the above. Also added SPECIALIZE_TYPE_TRAITS
        so we can do is/downcast.

        * page/EventHandler.cpp:
        (WebCore::EventHandler::handleTouchEvent): Use is/downcast instead of toNode.

        * platform/graphics/WidthCache.h:
        (WebCore::WidthCache::add): Removed unneeded static_cast; length already returns unsigned.

        * rendering/RenderSnapshottedPlugIn.cpp:
        (WebCore::RenderSnapshottedPlugIn::handleEvent): Removed unneeded toNode now that
        partOfSnapshotOverlay takes an EventTarget.

2017-11-12  Gabriel Ivascu  <givascu@igalia.com>

        [GTK] Add functionality to handle font sizes in points
        https://bugs.webkit.org/show_bug.cgi?id=179285

        Reviewed by Carlos Garcia Campos and Michael Catanzaro.

        * platform/PlatformScreen.h:
        * platform/gtk/PlatformScreenGtk.cpp:
        (WebCore::screenDPI):
        * platform/wpe/PlatformScreenWPE.cpp:
        (WebCore::screenDPI):

2017-11-12  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WebCore] Implement import.meta.url
        https://bugs.webkit.org/show_bug.cgi?id=178672

        Reviewed by Darin Adler.

        This patch implements `import.meta.url` field, which holds a base url
        of the currently executing module[1].

        In the case of embedded modules, this field becomes the URL of the
        embedding HTML file. In the case of imported modules, the URL becomes
        the URL of the executed module script file.

        [1]: https://github.com/whatwg/html/pull/3141

        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::moduleLoaderCreateImportMetaProperties):
        * bindings/js/JSDOMWindowBase.h:
        * bindings/js/ScriptModuleLoader.cpp:
        (WebCore::ScriptModuleLoader::moduleURL):
        (WebCore::ScriptModuleLoader::evaluate):
        (WebCore::ScriptModuleLoader::createImportMetaProperties):
        * bindings/js/ScriptModuleLoader.h:

2017-11-11  Dan Bernstein  <mitz@apple.com>

        [Xcode] WebCore generates unified sources during installhdrs
        https://bugs.webkit.org/show_bug.cgi?id=179578

        Reviewed by Anders Carlsson.

        * WebCore.xcodeproj/project.pbxproj: Use GenerateUnifiedSources.xcconfig, which sets
          INSTALLHDRS_SCRIPT_PHASE to NO, for the Generate Unified Sources target.

2017-11-11  Simon Fraser  <simon.fraser@apple.com>

        Remove redundant platform-specific implementations of Image::drawPattern()
        https://bugs.webkit.org/show_bug.cgi?id=179580

        Reviewed by Sam Weinig.

        Platform-specific Image files had implementations of Image::drawPattern() but they
        were all effectively identical, so put a single implementation into Image.cpp.

        * SourcesCocoa.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/SourcesCairo.txt:
        * platform/graphics/Image.cpp:
        (WebCore::Image::drawPattern):
        * platform/graphics/cairo/ImageCairo.cpp: Removed.
        * platform/graphics/cg/ImageCG.cpp: Removed.
        * platform/graphics/win/ImageDirect2D.cpp:
        (WebCore::Image::drawPattern): Deleted.

2017-11-11  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: Canvas tab: show detailed status during canvas recording
        https://bugs.webkit.org/show_bug.cgi?id=178185
        <rdar://problem/34939862>

        Reviewed by Brian Burg.

        Updated existing tests to assert that the correct number of progress events are fired.

        * inspector/agents/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
        After each recorded frame, fire a progress event with the recorded frames as data. This will
        release the frames from the associated InspectorCanvas, meaning that the frames must be
        aggregated in the frontend before a Recording can be created.

        The protocol is designed with arrays so that if we decide to add throttling (e.g. one event
        per second) we are able to do so without modifying the protocol.

        * inspector/InspectorCanvas.h:
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::hasRecordingData const):
        (WebCore::InspectorCanvas::currentFrameHasData const):
        (WebCore::InspectorCanvas::recordAction):
        (WebCore::InspectorCanvas::finalizeFrame):
        (WebCore::InspectorCanvas::markCurrentFrameIncomplete):
        Add additional checks that the list of recorded frames is not nullptr when finalizing or
        marking as incomplete.

2017-11-11  Helmut Grohne  <helmut@subdivi.de>

        [GTK] PlatformGTK.cmake: use the PKG_CONFIG_EXECUTABLE variable
        https://bugs.webkit.org/show_bug.cgi?id=179547

        Reviewed by Michael Catanzaro.

        * PlatformGTK.cmake: Use PKG_CONFIG_EXECUTABLE instead of
        hardcoding the executable name.

2017-11-10  Chris Dumez  <cdumez@apple.com>

        [Service Workers] Registration promise should be rejected when the service worker fails to start
        https://bugs.webkit.org/show_bug.cgi?id=179566

        Reviewed by Brady Eidson.

        Registration promise should be rejected when the service worker fails to start.

        Though our code intended to do this, there were several issues:
        - Our code failed to properly detect when the script failed to evaluate. This is
          because it relied on the exception message being non-null but it was always
          null when same origin due to a bug.
        - Our scriptContextFailedToStart() handler failed to rejected the promise
          and finish the job as per:
          - https://w3c.github.io/ServiceWorker/#update-algorithm (step 9.7)

        Test: http/tests/workers/service/worker-fails-to-start.html

        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::evaluate):
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptContextFailedToStart):

2017-11-10  Jer Noble  <jer.noble@apple.com>

        Unreviewed Win Debug build fix; add FourCC.cpp to the cmake source list for Windows.

        * PlatformWin.cmake:

2017-11-10  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [CG] PDF document cached image is regenerated every time the destination rectangle changes
        https://bugs.webkit.org/show_bug.cgi?id=179516

        Reviewed by Tim Horton.

        The PDF document cached image was regenerated if m_cachedImageRect didn't
        contain the dirty rectangle. When moving the image, its new rectangle is
        invalidated. This will set a new dirty rectangle outside m_cachedImageRect
        which may not be fully inside m_cachedImageRect.

        The PDF document cached image should be reused if we still draw the same
        part of the image (srcRet did not change) and we use the same zooming factor        
        (dstSize did not change).

        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::cacheParametersMatch const): Remove a check
        that was added mainly to force recalculating m_cachedImageRect when the
        dirty rectangle changes. 

        (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Recalculate
        m_cachedImageRect every time this function is called regardless the cached
        image will be regenerated or not.

2017-11-10  Simon Fraser  <simon.fraser@apple.com>

        Compositing layers in UIWebView are often missing content after scrolling
        https://bugs.webkit.org/show_bug.cgi?id=179564
        rdar://problem/33885639

        Reviewed by Tim Horton.
        
        When dropping backing store for layers outside the viewport, we rely on a compositing
        layer flush to compute layer visibility and bring the backing store back when necessary.

        In UIWebView, we have a mechanism to trigger flushing on user scrolling but it only triggers
        when there are tiled layers. Remove that condition so it triggers always, now that
        backing store availability also depends on this.

        * page/ios/FrameIOS.mm:
        (WebCore::Frame::viewportOffsetChanged):
        (WebCore::anyFrameHasTiledLayers): Deleted.

2017-11-10  Simon Fraser  <simon.fraser@apple.com>

        Contents of composited overflow-scroll are missing when newly added
        https://bugs.webkit.org/show_bug.cgi?id=179556
        rdar://problem/20368294

        Reviewed by Tim Horton.

        When content is appended to an oveflow:scroll, we do a subtree layout. That triggered
        a compositing code path that failed to call updateAfterDescendants() which is where
        we compute whether we can be a simple composited layer without backing store. Fix to
        call that after the updateGeometry() call, as we do elsewhere.

        Test: compositing/backing/overflow-gains-content.html

        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateAfterLayout):

2017-11-10  Simon Fraser  <simon.fraser@apple.com>

        Remove the 'CompositingChildrenOnly' flag which was always on
        https://bugs.webkit.org/show_bug.cgi?id=179546

        Reviewed by Antoine Quint.

        All calls to updateAfterLayout() passed the CompositingChildrenOnly flag, so all calls
        to updateCompositingDescendantGeometry() had compositedChildrenOnly=true, so remove
        these flags.

        Also use an OptionSet<>.

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositions):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateAfterLayout):
        (WebCore::RenderLayerBacking::contentChanged):
        * rendering/RenderLayerBacking.h:
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
        * rendering/RenderLayerCompositor.h:

2017-11-10  Chris Dumez  <cdumez@apple.com>

        Remove dead code from ServiceWorkerRegistration
        https://bugs.webkit.org/show_bug.cgi?id=179555

        Reviewed by Ryosuke Niwa.

        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::setInstallingWorker): Deleted.
        (WebCore::ServiceWorkerRegistration::setWaitingWorker): Deleted.
        (WebCore::ServiceWorkerRegistration::setActiveWorker): Deleted.
        * workers/service/ServiceWorkerRegistration.h:

2017-11-10  Chris Dumez  <cdumez@apple.com>

        [Service Workers] Implement better support for "Clear Registration" algorithm
        https://bugs.webkit.org/show_bug.cgi?id=179441

        Reviewed by Brady Eidson.

        Implement better support for "Clear Registration" algorithm as per:
        - https://w3c.github.io/ServiceWorker/#clear-registration-algorithm

        In particular, we now properly clear the service workers on the ServiceWorkerRegistration
        object and we properly update its service workers' state to "redundant".

        Test: http/tests/workers/service/registration-clear-redundant-worker.html

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

2017-11-10  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r224705.

        Introduced a LayoutTest crash on WK1.

        Reverted changeset:

        "[Web Animations] Implement getAnimations()"
        https://bugs.webkit.org/show_bug.cgi?id=179535
        https://trac.webkit.org/changeset/224705

2017-11-10  Jer Noble  <jer.noble@apple.com>

        Add a FairPlay Streaming based CDM for Modern EME
        https://bugs.webkit.org/show_bug.cgi?id=179499
        <rdar://problem/35445033>

        Reviewed by Eric Carlson.

        Tests: platform/mac/media/encrypted-media/fps-createMediaKeys.html
               platform/mac/media/encrypted-media/fps-requestMediaKeySystemAccess.html

        Add new CDMFairPlayStreaming and CDMInstanceFairPlayStreamingAVFObjC platform classes which implement
        the basics of FairPlay Streaming support in Modern EME.

        Drive-by fixes:

        - Add a != operator to FourCC
        - Add a virtual setStorageDirectory() method to CDMInstance (and default implementations to CDMClearKey
          and MockCDM)
        - Move ISOVTTCue into the platform/graphics/iso directory and update all the places where it is called.

        * Modules/encryptedmedia/MediaKeySession.cpp:
        (WebCore::MediaKeySession::mediaKeysStorageDirectory const):
        * Modules/encryptedmedia/MediaKeySession.h:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/encryptedmedia/CDMFactory.cpp:
        * platform/encryptedmedia/CDMInstance.h:
        * platform/encryptedmedia/CDMRestrictions.h:
        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::CDMInstanceClearKey::setStorageDirectory):
        * platform/encryptedmedia/clearkey/CDMClearKey.h:
        * platform/graphics/FourCC.h:
        (WebCore::FourCC::operator!= const):
        * platform/graphics/iso/ISOBox.cpp: Added.
        (WebCore::ISOBox::peekBox):
        (WebCore::ISOBox::read):
        (WebCore::ISOBox::parse):
        (WebCore::ISOFullBox::parse):
        * platform/graphics/iso/ISOBox.h: Added.
        (WebCore::ISOBox::minimumBoxSize):
        (WebCore::ISOBox::size const):
        (WebCore::ISOBox::boxType const):
        (WebCore::ISOBox::extendedType const):
        (WebCore::ISOBox::checkedRead):
        (WebCore::ISOFullBox::version const):
        (WebCore::ISOFullBox::flags const):
        * platform/graphics/iso/ISOOriginalFormatBox.cpp: Added.
        (WebCore::ISOOriginalFormatBox::parse):
        * platform/graphics/iso/ISOOriginalFormatBox.h: Added.
        (WebCore::ISOOriginalFormatBox::boxTypeName):
        (WebCore::ISOOriginalFormatBox::dataFormat const):
        * platform/graphics/iso/ISOProtectionSchemeInfoBox.cpp: Added.
        (WebCore::ISOProtectionSchemeInfoBox::parse):
        * platform/graphics/iso/ISOProtectionSchemeInfoBox.h: Added.
        (WebCore::ISOProtectionSchemeInfoBox::boxTypeName):
        (WebCore::ISOProtectionSchemeInfoBox::schemeTypeBox const):
        (WebCore::ISOProtectionSchemeInfoBox::schemeInformationBox const):
        * platform/graphics/iso/ISOSchemeInformationBox.cpp: Added.
        (WebCore::ISOSchemeInformationBox::parse):
        * platform/graphics/iso/ISOSchemeInformationBox.h: Added.
        (WebCore::ISOSchemeInformationBox::boxTypeName):
        (WebCore::ISOSchemeInformationBox::schemeSpecificData const):
        * platform/graphics/iso/ISOSchemeTypeBox.cpp: Added.
        (WebCore::ISOSchemeTypeBox::parse):
        * platform/graphics/iso/ISOSchemeTypeBox.h: Added.
        (WebCore::ISOSchemeTypeBox::boxTypeName):
        (WebCore::ISOSchemeTypeBox::schemeType const):
        (WebCore::ISOSchemeTypeBox::schemeVersion const):
        * platform/graphics/iso/ISOTrackEncryptionBox.cpp: Added.
        (WebCore::ISOTrackEncryptionBox::parse):
        * platform/graphics/iso/ISOTrackEncryptionBox.h: Added.
        (WebCore::ISOTrackEncryptionBox::boxTypeName):
        (WebCore::ISOTrackEncryptionBox::defaultCryptByteBlock const):
        (WebCore::ISOTrackEncryptionBox::defaultSkipByteBlock const):
        (WebCore::ISOTrackEncryptionBox::defaultIsProtected const):
        (WebCore::ISOTrackEncryptionBox::defaultPerSampleIVSize const):
        (WebCore::ISOTrackEncryptionBox::defaultKID const):
        (WebCore::ISOTrackEncryptionBox::defaultConstantIV const):
        * platform/graphics/iso/ISOVTTCue.cpp: Added.
        (WebCore::ISOStringBox::contents):
        (WebCore::vttIdBoxType):
        (WebCore::vttSettingsBoxType):
        (WebCore::vttPayloadBoxType):
        (WebCore::vttCurrentTimeBoxType):
        (WebCore::vttCueSourceIDBoxType):
        (WebCore::ISOWebVTTCue::ISOWebVTTCue):
        (WebCore::ISOWebVTTCue::parse):
        * platform/graphics/iso/ISOVTTCue.h: Renamed from Source/WebCore/platform/graphics/ISOVTTCue.h.
        (WebCore::ISOWebVTTCue::boxTypeName):
        (WebCore::ISOWebVTTCue::presentationTime const):
        (WebCore::ISOWebVTTCue::duration const):
        (WebCore::ISOWebVTTCue::sourceID const):
        (WebCore::ISOWebVTTCue::id const):
        (WebCore::ISOWebVTTCue::originalStartTime const):
        (WebCore::ISOWebVTTCue::settings const):
        (WebCore::ISOWebVTTCue::cueText const):
        * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: Added.
        (WebCore::extractSinfData):
        (WebCore::extractSchemeAndKeyIdFromSinf):
        (WebCore::extractKeyIDsSinf):
        (WebCore::sanitizeSinf):
        (WebCore::CDMFactory::platformRegisterFactories):
        (WebCore::CDMFactoryFairPlayStreaming::singleton):
        (WebCore::CDMFactoryFairPlayStreaming::createCDM):
        (WebCore::CDMFactoryFairPlayStreaming::supportsKeySystem):
        (WebCore::CDMPrivateFairPlayStreaming::supportsInitDataType const):
        (WebCore::CDMPrivateFairPlayStreaming::supportsConfiguration const):
        (WebCore::CDMPrivateFairPlayStreaming::supportsConfigurationWithRestrictions const):
        (WebCore::CDMPrivateFairPlayStreaming::supportsSessionTypeWithConfiguration const):
        (WebCore::CDMPrivateFairPlayStreaming::supportsRobustness const):
        (WebCore::CDMPrivateFairPlayStreaming::distinctiveIdentifiersRequirement const):
        (WebCore::CDMPrivateFairPlayStreaming::persistentStateRequirement const):
        (WebCore::CDMPrivateFairPlayStreaming::distinctiveIdentifiersAreUniquePerOriginAndClearable const):
        (WebCore::CDMPrivateFairPlayStreaming::createInstance):
        (WebCore::CDMPrivateFairPlayStreaming::loadAndInitialize):
        (WebCore::CDMPrivateFairPlayStreaming::supportsServerCertificates const):
        (WebCore::CDMPrivateFairPlayStreaming::supportsSessions const):
        (WebCore::CDMPrivateFairPlayStreaming::supportsInitData const):
        (WebCore::CDMPrivateFairPlayStreaming::sanitizeResponse const):
        (WebCore::CDMPrivateFairPlayStreaming::sanitizeSessionId const):
        * platform/graphics/avfoundation/CDMFairPlayStreaming.h: Added.
        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: Added.
        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: Added.
        (-[WebCoreFPSContentKeySessionDelegate initWithParent:]):
        (-[WebCoreFPSContentKeySessionDelegate invalidate]):
        (-[WebCoreFPSContentKeySessionDelegate contentKeySession:didProvideContentKeyRequest:]):
        (-[WebCoreFPSContentKeySessionDelegate contentKeySession:didProvideRenewingContentKeyRequest:]):
        (-[WebCoreFPSContentKeySessionDelegate contentKeySession:didProvidePersistableContentKeyRequest:]):
        (-[WebCoreFPSContentKeySessionDelegate contentKeySession:didUpdatePersistableContentKey:forContentKeyIdentifier:]):
        (-[WebCoreFPSContentKeySessionDelegate contentKeySession:contentKeyRequest:didFailWithError:]):
        (-[WebCoreFPSContentKeySessionDelegate contentKeySession:shouldRetryContentKeyRequest:reason:]):
        (-[WebCoreFPSContentKeySessionDelegate contentKeySessionContentProtectionSessionIdentifierDidChange:]):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::CDMInstanceFairPlayStreamingAVFObjC):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::~CDMInstanceFairPlayStreamingAVFObjC):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::mimeTypeIsPlayable):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setDistinctiveIdentifiersAllowed):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setPersistentStateAllowed):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setServerCertificate):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::isLicenseTypeSupported const):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestLicense):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::loadSession):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::closeSession):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::removeSessionData):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::storeRecordOfKeyUsage):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keySystem const):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRenewingRequest):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvidePersistableRequest):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::shouldRetryRequestForReason):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionIdentifierChanged):
        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
        (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
        (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
        * testing/MockCDMFactory.cpp:
        (WebCore::MockCDMInstance::setStorageDirectory):
        * testing/MockCDMFactory.h:

2017-11-10  Antoine Quint  <graouts@apple.com>

        [Web Animations] Implement getAnimations()
        https://bugs.webkit.org/show_bug.cgi?id=179535
        <rdar://problem/34932475>

        Reviewed by Simon Fraser.

        We now allow a list of animations for a document, with Document.getAnimations(), or for an
        element, with Animatable.getAnimations(), to be returned. In order to support this, we maintain
        a map on AnimationTimeline of all animations for a given element. This map is invalidated
        when an animation's timeline changes and when an animation's effect changes. Note that the
        Web Animations spec mandates that an AnimationEffect can only be a single animation's effect.

        Additionally, we ensure that the Document-to-DocumentTimeline relationship is cleared when
        is being prepared for teardown to avoid a ref-cycle.

        Tests: http/wpt/wk-web-animations/interfaces/document-get-animations.html
               http/wpt/wk-web-animations/interfaces/element-get-animations.html
               http/wpt/wk-web-animations/timing-model/animation-effect-unique-relationship.html

        * CMakeLists.txt: Add Animatable.idl.
        * DerivedSources.make: Add Animatable.idl.
        * WebCore.xcodeproj/project.pbxproj: Add Animatable.idl.
        * animation/Animatable.idl: A new interface that Element implements and which currently only exposes
        getAnimations(), the animate() method will be added later.
        * animation/AnimationEffect.h: Add a new m_animation member to reference the animation using this
        effect. This relationship is required so we guarantee that an effect is associated with a single
        animation at most.
        (WebCore::AnimationEffect::animation const):
        (WebCore::AnimationEffect::setAnimation):
        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::animationWasAddedToElement): New method to notify the timeline that an
        animation registered with this timeline has been associated with a new element through its effect.
        (WebCore::AnimationTimeline::animationWasRemovedFromElement): New method to notify the timeline that an
        animation registered with this timeline has been disassociated with an element through its effect.
        (WebCore::AnimationTimeline::animationsForElement): New method returning all animations registered with
        this timeline for a given element.
        * animation/AnimationTimeline.h:
        (WebCore::AnimationTimeline::animations const): All animations registered with this timeline.
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::DocumentTimeline):
        (WebCore::DocumentTimeline::detachFromDocument): Clear the reference between this timeline and its document.
        * animation/DocumentTimeline.h:
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::create):
        (WebCore::WebAnimation::setEffect): As an animation's effect changes, we need to ensure that the old
        effect no longer has an associated animation, and that the new effect is associated with this animation.
        Additionally, we update the element-to-animations map on the animation's timeline.
        (WebCore::WebAnimation::setTimeline): Update the element-to-animations map on the former and new timeline.
        * dom/Document.cpp:
        (WebCore::Document::prepareForDestruction): Clear the relationship between this document and its timeline.
        (WebCore::Document::getAnimations): Obtain all animations associated with this document's timeline.
        * dom/Document.h:
        * dom/Document.idl:
        * dom/Element.cpp:
        (WebCore::Element::getAnimations): Obtain all animations associated with this element.
        * dom/Element.h:
        * dom/Element.idl:
        * testing/Internals.cpp:

2017-11-10  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Make http status codes be "integer" instead of "number" in protocol
        https://bugs.webkit.org/show_bug.cgi?id=179543

        Reviewed by Antoine Quint.

        * inspector/agents/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
        No need for the temporary or type change.

2017-11-10  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r224602 and r224697.
        https://bugs.webkit.org/show_bug.cgi?id=179545

        The LayoutTest for this change is flaky. (Requested by
        ryanhaddad on #webkit).

        Reverted changesets:

        "Add tests to ensure that <source> tags are only preloaded
        when the `type`"
        https://bugs.webkit.org/show_bug.cgi?id=179231
        https://trac.webkit.org/changeset/224602

        "Fix race conditions with setBackingScaleFactor, page refresh
        and preloader"
        https://bugs.webkit.org/show_bug.cgi?id=179488
        https://trac.webkit.org/changeset/224697

2017-11-10  Chris Dumez  <cdumez@apple.com>

        [Service Workers] Implement "Try Activate" / "Activate" algorithms
        https://bugs.webkit.org/show_bug.cgi?id=179436

        Reviewed by Brady Eidson.

        Implement proper "Try Activate" / "Activate" algorithms as per:
        - https://w3c.github.io/ServiceWorker/#try-activate-algorithm
        - https://w3c.github.io/ServiceWorker/#activation-algorithm

        Test: http/tests/workers/service/basic-activate-event.html

        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::fireActivateEvent):
        * workers/service/context/SWContextManager.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::fireActivateEvent):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::didFinishActivation):
        (WebCore::SWServer::didFinishActivation):
        (WebCore::SWServer::fireActivateEvent):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::didFinishInstall):
        (WebCore::SWServerJobQueue::tryActivate):
        (WebCore::SWServerJobQueue::activate):
        (WebCore::SWServerJobQueue::didFinishActivation):
        * workers/service/server/SWServerJobQueue.h:

2017-11-10  Alex Christensen  <achristensen@webkit.org>

        Fix debug build after r224700
        https://bugs.webkit.org/show_bug.cgi?id=179460

        * platform/text/TextEncodingRegistry.cpp:
        (WebCore::addToTextEncodingNameMap):

2017-11-10  Maciej Stachowiak  <mjs@apple.com>

        Remove TEC decoders that duplicate ICU decoders
        https://bugs.webkit.org/show_bug.cgi?id=179460

        Reviewed by Darin Adler.

        Test: fast/encoding/duplicate-tec-encodings.html

        * platform/text/TextEncodingRegistry.cpp:
        (WebCore::checkExistingName): Deleted.
        (WebCore::addToTextEncodingNameMap): Move the check from checkExistingName here,
        and make it an ASSERT, since we should now be guaranteed no duplicate encodings.
        * platform/text/mac/mac-encodings.txt: Remove encodings that duplicate ones we
        implement with ICU.
        * platform/text/TextCodecICU.cpp: Add some extra encoding aliases that only TEC 
        knew about.

2017-11-10  Alex Christensen  <achristensen@webkit.org>

        Make CachedResource::redirectReceived asynchronous
        https://bugs.webkit.org/show_bug.cgi?id=179503

        Reviewed by Antti Koivisto.

        There were a few loops where we called redirectReceived many times in a row,
        and these are replaced with a completion handler that recursively calls the next
        redirectReceived or the code after the loop.

        No change in behavior.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::redirectReceived):
        * loader/DocumentLoader.h:
        (WebCore::DocumentLoader::setLastCheckedRequest):
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::redirectReceived):
        * loader/DocumentThreadableLoader.h:
        * loader/MediaResourceLoader.cpp:
        (WebCore::MediaResource::redirectReceived):
        * loader/MediaResourceLoader.h:
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNavigationPolicy):
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::willSendRequestInternal):
        * loader/cache/CachedRawResource.cpp:
        (WebCore::iterate):
        (WebCore::CachedRawResource::didAddClient):
        (WebCore::CachedRawResource::redirectReceived):
        * loader/cache/CachedRawResource.h:
        * loader/cache/CachedRawResourceClient.h:
        (WebCore::CachedRawResourceClient::redirectReceived):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::redirectReceived):
        * loader/cache/CachedResource.h:
        * platform/graphics/PlatformMediaResourceLoader.h:
        (WebCore::PlatformMediaResourceClient::redirectReceived):
        * platform/network/cocoa/WebCoreNSURLSession.mm:
        (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):

2017-11-10  John Wilander  <wilander@apple.com>

        Ignore HSTS for partitioned, cross-origin subresource requests
        https://bugs.webkit.org/show_bug.cgi?id=178993
        <rdar://problem/34962462>

        Reviewed by Brent Fulgham.

        No new tests. HSTS is not supported in layout tests.
        Tested manually.

        * platform/network/mac/WebCoreURLResponse.mm:
        (WebCore::synthesizeRedirectResponseIfNecessary):

2017-11-10  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r224267): WebViews scheduled with custom run loop modes don't load
        https://bugs.webkit.org/show_bug.cgi?id=179515
        <rdar://problem/35445245>

        Reviewed by Andy Estes.

        Covered by a new API test which would have timed out without this change.

        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (schedulePairHashSet):
        Collect run loop modes from the NetworkingContext similarly to how we did before https://trac.webkit.org/changeset/224267/webkit#file40
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

2017-11-10  Chris Dumez  <cdumez@apple.com>

        Simplify SWServerRegistration::forEachConnection()
        https://bugs.webkit.org/show_bug.cgi?id=179523

        Reviewed by Alex Christensen.

        Simplify SWServerRegistration::forEachConnection() by dropping the hack
        introduced in r224590 to work around the fact that we had a race
        between Storage & WebProcess processes during registration. After
        r224652, we do an IPC handshake between those 2 processes after
        resolving the registration promise so we know for sure the
        ServiceWorkerRegistration object has registered itself with the
        Storage process before we keep going with the install steps.

        No new tests, no expected Web-facing behavior change.

        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptFetchFinished):
        (WebCore::SWServerJobQueue::install):
        (WebCore::SWServerJobQueue::didResolveRegistrationPromise):
        (WebCore::SWServerJobQueue::didFinishInstall):
        (WebCore::SWServerJobQueue::runRegisterJob):
        (WebCore::SWServerJobQueue::runUnregisterJob):
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::updateRegistrationState):
        (WebCore::SWServerRegistration::updateWorkerState):
        (WebCore::SWServerRegistration::fireUpdateFoundEvent):
        (WebCore::SWServerRegistration::forEachConnection):
        * workers/service/server/SWServerRegistration.h:

2017-11-10  Ms2ger  <Ms2ger@igalia.com>

        Allow XHR to override the User-Agent header.
        https://bugs.webkit.org/show_bug.cgi?id=179527

        Reviewed by Chris Dumez.

        Also rename FrameLoader::applyUserAgent to FrameLoader::applyUserAgentIfNeeded
        for clarity.

        Test: imported/w3c/web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed.htm

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::addExtraFieldsToRequest):
        (WebCore::FrameLoader::applyUserAgentIfNeeded):
        * loader/FrameLoader.h:
        * loader/ResourceLoadNotifier.cpp:
        (WebCore::ResourceLoadNotifier::willSendRequest):
        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::createResourceHandle):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):

2017-11-10  Ms2ger  <Ms2ger@igalia.com>

        [GTK] Use fallible allocation in ImageBuffer::ImageBuffer().
        https://bugs.webkit.org/show_bug.cgi?id=179051

        Reviewed by Michael Catanzaro.

        Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html

        * platform/graphics/cairo/ImageBufferCairo.cpp:
        (WebCore::ImageBuffer::ImageBuffer):

2017-11-10  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE] CoordinatedGraphicsLayer::setNeedsDisplayInRect() converts FloatRect to IntRect erroneously
        https://bugs.webkit.org/show_bug.cgi?id=179476

        Reviewed by Žan Doberšek.

        Convert the passed FloatRect into an IntRect using enclosingIntRect(), so we are guaranteed that
        the rectangle to paint fits into the buffer that the backingStore will allocate.

        No behaviour change.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect):

2017-11-10  Fujii Hironori  <Hironori.Fujii@sony.com>

        WebInjectedScriptHost.cpp: warning: variable ‘scope’ set but not used
        https://bugs.webkit.org/show_bug.cgi?id=179524

        Reviewed by Joseph Pecoraro.

        r224606 has introduced a new compilation warning if not
        ENABLE(PAYMENT_REQUEST).

        No new tests (No behavior change).

        * inspector/WebInjectedScriptHost.cpp:
        (WebCore::WebInjectedScriptHost::getInternalProperties): Do not
        define the variable 'scope' if not ENABLE(PAYMENT_REQUEST). Marked
        a variable 'vm' with UNUSED_PARAM.

2017-11-10  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Start grouping Cairo GraphicsContext operations behind a separate interface
        https://bugs.webkit.org/show_bug.cgi?id=179467

        Reviewed by Carlos Garcia Campos.

        Start moving the Cairo operations in GraphicsContext into a separate
        translation unit, CairoOperations.cpp. This will ease leveraging these
        operations from a pre-recorded list of GraphicsContext commands, or
        from a Cairo-specific GraphicsContextImpl, without undermining the
        current GraphicsContext implementation that we'll want to maintain
        in a working state until necessary.

        We start with the clipping operations. Each operation is encapsulated
        in a static function inside the WebCore::Cairo namespace that expects
        PlatformContextCairo reference as the first argument, which makes sense
        since we have to utilize the cairo_t state object that's kept there.
        Other parameters are passed as well, as required for some specific
        operation.

        In the Cairo implementation of GraphicsContext, the affected methods
        are changed to assert presence of the platform context (i.e. this is a
        GraphicsContext that operates on a valid cairo_t object, and is not
        using an m_impl object or is in non-painting mode) before the
        PlatformContextCairo object is dereferenced and passed along with
        other arguments to the Cairo::clip*() function.

        No new tests -- no change in behavior.

        * platform/SourcesCairo.txt:
        * platform/graphics/cairo/CairoOperations.cpp: Added.
        (WebCore::Cairo::clip):
        (WebCore::Cairo::clipOut):
        (WebCore::Cairo::clipPath):
        (WebCore::Cairo::clipToImageBuffer):
        * platform/graphics/cairo/CairoOperations.h: Added.
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::clip):
        (WebCore::GraphicsContext::clipPath):
        (WebCore::GraphicsContext::clipToImageBuffer):
        (WebCore::GraphicsContext::clipOut):

2017-11-09  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r224661.

        Broke build on several internal Mac/iOS bots

        Reverted changeset:

        "Ignore HSTS for partitioned, cross-origin subresource
        requests"
        https://bugs.webkit.org/show_bug.cgi?id=178993
        https://trac.webkit.org/changeset/224661

2017-11-09  Chris Dumez  <cdumez@apple.com>

        ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects
        https://bugs.webkit.org/show_bug.cgi?id=179517

        Reviewed by Brady Eidson.

        ServiceWorkerRegistration objects could get recycled for different SWServerRegistration objects, leading to
        flakiness in the tests. We uses ServiceWorkerRegistrationKey as key in the m_registration map on WebProcess
        side. The lifetime of the ServiceWorkerRegistration objects is tied to the lifetime of their JS wrapper.
        When a test does a registration for a given scope, then unregisters, then registers again for the same scope,
        we would end up creating a new SWServerRegistration object on server side, but possibly reuse the same
        ServiceWorkerRegistration object on WebProcess side, if its wrapper has not yet been garbage collected.
        This is because the registrations have the same ServiceWorkerRegistrationKey in this case.

        To address the issue, we now use the ServiceWorkerRegistrationIdentifier as key in the m_registration
        hash map. A SWServerRegistration has a unique ServiceWorkerRegistrationIdentifier on server side.
        All its clients ServiceWorkerRegistration also use the same ServiceWorkerRegistrationIdentifier.

        Test: http/tests/workers/service/basic-unregister-then-register-again-no-reuse.html

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::getRegistration):
        (WebCore::ServiceWorkerContainer::scheduleTaskToUpdateRegistrationState):
        (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent):
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::removeRegistration):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerRegistration.h:
        * workers/service/ServiceWorkerRegistrationData.h:
        (WebCore::ServiceWorkerRegistrationData::decode):
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::updateRegistrationState):
        (WebCore::SWClientConnection::fireUpdateFoundEvent):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::addServiceWorkerRegistrationInServer):
        (WebCore::SWServer::Connection::removeServiceWorkerRegistrationInServer):
        (WebCore::SWServer::resolveRegistrationJob):
        (WebCore::SWServer::addClientServiceWorkerRegistration):
        (WebCore::SWServer::removeClientServiceWorkerRegistration):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::generateServiceWorkerRegistrationIdentifier):
        (WebCore::SWServerRegistration::SWServerRegistration):
        (WebCore::SWServerRegistration::updateRegistrationState):
        (WebCore::SWServerRegistration::fireUpdateFoundEvent):
        (WebCore::SWServerRegistration::forEachConnection):
        (WebCore::SWServerRegistration::addClientServiceWorkerRegistration):
        (WebCore::SWServerRegistration::removeClientServiceWorkerRegistration):
        * workers/service/server/SWServerRegistration.h:
        (WebCore::SWServerRegistration::identifier const):

2017-11-09  John Wilander  <wilander@apple.com>

        Ignore HSTS for partitioned, cross-origin subresource requests
        https://bugs.webkit.org/show_bug.cgi?id=178993
        <rdar://problem/34962462>

        Reviewed by Brent Fulgham.

        No new tests. HSTS is not supported in layout tests.
        Tested manually.

        * platform/network/mac/WebCoreURLResponse.mm:
        (WebCore::synthesizeRedirectResponseIfNecessary):

2017-11-09  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] Remove explicit pop from LayoutState
        https://bugs.webkit.org/show_bug.cgi?id=179509
        <rdar://problem/35454323>

        Reviewed by Antti Koivisto.

        Both relayoutForPagination()/relayoutToAvoidWidows() call layout recursively which requires
        manual layout state pop. This patch addresses this issue by constructing a new LayoutState object
        for the positioned descendants.

        Covered by existing tests.

        * rendering/LayoutState.cpp:
        (WebCore::LayoutStateMaintainer::~LayoutStateMaintainer):
        (WebCore::LayoutStateMaintainer::pop): Deleted.
        * rendering/LayoutState.h:
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::layoutBlock):
        (WebCore::RenderBlockFlow::relayoutToAvoidWidows):
        (WebCore::RenderBlockFlow::relayoutForPagination):
        * rendering/RenderBlockFlow.h:

2017-11-09  Chris Dumez  <cdumez@apple.com>

        Implement real post 'install' event steps of the Install algorithm (steps 14+)
        https://bugs.webkit.org/show_bug.cgi?id=179401

        Reviewed by Brady Eidson.

        Implement step 14+ of Install algorithm, as per:
        - https://w3c.github.io/ServiceWorker/#installation-algorithm

        * dom/Microtasks.h:
        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::ServiceWorker):
        (WebCore::ServiceWorker::scheduleTaskToUpdateState):
        * workers/service/ServiceWorker.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::scheduleTaskToUpdateRegistrationState):
        (WebCore::ServiceWorkerContainer::jobFailedWithException):
        (WebCore::ServiceWorkerContainer::scheduleTaskToFireUpdateFoundEvent):
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::resolvedWithRegistration):
        * workers/service/ServiceWorkerJob.h:
        * workers/service/ServiceWorkerJobClient.h:
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
        * workers/service/ServiceWorkerTypes.h:
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::registrationJobResolvedInServer):
        (WebCore::SWClientConnection::forEachContainer):
        (WebCore::SWClientConnection::updateRegistrationState):
        (WebCore::SWClientConnection::updateWorkerState):
        (WebCore::SWClientConnection::fireUpdateFoundEvent):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::didResolveRegistrationPromise):
        (WebCore::SWServer::resolveRegistrationJob):
        (WebCore::SWServer::didResolveRegistrationPromise):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::install):
        (WebCore::SWServerJobQueue::didResolveRegistrationPromise):
        (WebCore::SWServerJobQueue::didFinishInstall):
        (WebCore::SWServerJobQueue::runRegisterJob):
        * workers/service/server/SWServerJobQueue.h:
        * workers/service/server/SWServerRegistration.cpp:
        * workers/service/server/SWServerRegistration.h:
        (WebCore::SWServerRegistration::installingWorker const):
        (WebCore::SWServerRegistration::waitingWorker const):
        (WebCore::SWServerRegistration::activeWorker const):
        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::terminate):
        * workers/service/server/SWServerWorker.h:

2017-11-09  Doug Russell  <d_russell@apple.com>

        Bug 179068 - AX: search predicate returns containing group for plain text instead of text element
        https://bugs.webkit.org/show_bug.cgi?id=179068

        Reviewed by Darin Adler

        Implement a check in AccessibilityRenderObject::hasPlainText(), AccessibilityObject::canHavePlainText(), to confirm the element is capable of providing text.

        Tests: accessibility/mac/search-predicate-plaintext.html
               accessibility/mac/search-predicate-visible-button.html
               accessibility/mac/search-predicate-visited-links.html

        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::text const):
        (WebCore::AccessibilityNodeObject::stringValue const):
        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityObject::isARIAStaticText const):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::stringValue const):
        (WebCore::AccessibilityRenderObject::canHavePlainText const):
        (WebCore::AccessibilityRenderObject::hasPlainText const):
        * accessibility/AccessibilityRenderObject.h:

2017-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>

        Inserting an image, selecting, underlining, and then deleting leaves the typing style with both "-webkit-text-decorations-in-effect" and "text-decoration"
        https://bugs.webkit.org/show_bug.cgi?id=179431

        Reviewed by Ryosuke Niwa.

        When inserting an image element, selecting it, underlining the selection, deleting, and then inserting text, we
        crash on a debug assert. This codepath was exercised by an API test added in <https://trac.webkit.org/r224512>.
        This assertion happens due to the following sequence of events:
        1. DeleteSelectionCommand::saveTypingStyleState computes a typing style.
        2. In doing so, it calls into EditingStyle::init, which observes that "-webkit-text-decorations-in-effect" is
           present and appends "text-decoration" with an identical CSS value to the EditingStyle's mutable style
           properties.
        3. DeleteSelectionCommand::calculateTypingStyleAfterDelete sets the current selection's typing style to the
           above typing style.
        4. Later on, when we try to insert text, we compute the StyleChange using the above typing style, which calls
           into reconcileTextDecorationProperties.
        5. reconcileTextDecorationProperties debug asserts that "-webkit-text-decorations-in-effect" and
           "text-decoration" don't coexist on the EditingStyle's (i.e. the typing style's) mutable properties; since (2)
           added both properties, this assertion fires.

        It appears that step (2) shouldn't be adding "text-decoration" in addition to EditingStyle's mutable style
        properties, since doing so would violate the requirements of reconcileTextDecorationProperties. As such, we can
        tweak EditingStyle::init to *replace* the "-webkit-text-decorations-in-effect" property with "text-decoration"
        instead; this matches the behavior of reconcileTextDecorationProperties, and ensures that we only have the
        "text-decorations" property when we try to insert text in step (4).

        Test: editing/execCommand/underline-selection-containing-image.html

        * editing/EditingStyle.cpp:
        (WebCore::EditingStyle::init):

2017-11-09  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: support undo/redo of insertAdjacentHTML
        https://bugs.webkit.org/show_bug.cgi?id=179283

        Reviewed by Joseph Pecoraro.

        Test: inspector/dom/insertAdjacentHTML.html

        Create another version of Element::insertAdjacentHTML that keeps track of the nodes that are
        added. This is necessary because the children of a DocumentFragment are removed when it is
        added to a ContainerNode. In this way, it is possible to remove those nodes during an undo.

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

        * inspector/DOMEditor.h:
        * inspector/DOMEditor.cpp:
        (WebCore::DOMEditor::insertAdjacentHTML):
        Drive-by fix: sort functions and class declarations.

        * inspector/agents/InspectorDOMAgent.h:
        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::insertAdjacentHTML):

2017-11-09  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] Remove redundant LayoutState c'tor
        https://bugs.webkit.org/show_bug.cgi?id=179505
        <rdar://problem/35450650>

        Reviewed by Antti Koivisto.

        No change in functionality.

        * rendering/LayoutState.cpp:
        * rendering/LayoutState.h:

2017-11-09  Youenn Fablet  <youenn@apple.com>

        FetchResponse should set the mime type of its internal ResourceResponse
        https://bugs.webkit.org/show_bug.cgi?id=179487

        Reviewed by Chris Dumez.

        No observable change.
        Setting the mime type of the response as navigation loads use that field.
        This will be used for navigation loads served by service worker.

        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::create):

2017-11-09  Youenn Fablet  <youenn@apple.com>

        ServiceWorker ResourceResponse should not assert in platformCertificateInfo()
        https://bugs.webkit.org/show_bug.cgi?id=179486

        Reviewed by Chris Dumez.

        No change of behavior.
        In case a Response is returned by Service Worker, there may be no related internal response.
        In that case, platformCertificateInfo is returning an empty CertificateInfo.

        * platform/network/cocoa/ResourceResponseCocoa.mm:
        (WebCore::ResourceResponse::platformCertificateInfo const):

2017-11-09  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] Remove conditional push from RenderTableSection::calcRowLogicalHeight
        https://bugs.webkit.org/show_bug.cgi?id=179493
        <rdar://problem/35446631>

        Reviewed by Antti Koivisto.

        Pushing layout states is cheap and we do it for every container anyway.

        Covered by existing tests.

        * rendering/LayoutState.cpp:
        (WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
        (WebCore::LayoutStateMaintainer::~LayoutStateMaintainer):
        (WebCore::LayoutStateMaintainer::pop):
        (WebCore::LayoutStateMaintainer::push): Deleted.
        * rendering/LayoutState.h:
        (WebCore::LayoutStateMaintainer::didPush const): Deleted.
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::calcRowLogicalHeight):

2017-11-09  Youenn Fablet  <youenn@apple.com>

        CachedResourceLoader::requestRawResource should not assert when destination is set in the context of a service worker
        https://bugs.webkit.org/show_bug.cgi?id=179491

        Reviewed by Chris Dumez.

        No change of behavior.
        requestRawResource on web page should have the destination set as the empty string as per fetch spec.
        In the context of a service worker, requestRawResource may be used with any destination.
        Updating assertion accordingly.

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

2017-11-09  Youenn Fablet  <youenn@apple.com>

        ResourceErrorBase::setType should not ASSERT if it is a no op
        https://bugs.webkit.org/show_bug.cgi?id=179490

        Reviewed by Chris Dumez.

        No change of behavior.

        * platform/network/ResourceErrorBase.cpp:
        (WebCore::ResourceErrorBase::setType):

2017-11-09  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] Remove renderer data members from state maintainers.
        https://bugs.webkit.org/show_bug.cgi?id=179483
        <rdar://problem/35442548>

        Reviewed by Darin Adler.

        Although layout is not supposed to mutate the tree anymore, it's safer to use LayoutContext instead.

        No change in functionality.

        * page/LayoutContext.cpp:
        * page/LayoutContext.h:
        * rendering/LayoutState.cpp:
        (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
        (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
        (WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer):
        (WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer):
        * rendering/LayoutState.h:

2017-11-09  Maciej Stachowiak  <mjs@apple.com>

        Remove support for iOS-only softbank-sjis encoding if possible
        https://bugs.webkit.org/show_bug.cgi?id=179416

        Reviewed by Darin Adler.

        * platform/text/TextCodecICU.cpp:
        (WebCore::TextCodecICU::registerEncodingNames): Remove support for softbank-sjis
        codec, because by code inspection it couldn't have possibly worked.
        (WebCore::TextCodecICU::registerCodecs): Ditto.

2017-11-09  Christopher Reid  <chris.reid@sony.com>

        Use enum classes within FileSystem
        https://bugs.webkit.org/show_bug.cgi?id=175172

        Reviewed by Darin Adler.

        No new tests, no change in behavior.

        Further cleanup to FileSystem's enum classes.
        Shortening FileSystem's enum names now that they are enum classes.
        Adding OptionSet<FileLockMode> to functions using the FileLockMode enum.

        * Modules/webdatabase/OriginLock.cpp:
        * loader/appcache/ApplicationCacheStorage.cpp:
        * platform/FileHandle.h:
        * platform/FileStream.cpp:
        * platform/FileSystem.cpp:
        * platform/FileSystem.h:
        * platform/cocoa/FileMonitorCocoa.mm:
        * platform/glib/FileSystemGlib.cpp:
        * platform/network/curl/CurlCacheEntry.cpp:
        * platform/network/curl/CurlCacheManager.cpp:
        * platform/posix/FileSystemPOSIX.cpp:
        * platform/win/FileSystemWin.cpp:
        * rendering/RenderThemeWin.cpp:

2017-11-09  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] LayouState::m_lineGrid should be a weak pointer
        https://bugs.webkit.org/show_bug.cgi?id=179484
        <rdar://problem/35442725>

        Reviewed by Darin Adler.

        Covered by existing tests.

        * rendering/LayoutState.cpp:
        (WebCore::LayoutState::propagateLineGridInfo):
        (WebCore::LayoutState::establishLineGrid):
        * rendering/LayoutState.h:
        (WebCore::LayoutState::lineGrid const):

2017-11-09  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] Add pagination parameter to subtree LayoutState
        https://bugs.webkit.org/show_bug.cgi?id=179465
        <rdar://problem/35434096>

        Reviewed by Antti Koivisto.

        It enables us to remove the last setters from LayoutState.

        No change in functionality.

        * page/LayoutContext.cpp:
        (WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
        * rendering/LayoutState.cpp:
        (WebCore::LayoutState::LayoutState):
        (WebCore::LayoutState::layoutDeltaMatches const):
        (WebCore::LayoutState::layoutDeltaMatches): Deleted.
        * rendering/LayoutState.h:
        (WebCore::LayoutState::isPaginated const):
        (WebCore::LayoutState::setIsPaginated): Deleted.
        (WebCore::LayoutState::setPageLogicalHeight): Deleted.

2017-11-08  Joseph Pecoraro  <pecoraro@apple.com>

        AVSampleBufferGenerator leaks seen on leaks bot
        https://bugs.webkit.org/show_bug.cgi?id=179464

        Reviewed by Jer Noble.

        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
        (WebCore::ImageDecoderAVFObjC::readSampleMetadata):
        (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
        Adopt the allocation into our RetainPtr.

2017-11-08  Simon Fraser  <simon.fraser@apple.com>

        Content not painted when scrolling an overflow node inside an iframe
        https://bugs.webkit.org/show_bug.cgi?id=179315
        rdar://problem/35364166

        Reviewed by Tim Horton.

        When scrolling overflow:scroll, we need to check for overlap updates just as we do
        for page scrolls.

        Test: compositing/ios/overflow-scroll-update-overlap.html

        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateCompositingLayers):

2017-11-08  Simon Fraser  <simon.fraser@apple.com>

        Cordova: elements with tag position:fixed disappears (flickering) when a long content is scrolling and appears again when the scroll is finished.
        https://bugs.webkit.org/show_bug.cgi?id=178066

        Reviewed by Tim Horton.

        In UIWebView, we were failing to call setIsViewportConstrained() on layers for position:fixed,
        causing us to detach their backing store sometimes on page scrolling.
        
        Fix by hoisting the call to RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole()
        up the stack into code that runs for both UIWebView and WKWebView. This required moving some of
        the sanity check code up out of updateScrollCoordinatedLayer() into the caller.

        Not testable because the bug only manifested in UIWebView.

        * rendering/RenderLayerCompositor.cpp:
        (WebCore::canCoordinateScrollingForLayer):
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

2017-11-08  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] Move RenderMultiColumnFlow::computeLineGridPaginationOrigin to LayoutState
        https://bugs.webkit.org/show_bug.cgi?id=179462

        Reviewed by Antti Koivisto.

        This is in preparation for having no setters on LayoutState.
        Having all the related functions (pagination/line-grid) in one place also helps with moving
        them to a more appropriate place later.

        No change in functionality.

        * rendering/LayoutState.cpp:
        (WebCore::LayoutState::computePaginationInformation):
        (WebCore::LayoutState::computeLineGridPaginationOrigin):
        (WebCore::LayoutState::establishLineGrid):
        * rendering/LayoutState.h:
        (WebCore::LayoutState::setLineGridPaginationOrigin): Deleted.
        (WebCore::LayoutState::currentRenderFragmentedFlow const): Deleted.
        (WebCore::LayoutState::setCurrentRenderFragmentedFlow): Deleted.
        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::computeLineGridPaginationOrigin const): Deleted.

2017-11-08  Jiewen Tan  <jiewen_tan@apple.com>

        Replace some stack raw pointers with RefPtrs within WebCore/svg
        https://bugs.webkit.org/show_bug.cgi?id=179314
        <rdar://problem/34842204>

        Reviewed by Ryosuke Niwa.

        Besides replacing pointers directly, some of the methods are changed to return
        RefPtrs as well.

        No changes in behaviors.

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::remoteSVGRootElement const):
        * dom/EventPath.h:
        (WebCore::EventPath::eventTargetRespectingTargetRules):
        * page/FrameView.cpp:
        (WebCore::FrameView::scrollToAnchor):
        * svg/SVGAElement.cpp:
        (WebCore::SVGAElement::defaultEventHandler):
        * svg/SVGAltGlyphElement.cpp:
        (WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
        * svg/SVGAnimateElementBase.cpp:
        (WebCore::SVGAnimateElementBase::hasValidAttributeType):
        (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
        (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
        (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
        (WebCore::SVGAnimateElementBase::resetAnimatedType):
        (WebCore::SVGAnimateElementBase::applyResultsToTarget):
        (WebCore::SVGAnimateElementBase::calculateDistance):
        * svg/SVGAnimateMotionElement.cpp:
        (WebCore::SVGAnimateMotionElement::hasValidAttributeType):
        (WebCore::SVGAnimateMotionElement::updateAnimationPath):
        (WebCore::SVGAnimateMotionElement::resetAnimatedType):
        (WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
        (WebCore::SVGAnimateMotionElement::applyResultsToTarget):
        * svg/SVGAnimateTransformElement.cpp:
        (WebCore::SVGAnimateTransformElement::hasValidAttributeType):
        * svg/SVGAnimatedPath.cpp:
        (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
        * svg/SVGAnimationElement.cpp:
        (WebCore::SVGAnimationElement::adjustForInheritance):
        (WebCore::SVGAnimationElement::determinePropertyValueTypes):
        * svg/SVGDocument.cpp:
        (WebCore::SVGDocument::rootElement):
        (WebCore::SVGDocument::zoomAndPanEnabled const):
        (WebCore::SVGDocument::startPan):
        (WebCore::SVGDocument::updatePan const):
        * svg/SVGDocument.h:
        * svg/SVGDocumentExtensions.cpp:
        (WebCore::SVGDocumentExtensions::removeElementFromPendingResourcesForRemovalMap):
        * svg/SVGDocumentExtensions.h:
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::~SVGElement):
        (WebCore::SVGElement::correspondingUseElement const):
        (WebCore::SVGElement::setCorrespondingElement):
        (WebCore::SVGElement::resolveCustomStyle):
        (WebCore::SVGElement::computedStyle):
        (WebCore::SVGElement::buildPendingResourcesIfNeeded):
        (WebCore::SVGElement::updateRelativeLengthsInformation):
        (WebCore::SVGElement::invalidateInstances):
        * svg/SVGElement.h:
        * svg/SVGFEBlendElement.cpp:
        (WebCore::SVGFEBlendElement::build):
        * svg/SVGFEColorMatrixElement.cpp:
        (WebCore::SVGFEColorMatrixElement::build):
        * svg/SVGFEComponentTransferElement.cpp:
        (WebCore::SVGFEComponentTransferElement::build):
        * svg/SVGFECompositeElement.cpp:
        (WebCore::SVGFECompositeElement::build):
        * svg/SVGFEConvolveMatrixElement.cpp:
        (WebCore::SVGFEConvolveMatrixElement::build):
        * svg/SVGFEDiffuseLightingElement.cpp:
        (WebCore::SVGFEDiffuseLightingElement::build):
        * svg/SVGFEDisplacementMapElement.cpp:
        (WebCore::SVGFEDisplacementMapElement::build):
        * svg/SVGFEDropShadowElement.cpp:
        (WebCore::SVGFEDropShadowElement::build):
        * svg/SVGFEGaussianBlurElement.cpp:
        (WebCore::SVGFEGaussianBlurElement::build):
        * svg/SVGFEImageElement.cpp:
        (WebCore::SVGFEImageElement::buildPendingResource):
        (WebCore::SVGFEImageElement::notifyFinished):
        * svg/SVGFELightElement.cpp:
        (WebCore::SVGFELightElement::findLightSource):
        (WebCore::SVGFELightElement::svgAttributeChanged):
        (WebCore::SVGFELightElement::childrenChanged):
        * svg/SVGFEMergeElement.cpp:
        (WebCore::SVGFEMergeElement::build):
        * svg/SVGFEMorphologyElement.cpp:
        (WebCore::SVGFEMorphologyElement::build):
        * svg/SVGFEOffsetElement.cpp:
        (WebCore::SVGFEOffsetElement::build):
        * svg/SVGFESpecularLightingElement.cpp:
        (WebCore::SVGFESpecularLightingElement::build):
        * svg/SVGFETileElement.cpp:
        (WebCore::SVGFETileElement::build):
        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
        (WebCore::invalidateFilterPrimitiveParent):
        * svg/SVGFontFaceElement.cpp:
        (WebCore::SVGFontFaceElement::rebuildFontFace):
        * svg/SVGFontFaceFormatElement.cpp:
        (WebCore::SVGFontFaceFormatElement::childrenChanged):
        * svg/SVGFontFaceUriElement.cpp:
        (WebCore::SVGFontFaceUriElement::childrenChanged):
        * svg/SVGForeignObjectElement.cpp:
        (WebCore::SVGForeignObjectElement::rendererIsNeeded):
        * svg/SVGLengthContext.cpp:
        (WebCore::SVGLengthContext::determineViewport const):
        * svg/SVGLinearGradientElement.cpp:
        (WebCore::SVGLinearGradientElement::collectGradientAttributes):
        * svg/SVGMPathElement.cpp:
        (WebCore::SVGMPathElement::buildPendingResource):
        (WebCore::SVGMPathElement::pathElement):
        * svg/SVGMPathElement.h:
        * svg/SVGRadialGradientElement.cpp:
        (WebCore::SVGRadialGradientElement::collectGradientAttributes):
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::frameForCurrentScale const):
        (WebCore::SVGSVGElement::currentScale const):
        (WebCore::SVGSVGElement::setCurrentScale):
        (WebCore::SVGSVGElement::deselectAll):
        (WebCore::SVGSVGElement::localCoordinateSpaceTransform const):
        (WebCore::SVGSVGElement::scrollToAnchor):
        (WebCore::SVGSVGElement::getElementById):
        * svg/SVGSVGElement.h:
        * svg/SVGStyleElement.cpp:
        (WebCore::SVGStyleElement::setDisabled):
        * svg/SVGTRefElement.cpp:
        (WebCore::SVGTRefElement::detachTarget):
        * svg/SVGTextContentElement.cpp:
        (WebCore::SVGTextContentElement::elementFromRenderer):
        * svg/SVGTextPathElement.cpp:
        (WebCore::SVGTextPathElement::buildPendingResource):
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::transferSizeAttributesToTargetClone const):
        (WebCore::SVGUseElement::svgAttributeChanged):
        (WebCore::SVGUseElement::targetClone const):
        (WebCore::SVGUseElement::toClipPath):
        (WebCore::SVGUseElement::rendererClipChild const):
        (WebCore::SVGUseElement::findTarget const):
        (WebCore::SVGUseElement::invalidateDependentShadowTrees):
        (WebCore::SVGUseElement::selfHasRelativeLengths const):
        * svg/SVGUseElement.h:
        * svg/animation/SMILTimeContainer.cpp:
        (WebCore::SMILTimeContainer::updateAnimations):
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::buildPendingResource):
        (WebCore::SVGSMILElement::insertedIntoAncestor):
        (WebCore::SVGSMILElement::connectConditions):
        (WebCore::SVGSMILElement::disconnectConditions):
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::rootElement const):
        (WebCore::SVGImage::hasSingleSecurityOrigin const):
        (WebCore::SVGImage::setContainerSize):
        (WebCore::SVGImage::containerSize const):
        (WebCore::SVGImage::draw):
        (WebCore::SVGImage::embeddedContentBox const):
        (WebCore::SVGImage::hasRelativeWidth const):
        (WebCore::SVGImage::hasRelativeHeight const):
        (WebCore::SVGImage::computeIntrinsicDimensions):
        (WebCore::SVGImage::startAnimation):
        (WebCore::SVGImage::stopAnimation):
        (WebCore::SVGImage::isAnimating const):
        (WebCore::SVGImage::reportApproximateMemoryCost const):
        * svg/graphics/SVGImage.h:
        * svg/graphics/filters/SVGFEImage.cpp:
        (WebCore::FEImage::platformApplySoftware):
        * svg/graphics/filters/SVGFilterBuilder.cpp:
        (WebCore::SVGFilterBuilder::getEffectById const):
        * svg/graphics/filters/SVGFilterBuilder.h:
        * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
        * svg/properties/SVGListPropertyTearOff.h:

2017-11-08  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] LayoutContext should own the stack of LayoutState objects
        https://bugs.webkit.org/show_bug.cgi?id=179408
        <rdar://problem/35423075>

        Reviewed by Antti Koivisto.

        No change in functionality.

        * page/LayoutContext.cpp:
        (WebCore::LayoutContext::layoutDelta const):
        (WebCore::LayoutContext::addLayoutDelta):
        (WebCore::LayoutContext::layoutDeltaMatches):
        (WebCore::LayoutContext::layoutState const):
        (WebCore::LayoutContext::pushLayoutState):
        (WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
        (WebCore::LayoutContext::popLayoutState):
        * page/LayoutContext.h:
        (WebCore::LayoutContext::isPaintOffsetCacheEnabled const):
        (WebCore::LayoutContext::layoutState const): Deleted.
        * rendering/LayoutState.cpp:
        (WebCore::LayoutState::LayoutState):
        (WebCore::LayoutState::computeOffsets):
        (WebCore::LayoutState::computeClipRect):
        (WebCore::LayoutState::computePaginationInformation):
        (WebCore::LayoutState::propagateLineGridInfo):
        (WebCore::LayoutState::establishLineGrid):
        (WebCore::LayoutState::clearPaginationInformation): Deleted.
        * rendering/LayoutState.h:
        (WebCore::LayoutState::setIsPaginated):

2017-11-08  Brady Eidson  <beidson@apple.com>

        ServiceWorkerRegistration::updateStateFromServer fix! (Don't always create a new ServiceWorker every time).
        https://bugs.webkit.org/show_bug.cgi?id=179456

        Reviewed by Chris Dumez.

        No new tests (No behavior change yet).

        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::updateStateFromServer): Re-use a previous worker instead of always creating a new one.

2017-11-08  Brent Fulgham  <bfulgham@apple.com>

        XMLHttpRequest should not treat file URLs as same origin
        https://bugs.webkit.org/show_bug.cgi?id=178565
        <rdar://problem/11115901>

        Reviewed by Daniel Bates.

        Based on a Blink patch by <jannhorn@googlemail.com>.
        https://chromium.googlesource.com/chromium/src/+/c362e001551abc2bea392773f32eaf043d8bc29f

        Test: security/cannot-read-self-from-file.html

        * page/SecurityOrigin.cpp:
        (WebCore::SecurityOrigin::passesFileCheck const): Do not treat file as same-origin.

2017-11-08  Jeremy Jones  <jeremyj@apple.com>

        HTMLMediaElement should not use element fullscreen on iOS
        https://bugs.webkit.org/show_bug.cgi?id=179418
        rdar://problem/35409277

        Reviewed by Eric Carlson.

        Add ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN to determine if HTMLMediaElement should use element full screen or not.

        * Configurations/FeatureDefines.xcconfig:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::enterFullscreen):

2017-11-08  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Show Internal properties of PaymentRequest in Web Inspector Console
        https://bugs.webkit.org/show_bug.cgi?id=179276

        Reviewed by Andy Estes.

        Test: http/tests/inspector/runtime/internal-properties-payment-request.https.html

        * Modules/paymentrequest/PaymentRequest.h:
        Expose access to internal state.

        * inspector/WebInjectedScriptHost.h:
        * inspector/WebInjectedScriptHost.cpp:
        (WebCore::constructInternalProperty):
        (WebCore::WebInjectedScriptHost::getInternalProperties):
        Provide internal properties for a PaymentRequest.

        * testing/Internals.cpp:
        (WebCore::Internals::withUserGesture):
        * testing/Internals.h:
        * testing/Internals.idl:
        Provide a simple way to run code inside of a user gesture.

2017-11-08  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r224534): Crash inside Document::updateStyleIfNeeded
        https://bugs.webkit.org/show_bug.cgi?id=179442

        Reviewed by Simon Fraser.

        Disable the assertion when the web thread is used.

        * dom/Document.cpp:
        (WebCore::Document::updateStyleIfNeeded):
        (WebCore::Document::updateLayout):

2017-11-08  Colin Bendell  <colin@bendell.ca>

        Added mime type check to the picture source preloader to avoid downloading incompatible resources.
        https://bugs.webkit.org/show_bug.cgi?id=179231

        Reviewed by Alex Christensen.

        Test: http/tests/loading/preload-picture-type.html

        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): include type match state when selecting candidate imgs
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): added type attribute evaluation and matching

2017-11-08  Brady Eidson  <beidson@apple.com>

        Some SW Container and Registration tweaks.
        https://bugs.webkit.org/show_bug.cgi?id=179450

        Reviewed by Chris Dumez.

        No new tests (Progression in an existing test).

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):

2017-11-08  Antti Koivisto  <antti@apple.com>

        Move inlineElementContinuation function to RenderBoxModelObject and rename to inlineContinuation
        https://bugs.webkit.org/show_bug.cgi?id=179437

        Reviewed by Zalan Bujtas.

        Unify RenderInline::inlineElementContinuation and RenderBlock::inlineElementContinuation.
        It is simply a function to find the next RenderInline in the continuation chain.

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::lastChildConsideringContinuation):
        (WebCore::startOfContinuations):
        (WebCore::endOfContinuations):
        (WebCore::childBeforeConsideringContinuations):
        (WebCore::AccessibilityRenderObject::nextSibling const):
        (WebCore::nextContinuation):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::paintObject):
        (WebCore::RenderBlock::absoluteRects const):
        (WebCore::RenderBlock::addFocusRingRects):
        (WebCore::RenderBlock::inlineElementContinuation const): Deleted.
        * rendering/RenderBlock.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::accumulateInFlowPositionOffsets):
        (WebCore::RenderBoxModelObject::inlineContinuation const):
        * rendering/RenderBoxModelObject.h:
        * rendering/RenderInline.cpp:
        (WebCore::updateStyleOfAnonymousBlockContinuations):
        (WebCore::RenderInline::styleDidChange):
        (WebCore::nextContinuation):
        (WebCore::RenderInline::positionForPoint):
        (WebCore::RenderInline::inlineElementContinuation const): Deleted.
        * rendering/RenderInline.h:
        * rendering/line/LineInlineHeaders.h:
        (WebCore::hasInlineDirectionBordersPaddingOrMargin):

2017-11-08  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Eliminate unnecessary hash lookups with NetworkResourceData
        https://bugs.webkit.org/show_bug.cgi?id=179361

        Reviewed by Brian Burg.

        * inspector/NetworkResourcesData.h:
        (WebCore::NetworkResourcesData::ResourceData::setURL):
        (WebCore::NetworkResourcesData::ResourceData::setUrl): Deleted.
        Drive-by fix the name `setUrl` to `setURL`.

        * inspector/NetworkResourcesData.h:
        Store unique_ptrs in the HashMap.

        * inspector/NetworkResourcesData.cpp:
        (WebCore::NetworkResourcesData::resourceCreated):
        (WebCore::NetworkResourcesData::responseReceived):
        Create new versions of methods that combine two operations.

        (WebCore::NetworkResourcesData::removeCachedResource):
        (WebCore::NetworkResourcesData::clear):
        (WebCore::NetworkResourcesData::ensureNoDataForRequestId):
        Handle unique_ptrs in the HashMap.

        * inspector/agents/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::frameIdentifier):
        (WebCore::InspectorNetworkAgent::willSendRequest):
        (WebCore::InspectorNetworkAgent::didReceiveResponse):
        (WebCore::InspectorNetworkAgent::didFailLoading):
        Use the new version of operations to avoid multiple lookups.

2017-11-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Implement delegate hooks for attachment element insertion and removal
        https://bugs.webkit.org/show_bug.cgi?id=179016
        <rdar://problem/35250890>

        Reviewed by Tim Horton.

        Relanding this patch with a tweaked API test. WKAttachmentTests.AttachmentUpdatesWhenChangingFontStyles, in its
        original form, hit a debug assertion and exposed an existing bug related to EditingStyles and text decoration.
        After some investigation, this debug assertion is unrelated to the attachment logic introduced here; see
        <https://bugs.webkit.org/show_bug.cgi?id=179431> for additional analysis, and several proposed fixes.

        * editing/Editor.cpp:
        (WebCore::Editor::respondToChangedSelection):
        (WebCore::Editor::editorUIUpdateTimerFired):
        (WebCore::Editor::scheduleEditorUIUpdate):
        (WebCore::Editor::didInsertAttachmentElement):
        (WebCore::Editor::didRemoveAttachmentElement):
        (WebCore::Editor::notifyClientOfAttachmentUpdates):
        (WebCore::Editor::insertAttachmentFromFile):
        * editing/Editor.h:
        * html/HTMLAttachmentElement.cpp:
        (WebCore::HTMLAttachmentElement::HTMLAttachmentElement):
        (WebCore::HTMLAttachmentElement::insertedIntoAncestor):
        (WebCore::HTMLAttachmentElement::removedFromAncestor):
        (WebCore::HTMLAttachmentElement::uniqueIdentifier const):
        (WebCore::HTMLAttachmentElement::setUniqueIdentifier):
        * html/HTMLAttachmentElement.h:
        * html/HTMLAttributeNames.in:
        * page/EditorClient.h:
        (WebCore::EditorClient::didInsertAttachment):
        (WebCore::EditorClient::didRemoveAttachment):

2017-11-08  Chris Dumez  <cdumez@apple.com>

        Simplify ServiceWorkerContainer::jobResolvedWithRegistration()
        https://bugs.webkit.org/show_bug.cgi?id=179429

        Reviewed by Brady Eidson.

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):

2017-11-08  Chris Dumez  <cdumez@apple.com>

        [Service Workers] Make sure SWServerRegistration update functions always message back the connection that scheduled the job
        https://bugs.webkit.org/show_bug.cgi?id=179428

        Reviewed by Brady Eidson.

        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::install):
        (WebCore::SWServerJobQueue::didFinishInstall):
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::updateRegistrationState):
        (WebCore::SWServerRegistration::updateWorkerState):
        (WebCore::SWServerRegistration::fireUpdateFoundEvent):
        (WebCore::SWServerRegistration::firePostInstallEvents):
        (WebCore::SWServerRegistration::forEachConnection):
        * workers/service/server/SWServerRegistration.h:

2017-11-08  Maciej Stachowiak  <mjs@apple.com>

        iOS supports some text encodings supposedly due to lack of TEC that aren't supported by the TEC decoder on macOS
        https://bugs.webkit.org/show_bug.cgi?id=179309

        Reviewed by Darin Adler.

        Test: fast/encoding/legacy-ios-encodings.html

        * platform/text/TextCodecICU.cpp:
        (WebCore::TextCodecICU::registerEncodingNames): Remove most iOS-specific adding of names, leaving only softbank-sjis. 
        Most were either redundant or unnecessary.
        (WebCore::TextCodecICU::registerCodecs): ditto

2017-11-08  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed. Attempting to unbork the WinCairo bot after r224578.

        * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
        Add a missing semicolon after the deafult initialization of a member
        variable in the GraphicsContextPlatformPrivate class.

2017-11-08  Chris Dumez  <cdumez@apple.com>

        [Service Workers] Support waitUntil() on the 'install' event
        https://bugs.webkit.org/show_bug.cgi?id=179396

        Reviewed by Brady Eidson.

        Support waitUntil() on the 'install' event:
        - https://w3c.github.io/ServiceWorker/#installation-algorithm (step 10.4)
        - https://w3c.github.io/ServiceWorker/#wait-until-method

        Tests: http/tests/workers/service/basic-install-event-waitUntil-multiple-promises.html
               http/tests/workers/service/basic-install-event-waitUntil-reject.html
               http/tests/workers/service/basic-install-event-waitUntil-resolve.html

        * testing/Internals.cpp:
        * testing/Internals.h:
        * testing/Internals.idl:
        * workers/service/ExtendableEvent.cpp:
        (WebCore::ExtendableEvent::waitUntil):
        (WebCore::ExtendableEvent::addExtendLifetimePromise):
        (WebCore::ExtendableEvent::whenAllExtendLifetimePromisesAreSettled):
        * workers/service/ExtendableEvent.h:
        (WebCore::ExtendableEvent::pendingPromiseCount const):
        * workers/service/FetchEvent.cpp:
        (WebCore::FetchEvent::respondWith):
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::removeRegistration):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::fireInstallEvent):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::didFinishInstall):
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::firePostInstallEvents):

2017-11-08  Antti Koivisto  <antti@apple.com>

        Remove Element::isInlineElementContinuation
        https://bugs.webkit.org/show_bug.cgi?id=179425

        Reviewed by Zalan Bujtas.

        It is really just isInline+isContinuation test and most callers know it is an inline already.

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::firstChildConsideringContinuation):
        (WebCore::startOfContinuations):
        (WebCore::firstChildIsInlineContinuation):
        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
        (WebCore::InlineFlowBox::paint):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::addContinuationWithOutline):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::setIsContinuation):
        (WebCore::RenderElement::isElementContinuation const): Deleted.
        (WebCore::RenderElement::isInlineElementContinuation const): Deleted.
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::willBeDestroyed):
        (WebCore::RenderInline::updateHitTestResult):
        * rendering/line/LineInlineHeaders.h:
        (WebCore::hasInlineDirectionBordersPaddingOrMargin):

2017-11-08  David Hyatt  <hyatt@apple.com>

        [Experiment] Implement code to detect high frequency painting
        https://bugs.webkit.org/show_bug.cgi?id=179118
        <rdar://problem/35347068>

        Reviewed by Simon Fraser.

        This patch implements a model for detecting that objects whose
        graphics resources we want to cache (like glyphs or paths) are painting
        frequently enough that it's worth taking the memory hit to cache them.

        Paint frequency detection is done at the self-painting RenderLayer level, since
        a lower level of granularity (e.g., per-RenderObject) would be too memory-intensive.

        * rendering/PaintInfo.h:
        (WebCore::PaintInfo::PaintInfo):
        (WebCore::PaintInfo::enclosingSelfPaintingLayer):
        Add the enclosing self-painting layer that is currently painting to the PaintInfo
        so that objects that have cachaeble graphics resources can notify the layer when
        they actually paint them.

        * rendering/RenderLayer.cpp:
        (WebCore::PaintFrequencyInfo::PaintFrequencyInfo):
        (WebCore::PaintFrequencyInfo::paintingFrequently const):
        (WebCore::PaintFrequencyInfo::updatePaintFrequency):
        (WebCore::PaintFrequencyInfo::paintingCacheableResource):
        RenderLayers have a pointer to PaintFrequencyInfo that is allocated once you've
        painted cachaeble resources.

        (WebCore::RenderLayer::paintLayerContents):
        (WebCore::RenderLayer::paintBackgroundForFragments):
        (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
        (WebCore::RenderLayer::paintOutlineForFragments):
        (WebCore::RenderLayer::paintMaskForFragments):
        (WebCore::RenderLayer::paintChildClippingMaskForFragments):
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/RenderLayer.h:
        Patch to pass the layer with the PaintInfo.

        * testing/Internals.cpp:
        (WebCore::Internals::isPaintingFrequently):
        (WebCore::Internals::incrementFrequentPaintCounter):
        * testing/Internals.h:
        * testing/Internals.idl:
        Test methods for making layout tests to ensure we go into the mode properly.

2017-11-08  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] Make public data members private.
        https://bugs.webkit.org/show_bug.cgi?id=179409
        <rdar://problem/35406184>

        Reviewed by Sam Weinig.

        No change in functionality.

        * page/LayoutContext.cpp:
        (WebCore::LayoutContext::layoutDelta const):
        (WebCore::LayoutContext::addLayoutDelta):
        (WebCore::LayoutContext::layoutDeltaMatches):
        (WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
        * rendering/LayoutState.cpp:
        (WebCore::LayoutState::LayoutState):
        (WebCore::LayoutState::addLayoutDelta):
        (WebCore::LayoutState::layoutDeltaMatches):
        * rendering/LayoutState.h:
        (WebCore::LayoutState::setIsPaginated):
        (WebCore::LayoutState::setPageLogicalHeight):
        (WebCore::LayoutState::paintOffset const):
        (WebCore::LayoutState::renderer const):
        (WebCore::LayoutState::clipRect const):
        (WebCore::LayoutState::isClipped const):
        (WebCore::LayoutState::layoutDelta const):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const):
        (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::layoutBlock):
        (WebCore::RenderBlockFlow::applyBeforeBreak):
        (WebCore::RenderBlockFlow::applyAfterBreak):
        (WebCore::RenderBlockFlow::pageLogicalTopForOffset const):
        (WebCore::RenderBlockFlow::pageLogicalHeightForOffset const):
        (WebCore::RenderBlockFlow::pageRemainingLogicalHeightForOffset const):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::mapLocalToContainer const):
        (WebCore::RenderBox::computeRectForRepaint const):
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::computeRectForRepaint const):
        (WebCore::RenderInline::mapLocalToContainer const):

2017-11-08  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Improve PlatformContextCairo lifetime management in GraphicsContextPlatformPrivate
        https://bugs.webkit.org/show_bug.cgi?id=179424

        Reviewed by Carlos Garcia Campos.

        When the PlatformContextCairo object is owned by GraphicsContextPlatformPrivate,
        the latter should hold it in a std::unique_ptr<>. When PlatformContextCairo is
        not owned, the std::unique_ptr<> should remain null, and the PlatformContextCairo
        reference should point to the externally-managed object.

        A new GraphicsContextPlatformPrivate constructor accepts a std::unique_ptr<> that
        manages a PlatformContextCairo object and moves it into the member variable, tying
        lifetime of that PlatformContextCairo object to the private object.

        This enables dropping the GraphicsContextPlatformPrivateToplevel class, and the
        virtual table is no longer required. Small cleanups to the remaining class are
        also performed.

        No new tests -- no changes in behavior.

        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::GraphicsContext):
        (WebCore::GraphicsContext::platformInit):
        (WebCore::GraphicsContext::platformContext const):
        * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
        (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
        (WebCore::GraphicsContextPlatformPrivate::save):
        (WebCore::GraphicsContextPlatformPrivate::restore):
        (WebCore::GraphicsContextPlatformPrivate::flush):
        (WebCore::GraphicsContextPlatformPrivate::clip):
        (WebCore::GraphicsContextPlatformPrivate::scale):
        (WebCore::GraphicsContextPlatformPrivate::rotate):
        (WebCore::GraphicsContextPlatformPrivate::translate):
        (WebCore::GraphicsContextPlatformPrivate::concatCTM):
        (WebCore::GraphicsContextPlatformPrivate::setCTM):
        (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): Deleted.
        (WebCore::GraphicsContextPlatformPrivateToplevel::GraphicsContextPlatformPrivateToplevel): Deleted.
        (WebCore::GraphicsContextPlatformPrivateToplevel::~GraphicsContextPlatformPrivateToplevel): Deleted.
        * platform/graphics/win/GraphicsContextCairoWin.cpp:
        (WebCore::GraphicsContext::platformInit):

2017-11-08  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Move transparency layers Vector to PlatformContextCairo
        https://bugs.webkit.org/show_bug.cgi?id=179420

        Reviewed by Carlos Garcia Campos.

        Move the Vector of transparency layer float values from the
        GraphicsContextPlatformPrivate class to PlatformContextCairo.
        It fits better there since it's a platform-specific context
        state, just like e.g. the ShadowBlur member.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
        (WebCore::GraphicsContext::endPlatformTransparencyLayer):
        * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
        * platform/graphics/cairo/PlatformContextCairo.h:
        (WebCore::PlatformContextCairo::layers):
        * platform/graphics/win/GraphicsContextCairoWin.cpp:
        (WebCore::drawBitmapToContext):
        (WebCore::GraphicsContext::releaseWindowsContext):
        (WebCore::GraphicsContext::drawWindowsBitmap):

2017-11-08  Jeremy Jones  <jeremyj@apple.com>

        Disable implicit animations when adding or removing text track representation layers.
        https://bugs.webkit.org/show_bug.cgi?id=179406
        rdar://problem/34369835

        Reviewed by Simon Fraser.

        No new tests because this has no effect on the DOM.

        This change prevents implicit animations when the text track layer is added or removed from
        the video layer.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::syncTextTrackBounds):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation):
        * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
        (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):

2017-11-07  Maciej Stachowiak  <mjs@apple.com>

        Get rid of unsightly hex numbers from unified build object files
        https://bugs.webkit.org/show_bug.cgi?id=179410

        Reviewed by Saam Barati.

        * WebCore.xcodeproj/project.pbxproj: Rename UnifiedSource*.mm to UnifiedSource*-mm.mm for more readable build output.

2017-11-07  Antti Koivisto  <antti@apple.com>

        Remove RenderBlock::isAnonymousBlockContinuation()
        https://bugs.webkit.org/show_bug.cgi?id=179403

        Non-anonymous blocks don't have continuations so this is the same as simply calling continuation().

        Some of these are also really isContinuation() tests. This ends up being the same as calling
        continuation() as block continuations always have next continuation too. This patch uses
        isContinuation() where appropriate.

        Reviewed by Zalan Bujtas.

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::nodeForHitTest const):
        (WebCore::RenderBlock::absoluteRects const):
        (WebCore::RenderBlock::absoluteQuads const):
        (WebCore::RenderBlock::rectWithOutlineForRepaint const):
        (WebCore::RenderBlock::hoverAncestor const):
        (WebCore::RenderBlock::outlineStyleForRepaint const):
        * rendering/RenderBlock.h:
        (WebCore::RenderBlock::isAnonymousBlockContinuation const): Deleted.
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::propagateStyleToAnonymousChildren):
        * rendering/RenderInline.cpp:
        (WebCore::updateStyleOfAnonymousBlockContinuations):

2017-11-07  Antti Koivisto  <antti@apple.com>

        There is no such thing as block element continuation
        https://bugs.webkit.org/show_bug.cgi?id=179400

        Reviewed by Zalan Bujtas.

        There are no non-anonymous block continuations. This is dead code.

        * rendering/RenderBlock.cpp:
        (WebCore::borderOrPaddingLogicalWidthChanged):
        (WebCore::RenderBlock::styleDidChange):
        (WebCore::RenderBlock::blockElementContinuation const): Deleted.

            This would always return null.

        * rendering/RenderBlock.h:

2017-11-07  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] Rename enable/disableLayoutState
        https://bugs.webkit.org/show_bug.cgi?id=179399
        <rdar://problem/35400245>

        Reviewed by Antti Koivisto.

        It only enables/disables paint offset caching.

        No change in functionality.

        * page/LayoutContext.cpp:
        (WebCore::LayoutContext::pushLayoutState):
        (WebCore::LayoutContext::checkLayoutState):
        * page/LayoutContext.h:
        (WebCore::LayoutContext::isPaintOffsetCacheEnabled const):
        (WebCore::LayoutContext::disablePaintOffsetCache):
        (WebCore::LayoutContext::enablePaintOffsetCache):
        (WebCore::LayoutContext::layoutStateEnabled const): Deleted.
        (WebCore::LayoutContext::disableLayoutState): Deleted.
        (WebCore::LayoutContext::enableLayoutState): Deleted.
        * rendering/LayoutState.cpp:
        (WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
        (WebCore::LayoutStateMaintainer::push):
        (WebCore::LayoutStateMaintainer::pop):
        (WebCore::LayoutStateDisabler::LayoutStateDisabler):
        (WebCore::LayoutStateDisabler::~LayoutStateDisabler):
        (WebCore::shouldDisablePaintOffsetCacheForSubtree):
        (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
        (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
        (WebCore::shouldDisableLayoutStateForSubtree): Deleted.
        * rendering/LayoutState.h:
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::mapLocalToContainer const):
        (WebCore::RenderBox::computeRectForRepaint const):
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::clippedOverflowRectForRepaint const):
        (WebCore::RenderInline::computeRectForRepaint const):
        (WebCore::RenderInline::mapLocalToContainer const):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositions):
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::computeRectForRepaint const):
        * rendering/svg/RenderSVGContainer.cpp:
        (WebCore::RenderSVGContainer::layout):
        * rendering/svg/RenderSVGForeignObject.cpp:
        (WebCore::RenderSVGForeignObject::layout):

2017-11-07  Brady Eidson  <beidson@apple.com>

        Implement "UpdateWorkerState" and use it
        https://bugs.webkit.org/show_bug.cgi?id=179318

        Reviewed by Chris Dumez.

        No new tests (Existing tests and changes there-to).

        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::allWorkers):
        (WebCore::ServiceWorker::mutableAllWorkers):
        (WebCore::ServiceWorker::ServiceWorker):
        (WebCore::ServiceWorker::~ServiceWorker):
        (WebCore::ServiceWorker::updateWorkerState):
        (WebCore::ServiceWorker::setState): Deleted.
        * workers/service/ServiceWorker.h:

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::updateRegistrationState):
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        * workers/service/ServiceWorkerContainer.h:

        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
        (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
        (WebCore::ServiceWorkerRegistration::updateStateFromServer):

        * workers/service/ServiceWorkerRegistrationData.cpp:
        (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
        * workers/service/ServiceWorkerRegistrationData.h:
        (WebCore::ServiceWorkerRegistrationData::encode const):
        (WebCore::ServiceWorkerRegistrationData::decode):

        * workers/service/ServiceWorkerRegistrationKey.cpp:
        (WebCore::ServiceWorkerRegistrationKey::loggingString const):
        * workers/service/ServiceWorkerRegistrationKey.h:

        * workers/service/ServiceWorkerTypes.h:

        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::registerServiceWorkerThreadForInstall):
        (WebCore::SWContextManager::registerServiceWorkerThreadForUpdate): Deleted.
        * workers/service/context/SWContextManager.h:

        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::updateRegistrationState):
        (WebCore::SWClientConnection::updateWorkerState):
        * workers/service/server/SWClientConnection.h:

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::updateWorker):
        * workers/service/server/SWServer.h:
        (WebCore::SWServer::workerByID const):

        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptFetchFinished):
        (WebCore::SWServerJobQueue::scriptContextStarted):
        (WebCore::SWServerJobQueue::install):
        (WebCore::SWServerJobQueue::tryClearRegistration):

        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::updateRegistrationState):
        (WebCore::SWServerRegistration::updateWorkerState):
        (WebCore::SWServerRegistration::data const):
        * workers/service/server/SWServerRegistration.h:
        (WebCore::SWServerRegistration::setActiveServiceWorkerIdentifier): Deleted.

        * workers/service/server/SWServerWorker.h:
        (WebCore::SWServerWorker::state const):
        (WebCore::SWServerWorker::setState):

2017-11-07  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] Remove explicit LayoutStateMaintainer::pop calls.
        https://bugs.webkit.org/show_bug.cgi?id=179380
        <rdar://problem/35392161>

        Reviewed by Antti Koivisto.

        Besides the pagination related explicit pops (FIXME), all LayoutStateMaintainer pops are
        now in LayoutStateMaintainer's d'tor.

        Covered by existing tests.

        * rendering/LayoutState.cpp:
        (WebCore::LayoutStateMaintainer::~LayoutStateMaintainer):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::simplifiedLayout):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::layoutBlock):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::layout):
        * rendering/RenderDeprecatedFlexibleBox.cpp:
        (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
        * rendering/RenderEmbeddedObject.cpp:
        (WebCore::RenderEmbeddedObject::layout):
        * rendering/RenderFlexibleBox.cpp:
        (WebCore::RenderFlexibleBox::layoutBlock):
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::layoutBlock):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::layoutShadowControls):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::layout):
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::layout):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::calcRowLogicalHeight):
        (WebCore::RenderTableSection::layout):
        (WebCore::RenderTableSection::layoutRows):
        * rendering/RenderVTTCue.cpp:
        (WebCore::RenderVTTCue::layout):
        * rendering/RenderView.cpp:
        (WebCore::RenderView::layout):

2017-11-07  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r224512 and r224521.
        https://bugs.webkit.org/show_bug.cgi?id=179388

        An API test added with this change is failing an assertion on
        the bots. (Requested by ryanhaddad on #webkit).

        Reverted changesets:

        "[Attachment Support] Implement delegate hooks for attachment
        element insertion and removal"
        https://bugs.webkit.org/show_bug.cgi?id=179016
        https://trac.webkit.org/changeset/224512

        "Remove stray logging from a newly added API test"
        https://trac.webkit.org/changeset/224521

2017-11-07  Antoine Quint  <graouts@apple.com>

        <video> does not respect pointer-events
        https://bugs.webkit.org/show_bug.cgi?id=179378
        <rdar://problem/34687668>

        Reviewed by Simon Fraser.

        We now honor the "pointer-events" property value set on the <video> element by setting it to "inherit"
        on the media controls shadow root container.

        Test: media/modern-media-controls/css/pointer-events-none.html

        * Modules/modern-media-controls/controls/media-controls.css:
        (.media-controls-container):

2017-11-07  Chris Dumez  <cdumez@apple.com>

        [Service Workers] Add support for "install" event
        https://bugs.webkit.org/show_bug.cgi?id=179338

        Reviewed by Youenn Fablet.

        Add support for "install" event as per:
        - https://w3c.github.io/ServiceWorker/#installation-algorithm (Step 10)

        For now, install always succeeds as our support for ExtendableEvent.waitUntil() is
        still incomplete.

        Test: http/tests/workers/service/basic-install-event.html

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::firePostInstallEvents):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::fireInstallEvent):
        * workers/service/context/SWContextManager.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::fireInstallEvent):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::firePostInstallEvents):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::didFinishInstall):
        (WebCore::SWServer::didFinishInstall):
        (WebCore::SWServer::fireInstallEvent):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptContextStarted):
        (WebCore::SWServerJobQueue::install):
        (WebCore::SWServerJobQueue::didFinishInstall):
        * workers/service/server/SWServerJobQueue.h:
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::firePostInstallEvents):
        * workers/service/server/SWServerRegistration.h:

2017-11-07  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r224498.

        The LayoutTest for this change is flaky and affecting EWS
        results.

        Reverted changeset:

        "Add tests to ensure that <source> tags are only preloaded
        when the `type`"
        https://bugs.webkit.org/show_bug.cgi?id=179231
        https://trac.webkit.org/changeset/224498

2017-11-07  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Add some fast returns in cases where we only call through to a NetworkAgent
        https://bugs.webkit.org/show_bug.cgi?id=179359

        Reviewed by Devin Rousso.

        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::willSendRequest):
        (WebCore::InspectorInstrumentation::willSendRequestOfType):
        (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
        (WebCore::InspectorInstrumentation::didReceiveThreadableLoaderResponse):
        (WebCore::InspectorInstrumentation::didReceiveData):
        (WebCore::InspectorInstrumentation::didFinishXHRLoading):
        (WebCore::InspectorInstrumentation::willLoadXHRSynchronously):
        (WebCore::InspectorInstrumentation::didLoadXHRSynchronously):
        (WebCore::InspectorInstrumentation::scriptImported):
        (WebCore::InspectorInstrumentation::didReceiveScriptResponse):
        Fast return if no frontend in cases that only call into NetworkAgent
        because the NetworkAgent is only available if there is a frontend.

2017-10-31  Filip Pizlo  <fpizlo@apple.com>

        bmalloc should support strictly type-segregated isolated heaps
        https://bugs.webkit.org/show_bug.cgi?id=178108

        Reviewed by Saam Barati, Simon Fraser, and Ryosuke Niwa.

        No new tests because no new change in behavior. Though, the bmalloc change has a unit test.
        
        Adopting IsoHeap means dropping in macros in both the .h and .cpp file of each class that we
        opt in. It's not pretty, but it helps ensure speedy allocation since it means that we never
        have to do any kind of switch or dynamic lookup to find the right allocator for a type.
        
        This change is perf-neutral on MotionMark, PLT3, and membuster.

        * Sources.txt:
        * html/shadow/SliderThumbElement.cpp:
        * html/shadow/SliderThumbElement.h:
        * html/shadow/mac/ImageControlsButtonElementMac.cpp:
        * html/shadow/mac/ImageControlsRootElementMac.cpp:
        * rendering/RenderAttachment.cpp:
        * rendering/RenderAttachment.h:
        * rendering/RenderBlock.cpp:
        * rendering/RenderBlock.h:
        * rendering/RenderBlockFlow.cpp:
        * rendering/RenderBlockFlow.h:
        * rendering/RenderBox.cpp:
        * rendering/RenderBox.h:
        * rendering/RenderBoxModelObject.cpp:
        * rendering/RenderBoxModelObject.h:
        * rendering/RenderButton.cpp:
        * rendering/RenderButton.h:
        * rendering/RenderCombineText.cpp:
        * rendering/RenderCombineText.h:
        * rendering/RenderCounter.cpp:
        * rendering/RenderCounter.h:
        * rendering/RenderDeprecatedFlexibleBox.cpp:
        * rendering/RenderDeprecatedFlexibleBox.h:
        * rendering/RenderDetailsMarker.cpp:
        * rendering/RenderDetailsMarker.h:
        * rendering/RenderElement.cpp:
        * rendering/RenderElement.h:
        * rendering/RenderEmbeddedObject.cpp:
        * rendering/RenderEmbeddedObject.h:
        * rendering/RenderFileUploadControl.cpp:
        * rendering/RenderFileUploadControl.h:
        * rendering/RenderFlexibleBox.cpp:
        * rendering/RenderFlexibleBox.h:
        * rendering/RenderFragmentContainer.cpp:
        * rendering/RenderFragmentContainer.h:
        * rendering/RenderFragmentContainerSet.cpp:
        * rendering/RenderFragmentContainerSet.h:
        * rendering/RenderFragmentedFlow.cpp:
        * rendering/RenderFragmentedFlow.h:
        * rendering/RenderFrameBase.cpp:
        * rendering/RenderFrameBase.h:
        * rendering/RenderFrameSet.cpp:
        * rendering/RenderFrameSet.h:
        * rendering/RenderFullScreen.cpp:
        * rendering/RenderFullScreen.h:
        * rendering/RenderGrid.cpp:
        * rendering/RenderGrid.h:
        * rendering/RenderHTMLCanvas.cpp:
        * rendering/RenderHTMLCanvas.h:
        * rendering/RenderImage.cpp:
        * rendering/RenderImage.h:
        * rendering/RenderImageResourceStyleImage.cpp:
        * rendering/RenderImageResourceStyleImage.h:
        * rendering/RenderInline.cpp:
        * rendering/RenderInline.h:
        * rendering/RenderLayerModelObject.cpp:
        * rendering/RenderLayerModelObject.h:
        * rendering/RenderLineBreak.cpp:
        * rendering/RenderLineBreak.h:
        * rendering/RenderListBox.cpp:
        * rendering/RenderListBox.h:
        * rendering/RenderListItem.cpp:
        * rendering/RenderListItem.h:
        * rendering/RenderListMarker.cpp:
        * rendering/RenderListMarker.h:
        * rendering/RenderMedia.cpp:
        * rendering/RenderMedia.h:
        * rendering/RenderMediaControlElements.cpp:
        * rendering/RenderMediaControlElements.h:
        * rendering/RenderMenuList.cpp:
        * rendering/RenderMenuList.h:
        * rendering/RenderMeter.cpp:
        * rendering/RenderMeter.h:
        * rendering/RenderMultiColumnFlow.cpp:
        * rendering/RenderMultiColumnFlow.h:
        * rendering/RenderMultiColumnSet.cpp:
        * rendering/RenderMultiColumnSet.h:
        * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
        * rendering/RenderMultiColumnSpannerPlaceholder.h:
        * rendering/RenderObject.cpp:
        * rendering/RenderObject.h:
        * rendering/RenderProgress.cpp:
        * rendering/RenderProgress.h:
        * rendering/RenderQuote.cpp:
        * rendering/RenderQuote.h:
        * rendering/RenderReplaced.cpp:
        * rendering/RenderReplaced.h:
        * rendering/RenderReplica.cpp:
        * rendering/RenderReplica.h:
        * rendering/RenderRuby.cpp:
        * rendering/RenderRuby.h:
        * rendering/RenderRubyBase.cpp:
        * rendering/RenderRubyBase.h:
        * rendering/RenderRubyRun.cpp:
        * rendering/RenderRubyRun.h:
        * rendering/RenderRubyText.cpp:
        * rendering/RenderRubyText.h:
        * rendering/RenderScrollbarPart.cpp:
        * rendering/RenderScrollbarPart.h:
        * rendering/RenderSearchField.cpp:
        * rendering/RenderSearchField.h:
        * rendering/RenderSlider.cpp:
        * rendering/RenderSlider.h:
        * rendering/RenderTable.cpp:
        * rendering/RenderTable.h:
        * rendering/RenderTableCaption.cpp:
        * rendering/RenderTableCaption.h:
        * rendering/RenderTableCell.cpp:
        * rendering/RenderTableCell.h:
        * rendering/RenderTableCol.cpp:
        * rendering/RenderTableCol.h:
        * rendering/RenderTableRow.cpp:
        * rendering/RenderTableRow.h:
        * rendering/RenderTableSection.cpp:
        * rendering/RenderTableSection.h:
        * rendering/RenderText.cpp:
        * rendering/RenderText.h:
        * rendering/RenderTextControl.cpp:
        * rendering/RenderTextControl.h:
        * rendering/RenderTextControlMultiLine.cpp:
        * rendering/RenderTextControlMultiLine.h:
        * rendering/RenderTextControlSingleLine.cpp:
        * rendering/RenderTextControlSingleLine.h:
        * rendering/RenderTextFragment.cpp:
        * rendering/RenderTextFragment.h:
        * rendering/RenderVTTCue.cpp:
        * rendering/RenderVTTCue.h:
        * rendering/RenderVideo.cpp:
        * rendering/RenderVideo.h:
        * rendering/RenderView.cpp:
        * rendering/RenderView.h:
        * rendering/RenderWidget.cpp:
        * rendering/RenderWidget.h:
        * rendering/mathml/RenderMathMLBlock.cpp:
        * rendering/mathml/RenderMathMLBlock.h:
        * rendering/mathml/RenderMathMLFenced.cpp:
        * rendering/mathml/RenderMathMLFenced.h:
        * rendering/mathml/RenderMathMLFencedOperator.cpp:
        * rendering/mathml/RenderMathMLFencedOperator.h:
        * rendering/mathml/RenderMathMLFraction.cpp:
        * rendering/mathml/RenderMathMLFraction.h:
        * rendering/mathml/RenderMathMLMath.cpp:
        * rendering/mathml/RenderMathMLMath.h:
        * rendering/mathml/RenderMathMLMenclose.cpp:
        * rendering/mathml/RenderMathMLMenclose.h:
        * rendering/mathml/RenderMathMLOperator.cpp:
        * rendering/mathml/RenderMathMLOperator.h:
        * rendering/mathml/RenderMathMLPadded.cpp:
        * rendering/mathml/RenderMathMLPadded.h:
        * rendering/mathml/RenderMathMLRoot.cpp:
        * rendering/mathml/RenderMathMLRoot.h:
        * rendering/mathml/RenderMathMLRow.cpp:
        * rendering/mathml/RenderMathMLRow.h:
        * rendering/mathml/RenderMathMLScripts.cpp:
        * rendering/mathml/RenderMathMLScripts.h:
        * rendering/mathml/RenderMathMLSpace.cpp:
        * rendering/mathml/RenderMathMLSpace.h:
        * rendering/mathml/RenderMathMLToken.cpp:
        * rendering/mathml/RenderMathMLToken.h:
        * rendering/mathml/RenderMathMLUnderOver.cpp:
        * rendering/mathml/RenderMathMLUnderOver.h:
        * rendering/svg/RenderSVGBlock.cpp:
        * rendering/svg/RenderSVGBlock.h:
        * rendering/svg/RenderSVGContainer.cpp:
        * rendering/svg/RenderSVGContainer.h:
        * rendering/svg/RenderSVGEllipse.cpp:
        * rendering/svg/RenderSVGEllipse.h:
        * rendering/svg/RenderSVGForeignObject.cpp:
        * rendering/svg/RenderSVGForeignObject.h:
        * rendering/svg/RenderSVGGradientStop.cpp:
        * rendering/svg/RenderSVGGradientStop.h:
        * rendering/svg/RenderSVGHiddenContainer.cpp:
        * rendering/svg/RenderSVGHiddenContainer.h:
        * rendering/svg/RenderSVGImage.cpp:
        * rendering/svg/RenderSVGImage.h:
        * rendering/svg/RenderSVGInline.cpp:
        * rendering/svg/RenderSVGInline.h:
        * rendering/svg/RenderSVGInlineText.cpp:
        * rendering/svg/RenderSVGInlineText.h:
        * rendering/svg/RenderSVGModelObject.cpp:
        * rendering/svg/RenderSVGModelObject.h:
        * rendering/svg/RenderSVGPath.cpp:
        * rendering/svg/RenderSVGPath.h:
        * rendering/svg/RenderSVGRect.cpp:
        * rendering/svg/RenderSVGRect.h:
        * rendering/svg/RenderSVGResourceClipper.cpp:
        * rendering/svg/RenderSVGResourceClipper.h:
        * rendering/svg/RenderSVGResourceContainer.cpp:
        * rendering/svg/RenderSVGResourceContainer.h:
        * rendering/svg/RenderSVGResourceFilter.cpp:
        * rendering/svg/RenderSVGResourceFilter.h:
        * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
        * rendering/svg/RenderSVGResourceFilterPrimitive.h:
        * rendering/svg/RenderSVGResourceGradient.cpp:
        * rendering/svg/RenderSVGResourceGradient.h:
        * rendering/svg/RenderSVGResourceLinearGradient.cpp:
        * rendering/svg/RenderSVGResourceLinearGradient.h:
        * rendering/svg/RenderSVGResourceMarker.cpp:
        * rendering/svg/RenderSVGResourceMarker.h:
        * rendering/svg/RenderSVGResourceMasker.cpp:
        * rendering/svg/RenderSVGResourceMasker.h:
        * rendering/svg/RenderSVGResourcePattern.cpp:
        * rendering/svg/RenderSVGResourcePattern.h:
        * rendering/svg/RenderSVGResourceRadialGradient.cpp:
        * rendering/svg/RenderSVGResourceRadialGradient.h:
        * rendering/svg/RenderSVGRoot.cpp:
        * rendering/svg/RenderSVGRoot.h:
        * rendering/svg/RenderSVGShape.cpp:
        * rendering/svg/RenderSVGShape.h:
        * rendering/svg/RenderSVGTSpan.cpp: Added.
        * rendering/svg/RenderSVGTSpan.h:
        * rendering/svg/RenderSVGText.cpp:
        * rendering/svg/RenderSVGText.h:
        * rendering/svg/RenderSVGTextPath.cpp:
        * rendering/svg/RenderSVGTextPath.h:
        * rendering/svg/RenderSVGTransformableContainer.cpp:
        * rendering/svg/RenderSVGTransformableContainer.h:
        * rendering/svg/RenderSVGViewportContainer.cpp:
        * rendering/svg/RenderSVGViewportContainer.h:

2017-11-07  Antti Koivisto  <antti@apple.com>

        Dynamic media queries don't update in shadow tree stylesheets
        https://bugs.webkit.org/show_bug.cgi?id=179324

        Reviewed by Ryosuke Niwa.

        Viewport and accessibility queries should work dynamically also in shadow trees.

        Test: fast/shadow-dom/media-query-in-shadow-style.html

        * page/LayoutContext.cpp:
        (WebCore::LayoutContext::updateStyleForLayout):
        * page/Page.cpp:
        (WebCore::Page::accessibilitySettingsDidChange):

            Evaluate media query list (JS API) unconditionally as it is independent from style queries.
            Remove some logging.

        * style/StyleScope.cpp:
        (WebCore::Style::Scope::evaluateMediaQueriesForViewportChange):
        (WebCore::Style::Scope::evaluateMediaQueriesForAccessibilitySettingsChange):

            Factor into functions in style scope.

        (WebCore::Style::Scope::evaluateMediaQueries):

            Evaluate queries in all shadow trees too.

        * style/StyleScope.h:

2017-11-07  Ryosuke Niwa  <rniwa@webkit.org>

        Release-assert NoEventDispatchAssertion in canExecute, updateLayout, and updateStyle
        https://bugs.webkit.org/show_bug.cgi?id=179281
        <rdar://problem/35008993>

        Reviewed by Antti Koivisto.

        Surgically enable NoEventDispatchAssertion::InMainThread::isEventAllowed() in release builds to prevent
        against insecure execution of author scripts.

        No new tests since there should be no behavioral changes (other than preventing potential security bugs
        from being exploited).

        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::canExecuteScripts): Use the release assert here. This function is consulted
        whenever author scripts are executed in event handler, script element, etc... in the main thread so
        enabling the release assert here should basically prevent all unwanted script executions protected by
        NoEventDispatchAssertion.
        * dom/ContainerNode.cpp:
        (NoEventDispatchAssertion::s_count): Now always compiled.
        * dom/Document.cpp:
        (WebCore::Document::updateStyleIfNeeded): Use the release assert here. This assertion would prevent
        unwanted style updating. This part of the change can be reverted if it turns out to be too crashy since
        just updating the style would not directly introduce a security vulnerability.
        (WebCore::Document::updateLayout): Ditto for updating the layout.
        * dom/NoEventDispatchAssertion.h:
        (WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion): Enabled this in release builds.
        (WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion): Ditto.
        (WebCore::NoEventDispatchAssertion::isEventAllowedInMainThread): Ditto.
        (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Ditto.
        (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Ditto.
        (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): We still don't enable
        this assertion because this check requires O(n) operation. Added a comment to that end.
        (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): Enabled this in release builds.
        (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope): Ditto.
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::executeClassicScript): Use the release assert here. This is the function used by
        the HTML parser to run scripts via HTMLScriptRunner::executePendingScriptAndDispatchEvent. Having a release
        assertion here should prevent the rest of the unwanted script executions in the HTML parser not caught by
        canExecuteScripts.

2017-11-07  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE][GTK] Building with ENABLE_VIDEO=OFF fails to find AudioTrack.idl
        https://bugs.webkit.org/show_bug.cgi?id=179372

        Reviewed by Michael Catanzaro.

        Arrange MSE extensions defined in {Audio,Text,Video}TrackMediaSource.idl to be
        only used for building when both ENABLE_VIDEO_TRACK and ENABLE_MEDIA_SOURCE are
        enabled.

        No new tests needed.

        * CMakeLists.txt: Add conditional for ENABLE_MEDIA_SOURCE and move the addition
        of the IDL files to the build there.
        * Sources.txt: Conversely, source unification should skip sources derived from
        the IDL files when ENABLE_MEDIA_SOURCE disabled, so add guards as well.

2017-11-07  Youenn Fablet  <youenn@apple.com>

        Support the case of fetch events that are not responded
        https://bugs.webkit.org/show_bug.cgi?id=179336

        Reviewed by Chris Dumez.

        Covered by updated test.

        Implementing https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm step 19.
        Making FetchEvent cancellable.

        * workers/service/FetchEvent.h:
        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
        * workers/service/context/ServiceWorkerFetch.h:

2017-11-07  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Create inspector agents lazily
        https://bugs.webkit.org/show_bug.cgi?id=179360

        Reviewed by Sam Weinig.

        * inspector/CommandLineAPIHost.h:
        Modernize style.

        * inspector/InspectorController.h:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::InspectorController):
        (WebCore::InspectorController::pageAgentContext):
        (WebCore::InspectorController::createLazyAgents):
        (WebCore::InspectorController::connectFrontend):
        Move many of the agent construction to happen lazily. These
        agent's aren't needed until an inspector connects, so defer
        creation until an inspector connects.

2017-11-06  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] Move m_layoutState from RenderView to LayoutContext
        https://bugs.webkit.org/show_bug.cgi?id=179282
        <rdar://problem/35348653>

        Reviewed by Antti Koivisto.

        LayoutContext now owns the top level LayoutState object.
        It makes RenderView behave like any other renderer by constructing a LayoutStateMaintainer on the stack.
        This is mostly moving code from RenderView.h/.cpp to LayoutContext.h/.cpp and fixing the callsites.
        (While view().frameView().layoutContext().layoutState() is a bit lengthy, it's
        temporary only, since LayoutState is planned to be an argument of the layout() method.  

        Covered by existing test.

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::notificationPostTimerFired):
        * page/LayoutContext.cpp:
        (WebCore::LayoutContext::layoutDelta const):
        (WebCore::LayoutContext::addLayoutDelta):
        (WebCore::LayoutContext::layoutDeltaMatches):
        (WebCore::LayoutContext::pushLayoutState):
        (WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
        (WebCore::LayoutContext::popLayoutState):
        (WebCore::LayoutContext::checkLayoutState):
        * page/LayoutContext.h:
        (WebCore::LayoutContext::layoutState const):
        (WebCore::LayoutContext::layoutStateEnabled const):
        (WebCore::LayoutContext::disableLayoutState):
        (WebCore::LayoutContext::enableLayoutState):
        * rendering/LayoutState.cpp:
        (WebCore::LayoutState::LayoutState):
        (WebCore::LayoutState::computeClipRect):
        (WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
        (WebCore::LayoutStateMaintainer::push):
        (WebCore::LayoutStateMaintainer::pop):
        (WebCore::LayoutStateDisabler::LayoutStateDisabler):
        (WebCore::LayoutStateDisabler::~LayoutStateDisabler):
        (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
        (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
        (WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer):
        (WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer):
        * rendering/LayoutState.h:
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::setLogicalLeftForChild):
        (WebCore::RenderBlock::setLogicalTopForChild):
        (WebCore::RenderBlock::layoutPositionedObject):
        (WebCore::RenderBlock::markForPaginationRelayoutIfNeeded):
        (WebCore::RenderBlock::adjustLogicalLeftOffsetForLine const):
        (WebCore::RenderBlock::adjustLogicalRightOffsetForLine const):
        (WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const):
        (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::layoutBlock):
        (WebCore::RenderBlockFlow::layoutBlockChildren):
        (WebCore::RenderBlockFlow::layoutBlockChild):
        (WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
        (WebCore::RenderBlockFlow::estimateLogicalTopPosition):
        (WebCore::RenderBlockFlow::applyBeforeBreak):
        (WebCore::RenderBlockFlow::applyAfterBreak):
        (WebCore::RenderBlockFlow::hasNextPage const):
        (WebCore::RenderBlockFlow::pageLogicalTopForOffset const):
        (WebCore::RenderBlockFlow::pageLogicalHeightForOffset const):
        (WebCore::RenderBlockFlow::pageRemainingLogicalHeightForOffset const):
        (WebCore::RenderBlockFlow::repaintOverhangingFloats):
        (WebCore::RenderBlockFlow::insertFloatingObject):
        (WebCore::RenderBlockFlow::positionNewFloats):
        (WebCore::RenderBlockFlow::layoutSimpleLines):
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::RenderBlockFlow::layoutRunsAndFloats):
        (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
        (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
        (WebCore::RenderBlockFlow::layoutLineBoxes):
        (WebCore::RenderBlockFlow::determineStartPosition):
        (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::outlineBoundsForRepaint const):
        (WebCore::RenderBox::mapLocalToContainer const):
        (WebCore::RenderBox::clippedOverflowRectForRepaint const):
        (WebCore::RenderBox::computeRectForRepaint const):
        (WebCore::RenderBox::offsetFromLogicalTopOfFirstPage const):
        * rendering/RenderDeprecatedFlexibleBox.cpp:
        (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
        (WebCore::layoutChildIfNeededApplyingDelta):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::insertChildInternal):
        (WebCore::RenderElement::takeChildInternal):
        * rendering/RenderEmbeddedObject.cpp:
        * rendering/RenderFragmentedFlow.cpp:
        (WebCore::RenderFragmentedFlow::repaintRectangleInFragments const):
        * rendering/RenderGrid.cpp:
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::clippedOverflowRectForRepaint const):
        (WebCore::RenderInline::computeRectForRepaint const):
        (WebCore::RenderInline::mapLocalToContainer const):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositions):
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::layout):
        * rendering/RenderMediaControlElements.cpp:
        (WebCore::RenderMediaVolumeSliderContainer::layout):
        (WebCore::RenderMediaControlTimelineContainer::layout):
        (WebCore::RenderTextTrackContainerElement::layout):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::repaintRectangle const):
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::clippedOverflowRectForRepaint const):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::layout):
        (WebCore::RenderTable::markForPaginationRelayoutIfNeeded):
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::clippedOverflowRectForRepaint const):
        (WebCore::RenderTableCell::computeRectForRepaint const):
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::layout):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::calcRowLogicalHeight):
        (WebCore::RenderTableSection::layout):
        (WebCore::RenderTableSection::layoutRows):
        (WebCore::RenderTableSection::setLogicalPositionForCell const):
        * rendering/RenderVTTCue.cpp:
        * rendering/RenderView.cpp:
        (WebCore::RenderView::layout):
        (WebCore::RenderView::layoutContent): Deleted.
        (WebCore::RenderView::checkLayoutState): Deleted.
        (WebCore::RenderView::initializeLayoutState): Deleted.
        (WebCore::RenderView::pushLayoutState): Deleted.
        (WebCore::RenderView::pushLayoutStateForPaginationIfNeeded): Deleted.
        * rendering/RenderView.h:
        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::lineSnapAdjustment const):
        * rendering/svg/RenderSVGContainer.cpp:
        (WebCore::RenderSVGContainer::layout):
        * rendering/svg/RenderSVGForeignObject.cpp:
        (WebCore::RenderSVGForeignObject::layout):
        * rendering/svg/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::layout):
        * style/RenderTreeUpdaterFirstLetter.cpp:
        (WebCore::RenderTreeUpdater::FirstLetter::update):
        * style/RenderTreeUpdaterListItem.cpp:
        (WebCore::RenderTreeUpdater::ListItem::updateMarker):

2017-11-06  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [CG] Adopt CGContextDrawPathDirect()
        https://bugs.webkit.org/show_bug.cgi?id=179339
        <rdar://problem/26283575>

        Reviewed by Simon Fraser.

        Adopt this function on macOS >= 10.12 and iOS >= 10.0. Instead of clearing
        the current path and creating a new one by calling CGContextBeginPath()
        and then adding a CGPath by calling CGContextAddPath() and then calling 
        one of the drawing path functions, we just call CGContextDrawPathDirect().

        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::drawPath):
        (WebCore::GraphicsContext::fillPath):
        (WebCore::GraphicsContext::strokePath): Don't call CGContextBeginPath()
        and CGContextAddPath() for the drawing CGContext in the case of gradient
        shadow because we add the CGPath to the layerContext and at the end we
        draw this CGLayer into the drawing context.

2017-11-06  Alex Christensen  <achristensen@webkit.org>

        Make ResourceLoader::willSendRequestInternal asynchronous
        https://bugs.webkit.org/show_bug.cgi?id=179251

        Reviewed by Andy Estes.

        ResourceLoader::willSendRequestInternal is used for redirects, which need to be asynchronous, and for the initial request.
        Making it asynchronous requires making load initialization asynchronous, too.

        No change in behavior.  This will allow us to make more things asynchronous.

        * loader/LoaderStrategy.h:
        * loader/NetscapePlugInStreamLoader.cpp:
        (WebCore::NetscapePlugInStreamLoader::create):
        (WebCore::NetscapePlugInStreamLoader::init):
        (WebCore::NetscapePlugInStreamLoader::willSendRequest):
        * loader/NetscapePlugInStreamLoader.h:
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::init):
        (WebCore::ResourceLoader::willSendRequestInternal):
        (WebCore::ResourceLoader::willSendRequest):
        (WebCore::ResourceLoader::willSendRequestAsync):
        * loader/ResourceLoader.h:
        (WebCore::ResourceLoader::startLoading):
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::create):
        (WebCore::SubresourceLoader::startLoading):
        (WebCore::SubresourceLoader::init):
        (WebCore::SubresourceLoader::willSendRequestInternal):
        * loader/SubresourceLoader.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load):
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
        Calling autorelease from a non-main thread was causing crashes.  This is because we need to set up an autorelease pool on that thread, which we have not done.  See:
        https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmAutoreleasePools.html#//apple_ref/doc/uid/20000047-1041876
        I replaced the calls to RetainPtr::autorelease with RetainPtr::get.  This causes us to keep the NSURLRequest and NSURLResponse alive as long as the request is being
        responded to in WebKitLegacy and in El Capitan.  Given the number of ResourceRequest and ResourceResponse copies we store, this shouldn't be a problem memory-wise.
        This will all go away once NSURLSession is used for loading in WebKitLegacy, and this is a large step towards that.

2017-11-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Implement delegate hooks for attachment element insertion and removal
        https://bugs.webkit.org/show_bug.cgi?id=179016
        <rdar://problem/35250890>

        Reviewed by Tim Horton.

        Implements a mechanism for notifying WebKit2 clients when attachment elements are inserted into or removed from
        the document. See per-change comments below for more details.

        API tests: WKAttachmentTests.AttachmentElementInsertion
                   WKAttachmentTests.AttachmentUpdatesWhenInsertingAndDeletingNewline
                   WKAttachmentTests.AttachmentUpdatesWhenUndoingAndRedoing
                   WKAttachmentTests.AttachmentUpdatesWhenChangingFontStyles
                   WKAttachmentTests.AttachmentUpdatesWhenInsertingLists
                   WKAttachmentTests.AttachmentUpdatesWhenInsertingRichMarkup

        * editing/Editor.cpp:
        (WebCore::Editor::respondToChangedSelection):
        (WebCore::Editor::editorUIUpdateTimerFired):

        Additionally notify the client of any attachment updates.

        (WebCore::Editor::scheduleEditorUIUpdate):

        Add a new helper that starts the editor UI update timer with 0 delay, and use it everywhere we schedule an
        editor UI update.

        (WebCore::Editor::didInsertAttachmentElement):
        (WebCore::Editor::didRemoveAttachmentElement):

        Maintain two sets of attachment element identifiers -- the first one tracking insertions, and the second one
        tracking removals. When an attachment element is inserted, we first check to see if that attachment element has
        just been removed; if so, we don't add it to the inserted identifiers set, but instead remove it from the set of
        removed identifiers. We perform a similar check in the opposite case. This prevents us from notifying the client
        of extraneous insertions and removals during certain editing commands which may reparent and move attachment
        elements around. In both cases, we schedule an editor UI update afterwards, where we will notify the client of
        attachment updates.

        (WebCore::Editor::notifyClientOfAttachmentUpdates):
        (WebCore::Editor::insertAttachmentFromFile):
        * editing/Editor.h:
        * html/HTMLAttachmentElement.cpp:
        (WebCore::HTMLAttachmentElement::HTMLAttachmentElement):

        Remove the version of HTMLAttachmentElement's constructor that takes a unique identifier.

        (WebCore::HTMLAttachmentElement::insertedIntoAncestor):
        (WebCore::HTMLAttachmentElement::removedFromAncestor):

        Implement these hooks to observe insertion into and removal from the DOM. If the element was attached to or
        removed from an ancestor that was connected to the document, call out to the document's frame's editor. This
        "document-connected" rule prevents us from calling out to the client in cases where (for instance) we append an
        attachment element to a newly created DocumentFragment in preparation for executing a ReplaceSelectionCommand.

        (WebCore::HTMLAttachmentElement::uniqueIdentifier const):
        (WebCore::HTMLAttachmentElement::setUniqueIdentifier):

        Refactor unique identifier to refer to the new attachment identifier attribute instead of a member variable.

        * html/HTMLAttachmentElement.h:
        * html/HTMLAttributeNames.in:

        Add a new attribute representing an attachment element's identifier. This enables us to keep track of particular
        attachments as they are destroyed and recreated as different objects, as a result of some editing commands.

        * page/EditorClient.h:
        (WebCore::EditorClient::didInsertAttachment):
        (WebCore::EditorClient::didRemoveAttachment):

        Add boilerplate editor client hooks for attachment insertion and removal.

2017-11-06  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r224494.

        Introduced LayoutTest flakiness on WK1.

        Reverted changeset:

        "[LayoutState cleanup] Move m_layoutState from RenderView to
        LayoutContext"
        https://bugs.webkit.org/show_bug.cgi?id=179282
        https://trac.webkit.org/changeset/224494

2017-11-03  Simon Fraser  <simon.fraser@apple.com>

        UIWebView is not rendering content that comes on screen during overflow scroll
        https://bugs.webkit.org/show_bug.cgi?id=179277
        rdar://problem/34272949

        Reviewed by Tim Horton

        When page or overflow scrolling happens, we do a traversal of GraphicsLayers to determine
        whether the exposed part of tiled layers changed in a way that requires a change in the tile
        coverage. If so, we schedule a compositing layer flush.

        There was no equivalent logic for computing whether the "backing store detached" state
        of a layer changed (which we use to throw away backing store of layers outside the viewport),
        so after scrolling an accelerated overflow:scroll which contained composited layers, we
        would sometimes fail to recompute that we should re-create backing store for revealed
        layers.

        Fix by having GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush() determine
        whether 'intersectsCoverageRect' changed, and if so trigger a flush. This requires
        tracking CommitState for isViewportConstrained-ness, just like we do during commits.

        Also clean up code related to computing the visible rect passed into visibleRectChangeRequiresFlush() and
        flushCompositingState(); these diverged for no good reason. Also clean up the logging a little.
        
        Not testable because UIWebView layout tests are unreliable.

        * page/ios/FrameIOS.mm:
        (WebCore::Frame::viewportOffsetChanged):
        (WebCore::Frame::overflowScrollPositionChangedForNode):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
        (WebCore::GraphicsLayerCA::visibleRectChangeRequiresFlush const):
        * platform/graphics/ca/GraphicsLayerCA.h:
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
        (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
        (WebCore::RenderLayerCompositor::didChangeVisibleRect):
        * rendering/RenderLayerCompositor.h:

2017-11-06  Chris Dumez  <cdumez@apple.com>

        [Service Workers] Add proper implementation for 'updatefound' event
        https://bugs.webkit.org/show_bug.cgi?id=179302

        Reviewed by Brady Eidson.

        Add proper implementation for 'updatefound' event instead of faking it.
        The 'updatefound' event firing is now triggered from the StorageProcess,
        during the install steps, instead of being fired on WebContent process
        side in jobResolvedWithRegistration().

        Specification:
        - https://w3c.github.io/ServiceWorker/#install (step 7)

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::scheduleJob):
        (WebCore::ServiceWorkerContainer::fireUpdateFoundEvent):
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        (WebCore::ServiceWorkerContainer::jobDidFinish):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::fireUpdateFoundEvent):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptContextStarted):
        (WebCore::SWServerJobQueue::install):
        * workers/service/server/SWServerJobQueue.h:
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::fireUpdateFoundEvent):
        * workers/service/server/SWServerRegistration.h:

2017-11-06  Christopher Reid  <chris.reid@sony.com>

        Use enum classes within FileSystem
        https://bugs.webkit.org/show_bug.cgi?id=175172

        Reviewed by Myles C. Maxfield.

        No new tests, no change in behavior.

        Using enum classes in filesystem to enforce stronger type safety.

        * Modules/webdatabase/OriginLock.cpp:
        * loader/appcache/ApplicationCacheStorage.cpp:
        * platform/FileHandle.h:
        * platform/FileStream.cpp:
        * platform/FileSystem.cpp:
        * platform/FileSystem.h:
        * platform/cocoa/FileMonitorCocoa.mm:
        * platform/glib/FileSystemGlib.cpp:
        * platform/network/curl/CurlCacheEntry.cpp:
        * platform/network/curl/CurlCacheManager.cpp:
        * platform/posix/FileSystemPOSIX.cpp:
        * platform/win/FileSystemWin.cpp:
        * rendering/RenderThemeWin.cpp:

2017-11-06  Commit Queue  <commit-queue@webkit.org>

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

        It is breaking internal builds (Requested by youenn on
        #webkit).

        Reverted changeset:

        "Use VCP H264 encoder for platforms supporting it"
        https://bugs.webkit.org/show_bug.cgi?id=179076
        https://trac.webkit.org/changeset/224497

2017-11-06  Chris Dumez  <cdumez@apple.com>

        ScriptExecutionContext::serviceWorkerContainer() should avoid constructing a Navigator object
        https://bugs.webkit.org/show_bug.cgi?id=179322

        Reviewed by Sam Weinig.

        ScriptExecutionContext::serviceWorkerContainer() should avoid constructing a Navigator object
        unnecessarily.

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::serviceWorkerContainer):
        * page/DOMWindow.h:

2017-11-06  Colin Bendell  <colin@bendell.ca>

        Added mime type check to the picture source preloader to avoid downloading incompatible resources.
        https://bugs.webkit.org/show_bug.cgi?id=179231

        Reviewed by Alex Christensen.

        Test: http/tests/loading/preload-picture-type.html

        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): include type match state when selecting candidate imgs
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): added type attribute evaluation and matching

2017-11-06  Youenn Fablet  <youenn@apple.com>

        Use VCP H264 encoder for platforms supporting it
        https://bugs.webkit.org/show_bug.cgi?id=179076
        rdar://problem/35180773

        Reviewed by Eric Carlson.

        Covered by existing test coverage.

        * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp:
        (WebCore::VideoToolboxVideoEncoderFactory::setActive):
        (WebCore::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder):
        (WebCore::VideoToolboxVideoEncoderFactory::DestroyVideoEncoder):
        * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.h:

2017-11-06  Chris Dumez  <cdumez@apple.com>

        ServiceWorkerContainer should take a PendingActivity while a service worker job is pending
        https://bugs.webkit.org/show_bug.cgi?id=179321

        Reviewed by Youenn Fablet.

        ServiceWorkerContainer should take a PendingActivity while a service worker job is pending.
        ServiceWorkerContainer is an ActiveDOMObject and taking such pending activity makes sure
        the object stays alive while a job is pending (and a promise is not resolved yet). It also
        makes sure the document does not get suspended in the middle of a job.

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::scheduleJob):
        (WebCore::ServiceWorkerContainer::jobDidFinish):

2017-11-06  Antti Koivisto  <antti@apple.com>

        @media rules ignored in user agent style sheet html.css
        https://bugs.webkit.org/show_bug.cgi?id=169245
        <rdar://problem/30885951>

        Reviewed by Darin Adler.

        To support accessibility features, allow non-trivial @media rules in user agent stylesheet.

        This patch creates a special stylesheet consisting of rules with media queries seen on user agent stylesheets.
        The queries on this sheet are evaluated with the document's media query evaluator.

        No tests as I don't want to add things to UA style just for testing purposes. This will
        gain coverage when the feature is used.

         * css/CSSDefaultStyleSheets.cpp:
        (WebCore::CSSDefaultStyleSheets::addToDefaultStyle):

            Add a helper.
            Build a new stylesheet that consists of complex media rules seen in user agent sheets.

        (WebCore::CSSDefaultStyleSheets::loadFullDefaultStyle):
        (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
        * css/CSSDefaultStyleSheets.h:
        * css/DocumentRuleSets.cpp:
        (WebCore::DocumentRuleSets::userAgentMediaQueryStyle const):

            Rule set constructed from media queries seen on UA sheet.

        (WebCore::DocumentRuleSets::updateUserAgentMediaQueryStyleIfNeeded const):

            Evalute the media queries if needed.
            Re-evaluate if the rule count of the media query stylesheet increases
            (this could happen when additional UA style is added).

        (WebCore::DocumentRuleSets::resetUserAgentMediaQueryStyle):
        (WebCore::DocumentRuleSets::collectFeatures const):

            Collect the features from userAgentMediaQueryStyle.

        * css/DocumentRuleSets.h:
        (WebCore::DocumentRuleSets::setIsForShadowScope):
        * css/ElementRuleCollector.cpp:
        (WebCore::ElementRuleCollector::ElementRuleCollector):
        (WebCore::ElementRuleCollector::matchUARules):

            Also match rules in userAgentMediaQueryStyle.

        * css/ElementRuleCollector.h:
        * css/InspectorCSSOMWrappers.cpp:
        (WebCore::InspectorCSSOMWrappers::collectDocumentWrappers):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::StyleResolver):
        * style/StyleScope.cpp:
        (WebCore::Style::Scope::resolver):

2017-11-06  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] Move m_layoutState from RenderView to LayoutContext
        https://bugs.webkit.org/show_bug.cgi?id=179282
        <rdar://problem/35348653>

        Reviewed by Antti Koivisto.

        LayoutContext now owns the top level LayoutState object.
        It makes RenderView behave like any other renderer by constructing a LayoutStateMaintainer on the stack.
        This is mostly moving code from RenderView.h/.cpp to LayoutContext.h/.cpp and fixing the callsites.
        (While view().frameView().layoutContext().layoutState() is a bit lengthy, it's
        temporary only, since LayoutState is planned to be an argument of the layout() method.  

        Covered by existing test.

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::notificationPostTimerFired):
        * page/LayoutContext.cpp:
        (WebCore::LayoutContext::layoutDelta const):
        (WebCore::LayoutContext::addLayoutDelta):
        (WebCore::LayoutContext::layoutDeltaMatches):
        (WebCore::LayoutContext::pushLayoutState):
        (WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
        (WebCore::LayoutContext::popLayoutState):
        (WebCore::LayoutContext::checkLayoutState):
        * page/LayoutContext.h:
        (WebCore::LayoutContext::layoutState const):
        (WebCore::LayoutContext::layoutStateEnabled const):
        (WebCore::LayoutContext::disableLayoutState):
        (WebCore::LayoutContext::enableLayoutState):
        * rendering/LayoutState.cpp:
        (WebCore::LayoutState::LayoutState):
        (WebCore::LayoutState::computeClipRect):
        (WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
        (WebCore::LayoutStateMaintainer::push):
        (WebCore::LayoutStateMaintainer::pop):
        (WebCore::LayoutStateDisabler::LayoutStateDisabler):
        (WebCore::LayoutStateDisabler::~LayoutStateDisabler):
        (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
        (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
        (WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer):
        (WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer):
        * rendering/LayoutState.h:
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::setLogicalLeftForChild):
        (WebCore::RenderBlock::setLogicalTopForChild):
        (WebCore::RenderBlock::layoutPositionedObject):
        (WebCore::RenderBlock::markForPaginationRelayoutIfNeeded):
        (WebCore::RenderBlock::adjustLogicalLeftOffsetForLine const):
        (WebCore::RenderBlock::adjustLogicalRightOffsetForLine const):
        (WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const):
        (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::layoutBlock):
        (WebCore::RenderBlockFlow::layoutBlockChildren):
        (WebCore::RenderBlockFlow::layoutBlockChild):
        (WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
        (WebCore::RenderBlockFlow::estimateLogicalTopPosition):
        (WebCore::RenderBlockFlow::applyBeforeBreak):
        (WebCore::RenderBlockFlow::applyAfterBreak):
        (WebCore::RenderBlockFlow::hasNextPage const):
        (WebCore::RenderBlockFlow::pageLogicalTopForOffset const):
        (WebCore::RenderBlockFlow::pageLogicalHeightForOffset const):
        (WebCore::RenderBlockFlow::pageRemainingLogicalHeightForOffset const):
        (WebCore::RenderBlockFlow::repaintOverhangingFloats):
        (WebCore::RenderBlockFlow::insertFloatingObject):
        (WebCore::RenderBlockFlow::positionNewFloats):
        (WebCore::RenderBlockFlow::layoutSimpleLines):
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::RenderBlockFlow::layoutRunsAndFloats):
        (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
        (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
        (WebCore::RenderBlockFlow::layoutLineBoxes):
        (WebCore::RenderBlockFlow::determineStartPosition):
        (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::outlineBoundsForRepaint const):
        (WebCore::RenderBox::mapLocalToContainer const):
        (WebCore::RenderBox::clippedOverflowRectForRepaint const):
        (WebCore::RenderBox::computeRectForRepaint const):
        (WebCore::RenderBox::offsetFromLogicalTopOfFirstPage const):
        * rendering/RenderDeprecatedFlexibleBox.cpp:
        (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
        (WebCore::layoutChildIfNeededApplyingDelta):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::insertChildInternal):
        (WebCore::RenderElement::takeChildInternal):
        * rendering/RenderEmbeddedObject.cpp:
        * rendering/RenderFragmentedFlow.cpp:
        (WebCore::RenderFragmentedFlow::repaintRectangleInFragments const):
        * rendering/RenderGrid.cpp:
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::clippedOverflowRectForRepaint const):
        (WebCore::RenderInline::computeRectForRepaint const):
        (WebCore::RenderInline::mapLocalToContainer const):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositions):
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::layout):
        * rendering/RenderMediaControlElements.cpp:
        (WebCore::RenderMediaVolumeSliderContainer::layout):
        (WebCore::RenderMediaControlTimelineContainer::layout):
        (WebCore::RenderTextTrackContainerElement::layout):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::repaintRectangle const):
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::clippedOverflowRectForRepaint const):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::layout):
        (WebCore::RenderTable::markForPaginationRelayoutIfNeeded):
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::clippedOverflowRectForRepaint const):
        (WebCore::RenderTableCell::computeRectForRepaint const):
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::layout):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::calcRowLogicalHeight):
        (WebCore::RenderTableSection::layout):
        (WebCore::RenderTableSection::layoutRows):
        (WebCore::RenderTableSection::setLogicalPositionForCell const):
        * rendering/RenderVTTCue.cpp:
        * rendering/RenderView.cpp:
        (WebCore::RenderView::layout):
        (WebCore::RenderView::layoutContent): Deleted.
        (WebCore::RenderView::checkLayoutState): Deleted.
        (WebCore::RenderView::initializeLayoutState): Deleted.
        (WebCore::RenderView::pushLayoutState): Deleted.
        (WebCore::RenderView::pushLayoutStateForPaginationIfNeeded): Deleted.
        * rendering/RenderView.h:
        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::lineSnapAdjustment const):
        * rendering/svg/RenderSVGContainer.cpp:
        (WebCore::RenderSVGContainer::layout):
        * rendering/svg/RenderSVGForeignObject.cpp:
        (WebCore::RenderSVGForeignObject::layout):
        * rendering/svg/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::layout):
        * style/RenderTreeUpdaterFirstLetter.cpp:
        (WebCore::RenderTreeUpdater::FirstLetter::update):
        * style/RenderTreeUpdaterListItem.cpp:
        (WebCore::RenderTreeUpdater::ListItem::updateMarker):

2017-11-05  Yusuke Suzuki  <utatane.tea@gmail.com>

        JIT call inline caches should cache calls to objects with getCallData/getConstructData traps
        https://bugs.webkit.org/show_bug.cgi?id=144458

        Reviewed by Saam Barati.

        * bridge/runtime_method.cpp:
        (JSC::RuntimeMethod::RuntimeMethod):
        (JSC::RuntimeMethod::getCallData): Deleted.
        * bridge/runtime_method.h:

2017-11-06  Maciej Stachowiak  <mjs@apple.com>

        Canonical name of EUC-KR encoding should be EUC-KR, not windows-949
        https://bugs.webkit.org/show_bug.cgi?id=179305

        Reviewed by Alexey Proskuryakov.

        Already covered by:
        LayoutTests/imported/w3c/web-platform-tests/encoding/textdecoder-labels.html
        LayoutTests/imported/w3c/web-platform-tests/encoding/textencoder-constructor-non-utf-expected.html
        LayoutTests/fast/encoding/charset-decode.html
        
        * platform/text/TextCodecICU.cpp: Change registration so the EUC-KR name
        is canonical.
        (WebCore::TextCodecICU::registerCodecs): However, we still want to use the windows-949
        decoder. It's not exactly the same, but the spec calls for that.

2017-11-06  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] CairoGlyphToPathTranslator::path() shouldn't fill out the glyph path
        https://bugs.webkit.org/show_bug.cgi?id=179159

        Reviewed by Michael Catanzaro.

        In case of non-zero synthetic bold offset in CairoGlyphToPathTranslator::path(),
        cairo_glyph_path() should be called just like in the generic case.
        cairo_show_glyphs() performs the actual rasterization of the glyph, but we're
        only interested in the generated path operations.

        No new tests -- covered by existing tests.

        * platform/graphics/cairo/FontCairo.cpp:
        (WebCore::CairoGlyphToPathTranslator::path):

2017-11-05  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] Fix build after r224463
        https://bugs.webkit.org/show_bug.cgi?id=179310

        Unreviewed build fix.

        No new tests (No behavior change).

        * platform/graphics/win/GraphicsContextCairoWin.cpp: Include "GraphicsContextImpl.h".

2017-11-05  Antoine Quint  <graouts@apple.com>

        [Web Animations] Schedule animations registered on the document timeline
        https://bugs.webkit.org/show_bug.cgi?id=179236
        <rdar://problem/35332669>

        Reviewed by Dean Jackson.

        We now schedule animations contained in the document timeline using a three-step approach.

        1. Each time an object that is part of the timing model changes one of its timing properties, we call
           animationTimingModelDidChange() on the document timeline. This schedules performInvalidationTask()
           to be called when the current run loop completes, such that we invalidate the timing model just once
           per run loop.

        2. Once performInvalidationTask() is called, the timing model is invalidated in updateAnimationSchedule().
           We iterate over the registered animations on the timineline and identify the shortest interval between
           the current time and the next moment one of the animations requires a tick to update its value. If we
           find a value below 15ms, we schedule animations to be resolved with scheduleAnimationResolution() right
           away. If the value is above 15ms, and not inifinity, we schedule a one-shot timer for that interval to
           call scheduleAnimationResolution().

        3. Once scheduleAnimationResolution() is called, we call scheduleAnimation() on the shared DisplayRefreshMonitorManager
           to be notified when the next display refresh occurs to actually resolve animations with resolveAnimations().

        Note that, in this patch, resolveAnimations() does nothing, we will add support for interpolating values in
        a future patch.

        Another important thing to note is that every time the document timeline's current time is requested, we cache
        it for the duration of the run loop such that the timing model always uses the same value during a given run loop.

        Finally, to support tests where we check the state of the timing model by manually advancing time, we expose a
        new pause() method on AnimationTimeline for tests to call to avoid the timeline to self-advance.

        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::addAnimation): Mark that the timing model changed as a result of adding an animation.
        (WebCore::AnimationTimeline::removeAnimation): Mark that the timing model changed as a result of removing an animation.
        (WebCore::AnimationTimeline::bindingsCurrentTime): Update the method signature to no longer be const and call into
        currentTime() instead of reading directly from the m_currentTime member variable since a subclass, like DocumentTimeline,
        may have a custom currentTime() implementation.
        (WebCore::AnimationTimeline::setCurrentTime): Mark that the timing model changed as a result of the timeline current time
        changing.
        (WebCore::AnimationTimeline::bindingsCurrentTime const): Deleted.
        * animation/AnimationTimeline.h:
        (WebCore::AnimationTimeline::currentTime): Change both methods signatures to no longer be const so that DocumentTimeline's
        implementation of currentTime() may cache the current time in a member variable, enqueuing a callback when the run loop
        completes for this member variable to be reset, and updating some states.
        (WebCore::AnimationTimeline::pause): To be implemented by subclasses.
        (WebCore::AnimationTimeline::animationTimingModelDidChange): Add a new virtual method to indicate that the timing model
        needs invalidating.
        (WebCore::AnimationTimeline::animations const): Add an accessor to allow animations to be accessed by a subclass.
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::create):
        (WebCore::DocumentTimeline::DocumentTimeline): Update the constructor signature to receive a Document and a PlatformDisplayID
        since we need a reference to the Document to get at the nowTime() and a PlatformDisplayID to create the DisplayRefreshMonitor.
        (WebCore::DocumentTimeline::~DocumentTimeline): Close the task queue when the timeline gets destroyed.
        (WebCore::DocumentTimeline::currentTime): If we don't have a current cahed current time, compute one and schedule
        the invalidation task if needed so that we may reset the cached value as the run loop completes.
        (WebCore::DocumentTimeline::pause): Allows the timeline not to self-advance, for testing purposes only.
        (WebCore::DocumentTimeline::animationTimingModelDidChange): If we haven't already done so, mark that we need to update our
        animation schedule in the invalidation task and schedule that task if not scheduled yet.
        (WebCore::DocumentTimeline::scheduleInvalidationTaskIfNeeded): Schedule the invalidation task to run as the run loop completes
        if we haven't already done so.
        (WebCore::DocumentTimeline::performInvalidationTask): Update the animation schedule if needed and reset the cached current
        time value.
        (WebCore::DocumentTimeline::updateAnimationSchedule): Iterate over registed animations and find the shortest interval until
        one of them needs to update their animation. If the shortest interval is below 15ms, schedule the animation resolution right
        away. If the shortest inverval is finite and above 15ms, then schedule a one-shot timer for that interval to perform the
        animation resolution then. 
        (WebCore::DocumentTimeline::animationScheduleTimerFired): The one-shot timer to perform the animation resolution has fired,
        we call scheduleAnimationResolution().
        (WebCore::DocumentTimeline::scheduleAnimationResolution): We call scheduleAnimation() on the shared DisplayRefreshMonitorManager
        so that we may resolve animations on the next display refresh, or start a timer if the DisplayRefreshMonitorManager is not available.
        (WebCore::DocumentTimeline::displayRefreshFired): The display is about to refresh, we call resolveAnimations().
        (WebCore::DocumentTimeline::animationResolutionTimerFired): The fallback animation resolution timer has fired, we call resolveAnimations().
        (WebCore::DocumentTimeline::resolveAnimations): Currently do nothing, this is where we'll iterate over registered animations to
        update them with the current time.
        (WebCore::DocumentTimeline::windowScreenDidChange): Notify the shared DisplayRefreshMonitorManager that the PlatformDisplayID
        changed.
        (WebCore::DocumentTimeline::createDisplayRefreshMonitor const): Provide a DisplayRefreshMonitor as part of the
        DisplayRefreshMonitorClient protocol. 
        * animation/DocumentTimeline.h:
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::create): Remove extra white space.
        (WebCore::WebAnimation::setStartTime): Mark that the timing model changed as a result of changing this animation's start time.
        (WebCore::WebAnimation::timeToNextRequiredTick const): Compute the interval until the next time we need to resolve this animation.
        If the provided current time is before this animation's start time, compute the delay until the start time. If the current time
        is after the animation's start time but before the animation's end time, indicate that we want to resolve the animation again
        right away and return 0ms. In any other case, return an infinite interval to indicate that we don't need to be refreshed after
        the provided time.
        * animation/WebAnimation.h:
        * dom/Document.cpp:
        (WebCore::Document::windowScreenDidChange): Notify the document timeline that the PlatformDisplayID changed.
        (WebCore::Document::timeline): Provide the Document and the PlatformDisplayID to the DocumentTimeline.
        * testing/Internals.cpp:
        (WebCore::Internals::pauseTimeline):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-11-05  Chris Dumez  <cdumez@apple.com>

        Implement ServiceWorkerRegistration.update()
        https://bugs.webkit.org/show_bug.cgi?id=179270

        Reviewed by Youenn Fablet.

        Implement ServiceWorkerRegistration.update():
        - https://w3c.github.io/ServiceWorker/#service-worker-registration-update

        We already had support for the Update algorithm in SWServerJobQueue but
        this patch enhances our support a bit to get us closer to the specification:
        - https://w3c.github.io/ServiceWorker/#update-algorithm

        No new tests, rebaselined existing tests.

        * workers/service/ServiceWorker.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::updateRegistration):
        (WebCore::ServiceWorkerContainer::getRegistration):
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerJobData.h:
        (WebCore::ServiceWorkerJobData::encode const):
        (WebCore::ServiceWorkerJobData::decode):
        * workers/service/ServiceWorkerJobType.h:
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
        (WebCore::ServiceWorkerRegistration::installing):
        (WebCore::ServiceWorkerRegistration::waiting):
        (WebCore::ServiceWorkerRegistration::active):
        (WebCore::ServiceWorkerRegistration::setInstallingWorker):
        (WebCore::ServiceWorkerRegistration::setWaitingWorker):
        (WebCore::ServiceWorkerRegistration::setActiveWorker):
        (WebCore::ServiceWorkerRegistration::getNewestWorker):
        (WebCore::ServiceWorkerRegistration::update):
        * workers/service/ServiceWorkerRegistration.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptFetchFinished):
        (WebCore::SWServerJobQueue::scriptContextFailedToStart):
        (WebCore::SWServerJobQueue::runNextJobSynchronously):
        (WebCore::SWServerJobQueue::runUpdateJob):

2017-11-04  Simon Fraser  <simon.fraser@apple.com>

        Move code that maps a CompositeOperator and BlendMode to a CGBlendMode into a helper function
        https://bugs.webkit.org/show_bug.cgi?id=179290

        Reviewed by Darin Adler.

        Move the code, and use nested switch rather than conditionals.

        * platform/graphics/GraphicsTypes.h:
        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::selectCGBlendMode):
        (WebCore::GraphicsContext::setPlatformCompositeOperation):

2017-11-04  Chris Dumez  <cdumez@apple.com>

        Index properties on cross origin Window objects should be enumerable
        https://bugs.webkit.org/show_bug.cgi?id=179289

        Reviewed by Darin Adler.

        Index properties on cross origin Window objects should be enumerable:
        - https://github.com/whatwg/html/pull/3186
        - https://github.com/w3c/web-platform-tests/pull/8045

        All exposed properties used to be enumerable but we had to revert this in
        r224287 because it was not Web-compatible. The HTML specification has now
        been updated so that only index properties are enumerable cross origin.

        No new tests, rebaselined existing tests.

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

2017-11-04  Simon Fraser  <simon.fraser@apple.com>

        Add a GraphicsContextImpl and use it for DispayList::Recorder
        https://bugs.webkit.org/show_bug.cgi?id=179286

        Reviewed by Sam Weinig.

        Start moving towards a model when GraphicsContext has a pointer to an implementation
        ("pimpl") by adding GraphicsContextImpl, and converting display list recording to
        be an implementation of a GraphicsContextImpl.

        No behavior change.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
        * platform/graphics/GraphicsContext.cpp:
        (WebCore::GraphicsContext::GraphicsContext):
        (WebCore::GraphicsContext::save):
        (WebCore::GraphicsContext::restore):
        (WebCore::GraphicsContext::setStrokeThickness):
        (WebCore::GraphicsContext::setStrokeStyle):
        (WebCore::GraphicsContext::setStrokeColor):
        (WebCore::GraphicsContext::setShadow):
        (WebCore::GraphicsContext::setLegacyShadow):
        (WebCore::GraphicsContext::clearShadow):
        (WebCore::GraphicsContext::setFillColor):
        (WebCore::GraphicsContext::setShadowsIgnoreTransforms):
        (WebCore::GraphicsContext::setShouldAntialias):
        (WebCore::GraphicsContext::setShouldSmoothFonts):
        (WebCore::GraphicsContext::setShouldSubpixelQuantizeFonts):
        (WebCore::GraphicsContext::setImageInterpolationQuality):
        (WebCore::GraphicsContext::setStrokePattern):
        (WebCore::GraphicsContext::setFillPattern):
        (WebCore::GraphicsContext::setStrokeGradient):
        (WebCore::GraphicsContext::setFillRule):
        (WebCore::GraphicsContext::setFillGradient):
        (WebCore::GraphicsContext::beginTransparencyLayer):
        (WebCore::GraphicsContext::endTransparencyLayer):
        (WebCore::GraphicsContext::drawGlyphs):
        (WebCore::GraphicsContext::drawImage):
        (WebCore::GraphicsContext::drawTiledImage):
        (WebCore::GraphicsContext::setTextDrawingMode):
        (WebCore::GraphicsContext::fillRect):
        (WebCore::GraphicsContext::fillRoundedRect):
        (WebCore::GraphicsContext::setAlpha):
        (WebCore::GraphicsContext::setCompositeOperation):
        (WebCore::GraphicsContext::setDrawLuminanceMask):
        (WebCore::GraphicsContext::applyDeviceScaleFactor):
        (WebCore::GraphicsContext::fillEllipse):
        (WebCore::GraphicsContext::strokeEllipse):
        * platform/graphics/GraphicsContext.h:
        (WebCore::GraphicsContext::hasPlatformContext const):
        (WebCore::GraphicsContext::paintingDisabled const):
        (WebCore::GraphicsContext::setDisplayListRecorder): Deleted.
        (WebCore::GraphicsContext::isRecording const): Deleted.
        * platform/graphics/GraphicsContextImpl.cpp: Added.
        (WebCore::GraphicsContextImpl::GraphicsContextImpl):
        (WebCore::GraphicsContextImpl::~GraphicsContextImpl):
        * platform/graphics/GraphicsContextImpl.h: Added.
        (WebCore::GraphicsContextImpl::graphicsContext const):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::recursiveCommitChanges):
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::getCTM const):
        (WebCore::GraphicsContext::savePlatformState):
        (WebCore::GraphicsContext::restorePlatformState):
        (WebCore::GraphicsContext::drawRect):
        (WebCore::GraphicsContext::drawNativeImage):
        (WebCore::GraphicsContext::drawLine):
        (WebCore::GraphicsContext::drawEllipse):
        (WebCore::GraphicsContext::fillPath):
        (WebCore::GraphicsContext::strokePath):
        (WebCore::GraphicsContext::fillRect):
        (WebCore::GraphicsContext::clip):
        (WebCore::GraphicsContext::clipPath):
        (WebCore::GraphicsContext::clipBounds const):
        (WebCore::GraphicsContext::drawLinesForText):
        (WebCore::GraphicsContext::roundToDevicePixels):
        (WebCore::GraphicsContext::translate):
        (WebCore::GraphicsContext::setPlatformStrokeThickness):
        (WebCore::GraphicsContext::setPlatformStrokeStyle):
        (WebCore::GraphicsContext::concatCTM):
        (WebCore::GraphicsContext::setCTM):
        (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
        (WebCore::GraphicsContext::endPlatformTransparencyLayer):
        (WebCore::GraphicsContext::clearRect):
        (WebCore::GraphicsContext::strokeRect):
        (WebCore::GraphicsContext::setLineCap):
        (WebCore::GraphicsContext::setLineDash):
        (WebCore::GraphicsContext::setLineJoin):
        (WebCore::GraphicsContext::setMiterLimit):
        (WebCore::GraphicsContext::clipOut):
        (WebCore::GraphicsContext::rotate):
        (WebCore::GraphicsContext::scale):
        (WebCore::GraphicsContext::platformFillRoundedRect):
        (WebCore::GraphicsContext::fillRectWithRoundedHole):
        (WebCore::GraphicsContext::drawPattern):
        (WebCore::GraphicsContext::setPlatformShouldAntialias):
        (WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
        (WebCore::GraphicsContext::isAcceleratedContext const):
        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::savePlatformState):
        (WebCore::GraphicsContext::restorePlatformState):
        (WebCore::GraphicsContext::drawNativeImage):
        (WebCore::GraphicsContext::drawPattern):
        (WebCore::GraphicsContext::drawRect):
        (WebCore::GraphicsContext::drawLine):
        (WebCore::GraphicsContext::drawEllipse):
        (WebCore::GraphicsContext::applyStrokePattern):
        (WebCore::GraphicsContext::applyFillPattern):
        (WebCore::GraphicsContext::drawPath):
        (WebCore::GraphicsContext::fillPath):
        (WebCore::GraphicsContext::strokePath):
        (WebCore::GraphicsContext::fillRect):
        (WebCore::GraphicsContext::platformFillRoundedRect):
        (WebCore::GraphicsContext::fillRectWithRoundedHole):
        (WebCore::GraphicsContext::clip):
        (WebCore::GraphicsContext::clipOut):
        (WebCore::GraphicsContext::clipPath):
        (WebCore::GraphicsContext::clipBounds const):
        (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
        (WebCore::GraphicsContext::endPlatformTransparencyLayer):
        (WebCore::GraphicsContext::setPlatformShadow):
        (WebCore::GraphicsContext::setMiterLimit):
        (WebCore::GraphicsContext::clearRect):
        (WebCore::GraphicsContext::strokeRect):
        (WebCore::GraphicsContext::setLineCap):
        (WebCore::GraphicsContext::setLineDash):
        (WebCore::GraphicsContext::setLineJoin):
        (WebCore::GraphicsContext::scale):
        (WebCore::GraphicsContext::rotate):
        (WebCore::GraphicsContext::translate):
        (WebCore::GraphicsContext::concatCTM):
        (WebCore::GraphicsContext::setCTM):
        (WebCore::GraphicsContext::getCTM const):
        (WebCore::GraphicsContext::roundToDevicePixels):
        (WebCore::GraphicsContext::drawLinesForText):
        (WebCore::GraphicsContext::setURLForRect):
        (WebCore::GraphicsContext::setIsCALayerContext):
        (WebCore::GraphicsContext::isCALayerContext const):
        (WebCore::GraphicsContext::setIsAcceleratedContext):
        (WebCore::GraphicsContext::isAcceleratedContext const):
        (WebCore::GraphicsContext::setPlatformTextDrawingMode):
        (WebCore::GraphicsContext::setPlatformStrokeColor):
        (WebCore::GraphicsContext::setPlatformStrokeThickness):
        (WebCore::GraphicsContext::setPlatformFillColor):
        (WebCore::GraphicsContext::setPlatformShouldAntialias):
        (WebCore::GraphicsContext::setPlatformShouldSmoothFonts):
        (WebCore::GraphicsContext::setPlatformAlpha):
        (WebCore::GraphicsContext::setPlatformCompositeOperation):
        (WebCore::GraphicsContext::platformApplyDeviceScaleFactor):
        (WebCore::GraphicsContext::platformFillEllipse):
        (WebCore::GraphicsContext::platformStrokeEllipse):
        (WebCore::GraphicsContext::setDestinationForRect):
        (WebCore::GraphicsContext::addDestinationAtPoint):
        * platform/graphics/cocoa/GraphicsContextCocoa.mm:
        (WebCore::GraphicsContext::drawFocusRing):
        * platform/graphics/displaylists/DisplayListRecorder.cpp:
        (WebCore::DisplayList::Recorder::Recorder):
        (WebCore::DisplayList::Recorder::updateItemExtent const):
        (WebCore::DisplayList::Recorder::extentFromLocalBounds const):
        * platform/graphics/displaylists/DisplayListRecorder.h:
        (WebCore::DisplayList::Recorder::itemCount const):
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::paint):

2017-11-04  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] Move all LayoutState* classes to LayoutState.h/cpp
        https://bugs.webkit.org/show_bug.cgi?id=179280
        <rdar://problem/35348452>

        Reviewed by Antti Koivisto.

        No change in functionality.

        * page/LayoutContext.cpp:
        (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer): Deleted.
        (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer): Deleted.
        (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree): Deleted.
        * rendering/LayoutState.cpp:
        (WebCore::LayoutStateMaintainer::LayoutStateMaintainer):
        (WebCore::LayoutStateMaintainer::~LayoutStateMaintainer):
        (WebCore::LayoutStateMaintainer::push):
        (WebCore::LayoutStateMaintainer::pop):
        (WebCore::LayoutStateDisabler::LayoutStateDisabler):
        (WebCore::LayoutStateDisabler::~LayoutStateDisabler):
        (WebCore::shouldDisableLayoutStateForSubtree):
        (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
        (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
        (WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer):
        (WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer):
        * rendering/LayoutState.h:
        (WebCore::LayoutStateMaintainer::didPush const):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer): Deleted.
        (WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer): Deleted.
        (): Deleted.
        * rendering/RenderView.h:
        (WebCore::LayoutStateMaintainer::LayoutStateMaintainer): Deleted.
        (WebCore::LayoutStateMaintainer::~LayoutStateMaintainer): Deleted.
        (WebCore::LayoutStateMaintainer::push): Deleted.
        (WebCore::LayoutStateMaintainer::pop): Deleted.
        (WebCore::LayoutStateMaintainer::didPush const): Deleted.
        (WebCore::LayoutStateDisabler::LayoutStateDisabler): Deleted.
        (WebCore::LayoutStateDisabler::~LayoutStateDisabler): Deleted.

2017-11-04  Zalan Bujtas  <zalan@apple.com>

        [LayoutState cleanup] Move offset/cliprect/pagination code to dedicate methods
        https://bugs.webkit.org/show_bug.cgi?id=179279
        <rdar://problem/35348171>

        Reviewed by Antti Koivisto.

        This is in preparation for creating the initial LayoutSate through LayoutStateMaintainer.

        Moving code around. No change in functionality.

        * rendering/LayoutState.cpp:
        (WebCore::LayoutState::LayoutState):
        (WebCore::LayoutState::computeOffsets):
        (WebCore::LayoutState::computeClipRect):
        (WebCore::LayoutState::computePaginationInformation):
        * rendering/LayoutState.h:

2017-11-01  Darin Adler  <darin@apple.com>

        Simplify event dispatch code and make it a bit more consistent
        https://bugs.webkit.org/show_bug.cgi?id=178991

        Reviewed by Chris Dumez.

        Straighten out event dispatch code in three ways:

        1) Add an Event::resetAfterDispatch function, and use it instead of the multiple
           separate functions that were used before to reset after dispatching. This fixed
           an extremely minor bug where we would leave some kinds of state on some event
           objects in unusual cases after dispatching the events.

        2) Remove IDBEventDispatcher and make its callers use EventDispatcher instead.
           This leaves us with one less event dispatch code path to maintain, more shared code.

        3) Remove boolean return values from functions that take event objects and
           dispatch the events. The return values are redundant with various things that
           can be checked by looking at the event itself. The legacy return value indicates
           whether the event has its "canceled flag" set, which means that the default
           behavior should be prevented. If that is what we need to check, it's easier
           to read the code and see that it's correct if it calls the named function
           "defaultPrevented" directly. More importantly, callers can also call whatever
           other function is appropriate to ask the specific relevant question to their needs.
           The general rule is that default behavior that we want to allow even with an
           untrusted event can be inside a default event handler function. Default behavior
           that should only happen for the browser-generated event can and should be done
           after dispatching the event, in the code that dispatches it; but that requires
           explicitly checking "defaultPrevented".

        * Modules/indexeddb/IDBDatabase.cpp:
        (WebCore::IDBDatabase::dispatchEvent): Removed boolean return value.
        * Modules/indexeddb/IDBDatabase.h: Ditto.

        * Modules/indexeddb/IDBEventDispatcher.cpp: Removed.
        * Modules/indexeddb/IDBEventDispatcher.h: Removed.

        * Modules/indexeddb/IDBOpenDBRequest.cpp:
        (WebCore::IDBOpenDBRequest::dispatchEvent): Removed boolean return value.
        Added protection for "this" since the function accesses it after dispatching the event.
        * Modules/indexeddb/IDBOpenDBRequest.h: Ditto.

        * Modules/indexeddb/IDBRequest.cpp:
        (WebCore::IDBRequest::dispatchEvent): Removed boolean return value. Instead of using
        IDBEventDispatcher, use EventDispatcher's new function that takes an initializer_list
        with a list of event targets. Added protection for "this" since the function accesses
        it after dispatching the event.
        * Modules/indexeddb/IDBRequest.h: Ditto.
        * Modules/indexeddb/IDBTransaction.cpp:
        (WebCore::IDBTransaction::dispatchEvent): Ditto.
        * Modules/indexeddb/IDBTransaction.h: Ditto.

        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::dispatchEvent): Removed boolean return value.
        * Modules/mediastream/RTCPeerConnection.h: Ditto.
        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::PaymentRequest::shippingAddressChanged): Don't dispatch an event if
        m_isUpdating is true; preserves behavior that was implemented in
        PaymentRequest::dispatchEvent before. Since this is the source of the trusted
        event, cleaner to implement the rule here instead of overriding dispatchEvent.
        (WebCore::PaymentRequest::shippingOptionChanged): Ditto.
        (WebCore::PaymentRequest::dispatchEvent): Deleted.
        * Modules/paymentrequest/PaymentRequest.h: Ditto.

        * Sources.txt: Removed IDBEventDispatcher.cpp.
        * WebCore.xcodeproj/project.pbxproj: Removed IDBEventDispatcher.h/cpp.

        * dom/Element.cpp:
        (WebCore::Element::dispatchMouseEvent): Updated to call defaultPrevented
        directly instead of using the return value of dispatchEvent.
        (WebCore::Element::dispatchWheelEvent): Ditto.
        (WebCore::Element::dispatchKeyEvent): Ditto.
        (WebCore::Element::dispatchFocusInEvent): Removed assertion, since the
        underlying event dispatching takes care of it.
        (WebCore::Element::dispatchFocusOutEvent): Ditto.
        (WebCore::Element::dispatchFocusEvent): Call dispatchEvent instead of
        calling EventDispatcher::dispatchEvent. There is no good reason to use
        EventDispatcher directly.
        (WebCore::Element::dispatchBlurEvent): Ditto.

        * dom/Event.cpp:
        (WebCore::Event::eventInterface const): Deleted. Moved into header since this is
        short and if called in a non-polymorphic context it's good to have it be inlined.
        (WebCore::Event::isUIEvent const): Ditto.
        (WebCore::Event::isMouseEvent const): Ditto.
        (WebCore::Event::isFocusEvent const): Ditto.
        (WebCore::Event::isKeyboardEvent const): Ditto.
        (WebCore::Event::isInputEvent const): Ditto.
        (WebCore::Event::isCompositionEvent const): Ditto.
        (WebCore::Event::isTouchEvent const): Ditto.
        (WebCore::Event::isClipboardEvent const): Ditto.
        (WebCore::Event::isBeforeTextInsertedEvent const): Ditto.
        (WebCore::Event::isBeforeUnloadEvent const): Ditto.
        (WebCore::Event::isErrorEvent const): Ditto.
        (WebCore::Event::isTextEvent const): Ditto.
        (WebCore::Event::isWheelEvent const): Ditto.
        (WebCore::Event::receivedTarget): Ditto.
        (WebCore::Event::resetAfterDispatch): Added. Replaces functions like
        clearEventPath and resetPropagationFlags, covering all the things we need to clear
        after dispatching an event.

        * dom/Event.h: Removed some unneeded includes and forward declarations. Moved bodies
        of multi-line inline member functions out of the class definition. Changed argument
        type of setEventPhase and m_eventPhase to an enum rather than just an integer, since
        only the getter is for use from the bindings. Removed clearEventPath, srcElement, and
        resetPropagationFlags. Sorted the isXXX functions alphabetically and removed previous
        attempts to make categories out of them. Marked the constructor explicit since it has
        a single argument. Moved trivially short bodies into the class definition.

        * dom/Event.idl: Use ImplementedAs to implement srcElement so we don't need it in
        the C++ code.

        * dom/EventContext.cpp:
        (WebCore::EventContext::EventContext): Removed assertion since we now handle event
        contexts without nodes so we can use this to dispatch events for IDB, for example.
        (WebCore::EventContext::handleLocalEvents const): Add code to handle non-node event
        targets by calling fireEventListeners directly.
        (WebCore::MouseOrFocusEventContext::MouseOrFocusEventContext): Take a reference
        insetad of a pointer for the node.
        (WebCore::TouchEventContext::TouchEventContext): Ditto.
        (WebCore::TouchEventContext::handleLocalEvents const): Streamline a bit by improving
        the checkReachability function to be easier to call. Also removed an unneeded assertion
        just before calling downcast<>, the same assertion that downcast<> itself does.
        (WebCore::TouchEventContext::checkReachability const): Chagned argument type to take
        a Ref& so the caller doesn't have to call get() or ptr().

        * dom/EventContext.h: Removed unneeded FIXME and currentTargetSameAsTarget function.
        Changed arguemnt types to use Node& instead of Node* as appropriate. Removed unused
        functions from TouchEventContext, made more private, and changed data members to Ref
        instead of RefPtr. Removed unused NotTouchList value from TouchListType enumeration.
        Changed touchList function to return a reference instead of a pointer.

        * dom/EventDispatcher.cpp: Removed unneeded includes.
        (WebCore::dispatchEventInDOM): Removed use of currentTargetSameAsTarget since it's
        clearer if written out.
        (WebCore::EventDispatcher::dispatchEvent): Changed no-event dispatch assertion to
        use RELEASE_ASSERT_WITH_SECURITY_IMPLICATION since the style checker says so, but
        it still doesn't assert anything in release builds because the check in
        NoEventDispatchAssertion itself is debug-only. Moved the calls to EventPath's
        setRelatedTarget and retargetTouchLists functions inside the EventPath constructor.
        Removed the second no-event dispatch assertion because we only need one. Replaced
        calls to clearEventPath, setCurrentTarget(nullptr), resetPropagationFlags,
        and setEventPhase(NONE) and with a call to resetAfterDispatch. Moved the code that
        temporarily sets the target to a different value when calling default event handlers
        into the block that calls the default event handlers. Added a new overload that
        takes an initializer list of event targets so we can dispatch events that are not
        being sent to nodes.

        * dom/EventDispatcher.h: Fixed misleading copyright dates and names since this file
        just contains a couple of function declarations. Added new overload of dispatchEvent.

        * dom/EventPath.cpp:
        (WebCore::WindowEventContext::WindowEventContext): Take references instead of pointers.
        (WebCore::EventPath::EventPath): Moved the bulk of construction into a new function
        named buildPath, so it can still use "return" without skipping the additions here.
        Added calls to setRelatedTarget and retargetTouchLists and now both can be private.
        Also added a new overload that takes event targets that are not nodes.
        (WebCore::EventPath::buildPath): Added. Contains what used to be in the constructor.
        But use some references instead of pointers and refactor a bit using lambdas.
        (WebCore::EventPath::retargetTouchList): Added. Makes the retargetTouchLists function
        shorter and less repetetive.
        (WebCore::EventPath::retargetTouchLists): Updated to call retargetTouchList.
        (WebCore::EventPath::hasEventListeners const): Deleted. This was unused.
        * dom/EventPath.h: Added a constructor that takes an initializer list of event targets.
        Made retargetTouchEvents and setRelatedTarget private and used them in the constructor
        insead of expecting clients to call them. Removed unused hasEventListeners and
        lastContextIfExists functions. Moved body of the eventTargetRespectingTargetRules
        function out of the class definition.

        * dom/EventTarget.cpp:
        (WebCore::EventTarget::dispatchEventForBindings): Updated so it does not expect
        dispatchEvent to return a boolean. Instead call a function on the event after dispatching.
        Decided to use legacyReturnValue instead of !defaultPrevented, because this is exactly
        the return value that the returnValue property is referring to.
        (WebCore::EventTarget::dispatchEvent): Removed return value. Replaced calls to
        resetPropagationFlags and setEventPhase(NONE) with a call to resetAfterDispatch.
        I noticed that there was a local boolean here named "defaultPrevented", which was
        backwards; the value in that local was "default not prevented". Doesn't matter since
        the boolean return value was removed.
        (WebCore::EventTarget::fireEventListeners): Removed the boolean return value.

        * dom/EventTarget.h: Added initial values to members of ListenerOptions and
        AddEventListenerOptions; maybe we can get rid of the constructors some day.
        Removed booelan return values from dispatchEvent and fireEventListeners.

        * dom/KeyboardEvent.cpp: Removed unneeded include of EventDispatcher.h.

        * dom/Node.cpp:
        (WebCore::Node::dispatchEvent): Got rid of boolean return value.
        Removed special case code that sometimes called dispatchTouchEvent, since that
        just turns around and calls EventDispatcher::dispatchEvent just like this function.
        (WebCore::Node::dispatchDOMActivateEvent): Removed boolean return value, removed
        integer detail argument and moved the logic to compute the value of the detail
        peroprty and to call setDefaultHandled on the underlying click event in here.
        This is a private helper function used only in one place.
        (WebCore::Node::dispatchTouchEvent): Deleted.
        (WebCore::Node::defaultEventHandler): Updated for change to dispatchDOMActivateEvent.
        * dom/Node.h: Updated for the above changes.

        * dom/RejectedPromiseTracker.cpp:
        (WebCore::RejectedPromiseTracker::reportUnhandledRejections): Use defaultPrevented
        directly instead of the return value from dispatchEvent.

        * dom/ScopedEventQueue.cpp:
        (WebCore::ScopedEventQueue::enqueueEvent): Moved assertions here ...
        (WebCore::ScopedEventQueue::dispatchEvent const): ... from here. Also changed this
        to call Node::dispatchEvent instead of calling EventDispatcher::dispatchEvent directly.

        * dom/SimulatedClick.cpp:
        (WebCore::simulateMouseEvent): Call Element::dispatchEvent instead of calling
        EventDispatcher::dispatchEvent directly.

        * editing/Editor.cpp:
        (WebCore::dispatchBeforeInputEvent): Use defaultPrevented directly instead of the
        return value from dispatchEvent.
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::selectAll): Ditto.
        (WebCore::FrameSelection::dispatchSelectStart): Ditto.

        * html/CheckboxInputType.cpp:
        (WebCore::CheckboxInputType::didDispatchClick): Take a reference instead of a pointer.
        * html/CheckboxInputType.h: Updated for above and to use final instead of override.

        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::checkValidity): Use defaultPrevented directly instead
        of the return value from dispatchEvent.

        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::prepareForSubmission): Use defaultPrevented directly instead
        of the return value from dispatchEvent.
        (WebCore::HTMLFormElement::reset): Ditto.

        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::didDispatchClickEvent): Updated to pass references instead
        of pointer.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::dispatchEvent): Got rid of boolean return value.
        * html/HTMLMediaElement.h: Ditto.

        * html/HTMLPlugInElement.h: Use "delete" instead of just a private function for something
        that should never be called.

        * html/InputType.cpp:
        (WebCore::InputType::didDispatchClick): Take a reference instead of a pointer.
        * html/InputType.h: Ditto.
        * html/RadioInputType.cpp:
        (WebCore::RadioInputType::didDispatchClick): Ditto.
        * html/RadioInputType.h: Updated for above and to use final instead of override.

        * html/track/TextTrackCue.cpp:
        (WebCore::TextTrackCue::dispatchEvent): Got rid of boolean return value.
        * html/track/TextTrackCue.h: Ditto.

        * inspector/InspectorInstrumentation.cpp: Removed unneeded include of EventDispatcher.h.

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::dispatchLoadEvent): Streamlined code a bit so we only have a single
        call to dispatchEvent. Improved comments.
        (WebCore::DOMWindow::dispatchEvent): Removed return value. Added comments. Replaced
        calls to setCurrentTarget(null), setEventPhase(NONE), and resetPropagationFlags with
        a call to resetAfterDispatch.
        * page/DOMWindow.h: Updated to get rid of the boolean return value.

        * page/DragController.cpp:
        (WebCore::DragController::dispatchTextInputEventFor): Use defaultPrevented directly instead
        of the return value from dispatchEvent.

        * page/EventHandler.cpp:
        (WebCore::dispatchSelectStart): Use defaultPrevented directly instead
        of the return value from dispatchEvent.
        (WebCore::EventHandler::accessibilityPreventsEventPropagation): Fixed spelling error in the
        name of this function.
        (WebCore::EventHandler::dispatchDragSrcEvent): Got rid of boolean return value.
        (WebCore::EventHandler::handleTouchEvent): Call dispatchEvent instead of dispatchTouchEvent;
        there was no difference between the two except that dispatchTouchEvent required downcasting
        and might some day lead to us missing some behavior implemented in an override to dispatchEvent.
        * page/EventHandler.h: Updated for above changes.

        * platform/graphics/filters/FilterOperation.h:
        (WebCore::FilterOperation::clone): Removed dead code that was causing a compiler warning.

        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject): Use defaultPrevented
        directly instead of the return value from dispatchEvent.

2017-11-04  Aishwarya Nirmal  <anirmal@apple.com>

        [Touch Bar Web API] Add support for menuitem tag
        https://bugs.webkit.org/show_bug.cgi?id=179020

        Reviewed by Ryosuke Niwa.

        The Touch Bar Web API will make use of the menu and menuitem tags
        to represent the NSTouchBar and NSTouchBarItem respectively.
        Since WebKit currently does not offer support for the menuitem tag,
        this change adds it in. There is a runtime flag for this tag, which
        is set to false by default.

        A specification for the menuitem element can be found at
        https://www.w3.org/TR/2013/WD-html51-20130528/interactive-elements.html#the-menuitem-element.
        More attributes of this element will be implemented in future patches.

        Test: fast/html/menuitem-element.html

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/WebCoreBuiltinNames.h:
        * html/HTMLElementsAllInOne.cpp:
        * html/HTMLMenuItemElement.cpp: Added.
        (WebCore::HTMLMenuItemElement::HTMLMenuItemElement):
        (WebCore::HTMLMenuItemElement::create):
        * html/HTMLMenuItemElement.h: Added.
        * html/HTMLMenuItemElement.idl: Added.
        * html/HTMLTagNames.in:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setMenuItemElementEnabled):
        (WebCore::RuntimeEnabledFeatures::menuItemElementEnabled const):

2017-11-03  Zalan Bujtas  <zalan@apple.com>

        LayoutState should take RenderBox reference.
        https://bugs.webkit.org/show_bug.cgi?id=179272
        <rdar://problem/35345247>

        Reviewed by Simon Fraser.

        No change in functionality.

        * rendering/LayoutState.cpp:
        (WebCore::LayoutState::LayoutState):
        (WebCore::LayoutState::propagateLineGridInfo):
        (WebCore::LayoutState::establishLineGrid):
        * rendering/LayoutState.h: type tightening.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const):
        * rendering/RenderView.cpp:
        (WebCore::RenderView::pushLayoutState):
        * rendering/RenderView.h:

2017-11-03  Youenn Fablet  <youenn@apple.com>

        Implement ServiceWorkerContainer.getRegistration
        https://bugs.webkit.org/show_bug.cgi?id=179253

        Reviewed by Chris Dumez.

        Test: http/tests/workers/service/service-worker-getRegistration.html

        Added a map of ServiceWorkerRegistration in ServiceWorkerContainer.
        Removing a similar map from SWClientConnection as it is more convenient to have this map per ScriptExecutionContext.

        This map allows returning the same JS object for different getRegistration.
        Delegating the actual matching to SWServer::Connection which is implemented on the StorageProcess through IPC.

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::getRegistration):
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        (WebCore::ServiceWorkerContainer::jobDidFinish):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerContainer.idl:
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
        (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
        * workers/service/ServiceWorkerRegistration.h:
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::updateRegistrationState):
        (WebCore::SWClientConnection::addServiceWorkerRegistration): Deleted.
        (WebCore::SWClientConnection::removeServiceWorkerRegistration): Deleted.
        * workers/service/server/SWClientConnection.h:

2017-11-03  Chris Dumez  <cdumez@apple.com>

        [iOS-WK1] Fix thread safety issue in WebSQLiteDatabaseTrackerClient
        https://bugs.webkit.org/show_bug.cgi?id=179190

        Reviewed by David Kilzer.

        WebSQLiteDatabaseTrackerClient and its HystererisActivity member are constructed on the UIThread. The
        HystererisActivity activity also fires on the UIThread, which means that WebSQLiteDatabaseTrackerClient::hysteresisUpdated()
        gets called on the UIThread.

        However, the code in WebSQLiteDatabaseTrackerClient::willBeginFirstTransaction() / WebSQLiteDatabaseTrackerClient::didFinishLastTransaction()
        uses callOnMainThread() before calling methods on the HysteresisActivity. callOnMainThread() dispatches to the WebThread on WK1 iOS, which
        would lead to crashes when calling methods of the HystererisActivity object:
        *** -[CFRunLoopTimer respondsToSelector:]: message sent to deallocated instance 0x1c0b6a500

        To address the issue, we now dispatch_async() to the main queue in willBeginFirstTransaction() / didFinishLastTransaction()
        instead of using callOnMainThread(). I also added assertions to catch issues like these.

        * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
        (WebCore::WebSQLiteDatabaseTrackerClient::willBeginFirstTransaction):
        (WebCore::WebSQLiteDatabaseTrackerClient::didFinishLastTransaction):
        (WebCore::WebSQLiteDatabaseTrackerClient::hysteresisUpdated):

2017-11-03  Ryosuke Niwa  <rniwa@webkit.org>

        ASSERTION FAILED: NoEventDispatchAssertion::InMainThread::isEventAllowed() || (frameView && frameView->isInChildFrameWithFrameFlattening())
        https://bugs.webkit.org/show_bug.cgi?id=179259

        Reviewed by Youenn Fablet.

        Avoid updating the layout inside HTMLMediaElement::stop() and MediaElementSession::~MediaElementSession

        No new tests since existing tests cover this.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::userCancelledLoad): Don't update VTT cues when the active DOM objects are being stopped.
        * platform/audio/mac/MediaSessionManagerMac.mm:
        (WebCore::MediaSessionManagerMac::removeSession): Update the updateNowPlayingInfo asynchronously
        since this function can be called inside HTMLMediaElement::~HTMLMediaElement.

2017-11-03  Alex Christensen  <achristensen@webkit.org>

        Add WEBCORE_EXPORT to CachedResourceHandleBase
        https://bugs.webkit.org/show_bug.cgi?id=179251

        * loader/cache/CachedResourceHandle.h:
        (WebCore::CachedResourceHandleBase::get const): Deleted.
        (WebCore::CachedResourceHandleBase::operator! const): Deleted.
        (WebCore::CachedResourceHandleBase::operator UnspecifiedBoolType const): Deleted.
        (WebCore::CachedResourceHandleBase::operator=): Deleted.
        I'll need this soon for bug 179251, and having to touch CachedResourceHandle.h causes me to rebuild everything.
        Committing it separately greatly increases my debugging and comparison speed.

2017-11-03  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r224428, r224435, and r224440.
        https://bugs.webkit.org/show_bug.cgi?id=179274

        Broke iOS and internal builds (Requested by ryanhaddad on
        #webkit).

        Reverted changesets:

        "Use VCP H264 encoder for platforms supporting it"
        https://bugs.webkit.org/show_bug.cgi?id=179076
        https://trac.webkit.org/changeset/224428

        "Use VCP H264 encoder for platforms supporting it"
        https://bugs.webkit.org/show_bug.cgi?id=179076
        https://trac.webkit.org/changeset/224435

        "Use VCP H264 encoder for platforms supporting it"
        https://bugs.webkit.org/show_bug.cgi?id=179076
        https://trac.webkit.org/changeset/224440

2017-11-03  Youenn Fablet  <youenn@apple.com>

        Requests handled by Service Worker should not go through preflighting
        https://bugs.webkit.org/show_bug.cgi?id=179250

        Reviewed by Alex Christensen.

        Test: http/tests/workers/service/service-worker-crossorigin-fetch.html
        In case of cross origin requests needed preflighting that may be served through SW, the following is done:
        - Bypass preflight
        - Put service workers mode as Only so that if SW is not handling the request, the load will fail
        - If load fails, restart DocumentThreadableLoader load with preflight.

        Additional testing should be added when we properly handle the case where no fetch event handler is registered in the service worker.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
        (WebCore::DocumentThreadableLoader::didFail):
        * loader/DocumentThreadableLoader.h:
        * loader/ResourceLoaderOptions.h:
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
        * platform/network/ResourceErrorBase.h:

2017-11-03  Zalan Bujtas  <zalan@apple.com>

        Remove redundant LayoutStateMaintainer argument (RenderView&)
        https://bugs.webkit.org/show_bug.cgi?id=179269
        <rdar://problem/35344397>

        Reviewed by Simon Fraser.

        No change in functionality.

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::simplifiedLayout):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::layoutBlock):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::layout):
        * rendering/RenderDeprecatedFlexibleBox.cpp:
        (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
        * rendering/RenderEmbeddedObject.cpp:
        (WebCore::RenderEmbeddedObject::layout):
        * rendering/RenderFlexibleBox.cpp:
        (WebCore::RenderFlexibleBox::layoutBlock):
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::layoutBlock):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::layoutShadowControls):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::layout):
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::layout):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::layout):
        (WebCore::RenderTableSection::layoutRows):
        * rendering/RenderVTTCue.cpp:
        (WebCore::RenderVTTCue::layout):
        * rendering/RenderView.h:
        (WebCore::LayoutStateMaintainer::LayoutStateMaintainer):

2017-11-03  Youenn Fablet  <youenn@apple.com>

        Use VCP H264 encoder for platforms supporting it
        https://bugs.webkit.org/show_bug.cgi?id=179076
        rdar://problem/35180773

        Reviewed by Eric Carlson.

        Covered by existing test coverage.

        * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp:
        (WebCore::VideoToolboxVideoEncoderFactory::setActive):
        (WebCore::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder):
        (WebCore::VideoToolboxVideoEncoderFactory::DestroyVideoEncoder):
        * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.h:

2017-11-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Fix build after r224373
        https://bugs.webkit.org/show_bug.cgi?id=179265

        Unreviewed build fix.

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

2017-11-03  Brady Eidson  <beidson@apple.com>

        Remove an invalid ASSERT that is seen intermittently.
        https://bugs.webkit.org/show_bug.cgi?id=179186

        Unreviewed.

        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::removeClientServiceWorkerRegistration): This is an invalid ASSERT,
          it's definitely racey over IPC.

2017-11-03  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] Remove unneeded USE(LIBEPOXY) guards
        https://bugs.webkit.org/show_bug.cgi?id=179228

        Reviewed by Carlos Garcia Campos.

        USE(LIBEPOXY) is already mandatory for WPE.

        * platform/graphics/egl/GLContextEGLWPE.cpp:
        * platform/graphics/wpe/PlatformDisplayWPE.cpp:

2017-11-03  Ali Juma  <ajuma@chromium.org>

        Layout viewport rect is too wide after window resize
        https://bugs.webkit.org/show_bug.cgi?id=175235

        Fix a formatting mistake that was introduced by r224241.

        Reviewed by Simon Fraser.

        No change in behavior.

        * platform/ScrollView.cpp:
        (WebCore::ScrollView::updateScrollbars):

2017-11-03  Youenn Fablet  <youenn@apple.com>

        Implement Service Worker Matching Registration algorithm
        https://bugs.webkit.org/show_bug.cgi?id=178882

        Reviewed by Chris Dumez.

        Test: http/tests/workers/service/service-worker-clear.html

        Adding support for scope as part of the ServiceWorkerRegistrationKey to disambiguate several service workers registered with different scopes.
        Adding the Service Worker Registration algorithm in SWServer and adding internals API to test it.
        Making ServiceWorkerRegistrationKey a class to protect its internal field to be reused in wrong places.

        Added preliminary support for clearing service workers for a given session ID as this is needed by WTR for stable testing.

        * testing/Internals.cpp:
        (WebCore::Internals::hasServiceWorkerRegistration):
        * testing/Internals.h:
        * testing/Internals.idl:
        * workers/service/ServiceWorkerJobData.cpp:
        (WebCore::ServiceWorkerJobData::registrationKey const):
        * workers/service/ServiceWorkerRegistration.h:
        * workers/service/ServiceWorkerRegistrationKey.cpp:
        (WebCore::ServiceWorkerRegistrationKey::hash const):
        (WebCore::ServiceWorkerRegistrationKey::operator== const):
        (WebCore::ServiceWorkerRegistrationKey::isolatedCopy const):
        * workers/service/ServiceWorkerRegistrationKey.h:
        (WebCore::ServiceWorkerRegistrationKey::encode const):
        (WebCore::ServiceWorkerRegistrationKey::decode):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::clear):
        (WebCore::SWServer::doRegistrationMatching const):
        * workers/service/server/SWServer.h:
        (WebCore::SWServer::Connection::doRegistrationMatching const):
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::~SWServerJobQueue):
        * workers/service/server/SWServerRegistration.h:

2017-11-02  Dean Jackson  <dino@apple.com>

        Add basic OffscreenCanvas interface
        https://bugs.webkit.org/show_bug.cgi?id=179213
        <rdar://problem/35326778>

        Reviewed by Sam Weinig.

        Add the basic infrastructure for the OffscreenCanvas
        object, so it can be created from script.

        Test: http/wpt/offscreen-canvas/offscreencanvas.constructor.html

        * DerivedSources.make:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSEventTargetCustom.cpp:
        * dom/EventTargetFactory.in:
        * html/OffscreenCanvas.cpp: Added.
        (WebCore::OffscreenCanvas::create):
        (WebCore::OffscreenCanvas::OffscreenCanvas):
        (WebCore::OffscreenCanvas::width const):
        (WebCore::OffscreenCanvas::setWidth):
        (WebCore::OffscreenCanvas::height const):
        (WebCore::OffscreenCanvas::setHeight):
        * html/OffscreenCanvas.h: Added.
        * html/OffscreenCanvas.idl: Added.

2017-11-03  Ryosuke Niwa  <rniwa@webkit.org>

        Crash inside ChildListMutationAccumulator::enqueueMutationRecord()
        https://bugs.webkit.org/show_bug.cgi?id=179234
        <rdar://problem/35287748>

        Reviewed by Darin Adler.

        Fixed the crash by keeping MutationObserver referenced by MutationObserverInterestGroup alive.

        Also added hasCallback() virtual function on MutationObserver to check whether the callback is alive
        to work around the bug that JS function referenced by MutationObserver isn't kept alive.
        We'll address this bug separately in https://webkit.org/b/179224.

        Test: fast/dom/MutationObserver/disconnect-observer-while-mutation-records-are-enqueued-crash.html

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateCallbackHeaderContent): Added an override for the newly added virtual hasCallback().
        * dom/MutationCallback.h:
        * dom/MutationObserver.cpp:
        (WebCore::MutationObserver::deliver): Added the aforementioned workaround.
        * dom/MutationObserverInterestGroup.cpp:
        (WebCore::MutationObserverInterestGroup::MutationObserverInterestGroup): Fixed the crash by using Ref.
        (WebCore::MutationObserverInterestGroup::enqueueMutationRecord): Ditto.
        * dom/MutationObserverInterestGroup.h:
        * dom/NativeNodeFilter.cpp:
        (WebCore::NativeNodeFilter::hasCallback const): Always return true here. This function is never called
        but we still need to implement it since NodeFilter has a pure virtual hasCallback() now.
        * dom/NativeNodeFilter.h:
        * dom/Node.cpp:
        (WebCore::collectMatchingObserversForMutation): Use Ref to fix the crash.
        (WebCore::Node::registeredMutationObservers): Ditto.
        * dom/Node.h:
        * dom/NodeFilter.h:

2017-11-03  Zalan Bujtas  <zalan@apple.com>

        RenderObject::*positioned() naming cleanup
        https://bugs.webkit.org/show_bug.cgi?id=179206
        <rdar://problem/35325254>

        Reviewed by Darin Adler.

        +isFixedPositioned()
        +isAbsolutelyPositioned()
        isRelPositioned() -> isRelativelyPositioned()

        Covered by existing tests.

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::positionOffsetValue):
        * dom/Element.cpp:
        (WebCore::layoutOverflowRectContainsAllDescendants):
        * rendering/LayoutState.cpp:
        (WebCore::LayoutState::LayoutState):
        * rendering/LayoutState.h:
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::renderName const):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::fixedElementLaysOutRelativeToFrame const):
        (WebCore::RenderBox::foregroundIsKnownToBeOpaqueInRect const):
        (WebCore::RenderBox::mapLocalToContainer const):
        (WebCore::RenderBox::pushMappingToContainer const):
        (WebCore::RenderBox::mapAbsoluteToLocalPoint const):
        (WebCore::RenderBox::offsetFromContainer const):
        (WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
        (WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent const):
        (WebCore::RenderBoxModelObject::offsetForInFlowPosition const):
        * rendering/RenderDeprecatedFlexibleBox.cpp:
        (WebCore::RenderDeprecatedFlexibleBox::renderName const):
        * rendering/RenderFragmentedFlow.cpp:
        (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
        * rendering/RenderGeometryMap.cpp:
        (WebCore::canMapBetweenRenderersViaLayers):
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::renderName const):
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::renderName const):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paintLayer):
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateCompositedBounds):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateBacking):
        (WebCore::RenderLayerCompositor::computeExtent const):
        (WebCore::RenderLayerCompositor::reasonsForCompositing const):
        (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
        (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::containingBlock const):
        (WebCore::RenderObject::outputRenderObject const):
        (WebCore::RenderObject::offsetParent const):
        * rendering/RenderObject.h:
        (WebCore::RenderObject::isPositioned const):
        (WebCore::RenderObject::isInFlowPositioned const):
        (WebCore::RenderObject::isFixedPositioned const):
        (WebCore::RenderObject::isAbsolutePositioned const):
        (WebCore::RenderObject::isRelativePositioned const):
        (WebCore::RenderObject::isStickyPositioned const):
        (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
        (WebCore::RenderObject::RenderObjectBitfields::isRelativePositioned const):
        (WebCore::RenderObject::RenderObjectBitfields::isPositioned const):
        (WebCore::RenderObject::isRelPositioned const): Deleted.
        (WebCore::RenderObject::RenderObjectBitfields::isRelPositioned const): Deleted.

2017-11-03  Chris Dumez  <cdumez@apple.com>

        Use a single identifier type to identify Service Workers
        https://bugs.webkit.org/show_bug.cgi?id=179192

        Reviewed by Brady Eidson.

        Use a single identifier type to identify Service Workers. We had both a String
        identifier and a uint64_t identifier for each service worker. We now consistently
        use a ServiceWorkerIdentifier which is a strongly typed identifier backed by a
        uint64_t.

        * WebCore.xcodeproj/project.pbxproj:
        * loader/ResourceLoaderOptions.h:
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
        * loader/cache/CachedResourceRequest.h:
        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::ServiceWorker):
        * workers/service/ServiceWorker.h:
        * workers/service/ServiceWorkerClient.cpp:
        (WebCore::ServiceWorkerClient::postMessage):
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        * workers/service/ServiceWorkerContextData.cpp:
        (WebCore::ServiceWorkerContextData::isolatedCopy const):
        * workers/service/ServiceWorkerContextData.h:
        (WebCore::ServiceWorkerContextData::encode const):
        (WebCore::ServiceWorkerContextData::decode):
        * workers/service/ServiceWorkerIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerContextData.cpp.
        * workers/service/ServiceWorkerRegistrationData.h:
        (WebCore::ServiceWorkerRegistrationData::decode):
        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::serviceWorkerThreadProxy const):
        (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
        * workers/service/context/SWContextManager.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::ServiceWorkerThread):
        * workers/service/context/ServiceWorkerThread.h:
        (WebCore::ServiceWorkerThread::identifier const):
        * workers/service/context/ServiceWorkerThreadProxy.h:
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::generateServiceWorkerIdentifier):
        (WebCore::SWServer::Connection::scriptContextFailedToStart):
        (WebCore::SWServer::Connection::scriptContextStarted):
        (WebCore::SWServer::scriptContextFailedToStart):
        (WebCore::SWServer::scriptContextStarted):
        (WebCore::SWServer::updateWorker):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptContextFailedToStart):
        (WebCore::SWServerJobQueue::scriptContextStarted):
        * workers/service/server/SWServerJobQueue.h:
        * workers/service/server/SWServerRegistration.h:
        (WebCore::SWServerRegistration::setActiveServiceWorkerIdentifier):
        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::SWServerWorker):
        * workers/service/server/SWServerWorker.h:
        (WebCore::SWServerWorker::create):
        (WebCore::SWServerWorker::identifier const):

2017-11-02  Andy Estes  <aestes@apple.com>

        [Payment Request] show() should only be called with user activation
        https://bugs.webkit.org/show_bug.cgi?id=179056

        Reviewed by Sam Weinig.

        Updated existing tests to call PaymentRequest.show() with user activation.

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

2017-11-03  Daniel Bates  <dabates@apple.com>

        Invalidate node list when associated form control element is removed
        https://bugs.webkit.org/show_bug.cgi?id=179232
        <rdar://problem/35308269>

        Reviewed by Ryosuke Niwa.

        A node list represents a live view of the DOM. Invalidate the node list
        associated with a form element whenever one of its associated form control
        elements is removed.

        Test: fast/forms/node-list-remove-button-from-form.html

        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::removeFormElement):

2017-11-03  Frederic Wang  <fwang@igalia.com>

        Add USE(APPLE_INTERNAL_SDK)-guards around SPI in ResourceHandle code
        https://bugs.webkit.org/show_bug.cgi?id=136107

        Based on patch by Daniel Bates <dabates@apple.com>
        Reviewed by Darin Adler.

        No new tests, behavior unchanged.

        * platform/network/ResourceHandleClient.h: Replace includes of private headers with CFNetworkSPI.h.
        * platform/network/ResourceHandleInternal.h: Ditto.
        * platform/network/ios/ResourceHandleIOS.mm: Add USE(APPLE_INTERNAL_SDK)-guard around SPI
        headers and forward declare NSURLRequest SPI and constant _kCFStreamSSLTrustedLeafCertificates
        for clients that build without the internal SDK. Add BSD license block to file.
        (WebCore::ResourceHandle::createSSLPropertiesFromNSURLRequest): Fix code style issues; use
        nullptr instead of 0, use reinterpret_cast instead of C-style cast, remove unnecessary
        "using namespace WebCore"
        and rename variables to improve readability.
        * platform/network/mac/ResourceErrorMac.mm: Add USE(APPLE_INTERNAL_SDK)-guard around private
        headers and add typedef for CFCachedURLResponseRef for clients that build without the
        internal SDK.

2017-11-03  Antti Koivisto  <antti@apple.com>

        Crash in WebCore::RenderStyle::overflowX with display:contents
        https://bugs.webkit.org/show_bug.cgi?id=178857
        <rdar://problem/35201120>

        Reviewed by Zalan Bujtas.

        Crash test by Renata Hodovan.

        Tests: fast/css/display-contents-all.html
               fast/css/display-contents-document-element.html

        * css/StyleResolver.cpp:
        (WebCore::adjustDisplayContentsStyle):

        For document element 'display:contents' should adjust to 'display:block' like it does for other display types.

2017-11-03  Jiewen Tan  <jiewen_tan@apple.com>

        Replace some auto* with RefPtr within WebCore/html
        https://bugs.webkit.org/show_bug.cgi?id=179218
        <rdar://problem/35102567>

        Reviewed by Ryosuke Niwa.

        No changes in behaviors.

        In this patch, it replace some auto* pointers with RefPtrs. The way it achieves this goal is to wrap
        the RHS with makeRefPtr(). Also, some methods have been modified to return RefPtrs directly. Those
        include:
            HTMLInputElement::list,
            HTMLInputElement::dataList,
            HTMLLabelElement::control,
            HTMLLegendElement::associatedControl,
            HTMLSummaryElement::detailsElement,
            HTMLTableElement::tHead,
            HTMLTableElement::tFoot,
            HTMLTablePartElement::findParentTable,
            HTMLTableRowElement.cpp::findTable, local function
            RadioNodeList.cpp::toRadioButtonInputElement, local function
            CanvasStyle::canvasGradient,
            CanvasStyle::canvasPattern,
            WebGLRenderingContextBase::validateTextureBinding,
            GraphicsContext::strokeGradient,
            GraphicsContext::fillGradient.

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::labelChanged):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::correspondingControlForLabelElement const):
        * accessibility/AccessibilityTable.cpp:
        (WebCore::AccessibilityTable::addChildren):
        (WebCore::AccessibilityTable::title const):
        * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
        (webkitAccessibleTableGetCaption):
        * html/ColorInputType.cpp:
        (WebCore::ColorInputType::suggestions const):
        * html/FTPDirectoryDocument.cpp:
        (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
        * html/FileInputType.cpp:
        (WebCore::FileInputType::appendFormData const):
        (WebCore::FileInputType::disabledAttributeChanged):
        (WebCore::FileInputType::multipleAttributeChanged):
        * html/FormAssociatedElement.cpp:
        (WebCore::FormAssociatedElement::formOwnerRemovedFromTree):
        * html/HTMLBodyElement.cpp:
        (WebCore::HTMLBodyElement::insertedIntoAncestor):
        (WebCore::HTMLBodyElement::didFinishInsertingNode):
        (WebCore::HTMLBodyElement::scrollTo):
        * html/HTMLDetailsElement.cpp:
        (WebCore::HTMLDetailsElement::isActiveSummary const):
        (WebCore::HTMLDetailsElement::parseAttribute):
        * html/HTMLDocument.cpp:
        (WebCore::HTMLDocument::namedItem):
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::editabilityFromContentEditableAttr):
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::didAttachRenderers):
        * html/HTMLFrameOwnerElement.cpp:
        (WebCore:: const):
        * html/HTMLFrameSetElement.cpp:
        (WebCore::HTMLFrameSetElement::namedItem):
        * html/HTMLHtmlElement.cpp:
        (WebCore::HTMLHtmlElement::insertedByParser):
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::defaultEventHandler):
        (WebCore::HTMLInputElement::list const):
        (WebCore::HTMLInputElement::dataList const):
        (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
        * html/HTMLInputElement.h:
        * html/HTMLLabelElement.cpp:
        (WebCore::firstElementWithIdIfLabelable):
        (WebCore::HTMLLabelElement::control const):
        (WebCore::HTMLLabelElement::form const):
        (WebCore::HTMLLabelElement::setActive):
        (WebCore::HTMLLabelElement::setHovered):
        (WebCore::HTMLLabelElement::willRespondToMouseClickEvents):
        (WebCore::HTMLLabelElement::focus):
        (WebCore::HTMLLabelElement::accessKeyAction):
        * html/HTMLLabelElement.h:
        * html/HTMLLegendElement.cpp:
        (WebCore::HTMLLegendElement::associatedControl):
        (WebCore::HTMLLegendElement::focus):
        (WebCore::HTMLLegendElement::accessKeyAction):
        (WebCore::HTMLLegendElement::form const):
        * html/HTMLLegendElement.h:
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::setCSSStyleSheet):
        (WebCore::HTMLLinkElement::addSubresourceAttributeURLs const):
        * html/HTMLMediaElement.cpp:
        (WebCore::needsAutoplayPlayPauseEventsQuirk):
        (WebCore::HTMLMediaElement::loadResource):
        (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
        (WebCore::HTMLMediaElement::removeTextTrack):
        (WebCore::HTMLMediaElement::layoutSizeChanged):
        * html/HTMLObjectElement.cpp:
        (WebCore::shouldBeExposed):
        (WebCore::HTMLObjectElement::appendFormData):
        * html/HTMLOptGroupElement.cpp:
        (WebCore::HTMLOptGroupElement::recalcSelectOptions):
        * html/HTMLPictureElement.cpp:
        (WebCore::HTMLPictureElement::viewportChangeAffectedPicture const):
        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::bindingsInstance):
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::isImageType):
        (WebCore::HTMLPlugInImageElement::willDetachRenderers):
        (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const):
        (WebCore::HTMLPlugInImageElement::checkSizeChangeForSnapshotting):
        * html/HTMLSlotElement.cpp:
        (WebCore::HTMLSlotElement::attributeChanged):
        (WebCore:: const):
        * html/HTMLSourceElement.cpp:
        (WebCore::HTMLSourceElement::parseAttribute):
        * html/HTMLStyleElement.cpp:
        (WebCore::HTMLStyleElement::addSubresourceAttributeURLs const):
        * html/HTMLSummaryElement.cpp:
        (WebCore::HTMLSummaryElement::detailsElement const):
        * html/HTMLSummaryElement.h:
        * html/HTMLTableElement.cpp:
        (WebCore::HTMLTableElement::caption const):
        (WebCore::HTMLTableElement::tHead const):
        (WebCore::HTMLTableElement::tFoot const):
        (WebCore::HTMLTableElement::createTHead):
        (WebCore::HTMLTableElement::deleteTHead):
        (WebCore::HTMLTableElement::createTFoot):
        (WebCore::HTMLTableElement::deleteTFoot):
        (WebCore::HTMLTableElement::createCaption):
        (WebCore::HTMLTableElement::deleteCaption):
        * html/HTMLTableElement.h:
        * html/HTMLTablePartElement.cpp:
        (WebCore::HTMLTablePartElement::findParentTable const):
        * html/HTMLTablePartElement.h:
        * html/HTMLTableRowElement.cpp:
        (WebCore::findTable):
        (WebCore::HTMLTableRowElement::rowIndex const):
        (WebCore::findRows):
        * html/HTMLTableSectionElement.cpp:
        (WebCore::HTMLTableSectionElement::additionalPresentationAttributeStyle const):
        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::mediaElement const):
        * html/LinkIconCollector.cpp:
        (WebCore::LinkIconCollector::iconsOfTypes):
        * html/MediaDocument.cpp:
        (WebCore::MediaDocumentParser::createDocumentStructure):
        (WebCore::MediaDocument::replaceMediaElementTimerFired):
        * html/MediaElementSession.cpp:
        (WebCore::needsArbitraryUserGestureAutoplayQuirk):
        (WebCore::isElementRectMostlyInMainFrame):
        (WebCore::isElementLargeRelativeToMainFrame):
        * html/PluginDocument.cpp:
        (WebCore::PluginDocumentParser::createDocumentStructure):
        (WebCore::PluginDocumentParser::appendBytes):
        * html/RadioNodeList.cpp:
        (WebCore::toRadioButtonInputElement):
        (WebCore::RadioNodeList::value const):
        (WebCore::RadioNodeList::setValue):
        * html/RangeInputType.cpp:
        (WebCore::RangeInputType::updateTickMarkValues):
        * html/canvas/CanvasRenderingContext.cpp:
        (WebCore::CanvasRenderingContext::wouldTaintOrigin):
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::setStrokeStyle):
        (WebCore::CanvasRenderingContext2D::setFillStyle):
        (WebCore::CanvasRenderingContext2D::fillInternal):
        (WebCore::CanvasRenderingContext2D::strokeInternal):
        (WebCore::CanvasRenderingContext2D::fillRect):
        (WebCore::CanvasRenderingContext2D::strokeRect):
        (WebCore::toStyle):
        (WebCore::CanvasRenderingContext2D::drawTextInternal):
        * html/canvas/CanvasStyle.h:
        (WebCore::CanvasStyle::canvasGradient const):
        (WebCore::CanvasStyle::canvasPattern const):
        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::texStorage2D):
        (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
        (WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
        * html/canvas/WebGLBuffer.h:
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
        (WebCore::WebGLRenderingContext::validateIndexArrayConservative):
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::compressedTexImage2D):
        (WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
        (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
        (WebCore::WebGLRenderingContextBase::generateMipmap):
        (WebCore::WebGLRenderingContextBase::getTexParameter):
        (WebCore::WebGLRenderingContextBase::texImage2DBase):
        (WebCore::WebGLRenderingContextBase::validateTexFunc):
        (WebCore::WebGLRenderingContextBase::texSubImage2D):
        (WebCore::WebGLRenderingContextBase::texSubImage2DBase):
        (WebCore::WebGLRenderingContextBase::copyTexImage2D):
        (WebCore::WebGLRenderingContextBase::texImage2D):
        (WebCore::WebGLRenderingContextBase::texParameter):
        (WebCore::WebGLRenderingContextBase::validateTextureBinding):
        * html/canvas/WebGLRenderingContextBase.h:
        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::executeReparentTask):
        (WebCore::executeTakeAllChildrenAndReparentTask):
        (WebCore::HTMLConstructionSite::dispatchDocumentElementAvailableIfNeeded):
        (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
        (WebCore::HTMLConstructionSite::findFosterSite):
        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
        * html/parser/XSSAuditorDelegate.cpp:
        (WebCore::XSSAuditorDelegate::generateViolationReport):
        * html/shadow/TextControlInnerElements.cpp:
        (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
        * html/track/InbandGenericTextTrack.cpp:
        (WebCore::InbandGenericTextTrack::updateGenericCue):
        (WebCore::InbandGenericTextTrack::removeGenericCue):
        * html/track/InbandTextTrack.cpp:
        (WebCore::InbandTextTrack::willRemove):
        * html/track/TextTrack.cpp:
        (WebCore::TextTrack::addCue):
        (WebCore::TextTrack::addRegion):
        * html/track/VideoTrack.cpp:
        (WebCore::VideoTrack::willRemove):
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::buildInitialState):
        * platform/graphics/GraphicsContext.h:
        (WebCore::GraphicsContext::strokeGradient const):
        (WebCore::GraphicsContext::fillGradient const):
        * rendering/svg/RenderSVGPath.cpp:
        (WebCore::useStrokeStyleToFill):

2017-11-03  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: Canvas2D Profiling: highlight expensive context commands in the captured command log
        https://bugs.webkit.org/show_bug.cgi?id=178302
        <rdar://problem/33158849>

        Reviewed by Brian Burg.

        No new tests, updated existing tests.

        * inspector/InspectorCanvas.h:
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::recordAction):
        (WebCore::InspectorCanvas::finalizeFrame):
        (WebCore::InspectorCanvas::markNewFrame): Deleted.

        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):

2017-11-02  Maciej Stachowiak  <mjs@apple.com>

        Don't try to guess plugin MIME type from a file extension in a URL (no observable effect)
        https://bugs.webkit.org/show_bug.cgi?id=178333

        Reviewed by Darin Adler.

        No test cases because I could not find an observable behavior difference,
        even after trying many different plugin loading scenarios.
        
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): loadedMIMEType --> serviceType
        (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns): ditto
        (WebCore::HTMLPlugInImageElement::userDidClickSnapshot): ditto
        (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): ditto
        * html/HTMLPlugInImageElement.h:
        (WebCore::HTMLPlugInImageElement::loadedMimeType const): Deleted. This was the one call site
        for mimeTypeFromURL, and is otherwise just a wrapper for SerciceType()
        * platform/URL.cpp:
        (WebCore::mimeTypeFromURL): Deleted. This was the only use of MIMETypeDatabase in URL.
        * platform/URL.h: Removed declaration for mimeTypeFromURL.
        * WebCore.order: Removed mimeTypeFromURL.

2017-11-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Fix cancellation process implementation
        https://bugs.webkit.org/show_bug.cgi?id=179199

        Reviewed by Alex Christensen.

        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::cancel):
        (WebCore::CurlRequest::willSendData):
        (WebCore::CurlRequest::didReceiveHeader):
        (WebCore::CurlRequest::didReceiveData):
        (WebCore::CurlRequest::completeDidReceiveResponse):
        (WebCore::CurlRequest::pausedStatusChanged):
        * platform/network/curl/CurlRequest.h:
        (WebCore::CurlRequest::isSyncRequest const):
        (WebCore::CurlRequest::isCompletedOrCancelled const):
        (WebCore::CurlRequest::needToInvokeDidCancelTransfer const):
        (WebCore::CurlRequest::isSyncRequest): Deleted.

2017-11-02  Brady Eidson  <beidson@apple.com>

        SW: Implement "Update Registration State" algorithm (unused for now)
        https://bugs.webkit.org/show_bug.cgi?id=179186

        Reviewed by Chris Dumez.

        No new tests (No behavior change yet).

        This algorithm is very simple, and this patch plumbs it through.
        But it's not useful to start using this algorithm without "Update Worker State" also.
        So to keep this patch small, it's unused for now. Will be used in the next patch.

        * WebCore.xcodeproj/project.pbxproj:

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):

        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
        (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
        (WebCore::ServiceWorkerRegistration::updateStateFromServer):
        * workers/service/ServiceWorkerRegistration.h:

        * workers/service/ServiceWorkerTypes.h: Copied from Source/WebCore/workers/service/server/SWServerRegistration.cpp.

        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::addServiceWorkerRegistration):
        (WebCore::SWClientConnection::removeServiceWorkerRegistration):
        (WebCore::SWClientConnection::updateRegistrationState):
        * workers/service/server/SWClientConnection.h:

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::addServiceWorkerRegistrationInServer):
        (WebCore::SWServer::Connection::removeServiceWorkerRegistrationInServer):
        (WebCore::SWServer::addClientServiceWorkerRegistration):
        (WebCore::SWServer::removeClientServiceWorkerRegistration):
        * workers/service/server/SWServer.h:
        (WebCore::SWServer::getConnection):

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

        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::SWServerRegistration):
        (WebCore::SWServerRegistration::updateRegistrationState):
        (WebCore::SWServerRegistration::addClientServiceWorkerRegistration):
        (WebCore::SWServerRegistration::removeClientServiceWorkerRegistration):
        * workers/service/server/SWServerRegistration.h:

2017-11-01  Ryosuke Niwa  <rniwa@webkit.org>

        Assert that updateStyle and updateLayout are only called when it's safe to dispatch events
        https://bugs.webkit.org/show_bug.cgi?id=179157
        <rdar://problem/35144778>

        Reviewed by Zalan Bujtas.

        Added assertions to Document::updateStyleIfNeeded and Document::updateLayout that these functions are
        only called when NoEventDispatchAssertion::isEventAllowedInMainThread() is true with two exceptions:
        1. Inside SVGImage::draw which triggers a layout on a separate document.
        2. While doing a nested layout for a frame flattening.

        No new tests since there should be no behavioral changes.

        * dom/ContainerNode.cpp:
        (NoEventDispatchAssertion::DisableAssertionsInScope::s_existingCount): Deleted. This is now an instance
        variable of DisableAssertionsInScope.
        (ContainerNode::removeNodeWithScriptAssertion): Moved childrenChanged out of the scope since it could
        invoke respondToChangedSelection via HTMLTextAreaElement::childrenChanged.
        * dom/Document.cpp:
        (WebCore::Document::updateStyleIfNeeded): Added the assertion. Allow updateWidgetPositions() to call
        this function but exit early when checking needsStyleRecalc().
        (WebCore::Document::updateLayout): Added the assertion.
        * dom/NoEventDispatchAssertion.h:
        (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::DisableAssertionsInScope): Made this class
        store the original value of s_count as an instance variable to support re-entrancy.
        (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::~DisableAssertionsInScope): Ditto.
        * page/LayoutContext.cpp:
        (WebCore::LayoutContext::runOrScheduleAsynchronousTasks): Temporarily disable the assertion. This is safe
        since SVGImage has its own document.
        * svg/SVGSVGElement.cpp:
        (WebCore::checkIntersectionWithoutUpdatingLayout): Extracted out of SVGSVGElement::checkIntersection.
        (WebCore::checkEnclosureWithoutUpdatingLayout): Extracted out of SVGSVGElement::checkEnclosure.
        (WebCore::SVGSVGElement::getIntersectionList): Use checkIntersectionWithoutUpdatingLayout to avoid
        calling updateLayoutIgnorePendingStylesheets while iterating over elements.
        (WebCore::SVGSVGElement::getEnclosureList): Ditto.
        (WebCore::SVGSVGElement::checkIntersection):
        (WebCore::SVGSVGElement::checkEnclosure):
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::draw): Temporarily disable the assertion. This is safe as SVGImage has its own page.

2017-11-02  Alex Christensen  <achristensen@webkit.org>

        Fix Windows debug build after r224371

        * platform/graphics/win/DIBPixelData.h:

2017-11-02  Alex Christensen  <achristensen@webkit.org>

        Use CompletionHandlers for redirects
        https://bugs.webkit.org/show_bug.cgi?id=179163

        Reviewed by Tim Horton.

        Having functions sometimes have to remember to call client->continueWillSendRequest is fragile.
        CompletionHandler asserts if it's not called once before destruction, and that's what we need here.
        This will prevent future bugs, and make ResourceHandle look more like NetworkDataTask.

        No change in behavior.

        * loader/NetscapePlugInStreamLoader.cpp:
        (WebCore::NetscapePlugInStreamLoader::willSendRequest):
        * loader/NetscapePlugInStreamLoader.h:
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::willSendRequest):
        (WebCore::ResourceLoader::willSendRequestAsync):
        * loader/ResourceLoader.h:
        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::willSendRequestAsync):
        * loader/appcache/ApplicationCacheGroup.h:
        * platform/network/BlobResourceHandle.cpp:
        * platform/network/PingHandle.h:
        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleClient.h:
        * platform/network/SynchronousLoaderClient.cpp:
        (WebCore::SynchronousLoaderClient::willSendRequestAsync):
        * platform/network/SynchronousLoaderClient.h:
        * platform/network/cf/ResourceHandleCFNet.cpp:
        (WebCore::ResourceHandle::willSendRequest):
        (WebCore::ResourceHandle::continueWillSendRequest): Deleted.
        * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueWillSendRequest): Deleted.
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::willSendRequest):
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::willSendRequest):
        (WebCore::ResourceHandle::continueWillSendRequest): Deleted.
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate continueWillSendRequest:]): Deleted.
        * platform/network/soup/ResourceHandleSoup.cpp:
        (WebCore::doRedirect):
        (WebCore::ResourceHandle::continueWillSendRequest): Deleted.

2017-11-02  Christopher Reid  <chris.reid@sony.com>

        Add a FileSystem namespace to FileSystem.cpp
        https://bugs.webkit.org/show_bug.cgi?id=179063

        Reviewed by Darin Adler.

        No new tests, no change in behavior.

        Adding a FileSystem namespace so its functions aren't global in WebCore.

        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
        * Modules/entriesapi/DOMFileSystem.cpp:
        * Modules/entriesapi/FileSystemEntry.cpp:
        * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
        * Modules/indexeddb/server/IDBServer.cpp:
        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
        * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
        * Modules/indexeddb/shared/InProcessIDBServer.cpp:
        * Modules/webdatabase/DatabaseTracker.cpp:
        * Modules/webdatabase/OriginLock.cpp:
        * Modules/webdatabase/OriginLock.h:
        * fileapi/File.cpp:
        * fileapi/FileCocoa.mm:
        * html/FileListCreator.cpp:
        * html/HTMLMediaElement.cpp:
        * loader/appcache/ApplicationCacheStorage.cpp:
        * page/Page.cpp:
        * page/SecurityOrigin.cpp:
        * page/SecurityOriginData.cpp:
        * platform/FileHandle.cpp:
        * platform/FileHandle.h:
        * platform/FileStream.cpp:
        * platform/FileStream.h:
        * platform/FileSystem.cpp: Added FileSystem namespace
        * platform/FileSystem.h: Added FileSystem namespace
        * platform/SharedBuffer.cpp:
        * platform/SharedBuffer.h:
        * platform/cf/FileSystemCF.cpp: Added FileSystem namespace
        * platform/cocoa/FileMonitorCocoa.mm:
        * platform/cocoa/FileSystemCocoa.mm: Added FileSystem namespace
        * platform/glib/FileMonitorGLib.cpp:
        * platform/glib/FileSystemGlib.cpp: Added FileSystem namespace
        * platform/glib/SharedBufferGlib.cpp:
        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        * platform/graphics/win/DIBPixelData.h:
        * platform/ios/QuickLook.mm:
        * platform/ios/WebItemProviderPasteboard.mm:
        * platform/mac/FileSystemMac.mm: Added FileSystem namespace
        * platform/network/BlobDataFileReference.cpp:
        * platform/network/BlobRegistryImpl.cpp:
        * platform/network/FormData.cpp:
        * platform/network/cf/FormDataStreamCFNet.cpp:
        * platform/network/cocoa/ResourceRequestCocoa.mm:
        * platform/network/curl/CurlCacheEntry.cpp:
        * platform/network/curl/CurlCacheEntry.h:
        * platform/network/curl/CurlCacheManager.cpp:
        * platform/network/curl/CurlDownload.cpp:
        * platform/network/curl/CurlRequest.cpp:
        * platform/network/curl/CurlRequest.h:
        * platform/network/curl/ResourceHandleCurl.cpp:
        * platform/network/mac/BlobDataFileReferenceMac.mm:
        * platform/network/soup/ResourceRequestSoup.cpp:
        * platform/network/soup/SoupNetworkSession.cpp:
        * platform/posix/FileSystemPOSIX.cpp: Added FileSystem namespace
        * platform/posix/SharedBufferPOSIX.cpp:
        * platform/sql/SQLiteFileSystem.cpp:
        * platform/text/hyphen/HyphenationLibHyphen.cpp:
        * platform/win/FileSystemWin.cpp: Added FileSystem namespace
        * rendering/RenderThemeGtk.cpp:
        * rendering/RenderThemeWin.cpp:

2017-11-02  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: Canvas Tab: show supported GL extensions for selected canvas
        https://bugs.webkit.org/show_bug.cgi?id=179070
        <rdar://problem/35278276>

        Reviewed by Brian Burg.

        Test: inspector/canvas/extensions.html

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::getExtension):
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::getExtension):
        Rework common logic into a macro for readability and to simplify adding calls to
        InspectorInstrumentation functions.

        * html/canvas/WebGLRenderingContextBase.h:
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::extensionIsEnabled):

        * inspector/InspectorCanvasAgent.h:
        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::enable):
        (WebCore::InspectorCanvasAgent::didEnableExtension):

        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didEnableExtension):
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didEnableExtensionImpl):

2017-11-02  Youenn Fablet  <youenn@apple.com>

        Do not check for CORS in case response is coming from a service worker
        https://bugs.webkit.org/show_bug.cgi?id=179177

        Reviewed by Chris Dumez.

        Test: http/tests/workers/service/cors-image-fetch.html

        As per fetch spec, CORS check (https://fetch.spec.whatwg.org/#cors-check) is done
        within HTTP fetch (https://fetch.spec.whatwg.org/#http-fetch).
        It does not apply to fetches handled by service workers.

        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):

2017-11-02  Joseph Pecoraro  <pecoraro@apple.com>

        Make ServiceWorker a Remote Inspector debuggable target
        https://bugs.webkit.org/show_bug.cgi?id=179043
        <rdar://problem/34126008>

        Reviewed by Brian Burg.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        New files.

        * workers/service/context/ServiceWorkerDebuggable.h: Added.
        * workers/service/context/ServiceWorkerDebuggable.cpp: Added.
        (WebCore::ServiceWorkerDebuggable::ServiceWorkerDebuggable):
        (WebCore::ServiceWorkerDebuggable::connect):
        (WebCore::ServiceWorkerDebuggable::disconnect):
        (WebCore::ServiceWorkerDebuggable::dispatchMessageFromRemote):
        ServiceWorker remote inspector target, exposes the script url to debuggers.
        Pass the channel on to the inspector proxy to hook it up to the worker.

        * workers/service/context/ServiceWorkerInspectorProxy.h:
        * workers/service/context/ServiceWorkerInspectorProxy.cpp: Added.
        (WebCore::ServiceWorkerInspectorProxy::ServiceWorkerInspectorProxy):
        (WebCore::ServiceWorkerInspectorProxy::~ServiceWorkerInspectorProxy):
        (WebCore::ServiceWorkerInspectorProxy::serviceWorkerTerminated):
        Handle interesting events throughout a Service Worker life cycle.

        (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
        (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
        (WebCore::ServiceWorkerInspectorProxy::sendMessageToWorker):
        (WebCore::ServiceWorkerInspectorProxy::sendMessageFromWorkerToFrontend):
        Implement existing worker debugger hooks for connection setup and sending messages.
        Inspector protocol messages come in on the MainThread and hop over to the
        WorkerThread to be handled on the expected context thread. Likewise outgoing
        messages hop back to be sent through the InspectorFrontend channel on MainThread.

        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::ServiceWorkerThread):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/context/ServiceWorkerThreadProxy.h:
        * workers/service/context/ServiceWorkerThreadProxy.cpp:
        (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
        (WebCore::ServiceWorkerThreadProxy::postMessageToDebugger):
        Construct the new inspector proxy and debuggable registration.
        Call lifecycle events and debugger hooks when appropriate.

2017-11-02  Antti Koivisto  <antti@apple.com>

        display:contents should work with dynamic table mutations
        https://bugs.webkit.org/show_bug.cgi?id=179179

        Reviewed by Ryosuke Niwa.

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

            RenderText with inline text wrapper as beforeChild is now resolved in RenderTreePosition, covering all cases.
            Verify this with assert.

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::insertChildInternal):

            Add assertion.

        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::addChild):

            Fix cases where we did unchecked downcasts for anonymous beforeChild.

        * style/RenderTreePosition.cpp:
        (WebCore::RenderTreePosition::insert):

            When inserting before a text rendeder with an display:contents inline wrapper, use the wrapper as beforeChild.

        * style/RenderTreePosition.h:
        (WebCore::RenderTreePosition::insert): Deleted.
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateRenderTree):
        (WebCore::RenderTreeUpdater::renderingParent):

            Add separate helper to get parent frame for the closest rendered (non display:contents) ancestor.

        (WebCore::RenderTreeUpdater::renderTreePosition):
        (WebCore::RenderTreeUpdater::updateElementRenderer):
        (WebCore::RenderTreeUpdater::textRendererIsNeeded):
        (WebCore::RenderTreeUpdater::updateTextRenderer):
        (WebCore::RenderTreeUpdater::storePreviousRenderer):

            Use it for tracking state related to render tree siblings. With this we compute whitespace nodes
            correctly for display:contents. The test cases end up depending on that.

        * style/RenderTreeUpdater.h:

2017-11-02  Tim Horton  <timothy_horton@apple.com>

        Bump the size of SameAsRenderElement after r224324

        * rendering/RenderElement.cpp:
        RenderElement uses one more bit in the bitfield now.

2017-11-02  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r224353.

        Breaks internal builds.

        Reverted changeset:

        "Ignore HSTS for partitioned, cross-origin subresource
        requests"
        https://bugs.webkit.org/show_bug.cgi?id=178993
        https://trac.webkit.org/changeset/224353

2017-11-02  Joseph Pecoraro  <pecoraro@apple.com>

        Inspector should display service worker served responses properly
        https://bugs.webkit.org/show_bug.cgi?id=178597
        <rdar://problem/35186111>

        Reviewed by Brian Burg.

        Test: http/tests/inspector/network/resource-response-service-worker.html

        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::responseSource):
        Use the new protocol enum.

2017-11-02  Ryosuke Niwa  <rniwa@webkit.org>

        Eliminate isMainThread() checks in most call sites of NoEventDispatchAssertion
        https://bugs.webkit.org/show_bug.cgi?id=179161

        Reviewed by Zalan Bujtas.

        Introduced NoEventDispatchAssertion::InMainThread which bypasses the expensive isMainThread() check
        in order to turn NoEventDispatchAssertion into a release assertion in a separate patch.

        Also removed instances of NoEventDispatchAssertion in notifyChildNodeInserted and notifyChildNodeRemoved
        and asserted that the caller has instantiated NoEventDispatchAssertion instead.

        No new tests since there should be no behavioral changes.

        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::canExecuteScripts):
        * dom/Attr.cpp:
        * dom/CharacterData.cpp:
        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion):
        (WebCore::ContainerNode::removeNodeWithScriptAssertion):
        (WebCore::executeNodeInsertionWithScriptAssertion):
        (WebCore::ContainerNode::removeDetachedChildren): Instantiated NoEventDispatchAssertion::InMainThread
        so that notifyChildNodeRemoved would be called inside NoEventDispatchAssertion. 
        (WebCore::ContainerNode::insertBeforeCommon):
        (WebCore::ContainerNode::appendChildCommon):
        (WebCore::ContainerNode::removeBetween):
        (WebCore::dispatchChildInsertionEvents):
        (WebCore::dispatchChildRemovalEvents):
        * dom/ContainerNodeAlgorithms.cpp:
        (WebCore::notifyChildNodeInserted): Assert that the caller has instantiated NoEventDispatchAssertion.
        (WebCore::notifyChildNodeRemoved): Ditto.
        * dom/Document.cpp:
        (WebCore::Document::resolveStyle):
        (WebCore::Document::updateStyleIfNeeded):
        (WebCore::Document::nodeChildrenWillBeRemoved):
        (WebCore::Document::nodeWillBeRemoved):
        (WebCore::Document::dispatchWindowEvent): Replaced RELEASE_ASSERT with ASSERT_WITH_SECURITY_IMPLICATION
        for clarity since NoEventDispatchAssertion::isEventAllowedInMainThread() always returns true in release
        builds right now.
        (WebCore::Document::dispatchWindowLoadEvent): Ditto.
        (WebCore::Document::applyPendingXSLTransformsTimerFired): Use ASSERT_WITH_SECURITY_IMPLICATION instead
        of regular ASSERT.
        * dom/Element.cpp:
        (WebCore::Element::addShadowRoot): Instantiate NoEventDispatchAssertion::InMainThread to call
        notifyChildNodeInserted will it.
        (WebCore::Element::attachAttributeNodeIfNeeded):
        (WebCore::Element::setAttributeNode): Fixed the indentation.
        (WebCore::Element::setAttributeNodeNS): Ditto.
        (WebCore::Element::dispatchFocusInEvent):
        (WebCore::Element::dispatchFocusOutEvent):
        * dom/EventDispatcher.cpp:
        (WebCore::EventDispatcher::dispatchEvent):
        * dom/NoEventDispatchAssertion.h:
        (WebCore::NoEventDispatchAssertion::isEventDispatchAllowedInSubtree): Moved to InMainThread.
        (WebCore::NoEventDispatchAssertion::InMainThread): Added.
        (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Assert that we're in the main thread
        instead of exiting early.
        (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Ditto.
        (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Moved here.
        (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed):
        * dom/Node.cpp:
        (WebCore::Node::dispatchSubtreeModifiedEvent):
        (WebCore::Node::dispatchDOMActivateEvent):
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
        (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
        (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
        * history/CachedPage.cpp:
        (WebCore::CachedPage::restore):
        * history/PageCache.cpp:
        (WebCore::PageCache::addIfCacheable):
        * page/LayoutContext.cpp:
        (WebCore::LayoutContext::layout):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::scrollRectToVisible):

2017-11-02  John Wilander  <wilander@apple.com>

        Ignore HSTS for partitioned, cross-origin subresource requests
        https://bugs.webkit.org/show_bug.cgi?id=178993
        <rdar://problem/34962462>

        Reviewed by Brent Fulgham and Alex Christensen.

        No new tests. HSTS is not supported in layout tests.
        Tested manually.

        * platform/network/mac/WebCoreURLResponse.mm:
        (WebCore::synthesizeRedirectResponseIfNecessary):
            Now also synthesizes a response if
            _schemeWasUpgradedDueToDynamicHSTS is set on the
            request. Because in such cases the scheme might
            have been downgraded and there the two schemes
            match.

2017-11-02  Zalan Bujtas  <zalan@apple.com>

        LayoutState::m_next is really the ancestor state.
        https://bugs.webkit.org/show_bug.cgi?id=179187
        <rdar://problem/35319525>

        Reviewed by Simon Fraser.

        No change in functionality.

        * rendering/LayoutState.cpp:
        (WebCore::LayoutState::LayoutState):
        (WebCore::LayoutState::clearPaginationInformation):
        (WebCore::LayoutState::propagateLineGridInfo):
        (WebCore::LayoutState::establishLineGrid):
        * rendering/LayoutState.h:
        * rendering/RenderView.h:

2017-11-02  Alex Christensen  <achristensen@webkit.org>

        Fix iOS WebKitLegacy after r224267
        https://bugs.webkit.org/show_bug.cgi?id=179189

        Reviewed by Tim Horton.

        Use callOnMainThread instead of dispatch_async to work correctly on the web thread.

        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

2017-11-02  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE] Add some error reporting during EGL display/context creation
        https://bugs.webkit.org/show_bug.cgi?id=178937

        Reviewed by Carlos Alberto Lopez Perez.

        Unconditionally log errors using WTFLogAlways during EGL context creation. This
        provides a small degree of help for troubleshooting, and while eglGetError() only
        returns numeric error codes, it's better than nothing.

        No new tests needed.

        * platform/graphics/PlatformDisplay.cpp:
        (WebCore::PlatformDisplay::initializeEGLDisplay):
        * platform/graphics/egl/GLContextEGL.cpp:
        (WebCore::GLContextEGL::errorString):
        (WebCore::GLContextEGL::lastErrorString):
        (WebCore::GLContextEGL::createWindowContext):
        (WebCore::GLContextEGL::createPbufferContext):
        (WebCore::GLContextEGL::createSurfacelessContext):
        (WebCore::GLContextEGL::createContext):
        (WebCore::GLContextEGL::createSharingContext):
        (WebCore::GLContextEGL::GLContextEGL):
        * platform/graphics/egl/GLContextEGL.h:
        * platform/graphics/egl/GLContextEGLWPE.cpp:
        (WebCore::GLContextEGL::createWPEContext):
        * platform/graphics/wpe/PlatformDisplayWPE.cpp:
        (WebCore::PlatformDisplayWPE::initialize):

2017-11-02  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Move InspectorAgents into a folder
        https://bugs.webkit.org/show_bug.cgi?id=179132

        Reviewed by Devin Rousso.

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        Move files around.

        * inspector/agents/InspectorApplicationCacheAgent.cpp: Renamed from Source/WebCore/inspector/InspectorApplicationCacheAgent.cpp.
        * inspector/agents/InspectorApplicationCacheAgent.h: Renamed from Source/WebCore/inspector/InspectorApplicationCacheAgent.h.
        * inspector/agents/InspectorCSSAgent.cpp: Renamed from Source/WebCore/inspector/InspectorCSSAgent.cpp.
        * inspector/agents/InspectorCSSAgent.h: Renamed from Source/WebCore/inspector/InspectorCSSAgent.h.
        * inspector/agents/InspectorCanvasAgent.cpp: Renamed from Source/WebCore/inspector/InspectorCanvasAgent.cpp.
        * inspector/agents/InspectorCanvasAgent.h: Renamed from Source/WebCore/inspector/InspectorCanvasAgent.h.
        * inspector/agents/InspectorDOMAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMAgent.cpp.
        * inspector/agents/InspectorDOMAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMAgent.h.
        * inspector/agents/InspectorDOMDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp.
        * inspector/agents/InspectorDOMDebuggerAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMDebuggerAgent.h.
        * inspector/agents/InspectorDOMStorageAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDOMStorageAgent.cpp.
        * inspector/agents/InspectorDOMStorageAgent.h: Renamed from Source/WebCore/inspector/InspectorDOMStorageAgent.h.
        * inspector/agents/InspectorDatabaseAgent.cpp: Renamed from Source/WebCore/inspector/InspectorDatabaseAgent.cpp.
        * inspector/agents/InspectorDatabaseAgent.h: Renamed from Source/WebCore/inspector/InspectorDatabaseAgent.h.
        * inspector/agents/InspectorIndexedDBAgent.cpp: Renamed from Source/WebCore/inspector/InspectorIndexedDBAgent.cpp.
        * inspector/agents/InspectorIndexedDBAgent.h: Renamed from Source/WebCore/inspector/InspectorIndexedDBAgent.h.
        * inspector/agents/InspectorLayerTreeAgent.cpp: Renamed from Source/WebCore/inspector/InspectorLayerTreeAgent.cpp.
        * inspector/agents/InspectorLayerTreeAgent.h: Renamed from Source/WebCore/inspector/InspectorLayerTreeAgent.h.
        * inspector/agents/InspectorMemoryAgent.cpp: Renamed from Source/WebCore/inspector/InspectorMemoryAgent.cpp.
        * inspector/agents/InspectorMemoryAgent.h: Renamed from Source/WebCore/inspector/InspectorMemoryAgent.h.
        * inspector/agents/InspectorNetworkAgent.cpp: Renamed from Source/WebCore/inspector/InspectorNetworkAgent.cpp.
        * inspector/agents/InspectorNetworkAgent.h: Renamed from Source/WebCore/inspector/InspectorNetworkAgent.h.
        * inspector/agents/InspectorPageAgent.cpp: Renamed from Source/WebCore/inspector/InspectorPageAgent.cpp.
        * inspector/agents/InspectorPageAgent.h: Renamed from Source/WebCore/inspector/InspectorPageAgent.h.
        * inspector/agents/InspectorTimelineAgent.cpp: Renamed from Source/WebCore/inspector/InspectorTimelineAgent.cpp.
        * inspector/agents/InspectorTimelineAgent.h: Renamed from Source/WebCore/inspector/InspectorTimelineAgent.h.
        * inspector/agents/InspectorWorkerAgent.cpp: Renamed from Source/WebCore/inspector/InspectorWorkerAgent.cpp.
        * inspector/agents/InspectorWorkerAgent.h: Renamed from Source/WebCore/inspector/InspectorWorkerAgent.h.
        * inspector/agents/WebConsoleAgent.cpp: Renamed from Source/WebCore/inspector/WebConsoleAgent.cpp.
        * inspector/agents/WebConsoleAgent.h: Renamed from Source/WebCore/inspector/WebConsoleAgent.h.
        * inspector/agents/WebDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/WebDebuggerAgent.cpp.
        * inspector/agents/WebDebuggerAgent.h: Renamed from Source/WebCore/inspector/WebDebuggerAgent.h.
        * inspector/agents/WebHeapAgent.cpp: Renamed from Source/WebCore/inspector/WebHeapAgent.cpp.
        * inspector/agents/WebHeapAgent.h: Renamed from Source/WebCore/inspector/WebHeapAgent.h.
        * inspector/agents/page/PageConsoleAgent.cpp: Renamed from Source/WebCore/inspector/PageConsoleAgent.cpp.
        * inspector/agents/page/PageConsoleAgent.h: Renamed from Source/WebCore/inspector/PageConsoleAgent.h.
        * inspector/agents/page/PageDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/PageDebuggerAgent.cpp.
        * inspector/agents/page/PageDebuggerAgent.h: Renamed from Source/WebCore/inspector/PageDebuggerAgent.h.
        * inspector/agents/page/PageHeapAgent.cpp: Renamed from Source/WebCore/inspector/PageHeapAgent.cpp.
        * inspector/agents/page/PageHeapAgent.h: Renamed from Source/WebCore/inspector/PageHeapAgent.h.
        * inspector/agents/page/PageRuntimeAgent.cpp: Renamed from Source/WebCore/inspector/PageRuntimeAgent.cpp.
        * inspector/agents/page/PageRuntimeAgent.h: Renamed from Source/WebCore/inspector/PageRuntimeAgent.h.
        * inspector/agents/worker/WorkerConsoleAgent.cpp: Renamed from Source/WebCore/inspector/WorkerConsoleAgent.cpp.
        * inspector/agents/worker/WorkerConsoleAgent.h: Renamed from Source/WebCore/inspector/WorkerConsoleAgent.h.
        * inspector/agents/worker/WorkerDebuggerAgent.cpp: Renamed from Source/WebCore/inspector/WorkerDebuggerAgent.cpp.
        * inspector/agents/worker/WorkerDebuggerAgent.h: Renamed from Source/WebCore/inspector/WorkerDebuggerAgent.h.
        * inspector/agents/worker/WorkerRuntimeAgent.cpp: Renamed from Source/WebCore/inspector/WorkerRuntimeAgent.cpp.
        * inspector/agents/worker/WorkerRuntimeAgent.h: Renamed from Source/WebCore/inspector/WorkerRuntimeAgent.h.
        Move agents into folders.

2017-11-02  Youenn Fablet  <youenn@apple.com>

        Service Worker fetch should transmit headers to its client
        https://bugs.webkit.org/show_bug.cgi?id=179156

        Reviewed by Chris Dumez.

        Covered by updated tests.

        Making resourceResponse getter return a ResourceResponse with the headers of the FetchResponse Headers object.

        * Modules/cache/DOMCache.cpp:
        (WebCore::DOMCache::toConnectionRecord):
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::resourceResponse const):
        * Modules/fetch/FetchResponse.h:

2017-11-02  Chris Dumez  <cdumez@apple.com>

        Update SWServerJobQueue to follow the Service Worker specification more closely
        https://bugs.webkit.org/show_bug.cgi?id=179147

        Reviewed by Youenn Fablet.

        Align naming with the specification.

        Get rid of unnecessary m_currentJob as the current job is always the first
        job in the queue.

        Inline some of the tiny methods to simplify code. Those were leftovers from when
        we used to have a background thread.

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::scheduleJob):
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::SWServerJobQueue):
        (WebCore::SWServerJobQueue::scriptFetchFinished):
        (WebCore::SWServerJobQueue::scriptContextStarted):
        (WebCore::SWServerJobQueue::runNextJob):
        (WebCore::SWServerJobQueue::runNextJobSynchronously):
        (WebCore::SWServerJobQueue::runRegisterJob):
        (WebCore::SWServerJobQueue::runUnregisterJob):
        (WebCore::SWServerJobQueue::runUpdateJob):
        (WebCore::SWServerJobQueue::rejectCurrentJob):
        (WebCore::SWServerJobQueue::finishCurrentJob):
        * workers/service/server/SWServerJobQueue.h:
        (WebCore::SWServerJobQueue::firstJob const):
        (WebCore::SWServerJobQueue::lastJob const):
        (WebCore::SWServerJobQueue::enqueueJob):
        (WebCore::SWServerJobQueue::size const):

2017-11-02  Konstantin Tokarev  <annulen@yandex.ru>

        Unreviewed, removed useless semicolon at the end of namespace

        * platform/graphics/texmap/BitmapTextureGL.cpp:

2017-11-02  Michael Catanzaro  <mcatanzaro@igalia.com>

        WPE does not build with DragImage.cpp in unified sources.
        https://bugs.webkit.org/show_bug.cgi?id=178844

        Reviewed by Keith Miller.

        Add a stub implementation of DragImage for WPE so that we can drop the @no-unify.

        * Sources.txt:
        * SourcesWPE.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/wpe/DragImageWPE.cpp: Added.
        (WebCore::dragImageSize):
        (WebCore::deleteDragImage):
        (WebCore::scaleDragImage):
        (WebCore::dissolveDragImageToFraction):
        (WebCore::createDragImageFromImage):
        (WebCore::createDragImageIconForCachedImageFilename):
        (WebCore::createDragImageForLink):

2017-11-02  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] audioTrack.label is always empty on macOS
        https://bugs.webkit.org/show_bug.cgi?id=179175
        <rdar://problem/35315438>

        Reviewed by Youenn Fablet.

        * platform/mediastream/RealtimeMediaSourceSettings.h:
        (WebCore::RealtimeMediaSourceSettings::label const): New.
        (WebCore::RealtimeMediaSourceSettings::setLabel): Ditto.
        (WebCore::RealtimeMediaSourceSettings::encode const): Encode label.
        (WebCore::RealtimeMediaSourceSettings::decode): Decode label.

        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        (WebCore::AVMediaCaptureSource::initializeSettings): Set label.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::settings const): Ditto.

        * platform/mock/MockRealtimeMediaSource.cpp:
        (WebCore::MockRealtimeMediaSource::initializeSettings): Ditto.

2017-11-02  Chris Dumez  <cdumez@apple.com>

        [Service Workers] Add initial implementation for try Clear Registration / Clear Registration algorithms
        https://bugs.webkit.org/show_bug.cgi?id=179151

        Reviewed by Youenn Fablet.

        [Service Workers] Add initial implementation for try Clear Registration / Clear Registration algorithms:
        - https://w3c.github.io/ServiceWorker/#try-clear-registration
        - https://w3c.github.io/ServiceWorker/#clear-registration

        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptFetchFinished):
        (WebCore::SWServerJobQueue::runUnregisterJob):
        (WebCore::SWServerJobQueue::tryClearRegistration):
        (WebCore::SWServerJobQueue::clearRegistration):
        * workers/service/server/SWServerJobQueue.h:

2017-11-02  Antti Koivisto  <antti@apple.com>

        Clear Node renderer pointer when destroying RenderObject
        https://bugs.webkit.org/show_bug.cgi?id=179112

        Reviewed by Zalan Bujtas.

        Make sure we don't leave renderer pointers behind in Nodes.
        This could be done with WeakPtr but that would add extra indirection between DOM and render tree.

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::willBeDestroyed):

            Null the node renderer pointer.
            With continuations we have a case where renderer points to a node that has a different renderer.
            This is is ok as we know no node points to a continuation (they should really be anonymous renderers).

2017-11-02  Antti Koivisto  <antti@apple.com>

        Remove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers
        https://bugs.webkit.org/show_bug.cgi?id=179014

        Remove overly optimistic non-critical assertion that is hit on WK1 debug.

        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::removeAndDestroyAllContinuations):

2017-11-02  Frederic Wang  <fwang@igalia.com>

        Add references to bug 179167 in FIXME comments
        https://bugs.webkit.org/show_bug.cgi?id=179168

        Reviewed by Daniel Bates.

        * Configurations/FeatureDefines.xcconfig:

2017-11-02  Antti Koivisto  <antti@apple.com>

        Remove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers
        https://bugs.webkit.org/show_bug.cgi?id=179014

        Reviewed by Geoff Garen.

        Treat continuation similarly to other anonymous wrappers. This makes things more understandable
        and allows removal of some questionable code in RenderBlock::takeChild.

        The patch also makes continuation chain a double linked so we can efficiently remove single
        continuations from the chain. It also gets rid of algorithms that recurse in continuation chain.

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::firstChildInContinuation):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::styleDidChange):

            Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
            the chain only in the (non-continuation) head renderer.

        (WebCore::RenderBlock::dropAnonymousBoxChild):

            Make a member function.

        (WebCore::RenderBlock::takeChild):

            Remove code that destroyed empty continuations and caused the parent to destroy itself.
            Empty continuations are now removed by RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers.

        * rendering/RenderBlock.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::ContinuationChainNode::ContinuationChainNode):
        (WebCore::RenderBoxModelObject::ContinuationChainNode::~ContinuationChainNode):
        (WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter):

            Track continuations with double linked lists.

        (WebCore::continuationChainNodeMap):
        (WebCore::RenderBoxModelObject::willBeDestroyed):

            Don't recurse to destroy continuation chain. 
            Destroy all continuations iteratively if this is the head of the chain.
            When destroying a continuation renderer simply remove it from the chain.

        (WebCore::RenderBoxModelObject::continuation const):
        (WebCore::RenderBoxModelObject::insertIntoContinuationChainAfter):
        (WebCore::RenderBoxModelObject::removeFromContinuationChain):
        (WebCore::RenderBoxModelObject::ensureContinuationChainNode):
        (WebCore::continuationMap): Deleted.
        (WebCore::RenderBoxModelObject::setContinuation): Deleted.
        * rendering/RenderBoxModelObject.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::RenderElement):
        (WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary):

            Make this a function of the parent renderer itself instead of getting 'parent()' as first operation and
            then using it.
            Don't remove continuations (isAnonymousBlockContinuation() test gives wrong result for the last continuation of the chain).

        (WebCore::RenderElement::styleDidChange):

            removeAnonymousWrappersForInlinesIfNecessary is no function of the parent.

        (WebCore::RenderElement::updateOutlineAutoAncestor):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::hasContinuationChainNode const):
        (WebCore::RenderElement::setHasContinuationChainNode):
        (WebCore::RenderElement::hasContinuation const): Deleted.
        (WebCore::RenderElement::setHasContinuation): Deleted.
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::styleDidChange):

            Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
            the chain only in the (non-continuation) head renderer.

        (WebCore::RenderInline::addChildIgnoringContinuation):

            Remove the old continuation from the chain. splitFlow() will add it back into the right place.

        (WebCore::RenderInline::splitInlines):
        (WebCore::RenderInline::addChildToContinuation):
        (WebCore::RenderInline::childBecameNonInline):

            Remove the old continuation from the chain. splitFlow() will add it back into the right place.

        * rendering/RenderInline.h:
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded const):
        (WebCore::RenderObject::outputRenderObject const):
        (WebCore::findDestroyRootIncludingAnonymous):

            Allow anonymous continuations as destroy roots.

        (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):

            Removing a continuation may leave behind unnecessary anonymous sibling wrappers.
            Call removeAnonymousWrappersForInlinesIfNecessary() on parent after removal to get rid of them.
            If takeChild/removeAnonymousWrappersForInlinesIfNecessary leaves us with empty anonymous parent destroy that too.

        * rendering/RenderRubyRun.cpp:
        (WebCore::RenderRubyRun::takeChild):

            Similar to RenderBlock::takeChild, remove the code that would make the renderer destroy itself.
            Cleaning up RenderRubyRuns is now handled by removeFromParentAndDestroyCleaningUpAnonymousWrappers.

2017-11-02  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r224053): Crash in WebCore::Node::moveTreeToNewScope
        https://bugs.webkit.org/show_bug.cgi?id=179158

        Reviewed by Antti Koivisto.

        Call decrementReferencingNodeCount after checking the release assertion
        since that could delete oldDocument.

        * dom/Node.cpp:
        (WebCore::Node::moveTreeToNewScope):

2017-11-02  Antti Koivisto  <antti@apple.com>

        First letter text renderer should be anonymous
        https://bugs.webkit.org/show_bug.cgi?id=179114

        Reviewed by Darin Adler.

        Currently both RenderTextFragment and RenderText for first letter point to the same Text node.
        There should only be one non-anonymous renderer per node.

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):

            Skip the first letter text renderer instead of the fragment.

        * rendering/RenderBoxModelObject.cpp:
        (WebCore::firstLetterRemainingTextMap):

            Use WeakPtr.
            Modernize.

        (WebCore::RenderBoxModelObject::willBeDestroyed):
        (WebCore::RenderBoxModelObject::firstLetterRemainingText const):

            Avoid hash lookup with the new isFirstLetter bit.

        (WebCore::RenderBoxModelObject::setFirstLetterRemainingText):

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::RenderElement):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::isFirstLetter const):
        (WebCore::RenderElement::setIsFirstLetter):

            Add a bit for more explicit code.

        * rendering/RenderTextFragment.cpp:
        (WebCore::RenderTextFragment::setText):

            Assert that RenderTextFragment is always the non-anonymous renderer.

        * style/RenderTreeUpdaterFirstLetter.cpp:
        (WebCore::updateFirstLetterStyle):

            Set the isFirstLetter bit.

        (WebCore::createFirstLetterRenderer):

            Set the isFirstLetter bit.
            Remove the old text renderer before adding a new one.

2017-11-01  Frederic Wang  <fwang@igalia.com>

        Remove ScrollableArea::isTouchScrollable and ScrollableArea::isOverflowScroll
        https://bugs.webkit.org/show_bug.cgi?id=179121

        Reviewed by Alex Christensen.

        These functions were introduced in r161589 and r160236 but it seems that they have never
        been used.

        No new tests, behavior unchanged.

        * platform/ScrollableArea.h:
        (WebCore::ScrollableArea::isTouchScrollable const): Deleted.
        (WebCore::ScrollableArea::isOverflowScroll const): Deleted.
        * rendering/RenderLayer.h:

2017-11-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Make the order of scheduler job handling sequential 
        https://bugs.webkit.org/show_bug.cgi?id=179127

        Reviewed by Alex Christensen.

        * platform/network/curl/CurlRequestScheduler.cpp:
        (WebCore::CurlRequestScheduler::add):
        (WebCore::CurlRequestScheduler::cancel):
        (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
        (WebCore::CurlRequestScheduler::executeTasks):
        (WebCore::CurlRequestScheduler::workerThread):
        (WebCore::CurlRequestScheduler::startTransfer):
        (WebCore::CurlRequestScheduler::completeTransfer):
        (WebCore::CurlRequestScheduler::cancelTransfer):
        (WebCore::CurlRequestScheduler::finalizeTransfer):
        (WebCore::CurlJobList::isEmpty const): Deleted.
        (WebCore::CurlJobList::startJobs): Deleted.
        (WebCore::CurlJobList::finishJobs): Deleted.
        (WebCore::CurlRequestScheduler::updateJobList): Deleted.
        * platform/network/curl/CurlRequestScheduler.h:

2017-11-01  Ryosuke Niwa  <rniwa@webkit.org>

        NavigatorBase::onLine() accesses NetworkStateNotifier's singleton in a worker thread
        https://bugs.webkit.org/show_bug.cgi?id=179149
        <rdar://problem/35307552>

        Reviewed by Jiewen Tan.

        Fixed the bug making NavigatorBase::onLine a pure virtual function, and having two separate
        implementations for Navigator and WorkerNavigator. The former uses the singleton directly,
        and the latter returns the boolean stored in its instance. The boolean value is updated
        via WorkerMessagingProxy when the online status changes.

        No new tests.

        * page/Navigator.cpp:
        (WebCore::Navigator::onLine const):
        * page/Navigator.h:
        * page/NavigatorBase.cpp:
        (WebCore::NavigatorBase::onLine): Deleted.
        * page/NavigatorBase.h:
        * page/WorkerNavigator.cpp:
        (WebCore::WorkerNavigator::WorkerNavigator):
        (WebCore::WorkerNavigator::onLine const):
        * page/WorkerNavigator.h:
        * platform/network/NetworkStateNotifier.cpp:
        (WebCore::NetworkStateNotifier::singleton):
        * workers/DedicatedWorkerGlobalScope.cpp:
        (WebCore::DedicatedWorkerGlobalScope::create):
        (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
        * workers/DedicatedWorkerGlobalScope.h:
        * workers/DedicatedWorkerThread.cpp:
        (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
        (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
        * workers/DedicatedWorkerThread.h:
        * workers/Worker.cpp:
        (WebCore::Worker::notifyFinished):
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::WorkerGlobalScope):
        (WebCore::WorkerGlobalScope::navigator):
        (WebCore::WorkerGlobalScope::setIsOnline):
        * workers/WorkerGlobalScope.h:
        * workers/WorkerGlobalScopeProxy.h:
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
        (WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
        * workers/WorkerMessagingProxy.h:
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
        (WebCore::WorkerThread::WorkerThread):
        (WebCore::WorkerThread::workerThread):
        * workers/WorkerThread.h:
        * workers/service/ServiceWorkerGlobalScope.cpp:
        (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
        * workers/service/ServiceWorkerGlobalScope.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::ServiceWorkerThread):
        (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
        * workers/service/context/ServiceWorkerThread.h:

2017-11-01  Jiewen Tan  <jiewen_tan@apple.com>

        Let is<T>() accept RefPtrs
        https://bugs.webkit.org/show_bug.cgi?id=178612
        <rdar://problem/35102004>

        Reviewed by Ryosuke Niwa.

        Get rid of .get() for all is<T>() calls.

        No changes in behaviors.

        * bindings/js/JSElementCustom.cpp:
        (WebCore::createNewElementWrapper):
        * bindings/js/JSMediaStreamTrackCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSNodeCustom.cpp:
        (WebCore::createWrapperInline):
        * bindings/js/JSTextCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * css/CSSFilterImageValue.cpp:
        (WebCore::CSSFilterImageValue::loadSubimages):
        * css/CSSFontFaceSet.cpp:
        (WebCore::CSSFontFaceSet::matchingFaces):
        * css/CSSFontSelector.cpp:
        (WebCore::CSSFontSelector::addFontFaceRule):
        * css/CSSToStyleMap.cpp:
        (WebCore::CSSToStyleMap::mapNinePieceImage):
        * css/FontFace.cpp:
        (WebCore::FontFace::create):
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::createGridTrackList):
        * css/StyleBuilderCustom.h:
        (WebCore::StyleBuilderCustom::applyValueCursor):
        (WebCore::StyleBuilderCustom::applyValueContent):
        (WebCore::StyleBuilderCustom::applyValueWillChange):
        * css/StyleProperties.cpp:
        (WebCore::StyleProperties::propertyAsColor const):
        (WebCore::StyleProperties::propertyAsValueID const):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::createFilterOperations):
        * css/TransformFunctions.cpp:
        (WebCore::transformsForValue):
        * css/ViewportStyleResolver.cpp:
        (WebCore::ViewportStyleResolver::getViewportArgumentValue const):
        * dom/Document.cpp:
        (WebCore::Document::setBodyOrFrameset):
        (WebCore::Document::setFocusedElement):
        (WebCore::Document::updateHoverActiveState):
        * dom/Element.cpp:
        (WebCore::Element::setOuterHTML):
        * dom/Range.cpp:
        (WebCore::Range::insertNode):
        * editing/ApplyStyleCommand.cpp:
        (WebCore::toIdentifier):
        (WebCore::ApplyStyleCommand::applyBlockStyle):
        (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
        * editing/EditingStyle.cpp:
        (WebCore::identifierForStyleProperty):
        (WebCore::HTMLElementEquivalent::valueIsPresentInStyle const):
        (WebCore::EditingStyle::extractFontSizeDelta):
        (WebCore::EditingStyle::textDirection const):
        (WebCore::textDecorationValueList):
        (WebCore::EditingStyle::prepareToApplyAt):
        (WebCore::EditingStyle::legacyFontSize const):
        (WebCore::EditingStyle::textDirectionForSelection):
        (WebCore::StyleChange::StyleChange):
        (WebCore::StyleChange::extractTextStyles):
        (WebCore::diffTextDecorations):
        * html/BaseChooserOnlyDateAndTimeInputType.cpp:
        (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
        * html/FormAssociatedElement.cpp:
        (WebCore::FormAssociatedElement::findAssociatedForm):
        * html/HTMLAreaElement.cpp:
        (WebCore::HTMLAreaElement::imageElement const):
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::setOuterText):
        (WebCore::HTMLElement::dirAttributeChanged):
        * html/HTMLEmbedElement.cpp:
        (WebCore::HTMLEmbedElement::rendererIsNeeded):
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::dataList const):
        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::setText):
        (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel const):
        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::isKeyboardFocusable const):
        (WebCore::HTMLPlugInElement::isUserObservable const):
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::selectOption):
        * html/HTMLSummaryElement.cpp:
        (WebCore::isClickableControl):
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
        * html/RadioInputType.cpp:
        (WebCore::RadioInputType::isKeyboardFocusable const):
        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::HTMLConstructionSite::attachLater):
        (WebCore::HTMLConstructionSite::insertTextNode):
        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
        * html/track/TextTrackList.cpp:
        (TextTrackList::append):
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::setNodeName):
        * inspector/PageScriptDebugServer.cpp:
        (WebCore::PageScriptDebugServer::setJavaScriptPaused):
        * page/FocusController.cpp:
        (WebCore::shouldClearSelectionWhenChangingFocusedElement):
        * page/FrameView.cpp:
        (WebCore::FrameView::hasCustomScrollbars const):
        * page/Page.cpp:
        (WebCore::Page::pluginViews):
        * page/mac/EventHandlerMac.mm:
        (WebCore::EventHandler::platformPrepareForWheelEvents):
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
        * testing/Internals.cpp:
        (WebCore::deferredStyleRulesCountForList):
        (WebCore::deferredGroupRulesCountForList):
        (WebCore::deferredKeyframesRulesCountForList):

2017-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>

        [curl] Fix build after r224299
        https://bugs.webkit.org/show_bug.cgi?id=179155

        Unreviewed.

        Bug 175597 added the 6th argument of ResourceHandle constructor.
        Apply the same change of ResourceHandleCFNet.cpp to
        platformLoadResourceSynchronously of ResourceHandleCurl.cpp.

        No new tests since there should be no behavioral change other

        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        Added the 6th arguemnt shouldContentEncodingSniff.

2017-11-01  Simon Fraser  <simon.fraser@apple.com>

        Fix iOS build after r224312.

        * platform/graphics/cocoa/GraphicsContextCocoa.mm:
        (WebCore::GraphicsContext::drawFocusRing):

2017-11-01  Daniel Bates  <dabates@apple.com>

        Change Element::didAddUserAgentShadowRoot() to take a reference instead of a pointer
        https://bugs.webkit.org/show_bug.cgi?id=179153

        Reviewed by Ryosuke Niwa.

        Element::didAddUserAgentShadowRoot() is always passed a non-null pointer to the added
        ShadowRoot. Therefore we should have didAddUserAgentShadowRoot() take a lvalue reference
        to a ShadowRoot.

        No functionality changed. So, no new tests.

        * dom/Element.cpp:
        (WebCore::Element::addShadowRoot):
        * dom/Element.h:
        (WebCore::Element::didAddUserAgentShadowRoot):
        * html/HTMLDetailsElement.cpp:
        (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
        * html/HTMLDetailsElement.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
        * html/HTMLInputElement.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
        * html/HTMLMediaElement.h:
        * html/HTMLMeterElement.cpp:
        (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
        * html/HTMLMeterElement.h:
        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
        * html/HTMLPlugInElement.h:
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
        * html/HTMLPlugInImageElement.h:
        * html/HTMLProgressElement.cpp:
        (WebCore::HTMLProgressElement::didAddUserAgentShadowRoot):
        * html/HTMLProgressElement.h:
        * html/HTMLSummaryElement.cpp:
        (WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot):
        * html/HTMLSummaryElement.h:
        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::didAddUserAgentShadowRoot):
        * html/HTMLTextAreaElement.h:

2017-11-01  Jeremy Jones  <jeremyj@apple.com>

        Implement WKFullscreenWindowController for iOS.
        https://bugs.webkit.org/show_bug.cgi?id=178924
        rdar://problem/34697120

        Reviewed by Simon Fraser.

        Enable ENABLE_FULLSCREEN_API for iOS.

        * Configurations/FeatureDefines.xcconfig:

2017-11-01  Simon Fraser  <simon.fraser@apple.com>

        Misc display list and other cleanup
        https://bugs.webkit.org/show_bug.cgi?id=179150

        Reviewed by Tim Horton.

        A few functions in GraphicsContext would assert when using display lists, because they
        had no recording clause. Fix them (ellipse drawing, and focus ring drawing).
        
        Use #pragma once in more places.

        Add system trace points for display list recording.

        No behavior change for non-display list code.

        * platform/graphics/GraphicsContext.cpp:
        (WebCore::GraphicsContext::fillEllipse):
        (WebCore::GraphicsContext::strokeEllipse):
        * platform/graphics/PlatformLayer.h:
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::recursiveCommitChanges):
        * platform/graphics/ca/cocoa/WebSystemBackdropLayer.h:
        * platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
        * platform/graphics/cg/GraphicsContextCG.h:
        * platform/graphics/cocoa/GraphicsContextCocoa.mm:
        (WebCore::GraphicsContext::drawFocusRing):
        * platform/graphics/displaylists/DisplayList.h:
        * platform/graphics/displaylists/DisplayListItems.h:
        (WebCore::DisplayList::DrawFocusRingPath::create):
        (WebCore::DisplayList::DrawFocusRingPath::width const):
        (WebCore::DisplayList::DrawFocusRingPath::offset const):
        (WebCore::DisplayList::DrawFocusRingPath::DrawFocusRingPath):
        (WebCore::DisplayList::DrawFocusRingRects::create):
        (WebCore::DisplayList::DrawFocusRingRects::width const):
        (WebCore::DisplayList::DrawFocusRingRects::offset const):
        (WebCore::DisplayList::DrawFocusRingRects::DrawFocusRingRects):
        * platform/graphics/displaylists/DisplayListRecorder.cpp:
        (WebCore::DisplayList::Recorder::restore):
        (WebCore::DisplayList::Recorder::drawFocusRing):
        * platform/graphics/displaylists/DisplayListRecorder.h:
        * platform/graphics/displaylists/DisplayListReplayer.h:
        * platform/graphics/mac/WebLayer.h:

2017-11-01  Per Arne Vollan  <pvollan@apple.com>

        [Win] Fix compile errors in MediaPlayerPrivateAVFoundationCF.cpp
        https://bugs.webkit.org/show_bug.cgi?id=179148

        Reviewed by Ryosuke Niwa.

        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
        (WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURLChanged):

2017-11-01  Tim Horton  <timothy_horton@apple.com>

        Adjust RenderElement size assertion to be more accurate
        https://bugs.webkit.org/show_bug.cgi?id=179146

        Reviewed by Simon Fraser.

        * rendering/RenderElement.cpp:
        Alignment rules for bitfields differ on different platforms. If we're
        more truthful in our mimicing the layout of RenderElement, we can avoid
        the assertion firing on more configurations.

2017-11-01  Mark Lam  <mark.lam@apple.com>

        Add support to throw OOM if MarkedArgumentBuffer may overflow.
        https://bugs.webkit.org/show_bug.cgi?id=179092
        <rdar://problem/35116160>

        Reviewed by Saam Barati.

        No new tests.  The test for overflowing a MarkedArgumentBuffer will run for a
        ridiculously long time, which renders it unsuitable for automated tests.

        * Modules/plugins/QuickTimePluginReplacement.mm:
        (WebCore::QuickTimePluginReplacement::installReplacement):
        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::constructCustomElementSynchronously):
        (WebCore::JSCustomElementInterface::upgradeElement):
        (WebCore::JSCustomElementInterface::invokeCallback):
        * bindings/js/JSCustomXPathNSResolver.cpp:
        (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
        * bindings/js/JSDOMBuiltinConstructorBase.cpp:
        (WebCore::JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments):
        * bindings/js/JSDOMConvertSequences.h:
        (WebCore::JSConverter<IDLSequence<T>>::convert):
        (WebCore::JSConverter<IDLFrozenArray<T>>::convert):
        * bindings/js/JSDOMConvertWebGL.cpp:
        (WebCore::convertToJSValue):
        * bindings/js/JSDOMIterator.h:
        (WebCore::jsPair):
        (WebCore::iteratorForEach):
        * bindings/js/JSDOMMapLike.cpp:
        (WebCore::forwardFunctionCallToBackingMap):
        (WebCore::forwardForEachCallToBackingMap):
        * bindings/js/JSDOMPromiseDeferred.cpp:
        (WebCore::DeferredPromise::callFunction):
        (WebCore::createRejectedPromiseWithTypeError):
        * bindings/js/JSErrorHandler.cpp:
        (WebCore::JSErrorHandler::handleEvent):
        * bindings/js/JSEventListener.cpp:
        (WebCore::JSEventListener::handleEvent):
        * bindings/js/JSLazyEventListener.cpp:
        (WebCore::JSLazyEventListener::initializeJSFunction const):
        * bindings/js/JSPluginElementFunctions.cpp:
        (WebCore::callPlugin):
        * bindings/js/JSReadableStreamPrivateConstructors.cpp:
        (WebCore::constructJSReadableStreamReaderGeneric):
        * bindings/js/ReadableStream.cpp:
        (WebCore::ReadableStream::create):
        (WebCore::ReadableStream::pipeTo):
        (WebCore::ReadableStream::tee):
        (WebCore::ReadableStream::lock):
        (WebCore::checkReadableStream):
        * bindings/js/ReadableStreamDefaultController.cpp:
        (WebCore::ReadableStreamDefaultController::invoke):
        * bindings/js/ScheduledAction.cpp:
        (WebCore::ScheduledAction::executeFunctionInContext):
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneSerializer::recordObject):
        (WebCore::CloneSerializer::serialize):
        (WebCore::CloneDeserializer::readTerminal):
        (WebCore::CloneDeserializer::deserialize):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateCallbackImplementationContent):
        * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
        (WebCore::JSTestCallbackFunction::handleEvent):
        * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
        (WebCore::JSTestCallbackFunctionRethrow::handleEvent):
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
        (WebCore::JSTestCallbackFunctionWithThisObject::handleEvent):
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
        (WebCore::JSTestCallbackFunctionWithTypedefs::handleEvent):
        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        (WebCore::JSTestCallbackInterface::callbackWithNoParam):
        (WebCore::JSTestCallbackInterface::callbackWithArrayParam):
        (WebCore::JSTestCallbackInterface::callbackWithSerializedScriptValueParam):
        (WebCore::JSTestCallbackInterface::callbackWithStringList):
        (WebCore::JSTestCallbackInterface::callbackWithBoolean):
        (WebCore::JSTestCallbackInterface::callbackRequiresThisToPass):
        (WebCore::JSTestCallbackInterface::callbackWithAReturnValue):
        (WebCore::JSTestCallbackInterface::callbackThatRethrowsExceptions):
        (WebCore::JSTestCallbackInterface::callbackThatSkipsInvokeCheck):
        (WebCore::JSTestCallbackInterface::callbackWithThisObject):
        * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
        (WebCore::JSTestVoidCallbackFunction::handleEvent):
        * bridge/NP_jsobject.cpp:
        * bridge/objc/WebScriptObject.mm:
        (-[WebScriptObject callWebScriptMethod:withArguments:]):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::updateCaptionContainer):
        (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
        (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
        (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
        * testing/Internals.cpp:
        (WebCore::Internals::cloneArrayBuffer):

2017-11-01  Andy Estes  <aestes@apple.com>

        [Apple Pay] Update the enum traits for PaymentError::ContactField
        https://bugs.webkit.org/show_bug.cgi?id=179145
        <rdar://problem/35303108>

        Reviewed by Tim Horton.

        Account for the values added to PaymentError::ContactField in r220718 and r223580.

        * Modules/applepay/ApplePaySessionPaymentRequest.h:

2017-11-01  Daniel Bates  <dabates@apple.com>

        Remove unused Element::alwaysCreateUserAgentShadowRoot()
        https://bugs.webkit.org/show_bug.cgi?id=179141

        Reviewed by Ryosuke Niwa.

        In changeset r208135 Element::createShadowRoot() was removed. And Element::createShadowRoot()
        was the only caller of Element::alwaysCreateUserAgentShadowRoot(). We should remove
        Element::alwaysCreateUserAgentShadowRoot() as it is unused.

        * dom/Element.h:
        (WebCore::Element::didAddUserAgentShadowRoot):
        (WebCore::Element::alwaysCreateUserAgentShadowRoot const): Deleted.
        * html/HTMLButtonElement.h:
        * html/HTMLFormControlElement.h:
        * html/HTMLMediaElement.h:

2017-11-01  Chris Dumez  <cdumez@apple.com>

        Drop running Service Worker Jobs on a background thread
        https://bugs.webkit.org/show_bug.cgi?id=179142

        Reviewed by Youenn Fablet.

        Drop running Service Worker Jobs on a background thread. We don't really need to
        and this simplifies the logic a lot.

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::getRegistration):
        (WebCore::SWServer::addRegistration):
        (WebCore::SWServer::removeRegistration):
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptContextStarted):
        (WebCore::SWServerJobQueue::startNextJob):
        (WebCore::SWServerJobQueue::runRegisterJob):
        (WebCore::SWServerJobQueue::runUnregisterJob):
        (WebCore::SWServerJobQueue::runUpdateJob):
        (WebCore::SWServerJobQueue::finishCurrentJob):
        * workers/service/server/SWServerJobQueue.h:

2017-11-01  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed, try to fix Windows build.

        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
        (WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL):

2017-11-01  Chris Dumez  <cdumez@apple.com>

        Split JobQueue logic out of SWServerRegistration
        https://bugs.webkit.org/show_bug.cgi?id=179126

        Reviewed by Brady Eidson.

        Split JobQueue logic out of SWServerRegistration and into a SWServerJobQueue class to match the Service Workers
        specification more closely.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        * workers/service/ServiceWorkerRegistrationData.cpp:
        (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
        * workers/service/ServiceWorkerRegistrationData.h:
        (WebCore::ServiceWorkerRegistrationData::encode const):
        (WebCore::ServiceWorkerRegistrationData::decode):
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::~SWServer):
        (WebCore::SWServer::getRegistration):
        (WebCore::SWServer::addRegistration):
        (WebCore::SWServer::removeRegistration):
        (WebCore::SWServer::Connection::scriptContextStarted):
        (WebCore::SWServer::scheduleJob):
        (WebCore::SWServer::scriptFetchFinished):
        (WebCore::SWServer::scriptContextFailedToStart):
        (WebCore::SWServer::scriptContextStarted):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp: Added.
        (WebCore::SWServerJobQueue::SWServerJobQueue):
        (WebCore::SWServerJobQueue::~SWServerJobQueue):
        (WebCore::SWServerJobQueue::enqueueJob):
        (WebCore::SWServerJobQueue::scriptFetchFinished):
        (WebCore::SWServerJobQueue::scriptContextFailedToStart):
        (WebCore::SWServerJobQueue::scriptContextStarted):
        (WebCore::SWServerJobQueue::startNextJob):
        (WebCore::SWServerJobQueue::runRegisterJob):
        (WebCore::SWServerJobQueue::runUnregisterJob):
        (WebCore::SWServerJobQueue::runUpdateJob):
        (WebCore::SWServerJobQueue::rejectWithExceptionOnMainThread):
        (WebCore::SWServerJobQueue::resolveWithRegistrationOnMainThread):
        (WebCore::SWServerJobQueue::resolveCurrentRegistrationJobOnMainThead):
        (WebCore::SWServerJobQueue::resolveWithUnregistrationResultOnMainThread):
        (WebCore::SWServerJobQueue::startScriptFetchFromMainThread):
        (WebCore::SWServerJobQueue::rejectCurrentJob):
        (WebCore::SWServerJobQueue::resolveCurrentRegistrationJob):
        (WebCore::SWServerJobQueue::resolveCurrentUnregistrationJob):
        (WebCore::SWServerJobQueue::startScriptFetchForCurrentJob):
        (WebCore::SWServerJobQueue::finishCurrentJob):
        * workers/service/server/SWServerJobQueue.h: Added.
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::SWServerRegistration):
        (WebCore::SWServerRegistration::~SWServerRegistration):
        (WebCore::SWServerRegistration::data const):
        * workers/service/server/SWServerRegistration.h:
        (WebCore::SWServerRegistration::key const):
        (WebCore::SWServerRegistration::isUninstalling const):
        (WebCore::SWServerRegistration::setIsUninstalling):
        (WebCore::SWServerRegistration::setLastUpdateTime):
        (WebCore::SWServerRegistration::updateViaCache const):
        (WebCore::SWServerRegistration::setActiveServiceWorkerIdentifier):

2017-11-01  Daniel Bates  <dabates@apple.com>

        XMLHttpRequest should not sniff content encoding
        https://bugs.webkit.org/show_bug.cgi?id=175597
        <rdar://problem/34912624>

        Reviewed by Alex Christensen.

        Fixes an issue where the body of an HTTP response with headers "Content-Type: application/octet-stream" and
        "Content-Encoding: gzip" associated with an XHR request to a .gz file would not be automatically gzipped
        decompressed. Specifically, such a response would be treated analogous to a response with headers
        "Content-Type: application/gzip" and "Content-Encoding: identity". This behavior does not conform to the
        behavior of the Content-Encoding header as defined in the HTTP 1.1 and later specs. Moreover this behavior
        breaks the Epic Zen Garden demo: <https://s3.amazonaws.com/mozilla-games/ZenGarden/EpicZenGarden.html>.

        On macOS 10.13.2 opt out of content encoding sniffing when making an XHR request. We likely can
        selectively opt out of content encoding sniffing for other network requests. This will be done
        in subsequent commits to make it straightforward to identify site breakage (if any).

        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::start): Pass content encoding policy.
        * loader/ResourceLoader.h:
        (WebCore::ResourceLoader::shouldSniffContentEncoding const): Added.
        * loader/ResourceLoaderOptions.h:
        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::createResourceHandle): Enable content encoding sniff to match existing behavior.
        * platform/network/BlobResourceHandle.cpp:
        (WebCore::BlobResourceHandle::BlobResourceHandle): Ditto. We should look to disable content encoding sniffing in
        a subsequent change.
        * platform/network/PingHandle.h: Ditto.
        * platform/network/ResourceHandle.cpp:
        (WebCore::ResourceHandle::ResourceHandle): Modified to take a boolean as to whether to enable content encoding sniffing.
        (WebCore::ResourceHandle::create): Ditto.
        (WebCore::ResourceHandle::shouldContentEncodingSniff const): Added.
        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleInternal.h:
        (WebCore::ResourceHandleInternal::ResourceHandleInternal): Modified to take a boolean as to whether to enable content
        encoding sniffing.
        * platform/network/cf/ResourceHandleCFNet.cpp:
        (WebCore::ResourceHandle::createCFURLConnection): Modified to take a boolean as to whether to enable content encoding
        sniffing and apply this policy to the CFMutableURLRequestRef object when building on macOS 10.13.2.
        (WebCore::ResourceHandle::start):
        (WebCore::ResourceHandle::platformLoadResourceSynchronously): Enable content encoding sniff to match existing behavior.
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded): Added helper function to apply sniffing policies
        and storage partition, if applicable. 
        (WebCore::ResourceHandle::createNSURLConnection): Modified to take a boolean as to whether to enable content encoding
        sniffing. Calls adjustNSRequestApplyingPolicies() to apply this policy.
        (WebCore::ResourceHandle::start):
        (WebCore::ResourceHandle::platformLoadResourceSynchronously): Enable content encoding sniff to match existing behavior.
        * platform/network/soup/ResourceHandleSoup.cpp:
        (WebCore::ResourceHandle::create): Modified to take a boolean as to whether to enable content encoding sniffing.
        (WebCore::ResourceHandle::ResourceHandle): Ditto.
        (WebCore::ResourceHandle::releaseForDownload): Pass content encoding policy.
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::createRequest): Do not enable content encoding sniffing for the request.

2017-11-01  Jer Noble  <jer.noble@apple.com>

        [Performance] Painting <video> to canvas spends a lot of time in URL getting and parsing
        https://bugs.webkit.org/show_bug.cgi?id=179131

        Reviewed by Eric Carlson.

        Every time a <video> backed by MediaPlayerPrivateAVFoundation is asked to paint, it is first
        queried whether it has a single security origin. To do this, the media player asks
        AVFoundation what the "resolvedURL" of the asset is. This answer never changes after
        metadata is first fetched, so the answer should be cached. To do so, add a m_resolvedURL
        ivar to MediaPlayerPrivateAVFoundation, and add a setResolvedURL() and resolvedURLChanged()
        method to re-query the value. Also create ivars for the security origin rather than re-
        parsing them every time.

        Drive-by fix: clean up all the instances where we pass a String rather than a URL (and thus
        have to re-parse the URL at each point).

        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        (WebCore::MediaPlayerPrivateAVFoundation::load):
        (WebCore::MediaPlayerPrivateAVFoundation::hasSingleSecurityOrigin const):
        (WebCore::MediaPlayerPrivateAVFoundation::setResolvedURL):
        (WebCore::MediaPlayerPrivateAVFoundation::metadataLoaded):
        (WebCore::MediaPlayerPrivateAVFoundation::setPreload):
        (WebCore::MediaPlayerPrivateAVFoundation::resolvedURL const): Deleted.
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
        (WebCore::MediaPlayerPrivateAVFoundation::resolvedURL const):
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
        (WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURLChanged):
        (WebCore::AVFWrapper::createAssetForURL):
        (WebCore::MediaPlayerPrivateAVFoundationCF::resolvedURL const): Deleted.
        (WebCore::MediaPlayerPrivateAVFoundationCF::hasSingleSecurityOrigin const): Deleted.
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::canonicalURL):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
        (WebCore::canonicalURL):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin const): Deleted.

2017-11-01  Ryosuke Niwa  <rniwa@webkit.org>

        innerText->renderBox() can be null in HTMLTextFormControlElement::setSelectionRange
        https://bugs.webkit.org/show_bug.cgi?id=179103

        Reviewed by Antti Koivisto.

        Added a missing null check.

        Unfortunately, no new tests since we don't have a working reproduction for trunk code.

        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::setSelectionRange): Added a null check.

2017-11-01  Brady Eidson  <beidson@apple.com>

        Plumbing for handling SW scripts failing to evaluate
        https://bugs.webkit.org/show_bug.cgi?id=178926

        Reviewed by Chris Dumez.

        No new tests (Currently no observable behavior change).

        In an upcoming patch we'll actually run the appropriate observable steps for when
        a ServiceWorker script fails to evaluate.

        This is a standalone refactoring + plumbing patch that will make the observable changes
        easier to review.

        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::evaluate):
        * bindings/js/WorkerScriptController.h:
        (WebCore::WorkerScriptController::workerGlobalScopeWrapper):
        (WebCore::WorkerScriptController::vm):
        (WebCore::WorkerScriptController::initScriptIfNeeded):

        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):

        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::start):
        (WebCore::WorkerThread::workerThread):
        * workers/WorkerThread.h:

        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::registerServiceWorkerThreadForUpdate):
        (WebCore::SWContextManager::registerServiceWorkerThread): Deleted.
        * workers/service/context/SWContextManager.h:

        * workers/service/context/ServiceWorkerThread.h:
        (WebCore::ServiceWorkerThread::serverConnectionIdentifier const):
        (WebCore::ServiceWorkerThread::contextData const):

        * workers/service/context/ServiceWorkerThreadProxy.cpp:
        (WebCore::ServiceWorkerThreadProxy::create):
        (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::updateWorker):
        (WebCore::SWServer::createWorker): Deleted.
        * workers/service/server/SWServer.h:

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

2017-11-01  Ryosuke Niwa  <rniwa@webkit.org>

        Assert that NoEventDispatchAssertion is not in the stack when executing a script
        https://bugs.webkit.org/show_bug.cgi?id=179107

        Reviewed by Simon Fraser.

        Assert that NoEventDispatchAssertion::isEventAllowedInMainThread() is true when we're about to execute a script
        by adding the assertion in ScriptController::canExecuteScripts which gets called with AboutToExecuteScript
        whenever we're about to run scripts in event handlers, etc...

        We don't assert the construction of event handlers in JSLazyEventListener since this happens while copying
        the DOM tree inside a SVG use element and creating a event handler's JS function won't execute arbitrary scripts.

        No new tests since there should be no behavioral change other 

        * bindings/js/JSLazyEventListener.cpp:
        (WebCore::JSLazyEventListener::initializeJSFunction const): Use newly added AboutToCreateEventListener.
        (WebCore::JSLazyEventListener::create): Ditto.
        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::canExecuteScripts): Added the assertion.
        * bindings/js/ScriptController.h:

2017-11-01  Chris Dumez  <cdumez@apple.com>

        Regression(r219659): Can no longer log into ifttt.com using Google account
        https://bugs.webkit.org/show_bug.cgi?id=179117

        Reviewed by Geoffrey Garen.

        After r219659, it is no longer possible to log into ifttt.com using a Google
        account:
        - Signed into a Google account already
        - Visit https://ifttt.com/login
        - Click "Continue with Google"
        - Select the signed in account

        It turns out that this change to the HTML specification was not Web-compatible:
        See https://bugzilla.mozilla.org/show_bug.cgi?id=1412741 & https://github.com/whatwg/html/issues/3183

        This patch reverts r219659 for now until we agree on what behavior should get
        specified.

        No new tests, rebaselined existing tests.

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

2017-10-31  Dean Jackson  <dino@apple.com>

        transferFromImageBitmap should update canvas dimensions
        https://bugs.webkit.org/show_bug.cgi?id=179096
        <rdar://problem/35285218>

        Reviewed by Sam Weinig.

        When transferFromImageBitmap is called, the dimensions of the HTMLCanvasElement
        should be updated to reflect the size of the passed ImageBitmap.

        Update an existing WPT result.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::setImageBuffer const): Update the
        size of the element based on the incoming buffer.
        * html/HTMLCanvasElement.h: Mark m_size as mutable so we can
        call it from the const function setImageBuffer.

2017-11-01  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Introduce @toObject
        https://bugs.webkit.org/show_bug.cgi?id=178726

        Reviewed by Saam Barati.

        Use @isObject instead. It is more efficient.

        * Modules/mediastream/NavigatorUserMedia.js:
        (getUserMedia):

2017-11-01  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r224273 and r224278.
        https://bugs.webkit.org/show_bug.cgi?id=179120

        Some crashes under guard malloc (Requested by anttik on
        #webkit).

        Reverted changesets:

        "Remove empty continuations in
        RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers"
        https://bugs.webkit.org/show_bug.cgi?id=179014
        https://trac.webkit.org/changeset/224273

        "Fix ContinuationChainNode::insertAfter assertion."
        https://bugs.webkit.org/show_bug.cgi?id=179115
        https://trac.webkit.org/changeset/224278

2017-11-01  Emilio Cobos Álvarez  <emilio@crisal.io>

        Fix ContinuationChainNode::insertAfter assertion.
        https://bugs.webkit.org/show_bug.cgi?id=179115

        Reviewed by Antti Koivisto.

        The assertion was writing instead of reading next->previous.

        Hopefully it's harmless because it was clobbered on the same line, but
        it's worth asserting what it was intending to assert.

        No new tests (no behaviour change).

        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter):

2017-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>

        Use LazyNeverDestroyed instead of DEFINE_GLOBAL
        https://bugs.webkit.org/show_bug.cgi?id=174979

        Reviewed by Yusuke Suzuki.

        No new tests since there should be no behavioral change.

        * DerivedSources.cpp: Remove the warning of StaticConstructors.h.
        * WebCore.order: Removed
        * config.h: Removed definitions of SKIP_STATIC_CONSTRUCTORS_ON_MSVC and SKIP_STATIC_CONSTRUCTORS_ON_GCC.
        * dom/QualifiedName.cpp:
        (WebCore::createQualifiedName): Deleted.
        * dom/QualifiedName.h: Removed createQualifiedName.
        * dom/make_names.pl:
        (printCppHead): Do not include StaticConstructors.h.

2017-11-01  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Always include TextureMapper.cmake
        https://bugs.webkit.org/show_bug.cgi?id=179060

        Reviewed by Carlos Garcia Campos.

        * PlatformGTK.cmake:

2017-11-01  Antti Koivisto  <antti@apple.com>

        Remove empty continuations in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers
        https://bugs.webkit.org/show_bug.cgi?id=179014

        Reviewed by Geoff Garen.

        Treat continuation similarly to other anonymous wrappers. This makes things more understandable
        and allows removal of some questionable code in RenderBlock::takeChild.

        The patch also makes continuation chain a double linked so we can efficiently remove single
        continuations from the chain. It also gets rid of algorithms that recurse in continuation chain.

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::firstChildInContinuation):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::styleDidChange):

            Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
            the chain only in the (non-continuation) head renderer.

        (WebCore::RenderBlock::dropAnonymousBoxChild):

            Make a member function.

        (WebCore::RenderBlock::takeChild):

            Remove code that destroyed empty continuations and caused the parent to destroy itself.
            Empty continuations are now removed by RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers.

        * rendering/RenderBlock.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::ContinuationChainNode::ContinuationChainNode):
        (WebCore::RenderBoxModelObject::ContinuationChainNode::~ContinuationChainNode):
        (WebCore::RenderBoxModelObject::ContinuationChainNode::insertAfter):

            Track continuations with double linked lists.

        (WebCore::continuationChainNodeMap):
        (WebCore::RenderBoxModelObject::willBeDestroyed):

            Don't recurse to destroy continuation chain. 
            Destroy all continuations iteratively if this is the head of the chain.
            When destroying a continuation renderer simply remove it from the chain.

        (WebCore::RenderBoxModelObject::continuation const):
        (WebCore::RenderBoxModelObject::insertIntoContinuationChainAfter):
        (WebCore::RenderBoxModelObject::removeFromContinuationChain):
        (WebCore::RenderBoxModelObject::ensureContinuationChainNode):
        (WebCore::continuationMap): Deleted.
        (WebCore::RenderBoxModelObject::setContinuation): Deleted.
        * rendering/RenderBoxModelObject.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::RenderElement):
        (WebCore::RenderElement::removeAnonymousWrappersForInlinesIfNecessary):

            Make this a function of the parent renderer itself instead of getting 'parent()' as first operation and
            then using it.
            Don't remove continuations (isAnonymousBlockContinuation() test gives wrong result for the last continuation of the chain).

        (WebCore::RenderElement::styleDidChange):

            removeAnonymousWrappersForInlinesIfNecessary is no function of the parent.

        (WebCore::RenderElement::updateOutlineAutoAncestor):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::hasContinuationChainNode const):
        (WebCore::RenderElement::setHasContinuationChainNode):
        (WebCore::RenderElement::hasContinuation const): Deleted.
        (WebCore::RenderElement::setHasContinuation): Deleted.
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::styleDidChange):

            Don't add and remove continuations from the chain when updating style. Prevent recursion by walking
            the chain only in the (non-continuation) head renderer.

        (WebCore::RenderInline::addChildIgnoringContinuation):

            Remove the old continuation from the chain. splitFlow() will add it back into the right place.

        (WebCore::RenderInline::splitInlines):
        (WebCore::RenderInline::addChildToContinuation):
        (WebCore::RenderInline::childBecameNonInline):

            Remove the old continuation from the chain. splitFlow() will add it back into the right place.

        * rendering/RenderInline.h:
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded const):
        (WebCore::RenderObject::outputRenderObject const):
        (WebCore::findDestroyRootIncludingAnonymous):

            Allow anonymous continuations as destroy roots.

        (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):

            Removing a continuation may leave behind unnecessary anonymous sibling wrappers.
            Call removeAnonymousWrappersForInlinesIfNecessary() on parent after removal to get rid of them.

2017-10-31  Said Abou-Hallawa  <sabouhallawa@apple.com>

        updateMaskedAncestorShouldIsolateBlending() should check the Nullability of the computedStyle() of the element's ancestors
        https://bugs.webkit.org/show_bug.cgi?id=179085
        <rdar://problem/30888101>

        Reviewed by Ryosuke Niwa.

        This is a defensive change. The Element::computedStyle() can be null only
        if the element is not a connected to the DOM tree. This may happen if
        while the DOM tree is being changed, a different event is handled such
        that it requires styleReclac()/layout() to happen. In this case, the render
        tree will be in an incorrect state.

        * rendering/svg/SVGRenderSupport.cpp:
        (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):

2017-10-31  Alex Christensen  <achristensen@webkit.org>

        Use asynchronous ResourceHandleClient calls for WebKit1
        https://bugs.webkit.org/show_bug.cgi?id=160677

        Reviewed by Brady Eidson.

        Covered by existing tests.

        * PlatformAppleWin.cmake:
        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::willSendRequestAsync):
        (WebCore::ResourceLoader::didReceiveResponseAsync):
        (WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
        * loader/ResourceLoader.h:
        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
        (WebCore::ApplicationCacheGroup::willSendRequestAsync):
        (WebCore::ApplicationCacheGroup::canAuthenticateAgainstProtectionSpaceAsync):
        (WebCore::ApplicationCacheGroup::didReceiveResponse): Deleted.
        * loader/appcache/ApplicationCacheGroup.h:
        * platform/network/BlobResourceHandle.cpp:
        (WebCore::BlobResourceHandle::continueDidReceiveResponse):
        (WebCore::BlobResourceHandle::getSizeForNext):
        (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
        (WebCore::BlobResourceHandle::notifyResponseOnError):
        * platform/network/PingHandle.h:
        * platform/network/ResourceHandle.cpp:
        (WebCore::ResourceHandle::didReceiveResponse):
        (WebCore::ResourceHandle::usesAsyncCallbacks): Deleted.
        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleClient.cpp:
        (WebCore::ResourceHandleClient::~ResourceHandleClient):
        (WebCore::ResourceHandleClient::willSendRequest): Deleted.
        (WebCore::ResourceHandleClient::willSendRequestAsync): Deleted.
        (WebCore::ResourceHandleClient::didReceiveResponseAsync): Deleted.
        (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
        * platform/network/ResourceHandleClient.h:
        (WebCore::ResourceHandleClient::didReceiveAuthenticationChallenge):
        (WebCore::ResourceHandleClient::didReceiveResponse): Deleted.
        (WebCore::ResourceHandleClient::usesAsyncCallbacks): Deleted.
        (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpace): Deleted.
        * platform/network/ResourceHandleInternal.h:
        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
        * platform/network/SynchronousLoaderClient.cpp:
        (WebCore::SynchronousLoaderClient::willSendRequestAsync):
        (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
        (WebCore::SynchronousLoaderClient::didReceiveResponseAsync):
        (WebCore::SynchronousLoaderClient::didFinishLoading):
        (WebCore::SynchronousLoaderClient::didFail):
        (WebCore::SynchronousLoaderClient::willSendRequest): Deleted.
        (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace): Deleted.
        (WebCore::SynchronousLoaderClient::didReceiveResponse): Deleted.
        * platform/network/SynchronousLoaderClient.h:
        * platform/network/cf/ResourceHandleCFNet.cpp:
        (WebCore::ResourceHandle::createCFURLConnection):
        (WebCore::ResourceHandle::start):
        (WebCore::ResourceHandle::willSendRequest):
        (WebCore::ResourceHandle::shouldUseCredentialStorage):
        (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::ResourceHandleCFURLConnectionDelegateWithOperationQueue):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::shouldUseCredentialStorage):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueCanAuthenticateAgainstProtectionSpace):
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
        * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Removed.
        * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: Removed.
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::start):
        (WebCore::ResourceHandle::schedule):
        (WebCore::ResourceHandle::makeDelegate):
        (WebCore::ResourceHandle::delegate):
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        (WebCore::ResourceHandle::willSendRequest):
        (WebCore::ResourceHandle::continueWillSendRequest):
        (WebCore::ResourceHandle::continueDidReceiveResponse):
        (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
        (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace):
        (WebCore::ResourceHandle::continueWillCacheResponse):
        (WebCore::ResourceHandle::shouldUseCredentialStorage): Deleted.
        * platform/network/mac/WebCoreResourceHandleAsDelegate.h: Removed.
        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Removed.
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

2017-10-31  Simon Fraser  <simon.fraser@apple.com>

        Rubber-banding overflow-scrolling-touch shows black
        https://bugs.webkit.org/show_bug.cgi?id=179087
        rdar://problem/35260253

        Reviewed by Sam Weinig.

        The "backgroundIsKnownToBeObscured" optimization was kicking in for an overflow:scroll
        whose area was completely covered by its contents, which happens with overlay scrollbars.

        However, this ignored the fact that you can rubber-band to reveal the background, and,
        on iOS, composited scrolling requires that the scroller background is painted since it goes
        into its own layer.

        Fix by turning off the optimization for layers that scroll overflow, including those
        using composited scrolling.

        Test: fast/scrolling/rubber-band-shows-background.html

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::foregroundIsKnownToBeOpaqueInRect const):
        (WebCore::RenderBox::computeBackgroundIsKnownToBeObscured):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::scrollTo):
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/RenderLayer.h:

2017-10-31  Tim Horton  <timothy_horton@apple.com>

        Clean up some drag and drop feature flags
        https://bugs.webkit.org/show_bug.cgi?id=179082

        Reviewed by Simon Fraser.

        * Configurations/FeatureDefines.xcconfig:

2017-10-31  Simon Fraser  <simon.fraser@apple.com>

        Make it possible to test rubber-banding in overflow scroll
        https://bugs.webkit.org/show_bug.cgi?id=179078

        Reviewed by Sam Weinig.

        Test: fast/scrolling/unconstrained-scrollto.html
        
        Add internals.unconstrainedScrollTo(element, x, y) and plumb through ScrollClamping
        (which replaces RenderLayer::ScrollOffsetClamping) to support it.

        Flip the default from unclamped to clamped for various RenderLayer scrolling-related
        functions, since most callers want clamped.

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::scrollTo const):
        * dom/Element.cpp:
        (WebCore::Element::scrollTo):
        * dom/Element.h:
        * html/HTMLBodyElement.cpp:
        (WebCore::HTMLBodyElement::scrollTo):
        * html/HTMLBodyElement.h:
        * html/TextFieldInputType.cpp:
        (WebCore::TextFieldInputType::elementDidBlur):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::scrollTo const):
        * page/DOMWindow.h:
        * page/Frame.cpp:
        (WebCore::Frame::scrollOverflowLayer):
        (WebCore::Frame::checkOverflowScroll):
        * platform/ScrollAnimator.cpp:
        (WebCore::ScrollAnimator::scrollToOffsetWithoutAnimation):
        * platform/ScrollAnimator.h:
        * platform/ScrollTypes.h:
        * platform/ScrollableArea.cpp:
        (WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
        * platform/ScrollableArea.h:
        * platform/cocoa/ScrollController.h:
        * platform/mac/ScrollAnimatorMac.h:
        * platform/mac/ScrollAnimatorMac.mm:
        (WebCore::ScrollAnimatorMac::scrollToOffsetWithoutAnimation):
        (WebCore::ScrollAnimatorMac::immediateScrollToPosition):
        * platform/mock/ScrollAnimatorMock.h:
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::setScrollLeft):
        (WebCore::RenderBox::setScrollTop):
        * rendering/RenderBox.h:
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::panScrollFromPoint):
        (WebCore::RenderLayer::scrollByRecursively):
        (WebCore::RenderLayer::applyPostLayoutScrollPositionIfNeeded):
        (WebCore::RenderLayer::scrollToXPosition):
        (WebCore::RenderLayer::scrollToYPosition):
        (WebCore::RenderLayer::scrollToOffset):
        * rendering/RenderLayer.h:
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::setScrollLeft):
        (WebCore::RenderListBox::setScrollTop):
        * rendering/RenderListBox.h:
        * rendering/RenderTextControlSingleLine.cpp:
        (WebCore::RenderTextControlSingleLine::setScrollLeft):
        (WebCore::RenderTextControlSingleLine::setScrollTop):
        * rendering/RenderTextControlSingleLine.h:
        * testing/Internals.cpp:
        (WebCore::Internals::unconstrainedScrollTo):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-10-31  Dean Jackson  <dino@apple.com>

        Accept Settings object in ImageBitmapRenderingContext constructor and getContext
        https://bugs.webkit.org/show_bug.cgi?id=179075
        <rdar://problem/35279965>

        Reviewed by Sam Weinig.

        Allow getContext("bitmaprenderer") to take a dictionary as another argument, and
        pass that on to the ImageBitmapRenderingContext constructor.

        Unfortunately this meant having to move ImageBitmapRenderingContext::Settings out into
        a stand-alone struct, since it needs to be defined in HTMLCanvasElement, which itself
        needs to be defined for ImageBitmapRenderingContext.

        * DerivedSources.make: Add new IDL.
        * WebCore.xcodeproj/project.pbxproj: New files.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::createContextBitmapRenderer):
        (WebCore::HTMLCanvasElement::getContextBitmapRenderer):

            Accept the ImageBitmapRenderingContextSettings object, and pass it on.

        * html/HTMLCanvasElement.h:
        * html/canvas/ImageBitmapRenderingContext.cpp:
        (WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
        * html/canvas/ImageBitmapRenderingContext.h:
        * html/canvas/ImageBitmapRenderingContext.idl:
        * html/canvas/ImageBitmapRenderingContextSettings.h: Copied from Source/WebCore/html/canvas/ImageBitmapRenderingContext.idl.
        * html/canvas/ImageBitmapRenderingContextSettings.idl: Added.

2017-10-31  Tim Horton  <timothy_horton@apple.com>

        Fix up some content filtering feature flags
        https://bugs.webkit.org/show_bug.cgi?id=179079

        Reviewed by Simon Fraser.

        * Configurations/FeatureDefines.xcconfig:

2017-10-31  Chris Dumez  <cdumez@apple.com>

        navigator.serviceWorker should always return the same object
        https://bugs.webkit.org/show_bug.cgi?id=179067

        Reviewed by Youenn Fablet.

        navigator.serviceWorker should always return the same object:
        - https://www.w3.org/TR/service-workers-1/#navigator-service-worker

        Add visitor to make sure we don't gc() the ServiceWorkerContainer wrapper too early.

        Test: http/tests/workers/service/navigator-serviceWorker-same-object.html

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSNavigatorCustom.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerContainer.idl.
        (WebCore::JSNavigator::visitAdditionalChildren):
        * page/Navigator.idl:
        * workers/service/ServiceWorkerContainer.idl:

2017-10-31  Antoine Quint  <graouts@apple.com>

        [Web Animations] Support AnimationEffect parameter in Animation constructor and read-write timeline property
        https://bugs.webkit.org/show_bug.cgi?id=179066

        Reviewed by Dean Jackson.

        We update the Animation constructor signature and behavior to allow for an AnimationEffect as its first,
        null by default, parameter and implement the spec behavior where an omitted AnimationTimeline parameter
        should default to the document timeline. We also make the timeline property read-write.

        Existing tests are rebaselined and amended for this new behavior.

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::create):
        (WebCore::WebAnimation::WebAnimation):
        (WebCore::WebAnimation::setEffect):
        (WebCore::WebAnimation::setTimeline):
        * animation/WebAnimation.h:
        * animation/WebAnimation.idl:

2017-10-31  Ali Juma  <ajuma@chromium.org>

        Layout viewport rect is too wide after window resize
        https://bugs.webkit.org/show_bug.cgi?id=175235

        Reviewed by Dave Hyatt.

        After a window resize, ScrollView::updateScrollbars adds/removes scrollbars and triggers
        layout. Each addition or removal triggers another pass, but at most 2 additional passes
        are allowed. If a scrollbar is added or removed in the final allowed pass, layout is
        left in an inconsistent state wrt the presence of scrollbars.

        To avoid unnecessary passes, don't remove both scrollbars when only one needs to be
        removed. This saves the extra pass needed to add the scrollbar back.

        Test: fast/dom/Window/window-resize-update-scrollbars.html

        * platform/ScrollView.cpp:
        (WebCore::ScrollView::updateScrollbars):

2017-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Implement WKWebView SPI for inserting attachment elements
        https://bugs.webkit.org/show_bug.cgi?id=179013
        <rdar://problem/35249668>

        Reviewed by Tim Horton.

        Adds Editor helper methods to insert an attachment element at the current selection.

        Test: WKAttachmentTests.AttachmentElementInsertion

        * editing/Editor.cpp:
        (WebCore::Editor::insertAttachment):
        (WebCore::Editor::insertAttachmentFromFile):
        * editing/Editor.h:

        Add two new helpers for inserting attachment elements, either from a filename or a data blob. This is a wrapper
        around Editor::replaceSelectionWithFragment.

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

        Add a unique identifier string to HTMLAttachmentElement. This unique identifier allows the UI process to
        reference and indirectly manipulate attachment elements.

2017-10-31  Alex Christensen  <achristensen@webkit.org>

        Fix custom header field setting with reloads and asynchronous navigation action policy decisions
        https://bugs.webkit.org/show_bug.cgi?id=179064

        Reviewed by Tim Horton.

        r223909 had two problems:
        1. It called addHTTPHeaderField instead of setHTTPHeaderField, so when a page is reloaded the header field
        is added to the resource request to be reloaded, which already had the headers added.
        2. It only worked in the synchronous decidePolicyForNavigationAction code path, not for asynchronous completion handlers.

        These are both fixed, and both cases are covered with new API tests.

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

2017-10-31  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: make ScriptCallStack::maxCallStackSizeToCapture the default value when capturing backtraces
        https://bugs.webkit.org/show_bug.cgi?id=179048

        Reviewed by Mark Lam.

        No change in functionality.

        * bindings/js/JSDOMExceptionHandling.cpp:
        (WebCore::reportException):
        * dom/RejectedPromiseTracker.cpp:
        (WebCore::createScriptCallStackFromReason):
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::compileShader):
        (WebCore::WebGLRenderingContextBase::printToConsole):
        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::buildInitiatorObject):
        * inspector/PageDebuggerAgent.cpp:
        (WebCore::PageDebuggerAgent::breakpointActionLog):
        * inspector/WorkerDebuggerAgent.cpp:
        (WebCore::WorkerDebuggerAgent::breakpointActionLog):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::postMessage):

2017-10-31  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Build more files under WebCore as unified sources
        https://bugs.webkit.org/show_bug.cgi?id=178968

        Reviewed by Keith Miller.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * SourcesGTK.txt: Added.
        * SourcesWPE.txt:

2017-10-30  Ryosuke Niwa  <rniwa@webkit.org>

        Assert that no script is executed during LayoutPhase::InRenderTreeLayout
        https://bugs.webkit.org/show_bug.cgi?id=179046

        Reviewed by Antti Koivisto.

        Added NoEventDispatchAssertion to LayoutPhase::InRenderTreeLayout.

        * page/LayoutContext.cpp:
        (WebCore::LayoutContext::layout):

2017-10-31  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: replace Canvas stack iteration with createScriptCallStack
        https://bugs.webkit.org/show_bug.cgi?id=178980

        Reviewed by Joseph Pecoraro.

        No new tests, updated existing tests.

        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::buildObjectForCanvas):
        (WebCore::InspectorCanvas::buildAction):
        (WebCore::iterateCallFrames): Deleted.

2017-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>

        [FreeType] Simple and complex paths are not applied consistently
        https://bugs.webkit.org/show_bug.cgi?id=177601

        Reviewed by Michael Catanzaro.

        Due to bug #100050, when rendering text, the complex path is forced in case kerning or shaping is enabled and
        only part of the run is going to be rendered. This happens in the GTK+ port when selecting text (except when
        selecting the whole run, of course). The text is initially rendered using the simple path as returned by
        FontCascade::codePath() and then the selection is rendered using the complex path, overriding what
        FontCascade::codePath() returned in that case. This doesn't happen in mac, because the selection is rendered
        differently, so FontCascade::drawText always renders the full run (simple path) when selecting text. Selecting
        text is the most noticeable inconsistency, but it's not the only one. Similar exceptions are applied when
        calculating the text width, or getting the offset of a given position. The rendered text is the simple one, but
        the calculations are performed using the complex path, so depending on the kerning and ligatures we might end up
        with wrong results. If the text has been rendered using the simple path, the selections and all other
        calculations should be performed with the simple path too. This patch moves the condition to force complex text
        to FontCascade::codePath(), and only for non Freetype ports. This ensures that all callers to
        FontCascade::codePath() will get a consistent result.

        * platform/graphics/FontCascade.cpp:
        (WebCore::FontCascade::drawText const): Use the mode returned by codePath().
        (WebCore::FontCascade::drawEmphasisMarks const): Ditto.
        (WebCore::FontCascade::adjustSelectionRectForText const): Use the mode returned by codePath().
        (WebCore::FontCascade::offsetForPosition const): Ditto.
        (WebCore::FontCascade::codePath const): Force complex text for partial runs for ports not enabling advance text
        rendering mode by default.
        * platform/graphics/FontCascade.h: Add to and from optional parameters to codePath().

2017-10-30  Chris Dumez  <cdumez@apple.com>

        Fire updatefound event after resolving the registration promise
        https://bugs.webkit.org/show_bug.cgi?id=178985

        Reviewed by Youenn Fablet.

        Fake series of events that are supposed to happen after registering a service worker
        that notify the page of the service worker's installation and activation.

        Also make sure that registration.installing / waiting / active return proper values.
        Make sure that serviceWorker.scriptURL returns a proper value.

        This unblocks a lot of web-platform-tests since they were blocked shortly after
        registration due to missing events or registration.installing being null.

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::activeServiceWorker const):
        (WebCore::ScriptExecutionContext::setActiveServiceWorker):
        * dom/ScriptExecutionContext.h:
        * loader/WorkerThreadableLoader.cpp:
        (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::prepareFetch):
        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::loadSynchronously):
        (WebCore::WorkerScriptLoader::loadAsynchronously):
        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::ServiceWorker):
        (WebCore::ServiceWorker::setState):
        * workers/service/ServiceWorker.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::controller const):
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
        (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
        (WebCore::ServiceWorkerRegistration::installing):
        (WebCore::ServiceWorkerRegistration::waiting):
        (WebCore::ServiceWorkerRegistration::active):
        * workers/service/ServiceWorkerRegistration.h:
        * workers/service/ServiceWorkerRegistrationData.cpp:
        (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
        * workers/service/ServiceWorkerRegistrationData.h:
        (WebCore::ServiceWorkerRegistrationData::encode const):
        (WebCore::ServiceWorkerRegistrationData::decode):
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::scriptContextStarted):
        (WebCore::SWServerRegistration::runRegisterJob):
        (WebCore::SWServerRegistration::data const):
        * workers/service/server/SWServerRegistration.h:

2017-10-30  Fujii Hironori  <Hironori.Fujii@sony.com>

        Use LazyNeverDestroyed instead of DEFINE_GLOBAL for XMLNames, HTMLNames, MathMLNames and SVGNames
        https://bugs.webkit.org/show_bug.cgi?id=175118

        Reviewed by Alex Christensen.

        Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.

        No new tests since there should be no behavioral change.

        * dom/make_names.pl:
        (printConstructors):
        (printNamesHeaderFile):
        (printNamesCppFile):
        (printDefinitions):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const):
        * css/StyleResolver.cpp:
        (WebCore::hasEffectiveDisplayNoneForDisplayContents):
        * dom/CustomElementReactionQueue.cpp:
        (WebCore::CustomElementReactionQueue::observesStyleAttribute const):
        * dom/Document.cpp:
        (WebCore::Document::validateCustomElementName):
        * dom/Element.cpp:
        (WebCore::isStyleAttribute):
        (WebCore::canAttachAuthorShadowRoot):
        * dom/ElementData.cpp:
        (WebCore::ElementData::findLanguageAttribute const):
        * domjit/JSDocumentDOMJIT.cpp:
        (WebCore::compileDocumentBodyAttribute):
        * editing/Editor.cpp:
        (WebCore::Editor::applyEditingStyleToBodyElement const):
        * editing/EditorCommand.cpp:
        (WebCore::valueDefaultParagraphSeparator):
        * editing/MarkupAccumulator.cpp:
        (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
        (WebCore::MarkupAccumulator::appendNamespace):
        (WebCore::MarkupAccumulator::elementCannotHaveEndTag):
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::isProhibitedParagraphChild):
        * html/HTMLBodyElement.cpp:
        (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
        * html/HTMLDocument.cpp:
        (WebCore::HTMLDocument::isCaseSensitiveAttribute):
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::createEventHandlerNameMap):
        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::HTMLConstructionSite::findFosterSite):
        * html/parser/HTMLElementStack.cpp:
        (WebCore::HTMLElementStack::hasTemplateInHTMLScope const):
        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::updatePredictedBaseURL):
        * html/parser/HTMLTreeBuilder.cpp:
        (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope):
        (WebCore::HTMLTreeBuilder::processStartTagForInBody):
        (WebCore::HTMLTreeBuilder::processTemplateEndTag):
        (WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
        (WebCore::HTMLTreeBuilder::processStartTag):
        (WebCore::HTMLTreeBuilder::processBodyEndTagForInBody):
        (WebCore::HTMLTreeBuilder::processEndTagForInBody):
        (WebCore::HTMLTreeBuilder::processCaptionEndTagForInCaption):
        (WebCore::HTMLTreeBuilder::processTableEndTagForInTable):
        (WebCore::HTMLTreeBuilder::processEndTag):
        (WebCore::HTMLTreeBuilder::insertPhoneNumberLink):
        (WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
        (WebCore::HTMLTreeBuilder::defaultForBeforeHead):
        (WebCore::HTMLTreeBuilder::defaultForInHead):
        (WebCore::HTMLTreeBuilder::defaultForInHeadNoscript):
        (WebCore::HTMLTreeBuilder::defaultForAfterHead):
        * html/parser/TextDocumentParser.cpp:
        (WebCore::TextDocumentParser::insertFakePreElement):
        * rendering/svg/SVGPathData.cpp:
        (WebCore::pathFromGraphicsElement):
        * rendering/svg/SVGResources.cpp:
        (WebCore::clipperFilterMaskerTags):
        (WebCore::markerTags):
        (WebCore::fillAndStrokeTags):
        (WebCore::chainableResourceTags):
        * svg/SVGAnimatedBoolean.h:
        * svg/SVGAnimatedEnumeration.h:
        * svg/SVGAnimatedInteger.h:
        * svg/SVGAnimatedLength.h:
        * svg/SVGAnimatedLengthList.h:
        * svg/SVGAnimatedNumber.h:
        * svg/SVGAnimatedNumberList.h:
        * svg/SVGAnimatedPreserveAspectRatio.h:
        * svg/SVGAnimatedRect.h:
        * svg/SVGAnimatedString.h:
        * svg/SVGAnimatedTransformList.h:
        * svg/SVGAnimationElement.cpp:
        (WebCore::SVGAnimationElement::isSupportedAttribute):
        * svg/SVGCursorElement.cpp:
        (WebCore::SVGCursorElement::isSupportedAttribute):
        * svg/SVGElement.cpp:
        (WebCore::createAttributeNameToCSSPropertyIDMap):
        (WebCore::SVGElement::childShouldCreateRenderer const):
        (WebCore::SVGElement::animatableAttributeForName):
        * svg/SVGFilterElement.cpp:
        (WebCore::SVGFilterElement::isSupportedAttribute):
        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
        (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute):
        * svg/SVGForeignObjectElement.cpp:
        (WebCore::SVGForeignObjectElement::isSupportedAttribute):
        * svg/SVGGradientElement.cpp:
        (WebCore::SVGGradientElement::isSupportedAttribute):
        * svg/SVGImageElement.cpp:
        (WebCore::SVGImageElement::isSupportedAttribute):
        * svg/SVGLineElement.cpp:
        (WebCore::SVGLineElement::isSupportedAttribute):
        * svg/SVGMarkerElement.cpp:
        (WebCore::SVGMarkerElement::isSupportedAttribute):
        * svg/SVGMaskElement.cpp:
        (WebCore::SVGMaskElement::isSupportedAttribute):
        * svg/SVGPathElement.cpp:
        (WebCore::SVGPathElement::dPropertyInfo):
        (WebCore::SVGPathElement::isSupportedAttribute):
        * svg/SVGPatternElement.cpp:
        (WebCore::SVGPatternElement::isSupportedAttribute):
        * svg/SVGPolyElement.cpp:
        (WebCore::SVGPolyElement::pointsPropertyInfo):
        * svg/SVGRadialGradientElement.cpp:
        (WebCore::SVGRadialGradientElement::isSupportedAttribute):
        * svg/SVGTextContentElement.cpp:
        (WebCore::SVGTextContentElement::textLengthPropertyInfo):
        (WebCore::SVGTextContentElement::isSupportedAttribute):
        * svg/SVGTextPathElement.cpp:
        (WebCore::SVGTextPathElement::isSupportedAttribute):
        * svg/SVGUseElement.cpp:
        (WebCore::createAllowedElementSet):
        * xml/NativeXPathNSResolver.cpp:
        (WebCore::NativeXPathNSResolver::lookupNamespaceURI):
        * xml/parser/XMLDocumentParser.cpp:
        (WebCore::XMLDocumentParser::parseDocumentFragment):

2017-10-30  Jer Noble  <jer.noble@apple.com>

        [WebGL] Optimization to skip painting if texture and source surface hasn't changed isn't working; re-optimize.
        https://bugs.webkit.org/show_bug.cgi?id=178953

        Reviewed by Dean Jackson.

        The "seed" value of the current bound texture never matches the last saved value in
        VideoTextureCopierCV::copyImageToPlatformTexture(). The value is modified by the function
        itself, so a fresh value needs to be re-queried after the image's surface is attached to the
        texture.

        Once this fix is in, however, the <canvas> being painted will flash when no new image is
        available. This is because the wrong texture target is being restored by the GC3DStateSaver
        at the end of copyImageToPlatformTexture(). While we're fixing that, we may as well use the
        texture state saved by the GraphicsContext3D itself to restore the correct texture unit,
        texture target, and texture.

        * platform/graphics/GraphicsContext3D.h:
        (WebCore::GraphicsContext3D::activeTextureUnit const):
        (WebCore::GraphicsContext3D::currentBoundTexture const):
        (WebCore::GraphicsContext3D::currentBoundTarget const):
        (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture const):
        (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture const):
        (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTarget const):
        (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTarget const):
        (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture): Deleted.
        (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture): Deleted.
        (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTarget): Deleted.
        * platform/graphics/cv/VideoTextureCopierCV.cpp:
        (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
        * platform/graphics/cv/VideoTextureCopierCV.h:
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::prepareTexture):
        (WebCore::GraphicsContext3D::activeTexture):
        (WebCore::GraphicsContext3D::bindTexture):

2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>

        WKBundlePageWillSendSubmitEventCallback is called with incorrect frame parameter
        https://bugs.webkit.org/show_bug.cgi?id=176719

        Reviewed by Chris Dumez.

        WKBundlePageWillSendSubmitEventCallback is clearly intended to parallel
        WKBundlePageWillSubmitFormCallback, since almost all the parameters are the same. Now, in
        WKBundlePageWillSubmitFormCallback, the first WKBundleFrameRef, "frame", is the frame of the
        form target, and the second WKBundleFrameRef, sourceFrame, is the frame containing the form.
        That's correct. But in WKBundlePageWillSendSubmitEventCallback, both frame and sourceFrame
        are always identical. The problem is that the FrameLoaderClient delegate is called on the
        wrong FrameLoaderClient. It should be called on the FrameLoaderClient of the target frame,
        but HTMLFormElement calls it on the FrameLoaderClient of the source frame instead.

        Fix this by factoring the target frame computation out of FormSubmission into some helpers.

        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::prepareForSubmission):
        (WebCore::HTMLFormElement::effectiveTarget const):
        (WebCore::HTMLFormElement::findSubmitButton const):
        * html/HTMLFormElement.h:
        * loader/FormSubmission.cpp:
        (WebCore::FormSubmission::create):

2017-10-30  Alex Christensen  <achristensen@webkit.org>

        ASSERTION FAILED: internalValuesConsistent(m_url) in WebCore::URLParser::URLParser
        https://bugs.webkit.org/show_bug.cgi?id=178861

        Reviewed by Tim Horton.

        This is a dark corner of the URL spec that has wildly different behavior in different browsers.
        The assertion fired when we have a file URL with a ? or a # after file:// and it was because
        m_pathAfterLastSlash was still 0. We definitely shouldn't assert. I'm making us consistent with
        other cases where we have nothing there and add an implied missing slash.
        
        Covered by new API tests.

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

2017-10-27  Megan Gardner  <megan_gardner@apple.com>

        Correctly determine affinity when inserting text via Keyboard Suggestions
        https://bugs.webkit.org/show_bug.cgi?id=178969

        Reviewed by Ryosuke Niwa.

        There has been talk about renaming these enums, but in the meantime we should at least have a comment 
        clarifying what they actually mean.

        No new tests only adding a comment, no tests needed.

        * editing/TextAffinity.h:

2017-10-27  Ryosuke Niwa  <rniwa@webkit.org>

        Crash in addChildNodesToDeletionQueue
        https://bugs.webkit.org/show_bug.cgi?id=178974
        <rdar://problem/35234372>

        Reviewed by Brent Fulgham.

        The bug was caused by HTMLConstructionSite::insertTextNode constructing an ill-formed tree
        when fostering parent under a template element by adjusting HTMLConstructionSiteTask's parent
        without clearing nextChild. Fixed the crash by simply removing this code since executeTask
        already takes care of fostering the parent in static inline insert(HTMLConstructionSiteTask&).

        Test: fast/parser/foster-parent-under-template.html

        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::HTMLConstructionSite::insertTextNode):

2017-10-30  Commit Queue  <commit-queue@webkit.org>

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

        MotionMark regression (Requested by shallawa on #webkit).

        Reverted changeset:

        "When navigating back to a page, compositing layers may not
        use accelerated drawing"
        https://bugs.webkit.org/show_bug.cgi?id=178749
        https://trac.webkit.org/changeset/224078

2017-10-30  Dean Jackson  <dino@apple.com>

        Implement "bitmaprenderer" CanvasRenderingContext
        https://bugs.webkit.org/show_bug.cgi?id=178992
        <rdar://problem/34147157>

        Reviewed by Sam Weinig.

        Implement the "bitmaprenderer" context for HTMLCanvasElement.
        Use as much of the existing 2d context code as possible, which
        means that we are painting the ImageBitmap into the backing
        store. This isn't optimal, but it is good enough to get
        going while we move buffer ownership from the canvas object
        into the rendering contexts.

        This patch raised a few issues on the HTML specification:
        https://github.com/whatwg/html/issues/3164
        https://github.com/whatwg/html/issues/3165
        https://github.com/whatwg/html/issues/3166
        https://github.com/whatwg/html/issues/3167

        Update existing Web Platform Test results.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::createContext2d): Drive-by comment fix.
        (WebCore::HTMLCanvasElement::createContextWebGL): Ditto.
        (WebCore::HTMLCanvasElement::createContextWebGPU): Ditto.
        (WebCore::HTMLCanvasElement::createContextBitmapRenderer): We now require
        a layer/backing store for a bitmap context.
        (WebCore::HTMLCanvasElement::paintsIntoCanvasBuffer const): Add bitmap-renderer
        to the type of context that uses the canvas's backing store.
        (WebCore::HTMLCanvasElement::createImageBuffer const): Comment fix.
        (WebCore::HTMLCanvasElement::setImageBuffer const): Change parameter to a &&.
        (WebCore::HTMLCanvasElement::setImageBufferAndMarkDirty): New function to set
        the backing store efficiently, as well as make it look like we need to repaint
        the entire canvas.
        (WebCore::HTMLCanvasElement::drawingContext const): The buffer doesn't actually
        need to provide a GraphicsContext if we're a bitmap renderer.
        * html/HTMLCanvasElement.h:

        * html/ImageBitmap.cpp:
        (WebCore::ImageBitmap::transferOwnershipAndClose): New helper to give the ownership
        of the ImageBuffer away, and look like close() was called.
        * html/ImageBitmap.h:

        * html/canvas/ImageBitmapRenderingContext.cpp: Implement the algorithm from the HTML
        specification.
        (WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
        (WebCore::ImageBitmapRenderingContext::isAccelerated const):
        (WebCore::ImageBitmapRenderingContext::setOutputBitmap):
        (WebCore::ImageBitmapRenderingContext::transferFromImageBitmap):
        * html/canvas/ImageBitmapRenderingContext.h:
        * html/canvas/ImageBitmapRenderingContext.idl:

2017-10-30  Simon Fraser  <simon.fraser@apple.com>

        tab-size: 0px asserts
        https://bugs.webkit.org/show_bug.cgi?id=176198

        Reviewed by Antti Koivisto.

        Don't claim to support tab-size values with units. We don't, and they would become 0, rather
        than fall back to the default as should happen.

        Enhanced fast/css/tab-size.html to test.

        * css/parser/CSSPropertyParser.cpp:
        (WebCore::consumeTabSize):

2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] Fix build warnings
        https://bugs.webkit.org/show_bug.cgi?id=178899

        Reviewed by Carlos Alberto Lopez Perez.

        These are actually mostly cross-platform issues.

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::arrayBufferViewElementSize):
        * platform/Cairo.cmake:
        * platform/Curl.cmake:
        * platform/FreeType.cmake:
        * platform/GCrypt.cmake:
        * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
        (WebCore::TextureMapperShaderProgram::create):
        * platform/network/soup/SoupNetworkSession.cpp:
        (WebCore::SoupNetworkSession::SoupNetworkSession):

2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE] Build more files under WebCore as unified sources and get rid of WebCorePlatformWPE build target
        https://bugs.webkit.org/show_bug.cgi?id=178964

        Reviewed by Carlos Alberto Lopez Perez.

        This also gets rid of the WebCorePlatformWPE build target to simplify the build. It links to
        all the same libraries as the WebCore target, so it doesn't seem to have any purpose. Bye.

        Some CMake files under platform are not unified, either because there is not much to gain
        (e.g. ImageDecoders, where everything is in a separate directory), or because it is complex
        (e.g. GStreamer, where GObject implementations would be tricky to build unified), and
        because we're limited to using only features declared in WebKitFeatures.cmake inside the
        unified sources lists, which makes some of the platform files a bit tricky (notably,
        anything that needs to go into WebCorePlatformGTK for the GTK port). So it's not perfect.

        * PlatformWPE.cmake:
        * SourcesWPE.txt: Added.
        * crypto/gcrypt/GCryptUtilities.h:
        * platform/Cairo.cmake:
        * platform/GCrypt.cmake:
        * platform/SourcesCairo.txt: Added.
        * platform/SourcesGCrypt.txt: Added.
        * platform/SourcesGLib.txt: Added.
        * platform/SourcesSoup.txt: Added.

2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>

        Remove more unused ENABLE(GAMEPAD_DEPRECATED) code
        https://bugs.webkit.org/show_bug.cgi?id=178364

        Reviewed by Carlos Alberto Lopez Perez.

        * Modules/gamepad/deprecated/Gamepad.cpp: Removed.
        * Modules/gamepad/deprecated/Gamepad.h: Removed.
        * Modules/gamepad/deprecated/Gamepad.idl: Removed.
        * Modules/gamepad/deprecated/GamepadList.cpp: Removed.
        * Modules/gamepad/deprecated/GamepadList.h: Removed.
        * Modules/gamepad/deprecated/GamepadList.idl: Removed.
        * Modules/gamepad/deprecated/NavigatorGamepad.cpp: Removed.
        * Modules/gamepad/deprecated/NavigatorGamepad.h: Removed.
        * Modules/gamepad/deprecated/NavigatorGamepad.idl: Removed.

2017-10-30  Daniel Bates  <dabates@apple.com>

        Use if conditional function in DerivedSources.make to reduce duplication
        https://bugs.webkit.org/show_bug.cgi?id=178989

        Reviewed by Darin Adler.

        In DerivedSources.make we currently duplicate most of the Makefile recipe for generating HTML/SVG
        tags and attributes to support passing the optional command line option --extraDefines when one
        or more HTML/SVG compile-time features are enabled. Instead we can make use of a Makefile
        conditional function in the recipe itself to avoid code duplication.

        * DerivedSources.make:

2017-10-30  Antoine Quint  <graouts@apple.com>

        [Web Animations] Expose the playbackRate property on Animation
        https://bugs.webkit.org/show_bug.cgi?id=178931

        Reviewed by Sam Weinig.

        Account for the playback rate when computing and setting an animation's
        current time, ensuring that we adjust the start time to preserve the
        current time when setting a new playback rate.

        Test: http/wpt/wk-web-animations/timing-model/animation-playback-rate.html

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::WebAnimation):
        (WebCore::WebAnimation::currentTime const):
        (WebCore::WebAnimation::setCurrentTime):
        (WebCore::WebAnimation::setPlaybackRate):
        * animation/WebAnimation.h:
        * animation/WebAnimation.idl:

2017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] Expose availability of certain editing commands in WebKitEditorState
        https://bugs.webkit.org/show_bug.cgi?id=168219

        Reviewed by Ryosuke Niwa.

        Make Editor::canUndo and Editor::canRedo const.

        Also, remove unused allowsCopy from HitTestResult.

        * editing/Editor.cpp:
        (WebCore::Editor::canUndo const):
        (WebCore::Editor::canRedo const):
        (WebCore::Editor::canUndo): Deleted.
        (WebCore::Editor::canRedo): Deleted.
        * editing/Editor.h:
        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::allowsCopy const): Deleted.
        * rendering/HitTestResult.h:
        * rendering/SelectionRangeData.cpp:

2017-10-27  Antti Koivisto  <antti@apple.com>

        Destroy all unneeded anonymous wrappers in RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers()
        https://bugs.webkit.org/show_bug.cgi?id=178933

        Reviewed by Zalan Bujtas.

        Currently it just cleans up table related wrappers.

        * rendering/RenderObject.cpp:
        (WebCore::findDestroyRootIncludingAnonymous):

        Continuations are left as future work.

2017-10-30  Zalan Bujtas  <zalan@apple.com>

        Remove reference to RenderTreeInternalMutationScope
        https://bugs.webkit.org/show_bug.cgi?id=178998
        <rdar://problem/35246464>

        Reviewed by Antti Koivisto.

        We don't have such class anymore.

        No change in functionality.

        * rendering/RenderView.h:

2017-10-30  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Add support for P-521 EC curves
        https://bugs.webkit.org/show_bug.cgi?id=175199

        Reviewed by Jiewen Tan.

        Add support for 521-bit elliptic curves in the libgcrypt-based
        implementation of WebCrypto API.

        In the CryptoAlgorithmECDH implementation, the bit-size of the key is now
        rounded up to the next byte boundary and passed to the helper
        gcryptDerive() function. There the size in bytes is used to zero-pad the
        derived key data. This is done to properly handle derivation results for
        the P-521 curves, where the leading zero bit could get clipped, resulting
        in a derived key that is only 65 byes in length when it is expected to be
        66 bytes. Further cleanups are done in gcryptDerive() to use the mpiData()
        function where possible.

        In the CryptoAlgorithmECDSA implementation, the bit-size of the key is
        again rounded up to the nearest byte boundary before being passed to the
        helper gcryptSign() and gcryptVerify() functions. This again properly
        enforces the requirement of 66 bytes to handle P-521 elliptic curves.

        In the CryptoKeyEC implementation, NamedCurve::P521 cases in helper
        functions operating on NamedCurve values are now implemented to return
        appropriate values. platformSupportedCurve() now returns true for the
        NamedCurve::P521 value. Zero-padding of the private key data is used
        wherever it is necessary to avoid clipping any leading zero bit in the
        P-521 EC key.

        No new tests -- affected tests have their baselines updated.

        * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
        (WebCore::gcryptDerive):
        (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
        * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
        (WebCore::CryptoAlgorithmECDSA::platformSign):
        (WebCore::CryptoAlgorithmECDSA::platformVerify):
        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        (WebCore::curveName):
        (WebCore::curveIdentifier):
        (WebCore::curveSize):
        (WebCore::curveUncompressedFieldElementSize):
        (WebCore::CryptoKeyEC::platformSupportedCurve):
        (WebCore::curveForIdentifier):
        (WebCore::CryptoKeyEC::platformImportPkcs8):
        (WebCore::CryptoKeyEC::platformAddFieldElements const):
        (WebCore::CryptoKeyEC::platformExportPkcs8 const):

2017-10-29  Fujii Hironori  <Hironori.Fujii@sony.com>

        Use of uninitialized value $targetIdlFile in hash element at preprocess-idls.pl line 165.
        https://bugs.webkit.org/show_bug.cgi?id=177743

        Reviewed by Darin Adler.

        GamepadWebVR.idl supplements Gamepad.idl. But, Gamepad.idl is not
        processed because ENABLE_GAMEPAD is OFF.

        No new tests since there should be no behavioral change.

        * CMakeLists.txt: Include GamepadWebVR.idl only if ENABLE_GAMEPAD.
        * Sources.txt: Ditto.
        * bindings/scripts/preprocess-idls.pl: Die if a supplemented IDL file is not found.

2017-10-29  Sam Weinig  <sam@webkit.org>

        [Conic Gradients] Add support for parsing conic gradients
        https://bugs.webkit.org/show_bug.cgi?id=178987

        Reviewed by Dean Jackson.

        Adds initial support, disabled by default, for parsing conic gradients as per
        CSS 4 Images - https://www.w3.org/TR/css-images-4/#conic-gradients.

        Test: fast/gradients/conic-gradient-parsing.html

        * css/CSSGradientValue.cpp:
        (WebCore::clone):
        (WebCore::CSSGradientValue::isCacheable const):
        (WebCore::CSSConicGradientValue::customCSSText const):
        (WebCore::CSSConicGradientValue::createGradient):
        (WebCore::CSSConicGradientValue::equals const):
        * css/CSSGradientValue.h:
        
            Add CSSConicGradientValue as a subclass of CSSGradientValue and implement
            customCSSText() and equals(). Stub out createGradient() as painting is not
            yet implemented.
        
        * css/CSSImageGeneratorValue.cpp:
        (WebCore::CSSImageGeneratorValue::image):
        (WebCore::CSSImageGeneratorValue::isFixedSize const):
        (WebCore::CSSImageGeneratorValue::fixedSize):
        (WebCore::CSSImageGeneratorValue::isPending const):
        (WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
        (WebCore::CSSImageGeneratorValue::loadSubimages):
        * css/CSSValue.cpp:
        (WebCore::CSSValue::equals const):
        (WebCore::CSSValue::cssText const):
        (WebCore::CSSValue::destroy):
        
            Dispatch to CSSConicGradientValue as needed.
        
        * css/CSSValue.h:
        (WebCore::CSSValue::isImageGeneratorValue const):
        (WebCore::CSSValue::isGradientValue const):
        (WebCore::CSSValue::isConicGradientValue const):
        
            Add conic gradient predicate support and update isImageGeneratorValue and 
            isGradientValue to include conic gradient.
        
        * css/CSSValueKeywords.in:
        
            Add conic-gradient and repeating-conic-gradient.
        
        * css/parser/CSSParser.cpp:
        (WebCore::CSSParserContext::CSSParserContext):
        (WebCore::operator==):
        * css/parser/CSSParserMode.h:
        (WebCore::CSSParserContextHash::hash):
        
            Add runtime flags to enable conic gradients.
        
        * css/parser/CSSPropertyParserHelpers.cpp:
        (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
        
            Helper, similar to consumeLengthOrPercent, for consumeGradientColorStops. 
            Corresponds to https://drafts.csswg.org/css-values-4/#typedef-angle-percentage
        
        (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
        
            Convert to take CSSGradientValue by reference.
        
        (WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops):
        
            Helper, similar to consumeGradientColorStops, but for angular color stops
            used in conic gradients. Corresponds to https://www.w3.org/TR/css-images-4/#typedef-angular-color-stop-list
            but does not yet support double position syntax.
        
        (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
        (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
        (WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
        
            Pass CSSGradientValue by reference.
        
        (WebCore::CSSPropertyParserHelpers::consumeConicGradient):
        
            Parse conic gradient.
        
        (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
        
            Dispatch to consumeConicGradient for repeating and non-repeating
            conic gradients.
        
        (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
        
            Put each value on its own line to make it more readable and add CSSValueConicGradient
            and CSSValueRepeatingConicGradient.
        
        * page/Settings.yaml:
        
            Add a setting to enable conic gradients. Disabled by default.

        * features.json:
        
            Move conic gradients to "In Development".

2017-10-29  Antoine Quint  <graouts@apple.com>

        [Web Animations] Expose the currentTime property on Animation
        https://bugs.webkit.org/show_bug.cgi?id=178988

        Unreviewed.

        Style fixes missed in previous patch.

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::setCurrentTime):

2017-10-29  Antoine Quint  <graouts@apple.com>

        [Web Animations] Expose the currentTime property on Animation
        https://bugs.webkit.org/show_bug.cgi?id=178988

        Reviewed by Dean Jackson.

        We now expose the currentTime property on Animation objects, our first
        step in implementing the Web Animations timing model, specifically section
        3.5.4. "The current time of an animation" and section 3.5.5. "Setting the
        current time of an animation". Setting the startTime has implications on
        currentTime and vice-versa.

        Test: webanimations/animation-current-time.html

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::setBindingsStartTime):
        (WebCore::WebAnimation::startTime const):
        (WebCore::WebAnimation::setStartTime):
        (WebCore::WebAnimation::bindingsCurrentTime const):
        (WebCore::WebAnimation::setBindingsCurrentTime):
        (WebCore::WebAnimation::currentTime const):
        (WebCore::WebAnimation::setCurrentTime):
        * animation/WebAnimation.h:
        * animation/WebAnimation.idl:

2017-10-29  Ryosuke Niwa  <rniwa@webkit.org>

        Assert that no script is executed during style recalc
        https://bugs.webkit.org/show_bug.cgi?id=178845
        <rdar://problem/35106129>

        Reviewed by Antti Koivisto.

        This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
        to make sure we don't start mutating DOM in the middle of a style update.

        Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
        shadow tree since that happens while updating the style.

        No new tests since there should be no behavioral change.

        * dom/Document.cpp:
        (WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
        and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
        the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
        Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
        scripts which in turn trigger another (recursive) style recalc.
        (WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
        NoEventDispatchAssertion.
        * dom/Element.cpp:
        (WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
        newly cloned element for SVG use element's shadow tree.
        (WebCore::Element::cloneElementWithoutChildren): Ditto.
        * dom/EventDispatcher.cpp:
        (WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
        use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
        since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
        pushing or popoing the stack frame.
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::clearShadowTree):
        (WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
        of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
        scripts, it's safe to mutate them during the style recalc even though it's not the best design.
        (WebCore::SVGUseElement::cloneTarget const): Ditto.
        (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
        (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
        (WebCore::SVGUseElement::transferEventListenersToShadowTree const):

2017-10-28  Dean Jackson  <dino@apple.com>

        createImageBitmap with HTMLCanvasElement
        https://bugs.webkit.org/show_bug.cgi?id=178984
        <rdar://problem/35238440>

        Reviewed by Sam Weinig.

        Implement createImageBitmap(HTMLCanvasElement).

        While here, explicitly reject the promises for the
        methods we haven't yet implemented. I was hoping this
        would avoid a lengthy timeout in one of the imported
        WPT tests but, alas, it doesn't. However, it's still
        a good idea.

        Extend internal WPT proposals to cover canvas creation.

        * html/ImageBitmap.cpp:
        (WebCore::ImageBitmap::createPromise): Get the image from
        the canvas and draw it into a new ImageBitmap buffer.

2017-10-28  Myles C. Maxfield  <mmaxfield@apple.com>

        [iOS] Unify Font::platformCharWidthInit() with macOS
        https://bugs.webkit.org/show_bug.cgi?id=178951
        <rdar://problem/7848198>

        Reviewed by Zalan Bujtas.

        The only reason these codepaths are different is because historically this codepath
        didn't work with GS fonts (which we don't use anymore).

        Tests: fast/forms/search-styled.html
               fast/forms/text-control-intrinsic-widths.html
               fast/forms/textarea-width.html

        * platform/graphics/cocoa/FontCocoa.mm:
        (WebCore::Font::platformCharWidthInit):

2017-10-28  Chris Dumez  <cdumez@apple.com>

        self.ExtendableEvent / Client / Clients / WindowClient do not exist in a Service Worker
        https://bugs.webkit.org/show_bug.cgi?id=178976

        Reviewed by Sam Weinig.

        Test: http/tests/workers/service/ServiceWorkerGlobalScope-properties.html

        * workers/service/ExtendableEvent.idl:
        * workers/service/FetchEvent.idl:
        Drop [Exposed=Worker] as there is already [Exposed=ServiceWorker] and
        ServiceWorkerGlobalScope inherits from WorkerGlobalScope. This is redundant
        and we would hit assertions and adding the global constructors at runtime
        when the feature is enabled, because the property already exists.

2017-10-28  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Move core layout logic to a separate class.
        https://bugs.webkit.org/show_bug.cgi?id=178771
        <rdar://problem/35166542>

        Reviewed by Simon Fraser.

        Move layout code out from FrameView to LayoutContext.

        LayoutContext holds all the layout related logic (scheduling, needsLayout, handling layout states),
        while scrolling, view sizing methods stay in FrameView.
        Having a dedicated LayoutContext allows to structure the code better.   

        Covered by existing tests.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * accessibility/AXObjectCache.cpp:
        (WebCore::rendererNeedsDeferredUpdate):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::updateBackingStore):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::textUnderElement const):
        (WebCore::AccessibilityRenderObject::layoutCount const):
        * dom/Document.cpp:
        (WebCore::Document::setVisualUpdatesAllowed):
        (WebCore::Document::resolveStyle):
        (WebCore::Document::updateStyleIfNeeded):
        (WebCore::Document::updateLayout):
        (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
        (WebCore::Document::implicitClose):
        (WebCore::Document::isLayoutTimerActive):
        * dom/Element.cpp:
        (WebCore::Element::absoluteEventHandlerBounds):
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::setSelection):
        * html/HTMLEmbedElement.cpp:
        (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::didAttachRenderers):
        * inspector/InspectorOverlay.cpp:
        (WebCore::InspectorOverlay::update):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::stopForUserCancel):
        * page/Frame.cpp:
        (WebCore::Frame::setView):
        (WebCore::Frame::clearTimers):
        (WebCore::Frame::setPageAndTextZoomFactors):
        (WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
        * page/FrameView.cpp:
        (WebCore::FrameView::FrameView):
        (WebCore::FrameView::~FrameView):
        (WebCore::FrameView::reset):
        (WebCore::FrameView::resetScrollbars):
        (WebCore::FrameView::didFirstLayout const):
        (WebCore::FrameView::willDestroyRenderTree):
        (WebCore::FrameView::didDestroyRenderTree):
        (WebCore::FrameView::setContentsSize):
        (WebCore::FrameView::calculateScrollbarModesForLayout):
        (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
        (WebCore::FrameView::topContentInsetDidChange):
        (WebCore::FrameView::forceLayoutParentViewIfNeeded):
        (WebCore::FrameView::adjustScrollbarsForLayout):
        (WebCore::FrameView::willDoLayout): This takes care of the view related task right before entering render tree layout.
        (WebCore::FrameView::didLayout): post layout tasks.
        (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange):
        (WebCore::FrameView::updateLayoutViewport):
        (WebCore::FrameView::maintainScrollPositionAtAnchor):
        (WebCore::FrameView::updateLayerPositionsAfterScrolling):
        (WebCore::FrameView::updateCompositingLayersAfterScrolling):
        (WebCore::FrameView::availableContentSizeChanged):
        (WebCore::FrameView::updateContentsSize):
        (WebCore::FrameView::needsLayout const):
        (WebCore::FrameView::setNeedsLayout):
        (WebCore::FrameView::scheduleSelectionUpdate):
        (WebCore::FrameView::updateEmbeddedObjects):
        (WebCore::FrameView::flushAnyPendingPostLayoutTasks):
        (WebCore::FrameView::flushPostLayoutTasksQueue):
        (WebCore::FrameView::performPostLayoutTasks):
        (WebCore::FrameView::sendResizeEventIfNeeded):
        (WebCore::FrameView::autoSizeIfEnabled):
        (WebCore::FrameView::paintControlTints):
        (WebCore::FrameView::paintContents):
        (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
        (WebCore::FrameView::enableAutoSizeMode):
        (WebCore::FrameView::forceLayout):
        (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer): Deleted.
        (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer): Deleted.
        (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree): Deleted.
        (): Deleted.
        (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker): Deleted.
        (WebCore::applyTextSizingIfNeeded): Deleted.
        (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded): Deleted.
        (WebCore::FrameView::updateStyleForLayout): Deleted.
        (WebCore::FrameView::canPerformLayout const): Deleted.
        (WebCore::FrameView::layout): Deleted.
        (WebCore::FrameView::runOrSchedulePostLayoutTasks): Deleted.
        (WebCore::FrameView::convertSubtreeLayoutToFullLayout): Deleted.
        (WebCore::FrameView::layoutTimerFired): Deleted.
        (WebCore::FrameView::scheduleRelayout): Deleted.
        (WebCore::isObjectAncestorContainerOf): Deleted.
        (WebCore::FrameView::scheduleRelayoutOfSubtree): Deleted.
        (WebCore::FrameView::layoutPending const): Deleted.
        (WebCore::FrameView::unscheduleRelayout): Deleted.
        (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded): Deleted.
        * page/FrameView.h:
        * page/LayoutContext.cpp: Added.
        (WebCore::isObjectAncestorContainerOf):
        (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
        (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
        (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree):
        (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
        (WebCore::LayoutScope::LayoutScope):
        (WebCore::LayoutScope::~LayoutScope):
        (WebCore::LayoutContext::LayoutContext):
        (WebCore::LayoutContext::layout):
        (WebCore::LayoutContext::runOrScheduleAsynchronousTasks):
        (WebCore::LayoutContext::runAsynchronousTasks):
        (WebCore::LayoutContext::flushAsynchronousTasks):
        (WebCore::LayoutContext::reset):
        (WebCore::LayoutContext::needsLayout const):
        (WebCore::LayoutContext::setNeedsLayout):
        (WebCore::LayoutContext::enableSetNeedsLayout):
        (WebCore::LayoutContext::disableSetNeedsLayout):
        (WebCore::LayoutContext::scheduleLayout):
        (WebCore::LayoutContext::unscheduleLayout):
        (WebCore::LayoutContext::scheduleSubtreeLayout):
        (WebCore::LayoutContext::layoutTimerFired):
        (WebCore::LayoutContext::convertSubtreeLayoutToFullLayout):
        (WebCore::LayoutContext::setSubtreeLayoutRoot):
        (WebCore::LayoutContext::canPerformLayout const):
        (WebCore::LayoutContext::applyTextSizingIfNeeded):
        (WebCore::LayoutContext::updateStyleForLayout):
        (WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
        (WebCore::LayoutContext::startLayoutAtMainFrameViewIfNeeded):
        (WebCore::LayoutContext::frame const):
        (WebCore::LayoutContext::view const):
        (WebCore::LayoutContext::renderView const):
        (WebCore::LayoutContext::document const):
        * page/LayoutContext.h: Added.
        (WebCore::LayoutContext::startDisallowingLayout):
        (WebCore::LayoutContext::endDisallowingLayout):
        (WebCore::LayoutContext::layoutPhase const):
        (WebCore::LayoutContext::isLayoutNested const):
        (WebCore::LayoutContext::layoutCount const):
        (WebCore::LayoutContext::isLayoutPending const):
        (WebCore::LayoutContext::isInLayout const):
        (WebCore::LayoutContext::isInRenderTreeLayout const):
        (WebCore::LayoutContext::inPaintableState const):
        (WebCore::LayoutContext::subtreeLayoutRoot const):
        (WebCore::LayoutContext::clearSubtreeLayoutRoot):
        (WebCore::LayoutContext::resetFirstLayoutFlag):
        (WebCore::LayoutContext::didFirstLayout const):
        (WebCore::LayoutContext::setNeedsFullRepaint):
        (WebCore::LayoutContext::needsFullRepaint const):
        (WebCore::LayoutContext::layoutDisallowed const):
        (WebCore::LayoutContext::isLayoutSchedulingEnabled const):
        (WebCore::LayoutContext::inAsynchronousTasks const):
        * page/Page.cpp:
        (WebCore::Page::setPageScaleFactor):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::insertPositionedObject):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::imageChanged):
        (WebCore::RenderBox::computeLogicalWidthInFragment const):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::clearSubtreeLayoutRootIfNeeded const):
        (WebCore::RenderElement::checkForRepaintDuringLayout const):
        * rendering/RenderFrameBase.cpp:
        (WebCore::RenderFrameBase::performLayoutWithFlattening):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::scrollTo):
        * rendering/RenderObject.cpp:
        (WebCore::scheduleRelayoutForSubtree):
        * rendering/RenderTreeAsText.cpp:
        (WebCore::write):
        * rendering/RenderVideo.cpp:
        (WebCore::RenderVideo::updatePlayer):
        * rendering/RenderView.h:
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::updateWidgetPosition):
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::draw):
        * testing/Internals.cpp:
        (WebCore::Internals::layoutCount const):
        
2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>

        Cleanup PageDebuggable
        https://bugs.webkit.org/show_bug.cgi?id=178972

        Reviewed by Sam Weinig.

        * page/PageDebuggable.cpp:
        (WebCore::PageDebuggable::PageDebuggable):
        * page/PageDebuggable.h:

2017-10-28  Joseph Pecoraro  <pecoraro@apple.com>

        Extract a WorkerDebuggerProxy interface out of WorkerReportingProxy
        https://bugs.webkit.org/show_bug.cgi?id=178975

        Reviewed by Sam Weinig.

        No new tests, just refactoring.

        * workers/WorkerDebuggerProxy.h:
        * workers/WorkerReportingProxy.h:
        * WebCore.xcodeproj/project.pbxproj:
        Extract a method from WorkerReportingProxy to WorkerDebuggerProxy and
        rename it to be more general.

        * inspector/WorkerToPageFrontendChannel.h:
        (WebCore::WorkerToPageFrontendChannel::sendMessageToFrontend):
        * workers/DedicatedWorkerThread.cpp:
        (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
        * workers/DedicatedWorkerThread.h:
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
        (WebCore::WorkerMessagingProxy::postMessageToDebugger):
        (WebCore::WorkerMessagingProxy::postMessageToPageInspector): Deleted.
        * workers/WorkerMessagingProxy.h:
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::WorkerThread):
        * workers/WorkerThread.h:
        (WebCore::WorkerThread::workerDebuggerProxy const):
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::ServiceWorkerThread):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/context/ServiceWorkerThreadProxy.cpp:
        (WebCore::ServiceWorkerThreadProxy::create):
        (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
        Include a WorkerDebuggerProxy alongside the other proxies.
        Use the renamed debugger proxy method.

2017-10-28  Ryosuke Niwa  <rniwa@webkit.org>

        Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
        https://bugs.webkit.org/show_bug.cgi?id=178715
        <rdar://problem/35144665>

        Reviewed by Brent Fulgham.

        Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
        instead of in the middle of collecting a list of stylesheets.

        * dom/Document.cpp:
        (WebCore::Document::Document): Initialize the newly added timer.
        (WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
        handlers may be expecting to see the document after XSLT had been applied.
        (WebCore::Document::scheduleToApplyXSLTransforms): Added.
        (WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
        (WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
        Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
        (WebCore::Document::applyXSLTransform): Deleted.
        (WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
        inline XSLT and it happens much earlier than implicitClose.
        (WebCore::Document::suspendScheduledTasks): Suspend the XSLT timer.
        (WebCore::Document::resumeScheduledTasks): Reschedule the XSLT timer if m_hasPendingXSLTransforms is set.
        * dom/Document.h:
        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
        stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
        function can be called from a non-script-resilient call stack.
        (WebCore::ProcessingInstruction::sheetLoaded): Ditto.
        * style/StyleScope.cpp:
        (WebCore::Style::Scope::collectXSLTransforms): Added.
        (WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
        that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
        * style/StyleScope.h:
        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.

2017-10-27  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: Canvas Tab: no way to see backtrace of where a canvas context was created
        https://bugs.webkit.org/show_bug.cgi?id=178799
        <rdar://problem/35175805>

        Reviewed by Brian Burg.

        No new tests, updated existing tests.

        * inspector/InspectorCanvas.h:
        * inspector/InspectorCanvas.cpp:
        (iterateCallFrames):
        (WebCore::InspectorCanvas::buildObjectForCanvas):
        (WebCore::InspectorCanvas::buildAction):

        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
        If the Canvas agent is enabled, generate a backtrace and send it to the frontend with the canvas.
        We do not do this for canvases created before the agent is enabled for performance reasons.

2017-10-27  Keith Miller  <keith_miller@apple.com>

        Add unified source list files and build scripts to Xcode project navigator
        https://bugs.webkit.org/show_bug.cgi?id=178959

        Reviewed by Andy Estes.

        * WebCore.xcodeproj/project.pbxproj:

2017-10-27  Daniel Bates  <dabates@apple.com>

        Only allow non-mixed content protected subresources to ask for credentials
        https://bugs.webkit.org/show_bug.cgi?id=178919
        <rdar://problem/35015245>

        Reviewed by Alex Christensen.

        Only allow non-mixed content protected subresources to ask for credentials. It is not meaningful
        to allow protected mixed-content subresources to ask for credentials.

        Tests: http/tests/security/mixedContent/insecure-image-redirects-to-basic-auth-secure-image.html
               http/tests/security/mixedContent/insecure-script-redirects-to-basic-auth-secure-script.html
               http/tests/security/mixedContent/insecure-stylesheet-redirects-to-basic-auth-secure-stylesheet.html
               http/tests/security/mixedContent/secure-redirect-to-insecure-redirect-to-basic-auth-secure-image.https.html
               http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-insecure-image.https.html
               http/tests/security/mixedContent/secure-redirect-to-secure-redirect-to-basic-auth-secure-image.https.html

        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::ResourceLoader): Initialize m_canAskClientForCredentials based on the
        specified resource loader options.
        (WebCore::ResourceLoader::init): Update m_canAskClientForCredentials based on the URL of the initial
        request.
        (WebCore::ResourceLoader::isMixedContent const): Helper function to check if the specified URL
        represents a mixed content resource.
        (WebCore::ResourceLoader::willSendRequestInternal): If the original request or the redirect request
        is mixed content then update state such that we will disallow asking for credentials.
        (WebCore::ResourceLoader::isAllowedToAskUserForCredentials const): Modified to use m_canAskClientForCredentials
        when determining whether the request is allowed to ask for credentials.
        * loader/ResourceLoader.h:

2017-10-27  Chris Dumez  <cdumez@apple.com>

        Unskip more Service Workers tests
        https://bugs.webkit.org/show_bug.cgi?id=178944

        Reviewed by Sam Weinig.

        Drop bad assertion that was causing the Service Worker WebProcess to crash and causing
        tests to fail as a result.

        * workers/service/ServiceWorkerGlobalScope.cpp:
        (WebCore::ServiceWorkerGlobalScope::registration):
        * workers/service/ServiceWorkerGlobalScope.h:

2017-10-27  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r224011.

        xsl LayoutTests hit an assertion added with this change since
        r223999 was rolled out.

        Reverted changeset:

        "Assert that no script is executed during style recalc"
        https://bugs.webkit.org/show_bug.cgi?id=178845
        https://trac.webkit.org/changeset/224011

2017-10-27  Antoine Quint  <graouts@apple.com>

        [Web Animations] Expose the currentTime property on AnimationTimeline
        https://bugs.webkit.org/show_bug.cgi?id=178928

        Reviewed by Dean Jackson.

        We add the currentTime property on AnimationTimeline and add an internals method
        to set it in a test which will allow us to validate the timing model state for
        a given time.

        Test: webanimations/timeline-current-time.html

        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::bindingsCurrentTime const):
        (WebCore::AnimationTimeline::setCurrentTime):
        * animation/AnimationTimeline.h:
        (WebCore::AnimationTimeline::currentTime const):
        * animation/AnimationTimeline.idl:
        * testing/Internals.cpp:
        (WebCore::Internals::setTimelineCurrentTime):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-10-27  Antoine Quint  <graouts@apple.com>

        [Web Animations] Use Seconds vs. MonotonicTime to represent times
        https://bugs.webkit.org/show_bug.cgi?id=178950

        Reviewed by Dean Jackson.

        Animation start times, all expressed in seconds, in the Web Animations API are relative to the timeline
        originTime, itself relative to the page's nagigation time (Performance.navigationTime), so it makes more
        sense to use Seconds to represent them as opposed to a MonotonicTime.

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::bindingsStartTime const):
        (WebCore::WebAnimation::setBindingsStartTime):
        * animation/WebAnimation.h:

2017-10-27  Chris Dumez  <cdumez@apple.com>

        DOMWindow::dispatchEvent() does not reset the event's dispatch flag
        https://bugs.webkit.org/show_bug.cgi?id=178897

        Reviewed by Darin Adler.

        Make sure we reset the currentTarget, dispatch flag, phase and propagation flags
        after dispatching an event on a Window, as per:
        - https://dom.spec.whatwg.org/#concept-event-dispatch

        This behavior is consistent with Firefox.

        Test: fast/events/window-load-initEvent.html

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::dispatchEvent):

2017-10-27  Keith Miller  <keith_miller@apple.com>

        Move iOS specific sources to unified sources
        https://bugs.webkit.org/show_bug.cgi?id=178915

        Rubber-stamped by Tim Horton.

        * SourcesCocoa.txt:
        * SourcesIOS.txt:
        * SourcesMac.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-27  Eric Carlson  <eric.carlson@apple.com>

        NowPlayingInfo should contain a unique identifier
        https://bugs.webkit.org/show_bug.cgi?id=178872
        <rdar://problem/34924012>

        Unreviewed, build fix.

        * platform/audio/ios/MediaSessionManagerIOS.mm:
        (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Call string.impl().hash() instead of
        string.existingHash() because the later will assert in a debug build if the hash hasn't
        been calculated yet.
        * platform/audio/mac/MediaSessionManagerMac.mm:
        (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto.

2017-10-27  Alex Christensen  <achristensen@webkit.org>

        Fix accessibility/mac/aria-label-on-label-element.html after r224074
        https://bugs.webkit.org/show_bug.cgi?id=178892

        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::titleElementText const):
        (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityText::AccessibilityText):
        Turns out my null checks changed behavior.  This undoes them.

2017-10-27  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r223999.

        Caused xsl LayoutTest flakiness.

        Reverted changeset:

        "Style::Scope::flushPendingUpdate() can replace the entire
        document in XSLTProcessor::createDocumentFromSource"
        https://bugs.webkit.org/show_bug.cgi?id=178715
        https://trac.webkit.org/changeset/223999

2017-10-27  Chris Dumez  <cdumez@apple.com>

        Audit init*Event() method to make sure they reset internal data members
        https://bugs.webkit.org/show_bug.cgi?id=178886

        Reviewed by Ryosuke Niwa.

        Audit init*Event() method to make sure they reset internal data members.

        * dom/Event.cpp:
        (WebCore::Event::initEvent):
        * dom/KeyboardEvent.cpp:
        (WebCore::KeyboardEvent::initKeyboardEvent):
        * dom/MessageEvent.cpp:
        (WebCore::MessageEvent::initMessageEvent):
        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::initMouseEvent):
        * dom/MouseRelatedEvent.h:
        (WebCore::MouseRelatedEvent::setIsSimulated):
        * dom/TextEvent.cpp:
        (WebCore::TextEvent::initTextEvent):
        * dom/WheelEvent.cpp:
        (WebCore::WheelEvent::initWheelEvent):

2017-10-27  Chris Dumez  <cdumez@apple.com>

        Add initial support for serviceWorkerClient.postMessage()
        https://bugs.webkit.org/show_bug.cgi?id=178794

        Reviewed by Youenn Fablet.

        Add initial support for serviceWorkerClient.postMessage():
        - https://w3c.github.io/ServiceWorker/#client-postmessage

        It is now possible to do bi-directional communication with a service worker
        via postMessage().

        No new tests, updated existing test.

        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::generateDocumentIdentifier):
        (WebCore::Document::allDocumentsMap):
        (WebCore::Document::allDocuments):
        (WebCore::m_identifier):
        (WebCore::Document::~Document):
        * dom/Document.h:
        (WebCore::Document::identifier const):
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::serviceWorkerContainer):
        * dom/ScriptExecutionContext.h:
        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::postMessage):
        * workers/service/ServiceWorkerClient.cpp:
        (WebCore::ServiceWorkerClient::ServiceWorkerClient):
        (WebCore::ServiceWorkerClient::~ServiceWorkerClient):
        (WebCore::ServiceWorkerClient::id const):
        (WebCore::ServiceWorkerClient::postMessage):
        * workers/service/ServiceWorkerClient.h:
        (WebCore::ServiceWorkerClient::create):
        * workers/service/ServiceWorkerClient.idl:
        * workers/service/ServiceWorkerClientIdentifier.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
        (WebCore::ServiceWorkerClientIdentifier::toString const):
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::unregister):
        * workers/service/ServiceWorkerWindowClient.cpp:
        (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
        * workers/service/ServiceWorkerWindowClient.h:
        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
        * workers/service/context/SWContextManager.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
        * workers/service/server/SWClientConnection.h:

2017-10-27  Frederic Wang  <fwang@igalia.com>

        Use auto for some variables in RenderLayerCompositor/Backing
        https://bugs.webkit.org/show_bug.cgi?id=178570

        Reviewed by Darin Adler.

        No new tests, behavior unchanged.

        * rendering/RenderLayerBacking.cpp:
        (WebCore::canvasCompositingStrategy):
        (WebCore::RenderLayerBacking::RenderLayerBacking):
        (WebCore::computePageTiledBackingCoverage):
        (WebCore::RenderLayerBacking::layerWillBeDestroyed):
        (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
        (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
        (WebCore::RenderLayerBacking::updateCompositedBounds):
        (WebCore::RenderLayerBacking::updateAfterWidgetResize):
        (WebCore::RenderLayerBacking::updateAfterLayout):
        (WebCore::RenderLayerBacking::updateConfiguration):
        (WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
        (WebCore::RenderLayerBacking::updateGeometry):
        (WebCore::RenderLayerBacking::updateInternalHierarchy):
        (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
        (WebCore::RenderLayerBacking::hasUnpositionedOverflowControlsLayers const):
        (WebCore::RenderLayerBacking::compositingOpacity const):
        (WebCore::isRestartedPlugin):
        (WebCore::RenderLayerBacking::isDirectlyCompositedImage const):
        (WebCore::RenderLayerBacking::updateImageContents):
        (WebCore::RenderLayerBacking::setContentsNeedDisplay):
        (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
        (WebCore::RenderLayerBacking::getCurrentTransform const):
        (WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
        (WebCore::RenderLayerBacking::startAnimation):
        (WebCore::RenderLayerBacking::compositedBoundsIncludingMargin const):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlushIncludingSubframes):
        (WebCore::updateScrollingLayerWithClient):
        (WebCore::RenderLayerCompositor::didFlushChangesForLayer):
        (WebCore::RenderLayerCompositor::didPaintBacking):
        (WebCore::RenderLayerCompositor::didChangeVisibleRect):
        (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const):
        (WebCore::RenderLayerCompositor::updateCompositingLayers):
        (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
        (WebCore::RenderLayerCompositor::logLayerInfo):
        (WebCore::checkIfDescendantClippingContextNeedsUpdate):
        (WebCore::styleChangeRequiresLayerRebuild):
        (WebCore::RenderLayerCompositor::canCompositeClipPath):
        (WebCore::rendererForCompositingTests):
        (WebCore::RenderLayerCompositor::updateBacking):
        (WebCore::RenderLayerCompositor::repaintOnCompositingChange):
        (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
        (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
        (WebCore::RenderLayerCompositor::setCompositingParent):
        (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
        (WebCore::RenderLayerCompositor::hasCoordinatedScrolling const):
        (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
        (WebCore::RenderLayerCompositor::positionForClipLayer const):
        (WebCore::RenderLayerCompositor::frameViewDidLayout):
        (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged):
        (WebCore::RenderLayerCompositor::scrollingLayerDidChange):
        (WebCore::RenderLayerCompositor::frameContentsCompositor):
        (WebCore::RenderLayerCompositor::parentFrameContentLayers):
        (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
        (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
        (WebCore::RenderLayerCompositor::setIsInWindow):
        (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
        (WebCore::RenderLayerCompositor::clippedByAncestor const):
        (WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const):
        (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
        (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
        (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
        (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
        (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
        (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
        (WebCore::RenderLayerCompositor::requiresScrollLayer const):
        (WebCore::RenderLayerCompositor::supportsFixedRootBackgroundCompositing const):
        (WebCore::RenderLayerCompositor::fixedRootBackgroundLayer const):
        (WebCore::RenderLayerCompositor::resetTrackedRepaintRects):
        (WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles const):
        (WebCore::RenderLayerCompositor::documentUsesTiledBacking const):
        (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
        (WebCore::RenderLayerCompositor::updateLayerForHeader):
        (WebCore::RenderLayerCompositor::updateLayerForFooter):
        (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
        (WebCore::RenderLayerCompositor::ensureRootLayer):
        (WebCore::RenderLayerCompositor::destroyRootLayer):
        (WebCore::RenderLayerCompositor::attachRootLayer):
        (WebCore::RenderLayerCompositor::detachRootLayer):
        (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
        (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
        (WebCore::RenderLayerCompositor::deviceOrPageScaleFactorChanged):
        (WebCore::RenderLayerCompositor::computeFixedViewportConstraints const):
        (WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
        (WebCore::enclosingScrollingNodeID):
        (WebCore::scrollCoordinatedAncestorInParentOfFrame):
        (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
        (WebCore::RenderLayerCompositor::attachScrollingNode):
        (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
        (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
        (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers):
        (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
        (WebCore::RenderLayerCompositor::didAddScrollingLayer):
        (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView):

2017-10-27  Alicia Boya García  <aboya@igalia.com>

        [GStreamer][MSE] Trim space between codecs
        https://bugs.webkit.org/show_bug.cgi?id=178160

        Reviewed by Xabier Rodriguez-Calvar.

        Modify supportsCodecs() to accept a Vector<String> instead of
        receiving a string and parsing itself.

        This improves passrate for `mediasource-is-type-supported` as it
        ensures that whitespace between codecs is now trimmed and codec
        strings such as `video/webm;codecs="opus, vp9"` are matched as a valid
        type, as required by the spec.

        This patch also renames supportCodecs() to supportAllCodecs() and adds
        a new variant, supportCodec(), that checks for support of an
        individual codec.

        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
        (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodec):
        (WebCore::MediaPlayerPrivateGStreamerMSE::supportsAllCodecs):
        (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:

2017-10-27  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Crash in WebCore::SelectionRangeData::apply
        https://bugs.webkit.org/show_bug.cgi?id=177808

        Reviewed by Carlos Garcia Campos.

        The problem appears to be a name collision between WebCore::SelectionData and
        WebCore::SelectionData. Yes, those are the same names. It seems the destructor for a
        Source/WebCore/platform/gtk/SelectionData.h SelectionData is being called on a
        Source/WebCore/rendering/SelectionRangeData.cpp SelectionData. Yikes. Can you forgive the
        poor linker for not being magic?

        This fixes crashes in approximately one bajillion tests.

        * rendering/SelectionRangeData.cpp: Move SelectionData into an anonymous namespace.

2017-10-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [WinCairo] Fix build after WebCore moves to unified source.
        https://bugs.webkit.org/show_bug.cgi?id=178920

        Added empty implementations to fix link error.

        Reviewed by Ryosuke Niwa.

        * platform/network/curl/DNSCurl.cpp:
        (WebCore::DNSResolveQueue::updateIsUsingProxy):
        (WebCore::DNSResolveQueue::platformResolve):

2017-10-26  Jeremy Jones  <jeremyj@apple.com>

        Implement seek tolerance methods in WebAVPlayerController.
        https://bugs.webkit.org/show_bug.cgi?id=178838
        rdar://problem/33781777

        Reviewed by Eric Carlson.

        No new tests because this doesn't change any behavior in the page, but exposes seek tolerance to fullscreen platform UI.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::setCurrentTimeWithTolerance):
        * html/HTMLMediaElement.h:
        * platform/cocoa/PlaybackSessionModel.h:
        * platform/cocoa/PlaybackSessionModelMediaElement.h:
        * platform/cocoa/PlaybackSessionModelMediaElement.mm:
        (WebCore::PlaybackSessionModelMediaElement::seekToTime):
        * platform/ios/WebAVPlayerController.mm:
        (-[WebAVPlayerController seekToTime:]):
        (-[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:]):
        (-[WebAVPlayerController seekByTimeInterval:]):
        (-[WebAVPlayerController seekByTimeInterval:toleranceBefore:toleranceAfter:]):
        (-[WebAVPlayerController seekToBeginning:]):
        (-[WebAVPlayerController seekToEnd:]):
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        (VideoFullscreenControllerContext::seekToTime):

2017-10-26  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix WPE build after r224074
        https://bugs.webkit.org/show_bug.cgi?id=178892

        * accessibility/wpe/AccessibilityObjectWPE.cpp:
        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):

2017-10-25  Simon Fraser  <simon.fraser@apple.com>

        When navigating back to a page, compositing layers may not use accelerated drawing
        https://bugs.webkit.org/show_bug.cgi?id=178749
        rdar://problem/35158946

        Reviewed by Dean Jackson.

        There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
        occurred on back navigation, related to the ordering of style recalcs and layout.

        First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
        its cacheAcceleratedCompositingFlags(), so any layers created during style update
        didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
        to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().

        Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
        before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
        the TileController.

        Test: compositing/accelerated-layers-after-back.html

        * page/FrameView.cpp:
        (WebCore::FrameView::updateCompositingLayersAfterLayout):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::willRecalcStyle):
        (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
        (WebCore::RenderLayerCompositor::updateCompositingLayers):
        * rendering/RenderLayerCompositor.h:

2017-10-26  Alex Christensen  <achristensen@webkit.org>

        Fix Windows build
        https://bugs.webkit.org/show_bug.cgi?id=178892

        * accessibility/win/AccessibilityObjectWin.cpp:
        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):

2017-10-26  Alex Christensen  <achristensen@webkit.org>

        Modernize AccessibilityObject.h
        https://bugs.webkit.org/show_bug.cgi?id=178892

        Reviewed by Tim Horton.

        The enums in AccessibilityObject.h are causing naming collisions with unified builds.
        This is what enum classes are for.
        HashMaps of enum classes still need a few casts to/from int.
        
        I also made some RefPtr's Ref's, use some initializer lists instead of values in the constructor implementation, and indentation fixing.
        
        No change in behavior.

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXComputedObjectAttributeCache::getIgnored const):
        (WebCore::AXObjectCache::~AXObjectCache):
        (WebCore::AXObjectCache::getOrCreate):
        (WebCore::AXObjectCache::remove):
        (WebCore::AXObjectCache::notificationPostTimerFired):
        * accessibility/AXObjectCache.h:
        (WebCore::AXComputedObjectAttributeCache::CachedAXObjectAttributes::CachedAXObjectAttributes):
        (WebCore::AXComputedObjectAttributeCache::getIgnored const):
        * accessibility/AccessibilityARIAGrid.cpp:
        (WebCore::AccessibilityARIAGrid::addChildren):
        * accessibility/AccessibilityARIAGridCell.cpp:
        (WebCore::AccessibilityARIAGridCell::parentRowGroup const):
        * accessibility/AccessibilityARIAGridRow.cpp:
        (WebCore::AccessibilityARIAGridRow::headerObject):
        * accessibility/AccessibilityAttachment.cpp:
        (WebCore::AccessibilityAttachment::accessibilityText):
        * accessibility/AccessibilityAttachment.h:
        * accessibility/AccessibilityImageMapLink.cpp:
        (WebCore::AccessibilityImageMapLink::roleValue const):
        (WebCore::AccessibilityImageMapLink::accessibilityText):
        * accessibility/AccessibilityLabel.cpp:
        (WebCore::childrenContainOnlyStaticText):
        * accessibility/AccessibilityLabel.h:
        * accessibility/AccessibilityList.cpp:
        (WebCore::AccessibilityList::isUnorderedList const):
        (WebCore::AccessibilityList::isOrderedList const):
        (WebCore::AccessibilityList::determineAccessibilityRole):
        (WebCore::AccessibilityList::roleValue const):
        * accessibility/AccessibilityListBox.cpp:
        (WebCore::AccessibilityListBox::setSelectedChildren):
        (WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject const):
        * accessibility/AccessibilityListBox.h:
        * accessibility/AccessibilityListBoxOption.h:
        * accessibility/AccessibilityMathMLElement.cpp:
        (WebCore::AccessibilityMathMLElement::determineAccessibilityRole):
        (WebCore::AccessibilityMathMLElement::isMathScriptObject const):
        (WebCore::AccessibilityMathMLElement::isMathMultiscriptObject const):
        * accessibility/AccessibilityMediaControls.cpp:
        (WebCore::AccessibilityMediaControl::accessibilityText):
        (WebCore::AccessibilityMediaControl::roleValue const):
        * accessibility/AccessibilityMediaControls.h:
        * accessibility/AccessibilityMenuList.cpp:
        (WebCore::AccessibilityMenuList::addChildren):
        * accessibility/AccessibilityMenuList.h:
        * accessibility/AccessibilityMenuListOption.h:
        * accessibility/AccessibilityMenuListPopup.cpp:
        (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject const):
        * accessibility/AccessibilityMenuListPopup.h:
        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
        (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
        (WebCore::AccessibilityNodeObject::canHaveChildren const):
        (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored const):
        (WebCore::AccessibilityNodeObject::isSearchField const):
        (WebCore::AccessibilityNodeObject::isImage const):
        (WebCore::AccessibilityNodeObject::isPasswordField const):
        (WebCore::AccessibilityNodeObject::isInputImage const):
        (WebCore::AccessibilityNodeObject::isProgressIndicator const):
        (WebCore::AccessibilityNodeObject::isSlider const):
        (WebCore::AccessibilityNodeObject::isMenuRelated const):
        (WebCore::AccessibilityNodeObject::isMenu const):
        (WebCore::AccessibilityNodeObject::isMenuBar const):
        (WebCore::AccessibilityNodeObject::isMenuButton const):
        (WebCore::AccessibilityNodeObject::isMenuItem const):
        (WebCore::AccessibilityNodeObject::isEnabled const):
        (WebCore::AccessibilityNodeObject::isChecked const):
        (WebCore::AccessibilityNodeObject::supportsRequiredAttribute const):
        (WebCore::AccessibilityNodeObject::headingLevel const):
        (WebCore::AccessibilityNodeObject::isHeading const):
        (WebCore::AccessibilityNodeObject::isLink const):
        (WebCore::AccessibilityNodeObject::isGroup const):
        (WebCore::AccessibilityNodeObject::selectedRadioButton):
        (WebCore::AccessibilityNodeObject::checkboxOrRadioValue const):
        (WebCore::AccessibilityNodeObject::actionElement const):
        (WebCore::AccessibilityNodeObject::alterSliderValue):
        (WebCore::AccessibilityNodeObject::isGenericFocusableElement const):
        (WebCore::AccessibilityNodeObject::menuElementForMenuButton const):
        (WebCore::AccessibilityNodeObject::menuItemElementForMenu const):
        (WebCore::AccessibilityNodeObject::titleElementText const):
        (WebCore::AccessibilityNodeObject::alternativeText const):
        (WebCore::AccessibilityNodeObject::visibleText const):
        (WebCore::AccessibilityNodeObject::helpText const):
        (WebCore::AccessibilityNodeObject::accessibilityText):
        (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
        (WebCore::AccessibilityNodeObject::accessibilityDescription const):
        (WebCore::AccessibilityNodeObject::roleIgnoresTitle const):
        (WebCore::AccessibilityNodeObject::hierarchicalLevel const):
        (WebCore::AccessibilityNodeObject::title const):
        (WebCore::AccessibilityNodeObject::text const):
        (WebCore::AccessibilityNodeObject::stringValue const):
        (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const):
        (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent const):
        (WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
        * accessibility/AccessibilityNodeObject.h:
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::detach):
        (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
        (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
        (WebCore::AccessibilityObject::isBlockquote const):
        (WebCore::AccessibilityObject::isTextControl const):
        (WebCore::AccessibilityObject::isARIATextControl const):
        (WebCore::AccessibilityObject::isLandmark const):
        (WebCore::AccessibilityObject::findMatchingObjects):
        (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
        (WebCore::AccessibilityObject::selectText):
        (WebCore::AccessibilityObject::isARIAInput):
        (WebCore::AccessibilityObject::isARIAControl):
        (WebCore::AccessibilityObject::isRangeControl const):
        (WebCore::AccessibilityObject::visiblePositionForBounds const):
        (WebCore::AccessibilityObject::supportsARIAReadOnly const):
        (WebCore::AccessibilityObject::ariaReadOnlyValue const):
        (WebCore::AccessibilityObject::headingElementForNode):
        (WebCore::AccessibilityObject::ariaTreeRows):
        (WebCore::AccessibilityObject::ariaTreeItemContent):
        (WebCore::AccessibilityObject::ariaTreeItemDisclosedRows):
        (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
        (WebCore::AccessibilityObject::actionVerb const):
        (WebCore::AccessibilityObject::ariaCurrentState const):
        (WebCore::AccessibilityObject::ariaCurrentValue const):
        (WebCore::AccessibilityObject::orientation const):
        (WebCore::initializeRoleMap):
        (WebCore::AccessibilityObject::ariaRoleToWebCoreRole):
        (WebCore::AccessibilityObject::computedRoleString const):
        (WebCore::AccessibilityObject::supportsPressAction const):
        (WebCore::AccessibilityObject::sortDirection const):
        (WebCore::AccessibilityObject::supportsExpanded const):
        (WebCore::AccessibilityObject::isExpanded const):
        (WebCore::AccessibilityObject::supportsChecked const):
        (WebCore::AccessibilityObject::checkboxOrRadioValue const):
        (WebCore::AccessibilityObject::scrollByPage const):
        (WebCore::AccessibilityObject::lastKnownIsIgnoredValue):
        (WebCore::AccessibilityObject::setLastKnownIsIgnoredValue):
        (WebCore::AccessibilityObject::buttonRoleType const):
        (WebCore::AccessibilityObject::isButton const):
        (WebCore::AccessibilityObject::accessibilityIsIgnoredByDefault const):
        (WebCore::AccessibilityObject::defaultObjectInclusion const):
        (WebCore::AccessibilityObject::accessibilityIsIgnored const):
        (WebCore::AccessibilityObject::isContainedByPasswordField const):
        (WebCore::AccessibilityObject::AccessibilityObject): Deleted.
        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityText::AccessibilityText):
        (WebCore::AccessibilityIsIgnoredFromParentData::AccessibilityIsIgnoredFromParentData):
        (WebCore::AccessibilityObject::isImageMap const):
        (WebCore::AccessibilityObject::isWebArea const):
        (WebCore::AccessibilityObject::isCheckbox const):
        (WebCore::AccessibilityObject::isRadioButton const):
        (WebCore::AccessibilityObject::isListBox const):
        (WebCore::AccessibilityObject::isSpinButton const):
        (WebCore::AccessibilityObject::isSwitch const):
        (WebCore::AccessibilityObject::isToggleButton const):
        (WebCore::AccessibilityObject::isTabList const):
        (WebCore::AccessibilityObject::isTabItem const):
        (WebCore::AccessibilityObject::isRadioGroup const):
        (WebCore::AccessibilityObject::isComboBox const):
        (WebCore::AccessibilityObject::isTree const):
        (WebCore::AccessibilityObject::isTreeGrid const):
        (WebCore::AccessibilityObject::isTreeItem const):
        (WebCore::AccessibilityObject::isScrollbar const):
        (WebCore::AccessibilityObject::isListItem const):
        (WebCore::AccessibilityObject::isScrollView const):
        (WebCore::AccessibilityObject::isCanvas const):
        (WebCore::AccessibilityObject::isPopUpButton const):
        (WebCore::AccessibilityObject::isColorWell const):
        (WebCore::AccessibilityObject::isSplitter const):
        (WebCore::AccessibilityObject::isToolbar const):
        (WebCore::AccessibilityObject::isSummary const):
        (WebCore::AccessibilityObject::isStaticText const):
        (WebCore::AccessibilityObject::ariaRoleAttribute const):
        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
        * accessibility/AccessibilityProgressIndicator.h:
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::parentObject const):
        (WebCore::AccessibilityRenderObject::isAttachment const):
        (WebCore::AccessibilityRenderObject::helpText const):
        (WebCore::AccessibilityRenderObject::stringValue const):
        (WebCore::AccessibilityRenderObject::addRadioButtonGroupChildren const):
        (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers const):
        (WebCore::AccessibilityRenderObject::linkedUIElements const):
        (WebCore::AccessibilityRenderObject::isAllowedChildOfTree const):
        (WebCore::objectInclusionFromAltText):
        (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
        (WebCore::AccessibilityRenderObject::selectedTextRange const):
        (WebCore::AccessibilityRenderObject::isTabItemSelected const):
        (WebCore::AccessibilityRenderObject::isFocused const):
        (WebCore::AccessibilityRenderObject::setSelectedRows):
        (WebCore::AccessibilityRenderObject::getDocumentLinks):
        (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
        (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):
        (WebCore::AccessibilityRenderObject::supportsExpandedTextValue const):
        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
        (WebCore::AccessibilityRenderObject::orientation const):
        (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const):
        (WebCore::AccessibilityRenderObject::ariaRoleHasPresentationalChildren const):
        (WebCore::AccessibilityRenderObject::canSetExpandedAttribute const):
        (WebCore::AccessibilityRenderObject::addImageMapChildren):
        (WebCore::AccessibilityRenderObject::addTextFieldChildren):
        (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
        (WebCore::AccessibilityRenderObject::ariaLiveRegionAtomic const):
        (WebCore::AccessibilityRenderObject::canHaveSelectedChildren const):
        (WebCore::AccessibilityRenderObject::ariaListboxSelectedChildren):
        (WebCore::AccessibilityRenderObject::selectedChildren):
        (WebCore::AccessibilityRenderObject::visibleChildren):
        (WebCore::AccessibilityRenderObject::tabChildren):
        (WebCore::AccessibilityRenderObject::actionVerb const):
        (WebCore::msaaRoleForRenderer):
        (WebCore::AccessibilityRenderObject::roleValueForMSAA const):
        * accessibility/AccessibilitySVGElement.cpp:
        (WebCore::AccessibilitySVGElement::accessibilityText):
        (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):
        (WebCore::AccessibilitySVGElement::inheritsPresentationalRole const):
        (WebCore::AccessibilitySVGElement::determineAriaRoleAttribute const):
        (WebCore::AccessibilitySVGElement::determineAccessibilityRole):
        * accessibility/AccessibilitySVGRoot.h:
        * accessibility/AccessibilityScrollView.cpp:
        (WebCore::AccessibilityScrollView::scrollBar):
        * accessibility/AccessibilityScrollView.h:
        * accessibility/AccessibilityScrollbar.cpp:
        (WebCore::AccessibilityScrollbar::orientation const):
        * accessibility/AccessibilityScrollbar.h:
        * accessibility/AccessibilitySlider.cpp:
        (WebCore::AccessibilitySlider::orientation const):
        (WebCore::AccessibilitySlider::addChildren):
        * accessibility/AccessibilitySlider.h:
        * accessibility/AccessibilitySpinButton.cpp:
        (WebCore::AccessibilitySpinButton::addChildren):
        * accessibility/AccessibilitySpinButton.h:
        * accessibility/AccessibilityTable.cpp:
        (WebCore::AccessibilityTable::hasARIARole const):
        (WebCore::AccessibilityTable::addChildren):
        (WebCore::AccessibilityTable::headerContainer):
        (WebCore::AccessibilityTable::roleValue const):
        (WebCore::AccessibilityTable::computeAccessibilityIsIgnored const):
        (WebCore::AccessibilityTable::titleElementText const):
        * accessibility/AccessibilityTableCell.cpp:
        (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored const):
        (WebCore::AccessibilityTableCell::determineAccessibilityRole):
        * accessibility/AccessibilityTableColumn.cpp:
        (WebCore::AccessibilityTableColumn::headerObject):
        * accessibility/AccessibilityTableColumn.h:
        * accessibility/AccessibilityTableHeaderContainer.h:
        * accessibility/AccessibilityTableRow.cpp:
        (WebCore::AccessibilityTableRow::determineAccessibilityRole):
        (WebCore::AccessibilityTableRow::computeAccessibilityIsIgnored const):
        * accessibility/AccessibilityTree.cpp:
        (WebCore::AccessibilityTree::determineAccessibilityRole):
        * accessibility/ios/AccessibilityObjectIOS.mm:
        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
        (WebCore::AccessibilityObject::isInputTypePopupButton const):
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
        (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
        (-[WebAccessibilityObjectWrapper _accessibilityTreeAncestor]):
        (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
        (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
        (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
        (-[WebAccessibilityObjectWrapper _accessibilityTextEntryTraits]):
        (-[WebAccessibilityObjectWrapper accessibilityTraits]):
        (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
        (-[WebAccessibilityObjectWrapper stringValueShouldBeUsedInLabel]):
        (-[WebAccessibilityObjectWrapper accessibilityLabel]):
        (-[WebAccessibilityObjectWrapper accessibilityValue]):
        (-[WebAccessibilityObjectWrapper accessibilityIsComboBox]):
        (-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]):
        (-[WebAccessibilityObjectWrapper accessibilityLinkedElement]):
        (-[WebAccessibilityObjectWrapper treeItemParentForObject:]):
        (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):
        (-[WebAccessibilityObjectWrapper accessibilitySortDirection]):
        * accessibility/mac/AccessibilityObjectMac.mm:
        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
        * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
        (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
        (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
        (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
        (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
        (createAccessibilitySearchKeyMap):
        (accessibilitySearchKeyForString):
        (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute):
        (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
        (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
        (createAccessibilityRoleMap):
        (roleValueToNSString):
        (-[WebAccessibilityObjectWrapper role]):
        (-[WebAccessibilityObjectWrapper subrole]):
        (-[WebAccessibilityObjectWrapper roleDescription]):
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
        (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
        (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):

2017-10-26  Youenn Fablet  <youenn@apple.com>

        importScripts in service worker should use ServiceWorkersMode::None
        https://bugs.webkit.org/show_bug.cgi?id=178888

        Reviewed by Chris Dumez.

        Test: http/tests/workers/service/service-worker-importScript.html

        Made sure ServiceWorkersMode::None is used for loading scripts in service workers as we do not support foreign fetch.

        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::loadSynchronously):

2017-10-26  Keith Miller  <keith_miller@apple.com>

        Unreviewed, cleanup changelogs.

2017-10-26  Keith Miller  <keith_miller@apple.com>

        Unreviewed, add deprecated declarations pragma to fix macosx.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:

2017-10-26  Andy Estes  <aestes@apple.com>

        [Payment Request] Restrict API use to secure, same-origin frames
        https://bugs.webkit.org/show_bug.cgi?id=178887

        Reviewed by Tim Horton.

        Reuse the access checks from Apple Pay to restrict PaymentRequest API usage to secure frames
        in the same origin as the main frame.

        Progresses active-document-cross-origin.https.sub.html and
        active-document-same-origin.https.html from web-platform-tests. Regresses basic.https.html
        since the allowpaymentrequest <iframe> attribute is not yet implemented.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::ApplePaySession::create):
        (WebCore::ApplePaySession::supportsVersion):
        (WebCore::ApplePaySession::canMakePayments):
        (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
        (WebCore::ApplePaySession::openPaymentSetup):
        (WebCore::isSecure): Deleted.
        (WebCore::canCallApplePaySessionAPIs): Deleted.
        * Modules/applepay/PaymentSession.cpp: Added.
        (WebCore::isSecure):
        (WebCore::PaymentSession::canCreateSession):
        * Modules/applepay/PaymentSession.h:
        * Modules/paymentrequest/PaymentHandler.cpp:
        (WebCore::PaymentHandler::canCreateSession):
        * Modules/paymentrequest/PaymentHandler.h:
        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::PaymentRequest::create):
        * WebCore.xcodeproj/project.pbxproj:

2017-10-26  Youenn Fablet  <youenn@apple.com>

        Add service worker handle fetch support for all subresource requests
        https://bugs.webkit.org/show_bug.cgi?id=178769

        Reviewed by Chris Dumez.

        Test: http/tests/workers/service/image-fetch.html

        Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
        Setting the selected service worker identifier for subresource only at the moment.

        Testing is limited to images, future wpt tests should cover other subresource cases.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::prepareFetch):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
        * loader/cache/CachedResourceRequest.h:

2017-10-26  Eric Carlson  <eric.carlson@apple.com>

        NowPlayingInfo should contain a unique identifier
        https://bugs.webkit.org/show_bug.cgi?id=178872

        Reviewed by Jer Noble.

        Updated TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm.

        * platform/audio/PlatformMediaSessionManager.h:
        (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const): New.

        * platform/audio/ios/MediaSessionManagerIOS.h:
        * platform/audio/ios/MediaSessionManagerIOS.mm:
        (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Ditto.

        * platform/audio/mac/MediaSessionManagerMac.h:
        * platform/audio/mac/MediaSessionManagerMac.mm:
        (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto. Don't leak CFString.

        * platform/mac/MediaRemoteSoftLink.cpp: Softlink kMRMediaRemoteNowPlayingInfoUniqueIdentifier.
        * platform/mac/MediaRemoteSoftLink.h:

2017-10-26  Keith Miller  <keith_miller@apple.com>

        Unreviewed, iOS build fix.

        * SourcesMac.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-26  Keith Miller  <keith_miller@apple.com>

        Move Mac specific files to unified sources
        https://bugs.webkit.org/show_bug.cgi?id=178883

        Rubber-stamped by Tim Horton.

        * SourcesCocoa.txt:
        * SourcesMac.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-26  Ryosuke Niwa  <rniwa@webkit.org>

        DidMoveToNewDocumentAssertionScope shouldn't be necessary
        https://bugs.webkit.org/show_bug.cgi?id=178836
        <rdar://problem/35008876>

        Reviewed by Antti Koivisto.

        DidMoveToNewDocumentAssertionScope was introduced in r217972 to replace an existing assertion to make sure
        Node::didMoveToNewDocument is always called by its overrides in Node's subclasses. However, we can ensure
        better Node::didMoveToNewDocument is always called if we called it directly in Node::moveTreeToNewScope.

        Because only subclasses of Element and ShadowRoot override Node::didMoveToNewDocument and we already have
        a specialized code path to adopt a ShadowRoot to a new document, this refactoring eliminates the need for
        having a virtual function on Node at all.

        Hence this patch names Node::didMoveToNewDocument to Node::moveToNewDocument and makes it non-virtual,
        splits ShadowRoot::didMoveToNewDocument into moveShadowRootToNewParentScope and moveShadowRootToNewDocument,
        and removes DidMoveToNewDocumentAssertionScope completely.

        No new tests since there should be no behavioral change.

        * dom/Document.cpp:
        (WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Renamed from moveNodeIteratorsToNewDocument.
        * dom/Document.h:
        (WebCore::Document::moveNodeIteratorsToNewDocument): Inlined the check for emptiness of m_nodeIterators to
        avoid keep calling moveNodeIteratorsToNewDocumentSlowCase on every single node getting moved.
        * dom/Element.cpp:
        (WebCore::Element::didMoveToNewDocument): Removed the call to Node::didMoveToNewDocument since this is the
        base virtual function now.
        * dom/Element.h:
        * dom/Node.cpp:
        (WebCore::DidMoveToNewDocumentAssertionScope::DidMoveToNewDocumentAssertionScope): Deleted.
        (WebCore::DidMoveToNewDocumentAssertionScope::~DidMoveToNewDocumentAssertionScope): Deleted.
        (WebCore::DidMoveToNewDocumentAssertionScope::didRecieveCall): Deleted.
        (WebCore::moveNodeToNewDocument): Deleted.
        (WebCore::Node::moveShadowTreeToNewDocument): Made this a member function of Node since it needs to call
        moveNodeToNewDocument, which is private to Node.
        (WebCore::Node::moveTreeToNewScope): Removed the release assert for the root node since  the same check
        exists inside traverseSubtreeToUpdateTreeScope. Also removed the release assertion for checking that
        node's old document matches the old document since document() simply calls treeScope().documentScope()
        and we're already release-asserting that the old scope of a node matches the old scope we know of.
        We release-assert that the old tree scope's document didn't change after the traversal instead. Finally,
        replaced a bunch of RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
        (WebCore::Node::moveNodeToNewDocument): Renamed from didMoveToNewDocument. Moved the code related to
        mutation observers inside hasRareData() check, and moved the the code to move event listeners inside
        eventTargetData() check both for clarity, and avoid doing the work for every single node being moved.
        Finally, call the old didMoveToNewDocument when "this" is an Element.
        * dom/Node.h:
        * dom/ShadowRoot.cpp:
        (WebCore::ShadowRoot::moveShadowRootToNewParentScope): Added. Extracted from didMoveToNewDocument.
        (WebCore::ShadowRoot::moveShadowRootToNewDocument): Renamed from didMoveToNewDocument. We now
        release-assert that parent tree scope's document matches the new document if any.
        * dom/ShadowRoot.h:

2017-10-26  Youenn Fablet  <youenn@apple.com>

        Implement ServiceWorkerContainer getRegistration
        https://bugs.webkit.org/show_bug.cgi?id=178882

        Reviewed by Chris Dumez.

        Replace rejection promise by resolving the promise with a null value.
        This helps in running WPT tests as WPT tests usually check for registered service workers before running tests.
        For WTR, there should be no registered service worker anyway.

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::getRegistration):
        * workers/service/ServiceWorkerContainer.h:

2017-10-26  Dan Bernstein  <mitz@apple.com>

        Account for Mail’s WebMessageDocument class being renamed
        https://bugs.webkit.org/show_bug.cgi?id=178881

        Reviewed by Sam Weinig.

        * editing/cocoa/HTMLConverter.mm:
        (_WebMessageDocumentClass): Look up the class by its new name. No longer look it up by the
          old old name, because TOT WebKit isn’t going to be used by versions of Mail that have that name.

2017-10-26  Antoine Quint  <graouts@apple.com>

        Remove FrameView::serviceScriptedAnimations and Document::serviceScriptedAnimations
        https://bugs.webkit.org/show_bug.cgi?id=178879

        Reviewed by Dean Jackson.

        There are no call sites for FrameView::serviceScriptedAnimations() and that method is the
        only call site for Document::serviceScriptedAnimations(), so both can go.

        * dom/Document.cpp:
        (WebCore::Document::serviceScriptedAnimations): Deleted.
        * dom/Document.h:
        * page/FrameView.cpp:
        (WebCore::FrameView::serviceScriptedAnimations): Deleted.
        * page/FrameView.h:

2017-10-26  Chris Dumez  <cdumez@apple.com>

        Bring back SWContextManager abstraction in WebCore
        https://bugs.webkit.org/show_bug.cgi?id=178876

        Reviewed by Geoffrey Garen.

        Bring back SWContextManager abstraction in WebCore. It was killed in <https://trac.webkit.org/changeset/223718> but
        is actually useful when the ServiceWorker wants to message the storage process.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * workers/service/context/SWContextManager.cpp: Added.
        (WebCore::SWContextManager::singleton):
        (WebCore::SWContextManager::setConnection):
        (WebCore::SWContextManager::connection const):
        (WebCore::SWContextManager::registerServiceWorkerThread):
        (WebCore::SWContextManager::serviceWorkerThreadProxy const):
        (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
        * workers/service/context/SWContextManager.h: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
        (WebCore::SWContextManager::Connection::~Connection):

2017-10-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Rename CurlJobManager to CurlRequestScheduler
        https://bugs.webkit.org/show_bug.cgi?id=178775

        To match the meaning of the class.
        It was originally meant to be more generic purpose, but as
        other classes was introduced, the objective of the class is
        now only to handle the life cycle of curl requests.

        The delegate is also renamed to CurlRequestSchedulerClient.

        Reviewed by Alex Christensen.

        * platform/Curl.cmake:
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::~CurlDownload):
        (WebCore::CurlDownload::willSendRequest):
        * platform/network/curl/CurlDownload.h:
        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::CurlRequest):
        (WebCore::CurlRequest::start):
        (WebCore::CurlRequest::startWithJobManager):
        (WebCore::CurlRequest::cancel):
        (WebCore::CurlRequest::callClient):
        (WebCore::CurlRequest::didReceiveData):
        (WebCore::CurlRequest::didCompleteTransfer):
        (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
        (WebCore::CurlRequest::invokeDidReceiveResponse):
        (WebCore::CurlRequest::completeDidReceiveResponse):
        (WebCore::CurlRequest::pausedStatusChanged):
        (WebCore::CurlRequest::callDelegate): Deleted.
        * platform/network/curl/CurlRequest.h:
        (WebCore::CurlRequest::create):
        (WebCore::CurlRequest::setClient):
        (WebCore::CurlRequest::setDelegate): Deleted.
        * platform/network/curl/CurlRequestClient.h: Renamed from Source/WebCore/platform/network/curl/CurlRequestDelegate.h.
        * platform/network/curl/CurlRequestScheduler.cpp: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.cpp.
        (WebCore::CurlJobList::startJobs):
        (WebCore::CurlJobList::finishJobs):
        (WebCore::CurlRequestScheduler::singleton):
        (WebCore::CurlRequestScheduler::add):
        (WebCore::CurlRequestScheduler::cancel):
        (WebCore::CurlRequestScheduler::callOnWorkerThread):
        (WebCore::CurlRequestScheduler::startThreadIfNeeded):
        (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
        (WebCore::CurlRequestScheduler::stopThread):
        (WebCore::CurlRequestScheduler::updateJobList):
        (WebCore::CurlRequestScheduler::workerThread):
        * platform/network/curl/CurlRequestScheduler.h: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.h.
        (WebCore::CurlRequestScheduler::~CurlRequestScheduler):
        * platform/network/curl/CurlRequestSchedulerClient.h: Added.
        (WebCore::CurlRequestSchedulerClient::~CurlRequestSchedulerClient):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
        (WebCore::ResourceHandleCurlDelegate::setAuthentication):
        (WebCore::ResourceHandleCurlDelegate::continueAfterWillSendRequest):
        * platform/network/curl/ResourceHandleCurlDelegate.h:

2017-10-26  Antti Koivisto  <antti@apple.com>

        Remove unnecessary whitespace invalidation logic from RenderTreeUpdater
        https://bugs.webkit.org/show_bug.cgi?id=178786

        Reviewed by Zalan Bujtas.

        RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded is a somewhat complex
        and confusing function for figuring out if some whitespace-only text node might need to have its
        rendering status recomputed. However actually computing if a text renderer is needed is not expensive.
        We can simply do it for all whitespace nodes after a sibling mutation.

        This also removes a set that could have stale renderer pointers in it (they were never dereferenced).

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

            Fix a display:contents bug exposed by this change. With display:contents a text renderer may have an anonymous
            inline wrapper and we need to take it into account when the text renderer is the beforeChild.

            Tested by imported/w3c/web-platform-tests/css/css-display-3/display-contents-state-change-001.html

        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateRenderTree):

            Call updateTextRenderer() for all whitespace-only text nodes after a change in siblings.
            In normal update case it just figures out quickly (by calling textRendererIsNeeded)
            that there are no changes and bails out.

        (WebCore::RenderTreeUpdater::updateElementRenderer):
        (WebCore::RenderTreeUpdater::updateTextRenderer):
        (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): Deleted.

            No longer needed. Just mark that there have been changes to siblings instead.

        * style/RenderTreeUpdater.h:

2017-10-26  Myles C. Maxfield  <mmaxfield@apple.com>

        Mark font palettes as in development
        https://bugs.webkit.org/show_bug.cgi?id=178590

        Unreviewed.

        * features.json:

2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r223984.

        Caused LayoutTest assertion failures.

        Reverted changeset:

        "When navigating back to a page, compositing layers may not
        use accelerated drawing"
        https://bugs.webkit.org/show_bug.cgi?id=178749
        https://trac.webkit.org/changeset/223984

2017-10-26  Youenn Fablet  <youenn@apple.com>

        Add inspector logging for MediaElementSession autoplay
        https://bugs.webkit.org/show_bug.cgi?id=178846

        Reviewed by Eric Carlson.

        No change of behavior.
        Making use of pal Logger in MediaElementSession.
        This new logging is limited to autoplay/playback for now.

        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::MediaElementSession):
        (WebCore::MediaElementSession::playbackPermitted const):
        (WebCore::MediaElementSession::autoplayPermitted const):
        (WebCore::MediaElementSession::willLog const):
        (WebCore::MediaElementSession::logChannel const):
        * html/MediaElementSession.h:

2017-10-26  Keith Miller  <keith_miller@apple.com>

        Move ApplePay to unified sources
        https://bugs.webkit.org/show_bug.cgi?id=178871

        Rubber-stamped by Tim Horton.

        Also, add some other missing files.

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

2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r224019.

        This change caused API test WebKit.MSEIsPlayingAudio to time
        out.

        Reverted changeset:

        "XMLHttpRequest should not treat file URLs as same origin"
        https://bugs.webkit.org/show_bug.cgi?id=178565
        https://trac.webkit.org/changeset/224019

2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r223994.

        The LayoutTest for this change is failing.

        Reverted changeset:

        "Add service worker handle fetch support for all subresource
        requests"
        https://bugs.webkit.org/show_bug.cgi?id=178769
        https://trac.webkit.org/changeset/223994

2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r223908.

        Causes LayoutTest crashes with newer SDKs.

        Reverted changeset:

        "Adopt new secure coding APIs"
        https://bugs.webkit.org/show_bug.cgi?id=178484
        https://trac.webkit.org/changeset/223908

2017-10-25  Brent Fulgham  <bfulgham@apple.com>

        XMLHttpRequest should not treat file URLs as same origin
        https://bugs.webkit.org/show_bug.cgi?id=178565
        <rdar://problem/11115901>

        Reviewed by Ryosuke Niwa.

        Do not treat file URLs as same-origin for XHR requests.

        Test: fast/xmlhttprequest/xmlhttprequest-access-self-as-file.html

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Use new helper method.
        * page/SecurityOrigin.cpp:
        (WebCore::SecurityOrigin::requestIsSameOrigin): New method to recognize same-origin
        requests, with special handling for XHR.
        * page/SecurityOrigin.h:

2017-10-26  Christopher Reid  <chris.reid@sony.com>

        Remove scopeguard from platform
        https://bugs.webkit.org/show_bug.cgi?id=178681

        Reviewed by Brady Eidson.

        Replacing platform/ScopeGuard with WTF::ScopeExit.
        No new tests, no change in behavior.

        * Modules/indexeddb/IDBRequest.cpp:
        * Modules/indexeddb/IDBRequest.h:
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/FileSystem.cpp:
        * platform/ScopeGuard.h: Removed.
        * platform/network/BlobRegistryImpl.cpp:
        * workers/service/ServiceWorkerContainer.cpp:

2017-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r222090): [HarfBuzz] Arabic shaping is broken except for first word in line
        https://bugs.webkit.org/show_bug.cgi?id=178625

        Reviewed by Michael Catanzaro.

        Once we find the first space, which has the COMMON script, we split the run, and the next ones keep using
        COMMON instead of ARABIC because we don't update the current script on every loop iteration. This patch
        simplifies the script handling by moving the code back to the loop and always breaking in case of different
        scripts, correctly handling INHERITED and COMMON cases and updating the current script when needed.

        Covered by existing tests. This improves several tests that have been rebaselined.

        * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
        (WebCore::findNextRun):
        (WebCore::scriptsAreCompatibleForCharacters): Deleted.

2017-10-26  Enrique Ocaña González  <eocanha@igalia.com>

        [MSE][GStreamer] Fix hang on clearing/destroying AppendPipeline
        https://bugs.webkit.org/show_bug.cgi?id=178819

        Reviewed by Xabier Rodriguez-Calvar.

        The deadlock may occur when UI thread tries to clear pipeline in
        AppendPipeline::clearPlayerPrivate() while parser thread tries to change
        pipeline state to pause holding the stream lock in
        AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread()

        This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>

        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
        Return if there's no player private.

2017-10-26  Ryosuke Niwa  <rniwa@webkit.org>

        Assert that no script is executed during style recalc
        https://bugs.webkit.org/show_bug.cgi?id=178845
        <rdar://problem/35106129>

        Reviewed by Antti Koivisto.

        This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
        to make sure we don't start mutating DOM in the middle of a style update.

        Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
        shadow tree since that happens while updating the style.

        No new tests since there should be no behavioral change.

        * dom/Document.cpp:
        (WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
        and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
        the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
        Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
        scripts which in turn trigger another (recursive) style recalc.
        (WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
        NoEventDispatchAssertion.
        * dom/Element.cpp:
        (WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
        newly cloned element for SVG use element's shadow tree.
        (WebCore::Element::cloneElementWithoutChildren): Ditto.
        * dom/EventDispatcher.cpp:
        (WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
        use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
        since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
        pushing or popoing the stack frame.
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::clearShadowTree):
        (WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
        of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
        scripts, it's safe to mutate them during the style recalc even though it's not the best design.
        (WebCore::SVGUseElement::cloneTarget const): Ditto.
        (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
        (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
        (WebCore::SVGUseElement::transferEventListenersToShadowTree const):

2017-10-25  Keith Miller  <keith_miller@apple.com>

        Move platform Cocoa sources to unified sources
        https://bugs.webkit.org/show_bug.cgi?id=178851

        Rubber-stamped by Tim Horton.

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

2017-10-25  Keith Miller  <keith_miller@apple.com>

        Start moving Cocoa specific unified sources
        https://bugs.webkit.org/show_bug.cgi?id=178850

        Rubber-stamped by Tim Horton.

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

2017-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>

        [HarfBuzz] ComplexTextRun should initialize direction from the harfbuzz buffer
        https://bugs.webkit.org/show_bug.cgi?id=178788

        Reviewed by Michael Catanzaro.

        Instead of using the TextRun direction. If the TextRun is ltr, but the harfbuzz buffer is rtl, the character
        indexes will be swapped in m_coreTextIndices.

        * platform/graphics/ComplexTextController.h:
        (WebCore::ComplexTextController::ComplexTextRun::create): Remove the ltr parameter.
        * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
        (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Initialize m_isLTR using hb_buffer_get_direction().
        (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Do not pass ltr to ComplexTextRun::create().

2017-10-25  Keith Miller  <keith_miller@apple.com>

        Move remaining platform independent sources to unified sources
        https://bugs.webkit.org/show_bug.cgi?id=178849

        Rubber-stamped by Tim Horton.

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-25  Keith Miller  <keith_miller@apple.com>

        Move plugins and rendering to unified sources
        https://bugs.webkit.org/show_bug.cgi?id=178848

        Rubber-stamped by Tim Horton.

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-25  Keith Miller  <keith_miller@apple.com>

        Unreviewed, add FEMorphology.cpp back to the regular build after r224003.

        * WebCore.xcodeproj/project.pbxproj:

2017-10-25  Keith Miller  <keith_miller@apple.com>

        Unreviewed, Windows build fix.

        * Sources.txt:

2017-10-25  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: provide a way to enable/disable event listeners
        https://bugs.webkit.org/show_bug.cgi?id=177451
        <rdar://problem/34994925>

        Reviewed by Joseph Pecoraro.

        Test: inspector/dom/setEventListenerDisabled.html

        * dom/EventTarget.cpp:
        (WebCore::EventTarget::fireEventListeners):
        Add InspectorInstrumentation call to isEventListenerDisabled. If true, the event listener's
        callback will not be called.

        * inspector/InspectorDOMAgent.h:
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::discardBindings):
        (WebCore::InspectorDOMAgent::getEventListenersForNode):
        (WebCore::InspectorDOMAgent::setEventListenerDisabled):
        (WebCore::InspectorDOMAgent::buildObjectForEventListener):
        (WebCore::InspectorDOMAgent::willRemoveEventListener):
        (WebCore::InspectorDOMAgent::isEventListenerDisabled):
        Introduce a mapping of `EventListener*` to `InspectorEventListener`, a struct for uniquely
        identifying event listeners so they can be referenced from the frontend. We only add items
        to this mapping when `getEventListenersForNode` is called, as that is when EventListener
        data is sent to the frontend. This allows us to defer creating an Inspector "mirror" object
        for each EventListener until it is needed. Items are removed whenever an event listener is
        removed or when the document changes.

        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::isEventListenerDisabled):
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
        (WebCore::InspectorInstrumentation::isEventListenerDisabledImpl):
        Pass additional parameters to InspectorDOMAgent so it can determine if the event listener
        actually exists. If not, don't dispatch an event to the frontend as nothing will change.

2017-10-25  Keith Miller  <keith_miller@apple.com>

        Move Platform to unified sources.
        https://bugs.webkit.org/show_bug.cgi?id=178829

        Rubber-stamped by Tim Horton.

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/Cursor.cpp:
        * platform/sql/SQLiteDatabase.h:

2017-10-25  Chris Dumez  <cdumez@apple.com>

        messageEvent.source can also be a ServiceWorker
        https://bugs.webkit.org/show_bug.cgi?id=178839

        Reviewed by Brady Eidson.

        messageEvent.source can also be a ServiceWorker:
        - https://html.spec.whatwg.org/multipage/comms.html#messageeventsource

        This enables calling postMessage() from a ServiceWorker via Bug 178794.

        * dom/MessageEvent.cpp:
        (WebCore::MessageEvent::source const): Deleted.
        * dom/MessageEvent.h:
        * dom/MessageEvent.idl:

2017-10-25  Ryosuke Niwa  <rniwa@webkit.org>

        Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
        https://bugs.webkit.org/show_bug.cgi?id=178715
        <rdar://problem/35144665>

        Reviewed by Brent Fulgham.

        Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
        instead of in the middle of collecting a list of stylesheets.

        * dom/Document.cpp:
        (WebCore::Document::Document): Initialize the newly added timer.
        (WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
        handlers may be expecting to see the document after XSLT had been applied.
        (WebCore::Document::scheduleToApplyXSLTransforms): Added.
        (WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
        (WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
        Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
        (WebCore::Document::applyXSLTransform): Deleted.
        (WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
        inline XSLT and it happens much earlier than implicitClose.
        * dom/Document.h:
        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
        stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
        function can be called from a non-script-resilient call stack.
        (WebCore::ProcessingInstruction::sheetLoaded): Ditto.
        * style/StyleScope.cpp:
        (WebCore::Style::Scope::collectXSLTransforms): Added.
        (WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
        that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
        * style/StyleScope.h:
        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.

2017-10-25  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: Canvas Tab: starting a second recording doesn't show red titlebar if the first recording was empty
        https://bugs.webkit.org/show_bug.cgi?id=178805
        <rdar://problem/35176303>

        Reviewed by Brian Burg.

        No new tests, updated existing tests.

        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
        If the recording was stopped and had no data, reset the CallTracingActive flag to false.

2017-10-25  Keith Miller  <keith_miller@apple.com>

        Move html to unified sources
        https://bugs.webkit.org/show_bug.cgi?id=178709

        Reviewed by Alex Christensen.

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-25  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Delete temporally downloaded file when it cancelled
        https://bugs.webkit.org/show_bug.cgi?id=134393

        Reviewed by Alex Christensen.

        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::didCancelTransfer):
        (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
        (WebCore::CurlRequest::closeDownloadFile):
        (WebCore::CurlRequest::cleanupDownloadFile):
        * platform/network/curl/CurlRequest.h:

2017-10-25  Youenn Fablet  <youenn@apple.com>

        Add service worker handle fetch support for all subresource requests
        https://bugs.webkit.org/show_bug.cgi?id=178769

        Reviewed by Chris Dumez.

        Test: http/tests/workers/service/image-fetch.https.html

        Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
        Setting the selected service worker identifier for subresource only at the moment.

        Testing is limited to images, future wpt tests should cover other subresource cases.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::prepareFetch):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
        * loader/cache/CachedResourceRequest.h:

2017-10-25  Simon Fraser  <simon.fraser@apple.com>

        Aliasing of text in CSS specs is blocky and ugly
        https://bugs.webkit.org/show_bug.cgi?id=174946
        rdar://problem/33594542

        Reviewed by Dean Jackson.

        The PaintedContentRequest relating to subpixel-antialiased text was failing to be
        satisfied if the text content in a composited layer was nested inside descendant
        RenderLayers, because RenderLayer::isVisuallyNonEmpty() returned early. If this
        function is passed a request, we can't return until we've satisfied the request
        (which triggers the checking of descendant layers).

        Test: compositing/contents-format/subpixel-antialiased-nested-layer.html

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

2017-10-25  Chris Dumez  <cdumez@apple.com>

        Unreviewed, add missing copyright header to ServiceWorkerClientType.idl.

        * workers/service/ServiceWorkerClientType.idl:
        * platform/Cursor.cpp: Previously, excluded on iOS now wrapped in #if
        * platform/sql/SQLiteDatabase.h: remove debugging data member from release builds.

2017-10-25  Chris Dumez  <cdumez@apple.com>

        Make toJS() do the right thing for ServiceWorkerClient
        https://bugs.webkit.org/show_bug.cgi?id=178816

        Reviewed by Youenn Fablet.

        Make toJS() do the right thing for ServiceWorkerClient. In particular,
        it needs to construct a JSServiceWorkerWindowClient wrapper if the
        implementation object is a ServiceWorkerWindowClient.

        Also, ServiceWorkerClient does not need to be an ActiveDOMObject as
        it does not have any long-running tasks. Make it a ContextDestructionObject
        instead for now.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * workers/service/ServiceWorkerClient.cpp:
        (WebCore::ServiceWorkerClient::postMessage):
        * workers/service/ServiceWorkerClient.h:
        (WebCore::ServiceWorkerClient::create):
        * workers/service/ServiceWorkerClient.idl:
        * workers/service/ServiceWorkerClientType.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
        * workers/service/ServiceWorkerClientType.idl: Added.
        * workers/service/ServiceWorkerClients.h:
        * workers/service/ServiceWorkerClients.idl:

2017-10-25  Simon Fraser  <simon.fraser@apple.com>

        When navigating back to a page, compositing layers may not use accelerated drawing
        https://bugs.webkit.org/show_bug.cgi?id=178749
        rdar://problem/35158946

        Reviewed by Dean Jackson.

        There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
        occurred on back navigation, related to the ordering of style recalcs and layout.

        First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
        its cacheAcceleratedCompositingFlags(), so any layers created during style update
        didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
        to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().

        Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
        before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
        the TileController.

        Test: compositing/accelerated-layers-after-back.html

        * page/FrameView.cpp:
        (WebCore::FrameView::updateCompositingLayersAfterLayout):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::willRecalcStyle):
        (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
        (WebCore::RenderLayerCompositor::updateCompositingLayers):
        * rendering/RenderLayerCompositor.h:

2017-10-25  Youenn Fablet  <youenn@apple.com>

        Enable ServiceWorker to fetch resources
        https://bugs.webkit.org/show_bug.cgi?id=178673

        Reviewed by Brady Eidson.

        Test: http/tests/workers/service/service-worker-fetch.html

        Allow reusing of EmptyFrameLoaderClient for network loading in WebKit Service Worker environment.
        Allow overriding the creation of a document loader, pageID, frameID and sessionID getters.

        Allow the possibility to create synthetic documents for all ports.

        Beefing up ServiceWorkerThreadProxy as it owns a Document and a Page that do nothing but server
        the purpose of loading resources for a service worker thread.

        * WebCore.xcodeproj/project.pbxproj:
        * loader/DocumentLoader.h:
        (WebCore::DocumentLoader::setResponse):
        * loader/EmptyClients.cpp:
        (WebCore::EmptyFrameLoaderClient::sessionID const):
        (WebCore::EmptyFrameLoaderClient::createNetworkingContext):
        (WebCore::createEmptyFrameNetworkingContext):
        * loader/EmptyClients.h:
        * loader/EmptyFrameLoaderClient.h: Added.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::initForSynthesizedDocument):
        * loader/FrameLoader.h:
        * loader/FrameLoaderClient.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::ServiceWorkerThread):
        (WebCore::m_workerObjectProxy):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/context/ServiceWorkerThreadProxy.cpp:
        (WebCore::ServiceWorkerThreadProxy::create):
        (WebCore::createPageForServiceWorker):
        (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
        (WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
        * workers/service/context/ServiceWorkerThreadProxy.h:
        Test: http/tests/workers/service/service-worker-fetch.html

2017-10-25  Jer Noble  <jer.noble@apple.com>

        UNPACK_FLIP_Y is broken for MSE-backed videos
        https://bugs.webkit.org/show_bug.cgi?id=178774

        Reviewed by Dean Jackson.

        The global GLSL variable gl_Position can apparently only be set once, and any modifications
        made after that initial set are ignored. So rather than implement flipping by changing
        gl_Position.y, flip the texture coordinates instead.

        Drive-by fix: some of the constants used in VideoTextureCopierCV are not defined on older
        macOS versions, so make them optional.

        Tests: fast/canvas/webgl/texImage2D-mse-flipY-false.html
               fast/canvas/webgl/texImage2D-mse-flipY-true.html

        * platform/graphics/cv/VideoTextureCopierCV.cpp:
        (WebCore::transferFunctionFromString):
        (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
        * platform/cocoa/CoreVideoSoftLink.cpp:
        * platform/cocoa/CoreVideoSoftLink.h:

2017-10-25  Chris Dumez  <cdumez@apple.com>

        [Service Worker] Add stubs for serviceWorkerClient.type
        https://bugs.webkit.org/show_bug.cgi?id=178812

        Reviewed by Youenn Fablet.

        Add stubs for serviceWorkerClient.type to match the latest specification:
        - https://w3c.github.io/ServiceWorker/#enumdef-clienttype

        * CMakeLists.txt:
        * DerivedSources.make:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * workers/service/ServiceWorkerClient.cpp:
        (WebCore::ServiceWorkerClient::type const):
        * workers/service/ServiceWorkerClient.h:
        * workers/service/ServiceWorkerClient.idl:
        * workers/service/ServiceWorkerClientType.h: Added.
        * workers/service/ServiceWorkerClientType.idl: Added.
        * workers/service/ServiceWorkerClients.h:
        * workers/service/ServiceWorkerClients.idl:

2017-10-24  Keith Miller  <keith_miller@apple.com>

        Move mathml and page to unified souces
        https://bugs.webkit.org/show_bug.cgi?id=178770

        Rubber-stamped by Tim Horton.

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-25  Fujii Hironori  <Hironori.Fujii@sony.com>

        fast/images/animated-gif-paint-after-animation.html flaky crash
        https://bugs.webkit.org/show_bug.cgi?id=178510

        Reviewed by Said Abou-Hallawa.

        ScalableImageDecoder was accessed from the main thread and the
        image decoding thread without a mutex.

        No new tests because there is no behavior change.

        * platform/image-decoders/ScalableImageDecoder.h: Add m_mutex. Lock the mutex in setData.
        * platform/image-decoders/ScalableImageDecoder.cpp:
        (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): Lock the mutex.
        (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): Ditto.
        (WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
        (WebCore::ScalableImageDecoder::frameDurationAtIndex const): Ditto.
        (WebCore::ScalableImageDecoder::createFrameImageAtIndex): Ditto.

2017-10-25  Chris Dumez  <cdumez@apple.com>

        Add support for unregistering a service worker
        https://bugs.webkit.org/show_bug.cgi?id=178735

        Reviewed by Brady Eidson.

        Add support for unregistering a service worker:
        - https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister

        Test: http/tests/workers/service/basic-unregister.https.html

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::removeRegistration):
        (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
        * workers/service/ServiceWorkerJob.h:
        * workers/service/ServiceWorkerJobClient.h:
        * workers/service/ServiceWorkerJobData.h:
        (WebCore::ServiceWorkerJobData::encode const):
        (WebCore::ServiceWorkerJobData::decode):
        * workers/service/ServiceWorkerJobType.h:
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::containerForScriptExecutionContext):
        (WebCore::ServiceWorkerRegistration::unregister):
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::registrationJobResolvedInServer):
        (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::resolveRegistationJob):
        (WebCore::SWServer::resolveUnregistrationJob):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::scriptContextStarted):
        (WebCore::SWServerRegistration::startNextJob):
        (WebCore::SWServerRegistration::runUnregisterJob):
        (WebCore::SWServerRegistration::resolveWithRegistrationOnMainThread):
        (WebCore::SWServerRegistration::resolveWithUnregistrationResultOnMainThread):
        (WebCore::SWServerRegistration::resolveCurrentRegistrationJob):
        (WebCore::SWServerRegistration::resolveCurrentUnregistrationJob):
        * workers/service/server/SWServerRegistration.h:

2017-10-25  Simon Fraser  <simon.fraser@apple.com>

        MediaSessionManager* needs to catch Obj-C exceptions
        https://bugs.webkit.org/show_bug.cgi?id=178813

        Reviewed by Tim Horton.

        Wrap all calls out to Objective-C with BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS.

        * platform/audio/ios/MediaSessionManagerIOS.mm:
        (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
        (WebCore::MediaSessionManageriOS::~MediaSessionManageriOS):
        (WebCore::MediaSessionManageriOS::hasWirelessTargetsAvailable):
        (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
        (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
        (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
        (-[WebMediaSessionHelper allocateVolumeView]):
        (-[WebMediaSessionHelper initWithCallback:]):
        * platform/audio/mac/MediaSessionManagerMac.mm:
        (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):

2017-10-25  Andy Estes  <aestes@apple.com>

        [Payment Request] Implement the "user aborts the payment request" algorithm
        https://bugs.webkit.org/show_bug.cgi?id=178810

        Reviewed by Tim Horton.

        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::ApplePayPaymentHandler::didCancelPaymentSession):
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::PaymentRequest::cancel):
        * Modules/paymentrequest/PaymentRequest.h:
        * testing/MockPaymentCoordinator.cpp:
        (WebCore::MockPaymentCoordinator::cancelPayment):
        * testing/MockPaymentCoordinator.h:
        * testing/MockPaymentCoordinator.idl:

2017-10-25  Jer Noble  <jer.noble@apple.com>

        Autoplay muted videos still stop playback of other streaming apps in the background
        https://bugs.webkit.org/show_bug.cgi?id=177920

        Reviewed by Eric Carlson.

        When creating a new <video> or <audio> element, the global AudioSession can sometimes have
        its sessionCategory() set to "MediaPlayback", even if the element does not yet have a
        source. This is because the constructor for the MediaElementSession is called before
        m_isPlayingToWirelessTarget is initialized, and so in the MediaElementSession constructor,
        the media element's m_isPlayingToWirelessTarget ivar is sometimes (uninitialized) true.

        We could move the MediaElementSession ivar to the very end of the header, so it's
        initialized last, but that still leaves the possibility of the MediaElementSession et. all
        calling into the HTMLMediaElement before it's subclass's constructors have a chance to
        initialize their own ivars (much less their vtables). So instead, we'll create and set the
        MediaElementSession in a finishInitialization() method called from the HTMLVideoElement and
        HTMLAudioElement's create() factory methods.

        * html/HTMLAudioElement.cpp:
        (WebCore::HTMLAudioElement::create):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::HTMLMediaElement):
        (WebCore::HTMLMediaElement::finishInitialization):
        * html/HTMLMediaElement.h:
        * html/HTMLVideoElement.cpp:
        (WebCore::HTMLVideoElement::create):

2017-10-25  Javier Fernandez  <jfernandez@igalia.com>

        [css-grid] Avoid clearing the overrideContainingBlockWidth if possible
        https://bugs.webkit.org/show_bug.cgi?id=178260

        Reviewed by Sergio Villar Senin.

        Since the intrinsic width computation uses the same logic than the
        track sizing algorithm we are clearing the overrideContainingBlockWidth
        of some grid items that are required to laid out them properly.

        It's very uncommon that any intrinsic size computation isn't performed
        as part of a layout process. However, if it happens, once cleared the
        overrideContainingBlockWidth it may lead to an incorrect layout of the
        affected grid items.

        This change is a defensive approach to avoid the issues caused by
        such off-layout preferred size requests, which may imply recomputing
        the grid container intrinsic size.

        No new tests, because we are only removing some redundant logic.

        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
        (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
        (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
        (WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild const):
        (WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild const):
        (WebCore::DefiniteSizeStrategy::minLogicalWidthForChild const):
        * rendering/GridTrackSizingAlgorithm.h:

2017-10-25  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>

        Unreviewed follow up changing one more enum value as discussed in the bug
        https://bugs.webkit.org/show_bug.cgi?id=177810

        * platform/glib/LowPowerModeNotifierGLib.cpp:
        (WebCore::LowPowerModeNotifier::updateState): use NONE instead of DISCHARGING, to ensure
        it will build even with older upower.

2017-10-25  Zan Dobersek  <zdobersek@igalia.com>

        Make SERVICE_WORKER feature buildable on GTK, WPE
        https://bugs.webkit.org/show_bug.cgi?id=178574

        Reviewed by Carlos Garcia Campos.

        * CMakeLists.txt: Add missing include paths and files to the build.
        * Sources.txt: Add missing files to the build.
        * WebCore.xcodeproj/project.pbxproj: Remove the JSDOMPromise.cpp and
        JSFetchEventCustom.cpp targets, they're now built via unified sources.
        * bindings/js/JSFetchEventCustom.cpp: Guard custom JSFetchEvent code
        with the ENABLE(SERVICE_WORKER) guards.

2017-10-24  Alejandro G. Castro  <alex@igalia.com>

        Clean up gcc build warnings about reaching the end of a non void function for webrtc classes
        https://bugs.webkit.org/show_bug.cgi?id=178721

        Reviewed by Youenn Fablet.

        Assert when we reach those situations and return some value after that to avoid warning.

        No new tests, this is a clean up.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::sessionDescriptionType):
        (WebCore::signalingState):
        (WebCore::toRTCIceConnectionState):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::bundlePolicyfromConfiguration):
        (WebCore::iceTransportPolicyfromConfiguration):

2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>

        RenderSVGModelObject::checkIntersection triggers layout
        https://bugs.webkit.org/show_bug.cgi?id=178710

        Reviewed by Simon Fraser.

        Fixed the bug that checkIntersection and checkEnclosure no longer updates the layout after r223882.

        Test: svg/custom/check-intersection-basic.svg

        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
        (WebCore::SVGSVGElement::checkIntersection):
        (WebCore::SVGSVGElement::checkEnclosure):
        * svg/SVGSVGElement.h:

2017-10-24  Andy Estes  <aestes@apple.com>

        [Apple Pay] Implement a paymentmethodselected event for PaymentRequest
        https://bugs.webkit.org/show_bug.cgi?id=178765

        Reviewed by Tim Horton.

        When the Apple Pay payment method changes, fire an applepaypaymentmethodchanged event on the
        PaymentRequest object. The event has a paymentMethod property and an updateWith() method
        which behaves identically to PaymentRequestUpdateEvent.updateWith().

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

        * DerivedSources.make:
        * Modules/applepay/ApplePayPaymentMethod.idl:
        * Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
        * Modules/applepay/PaymentMethod.h:
        (WebCore::PaymentMethod::PaymentMethod): Deleted.
        (WebCore::PaymentMethod::pkPaymentMethod const): Deleted.
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::ApplePayPaymentHandler::detailsUpdated):
        (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
        (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
        * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp: Added.
        (WebCore::ApplePayPaymentMethodUpdateEvent::ApplePayPaymentMethodUpdateEvent):
        (WebCore::ApplePayPaymentMethodUpdateEvent::eventInterface const):
        * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h: Added.
        * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl: Added.
        * Modules/paymentrequest/PaymentHandler.h:
        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::PaymentRequest::shippingAddressChanged):
        (WebCore::PaymentRequest::shippingOptionChanged):
        (WebCore::PaymentRequest::dispatchEvent):
        (WebCore::PaymentRequest::updateWith):
        (WebCore::PaymentRequest::settleDetailsPromise):
        (WebCore::PaymentRequest::dispatchUpdateEvent): Deleted.
        * Modules/paymentrequest/PaymentRequest.h:
        * Modules/paymentrequest/PaymentRequest.idl:
        * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
        (WebCore::PaymentRequestUpdateEvent::updateWith):
        * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/EventNames.h:
        * dom/EventNames.in:
        * testing/MockPaymentCoordinator.cpp:
        (WebCore::MockPaymentCoordinator::changePaymentMethod):
        * testing/MockPaymentCoordinator.h:
        * testing/MockPaymentCoordinator.idl:
        * testing/MockPaymentMethod.h: Added.

2017-10-24  Youenn Fablet  <youenn@apple.com>

        ServiceWorkerClientFetch should return an error that is not null in case of failure
        https://bugs.webkit.org/show_bug.cgi?id=178761

        Reviewed by Geoffrey Garen.

        Covered by existing tests.

        As per spec, ServiceWorkerJob should not go through Service Worker Handle Fetch
        for fetching scripts.

        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::loadAsynchronously):
        * workers/WorkerScriptLoaderClient.h:
        (WebCore::WorkerScriptLoaderClient::isServiceWorkerClient const):
        * workers/service/ServiceWorkerJob.h:

2017-10-24  Keith Miller  <keith_miller@apple.com>

        Move inspector and loader to unified sources.
        https://bugs.webkit.org/show_bug.cgi?id=178760

        Rubber-stamped by Tim Horton.

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-24  Alex Christensen  <achristensen@webkit.org>

        Fix build after r223940

        * inspector/WebConsoleAgent.cpp:

2017-10-24  Alex Christensen  <achristensen@webkit.org>

        Fix Windows build after r223929.
        https://bugs.webkit.org/show_bug.cgi?id=177027

        * inspector/WebConsoleAgent.cpp:
        (WebCore::WebConsoleAgent::getLoggingChannels):
        Always initialize the variable "level".  Visual studio was complaining about the possibility of not initializing it
        but this is only possible if logChannel->level is an invalid enum value.

2017-10-24  Alex Christensen  <achristensen@webkit.org>

        Fix Windows build after r223925
        https://bugs.webkit.org/show_bug.cgi?id=178687

        * html/ImageBitmap.cpp:
        (WebCore::interpolationQualityForResizeQuality):
        Visual Studio was complaining that not all control paths returned a value.

2017-10-24  Youenn Fablet  <youenn@apple.com>

        Enable service worker to use cache storage api
        https://bugs.webkit.org/show_bug.cgi?id=178684

        Reviewed by Brady Eidson.

        Test: http/tests/workers/service/service-worker-cache-api.https.html

        Updated WorkerLoaderProxy so that it can create a CacheStorageConnection.
        Update WorkerCacheStorageConnection to take benefit of that.
        This allows creating a CacheStorageConnection based on the page for regular workers and differently for Service Worker context.

        Added ServiceWorkerThreadProxy as a proxy to ServiceWorkerThread.
        It is in particular responsible to do proxy for loading tasks.
        It implements cache API support for service worker by creating a dedicated CacheStorageConnection.

        * Modules/cache/WorkerCacheStorageConnection.cpp:
        (WebCore::WorkerCacheStorageConnection::create):
        (WebCore::WorkerCacheStorageConnection::~WorkerCacheStorageConnection):
        (WebCore::WorkerCacheStorageConnection::doOpen):
        (WebCore::WorkerCacheStorageConnection::doRemove):
        (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
        (WebCore::WorkerCacheStorageConnection::reference):
        (WebCore::WorkerCacheStorageConnection::dereference):
        (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
        (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
        (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
        * WebCore.xcodeproj/project.pbxproj:
        * workers/WorkerLoaderProxy.h:
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::createCacheStorageConnection):
        * workers/WorkerMessagingProxy.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::ServiceWorkerThread):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/context/ServiceWorkerThreadProxy.cpp: Added.
        (WebCore::ServiceWorkerThreadProxy::create):
        (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
        (WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope):
        (WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
        (WebCore::ServiceWorkerThreadProxy::createCacheStorageConnection):
        * workers/service/context/ServiceWorkerThreadProxy.h: Added.

2017-10-24  Alex Christensen  <achristensen@webkit.org>

        Optionally store entire ResourceRequest for ping loads
        https://bugs.webkit.org/show_bug.cgi?id=178756

        Reviewed by Tim Horton.

        No change in behavior.
        This uses less memory in the common loading case.
        This will be needed for moving appcache loading to the Networking Process.
        See https://bugs.webkit.org/show_bug.cgi?id=178540

        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load):
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::setOriginalRequest):
        (WebCore::CachedResource::originalRequest const):
        (WebCore::CachedResource::setOriginalRequestHeaders): Deleted.
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestResource):

2017-10-24  Andy Estes  <aestes@apple.com>

        [WebIDL] Support the ExportMacro attribute for dictionaries
        https://bugs.webkit.org/show_bug.cgi?id=178752

        Reviewed by Sam Weinig.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateDictionaryHeaderContent):
        * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
        * bindings/scripts/test/TestStandaloneDictionary.idl:

2017-10-24  Eric Carlson  <eric.carlson@apple.com>

        Web Inspector: Enable WebKit logging configuration and display
        https://bugs.webkit.org/show_bug.cgi?id=177027
        <rdar://problem/33964767>

        Reviewed by Joseph Pecoraro.

        Test: inspector/console/webcore-logging.html

        * dom/Document.cpp:
        (WebCore::Document::~Document): Stop observing the logger.
        (WebCore::Document::logger): Observe the logger.
        (WebCore::Document::didLogMessage): Forward logging messages to the inspector.
        * dom/Document.h:

        * inspector/WebConsoleAgent.cpp:
        (WebCore::WebConsoleAgent::getLoggingChannels): New, return the state of log runtime channels.
        (WebCore::WebConsoleAgent::setLoggingChannelLevel): New, set the state of a channel.
        * inspector/WebConsoleAgent.h:

        * platform/Logging.cpp:
        (WebCore::getLogChannel): New, get a log channel by name.
        * platform/Logging.h:

2017-10-24  Dean Jackson  <dino@apple.com>

        Attempted build fix for Sierra.

        * html/ImageBitmap.cpp:
        (WebCore::croppedSourceRectangleWithFormatting):

2017-10-24  Dean Jackson  <dino@apple.com>

        Implement resizing options for ImageBitmap rendering
        https://bugs.webkit.org/show_bug.cgi?id=178687
        <rdar://problem/35135417>

        Reviewed by Sam Weinig.

        Implement many of the sizing options for createImageBitmap.

        Test: http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing.html

        * html/ImageBitmap.cpp:
        (WebCore::croppedSourceRectangleWithFormatting):

            Implement the first bit of the algorithm from
            the HTML specification.

        (WebCore::outputSizeForSourceRectangle):

            ... and then the second bit. Leave the rest in
            comments for now.

        (WebCore::interpolationQualityForResizeQuality):

            Helper function to map ImageBitmapOptions to
            GraphicsContext.

        (WebCore::ImageBitmap::createPromise):

            Implement more of the sizing algorithm.

        * html/ImageBitmap.h: Origin tainting is defined to be false by default.

2017-10-24  Chris Dumez  <cdumez@apple.com>

        Add initial implementation for serviceWorker.postMessage()
        https://bugs.webkit.org/show_bug.cgi?id=178534

        Reviewed by Youenn Fablet.

        Add initial implementation for serviceWorker.postMessage():
        - https://w3c.github.io/ServiceWorker/#service-worker-postmessage

        Test: http/tests/workers/service/basic-ServiceWorker-postMessage.https.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSExtendableMessageEvent.cpp: Added.
        (WebCore::JSExtendableMessageEvent::data const):
        * bindings/js/WebCoreBuiltinNames.h:
        * dom/Document.h:
        * dom/EventNames.in:
        * dom/MessagePortChannel.h:
        * dom/ScriptExecutionContext.h:
        * workers/WorkerGlobalScope.h:
        * workers/service/ExtendableEvent.cpp:
        (WebCore::ExtendableEvent::ExtendableEvent):
        (WebCore::ExtendableEvent::~ExtendableEvent):
        * workers/service/ExtendableEvent.h:
        * workers/service/ExtendableMessageEvent.cpp: Added.
        (WebCore::ExtendableMessageEvent::create):
        (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
        (WebCore::ExtendableMessageEvent::~ExtendableMessageEvent):
        * workers/service/ExtendableMessageEvent.h: Added.
        * workers/service/ExtendableMessageEvent.idl: Added.
        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::ServiceWorker):
        (WebCore::ServiceWorker::postMessage):
        (WebCore::ServiceWorker::state const):
        (WebCore::ServiceWorker::scriptExecutionContext const):
        * workers/service/ServiceWorker.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::controller const):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerGlobalScope.cpp:
        (WebCore::ServiceWorkerGlobalScope::thread):
        * workers/service/ServiceWorkerGlobalScope.h:
        (isType):
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/server/SWClientConnection.h:

2017-10-24  Andy Estes  <aestes@apple.com>

        [Payment Request] Implement the "PaymentRequest updated" algorithm
        https://bugs.webkit.org/show_bug.cgi?id=178689

        Reviewed by Alex Christensen.

        Implemented the "PaymentRequest updated" algorithm by firing shippingaddresschange and
        shippingoptionchange events at the right times and implementing
        PaymentRequestUpdateEvent.updateWith().

        Tests: http/tests/paymentrequest/payment-request-change-shipping-address.https.html
               http/tests/paymentrequest/payment-request-change-shipping-option.https.html
               http/tests/paymentrequest/updateWith-method-pmi-handling.https.html

        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::convertAndValidate): Added. Converts a PaymentDetailsInit to a
        ApplePaySessionPaymentRequest::TotalAndLineItems.
        (WebCore::ApplePayPaymentHandler::shippingAddressUpdated): Created a ShippingContactUpdate
        and passed it to PaymentCoordinator::completeShippingContactSelection().
        (WebCore::ApplePayPaymentHandler::shippingOptionUpdated): Created a ShippingMethodUpdate and
        passed it to PaymentCoordinator::completeShippingMethodSelection().
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
        * Modules/paymentrequest/PaymentHandler.h:
        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::checkAndCanonicalizeDetails): Moved the logic for checking and canonicalizing a
        PaymentDetailsBase from PaymentRequest::create() to here.
        (WebCore::PaymentRequest::create): Called checkAndCanonicalizeDetails().
        (WebCore::PaymentRequest::abortWithException): Moved the body of stop() to here and
        parameterized the Exception with which to abort m_showPromise.
        (WebCore::PaymentRequest::stop): Called abortWithException() with an AbortError.
        (WebCore::PaymentRequest::shippingAddressChanged): Called dispatchUpdateEvent() with
        shippingaddresschangeEvent.
        (WebCore::PaymentRequest::shippingOptionChanged): Ditto with shippingoptionchangeEvent.
        (WebCore::PaymentRequest::dispatchUpdateEvent): Created a PaymentRequestUpdateEvent and
        dispatched it.
        (WebCore::PaymentRequest::updateWith): Added a settle handler to m_detailsPromise.
        (WebCore::PaymentRequest::settleDetailsPromise): Updated the PaymentRequest with the new
        details and called PaymentHandler::shippingAddressUpdated() or
        PaymentHandler::shippingOptionUpdated().
        * Modules/paymentrequest/PaymentRequest.h:
        * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
        (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
        (WebCore::PaymentRequestUpdateEvent::updateWith): Called PaymentRequest::updateWith().
        (WebCore::PaymentRequestUpdateEvent::eventInterface const): Returned
        PaymentRequestUpdateEventInterfaceType.
        * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
        * Modules/paymentrequest/PaymentRequestUpdateEvent.idl:
        * testing/MockPaymentCoordinator.cpp:
        (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
        (WebCore::MockPaymentCoordinator::openPaymentSetup):
        (WebCore::MockPaymentCoordinator::completeMerchantValidation): Stopped calling
        PaymentCoordinator::didAuthorizePayment().
        (WebCore::MockPaymentCoordinator::changeShippingOption): Called
        PaymentCoordinator::didSelectShippingMethod().
        (WebCore::MockPaymentCoordinator::acceptPayment): Called
        PaymentCoordinator::didAuthorizePayment().
        * testing/MockPaymentCoordinator.h:
        * testing/MockPaymentCoordinator.idl:

2017-10-24  Alex Christensen  <achristensen@webkit.org>

        Apply custom header fields from WebsitePolicies to same-domain requests
        https://bugs.webkit.org/show_bug.cgi?id=178356
        <rdar://problem/31073436>

        Reviewed by Brady Eidson.

        Covered by new API tests.

        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestResource):
        * platform/network/ResourceRequestBase.cpp:
        (WebCore::ResourceRequestBase::setCachePolicy):
        (WebCore::ResourceRequestBase::setTimeoutInterval):
        (WebCore::ResourceRequestBase::setHTTPMethod):
        (WebCore::ResourceRequestBase::setHTTPHeaderField):
        (WebCore::ResourceRequestBase::clearHTTPAuthorization):
        (WebCore::ResourceRequestBase::clearHTTPContentType):
        (WebCore::ResourceRequestBase::clearHTTPReferrer):
        (WebCore::ResourceRequestBase::clearHTTPOrigin):
        (WebCore::ResourceRequestBase::clearHTTPUserAgent):
        (WebCore::ResourceRequestBase::clearHTTPAccept):
        (WebCore::ResourceRequestBase::clearHTTPAcceptEncoding):
        (WebCore::ResourceRequestBase::setResponseContentDispositionEncodingFallbackArray):
        (WebCore::ResourceRequestBase::setHTTPBody):
        (WebCore::ResourceRequestBase::setAllowCookies):
        (WebCore::ResourceRequestBase::setPriority):
        (WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
        (WebCore::ResourceRequestBase::addHTTPHeaderField):
        (WebCore::ResourceRequestBase::setHTTPHeaderFields):
        If we only update the platform request when headers are added (or other changes) for HTTP requests,
        then the changes will not affect the NSURLRequest that is sent over IPC or visible to the API.
        This is necessary for these new tests to work, but it's also of growing importance since our
        introduction of WKURLSchemeHandler.

2017-10-24  Brent Fulgham  <bfulgham@apple.com>

        Adopt new secure coding APIs
        https://bugs.webkit.org/show_bug.cgi?id=178484
        <rdar://problem/34837193>

        Reviewed by Tim Horton.

        Switch to new NSKeyed[Un]Archiver methods that active and use
        NSSecureCoding by default.

        Most of the new API is wrapped in a set of convenience methods so we can
        build without the new API on older systems.

        No change in behavior.

        * editing/cocoa/EditorCocoa.mm:
        (WebCore::archivedDataForAttributedString): Use new convenience method
        to archive the string object.
        * loader/archive/cf/LegacyWebArchiveMac.mm:
        (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
        use secure coding where possible.
        (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::write): Use new secure API.
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
        * testing/cocoa/WebArchiveDumpSupport.mm:
        (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
        secure coding API where possible.

2017-10-24  Jeremy Jones  <jeremyj@apple.com>

        HTMLMediaElement should iterate HTMLTrackElements consistently.
        https://bugs.webkit.org/show_bug.cgi?id=178423
        rdar://problem/35044967

        Reviewed by Eric Carlson.

        No new tests because no expected behavior change.

        HTMLMediaElement iterates HTMLTrackElements as children in every place but one, where it iterates them
        as descendants. It should always iterate them as children.

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

2017-10-24  Chris Dumez  <cdumez@apple.com>

        SerializedScriptValue::deserialize() should take ports as a const Vector&
        https://bugs.webkit.org/show_bug.cgi?id=178727

        Reviewed by Alex Christensen.

        SerializedScriptValue::deserialize() should take ports as a const Vector&, not a Vector&.
        It does not modify the input vector.

        * bindings/js/JSMessageEventCustom.cpp:
        (WebCore::JSMessageEvent::data const):
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneDeserializer::deserialize):
        (WebCore::CloneDeserializer::CloneDeserializer):
        (WebCore::SerializedScriptValue::deserialize):
        * bindings/js/SerializedScriptValue.h:

2017-10-24  Konstantin Tokarev  <annulen@yandex.ru>

        [MediaFoundation] Videos are always autoplaying for local files
        https://bugs.webkit.org/show_bug.cgi?id=178693

        Patch by Doug Massay.
        Reviewed by Alex Christensen.

        r199114 fixes autoplay issue only if starting session invokes
        buffering stage. However when local files are played, onBufferingStarted
        and onBufferingStopped are not called, and video is not paused.

        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
        (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
        (WebCore::MediaPlayerPrivateMediaFoundation::onSessionStarted):
        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

2017-10-24  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r223889.

        This caused multiple crashes on all platforms

        Reverted changeset:

        "Adopt new secure coding APIs"
        https://bugs.webkit.org/show_bug.cgi?id=178484
        https://trac.webkit.org/changeset/223889

2017-10-24  Antti Koivisto  <antti@apple.com>

        Create inline wrappers for before/after pseudo elements that have display:contents
        https://bugs.webkit.org/show_bug.cgi?id=178722

        Reviewed by Ryosuke Niwa.

        We can handle before and after pseudo elements with display:contents by giving them
        inline renderers with style inherited from display:contents style. This removes
        need for complicated logic for this case and handles everything correctly.

        This is a better approach and replaces the one taken in bug 178584.
        It also fixes two display:contents WPTs.

        * dom/PseudoElement.h:

            There is no need to track content renderers separately anymore. They always descendants of
            pseudo element's renderer (which is an inline wrapper in case of display:contents).

        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::copyContentFrom):
        * rendering/style/RenderStyle.h:
        * style/RenderTreeUpdaterGeneratedContent.cpp:
        (WebCore::createContentRenderers):
        (WebCore::updateStyleForContentRenderers):
        (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
        (WebCore::removeAndDestroyContentRenderers): Deleted.

            Since content renderers are now always descendants of the pseudo renderer
            there is no need for a separate destruction path.

        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::resolvePseudoStyle):

            Create ElementUpdate with a style that will produce an inline wrapper.

2017-10-24  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] MediaPlayer::isAvailable() takes ~150 ms during web process initialization
        https://bugs.webkit.org/show_bug.cgi?id=178713
        <rdar://problem/35115906>

        Reviewed by Eric Carlson.

        Loading AVFoundation should not be required to answer the question of MediaPlayer::isAvailable() on iOS, where
        both AVFoundation and CoreMedia frameworks should always exist. As such, we can bail early and return true to
        avoid always dynamically loading AVFoundation and CoreMedia.

        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::isAvailable):

2017-10-24  Antoine Quint  <graouts@apple.com>

        RenderThemeCocoa::mediaControlsFormattedStringForDuration may cause a crash due to unhandled Obj-C exception
        https://bugs.webkit.org/show_bug.cgi?id=178716
        <rdar://problem/35112900>

        Reviewed by Dean Jackson.

        * rendering/RenderThemeCocoa.mm:
        (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):

2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>

        SizesAttributeParser::SizesAttributeParser triggers layout
        https://bugs.webkit.org/show_bug.cgi?id=178712

        Reviewed by Antti Koivisto.

        Revert r213711 as this change introduced an unwated synchronous layout inside Node::insertedIntoAncestor.

        The test had been marked as timing out since r191379 and changed to failing expectation in r199225
        as the test result's error message changes from run to run.

        Disabled Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html
                        had been marked failing since r199225, prior to which it was marked as timeout in r191379.
                        imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html
                        is now marked as flaky.

        * css/parser/SizesAttributeParser.cpp:
        (WebCore::SizesAttributeParser::SizesAttributeParser):

2017-10-24  Keith Miller  <keith_miller@apple.com>

        Unreviewed, fix internal iOS build.

        * Sources.txt:

2017-10-24  Brent Fulgham  <bfulgham@apple.com>

        Adopt new secure coding APIs
        https://bugs.webkit.org/show_bug.cgi?id=178484
        <rdar://problem/34837193>

        Reviewed by Tim Horton.

        Switch to new NSKeyed[Un]Archiver methods that active and use
        NSSecureCoding by default.

        Most of the new API is wrapped in a set of convenience methods so we can
        build without the new API on older systems.

        No change in behavior.

        * editing/cocoa/EditorCocoa.mm:
        (WebCore::archivedDataForAttributedString): Use new convenience method
        to archive the string object.
        * loader/archive/cf/LegacyWebArchiveMac.mm:
        (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
        use secure coding where possible.
        (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::write): Use new secure API.
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
        * testing/cocoa/WebArchiveDumpSupport.mm:
        (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
        secure coding API where possible.

2017-10-24  Miguel Gomez  <magomez@igalia.com>

        [GTK][X11] Windy.com shows always straight wind lines
        https://bugs.webkit.org/show_bug.cgi?id=176718

        Reviewed by Carlos Garcia Campos.

        WebGL's GL_LUMINANCE_ALPHA format is not available in OpenGL when using a version >= 3.2
        and a core profile. In that case, we need to replace it with GL_RG and swizzle the color
        components appropriately.

        No new behavior.

        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
        (WebCore::GraphicsContext3D::texImage2D):
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::texSubImage2D):

2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>

        DocumentOrderedMap::add should release assert that tree scopes match
        https://bugs.webkit.org/show_bug.cgi?id=178708

        Reviewed by Antti Koivisto.

        Assert that the tree scope of element matches the given tree scope instead of asserting that
        element is in tree scope, and replaced the use of RELEASE_ASSERT by the newly added
        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION to clarify the semantics of these assertions.

        Also removed now redudnant early exits which would never execute due to release assertions.

        * dom/DocumentOrderedMap.cpp:
        (WebCore::DocumentOrderedMap::add):
        (WebCore::DocumentOrderedMap::remove):
        (WebCore::DocumentOrderedMap::get const):

2017-10-24  Michael Catanzaro  <mcatanzaro@igalia.com>

        -Wsubobject-linkage warning in InspectorIndexedDBAgent.cpp
        https://bugs.webkit.org/show_bug.cgi?id=178698

        Reviewed by Joseph Pecoraro.

        * inspector/InspectorIndexedDBAgent.cpp:

2017-10-24  Antoine Quint  <graouts@apple.com>

        [Web Animations] Add basic timing and target properties
        https://bugs.webkit.org/show_bug.cgi?id=178674

        Reviewed by Dean Jackson.

        We add three new interfaces to expose enough properties to establish basic timing properties,
        a start time and duration, and the target of an animation. The startTime property is set on
        the Animation object, the target is set on the KeyframeEffect set as the effect property on
        the Animation object, and the duration is set on the AnimationEffectTiming set on the effect.

        Tests: webanimations/animation-effect-timing.html
               webanimations/animation-effect.html
               webanimations/animation-interface-effect-property.html
               webanimations/animation-interface-start-time-property.html
               webanimations/keyframe-effect-interface-timing-duration.html
               webanimations/keyframe-effect.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
        (WebCore::AnimationEffect::AnimationEffect):
        (WebCore::AnimationEffect::~AnimationEffect):
        * animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
        (WebCore::AnimationEffect::isKeyframeEffect const):
        (WebCore::AnimationEffect::timing const):
        (WebCore::AnimationEffect::classType const):
        * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
        * animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
        (WebCore::AnimationEffectTiming::create):
        (WebCore::AnimationEffectTiming::AnimationEffectTiming):
        (WebCore::AnimationEffectTiming::~AnimationEffectTiming):
        * animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h.
        * animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
        * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
        (WebCore::KeyframeEffect::create):
        (WebCore::KeyframeEffect::KeyframeEffect):
        * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
        * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::setEffect):
        * animation/WebAnimation.h:
        * animation/WebAnimation.idl:
        * bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp.
        (WebCore::toJSNewlyCreated):
        (WebCore::toJS):
        * bindings/js/WebCoreBuiltinNames.h:

2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>

        RenderSVGModelObject::checkIntersection triggers layout
        https://bugs.webkit.org/show_bug.cgi?id=178710

        Reviewed by Antti Koivisto.

        Don't trigger a layout inside getElementCTM. Update the layout upfront in getEnclosureList.

        * rendering/svg/RenderSVGModelObject.cpp:
        (WebCore::getElementCTM):
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::getEnclosureList):

2017-10-24  Nan Wang  <n_wang@apple.com>

        AX: Crash at -[WebAccessibilityObjectWrapper _accessibilityMinValue] + 24
        https://bugs.webkit.org/show_bug.cgi?id=178697

        Reviewed by Chris Fleizach.

        When we are calling _accessibilityMinValue and _accessibilityMaxValue on iOS, 
        it might cause crash if the AX object has already been detached. Fixed this 
        by adding the necessary checks.

        Test: accessibility/ios-simulator/slider-min-value-crash.html

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

2017-10-23  Keith Miller  <keith_miller@apple.com>

        Unreviewed, restore unneeded all in ones.

        * CMakeLists.txt:

2017-10-23  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r223870 and r223871.
        https://bugs.webkit.org/show_bug.cgi?id=178702

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

        Reverted changesets:

        "Add html, inspector, loader to unified sources"
        https://bugs.webkit.org/show_bug.cgi?id=178695
        https://trac.webkit.org/changeset/223870

        "Unrievwed, fix windows build."
        https://trac.webkit.org/changeset/223871

2017-10-23  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, attempt to fix initializeSupportedImageMIMETypes after r223860
        https://bugs.webkit.org/show_bug.cgi?id=178618
        <rdar://problem/35108852>

        * platform/MIMETypeRegistry.cpp:
        (WebCore::initializeSupportedImageMIMETypes):

2017-10-23  Keith Miller  <keith_miller@apple.com>

        Unrievwed, fix windows build.

        * CMakeLists.txt:

2017-10-23  Keith Miller  <keith_miller@apple.com>

        Add html, inspector, loader to unified sources
        https://bugs.webkit.org/show_bug.cgi?id=178695

        Rubber-stamped by Tim Horton.

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-23  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Remove unused Console.setMonitoringXHREnabled
        https://bugs.webkit.org/show_bug.cgi?id=178617

        Reviewed by Sam Weinig.

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didFinishXHRLoading):
        * inspector/WebConsoleAgent.cpp:
        (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
        (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
        * inspector/WebConsoleAgent.h:
        Remove XHR monitoring code.

        * xml/XMLHttpRequest.h:
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::send):
        (WebCore::XMLHttpRequest::didFinishLoading):
        (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
        * xml/XMLHttpRequest.idl:
        Remove now unused state on XHR and ExecState requirement for send().

2017-10-23  Keith Miller  <keith_miller@apple.com>

        Add dom, editing, fileapi, and history to unified sources
        https://bugs.webkit.org/show_bug.cgi?id=178694

        Rubber-stamped by Tim Horton.

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-23  Keith Miller  <keith_miller@apple.com>

        Move bridge, contentextensions, crypto, and css to unified sources.
        https://bugs.webkit.org/show_bug.cgi?id=178691

        Reviewed by Tim Horton.

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the Windows build after r223860

        UTIUtilities only exists on Cocoa platforms, so we need to guard it accordingly.

        * platform/MIMETypeRegistry.cpp:
        (WebCore::initializeSupportedImageMIMETypes):

2017-10-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] DocumentWriter::createDocument can spend ~100ms unnecessarily converting image UTIs to MIME types
        https://bugs.webkit.org/show_bug.cgi?id=178618
        <rdar://problem/35108852>

        Reviewed by Said Abou-Hallawa.

        Currently, in setting up a new Document, DocumentWriter::createDocument() always asks whether or not the
        Document should be a PDF document by calling MIMETypeRegistry::isPDFMIMEType(), which forces lazy initialization
        of every MIME type dictionary (e.g. image types, PDF types, JavaScript types, etc.). As evidenced by traces,
        this can be an expensive operation on certain devices.

        This patch implements two optimizations. First, we refactor the initializeSupportedImageMIMETypes() helper to
        stop asking for MIMETypeForImageSourceType for each of the supported UTIs. This is because the known MIME types
        corresponding to these hard-coded UTI types is a fixed set anyways, so we can simply iterate over a constant
        array of MIME types and populate the supported image (and image resource) types. Also, add assertions to ensure
        that we keep allowed image MIME types in sync with allowed image UTIs.

        The second optimization removes initializeMIMETypeRegistry() altogether in favor of calling just the
        initialize*MIMETypes() functions needed to ensure the information required. For instance, getPDFMIMETypes()
        currently calls initializeMIMETypeRegistry() if the pdfMIMETypes dictionary doesn't exist, when it really only
        needs to ensure that the pdfMIMETypes is initialized, for which initializePDFMIMETypes() is sufficient.

        * platform/MIMETypeRegistry.cpp:
        (WebCore::initializeSupportedImageMIMETypes):
        (WebCore::initializeSupportedJavaScriptMIMETypes):
        (WebCore::initializePDFMIMETypes):
        (WebCore::initializeSupportedNonImageMimeTypes):
        (WebCore::initializeUnsupportedTextMIMETypes):

        Move MIME type dictionary creation into initialize*MIMETypes() helpers. Additionally, remove
        initializePDFAndPostScriptMIMETypes, which is no longer necessary.

        (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
        (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType):
        (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
        (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
        (WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType):
        (WebCore::MIMETypeRegistry::isPDFOrPostScriptMIMEType):

        Tweak to check that the type isPDFMIMEType(), or that it's otherwise "application/postscript".

        (WebCore::MIMETypeRegistry::isPDFMIMEType):
        (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
        (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
        (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes):
        (WebCore::MIMETypeRegistry::getPDFMIMETypes):
        (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):

        Call only the relevant MIME type initializers when needed.

        (WebCore::initializePostScriptMIMETypes): Deleted.
        (WebCore::initializeMIMETypeRegistry): Deleted.
        (WebCore::MIMETypeRegistry::getPDFAndPostScriptMIMETypes): Deleted.

        Remove an unused and unexported function.

        * platform/MIMETypeRegistry.h:

2017-10-23  Andy Estes  <aestes@apple.com>

        [Payment Request] Take the JSC API lock before creating the PaymentResponse.details object
        https://bugs.webkit.org/show_bug.cgi?id=178686

        Reviewed by Keith Miller.

        This fixes several flaky crashes in http/tests/paymentrequest/ after r223855.

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

2017-10-23  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Please support HAR Export for network traffic
        https://bugs.webkit.org/show_bug.cgi?id=146692
        <rdar://problem/7463672>

        Reviewed by Brian Burg.

        Tests: http/tests/inspector/network/har/har-basic.html
               http/tests/inspector/network/har/har-page.html

        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::willSendRequest):
        Include the wall time when sending a request. This is needed for HAR to
        include a wall time, and can be used for Cookie expiration time calculation
        as well.

2017-10-23  Andy Estes  <aestes@apple.com>

        [Payment Request] Resolve PaymentRequest.show()'s accept promise when a payment is authorized
        https://bugs.webkit.org/show_bug.cgi?id=178609
        <rdar://problem/33542813>

        Reviewed by Alex Christensen.

        This patch implements the logic for resolving PaymentRequest.show()'s accept promise when
        the user authorizes a payment, and implements PaymentResponse.complete().

        Tests: http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html
               http/tests/paymentrequest/payment-response-complete-method.https.html
               http/tests/paymentrequest/payment-response-methodName-attribute.https.html
               http/tests/paymentrequest/payment-response-payerEmail-attribute.https.html
               http/tests/paymentrequest/payment-response-payerName-attribute.https.html
               http/tests/paymentrequest/payment-response-payerPhone-attribute.https.html

        * DerivedSources.make:
        * Modules/applepay/ApplePayPaymentContact.h:
        * Modules/applepay/Payment.h:
        (WebCore::Payment::Payment): Deleted.
        (WebCore::Payment::pkPayment const): Deleted.
        * Modules/applepay/PaymentContact.h:
        (WebCore::PaymentContact::PaymentContact): Deleted.
        (WebCore::PaymentContact::pkContact const): Deleted.
        * Modules/applepay/cocoa/PaymentContactCocoa.mm:
        (WebCore::convert):
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::ApplePayPaymentHandler::hasActiveSession):
        (WebCore::ApplePayPaymentHandler::ApplePayPaymentHandler):
        (WebCore::ApplePayPaymentHandler::document):
        (WebCore::ApplePayPaymentHandler::paymentCoordinator):
        (WebCore::ApplePayPaymentHandler::convertData):
        (WebCore::ApplePayPaymentHandler::show):
        (WebCore::ApplePayPaymentHandler::hide):
        (WebCore::ApplePayPaymentHandler::canMakePayment):
        (WebCore::ApplePayPaymentHandler::complete):
        (WebCore::convert):
        (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
        (WebCore::ApplePayPaymentHandler::didSelectShippingMethod):
        (WebCore::ApplePayPaymentHandler::didSelectShippingContact):
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
        * Modules/paymentrequest/PaymentAddress.h:
        * Modules/paymentrequest/PaymentAddress.idl:
        * Modules/paymentrequest/PaymentHandler.cpp:
        (WebCore::PaymentHandler::create):
        * Modules/paymentrequest/PaymentHandler.h:
        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::PaymentRequest::show):
        (WebCore::PaymentRequest::stop):
        (WebCore::PaymentRequest::canMakePayment):
        (WebCore::PaymentRequest::canSuspendForDocumentSuspension const):
        (WebCore::PaymentRequest::shippingAddressChanged):
        (WebCore::PaymentRequest::shippingOptionChanged):
        (WebCore::PaymentRequest::accept):
        (WebCore::PaymentRequest::complete):
        * Modules/paymentrequest/PaymentRequest.h:
        * Modules/paymentrequest/PaymentResponse.cpp:
        (WebCore::PaymentResponse::PaymentResponse):
        (WebCore::PaymentResponse::complete):
        * Modules/paymentrequest/PaymentResponse.h:
        * WebCore.xcodeproj/project.pbxproj:
        * testing/Internals.cpp:
        (WebCore::Internals::Internals):
        (WebCore::Internals::mockPaymentCoordinator const):
        * testing/Internals.h:
        * testing/Internals.idl:
        * testing/MockPayment.h: Added.
        * testing/MockPaymentAddress.h: Added.
        * testing/MockPaymentAddress.idl: Added.
        * testing/MockPaymentContact.h: Added.
        * testing/MockPaymentCoordinator.cpp:
        (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
        (WebCore::MockPaymentCoordinator::openPaymentSetup):
        (WebCore::dispatchIfShowing):
        (WebCore::MockPaymentCoordinator::showPaymentUI):
        (WebCore::MockPaymentCoordinator::completeMerchantValidation):
        (WebCore::MockPaymentCoordinator::completePaymentSession):
        (WebCore::MockPaymentCoordinator::abortPaymentSession):
        (WebCore::MockPaymentCoordinator::cancelPaymentSession):
        (WebCore::MockPaymentCoordinator::paymentCoordinatorDestroyed):
        * testing/MockPaymentCoordinator.h:
        * testing/MockPaymentCoordinator.idl: Added.

2017-10-23  Dean Jackson  <dino@apple.com>

        Attempt to stop iOS Simulator tests from failing because
        we don't support Accelerated ImageBuffer.

        * html/ImageBitmap.cpp:

2017-10-23  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Make m_subtreeLayoutRoot weak.
        https://bugs.webkit.org/show_bug.cgi?id=178621
        <rdar://problem/35110321>

        Reviewed by Simon Fraser.

        This patch turn m_subtreeLayoutRoot into a weak pointer to handle both the optional and the mutation cases.

        Covered by existing cases.

        * page/FrameView.cpp:
        (WebCore::FrameView::reset):
        (WebCore::FrameView::willDestroyRenderTree):
        (WebCore::FrameView::didDestroyRenderTree):
        (WebCore::FrameView::calculateScrollbarModesForLayout):
        (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
        (WebCore::FrameView::canPerformLayout const):
        (WebCore::FrameView::layout): WeakPtr<RenderElement> protects us from recursive layouts triggering UAF on layoutRoot.
        (WebCore::FrameView::convertSubtreeLayoutToFullLayout):
        (WebCore::FrameView::scheduleRelayout):
        (WebCore::FrameView::scheduleRelayoutOfSubtree):
        (WebCore::FrameView::needsLayout const):
        (WebCore::FrameView::autoSizeIfEnabled):
        * page/FrameView.h:

2017-10-23  Keith Miller  <keith_miller@apple.com>

        Unreviewed, fix windows build.

        * CMakeLists.txt:

2017-10-23  Keith Miller  <keith_miller@apple.com>

        Move shared accessibility and animiations files to unified sources.
        https://bugs.webkit.org/show_bug.cgi?id=178677

        Reviewed by Tim Horton.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-23  Chris Dumez  <cdumez@apple.com>

        Drop confusing Event::dispatched() method
        https://bugs.webkit.org/show_bug.cgi?id=178670

        Reviewed by Youenn Fablet.

        Drop confusing Event::dispatched() method. What the call sites want to do is check
        that the Event's "dispatch" flag is set:
        - https://dom.spec.whatwg.org/#dispatch-flag

        This flag gets set at the beginning of dispatchEvent() and unset at the end of
        dispatchEvent():
        - https://dom.spec.whatwg.org/#ref-for-dispatch-flag③

        See as an example event.initEvent():
        - https://dom.spec.whatwg.org/#dom-event-initevent

        The right way to check the Event's "dispatch" flag is the Event::isBeingDispatched()
        method, so use this instead. One side effect of this change is that it is now
        possible to call the init*Event() method on events that have already been dispatched
        in order to dispatch them again, as per the specification.

        Test: fast/events/initEvent-after-dispatching.html

        * dom/CompositionEvent.cpp:
        (WebCore::CompositionEvent::initCompositionEvent):
        * dom/DeviceMotionEvent.cpp:
        (WebCore::DeviceMotionEvent::initDeviceMotionEvent):
        * dom/DeviceOrientationEvent.cpp:
        (WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
        * dom/Event.h:
        * dom/HashChangeEvent.h:
        * dom/KeyboardEvent.cpp:
        (WebCore::KeyboardEvent::initKeyboardEvent):
        * dom/MessageEvent.cpp:
        (WebCore::MessageEvent::initMessageEvent):
        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::initMouseEvent):
        * dom/OverflowEvent.cpp:
        (WebCore::OverflowEvent::initOverflowEvent):
        * dom/TextEvent.cpp:
        (WebCore::TextEvent::initTextEvent):
        * dom/TouchEvent.cpp:
        (WebCore::TouchEvent::initTouchEvent):
        * dom/UIEvent.cpp:
        (WebCore::UIEvent::initUIEvent):
        * dom/WheelEvent.cpp:
        (WebCore::WheelEvent::initWheelEvent):
        * storage/StorageEvent.cpp:
        (WebCore::StorageEvent::initStorageEvent):

2017-10-23  Antti Koivisto  <antti@apple.com>

        Remember previous child renderer during render tree update
        https://bugs.webkit.org/show_bug.cgi?id=178659

        Reviewed by Zalan Bujtas.

        We shouldn't need to recompute the previous renderer, we know it already.

        * style/RenderTreePosition.cpp:
        (WebCore::RenderTreePosition::previousSiblingRenderer const): Deleted.

            No longer needed. This was also subtly wrong as doesn't take display:contents into account.

        * style/RenderTreePosition.h:
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateRenderTree):
        (WebCore::RenderTreeUpdater::textRendererIsNeeded):

            Use the saved previous renderer.

        (WebCore::RenderTreeUpdater::updateTextRenderer):
        (WebCore::RenderTreeUpdater::storePreviousRenderer):

            Save the previous renderere as we walk the tree.

        (WebCore::textRendererIsNeeded): Deleted.
        * style/RenderTreeUpdater.h:

2017-10-23  Keith Miller  <keith_miller@apple.com>

        Add Shared Modules files to the unified source build.
        https://bugs.webkit.org/show_bug.cgi?id=178675

        Reviewed by Tim Horton.

        This patch all the Modules sources files shared across all ports to
        unified sources.

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-22  Dean Jackson  <dino@apple.com>

        Implement drawImage(ImageBitmap) on 2d canvas
        https://bugs.webkit.org/show_bug.cgi?id=178653
        <rdar://problem/35104360>

        Reviewed by Antoine Quint.

        Implement CanvasRenderingContext2D::drawImage with ImageBitmap.
        It's probably not going to be a very common operation, but
        it importantly allows us to test the ImageBitmap creation
        code.

        Test: http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap.html

        * html/ImageBitmap.cpp:
        (WebCore::taintsOrigin): New helper function to determine if a
        CachedImage would provide a clean origin.
        (WebCore::ImageBitmap::createPromise): Set the flag that records
        if this ImageBitmap has a clean origin.
        * html/ImageBitmap.h:
        (WebCore::ImageBitmap::buffer): Exposes the ImageBuffer backing
        store, allowing access to the data for drawing.
        (WebCore::ImageBitmap::originClean const): Is this ImageBitmap
        going to taint a destination.
        * html/canvas/CanvasRenderingContext.cpp:
        (WebCore::CanvasRenderingContext::wouldTaintOrigin): Implement
        the ImageBitmap version of this template function.
        * html/canvas/CanvasRenderingContext.h:
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::drawImage): Implement the
        actual drawing of an ImageBitmap.

2017-10-23  Daniel Bates  <dabates@apple.com>

        Unreviewed, rolling out r223699.

        Caused regressions with right-to-left text selection and
        painting of markers in flipped writing mode and in overlapping
        lines. Will investigate offline.

        Reverted changeset:

        "Share logic in InlineTextBox to compute selection rect"
        https://bugs.webkit.org/show_bug.cgi?id=178232
        https://trac.webkit.org/changeset/223699

2017-10-23  Youenn Fablet  <youenn@apple.com>

        Create a Fetch event when ServiceWorker has to handle a fetch
        https://bugs.webkit.org/show_bug.cgi?id=178491

        Reviewed by Chris Dumez.

        Covered by existing test.

        Updating FetchEvent to pass a FetchResponse* within its onResponse callback.
        Making it a CompletionHandler.
        Fixing a check on respondWith to ensure that event is dispatched when respondWith is called.

        Adding ServiceWorkerFetch class to handle the creation of the fetch event, waiting for the fetch event to be responded
        and processing when fetch event is responded.
        ServiceWorkerFetchTask takes a client to which will be sent the response body or the error.
        WebKit implementation of it will be to send the related IPC message back to the WebProcess that made the fetch request.

        Adding a method to ServiceWorkerThread to create the fetch event on worker thread and dispatch on the global scope.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/network/ResourceResponseBase.h:
        * testing/Internals.cpp:
        (WebCore::Internals::waitForFetchEventToFinish):
        * workers/service/FetchEvent.cpp:
        (WebCore::FetchEvent::~FetchEvent):
        (WebCore::FetchEvent::respondWith):
        (WebCore::FetchEvent::onResponse):
        (WebCore::FetchEvent::respondWithError):
        (WebCore::FetchEvent::processResponse):
        (WebCore::FetchEvent::promiseIsSettled):
        * workers/service/FetchEvent.h:
        * workers/service/context/ServiceWorkerFetch.cpp: Added.
        (WebCore::ServiceWorkerFetch::dispatchFetchTask):
        (WebCore::ServiceWorkerFetch::processResponse):
        * workers/service/context/ServiceWorkerFetch.h: Added.
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::m_workerObjectProxy):
        (WebCore::ServiceWorkerThread::dispatchFetchEvent):
        * workers/service/context/ServiceWorkerThread.h:

2017-10-23  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Fix authentication related bugs
        https://bugs.webkit.org/show_bug.cgi?id=178652

        Reviewed by Alex Christensen.

        * platform/network/curl/AuthenticationChallengeCurl.cpp:
        (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlHandle::setHttpAuthUserPass):
        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::setUserPass):
        (WebCore::CurlRequest::setupTransfer):
        (WebCore::CurlRequest::didReceiveHeader):
        * platform/network/curl/CurlRequest.h:

2017-10-23  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r223820.

        This caused a build break on Windows.

        Reverted changeset:

        "Web Inspector: Remove unused Console.setMonitoringXHREnabled"
        https://bugs.webkit.org/show_bug.cgi?id=178617
        https://trac.webkit.org/changeset/223820

2017-10-23  Zalan Bujtas  <zalan@apple.com>

        Call FrameView::scheduleSelectionUpdate when selection needs repainting after layout instead of setting the RenderView dirty.
        https://bugs.webkit.org/show_bug.cgi?id=178651
        <rdar://problem/35117448>

        Reviewed by Antti Koivisto.

        Calling setNeedsLayout() on the RenderView to trigger selection update is problematic in 2 different ways:
        1. marking the root renderer dirty does not trigger layout (this is very specific to the root,
        other renderers do trigger layout). It means that it works as long as someone else schedules a layout.
        2. when a subtree layout is already scheduled and we mark the root renderer dirty, the root gets stuck with
        the dirty flag (since the entry point for the subsequent layout is a descendant of the root and not the root itself).

        This patch addresses these issues by scheduling/converting subtree layout when needed.  

        Covered by fast/dynamic/remove-invisible-node-inside-selection.html/remove-node-inside-selection.html

        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::respondToNodeModification):
        * page/FrameView.cpp:
        (WebCore::FrameView::scheduleSelectionUpdate):
        * page/FrameView.h:

2017-10-23  Miguel Gomez  <magomez@igalia.com>

        [TexMap] Remove GraphicsContext3D usage from TextureMapperShaderProgram
        https://bugs.webkit.org/show_bug.cgi?id=175425

        Reviewed by Žan Doberšek.

        Remove usage of the GraphicsContext3D class in TextureMapperShaderProgram.
        Direct OpenGL API calls, types and constants are used instead.

        By removing GraphicsContext3D, we don't use ANGLE anymore to perform the
        shader adaptation to the used OpenGL/GLES2 version, so we need to do that
        inside TextureMapperShaderProgram. The main changes required for this are
        adding the #version directive and use in/out to define input/output parameters
        when using OpenGL >= 3.2, and defining the default precision only when using
        GLES2.

        Besides that, now that VideoTextureCopierGStreamer doesn't have its own
        GraphicsContext3D, we need to add a VAO to it when using OpenGL >= 3.2.

        Based on a previous patch by Žan Doberšek <zdobersek@igalia.com>.

        No behavior change.

        * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
        (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
        (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
        (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
        * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
        * platform/graphics/texmap/TextureMapperGL.cpp:
        (WebCore::TextureMapperGLData::getShaderProgram):
        (WebCore::prepareFilterProgram):
        (WebCore::TextureMapperGL::drawTexture):
        (WebCore::TextureMapperGL::drawFiltered):
        * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
        (WebCore::TextureMapperShaderProgram::create):
        (WebCore::getShaderLog):
        (WebCore::getProgramLog):
        (WebCore::TextureMapperShaderProgram::TextureMapperShaderProgram):
        (WebCore::TextureMapperShaderProgram::~TextureMapperShaderProgram):
        (WebCore::TextureMapperShaderProgram::setMatrix):
        (WebCore::TextureMapperShaderProgram::getLocation):
        * platform/graphics/texmap/TextureMapperShaderProgram.h:
        (WebCore::TextureMapperShaderProgram::programID const):

2017-10-22  Sam Weinig  <sam@webkit.org>

        [Settings] Replace current Settings generation with template file based approach
        https://bugs.webkit.org/show_bug.cgi?id=178634

        Reviewed by Joseph Pecoraro.

        This replaces the recently added python based Settings generation with a generator
        built in ruby, so we can take advantage of ERB for templating. The result has much
        of the logic in the templates and as a result feels much easier to follow and cleaner.

        Since I was moving things to ruby, I took the opertunity to switch the Settings definition
        file from our .in format to yaml, which is quite a bit easier to read.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Scripts/GenerateSettings: Removed.
        * Scripts/GenerateSettings.py: Removed.
        * Scripts/GenerateSettings.rb: Added.
        * Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py: Removed.
        * Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py: Removed.
        * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py: Removed.
        * Scripts/GenerateSettings/GenerateSettings.py: Removed.
        * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Removed.
        * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Removed.
        * Scripts/GenerateSettings/Settings.py: Removed.
        * Scripts/GenerateSettings/__init__.py: Removed.
        * Scripts/SettingsTemplates: Added.
        * Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb: Added.
        * Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb: Added.
        * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: Added.
        * Scripts/SettingsTemplates/Settings.cpp.erb: Added.
        * Scripts/SettingsTemplates/Settings.h.erb: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * WebCoreMacros.cmake:
        * page/Settings.in: Removed.
        * page/Settings.yaml: Added.

2017-10-22  Joseph Pecoraro  <pecoraro@apple.com>

        REGRESSION(r219675): Web Inspector: CommandLineAPI getEventListeners does not work
        https://bugs.webkit.org/show_bug.cgi?id=178650
        <rdar://problem/35116347>

        Reviewed by Sam Weinig.

        Test: inspector/console/command-line-api-getEventListeners.html

        * inspector/CommandLineAPIHost.cpp:
        (WebCore::listenerEntriesFromListenerInfo):
        Fix typo.

        (WebCore::CommandLineAPIHost::getEventListeners):
        Fix incorrect early return.

        * inspector/CommandLineAPIHost.h:
        * inspector/CommandLineAPIHost.idl:
        Add more attributes about the listener. These new attributes match output from Chrome.

2017-10-22  Antoine Quint  <graouts@apple.com>

        [Web Animations] Add animations to the timeline
        https://bugs.webkit.org/show_bug.cgi?id=178643

        Reviewed by Dean Jackson.

        If a timeline is provided as a parameter to the Animation constructor,
        add it to the timeline, and remove it when the object is destroyed.

        We also start the basic mechanism to dump the contents of a timeline
        as text for testing purposes, currently only logging the number of
        animations in a timeline and just logging the class name for animation
        themselves.

        Test: webanimations/animation-creation-addition.html

        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::description):
        * animation/AnimationTimeline.h:
        * animation/AnimationTimeline.idl:
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::create):
        (WebCore::WebAnimation::~WebAnimation):
        (WebCore::WebAnimation::description):
        * animation/WebAnimation.h:
        * testing/Internals.cpp:
        (WebCore::Internals::timelineDescription):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-10-21  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Drop allowSubtree parameter
        https://bugs.webkit.org/show_bug.cgi?id=178623
        <rdar://problem/35111012>

        Reviewed by Sam Weinig.

        This flag is only set through ::forceLayout(). Let's just convert the subtree layout
        to full layout right before calling ::layout().

        No change in functionality.

        * page/FrameView.cpp:
        (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
        (WebCore::FrameView::layout):
        (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
        (WebCore::FrameView::forceLayout):
        * page/FrameView.h:

2017-10-21  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Remove unused Console.setMonitoringXHREnabled
        https://bugs.webkit.org/show_bug.cgi?id=178617

        Reviewed by Sam Weinig.

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didFinishXHRLoading):
        * inspector/WebConsoleAgent.cpp:
        (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
        (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
        * inspector/WebConsoleAgent.h:
        Remove XHR monitoring code.

        * xml/XMLHttpRequest.h:
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::send):
        (WebCore::XMLHttpRequest::didFinishLoading):
        (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
        * xml/XMLHttpRequest.idl:
        Remove now unused state on XHR and ExecState requirement for send().

2017-10-21  Dean Jackson  <dino@apple.com>

        createImageBitmap with basic HTMLImageElement
        https://bugs.webkit.org/show_bug.cgi?id=178619
        <rdar://problem/35104118>

        Reviewed by Antoine Quint.

        Implement the basic infrastructure for creating
        an ImageBitmap from an HTMLImageElement.

        Test: http/wpt/2dcontext/imagebitmap/createImageBitmap.html

        * html/ImageBitmap.cpp:
        (WebCore::ImageBitmap::createPromise): Create the image buffer
        and draw the image into its backing store.
        * html/ImageBitmap.h:

2017-10-21  Antoine Quint  <graouts@apple.com>

        [Web Animations] Add bindings to unified sources
        https://bugs.webkit.org/show_bug.cgi?id=178620

        Reviewed by Dean Jackson.

        Removing the Web Animations bindings from the WebCore target and adding them to the unified sources list instead.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-21  Tim Horton  <timothy_horton@apple.com>

        Fix the Mac CMake build

        * PlatformMac.cmake:

2017-10-21  Antti Koivisto  <antti@apple.com>

        Support ::before/::after pseudo elements with display:contents
        https://bugs.webkit.org/show_bug.cgi?id=178584

        Reviewed by Ryosuke Niwa.

        This is cases like

        ::before { display:contents; content:'foo' }

        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::adjustDisplayContentsStyle): Added.

            Allow display:contents on pseudo elements.
            Factor into function.

        (WebCore::StyleResolver::adjustRenderStyle):
        * dom/PseudoElement.h:

            Add a weak vector of content renderers.

        * style/RenderTreePosition.h:
        (WebCore::RenderTreePosition::moveToLastChild):

            Add a way to set a valid render tree position without a node.

        * style/RenderTreeUpdaterGeneratedContent.cpp:
        (WebCore::createContentRenderers):

            Take RenderTreePosition.

        (WebCore::updateStyleForContentRenderers):

            Update based on the content renderer vector instead of doing a tree walk.

        (WebCore::removeAndDestroyContentRenderers):

            Helper for destroying content renderers.

        (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):

            In the normal case create a render tree position for the pseudo element renderer and
            use RenderTreePosition::moveToLastChild to make it a valid position. (The existing
            RenderTreePosition interface didn't have way to move to positions in anonymous boxes)

            In the case of a non box generating display:contents pseudo element, use the current
            render tree position instead.

            Ensure that pseudo element renderers are destroyed before creating the new ones since in
            display:contents case they are not descendants of the pseudo renderer and don't get cleared
            automatically.

2017-10-20  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Use SetForScope to ensure layout state correctness
        https://bugs.webkit.org/show_bug.cgi?id=178604
        <rdar://problem/35101890>

        Reviewed by Simon Fraser.

        SetForScope guarantees state correctness even with nested layouts. This is a lot less
        error prone than resetting the state value after each potential recursive call.

        Covered by existing tests.

        * page/FrameView.cpp:
        (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange): This layout state does
        not look too useful.
        (WebCore::FrameView::layout):
        * page/FrameView.h: While performPostLayoutTasks() is somewhat special since it can either be sync or async,
        so painting should be allowed in both cases.

2017-10-20  Said Abou-Hallawa  <sabouhallawa@apple.com>

        SVGPathElement should cache the built-up Path of its non animating pathByteStream()
        https://bugs.webkit.org/show_bug.cgi?id=178248

        Reviewed by Simon Fraser.

        Instead of creating a Path object from the non animating pathByteStream()
        every time we need to updatePathFromPathElement(), the Path object can be
        cached once it is created and used for later calls.

        * html/canvas/Path2D.h: buildPathFromString() now returns a Path.

        * platform/graphics/Path.h:
        * platform/graphics/cairo/PathCairo.cpp:
        (WebCore::Path::Path):
        (WebCore::Path::operator=):
        * platform/graphics/cg/PathCG.cpp:
        (WebCore::Path::Path):
        (WebCore::Path::operator=):
        * platform/graphics/win/PathDirect2D.cpp:
        (WebCore::Path::Path):
        (WebCore::Path::operator=):
        Define the move constructor and the move assignment operator for the the
        Path class so a statement like "Path path = buildPathFromString()" won't 
        go through the copy constructor and the copy assignment operator.

        * rendering/style/BasicShapes.cpp:
        (WebCore::SVGPathTranslatedByteStream::path const):
        * rendering/svg/RenderSVGResourceClipper.cpp:
        (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
        * rendering/svg/RenderSVGShape.cpp:
        (WebCore::RenderSVGShape::updateShapeFromElement):
        * rendering/svg/RenderSVGTextPath.cpp:
        (WebCore::RenderSVGTextPath::layoutPath const):
        * rendering/svg/SVGPathData.cpp:
        (WebCore::pathFromCircleElement):
        (WebCore::pathFromEllipseElement):
        (WebCore::pathFromLineElement):
        (WebCore::pathFromPathElement):
        (WebCore::pathFromPolygonElement):
        (WebCore::pathFromPolylineElement):
        (WebCore::pathFromRectElement):
        (WebCore::pathFromGraphicsElement):
        (WebCore::updatePathFromCircleElement): Deleted.
        (WebCore::updatePathFromEllipseElement): Deleted.
        (WebCore::updatePathFromLineElement): Deleted.
        (WebCore::updatePathFromPathElement): Deleted.
        (WebCore::updatePathFromPolygonElement): Deleted.
        (WebCore::updatePathFromPolylineElement): Deleted.
        (WebCore::updatePathFromRectElement): Deleted.
        (WebCore::updatePathFromGraphicsElement): Deleted.
        * rendering/svg/SVGPathData.h:
        * svg/SVGAnimateMotionElement.cpp:
        (WebCore::SVGAnimateMotionElement::parseAttribute):
        (WebCore::SVGAnimateMotionElement::updateAnimationPath):
        * svg/SVGGraphicsElement.cpp:
        (WebCore::SVGGraphicsElement::toClipPath):
        * svg/SVGGraphicsElement.h:
        Rename updatePathFromElement() to pathFromGraphicsElement().

        * svg/SVGPathElement.cpp:
        (WebCore::SVGPathElement::parseAttribute): Clear the cache when
        m_pathByteStream changes.
        (WebCore::SVGPathElement::pathForByteStream const): Caches the m_cachedPath
        if it is null.
        (WebCore::SVGPathElement::pathSegListChanged): Clear the cache when
        m_pathByteStream changes.

        * svg/SVGPathElement.h:
        * svg/SVGPathUtilities.cpp:
        (WebCore::buildPathFromString):
        (WebCore::buildPathFromByteStream):
        * svg/SVGPathUtilities.h:
        Make thes buildPathFromString() and buildPathFromByteStream() return Paths.

        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::toClipPath):
        * svg/SVGUseElement.h:
        Make these toClipPath() return Path.

2017-10-20  Ryosuke Niwa  <rniwa@webkit.org>

        Rename insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor
        https://bugs.webkit.org/show_bug.cgi?id=178605

        Reviewed by Andy Estes.

        Renamed insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor respectively
        to make it clear that these functions can be called even when node's immediate parent didn't change.

        * dom/ContainerNodeAlgorithms.cpp:
        (WebCore::notifyNodeInsertedIntoDocument):
        (WebCore::notifyNodeInsertedIntoTree):
        (WebCore::notifyNodeRemovedFromDocument):
        (WebCore::notifyNodeRemovedFromTree):
        (WebCore::notifyChildNodeRemoved):
        * dom/ContainerNodeAlgorithms.h:
        * dom/Element.cpp:
        (WebCore::Element::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::Element::removedFromAncestor): Renamed from removedFrom.
        * dom/Element.h:
        * dom/Node.cpp:
        (WebCore::Node::insertedIntoAncestor): 
        (WebCore::Node::removedFromAncestor):
        (WebCore::Node::removedFrom): Deleted.
        * dom/Node.h:
        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::ProcessingInstruction::removedFromAncestor): Renamed from removedFrom.
        * dom/ProcessingInstruction.h:
        * dom/ScriptElement.h:
        (WebCore::ScriptElement::insertedIntoAncestor const): Renamed from insertedInto.
        * dom/ShadowRoot.cpp:
        (WebCore::ShadowRoot::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::ShadowRoot::removedFromAncestor): Renamed from removedFrom.
        * dom/ShadowRoot.h:
        * html/FormAssociatedElement.cpp:
        (WebCore::FormAssociatedElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::FormAssociatedElement::removedFromAncestor): Renamed from removedFrom.
        * html/FormAssociatedElement.h:
        * html/HTMLBaseElement.cpp:
        (WebCore::HTMLBaseElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLBaseElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLBaseElement.h:
        * html/HTMLBodyElement.cpp:
        (WebCore::HTMLBodyElement::insertedIntoAncestor): Renamed from insertedInto.
        * html/HTMLBodyElement.h:
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLFormControlElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLFormControlElement.h:
        * html/HTMLFormControlElementWithState.cpp:
        (WebCore::HTMLFormControlElementWithState::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLFormControlElementWithState::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLFormControlElementWithState.h:
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLFormElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLFormElement.h:
        * html/HTMLFrameElementBase.cpp:
        (WebCore::HTMLFrameElementBase::insertedIntoAncestor): Renamed from insertedInto.
        * html/HTMLFrameElementBase.h:
        * html/HTMLFrameSetElement.cpp:
        (WebCore::HTMLFrameSetElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLFrameSetElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLFrameSetElement.h:
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLImageElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLImageElement.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLInputElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLInputElement.h:
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLLinkElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLLinkElement.h:
        * html/HTMLMapElement.cpp:
        (WebCore::HTMLMapElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLMapElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLMapElement.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLMediaElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLMediaElement.h:
        * html/HTMLMetaElement.cpp:
        (WebCore::HTMLMetaElement::insertedIntoAncestor): Renamed from insertedInto.
        * html/HTMLMetaElement.h:
        * html/HTMLObjectElement.cpp:
        (WebCore::HTMLObjectElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLObjectElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLObjectElement.h:
        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::insertedIntoAncestor): Renamed from insertedInto.
        * html/HTMLOptionElement.h:
        * html/HTMLScriptElement.cpp:
        (WebCore::HTMLScriptElement::insertedIntoAncestor): Renamed from insertedInto.
        * html/HTMLScriptElement.h:
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::insertedIntoAncestor): Renamed from insertedInto.
        * html/HTMLSelectElement.h:
        * html/HTMLSlotElement.cpp:
        (WebCore::HTMLSlotElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLSlotElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLSlotElement.h:
        * html/HTMLSourceElement.cpp:
        (WebCore::HTMLSourceElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLSourceElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLSourceElement.h:
        * html/HTMLStyleElement.cpp:
        (WebCore::HTMLStyleElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLStyleElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLStyleElement.h:
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
        * html/HTMLTextFormControlElement.h:
        * html/HTMLTitleElement.cpp:
        (WebCore::HTMLTitleElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLTitleElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLTitleElement.h:
        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::HTMLTrackElement::removedFromAncestor): Renamed from removedFrom.
        * html/HTMLTrackElement.h:
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::removedFromAncestor): Renamed from removedFrom.
        (WebCore::SVGElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::SVGElement::updateRelativeLengthsInformation):
        * svg/SVGElement.h:
        * svg/SVGFEImageElement.cpp:
        (WebCore::SVGFEImageElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::SVGFEImageElement::removedFromAncestor): Renamed from removedFrom.
        * svg/SVGFEImageElement.h:
        * svg/SVGFontFaceElement.cpp:
        (WebCore::SVGFontFaceElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::SVGFontFaceElement::removedFromAncestor): Renamed from removedFrom.
        * svg/SVGFontFaceElement.h:
        * svg/SVGFontFaceUriElement.cpp:
        (WebCore::SVGFontFaceUriElement::insertedIntoAncestor): Renamed from insertedInto.
        * svg/SVGFontFaceUriElement.h:
        * svg/SVGImageElement.cpp:
        (WebCore::SVGImageElement::insertedIntoAncestor): Renamed from insertedInto.
        * svg/SVGImageElement.h:
        * svg/SVGMPathElement.cpp:
        (WebCore::SVGMPathElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::SVGMPathElement::removedFromAncestor): Renamed from removedFrom.
        * svg/SVGMPathElement.h:
        * svg/SVGPathElement.cpp:
        (WebCore::SVGPathElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::SVGPathElement::removedFromAncestor): Renamed from removedFrom.
        * svg/SVGPathElement.h:
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::SVGSVGElement::removedFromAncestor): Renamed from removedFrom.
        * svg/SVGSVGElement.h:
        * svg/SVGScriptElement.cpp:
        (WebCore::SVGScriptElement::insertedIntoAncestor): Renamed from insertedInto.
        * svg/SVGScriptElement.h:
        * svg/SVGStyleElement.cpp:
        (WebCore::SVGStyleElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::SVGStyleElement::removedFromAncestor): Renamed from removedFrom.
        * svg/SVGStyleElement.h:
        * svg/SVGTRefElement.cpp:
        (WebCore::SVGTRefElement::buildPendingResource):
        (WebCore::SVGTRefElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::SVGTRefElement::removedFromAncestor): Renamed from removedFrom.
        * svg/SVGTRefElement.h:
        * svg/SVGTextPathElement.cpp:
        (WebCore::SVGTextPathElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::SVGTextPathElement::removedFromAncestor): Renamed from removedFrom.
        * svg/SVGTextPathElement.h:
        * svg/SVGTitleElement.cpp:
        (WebCore::SVGTitleElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::SVGTitleElement::removedFromAncestor): Renamed from removedFrom.
        * svg/SVGTitleElement.h:
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::SVGUseElement::removedFromAncestor): Renamed from removedFrom.
        * svg/SVGUseElement.h:
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::insertedIntoAncestor): Renamed from insertedInto.
        (WebCore::SVGSMILElement::removedFromAncestor): Renamed from removedFrom.
        * svg/animation/SVGSMILElement.h:

2017-10-20  Ryosuke Niwa  <rniwa@webkit.org>

        Fix conditions in HTMLSourceElement and HTMLTrackElement's insertedInto and removedFrom
        https://bugs.webkit.org/show_bug.cgi?id=178607

        Reviewed by Eric Carlson.

        Fixed the conditions in insertedInto and removedFrom of HTMLSourceElement and HTMLTrackElement to be
        semantically sensisble. Since these elements are only functional when their immediate parents are
        HTMLMediaElement and HTMLPictureElement, we have to check that its immediate parent changed, not when
        some of its ancestor had changed by insertion or removal.

        * html/HTMLSourceElement.cpp:
        (WebCore::HTMLSourceElement::insertedInto):
        (WebCore::HTMLSourceElement::removedFrom):
        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::insertedInto):
        (WebCore::HTMLTrackElement::removedFrom):

2017-10-20  Keith Miller  <keith_miller@apple.com>

        Unreviewed, fix windows build.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-20  Daniel Bates  <dabates@apple.com>

        Use "= default" for more default constructors and destructors in WebCore
        https://bugs.webkit.org/show_bug.cgi?id=178585

        Reviewed by Alex Christensen.

        Also remove some destructors that would be implicitly generated.

        * Modules/applepay/PaymentMerchantSession.h:
        (WebCore::PaymentMerchantSession::~PaymentMerchantSession): Deleted.
        * platform/ControlStates.h:
        (WebCore::ControlStates::~ControlStates): Deleted.
        * platform/PlatformEvent.h:
        (WebCore::PlatformEvent::~PlatformEvent): Use default.
        * platform/PlatformStrategies.h:
        (WebCore::PlatformStrategies::PlatformStrategies): Ditto.
        * platform/image-decoders/gif/GIFImageReader.h:
        (GIFFrameContext::GIFFrameContext):
        (GIFFrameContext::~GIFFrameContext): Deleted.
        (GIFImageReader::~GIFImageReader): Deleted.
        * rendering/RenderBlockFlow.h:
        (WebCore::RenderBlockFlow::RenderBlockFlowRareData::~RenderBlockFlowRareData): Deleted.

2017-10-20  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Scheduling layout should be disabled for FrameView::layout
        https://bugs.webkit.org/show_bug.cgi?id=178562
        <rdar://problem/35089015>

        Reviewed by Simon Fraser.

        This patch extends the scope of m_layoutSchedulingEnabled. Now layout scheduling is disabled for the entire FrameView::layout(). 
        A scheduled layout at the end of FrameView::layout would indicated dirty tree (which is against FrameView::layout's contract).

        Covered by existing tests.

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

2017-10-20  Said Abou-Hallawa  <sabouhallawa@apple.com>

        When destroying a resource, register "only" the clients who are losing their resource as having pending resources
        https://bugs.webkit.org/show_bug.cgi?id=178567
        <rdar://problem/35064781>

        Reviewed by Simon Fraser.

        SVGResources::resourceDestroyed() will return a bool indicating whether 
        it had a reference to the destroyed resource or not. If it returns true
        SVGResourcesCache::resourceDestroyed() will register the client Element
        as having pending resources.

        * rendering/svg/SVGResources.cpp:
        (WebCore::paintingResourceFromSVGPaint):
        (WebCore::SVGResources::removeClientFromCache const):
        (WebCore::SVGResources::resourceDestroyed):
        (WebCore::SVGResources::buildSetOfResources):
        (WebCore::SVGResources::resetClipper):
        (WebCore::SVGResources::resetFilter):
        (WebCore::SVGResources::resetMarkerStart):
        (WebCore::SVGResources::resetMarkerMid):
        (WebCore::SVGResources::resetMarkerEnd):
        (WebCore::SVGResources::resetMasker):
        (WebCore::SVGResources::resetFill):
        (WebCore::SVGResources::resetStroke):
        (WebCore::SVGResources::resetLinkedResource):
        * rendering/svg/SVGResources.h:
        (WebCore::SVGResources::isEmpty const):
        (WebCore::SVGResources::ClipperFilterMaskerData::ClipperFilterMaskerData): Deleted.
        (WebCore::SVGResources::MarkerData::MarkerData): Deleted.
        (WebCore::SVGResources::FillStrokeData::FillStrokeData): Deleted.
        * rendering/svg/SVGResourcesCache.cpp:
        (WebCore::SVGResourcesCache::resourceDestroyed):

2017-10-20  Ryosuke Niwa  <rniwa@webkit.org>

        Unify the node removal code in ContainerNode and expand the coverage of NoEventDispatchAssertion
        https://bugs.webkit.org/show_bug.cgi?id=178568

        Reviewed by Antti Koivisto.

        Consolidated the code to remove a child node in ContainerNode into removeAllChildrenWithScriptAssertion
        and removeNodeWithScriptAssertion to share code and make the semantics of when it becomes unsafe to run scripts.

        Also renamed getChildNodes to collectChildNodes, and made it return NodeVector instead of taking an out argument.

        No new tests since there should be no behavioral changes.

        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Added.
        (WebCore::ContainerNode::removeNodeWithScriptAssertion): Added.
        (WebCore::collectChildrenAndRemoveFromOldParent):
        (WebCore::ContainerNode::takeAllChildrenFrom): Deployed removeAllChildrenWithScriptAssertion.
        (WebCore::ContainerNode::notifyChildRemoved): Deleted. Merged into removeNodeWithScriptAssertion.
        (WebCore::willRemoveChild): Deleted. Ditto.
        (WebCore::willRemoveChildren): Deleted. Merged into removeAllChildrenWithScriptAssertion.
        (WebCore::ContainerNode::removeChild): Deployed removeNodeWithScriptAssertion.
        (WebCore::ContainerNode::parserRemoveChild): Ditto.
        (WebCore::ContainerNode::replaceAllChildren): Deployed removeAllChildrenWithScriptAssertion. Now removes the node
        outside executeNodeInsertionWithScriptAssertion but that's okay since executeNodeInsertionWithScriptAssertion
        doesn't execute any code with a side effect before invoking the callback.
        (WebCore::ContainerNode::removeChildren):
        (WebCore::dispatchChildRemovalEvents): Refactored to take Ref<Node>&.
        * dom/ContainerNode.h:
        (WebCore::collectChildNodes): Renamed from getChildNodes. Also removed the useless comment about NodeVector's
        initial size and instead prefer to webkit.org/b/80706 where the number 11 was picked.
        * editing/ApplyStyleCommand.cpp:
        (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
        * editing/ReplaceNodeWithSpanCommand.cpp:
        (WebCore::swapInNodePreservingAttributesAndChildren):
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::clearShadowTree): Added an assertion exception while tearing down the UA shadow tree.

2017-10-20  Youenn Fablet  <youenn@apple.com>

        ResourceResponse should have a ServiceWorker source
        https://bugs.webkit.org/show_bug.cgi?id=178593

        Reviewed by Alex Christensen.

        Covered by updated tests.

        Added ResourceResponse::Source::ServiceWorker.
        Added internals to get FetchResponse source.

        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::responseSource):
        * loader/ResourceLoader.cpp:
        (WebCore::logResourceResponseSource):
        * page/DiagnosticLoggingKeys.cpp:
        (WebCore::DiagnosticLoggingKeys::serviceWorkerKey):
        * page/DiagnosticLoggingKeys.h:
        * platform/network/ResourceResponseBase.h:
        * testing/Internals.cpp:
        (WebCore::responseSourceToString):
        (WebCore::Internals::fetchResponseSource):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-10-20  Andy Estes  <aestes@apple.com>

        Generated serializers do not properly handle optional interface attributes
        https://bugs.webkit.org/show_bug.cgi?id=178542

        Reviewed by Sam Weinig.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateSerializerDefinition):
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        (WebCore::JSTestSerialization::serialize):

2017-10-20  Antoine Quint  <graouts@apple.com>

        [Web Animations] Provide basic timeline and animation interfaces
        https://bugs.webkit.org/show_bug.cgi?id=178526

        Reviewed by Dean Jackson.

        We're getting Web Animations work started by implementing a very minimal codebase which provides
        a DocumentTimeline class which has an instance created for each Document. The parent class,
        AnimationTimeline, allows for animations to be added and removed, and animations can be created
        using the Animation class, with an optional timeline as parameter.

        Tests: webanimations/animation-creation-basic.html
               webanimations/document-timeline.html

        * CMakeLists.txt:
        * Configurations/FeatureDefines.xcconfig:
        * DerivedSources.make:
        * PlatformWin.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * animation/AnimationTimeline.cpp: Added.
        (WebCore::AnimationTimeline::AnimationTimeline):
        (WebCore::AnimationTimeline::~AnimationTimeline):
        (WebCore::AnimationTimeline::addAnimation):
        (WebCore::AnimationTimeline::removeAnimation):
        * animation/AnimationTimeline.h: Added.
        (WebCore::AnimationTimeline::isDocumentTimeline const):
        (WebCore::AnimationTimeline::classType const):
        * animation/AnimationTimeline.idl: Added.
        * animation/DocumentTimeline.cpp: Added.
        (WebCore::DocumentTimeline::create):
        (WebCore::DocumentTimeline::DocumentTimeline):
        * animation/DocumentTimeline.h: Added.
        * animation/DocumentTimeline.idl: Added.
        * animation/WebAnimation.cpp: Added.
        (WebCore::WebAnimation::create):
        (WebCore::WebAnimation::WebAnimation):
        (WebCore::WebAnimation::~WebAnimation):
        * animation/WebAnimation.h: Added.
        * animation/WebAnimation.idl: Added.
        * bindings/js/JSAnimationTimelineCustom.cpp: Added.
        (WebCore::toJSNewlyCreated):
        (WebCore::toJS):
        * bindings/js/WebCoreBuiltinNames.h:
        * dom/Document.cpp:
        (WebCore::Document::timeline):
        * dom/Document.h:
        * dom/Document.idl:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::webAnimationsEnabled const):

2017-10-20  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r223744, r223750, and r223751.
        https://bugs.webkit.org/show_bug.cgi?id=178594

        These caused consistent failures in test that existed and were
        added in the patches. (Requested by mlewis13 on #webkit).

        Reverted changesets:

        "[JSC] ScriptFetcher should be notified directly from module
        pipeline"
        https://bugs.webkit.org/show_bug.cgi?id=178340
        https://trac.webkit.org/changeset/223744

        "Unreviewed, fix changed line number in test expect files"
        https://bugs.webkit.org/show_bug.cgi?id=178340
        https://trac.webkit.org/changeset/223750

        "Unreviewed, follow up to reflect comments"
        https://bugs.webkit.org/show_bug.cgi?id=178340
        https://trac.webkit.org/changeset/223751

2017-10-20  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Move can-enter-layout logic to a separate function
        https://bugs.webkit.org/show_bug.cgi?id=178546
        <rdar://problem/35083894>

        Reviewed by Antti Koivisto.

        No change in functionality.

        * page/FrameView.cpp:
        (WebCore::FrameView::canPerformLayout const):
        (WebCore::FrameView::layout): We already assert on certain reentrancy conditions, loggig the reason
        does not seem to have high value.
        * page/FrameView.h:

2017-10-20  Dean Jackson  <dino@apple.com>

        Add createImageBitmap to Window and Worker
        https://bugs.webkit.org/show_bug.cgi?id=178573
        <rdar://problem/35092692>

        Reviewed by Sam Weinig.

        Implement the createImageBitmap functions that are exposed on the Window
        and Worker objects.

        Covered by the Web Platform Tests.

        * html/ImageBitmap.cpp: Make sure to call suspendIfNeeded since this is
        an ActiveDOMObject.
        * html/ImageBitmap.h: Change the order of the classes in the Variant
        to match the order of definitions in the IDL.
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::createImageBitmap): Call ImageBitmap::createPromise.
        * page/DOMWindow.h:
        * page/WindowOrWorkerGlobalScope.idl: Add the createImageBitmap methods.
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::createImageBitmap): Call ImageBitmap::createPromise.
        * workers/WorkerGlobalScope.h:

2017-10-20  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [ATK] Events missing and state incorrect for aria-activedescendant
        https://bugs.webkit.org/show_bug.cgi?id=178523

        Reviewed by Chris Fleizach.

        When the aria-activedescendant of an element changes, emit object:state-changed:focused.
        When a focused element has a valid active descendant, do not expose the focused state on
        the element, but rather on the active descendant. Also expose the focusable state on the
        active descendant.

        Tests: accessibility/gtk/aria-activedescendant-changed-notification.html
               accessibility/gtk/aria-activedescendant.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::isActiveDescendantOfFocusedContainer const):
        (WebCore::AccessibilityObject::ariaActiveDescendantReferencingElements const):
        * accessibility/AccessibilityObject.h:
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::shouldNotifyActiveDescendant const):
        * accessibility/atk/AXObjectCacheAtk.cpp:
        (WebCore::AXObjectCache::postPlatformNotification):
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (setAtkStateSetFromCoreObject):

2017-10-20  Ms2ger  <Ms2ger@igalia.com>

        Add the MAX_CLIENT_WAIT_TIMEOUT_WEBGL constant to WebGL2RenderingContext.
        https://bugs.webkit.org/show_bug.cgi?id=178572

        Reviewed by Žan Doberšek.

        Test: fast/canvas/webgl/webgl2/constants.html

        * html/canvas/WebGL2RenderingContext.idl:

2017-10-20  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE] Fix review comments on WEBPImageDecoder
        https://bugs.webkit.org/show_bug.cgi?id=178080

        Reviewed by Said Abou-Hallawa.

        Properly free the demuxer in case of error, improve the code to detect the first
        required frame to decode, fix the usage of the DecodingStatus and some styling
        changes.

        Covered by existent tests.

        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::webpFrameAtIndex):
        (WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
        (WebCore::WEBPImageDecoder::decode):
        (WebCore::WEBPImageDecoder::decodeFrame):
        (WebCore::WEBPImageDecoder::initFrameBuffer):
        (WebCore::WEBPImageDecoder::clearFrameBufferCache):

2017-10-20  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Clean up old style code in old curl files.
        https://bugs.webkit.org/show_bug.cgi?id=178569

        Reviewed by Ryosuke Niwa.

        * platform/network/curl/AuthenticationChallenge.h:
        * platform/network/curl/CertificateInfo.h:
        * platform/network/curl/CookieJarCurl.h:
        * platform/network/curl/CurlCacheEntry.h:
        * platform/network/curl/CurlCacheManager.cpp:
        (WebCore::CurlCacheManager::singleton):
        (WebCore::CurlCacheManager::getInstance): Deleted.
        * platform/network/curl/CurlCacheManager.h:
        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlContext::singleton):
        * platform/network/curl/CurlContext.h:
        (WebCore::CurlContext::singleton): Deleted.
        * platform/network/curl/CurlJobManager.cpp:
        (WebCore::CurlJobManager::singleton):
        * platform/network/curl/CurlJobManager.h:
        (WebCore::CurlJobManager::singleton): Deleted.
        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::setupTransfer):
        * platform/network/curl/CurlRequest.h:
        * platform/network/curl/CurlRequestDelegate.h:
        * platform/network/curl/CurlResponse.h:
        (WebCore::CurlResponse::isolatedCopy const):
        * platform/network/curl/CurlSSLHandle.h:
        * platform/network/curl/CurlSSLVerifier.h:
        * platform/network/curl/DownloadBundle.h:
        * platform/network/curl/MultipartHandle.h:
        * platform/network/curl/ResourceError.h:
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
        (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
        (WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
        (WebCore::ResourceHandleCurlDelegate::curlDidComplete):
        (WebCore::ResourceHandleCurlDelegate::curlDidFailWithError):
        * platform/network/curl/ResourceRequest.h:
        (WebCore::ResourceRequest::ResourceRequest):
        (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
        (WebCore::ResourceRequest::cfURLRequest const):
        (WebCore::ResourceRequest::httpPipeliningEnabled):
        (WebCore::ResourceRequest::setHTTPPipeliningEnabled):
        (WebCore::ResourceRequest::doUpdatePlatformRequest):
        (WebCore::ResourceRequest::doUpdateResourceRequest):
        (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
        (WebCore::ResourceRequest::doUpdateResourceHTTPBody):
        (WebCore::ResourceRequest::doPlatformSetAsIsolatedCopy):
        * platform/network/curl/ResourceResponseCurl.cpp:
        (WebCore::ResourceResponse::isAppendableHeader):
        (WebCore::ResourceResponse::ResourceResponse):

2017-10-20  Frederic Wang  <fwang@igalia.com>

        RenderLayerCompositor: Move implementation of simple methods into the header file.
        https://bugs.webkit.org/show_bug.cgi?id=178514

        Reviewed by Darin Adler.

        No new tests, behavior unchanged.

2017-10-19  Antti Koivisto  <antti@apple.com>

        Support ::before/::after pseudo elements on elements with display:contents
        https://bugs.webkit.org/show_bug.cgi?id=178513

        Reviewed by Ryosuke Niwa.

        Add support for

            div { display:contents }
            div::after { content:'foo' }

        That is support non-box generating elements with generated content.

        * style/RenderTreePosition.cpp:
        (WebCore::RenderTreePosition::nextSiblingRenderer const):

            Implement full pseudo-inclusive traversal starting from any element (including pseudo)
            to locate the next rendering sibling. In case of display:content this may need to look
            into descendants.

        * style/RenderTreeUpdater.cpp:
        (WebCore::textRendererIsNeeded):

            RenderTreePosition::nextSiblingRenderer can no longer be called with a node that already has a renderer.
            Maintain the existing behavior.

        * style/RenderTreeUpdaterGeneratedContent.cpp:
        (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
        (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):

            Don't require for host to have a renderer.

        * style/RenderTreeUpdaterGeneratedContent.h:
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::resolvePseudoStyle):

2017-10-20  Keith Miller  <keith_miller@apple.com>

        Move common bindings files to unified sources
        https://bugs.webkit.org/show_bug.cgi?id=178561

        Rubber-stamped by Ryosuke Niwa.

        This patch moves most of the common bindings files to unified sources.

        Additionally, it adds a change to make_names to unique a struct
        name that caused name conflicts that I missed when I made the
        source changes before.

        Lastly, add missing reference to WebCoreJSBuiltins.cpp in CMake build.

        No new behavior no tests.

        * CMakeLists.txt:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/make_names.pl:
        (printFactoryCppFile):

2017-10-20  Saam Barati  <sbarati@apple.com>

        Optimize accesses to how we get the direct prototype
        https://bugs.webkit.org/show_bug.cgi?id=178548

        Reviewed by Yusuke Suzuki.

        No new tests: no functionality change.

        * bindings/js/JSDOMAbstractOperations.h:
        (WebCore::isVisibleNamedProperty):
        (WebCore::accessVisibleNamedProperty):
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::toJSDOMWindow):
        * bindings/js/JSDOMWindowProperties.cpp:
        (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
        * bindings/js/JSPluginElementFunctions.cpp:
        (WebCore::pluginElementCustomGetOwnPropertySlot):
        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::initScript):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GeneratePut):
        (GeneratePutByIndex):
        (GenerateConstructorHelperMethods):
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        (WebCore::JSTestGlobalObjectConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
        (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::put):
        (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::putByIndex):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
        (WebCore::JSTestNamedAndIndexedSetterThrowingException::put):
        (WebCore::JSTestNamedAndIndexedSetterThrowingException::putByIndex):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
        (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::put):
        (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::putByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
        (WebCore::JSTestNamedSetterNoIdentifier::put):
        (WebCore::JSTestNamedSetterNoIdentifier::putByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
        (WebCore::JSTestNamedSetterThrowingException::put):
        (WebCore::JSTestNamedSetterThrowingException::putByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
        (WebCore::JSTestNamedSetterWithIdentifier::put):
        (WebCore::JSTestNamedSetterWithIdentifier::putByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
        (WebCore::JSTestNamedSetterWithIndexedGetter::put):
        (WebCore::JSTestNamedSetterWithIndexedGetter::putByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
        (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::put):
        (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::putByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
        (WebCore::JSTestNamedSetterWithUnforgableProperties::put):
        (WebCore::JSTestNamedSetterWithUnforgableProperties::putByIndex):

2017-10-20  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] ScriptFetcher should be notified directly from module pipeline
        https://bugs.webkit.org/show_bug.cgi?id=178340

        Reviewed by Sam Weinig.

        No behavior change.

        * bindings/js/JSMainThreadExecState.h:
        (WebCore::JSMainThreadExecState::loadModule):
        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::loadModuleScriptInWorld):
        (WebCore::jsValueToModuleKey): Deleted.
        (WebCore::ScriptController::setupModuleScriptHandlers): Deleted.
        * bindings/js/ScriptController.h:
        * dom/LoadableModuleScript.cpp:
        (WebCore::LoadableModuleScript::notifyLoadFailed):
        * dom/LoadableModuleScript.h:

2017-10-19  Ms2ger  <Ms2ger@igalia.com>

        Remove proprietary constants from WebGL2RenderingContext.
        https://bugs.webkit.org/show_bug.cgi?id=178511

        Reviewed by Ryosuke Niwa.

        As far as I can tell, these constants are not in the specification,
        and no other browser supports them.

        No new tests: just code removal.

        * html/canvas/WebGL2RenderingContext.idl:

2017-10-19  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Move style update related logic to a separate function
        https://bugs.webkit.org/show_bug.cgi?id=178558
        <rdar://problem/35088218>

        Reviewed by Simon Fraser.

        No change in functionality.

        * page/FrameView.cpp:
        (WebCore::FrameView::ensureStyleIsUpToDateForLayout):
        (WebCore::FrameView::layout):
        * page/FrameView.h:

2017-10-19  JF Bastien  <jfbastien@apple.com>

        WebAssembly: no VM / JS version of everything but Instance
        https://bugs.webkit.org/show_bug.cgi?id=177473

        Reviewed by Filip Pizlo, Saam Barati.

        * ForwardingHeaders/wasm/WasmModule.h: Added. This used to be
        included in JSWebAssemblyModule.h.
        * bindings/js/SerializedScriptValue.cpp: Update postMessage code
        according to C++ API changes.

2017-10-19  Chris Dumez  <cdumez@apple.com>

        SerializedScriptValue passed to postMessage() cannot be null
        https://bugs.webkit.org/show_bug.cgi?id=178550

        Reviewed by Youenn Fablet.

        SerializedScriptValue passed to postMessage() cannot be null. Therefore, we
        should use Ref<> type, not RefPtr<>.

        * dom/MessagePortChannel.h:
        * dom/default/PlatformMessagePortChannel.cpp:
        (WebCore::MessagePortChannel::postMessageToRemote):
        * workers/WorkerGlobalScopeProxy.h:
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
        (WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
        * workers/WorkerMessagingProxy.h:
        * workers/WorkerObjectProxy.h:
        * workers/service/context/ServiceWorkerThread.cpp:

2017-10-19  Daniel Bates  <dabates@apple.com>

        Use "= default" to denote default constructor or destructor
        https://bugs.webkit.org/show_bug.cgi?id=178528

        Rubber-stamped by Andy Estes.

        * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
        * Modules/applepay/ApplePayError.cpp:
        * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
        * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
        * Modules/applepay/ApplePaySession.cpp:
        * Modules/applepay/ApplePaySessionPaymentRequest.cpp:
        * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
        * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
        * Modules/applepay/ApplePayValidateMerchantEvent.cpp:
        * Modules/applepay/Payment.h:
        * Modules/applepay/PaymentCoordinatorClient.h:
        * Modules/credentials/BasicCredential.cpp:
        * Modules/credentials/FederatedCredential.cpp:
        * Modules/credentials/NavigatorCredentials.cpp:
        * Modules/credentials/PasswordCredential.cpp:
        * Modules/encryptedmedia/CDMClient.h:
        * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
        * Modules/encryptedmedia/legacy/LegacyCDM.h:
        * Modules/encryptedmedia/legacy/LegacyCDMPrivate.h:
        * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
        * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h:
        * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
        * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
        * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
        * Modules/entriesapi/DOMFileSystem.cpp:
        * Modules/entriesapi/FileSystemDirectoryReader.cpp:
        * Modules/entriesapi/FileSystemEntry.cpp:
        * Modules/fetch/FetchLoaderClient.h:
        * Modules/gamepad/Gamepad.cpp:
        * Modules/gamepad/GamepadEvent.h:
        * Modules/gamepad/deprecated/Gamepad.cpp:
        [ truncated ]

2017-10-19  Sam Weinig  <sam@webkit.org>

        [Bindings] Standardize on DOMPromise as the way to store passed in promises
        https://bugs.webkit.org/show_bug.cgi?id=178533

        Reviewed by Youenn Fablet.

        This standardizes on RefPtr<DOMPromise> as the canonical way to store a promise
        that has been passed in from JS. This does not change promises that start off in
        WebCore and are passed to JS; they remain using DOMPromiseDeferred and DOMPromiseProxy.

        * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
        * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
        * dom/PromiseRejectionEvent.cpp:
        * dom/PromiseRejectionEvent.h:
        * dom/RejectedPromiseTracker.cpp:

            Use a RefPtr<DOMPromise> rather than a JSPromise* to hold onto the promise.

        * bindings/IDLTypes.h:

            Use IDLWrapper to get better defaults, since DOMPromise is refcounted.

        * bindings/js/JSDOMConvertPromise.h:
        (WebCore::Converter<IDLPromise<T>>::convert):

            Switch default conversion to return a RefPtr<DOMPromise> rather than a JSPromise*

        (WebCore::JSConverter<IDLPromise<T>>::convert):

            Add support for converting from a DOMPromise to a JSValue.

        * bindings/js/JSDOMPromise.cpp:
        * bindings/js/JSDOMPromise.h:
        (WebCore::DOMPromise::create): Deleted.

            Remove now unused constructor.    

        * workers/service/ExtendableEvent.cpp:
        (WebCore::ExtendableEvent::waitUntil):
        * workers/service/ExtendableEvent.h:
        * workers/service/ExtendableEvent.idl:
        * workers/service/FetchEvent.cpp:
        (WebCore::FetchEvent::respondWith):
        (WebCore::FetchEvent::promiseIsSettled):
        * workers/service/FetchEvent.h:
        * workers/service/FetchEvent.idl:

            Address FIXMEs and remove need for passing an ExecState to ExtendableEvent
            and FetchEvent by using the new default conversion to DOMPromise.

2017-10-19  Sam Weinig  <sam@webkit.org>

        [Settings] Move global settings into their own file
        https://bugs.webkit.org/show_bug.cgi?id=178512

        Reviewed by Darin Adler.

        Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings.
        It's called DeprecatedGlobalSettings to indicate that this is an anti-pattern we would
        like to discourage, as WebCore can operate in a process with multiple clients, each of
        which should be able to set their own preferences.

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

            Add new files.
        
        * page/DeprecatedGlobalSettings.cpp: Copied from Source/WebCore/page/SettingsBase.cpp.
        * page/DeprecatedGlobalSettings.h: Copied from Source/WebCore/page/SettingsBase.h.
        * page/SettingsBase.cpp:
        * page/SettingsBase.h:
        
            Move all global settings out of SettingsBase and into the new DeprecatedGlobalSettings.
        
        * Modules/mediastream/UserMediaRequest.cpp:
        * bindings/js/CommonVM.cpp:
        * css/CSSStyleDeclaration.cpp:
        * dom/DataTransfer.cpp:
        * dom/DataTransferItemList.cpp:
        * editing/Editor.cpp:
        * loader/ResourceLoadObserver.cpp:
        * page/FrameView.cpp:
        * page/PerformanceMonitor.cpp:
        * platform/ScrollbarTheme.cpp:
        (WebCore::ScrollbarTheme::theme):
        * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
        * platform/graphics/MediaPlayer.cpp:
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        * platform/mac/NSScrollerImpDetails.mm:
        * platform/mock/ScrollbarThemeMock.cpp:
        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
        * platform/network/ios/NetworkStateNotifierIOS.mm:
        * platform/network/soup/SocketStreamHandleImplSoup.cpp:
        * platform/win/MainThreadSharedTimerWin.cpp:
        * rendering/RenderLayer.cpp:
        * rendering/RenderListBox.cpp:
        * testing/InternalSettings.cpp:
        * testing/Internals.cpp:

            Update users of global settings to reference the new class name.

2017-10-19  Youenn Fablet  <youenn@apple.com>

        Add preliminary support for ServiceWorker Handle Fetch
        https://bugs.webkit.org/show_bug.cgi?id=178475
        <rdar://problem/35066424>

        Reviewed by Chris Dumez.

        Test: http/tests/workers/service/basic-fetch.https.html

        Adding parameters to allow WebKit to do loading through Service Worker or through regular networking.
        A script context is now storing its selected service worker identifier. This should be fully implemented later on.
        This selected service worker identifier is passed to loading code as a ResourceLoaderOptions field.
        Service workers mode is also added as a ResourceLoaderOptions field so that the service worker can be bypassed.

        * WebCore.xcodeproj/project.pbxproj:
        * dom/ScriptExecutionContext.h:
        (WebCore::ScriptExecutionContext::selectedServiceWorkerIdentifier const):
        (WebCore::ScriptExecutionContext::setSelectedServiceWorkerIdentifier):
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
        * loader/FetchOptions.h:
        (WebCore::isPotentialNavigationOrSubresourceRequest):
        (WebCore::isNonSubresourceRequest):
        * loader/ResourceLoaderOptions.h:
        * loader/WorkerThreadableLoader.cpp:
        (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
        (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
        * loader/WorkerThreadableLoader.h:
        * platform/network/ResourceRequestBase.h:
        * platform/network/ResourceResponseBase.h:
        * workers/WorkerThread.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        * workers/service/context/SWContextManager.cpp: Removed.
        * workers/service/context/ServiceWorkerThread.h:

2017-10-19  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Move post layout task scheduling logic to a separate function
        https://bugs.webkit.org/show_bug.cgi?id=178538
        <rdar://problem/35080743>

        Reviewed by Simon Fraser.

        Move and reorganize post layout task scheduling code.
        
        Covered by existing tests.

        * page/FrameView.cpp:
        (WebCore::FrameView::layout):
        (WebCore::FrameView::runOrSchedulePostLayoutTasks):
        * page/FrameView.h:

2017-10-19  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Move scrollbars setup logic to a separate function
        https://bugs.webkit.org/show_bug.cgi?id=178394
        <rdar://problem/35031066>

        Reviewed by Antti Koivisto.

        Decouple scrollbars setup and the unrelated first-layout logic.
        FIXME: find out why m_firstLayout depends on the subtree flag (I'd assume we issue full layout the very first time). 

        Covered by existing test cases.

        * page/FrameView.cpp:
        (WebCore::FrameView::adjustScrollbarsForLayout):
        (WebCore::FrameView::layout):
        * page/FrameView.h:

2017-10-19  Tim Horton  <timothy_horton@apple.com>

        Expand r209943 to suppress paste during provisional navigation as well
        https://bugs.webkit.org/show_bug.cgi?id=178429
        <rdar://problem/33952830>

        Reviewed by Dean Jackson.

        No new tests; adjusted an existing test to cover this case.

        * editing/Editor.cpp:
        (WebCore::Editor::canPaste const):
        Disable pasting during provisional navigation, like r209943 did for
        various other forms of text input.

        (WebCore::Editor::shouldInsertText const):
        * dom/EventDispatcher.cpp:
        (WebCore::shouldSuppressEventDispatchInDOM):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::shouldSuppressTextInputFromEditing const):
        (WebCore::FrameLoader::shouldSuppressKeyboardInput const): Deleted.
        * loader/FrameLoader.h:
        * page/Settings.in:
        Rename the setting to be about editing-related text input, not "keyboard" input.

        * editing/EditorCommand.cpp:
        (WebCore::allowExecutionWhenDisabled):
        (WebCore::doNotAllowExecutionWhenDisabled):
        (WebCore::allowExecutionWhenDisabledCopyCut):
        (WebCore::allowExecutionWhenDisabledPaste):
        (WebCore::createCommandMap):
        (WebCore::Editor::Command::allowExecutionWhenDisabled const):
        Completely disable execution of paste events when in no-text-input-from-editing mode.
        Otherwise, even though canPaste was false and we wouldn't do a default paste action,
        we would still dispatch the paste event to the DOM.

2017-10-19  Dean Jackson  <dino@apple.com>

        Avoid duplicate multisample resolve before WebGL compositing
        https://bugs.webkit.org/show_bug.cgi?id=178537
        <rdar://problem/35080724>

        Fix iOS build.

        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):

2017-10-19  Dean Jackson  <dino@apple.com>

        Avoid duplicate multisample resolve before WebGL compositing
        https://bugs.webkit.org/show_bug.cgi?id=178537
        <rdar://problem/35080724>

        Reviewed by Jer Noble.

        Both endPaint and prepareTexture were doing the MSAA resolve
        into the renderbuffer, and being called on macOS before compositing.
        Without that step, endPaint became unnecessary on iOS so I renamed
        it presentRenderbuffer.

        Covered by existing tests.

        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
        (WebCore::GraphicsContext3D::presentRenderbuffer):
        (WebCore::GraphicsContext3D::endPaint): Deleted.
        * platform/graphics/cocoa/WebGLLayer.mm:
        (-[WebGLLayer display]):

2017-10-19  Andy Estes  <aestes@apple.com>

        [Payment Request] Only process shipping options if shipping is requested, and throw an exception on duplicate shipping option IDs
        https://bugs.webkit.org/show_bug.cgi?id=178535

        Reviewed by Alex Christensen.

        Progresses four tests in web-platform-tests/payment-request/payment-request-constructor.https.html.

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

2017-10-19  Daniel Bates  <dabates@apple.com>

        Share logic in InlineTextBox to compute selection rect
        https://bugs.webkit.org/show_bug.cgi?id=178232
        <rdar://problem/34963452>

        Reviewed by Zalan Bujtas.

        Currently each paint routine in InlineTextBox duplicates similar code to compute the selection
        rect it will paint. This change consolidates all the duplication into localSelectionRectWithClampedPositions()
        and writes all of the paint operations, except for paintCompositionUnderline(), in terms of it.
        We will write paintCompositionUnderline() in terms of localSelectionRectWithClampedPositions()
        in a subsequent patch.

        We also write localSelectionRect() in terms of localSelectionRectWithClampedPositions(). Ideally
        we would have one way to compute the selection rect. However, localSelectionRect() and paintDocumentMarker()
        currently expect the enclosing integral rectangle of the selection rectangle. The function
        paintDocumentMarker() needs the enclosing integral rectangle to avoid truncating the dot pattern
        drawn under marked words (e.g. a spelling error) on Cocoa platforms. With regards to localSelectionRect()
        we should look to have it return the actual selection rectangle. See <https://bugs.webkit.org/show_bug.cgi?id=138913>
        for more details.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::localSelectionRect const): Move logic in common with paintSelection() into
        localSelectionRectWithClampedPositions() and modified code to use it.
        (WebCore::InlineTextBox::localSelectionRectWithClampedPositions const): Added.
        (WebCore::InlineTextBox::paint): Store the local paint offset as a LayoutPoint as it is the canonical
        data type for representing an offset when painting. Pass the local paint offset instead of the analagous boxOrigin value.
        (WebCore::InlineTextBox::paintSelection): Write in terms of localSelectionRectWithClampedPositions().
        (WebCore::InlineTextBox::paintTextSubrangeBackground): Ditto.
        (WebCore::InlineTextBox::paintCompositionBackground): Ditto.
        (WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
        (WebCore::InlineTextBox::paintDocumentMarker): Ditto.
        (WebCore::InlineTextBox::paintDocumentMarkers): Pass paint offset instead of the analogous boxOrigin value.
        * rendering/InlineTextBox.h:

2017-10-19  Daniel Bates  <dabates@apple.com>

        Referrer policy should be inherited from creator
        https://bugs.webkit.org/show_bug.cgi?id=178403
        <rdar://problem/31546136>

        Reviewed by Andy Estes.

        As per section Browsing contexts of the the HTML standard, <https://html.spec.whatwg.org/multipage/browsers.html>
        (17 October 2017), the referrer policy of a document should initially be inherited from its
        creator.

        Tests: http/tests/security/referrer-policy-nested-subframe.html
               http/tests/security/referrer-policy-nested-window-open.html
               http/tests/security/referrer-policy-subframe-window-open.html
               http/tests/security/referrer-policy-window-open-subframe.html

        * dom/Document.cpp:
        (WebCore::Document::initSecurityContext): Ask the loader for the effective referrer policy.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::effectiveReferrerPolicy const): Added. Returns the referrer policy
        of the creator document. The creator document is document of the parent frame or the document
        of the opener for a subframe or child window, respectively. If we do not have a creator frame
        then we return the default referrer policy, non-referrer-when-downgrade, by <https://www.w3.org/TR/2017/CR-referrer-policy-20170126/#referrer-policy-empty-string>.
        * loader/FrameLoader.h:

2017-10-19  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Do not reenter FrameView::performPostLayoutTasks
        https://bugs.webkit.org/show_bug.cgi?id=178518
        <rdar://problem/35075409>

        Reviewed by Antti Koivisto.

        This patch tightens existing reentrancy policy on performPostLayoutTasks.

        Covered by existing test cases.

        * page/FrameView.cpp:
        (WebCore::FrameView::FrameView):
        (WebCore::FrameView::reset):
        (WebCore::FrameView::layout):
        (WebCore::FrameView::performPostLayoutTasks):
        * page/FrameView.h:

2017-10-19  Chris Dumez  <cdumez@apple.com>

        Unreviewed, revert r223650 as it caused crashes on the bots.

        * WebCore.xcodeproj/project.pbxproj:
        * dom/ScriptExecutionContext.h:
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
        * loader/FetchOptions.h:
        * loader/ResourceLoaderOptions.h:
        * loader/WorkerThreadableLoader.cpp:
        (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
        (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
        * loader/WorkerThreadableLoader.h:
        * platform/network/ResourceRequestBase.h:
        * platform/network/ResourceResponseBase.h:
        * workers/WorkerThread.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        * workers/service/context/SWContextManager.cpp: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
        (WebCore::SWContextManager::singleton):
        (WebCore::SWContextManager::SWContextManager):
        (WebCore::SWContextManager::startServiceWorkerContext):
        * workers/service/context/SWContextManager.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
        * workers/service/context/ServiceWorkerThread.h:

2017-10-19  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Replace m_nestedLayoutCount with isLayoutNested()
        https://bugs.webkit.org/show_bug.cgi?id=178503
        <rdar://problem/35066561>

        Reviewed by Antti Koivisto.

        Covered by existing tests.

        * page/FrameView.cpp:
        (WebCore::FrameView::reset):
        (WebCore::FrameView::layout):
        (WebCore::FrameView::updateLayerPositionsAfterScrolling):
        (WebCore::FrameView::updateCompositingLayersAfterScrolling):
        (WebCore::FrameView::updateEmbeddedObjects):
        (WebCore::FrameView::flushPostLayoutTasksQueue):
        (WebCore::FrameView::performPostLayoutTasks):
        (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
        * page/FrameView.h:

2017-10-19  Antti Koivisto  <antti@apple.com>

        Overlapping text on all CSS fonts specs
        https://bugs.webkit.org/show_bug.cgi?id=177585
        <rdar://problem/34704078>

        Reviewed by Daniel Bates.

        We were resetting StyleResolver::overrideDocumentElementStyle too early when resolving slot elements.
        This resulted in 'rem' units being miscomputed.

        Reduction by Zalan.

        Test: fast/html/details-line-height-overlap.html

        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::Scope::Scope):
        (WebCore::Style::TreeResolver::Scope::~Scope):

            Only reset overrideDocumentElementStyle when destroying the scope.

        (WebCore::Style::TreeResolver::pushScope):
        (WebCore::Style::TreeResolver::pushEnclosingScope):
        (WebCore::Style::TreeResolver::popScope):

            A scope can show up multiple times in scope stack.

        * style/StyleTreeResolver.h:

2017-10-19  Ryosuke Niwa  <rniwa@webkit.org>

        Consolidate calls to insertedInto and expand the coverage of NoEventDispatchAssertion
        https://bugs.webkit.org/show_bug.cgi?id=178504

        Reviewed by Antti Koivisto.

        Consolidated calls to notifyChildNodeInserted, childrenChanged, didFinishInsertingNode, and
        dispatchChildInsertionEvents for inserting a node by executeNodeInsertionWithScriptAssertion,
        a new templatefunction which takes a closure to do the node insertion to make exactly when
        the script becomes runnable clear.

        Added an exception to SVGTRefElement::updateReferencedText since this code mutates user agent
        shadow root during insertedInto, and turned ChildChangeSource into an enum class.

        * dom/CharacterData.cpp:
        (WebCore::CharacterData::parserAppendData):
        (WebCore::CharacterData::setDataAndUpdate):
        * dom/ContainerNode.cpp:
        (WebCore::executeNodeInsertionWithScriptAssertion): Extracted.
        (WebCore::ContainerNode::takeAllChildrenFrom): Deployed executeNodeInsertionWithScriptAssertion.
        (WebCore::ContainerNode::insertBefore): Ditto.
        (WebCore::ContainerNode::changeForChildInsertion): Deleted.
        (WebCore::ContainerNode::notifyChildInserted): Deleted.
        (WebCore::ContainerNode::parserInsertBefore): Deployed executeNodeInsertionWithScriptAssertion. 
        (WebCore::ContainerNode::replaceChild): Ditto.
        (WebCore::ContainerNode::removeChild):
        (WebCore::ContainerNode::parserRemoveChild):
        (WebCore::ContainerNode::replaceAllChildren): Ditto.
        (WebCore::ContainerNode::removeChildren):
        (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Ditto.
        (WebCore::ContainerNode::parserAppendChild): Ditto.
        (WebCore::ContainerNode::childrenChanged):
        (WebCore::ContainerNode::updateTreeAfterInsertion): Deleted.
        * dom/ContainerNode.h:
        * dom/Element.cpp:
        (WebCore::Element::childrenChanged):
        * html/HTMLOutputElement.cpp:
        (WebCore::HTMLOutputElement::childrenChanged):
        * svg/SVGClipPathElement.cpp:
        (WebCore::SVGClipPathElement::childrenChanged):
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::childrenChanged):
        * svg/SVGFELightElement.cpp:
        (WebCore::SVGFELightElement::childrenChanged):
        * svg/SVGFilterElement.cpp:
        (WebCore::SVGFilterElement::childrenChanged):
        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
        (WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
        * svg/SVGGradientElement.cpp:
        (WebCore::SVGGradientElement::childrenChanged):
        * svg/SVGMarkerElement.cpp:
        (WebCore::SVGMarkerElement::childrenChanged):
        * svg/SVGMaskElement.cpp:
        (WebCore::SVGMaskElement::childrenChanged):
        * svg/SVGPatternElement.cpp:
        (WebCore::SVGPatternElement::childrenChanged):
        * svg/SVGTRefElement.cpp:
        (WebCore::SVGTRefElement::updateReferencedText): Allow DOM mutations inside the user agent shadow tree here.

2017-10-19  Ryosuke Niwa  <rniwa@webkit.org>

        Add an argument indicating the type of removal to Node::removedFrom
        https://bugs.webkit.org/show_bug.cgi?id=178505

        Reviewed by Antti Koivisto.

        Like r223628, added RemovalType as the first argument to Node::removedFrom, which contains two booleans indicating
        whether the node just become disconnected from a document, and whether node's tree scope had changed or not.

        These boolean flags simplifies the logic in removedFrom implementations, and are required to have a better
        guarantee about the correctness of node flags during calls to removedFrom. Right now, Node::isConnected() and
        Node::isInShadowTree() are both outdated until Node::removedFrom is called.

        Also renamed the second argument of removedFrom to parentOfRemovedTree to make the semantics clear.

        Note that in some implementations of removedFrom, we check whether isConnected() was true to decide whether
        the node had already been disconnected from a document prior to calls to this particular call of removedFrom.
        This extra check is no longer necessary since no node will be removed from a document without first being inserted
        completely somewhere after r223458.

        No new tests since there should be no behavioral changes.

        * dom/ContainerNodeAlgorithms.cpp:
        (WebCore::notifyNodeInsertedIntoDocument): Replaced RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
        (WebCore::notifyNodeRemovedFromDocument): Replaced the check that the node had not been re-connected by scripts
        by a release assert now that we believe we've eliminated all causes of these unwanted DOM mutations in r223458.
        Also moved the code to call setCSSTarget to Element::removedFrom. This random call to setCSSTarget predates r114351,
        as well as r40475. It was originally introduced by r29311 into Node::removedFromDocument() ten years ago.
        (WebCore::notifyNodeRemovedFromTree): Moved NoEventDispatchAssertion to notifyChildNodeRemoved.
        (WebCore::notifyChildNodeRemoved): Added NoEventDispatchAssertion.
        * dom/ContainerNodeAlgorithms.h:
        * dom/Element.cpp:
        (WebCore::Element::removedFrom): Replaced the complicated code to detect when this element is removed from a document
        and its tree scope had changed by removalType.disconnectedFromDocument and removalType.treeScopeChanged.
        * dom/Element.h:
        * dom/Node.cpp:
        (WebCore::Node::removedFrom):
        * dom/Node.h: Replaced a long block of comments above insertedInto by two lines of concise comments now that
        the semantics of insertedInto and didFinishInsertingNode are more clear, and enforced by assertions.
        (WebCore::Node::RemovalType::RemovalType): Addedl
        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::removedFrom):
        * dom/ProcessingInstruction.h:
        * dom/ShadowRoot.cpp:
        (WebCore::ShadowRoot::removedFrom): The extra !isConnected() check is no longer needed. See the description above.
        * dom/ShadowRoot.h:
        * html/FormAssociatedElement.cpp:
        (WebCore::FormAssociatedElement::removedFrom):
        * html/FormAssociatedElement.h:
        * html/HTMLBaseElement.cpp:
        (WebCore::HTMLBaseElement::removedFrom):
        * html/HTMLBaseElement.h:
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::removedFrom):
        * html/HTMLFormControlElement.h:
        * html/HTMLFormControlElementWithState.cpp:
        (WebCore::HTMLFormControlElementWithState::removedFrom):
        * html/HTMLFormControlElementWithState.h:
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::removedFrom):
        * html/HTMLFormElement.h:
        * html/HTMLFrameSetElement.cpp:
        (WebCore::HTMLFrameSetElement::removedFrom):
        * html/HTMLFrameSetElement.h:
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::removedFrom):
        * html/HTMLImageElement.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::removedFrom):
        * html/HTMLInputElement.h:
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
        * html/HTMLLinkElement.h:
        * html/HTMLMapElement.cpp:
        (WebCore::HTMLMapElement::removedFrom):
        * html/HTMLMapElement.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::removedFrom):
        * html/HTMLMediaElement.h:
        * html/HTMLObjectElement.cpp:
        (WebCore::HTMLObjectElement::removedFrom):
        * html/HTMLObjectElement.h:
        * html/HTMLSlotElement.cpp:
        (WebCore::HTMLSlotElement::removedFrom): Simplifies the logic to detect when this slot element is being
        removed from a shadow tree using removalType.treeScopeChanged.
        * html/HTMLSlotElement.h:
        * html/HTMLSourceElement.cpp:
        (WebCore::HTMLSourceElement::insertedInto): Added a FIXME for an obvious bug.
        (WebCore::HTMLSourceElement::removedFrom): Ditto.
        * html/HTMLSourceElement.h:
        * html/HTMLStyleElement.cpp:
        (WebCore::HTMLStyleElement::removedFrom):
        * html/HTMLStyleElement.h:
        * html/HTMLTitleElement.cpp:
        (WebCore::HTMLTitleElement::removedFrom):
        * html/HTMLTitleElement.h:
        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::removedFrom): Ditto.
        * html/HTMLTrackElement.h:
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::removedFrom): Replaced isConnected() check before calling Node::removedFrom by the check of
        removalType.disconnectedFromDocument.
        * svg/SVGElement.h:
        * svg/SVGFEImageElement.cpp:
        (WebCore::SVGFEImageElement::removedFrom):
        * svg/SVGFEImageElement.h:
        * svg/SVGFontFaceElement.cpp:
        (WebCore::SVGFontFaceElement::removedFrom):
        * svg/SVGFontFaceElement.h:
        * svg/SVGMPathElement.cpp:
        (WebCore::SVGMPathElement::removedFrom):
        * svg/SVGMPathElement.h:
        * svg/SVGPathElement.cpp:
        (WebCore::SVGPathElement::removedFrom):
        * svg/SVGPathElement.h:
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::removedFrom):
        * svg/SVGSVGElement.h:
        * svg/SVGStyleElement.cpp:
        (WebCore::SVGStyleElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
        * svg/SVGStyleElement.h:
        * svg/SVGTRefElement.cpp:
        (WebCore::SVGTRefElement::removedFrom):
        * svg/SVGTRefElement.h:
        * svg/SVGTextPathElement.cpp:
        (WebCore::SVGTextPathElement::removedFrom):
        * svg/SVGTextPathElement.h:
        * svg/SVGTitleElement.cpp:
        (WebCore::SVGTitleElement::removedFrom):
        * svg/SVGTitleElement.h:
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::removedFrom):
        * svg/SVGUseElement.h:
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::removedFrom):
        * svg/animation/SVGSMILElement.h:

2017-10-19  Ms2ger  <Ms2ger@igalia.com>

        Update the signatures of compressedTexSubImage3D.
        https://bugs.webkit.org/show_bug.cgi?id=178507

        Reviewed by Ryosuke Niwa.

        No new tests: not much point in adding tests now; this method doesn't
        do anything anyway.

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:

2017-10-19  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [curl] Segfault in WebCore::CurlRequest::setupPOST
        https://bugs.webkit.org/show_bug.cgi?id=178434

        Reviewed by Ryosuke Niwa.

        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::resolveBlobReferences):
        (WebCore::CurlRequest::setupPOST):

2017-10-18  Ryosuke Niwa  <rniwa@webkit.org>

        Don't expose raw HTML in pasteboard to the web content
        https://bugs.webkit.org/show_bug.cgi?id=178422
        <rdar://problem/34567052>

        Reviewed by Wenson Hsieh.

        This patch enables HTML sanitization added in r223440 when WebKit pastes & concludes edit drag as opposed to
        just when dataTransfer.get is used. This is important to avoid leaking privacy sensitive information such as
        local file paths and pasting potentially harmful content such as scripts in event handler serialized by
        WebKit prior to r223462. In addition, we start using blob URLs in the pasted content instead of retaining
        the original URL and overriding the document loader like r222839 for RTFD and r222119 for image files.

        To do this, a new superclass FrameWebContentReader of PasteboardWebContentReader and WebContentMarkupReader
        is introduced, and helper functions are extracted out of WebContentMarkupReader in WebContentReaderCocoa.mm
        to be also used in WebContentReader.

        Tests: http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html
               http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-in-same-origin.html
               http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html
               PasteWebArchive.SanitizesHTML

        * editing/WebContentReader.cpp:
        (WebCore::FrameWebContentReader::shouldSanitize const): Moved from WebContentMarkupReader.
        * editing/WebContentReader.h:
        (WebCore::FrameWebContentReader): Added to share code between WebContentReader and WebContentMarkupReader.
        (WebCore::FrameWebContentReader::FrameWebContentReader): Added.
        * editing/cocoa/EditorCocoa.mm:
        (WebCore::Editor::writeSelectionToPasteboard): Store the content's origin in the pasteboard so that we can
        avoid sanitizing the content when pasting into the same document. This is important since converting all URLs
        into blob URLs would break editors on the Web which tracks images, etc... in the content using URLs.
        (WebCore::Editor::writeSelection): Ditto.
        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::MarkupAndArchive): Replaced FragmentAndArchive. Now returns the markup string in the archive
        instead of the parsed fragment.
        (WebCore::extractMarkupAndArchive): Renamed from createFragmentFromWebArchive. Now returns the markup string.
        (WebCore::sanitizeMarkupWithArchive): Extracted out of WebContentMarkupReader::readWebArchive to share code
        between WebContentReader and WebContentMarkupReader, and added the code to handle subframes recursively.
        As inefficient as this code is, we can't delay the conversion of subframes' marksup until later time since
        the main frame's markup would contain blob URLs to refer to those subframes. 
        (WebCore::WebContentReader::readWebArchive): Use sanitizeMarkupWithArchive when shouldSanitize() is true.
        Don't add the subresources to the document loader when the content will be loaded into the same origin since
        subresouces are mostly likely available in the document anyway.
        (WebCore::WebContentMarkupReader::readWebArchive):
        * platform/Pasteboard.h:
        (WebCore::PasteboardWebContent): Added contentOrigin.
        * platform/PasteboardWriterData.h:
        (WebCore::PasteboardWriterData): Ditto.
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::read): Read the origin before branching out to readRespectingUTIFidelities.
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::write): Record the content origin into the pasteboard.
        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::write): Ditto.
        * platform/mac/PasteboardWriter.mm:
        (WebCore::createPasteboardWriter): Ditto.

2017-10-18  Sam Weinig  <sam@webkit.org>

        Another attempt to fix the windows build.

        * page/SettingsBase.cpp:
        (WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
        * page/SettingsBase.h:

2017-10-18  Sam Weinig  <sam@webkit.org>

        Attempt to fix the windows build.

        * page/SettingsBase.cpp:
        (WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
        * page/SettingsBase.h:

2017-10-18  Sam Weinig  <sam@webkit.org>

        [Settings] Convert more settings to be generated
        https://bugs.webkit.org/show_bug.cgi?id=177766

        Reviewed by Dean Jackson.

        - Replaces setNeedsStyleRecalcInAllFrames option in Settings.in
          with a more generic, onChange, which allows you to specify a function
          in SettingsBase that will be called when the setting changes. 
          setNeedsStyleRecalcInAllFrames is then reimplemented in terms of
          onChange.
        - Moves most (all but two) of the remaining non-static settings from
          SettingsBase to Settings.in

        * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
        (printSetterBody):
        * Scripts/GenerateSettings/Settings.py:
        (Setting.__init__):
        (Setting.__str__):
        (Setting.typeIsValueType):
        (Setting.setterFunctionName):
        (Setting.setterChangeFunctionName):
        (Setting.hasComplexSetter):
        (parseInput):
        
            Add support for the onChange option.
        
        * page/Settings.in:

            Migrate most of the remaining non-static settings to Settings.in.
            Adopt onChange option.

        * page/SettingsBase.cpp:
        * page/SettingsBase.h:

            Add helper functions for use by the onChange option.

2017-10-18  Chris Dumez  <cdumez@apple.com>

        Implement ServiceWorkerRegistration.scope / updateViaCache
        https://bugs.webkit.org/show_bug.cgi?id=178497

        Reviewed by Youenn Fablet.

        Implement ServiceWorkerRegistration.scope / updateViaCache.

        No new tests, updated existing test.

        * WebCore.xcodeproj/project.pbxproj:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::resolvedWithRegistration):
        * workers/service/ServiceWorkerJob.h:
        * workers/service/ServiceWorkerJobClient.h:
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
        (WebCore::ServiceWorkerRegistration::scope const):
        (WebCore::ServiceWorkerRegistration::updateViaCache const):
        (WebCore::ServiceWorkerRegistration::update):
        (WebCore::ServiceWorkerRegistration::unregister):
        (WebCore::ServiceWorkerRegistration::scriptExecutionContext const):
        (WebCore::ServiceWorkerRegistration::activeDOMObjectName const):
        (WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const):
        * workers/service/ServiceWorkerRegistration.h:
        * workers/service/ServiceWorkerRegistration.idl:
        * workers/service/ServiceWorkerRegistrationData.cpp:
        (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
        * workers/service/ServiceWorkerRegistrationData.h:
        (WebCore::ServiceWorkerRegistrationData::encode const):
        (WebCore::ServiceWorkerRegistrationData::decode):
        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::jobResolvedInServer):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::scriptContextStarted):
        (WebCore::SWServerRegistration::data const):

2017-10-18  Youenn Fablet  <youenn@apple.com>

        Add preliminary support for ServiceWorker Handle Fetch
        https://bugs.webkit.org/show_bug.cgi?id=178475

        Reviewed by Chris Dumez.

        Test: http/tests/workers/service/basic-fetch.https.html

        Adding parameters to allow WebKit to do loading through Service Worker or through regular networking.
        A script context is now storing its selected service worker identifier. This should be fully implemented later on.
        This selected service worker identifier is passed to loading code as a ResourceLoaderOptions field.
        Service workers mode is also added as a ResourceLoaderOptions field so that the service worker can be bypassed.

        * WebCore.xcodeproj/project.pbxproj:
        * dom/ScriptExecutionContext.h:
        (WebCore::ScriptExecutionContext::selectedServiceWorkerIdentifier const):
        (WebCore::ScriptExecutionContext::setSelectedServiceWorkerIdentifier):
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
        * loader/FetchOptions.h:
        (WebCore::isPotentialNavigationOrSubresourceRequest):
        (WebCore::isNonSubresourceRequest):
        * loader/ResourceLoaderOptions.h:
        * loader/WorkerThreadableLoader.cpp:
        (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
        (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
        * loader/WorkerThreadableLoader.h:
        * platform/network/ResourceRequestBase.h:
        * platform/network/ResourceResponseBase.h:
        * workers/WorkerThread.h:
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        * workers/service/ServiceWorkerProvider.h:
        * workers/service/context/SWContextManager.cpp: Removed.
        * workers/service/context/ServiceWorkerThread.h:
        * workers/service/server/SWServer.h:

2017-10-18  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Group related pre-layout code to improve readability
        https://bugs.webkit.org/show_bug.cgi?id=178496
        <rdar://problem/35065718>

        Reviewed by Simon Fraser.

        Early returns/asserts/member variable resets etc.

        Covered by existing tests.

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

2017-10-17  Jiewen Tan  <jiewen_tan@apple.com>

        Replace some stack raw pointers with RefPtrs within WebCore/html
        https://bugs.webkit.org/show_bug.cgi?id=178201
        <rdar://problem/34841692>

        Reviewed by Ryosuke Niwa.

        This is an effort to reduce raw pointer usage in DOM code. In this patch, raw pointers
        that are ref countable are blindly selected to be replaced with RefPtrs with one exception
        which is auto*.

        Also, this patch occasionally modifies the return type of some methods, and therefore callers
        of those methods are modified accordingly.

        * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
        (WebCore::LegacyCDM::mediaPlayer const):
        * Modules/encryptedmedia/legacy/LegacyCDM.h:
        * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
        (WebCore::CDMPrivateMediaPlayer::createSession):
        * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
        (WebCore::WebKitMediaKeys::cdmMediaPlayer const):
        * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
        * Modules/mediacontrols/MediaControlsHost.cpp:
        (WebCore::MediaControlsHost::externalDeviceDisplayName const):
        (WebCore::MediaControlsHost::externalDeviceType const):
        * dom/Element.cpp:
        (WebCore::Element::focusDelegate):
        (WebCore::Element::userAgentShadowRoot const):
        (WebCore::Element::ensureUserAgentShadowRoot):
        * dom/Element.h:
        * dom/EventContext.cpp:
        (WebCore::TouchEventContext::checkReachability const):
        * dom/EventPath.cpp:
        (WebCore::shouldEventCrossShadowBoundary):
        (WebCore::EventPath::setRelatedTarget):
        (WebCore::EventPath::retargetTouch):
        (WebCore:: const):
        * dom/EventTarget.cpp:
        (WebCore::EventTarget::toNode):
        (WebCore::EventTarget::addEventListener):
        * dom/EventTarget.h:
        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::toElement const):
        (WebCore::MouseEvent::fromElement const):
        * dom/MouseEvent.h:
        * dom/MouseRelatedEvent.cpp:
        (WebCore::MouseRelatedEvent::computeRelativePosition):
        * dom/Node.cpp:
        (WebCore::Node::toNode):
        * dom/Node.h:
        * dom/ScopedEventQueue.cpp:
        * editing/Editor.cpp:
        (WebCore::Editor::selectionForCommand):
        * editing/EditorCommand.cpp:
        (WebCore::targetFrame):
        * editing/TextIterator.cpp:
        (WebCore::TextIterator::handleReplacedElement):
        * html/BaseChooserOnlyDateAndTimeInputType.cpp:
        (WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
        * html/ColorInputType.cpp:
        (WebCore::ColorInputType::updateColorSwatch):
        (WebCore::ColorInputType::shadowColorSwatch const):
        * html/FileInputType.cpp:
        (WebCore::FileInputType::disabledAttributeChanged):
        (WebCore::FileInputType::multipleAttributeChanged):
        * html/FormAssociatedElement.cpp:
        (WebCore::FormAssociatedElement::findAssociatedForm):
        (WebCore::FormAssociatedElement::formOwnerRemovedFromTree):
        (WebCore::FormAssociatedElement::resetFormOwner):
        (WebCore::FormAssociatedElement::formAttributeChanged):
        * html/FormController.cpp:
        (WebCore::recordFormStructure):
        (WebCore::FormKeyGenerator::formKey):
        (WebCore::FormController::restoreControlStateIn):
        * html/HTMLAnchorElement.cpp:
        (WebCore::appendServerMapMousePosition):
        (WebCore::HTMLAnchorElement::handleClick):
        * html/HTMLAppletElement.cpp:
        (WebCore::HTMLAppletElement::updateWidget):
        * html/HTMLAreaElement.cpp:
        (WebCore::HTMLAreaElement::imageElement const):
        (WebCore::HTMLAreaElement::isFocusable const):
        (WebCore::HTMLAreaElement::setFocus):
        (WebCore::HTMLAreaElement::updateFocusAppearance):
        * html/HTMLBodyElement.cpp:
        (WebCore::HTMLBodyElement::scrollLeft):
        (WebCore::HTMLBodyElement::setScrollLeft):
        (WebCore::HTMLBodyElement::scrollTop):
        (WebCore::HTMLBodyElement::setScrollTop):
        (WebCore::HTMLBodyElement::scrollHeight):
        (WebCore::HTMLBodyElement::scrollWidth):
        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::createElementRenderer):
        (WebCore:: const):
        * html/HTMLDocument.cpp:
        (WebCore::HTMLDocument::width):
        (WebCore::HTMLDocument::height):
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::rendererIsNeeded):
        (WebCore::setHasDirAutoFlagRecursively):
        (WebCore::HTMLElement::directionality const):
        (WebCore::HTMLElement::dirAttributeChanged):
        (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
        * html/HTMLEmbedElement.cpp:
        (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
        (WebCore::HTMLEmbedElement::rendererIsNeeded):
        * html/HTMLFieldSetElement.cpp:
        (WebCore::updateFromControlElementsAncestorDisabledStateUnder):
        (WebCore::HTMLFieldSetElement::disabledStateChanged):
        (WebCore::HTMLFieldSetElement::childrenChanged):
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const):
        (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
        (WebCore::HTMLFormControlElement::didChangeForm):
        (WebCore::HTMLFormControlElement::shouldAutocorrect const):
        (WebCore::HTMLFormControlElement::autocapitalizeType const):
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::handleLocalEvents):
        (WebCore::submitElementFromEvent):
        (WebCore::HTMLFormElement::prepareForSubmission):
        (WebCore::HTMLFormElement::submit):
        (WebCore::HTMLFormElement::reset):
        (WebCore::HTMLFormElement::shouldAutocorrect const):
        (WebCore::HTMLFormElement::parseAttribute):
        (WebCore::HTMLFormElement::resetDefaultButton):
        (WebCore::HTMLFormElement::elementFromPastNamesMap const):
        (WebCore::HTMLFormElement::namedElements):
        * html/HTMLFormElement.h:
        * html/HTMLFrameElement.cpp:
        (WebCore::HTMLFrameElement::didAttachRenderers):
        * html/HTMLFrameElementBase.cpp:
        (WebCore::HTMLFrameElementBase::isURLAllowed const):
        (WebCore::HTMLFrameElementBase::openURL):
        (WebCore::HTMLFrameElementBase::didAttachRenderers):
        * html/HTMLFrameOwnerElement.cpp:
        (WebCore::HTMLFrameOwnerElement::setContentFrame):
        (WebCore::HTMLFrameOwnerElement::clearContentFrame):
        (WebCore::HTMLFrameOwnerElement::disconnectContentFrame):
        (WebCore::SubframeLoadingDisabler::canLoadFrame):
        * html/HTMLFrameSetElement.cpp:
        (WebCore::HTMLFrameSetElement::findContaining):
        (WebCore::HTMLFrameSetElement::willAttachRenderers):
        (WebCore::HTMLFrameSetElement::insertedInto):
        (WebCore::HTMLFrameSetElement::removedFrom):
        * html/HTMLFrameSetElement.h:
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
        (WebCore::HTMLImageElement::pictureElement const):
        (WebCore::HTMLImageElement::destroyImageControls):
        (WebCore::HTMLImageElement::hasImageControls const):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::innerTextElement const):
        (WebCore::HTMLInputElement::endEditing):
        (WebCore::HTMLInputElement::dataList const):
        (WebCore::HTMLInputElement::resetListAttributeTargetObserver): Deleted.
        (WebCore::HTMLInputElement::listAttributeTargetChanged): Deleted.
        (WebCore::HTMLInputElement::isSteppable const): Deleted.
        (WebCore::HTMLInputElement::dateType const): Deleted.
        (WebCore::HTMLInputElement::isTextButton const): Deleted.
        (WebCore::HTMLInputElement::isRadioButton const): Deleted.
        (WebCore::HTMLInputElement::isSearchField const): Deleted.
        (WebCore::HTMLInputElement::isInputTypeHidden const): Deleted.
        (WebCore::HTMLInputElement::isPasswordField const): Deleted.
        (WebCore::HTMLInputElement::isCheckbox const): Deleted.
        (WebCore::HTMLInputElement::isRangeControl const): Deleted.
        (WebCore::HTMLInputElement::isColorControl const): Deleted.
        (WebCore::HTMLInputElement::isText const): Deleted.
        (WebCore::HTMLInputElement::isEmailField const): Deleted.
        (WebCore::HTMLInputElement::isFileUpload const): Deleted.
        (WebCore::HTMLInputElement::isImageButton const): Deleted.
        (WebCore::HTMLInputElement::isNumberField const): Deleted.
        (WebCore::HTMLInputElement::isSubmitButton const): Deleted.
        (WebCore::HTMLInputElement::isTelephoneField const): Deleted.
        (WebCore::HTMLInputElement::isURLField const): Deleted.
        (WebCore::HTMLInputElement::isDateField const): Deleted.
        (WebCore::HTMLInputElement::isDateTimeField const): Deleted.
        (WebCore::HTMLInputElement::isDateTimeLocalField const): Deleted.
        (WebCore::HTMLInputElement::isMonthField const): Deleted.
        (WebCore::HTMLInputElement::isTimeField const): Deleted.
        (WebCore::HTMLInputElement::isWeekField const): Deleted.
        (WebCore::HTMLInputElement::isEnumeratable const): Deleted.
        (WebCore::HTMLInputElement::supportLabels const): Deleted.
        (WebCore::HTMLInputElement::shouldAppearChecked const): Deleted.
        (WebCore::HTMLInputElement::supportsPlaceholder const): Deleted.
        (WebCore::HTMLInputElement::updatePlaceholderText): Deleted.
        (WebCore::HTMLInputElement::isEmptyValue const): Deleted.
        (WebCore::HTMLInputElement::maxLengthAttributeChanged): Deleted.
        (WebCore::HTMLInputElement::minLengthAttributeChanged): Deleted.
        (WebCore::HTMLInputElement::updateValueIfNeeded): Deleted.
        (WebCore::HTMLInputElement::defaultToolTip const): Deleted.
        (WebCore::HTMLInputElement::matchesIndeterminatePseudoClass const): Deleted.
        (WebCore::HTMLInputElement::shouldAppearIndeterminate const): Deleted.
        (WebCore::HTMLInputElement::mediaCaptureType const): Deleted.
        (WebCore::HTMLInputElement::isInRequiredRadioButtonGroup): Deleted.
        (WebCore:: const): Deleted.
        (WebCore::HTMLInputElement::checkedRadioButtonForGroup const): Deleted.
        (WebCore::HTMLInputElement::radioButtonGroups const): Deleted.
        (WebCore::HTMLInputElement::addToRadioButtonGroup): Deleted.
        (WebCore::HTMLInputElement::removeFromRadioButtonGroup): Deleted.
        (WebCore::HTMLInputElement::height const): Deleted.
        (WebCore::HTMLInputElement::width const): Deleted.
        (WebCore::HTMLInputElement::setHeight): Deleted.
        (WebCore::HTMLInputElement::setWidth): Deleted.
        (WebCore::ListAttributeTargetObserver::ListAttributeTargetObserver): Deleted.
        (WebCore::ListAttributeTargetObserver::idTargetChanged): Deleted.
        (WebCore::HTMLInputElement::setRangeText): Deleted.
        (WebCore::HTMLInputElement::shouldTruncateText const): Deleted.
        (WebCore::HTMLInputElement::selectionStartForBindings const): Deleted.
        (WebCore::HTMLInputElement::setSelectionStartForBindings): Deleted.
        (WebCore::HTMLInputElement::selectionEndForBindings const): Deleted.
        (WebCore::HTMLInputElement::setSelectionEndForBindings): Deleted.
        (WebCore::HTMLInputElement::selectionDirectionForBindings const): Deleted.
        (WebCore::HTMLInputElement::setSelectionDirectionForBindings): Deleted.
        (WebCore::HTMLInputElement::setSelectionRangeForBindings): Deleted.
        (WebCore::HTMLInputElement::createInnerTextStyle const): Deleted.
        (WebCore::HTMLInputElement::setupDateTimeChooserParameters): Deleted.
        (WebCore::HTMLInputElement::capsLockStateMayHaveChanged): Deleted.
        * html/HTMLInputElement.h:
        * html/HTMLKeygenElement.cpp:
        (WebCore::HTMLKeygenElement::shadowSelect const):
        * html/HTMLLabelElement.cpp:
        (WebCore::HTMLLabelElement::defaultEventHandler):
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::handleClick):
        * html/HTMLMapElement.cpp:
        (WebCore::HTMLMapElement::mapMouseEvent):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::selectMediaResource):
        (WebCore::HTMLMediaElement::loadResource):
        (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
        (WebCore::HTMLMediaElement::isSafeToLoadURL):
        (WebCore::HTMLMediaElement::controls const):
        (WebCore::HTMLMediaElement::layoutSizeChanged):
        (WebCore::HTMLMediaElement::enterFullscreen):
        (WebCore::HTMLMediaElement::mediaControls const):
        (WebCore::HTMLMediaElement::hasMediaControls const):
        (WebCore::HTMLMediaElement::mediaPlayerReferrer const):
        (WebCore::HTMLMediaElement::mediaPlayerUserAgent const):
        (WebCore::HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge):
        (WebCore::HTMLMediaElement::sourceApplicationIdentifier const):
        (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
        (WebCore::HTMLMediaElement::session const):
        * html/HTMLMediaElement.h:
        (WebCore::HTMLMediaElement::player const):
        * html/HTMLObjectElement.cpp:
        (WebCore::HTMLObjectElement::hasFallbackContent const):
        * html/HTMLOptGroupElement.cpp:
        (WebCore::HTMLOptGroupElement::ownerSelectElement const):
        (WebCore::HTMLOptGroupElement::accessKeyAction):
        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::setText):
        (WebCore::HTMLOptionElement::accessKeyAction):
        (WebCore::HTMLOptionElement::index const):
        (WebCore::HTMLOptionElement::parseAttribute):
        (WebCore::HTMLOptionElement::selected):
        (WebCore::HTMLOptionElement::setSelected):
        (WebCore::HTMLOptionElement::setSelectedState):
        (WebCore::HTMLOptionElement::childrenChanged):
        (WebCore::HTMLOptionElement::ownerDataListElement const):
        (WebCore::HTMLOptionElement::ownerSelectElement const):
        (WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel const):
        (WebCore::HTMLOptionElement::insertedInto):
        (WebCore::HTMLOptionElement::collectOptionInnerText const):
        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::willDetachRenderers):
        (WebCore::HTMLPlugInElement::isKeyboardFocusable const):
        (WebCore::HTMLPlugInElement::isUserObservable const):
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const):
        (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::add):
        (WebCore::HTMLSelectElement::recalcListItems const):
        (WebCore::HTMLSelectElement::selectOption):
        (WebCore::HTMLSelectElement::reset):
        (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
        * html/HTMLSlotElement.cpp:
        (WebCore::flattenAssignedNodes):
        * html/HTMLSourceElement.cpp:
        (WebCore::HTMLSourceElement::removedFrom):
        * html/HTMLSummaryElement.cpp:
        (WebCore::HTMLSummaryElement::isActiveSummary const):
        (WebCore::isClickableControl):
        (WebCore::HTMLSummaryElement::defaultEventHandler):
        * html/HTMLTableCellElement.cpp:
        (WebCore::HTMLTableCellElement::additionalPresentationAttributeStyle const):
        * html/HTMLTableColElement.cpp:
        (WebCore::HTMLTableColElement::additionalPresentationAttributeStyle const):
        * html/HTMLTableElement.cpp:
        (WebCore::HTMLTableElement::tHead const):
        (WebCore::HTMLTableElement::setTHead):
        (WebCore::HTMLTableElement::tFoot const):
        (WebCore::HTMLTableElement::createTBody):
        (WebCore::HTMLTableElement::lastBody const):
        (WebCore::HTMLTableElement::deleteRow):
        * html/HTMLTablePartElement.cpp:
        (WebCore::HTMLTablePartElement::findParentTable const):
        * html/HTMLTableRowsCollection.cpp:
        (WebCore::HTMLTableRowsCollection::rowAfter):
        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::subtreeHasChanged):
        (WebCore::HTMLTextAreaElement::innerTextElement const):
        * html/HTMLTextAreaElement.h:
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::setSelectionRange):
        (WebCore::HTMLTextFormControlElement::indexForVisiblePosition const):
        (WebCore::HTMLTextFormControlElement::visiblePositionForIndex const):
        (WebCore::HTMLTextFormControlElement::computeSelectionStart const):
        (WebCore::HTMLTextFormControlElement::computeSelectionEnd const):
        (WebCore::HTMLTextFormControlElement::computeSelectionDirection const):
        (WebCore::HTMLTextFormControlElement::selection const):
        (WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
        (WebCore::innerTextValueFrom):
        (WebCore::HTMLTextFormControlElement::setInnerTextValue):
        (WebCore::HTMLTextFormControlElement::innerTextValue const):
        (WebCore::positionForIndex):
        (WebCore::HTMLTextFormControlElement::indexForPosition const):
        (WebCore::HTMLTextFormControlElement::hidePlaceholder):
        (WebCore::HTMLTextFormControlElement::showPlaceholderIfNecessary):
        (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks const):
        (WebCore::enclosingTextFormControl):
        (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
        * html/HTMLTextFormControlElement.h:
        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::canLoadURL):
        (WebCore::HTMLTrackElement::setReadyState):
        (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute const):
        (WebCore::HTMLTrackElement::textTrackKindChanged):
        (WebCore::HTMLTrackElement::textTrackModeChanged):
        (WebCore::HTMLTrackElement::textTrackAddCues):
        (WebCore::HTMLTrackElement::textTrackRemoveCues):
        (WebCore::HTMLTrackElement::textTrackAddCue):
        (WebCore::HTMLTrackElement::textTrackRemoveCue):
        (WebCore::HTMLTrackElement::mediaElement const):
        * html/HTMLTrackElement.h:
        * html/HTMLVideoElement.cpp:
        (WebCore::HTMLVideoElement::setDisplayMode):
        (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
        * html/ImageDocument.cpp:
        (WebCore::ImageDocument::createDocumentStructure):
        (WebCore::ImageDocument::scale):
        (WebCore::ImageDocument::imageFitsInWindow):
        * html/InputType.cpp:
        (WebCore::InputType::destroyShadowSubtree):
        * html/InputType.h:
        (WebCore::InputType::innerTextElement const):
        * html/MediaDocument.cpp:
        (WebCore::MediaDocumentParser::createDocumentStructure):
        (WebCore::MediaDocument::defaultEventHandler):
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
        (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
        (WebCore::isMainContentForPurposesOfAutoplay):
        * html/NumberInputType.cpp:
        (WebCore::NumberInputType::decorationWidth const):
        * html/PluginDocument.cpp:
        (WebCore::PluginDocumentParser::appendBytes):
        * html/RadioInputType.cpp:
        (WebCore::RadioInputType::handleKeydownEvent):
        (WebCore::RadioInputType::isKeyboardFocusable const):
        (WebCore::RadioInputType::didDispatchClick):
        * html/RadioNodeList.cpp:
        (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter const):
        * html/RangeInputType.cpp:
        (WebCore::RangeInputType::handleMouseDownEvent):
        (WebCore::RangeInputType::handleTouchEvent):
        (WebCore::RangeInputType::sliderTrackElement const):
        (WebCore::RangeInputType::listAttributeTargetChanged):
        (WebCore::RangeInputType::updateTickMarkValues):
        * html/SearchInputType.cpp:
        (WebCore::SearchInputType::createShadowSubtree):
        * html/TextFieldInputType.cpp:
        (WebCore::TextFieldInputType::isEmptyValue const):
        (WebCore::TextFieldInputType::handleKeydownEvent):
        (WebCore::TextFieldInputType::handleFocusEvent):
        (WebCore::TextFieldInputType::innerTextElement const):
        (WebCore::TextFieldInputType::updatePlaceholderText):
        (WebCore::TextFieldInputType::didSetValueByUserEdit):
        (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const):
        * html/TextFieldInputType.h:
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::size):
        (WebCore::CanvasRenderingContext2D::drawImage):
        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::copyBufferSubData):
        (WebCore::WebGL2RenderingContext::getBufferSubData):
        * html/canvas/WebGLFramebuffer.cpp:
        (WebCore::WebGLFramebuffer::attach):
        (WebCore::WebGLFramebuffer::getAttachmentObject const):
        (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
        (WebCore::WebGLFramebuffer::getColorBufferWidth const):
        (WebCore::WebGLFramebuffer::getColorBufferHeight const):
        (WebCore::WebGLFramebuffer::getColorBufferFormat const):
        (WebCore::WebGLFramebuffer::checkStatus const):
        (WebCore::WebGLFramebuffer::hasStencilBuffer const):
        (WebCore::WebGLFramebuffer::initializeAttachments):
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::create):
        (WebCore::WebGLRenderingContextBase::bufferData):
        (WebCore::WebGLRenderingContextBase::bufferSubData):
        (WebCore::WebGLRenderingContextBase::compressedTexImage2D):
        (WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
        (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
        (WebCore::WebGLRenderingContextBase::generateMipmap):
        (WebCore::WebGLRenderingContextBase::getAttachedShaders):
        (WebCore::WebGLRenderingContextBase::getTexParameter):
        (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
        (WebCore::WebGLRenderingContextBase::texImage2DBase):
        (WebCore::WebGLRenderingContextBase::validateTexFunc):
        (WebCore::WebGLRenderingContextBase::texSubImage2D):
        (WebCore::WebGLRenderingContextBase::texSubImage2DBase):
        (WebCore::WebGLRenderingContextBase::copyTexImage2D):
        (WebCore::WebGLRenderingContextBase::texImage2D):
        (WebCore::WebGLRenderingContextBase::texParameter):
        (WebCore::WebGLRenderingContextBase::loseContextImpl):
        (WebCore::WebGLRenderingContextBase::checkTextureCompleteness):
        (WebCore::WebGLRenderingContextBase::validateTextureBinding):
        (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
        * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
        (WebCore::WebGPURenderPassColorAttachmentDescriptor::clearColor const):
        (WebCore::WebGPURenderPassColorAttachmentDescriptor::setClearColor):
        * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
        (WebCore::WebGPURenderPassDepthAttachmentDescriptor::clearDepth const):
        (WebCore::WebGPURenderPassDepthAttachmentDescriptor::setClearDepth):
        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::executeInsertAlreadyParsedChildTask):
        (WebCore::HTMLConstructionSite::insertTextNode):
        * html/parser/HTMLFormattingElementList.cpp:
        (WebCore::HTMLFormattingElementList::tryToEnsureNoahsArkConditionQuickly):
        * html/parser/HTMLParserOptions.cpp:
        (WebCore::HTMLParserOptions::HTMLParserOptions):
        * html/parser/HTMLParserScheduler.cpp:
        (WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript):
        * html/parser/HTMLTreeBuilder.cpp:
        (WebCore::HTMLTreeBuilder::processStartTagForInBody):
        (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
        (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
        * html/parser/XSSAuditor.cpp:
        (WebCore::XSSAuditor::init):
        * html/shadow/MediaControlElementTypes.cpp:
        (WebCore::parentMediaElement):
        * html/shadow/MediaControlElementTypes.h:
        (WebCore::parentMediaElement):
        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlPanelElement::startDrag):
        (WebCore::MediaControlPanelElement::endDrag):
        (WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
        (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
        (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
        (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
        (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
        (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
        (WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
        (WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
        (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
        (WebCore::MediaControlTextTrackContainerElement::clearTextTrackRepresentation):
        (WebCore::MediaControlTextTrackContainerElement::updateSizes):
        (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
        * html/shadow/MediaControls.cpp:
        (WebCore::MediaControls::containsRelatedTarget):
        * html/shadow/SliderThumbElement.cpp:
        (WebCore::SliderThumbElement::isDisabledFormControl const):
        (WebCore::SliderThumbElement::matchesReadWritePseudoClass const):
        (WebCore::SliderThumbElement::focusDelegate):
        (WebCore::SliderThumbElement::setPositionFromPoint):
        (WebCore::SliderThumbElement::startDragging):
        (WebCore::SliderThumbElement::stopDragging):
        (WebCore::SliderThumbElement::defaultEventHandler):
        (WebCore::SliderThumbElement::willRespondToMouseMoveEvents):
        (WebCore::SliderThumbElement::willRespondToMouseClickEvents):
        (WebCore::SliderThumbElement::willDetachRenderers):
        (WebCore::findTouchWithIdentifier):
        (WebCore::SliderThumbElement::handleTouchStart):
        (WebCore::SliderThumbElement::handleTouchMove):
        (WebCore::SliderThumbElement::handleTouchEndAndCancel):
        (WebCore::SliderThumbElement::handleTouchEvent):
        (WebCore::SliderThumbElement::hostInput const):
        * html/shadow/SliderThumbElement.h:
        * html/shadow/SpinButtonElement.cpp:
        (WebCore::SpinButtonElement::defaultEventHandler):
        (WebCore::SpinButtonElement::releaseCapture):
        * html/shadow/TextControlInnerElements.cpp:
        (WebCore::TextControlInnerTextElement::defaultEventHandler):
        (WebCore::SearchFieldCancelButtonElement::willRespondToMouseClickEvents):
        * html/shadow/mac/ImageControlsButtonElementMac.cpp:
        (WebCore::ImageControlsButtonElementMac::defaultEventHandler):
        * html/track/LoadableTextTrack.cpp:
        (WebCore::LoadableTextTrack::trackElementIndex):
        * html/track/TextTrack.cpp:
        (WebCore::TextTrack::setMode):
        (WebCore::TextTrack::hasCue):
        * html/track/TextTrackCueGeneric.cpp:
        (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
        * html/track/VTTCue.cpp:
        (WebCore::VTTCue::copyWebVTTNodeToDOMTree):
        (WebCore::VTTCue::determineTextDirection):
        (WebCore::VTTCue::markFutureAndPastNodes):
        (WebCore::VTTCue::removeDisplayTree):
        (WebCore::VTTCue::cueContentsMatch const):
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::didAddEventListener):
        (WebCore::InspectorDOMAgent::willRemoveEventListener):
        * loader/FormSubmission.cpp:
        (WebCore::FormSubmission::create):
        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::maybeCreateContextMenu):
        * rendering/RenderSnapshottedPlugIn.cpp:
        (WebCore::RenderSnapshottedPlugIn::handleEvent):
        * rendering/RenderTextControl.cpp:
        (WebCore::RenderTextControl::innerTextElement const):
        (WebCore::RenderTextControl::styleDidChange):
        (WebCore::RenderTextControl::textBlockLogicalWidth const):
        (WebCore::RenderTextControl::computeLogicalHeight const):
        (WebCore::RenderTextControl::hitInnerTextElement):
        (WebCore::RenderTextControl::canScroll const):
        (WebCore::RenderTextControl::innerLineHeight const):
        * rendering/RenderTextControl.h:
        * rendering/RenderTextControlSingleLine.cpp:
        (WebCore::RenderTextControlSingleLine::nodeAtPoint):
        (WebCore::RenderTextControlSingleLine::styleDidChange):
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::isFocused const):
        * rendering/RenderThemeGtk.cpp:
        (WebCore::RenderThemeGtk::paintMediaSliderTrack):
        (WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::paintSliderThumb):
        * rendering/RenderVideo.cpp:
        (WebCore::RenderVideo::willBeDestroyed):
        (WebCore::RenderVideo::calculateIntrinsicSize):
        (WebCore::RenderVideo::paintReplaced):
        (WebCore::RenderVideo::updatePlayer):
        (WebCore::RenderVideo::supportsAcceleratedRendering const):
        (WebCore::RenderVideo::acceleratedRenderingStateChanged):
        (WebCore::RenderVideo::requiresImmediateCompositing const):
        (WebCore::RenderVideo::foregroundIsKnownToBeOpaqueInRect const):
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::clearShadowTree):
        (WebCore::SVGUseElement::targetClone const):

2017-10-18  Dean Jackson  <dino@apple.com>

        Some older hardware can't actually use renderbuffers at the size they advertise
        https://bugs.webkit.org/show_bug.cgi?id=178417
        <rdar://problem/35042291>

        Reviewed by Tim Horton.

        The change in r223567 caused some older hardware to fail, because even though
        they claimed to support a maximum renderbuffer and viewport of 16K, they were
        unable to actually handle one. Rather than trying to identify such hardware,
        clamp all buffers to a maximum of 8192. This is bigger than the previous value
        of 4096, and large enough to have a full-screen buffer on a Retina 5K iMac.

        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
        (WebCore::GraphicsContext3D::getIntegerv):

2017-10-18  Chris Dumez  <cdumez@apple.com>

        [Service Worker] Add stubs for Client / WindowClient / Clients
        https://bugs.webkit.org/show_bug.cgi?id=178469

        Reviewed by Youenn Fablet.

        Add stubs for Client / WindowClient / Clients:
        - https://w3c.github.io/ServiceWorker/v1/#clients
        - https://w3c.github.io/ServiceWorker/v1/#client-interface

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/WebCoreBuiltinNames.h:
        * dom/Document.cpp:
        (WebCore::Document::visibilityState const):
        * dom/Document.h:
        * dom/Document.idl:
        * dom/VisibilityState.h: Renamed from Source/WebCore/page/PageVisibilityState.h.
        * dom/VisibilityState.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
        * page/Page.cpp:
        (WebCore::Page::visibilityState const):
        * page/Page.h:
        * workers/service/ServiceWorkerClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
        (WebCore::ServiceWorkerClient::ServiceWorkerClient):
        (WebCore::ServiceWorkerClient::activeDOMObjectName const):
        (WebCore::ServiceWorkerClient::canSuspendForDocumentSuspension const):
        (WebCore::ServiceWorkerClient::url const):
        (WebCore::ServiceWorkerClient::frameType const):
        (WebCore::ServiceWorkerClient::id const):
        (WebCore::ServiceWorkerClient::postMessage):
        * workers/service/ServiceWorkerClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
        * workers/service/ServiceWorkerClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
        * workers/service/ServiceWorkerClients.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp.
        (WebCore::ServiceWorkerClients::ServiceWorkerClients):
        (WebCore::ServiceWorkerClients::activeDOMObjectName const):
        (WebCore::ServiceWorkerClients::canSuspendForDocumentSuspension const):
        (WebCore::ServiceWorkerClients::get):
        (WebCore::ServiceWorkerClients::matchAll):
        (WebCore::ServiceWorkerClients::openWindow):
        (WebCore::ServiceWorkerClients::claim):
        * workers/service/ServiceWorkerClients.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h.
        (WebCore::ServiceWorkerClients::create):
        * workers/service/ServiceWorkerClients.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
        * workers/service/ServiceWorkerGlobalScope.cpp:
        (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
        * workers/service/ServiceWorkerGlobalScope.h:
        (WebCore::ServiceWorkerGlobalScope::clients):
        * workers/service/ServiceWorkerGlobalScope.idl:
        * workers/service/ServiceWorkerWindowClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
        (WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
        (WebCore::ServiceWorkerWindowClient::visibilityState const):
        (WebCore::ServiceWorkerWindowClient::isFocused const):
        (WebCore::ServiceWorkerWindowClient::focus):
        (WebCore::ServiceWorkerWindowClient::navigate):
        * workers/service/ServiceWorkerWindowClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
        * workers/service/ServiceWorkerWindowClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.

2017-10-18  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Use SetForScope to protect m_needsFullRepaint's value on reentrancy
        https://bugs.webkit.org/show_bug.cgi?id=178479
        <rdar://problem/35056950>

        Reviewed by Simon Fraser.

        No change in functionality.

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

2017-10-18  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Remove InPreLayoutStyleUpdate.
        https://bugs.webkit.org/show_bug.cgi?id=178483
        <rdar://problem/35058800>

        Reviewed by Simon Fraser.

        Its client, updateCompositingLayersAfterStyleChange only needs to know if there's a upcoming
        layer update (part of FrameView::layout()).

        No change in functionality.

        * page/FrameView.cpp:
        (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
        (WebCore::FrameView::layout):
        * page/FrameView.h:

2017-10-18  Chris Dumez  <cdumez@apple.com>

        Global constructors exposed to service workers should go on ServiceWorkerGlobalScope interface
        https://bugs.webkit.org/show_bug.cgi?id=178482

        Reviewed by Sam Weinig.

        Global constructors exposed to service workers should go on ServiceWorkerGlobalScope interface,
        not the ServiceWorker interface.

        * bindings/scripts/preprocess-idls.pl:

2017-10-17  Ryosuke Niwa  <rniwa@webkit.org>

        Add an argument indicating the type of insertion to Node::insertedInto
        https://bugs.webkit.org/show_bug.cgi?id=178431

        Reviewed by Antti Koivisto.

        Added InsertionType as the first argument to Node::insertedInto, which contains two booleans indicating
        whether the node just become newly connected to a document, and whether node's tree scope had changed or not.

        These boolean flags simplifie the logic in insertedInto implementations, and are required to have a better
        guarantee about the correctness of node flags during calls to insertedInto. Right now, isConnected() and
        isInShadowTree() are both outdated until Node::insertedInto is called.

        Also renamed the second argument from insertionPoint to parentOfInsertedTree to make the semantics clear,
        and renamed finishedInsertingSubtree to didFinishInsertingNode, and renamed InsertionNotificationRequest
        to InsertedIntoResult using enum class.

        Note that in some implementations of insertedInto, we check whether isConnected() was false to decide whether
        the node is newly connected to a document. This extra check is no longer necessary since no node will be inserted
        into a document without first being completely removed after r223458.

        No new tests since there should be no behavioral changes.

        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::notifyChildInserted):
        * dom/ContainerNodeAlgorithms.cpp:
        (WebCore::notifyNodeInsertedIntoDocument): Replaced the check that the node had not been disconnected by scripts
        by a release assert now that we believe we've eliminated all causes of these unwanted DOM mutations in r223458.
        (WebCore::notifyNodeInsertedIntoTree): Removed NoEventDispatchAssertion since notifyChildNodeInserted has it
        already since r223458.
        (WebCore::notifyChildNodeInserted): Made this function return NodeVector (copy elision).
        * dom/ContainerNodeAlgorithms.h:
        * dom/Element.cpp:
        (WebCore::Element::insertedInto): Use insertionType.connectedToDocument to detect when this element had become
        connected to some document. Similarly, use insertionType.treeScopeChanged to detect when this element had been
        inserted into a new tree scope. Removed the comment which became obsolete due to this cleanup.
        (WebCore::Element::addShadowRoot): Simplified the code here since we never attach a ShadowRoot with children.
        * dom/Element.h:
        * dom/Node.cpp:
        (WebCore::Node::insertedInto):
        * dom/Node.h:
        (WebCore::Node::InsertedIntoResult): Renamed from InsertionNotificationRequest, and turned into an enum class.
        (WebCore::Node::InsertionType): Added. We pass this object by value to insertedInto as a performance optimization
        as passing two booleans by value is faster than passing a pointer and then de-referencing it in a virtual callee.
        (WebCore::Node::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::insertedInto):
        (WebCore::ProcessingInstruction::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * dom/ProcessingInstruction.h:
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::shouldCallFinishedInsertingSubtree): Deleted.
        (WebCore::ScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * dom/ScriptElement.h:
        (WebCore::ScriptElement::insertedInto const): Added. Extracted from shouldCallFinishedInsertingSubtree.
        * dom/ShadowRoot.cpp:
        (WebCore::ShadowRoot::insertedInto): The extra isConnected() check is no longer needed. See the description above.
        * dom/ShadowRoot.h:
        * html/FormAssociatedElement.cpp:
        (WebCore::FormAssociatedElement::insertedInto):
        * html/FormAssociatedElement.h:
        * html/HTMLBaseElement.cpp:
        (WebCore::HTMLBaseElement::insertedInto):
        * html/HTMLBaseElement.h:
        * html/HTMLBodyElement.cpp:
        (WebCore::HTMLBodyElement::insertedInto):
        (WebCore::HTMLBodyElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * html/HTMLBodyElement.h:
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::insertedInto):
        (WebCore::HTMLFormControlElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * html/HTMLFormControlElement.h:
        * html/HTMLFormControlElementWithState.cpp:
        (WebCore::HTMLFormControlElementWithState::insertedInto):
        * html/HTMLFormControlElementWithState.h:
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::insertedInto):
        * html/HTMLFormElement.h:
        * html/HTMLFrameElementBase.cpp:
        (WebCore::HTMLFrameElementBase::insertedInto):
        (WebCore::HTMLFrameElementBase::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * html/HTMLFrameElementBase.h:
        * html/HTMLFrameSetElement.cpp:
        (WebCore::HTMLFrameSetElement::insertedInto):
        * html/HTMLFrameSetElement.h:
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::insertedInto):
        * html/HTMLImageElement.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::insertedInto):
        (WebCore::HTMLInputElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * html/HTMLInputElement.h:
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::insertedInto): The extra isConnected() check is no longer needed. See above.
        (WebCore::HTMLLinkElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * html/HTMLLinkElement.h:
        * html/HTMLMapElement.cpp:
        (WebCore::HTMLMapElement::insertedInto):
        * html/HTMLMapElement.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::insertedInto):
        (WebCore::HTMLMediaElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * html/HTMLMediaElement.h:
        * html/HTMLMetaElement.cpp:
        (WebCore::HTMLMetaElement::insertedInto):
        * html/HTMLMetaElement.h:
        * html/HTMLObjectElement.cpp:
        (WebCore::HTMLObjectElement::insertedInto):
        (WebCore::HTMLObjectElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * html/HTMLObjectElement.h:
        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::insertedInto):
        * html/HTMLOptionElement.h:
        * html/HTMLScriptElement.cpp:
        (WebCore::HTMLScriptElement::insertedInto):
        (WebCore::HTMLScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * html/HTMLScriptElement.h:
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::insertedInto):
        * html/HTMLSelectElement.h:
        * html/HTMLSlotElement.cpp:
        (WebCore::HTMLSlotElement::insertedInto): Replaced a cumbersome condition by a boolean check on insertionType's
        treeScopeChanged and removed the accompanying comment which is no longer needed.
        * html/HTMLSlotElement.h:
        * html/HTMLSourceElement.cpp:
        (WebCore::HTMLSourceElement::insertedInto):
        * html/HTMLSourceElement.h:
        * html/HTMLStyleElement.cpp:
        (WebCore::HTMLStyleElement::insertedInto): The extra isConnected() check is no longer needed. See above.
        * html/HTMLStyleElement.h:
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::insertedInto):
        * html/HTMLTextFormControlElement.h:
        * html/HTMLTitleElement.cpp:
        (WebCore::HTMLTitleElement::insertedInto):
        * html/HTMLTitleElement.h:
        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::insertedInto): Added a FIXME since this code is clearly wrong.
        * html/HTMLTrackElement.h:
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::insertedInto):
        * svg/SVGElement.h:
        * svg/SVGFEImageElement.cpp:
        (WebCore::SVGFEImageElement::insertedInto):
        (WebCore::SVGFEImageElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * svg/SVGFEImageElement.h:
        * svg/SVGFontFaceElement.cpp:
        (WebCore::SVGFontFaceElement::insertedInto):
        * svg/SVGFontFaceElement.h:
        * svg/SVGFontFaceUriElement.cpp:
        (WebCore::SVGFontFaceUriElement::insertedInto):
        * svg/SVGFontFaceUriElement.h:
        * svg/SVGImageElement.cpp:
        (WebCore::SVGImageElement::insertedInto):
        * svg/SVGImageElement.h:
        * svg/SVGMPathElement.cpp:
        (WebCore::SVGMPathElement::insertedInto):
        (WebCore::SVGMPathElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * svg/SVGMPathElement.h:
        * svg/SVGPathElement.cpp:
        (WebCore::SVGPathElement::insertedInto):
        * svg/SVGPathElement.h:
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::insertedInto):
        * svg/SVGSVGElement.h:
        * svg/SVGScriptElement.cpp:
        (WebCore::SVGScriptElement::insertedInto):
        (WebCore::SVGScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * svg/SVGScriptElement.h:
        * svg/SVGStyleElement.cpp:
        (WebCore::SVGStyleElement::insertedInto): The extra isConnected() check is no longer needed. See above description.
        * svg/SVGStyleElement.h:
        * svg/SVGTRefElement.cpp:
        (WebCore::SVGTRefElement::insertedInto):
        (WebCore::SVGTRefElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * svg/SVGTRefElement.h:
        * svg/SVGTextPathElement.cpp:
        (WebCore::SVGTextPathElement::insertedInto):
        (WebCore::SVGTextPathElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * svg/SVGTextPathElement.h:
        * svg/SVGTitleElement.cpp:
        (WebCore::SVGTitleElement::insertedInto):
        * svg/SVGTitleElement.h:
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::insertedInto):
        * svg/SVGUseElement.h:
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::insertedInto):
        (WebCore::SVGSMILElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
        * svg/animation/SVGSMILElement.h:

2017-10-18  Eric Carlson  <eric.carlson@apple.com>

        Key events should not update Document.lastHandledUserGestureTimestamp unless key event is handled
        https://bugs.webkit.org/show_bug.cgi?id=178473
        <rdar://problem/34869935>

        Reviewed by Brent Fulgham.

        No new tests, updated media/restricted-audio-playback-with-document-gesture.html for this change.

        * page/EventHandler.cpp:
        (WebCore::EventHandler::keyEvent): Restore the current Document's "lastHandledUserGestureTimestamp"
        if the key event was not handled.

2017-10-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, rolling out r223291.

        After further investigation, this removed codepath is
        something Mail may want to re-adopt. Additionally, the
        original breaking change was rolled out in r223408, so
        this test once again passes on ToT.

        Reverted changeset:

        "Remove Editor::simplifyMarkup"
        https://bugs.webkit.org/show_bug.cgi?id=178271
        https://trac.webkit.org/changeset/223291

2017-10-18  Sam Weinig  <sam@webkit.org>

        [Settings] Move remaining simple settings to Settings.in
        https://bugs.webkit.org/show_bug.cgi?id=177730
        <rdar://problem/34763346>

        Reviewed by Daniel Bates.

        * Scripts/GenerateSettings/Settings.py:
        (Setting.__init__):
        (Setting.__str__):
        (Setting.getterFunctionName):
        (parseInput):

            Add support for parsing the 'getter' option.

        * page/Settings.in:
        
            Migrate simple settings from SettingsBase to here.
        
        * page/SettingsBase.cpp:
        (WebCore::SettingsBase::SettingsBase):
        (WebCore::SettingsBase::setJavaEnabled): Deleted.
        (WebCore::SettingsBase::setJavaEnabledForLocalFiles): Deleted.
        (WebCore::SettingsBase::setPreferMIMETypeForImages): Deleted.
        (WebCore::SettingsBase::setForcePendingWebGLPolicy): Deleted.
        (WebCore::SettingsBase::setNeedsAdobeFrameReloadingQuirk): Deleted.
        (WebCore::SettingsBase::setFontRenderingMode): Deleted.
        (WebCore::SettingsBase::fontRenderingMode const): Deleted.
        (WebCore::SettingsBase::setShowTiledScrollingIndicator): Deleted.
        (WebCore::SettingsBase::setFontFallbackPrefersPictographs): Deleted.
        * page/SettingsBase.h:
        (WebCore::SettingsBase::isJavaEnabled const): Deleted.
        (WebCore::SettingsBase::isJavaEnabledForLocalFiles const): Deleted.
        (WebCore::SettingsBase::preferMIMETypeForImages const): Deleted.
        (WebCore::SettingsBase::needsAcrobatFrameReloadingQuirk const): Deleted.
        (WebCore::SettingsBase::showTiledScrollingIndicator const): Deleted.
        (WebCore::SettingsBase::setTouchEventEmulationEnabled): Deleted.
        (WebCore::SettingsBase::isTouchEventEmulationEnabled const): Deleted.
        (WebCore::SettingsBase::setTimeWithoutMouseMovementBeforeHidingControls): Deleted.
        (WebCore::SettingsBase::timeWithoutMouseMovementBeforeHidingControls const): Deleted.
        (WebCore::SettingsBase::fontFallbackPrefersPictographs const): Deleted.
        (WebCore::SettingsBase::setMediaKeysStorageDirectory): Deleted.
        (WebCore::SettingsBase::mediaKeysStorageDirectory const): Deleted.
        (WebCore::SettingsBase::setMediaDeviceIdentifierStorageDirectory): Deleted.
        (WebCore::SettingsBase::mediaDeviceIdentifierStorageDirectory const): Deleted.
        (WebCore::SettingsBase::applePayEnabled const): Deleted.
        (WebCore::SettingsBase::setApplePayEnabled): Deleted.
        (WebCore::SettingsBase::applePayCapabilityDisclosureAllowed const): Deleted.
        (WebCore::SettingsBase::setApplePayCapabilityDisclosureAllowed): Deleted.
        (WebCore::SettingsBase::isForcePendingWebGLPolicy const): Deleted.
        
            Remove simple settings.

2017-10-18  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Move root/body marking dirty logic to a separate function
        https://bugs.webkit.org/show_bug.cgi?id=178477
        <rdar://problem/35056478>

        Reviewed by Simon Fraser.

        No change in functionality.

        * page/FrameView.cpp:
        (WebCore::FrameView::markRootOrBodyRendererDirty const):
        (WebCore::FrameView::layout):
        * page/FrameView.h:

2017-10-18  Keith Miller  <keith_miller@apple.com>

        Setup WebCore build to start using unified sources.
        https://bugs.webkit.org/show_bug.cgi?id=178362

        Reviewed by Tim Horton.

        This patch adds all the long tooling needed to start adding
        unified sources to WebCore. Most of the source list files
        are empty to start but will be filled over the next few days.

        I started by moving all the non-derived bindings code to
        unified sources to make sure everything worked correctly.

        * CMakeLists.txt:
        * Configurations/GenerateUnifiedSources.xcconfig: Added.
        * Configurations/WebCore.xcconfig:
        * PlatformMac.cmake:
        * Sources.txt: Added.
        * SourcesCocoa.txt: Added.
        * SourcesIOS.txt: Added.
        * SourcesMac.txt: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSMediaStreamCapabilitiesCustom.cpp: Removed. No one seems to use this...

2017-10-18  Commit Queue  <commit-queue@webkit.org>

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

        This protocol change broke some internal builds (Requested by
        brrian__ on #webkit).

        Reverted changeset:

        "Web Inspector: provide a way to enable/disable event
        listeners"
        https://bugs.webkit.org/show_bug.cgi?id=177451
        https://trac.webkit.org/changeset/223321

2017-10-18  Sam Weinig  <sam@webkit.org>

        [Settings] Miscellaneous cleanup of the settings generation scripts
        https://bugs.webkit.org/show_bug.cgi?id=178462

        Reviewed by Daniel Bates.

        - Stop generating and remove now unused SettingsMacros.h
        - Make functions operating on the python Setting object member functions
        - Add predicate to determine if a Setting's type is a value type, allowing
          us to exclude those from using const references.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Scripts/GenerateSettings.py:
        * Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py:
        * Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py:
        * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py:
        * Scripts/GenerateSettings/GenerateSettings.py:
        * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
        * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
        * Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py: Removed.
        * Scripts/GenerateSettings/Settings.py:
        * WebCoreMacros.cmake:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-18  Chris Dumez  <cdumez@apple.com>

        Align ImageData constructor with the specification
        https://bugs.webkit.org/show_bug.cgi?id=178406

        Reviewed by Youenn Fablet.

        Align ImageData constructor with the specification:
        - https://html.spec.whatwg.org/multipage/canvas.html#dom-imagedata

        It sometimes throws the wrong exception.

        No new tests, rebaselined existing test.

        * html/ImageData.cpp:
        (WebCore::ImageData::create):
        * html/ImageData.h:
        * html/ImageData.idl:

2017-10-18  Chris Dumez  <cdumez@apple.com>

        Add an efficient data structure for WebCore to query if there is a Service Worker registered for a given origin
        https://bugs.webkit.org/show_bug.cgi?id=177876
        <rdar://problem/34813129>

        Reviewed by Ryosuke Niwa.

        No new tests, updatdd existing test.

        * dom/Document.h:
        * testing/Internals.cpp:
        (WebCore::Internals::hasServiceWorkerRegisteredForOrigin):
        * testing/Internals.h:
        * testing/Internals.idl:
        * workers/service/ServiceWorkerProvider.h:
        * workers/service/context/SWContextManager.cpp:
        (WebCore::SWContextManager::startServiceWorkerContext):
        * workers/service/server/SWClientConnection.h:
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::scriptContextStarted):
        (WebCore::SWServer::scriptContextStarted):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::scriptContextFailedToStart):
        (WebCore::SWServerRegistration::scriptContextStarted):
        * workers/service/server/SWServerRegistration.h:

2017-10-18  Sam Weinig  <sam@webkit.org>

        [Settings] Replace macros in Settings.h/cpp with generated code
        https://bugs.webkit.org/show_bug.cgi?id=178419

        Reviewed by Antti Koivisto.

        * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
        * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:

            Rather than use macros in the generated Settings class, generate the code the macros
            would expand to.

2017-10-18  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Move frame flattening layout logic to a separate function
        https://bugs.webkit.org/show_bug.cgi?id=178425
        <rdar://problem/35045836>

        Reviewed by Antti Koivisto.

        No change in functionality.

        * page/FrameView.cpp:
        (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
        (WebCore::FrameView::layout):
        (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
        * page/FrameView.h:

2017-10-18  Antti Koivisto  <antti@apple.com>

        Resolve ::before and ::after pseudo elements during style resolution
        https://bugs.webkit.org/show_bug.cgi?id=178339

        Reviewed by Ryosuke Niwa.

        They are currently resolved during render tree building which creates problems with display:contents and animations.

        * dom/PseudoElement.cpp:
        (WebCore::PseudoElement::PseudoElement):

            Call InspectorInstrumentation from constructor.

        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::Parent::Parent):
        (WebCore::RenderTreeUpdater::updateRenderTree):
        (WebCore::RenderTreeUpdater::pushParent):

            Push the full update to the parent stack.

        (WebCore::RenderTreeUpdater::popParent):
        (WebCore::RenderTreeUpdater::updateBeforeDescendants):
        (WebCore::RenderTreeUpdater::updateAfterDescendants):
        (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
        * style/RenderTreeUpdater.h:
        * style/RenderTreeUpdaterGeneratedContent.cpp:
        (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):

            No need to resolve pseudo style, we have it already.

        (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
        (WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement): Deleted.
        (WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement): Deleted.
        * style/RenderTreeUpdaterGeneratedContent.h:
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::resolveElement):
        (WebCore::Style::TreeResolver::resolvePseudoStyle):

            Resolve pseudos.

        (WebCore::Style::TreeResolver::createAnimatedElementUpdate):

            Make a private member function.

        (WebCore::Style::TreeResolver::resolveComposedTree):
        * style/StyleTreeResolver.h:
        * style/StyleUpdate.cpp:
        (WebCore::Style::Update::elementUpdates const):
        (WebCore::Style::Update::elementUpdates):

            Bundle the style update for an element and the associated before/after pseudos.

        (WebCore::Style::Update::elementStyle const):
        (WebCore::Style::Update::elementStyle):
        (WebCore::Style::Update::addElement):
        (WebCore::Style::Update::elementUpdate const): Deleted.
        (WebCore::Style::Update::elementUpdate): Deleted.
        * style/StyleUpdate.h:

2017-10-18  Ms2ger  <Ms2ger@igalia.com>

        Update the signatures of texSubImage3D.
        https://bugs.webkit.org/show_bug.cgi?id=178435

        Reviewed by Sam Weinig.

        Update the signatures of texSubImage3D.

        No new tests: not much point in adding tests now; this method doesn't
        do anything anyway.

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::texSubImage3D):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:

2017-10-18  Fujii Hironori  <Hironori.Fujii@sony.com>

        Use LazyNeverDestroyed instead of DEFINE_GLOBAL for WebKitFontFamilyNames
        https://bugs.webkit.org/show_bug.cgi?id=175106

        Reviewed by Yusuke Suzuki.

        No new tests because there is no behavior change.

        * css/CSSFontFaceSet.cpp:
        (WebCore::CSSFontFaceSet::familyNameFromPrimitive): Call get() method of LazyNeverDestroyed.
        * dom/make_names.pl: Use LazyNeverDestroyed for font names.

2017-10-18  Zan Dobersek  <zdobersek@igalia.com>

        [MSE] Move SourceBuffer's pending append data into the platform implementations
        https://bugs.webkit.org/show_bug.cgi?id=178003

        Reviewed by Jer Noble.

        In SourceBuffer::appendBufferTimerFired(), we can use move semantics to
        pass the pending append data into the platform layer, where it can then
        be used more efficiently.

        Resources in the m_pendingAppendData member are moved into the append()
        call on the SourceBufferPrivate object. The m_pendingAppendData is still
        cleared out manually in case the underlying implementation doesn't clear
        it out through a move operation. The SourceBufferPrivate interface is
        updated to accept a Vector rvalue reference as the only parameter of the
        append() method.

        For the GStreamer implementation, signature of the append() method in
        MediaSourceClientGStreamerMSE class is also updated. The implementation
        now moves the Vector resources over to a on-heap Vector object that is
        then wrapped into a GstBuffer object by using the
        gst_buffer_new_wrapped_full() API and specifying the custom deleter.

        The AVFoundation implementation of SourceBufferPrivate is only updated
        to reflect the changes in the interface. The Vector data that is passed
        in is still copied into the NSData allocation.

        MockSourceBufferPrivate is also updated, with the append data still
        being copied into the m_inputBuffer Vector.

        No new tests -- no change in behavior.

        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::appendBufferTimerFired):
        * platform/graphics/SourceBufferPrivate.h:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::SourceBufferPrivateAVFObjC::append):
        * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
        (WebCore::MediaSourceClientGStreamerMSE::append):
        * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
        * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
        (WebCore::SourceBufferPrivateGStreamer::append):
        * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
        * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
        (WebCore::MockSourceBufferPrivate::append):
        * platform/mock/mediasource/MockSourceBufferPrivate.h:

2017-10-17  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Remove redundant body->renderer()->setChildNeedsLayout() call
        https://bugs.webkit.org/show_bug.cgi?id=178414
        <rdar://problem/35040876>

        Reviewed by Simon Fraser.

        Since m_size always equals to layoutSize() at this point, we never call setChildNeedsLayout() on the body's renderer.
        However a few lines below, when we adjust the frame size and check if oldSize != m_size, we actually
        dirty the body's renderer.

        Covered by existing tests.

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

2017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>

        [Regression] Webkit "-apple-system" font fallback token handles font weights of PingFang incorrectly.
        https://bugs.webkit.org/show_bug.cgi?id=177345
        <rdar://problem/32975942>

        Reviewed by Jon Lee.

        This bug has a fairly insideous cause. In particular, the system font fallback path follows
        system conventions, which are not the same as the CSS fallback path. For example, the Chinese
        fallback of San Francisco weight 600 is Ping Fang weight 500. This doesn't match our
        assumptions in CSS, because Ping Fang does have a 600 weight, which CSS would think is closer.
        However, the whole point of system-ui is that it follows the system fallback path, not CSS's.
        Therefore, falling back from a bold system-ui request to a non-bold fallback font is correct
        and expected, and we shouldn't synthesize bold in this situation.

        Test: fast/text/system-ui-chinese-bold-fallback.html

        * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
        (WebCore::FontFamilySpecificationCoreText::fontRanges const):

2017-10-17  Chelsea Pugh  <cpugh@apple.com>

        [iOS] Don't turn fields yellow after filling credentials
        https://bugs.webkit.org/show_bug.cgi?id=178411

        Reviewed by Wenson Hsieh.

        * editing/ios/AutofillElements.cpp:
        (WebCore::AutofillElements::autofill): We don't want to turn fields yellow when filling the user name
        and password. Remove the code that was causing that to happen.

2017-10-16  Andy Estes  <aestes@apple.com>

        [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
        https://bugs.webkit.org/show_bug.cgi?id=178191
        <rdar://problem/34906367>

        Reviewed by Tim Horton.

        Added test cases to http/tests/ssl/applepay/ApplePaySession.html.

        * Modules/applepay/ApplePayError.idl:
        * Modules/applepay/ApplePayPaymentContact.h:
        * Modules/applepay/ApplePayPaymentContact.idl:
        * Modules/applepay/ApplePaySessionPaymentRequest.h:
        * Modules/applepay/cocoa/PaymentContactCocoa.mm:
        (WebCore::subLocality):
        (WebCore::setSubLocality):
        (WebCore::subAdministrativeArea):
        (WebCore::setSubAdministrativeArea):
        (WebCore::convert):

2017-10-17  Commit Queue  <commit-queue@webkit.org>

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

        Introduced a crash in CSSAnimationController::updateAnimations
        (Requested by rniwa on #webkit).

        Reverted changeset:

        "Resolve ::before and ::after pseudo elements during style
        resolution"
        https://bugs.webkit.org/show_bug.cgi?id=178339
        https://trac.webkit.org/changeset/223500

2017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>

        Delete button doesn't fully delete certain emoji
        https://bugs.webkit.org/show_bug.cgi?id=178096
        <rdar://problem/34785106>

        Reviewed by Simon Fraser.

        System infrastructure for handling emoji changes every year. Instead of having
        custom code to specifically walk over codepoints, we should delegate to the
        system handling.

        Tests: editing/deleting/delete-emoji.html
               editing/deleting/delete-emoji-1.html
               editing/deleting/delete-emoji-2.html
               editing/deleting/delete-emoji-3.html
               editing/deleting/delete-emoji-4.html
               editing/deleting/delete-emoji-5.html
               editing/deleting/delete-emoji-6.html
               editing/deleting/delete-emoji-7.html
               editing/deleting/delete-emoji-8.html
               editing/deleting/delete-emoji-9.html

        * rendering/RenderText.cpp:
        (WebCore::RenderText::previousOffset const):
        (WebCore::RenderText::previousOffsetForBackwardDeletion const):
        (WebCore::RenderText::nextOffset const):
        (WebCore::isHangulLVT): Deleted.
        (WebCore::isMark): Deleted.
        (WebCore::isRegionalIndicator): Deleted.
        (WebCore::isInArmenianToLimbuRange): Deleted.

2017-10-17  Youenn Fablet  <youenn@apple.com>

        Add preliminary support for fetch event
        https://bugs.webkit.org/show_bug.cgi?id=178171

        Unreviewed.

        * workers/service/FetchEvent.cpp:
        (WebCore::FetchEvent::promiseIsSettled): build fix by removing unnecessary captured this at the moment.

2017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>

        [CSS Font Loading] Fonts are erroneously invisible when the policy says they should be visible
        https://bugs.webkit.org/show_bug.cgi?id=178238

        Reviewed by Simon Fraser.

        When implementing font-display, I added testing infrastructure (so we don't have to wait for
        3 second timeouts to occur). This testing infrastructure covered up a real bug where the wrong
        font would be reported to CSSFontAccessor. This patch reverts the erroneous testing
        infrastructure and replaces it with a real fix to the problem. The replacement fix is covered
        by the same tests that I wrote when implementing the feature.

        Covered by existing tests.

        * css/CSSFontFace.cpp:
        (WebCore::CSSFontFace::pump):
        (WebCore::visibility):
        (WebCore::CSSFontFace::font):

2017-10-16  Sam Weinig  <sam@webkit.org>

        [Settings] Generate Settings.h/cpp
        https://bugs.webkit.org/show_bug.cgi?id=178361

        Reviewed by Dean Jackson.

        This change generates Settings.h and Settings.cpp exactly as they are,
        using SettingsMacros.h and everything. In follow up changes, the use of
        SettingsMacros.h will be removed.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Scripts/GenerateSettings.py:
        * Scripts/GenerateSettings/GenerateSettings.py:
        * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Added.
        * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * WebCoreMacros.cmake:
        * page/Settings.cpp: Removed.
        * page/Settings.h: Removed.

2017-10-17  Ms2ger  <Ms2ger@igalia.com>

        Create bindings for WebGL2's versions of texSubImage2D.
        https://bugs.webkit.org/show_bug.cgi?id=178382

        Reviewed by Ryosuke Niwa.

        Create bindings for WebGL2's versions of texSubImage2D.

        No new tests: not much point in adding tests now; this method doesn't
        do anything anyway.

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::texSubImage2D):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:
        * html/canvas/WebGLRenderingContext.idl:
        * html/canvas/WebGLRenderingContextBase.idl:

2017-10-17  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Subtree should read subtreeLayout.
        https://bugs.webkit.org/show_bug.cgi?id=178401

        Reviewed by Simon Fraser.

        Rename some variables to improve readability.

        No change in functionality.

        * page/FrameView.cpp:
        (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
        (WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
        (WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree):
        (WebCore::FrameView::reset):
        (WebCore::FrameView::willDestroyRenderTree):
        (WebCore::FrameView::didDestroyRenderTree):
        (WebCore::FrameView::calculateScrollbarModesForLayout):
        (WebCore::FrameView::layout):
        (WebCore::FrameView::convertSubtreeLayoutToFullLayout):
        (WebCore::FrameView::scheduleRelayout):
        (WebCore::FrameView::scheduleRelayoutOfSubtree):
        (WebCore::FrameView::needsLayout const):
        (WebCore::FrameView::autoSizeIfEnabled):
        * page/FrameView.h:

2017-10-16  Dean Jackson  <dino@apple.com>

        WebGL clamps drawingBufferWidth to 4096 pixels on a 5120 monitor/canvas
        https://bugs.webkit.org/show_bug.cgi?id=178223
        <rdar://problem/34597567>

        Reviewed by Antoine Quint.

        Remove the limit of 4k on the width/height of the renderbuffer.

        Test: fast/canvas/webgl/large-drawing-buffer-resize.html

        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::reshape):

2017-10-17  John Wilander  <wilander@apple.com>

        Add and remove cookie partition accordingly in intermediary redirect requests
        https://bugs.webkit.org/show_bug.cgi?id=178369
        <rdar://problem/34467603>

        Reviewed by Brent Fulgham.

        Tests: http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html
               http/tests/resourceLoadStatistics/remove-partitioning-from-redirect.html

        * loader/ResourceLoadObserver.h:
            Now exposes notifyObserver() so that it can be triggered
            by the TestRunner.
            Removed unimplemented ResourceLoadObserver::setShouldThrottleObserverNotifications().

2017-10-17  Jer Noble  <jer.noble@apple.com>

        Corrupted image after looping movie-backed <img>.
        https://bugs.webkit.org/show_bug.cgi?id=178398

        Reviewed by Eric Carlson.

        Use the decode-order sample cursor rather than the destination sample cursor when generating
        the CMSampleBuffer to decode.

        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
        (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):

2017-10-17  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r223459.

        This change introduced LayoutTest failures.

        Reverted changeset:

        "WebGL clamps drawingBufferWidth to 4096 pixels on a 5120
        monitor/canvas"
        https://bugs.webkit.org/show_bug.cgi?id=178223
        https://trac.webkit.org/changeset/223459

2017-10-17  Youenn Fablet  <youenn@apple.com>

        Add preliminary support for fetch event
        https://bugs.webkit.org/show_bug.cgi?id=178171

        Reviewed by Chris Dumez.

        Test: http/wpt/service-workers/fetchEvent.https.html
              http/wpt/service-workers/extendableEvent.https.html

        Adding support for ExtendableEvent and FetchEvent as per 
        https://w3c.github.io/ServiceWorker/v1/#extendableevent-interface and
        https://w3c.github.io/ServiceWorker/v1/#fetchevent-interface.

        Both events need to handle promises as method parameters.
        Beefing up DOMPromise for that purpose by exposing status, result and being able to call then.
        Adding a new DOMPromise create method that would be the base for https://heycam.github.io/webidl/#es-promise
        which might be implemented in the binding generator as a follow-up.

        This patch makes them exposed on Window for test purposes until they can be fully tested on ServiceWorker environment.
        It is also adding two internal methods for the same reason. These should be removed once events can be tested in its environment.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/fetch/FetchResponse.idl:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMPromise.cpp: Added.
        (WebCore::callFunction):
        (WebCore::DOMPromise::create):
        (WebCore::DOMPromise::whenSettled):
        (WebCore::DOMPromise::result const):
        (WebCore::DOMPromise::status const):
        * bindings/js/JSDOMPromise.h:
        * bindings/js/WebCoreBuiltinNames.h:
        * dom/EventNames.in:
        * testing/Internals.cpp:
        (WebCore::Internals::waitFetchEventToFinish):
        (WebCore::Internals::waitExtendableEventToFinish):
        * testing/Internals.h:
        * testing/Internals.idl:
        * workers/service/ExtendableEvent.cpp: Added.
        (WebCore::ExtendableEvent::ExtendableEvent):
        (WebCore::ExtendableEvent::waitUntil):
        (WebCore::ExtendableEvent::addPendingPromise):
        * workers/service/ExtendableEvent.h:
        (WebCore::ExtendableEvent::onFinishedWaiting):
        (WebCore::ExtendableEvent::promiseSettled):
        * workers/service/ExtendableEvent.idl: Added.
        * workers/service/ExtendableEventInit.h: Added.
        * workers/service/ExtendableEventInit.idl: Added.
        * workers/service/FetchEvent.cpp: Added.
        (WebCore::FetchEvent::FetchEvent):
        (WebCore::FetchEvent::respondWith):
        (WebCore::FetchEvent::onResponse):
        (WebCore::FetchEvent::respondWithError):
        (WebCore::FetchEvent::processResponse):
        (WebCore::FetchEvent::promiseSettled):
        * workers/service/FetchEvent.h:
        * workers/service/FetchEvent.idl:

2017-10-17  Jer Noble  <jer.noble@apple.com>

        Leak of one AVSampleCursor inside ImageDecoderAVFObjC::createFrameImageAtIndex()
        https://bugs.webkit.org/show_bug.cgi?id=178397

        Reviewed by Eric Carlson.

        Explicitly wrap the return value of -copy in a RetainPtr.

        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
        (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):

2017-10-17  Youenn Fablet  <youenn@apple.com>

        Cache API implementation should be able to compute storage size for WebKit client applications.
        https://bugs.webkit.org/show_bug.cgi?id=178350

        Reviewed by Chris Dumez.

        * page/SecurityOriginData.h:
        (WebCore::SecurityOriginData::equals const):

2017-10-17  Daniel Bates  <dabates@apple.com>

        ASSERTION FAILED: m_truncation != cFullTruncation in InlineTextBox::clampedOffset()
        https://bugs.webkit.org/show_bug.cgi?id=178322

        Reviewed by Darin Adler.

        It is acceptable for InlineTextBox::clampedOffset() to be called for a fully truncated box,
        say a person clicks on the ellipsis in a truncated text run. Restore the behavior prior to
        r223259 and return the clamped offset.

        Test: fast/text/click-ellipsis-assertion-failure.html

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

2017-10-17  Daniel Bates  <dabates@apple.com>

        REGRESSION (r222670 and r222732): RTL truncated text may not be drawn
        https://bugs.webkit.org/show_bug.cgi?id=178278
        <rdar://problem/34982818>

        Reviewed by Darin Adler.

        Revert r222732 and partially revert r222670. The underlying font rendering machinery implements
        text truncation by taking a TextRun object that represents all of the text in the line fragment
        and a subrange of the glyphs to render from this fragment. Only the glyphs in this subrange are
        drawn and they are drawn in the same position they would be in had the entire line fragment been
        drawn. Following r222670 InlineTextBox applies the truncation to the TextRun in InlineTextBox::text().
        Together with r222732, which assumed that the number of glyphs to draw is equal to the length of
        the TextRun, a truncated text run would be drawn at the wrong position on screen and could give
        the impression that the text is not drawn. Instead InlineTextBox::text() should always return
        the text for the entire line fragment without considering truncation and when calling TextPainter::paint()
        we need to pass the truncated length of the line fragment.

        Test: fast/text/ellipsis-text-rtl.html

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paint): Compute the truncated length (number of glyphs) and pass this
        to TextPainter::paint()
        (WebCore::InlineTextBox::text const): Do not apply truncation to the text run. Truncation is
        implemented by telling the underlying font rendering machinery to paint the subrange of the
        text run that represents the non-truncated (visible) text.
        * rendering/InlineTextBox.h:
        * rendering/SimpleLineLayoutFunctions.cpp:
        (WebCore::SimpleLineLayout::paintFlow): Pass the entire length of the text run as we did prior
        to r222732.
        * rendering/TextPainter.cpp:
        (WebCore::TextPainter::paint): Take a length that represents the number of glyphs to draw from
        the text run as we use to take prior to r222732.
        * rendering/TextPainter.h:

2017-10-17  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Move text auto sizing logic to a separate function
        https://bugs.webkit.org/show_bug.cgi?id=178391
        <rdar://problem/35030264>

        Reviewed by Antti Koivisto.

        No change in functionality.

        * page/FrameView.cpp:
        (WebCore::applyTextSizingIfNeeded):
        (WebCore::FrameView::layout):

2017-10-17  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        [Curl] Forward declaration "class Cookie;" in CookieJarCurl.h should be "struct Cookie;"
        https://bugs.webkit.org/show_bug.cgi?id=178378

        Reviewed by Per Arne Vollan.

        No new tests. No change in behaviors.

        * platform/network/curl/CookieJarCurl.h:

2017-10-17  Zalan Bujtas  <zalan@apple.com>

        [FrameView::layout cleanup] Merge InPreLayout blocks
        https://bugs.webkit.org/show_bug.cgi?id=178373

        Reviewed by Antti Koivisto.

        Remove redundant comment and scoping.

        No change in functionality.

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

2017-10-17  Antti Koivisto  <antti@apple.com>

        Text nodes with display:contents parent should render as if they were wrapped in an unstyled <span>
        https://bugs.webkit.org/show_bug.cgi?id=178332

        Reviewed by Ryosuke Niwa.

        According to https://github.com/w3c/csswg-drafts/issues/1118

            <div style="display:contents;color:green">text</div>

        must result in green text even though div doesn't generate a box.

        This patch implements the behavior by wrapping text renderers with display:contents parent element
        in an anonymous inline box that receives its style by inheriting from the parent element.

        * dom/Document.cpp:
        (WebCore::Document::updateTextRenderer):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::computeFirstLineStyle const):

            Synthesize the first line style in display:contents parent case.

        * rendering/RenderObject.cpp:
        (WebCore::findDestroyRootIncludingAnonymous):

            Factor into a function.

        (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):

            Get rid of the anonymous wrapper if it exists.

        * rendering/RenderText.cpp:
        (WebCore::inlineWrapperForDisplayContentsMap):
        (WebCore::RenderText::RenderText):
        (WebCore::RenderText::willBeDestroyed):
        (WebCore::RenderText::inlineWrapperForDisplayContents):
        (WebCore::RenderText::setInlineWrapperForDisplayContents):

            Add a weak member (implemented as a rare data map) for holding the wrapper pointer.

        (WebCore::RenderText::findByDisplayContentsInlineWrapperCandidate):

            Helper to get the text renderer for a wrapper.

        * rendering/RenderText.h:
        * style/RenderTreeUpdater.cpp:
        (WebCore::createTextRenderer):
        (WebCore::RenderTreeUpdater::updateTextRenderer):

            Create the wrapper if needed.

        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::resolveComposedTree):

            Compute the wrapper style by inheriting from the display:contents parent.

        * style/StyleUpdate.h:
        (WebCore::Style::TextUpdate::TextUpdate):

2017-10-17  Alicia Boya García  <aboya@igalia.com>

        [MSE][GStreamer] Insert parser elements in AppendPipeline when demuxing opus or Vorbis
        https://bugs.webkit.org/show_bug.cgi?id=178076

        Reviewed by Xabier Rodriguez-Calvar.

        YouTube does not include durations in the WebM container for files
        containing Opus audio, so we need to read them from the contained
        stream. Fortunately, GStreamer has an element to do that: opusparse.

        The same thing happens with Vorbis contained in WebM files from the
        W3C tests, which should also be fixed by the GStreamer element
        vorbisparse.

        This patch adds an opusparse or vorbisparse element to the
        AppendPipeline at the sinkpad of the demuxer when either is found.

        Tests: updated expectations.

        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::AppendPipeline::appsinkNewSample):
        (WebCore::createOptionalParserForFormat):
        (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
        (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
        * platform/graphics/gstreamer/mse/AppendPipeline.h:
        * platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp:
        (WebCore::GStreamerMediaSample::GStreamerMediaSample):
        * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
        (WebCore::PlaybackPipeline::attachTrack):

2017-10-17  Ms2ger  <Ms2ger@igalia.com>

        Add WebGL2 texImage3D overloads.
        https://bugs.webkit.org/show_bug.cgi?id=178119

        Reviewed by Ryosuke Niwa.

        No new tests: not much point in adding tests now; this method doesn't
        do anything anyway.

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::texImage3D):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:

2017-10-17  Antti Koivisto  <antti@apple.com>

        Resolve ::before and ::after pseudo elements during style resolution
        https://bugs.webkit.org/show_bug.cgi?id=178339

        Reviewed by Ryosuke Niwa.

        They are currently resolved during render tree building which creates problems with display:contents and animations.

        * dom/PseudoElement.cpp:
        (WebCore::PseudoElement::PseudoElement):

            Call InspectorInstrumentation from constructor.

        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::Parent::Parent):
        (WebCore::RenderTreeUpdater::updateRenderTree):
        (WebCore::RenderTreeUpdater::pushParent):

            Push the full update to the parent stack.

        (WebCore::RenderTreeUpdater::popParent):
        (WebCore::RenderTreeUpdater::updateBeforeDescendants):
        (WebCore::RenderTreeUpdater::updateAfterDescendants):
        (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
        * style/RenderTreeUpdater.h:
        * style/RenderTreeUpdaterGeneratedContent.cpp:
        (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):

            No need to resolve pseudo style, we have it already.

        (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
        (WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement): Deleted.
        (WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement): Deleted.
        * style/RenderTreeUpdaterGeneratedContent.h:
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::resolveElement):
        (WebCore::Style::TreeResolver::resolvePseudoStyle):

            Resolve pseudos.

        (WebCore::Style::TreeResolver::createAnimatedElementUpdate):

            Make a private member function.

        (WebCore::Style::TreeResolver::resolveComposedTree):
        * style/StyleTreeResolver.h:
        * style/StyleUpdate.cpp:
        (WebCore::Style::Update::elementUpdates const):
        (WebCore::Style::Update::elementUpdates):

            Bundle the style update for an element and the associated before/after pseudos.

        (WebCore::Style::Update::elementStyle const):
        (WebCore::Style::Update::elementStyle):
        (WebCore::Style::Update::addElement):
        (WebCore::Style::Update::elementUpdate const): Deleted.
        (WebCore::Style::Update::elementUpdate): Deleted.
        * style/StyleUpdate.h:

2017-10-17  Keith Miller  <keith_miller@apple.com>

        Change WebCore sources to work with unified source builds
        https://bugs.webkit.org/show_bug.cgi?id=178229

        Rubber stamped by Tim Horton.

        This patch does the following:

        1) Move all “using namespace <name>;” into the WebCore namespace
        (They used to go in the global namespace) and change to "using
        WebCore::<name>;” in .mm files.

        2) Move a bunch of the soft linking library/framework macros out
        of the .mm files since those caused name collision problems.

        3) Fix minor other naming collisions.

        The problem with 1 in a unified source world is generic names
        often collide with system header names. For example, WebCore has a
        Rect class and that collided with a system header type elsewhere.

        This patch shouldn't change behavior so no new tests.

        * Configurations/FeatureDefines.xcconfig:
        * Modules/cache/CacheStorageConnection.cpp:
        * Modules/cache/DOMCache.cpp:
        * Modules/cache/DOMCacheStorage.cpp:
        * Modules/cache/WorkerCacheStorageConnection.cpp:
        * Modules/encryptedmedia/InitDataRegistry.cpp:
        * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
        * Modules/indexeddb/IDBCursor.cpp:
        * Modules/indexeddb/IDBFactory.cpp:
        * Modules/indexeddb/IDBIndex.cpp:
        * Modules/indexeddb/IDBKeyRange.cpp:
        * Modules/indexeddb/IDBObjectStore.cpp:
        * Modules/indexeddb/IDBRequest.cpp:
        * Modules/indexeddb/IDBTransaction.cpp:
        * Modules/indexeddb/server/MemoryObjectStore.cpp:
        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::setReadyState):
        (WebCore::toString): Deleted.
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        * Modules/plugins/QuickTimePluginReplacement.mm:
        (WebCore::jsValueWithAVMetadataItemInContext):
        * Modules/webdriver/NavigatorWebDriver.cpp:
        * PlatformAppleWin.cmake:
        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * accessibility/ios/AccessibilityObjectIOS.mm:
        (-[WAKView accessibilityIsIgnored]): Deleted.
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WAKView accessibilityIsIgnored]):
        * accessibility/win/AXObjectCacheWin.cpp:
        * bindings/js/CommonVM.cpp:
        * bindings/js/DOMWrapperWorld.cpp:
        * bindings/js/GCController.cpp:
        * bindings/js/IDBBindingUtilities.cpp:
        * bindings/js/JSAudioTrackCustom.cpp:
        * bindings/js/JSAudioTrackListCustom.cpp:
        * bindings/js/JSBlobCustom.cpp:
        * bindings/js/JSCSSRuleCustom.cpp:
        * bindings/js/JSCSSRuleListCustom.cpp:
        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
        * bindings/js/JSCallbackData.cpp:
        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
        * bindings/js/JSCustomElementInterface.cpp:
        * bindings/js/JSCustomElementRegistryCustom.cpp:
        * bindings/js/JSCustomEventCustom.cpp:
        * bindings/js/JSDOMBindingSecurity.cpp:
        * bindings/js/JSDOMBuiltinConstructorBase.cpp:
        * bindings/js/JSDOMConstructorBase.cpp:
        * bindings/js/JSDOMConstructorWithDocument.cpp:
        * bindings/js/JSDOMConvertDate.cpp:
        * bindings/js/JSDOMConvertNumbers.cpp:
        * bindings/js/JSDOMConvertStrings.cpp:
        * bindings/js/JSDOMConvertWebGL.cpp:
        * bindings/js/JSDOMExceptionHandling.cpp:
        * bindings/js/JSDOMGlobalObject.cpp:
        * bindings/js/JSDOMGlobalObjectTask.cpp:
        * bindings/js/JSDOMGuardedObject.cpp:
        * bindings/js/JSDOMPromiseDeferred.cpp:
        * bindings/js/JSDOMQuadCustom.cpp:
        * bindings/js/JSDOMWindowBase.cpp:
        * bindings/js/JSDOMWindowCustom.cpp:
        * bindings/js/JSDOMWindowProxy.cpp:
        * bindings/js/JSDOMWrapper.cpp:
        * bindings/js/JSDOMWrapperCache.cpp:
        * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
        * bindings/js/JSDocumentCustom.cpp:
        * bindings/js/JSDocumentFragmentCustom.cpp:
        * bindings/js/JSElementCustom.cpp:
        * bindings/js/JSErrorHandler.cpp:
        * bindings/js/JSEventCustom.cpp:
        * bindings/js/JSEventListener.cpp:
        * bindings/js/JSEventTargetCustom.cpp:
        * bindings/js/JSFileSystemEntryCustom.cpp:
        * bindings/js/JSHTMLCollectionCustom.cpp:
        * bindings/js/JSHTMLDocumentCustom.cpp:
        * bindings/js/JSHTMLTemplateElementCustom.cpp:
        * bindings/js/JSHistoryCustom.cpp:
        * bindings/js/JSIDBCursorCustom.cpp:
        * bindings/js/JSIDBCursorWithValueCustom.cpp:
        * bindings/js/JSIDBIndexCustom.cpp:
        * bindings/js/JSIDBObjectStoreCustom.cpp:
        * bindings/js/JSIDBTransactionCustom.cpp:
        * bindings/js/JSImageDataCustom.cpp:
        * bindings/js/JSLazyEventListener.cpp:
        * bindings/js/JSLocationCustom.cpp:
        * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
        * bindings/js/JSMessageEventCustom.cpp:
        * bindings/js/JSMessagePortCustom.cpp:
        * bindings/js/JSMutationObserverCustom.cpp:
        * bindings/js/JSNodeCustom.cpp:
        * bindings/js/JSNodeListCustom.cpp:
        * bindings/js/JSPerformanceEntryCustom.cpp:
        * bindings/js/JSPluginElementFunctions.cpp:
        * bindings/js/JSPopStateEventCustom.cpp:
        * bindings/js/JSReadableStreamPrivateConstructors.cpp:
        * bindings/js/JSReadableStreamSourceCustom.cpp:
        * bindings/js/JSSVGPathSegCustom.cpp:
        * bindings/js/JSTextTrackCueCustom.cpp:
        * bindings/js/JSTextTrackCustom.cpp:
        * bindings/js/JSTextTrackListCustom.cpp:
        * bindings/js/JSTrackCustom.cpp:
        * bindings/js/JSVideoTrackCustom.cpp:
        * bindings/js/JSVideoTrackListCustom.cpp:
        * bindings/js/JSWebGL2RenderingContextCustom.cpp:
        * bindings/js/JSWebGLRenderingContextCustom.cpp:
        * bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp:
        * bindings/js/JSWebGPURenderingContextCustom.cpp:
        * bindings/js/JSWorkerGlobalScopeBase.cpp:
        * bindings/js/JSWorkerGlobalScopeCustom.cpp:
        * bindings/js/JSXMLHttpRequestCustom.cpp:
        * bindings/js/JSXPathNSResolverCustom.cpp:
        * bindings/js/ReadableStream.cpp:
        (WebCore::ReadableStream::pipeTo):
        (WebCore::ReadableStream::tee):
        (WebCore::checkReadableStream):
        (WebCore::callFunction): Deleted.
        * bindings/js/ScheduledAction.cpp:
        * bindings/js/ScriptCachedFrameData.cpp:
        * bindings/js/ScriptController.cpp:
        * bindings/js/SerializedScriptValue.cpp:
        * bindings/js/StructuredClone.cpp:
        * bindings/js/WebCoreJSClientData.cpp:
        * bindings/js/WorkerScriptController.cpp:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateEnumerationImplementation):
        (GenerateImplementation):
        (GenerateDictionaryImplementation):
        (GenerateCallbackFunctionImplementation):
        (GenerateCallbackInterfaceImplementation):
        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        * bindings/scripts/test/JS/JSMapLike.cpp:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        * bindings/scripts/test/JS/JSTestCallTracer.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        * bindings/scripts/test/JS/JSTestException.cpp:
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
        * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
        * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
        * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
        * bindings/scripts/test/JS/JSTestStringifier.cpp:
        * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
        * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
        * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
        * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
        * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
        * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
        * bridge/IdentifierRep.cpp:
        * bridge/NP_jsobject.cpp:
        (ObjectMap::get): Deleted.
        (ObjectMap::add): Deleted.
        (ObjectMap::remove): Deleted.
        (objectMap): Deleted.
        (ObjectMap::RootObjectInvalidationCallback::operator()): Deleted.
        (getListFromVariantArgs): Deleted.
        (jsAllocate): Deleted.
        (jsDeallocate): Deleted.
        (_NPN_CreateNoScriptObject): Deleted.
        (_NPN_InvokeDefault): Deleted.
        (_NPN_Invoke): Deleted.
        (_NPN_Evaluate): Deleted.
        (_NPN_GetProperty): Deleted.
        (_NPN_SetProperty): Deleted.
        (_NPN_RemoveProperty): Deleted.
        (_NPN_HasProperty): Deleted.
        (_NPN_HasMethod): Deleted.
        (_NPN_SetException): Deleted.
        (_NPN_Enumerate): Deleted.
        (_NPN_Construct): Deleted.
        * bridge/NP_jsobject.h:
        * contentextensions/ContentExtensionParser.cpp:
        * crypto/SubtleCrypto.cpp:
        * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
        (WebCore::CryptoAlgorithmAES_CBC::encrypt):
        (WebCore::CryptoAlgorithmAES_CBC::decrypt):
        (WebCore::CryptoAlgorithmAES_CBC::importKey):
        (WebCore::CryptoAlgorithmAES_CBC::exportKey):
        * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
        (WebCore::CryptoAlgorithmAES_CFB::encrypt):
        (WebCore::CryptoAlgorithmAES_CFB::decrypt):
        (WebCore::CryptoAlgorithmAES_CFB::importKey):
        (WebCore::CryptoAlgorithmAES_CFB::exportKey):
        * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
        (WebCore::parametersAreValid):
        (WebCore::CryptoAlgorithmAES_CTR::importKey):
        (WebCore::CryptoAlgorithmAES_CTR::exportKey):
        * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
        (WebCore::tagLengthIsValid):
        (WebCore::CryptoAlgorithmAES_GCM::encrypt):
        (WebCore::CryptoAlgorithmAES_GCM::decrypt):
        (WebCore::CryptoAlgorithmAES_GCM::importKey):
        (WebCore::CryptoAlgorithmAES_GCM::exportKey):
        * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
        (WebCore::CryptoAlgorithmAES_KW::importKey):
        (WebCore::CryptoAlgorithmAES_KW::exportKey):
        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
        (WebCore::CryptoAlgorithmHMAC::importKey):
        (WebCore::CryptoAlgorithmHMAC::exportKey):
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
        (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
        (WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
        * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
        (WebCore::CryptoAlgorithmRSA_PSS::importKey):
        (WebCore::CryptoAlgorithmRSA_PSS::exportKey):
        * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
        (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
        (WebCore::commonCryptoHMACAlgorithm): Deleted.
        * css/CSSBasicShapes.cpp:
        * css/CSSPrimitiveValue.cpp:
        * css/parser/CSSParser.cpp:
        * css/parser/CSSPropertyParser.cpp:
        * css/parser/CSSPropertyParserHelpers.cpp:
        (WebCore::CSSPropertyParserHelpers::positionFromThreeOrFourValues):
        (WebCore::CSSPropertyParserHelpers::consumePosition):
        (WebCore::CSSPropertyParserHelpers::createPrimitiveValuePair): Deleted.
        * dom/DOMQuad.cpp:
        * dom/Document.cpp:
        * dom/ErrorEvent.cpp:
        * dom/EventListenerMap.cpp:
        * dom/EventTarget.cpp:
        * dom/PromiseRejectionEvent.cpp:
        * dom/RejectedPromiseTracker.cpp:
        * dom/ScriptExecutionContext.cpp:
        * domjit/JSDocumentDOMJIT.cpp:
        * domjit/JSDocumentFragmentDOMJIT.cpp:
        * domjit/JSElementDOMJIT.cpp:
        * domjit/JSEventDOMJIT.cpp:
        * domjit/JSNodeDOMJIT.cpp:
        * editing/TextIterator.cpp:
        * editing/cocoa/HTMLConverter.mm:
        * history/CachedPage.cpp:
        * html/HTMLCanvasElement.cpp:
        * html/HTMLFontElement.cpp:
        * html/HTMLMediaElement.cpp:
        * html/HTMLSelectElement.cpp:
        * html/TypeAhead.cpp:
        * html/parser/HTMLSrcsetParser.cpp:
        (WebCore::tokenizeDescriptors):
        * html/parser/HTMLTokenizer.cpp:
        * html/parser/ParsingUtilities.h:
        (WebCore::isNotASCIISpace):
        * html/parser/XSSAuditorDelegate.cpp:
        * html/track/DataCue.cpp:
        * inspector/CommandLineAPIHost.cpp:
        * inspector/CommandLineAPIModule.cpp:
        * inspector/InspectorApplicationCacheAgent.cpp:
        * inspector/InspectorCSSAgent.cpp:
        * inspector/InspectorCanvas.cpp:
        * inspector/InspectorCanvasAgent.cpp:
        * inspector/InspectorClient.cpp:
        * inspector/InspectorController.cpp:
        * inspector/InspectorDOMAgent.cpp:
        * inspector/InspectorDOMDebuggerAgent.cpp:
        * inspector/InspectorDOMStorageAgent.cpp:
        * inspector/InspectorDatabaseAgent.cpp:
        * inspector/InspectorDatabaseResource.cpp:
        * inspector/InspectorFrontendClientLocal.cpp:
        * inspector/InspectorFrontendHost.cpp:
        * inspector/InspectorIndexedDBAgent.cpp:
        * inspector/InspectorInstrumentation.cpp:
        * inspector/InspectorLayerTreeAgent.cpp:
        * inspector/InspectorMemoryAgent.cpp:
        * inspector/InspectorNetworkAgent.cpp:
        * inspector/InspectorOverlay.cpp:
        * inspector/InspectorPageAgent.cpp:
        * inspector/InspectorShaderProgram.cpp:
        * inspector/InspectorStyleSheet.cpp:
        * inspector/InspectorTimelineAgent.cpp:
        * inspector/InspectorWorkerAgent.cpp:
        * inspector/InstrumentingAgents.cpp:
        * inspector/NetworkResourcesData.cpp:
        * inspector/PageConsoleAgent.cpp:
        * inspector/PageDebuggerAgent.cpp:
        * inspector/PageHeapAgent.cpp:
        * inspector/PageRuntimeAgent.cpp:
        * inspector/PageScriptDebugServer.cpp:
        * inspector/TimelineRecordFactory.cpp:
        * inspector/WebConsoleAgent.cpp:
        * inspector/WebDebuggerAgent.cpp:
        * inspector/WebHeapAgent.cpp:
        * inspector/WebInjectedScriptHost.cpp:
        * inspector/WebInjectedScriptManager.cpp:
        * inspector/WorkerConsoleAgent.cpp:
        * inspector/WorkerDebuggerAgent.cpp:
        * inspector/WorkerInspectorController.cpp:
        * inspector/WorkerRuntimeAgent.cpp:
        * inspector/WorkerScriptDebugServer.cpp:
        * loader/FTPDirectoryParser.cpp:
        * loader/TextResourceDecoder.cpp:
        * loader/cache/CachedResource.cpp:
        * loader/cache/CachedResourceLoader.cpp:
        * page/ContextMenuController.cpp:
        * page/DOMWindow.cpp:
        * page/Navigator.cpp:
        * page/PageConsoleClient.cpp:
        * page/PageDebuggable.cpp:
        * page/cocoa/ResourceUsageOverlayCocoa.mm:
        * page/csp/ContentSecurityPolicy.cpp:
        * page/csp/ContentSecurityPolicyDirectiveList.cpp:
        (WebCore::isNotASCIISpace): Deleted.
        * page/csp/ContentSecurityPolicyMediaListDirective.cpp:
        (WebCore::isNotASCIISpace): Deleted.
        * page/scrolling/ios/ScrollingTreeIOS.cpp:
        * page/scrolling/ios/ScrollingTreeIOS.h:
        * page/scrolling/mac/ScrollingTreeFixedNode.mm:
        (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
        (WebCore::operator*): Deleted.
        * page/scrolling/mac/ScrollingTreeStickyNode.mm:
        (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
        (WebCore::operator*): Deleted.
        * platform/Length.cpp:
        * platform/URL.cpp:
        (WebCore::isSchemeFirstChar):
        (WebCore::isSchemeChar):
        (WebCore::isBadChar):
        (WebCore::isTabNewline):
        * platform/audio/WebAudioBufferList.cpp:
        (WebCore::WebAudioBufferList::WebAudioBufferList):
        * platform/audio/mac/AudioSampleDataSource.mm:
        (WebCore::AudioSampleDataSource::pushSamples):
        * platform/cf/CoreMediaSoftLink.cpp: Removed.
        * platform/cf/CoreMediaSoftLink.h: Removed.
        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        * platform/graphics/FloatPolygon.cpp:
        (WebCore::areCollinearPoints):
        (WebCore::FloatPolygon::FloatPolygon):
        (WebCore::VertexPair::intersection const):
        (WebCore::determinant): Deleted.
        * platform/graphics/FontCache.cpp:
        * platform/graphics/FontCascade.cpp:
        * platform/graphics/GraphicsContext3DPrivate.cpp:
        * platform/graphics/WidthIterator.cpp:
        * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
        (WebCore::AudioSourceProviderAVFObjC::process):
        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
        (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
        (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
        (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
        * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
        (WebCore::assetTrackMeetsHardwareDecodeRequirements):
        * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
        (WebCore::ImageDecoderAVFObjC::readSampleMetadata):
        (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
        (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
        * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        * platform/graphics/cairo/ImageBufferCairo.cpp:
        * platform/graphics/cg/ImageBufferCG.cpp:
        (WebCore::ImageBuffer::ImageBuffer):
        (WebCore::releaseImageData): Deleted.
        * platform/graphics/cg/ImageBufferDataCG.h:
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        * platform/graphics/opentype/OpenTypeMathData.cpp:
        * platform/graphics/opentype/OpenTypeVerticalData.cpp:
        * platform/graphics/transforms/MatrixTransformOperation.cpp:
        (WebCore::MatrixTransformOperation::blend):
        (WebCore::createOperation): Deleted.
        * platform/graphics/win/FontPlatformDataCairoWin.cpp:
        * platform/graphics/win/FontWin.cpp:
        * platform/graphics/win/GraphicsContextCGWin.cpp:
        * platform/graphics/win/GraphicsContextCairoWin.cpp:
        * platform/graphics/win/GraphicsContextDirect2D.cpp:
        * platform/graphics/win/GraphicsContextWin.cpp:
        * platform/graphics/win/UniscribeController.cpp:
        * platform/image-decoders/ScalableImageDecoder.cpp:
        (): Deleted.
        * platform/ios/LegacyTileLayer.mm:
        (-[LegacyTileHostLayer renderInContext:]):
        * platform/ios/PlaybackSessionInterfaceAVKit.mm:
        * platform/ios/ScrollAnimatorIOS.mm:
        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
        * platform/ios/WebAVPlayerController.mm:
        (-[WebAVPlayerController skipBackwardThirtySeconds:]):
        (-[WebAVPlayerController gotoEndOfSeekableRanges:]):
        (-[WebAVPlayerController canSeekToBeginning]):
        (-[WebAVPlayerController canSeekToEnd]):
        (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]):
        (-[WebAVPlayerController updateMinMaxTiming]):
        * platform/ios/WebEvent.mm:
        * platform/ios/WebItemProviderPasteboard.mm:
        * platform/ios/wak/WKContentObservation.cpp:
        * platform/mac/KeyEventMac.mm:
        * platform/mac/PlaybackSessionInterfaceMac.mm:
        (WebCore::timeRangesToArray):
        * platform/mac/ScrollAnimatorMac.mm:
        (macScrollbarTheme): Deleted.
        (scrollerImpForScrollbar): Deleted.
        * platform/mac/ScrollbarThemeMac.mm:
        (WebCore::scrollbarMap):
        * platform/mac/VideoFullscreenInterfaceMac.mm:
        * platform/mac/WebCoreFullScreenPlaceholderView.mm:
        * platform/mac/WebCoreNSURLExtras.mm:
        (WebCore::dataForURLComponentType):
        * platform/mac/WebPlaybackControlsManager.mm:
        * platform/mac/WebVideoFullscreenController.mm:
        (SOFT_LINK_CLASS): Deleted.
        * platform/mac/WebVideoFullscreenHUDWindowController.mm:
        * platform/mac/WebWindowAnimation.mm:
        (WebWindowAnimationDurationFromDuration): Deleted.
        (scaledRect): Deleted.
        (squaredDistance): Deleted.
        * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::applyFrameRate):
        (WebCore::AVVideoCaptureSource::processNewFrame):
        * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
        * platform/mediastream/mac/CoreAudioCaptureDevice.cpp:
        * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
        (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
        * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
        * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp:
        * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
        * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
        * platform/network/HTTPParsers.cpp:
        * platform/text/LocaleICU.cpp:
        * platform/text/TextCodecLatin1.cpp:
        * platform/text/TextCodecUTF8.cpp:
        * platform/text/TextEncodingRegistry.cpp:
        * platform/text/win/LocaleWin.cpp:
        * platform/win/BString.cpp:
        * platform/win/KeyEventWin.cpp:
        * platform/win/ScrollbarThemeWin.cpp:
        * rendering/BidiRun.cpp:
        * rendering/FloatingObjects.cpp:
        * rendering/RenderBlock.cpp:
        * rendering/RenderListMarker.cpp:
        * rendering/RenderQuote.cpp:
        * rendering/RenderText.cpp:
        * rendering/RenderThemeWin.cpp:
        * testing/Internals.cpp:
        * testing/js/WebCoreTestSupport.cpp:
        * workers/WorkerConsoleClient.cpp:
        * workers/WorkerGlobalScope.cpp:
        * workers/WorkerInspectorProxy.cpp:
        * xml/SoftLinkLibxslt.cpp: Added.
        * xml/SoftLinkLibxslt.h: Added.
        * xml/XPathGrammar.cpp:
        * xml/XPathParser.cpp:
        * xml/XSLStyleSheetLibxslt.cpp:
        * xml/XSLTExtensions.cpp:
        * xml/XSLTProcessorLibxslt.cpp:
        * xml/XSLTUnicodeSort.cpp:
        (xsltTransformErrorTrampoline):
        (WebCore::xsltUnicodeSortFunction):
        * xml/parser/XMLDocumentParser.cpp:
        (WebCore::XMLDocumentParser::updateLeafTextNode):
        (WebCore::toString): Deleted.

2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        Allow reading data and blob URLs via DataTransfer when the pasteboard contains files
        https://bugs.webkit.org/show_bug.cgi?id=178377

        Reviewed by Ryosuke Niwa.

        Adds data and blob URLs, alongside http(s), as URL protocols safe to expose to bindings.

        Test: editing/pasteboard/drag-drop-href-as-url.html

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

2017-10-16  Ryosuke Niwa  <rniwa@webkit.org>

        Strip away event handlers and JavaScript URLs when copying
        https://bugs.webkit.org/show_bug.cgi?id=178375

        Reviewed by Wenson Hsieh.

        Don't serialize event handlers and URLs with javascript protocol when serializing HTML
        since they're not safe to be pasted elsewhere.

        Test: editing/pasteboard/copying-html-strips-javascript-url-and-event-handler.html

        * dom/Element.cpp:
        (WebCore::Element::isEventHandlerAttribute const):
        (WebCore::isEventHandlerAttribute): Deleted.
        * dom/Element.h:
        * editing/markup.cpp:
        (WebCore::StyledMarkupAccumulator::appendElement):

2017-10-16  Dean Jackson  <dino@apple.com>

        WebGL clamps drawingBufferWidth to 4096 pixels on a 5120 monitor/canvas
        https://bugs.webkit.org/show_bug.cgi?id=178223
        <rdar://problem/34597567>

        Reviewed by Antoine Quint.

        Remove the limit of 4k on the width/height of the renderbuffer.

        Test: fast/canvas/webgl/large-drawing-buffer-resize.html

        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::reshape):

2017-10-16  Ryosuke Niwa  <rniwa@webkit.org>

        Assert that Node::insertedInto doesn't fire an event
        https://bugs.webkit.org/show_bug.cgi?id=178376
        <rdar://problem/35022857>

        Reviewed by Daniel Bates.

        Fixed the assertion in notifyChildNodeInserted since this function MUST NOT dispatch an event,
        and moved a bunch of event-dispatching code from Node::insertedInto into Node::finishedInsertingSubtree.

        No new tests since the existing tests cover the behavioral change.

        * dom/ContainerNodeAlgorithms.cpp:
        (WebCore::notifyChildNodeInserted): Fixed the assertion.
        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::insertedInto):
        (WebCore::ProcessingInstruction::finishedInsertingSubtree): Extracted from insertedInto since
        checkStyleSheet can dispatch an event.
        * dom/ProcessingInstruction.h:
        * html/HTMLBodyElement.cpp:
        (WebCore::HTMLBodyElement::insertedInto):
        (WebCore::HTMLBodyElement::finishedInsertingSubtree): Extracted from insertedInto since
        setIntegralAttribute could dispatch DOMAttrModified synchronously.
        * html/HTMLBodyElement.h:

2017-10-16  Chris Dumez  <cdumez@apple.com>

        ServiceWorkerRegistration should subclass RefCounted<>
        https://bugs.webkit.org/show_bug.cgi?id=178374

        Reviewed by Ryosuke Niwa.

        ServiceWorkerRegistration should subclass RefCounted<> or we end up with an infinite recursion
        when constructing such object. This is because ServiceWorkerRegistration subclasses
        EventTargetWithInlineData which implements ref() / deref() by calling refEventTarget() /
        derefEventTarget(). refEventTarget() / derefEventTarget() are implemented in
        ServiceWorkerRegistration so that they call ref() / deref() (which ends up being EventTarget's
        methods).

        * workers/service/ServiceWorkerRegistration.h:

2017-10-16  Jer Noble  <jer.noble@apple.com>

        ImageDecoderAVFObjC fails to create more CMSampleBuffers after creating about 32MB worth.
        https://bugs.webkit.org/show_bug.cgi?id=178360

        Reviewed by Eric Carlson.

        AVSampleBufferGenerator has a constrained memory pool of about 32MB in size. Once
        CMSampleBuffers representing about 32MB of memory are allocated, no more can be created
        until previously created ones are released. So rather than (only) creating the sample
        buffers up front in readSampleMetadata(), also create them dynamically, if missing, in
        createFrameImageAtIndex(...) and release them in storeSampleBuffer(...) after they have been
        decoded.

        Drive-by fix: the expected content length was never actually set by the owner of ImageDecoderAVFObjC.
        Now that the expected content length is available, we don't have to wait until the data is complete
        to respond to requests.

        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::ensureDecoderAvailable):
        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
        (SOFT_LINK_POINTER_OPTIONAL):
        (-[WebCoreSharedBufferResourceLoaderDelegate canFulfillRequest:]):
        (-[WebCoreSharedBufferResourceLoaderDelegate fulfillRequest:]):
        (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
        (WebCore::imageDecoderAssetOptions):
        (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
        (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
        (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
        (WebCore::ImageDecoderAVFObjC::setExpectedContentSize):

2017-10-12  Matt Rajca  <mrajca@apple.com>

        Add API support for quirk that lets an arbitrary click allow auto-play.
        https://bugs.webkit.org/show_bug.cgi?id=178227

        Reviewed by Alex Christensen.

        Added API test.
        
        Instead of hardcoding sites in WebCore, let API clients control which websites opt into the quirk that lets
        an arbitrary click allow auto-play via website policies.

        * html/MediaElementSession.cpp:
        (WebCore::needsArbitraryUserGestureAutoplayQuirk):
        * loader/DocumentLoader.h:

2017-10-16  Chris Dumez  <cdumez@apple.com>

        DOMQuad.p1 / p2 / p3 / p4 should behave as [SameObject]
        https://bugs.webkit.org/show_bug.cgi?id=178366

        Reviewed by Youenn Fablet.

        DOMQuad.p1 / p2 / p3 / p4 should behave as [SameObject]. We attempted to do so using JSDOMQuad::visitAdditionalChildren()
        but the code did not work because we failed to generate a "isReachableFromOpaqueRoots()" function for JSDOMPoint.

        Test: fast/css/DOMQuad-points-SameObject.html

        * dom/DOMPoint.idl:

2017-10-16  Andy Estes  <aestes@apple.com>

        [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
        https://bugs.webkit.org/show_bug.cgi?id=178191
        <rdar://problem/34906367>

        Reviewed by Tim Horton.

        Added test cases to http/tests/ssl/applepay/ApplePaySession.html.

        * Modules/applepay/ApplePayError.idl:
        * Modules/applepay/ApplePayPaymentContact.h:
        * Modules/applepay/ApplePayPaymentContact.idl:
        * Modules/applepay/ApplePaySessionPaymentRequest.h:
        * Modules/applepay/cocoa/PaymentContactCocoa.mm:
        (WebCore::subLocality):
        (WebCore::setSubLocality):
        (WebCore::subAdministrativeArea):
        (WebCore::setSubAdministrativeArea):
        (WebCore::convert):

2017-10-16  Alex Christensen  <achristensen@webkit.org>

        Allow modern decoding of URLs
        https://bugs.webkit.org/show_bug.cgi?id=178265

        Reviewed by Chris Dumez.

        * platform/URL.h:
        (WebCore::URL::decode):

2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r223425.

        This change broke internal builds.

        Reverted changeset:

        "Remove unnecessary include from Document.h"
        https://bugs.webkit.org/show_bug.cgi?id=178247
        https://trac.webkit.org/changeset/223425

2017-10-16  Maureen Daum  <mdaum@apple.com>

        If an origin doesn't have databases in the Databases table we should still remove its information from disk in DatabaseTracker::deleteOrigin()
        https://bugs.webkit.org/show_bug.cgi?id=178281
        <rdar://problem/34576132>

        Reviewed by Brent Fulgham.

        New test:
        DatabaseTracker.DeleteOriginWithMissingEntryInDatabasesTable

        * Modules/webdatabase/DatabaseTracker.cpp:
        (WebCore::DatabaseTracker::deleteOrigin):
        If databaseNames is empty, don't bail early. Instead, delete everything in the directory
        containing the databases for this origin. This condition indicates that we previously
        tried to remove the origin but didn't get all of the way through the deletion process.
        Because we have lost track of the databases for this origin, we can assume that no
        other process is accessing them. This means it should be safe to delete them outright.

2017-10-16  Youenn Fablet  <youenn@apple.com>

        [FETCH] Remove Request.type getter
        https://bugs.webkit.org/show_bug.cgi?id=177798

        Reviewed by Chris Dumez.

        Tests: imported/w3c/web-platform-tests/fetch/api/request/request-type-attribute-historical.html
               imported/w3c/web-platform-tests/fetch/api/request/url-encoding.html

        Removing FetchRequest type getter.
        Merging Type and Destination as per https://fetch.spec.whatwg.org/#concept-request-destination.
        Setting destination of request within CachedResourceLoader as this will be useful to Service Workers.

        * Modules/fetch/FetchRequest.h:
        * Modules/fetch/FetchRequest.idl:
        * loader/FetchOptions.h:
        (WebCore::FetchOptions::isolatedCopy const):
        (WebCore::FetchOptions::FetchOptions):
        (WebCore::FetchOptions::encode const):
        (WebCore::FetchOptions::decode):
        * loader/ThreadableLoader.cpp:
        (WebCore::ThreadableLoaderOptions::isolatedCopy const):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestImage):
        (WebCore::CachedResourceLoader::requestFont):
        (WebCore::CachedResourceLoader::requestTextTrack):
        (WebCore::CachedResourceLoader::requestCSSStyleSheet):
        (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
        (WebCore::CachedResourceLoader::requestScript):
        (WebCore::CachedResourceLoader::requestXSLStyleSheet):
        (WebCore::CachedResourceLoader::requestMedia):
        (WebCore::CachedResourceLoader::requestIcon):
        (WebCore::CachedResourceLoader::requestRawResource):
        (WebCore::CachedResourceLoader::requestBeaconResource):
        (WebCore::CachedResourceLoader::requestMainResource):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::setDestinationIfNotSet):
        * loader/cache/CachedResourceRequest.h:

2017-10-15  Ryosuke Niwa  <rniwa@webkit.org>

        Cannot access images included in the content pasted from Microsoft Word
        https://bugs.webkit.org/show_bug.cgi?id=124391
        <rdar://problem/26862741>

        Reviewed by Antti Koivisto.

        The bug is caused by the fact Microsoft Word generates HTML content which references an image using file URL.
        Because the websites don't have access to arbtirary file URLs, this prevents editors such as TinyMCE to save
        those images.

        This patch fixes the problem by converting file URLs for images and all other subresources in the web archive
        generated by Microsoft Word by blob URLs like r222839 for RTF/RTFD and r222119 for images.

        To avoid revealing privacy sensitive information such as the absolute local file path to the user's home directory
        Microsoft Word and other applications in the system includes in the web archive placed in the system pasteboard,
        this patch also introduces the mechanism to sanitize when the HTML content is read by DataTransfer's getData.

        This patch also introduces the sanitization for when writing HTML into the pasteboard since other applications
        in the syste which is capable to processing web archives are not necessarily equipped to pretect itself and the
        rest of the system from potentially dangerous JavaScript included in the web archive placed in the system pasteboard.

        Finally, this patch expands the list of clipboard types that are exposed as "text/html" to the Web platform by
        adding the capability to convert RTF, RTFD, and web archive into HTML markup by introducing WebContentMarkupReader,
        a new subclass of PasteboardWebContentReader which creates a HTML markup instead of a document fragment. Most of
        the sanitization process happens in this new class, and will be expanded to WebContentReader to make pasting safer.

        Tests: editing/pasteboard/data-transfer-get-data-on-pasting-html-uses-blob-url.html
               editing/pasteboard/data-transfer-set-data-sanitizes-html-when-copying-in-null-origin.html
               editing/pasteboard/data-transfer-set-data-sanitizes-html-when-copying.html
               editing/pasteboard/data-transfer-set-data-sanitlize-html-when-dragging-in-null-origin.html
               http/tests/security/clipboard/copy-paste-html-across-origin-sanitizes-html.html
               CopyHTML.Sanitizes
               DataInteractionTests.DataTransferSanitizeHTML
               PasteRTF.ExposesHTMLTypeInDataTransfer
               PasteRTFD.ExposesHTMLTypeInDataTransfer
               PasteRTFD.ImageElementUsesBlobURLInHTML
               PasteWebArchive.ExposesHTMLTypeInDataTransfer

        * dom/DataTransfer.cpp:
        (WebCore::originIdentifierForDocument): Moved to Document::originIdentifierForPasteboard.
        (WebCore::DataTransfer::createForCopyAndPaste):
        (WebCore::DataTransfer::getDataForItem const): Use WebContentMarkupReader read HTMl content so that we can read
        web arhive, RTF, and RTFD as text/html.
        (WebCore::DataTransfer::getData const):
        (WebCore::DataTransfer::setData):
        (WebCore::DataTransfer::setDataFromItemList): Sanitize the HTML before placing into the system pasteboard.
        (WebCore::DataTransfer::createForDragStartEvent):
        (WebCore::DataTransfer::createForDrop):
        (WebCore::DataTransfer::createForUpdatingDropTarget):
        * dom/DataTransfer.h:
        * dom/DataTransfer.idl:
        * dom/DataTransferItem.cpp:
        (WebCore::DataTransferItem::getAsString const):
        * dom/Document.cpp:
        (WebCore::Document::originIdentifierForPasteboard): Renamed from uniqueIdentifier. Moved the code to use the origin
        string and then falling back to the UUID here from originIdentifierForDocument in DataTransfer.cpp.
        * dom/Document.h:
        * editing/WebContentReader.cpp:
        (WebCore::WebContentMarkupReader::shouldSanitize const): Added.
        * editing/WebContentReader.h:
        (WebCore::WebContentMarkupReader): Added.
        (WebCore::WebContentMarkupReader::WebContentMarkupReader):
        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::createFragmentFromWebArchive): Extracted out of WebContentReader::readWebArchive to share code.
        (WebCore::WebContentReader::readWebArchive):
        (WebCore::WebContentMarkupReader::readWebArchive): Added. Reads the web archive, replace all subresource URLs by
        blob URLs, and re-generate the markup using our copy & paste code. The last step is requied to strip away any privacy
        sensitive information as well as potentially dangerous JavaScript code.
        (WebCore::stripMicrosoftPrefix): Extracted out of WebContentReader::readHTML to share code.
        (WebCore::WebContentReader::readHTML):
        (WebCore::WebContentMarkupReader::readHTML): Added. Only sanitize the markup when it comes from a different origin.
        (WebCore::WebContentReader::readRTFD): Added a nullity check for frame.document().
        (WebCore::WebContentMarkupReader::readRTFD): Added.
        (WebCore::WebContentMarkupReader::readRTF): Added.
        * editing/markup.h:
        * editing/markup.cpp:
        (WebCore::createPageForSanitizingWebContent): Added.
        (WebCore::sanitizeMarkup): Added. This function "pastes" the markup into a new isolated document then reserializes
        using our serialization code for copy. It strips away all invisible information such as comments, and strips away
        event handlers and script elements to remove potentially dangerous scripts.
        * platform/Pasteboard.h:
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::readPasteboardWebContentDataForType): Now that this code can be called by DataTransfer, added
        the checks for the change count to make sure we stop letting web content read if the pasteboard had been changed by
        some other applications. To do this, turned this function into a member of Pasteboard. Also changed the return type
        to an enum with tri-state to exist the loop early in the call sites.
        (WebCore::Pasteboard::read):
        (WebCore::Pasteboard::readRespectingUTIFidelities):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Treat RTF, RTFD, and web archive as HTML.
        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::read): Add the change count checks now that this code can be called by DataTransfer.
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Treat RTF, RTFD, and web archive as HTML.

2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed attempt to fix the Windows debug build.

        * Modules/webdatabase/DatabaseTracker.cpp:
        (WebCore::DatabaseTracker::deleteOrigin):

2017-10-16  Chris Dumez  <cdumez@apple.com>

        Log using differential privacy domains where the WebContent process crashes
        https://bugs.webkit.org/show_bug.cgi?id=178346
        <rdar://problem/33293830>

        Reviewed by Alex Christensen.

        Add new diagnostic logging key for domain causing crashes.

        * page/DiagnosticLoggingKeys.cpp:
        (WebCore::DiagnosticLoggingKeys::domainCausingCrashKey):
        * page/DiagnosticLoggingKeys.h:

2017-10-16  Sam Weinig  <sam@webkit.org>

        [Settings] Remove all custom code from Settings.h/cpp
        https://bugs.webkit.org/show_bug.cgi?id=178330

        Reviewed by Simon Fraser.

        Removes the two remaining functions out of Settings paving the way
        for the file to be generated.
        
        - pageDestroyed was moved down into SettingsBase.
        - effectiveFrameFlattening was moved to FrameView (to reduce the need
          for additional includes, the FrameFlattening enum was converted to
          an enum class to allow it to be forward declared).
          
        Also moves default values into SettingsDefaultValues.h

        * WebCore.xcodeproj/project.pbxproj:
        
            Add new files.
        
        * page/FrameView.cpp:
        * page/FrameView.h:

            Move effectiveFrameFlattening function here from Settings.

        * page/Settings.cpp:
        * page/Settings.h:

            Move effectiveFrameFlattening, pageDestroyed and default values out.

        * page/Settings.in:
        
            Update for turning FrameFlattening into an enum class.
        
        * page/SettingsBase.h:

            Turn FrameFlattening into an enum class and move pageDestroyed here.

        * page/SettingsDefaultValues.h: Added.

            Move all the default values from Settings here.

        * rendering/RenderFrameSet.cpp:
        * rendering/RenderIFrame.cpp:
        * rendering/RenderView.cpp:

            Get effectiveFrameFlattening from the FrameView.

        * testing/InternalSettings.cpp:
        * testing/InternalSettings.h:
        
            Update now that FrameFlattening is an enum class.

2017-10-16  Maureen Daum  <mdaum@apple.com>

        If we fail to delete any database file, don't remove its information from the tracker database
        <rdar://problem/34576132> and https://bugs.webkit.org/show_bug.cgi?id=178251

        Reviewed by Brady Eidson.

        New tests:
        DatabaseTracker.DeleteDatabase
        DatabaseTracker.DeleteDatabaseWhenDatabaseDoesNotExist
        DatabaseTracker.DeleteOrigin
        DatabaseTracker.DeleteOriginWhenDeletingADatabaseFails
        DatabaseTracker.DeleteOriginWhenDatabaseDoesNotExist

        * Modules/webdatabase/DatabaseTracker.cpp:
        (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
        If the database doesn't exist, we previously deleted it but failed to remove the
        information from the tracker database. We still want to delete all of the information
        associated with this database from the tracker database, so add it to databaseNamesToDelete.
        (WebCore::DatabaseTracker::deleteOrigin):
        If a database doesn't exist, don't try to delete it. We don't need to, but more
        importantly, deleteDatabaseFile() will fail if the database doesn't exist, which
        will cause us to incorrectly think we failed to remove database information from disk.
        If we actually fail to delete any database file, return before we remove the origin
        information from the tracker database so we don't lose track of the database.
        (WebCore::DatabaseTracker::deleteDatabase):
        If a database doesn't exist, don't try to delete it. We don't need to, but also it
        will cause us to incorrectly think that we were unable to delete a database, so we
        would bail before we remove the database information from the tracker database. We
        want to remove the database information from the tracker database because the database
        doesn't exist.
        * Modules/webdatabase/DatabaseTracker.h:
        Expose fullPathForDatabase() for use by tests.
        * platform/Logging.h:
        Add a logging channel.

2017-10-16  Alex Christensen  <achristensen@webkit.org>

        Remove unnecessary include from Document.h
        https://bugs.webkit.org/show_bug.cgi?id=178247

        Reviewed by Darin Adler.

        * dom/Document.cpp:
        (WebCore::Document::hasTouchEventHandlers const):
        (WebCore::Document::touchEventTargetsContain const):
        * dom/Document.h:
        (WebCore::Document::hasTouchEventHandlers const): Deleted.
        (WebCore::Document::touchEventTargetsContain const): Deleted.

2017-10-16  Alex Christensen  <achristensen@webkit.org>

        Fix iOS build after r223422
        https://bugs.webkit.org/show_bug.cgi?id=178251

        * Modules/webdatabase/DatabaseManager.h:

2017-10-16  Maureen Daum  <mdaum@apple.com>

        We should wrap the removal of information from the tracker database in a transaction in DatabaseTracker::deleteOrigin()
        https://bugs.webkit.org/show_bug.cgi?id=178274
        <rdar://problem/34576132>

        Reviewed by Tim Horton.

        * Modules/webdatabase/DatabaseTracker.cpp:
        (WebCore::DatabaseTracker::deleteOrigin):
        Wrap the removal of information from the tracker database in a transaction so that
        we don't end up in a case where only one of the tables contains information about
        an origin.
        If anything goes wrong when we're modifying the tracker database, rollback the transaction
        before bailing.

2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r223419.

        This change broke the Windows build.

        Reverted changeset:

        "If we fail to delete any database file, don't remove its
        information from the tracker database"
        https://bugs.webkit.org/show_bug.cgi?id=178251
        https://trac.webkit.org/changeset/223419

2017-10-16  Maureen Daum  <mdaum@apple.com>

        If we fail to delete any database file, don't remove its information from the tracker database
        <rdar://problem/34576132> and https://bugs.webkit.org/show_bug.cgi?id=178251

        Reviewed by Brady Eidson.

        New tests:
        DatabaseTracker.DeleteDatabase
        DatabaseTracker.DeleteDatabaseWhenDatabaseDoesNotExist
        DatabaseTracker.DeleteOrigin
        DatabaseTracker.DeleteOriginWhenDeletingADatabaseFails
        DatabaseTracker.DeleteOriginWhenDatabaseDoesNotExist

        * Modules/webdatabase/DatabaseTracker.cpp:
        (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
        If the database doesn't exist, we previously deleted it but failed to remove the
        information from the tracker database. We still want to delete all of the information
        associated with this database from the tracker database, so add it to databaseNamesToDelete.
        (WebCore::DatabaseTracker::deleteOrigin):
        If a database doesn't exist, don't try to delete it. We don't need to, but more
        importantly, deleteDatabaseFile() will fail if the database doesn't exist, which
        will cause us to incorrectly think we failed to remove database information from disk.
        If we actually fail to delete any database file, return before we remove the origin
        information from the tracker database so we don't lose track of the database.
        (WebCore::DatabaseTracker::deleteDatabase):
        If a database doesn't exist, don't try to delete it. We don't need to, but also it
        will cause us to incorrectly think that we were unable to delete a database, so we
        would bail before we remove the database information from the tracker database. We
        want to remove the database information from the tracker database because the database
        doesn't exist.
        * Modules/webdatabase/DatabaseTracker.h:
        Expose fullPathForDatabase() for use by tests.
        * platform/Logging.h:
        Add a logging channel.

2017-10-16  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(223307): ASSERTION in WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution
        https://bugs.webkit.org/show_bug.cgi?id=178342
        <rdar://problem/35008505>

        Reviewed by Chris Dumez.

        In r223307 I mistakenly used 'topDocument->topDocument()' because of a copy/paste error. I should have just used
        'topDocument'.

        Tests: CommandBackForwardTestWKWebView in TestWebKitAPI.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): We might enter this routine at a time
        where there is no page. If so, we should return early and not log credit.
        * page/EventHandler.cpp:
        (WebCore::EventHandler::keyEvent): Correct the argument passed to the log function.

2017-10-15  Filip Pizlo  <fpizlo@apple.com>

        Make some asserts into release asserts
        https://bugs.webkit.org/show_bug.cgi?id=178324

        Reviewed by Saam Barati.

        No new tests because no change in behavior.
        
        This introduces some release asserts. Perf testing shows that it's neutral. So, we get some extra
        safety without losing any perf.

        * dom/ContainerNodeAlgorithms.cpp:
        (WebCore::notifyChildNodeInserted):
        * dom/Document.cpp:
        (WebCore::Document::adoptNode):
        (WebCore::Document::frameDestroyed):
        (WebCore::Document::attachToCachedFrame):
        (WebCore::Document::detachFromCachedFrame):
        (WebCore::Document::prepareForDestruction):
        (WebCore::Document::dispatchWindowEvent):
        (WebCore::Document::dispatchWindowLoadEvent):
        (WebCore::Document::applyQuickLookSandbox):
        * dom/DocumentOrderedMap.cpp:
        (WebCore::DocumentOrderedMap::add):
        (WebCore::DocumentOrderedMap::remove):
        (WebCore::DocumentOrderedMap::get const):
        (WebCore:: const):
        * dom/Node.cpp:
        (WebCore::Node::~Node):
        (WebCore::DidMoveToNewDocumentAssertionScope::~DidMoveToNewDocumentAssertionScope):
        (WebCore::DidMoveToNewDocumentAssertionScope::didRecieveCall):
        (WebCore::moveNodeToNewDocument):
        (WebCore::moveShadowTreeToNewDocument):
        (WebCore::Node::moveTreeToNewScope):
        (WebCore::Node::didMoveToNewDocument):
        (WebCore::Node::dispatchSubtreeModifiedEvent):
        (WebCore::Node::dispatchDOMActivateEvent):

2017-10-16  Alejandro G. Castro  <alex@igalia.com>

        Make RealtimeIncomingAudioSources and RealtimeOutgoingAudioSources port agnostic
        https://bugs.webkit.org/show_bug.cgi?id=177928

        Reviewed by Youenn Fablet.

        Refactor the RealtimeIncomingAudioSource and RealtimeOutgoingAudioSource classes,
        move the mac specific code to a different class. This way we can use them from
        other ports.

        No new tests, we are not adding new functionality just refactoring.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/RealtimeIncomingAudioSource.cpp: Copied from Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.h. Just the port agnostic parts.
        * platform/mediastream/RealtimeIncomingAudioSource.h: Copied from Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.h. Ditto.
        * platform/mediastream/RealtimeOutgoingAudioSource.cpp: Copied from Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp. Ditto.
        * platform/mediastream/RealtimeOutgoingAudioSource.h: Copied from Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.h. Ditto.
        * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp: Added, it adds Cocoa code parts from original Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.cpp.
        (WebCore::RealtimeIncomingAudioSource::create): Moved this function from the RealtimeOutgoingAudioSource.cpp file to avoid including the Cocoa file there.
        * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h: Added Cocoa code from original Source/WebCore/platform/mediastream/mac/RealtimeIncomingAudioSource.h.
        * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp: Added Cocoa code from original Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp.
        (WebCore::RealtimeOutgoingAudioSource::create): Moved this function from the RealtimeOutgoingAudioSource.cpp file to avoid including the Cocoa file there.
        * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h: Added Cocoa code from the original Source/WebCore/platform/mediastream/mac/RealtimeOutgoingAudioSource.h.

2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the tvOS build after r223340.

        Add a new #define in PlatformPasteboardIOS.mm for item provider support, and guard usages of
        WebItemProviderPasteboard using it.

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::pasteboardMayContainFilePaths):
        (WebCore::PlatformPasteboard::readURL):

2017-10-16  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r223271.

        This change introduced LayoutTest failures on WK1.

        Reverted changeset:

        "Use asynchronous ResourceHandleClient calls for WebKit1"
        https://bugs.webkit.org/show_bug.cgi?id=160677
        https://trac.webkit.org/changeset/223271

2017-10-16  Alejandro G. Castro  <alex@igalia.com>

        Make RealtimeIncomingVideoSources and RealtimeOutgoingVideoSources port agnostic
        https://bugs.webkit.org/show_bug.cgi?id=177869

        Reviewed by Youenn Fablet.

        Refactor the RealtimeIncomingVideoSource and RealtimeOutgoingVideoSource classes,
        move the cocoa specific code to a different class. This way we can use them from
        other ports.

        No new functionality, just a refactor.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/RealtimeIncomingVideoSource.cpp: Moved from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h. Just the port agnostic parts.
        * platform/mediastream/RealtimeIncomingVideoSource.h: Moved from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h. DItto
        * platform/mediastream/RealtimeOutgoingVideoSource.cpp: Moved from Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp. Ditto
        * platform/mediastream/RealtimeOutgoingVideoSource.h: Moved from Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.h. Ditto
        * platform/mediastream/mac/RealtimeIncomingVideoSourceMac.cpp: Added, it adds the Cocoa specific parts from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.cpp.
        (WebCore::RealtimeIncomingVideoSource::create): Moved this function from the base class, it allows avoiding the include.
        * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h: Added, cocoa dependent code from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSource.h.
        (WebCore::RealtimeOutgoingVideoSource::create): Moved this funtion from the base class, now we can use the Cocoa create without including it in the base class.
        * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: Added, cocoa dependent code.
        * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h: Added, cocoa dependent code.

2017-10-16  Manuel Rego Casasnovas  <rego@igalia.com>

        Don't use intrinsic width if our container's width is zero
        https://bugs.webkit.org/show_bug.cgi?id=178073

        Reviewed by Sergio Villar Senin.

        Based on Blink r173212 by <robhogan@gmail.com>.
        https://chromium.googlesource.com/chromium/src/+/1592e8a1e8e56dfa6e5d709c50b129ae659c2fad

        Since at least r798 we use a replaced element's intrinsic width
        if its containing block has a width of zero. As a result our rendering
        of width100percent-image.html has disagreed with all other browsers
        and we display replaced elements when they should be invisible.

        Test: fast/replaced/container-width-zero.html

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
        If our container has zero width then let our width be zero too.

2017-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        On ToT, event.dataTransfer.getData("text/uri-list") returns an empty string when dragging an image
        https://bugs.webkit.org/show_bug.cgi?id=178301
        <rdar://problem/34990050>

        Reviewed by Darin Adler.

        After r222656, we consider images on the pasteboard to be files. This causes DataTransfer.getData to return the
        empty string for all types, which brings back https://bugs.webkit.org/show_bug.cgi?id=170637. To allow pages to
        access the URL part of a dragged image, we exempt "text/uri-list" from our heurstics to hide pasteboard data
        which may contain files, and return the URL as long as its protocol is either HTTP or HTTPS.

        Tweaked an existing layout test to cover this scenario, as well as the scenario in which the dragged image links
        to a file URL (in which case we should avoid exposing the data).

        Test: editing/pasteboard/drag-drop-href-as-url.html
              DataInteractionTests.DataTransferGetDataWhenDroppingImageWithHTTPURL

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::getDataForItem const):

        When the pasteboard contains files, allow data for "text/uri-list" to be returned, as long as the URL string has
        a white-listed protocol (currently, this is just http and https).

        (WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
        (WebCore::DataTransfer::setData):
        (WebCore::DataTransfer::types const):

        When the pasteboard contains files, allow "text/uri-list" to be added, alongside the "Files" type, if it would
        have been exposed in the list of safe DOM types.

        * dom/DataTransfer.h:
        * platform/Pasteboard.cpp:
        (WebCore::Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles):

        Add a new helper method to determine whether it is safe to expose an URL string as "text/uri-list" to bindings,
        if the pasteboard contains files. While this currently checks whether or not the URL is in the HTTP family, we
        may want to consider tweaking this to blacklist the "file" protocol instead, and allow all other valid URLs by
        default.

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

        Mark stringForType as const, and also teach stringForType to return the null string for the platform URL type if
        the pasteboard might contain file paths.

        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):

        Before coercing a platform type to "text/uri-list" when building the list of DOM-safe types, check that the
        stringForType is not the empty string, in which case we don't expose the type to the DOM at all. This ensures
        that in cases where the URL might reveal a file path, we don't advertise "text/uri-list" as a type. We adopt a
        similar strategy on iOS.

        (WebCore::PlatformPasteboard::stringForType): Deleted.
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::pasteboardMayContainFilePaths):
        (WebCore::PlatformPasteboard::stringForType const):
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
        (WebCore::PlatformPasteboard::stringForType): Deleted.

2017-10-16  Frederic Wang  <fwang@igalia.com>

        Use auto/nullptr in scrolling code
        https://bugs.webkit.org/show_bug.cgi?id=178306

        Reviewed by Carlos Garcia Campos.

        This patch modifies the scrolling code to use the auto keyword when
        possible. It also replaces '0' with 'nullptr' for the return value of
        ScrollingStateTree::stateNodeForID.

        No new tests, behavior unchanged.

        * page/scrolling/AsyncScrollingCoordinator.cpp:
        (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
        (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
        (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
        (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
        (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
        (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
        (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
        (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
        (WebCore::AsyncScrollingCoordinator::updateNodeLayer):
        (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints):
        (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
        (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition):
        (WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
        * page/scrolling/ScrollingCoordinator.cpp:
        (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView const):
        (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
        (WebCore::ScrollingCoordinator::scrollLayerForFrameView):
        (WebCore::ScrollingCoordinator::headerLayerForFrameView):
        (WebCore::ScrollingCoordinator::footerLayerForFrameView):
        (WebCore::ScrollingCoordinator::counterScrollingLayerForFrameView):
        (WebCore::ScrollingCoordinator::insetClipLayerForFrameView):
        (WebCore::ScrollingCoordinator::contentShadowLayerForFrameView):
        (WebCore::ScrollingCoordinator::rootContentLayerForFrameView):
        (WebCore::ScrollingCoordinator::handleWheelEventPhase):
        (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects const):
        (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasonsForAllFrames):
        (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText const):
        * page/scrolling/ScrollingStateFixedNode.cpp:
        (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
        * page/scrolling/ScrollingStateStickyNode.cpp:
        (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
        * page/scrolling/ScrollingStateTree.cpp:
        (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
        (WebCore::ScrollingStateTree::attachNode):
        (WebCore::ScrollingStateTree::detachNode):
        (WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
        (WebCore::ScrollingStateTree::stateNodeForID const):
        * page/scrolling/ScrollingTree.cpp:
        (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
        (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling):
        (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
        (WebCore::ScrollingTree::commitTreeState):
        (WebCore::ScrollingTree::updateTreeFromStateNode):
        * page/scrolling/ScrollingTreeNode.cpp:
        (WebCore::ScrollingTreeNode::enclosingFrameNode const):
        * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
        (WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree):
        (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeLayer):
        (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints):
        (WebCore::ScrollingCoordinatorCoordinatedGraphics::scrollableAreaScrollLayerDidChange):
        (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):

2017-10-16  Fujii Hironori  <Hironori.Fujii@sony.com>

        A lot of "Can't stat WebCore/animation: No such file or directory" since r223328
        https://bugs.webkit.org/show_bug.cgi?id=178326

        Unreviewed build fix

        The directory WebCore/animation was removed in r223328.

        No new tests because there is no behavior change.

        * CMakeLists.txt: Removed animation from
        WebCore_INCLUDE_DIRECTORIES and WebCore_IDL_INCLUDES.
        * DerivedSources.make: Removed animation from VPATH and IDL_INCLUDES

2017-10-16  Frederic Wang  <fwang@igalia.com>

        Replace some ScrollingTreeNode::nodeType() calls with is*Node()
        https://bugs.webkit.org/show_bug.cgi?id=178259

        Reviewed by Darin Adler.

        No new tests, behavior unchanged.

        * page/scrolling/AsyncScrollingCoordinator.cpp:
        (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
        * page/scrolling/ScrollingStateNode.h:
        (WebCore::ScrollingStateNode::isScrollingNode const):
        * page/scrolling/ScrollingTree.cpp:
        (WebCore::ScrollingTree::updateTreeFromStateNode):
        * page/scrolling/ScrollingTreeNode.cpp:
        (WebCore::ScrollingTreeNode::enclosingFrameNode const):
        * page/scrolling/ScrollingTreeNode.h:
        (WebCore::ScrollingTreeNode::isScrollingNode const):

2017-10-16  Tomas Popela  <tpopela@redhat.com>

        DataTransfer.cpp triggers -Wunused-but-set-variable
        https://bugs.webkit.org/show_bug.cgi?id=178209

        Reviewed by Wenson Hsieh.

        Use the ASSERT_UNUSED to silence it.

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::filesFromPasteboardAndItemList const):

2017-10-15  Sam Weinig  <sam@webkit.org>

        [Settings] Split non-macro generated parts of Settings into SettingsBase base class
        https://bugs.webkit.org/show_bug.cgi?id=178321

        Reviewed by Darin Adler.

        Working towards getting generated Settings working again, but in smaller patches, split
        non-generated part off into SettingsBase as a first step.
        
        One function, effectiveFrameFlattening(), needs to remain in Settings for now, as it directly
        references a macro generated function, frameFlattening().

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * page/Page.h:
        * page/Settings.cpp:
        * page/Settings.h:
        * page/SettingsBase.h: Copied from Source/WebCore/page/Settings.h.
        * page/cocoa/SettingsBaseCocoa.mm: Copied from Source/WebCore/page/cocoa/SettingsCocoa.mm.
        * page/cocoa/SettingsCocoa.mm: Removed.

2017-10-15  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Perform module specifier validation at parsing time
        https://bugs.webkit.org/show_bug.cgi?id=178256

        Reviewed by Darin Adler.

        No behavior change in the current implementation.

        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::moduleLoaderResolve):
        * bindings/js/JSDOMWindowBase.h:
        * bindings/js/ScriptModuleLoader.cpp:
        (WebCore::ScriptModuleLoader::resolve):
        * bindings/js/ScriptModuleLoader.h:

2017-10-15  Chris Dumez  <cdumez@apple.com>

        DOMTokenList shouldn't add empty attributes
        https://bugs.webkit.org/show_bug.cgi?id=178280
        <rdar://problem/34987431>

        Reviewed by Ryosuke Niwa.

        Follow-up to r223306, reverse the check conditions to avoid attribute
        lookup when possible. Also use m_tokens instead of tokens() to avoid
        unnecessary branch.

        * html/DOMTokenList.cpp:
        (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):

2017-10-15  Darin Adler  <darin@apple.com>

        UTF-8 decoding produces one replacement character per byte; Encoding standard requires one replacement character per illegal sequence instead
        https://bugs.webkit.org/show_bug.cgi?id=178207

        Reviewed by Sam Weinig.

        * platform/text/TextCodecUTF8.cpp:
        (WebCore::TextCodecUTF8::create): Deleted. Use a lambda instead.
        (WebCore::TextCodecUTF8::registerCodecs): Use a lambda.
        (WebCore::nonASCIISequenceLength): Changed to return 0 instead of 2 for the range 80-C1 since
        none of those are valid sequence leading characters.
        (WebCore::decodeNonASCIISequence): Changed the length argument to be in/out so the caller
        knows how much of the sequence we decoded for failure cases. Simplified the length 2 section.
        (WebCore::TextCodecUTF8::handleError): Deleted.
        (WebCore::TextCodecUTF8::handlePartialSequence): Changed this into a pair of plain functions
        rather than two template function specializations since the two functions are rather different.
        For the one-byte version, got rid of the unused arguments. For the two-byte version, got rid
        of the ignored return value, stopped using the handleError function since each error case
        needs to be handled differently. In each error case consume the entire incorrect sequence
        instead of just one byte.
        (WebCore::TextCodecUTF8::decode): Updated for the above change, and changed the non-partial
        incorrect sequence to consume the entire incorrect sequence instead of just one byte. Also
        use WTF prefixes explicitly so we don't  have to do "using namespace".
        (WebCore::TextCodecUTF8::encode): Got rid of unneeded type punning, and added some inline
        capacity to save one memory allocation when encoding shorter strings.

        * platform/text/TextCodecUTF8.h: Use pragma once. Intialize m_partialSequenceSize where it
        is defined and let the compiler generate the constructor. Updated for the changes above.

        * platform/text/TextEncoding.h: Export a constructor now used by a unit test.
        * platform/text/TextEncodingRegistry.h: Export newTextCodec, now used by a unit test.

2017-10-14  Antoine Quint  <graouts@apple.com>

        Remove all Web Animations code
        https://bugs.webkit.org/show_bug.cgi?id=178273

        Reviewed by Sam Weinig.

        We remove all existing code related to Web Animations which does not include any functionality,
        only stubs. This leaves the build and runtime flags, we'll start a complete implementation from
        scratch.

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * animation/Animatable.idl: Removed.
        * animation/AnimationEffect.cpp: Removed.
        * animation/AnimationEffect.h: Removed.
        * animation/AnimationEffect.idl: Removed.
        * animation/AnimationTimeline.cpp: Removed.
        * animation/AnimationTimeline.h: Removed.
        * animation/AnimationTimeline.idl: Removed.
        * animation/DocumentAnimation.cpp: Removed.
        * animation/DocumentAnimation.h: Removed.
        * animation/DocumentAnimation.idl: Removed.
        * animation/DocumentTimeline.cpp: Removed.
        * animation/DocumentTimeline.h: Removed.
        * animation/DocumentTimeline.idl: Removed.
        * animation/KeyframeEffect.cpp: Removed.
        * animation/KeyframeEffect.h: Removed.
        * animation/KeyframeEffect.idl: Removed.
        * animation/WebAnimation.cpp: Removed.
        * animation/WebAnimation.h: Removed.
        * animation/WebAnimation.idl: Removed.
        * bindings/js/JSAnimationTimelineCustom.cpp: Removed.
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/WebCoreBuiltinNames.h:
        * dom/Element.cpp:
        (WebCore::Element::getAnimations): Deleted.
        * dom/Element.h:
        * dom/Element.idl:

2017-10-14  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: provide a way to enable/disable event listeners
        https://bugs.webkit.org/show_bug.cgi?id=177451

        Reviewed by Joseph Pecoraro.

        Test: inspector/dom/setEventListenerDisabled.html

        * dom/EventTarget.cpp:
        (WebCore::EventTarget::fireEventListeners):
        Add InspectorInstrumentation call to isEventListenerDisabled. If true, the event listener's
        callback will not be called.

        * inspector/InspectorDOMAgent.h:
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::discardBindings):
        (WebCore::InspectorDOMAgent::getEventListenersForNode):
        (WebCore::InspectorDOMAgent::setEventListenerDisabled):
        (WebCore::InspectorDOMAgent::buildObjectForEventListener):
        (WebCore::InspectorDOMAgent::willRemoveEventListener):
        (WebCore::InspectorDOMAgent::isEventListenerDisabled):
        Introduce a mapping of `EventListener*` to `InspectorEventListener`, a struct for uniquely
        identifying event listeners so they can be referenced from the frontend. We only add items
        to this mapping when `getEventListenersForNode` is called, as that is when EventListener
        data is sent to the frontend. This allows us to defer creating an Inspector "mirror" object
        for each EventListener until it is needed. Items are removed whenever an event listener is
        removed or when the document changes.

        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::isEventListenerDisabled):
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
        (WebCore::InspectorInstrumentation::isEventListenerDisabledImpl):
        Pass additional parameters to InspectorDOMAgent so it can determine if the event listener
        actually exists. If not, don't dispatch an event to the frontend as nothing will change.

2017-10-14  Sam Weinig  <sam@webkit.org>

        Remove HashCountedSet's copyToVector functions
        https://bugs.webkit.org/show_bug.cgi?id=178215

        Reviewed by Daniel Bates.

        * page/DeviceController.cpp:
        (WebCore::DeviceController::dispatchDeviceEvent):
        (WebCore::DeviceController::fireDeviceEvent):
        
            Replace use of HashCountedSet's copyToVector functions with copyToVector(hashCountedSet.values()).

2017-10-13  Jer Noble  <jer.noble@apple.com>

        Performance: Skip texture upload if source image and destination texture haven't changed
        https://bugs.webkit.org/show_bug.cgi?id=178254
        <rdar://problem/34968181>

        Reviewed by Dean Jackson.

        Update GraphicsContext3D to track which texture is bound to which texture unit, and also to
        track when those bound textures have their backing stores modified. This new "seed" value
        will be used to determine whether a given texture which has previously had image data
        uploaded to it needs to be re-updated.

        In VideoTextureCopierCV, track whether the texture's seed changed, whether the IOSurface is
        the same,  whether the IOSurface's seed has changed, and whether the "flipY" parameter
        changed since the last time the copier was asked to upload to the texture.

        * platform/graphics/GraphicsContext3D.h:
        (WebCore::GraphicsContext3D::textureSeed):
        (WebCore::GraphicsContext3D::GraphicsContext3DState::currentBoundTexture):
        (WebCore::GraphicsContext3D::GraphicsContext3DState::boundTexture):
        (WebCore::GraphicsContext3D::GraphicsContext3DState::setBoundTexture):
        * platform/graphics/cv/VideoTextureCopierCV.cpp:
        (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
        * platform/graphics/cv/VideoTextureCopierCV.h:
        (WebCore::VideoTextureCopierCV::lastTextureSeed):
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::prepareTexture):
        (WebCore::GraphicsContext3D::bindTexture):
        (WebCore::GraphicsContext3D::texStorage2D):
        (WebCore::GraphicsContext3D::texStorage3D):
        (WebCore::GraphicsContext3D::framebufferTexture2D):
        (WebCore::GraphicsContext3D::texSubImage2D):
        (WebCore::GraphicsContext3D::compressedTexImage2D):
        (WebCore::GraphicsContext3D::compressedTexSubImage2D):
        (WebCore::GraphicsContext3D::createTexture):
        (WebCore::GraphicsContext3D::deleteTexture):
        (WebCore::GraphicsContext3D::texImage2DDirect):

2017-10-13  Per Arne Vollan  <pvollan@apple.com>

        [Win] When built with VS2017, MiniBrowser crashes on startup.
        https://bugs.webkit.org/show_bug.cgi?id=175209

        Reviewed by Daniel Bates.

        Generated StaticStringImpl objects are not initialized compile-time with VS2017.
        When compiling with VS2017, the global, static, StaticStringImpl objects needs to
        be defined with the constexpr specifier, in order for the objects to be initialized
        at compile time. Since the StaticStringImpl objects will be const then, we need to
        be able to create an AtomicString object from a const StaticStringImpl object. 
        This constructor has been added to the AtomicString class.

        No new tests, covered by existing tests. 

        * bindings/scripts/StaticString.pm:
        (GenerateStrings):
        (GenerateStringAsserts):
        * dom/QualifiedName.cpp:
        (WebCore::createQualifiedName):
        * dom/QualifiedName.h:
        * dom/make_names.pl:
        (printDefinitions):

2017-10-13  Brent Fulgham  <bfulgham@apple.com>

        Protect FrameView during style calculations
        https://bugs.webkit.org/show_bug.cgi?id=178300
        <rdar://problem/34869329>

        Reviewed by Ryosuke Niwa.

        Protect the FrameView during layout and style updates in case arbitrary script
        is run that might clear it.

        Test: fast/html/marquee-reparent-check.html

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

2017-10-13  Per Arne Vollan  <pvollan@apple.com>

        Crash under ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData
        https://bugs.webkit.org/show_bug.cgi?id=178279

        Reviewed by Alex Christensen.

        Check if the connection is valid before calling ResourceHandleClient::didSendData.

        No new tests, covered by existing tests.

        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):

2017-10-13  Brent Fulgham  <bfulgham@apple.com>

        CMD+R / CMD+Q keyboard shortcuts are treated as user interaction with page
        https://bugs.webkit.org/show_bug.cgi?id=178183
        <rdar://problem/33327730>

        Reviewed by Ryosuke Niwa.

        Key events are granted user interaction credit (in terms of updating the last time of user
        interaction), even if the key event was not handled. Instead, we should defer granting
        access until the key event has been handled.
        
        Add a new default constructor argument to UserGestureIndicator to be used when handling key
        events, so we can delay a decision about whether to grant ResourceLoadStatistics
        'hasHadUserInteraction' until we confirm that the event was handled by the page.

        This change does not affect other aspects of user interaction.

        Tests: fast/events
               http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html
               http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown.html

        * dom/UserGestureIndicator.cpp:
        (WebCore::UserGestureIndicator::UserGestureIndicator): Add check based on constructor argument.
        Also: Drive by fix to avoid calling 'currentToken' when not on the main thread.
        * dom/UserGestureIndicator.h:
        * page/EventHandler.cpp:
        (WebCore::EventHandler::keyEvent): If the key event was handled, grant user interaction credit
        for ResourceLoadStatistics processing.
        (WebCore::EventHandler::internalKeyEvent): Use the new UserGestureIndicator constructor argument.

2017-10-13  Chris Dumez  <cdumez@apple.com>

        DOMTokenList shouldn't add empty attributes
        https://bugs.webkit.org/show_bug.cgi?id=178280

        Reviewed by Ryosuke Niwa.

        DOMTokenList shouldn't add empty attributes after:
        - https://github.com/whatwg/dom/pull/488

        Firefox and Chrome follow the latest spec.

        No new tests, updating existing test.

        * html/DOMTokenList.cpp:
        (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
        Implement the first step of https://dom.spec.whatwg.org/#concept-dtl-update

2017-10-13  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix; wrap more functions in USE(IOSURFACE) so that
        they do not generate "unused function" errors.

        * platform/graphics/cv/VideoTextureCopierCV.cpp:

2017-10-13  Jer Noble  <jer.noble@apple.com>

        One last unreviewed build fix; since the IOSurface APIs don't exist at
        all on the simulator, just wrap the entirety of the implementation of
        copyImageToPlatformTexture() in a #if USE(IOSURFACE) check.

        * platform/graphics/cv/VideoTextureCopierCV.cpp:
        (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):

2017-10-13  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix for the previous build fix; use the right PAL path for IOSurfaceSPI.h.

        * platform/graphics/cv/VideoTextureCopierCV.cpp:

2017-10-13  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix; add definitions for IOSurface methods missing on some platforms.

        * platform/graphics/cv/VideoTextureCopierCV.cpp:

2017-10-13  Alex Christensen  <achristensen@webkit.org>

        Remove Editor::simplifyMarkup
        https://bugs.webkit.org/show_bug.cgi?id=178271

        Reviewed by Wenson Hsieh.

        An API test became flaky, and it turns out this isn't used anywhere, so let's remove it!
        It was used in Mountain Lion, Mavericks, and Yosemite, but not since then.
        See <rdar://problem/10726177>

        * editing/Editor.cpp:
        (WebCore::Editor::simplifyMarkup): Deleted.
        * editing/Editor.h:

2017-10-13  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix; forward declare the type of IOSurfaceRef.

        * platform/cocoa/CoreVideoSoftLink.cpp:
        * platform/cocoa/CoreVideoSoftLink.h:

2017-10-13  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix; add soft link macros for newly called CoreVideo methods.

        * platform/cocoa/CoreVideoSoftLink.cpp:
        * platform/cocoa/CoreVideoSoftLink.h:

2017-10-13  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix; add UNUSED_PARAM macros.

        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
        (WebCore::GraphicsContext3D::texImageIOSurface2D):

2017-10-13  Jer Noble  <jer.noble@apple.com>

        Performance: do pixel conformance and texturing in a single step.
        https://bugs.webkit.org/show_bug.cgi?id=178219
        <rdar://problem/34937237>

        Reviewed by Dean Jackson.

        No new tests; performance improvements should have no behavior change.

        Rather than asking the VTDecompressionSession to conform the output CVPixelBuffer into a
        pixel format compatible with OpenGL (& ES), don't constrain the output at all, and only do a
        conformance step if the output is not already compatible with OpenGL. This eliminates one
        copy (in hardware) operation.

        Move the TextureCacheCV object into VideoTextureCopierCV; it will be conditionally used to
        create the texture if the pixel buffer is compatible.

        Refactor copyVideoTextureToPlatformTexture(CVOpenGLTextureRef) in VideoTextureCopierCV. The
        new entry point, copyImageToPlatformTexture(), will attempt to use the texture cache first,
        and call a new common copyVideoTextureToPlatformTexture(Platform3DObject) with the result.

        The new copyImageToPlatformTexture() will pull planar YUV frames into two textures, and combine
        the two with a color transfer function when drawing to the output texture.

        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture):
        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
        (WebCore::GraphicsContext3D::texImageIOSurface2D):
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
        * platform/graphics/cv/TextureCacheCV.h:
        * platform/graphics/cv/TextureCacheCV.mm:
        (WebCore::TextureCacheCV::textureFromImage):
        * platform/graphics/cv/VideoTextureCopierCV.cpp:
        (WebCore::pixelRangeFromPixelFormat):
        (WebCore::transferFunctionFromString):
        (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
        (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV):
        (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
        (WebCore::VideoTextureCopierCV::copyImageToPlatformTexture):
        (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture):
        * platform/graphics/cv/VideoTextureCopierCV.h:

2017-10-13  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Align queue with spec for ReadableStreamDefaultController
        https://bugs.webkit.org/show_bug.cgi?id=178082

        Reviewed by Xabier Rodriguez-Calvar.

        Implemented new queue behavior for dequeueValue (used by ReadableStreamDefaultController),
        which fixes rounding errors (as described in https://github.com/whatwg/streams/pull/661).
        Also aligned ReadableByteStreamController queue so that both queues are implemented in
        the same way.

        No new tests (covered by existing tests, especially WPT tests that now pass).

        * Modules/streams/ReadableByteStreamInternals.js:
        (privateInitializeReadableByteStreamController): Aligned queue with RSDC.
        (readableByteStreamControllerCancel): Aligned queue with RSDC.
        (readableByteStreamControllerError): Aligned queue with RSDC.
        (readableByteStreamControllerClose): Aligned queue with RSDC.
        (readableByteStreamControllerHandleQueueDrain): Aligned queue with RSDC.
        (readableByteStreamControllerPull): Aligned queue with RSDC.
        (readableByteStreamControllerEnqueue): Aligned queue with RSDC.
        (readableByteStreamControllerEnqueueChunk): Aligned queue with RSDC.
        (readableByteStreamControllerProcessPullDescriptors): Aligned queue with RSDC.
        (readableByteStreamControllerFillDescriptorFromQueue): Aligned queue with RSDC.
        (readableByteStreamControllerPullInto): Aligned queue with RSDC.
        * Modules/streams/StreamInternals.js:
        (dequeueValue): Updated to match spec.
        * bindings/js/WebCoreBuiltinNames.h: Removed now useless "totalQueuedBytes".

2017-10-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        "text/html" data is not exposed when dragging and dropping across origins
        https://bugs.webkit.org/show_bug.cgi?id=178253
        <rdar://problem/34971203>

        Reviewed by Ryosuke Niwa.

        Minor tweak to DataTransfer::setDataFromItemList to allow "text/html" written from bindings to transfer across
        origins without requiring a sanitized representation. Currently, sanitizedData is null, which limits "text/html"
        to being treated as custom data, inaccessible across origins. We should instead treat markup supplied via
        bindings the same way as we do "text/plain" supplied via bindings.

        Modified Tests: editing/pasteboard/data-transfer-set-data-sanitize-url-when-copying-in-null-origin.html
                        editing/pasteboard/data-transfer-set-data-sanitize-url-when-dragging-in-null-origin.html

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

2017-10-12  Brady Eidson  <beidson@apple.com>

        SW "Hello world".
        https://bugs.webkit.org/show_bug.cgi?id=178187

        Reviewed by Andy Estes.

        No new tests (Covered by changes to existing tests).

        With this patch, SW scripts are actually compiled and run inside a ServiceWorkerGlobalScope environment
        in the SW context process.

        * WebCore.xcodeproj/project.pbxproj:

        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::initScript):

        * dom/EventTargetFactory.in:

        * workers/WorkerGlobalScope.h:
        (WebCore::WorkerGlobalScope::isServiceWorkerGlobalScope const):

        * workers/service/ServiceWorkerContextData.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp.
        (WebCore::ServiceWorkerContextData::isolatedCopy const):
        * workers/service/ServiceWorkerContextData.h:
        (WebCore::ServiceWorkerContextData::encode const):
        (WebCore::ServiceWorkerContextData::decode):

        * workers/service/ServiceWorkerGlobalScope.cpp:
        (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
        (WebCore::ServiceWorkerGlobalScope::~ServiceWorkerGlobalScope):
        (WebCore::ServiceWorkerGlobalScope::registration):
        (WebCore::ServiceWorkerGlobalScope::eventTargetInterface const):
        * workers/service/ServiceWorkerGlobalScope.h:
        (WebCore::ServiceWorkerGlobalScope::create):
        (WebCore::ServiceWorkerGlobalScope::serverConnectionIdentifier const):

        * workers/service/context/SWContextManager.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp.
        (WebCore::SWContextManager::singleton):
        (WebCore::SWContextManager::SWContextManager):
        (WebCore::SWContextManager::startServiceWorkerContext):
        * workers/service/context/SWContextManager.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h.

        * workers/service/context/ServiceWorkerThread.cpp: Added.
        (WebCore::ServiceWorkerThreadProxy::sharedDummyProxy):
        (WebCore::ServiceWorkerThread::ServiceWorkerThread):
        (WebCore::m_workerObjectProxy):
        (WebCore::ServiceWorkerThread::~ServiceWorkerThread):
        (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
        (WebCore::ServiceWorkerThread::runEventLoop):
        * workers/service/context/ServiceWorkerThread.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h.
        (WebCore::ServiceWorkerThread::create):
        (WebCore::ServiceWorkerThread::workerObjectProxy const):

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

2017-10-12  Alex Christensen  <achristensen@webkit.org>

        Use asynchronous ResourceHandleClient calls for WebKit1
        https://bugs.webkit.org/show_bug.cgi?id=160677

        Reviewed by Brady Eidson.

        Covered by existing tests.

        * PlatformAppleWin.cmake:
        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::willSendRequestAsync):
        (WebCore::ResourceLoader::didReceiveResponseAsync):
        (WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
        * loader/ResourceLoader.h:
        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
        (WebCore::ApplicationCacheGroup::willSendRequestAsync):
        (WebCore::ApplicationCacheGroup::canAuthenticateAgainstProtectionSpaceAsync):
        (WebCore::ApplicationCacheGroup::didReceiveResponse): Deleted.
        * loader/appcache/ApplicationCacheGroup.h:
        * platform/network/BlobResourceHandle.cpp:
        (WebCore::BlobResourceHandle::continueDidReceiveResponse):
        (WebCore::BlobResourceHandle::getSizeForNext):
        (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
        (WebCore::BlobResourceHandle::notifyResponseOnError):
        * platform/network/PingHandle.h:
        * platform/network/ResourceHandle.cpp:
        (WebCore::ResourceHandle::didReceiveResponse):
        (WebCore::ResourceHandle::usesAsyncCallbacks): Deleted.
        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleClient.cpp:
        (WebCore::ResourceHandleClient::~ResourceHandleClient):
        (WebCore::ResourceHandleClient::willSendRequest): Deleted.
        (WebCore::ResourceHandleClient::willSendRequestAsync): Deleted.
        (WebCore::ResourceHandleClient::didReceiveResponseAsync): Deleted.
        (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
        * platform/network/ResourceHandleClient.h:
        (WebCore::ResourceHandleClient::didReceiveAuthenticationChallenge):
        (WebCore::ResourceHandleClient::didReceiveResponse): Deleted.
        (WebCore::ResourceHandleClient::usesAsyncCallbacks): Deleted.
        (WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpace): Deleted.
        * platform/network/ResourceHandleInternal.h:
        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
        * platform/network/SynchronousLoaderClient.cpp:
        (WebCore::SynchronousLoaderClient::willSendRequestAsync):
        (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpaceAsync):
        (WebCore::SynchronousLoaderClient::didReceiveResponseAsync):
        (WebCore::SynchronousLoaderClient::didFinishLoading):
        (WebCore::SynchronousLoaderClient::didFail):
        (WebCore::SynchronousLoaderClient::willSendRequest): Deleted.
        (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace): Deleted.
        (WebCore::SynchronousLoaderClient::didReceiveResponse): Deleted.
        * platform/network/SynchronousLoaderClient.h:
        * platform/network/cf/ResourceHandleCFNet.cpp:
        (WebCore::ResourceHandle::createCFURLConnection):
        (WebCore::ResourceHandle::start):
        (WebCore::ResourceHandle::willSendRequest):
        (WebCore::ResourceHandle::shouldUseCredentialStorage):
        (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::ResourceHandleCFURLConnectionDelegateWithOperationQueue):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::shouldUseCredentialStorage):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueCanAuthenticateAgainstProtectionSpace):
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
        * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Removed.
        * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h: Removed.
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::start):
        (WebCore::ResourceHandle::schedule):
        (WebCore::ResourceHandle::makeDelegate):
        (WebCore::ResourceHandle::delegate):
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        (WebCore::ResourceHandle::willSendRequest):
        (WebCore::ResourceHandle::continueWillSendRequest):
        (WebCore::ResourceHandle::continueDidReceiveResponse):
        (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace):
        (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace):
        (WebCore::ResourceHandle::continueWillCacheResponse):
        (WebCore::ResourceHandle::shouldUseCredentialStorage): Deleted.
        * platform/network/mac/WebCoreResourceHandleAsDelegate.h: Removed.
        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Removed.
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

2017-10-12  Chris Dumez  <cdumez@apple.com>

        [Mac] Add support for MouseEvent.buttons
        https://bugs.webkit.org/show_bug.cgi?id=178214

        Reviewed by Ryosuke Niwa.

        Add support for MouseEvent.buttons on Mac as per:
        - https://www.w3.org/TR/uievents/#ref-for-dom-mouseevent-buttons-1

        This is supported by Firefox and Chrome already.

        No new tests, rebaselined existing test.

        * dom/Element.cpp:
        (WebCore::Element::dispatchMouseEvent):
        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::create):
        (WebCore::MouseEvent::MouseEvent):
        * dom/MouseEvent.h:
        (WebCore::MouseEvent::buttons const):
        * dom/MouseEvent.idl:
        * dom/MouseEventInit.h:
        * dom/MouseEventInit.idl:
        * dom/SimulatedClick.cpp:
        * dom/WheelEvent.cpp:
        * page/EventHandler.cpp:
        (WebCore::EventHandler::dispatchDragEvent):
        * platform/PlatformMouseEvent.h:
        (WebCore::PlatformMouseEvent::buttons const):
        * platform/mac/PlatformEventFactoryMac.mm:
        (WebCore::currentlyPressedMouseButtons):
        (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):

2017-10-12  David Kilzer  <ddkilzer@apple.com>

        [iOS] Fix -Wunused-lambda-capture warnings in WebCore/WebKit with new clang compiler
        <https://webkit.org/b/178226>

        Reviewed by Chris Fleizach.

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
        - Remove unused lambda variable 'self'.

2017-10-12  Daniel Bates  <dabates@apple.com>

        Mark more InlineBox member functions as const
        https://bugs.webkit.org/show_bug.cgi?id=178217

        Reviewed by Andy Estes.

        * rendering/InlineBox.cpp:
        (WebCore::InlineBox::locationIncludingFlipping const): Mark as const. Also fix some style
        nits while I am here.
        (WebCore::InlineBox::flipForWritingMode const): Mark as const.
        (WebCore::InlineBox::locationIncludingFlipping): Deleted.
        (WebCore::InlineBox::flipForWritingMode): Deleted.
        * rendering/InlineBox.h:

2017-10-12  Daniel Bates  <dabates@apple.com>

        Teach InlineTextBox::clampOffset() about combined text and hyphenation
        https://bugs.webkit.org/show_bug.cgi?id=178032

        Reviewed by Zalan Bujtas.

        Treat combined text and the last character of a word halve plus hyphen as single units.

        With regards to combined text, ideally we would allow arbitrary selection inside combined
        text. Currently we do not support selection of combined text. To simplify the process of
        adding support for selecting combined text we treat combined text as a single unit. Once
        we are confident that we correctly implemented such support we can re-evaluate allowing
        arbitrary selection of combined text.

        With regards to treating the last character of a word halve plus hyphen as a single unit.
        This patch extends the targeted fix made for document markers in r223013 to all code that
        makes use of clamped offsets as a result the selection rect for inline boxes more accurately
        reflect the rectangle(s) that make up the painted selection. This is a step towards reconciling
        the difference between the computation of the rectangle that represents an arbitrary
        selection and the code that paints the active selection as part of <https://bugs.webkit.org/show_bug.cgi?id=138913>.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::localSelectionRect const): Compute text run, including combined text
        or hyphens due to line wrapping now that specified start and end positions are clamped with
        respect to combined text and hyphens (computed earlier in this function). Only measure the
        text represented by the selection if the start position > 0 or the end position is not equal
        to the length of the run.
        (WebCore::InlineTextBox::paint): Remove unnecessary code to fix up the selection start and
        end positions based on the truncation offset as this is done by clampedOffset(), called by
        selectionStartEnd().
        (WebCore::InlineTextBox::clampedOffset const): Modified to adjust the clamped offset with
        respect to truncation as well as treat combined text or a trailing word halve plus hyphen
        as single units. Assert that we are not fully truncated because it does not make sense to
        be computing the clamped offset in such a situation since nothing should be painted.
        (WebCore::InlineTextBox::selectionStartEnd const): Modified to compute the end of an inside
        selection using clampedOffset() to account for truncation, combined text or a hyphen. We
        already are using clampedOffset() when computing the start and end position for all other
        selection states.
        (WebCore::InlineTextBox::paintSelection): Compute text run, including combined text
        or hyphens due to line wrapping now that specified start and end positions are clamped with
        respect to combined text and hyphens (computed earlier in this function). Remove unnecessary
        code to adjust selection end point with respect to truncation, combined text, or an added
        hyphen now that selectionStartEnd() takes care of this (via clampedOffset()).
        (WebCore::InlineTextBox::paintTextSubrangeBackground): Compute text run, including combined
        text or hyphens due to line wrapping now that specified start and end positions are clamped
        with respect to combined text and hyphens (computed earlier in this function).
        (WebCore::InlineTextBox::paintDocumentMarker): Compute text run, including combined text now
        that specified start and end positions are clamped with respect to combined text (computed earlier in this function).
        Also remove unnecessary code to adjust end offset of the marker with respect to truncation
        and length of the text run as clampedOffset() now does this for us.

2017-10-11  Simon Fraser  <simon.fraser@apple.com>

        Don't assert if mix-blend-mode is set to a non-separable blend mode on a composited layer
        https://bugs.webkit.org/show_bug.cgi?id=178196
        rdar://problem/34942337

        Reviewed by Dan Bates.

        Core Animation doesn't support non-separable blend modes (hue, saturation, color, luminosity)
        on layers, but don't assert if we try to use them.

        Test: compositing/filters/blend-mode-saturation.html

        * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
        (PlatformCAFilters::setBlendingFiltersOnLayer):

2017-10-12  John Wilander  <wilander@apple.com>

        ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
        https://bugs.webkit.org/show_bug.cgi?id=175257
        <rdar://problem/33359866>

        Reviewed by Brent Fulgham.

        This patch was joint work between Michael Specter and John Wilander.

        Tests: http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
               http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html
               http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
               http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html
               http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
               http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html
               http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
               http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html
               http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
               http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html
               http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html
               http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::willSendRequest):
            Now sends redirectResponse.url() to WebCore::ResourceLoadObserver::logFrameNavigation().
        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::logFrameNavigation):
            Now receives the redirect response URL from WebCore::DocumentLoader().
        (WebCore::ResourceLoadObserver::nonNullOwnerURL const):
            New function to traverse the frame chain upward and find the first non-null URL.
        * loader/ResourceLoadObserver.h:

2017-10-12  Frederic Wang  <fwang@igalia.com>

        Use less specific cast in ScrollingTree::scrollPositionChangedViaDelegatedScrolling
        https://bugs.webkit.org/show_bug.cgi?id=178211

        Reviewed by Simon Fraser.

        No new tests, behavior is not changed.

        ScrollingTree::scrollPositionChangedViaDelegatedScrolling is a generic function that applies
        to scrolling nodes. Casting to more specific ScrollingTreeOverflowScrollingNodes is however
        not necessary to implement it. This patch moves to the least specific cast necessary so that
        this function will be usable for async scrolling of non-main frames in the future. Note that
        the function is currently only called from ScrollingTreeScrollingNodeDelegateIOS which in
        turn is only used by the ScrollingTreeScrollingOverflowNodeIOS class and so code behavior is
        not changed.

        * page/scrolling/ScrollingTree.cpp:
        (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Only cast the node to
        ScrollingTreeScrollingNode.

2017-10-11  Sam Weinig  <sam@webkit.org>

        Remove out-parameter variants of copyToVector
        https://bugs.webkit.org/show_bug.cgi?id=178155

        Reviewed by Tim Horton.

        * Modules/geolocation/Geolocation.cpp:
        (WebCore::Geolocation::stopTimersForOneShots):
        (WebCore::Geolocation::cancelAllRequests):
        (WebCore::Geolocation::handleError):
        (WebCore::Geolocation::makeSuccessCallbacks):
        * Modules/indexeddb/IDBDatabase.cpp:
        (WebCore::IDBDatabase::transaction):
        * Modules/indexeddb/IDBGetAllResult.cpp:
        (WebCore::IDBGetAllResult::allBlobFilePaths const):
        * Modules/indexeddb/server/MemoryIndex.cpp:
        (WebCore::IDBServer::MemoryIndex::notifyCursorsOfValueChange):
        (WebCore::IDBServer::MemoryIndex::notifyCursorsOfAllRecordsChanged):
        * css/CSSFontSelector.cpp:
        (WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
        * dom/Document.cpp:
        (WebCore::Document::moveNodeIteratorsToNewDocument):
        (WebCore::Document::resume):
        (WebCore::Document::didAssociateFormControlsTimerFired):
        * dom/IdTargetObserverRegistry.cpp:
        (WebCore::IdTargetObserverRegistry::notifyObserversInternal):
        * dom/MutationObserver.cpp:
        (WebCore::MutationObserver::notifyMutationObservers):
        * dom/Node.cpp:
        (WebCore::Document::invalidateNodeListAndCollectionCaches):
        * dom/RadioButtonGroups.cpp:
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::dispatchMessagePortEvents):
        (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
        (WebCore::ApplicationCacheGroup::deliverDelayedMainResources):
        * loader/cache/MemoryCache.cpp:
        (WebCore::MemoryCache::forEachResource):
        (WebCore::MemoryCache::pruneDeadResourcesToSize):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::willDestroyCachedFrame):
        (WebCore::DOMWindow::willDestroyDocumentInFrame):
        (WebCore::DOMWindow::willDetachDocumentFromFrame):
        (WebCore::DOMWindow::disconnectDOMWindowProperties):
        (WebCore::DOMWindow::reconnectDOMWindowProperties):
        * page/FrameView.cpp:
        (WebCore::collectAndProtectWidgets):
        * page/MemoryRelease.cpp:
        (WebCore::releaseCriticalMemory):
        * page/Performance.cpp:
        (WebCore::Performance::queueEntry):
        * platform/cocoa/PasteboardCocoa.mm:
        (WebCore::Pasteboard::typesForLegacyUnsafeBindings):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::FontCache::systemFontFamilies):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
        * platform/ios/WebCoreMotionManager.mm:
        (-[WebCoreMotionManager sendAccelerometerData:]):
        (-[WebCoreMotionManager sendMotionData:withHeading:]):
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
        * platform/network/cocoa/WebCoreNSURLSession.mm:
        (-[WebCoreNSURLSession invalidateAndCancel]):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::endAndCommitUpdateScrollInfoAfterLayoutTransaction):
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::setLogicalWidthForTextRun):
        * rendering/RenderDeprecatedFlexibleBox.cpp:
        (WebCore::FlexBoxIterator::next):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::paintObject):

            Replace out-parameter based copyToVector, with one that returns a Vector.

2017-10-12  Yusuke Suzuki  <utatane.tea@gmail.com>

        Support integrity="" on module scripts
        https://bugs.webkit.org/show_bug.cgi?id=177959

        Reviewed by Sam Weinig.

        This patch extends module hooks to accept fetching parameters.
        When starting fetching modules, WebCore creates ModuleFetchParameters.
        And this parameters is propagated to the fetch hook. Then, fetch
        hook can use this parameters to fetch modules.

        This parameters only contains `integrity` field. This "integrity" is
        used to perform subresource integrity check in module loader pipeline.
        And this error is just proparaged as errors in module pipeline, which
        is the same to the other types of errors in module pipeline.

        Test: http/tests/subresource-integrity/sri-module.html

        * ForwardingHeaders/runtime/JSScriptFetchParameters.h: Added.
        * ForwardingHeaders/runtime/ScriptFetchParameters.h: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/CachedModuleScriptLoader.cpp:
        (WebCore::CachedModuleScriptLoader::create):
        (WebCore::CachedModuleScriptLoader::CachedModuleScriptLoader):
        Take parameters, which includes "integrity".

        * bindings/js/CachedModuleScriptLoader.h:
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::moduleLoaderFetch):
        (WebCore::JSDOMWindowBase::moduleLoaderImportModule):
        import and fetch hooks take parameters.

        * bindings/js/JSDOMWindowBase.h:
        * bindings/js/JSMainThreadExecState.h:
        (WebCore::JSMainThreadExecState::loadModule):
        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::loadModuleScriptInWorld):
        (WebCore::ScriptController::loadModuleScript):
        Pass parameters to the entry point of the module pipeline.

        * bindings/js/ScriptController.h:
        * bindings/js/ScriptModuleLoader.cpp:
        (WebCore::ScriptModuleLoader::fetch):
        If parameters are passed, we set them to CachedModuleScriptLoader.

        (WebCore::ScriptModuleLoader::importModule):
        Pass parameters to the entry point of dynamic import.

        (WebCore::ScriptModuleLoader::notifyFinished):
        If script loader has parameters, we perform subresource integrity check here.

        * bindings/js/ScriptModuleLoader.h:
        * dom/LoadableModuleScript.cpp:
        (WebCore::LoadableModuleScript::create):
        (WebCore::LoadableModuleScript::LoadableModuleScript):
        (WebCore::LoadableModuleScript::load):
        Create ModuleFetchParameters with "integrity" value.

        * dom/LoadableModuleScript.h:
        * dom/ModuleFetchParameters.h: Copied from Source/WebCore/bindings/js/CachedModuleScriptLoader.h.
        (WebCore::ModuleFetchParameters::create):
        (WebCore::ModuleFetchParameters::integrity const):
        (WebCore::ModuleFetchParameters::ModuleFetchParameters):
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::requestModuleScript):
        Pass "integrity" value to the module script.

2017-10-12  Tomas Popela  <tpopela@redhat.com>

        Unreviewed, fix compilation warning

        warning: extra tokens at end of #endif directive [-Wendif-labels]

        * rendering/RenderMediaControls.h:

2017-10-11  Brent Fulgham  <bfulgham@apple.com>

        Correct nullptr deref in selection handling.
        https://bugs.webkit.org/show_bug.cgi?id=178189
        <rdar://problem/33833012>

        Reviewed by Ryosuke Niwa.

        The VisibleSelection::toNormalizedRange returns nullptr for certain conditions (e.g., 'isNone'
        and 'isOrphaned' cases). It's possible to crash the WebProcess by executing a code path with
        an orphaned selection range.

        The return value of 'toNormalizedRange' is checked for nullptr in many places, but not everywhere.
        This patch adds those missing nullptr checks.

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]):
        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
        * editing/EditingStyle.cpp:
        (WebCore::EditingStyle::styleAtSelectionStart):
        * editing/Editor.cpp:
        (WebCore::Editor::misspelledWordAtCaretOrRange const):
        * page/DOMSelection.cpp:
        (WebCore::DOMSelection::containsNode const):
        * page/DragController.cpp:
        (WebCore::DragController::concludeEditDrag):

2017-10-11  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r223215.

        This change broke the Sierra build.

        Reverted changeset:

        "[Apple Pay] Add subLocality and subAdministrativeArea to
        ApplePayPaymentContact"
        https://bugs.webkit.org/show_bug.cgi?id=178191
        https://trac.webkit.org/changeset/223215

2017-10-11  Chris Dumez  <cdumez@apple.com>

        XMLHttpRequest: do not sniff text/html, and do not sniff XML when responseType is set to "text"
        https://bugs.webkit.org/show_bug.cgi?id=168724

        Reviewed by Ryosuke Niwa.

        WebKit enabled HTML / XML charset detection for HTML-ish / XML-ish
        responses even when response type is text, which does not match the
        specification.

        This patch is based on the following Blink patch by Yutaka Hirano <yhirano@chromium.org>:
        - https://chromium.googlesource.com/chromium/src.git/+/47e4fc53e6d68c0a788fcc26de598b9e3848033f

        Tests:
        imported/w3c/web-platform-tests/XMLHttpRequest/responsetext-decoding.htm
        imported/w3c/web-platform-tests/XMLHttpRequest/responsedocument-decoding.htm

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::createDecoder const):
        (WebCore::XMLHttpRequest::didReceiveData):
        * xml/XMLHttpRequest.h:

2017-10-11  Andy Estes  <aestes@apple.com>

        [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact
        https://bugs.webkit.org/show_bug.cgi?id=178191
        <rdar://problem/34906367>

        Reviewed by Tim Horton.

        Added test cases to http/tests/ssl/applepay/ApplePaySession.html.

        * Modules/applepay/ApplePayPaymentContact.h:
        * Modules/applepay/ApplePayPaymentContact.idl:
        * Modules/applepay/cocoa/PaymentContactCocoa.mm:
        (WebCore::convert):

2017-10-11  Youenn Fablet  <youenn@apple.com>

        Add API to clean CacheStorage data
        https://bugs.webkit.org/show_bug.cgi?id=178034

        Reviewed by Chris Dumez.

        Test: http/tests/cache-storage/cache-clearing.https.html

        * platform/FileSystem.h:

2017-10-11  David Kilzer  <ddkilzer@apple.com>

        Part 2: Fix -Wcast-qual and -Wunused-lambda-capture warnings in WebCore with new clang compiler
        <https://webkit.org/b/178036>
        <rdar://problem/33667497>

        Reviewed by Chris Dumez.

        * Modules/cache/WorkerCacheStorageConnection.cpp:
        (WebCore::WorkerCacheStorageConnection::doRemove):
        - Change ASSERT() to ASSERT_UNUSED() to suppress warnings about
          unused lambda capture for 'cacheIdentifier' in Release builds.
        * bridge/objc/objc_class.mm:
        (JSC::Bindings::ObjcClass::classForIsA): Change C-style cast
        into reinterpret_cast and const_cast to go from CFTypeRef to
        ObjcClass*.
        * crypto/mac/CryptoKeyRSAMac.cpp:
        (WebCore::castDataArgumentToCCRSACryptorCreateFromDataIfNeeded):
        Add.  Introduce method to add a required const_cast for older
        OSes since the signature of CCRSACryptorCreateFromData() changed
        in iOS 11 & High Sierra.
        (WebCore::CryptoKeyRSA::create): Use
        castDataArgumentToCCRSACryptorCreateFromDataIfNeeded().
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
        Remove unused lambda capture for 'status'.

2017-10-11  Chris Dumez  <cdumez@apple.com>

        [Geolocation] Expose Coordinates.floorLevel
        https://bugs.webkit.org/show_bug.cgi?id=178173
        <rdar://problem/34918936>

        Reviewed by Ryosuke Niwa.

        Expose Coordinates.floorLevel via the Geolocation API. This is currently
        a WebKit-specific extension and it is only populated on iOS / WKTR / DRT.
        It is null on other platforms.

        Test: fast/dom/Geolocation/floorLevel.html

        * Modules/geolocation/Coordinates.h:
        (WebCore::Coordinates::floorLevel const):
        * Modules/geolocation/Coordinates.idl:
        * Modules/geolocation/GeolocationPosition.h:
        (WebCore::GeolocationPosition::encode const):
        (WebCore::GeolocationPosition::decode):
        * Modules/geolocation/ios/GeolocationPositionIOS.mm:
        (WebCore::GeolocationPosition::GeolocationPosition):
        * page/Settings.in:

2017-10-11  Simon Fraser  <simon.fraser@apple.com>

        Avoid triggering layout from style change
        https://bugs.webkit.org/show_bug.cgi?id=178184
        rdar://problem/34699113

        Reviewed by Zalan Bujtas.

        It's bad for RenderBox::styleDidChange() to scroll RenderLayers, because that
        can trigger layout via FrameView::updateWidgetPositions() and ScrollingCoordinator::absoluteEventTrackingRegions().
        So postpone the scrolling until after layout.

        Test: fast/scrolling/adjust-scroll-offset-on-zoom.html

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::styleDidChange):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositions):
        (WebCore::RenderLayer::setPostLayoutScrollPosition):
        (WebCore::RenderLayer::applyPostLayoutScrollPositionIfNeeded):
        * rendering/RenderLayer.h:

2017-10-11  Youenn Fablet  <youenn@apple.com>

        Bump default cache storage quota to 20MB
        https://bugs.webkit.org/show_bug.cgi?id=178132

        Reviewed by Alex Christensen.

        Covered by http/wpt/cache-storage/cache-quota.any.html.

        * platform/network/NetworkStorageSession.h:
        (WebCore::NetworkStorageSession::cacheStoragePerOriginQuota const):
        (WebCore::NetworkStorageSession::setCacheStoragePerOriginQuota):

2017-10-11  Myles C. Maxfield  <mmaxfield@apple.com>

        Allow PAL to log messages
        https://bugs.webkit.org/show_bug.cgi?id=171523

        Reviewed by Alex Christensen.

        Make the model of WebCore/PAL match the model of WebKit/WebCore. This is because PAL will
        need to log things (because existing files in WebCore/platform need to log things).

        No new tests because there is no behavior change.

        * WebCore.xcodeproj/project.pbxproj:
        * page/mac/PageMac.mm:
        (WebCore::Page::platformInitialize):
        * platform/Logging.cpp:
        (WebCore::registerNotifyCallback): Deleted.
        * platform/Logging.h:
        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::canUseForWithReason):

2017-10-11  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix build with some SDKs.

        Stop capturing |this| unnecessarily in lambda.

        * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
        (WebCore::FileSystemDirectoryEntry::getEntry):

2017-10-11  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix build with some SDKs.

        Stop capturing |this| unnecessarily in lambda.

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::DOMFileSystem::getFile):

2017-10-11  Daniel Bates  <dabates@apple.com>

        Extract logic to paint composition underlines to its own function
        https://bugs.webkit.org/show_bug.cgi?id=178038

        Reviewed by Zalan Bujtas.

        No functionality changed. So, no new tests.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paint): Modified to call paintCompositionUnderlines().
        (WebCore::InlineTextBox::paintCompositionUnderlines const): Added; extract code
        from InlineTextBox::paint() and modernized it.
        (WebCore::InlineTextBox::paintCompositionUnderline const): Added.
        (WebCore::InlineTextBox::paintCompositionUnderline): Deleted; made const.
        * rendering/InlineTextBox.h:

2017-10-11  Daniel Bates  <dabates@apple.com>

        InlineTextBox::isSelected() should only return true for a non-empty selection
        and remove incorrect FIXME from InlineTextBox::localSelectionRect()
        https://bugs.webkit.org/show_bug.cgi?id=160786

        Reviewed by Zalan Bujtas.

        Partial revert of r204400 in InlineTextBox::{isSelected, localSelectionRect}().

        The function InlineTextBox::isSelected() should only return true for a non-empty selection.
        Also remove an incorrect FIXME added to InlineTextBox::localSelectionRect() that questioned
        whether it was correct for it to return an empty rectangle. It is correct for it to return
        such a rectangle because this function is used to implement Element.getClientRects(). And
        Element.getClientRects() can return a rectangle with zero width or zero height by step 3
        of algorithm getClientRects() of section Extensions to the Element interface of the
        CSSOM View Module spec., <https://drafts.csswg.org/cssom-view/> (Editor's Draft, 15 September 2017).

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::isSelected const): Only return true for a non-empty selection
        and remove unnecessary FIXME. Also rename variables to improve readability.
        (WebCore::InlineTextBox::localSelectionRect const): Remove inaccurate FIXME comment.
        * rendering/InlineTextBox.h:

2017-10-11  Ryosuke Niwa  <rniwa@webkit.org>

        Sanitize URL in pasteboard for other applications and cross origin content
        https://bugs.webkit.org/show_bug.cgi?id=178060
        <rdar://problem/34874518>

        Reviewed by Wenson Hsieh.

        This patch introduces the sanitization of URL when written from a web content to prevent web content from
        exploiting the URL parser of other applications in the system particularly of those that actively monitor
        system pasteboard (a.k.a. clipboard on non-Cocoa platforms) and decode or otherwise process URLs.

        Because the Web compatibility requires that DataTransfer exposes the original URL to any document in the
        same origin as the one which wrote the URL into the pasteboard, we store a string which uniquely identifies
        the origin of an originating document into our custom pasteboard data. Note that we expose any URL which
        didn't come from WebKit since we don't expect URLs to reveal privacy sensitive information. We use UUID for
        the origin identifier of a null origin document.

        An alternative approach is to store the pasteboard data from the same origin into the document and invalidate
        it when the system pasteboard changes. However, Pasteboard object cannot know about Document (as Pasteboard
        is a platform object and Document is a WebCore object), this turns out be quite tricky as there are multiple
        places where we create Pasteboard objects, and they all need to be aware of this special same origin
        Pasteboard object that hangs off of Document. Also, this approach would result in the same origin code paths
        to diverge between null origin and non-null origin documents.

        Tests: editing/pasteboard/data-transfer-get-data-on-copying-pasting-malformed-url-in-same-document.html
               editing/pasteboard/data-transfer-set-data-ignore-copied-walformed-url-in-null-origin.html
               editing/pasteboard/data-transfer-set-data-sanitlize-url-when-copying-in-null-origin.html
               editing/pasteboard/data-transfer-set-data-sanitlize-url-when-dragging-in-null-origin.html
               http/tests/security/clipboard/copy-paste-url-across-origin-sanitizes-url.html
               CopyURL.ValidURL
               CopyURL.UnescapedURL
               CopyURL.MalformedURL
               DataInteractionTests.DataTransferSetDataValidURL
               DataInteractionTests.DataTransferSetDataUnescapedURL
               DataInteractionTests.DataTransferSetDataInvalidURL

        * dom/DataTransfer.cpp:
        (WebCore::originForDocument): Extracted from createForCopyAndPaste.
        (WebCore::DataTransfer::createForCopyAndPaste):
        (WebCore::DataTransfer::getDataForItem const): Read the URL from the custom data when the originating content
        is of the same origin. When the originating content is cross origin, or there is no custom data (e.g. written
        by another native application; or sanitization didn't result in any difference), then callback to native value.
        (WebCore::DataTransfer::setDataFromItemList): Sanitize the URL before writing it to the native pasteboard.
        Store the original value if the sanitization resulted in any difference.
        (WebCore::DataTransfer::types const):
        (WebCore::DataTransfer::commitToPasteboard): Moved the code to write custom data to Pasteboard since we need
        to write the origin string with it.
        (WebCore::DataTransfer::createForDragStartEvent): Added Document as an argument to compute the origin string.
        (WebCore::DataTransfer::createForDrop): Ditto.
        (WebCore::DataTransfer::createForUpdatingDropTarget):
        (WebCore::DataTransfer::moveDragState):
        * dom/DataTransfer.h:
        * dom/Document.cpp:
        (WebCore::Document::uniqueIdentifier): Added. See above.
        * dom/Document.h:
        * editing/Editor.cpp:
        (WebCore::createDataTransferForClipboardEvent):
        (WebCore::dispatchClipboardEvent):
        * page/DragController.cpp:
        (WebCore::DragController::dispatchTextInputEventFor):
        * page/EventHandler.cpp:
        (WebCore::EventHandler::performDragAndDrop):
        (WebCore::EventHandler::handleDrag):
        * platform/Pasteboard.h:
        * platform/PasteboardStrategy.h:
        * platform/PlatformPasteboard.h:
        * platform/StaticPasteboard.cpp:
        (WebCore::StaticPasteboard::takeCustomData): Moved the logic to write to native pasteboard to DataTransfer.
        * platform/StaticPasteboard.h:
        * platform/cocoa/PasteboardCocoa.mm:
        (WebCore::Pasteboard::typesSafeForBindings):
        (WebCore::Pasteboard::readStringInCustomData): Rewritten using readCustomData. See below.
        (WebCore::Pasteboard::readOrigin): Added.
        (WebCore::Pasteboard::readCustomData): Added. Populates the cache. Because a single Pasteboard object is never
        allowed to read values once its content is updated by other applications, we can permanently cache the result.
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::typesSafeForBindings): Now takes the unused origin string.
        (WebCore::Pasteboard::readOrigin): Added.
        * platform/gtk/PlatformPasteboardGtk.cpp:
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Now takes the unused origin string.
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::originKeyKeyForTeamData): Added.
        (WebCore::customTypesKeyForTeamData): Added. Replaces the use of PasteboardCustomData::cocoaType() in the team
        data for clarity since the team data key isn't same as the pasteboard type. We don't have to worry about the
        backwards compatibility since drag & drop session doesn't persist across iOS upgrades, and there is no publicly
        released iOS with this team data support.
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Read the origin string and the custom data
        off the team data. Don't expose custom types that are written by cross origin documents.
        (WebCore::PlatformPasteboard::write): Add the orign string with custom pasteboard types in the team data.
        (WebCore::PlatformPasteboard::readURL): Fixed a bug that this function was not reading NSURL when UIPasteboard
        serializes NSURL as a plist. This code is exercised by CopyURL.ValidURL.
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Don't add custom pasteboard types that are
        added by cross origin documents.
        * platform/win/PasteboardWin.cpp:
        (WebCore::Pasteboard::typesSafeForBindings): Now takes the unused origin string.
        (WebCore::Pasteboard::readOrigin): Added.
        * platform/wpe/PasteboardWPE.cpp:
        (WebCore::Pasteboard::typesSafeForBindings): Now takes the unused origin string.
        (WebCore::Pasteboard::readOrigin): Added.
        * platform/wpe/PlatformPasteboardWPE.cpp:
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Now takes the unused origin string.

2017-10-11  Antti Koivisto  <antti@apple.com>

        Remove some obsolete layout assertions
        https://bugs.webkit.org/show_bug.cgi?id=178170

        Reviewed by Zalan Bujtas.

        We have strong assertions against render tree mutation functions being called in layout. These are unnecessary.

        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::moveChildTo):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::takeChildInternal):
        * rendering/RenderElement.h:
        * rendering/RenderListItem.cpp:
        (WebCore::RenderListItem::layout):
        * rendering/RenderListItem.h:

2017-10-11  Andy Estes  <aestes@apple.com>

        [Payment Request] Implement Apple Pay merchant validation
        https://bugs.webkit.org/show_bug.cgi?id=178159

        Reviewed by Brady Eidson.

        When ApplePayPaymentHandler::validateMerchant() is called, dispatch the
        applepayvalidatemerchant event to the PaymentRequest object.

        The event object is an ApplePayMerchantValidationEvent, on which the client calls complete()
        with a merchant session.

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

        * DerivedSources.make:
        * Modules/applepay/ApplePayValidateMerchantEvent.h:
        * Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.cpp: Added.
        (WebCore::ApplePayMerchantValidationEvent::create):
        (WebCore::ApplePayMerchantValidationEvent::ApplePayMerchantValidationEvent):
        (WebCore::ApplePayMerchantValidationEvent::complete):
        (WebCore::ApplePayMerchantValidationEvent::eventInterface const):
        * Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.h: Added.
        * Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.idl: Added.
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::ApplePayPaymentHandler::validateMerchant):
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
        * Modules/paymentrequest/PaymentRequest.idl:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/EventNames.h:
        * dom/EventNames.in:
        * testing/Internals.cpp:
        (WebCore::Internals::Internals):
        * testing/MockPaymentCoordinator.cpp:
        (WebCore::MockPaymentCoordinator::MockPaymentCoordinator):
        (WebCore::MockPaymentCoordinator::showPaymentUI):
        * testing/MockPaymentCoordinator.h:

2017-10-11  Chris Dumez  <cdumez@apple.com>

        Modernize Geolocation code
        https://bugs.webkit.org/show_bug.cgi?id=178148

        Reviewed by Ryosuke Niwa.

        Modernize Geolocation code:
        - Use std::optional<> instead of separate boolean members
        - Make GeolocationPosition a simple struct that can be passed via IPC
        - Replace WebGeolocationPosition::Data with GeolocationPosition
        - Move logic to construct a GeolocationPosition from a CLLocation on iOS
          in one place to avoid code duplication.

        * Modules/geolocation/Coordinates.cpp:
        (WebCore::Coordinates::Coordinates):
        * Modules/geolocation/Coordinates.h:
        (WebCore::Coordinates::create):
        (WebCore::Coordinates::isolatedCopy const):
        (WebCore::Coordinates::latitude const):
        (WebCore::Coordinates::longitude const):
        (WebCore::Coordinates::altitude const):
        (WebCore::Coordinates::accuracy const):
        (WebCore::Coordinates::altitudeAccuracy const):
        (WebCore::Coordinates::heading const):
        (WebCore::Coordinates::speed const):
        * Modules/geolocation/Geolocation.cpp:
        (WebCore::createGeoposition):
        (WebCore::Geolocation::lastPosition):
        * Modules/geolocation/GeolocationClient.h:
        * Modules/geolocation/GeolocationController.cpp:
        (WebCore::GeolocationController::positionChanged):
        (WebCore::GeolocationController::lastPosition):
        * Modules/geolocation/GeolocationController.h:
        * Modules/geolocation/GeolocationPosition.h:
        (WebCore::GeolocationPosition::GeolocationPosition):
        The default constructor is only needed by our IPC decoding code.

        (WebCore::GeolocationPosition::encode const):
        (WebCore::GeolocationPosition::decode):
        * Modules/geolocation/ios/GeolocationPositionIOS.mm: Copied from Source/WebCore/Modules/geolocation/Coordinates.cpp.
        (WebCore::GeolocationPosition::GeolocationPosition):
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mock/GeolocationClientMock.cpp:
        (WebCore::GeolocationClientMock::lastPosition):
        (WebCore::GeolocationClientMock::controllerTimerFired):
        * platform/mock/GeolocationClientMock.h:

2017-10-11  Brady Eidson  <beidson@apple.com>

        Add a SW context process (where SW scripts will actually execute).
        https://bugs.webkit.org/show_bug.cgi?id=178156
        
        Reviewed by Andy Estes.

        No new tests (Covered by changes to existing tests).

        This patch adds an auxiliary "ServiceWorker context" WebProcess to a WebProcessPool.

        This process is where ServiceWorker scripts will execute, separate from the client WebProcess
        hosting the page(s) they are serving.

        This patch also adds all of the plumbing to pass along a fetched service worker script to this
        context WebProcess, as well as message back failure to actually start the script so we can test.

        Touches lots of code sites but is basically just a lot of plumbing.

        * WebCore.xcodeproj/project.pbxproj:

        * workers/service/ServiceWorkerContextData.h: Copied from Source/WebCore/workers/service/server/SWServerWorker.h.
        (WebCore::ServiceWorkerContextData::encode const):
        (WebCore::ServiceWorkerContextData::decode):

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::finishFetchingScriptInServer):
        (WebCore::SWServer::Connection::scriptContextFailedToStart):
        (WebCore::SWServer::scriptFetchFinished):
        (WebCore::SWServer::scriptContextFailedToStart):
        (WebCore::SWServer::createWorker):
        * workers/service/server/SWServer.h:

        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::scriptFetchFinished):
        (WebCore::SWServerRegistration::scriptContextFailedToStart):
        * workers/service/server/SWServerRegistration.h:

        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::SWServerWorker):
        (WebCore::SWServerWorker::~SWServerWorker):
        * workers/service/server/SWServerWorker.h:
        (WebCore::SWServerWorker::create):
        (WebCore::SWServerWorker::scriptURL const):
        (WebCore::SWServerWorker::script const):
        (WebCore::SWServerWorker::type const):
        (WebCore::SWServerWorker::workerID const):

2017-10-11  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] Expose value of aria-keyshortcuts as object attribute
        https://bugs.webkit.org/show_bug.cgi?id=171175

        Reviewed by Chris Fleizach.

        Expose the author-provided string through the "keyshortcuts" object attribute.

        Test: accessibility/gtk/aria-keyshortcuts.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::ariaKeyShortcutsValue const):
        * accessibility/AccessibilityObject.h:
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):
        * html/HTMLAttributeNames.in:

2017-10-11  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Drop Instantiate hook in ES6 module loader
        https://bugs.webkit.org/show_bug.cgi?id=178162

        Reviewed by Sam Weinig.

        Drop instantiate hooks.
        No behavior change.

        * bindings/js/JSDOMWindowBase.cpp:
        * bindings/js/JSWorkerGlobalScopeBase.cpp:

2017-10-11  Alicia Boya García  <aboya@igalia.com>

        [MSE][GStreamer] Add dump of append pipeline
        https://bugs.webkit.org/show_bug.cgi?id=178074

        Reviewed by Xabier Rodriguez-Calvar.

        Enable dump of AppendPipeline.

        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::appendPipelineStateChangeMessageCallback):
        (WebCore::AppendPipeline::AppendPipeline):
        (WebCore::AppendPipeline::handleStateChangeMessage):
        * platform/graphics/gstreamer/mse/AppendPipeline.h:

2017-09-27  Frederic Wang  <fwang@igalia.com>

        [iOS] Do not flatten frames when async frame scrolling is enabled
        https://bugs.webkit.org/show_bug.cgi?id=173704

        Reviewed by Simon Fraser.

        This patch disables frame flattening when async frame scrolling is enabled on iOS, as
        otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264),
        developers and beta testers will be able to check it by enabling "Async Frame Scrolling"
        in the "Experimental WebKit Features" menu of Safari iOS.

        Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html

        * page/FrameView.cpp:
        (WebCore::FrameView::frameFlatteningEnabled): Use effectiveFrameFlattening()
        * page/Settings.cpp:
        (WebCore::Settings::effectiveFrameFlattening): New function to return frameFlattening() or do
        some exceptions on iOS.
        * page/Settings.h: Declare effectiveFrameFlattening.
        * rendering/RenderFrameSet.cpp:
        (WebCore::RenderFrameSet::flattenFrameSet): Use effectiveFrameFlattening()
        * rendering/RenderIFrame.cpp:
        (WebCore::RenderIFrame::flattenFrame): Ditto.
        * rendering/RenderView.cpp:
        (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): Ditto.

2017-10-10  Xabier Rodriguez Calvar  <calvaris@igalia.com>

        [GStreamer] Fix double seek requested by downloadbuffer GStreamer element in webkibwebsrc
        https://bugs.webkit.org/show_bug.cgi?id=178079

        Reviewed by Žan Doberšek.

        When the downloadbuffer GStreamer element requests two seeks too
        close to each other there's some rare race condition where our
        source answers that it is not seekable and ends up with
        downloadbuffer element to seek beyond the file size, which causes
        the server to issue a 416 HTTP error code eventually, causing our
        MediaPlayer to stop.

        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (webKitWebSrcStop): We only unset he seekable attribute if we are
        not seeking.

2017-10-10  Ryosuke Niwa  <rniwa@webkit.org>

        Enable custom pasteboard data in DumpRenderTree and WebKitTestRunner
        https://bugs.webkit.org/show_bug.cgi?id=178154

        Reviewed by Wenson Hsieh.

        Extracted the logic to compute the default enabled-ness of custom pasteboard data as
        Settings::defaultCustomPasteboardDataEnabled() to be called by WebKit1 and WebKit2 layers.

        * page/Settings.cpp:
        (WebCore::Settings::defaultCustomPasteboardDataEnabled): Extracted from customPasteboardDataEnabled.
        (WebCore::Settings::customPasteboardDataEnabled): Deleted. Now inlined in the header file.
        * page/Settings.h:
        (WebCore::Settings::customPasteboardDataEnabled):
        * platform/cocoa/PasteboardCocoa.mm:
        (WebCore::Pasteboard::read): Fixed a bug that we were adding MIME type to the map before checking that
        we could actually read the buffer. We shouldn't skip a type (NSTIFFPboardType and kUTTypeTIFF for now)
        if an equivalent type had failed to read.

2017-10-10  Andy Estes  <aestes@apple.com>

        [Payment Request] Validate that all PaymentCurrencyAmounts use the same currency code when using Apple Pay
        https://bugs.webkit.org/show_bug.cgi?id=178150

        Reviewed by Tim Horton.

        Apple Pay requires a single currency code, but the Payment Request API allows the client to
        specify a currency code for each PaymentCurrencyAmount.

        Instead of having a required currencyCode property on ApplePayRequest and ignoring the
        currency property on PaymentCurrencyAmount, validate that all PaymentCurrencyAmounts use the
        same currency code and use that as ApplePaySessionPaymentRequest's currencyCode.

        Added test cases to http/tests/ssl/applepay/PaymentRequest.https.html.

        * Modules/applepay/ApplePayPaymentRequest.h:
        * Modules/applepay/ApplePayPaymentRequest.idl:
        * Modules/applepay/ApplePayRequestBase.cpp:
        (WebCore::convertAndValidate):
        * Modules/applepay/ApplePayRequestBase.h:
        * Modules/applepay/ApplePayRequestBase.idl:
        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::convertAndValidate):
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::validate):
        (WebCore::convertAndValidate):
        (WebCore::ApplePayPaymentHandler::show):
        * Modules/applepay/paymentrequest/ApplePayRequest.idl:

2017-10-10  Andy Estes  <aestes@apple.com>

        [Payment Request] Implement PaymentRequest.canMakePayment()
        https://bugs.webkit.org/show_bug.cgi?id=178048

        Reviewed by Youenn Fablet.

        Test: http/tests/paymentrequest/payment-request-canmakepayment-method.https.html

        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::ApplePayPaymentHandler::convertData): Moved
        ApplePayRequest-to-ApplePaySessionPaymentRequest conversion from here to show().
        (WebCore::ApplePayPaymentHandler::show): Returned an exception if
        ApplePaySessionPaymentRequest conversion fails.
        (WebCore::shouldDiscloseApplePayCapability): Checked if we are in an ephimeral session or if
        Settings::applePayCapabilityDisclosureAllowed() is false.
        (WebCore::ApplePayPaymentHandler::canMakePayment): Called
        PaymentCoordinator::canMakePayments() or PaymentCoordinator::canMakePaymentsWithActiveCard()
        depending on shouldDiscloseApplePayCapability().
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
        * Modules/applepay/paymentrequest/ApplePayRequest.h:
        * Modules/applepay/paymentrequest/ApplePayRequest.idl: Defined merchantIdentifier.
        * Modules/paymentrequest/PaymentHandler.h:
        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::parse): Moved JSON-parsing to here from show().
        (WebCore::PaymentRequest::show): Returned the exception from PaymentHandler::show().
        (WebCore::PaymentRequest::canMakePayment): For each payment method, try to create a
        PaymentHandler.
        For the first valid PaymentHandler, call canMakePayment() and pass a lambda that resolves
        the promise.
        * Modules/paymentrequest/PaymentRequest.h:
        * Modules/paymentrequest/PaymentRequest.idl: Added CallWith=Document annotations to show()
        and canMakePayment().

2017-10-10  Chris Dumez  <cdumez@apple.com>

        Unreviewed, really fix the build with certain SDKs.

        Follow-up to r223154, which fixed the wrong lambda.

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::DOMFileSystem::getEntry):
        (WebCore::DOMFileSystem::getFile):

2017-10-10  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix build with certain SDKs.

        Stop capturing |this| unnecessarily in lambda.

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::DOMFileSystem::getEntry):

2017-10-10  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r223148.

        This caused build failures.

        Reverted changeset:

        "Fix MSVC build with ENCRYPTED_MEDIA enabled"
        https://bugs.webkit.org/show_bug.cgi?id=177803
        http://trac.webkit.org/changeset/223148

2017-10-10  Zalan Bujtas  <zalan@apple.com>

        AccessibilityRenderObject should not hold a raw pointer to RenderObject
        https://bugs.webkit.org/show_bug.cgi?id=178144
        <rdar://problem/34919287>

        Reviewed by Chris Fleizach.

        m_renderer's lifetime is not directly tied to the AX wrapper object's lifetime.

        Covered by existing tests.

        * accessibility/AccessibilityListBox.cpp:
        (WebCore::AccessibilityListBox::elementAccessibilityHitTest const):
        * accessibility/AccessibilityMathMLElement.cpp:
        (WebCore::AccessibilityMathMLElement::isMathFenceOperator const):
        (WebCore::AccessibilityMathMLElement::isMathSeparatorOperator const):
        (WebCore::AccessibilityMathMLElement::mathLineThickness const):
        * accessibility/AccessibilityMenuList.cpp:
        (WebCore::AccessibilityMenuList::press):
        (WebCore::AccessibilityMenuList::isCollapsed const):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
        (WebCore::AccessibilityRenderObject::renderBoxModelObject const):
        (WebCore::AccessibilityRenderObject::setRenderer):
        (WebCore::AccessibilityRenderObject::previousSibling const):
        (WebCore::AccessibilityRenderObject::anchorElement const):
        (WebCore::AccessibilityRenderObject::helpText const):
        (WebCore::AccessibilityRenderObject::boundingBoxRect const):
        (WebCore::AccessibilityRenderObject::supportsPath const):
        (WebCore::AccessibilityRenderObject::elementPath const):
        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
        (WebCore::AccessibilityRenderObject::index const):
        (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
        (WebCore::AccessibilityRenderObject::observableObject const):
        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
        (WebCore::AccessibilityRenderObject::textChanged):
        (WebCore::AccessibilityRenderObject::remoteSVGRootElement const):
        (WebCore::AccessibilityRenderObject::roleValueForMSAA const):
        (WebCore::AccessibilityRenderObject::getScrollableAreaIfScrollable const):
        (WebCore::AccessibilityRenderObject::scrollTo const):
        * accessibility/AccessibilityRenderObject.h:
        (WebCore::AccessibilityRenderObject::setRenderObject):
        * accessibility/AccessibilitySlider.cpp:
        (WebCore::AccessibilitySlider::elementAccessibilityHitTest const):
        * accessibility/AccessibilityTable.cpp:
        (WebCore::AccessibilityTable::addChildren):
        * accessibility/AccessibilityTableCell.cpp:
        (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored const):
        (WebCore::AccessibilityTableCell::parentTable const):
        (WebCore::AccessibilityTableCell::rowIndexRange const):
        (WebCore::AccessibilityTableCell::columnIndexRange const):
        (WebCore::AccessibilityTableCell::titleUIElement const):

2017-10-10  Sam Weinig  <sam@webkit.org>

        Replace copyKeysToVector/copyValuesToVector with copyToVector(map.keys())/copyToVector(map.values())
        https://bugs.webkit.org/show_bug.cgi?id=178102

        Reviewed by Tim Horton.

        * Modules/geolocation/Geolocation.cpp:
        (WebCore::Geolocation::Watchers::getNotifiersVector const):
        * Modules/indexeddb/IDBTransaction.cpp:
        (WebCore::IDBTransaction::connectionClosedFromServer):
        * Modules/indexeddb/client/IDBConnectionProxy.cpp:
        (WebCore::IDBClient::IDBConnectionProxy::connectionToServerLost):
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::getTracks const):
        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::windowProxies):
        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::CSSComputedStyleDeclaration::item const):
        * dom/Document.cpp:
        (WebCore::Document::prepareForDestruction):
        * dom/DocumentMarkerController.cpp:
        (WebCore::DocumentMarkerController::removeMarkers):
        * inspector/InspectorWorkerAgent.cpp:
        (WebCore::InspectorWorkerAgent::disconnectFromAllWorkerInspectorProxies):
        * inspector/NetworkResourcesData.cpp:
        * loader/DocumentLoader.cpp:
        (WebCore::cancelAll):
        (WebCore::setAllDefersLoading):
        (WebCore::areAllLoadersPageCacheAcceptable):
        * loader/cache/MemoryCache.cpp:
        (WebCore::MemoryCache::forEachSessionResource):
        * loader/mac/DocumentLoaderMac.cpp:
        (WebCore::scheduleAll):
        (WebCore::unscheduleAll):
        * page/ResourceUsageThread.cpp:
        (WebCore::ResourceUsageThread::notifyObservers):
        * platform/mediastream/MediaStreamPrivate.cpp:
        (WebCore::MediaStreamPrivate::tracks const):

            Replace copyKeysToVector / copyValuesToVector with copyToVector(map.keys()) / copyToVector(map.values())

2017-10-10  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        Fix MSVC build with ENCRYPTED_MEDIA enabled
        https://bugs.webkit.org/show_bug.cgi?id=177803

        Reviewed by Alex Christensen.

        As a workaround for MSVC, a weak pointer of "this" is captured
        at the outermost lambda expression.

        * Modules/encryptedmedia/MediaKeySession.cpp:
        (WebCore::MediaKeySession::generateRequest):
        (WebCore::MediaKeySession::load):
        (WebCore::MediaKeySession::update):
        (WebCore::MediaKeySession::close):
        (WebCore::MediaKeySession::remove):
        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::CDMInstanceClearKey::updateLicense):
        (WebCore::CDMInstanceClearKey::loadSession):
        (WebCore::CDMInstanceClearKey::removeSessionData):

2017-10-10  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [ATK] ARIA form role should be mapped to ATK_ROLE_LANDMARK; not ATK_ROLE_FORM
        https://bugs.webkit.org/show_bug.cgi?id=178137

        Reviewed by Chris Fleizach.

        Expose the ARIA form role as ATK_ROLE_LANDMARK; continue to expose the HTML form
        element as ATK_ROLE_FORM.

        No new tests needed due to existing coverage. Update expectations for roles-exposed.html.

        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (atkRole):

2017-10-10  Matt Rajca  <mrajca@apple.com>

        Respect audio rate change restrictions in HTMLMediaElement::setVolume.
        https://bugs.webkit.org/show_bug.cgi?id=178140

        Reviewed by Eric Carlson.

        Tests: media/audio-playback-volume-changes-with-restrictions-and-user-gestures.html
               media/audio-playback-volume-changes-with-restrictions.html

        It's currently possible for a website to start auto-playing media with a zero volume and then
        programmatically set the volume to a non-zero value without a user gesture. This code path didn't
        have to be considered previously because volume changes are not supported on iOS.

        We currently pause media when an audio track comes in after an element has already started playing silently
        in mediaPlayerDidAddAudioTrack. This patch does the same when a non-zero volume is set after a media
        element already began playing silently and there is an audio rate change restriction.

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

2017-10-10  Ryosuke Niwa  <rniwa@webkit.org>

        Loading should be disabled while constructing the fragment in WebContentReader::readWebArchive
        https://bugs.webkit.org/show_bug.cgi?id=178118

        Reviewed by Antti Koivisto.

        Disable image loading while constructing the document fragment in WebContentReader::readWebArchive
        as we do in createFragmentAndAddResources for RTF/RTFD. This refactoring is needed to start using
        blob URL in the pasted document fragment for webkit.org/b/124391.

        Also modified WebContentReader::readWebArchive to take a reference to SharedBuffer instead of a pointer.

        No new tests since existing tests have been updated to cover this behavior change.

        * editing/WebContentReader.h:
        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::WebContentReader::readWebArchive): Use DeferredLoadingScope to disable the loader and images
        while constructing the document fragment.
        * platform/Pasteboard.h:
        * platform/ios/PasteboardIOS.mm:
        (WebCore::readPasteboardWebContentDataForType):
        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::read):

2017-10-10  Antti Koivisto  <antti@apple.com>

        Layers should be destroyed by RenderLayerModelObject
        https://bugs.webkit.org/show_bug.cgi?id=178139

        Reviewed by Simon Fraser.

        Clean up some FIXMEs.

        * rendering/RenderLayerModelObject.cpp:
        (WebCore::RenderLayerModelObject::willBeDestroyed):
        (WebCore::RenderLayerModelObject::destroyLayer):
        * rendering/RenderLayerModelObject.h:
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::willBeDestroyed):

2017-10-10  Chris Dumez  <cdumez@apple.com>

        Entries API should recognize path starting with 2 slashes as valid absolute path
        https://bugs.webkit.org/show_bug.cgi?id=178135

        Reviewed by Ryosuke Niwa.

        Entries API should recognize paths starting with 2 slashes as valid absolute paths to match Chrome's behavior.
        See https://github.com/WICG/entries-api/commit/990454758005a6039655835503d551015e346d9d

        This was causing us to fail some manual web-platform-tests.

        No new tests, updated existing tests.

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::isValidPathSegment):
        (WebCore::isZeroOrMorePathSegmentsSeparatedBySlashes):
        (WebCore::isValidRelativeVirtualPath):
        (WebCore::isValidVirtualPath):

2017-10-10  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r223110.

        This caused consistent failures and timeouts on multiple
        platforms.

        Reverted changeset:

        "Delete button doesn't fully delete certain emoji"
        https://bugs.webkit.org/show_bug.cgi?id=178096
        http://trac.webkit.org/changeset/223110

2017-10-10  Antti Koivisto  <antti@apple.com>

        RenderObject::destroy() should only be invoked after renderer has been removed from the tree
        https://bugs.webkit.org/show_bug.cgi?id=178075

        Reviewed by Zalan Bujtas.

        This patch fixes the remaining cases where the renderer is still in the tree while destroy()
        is called and adds the assert.

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::removeLeftoverAnonymousBlock):
        (WebCore::RenderBlock::takeChild):
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::willBeDestroyed):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::~RenderLayer):

            Null the parent pointers for m_scrollCorner/m_resizer.

        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/RenderLayer.h:
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::willBeDestroyed):
        (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
        (WebCore::RenderObject::destroy):

            Use RELEASE_ASSERT as these are cheap and important checks.
            Also turn isBeingDestroyed test into RELEASE_ASSERT.
            Remove AX call that no longer does anything.

        (WebCore::RenderObject::destroyAndCleanupAnonymousWrappers): Deleted.
        * rendering/RenderObject.h:
        * rendering/RenderRubyBase.cpp:
        (WebCore::RenderRubyBase::moveBlockChildren):
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows):
        (WebCore::RenderTableRow::destroyAndCollapseAnonymousSiblingRows): Deleted.

            Renamed and made this no longer destroy itself. The caller now takes care of that.
            Removed an unnecessary lambda.

        * rendering/RenderTableRow.h:
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::tearDownRenderers):
        (WebCore::RenderTreeUpdater::tearDownRenderer):
        * style/RenderTreeUpdaterListItem.cpp:
        (WebCore::RenderTreeUpdater::ListItem::updateMarker):

2017-10-09  Antti Koivisto  <antti@apple.com>

        Add isContinuation bit
        https://bugs.webkit.org/show_bug.cgi?id=178084

        Reviewed by Zalan Bujtas.

        Currently continuations are identified indirectly by comparing renderer pointer with the element renderer pointer.
        This is bug prone and fails to cover anonymous continuations.

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::firstChildConsideringContinuation):
        (WebCore::startOfContinuations):
        (WebCore::firstChildIsInlineContinuation):
        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):

            Ignore first-letter fragment. This worked before because first-letter renderers
            were mistakenly considered inline element continuations (see below).

        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::setContinuation):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::RenderElement):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::hasContinuation const):
        (WebCore::RenderElement::isContinuation const):
        (WebCore::RenderElement::setIsContinuation):

            The new bit.

        (WebCore::RenderElement::isElementContinuation const):
        (WebCore::RenderElement::isInlineElementContinuation const):
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::addChildIgnoringContinuation):
        (WebCore::RenderInline::cloneAsContinuation const):
        (WebCore::RenderInline::splitInlines):
        (WebCore::RenderInline::childBecameNonInline):
        (WebCore::RenderInline::clone const): Deleted.
        * rendering/RenderInline.h:
        * rendering/RenderObject.h:
        (WebCore::RenderObject::isAnonymousBlock const):
        (WebCore::RenderObject::isElementContinuation const): Deleted.

            The old continuation test was 'node() && node()->renderer() != this'
            This was fragile as nulling the renderer will make it fail.
            It was also wrong for first-letter renderers (isElementContinuation was true for them).

        (WebCore::RenderObject::isInlineElementContinuation const): Deleted.

            Move to RenderElement.

        (WebCore::RenderObject::isBlockElementContinuation const): Deleted.

2017-10-10  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [ATK] STATE_CHECKABLE should be removed from radio buttons in radiogroups with aria-readonly="true"
        https://bugs.webkit.org/show_bug.cgi?id=177931

        Reviewed by Chris Fleizach.

        Add a check in canSetValueAttribute() for readonly radiogroup ancestors of
        radio buttons.

        Test: accessibility/gtk/aria-readonly-radiogroup.html

        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::canSetValueAttribute const):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::radioGroupAncestor const):
        * accessibility/AccessibilityObject.h:

2017-10-09  Chris Dumez  <cdumez@apple.com>

        Calling fileSystemDirectoryEntry.getDirectory() with empty path should not fail
        https://bugs.webkit.org/show_bug.cgi?id=178114

        Reviewed by Ryosuke Niwa.

        Calling fileSystemDirectoryEntry.getDirectory() with empty/null/undefined path should not fail as per:
        - https://wicg.github.io/entries-api/#dom-filesystemdirectoryentry-getdirectory

        The empty string is a valid path as per:
        - https://wicg.github.io/entries-api/#valid-path

        This aligns out behavior with Chrome.

        No new tests, updated existing test.

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::isValidVirtualPath):
        (WebCore::resolveRelativeVirtualPath):

2017-10-09  Chris Dumez  <cdumez@apple.com>

        It should not be possible to submit a form that is disconnected
        https://bugs.webkit.org/show_bug.cgi?id=178099

        Reviewed by Sam Weinig.

        It should not be possible to submit a form that is disconnected. Both Firefox and Chrome agree with the specification.

        This is as per:
        https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-submission-algorithm (step 1)
        which refers to:
        https://html.spec.whatwg.org/multipage/links.html#cannot-navigate

        Form cannot navigate when it is disconnected.

        No new tests, rebaselined existing tests.

        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::prepareForSubmission):

2017-10-09  Myles C. Maxfield  <mmaxfield@apple.com>

        Delete button doesn't fully delete certain emoji
        https://bugs.webkit.org/show_bug.cgi?id=178096
        <rdar://problem/34785106>

        Reviewed by Simon Fraser.

        System infrastructure for handling emoji changes every year. Instead of having
        custom code to specifically walk over codepoints, we should delegate to the
        system handling.

        Test: editing/deleting/delete-emoji.html

        * rendering/RenderText.cpp:
        (WebCore::RenderText::previousOffset const):
        (WebCore::RenderText::previousOffsetForBackwardDeletion const):
        (WebCore::RenderText::nextOffset const):
        (WebCore::isHangulLVT): Deleted.
        (WebCore::isMark): Deleted.
        (WebCore::isRegionalIndicator): Deleted.
        (WebCore::isInArmenianToLimbuRange): Deleted.

2017-10-09  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Image data should be coalesced if it comes in small chunks before updating the ImageSource
        https://bugs.webkit.org/show_bug.cgi?id=175890

        Reviewed by Simon Fraser.

        Coalesce the updates, which an Image makes when receiving encoded data in
        small chunks, for all platforms. Ensure the clients of the CachedImage
        won't be notified unless an update in the ImageSource happens.

        I need to change some functions' names to better implement this patch. 
        The names of these functions have been confusing:
            CachedImage::addData(SharedBuffer&)
            CachedImage::addDataBuffer(const char* data, unsigned)
            CachedImage::addIncrementalDataBuffer(SharedBuffer&)

        The image data is not buffered incrementally into the CachedImage. When
        new data is received, SubresourceLoader calls CachedImage to "update" its
        m_data with either a SharedBuffer or a data pointer. In either case the
        SharedBuffer or the pointer contains all the loaded data. SubresourceLoader
        calls CachedImage to update its m_data, to ensure its m_image is created 
        and to notify its clients with the new data.

        The verb "add" in the functions' name is misleading. I am suggesting the
        following names instead:
            CachedImage::updateBuffer(SharedBuffer&)
            CachedImage::updateData(const char*, unsigned)
            CachedImage::doUpdateBuffer(SharedBuffer&)

        The first two are the virtual ones. They are called form SubresourceLoader.
        The third one is the internal implementation to update the m_data member.
        The same names will be used in the following classes:
            CachedResource which is the base class of CachedImage
            CachedRawResource which is derived from CachedResource
            CachedTextTrack which is derived from CachedResource

        * html/ImageDocument.cpp:
        (WebCore::ImageDocument::updateDuringParsing):
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::didReceiveDataOrBuffer):
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::clearImage): Reset the update back off members.
        (WebCore::CachedImage::doUpdateBuffer): Don't update CachedImage with
        the new data if it comes in small chunks with fast rate.
        (WebCore::CachedImage::shouldDeferUpdateImageData const): This code is moved 
        from ImageSource::dataChanged().
        (WebCore::CachedImage::didUpdateImageData): Ditto.
        (WebCore::CachedImage::updateImageData):
        (WebCore::CachedImage::updateBuffer):
        (WebCore::CachedImage::updateData):
        (WebCore::CachedImage::finishLoading):
        (WebCore::CachedImage::addIncrementalDataBuffer): Deleted.
        (WebCore::CachedImage::setImageDataBuffer): Deleted.
        (WebCore::CachedImage::addDataBuffer): Deleted.
        (WebCore::CachedImage::addData): Deleted.
        * loader/cache/CachedImage.h:
        * loader/cache/CachedRawResource.cpp:
        (WebCore::CachedRawResource::updateBuffer):
        (WebCore::CachedRawResource::updateData):
        (WebCore::CachedRawResource::addDataBuffer): Deleted.
        (WebCore::CachedRawResource::addData): Deleted.
        * loader/cache/CachedRawResource.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::updateBuffer):
        (WebCore::CachedResource::updateData):
        (WebCore::CachedResource::addDataBuffer): Deleted.
        (WebCore::CachedResource::addData): Deleted.
        * loader/cache/CachedResource.h:
        * loader/cache/CachedTextTrack.cpp:
        (WebCore::CachedTextTrack::doUpdateBuffer): Rename updateData() to doUpdateBuffer().
        (WebCore::CachedTextTrack::updateBuffer): Rename addDataBuffer() to updateBuffer().
        (WebCore::CachedTextTrack::finishLoading): Call the internal function doUpdateBuffer().
        (WebCore::CachedTextTrack::updateData): Deleted.
        (WebCore::CachedTextTrack::addDataBuffer): Deleted.
        * loader/cache/CachedTextTrack.h:
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::dataChanged): Move the update back off code to CachedImage::updateData().
        * platform/graphics/ImageSource.h:

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

        Implement RegExp Unicode property escapes
        https://bugs.webkit.org/show_bug.cgi?id=172069

        Reviewed by JF Bastien.

        Refactoring change - Added BuiltInCharacterClassID:: prefix to uses of the enum.

        * contentextensions/URLFilterParser.cpp:
        (WebCore::ContentExtensions::PatternParser::atomBuiltInCharacterClass):

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

        [Payment Request] Implement PaymentRequest.show() and PaymentRequest.hide()
        https://bugs.webkit.org/show_bug.cgi?id=178043
        <rdar://problem/34076639>

        Reviewed by Tim Horton.

        Tests: http/tests/paymentrequest/payment-request-abort-method.https.html
               http/tests/paymentrequest/payment-request-show-method.https.html

        * Modules/applepay/PaymentCoordinator.h:
        * Modules/applepay/PaymentSession.h: Virtually inherited from PaymentSessionBase to
        accommodate ApplePayPaymentHandler inheriting from both this and PaymentHandler.
        (WebCore::PaymentSession::~PaymentSession): Deleted.
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::paymentCoordinator): Virtually inherited from PaymentSessionBase to accommodate
        ApplePayPaymentHandler inheriting from both this and PaymentSession.
        (WebCore::ApplePayPaymentHandler::hasActiveSession): Added. Calls PaymentCoordinator::hasActiveSession().
        (WebCore::ApplePayPaymentHandler::show): Added. Calls PaymentCoordinator::beginPaymentSession().
        (WebCore::ApplePayPaymentHandler::hide): Added. Calls PaymentCoordinator::abortPaymentSession().
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: Inherited from PaymentSession in
        addition to PaymentHandler so that this can be PaymentCoordinator active session.
        * Modules/paymentrequest/PaymentHandler.cpp:
        (WebCore::PaymentHandler::create):
        (WebCore::PaymentHandler::hasActiveSession):
        * Modules/paymentrequest/PaymentHandler.h:
        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::PaymentRequest::~PaymentRequest):
        (WebCore::PaymentRequest::show): Rejected the promise if PaymentCoordinator has an active session.
        (WebCore::PaymentRequest::abort): Called stop().
        (WebCore::PaymentRequest::canSuspendForDocumentSuspension const): Returned true if state is
        Interactive and there is an active handler showing.
        (WebCore::PaymentRequest::stop): Hid the active session if it's showing, then set state to
        Closed and rejected the show promise.
        * Modules/paymentrequest/PaymentRequest.h:
        * Modules/paymentrequest/PaymentSessionBase.h: Added. Inherits from
        RefCounted<PaymentSessionBase> and defines a virtual destructor. This allows subclasses to
        virtually inherit a single ref-count to support multiple inheritance.
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GetGnuVTableOffsetForType): Added ApplePaySession to the list of classes that need a vtable
        offset of 3.
        * page/MainFrame.cpp:
        (WebCore::MainFrame::setPaymentCoordinator): Added a setter for m_paymentCoordinator.
        * page/MainFrame.h:
        * testing/Internals.cpp:
        (WebCore::Internals::Internals): Set the main frame's payment coordinator to a new
        PaymentCoordinator with MockPaymentCoordinator as its client.
        * testing/MockPaymentCoordinator.cpp: Added a mock PaymentCoordinatorClient for testing.
        (WebCore::MockPaymentCoordinator::supportsVersion):
        (WebCore::MockPaymentCoordinator::canMakePayments):
        (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
        (WebCore::MockPaymentCoordinator::openPaymentSetup):
        (WebCore::MockPaymentCoordinator::showPaymentUI):
        (WebCore::MockPaymentCoordinator::paymentCoordinatorDestroyed):
        * testing/MockPaymentCoordinator.h: Added.

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

        Add quota to cache API
        https://bugs.webkit.org/show_bug.cgi?id=177552

        Reviewed by Alex Christensen.

        Tests: http/wpt/cache-storage/cache-quota.any.html

        Storing padded opaque response body sizes within FetchResponse and CacheStorageConnection.
        See https://github.com/whatwg/storage/issues/31 for the rationale about this padding.
        Storing in CacheStorageConnection is needed for handling cloned network fetched created responses.
        Storing in FetchResponse is needed for handling cloned cache-storage created opaque responses.

        Adding internals to query and set the fuzzed size of a response.

        * Modules/cache/CacheStorageConnection.cpp:
        (WebCore::computeRealBodySize):
        (WebCore::CacheStorageConnection::computeRecordBodySize):
        (WebCore::CacheStorageConnection::setResponseBodySizeWithPadding):
        (WebCore::CacheStorageConnection::responseBodySizeWithPadding const):
        * Modules/cache/CacheStorageConnection.h:
        * Modules/cache/DOMCache.cpp:
        (WebCore::DOMCache::toConnectionRecord):
        (WebCore::DOMCache::updateRecords):
        * Modules/cache/DOMCache.h:
        * Modules/cache/DOMCacheEngine.cpp:
        (WebCore::DOMCacheEngine::errorToException):
        (WebCore::DOMCacheEngine::Record::copy const):
        * Modules/cache/DOMCacheEngine.h:
        * Modules/cache/WorkerCacheStorageConnection.cpp:
        (WebCore::toCrossThreadRecordData):
        (WebCore::fromCrossThreadRecordData):
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::clone):
        (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
        * Modules/fetch/FetchResponse.h:
        * Modules/fetch/FetchResponse.idl:
        * testing/Internals.cpp:
        (WebCore::Internals::setResponseSizeWithPadding):
        (WebCore::Internals::responseSizeWithPadding const):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-10-09  Zalan Bujtas  <zalan@apple.com>

        Remove redundant RenderObject::virtualContinuation
        https://bugs.webkit.org/show_bug.cgi?id=178091
        <rdar://problem/34892906>

        Reviewed by Antti Koivisto.
 
        virtualContinuation sounds like a feature of continuation, while it's just a (not super useful)helper override.

        No change in functionality.

        * rendering/RenderBlock.cpp:
        (WebCore::canMergeContiguousAnonymousBlocks):
        (WebCore::RenderBlock::takeChild):
        * rendering/RenderBlock.h:
        * rendering/RenderInline.h:
        * rendering/RenderObject.h:
        (WebCore::RenderObject::isBlockElementContinuation const):
        (WebCore::RenderObject::virtualContinuation const): Deleted.

2017-10-09  Dean Jackson  <dino@apple.com>

        [WebGL] Third IOSurface buffer might be allocated with the wrong size
        https://bugs.webkit.org/show_bug.cgi?id=178092
        <rdar://problem/34893173>

        Reviewed by Jer Noble.

        If the WebGL canvas resizes after the third buffer was allocated, it
        was never getting told that its backing store should be thrown away.

        * platform/graphics/cocoa/WebGLLayer.mm: Allocate the third buffer at
        the same time as the first two.
        (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
        (-[WebGLLayer bindFramebufferToNextAvailableSurface]):

2017-10-09  Sam Weinig  <sam@webkit.org>

        Make HashMap::keys() and HashMap::values() work with WTF::map/WTF::copyToVector
        https://bugs.webkit.org/show_bug.cgi?id=178072

        Reviewed by Darin Adler.

        * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
        (WebCore::MediaSelectionGroupAVFObjC::options):
        
            Update for type change for HashMap::values().
            
2017-10-09  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, another build fix attempt after r223031

        The default constructor of DragTargetResponse is also invoked via initializer list in EventHandler.cpp, so we'll
        need to explicitly declare this constructor in the header.

        * page/EventHandler.h:

2017-10-09  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r223021.

        LayoutTests added with this change are failing.

        Reverted changeset:

        "[Payment Request] Implement PaymentRequest.show() and
        PaymentRequest.hide()"
        https://bugs.webkit.org/show_bug.cgi?id=178043
        http://trac.webkit.org/changeset/223021

2017-10-09  Jeremy Jones  <jeremyj@apple.com>

        Blurry captions on retina screens.
        https://bugs.webkit.org/show_bug.cgi?id=177560
        rdar://problem/17913388

        Reviewed by Jer Noble.

        No new tests because the contents scale of the captions layer is not exposed to the DOM.

        The captions layer contents scale needs to take into account the device screen scale to get the correct resolution for captions.

        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
        (WebCore::MediaControlTextTrackContainerElement::updateSizes):

2017-10-09  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the Windows build after r223031

        Speculative build fix; no change in behavior.

        * page/EventHandler.h:
        (WebCore::EventHandler::DragTargetResponse::DragTargetResponse):

2017-10-09  Alex Christensen  <achristensen@webkit.org>

        Reduce includes in Document.h
        https://bugs.webkit.org/show_bug.cgi?id=178035

        Reviewed by Darin Adler.

        * dom/Document.h:

2017-10-09  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [ATK] Explicitly-set aria-sort value of "none" should be exposed as an object attribute
        https://bugs.webkit.org/show_bug.cgi?id=177955

        Reviewed by Chris Fleizach.

        Expose "none" as the value of aria-sort when the attribute is present and not
        one of the other valid sort types. Also add a new AccessibilitySortDirection,
        SortDirectionInvalid. This is currently only being used when the sort direction
        is sought for a role which does not support this ARIA attribute, but might come
        in handy if we want to add further sanity checks on the author-provided values.

        Test: accessibility/gtk/aria-sort-values.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::sortDirection const):
        * accessibility/AccessibilityObject.h:
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):

2017-10-09  Robin Morisset  <rmorisset@apple.com>

        Make the names of the options consistent 
        https://bugs.webkit.org/show_bug.cgi?id=177933

        Reviewed by Saam Barati.

        No functional change, just fixing comments.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::buffered const):
        (WebCore::MediaSource::monitorSourceBuffers):
        * Modules/webaudio/AudioBufferSourceNode.cpp:
        (WebCore::AudioBufferSourceNode::process):
        * bindings/scripts/generate-bindings.pl:
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::adjustRenderStyle):
        * editing/BreakBlockquoteCommand.cpp:
        (WebCore::BreakBlockquoteCommand::doApply):
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::doApply):
        * editing/VisibleSelection.cpp:
        (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
        * editing/VisibleUnits.cpp:
        (WebCore::closestWordBoundaryForPosition):
        * html/parser/AtomicHTMLToken.h:
        * html/parser/HTMLDocumentParser.cpp:
        (WebCore::HTMLDocumentParser::end):
        * inspector/InspectorOverlayPage.js:
        (reset):
        * page/ViewportConfiguration.cpp:
        (WebCore::ViewportConfiguration::layoutWidth const):
        (WebCore::ViewportConfiguration::layoutHeight const):
        * platform/graphics/FloatPolygon.h:
        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
        (WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
        * platform/graphics/filters/FilterOperation.h:
        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
        (WebCore::GraphicsContext3D::texImage2D):
        * platform/mac/WidgetMac.mm:
        (WebCore::safeRemoveFromSuperview):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
        * rendering/RenderBlockFlow.h:
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded const):
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::disabledTextColor const):
        * style/ClassChangeInvalidation.cpp:
        (WebCore::Style::computeClassChange):
        * style/StyleScope.cpp:
        (WebCore::Style::Scope::didChangeStyleSheetEnvironment):
        * svg/SVGAltGlyphDefElement.cpp:
        (WebCore::SVGAltGlyphDefElement::hasValidGlyphElements const):

2017-10-09  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE][GTK] Propagate libepoxy compiler flags obtained from pkg-config
        https://bugs.webkit.org/show_bug.cgi?id=178081

        Reviewed by Carlos Alberto Lopez Perez.

        No new tests needed.

        * CMakeLists.txt: Use ${LIBEPOXY_DEFINITIONS} for building WebCore.

2017-10-09  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Implement canCloseOrEnqueue
        https://bugs.webkit.org/show_bug.cgi?id=178005

        Reviewed by Youenn Fablet.

        Implemented readableStreamDefaultControllerCanCloseOrEnqueue [1]. This is
        just a refactoring (based on spec) aiming at factorizing a set of tests
        that are done at multiple places.

        [1] https://streams.spec.whatwg.org/#readable-stream-default-controller-can-close-or-enqueue

        No new tests (refactoring, no new behavior).

        * Modules/streams/ReadableStreamDefaultController.js:
        (enqueue): Updated.
        (close): Updated.
        * Modules/streams/ReadableStreamInternals.js:
        (readableStreamDefaultControllerClose): Updated.
        (readableStreamDefaultControllerCanCloseOrEnqueue): Added.

2017-10-05  Frederic Wang  <fwang@igalia.com>

        Remove WOFF2 from Source/ThirdParty.
        https://bugs.webkit.org/show_bug.cgi?id=177862

        Reviewed by Michael Catanzaro.

        No new tests, already covered by existing tests.

        * CMakeLists.txt: Use the system brotli/woff2 headers/libraries.

2017-10-08  Darin Adler  <darin@apple.com>

        Update HTMLOListElement.start to behavior from latest HTML specification
        https://bugs.webkit.org/show_bug.cgi?id=178057

        Reviewed by Chris Dumez.

        * html/HTMLOListElement.cpp:
        (optionalValue): Added. Helper function that we can put into Expected.h later
        if we like; makes it easier to turn Expected into std::optional.
        (WebCore::HTMLOListElement::HTMLOListElement): Moved data member initialization
        into class definition so it doesn't have to be done here.
        (WebCore::HTMLOListElement::parseAttribute): Simplified using the new
        optionalValue function. Moved the call to update values in here since it's
        a trivial one-liner (albeit done twice).
        (WebCore::HTMLOListElement::updateItemValues): Deleted. Moved this into the
        parseAttribute function.
        (WebCore::HTMLOListElement::itemCount): Updated to use std::optional instead
        of a separate m_shouldRecalculateItemCount flag. Also inlined the
        recalculateItemCount function since it's a trivial one-liner.
        (WebCore::HTMLOListElement::itemCountAfterLayout): Deleted. The only use of
        this was to implement the now-obsolete behavior of the start attribute.
        (WebCore::HTMLOListElement::recalculateItemCount): Deleted. Moved this into
        the itemCount function.

        * html/HTMLOListElement.h: Changed startForBindings to return 1 when start
        is not specified; this what the HTML specification now calls for. Updated
        for the changes above. Merged m_itemCount and m_shouldRecalculateItemCount
        into a single optional m_itemCount, and made it mutable so it can be
        computed as a side effect of calling the const member function start.

2017-10-08  Darin Adler  <darin@apple.com>

        Fix bugs related to setting reflected floating point DOM attributes
        https://bugs.webkit.org/show_bug.cgi?id=178061

        Reviewed by Sam Weinig.

        * html/HTMLProgressElement.cpp:
        (WebCore::HTMLProgressElement::setValue): Changed the semantics to match what
        the HTML specification calls for. When a caller passes a negative number or
        zero, the value does get set on the element. Negative numbers are not allowed
        when you get the current value, but are allowed to be set.
        (WebCore::HTMLProgressElement::setMax): Changed the semantics to match what
        the HTML specification calls for. When a caller passes a negative number or
        zero, this should leave the attribute unchanged.

        * html/shadow/MediaControlElementTypes.cpp:
        (WebCore::MediaControlVolumeSliderElement::setVolume): Use
        String::numberToStringECMAScript instead of String::number since that is what
        we want any time we are setting an attribute value from a floating point value.
        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlTimelineElement::setPosition): Ditto.
        (WebCore::MediaControlTimelineElement::setDuration): Removed unneeded check
        of std::isfinite since the single caller already checks that.

2017-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        DataTransfer.items does not contain items for custom types supplied via add or setData
        https://bugs.webkit.org/show_bug.cgi?id=178016

        Reviewed by Darin Adler.

        Minor tweaks to expose pasteboard types and data through DataTransfer's item list. This patch fixes two primary
        issues: (1) custom pasteboard data is not exposed through the item list in any way, and (2) the "Files"
        compatibility type is exposed as a separate data transfer item of kind 'string' when dropping or pasting files.

        Tests: editing/pasteboard/data-transfer-items-add-custom-data.html
               editing/pasteboard/data-transfer-items-drop-file.html

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

        Use stripLeadingAndTrailingHTMLSpaces instead of stripWhitespace.

        (WebCore::shouldReadOrWriteTypeAsCustomData):
        (WebCore::DataTransfer::getDataForItem const):
        (WebCore::DataTransfer::getData const):

        Add getDataForItem, a version of getData that does not normalize types before reading from the pasteboard. This
        normalization step is only needed for backwards compatibility with legacy types (such as "text" and "url")
        written to and read from using getData and setData; when using DataTransferItemList.add to set data, adding data
        for these types should instead write as custom pasteboard data.

        (WebCore::DataTransfer::setDataFromItemList):
        (WebCore::DataTransfer::types const):
        (WebCore::DataTransfer::typesForItemList const):

        Add typesForItemList, which fetches the list of types to expose as items on the DataTransfer. Importantly, this
        does not include the "Files" type added for compatibility when accessing DataTransfer.types, instead returning
        an empty array. The actual files are added separately, by iterating over DataTransfer's files in ensureItems.

        Note that when starting a drag or copying, we will still expose the full list of file and string types to
        bindings and not just file-backed items. Since all of this information is supplied by the page in the first
        place, we don't have to worry about exposing information, such as file paths, that may exist on the pasteboard.

        * dom/DataTransfer.h:
        * dom/DataTransferItem.cpp:
        (WebCore::DataTransferItem::getAsString const):
        * dom/DataTransferItemList.cpp:
        (WebCore::shouldExposeTypeInItemList):
        (WebCore::DataTransferItemList::add):
        (WebCore::DataTransferItemList::ensureItems const):
        (WebCore::isSupportedType): Deleted.

2017-10-08  Darin Adler  <darin@apple.com>

        CustomElementRegistry.define was throwing a JavaScript syntax error instead of a DOM syntax error
        https://bugs.webkit.org/show_bug.cgi?id=178055

        Reviewed by Sam Weinig.

        Both the JavaScript language and the DOM have "syntax error" exceptions, but
        they are not the same thing.

        Also, since the time a while back where we moved JavaScript error handling to
        use WebCore::Exception and WebCore::ExceptionOr, there are a number of functions
        that are no longer used and can be deleted.

        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::validateCustomElementNameAndThrowIfNeeded): Call throwDOMSyntaxError
        instead of throwSyntaxError.

        * bindings/js/JSDOMExceptionHandling.cpp:
        (WebCore::reportDeprecatedGetterError): Deleted. Unused.
        (WebCore::reportDeprecatedSetterError): Deleted. Unused.
        (WebCore::throwNotSupportedError): Deleted the overload without an error message,
        since it's unused. Changed the other overload to take an ASCIILiteral, since
        that is what all the callers need.
        (WebCore::throwInvalidStateError): Take ASCIILiteral as above.
        (WebCore::throwArrayElementTypeError): Deleted. Unused.
        (WebCore::throwDOMSyntaxError): Added an ASCIILiteral message argument. This
        function was unused; it's now being used above, always with a literal message.
        (WebCore::throwIndexSizeError): Deleted. Unused.
        (WebCore::throwTypeMismatchError): Deleted. Unused.
        * bindings/js/JSDOMExceptionHandling.h: Updated for the changes above.

        * bindings/js/JSHTMLElementCustom.cpp:
        (WebCore::constructJSHTMLElement): Fixed a typo in the error message.

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

        dragenter and dragleave shouldn't use the same data transfer object
        https://bugs.webkit.org/show_bug.cgi?id=178056

        Reviewed by Darin Adler.

        This patch fixes the bug that we were using a single DataTransfer to fire dragleave and dragenter events
        when the drag target moves from one element to another.

        It alos refactors DragController and EventHandler code so that the construction of DataTransfer object
        happens in EventHandler instead of DragController, and extracts createForUpdatingDropTarget out of
        createForDrop to have a better encapsulation over the data store mode.

        drag related functions in EventHandler now takes std::unique_ptr<Pasteboard>&&, drag operation mask set
        by the drag source, and a boolean indicating whether this drag & drop is for files or not. updateDragAndDrop
        takes a closure which makes a pasteboard because it has to create two instances of DataTransfer one for
        dragleave event and another one for dragenter event in some cases.

        Test: editing/pasteboard/data-transfer-is-unique-for-dragenter-and-dragleave.html

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::createForDrop): Now takes Pasteboard instead of DragData.
        (WebCore::DataTransfer::createForUpdatingDropTarget): Extracted out of createForDrop. Moved the code to
        use Readonly mode in dashboad here from createDataTransferToUpdateDrag in DragController.cpp.
        * dom/DataTransfer.h:
        * page/DragController.cpp:
        (WebCore::createDataTransferToUpdateDrag): Deleted.
        (WebCore::DragController::dragExited):
        (WebCore::DragController::performDragOperation):
        (WebCore::DragController::tryDHTMLDrag):
        * page/EventHandler.cpp:
        (WebCore::EventHandler::dispatchDragEvent): Made this fucntion take DataTransfer& instead of DataTransfer*.
        (WebCore::findDropZone): Ditto.
        (WebCore::EventHandler::dispatchDragEnterOrDragOverEvent): Added.
        (WebCore::EventHandler::updateDragAndDrop):
        (WebCore::EventHandler::cancelDragAndDrop):
        (WebCore::EventHandler::performDragAndDrop):
        (WebCore::EventHandler::dispatchDragSrcEvent):
        (WebCore::EventHandler::dispatchDragStartEventOnSourceElement):
        * page/EventHandler.h:

2017-10-08  Jer Noble  <jer.noble@apple.com>

        SourceBuffer remove throws out way more content than requested
        https://bugs.webkit.org/show_bug.cgi?id=177884
        <rdar://problem/34817104>

        Reviewed by Darin Adler.

        Test: media/media-source/media-source-remove-too-much.html

        The end parameter is exclusive, not inclusive, of the range to be removed.

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

2017-10-08  Brent Fulgham  <bfulgham@apple.com>

        Nullptr deref in WebCore::Node::computeEditability
        https://bugs.webkit.org/show_bug.cgi?id=177905
        <rdar://problem/34138402>

        Reviewed by Darin Adler.

        Script can run when setting focus, because a blur event and a focus event are generated.
        A handler for one of these events can cause the focused element to be cleared. We should
        handle this possibility gracefully.

        Test: fast/dom/focus-shift-crash.html

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

2017-10-07  Darin Adler  <darin@apple.com>

        Update Document.createEvent for recent DOM specification changes
        https://bugs.webkit.org/show_bug.cgi?id=178052

        Reviewed by Chris Dumez.

        * dom/BeforeUnloadEvent.cpp:
        (WebCore::BeforeUnloadEvent::BeforeUnloadEvent): Added a constructor for
        createForBindings.
        (WebCore::BeforeUnloadEvent::~BeforeUnloadEvent): Deleted. Just let the
        compiler generate this.
        * dom/BeforeUnloadEvent.h: Added createForBindings. Also made more things private.

        * dom/Document.cpp:
        (WebCore::Document::createEvent): Updated comments for clarity. Responding to
        changes to the DOM specification, added support for "beforeunloadevent", "focusevent",
        and "svgevents", moved "keyboardevents" and "popstateevent" into the list of strings
        we should remove, and moved "compositionevent", "devicemotionevent",
        "deviceorientationevent", "hashchangeevent", "storageevent", and "textevent" into
        the list of strings we should keep.

        * dom/Event.h: Added a virtual setRelatedTarget alongside the virtual relatedTarget
        to allow us to clean up the code that manipulates it.

        * dom/EventContext.cpp:
        (WebCore::MouseOrFocusEventContext::handleLocalEvents const): Call the virtual
        setRelatedTarget instead of doing a little type casting dance.

        * dom/FocusEvent.h: Added createForBindings. Made more functions private and
        changed setRelatedTarget into a private final override.

        * dom/MouseEvent.h: Changed setRelatedTarget into a private final override.

2017-10-07  Andy Estes  <aestes@apple.com>

        [Payment Request] Implement PaymentRequest.show() and PaymentRequest.hide()
        https://bugs.webkit.org/show_bug.cgi?id=178043
        <rdar://problem/34076639>

        Reviewed by Tim Horton.

        Tests: http/tests/paymentrequest/payment-request-abort-method.https.html
               http/tests/paymentrequest/payment-request-show-method.https.html

        * Modules/applepay/PaymentSession.h: Virtually inherited from PaymentSessionBase to
        accommodate ApplePayPaymentHandler inheriting from both this and PaymentHandler.
        (WebCore::PaymentSession::~PaymentSession): Deleted.
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::paymentCoordinator): Virtually inherited from PaymentSessionBase to accommodate
        ApplePayPaymentHandler inheriting from both this and PaymentSession.
        (WebCore::ApplePayPaymentHandler::hasActiveSession): Added. Calls PaymentCoordinator::hasActiveSession().
        (WebCore::ApplePayPaymentHandler::show): Added. Calls PaymentCoordinator::beginPaymentSession().
        (WebCore::ApplePayPaymentHandler::hide): Added. Calls PaymentCoordinator::abortPaymentSession().
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: Inherited from PaymentSession in
        addition to PaymentHandler so that this can be PaymentCoordinator active session.
        * Modules/paymentrequest/PaymentHandler.cpp:
        (WebCore::PaymentHandler::create):
        (WebCore::PaymentHandler::hasActiveSession):
        * Modules/paymentrequest/PaymentHandler.h:
        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::PaymentRequest::~PaymentRequest):
        (WebCore::PaymentRequest::show): Rejected the promise if PaymentCoordinator has an active session.
        (WebCore::PaymentRequest::abort): Called stop().
        (WebCore::PaymentRequest::canSuspendForDocumentSuspension const): Returned true if state is
        Interactive and there is an active handler showing.
        (WebCore::PaymentRequest::stop): Hid the active session if it's showing, then set state to
        Closed and rejected the show promise.
        * Modules/paymentrequest/PaymentRequest.h:
        * Modules/paymentrequest/PaymentSessionBase.h: Added. Inherits from
        RefCounted<PaymentSessionBase> and defines a virtual destructor. This allows subclasses to
        virtually inherit a single ref-count to support multiple inheritance.
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GetGnuVTableOffsetForType): Added ApplePaySession to the list of classes that need a vtable
        offset of 3.

2017-10-07  Ryosuke Niwa  <rniwa@webkit.org>

        WebContentReader::readHTML should be shared between macOS and iOS
        https://bugs.webkit.org/show_bug.cgi?id=178044

        Reviewed by Wenson Hsieh.

        Merged the implementations for WebContentReader::readHTML between macOS and iOS.

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::WebContentReader::readHTML):
        * editing/ios/WebContentReaderIOS.mm:
        (WebCore::WebContentReader::readHTML): Deleted.
        * editing/mac/WebContentReaderMac.mm:
        (WebCore::WebContentReader::readHTML): Deleted.

2017-10-06  Zalan Bujtas  <zalan@apple.com>

        RenderTable should not hold a collection of raw pointers to RenderTableCaption
        https://bugs.webkit.org/show_bug.cgi?id=178026
        <rdar://problem/34863090>

        Reviewed by Simon Fraser.

        Similar to sections, RenderTable should not store captions as raw pointers. Their lifetimes are
        not guaranteed to be sync with the RenderTable's.

        Covered by existing tests.

        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::addCaption):
        (WebCore::RenderTable::removeCaption):
        (WebCore::RenderTable::addOverflowFromChildren):
        * rendering/RenderTable.h:
        * rendering/RenderTableCaption.cpp:
        (WebCore::RenderTableCaption::insertedIntoTree):
        (WebCore::RenderTableCaption::willBeRemovedFromTree):

2017-10-06  Daniel Bates  <dabates@apple.com>

        Spelling error annotation should encompass hyphen in misspelled word that wraps across multiple lines
        https://bugs.webkit.org/show_bug.cgi?id=177980
        <rdar://problem/34847454>

        Reviewed by Simon Fraser.

        On macOS the spelling and grammar annotations for a word or word phrase encompass
        hyphenations added because the word or word phrase wraps across more than one line.
        The effect tends to be more aesthetically pleasing and consistent with how these
        annotations would be pointed out by a person in conversation: by identify the word
        or phrase that has a spelling or grammar issue regardless of whether that word or
        phrase is broken into halves due to line wrapping. The same argument applies to
        other annotations on macOS, including text matches. Therefore, we should always
        include any hyphens encompassed by a marker that were added due to line wrapping
        when painting the marker.

        Test: editing/spelling/spelling-marker-includes-hyphen.html

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paintDocumentMarker): Compute the text run including any
        added hyphens. If a hyphen was added then the inline text box represents that text
        up to the hyphen. Adjust the end position of the marker to be the length of the text
        run if its greater than or equal to the length of the text box.

2017-10-06  Zalan Bujtas  <zalan@apple.com>

        RenderTable should not hold a collection of raw pointers to RenderTableCol
        https://bugs.webkit.org/show_bug.cgi?id=178030
        <rdar://problem/34865236>

        Reviewed by Simon Fraser.

        In addition to the m_columnRenderersValid flag, this patch ensures that
        we don't dereference stale column renderers even when the flag is out of sync.

        Covered by existing tests.

        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::updateColumnCache const):
        (WebCore::RenderTable::slowColElement const):
        * rendering/RenderTable.h:

2017-10-06  Zalan Bujtas  <zalan@apple.com>

        RootInlineBox should not hold a collection of raw pointers to RenderBox
        https://bugs.webkit.org/show_bug.cgi?id=178025
        <rdar://problem/34862488>

        Reviewed by Simon Fraser.

        There are already some assertions in place to check if the renderers are valid.

        Covered by existing test cases.

        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::RenderBlockFlow::reattachCleanLineFloats):
        (WebCore::RenderBlockFlow::determineStartPosition):
        (WebCore::RenderBlockFlow::determineEndPosition):
        * rendering/RootInlineBox.h:
        (WebCore::RootInlineBox::appendFloat):
        (WebCore::RootInlineBox::floatsPtr):

2017-10-06  Zalan Bujtas  <zalan@apple.com>

        Continuation map should not hold a raw pointer
        https://bugs.webkit.org/show_bug.cgi?id=178021
        <rdar://problem/34861590>

        Reviewed by Simon Fraser.

        This patch ensures proper lifetime management for renderers stored in the Continuation map
        (currently they rely on the correctness of addChild/takeChild methods).

        Covered by existing tests.

        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::continuation const):
        (WebCore::RenderBoxModelObject::setContinuation):

2017-10-06  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r222791 and r222873.
        https://bugs.webkit.org/show_bug.cgi?id=178031

        Caused crashes with workers/wasm LayoutTests (Requested by
        ryanhaddad on #webkit).

        Reverted changesets:

        "WebAssembly: no VM / JS version of everything but Instance"
        https://bugs.webkit.org/show_bug.cgi?id=177473
        http://trac.webkit.org/changeset/222791

        "WebAssembly: address no VM / JS follow-ups"
        https://bugs.webkit.org/show_bug.cgi?id=177887
        http://trac.webkit.org/changeset/222873

2017-10-06  Alex Christensen  <achristensen@webkit.org>

        Add more infrastructure to apply custom header fields to same-origin requests
        https://bugs.webkit.org/show_bug.cgi?id=177629

        Reviewed by Ryosuke Niwa.

        Covered by new API tests.

        * loader/DocumentLoader.h:
        (WebCore::DocumentLoader::customHeaderFields):
        * loader/HTTPHeaderField.cpp:
        (WebCore::HTTPHeaderField::create):
        (WebCore::HTTPHeaderField::HTTPHeaderField): Deleted.
        * loader/HTTPHeaderField.h:
        (WebCore::HTTPHeaderField::encode const):
        (WebCore::HTTPHeaderField::decode):
        
        Change HTTPHeaderField from one String containing the name and value
        to a string for the name and another for value.  This matches HTTPHeaderMap
        and NSURLRequest more closely where names and values are treated as separate Strings.
        
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestResource):
        
        If the DocumentLoader has custom header fields from the WebsitePolicies, apply them to any same-origin requests.
        
        * loader/cache/CachedResourceRequest.h:
        (WebCore::CachedResourceRequest::resourceRequest):
        * platform/network/ResourceRequestBase.cpp:
        (WebCore::ResourceRequestBase::setCachePolicy):
        (WebCore::ResourceRequestBase::setTimeoutInterval):
        (WebCore::ResourceRequestBase::setHTTPMethod):
        (WebCore::ResourceRequestBase::setHTTPHeaderField):
        (WebCore::ResourceRequestBase::clearHTTPAuthorization):
        (WebCore::ResourceRequestBase::clearHTTPContentType):
        (WebCore::ResourceRequestBase::clearHTTPReferrer):
        (WebCore::ResourceRequestBase::clearHTTPOrigin):
        (WebCore::ResourceRequestBase::clearHTTPUserAgent):
        (WebCore::ResourceRequestBase::clearHTTPAccept):
        (WebCore::ResourceRequestBase::clearHTTPAcceptEncoding):
        (WebCore::ResourceRequestBase::setResponseContentDispositionEncodingFallbackArray):
        (WebCore::ResourceRequestBase::setHTTPBody):
        (WebCore::ResourceRequestBase::setAllowCookies):
        (WebCore::ResourceRequestBase::setPriority):
        (WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
        (WebCore::ResourceRequestBase::addHTTPHeaderField):
        (WebCore::ResourceRequestBase::setHTTPHeaderFields):
        
        non-HTTP/HTTPS ResourceRequests need to be updated, too, if header fields are added.
        Skipping updating non-HTTP/HTTPS ResourceRequests is not a valid shortcut, and with the
        growing importance of custom schemes with our new public API, we should update ResourceRequests
        of custom schemes correctly.

2017-10-06  Sam Weinig  <sam@webkit.org>

        Add basic support for getting a ImageBitmapRenderingContext
        https://bugs.webkit.org/show_bug.cgi?id=177983

        Reviewed by Dean Jackson.

        Add initial support for ImageBitmapRenderingContext.

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        
            Add new files.
        
        * dom/Document.cpp:
        * dom/Document.h:
        * dom/Document.idl:
        
            Add ImageBitmapRenderingContext to RenderingContext variant so it wil be able to
            be used with Document.getCSSCanvasContext.
        
        * html/HTMLCanvasElement.h:
        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::setHeight):
        (WebCore::HTMLCanvasElement::setWidth):
        
            Throw an exception if the context is in the placeholder mode (which we
            signify via a special PlaceholderRenderingContext) as speced. This can't
            currently be hit, as setting a placeholder requires offscreen canvas
            support, coming soon.
        
        (WebCore::HTMLCanvasElement::getContext):
        
            Re-work to match the spec's matrix of options, adding in support
            for 'bitmaprenderer'/ ImageBitmapRenderingContext type as well as 
            the placeholder mode.
        
        (WebCore::HTMLCanvasElement::createContext2d):
        (WebCore::HTMLCanvasElement::getContext2d):
        (WebCore::HTMLCanvasElement::isWebGLType):
        (WebCore::HTMLCanvasElement::createContextWebGL):
        (WebCore::HTMLCanvasElement::getContextWebGL):
        (WebCore::HTMLCanvasElement::createContextWebGPU):
        (WebCore::HTMLCanvasElement::getContextWebGPU):
        (WebCore::HTMLCanvasElement::isBitmapRendererType):
        (WebCore::HTMLCanvasElement::createContextBitmapRenderer):
        (WebCore::HTMLCanvasElement::getContextBitmapRenderer):

            Split creation out of the get functions so it can be called
            by getContext, where we know if the canvas is null or not.

        * html/HTMLCanvasElement.idl:
        
            Add ImageBitmapRenderingContext to RenderingContext variant so it wil be able to
            be used with HTMLCanvasElement.getContext.

        * html/canvas/CanvasRenderingContext.h:
        (WebCore::CanvasRenderingContext::isBitmapRenderer const):
        (WebCore::CanvasRenderingContext::isPlaceholder const):
        
            Add predicates for ImageBitmapRenderingContext and 
            PlaceholderRenderingContext.
        
        * html/canvas/ImageBitmapRenderingContext.cpp: Added.
        (WebCore::ImageBitmapRenderingContext::ImageBitmapRenderingContext):
        * html/canvas/ImageBitmapRenderingContext.h: Added.
        * html/canvas/ImageBitmapRenderingContext.idl: Added.
        * html/canvas/PlaceholderRenderingContext.cpp: Added.
        (WebCore::PlaceholderRenderingContext::PlaceholderRenderingContext):
        * html/canvas/PlaceholderRenderingContext.h: Added.
        
            Add stubbed out implementations for the new contexts.

2017-10-06  Jer Noble  <jer.noble@apple.com>

        Netflix playback fails with S7353 error
        https://bugs.webkit.org/show_bug.cgi?id=178023

        Reviewed by Dean Jackson.

        On certain platforms, WebCoreDecompressionSession will fail to produce CVImageBuffers when presented with
        encrypted content. On those platforms, the seek() command will fail, because frames at the destination time
        cannot be decoded. This occurs for Netflix because the <video> element is not in the DOM at decode time.

        Only create a WebCoreDecompressionSession in MediaPlayerPrivateMediaSourceAVFObjC when we have explicitly
        been asked to paint into a WebGL canvas.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged):

2017-10-06  Jiewen Tan  <jiewen_tan@apple.com>

        Replace some stack raw pointers with RefPtrs within WebCore/dom
        https://bugs.webkit.org/show_bug.cgi?id=177852
        <rdar://problem/34804487>

        Reviewed by Ryosuke Niwa.

        This is an effort to reduce raw pointer usage in DOM code. In this patch,
        stack raw pointers that could be freed during their lifetime because of
        event dispatching, layout updating and etc are selected. All selections are
        basing on code speculation.

        No changes in behaviours.

        * dom/ContainerNodeAlgorithms.cpp:
        (WebCore::addChildNodesToDeletionQueue):
        Escalate the RefPtr to where node is first defined.
        * dom/Document.cpp:
        (WebCore::Document::setVisualUpdatesAllowed):
        (WebCore::Document::updateLayout):
        (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
        Possible layout updates during their lifetime.
        (WebCore::Document::implicitClose):
        Possible event dispatching during its lifetime.
        (WebCore::Document::nodeChildrenWillBeRemoved):
        (WebCore::Document::nodeWillBeRemoved):
        Possible node removal during their lifetime.
        (WebCore::command):
        Possible layout updates during its lifetime.
        * dom/DocumentMarkerController.cpp:
        (WebCore::DocumentMarkerController::renderedRectsForMarkers):
        Possible layout updates during its lifetime.
        * dom/Element.cpp:
        (WebCore::Element::removedFrom):
         Possible event dispatching during its lifetime.
        (WebCore::checkForSiblingStyleChanges):
        Possible layout updates during their lifetime.
        * dom/MouseRelatedEvent.cpp:
        (WebCore::MouseRelatedEvent::computeRelativePosition):
        Possible layout updates during its lifetime.
        * dom/RadioButtonGroups.cpp:
        (WebCore::RadioButtonGroup::setCheckedButton):
        Possible layout updates during its lifetime.
        * dom/SlotAssignment.cpp:
        (WebCore::SlotAssignment::didChangeSlot):
        Possible layout updates during its lifetime.

2017-10-06  Zalan Bujtas  <zalan@apple.com>

        RootInlineBox should not hold a raw pointer to RenderObject
        https://bugs.webkit.org/show_bug.cgi?id=178018
        <rdar://problem/34859256>

        Reviewed by Simon Fraser.

        Not resetting the line break object could lead to dereferencing a stale renderer.  

        Covered by existing tests.

        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::RootInlineBox):
        (WebCore::RootInlineBox::setLineBreakInfo):
        * rendering/RootInlineBox.h:
        (WebCore::RootInlineBox::lineBreakObj const):

2017-10-06  Youenn Fablet  <youenn@apple.com>

        Removing some dead code in RTCPeerConnection
        https://bugs.webkit.org/show_bug.cgi?id=178011

        Reviewed by Alejandro G. Castro.

        No change of behavior.
        Removing code used by non-libwebrtc WebRTC backends.

        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::addTrack):
        (WebCore::RTCPeerConnection::removeTrack):
        (WebCore::RTCPeerConnection::completeAddTransceiver):

2017-10-05  Dean Jackson  <dino@apple.com>

        ImageBitmap API stubs
        https://bugs.webkit.org/show_bug.cgi?id=177984
        <rdar://problem/34848023>

        Patch by Sam and Dean.
        Reviewed by Dean and Sam.

        Add the IDL for ImageBitmap and ImageBitmapOptions, plus some
        stub implementations (complete with all the algorithms from
        the HTML specification as comments).

        * CMakeLists.txt: Add the new files.
        * DerivedSources.make: Create the JS bindings for ImageBitmap and ImageBitmapOptions.
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/CallTracerTypes.h:
        * html/ImageBitmap.cpp: Added.
        (WebCore::ImageBitmap::create):
        (WebCore::ImageBitmap::createPromise):
        (WebCore::ImageBitmap::ImageBitmap):
        (WebCore::ImageBitmap::~ImageBitmap):
        (WebCore::ImageBitmap::width const):
        (WebCore::ImageBitmap::height const):
        (WebCore::ImageBitmap::close):
        * html/ImageBitmap.h: Added.
        (WebCore::ImageBitmap::isDetached const):
        * html/ImageBitmap.idl: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl.
        * html/ImageBitmapOptions.h: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl.
        * html/ImageBitmapOptions.idl: Copied from Source/WebCore/html/canvas/CanvasDrawImage.idl.
        * html/canvas/CanvasDrawImage.idl:
        * html/canvas/CanvasFillStrokeStyles.idl:
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::size):
        (WebCore::CanvasRenderingContext2D::drawImage):
        (WebCore::CanvasRenderingContext2D::createPattern):
        * html/canvas/CanvasRenderingContext2D.h:
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::indexForData):
        (WebCore::InspectorCanvas::buildAction):
        (WebCore::InspectorCanvas::buildArrayForImageBitmap):
        * inspector/InspectorCanvas.h:
        * inspector/RecordingSwizzleTypes.h:

2017-10-06  Ms2ger  <Ms2ger@igalia.com>

        Create bindings for WebGL2's versions of texImage2D.
        https://bugs.webkit.org/show_bug.cgi?id=178006

        Reviewed by Dean Jackson.

        No new tests: not much point in adding tests now; this method doesn't
        do anything anyway.

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::texImage2D):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:
        * html/canvas/WebGLRenderingContext.idl:
        * html/canvas/WebGLRenderingContextBase.idl:

2017-10-06  Brady Eidson  <beidson@apple.com>

        Add (entirely incorrect) fetching of ServiceWorker scripts.
        https://bugs.webkit.org/show_bug.cgi?id=176179

        Reviewed by Andy Estes.

        No new tests (Covered by changes to existing tests).

        When the Storage process is running the "Update" algorithm and a ServiceWorker script file needs to be fetched, this patch:
          - Messages back to the WebContent process that started the register/update job
          - Executes a FetchLoad in that script context for the script
          - Sends the results back to the Storage process

        We don't do anything with the results yet.

        Soon.

        * WebCore.xcodeproj/project.pbxproj:

        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::didFail):
        * workers/WorkerScriptLoader.h:
        (WebCore::WorkerScriptLoader::error const):

        * workers/WorkerScriptLoaderClient.h:
        (WebCore::WorkerScriptLoaderClient::~WorkerScriptLoaderClient):
        (WebCore::WorkerScriptLoaderClient::didReceiveResponse): Deleted.
        (WebCore::WorkerScriptLoaderClient::notifyFinished): Deleted.

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
        (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
        (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
        * workers/service/ServiceWorkerContainer.h:

        * workers/service/ServiceWorkerFetchResult.h: Copied from Source/WebCore/workers/service/server/SWClientConnection.h.
        (WebCore::ServiceWorkerFetchResult::encode const):
        (WebCore::ServiceWorkerFetchResult::decode):

        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::startScriptFetch):
        (WebCore::ServiceWorkerJob::fetchScriptWithContext):
        (WebCore::ServiceWorkerJob::didReceiveResponse):
        (WebCore::ServiceWorkerJob::notifyFinished):
        * workers/service/ServiceWorkerJob.h:
        * workers/service/ServiceWorkerJobClient.h:

        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::finishedFetchingScript):
        (WebCore::SWClientConnection::failedFetchingScript):
        (WebCore::SWClientConnection::startScriptFetchForServer):
        * workers/service/server/SWClientConnection.h:

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::finishFetchingScriptInServer):
        (WebCore::SWServer::startScriptFetch):
        (WebCore::SWServer::scriptFetchFinished):
        * workers/service/server/SWServer.h:

        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::scriptFetchFinished):
        (WebCore::SWServerRegistration::runUpdateJob):
        (WebCore::SWServerRegistration::startScriptFetchFromMainThread):
        (WebCore::SWServerRegistration::startScriptFetchForCurrentJob):
        * workers/service/server/SWServerRegistration.h:

2017-10-06  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Create Cairo patterns from Gradient objects on-the-fly
        https://bugs.webkit.org/show_bug.cgi?id=177947

        Reviewed by Carlos Garcia Campos.

        Stop caching cairo_pattern_t objects for a specific global alpha value
        in the Gradient class. Instead, create these as required, for whatever
        alpha value. This drops some efficiency benefits in exchange for better
        Cairo operation isolation, while also matching the same approach that
        is used in the Pattern implementation for Cairo.

        Introduce the createPlatformGradient() method for Cairo, resuing the
        implementation of platformGradient() that's now removed. The
        Cairo-specific setPlatformGradientSpaceTransform() method is also
        removed since there's no cached cairo_pattern_t object that we can
        update. The Cairo-specific m_platformGradientAlpha member float is also
        deleted.

        Gradient::fill() and prepareCairoContextSource() are the only two places
        that need to create a cairo_pattern_t object off of Gradient, so they
        are updated accordingly.

        No new tests -- no changes in behavior.

        * platform/graphics/Gradient.cpp:
        (WebCore::Gradient::setGradientSpaceTransform):
        (WebCore::Gradient::setPlatformGradientSpaceTransform): Deleted.
        * platform/graphics/Gradient.h:
        * platform/graphics/cairo/GradientCairo.cpp:
        (WebCore::Gradient::platformDestroy):
        (WebCore::Gradient::createPlatformGradient):
        (WebCore::Gradient::fill):
        (WebCore::Gradient::platformGradient): Deleted.
        (WebCore::Gradient::setPlatformGradientSpaceTransform): Deleted.
        * platform/graphics/cairo/PlatformContextCairo.cpp:
        (WebCore::prepareCairoContextSource):

2017-10-06  Ms2ger  <Ms2ger@igalia.com>

        Create bindings for WebGL2's versions of compressedTexImage2D.
        https://bugs.webkit.org/show_bug.cgi?id=177481

        Reviewed by Žan Doberšek.

        No new tests: not much point in adding tests now; this method doesn't
        do anything anyway.

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::compressedTexImage2D):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:
        * html/canvas/WebGLRenderingContext.idl:
        * html/canvas/WebGLRenderingContextBase.idl:

2017-10-06  Enrique Ocaña González  <eocanha@igalia.com>

        [GStreamer][MSE] Likely race condition causes WTF::Deque to crash on debug
        https://bugs.webkit.org/show_bug.cgi?id=177410

        Reviewed by Xabier Rodriguez-Calvar.

        Deque keeps a chain of iterators which is updated as iterators are
        created/destroyed. This can cause problems when iterators are created
        from multiple threads as they are now, sometimes without proper
        locking because it's not actually needed.

        For instance, the lock in PlaybackPipeline::enqueueSample() is not
        needed because none of the accesses are actually risky. Locking there
        just to make Deque happy would only cause a performance penalty on the
        readers working in other threads.

        No new tests.

        * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
        (WebCore::PlaybackPipeline::addSourceBuffer): Use Vector instead of
        Deque.
        (WebCore::PlaybackPipeline::removeSourceBuffer): Ditto.
        (WebCore::PlaybackPipeline::enqueueSample): Remove lock and explain
        why it's not needed.
        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
        (webKitMediaSrcFinalize): Use Vector.
        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
        Use Vector.

2017-10-06  Zan Dobersek  <zdobersek@igalia.com>

        Remove dead code from Pattern
        https://bugs.webkit.org/show_bug.cgi?id=177945

        Reviewed by Carlos Garcia Campos.

        Drop the platormDestroy() and setPlatformPatternSpaceTransform() methods
        from the Pattern class -- these were empty implementations, with no port
        providing their own. The destructor is defaulted in the implementation
        file. The m_pattern member variable is also dropped as it was unused.

        No new tests -- no change in behavior.

        * platform/graphics/Pattern.cpp:
        (WebCore::Pattern::setPatternSpaceTransform):
        (WebCore::Pattern::~Pattern): Deleted.
        (WebCore::Pattern::platformDestroy): Deleted.
        (WebCore::Pattern::setPlatformPatternSpaceTransform): Deleted.
        * platform/graphics/Pattern.h:

2017-10-06  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK][Clang] Build fix after r222926
        https://bugs.webkit.org/show_bug.cgi?id=175384

        Unreviewed build fix.

        * css/CSSFontFace.cpp:
        (WebCore::CSSFontFace::setStatus):

2017-10-06  Enrique Ocaña González  <eocanha@igalia.com>

        [MSE][GStreamer] Seek on youtube.com/tv fails after r217185
        https://bugs.webkit.org/show_bug.cgi?id=177976

        Reviewed by Jer Noble.

        Covered by existing tests.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::seekToTime): Only call waitForSeekCompleted()
        when the time is not buffered when using GStreamer.

2017-10-06  Enrique Ocaña González  <eocanha@igalia.com>

        [MSE] Dead code in SourceBuffer::appendBufferTimerFired()
        https://bugs.webkit.org/show_bug.cgi?id=177951

        Reviewed by Jer Noble.

        Covered by LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-append-buffer.html.

        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::appendBufferTimerFired): Remove redundant code.

2017-10-06  Ryosuke Niwa  <rniwa@webkit.org>

        Split StaticPasteboard::writeString into writeString and writeStringInCustomData
        https://bugs.webkit.org/show_bug.cgi?id=177991

        Reviewed by Wenson Hsieh.

        Split writeString into the one that writes into the plaform pasteboard natively and the custom pasteboard data like we did
        in r222680 for readString and readStringInCustomData.

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::setData):
        (WebCore::DataTransfer::setDataFromItemList): Extracted out of setData.
        * dom/DataTransfer.h:
        * dom/DataTransferItemList.cpp:
        (WebCore::DataTransferItemList::add):
        * platform/StaticPasteboard.cpp:
        (WebCore::updateTypes): Extacted out of writeString.
        (WebCore::StaticPasteboard::writeString):
        (WebCore::StaticPasteboard::writeStringInCustomData):
        * platform/StaticPasteboard.h:

2017-10-05  Dean Jackson  <dino@apple.com>

        [WebGL] Safari performance is slow due to high MSAA usage
        https://bugs.webkit.org/show_bug.cgi?id=177949
        <rdar://problem/34835619>

        Reviewed by Sam Weinig.

        On some hardware, typically integrated GPUs, using MSAA with a sample
        count above 4 produces bad performance. Limit the number of samples to
        4 universally.

        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
        (WebCore::GraphicsContext3D::reshapeFBOs):

2017-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] All resource load statistics tests added in r212183 crash in GTK bots, timeout in GTK and WPE bots since r219049
        https://bugs.webkit.org/show_bug.cgi?id=168171

        Reviewed by Chris Dumez.

        Add an implementation of FileMonitor for GLib based ports.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * platform/FileMonitor.cpp:
        * platform/FileMonitor.h:
        * platform/glib/FileMonitorGLib.cpp: Added.
        (WebCore::FileMonitor::FileMonitor):
        (WebCore::FileMonitor::~FileMonitor):
        (WebCore::FileMonitor::fileChangedCallback):
        (WebCore::FileMonitor::didChange):

2017-10-05  Dean Jackson  <dino@apple.com>

        Lots of missing frames in YouTube360 when fullscreen on MacBook
        https://bugs.webkit.org/show_bug.cgi?id=177903
        <rdar://problem/33273300>

        Reviewed by Sam Weinig.

        Our compositing path for WebGL on macOS was too slow, requiring a copy
        of the framebuffer into another GL context. Replace this by having
        WebGL render into a texture that is backed by an IOSurface, and then
        set the WebGLLayer to use the IOSurface as contents.

        Covered by the existing WebGL tests.

        * platform/graphics/GraphicsContext3D.h:
        (WebCore::GraphicsContext3D::platformTexture const): We no longer use the
        framebuffer object outside the class, so change this to return the GL texture
        that the framebuffer is rendering in to. It was kind-of strange that it was
        named this way originally.
        Also make endPaint available on macOS, and add the definitions for
        createIOSurfaceBackingStore and updateFramebufferTextureBackingStoreFromLayer.

        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
        (WebCore::GraphicsContext3D::GraphicsContext3D): Now that we're using an IOSurface,
        we're binding to a new attachment point, GL_TEXTURE_RECTANGLE.
        (WebCore::GraphicsContext3D::endPaint): This is now being called on macOS and iOS,
        so add a comment that explains the extra work that iOS needs to do. At some future
        point it would be nice to make this slightly cleaner, so that iOS and macOS are
        more similar.
        (WebCore::GraphicsContext3D::allocateIOSurfaceBackingStore): New function that calls
        into the corresponding WebGLLayer function.
        (WebCore::GraphicsContext3D::updateFramebufferTextureBackingStoreFromLayer): Ditto.

        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
        (WebCore::wipeAlphaChannelFromPixels): Both readPixels and drawing a WebGL context
        into another buffer need to fill out the alpha channel if this context was
        created without one, otherwise the IOSurface backing store will happily provide
        what might be non-zero values.
        (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary): Call the helper above.
        (WebCore::GraphicsContext3D::reshapeFBOs): Add more code to call into the macOS-specific
        function to use an IOSurface as the framebuffer texture.
        (WebCore::GraphicsContext3D::readPixels): Call the helper above.

        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        (PlatformCALayerCocoa::copyContentsFromLayer): Replace the use of the
        deprecated setContentsChanged with reloadValueForKeyPath.

        * platform/graphics/cocoa/WebGLLayer.h: The macOS implementation now
        inherits from CALayer directly rather than CAOpenGLLayer. It also adds
        a few member variables to handle the IOSurfaces used for triple buffering.

        * platform/graphics/cocoa/WebGLLayer.mm:
        (-[WebGLLayer initWithGraphicsContext3D:]): If we were created without an
        alpha channel, tell CA that we're an opaque layer. Also set the layer's transform
        to identity, so that it calls into the code below to flip the contents.
        (-[WebGLLayer setTransform:]): Because an IOSurface is used for the layer contents,
        we don't get a chance to flip the drawing the way we do via the drawInContext delegate.
        Instead we have to apply a scale(1, -1) transform on top of the layer transform to
        make sure the layer is rendered right-way up.
        (-[WebGLLayer setAnchorPoint:]): Ditto, except we have to assume the anchor point is
        at the bottom of the layer, so flip the Y value.
        (-[WebGLLayer display]): Swap between the drawing buffer and the contents buffer, and
        then get a new buffer ready for display.
        (createAppropriateIOSurface): Helper.
        (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): Initializes the
        IOSurfaces used for drawing buffers.
        (-[WebGLLayer bindFramebufferToNextAvailableSurface]): Take the next available IOSurface and
        make it the drawing buffer (binding in to WebGL at the same time).
        (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]): Deleted.
        (-[WebGLLayer copyCGLContextForPixelFormat:]): Deleted.
        (-[WebGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]): Deleted.

        * platform/graphics/mac/WebLayer.mm: Remove the definition of reloadValueForKeyPath.

2017-10-05  Frederic Wang  <fwang@igalia.com>

        Update Source/ThirdParty/woff2 to 22c256bc457777744ba14b7325a6e8e0e7dec91c
        https://bugs.webkit.org/show_bug.cgi?id=177994

        Reviewed by Michael Catanzaro.

        No new tests, already covered by existing tests.

        * CMakeLists.txt: Include the directory for public headers instead.
        * platform/graphics/WOFFFileFormat.cpp: Use the public header
        woff2/decode.h and do not use the "wOF2" constant from private headers.
        (WebCore::isWOFF):
        (WebCore::convertWOFFToSfnt):

2017-10-05  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r222951 and r222952.
        https://bugs.webkit.org/show_bug.cgi?id=177992

        "Broke the iOS build and introduced a webgl LayoutTest
        failure." (Requested by ryanhaddad on #webkit).

        Reverted changesets:

        "Lots of missing frames in YouTube360 when fullscreen on
        MacBook"
        https://bugs.webkit.org/show_bug.cgi?id=177903
        http://trac.webkit.org/changeset/222951

        "Lots of missing frames in YouTube360 when fullscreen on
        MacBook"
        https://bugs.webkit.org/show_bug.cgi?id=177903
        http://trac.webkit.org/changeset/222952

2017-10-05  Ryosuke Niwa  <rniwa@webkit.org>

        DataTransfer shouldn't contain text/html when performing Paste and Match Style
        https://bugs.webkit.org/show_bug.cgi?id=174165
        <rdar://problem/33138027>

        Reviewed by Wenson Hsieh.

        When performing Paste and Match Style, only expose the plain text by creating a StaticPasteboard with plain text content.

        This patch introduces ClipboardEventKind enum class to differentiate regular paste and paste and match style (internally
        called as pasteAsPlainText) since both operations use "paste" event.

        Tests: editing/pasteboard/data-transfer-get-data-on-paste-as-plain-text-when-custom-pasteboard-data-disabled.html
               editing/pasteboard/data-transfer-get-data-on-paste-as-plain-text.html

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::createForCopyAndPaste): Made this function take Pasteboard as an argument.
        * dom/DataTransfer.h:
        * editing/Editor.cpp:
        (WebCore::ClipboardEventKind): Added.
        (WebCore::eventNameForClipboardEvent): Added.
        (WebCore::createDataTransferForClipboardEvent): Added.
        (WebCore::dispatchClipboardEvent):
        (WebCore::Editor::canDHTMLCut):
        (WebCore::Editor::canDHTMLCopy):
        (WebCore::Editor::canDHTMLPaste):
        (WebCore::Editor::tryDHTMLCopy):
        (WebCore::Editor::tryDHTMLCut):
        (WebCore::Editor::tryDHTMLPaste): Deleted.
        (WebCore::Editor::paste):
        (WebCore::Editor::pasteAsPlainText):
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType): Add "text/html" when public.html UTI is in the pasteboard
        even when the custom pasteboard data is disabled. We continue to add public.html in the case some app dependent on
        seeing "public.html" in dataTransfer.types.

2017-10-05  Zalan Bujtas  <zalan@apple.com>

        RenderTable should not hold section raw pointers
        https://bugs.webkit.org/show_bug.cgi?id=177977
        <rdar://problem/34846034>

        Reviewed by Simon Fraser.

        This enables us to remove forced recalcSections calls.

        Covered by existing tests.

        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::RenderTable):
        (WebCore::resetSectionPointerIfNotBefore):
        (WebCore::RenderTable::addChild):
        (WebCore::RenderTable::recalcSections const):
        (WebCore::RenderTable::sectionAbove const):
        * rendering/RenderTable.h:
        (WebCore::RenderTable::header const):
        (WebCore::RenderTable::footer const):
        (WebCore::RenderTable::firstBody const):
        (WebCore::RenderTable::topSection const):

2017-10-05  Dean Jackson  <dino@apple.com>

        Lots of missing frames in YouTube360 when fullscreen on MacBook
        https://bugs.webkit.org/show_bug.cgi?id=177903
        <rdar://problem/33273300>

        iOS build fix.

        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:

2017-10-05  Dean Jackson  <dino@apple.com>

        Lots of missing frames in YouTube360 when fullscreen on MacBook
        https://bugs.webkit.org/show_bug.cgi?id=177903
        <rdar://problem/33273300>

        Reviewed by Sam Weinig.

        Our compositing path for WebGL on macOS was too slow, requiring a copy
        of the framebuffer into another GL context. Replace this by having
        WebGL render into a texture that is backed by an IOSurface, and then
        set the WebGLLayer to use the IOSurface as contents.

        Covered by the existing WebGL tests.

        * platform/graphics/GraphicsContext3D.h:
        (WebCore::GraphicsContext3D::platformTexture const): We no longer use the
        framebuffer object outside the class, so change this to return the GL texture
        that the framebuffer is rendering in to. It was kind-of strange that it was
        named this way originally.
        Also make endPaint available on macOS, and add the definitions for
        createIOSurfaceBackingStore and updateFramebufferTextureBackingStoreFromLayer.

        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
        (WebCore::GraphicsContext3D::GraphicsContext3D): Now that we're using an IOSurface,
        we're binding to a new attachment point, GL_TEXTURE_RECTANGLE.
        (WebCore::GraphicsContext3D::endPaint): This is now being called on macOS and iOS,
        so add a comment that explains the extra work that iOS needs to do. At some future
        point it would be nice to make this slightly cleaner, so that iOS and macOS are
        more similar.
        (WebCore::GraphicsContext3D::allocateIOSurfaceBackingStore): New function that calls
        into the corresponding WebGLLayer function.
        (WebCore::GraphicsContext3D::updateFramebufferTextureBackingStoreFromLayer): Ditto.

        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
        (WebCore::wipeAlphaChannelFromPixels): Both readPixels and drawing a WebGL context
        into another buffer need to fill out the alpha channel if this context was
        created without one, otherwise the IOSurface backing store will happily provide
        what might be non-zero values.
        (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary): Call the helper above.
        (WebCore::GraphicsContext3D::reshapeFBOs): Add more code to call into the macOS-specific
        function to use an IOSurface as the framebuffer texture.
        (WebCore::GraphicsContext3D::readPixels): Call the helper above.

        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        (PlatformCALayerCocoa::copyContentsFromLayer): Replace the use of the
        deprecated setContentsChanged with reloadValueForKeyPath.

        * platform/graphics/cocoa/WebGLLayer.h: The macOS implementation now
        inherits from CALayer directly rather than CAOpenGLLayer. It also adds
        a few member variables to handle the IOSurfaces used for triple buffering.

        * platform/graphics/cocoa/WebGLLayer.mm:
        (-[WebGLLayer initWithGraphicsContext3D:]): If we were created without an
        alpha channel, tell CA that we're an opaque layer. Also set the layer's transform
        to identity, so that it calls into the code below to flip the contents.
        (-[WebGLLayer setTransform:]): Because an IOSurface is used for the layer contents,
        we don't get a chance to flip the drawing the way we do via the drawInContext delegate.
        Instead we have to apply a scale(1, -1) transform on top of the layer transform to
        make sure the layer is rendered right-way up.
        (-[WebGLLayer setAnchorPoint:]): Ditto, except we have to assume the anchor point is
        at the bottom of the layer, so flip the Y value.
        (-[WebGLLayer display]): Swap between the drawing buffer and the contents buffer, and
        then get a new buffer ready for display.
        (createAppropriateIOSurface): Helper.
        (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): Initializes the
        IOSurfaces used for drawing buffers.
        (-[WebGLLayer bindFramebufferToNextAvailableSurface]): Take the next available IOSurface and
        make it the drawing buffer (binding in to WebGL at the same time).
        (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]): Deleted.
        (-[WebGLLayer copyCGLContextForPixelFormat:]): Deleted.
        (-[WebGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]): Deleted.

        * platform/graphics/mac/WebLayer.mm: Remove the definition of reloadValueForKeyPath.

2017-10-05  Myles C. Maxfield  <mmaxfield@apple.com>

        Add "display" to FontFace Javascript object
        https://bugs.webkit.org/show_bug.cgi?id=175383
        <rdar://problem/33813239>

        Reviewed by Simon Fraser.

        We already have all the necessary infrastructure. Just hook it up to the .idl file!

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

        * css/CSSFontFace.h:
        * css/CSSPrimitiveValueMappings.h:
        * css/FontFace.cpp:
        (WebCore::FontFace::create):
        (WebCore::FontFace::setDisplay):
        (WebCore::FontFace::display const):
        * css/FontFace.h:
        * css/FontFace.idl:

2017-10-05  Jer Noble  <jer.noble@apple.com>

        [Cocoa] Enable ENABLE_ENCRYPTED_MEDIA build-time setting
        https://bugs.webkit.org/show_bug.cgi?id=177261

        Reviewed by Eric Carlson.

        Enable ENCRYPTED_MEDIA, and make the changes required for ENABLED_MEDIA and LEGACY_ENABLED_MEDIA
        to co-exist while both enabled simultaneously.

        * Configurations/FeatureDefines.xcconfig:
        * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
        (WebCore::LegacyCDM::registerCDMFactory):
        (WebCore::LegacyCDM::supportsKeySystem):
        (WebCore::LegacyCDM::keySystemSupportsMimeType):
        (WebCore::LegacyCDM::create):
        (WebCore::LegacyCDM::LegacyCDM):
        (WebCore::LegacyCDM::~LegacyCDM):
        (WebCore::LegacyCDM::supportsMIMEType const):
        (WebCore::LegacyCDM::createSession):
        (WebCore::LegacyCDM::mediaPlayer const):
        (WebCore::CDM::registerCDMFactory): Deleted.
        (WebCore::CDM::supportsKeySystem): Deleted.
        (WebCore::CDM::keySystemSupportsMimeType): Deleted.
        (WebCore::CDM::create): Deleted.
        (WebCore::CDM::CDM): Deleted.
        (WebCore::CDM::~CDM): Deleted.
        (WebCore::CDM::supportsMIMEType const): Deleted.
        (WebCore::CDM::createSession): Deleted.
        (WebCore::CDM::mediaPlayer const): Deleted.
        * Modules/encryptedmedia/legacy/LegacyCDM.h:
        (WebCore::LegacyCDMClient::~LegacyCDMClient):
        (WebCore::LegacyCDM::client const):
        (WebCore::LegacyCDM::setClient):
        (WebCore::CDMClient::~CDMClient): Deleted.
        (WebCore::CDM::keySystem const): Deleted.
        (WebCore::CDM::client const): Deleted.
        (WebCore::CDM::setClient): Deleted.
        * Modules/encryptedmedia/legacy/LegacyCDMPrivate.h:
        * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp:
        (WebCore::LegacyCDMPrivateClearKey::supportsKeySystem):
        (WebCore::LegacyCDMPrivateClearKey::supportsKeySystemAndMimeType):
        (WebCore::LegacyCDMPrivateClearKey::supportsMIMEType):
        (WebCore::LegacyCDMPrivateClearKey::createSession):
        (WebCore::CDMPrivateClearKey::supportsKeySystem): Deleted.
        (WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType): Deleted.
        (WebCore::CDMPrivateClearKey::supportsMIMEType): Deleted.
        (WebCore::CDMPrivateClearKey::createSession): Deleted.
        * Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
        (WebCore::LegacyCDMPrivateClearKey::LegacyCDMPrivateClearKey):
        (WebCore::LegacyCDMPrivateClearKey::~LegacyCDMPrivateClearKey):
        (WebCore::CDMPrivateClearKey::CDMPrivateClearKey): Deleted.
        (WebCore::CDMPrivateClearKey::~CDMPrivateClearKey): Deleted.
        * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
        (WebCore::CDMPrivateMediaPlayer::createSession):
        * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h:
        (WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
        (WebCore::CDMPrivateMediaPlayer::cdm const):
        * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
        (WebCore::CDMSessionClearKey::CDMSessionClearKey):
        * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
        * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
        (WebCore::WebKitMediaKeys::create):
        (WebCore::WebKitMediaKeys::WebKitMediaKeys):
        (WebCore::WebKitMediaKeys::isTypeSupported):
        (WebCore::WebKitMediaKeys::cdmMediaPlayer const):
        * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/encryptedmedia/CDMFactory.cpp:
        (WebCore::CDMFactory::platformRegisterFactories):
        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::ClearKeyState::singleton):
        (WebCore::parseJSONObject):
        (WebCore::parseLicenseFormat):
        (WebCore::parseLicenseReleaseAcknowledgementFormat):
        (WebCore::CDMFactoryClearKey::singleton):
        (WebCore::containsPersistentLicenseType):
        (WebCore::CDMInstanceClearKey::keySystem const):
        * platform/encryptedmedia/clearkey/CDMClearKey.h:
        * platform/graphics/LegacyCDMSession.h:
        (WebCore::LegacyCDMSessionClient::~LegacyCDMSessionClient):
        (WebCore::CDMSession::type):
        (WebCore::CDMSessionClient::~CDMSessionClient): Deleted.
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::createSession):
        * platform/graphics/MediaPlayer.h:
        * platform/graphics/MediaPlayerPrivate.h:
        (WebCore::MediaPlayerPrivateInterface::createSession):
        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
        (WebCore::CDMPrivateMediaSourceAVFObjC::CDMPrivateMediaSourceAVFObjC):
        (WebCore::CDMPrivateMediaSourceAVFObjC::cdm const):
        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
        (WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
        (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
        (WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
        (WebCore::CDMSessionAVContentKeySession::update):
        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
        (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
        (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
        (WebCore::CDMSessionAVFoundationObjC::playerDidReceiveError):
        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
        (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
        (WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC):
        (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError):
        (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::nativeImageForCurrentTime):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
        * testing/Internals.cpp:
        (WebCore::Internals::initializeMockCDM):
        * testing/LegacyMockCDM.cpp:
        (WebCore::LegacyMockCDM::supportsKeySystem):
        (WebCore::LegacyMockCDM::supportsKeySystemAndMimeType):
        (WebCore::LegacyMockCDM::supportsMIMEType):
        (WebCore::LegacyMockCDM::createSession):
        (WebCore::MockCDMSession::MockCDMSession):
        (WebCore::MockCDM::supportsKeySystem): Deleted.
        (WebCore::MockCDM::supportsKeySystemAndMimeType): Deleted.
        (WebCore::MockCDM::supportsMIMEType): Deleted.
        (WebCore::MockCDM::createSession): Deleted.
        * testing/LegacyMockCDM.h:
        (WebCore::LegacyMockCDM::LegacyMockCDM):
        (WebCore::LegacyMockCDM::~LegacyMockCDM):
        (WebCore::MockCDM::MockCDM): Deleted.
        (WebCore::MockCDM::~MockCDM): Deleted.
        * testing/MockCDMFactory.cpp:
        (WebCore::MockCDMInstance::keySystem const):

2017-10-05  John Wilander  <wilander@apple.com>

        Storage Access API: Web process should ask UI process for grant/deny
        https://bugs.webkit.org/show_bug.cgi?id=176941
        <rdar://problem/34440036>

        Reviewed by Chris Dumez and Sam Weinig.

        Tests: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-non-sandboxed-iframe.html
               http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction.html
               http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe-from-prevalent-domain-without-user-interaction.html

        This patch changes Document::requestStorageAccess() so that it
        calls the ChromeClient instead of the ResourceLoadObserver to
        request storage access on behalf of the iframe.
        The patch also changes how the promise is used, from returning
        a boolean to either resolving or rejecting to signal grant/deny
        access respectively.

        * dom/Document.cpp:
        (WebCore::Document::requestStorageAccess):
        * dom/Document.idl:
        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::registerStorageAccess): Deleted.
        * loader/ResourceLoadObserver.h:
        * page/ChromeClient.h:

2017-10-05  Brian Burg  <bburg@apple.com>

        Web Inspector: EventLoop::cycle() should not send nil NSEvents
        https://bugs.webkit.org/show_bug.cgi?id=177971
        <rdar://problem/20387399>

        Reviewed by Joseph Pecoraro.

        It is possible for the next matching event to be nil.
        WebKit clients don't expect to be sent a nil NSEvent, so add a null check here.

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

2017-10-05  Chris Dumez  <cdumez@apple.com>

        Drop unused parameters for CookiesStrategy::cookiesEnabled()
        https://bugs.webkit.org/show_bug.cgi?id=177957

        Reviewed by Alex Christensen.

        * loader/CookieJar.cpp:
        (WebCore::cookiesEnabled):
        * platform/CookiesStrategy.h:
        * platform/network/PlatformCookieJar.h:
        * platform/network/cf/CookieJarCFNet.cpp:
        (WebCore::cookiesEnabled):
        * platform/network/curl/CookieJarCurl.cpp:
        (WebCore::CookieJarCurlFileSystem::cookiesEnabled):
        (WebCore::cookiesEnabled):
        * platform/network/curl/CookieJarCurl.h:
        * platform/network/mac/CookieJarMac.mm:
        (WebCore::cookiesEnabled):
        * platform/network/soup/CookieJarSoup.cpp:
        (WebCore::cookiesEnabled):

2017-10-05  Zalan Bujtas  <zalan@apple.com>

        RenderListItem should not hold raw pointers to RenderListMarker.
        https://bugs.webkit.org/show_bug.cgi?id=177968
        <rdar://problem/34842943>

        Reviewed by Antti Koivisto.

        Now we don't need to unregister the marker from the list item explicitly.

        Covered by existing tests.

        * rendering/RenderListItem.cpp:
        (WebCore::RenderListItem::RenderListItem):
        (WebCore::RenderListItem::willBeDestroyed):
        (WebCore::RenderListItem::positionListMarker):
        * rendering/RenderListItem.h:
        * rendering/RenderListMarker.cpp:
        (WebCore::RenderListMarker::willBeDestroyed):
        * style/RenderTreeUpdaterListItem.cpp:
        (WebCore::RenderTreeUpdater::ListItem::updateMarker):

2017-10-05  Said Abou-Hallawa  <sabouhallawa@apple.com>

        RenderSVGRoot should check the renderers inside its visualOverflowRect for hit testing if the overflow is visible
        https://bugs.webkit.org/show_bug.cgi?id=177953
        <rdar://problem/34788389>

        Reviewed by Simon Fraser.

        Test: svg/hittest/svg-visual-overflow-rect.html

        If an SVGElement is positioned outside the rectangle of the root element,
        it can still be drawn if the root element has "overflow: visible" applied.
        But since SVGElement can be drawn in this case, it should be accessible
        through nodeAtPoint() which is used for hit testing.

        * rendering/svg/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::nodeAtPoint):

2017-10-05  Zalan Bujtas  <zalan@apple.com>

        RenderButton should not hold raw pointers to its direct children.
        https://bugs.webkit.org/show_bug.cgi?id=177960
        <rdar://problem/34840807>

        Reviewed by Antti Koivisto.

        The correct way of destroying a renderer is to call ::removeFromParentAndDestroy().

        Covered by existing tests.

        * rendering/RenderButton.cpp:
        (WebCore::RenderButton::RenderButton):
        (WebCore::RenderButton::addChild):
        (WebCore::RenderButton::takeChild):
        (WebCore::RenderButton::updateAnonymousChildStyle const):
        (WebCore::RenderButton::setText):
        (WebCore::RenderButton::text const):
        * rendering/RenderButton.h:

2017-10-05  David Kilzer  <ddkilzer@apple.com>

        Bug 177893: Disable -Wcast-qual for new clang compiler in Apple ports
        <https://webkit.org/b/177893>
        <rdar://problem/33667497>

        Reviewed by Tim Horton.

        * Configurations/Base.xcconfig:
        (WARNING_CFLAGS): Remvoe -Wcast-qual until we can provide a safe
        cast function that lets us re-enable the warning.

2017-10-05  Myles C. Maxfield  <mmaxfield@apple.com>

        Implement font-display loading behaviors
        https://bugs.webkit.org/show_bug.cgi?id=175384
        <rdar://problem/33813243>

        Reviewed by Darin Adler.

        The font-display descriptors works off of the following model of font loading:

        1. When a font loads, the @font-face enters the first phase, called the "block period." Here,
        text using this @font-face is rendered as invisible using a fallback font for metrics. If the
        file finishes loading during this period, it is swapped in (visibly).
        2. When the first phase is over, the @font-face enters the second phase, called the "swap
        period." Here, text using this @font-face is rendered visibly using a fallback font. If the
        file finishes loading during this period, it is swapped in.
        3. When the second phase is over, the @font-face enters the third phase, called the "failure
        period." Here, text using this @font-face is rendered visibly using a fallback font. If the
        file finishes loading during this period, it is not swapped in (but it does live in the
        network cache for subsequent page loads). This phase lasts forever.

        The font-display descriptor changes the duration of these phases. For example, our default
        font loading behavior can be achieved by making the first phase 3 seconds long and making the
        second phase infinitely long (so the third phase is never reached).

        Luckily, our CSSFontFace class already has states which correspond to each phase listed above:
        Loading, TimedOut, and Failure. This patch migrates our existing 3-second timer to have logic
        to correctly set the timeout duration based on the value of the font-display descriptor and
        the current status(). This occurs inside CSSFontFace::setStatus().

        This has implications for testing. Previously, our tests for the font loading behavior had a
        single boolean that describes whether or not font loads should immediately jump to the "swap
        period". Clearly, this is insufficient for testing all aspects of the font-display descriptor.
        Instead, this patch deletes this existing infrastructure and instead creates three more fake
        values of font-display (achieved in tests by using window.internals). These fake values make
        fonts immediately jump into a particular state and stay there forever (so the timeout values
        are, for example, [0, infinity, infinity] to test the swap period). This works because
        CSSFontFace is smart enough to synchronously move between states that have a 0 timeout, so
        there is no race between these timers and font loads.

        We also need to test the behavior when a file downloads and when a file hasn't been loaded
        yet (and the @font-face is in a particular state). Therefore, this patch adds another bool
        which indicates whether the font subsystem should totally ignore font load events. This means
        that a font will successfully download (and DOMContentLoaded will be fired, because that
        uses the loading subsystem), but the font subsystem will plug its ears and ignore the load.
        This means we can test the invisibility of text during the "block period" because DRT will
        see that the page load has completed, but the font subsystem will pretend like the font is
        still loading and draw invisibly.

        Therefore, there are 6 tests: a test to test each of the 3 states an @font-face block may be
        in, times 2 for whether or not we are ignoring font loads. These are more comprehensive than
        the existing font loading tests which used internals.settings.setWebFontsAlwaysFallBack(),
        so I deleted those tests in favor of these new ones.

        Tests: fast/text/loading-block-finish.html
               fast/text/loading-block-nofinish.html
               fast/text/loading-failure-finish.html
               fast/text/loading-failure-nofinish.html
               fast/text/loading-swap-finish.html
               fast/text/loading-swap-nofinish.html

        * css/CSSFontFace.cpp:
        (WebCore::CSSFontFace::setLoadingBehavior):
        (WebCore::CSSFontFace::fontLoadEventOccurred): Remove old testing infrastructure.
        (WebCore::CSSFontFace::timeoutFired): Previously, the timer was only used for going
        from Loading -> TimedOut. Now, we have to ask the status() to figure out which
        state transition we should be performing.
        (WebCore::CSSFontFace::allSourcesFailed const): A Failed state needs to return true
        here, even if some of the sources successfully downloaded.
        (WebCore::CSSFontFace::setStatus): The logic to figure out how long to set the timer
        for. Also, if the timer value is 0, synchronously recurse to change the status instead
        of setting a 0-delay timer.
        (WebCore::CSSFontFace::fontLoaded): Remove old testing infrastructure.
        (WebCore::CSSFontFace::fontTimeoutIndex const): Implement new testing infrastructure.
        (WebCore::CSSFontFace::shouldIgnoreFontLoadCompletions const): Ditto.
        (WebCore::CSSFontFace::pump): See comment. Also, we're allowed to be in the Failure
        state in more scenarios now, so relax some of our ASSERT()s.
        (WebCore::CSSFontFace::font): Ditto.
        (WebCore::CSSFontFace::webFontsShouldAlwaysFallBack const): Deleted.
        * css/CSSFontFace.h: Migrate to new testing infrastructure.
        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::CSSFontFaceSource): Implement new testing infrastructure.
        (WebCore::CSSFontFaceSource::shouldIgnoreFontLoadCompletions const): Ditto.
        (WebCore::CSSFontFaceSource::fontLoaded): Ditto.
        * css/CSSFontFaceSource.h:
        * css/CSSFontSelector.cpp:
        (WebCore::CSSFontSelector::beginLoadingFontSoon): Remove old testing infrastructure.
        * css/CSSSegmentedFontFace.cpp: It's possible to get different values out of
        CSSFontFace::font() in successive calls during the same runloop. FontRanges will 
        include a raw pointer to one of the values, so all the values need to be kept alive.
        * page/Settings.cpp: Migrate to new testing infrastructure.
        (WebCore::Settings::Settings):
        (WebCore::Settings::setFontTimeoutIndex):
        (WebCore::Settings::setShouldIgnoreFontLoadCompletions):
        (WebCore::Settings::setWebFontsAlwaysFallBack): Deleted.
        * page/Settings.h: Ditto.
        (WebCore::Settings::fontTimeoutIndex const):
        (WebCore::Settings::shouldIgnoreFontLoadCompletions const):
        (WebCore::Settings::webFontsAlwaysFallBack const): Deleted.
        * testing/InternalSettings.cpp: Ditto.
        (WebCore::InternalSettings::Backup::Backup):
        (WebCore::InternalSettings::Backup::restoreTo):
        (WebCore::InternalSettings::setFontTimeoutIndex):
        (WebCore::InternalSettings::setShouldIgnoreFontLoadCompletions):
        (WebCore::InternalSettings::setWebFontsAlwaysFallBack): Deleted.
        * testing/InternalSettings.h: Ditto.
        * testing/InternalSettings.idl: Ditto.

2017-10-05  Zalan Bujtas  <zalan@apple.com>

        RenderMathMLFenced should not hold a raw pointer to RenderMathMLFencedOperator
        https://bugs.webkit.org/show_bug.cgi?id=177950
        <rdar://problem/34837002>

        Reviewed by Antti Koivisto.

        Even though RenderMathMLFencedOperator is a child renderer, it's lifetime is not explicitly managed by
        RenderMathMLFenced.

        Covered by existing test cases.

        * rendering/mathml/RenderMathMLFenced.cpp:
        (WebCore::RenderMathMLFenced::RenderMathMLFenced):
        (WebCore::RenderMathMLFenced::makeFences):
        (WebCore::RenderMathMLFenced::addChild):
        * rendering/mathml/RenderMathMLFenced.h:

2017-10-05  Andy Estes  <aestes@apple.com>

        [Payment Request] Add a payment method that supports Apple Pay
        https://bugs.webkit.org/show_bug.cgi?id=177850

        Reviewed by Youenn Fablet.

        This patch implements a payment method dictionary and a payment handler for Apple Pay.

        It reuses existing Apple Pay code by:
        1. Moving shared properties from ApplePayPaymentRequest to ApplePayRequestBase and having
           ApplePayPaymentRequest inherit from ApplePayRequestBase.
        2. Creating an ApplePayRequest dictionary that inherits from ApplePayRequestBase and adds
           PaymentRequest-specific properties (right now that's just the version property).
        3. Moving validation logic from ApplePaySession into various places that can be reused by
           PaymentRequest and ApplePayPaymentHandler.
        4. Storing currency values for both ApplePaySession and PaymentRequest in Strings rather
           than integers representing whole cents, since PaymentRequest supports high-precision
           currency values.

        This patch does not implement any event handling for merchant validation, payment method
        changes, or shipping address/option changes. That will be handled in a follow-on.

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

        * DerivedSources.make:
        * Modules/applepay/ApplePayContactField.cpp: Added.
        (WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
        * Modules/applepay/ApplePayContactField.h: Added.
        * Modules/applepay/ApplePayContactField.idl: Added.
        * Modules/applepay/ApplePayMerchantCapability.cpp: Added.
        (WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
        * Modules/applepay/ApplePayMerchantCapability.h: Added.
        * Modules/applepay/ApplePayMerchantCapability.idl: Added.
        * Modules/applepay/ApplePayPaymentRequest.h: Moved fields shared with ApplePayRequest into ApplePayRequestBase.
        * Modules/applepay/ApplePayPaymentRequest.idl: Ditto.
        * Modules/applepay/ApplePayRequestBase.cpp: Added.
        (WebCore::convertAndValidate): Moved from ApplePaySession.cpp.
        * Modules/applepay/ApplePayRequestBase.h: Added.
        * Modules/applepay/ApplePayRequestBase.idl: Added.
        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::validateAmount): Renamed from parseAmount.
        (WebCore::convertAndValidateTotal):
        (WebCore::convertAndValidate):
        (WebCore::parseDigit): Deleted.
        (WebCore::parseAmount): Renamed to validateAmount.
        * Modules/applepay/ApplePaySessionPaymentRequest.h: Changed amount from an int64_t to a String.
        * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
        (WebCore::convert):
        * Modules/applepay/PaymentRequestValidator.mm: Renamed from Source/WebCore/Modules/applepay/PaymentRequestValidator.cpp.
        (WebCore::PaymentRequestValidator::validateTotal): Used NSDecimalNumber to validate amounts.
        (WebCore::validateShippingMethod): Ditto.
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: Added.
        (WebCore::ApplePayPaymentHandler::handlesIdentifier): Added. Returns true if identifier is a URL with host "apple.com" and path "/apple-pay".
        (WebCore::ApplePayPaymentHandler::ApplePayPaymentHandler):
        (WebCore::convert): Added. Converts PaymentRequest types to ApplePaySessionPaymentRequest types.
        (WebCore::ApplePayPaymentHandler::convertData): Added. JSON-parses data into an ApplePayRequest,
        then uses that along with the PaymentRequest to construct and validate an ApplePaySessionPaymentRequest.
        (WebCore::ApplePayPaymentHandler::show): Added a FIXME.
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: Added.
        * Modules/applepay/paymentrequest/ApplePayRequest.h: Added.
        * Modules/applepay/paymentrequest/ApplePayRequest.idl: Added. Inherits from ApplePayRequestBase and adds a required version property.
        * Modules/paymentrequest/PaymentHandler.cpp: Added.
        (WebCore::PaymentHandler::create): Returns a PaymentHandler subclass based on the payment method identifier.
        (WebCore::PaymentHandler::~PaymentHandler):
        * Modules/paymentrequest/PaymentHandler.h: Added.
        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::convertAndValidatePaymentMethodIdentifier): Added.
        (WebCore::PaymentRequest::show): Removed an unnecessary call to RunLoop::dispatch().
        Created a PaymentHandler for each payment method and called show() on the first available PaymentHandler.
        (WebCore::PaymentRequest::abort): Removed an unnecessary call to RunLoop::dispatch().
        (WebCore::PaymentRequest::canMakePayment): Ditto.
        (WebCore::PaymentRequest::finishShowing): Deleted.
        * Modules/paymentrequest/PaymentRequest.h:
        * WebCore.xcodeproj/project.pbxproj:

2017-10-05  Antti Koivisto  <antti@apple.com>

        Move more multicolumn render tree mutation code to RenderTreeUpdater::MultiColumn
        https://bugs.webkit.org/show_bug.cgi?id=177942

        Reviewed by Zalan Bujtas.

        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::RenderMultiColumnFlow):

            Use std::unique_ptr for the spanner map for safe owenership transfer.

        (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
        (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
        (WebCore::RenderMultiColumnFlow::fragmentedFlowRelativeWillBeRemoved):
        (WebCore::RenderMultiColumnFlow::populate): Deleted.
        (WebCore::RenderMultiColumnFlow::evacuateAndDestroy): Deleted.

            This code moves to RenderTreeUpdater::MultiColumn.

        * rendering/RenderMultiColumnFlow.h:
        * style/RenderTreeUpdaterMultiColumn.cpp:
        (WebCore::RenderTreeUpdater::MultiColumn::update):
        (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
        (WebCore::RenderTreeUpdater::MultiColumn::destroyFragmentedFlow):

            Use Hyatt's preferred 'fragmented flow' terminology.

        * style/RenderTreeUpdaterMultiColumn.h:

2017-10-05  Darin Adler  <darin@apple.com>

        Remove additional WebKitSystemInterface remnants
        https://bugs.webkit.org/show_bug.cgi?id=177948

        Reviewed by Andy Estes.

        * PlatformMac.cmake: Remove logic to select and link an appropriate
        WebKitSystemInterface library.

        * html/shadow/MediaControlElementTypes.h: Remove comment about matching
        WebKitSystemInterface.h, now obsolete.

        * rendering/RenderMediaControls.cpp: Wrap whole file in a single conditional
        to make it clear that it's only used at all in this one particular case.
        (wkHitTestMediaUIPart): Deleted.
        (wkMeasureMediaUIPart): Deleted.
        (wkDrawMediaUIPart): Deleted.
        (wkDrawMediaSliderTrack): Deleted.
        (WebCore::determineState): Deleted.
        (WebCore::getUnzoomedRectAndAdjustCurrentContext): Deleted.
        (WebCore::RenderMediaControls::adjustMediaSliderThumbSize): Call the
        WKMeasureMediaUIPart instead of through an inline function to rename it.
        (WebCore::RenderMediaControls::paintMediaControlsPart): Deleted.

        * rendering/RenderMediaControls.h: Wrap whole file in a single conditional
        to make it clear that it's only used at all in this one particular case.
        Removed unneeded includes, forward declarations, and function declaration.

        * rendering/RenderThemeMac.mm: Removed include of RenderMediaControls.h.

2017-10-05  Zalan Bujtas  <zalan@apple.com>

        Remove redundant LayoutStateDisabler from RenderTreeUpdaterFirstLetter
        https://bugs.webkit.org/show_bug.cgi?id=177946

        Reviewed by Simon Fraser.

        First letter is updated prior to layout.

        Covered by existing tests.

        * style/RenderTreeUpdaterFirstLetter.cpp:
        (WebCore::updateFirstLetterStyle):

2017-10-05  Andy Estes  <aestes@apple.com>

        [Payment Request] Factor out ApplePaySession's interface to PaymentCoordinator into a base class
        https://bugs.webkit.org/show_bug.cgi?id=177904

        Reviewed by Daniel Bates.

        In a follow-on patch, something other than ApplePaySession will need to be the
        PaymentCoordinator's active session during PaymentRequest sessions.

        To support this, this patch factors out the ApplePaySession functions called by
        PaymentCoordinator into a new base class called PaymentSession.

        * Modules/applepay/ApplePaySession.h:
        * Modules/applepay/PaymentCoordinator.cpp:
        (WebCore::PaymentCoordinator::beginPaymentSession):
        * Modules/applepay/PaymentCoordinator.h:
        * Modules/applepay/PaymentSession.h: Added.
        (WebCore::PaymentSession::~PaymentSession):
        * WebCore.xcodeproj/project.pbxproj:

2017-10-05  Zalan Bujtas  <zalan@apple.com>

        Move multicolumn flow clear to RenderTreeUpdater
        https://bugs.webkit.org/show_bug.cgi?id=177898
        <rdar://problem/34820157>

        Reviewed by Antti Koivisto.

        There are 2 cases when we need to clear the the multicolumn flow from its container.

        1. When the column renderer is not need anymore due to style change (evacuateAndDestroy).
        During the subtree reparenting (moving back the descendants to the original position),
        if we still had the multicolumn set on the RenderBlockFlow, RenderBlockFlow::addChild() would
        put the children back under the column. -> Move the clear call to the RenderTreeUpdater.
         
        2. When the column is detached from the tree/destroyed (willBeRemoveFromTree).
        Since it does not trigger reparenting, we don't need to clear the column immediately. 
        We call clear to avoid accessing state column renderer. -> Use WeakPtr to
        manage lifetime instead.

        Covered by existing tests.

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::setMultiColumnFlow):
        (WebCore::RenderBlockFlow::clearMultiColumnFlow):
        * rendering/RenderBlockFlow.h:
        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
        (WebCore::RenderMultiColumnFlow::willBeRemovedFromTree):
        * style/RenderTreeUpdaterMultiColumn.cpp:
        (WebCore::RenderTreeUpdater::MultiColumn::update):
        (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):

2017-10-05  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE] GIFImageDecoder never clears decoded frames even when told to do so
        https://bugs.webkit.org/show_bug.cgi?id=177864

        Reviewed by Carlos Garcia Campos.

        Fix GIFImageDecoder::clearFrameBufferCache() so it really deletes decoded buffers, and modify
        GIFImageDecoder to be able to decode frames that are not requested in the expected order.

        Covered by existent tests.

        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::findFirstRequiredFrameToDecode):
        (WebCore::GIFImageDecoder::frameBufferAtIndex):
        (WebCore::GIFImageDecoder::clearFrameBufferCache):
        * platform/image-decoders/gif/GIFImageDecoder.h:
        * platform/image-decoders/gif/GIFImageReader.cpp:
        (GIFImageReader::decode):
        * platform/image-decoders/gif/GIFImageReader.h:
        (GIFImageReader::frameContext const):

2017-10-05  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] Fix build after Bug 167956
        https://bugs.webkit.org/show_bug.cgi?id=177921

        Reviewed by Carlos Garcia Campos.

        FontCascade::fontForCombiningCharacterSequence wasn't defined for
        WinCairo port. It should be defined if !USE(HARFBUZZ).

        No new tests because there is no behavior change.

        * platform/graphics/FontCascade.cpp: Use !USE(HARFBUZZ) instead of !USE(CAIRO).

2017-10-05  Zan Dobersek  <zdobersek@igalia.com>

        Align BitmapImage::LargeAnimationCutoff to a megabyte value
        https://bugs.webkit.org/show_bug.cgi?id=177924

        Reviewed by Carlos Garcia Campos.

        * platform/graphics/BitmapImage.h: Fix the 1014 multiplier used to calculate
        the LargeAnimationCutoff value. It was most likely a typo.

2017-10-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        Address post-review feedback following r222885
        https://bugs.webkit.org/show_bug.cgi?id=177853
        <rdar://problem/34807346>

        Reviewed by Ryosuke Niwa and Dan Bates.

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::updateFileList):
        (WebCore::DataTransfer::types const):
        (WebCore::DataTransfer::filesFromPasteboardAndItemList const):
        * dom/DataTransferItem.h:
        (WebCore::DataTransferItem::file):
        (WebCore::DataTransferItem::file const): Deleted.
        * dom/DataTransferItemList.cpp:
        (WebCore::DataTransferItemList::add):
        (WebCore::DataTransferItemList::remove):

        When removing a data transfer item, capture it in a Ref for the scope of remove(), so that it won't be destroyed
        immediately after removing from the item list.

2017-10-05  Youenn Fablet  <youenn@apple.com>

        Make LibWebRTCProvider port agnostic
        https://bugs.webkit.org/show_bug.cgi?id=177747

        Reviewed by Alex Christensen & Alex Garcia.

        No change of behavior.

        LibWebRTCProvider had some Mac/iOS specific members that are now
        moved to LibWebRTCProviderCocoa.
        This consists in the codec factories that are VideoToolBox specific.
        Introducing LibWebRTCProvider::create to allow different port implementations of LibWebRTCProvider.

        * WebCore.xcodeproj/project.pbxproj:
        * inspector/InspectorOverlay.cpp:
        (WebCore::InspectorOverlay::overlayPage):
        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::LibWebRTCProvider::create):
        (WebCore::LibWebRTCProvider::factory):
        (WebCore::LibWebRTCProvider::createPeerConnectionFactory):
        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
        * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
        (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
        (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
        (WebCore::LibWebRTCProviderCocoa::setActive):
        * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::dataChanged):

2017-10-04  Alex Christensen  <achristensen@webkit.org>

        Remove WebCoreSystemInterface
        https://bugs.webkit.org/show_bug.cgi?id=177916

        Reviewed by Antti Koivisto.

        * Configurations/WebCore.xcconfig:
        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * accessibility/mac/AXObjectCacheMac.mm:
        * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        * dom/Document.cpp:
        * editing/mac/DictionaryLookup.mm:
        * page/ios/FrameIOS.mm:
        * page/ios/UserAgentIOS.mm:
        * page/mac/EventHandlerMac.mm:
        * platform/cocoa/LocalizedStringsCocoa.mm:
        * platform/cocoa/ScrollController.mm:
        * platform/graphics/Font.h:
        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        * platform/graphics/cg/GraphicsContextCG.cpp:
        * platform/graphics/cg/ImageBufferCG.cpp:
        * platform/graphics/cg/PathCG.cpp:
        * platform/graphics/cg/PatternCG.cpp:
        * platform/graphics/cocoa/FontCascadeCocoa.mm:
        * platform/graphics/cocoa/FontCocoa.mm:
        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
        * platform/graphics/mac/FontCacheMac.mm:
        * platform/graphics/mac/GlyphPageMac.cpp:
        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        * platform/ios/LegacyTileCache.mm:
        * platform/ios/PlatformScreenIOS.mm:
        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
        * platform/ios/WebCoreSystemInterfaceIOS.mm: Removed.
        * platform/ios/wak/WAKWindow.mm:
        * platform/mac/CursorMac.mm:
        * platform/mac/FileSystemMac.mm:
        * platform/mac/PlatformEventFactoryMac.mm:
        * platform/mac/PlatformSpeechSynthesizerMac.mm:
        * platform/mac/ScrollAnimatorMac.mm:
        * platform/mac/ScrollbarThemeMac.mm:
        * platform/mac/ThemeMac.mm:
        * platform/mac/WebCoreNSURLExtras.mm:
        * platform/mac/WebCoreSystemInterface.h: Removed.
        * platform/mac/WebCoreSystemInterface.mm: Removed.
        * platform/mac/WebVideoFullscreenHUDWindowController.mm:
        * platform/mac/WebWindowAnimation.mm:
        * platform/network/cf/CookieStorageCFNet.cpp:
        * platform/network/cf/CredentialStorageCFNet.cpp:
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        * platform/network/cf/ResourceHandleCFNet.cpp:
        * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
        * platform/network/cf/ResourceRequestCFNet.cpp:
        * platform/network/cf/ResourceResponseCFNet.cpp:
        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
        * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
        * platform/network/cocoa/ResourceRequestCocoa.mm:
        * platform/network/ios/WebCoreURLResponseIOS.mm:
        * platform/network/mac/CookieJarMac.mm:
        * platform/network/mac/ResourceHandleMac.mm:
        * platform/network/mac/WebCoreURLResponse.mm:
        * platform/text/TextEncodingRegistry.cpp:
        * rendering/RenderThemeMac.mm:

2017-10-04  Alex Christensen  <achristensen@webkit.org>

        Remove unnecessary includes of WebKitSystemInterface on Cocoa platforms
        https://bugs.webkit.org/show_bug.cgi?id=177912

        Reviewed by Saam Barati.

        * WebCore.xcodeproj/project.pbxproj:
        Also stop compiling RenderMediaControls.cpp on Cocoa platforms.  It's not used.

2017-09-30  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Introduce import.meta
        https://bugs.webkit.org/show_bug.cgi?id=177703

        Reviewed by Filip Pizlo.

        * bindings/js/JSDOMWindowBase.cpp:
        * bindings/js/JSWorkerGlobalScopeBase.cpp:

2017-10-04  Tim Horton  <timothy_horton@apple.com>

        Link WebCore against CFNetwork in the CMake build
        https://bugs.webkit.org/show_bug.cgi?id=177910

        Reviewed by Ryosuke Niwa.

        * PlatformMac.cmake:
        This is enough to get WebKit1 MiniBrowser running; otherwise, we
        crash trying to access the public suffix list.

2017-10-04  Daniel Bates  <dabates@apple.com>

        Have TextDecorationPainter hold an OptionSet of decorations
        https://bugs.webkit.org/show_bug.cgi?id=177889

        Reviewed by Simon Fraser.

        Currently TextDecorationPainter implicitly maintains the set of one or more TextDecoration
        flags in a instance variable bitmask of type TextDecoration. Instead we should represent
        this set explicitly as an OptionSet to improve readability of the code.

        For now we have the TextDecorationPainter constructor and TextDecorationPainter::stylesForRenderer()
        to take the set of decorations as an unsigned value to avoid the need to update callers.
        We will look to apply a similar change throughout the code in <https://bugs.webkit.org/show_bug.cgi?id=176844>.

        No functionality changed. So, no new tests.

        * rendering/TextDecorationPainter.cpp:
        (WebCore::TextDecorationPainter::TextDecorationPainter): For now, changed data type for passed
        decorations from TextDecoration to unsigned to convey that it is a bitmask.
        (WebCore::TextDecorationPainter::paintTextDecoration): Renamed linesAreOpaque to areLinesOpaque
        while I am here. Fixed some minor style issues.
        (WebCore::collectStylesForRenderer): Modified to take the remaining decorations as an OptionSet,
        and removed an unnecessary copy of these decorations by taking advantage of the fact that they
        are passed by value.
        (WebCore::TextDecorationPainter::stylesForRenderer): Convert the passed decorations to an OptionSet as needed to
        pass to collectStylesForRenderer().
        * rendering/TextDecorationPainter.h: Change m_decoration from TextDecoration to OptionSet<TextDecoration>
        and rename it to m_decorations to reflect that it is used as a set of one or more TextDecoration flags.
        Also remove unnecessary initializer for m_isPrinting while I am here and group it with the other boolean,
        m_isHorizontal. There is exactly one constructor for this class and it initializes m_isPrinting.

2017-10-04  Matt Baker  <mattbaker@apple.com>

        Web Inspector: Improve CanvasManager recording events
        https://bugs.webkit.org/show_bug.cgi?id=177762

        Reviewed by Devin Rousso.

        Dispatch Canvas.recordingFinished regardless of whether any actions were
        recorded. Without this extra guarantee, the frontend has to keep track
        of additional state to determine whether a recording is in progress.

        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::startRecording):
        (WebCore::InspectorCanvasAgent::stopRecording):
        (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
        (WebCore::InspectorCanvasAgent::requestRecording): Deleted.
        (WebCore::InspectorCanvasAgent::cancelRecording): Deleted.
        * inspector/InspectorCanvasAgent.h:

2017-10-04  Nan Wang  <n_wang@apple.com>

        AX: Make video objects accessible on iOS
        https://bugs.webkit.org/show_bug.cgi?id=177788
        <rdar://problem/34778028>

        Reviewed by Chris Fleizach.

        Exposed certain <video> elements on iOS:
        1. If they have no controls attribute set and have playsinline attribute set, that means
           normally there are custom controls provided. 
        2. Without autoplay attribute set. From iOS 10, with the motivation to improve performace by 
           replacing GIF with <video>, elements will now honor the autoplay attribute if they
           have no audio. So normally those <video> elements are not interactive.

        Also provided functions to let iOS users interact with the video elements:
        - Play/Pause: accessibilityActivate
        - Fast forward: accessibilityIncrement
        - Rewind: accessibilityDecrement

        Test: accessibility/ios-simulator/video-elements-ios.html

        * WebCore.xcodeproj/project.pbxproj:
        * accessibility/AXObjectCache.cpp:
        (WebCore::createFromRenderer):
        * accessibility/AccessibilityMediaObject.cpp: Added.
        (WebCore::AccessibilityMediaObject::AccessibilityMediaObject):
        (WebCore::AccessibilityMediaObject::~AccessibilityMediaObject):
        (WebCore::AccessibilityMediaObject::create):
        (WebCore::AccessibilityMediaObject::computeAccessibilityIsIgnored const):
        (WebCore::AccessibilityMediaObject::mediaElement const):
        (WebCore::AccessibilityMediaObject::stringValue const):
        (WebCore::AccessibilityMediaObject::interactiveVideoDuration const):
        (WebCore::AccessibilityMediaObject::mediaSeek):
        (WebCore::AccessibilityMediaObject::toggleMute):
        (WebCore::AccessibilityMediaObject::increment):
        (WebCore::AccessibilityMediaObject::decrement):
        (WebCore::AccessibilityMediaObject::press):
        (WebCore::AccessibilityMediaObject::hasControlsAttributeSet const):
        (WebCore::AccessibilityMediaObject::isPlaying const):
        (WebCore::AccessibilityMediaObject::isMuted const):
        (WebCore::AccessibilityMediaObject::isAutoplayEnabled const):
        (WebCore::AccessibilityMediaObject::isPlayingInline const):
        (WebCore::AccessibilityMediaObject::enterFullscreen const):
        * accessibility/AccessibilityMediaObject.h: Added.
        * accessibility/AccessibilityObject.cpp:
        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityObject::isMediaObject const):
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper accessibilityIsWebInteractiveVideo]):
        (-[WebAccessibilityObjectWrapper interactiveVideoDescription]):
        (-[WebAccessibilityObjectWrapper accessibilityIsMediaPlaying]):
        (-[WebAccessibilityObjectWrapper accessibilityIsMediaMuted]):
        (-[WebAccessibilityObjectWrapper accessibilityToggleMuteForMedia]):
        (-[WebAccessibilityObjectWrapper accessibilityVideoEnterFullscreen]):
        (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
        (-[WebAccessibilityObjectWrapper stringValueShouldBeUsedInLabel]):
        (-[WebAccessibilityObjectWrapper accessibilityLabel]):

2017-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add basic support for the version of DataTransferItemList.add that takes a File
        https://bugs.webkit.org/show_bug.cgi?id=177853
        <rdar://problem/34807346>

        Reviewed by Ryosuke Niwa.

        Adds very basic support for DataTransferItemList.add(File). So far, a File added in this way can only be read
        back from the same DataTransfer, during dragstart or copy. This File isn't written to the platform pasteboard
        yet, so even dropping or pasting in the same page will not transfer the File, but this brings us closer to
        parity with other browsers. See per-method comments for details.

        Tests: editing/pasteboard/data-transfer-item-list-add-file-multiple-times.html
               editing/pasteboard/data-transfer-item-list-add-file-on-copy.html
               editing/pasteboard/data-transfer-item-list-add-file-on-drag.html

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

        Recompute the DataTransfer's FileList. This behaves the same way as destroying the FileList altogether and
        building it from scratch, but we avoid that approach because the FileList object needs to maintain the same DOM
        wrapper after a File-backed item is removed.

        (WebCore::DataTransfer::itemListDidAddFile):

        Add the newly appended DataTransferItem's File to the DataTransfer's FileList.

        (WebCore::DataTransfer::types const):

        Return only the "Files" type if there are file-backed items in the DataTransfer's item list.

        (WebCore::DataTransfer::updatedFilesForFileList const):
        (WebCore::DataTransfer::files const):
        * dom/DataTransfer.h:
        * dom/DataTransferItem.h:
        (WebCore::DataTransferItem::file const):
        * dom/DataTransferItemList.cpp:
        (WebCore::DataTransferItemList::add):
        (WebCore::DataTransferItemList::remove):
        (WebCore::DataTransferItemList::clear):

        When removing a File, only clear from the DataTransfer's pasteboard if the removed item is not a File (otherwise,
        clearing a File that shares the same type as some other item in the pasteboard will erroneously clear that other
        item as well). Additionally, call out to the DataTransfer to update the FileList.

        * dom/DataTransferItemList.h:
        (WebCore::DataTransferItemList::hasItems const):
        (WebCore::DataTransferItemList::items const):

        Add helpers for directly accessing an item list's items. items() should be used in conjunction with hasItems().
        This route is taken to (1) avoid having to copy the vector of Files, and (2) to avoid generating m_items if it
        doesn't already exist.

2017-10-04  Zalan Bujtas  <zalan@apple.com>

        RenderMultiColumnFlow populate/evacuate should not disable layout state.
        https://bugs.webkit.org/show_bug.cgi?id=177894
        <rdar://problem/34818696>

        Reviewed by Antti Koivisto.

        Populate/evacuate methods are not called at layout time.

        Covered by existing tests.

        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::populate):
        (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):

2017-10-04  Zalan Bujtas  <zalan@apple.com>

        RenderMultiColumnFlow::m_beingEvacuated is redundant.
        https://bugs.webkit.org/show_bug.cgi?id=177886
        <rdar://problem/34815997>

        Reviewed by Simon Fraser.

        m_beingEvacuated was introduced to protect RenderMultiColumnFlow from triggering
        remove/insert code while the column is being destroyed and the descendants are getting reparented.
        However, 
        1. the setMultiColumnFlow(nullptr) call already protects from triggering the remove callback
        2. When adding the children back to their original position, we should not be able to find
        this column as the enclosing block anymore (simply because we are moving the children as siblings
        to the multicol renderer) 

        Covered by existing tests.

        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::RenderMultiColumnFlow):
        (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
        (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
        (WebCore::RenderMultiColumnFlow::fragmentedFlowRelativeWillBeRemoved):
        * rendering/RenderMultiColumnFlow.h:

2017-10-04  Antti Koivisto  <antti@apple.com>

        Fix typo.

        Unreviewed.

        * rendering/RenderView.cpp:
        (WebCore::RenderView::willBeDestroyed):

2017-10-04  Daniel Bates  <dabates@apple.com>

        Teach TextDecorationPainter about pseudo styles
        https://bugs.webkit.org/show_bug.cgi?id=177882

        Reviewed by Simon Fraser.

        As a step towards implementing support for CSS pseudo elements ::spelling-error and ::grammar-error
        (https://bugs.webkit.org/show_bug.cgi?id=175784) teach TextDecorationPainter about pseudo styles.

        * rendering/TextDecorationPainter.cpp:
        (WebCore::TextDecorationPainter::TextDecorationPainter): Modified to take an optional
        pseudo style (defaults to NOPSEUDO - no pseudo style).
        (WebCore::collectStylesForRenderer): Modified to take a pseudo style. Note that getCachedPseudoStyle()
        is only defined on RenderText and RenderElement objects (i.e. it is not a virtual function on RenderObject).
        So, we must explicitly type check the renderer and cast appropriately before calling it. We may want
        to consider making it virtual in the future if we find there are more call sites that would benefit
        from polymorphism.
        (WebCore::TextDecorationPainter::stylesForRenderer): Modified to take an optional
        pseudo style (defaults to NOPSEUDO - no pseudo style).
        * rendering/TextDecorationPainter.h:

2017-10-04  Antti Koivisto  <antti@apple.com>

        Add assert verifying all renderers get destroyed
        https://bugs.webkit.org/show_bug.cgi?id=177870

        Reviewed by Zalan Bujtas.

        * rendering/RenderView.cpp:
        (WebCore::RenderView::willBeDestroyed):

            Add assert to verify all renderers for this tree have been destroyed before the RenderView is.

        * rendering/RenderView.h:

2017-10-04  Daniel Bates  <dabates@apple.com>

        TextDecorationPainter::m_wavyOffset should be a float
        https://bugs.webkit.org/show_bug.cgi?id=177883

        Reviewed by Simon Fraser.

        In r194447 we extracted the text decoration painting code from InlineTextBox into
        TextDecorationPainter and changed the data type of the wavy offset from float to int.
        We use floating point numbers throughout the painting code and should store the wavy
        offset as a float.

        * rendering/TextDecorationPainter.cpp:
        (WebCore::TextDecorationPainter::TextDecorationPainter): Use C++ uniform initializer
        syntax to initialize member fields.
        (WebCore::TextDecorationPainter::paintTextDecoration): Change int to float.
        * rendering/TextDecorationPainter.h: Remove unnecessary equal initializer for m_wavyOffset
        as this class has exactly one constructor and it always initializes it.

2017-10-04  Youenn Fablet  <youenn@apple.com>

        Remove OpenWebRTC backend
        https://bugs.webkit.org/show_bug.cgi?id=177868

        Reviewed by Alejandro G. Castro.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/mediastream/MediaEndpointPeerConnection.cpp: Removed.
        * Modules/mediastream/MediaEndpointPeerConnection.h: Removed.
        * Modules/mediastream/MediaEndpointSessionDescription.cpp: Removed.
        * Modules/mediastream/MediaEndpointSessionDescription.h: Removed.
        * Modules/mediastream/SDPProcessor.cpp: Removed.
        * Modules/mediastream/SDPProcessor.h: Removed.
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/GStreamer.cmake:
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::buildMediaEnginesVector):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::supportsType):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp: Removed.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h: Removed.
        * platform/mediastream/MediaEndpoint.cpp: Removed.
        * platform/mediastream/MediaEndpoint.h: Removed.
        * platform/mediastream/MediaEndpointSessionConfiguration.h: Removed.
        * platform/mediastream/SDPProcessorScriptResource.cpp: Removed.
        * platform/mediastream/SDPProcessorScriptResource.h: Removed.
        * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Removed.
        * platform/mediastream/openwebrtc/MediaEndpointOwr.h: Removed.
        * platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Removed.
        * platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Removed.
        * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Removed.
        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Removed.
        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Removed.
        * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Removed.
        * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Removed.
        * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Removed.
        * platform/mock/MockMediaEndpoint.cpp: Removed.
        * platform/mock/MockMediaEndpoint.h: Removed.
        * platform/mock/MockRealtimeMediaSource.cpp:
        (WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
        * platform/mock/MockRealtimeMediaSource.h:
        * testing/Internals.cpp:
        (WebCore::Internals::Internals):
        (WebCore::Internals::enableMockMediaEndpoint): Deleted.
        * testing/Internals.h:

2017-10-04  Zalan Bujtas  <zalan@apple.com>

        Remove RenderTreeInternalMutationScope
        https://bugs.webkit.org/show_bug.cgi?id=177875
        <rdar://problem/34813088>

        Reviewed by Antti Koivisto.

        RenderTree mutation is in the past now. -and we've got assertions in place.

        Not testable.

        * page/FrameView.cpp:
        (WebCore::FrameView::layout):
        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::populate):
        (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
        * rendering/RenderQuote.cpp:
        (WebCore::RenderQuote::updateTextRenderer):
        (WebCore::RenderQuote::updateRenderer):
        * rendering/RenderView.h:
        (WebCore::RenderTreeInternalMutationScope::RenderTreeInternalMutationScope): Deleted.
        (WebCore::RenderTreeInternalMutationScope::~RenderTreeInternalMutationScope): Deleted.

2017-10-04  Miguel Gomez  <magomez@igalia.com>

        Unreviewed: fix GTK debug build after r222841.

        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::initFrameBuffer):

2017-10-04  Zalan Bujtas  <zalan@apple.com>

        RenderFragmentContainerRange should not hold raw pointers.
        https://bugs.webkit.org/show_bug.cgi?id=177854
        <rdar://problem/34805954>

        Reviewed by Antti Koivisto.

        m_startFragment and m_endFragment object's lifetimes are not tied to the lifetime of
        RenderFragmentContainerRange.

        Covered by existing tests.

        * rendering/RenderFragmentedFlow.cpp:
        (WebCore::RenderFragmentedFlow::setFragmentRangeForBox):
        * rendering/RenderFragmentedFlow.h:

2017-10-04  Zalan Bujtas  <zalan@apple.com>

        RenderMultiColumnSpannerPlaceholder should not hold raw pointers.
        https://bugs.webkit.org/show_bug.cgi?id=177840
        <rdar://problem/34800109>

        Reviewed by Sam Weinig.

        Though we should always have a spanner as long as there's a RenderMultiColumnSpannerPlaceholder,
        the spanner inject/removal logic is complicated enough to protect them with WeakPtr.  

        Covered by existing tests.

        * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
        (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
        * rendering/RenderMultiColumnSpannerPlaceholder.h:

2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] GtkUtilities.h should not be included in libs not linked to GTK
        https://bugs.webkit.org/show_bug.cgi?id=177860

        Reviewed by Carlos Garcia Campos.

        * platform/FreeType.cmake:
        * platform/gtk/GtkUtilities.cpp:
        (WebCore::topLevelPath): Deleted.
        (WebCore::webkitBuildDirectory): Deleted.
        * platform/gtk/GtkUtilities.h:
        (WebCore::wallTimeForEvent):
        * platform/text/hyphen/HyphenationLibHyphen.cpp:
        (WebCore::topLevelPath):
        (WebCore::webkitBuildDirectory):

2017-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        [Harfbuzz] Implement ComplexTextController on top of HarfBuzz
        https://bugs.webkit.org/show_bug.cgi?id=167956

        Reviewed by Myles C. Maxfield.

        Implement ComplexTextController using HarfBuzz and remove HarfBuzzShaper.

        Covered by existing tests, a rebaseline will be neeed.

        * platform/FreeType.cmake:
        * platform/graphics/ComplexTextController.cpp:
        (WebCore::TextLayoutDeleter::operator() const): Enable TextLayout when using HarfBuzz.
        (WebCore::FontCascade::createLayout const): Ditto.
        (WebCore::FontCascade::width): Ditto.
        * platform/graphics/ComplexTextController.h:
        (WebCore::ComplexTextController::ComplexTextRun::create): Add constructor that receives an hb_buffer_t.
        * platform/graphics/Font.cpp:
        (WebCore::Font::variantCapsSupportsCharacterForSynthesis const): Simple implementation for non-cocoa ports.
        * platform/graphics/FontCascade.cpp:
        (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Moved from FontCascadeCocoa.mm.
        (WebCore::FontCascade::floatWidthForComplexText const): Ditto.
        (WebCore::FontCascade::adjustSelectionRectForComplexText const): Ditto.
        (WebCore::FontCascade::offsetForPositionForComplexText const): Ditto.
        * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
        (WebCore::FontCascade::fontForCombiningCharacterSequence const): Normalize the sequence and get the font of the
        base character.
        * platform/graphics/cocoa/FontCascadeCocoa.mm:
        * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
        (WebCore::harfBuzzPositionToFloat):
        (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
        (WebCore::fontFeatures):
        (WebCore::characterScript):
        (WebCore::scriptsAreCompatibleForCharacters):
        (WebCore::findNextRun):
        (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
        * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
        (WebCore::harfBuzzGetGlyph): Check here if the character is a white space and use the space or zeroWidthSpace
        to ensure we get a glyph.
        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp: Removed.
        * platform/graphics/harfbuzz/HarfBuzzShaper.h: Removed.
        * platform/graphics/harfbuzz/HbUniquePtr.h: Added.
        (WebCore::HbPtrDeleter::operator() const):
        (WebCore::HbPtrDeleter<hb_font_t>::operator() const):
        (WebCore::HbPtrDeleter<hb_buffer_t>::operator() const):
        * platform/graphics/opentype/OpenTypeMathData.h: Use HbUniquePtr.

2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, fix typo in function name scanDirectoryForDicionaries
        https://bugs.webkit.org/show_bug.cgi?id=177866

        * platform/text/hyphen/HyphenationLibHyphen.cpp:
        (WebCore::scanDirectoryForDictionaries):
        (WebCore::scanTestDictionariesDirectoryIfNecessary):
        (WebCore::availableLocales):
        (WebCore::scanDirectoryForDicionaries): Deleted.

2017-10-04  Miguel Gomez  <magomez@igalia.com>

        Add animation support for WebP images
        https://bugs.webkit.org/show_bug.cgi?id=113124

        Reviewed by Žan Doberšek.

        Implement decoding of WebP animations.

        Test: fast/images/animated-webp.html

        * platform/graphics/ImageBackingStore.h:
        (WebCore::ImageBackingStore::blendPixel):
        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::WEBPImageDecoder):
        (WebCore::WEBPImageDecoder::~WEBPImageDecoder):
        (WebCore::WEBPImageDecoder::setData):
        (WebCore::WEBPImageDecoder::repetitionCount const):
        (WebCore::WEBPImageDecoder::frameBufferAtIndex):
        (WebCore::WEBPImageDecoder::findFirstRequiredFrameToDecode):
        (WebCore::WEBPImageDecoder::decode):
        (WebCore::WEBPImageDecoder::decodeFrame):
        (WebCore::WEBPImageDecoder::initFrameBuffer):
        (WebCore::WEBPImageDecoder::applyPostProcessing):
        (WebCore::WEBPImageDecoder::parseHeader):
        (WebCore::WEBPImageDecoder::clearFrameBufferCache):
        * platform/image-decoders/webp/WEBPImageDecoder.h:

2017-10-04  Ryosuke Niwa  <rniwa@webkit.org>

        Use blob URL when pasting RTFD instead of overriding DocumentLoader
        https://bugs.webkit.org/show_bug.cgi?id=177801
        <rdar://problem/34542270>

        Reviewed by Wenson Hsieh.

        Before this patch, pasting RTFD resulted in images and other subresources in RTFD are being placed
        into the document using WebKit fake URL, and DocumentLoader was overridden to return the appropriate
        data upon resource requests. This is bad because there is no mechanism for websites to access its content.

        Like r222119 and r208451, this patch fixes thie problem by using a blob URL instead of a WebKit fake URL.
        This patch also adds a Blob::create variant which takes a SharedBuffer.

        API Tests: PasteRTFD

        * editing/WebCorePasteboardFileReader.cpp:
        (WebCore::WebCorePasteboardFileReader::readBuffer):
        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::DeferredLoadingScope): Extracted out of createFragmentAndAddResources for clarity.
        (WebCore::DeferredLoadingScope::DeferredLoadingScope):
        (WebCore::DeferredLoadingScope::~DeferredLoadingScope):
        (WebCore::createFragmentAndAddResources): Instead of adding resources to document loader, replace each
        URL in the document by a blob URL.
        (WebCore::WebContentReader::readImage):
        * editing/markup.cpp:
        (WebCore::replaceSubresourceURLs): Added. A helper to replace each URL in the document fragment by a blob
        URL created for each subresource. This won't work for iframes or srcset but that's okay for now since DOM
        constructed from RTFD doesn't use either.
        * editing/markup.h:
        * fileapi/Blob.cpp:
        (WebCore::Blob::Blob): Added a variant which takes a SharedBuffer.
        * fileapi/Blob.h:
        (WebCore::Blob::create): Ditto.

2017-10-04  Michael Catanzaro  <mcatanzaro@igalia.com>

        REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
        https://bugs.webkit.org/show_bug.cgi?id=177449

        Reviewed by Chris Dumez.

        * platform/gtk/GtkUtilities.cpp:
        (WebCore::wallTimeForEvent):
        * platform/gtk/GtkUtilities.h:
        (WebCore::wallTimeForEvent):

2017-10-04  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE] Fix playback of GIFs
        https://bugs.webkit.org/show_bug.cgi?id=176089

        Reviewed by Carlos Garcia Campos.

        Allow GIFImageReader to decode again already decoded frames. Thanks to this, we don't
        need to delete the GIFImageReader when GIFImageDecoder::clearFrameBufferCache() is
        called, and the we don't need the lock to avoid crashes in that situation.

        Covered by existent tests.

        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::clearFrameBufferCache):
        (WebCore::GIFImageDecoder::decode):
        * platform/image-decoders/gif/GIFImageDecoder.h:
        * platform/image-decoders/gif/GIFImageReader.cpp:
        (GIFImageReader::decode):

2017-10-04  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>

        Unreviewed build fix.

        Use different enum value for the check. UP_DEVICE_LEVEL_NORMAL is only available on newer
        upower.

        * platform/glib/LowPowerModeNotifierGLib.cpp:
        (WebCore::LowPowerModeNotifier::updateState):

2017-10-03  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>

        [GLib] Let WebCore know of low power situations
        https://bugs.webkit.org/show_bug.cgi?id=177810

        Reviewed by Carlos Garcia Campos.

        WebCore can use knowledge of low power situations to throttle timers and avoid expensive
        checks, lowering power usage. We can use upower's warning level to let WebCore know we are
        in such a situation.

        No tests as there is no way to mock upower.

        * PlatformGTK.cmake: add new file.
        * PlatformWPE.cmake: add new file.
        * platform/LowPowerModeNotifier.cpp: use upower-glib to know about low power situations.
        * platform/LowPowerModeNotifier.h: includes upower header as UpClient and UpDevice are not forward
        declaration-friendly.
        * platform/glib/LowPowerModeNotifierGLib.cpp: Added.
        (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
        (WebCore::LowPowerModeNotifier::updateState): update low power mode from warning-level.
        (WebCore::LowPowerModeNotifier::warningLevelCallback): track upower's warning-level to know when
        a low power situation occurs.
        (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier): stop tracking the warning-level signal.
        (WebCore::LowPowerModeNotifier::isLowPowerModeEnabled const):

2017-10-04  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [ATK] aria-pressed="mixed" should be exposed via ATK_STATE_INDETERMINATE
        https://bugs.webkit.org/show_bug.cgi?id=177807

        Reviewed by Chris Fleizach.

        Include toggle buttons in the element types for which the mixed state is checked
        and exposed via ATK_STATE_INDETERMINATE if found. Also only do the role checks when
        AccessibilityObject::isIndeterminate() has returned false.

        Test: accessibility/gtk/aria-pressed-mixed-value.html

        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (setAtkStateSetFromCoreObject):

2017-10-04  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [ATK] ARIA tabpanel role should be exposed as ATK_ROLE_SCROLL_PANE
        https://bugs.webkit.org/show_bug.cgi?id=177815

        Reviewed by Chris Fleizach.

        Change the mapping of TabPanelRole from ATK_ROLE_PANEL to ATK_ROLE_SCROLL_PANE.

        No new tests because this mapping is already covered by aria-tab-roles.html and
        roles-exposed.html. The platform expectations for each test have been updated.

        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (atkRole):

2017-10-03  Antti Koivisto  <antti@apple.com>

        Use WeakPtr in RenderFullScreen
        https://bugs.webkit.org/show_bug.cgi?id=177827

        Reviewed by Zalan Bujtas.

        Make Document::m_fullScreenRenderer RenderFullScreen::m_placeholder WeakPtrs
        and get rid of the custom nulling code.

        * dom/Document.cpp:
        (WebCore::Document::destroyRenderTree):
        (WebCore::Document::webkitWillEnterFullScreenForElement):
        (WebCore::Document::webkitDidExitFullScreenForElement):
        (WebCore::Document::setFullScreenRenderer):
        (WebCore::Document::fullScreenRendererDestroyed): Deleted.
        * dom/Document.h:
        (WebCore::Document::fullScreenRenderer const):
        * rendering/RenderFullScreen.cpp:
        (WebCore::RenderFullScreen::RenderFullScreen):
        (WebCore::RenderFullScreen::willBeDestroyed):
        (WebCore::RenderFullScreen::createPlaceholder):
        (WebCore::RenderFullScreenPlaceholder::willBeDestroyed): Deleted.
        (WebCore::RenderFullScreen::setPlaceholder): Deleted.
        * rendering/RenderFullScreen.h:

2017-10-03  Ryosuke Niwa  <rniwa@webkit.org>

        Enable pasteboard custom data in macOS 10.12 and earlier
        https://bugs.webkit.org/show_bug.cgi?id=177855

        Reviewed by Wenson Hsieh.

        Make customPasteboardDataEnabled return true on macOS 10.12 and earlier as long as the app is Safari.

        * page/Settings.cpp:
        (WebCore::Settings::customPasteboardDataEnabled):

2017-10-03  Jon Davis  <jond@apple.com>

        Update several features to "Supported"
        https://bugs.webkit.org/show_bug.cgi?id=177831

        Reviewed by Alexey Proskuryakov.

        Update Media Capture and Streams, Performance Observer, Resource Timing, User Timing, 
        Web Cryptography, and WebRTC.

        * features.json:

2017-10-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Reimplement CurlDownload with CurlRequest
        https://bugs.webkit.org/show_bug.cgi?id=177779

        Reviewed by Alex Christensen.

        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlHandle::enableAllowedProtocols):
        (WebCore::CurlHandle::enableFollowLocation): Deleted.
        (WebCore::CurlHandle::getEffectiveURL): Deleted.
        * platform/network/curl/CurlContext.h:
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::~CurlDownload):
        (WebCore::CurlDownload::init):
        (WebCore::CurlDownload::start):
        (WebCore::CurlDownload::cancel):
        (WebCore::CurlDownload::createCurlRequest):
        (WebCore::CurlDownload::curlDidReceiveResponse):
        (WebCore::CurlDownload::curlDidReceiveBuffer):
        (WebCore::CurlDownload::curlDidComplete):
        (WebCore::CurlDownload::curlDidFailWithError):
        (WebCore::CurlDownload::shouldRedirectAsGET):
        (WebCore::CurlDownload::willSendRequest):
        (WebCore::CurlDownload::getResponse const): Deleted.
        (WebCore::CurlDownload::retain): Deleted.
        (WebCore::CurlDownload::release): Deleted.
        (WebCore::CurlDownload::setupTransfer): Deleted.
        (WebCore::CurlDownload::didCompleteTransfer): Deleted.
        (WebCore::CurlDownload::didCancelTransfer): Deleted.
        (WebCore::CurlDownload::closeFile): Deleted.
        (WebCore::CurlDownload::moveFileToDestination): Deleted.
        (WebCore::CurlDownload::writeDataToFile): Deleted.
        (WebCore::CurlDownload::didReceiveHeader): Deleted.
        (WebCore::CurlDownload::didReceiveData): Deleted.
        (WebCore::CurlDownload::didReceiveResponse): Deleted.
        (WebCore::CurlDownload::didReceiveDataOfLength): Deleted.
        (WebCore::CurlDownload::didFinish): Deleted.
        (WebCore::CurlDownload::didFail): Deleted.
        (WebCore::CurlDownload::writeCallback): Deleted.
        (WebCore::CurlDownload::headerCallback): Deleted.
        * platform/network/curl/CurlDownload.h:
        (WebCore::CurlDownloadListener::didReceiveResponse):
        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::didReceiveData):
        (WebCore::CurlRequest::finalizeTransfer):
        (WebCore::CurlRequest::enableDownloadToFile):
        (WebCore::CurlRequest::getDownloadedFilePath):
        (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
        (WebCore::CurlRequest::closeDownloadFile):
        * platform/network/curl/CurlRequest.h:
        (WebCore::CurlRequest::create):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
        * platform/network/curl/ResourceHandleCurlDelegate.h:

2017-10-03  Zalan Bujtas <zalan@apple.com>

        Move scroll snap point unregistration from willBeRemovedFromTree to willBeDestroyed
        https://bugs.webkit.org/show_bug.cgi?id=177830
        <rdar://problem/34796065>

        Reviewed by Antti Koivisto.

        willBeRemovedFromTree is called conditionally, relying on unregistering objects in there is highly error prone.

        Covered by existing tests.

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::willBeDestroyed):
        (WebCore::RenderBox::willBeRemovedFromTree): Deleted.
        * rendering/RenderBox.h:

2017-10-03  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [ATK] ARIA menuitems should be exposed with ATK_ROLE_MENU_ITEM even when it's the child of group role
        https://bugs.webkit.org/show_bug.cgi?id=177811

        Reviewed by Chris Fleizach.

        AccessibilityNodeObject::remapAriaRoleDueToParent() remaps ARIA menuitems to the
        MenuButtonRole AccessibilityRole when the menuitem's parent is an ARIA group, but
        the ATK code was not handling that remapped role value. As a result, the element
        was being exposed as ATK_ROLE_UNKNOWN. Add MenuButtonRole to the AccessibilityRole
        types exposed as ATK_ROLE_MENU_ITEM.

        Test: accessibility/gtk/menu-with-group-child-tree.html

        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (atkRole):

2017-10-03  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [ATK] aria-rowindex set on row element is not being exposed
        https://bugs.webkit.org/show_bug.cgi?id=177821

        Reviewed by Chris Fleizach.

        Expose the value of aria-rowindex when set on a row as an object
        attribute, as we already do when it's set on a cell.

        Test: accessibility/gtk/aria-rowindex-on-row.html

        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):

2017-10-03  Daniel Bates  <dabates@apple.com>

        Share code to normalize an HTTP method
        https://bugs.webkit.org/show_bug.cgi?id=177837

        Reviewed by Andy Estes.

        Currently we duplicate code in XMLHttpRequest and FetchRequest to normalize an HTTP method.
        We should add a common helper function and update both classes to make use of it.

        No functionality changed. So, no new tests.

        * Modules/fetch/FetchRequest.cpp:
        (WebCore::setMethod): Modified to use WebCore::normalizeHTTPMethod().
        * platform/network/HTTPParsers.cpp:
        (WebCore::normalizeHTTPMethod): Moved from XMLHttpRequest.cpp.
        * platform/network/HTTPParsers.h:
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::open): Modified to use WebCore::normalizeHTTPMethod().
        (WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod): Deleted; moved to HTTPParsers.cpp.
        * xml/XMLHttpRequest.h:

2017-10-03  Daniel Bates  <dabates@apple.com>

        Share code to determine a forbidden method
        https://bugs.webkit.org/show_bug.cgi?id=177833

        Reviewed by Andy Estes.

        Currently we duplicate code in XMLHttpRequest and FetchRequest to determine if a method is
        forbidden. We should add a common helper function and update both classes to make use of it.

        No functionality changed. So, no new tests.

        * Modules/fetch/FetchRequest.cpp:
        (WebCore::setMethod): Modified to use WebCore::isForbiddenMethod().
        * platform/network/HTTPParsers.cpp:
        (WebCore::isForbiddenMethod): Added.
        * platform/network/HTTPParsers.h:
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::open): Modified to use WebCore::isForbiddenMethod().
        (WebCore::XMLHttpRequest::isAllowedHTTPMethod): Deleted.
        * xml/XMLHttpRequest.h:

2017-10-03  Zalan Bujtas  <zalan@apple.com>

        RenderMenuList should not hold raw pointers
        https://bugs.webkit.org/show_bug.cgi?id=177836

        Reviewed by Antti Koivisto.

        While both m_buttonText and m_innerBlock are child renderers of
        the RenderMenuList, so the their lifecycles are supposed to tied
        to the parent object, this patch removes some manual raw pointer managing.

        Covered by existing tests.

        * rendering/RenderMenuList.cpp:
        (WebCore::RenderMenuList::RenderMenuList):
        (WebCore::RenderMenuList::createInnerBlock):
        (RenderMenuList::takeChild):
        (RenderMenuList::setText):
        * rendering/RenderMenuList.h:

2017-10-03  Timothy Horton  <timothy_horton@apple.com>

        Include a few widespread WTF headers in WebCorePrefix.h
        https://bugs.webkit.org/show_bug.cgi?id=173481

        * WebCorePrefix.h:
        Turn this off on Windows because it doesn't work; needs further investigation.

2017-10-03  Tim Horton  <timothy_horton@apple.com>

        Include a few widespread WTF headers in WebCorePrefix.h
        https://bugs.webkit.org/show_bug.cgi?id=173481

        Reviewed by Alex Christensen.

        * WebCorePrefix.h:
        These are four of the headers that contribute the most pre-processed
        source to the WebCore build. They (and their dependents) change infrequently
        enough that a world rebuild of WebCore when they change seems like an
        acceptable tradeoff for the ~9% reduction in WebCore build time that I
        measure from this change.

        We can't do this on macOS 10.12 because of https://bugs.llvm.org/show_bug.cgi?id=33520.

2017-10-03  Daniel Bates  <dabates@apple.com>

        XMLHttpRequest.setRequestHeader() should allow Content-Transfer-Encoding header; remove
        duplicate logic to check for a forbidden XHR header field
        https://bugs.webkit.org/show_bug.cgi?id=177829

        Reviewed by Alexey Proskuryakov.

        Use isForbiddenHeaderName() (defined in HTTPParsers.h) to check if the header field specified
        to XMLHttpRequest.setRequestHeader() is allowed. Among other benefits this makes the behavior
        of XMLHttpRequest.setRequestHeader() more closely aligned with the behavior of this method in
        the XHR standard, <https://xhr.spec.whatwg.org> (8 September 2017). In particular, XMLHttpRequest.setRequestHeader()
        no longer forbids setting the header Content-Transfer-Encoding. This header has not been
        considered a forbidden header since <https://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/>.

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::setRequestHeader):
        (WebCore::isForbiddenRequestHeader): Deleted.
        (WebCore::XMLHttpRequest::isAllowedHTTPHeader): Deleted.
        * xml/XMLHttpRequest.h:

2017-10-03  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r222686, r222695, and r222698.
        https://bugs.webkit.org/show_bug.cgi?id=177835

        Caused LayoutTests to crash in
        WebCore::TimerBase::setNextFireTime (Requested by ryanhaddad
        on #webkit).

        Reverted changesets:

        "[Settings] Replace SettingsMacros.h with a generated base
        class for Settings"
        https://bugs.webkit.org/show_bug.cgi?id=177681
        http://trac.webkit.org/changeset/222686

        "[Settings] Enums should not be passed by const reference"
        https://bugs.webkit.org/show_bug.cgi?id=177727
        http://trac.webkit.org/changeset/222695

        "[Settings] Move remaining simple settings to Settings.in"
        https://bugs.webkit.org/show_bug.cgi?id=177730
        http://trac.webkit.org/changeset/222698

2017-10-03  Jer Noble  <jer.noble@apple.com>

        Implement quality-of-service tiers in WebCoreDecompressionSession
        https://bugs.webkit.org/show_bug.cgi?id=177769

        Reviewed by Dean Jackson.

        VTDecompressionSession will suggest quality-of-service tiers to be used when decompression
        can't keep up with playback speed. Use a simple exponential-moving-average heuristic to
        determine when to move up and down the tiers.

        Drive-by fix: When frames are so late that they miss the display deadline, mark them as
        dropped rather than just delayed.

        * platform/graphics/cocoa/WebCoreDecompressionSession.h:
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
        (WebCore::WebCoreDecompressionSession::decodeSample):
        (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
        (WebCore::WebCoreDecompressionSession::automaticDequeue):
        (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
        (WebCore::WebCoreDecompressionSession::resetQosTier):
        (WebCore::WebCoreDecompressionSession::increaseQosTier):
        (WebCore::WebCoreDecompressionSession::decreaseQosTier):
        (WebCore::WebCoreDecompressionSession::updateQosWithDecodeTimeStatistics):
        * platform/cocoa/VideoToolboxSoftLink.cpp:
        * platform/cocoa/VideoToolboxSoftLink.h:

2017-10-03  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK] Support the "system" CSS font family
        https://bugs.webkit.org/show_bug.cgi?id=177755

        Reviewed by Carlos Garcia Campos.

        Obtain the system UI font from the GtkSettings::gtk-font-name property

        Test: platform/gtk/fonts/systemFont.html

        * platform/graphics/freetype/FontCacheFreeType.cpp:
        (WebCore::getFamilyNameStringFromFamily): Use defaultGtkSystemFont()
        to handle -webkit-system-font and -webkit-system-ui.
        (WebCore::isCommonlyUsedGenericFamily): Handle -webkit-system-font and
        -webkit-system-ui as generic family names.
        * platform/graphics/gtk/GtkUtilities.cpp:
        (WebCore::defaultGtkSystemFont): Added.
        * platform/graphics/gtk/GtkUtilities.h: Add prototype for defaultGtkSystemFont().

2017-10-03  Daniel Bates  <dabates@apple.com>

        [XHR] Only exempt Dashboard widgets from XHR header restrictions
        https://bugs.webkit.org/show_bug.cgi?id=177824
        <rdar://problem/34384301>

        Reviewed by Alexey Proskuryakov.

        Currently we allow file URLs to set arbitrary XHR headers. In contrast, non-file URLs are
        restricted from setting some XHR headers (e.g. COOKIE). Historically the relaxation for file
        URL was for backwards compatibility to allow Dashboard widgets to work. Instead we should
        apply the non-file URL policy to all URLs and only relax the policy for Dashboard widgets.

        Tests: fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html
               fast/xmlhttprequest/set-dangerous-headers.html

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

2017-10-03  Fujii Hironori  <Hironori.Fujii@sony.com>

        REGRESSION(r221909): Failing fast/text/international/iso-8859-8.html
        https://bugs.webkit.org/show_bug.cgi?id=177364

        Reviewed by Carlos Garcia Campos.

        Range.getClientRects returned an incorrect rect for a last
        collapsed space of RenderText in HarfBuzz port.

        HarfBuzzShaper::selectionRect needs to return a valid value even
        if the arguments 'from' and 'to' point to the just after the end
        of the text run.

        Tests: fast/text/international/iso-8859-8.html

        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
        (WebCore::HarfBuzzShaper::shape): Do not check the return value of
        fillGlyphBuffer.
        (WebCore::HarfBuzzShaper::fillGlyphBuffer): Change the return
        value type from bool to void.
        (WebCore::HarfBuzzShaper::selectionRect): Set the rightmost
        position to fromX if foundFromX is false.
        * platform/graphics/harfbuzz/HarfBuzzShaper.h: Change the return
        value type of fillGlyphBuffer from bool to void.

2017-10-03  JF Bastien  <jfbastien@apple.com>

        WebAssembly: no VM / JS version of everything but Instance
        https://bugs.webkit.org/show_bug.cgi?id=177473

        Reviewed by Filip Pizlo.

        * ForwardingHeaders/wasm/WasmModule.h: Added. This used to be
        included in JSWebAssemblyModule.h.
        * bindings/js/SerializedScriptValue.cpp: Update postMessage code
        according to C++ API changes.

2017-10-03  Zalan Bujtas  <zalan@apple.com>

        [AX] Do not trigger redundant layout on tables.
        https://bugs.webkit.org/show_bug.cgi?id=177781
        <rdar://problem/34777030>

        Reviewed by Antti Koivisto.

        RenderTable::forceSectionsRecalc() marks the RenderTable dirty and schedules a layout.
        Every time AccessibilityTable asks for the table element (including during construction),
        we end up triggering a layout. This call was added (r191357) to ensure RenderTable's m_firstBody is always
        up-to-date (in case of anonymous wrapper table renderer). Instead of relying on the m_firstBody,
        let's just use the first child to find the table element. The first child always points to a valid
        renderer (or nullptr), while m_firstBody is the result of section computation.

        Covered by existing tests.

        * accessibility/AccessibilityTable.cpp:
        (WebCore::AccessibilityTable::tableElement const):

2017-10-03  Daniel Bates  <dabates@apple.com>

        [CSP] Check policy before opening a new window to a JavaScript URL
        https://bugs.webkit.org/show_bug.cgi?id=176815
        <rdar://problem/34400057>

        Reviewed by Brent Fulgham.

        Ensure that the Content Security Policy of the page allows navigation to a JavaScript URL
        before opening a new window to it.

        Test: http/tests/security/contentSecurityPolicy/window-open-javascript-url-blocked.html

        * loader/FrameLoader.cpp:
        (WebCore::createWindow):

2017-10-03  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [ATK] ARIA drag-and-drop attribute values should be exposed via AtkObject attributes
        https://bugs.webkit.org/show_bug.cgi?id=177763

        Reviewed by Chris Fleizach.

        Expose the values of aria-grabbed and aria-dropeffect via the "grabbed" and "dropeffect"
        AtkObject attributes.

        Test: accessibility/gtk/aria-drag-and-drop.html

        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):

2017-10-03  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed test fix after r222779.

        * testing/cocoa/WebArchiveDumpSupport.mm:
        (WebCoreTestSupport::createCFURLResponseFromResponseData): Setting NSSecureCoding in this test code should be
        done based on build system, just like it is in the actual WebArchive handling code.

2017-10-03  Youenn Fablet  <youenn@apple.com>

        Clean-up RealtimeIncomingVideoSource
        https://bugs.webkit.org/show_bug.cgi?id=177782

        Reviewed by Alejandro G. Castro.

        No change of behavior.
        Removing code that is no longer needed.

        * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
        (WebCore::RealtimeIncomingVideoSource::create):
        (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
        * platform/mediastream/mac/RealtimeIncomingVideoSource.h:

2017-10-03  Brent Fulgham  <bfulgham@apple.com>

        [Mac] Use safer decoding practices for NSKeyedUnarchiver
        https://bugs.webkit.org/show_bug.cgi?id=175887
        <rdar://problem/33435281>

        Reviewed by Daniel Bates.

        * loader/archive/cf/LegacyWebArchiveMac.mm:
        (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Use NSSecureCoding to unarchive.
        (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto for archiving.
        * testing/cocoa/WebArchiveDumpSupport.mm:
        (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to use NSSecureCoding if possible.

2017-10-03  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r222760.

        This change caused LayoutTest crashes.

        Reverted changeset:

        "[Mac] Use safer decoding practices for NSKeyedUnarchiver"
        https://bugs.webkit.org/show_bug.cgi?id=175887
        http://trac.webkit.org/changeset/222760

2017-10-03  Michael Catanzaro  <mcatanzaro@igalia.com>

        REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
        https://bugs.webkit.org/show_bug.cgi?id=177449

        Reviewed by Chris Dumez.

        * platform/gtk/GtkUtilities.cpp:
        (WebCore::wallTimeForEvent):
        * platform/gtk/GtkUtilities.h:
        (WebCore::wallTimeForEvent):
        * platform/gtk/PlatformKeyboardEventGtk.cpp:
        (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
        * platform/gtk/PlatformMouseEventGtk.cpp:
        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
        * platform/gtk/PlatformWheelEventGtk.cpp:
        (WebCore::PlatformWheelEvent::PlatformWheelEvent):

2017-10-03  Youenn Fablet  <youenn@apple.com>

        Use vector map routine in WebCore CacheStorage implementation
        https://bugs.webkit.org/show_bug.cgi?id=177002

        Reviewed by Darin Adler.

        No change of behavior.
        Replacing use of reserveInitialCapacity/uncheckedAppend by use of map.

        * Modules/cache/CacheStorage.cpp:
        (WebCore::copyCache):
        (WebCore::CacheStorage::match):
        (WebCore::CacheStorage::retrieveCaches):
        (WebCore::CacheStorage::keys):
        (WebCore::copyCaches): Deleted.
        * Modules/cache/DOMCache.cpp:
        (WebCore::DOMCache::matchAll):
        (WebCore::copyRequestRef):
        (WebCore::DOMCache::keys):
        * Modules/cache/DOMCacheEngine.cpp:
        (WebCore::DOMCacheEngine::isolateCacheInfo):
        (WebCore::DOMCacheEngine::CacheInfos::isolatedCopy):
        * Modules/cache/WorkerCacheStorageConnection.cpp:
        (WebCore::recordsDataFromRecords):
        (WebCore::recordsFromRecordsData):

2017-10-02  Myles C. Maxfield  <mmaxfield@apple.com>

        Move LineEnding.{h,cpp} from WebCore/platform/text to wtf/text
        https://bugs.webkit.org/show_bug.cgi?id=176575

        Reviewed by Alex Christensen.

        No new tests because there is no behavior change.

        * WebCore.xcodeproj/project.pbxproj:
        * fileapi/BlobBuilder.cpp:
        * html/FormDataList.cpp:

2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Rename methods ending in *Json() as *JSON()
        https://bugs.webkit.org/show_bug.cgi?id=177793

        Reviewed by Matt Baker.

        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::buildObjectForCachedResource):
        (WebCore::InspectorNetworkAgent::willSendRequest):
        (WebCore::InspectorNetworkAgent::didReceiveResponse):
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::resourceTypeJSON):
        (WebCore::InspectorPageAgent::cachedResourceTypeJSON):
        (WebCore::InspectorPageAgent::buildObjectForFrameTree):
        (WebCore::InspectorPageAgent::resourceTypeJson): Deleted.
        (WebCore::InspectorPageAgent::cachedResourceTypeJson): Deleted.
        * inspector/InspectorPageAgent.h:

2017-10-02  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION(r222595): Intermittent crash while accessing DataTransferItemList
        https://bugs.webkit.org/show_bug.cgi?id=177791
        <rdar://problem/34781456>

        Reviewed by Ryosuke Niwa.

        DataTransfer::moveDragState() currently attempts to move the other DataTransfer's DataTransferItemList and
        DragImageLoader as members of its own. This is incorrect, since both of these entities hold raw references of
        some form to the other DataTransfer, yet they are held as unique_ptrs in the new DataTransfer. To fix this, we
        (1) remove the line of code that moves the item list, since item lists will be lazily generated on the new
        DataTransfer anyways, and (2) update the DataTransfer pointer on the old DataTransfer's DragImageLoader after
        moving it to the new DataTransfer.

        Test: editing/pasteboard/drag-end-crash-accessing-item-list.html

        * dom/DataTransfer.cpp:
        (WebCore::DragImageLoader::moveToDataTransfer):
        (WebCore::DataTransfer::moveDragState):

2017-10-02  Chris Dumez  <cdumez@apple.com>

        Rename computeSharedStringHash() overload taking a URL to computedVisitedLinkHash()
        https://bugs.webkit.org/show_bug.cgi?id=177776

        Reviewed by Alex Christensen.

        * dom/VisitedLinkState.cpp:
        (WebCore::linkHashForElement):
        (WebCore::VisitedLinkState::determineLinkStateSlowCase):
        * html/HTMLAnchorElement.h:
        (WebCore::HTMLAnchorElement::visitedLinkHash const):
        * platform/SharedStringHash.cpp:
        (WebCore::computeVisitedLinkHash):
        * platform/SharedStringHash.h:

2017-10-02  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [ATK] The value of aria-level is not exposed on non-heading roles
        https://bugs.webkit.org/show_bug.cgi?id=177775

        Reviewed by Chris Fleizach.

        Expose the value of aria-level via the "level" AtkObject attribute, as is currently
        done for headings.

        Test: accessibility/gtk/aria-level.html

        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):

2017-10-02  Andy Estes  <aestes@apple.com>

        [Payment Request] Validate payment method identifiers
        https://bugs.webkit.org/show_bug.cgi?id=177794

        Reviewed by Sam Weinig.

        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::isValidStandardizedPaymentMethodIdentifier):
        (WebCore::isValidURLBasedPaymentMethodIdentifier):
        (WebCore::convertAndValidatePaymentMethodIdentifier):
        (WebCore::PaymentRequest::create):
        * Modules/paymentrequest/PaymentRequest.h:

2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>

        Move more code into PasteboardCustomData
        https://bugs.webkit.org/show_bug.cgi?id=177795

        Reviewed by Wenson Hsieh.

        Moved sharedBufferFromCustomData, customDataFromSharedBuffer, and customWebKitPasteboardDataType into
        PasteboardCustomData as createSharedBuffer, fromSharedBuffer, and cocoaType respectively.

        * platform/Pasteboard.cpp:
        (WebCore::PasteboardCustomData::createSharedBuffer const): Renamed from sharedBufferFromCustomData.
        (WebCore::PasteboardCustomData::fromSharedBuffer): Renamed from customDataFromSharedBuffer.
        * platform/Pasteboard.h:
        * platform/StaticPasteboard.cpp:
        (WebCore::StaticPasteboard::commitToPasteboard): Now initializes with an empty origin string.
        * platform/cocoa/PasteboardCocoa.mm:
        (WebCore::PasteboardCustomData::cocoaType): Moved here from Pasteboard.h
        (WebCore::Pasteboard::readStringInCustomData):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
        (WebCore::PlatformPasteboard::write):
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]):
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
        (WebCore::PlatformPasteboard::write):

2017-10-02  Brent Fulgham  <bfulgham@apple.com>

        [Mac] Use safer decoding practices for NSKeyedUnarchiver
        https://bugs.webkit.org/show_bug.cgi?id=175887
        <rdar://problem/33435281>

        Reviewed by Daniel Bates.

        * loader/archive/cf/LegacyWebArchiveMac.mm:
        (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Use NSSecureCoding to unarchive.
        (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto for archiving.
        * testing/cocoa/WebArchiveDumpSupport.mm:
        (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to use NSSecureCoding if possible.

2017-10-02  Daniel Bates  <dabates@apple.com>

        Use InlineTextBox::lineFont() in more places
        https://bugs.webkit.org/show_bug.cgi?id=177749

        Reviewed by Zalan Bujtas.

        Currently InlineTextBox::paint() calls InlineTextBox::lineFont() to compute the font for the
        line and then passes this value to various paint helper functions. The computation is not
        expensive and it is sufficient to have the individual paint helper functions compute it
        directly. We should have the individual paint helper functions compute it directly. This
        will help towards sharing more code throughout InlineTextBox by reducing the noise of
        passing the font for the line.

        No functionality changed. So, no new tests.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paint):
        (WebCore::InlineTextBox::paintSelection):
        (WebCore::InlineTextBox::paintTextSubrangeBackground):
        (WebCore::InlineTextBox::paintCompositionBackground):
        (WebCore::InlineTextBox::paintTextMatchMarker):
        (WebCore::InlineTextBox::paintDecoration):
        (WebCore::InlineTextBox::paintDocumentMarker):
        (WebCore::InlineTextBox::paintDocumentMarkers):
        * rendering/InlineTextBox.h:

2017-10-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Implement missing async method in RecourceHandle and make it actually async
        https://bugs.webkit.org/show_bug.cgi?id=173964

        Reviewed by Alex Christensen.

        * platform/network/ResourceHandle.cpp:
        (WebCore::ResourceHandle::continueWillSendRequest): Deleted.
        (WebCore::ResourceHandle::continueDidReceiveResponse): Deleted.
        (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace): Deleted.
        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::start):
        (WebCore::CurlRequest::cancel):
        (WebCore::CurlRequest::suspend):
        (WebCore::CurlRequest::resume):
        (WebCore::CurlRequest::didReceiveHeader):
        (WebCore::CurlRequest::didReceiveData):
        (WebCore::CurlRequest::didCompleteTransfer):
        (WebCore::CurlRequest::didCancelTransfer):
        (WebCore::CurlRequest::finalizeTransfer):
        (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
        (WebCore::CurlRequest::invokeDidReceiveResponse):
        (WebCore::CurlRequest::completeDidReceiveResponse):
        (WebCore::CurlRequest::setRequestPaused):
        (WebCore::CurlRequest::setCallbackPaused):
        (WebCore::CurlRequest::pausedStatusChanged):
        (WebCore::CurlRequest::setPaused): Deleted.
        * platform/network/curl/CurlRequest.h:
        (WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
        (WebCore::CurlRequest::isPaused const):
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
        (WebCore::ResourceHandle::continueDidReceiveResponse):
        (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
        (WebCore::ResourceHandleCurlDelegate::continueDidReceiveResponse):
        (WebCore::ResourceHandleCurlDelegate::platformContinueSynchronousDidReceiveResponse):
        (WebCore::ResourceHandleCurlDelegate::continueAfterDidReceiveResponse):
        (WebCore::ResourceHandleCurlDelegate::shouldRedirectAsGET):
        * platform/network/curl/ResourceHandleCurlDelegate.h:
        * platform/network/curl/ResourceResponseCurl.cpp:
        (WebCore::ResourceResponse::shouldRedirect):
        (WebCore::ResourceResponse::isMovedPermanently const):
        (WebCore::ResourceResponse::isFound const):
        (WebCore::ResourceResponse::isSeeOther const):
        (WebCore::ResourceResponse::isNotModified const):
        (WebCore::ResourceResponse::isUnauthorized const):

2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>

        PasteImage tests are failing on debug builds
        https://bugs.webkit.org/show_bug.cgi?id=177778

        Reviewed by Wenson Hsieh.

        After r222702, PlatformPasteboard is no longer responsible for adding "Files" as a type"
        as DataTransfer takes care of it now. Removed the code to do this from PlatformPasteboardIOS.mm
        and PlatformPasteboardMac.mm so that we don't fail assertions in debug builds.

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):

2017-10-02  Daniel Bates  <dabates@apple.com>

        No need to truncate text after calling InlineTextBox::text()
        https://bugs.webkit.org/show_bug.cgi?id=177748

        Reviewed by Zalan Bujtas.

        Following r222670 it is no longer necessary to explicitly truncate the text run length
        as InlineTextBox::text() returns a text run with respect to the truncation of the text box.

        No functionality changed. So, no new tests.

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

2017-10-02  Antti Koivisto  <antti@apple.com>

        Add makeWeakPtr variant that takes pointer
        https://bugs.webkit.org/show_bug.cgi?id=177767

        Reviewed by Zalan Bujtas.

        Use it.

        * rendering/SelectionRangeData.h:
        (WebCore::SelectionRangeData::Context::Context):

2017-10-02  Antti Koivisto  <antti@apple.com>

        Make RenderPtr a type alias of std::unique_ptr
        https://bugs.webkit.org/show_bug.cgi?id=177739

        Reviewed by Sam Weinig.

        It just needs a custom deleter.

        * page/FrameView.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::insertChildInternal):
        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
        (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObjectDeleter::operator() const):
        (WebCore::RenderObject::willBeDestroyed):
        * rendering/RenderPtr.h:
        (WebCore::createRenderer):
        (WebCore::static_pointer_cast):

            Make this safer with downcast.

        (WebCore::RenderPtr::RenderPtr): Deleted.
        (WebCore::RenderPtr::~RenderPtr): Deleted.
        (WebCore::RenderPtr::get const): Deleted.
        (WebCore::RenderPtr::operator* const): Deleted.
        (WebCore::RenderPtr::operator-> const): Deleted.
        (WebCore::RenderPtr::operator! const): Deleted.
        (WebCore::RenderPtr::operator UnspecifiedBoolType const): Deleted.
        (WebCore::RenderPtr::operator=): Deleted.
        (WebCore::RenderPtr::swap): Deleted.
        (WebCore::RenderPtr::operator==): Deleted.
        (WebCore::RenderPtr::operator!=): Deleted.
        (WebCore::RenderPtr<T>::clear): Deleted.
        (WebCore::RenderPtr<T>::leakPtr): Deleted.
        (WebCore::RenderPtr<T>::RenderPtr): Deleted.
        (WebCore::=): Deleted.
        (WebCore::swap): Deleted.
        (WebCore::operator==): Deleted.
        (WebCore::operator!=): Deleted.
        (WebCore::getPtr): Deleted.
        (WTF::HashTraits<WebCore::RenderPtr<T>>::emptyValue): Deleted.
        (WTF::HashTraits<WebCore::RenderPtr<T>>::peek): Deleted.

            We already have hash traits for std::unique_ptr.

2017-10-02  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Include Beacon and Ping requests in Network tab
        https://bugs.webkit.org/show_bug.cgi?id=177641
        <rdar://problem/33086839>

        Reviewed by Chris Dumez.

        Tests: http/tests/inspector/network/beacon-type.html
               http/tests/inspector/network/ping-type.html

        * Modules/beacon/NavigatorBeacon.cpp:
        (WebCore::NavigatorBeacon::sendBeacon):
        Fix a typo.

        * loader/PingLoader.cpp:
        (WebCore::PingLoader::startPingLoad):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load):
        Include InspectorInstrumentation hooks for ping network loads.

        * loader/LoaderStrategy.h:
        * platform/network/PingHandle.h:
        Include an optional ResourceResponse in the ping load completion callback.
        If available this will be enough for Web Inspector to include details such
        as the response statusCode.

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::willSendRequestOfTypeImpl):
        (WebCore::InspectorInstrumentation::continueAfterPingLoaderImpl): Deleted.
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::willSendRequestOfType):
        (WebCore::InspectorInstrumentation::continueAfterPingLoader): Deleted.
        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::resourceTypeForCachedResource):
        (WebCore::resourceTypeForLoadType):
        (WebCore::InspectorNetworkAgent::willSendRequest):
        (WebCore::InspectorNetworkAgent::willSendRequestOfType):
        * inspector/InspectorNetworkAgent.h:
        Make a general willSendRequestOfType hook when sending a request that does
        not go through normal CachedResource loading. The Ping and Beacon requests
        go through this process, we may also use this path for Preflight requests.

        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::resourceTypeJson):
        (WebCore::InspectorPageAgent::cachedResourceType):
        * inspector/InspectorPageAgent.h:
        Small refactoring.

2017-10-02  Zalan Bujtas  <zalan@apple.com>

        SelectionRangeData should not hold raw RenderObject pointers
        https://bugs.webkit.org/show_bug.cgi?id=177677
        <rdar://problem/34763060>

        Reviewed by Sam Weinig.

        SelectionRangeData::Context start and end renderers' lifetime is not strictly tied
        to the lifetime of SelectionRangeData.

        Covered by existing tests.

        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::updateAppearance):
        * platform/DragImage.cpp:
        (WebCore::createDragImageForRange):
        * rendering/SelectionRangeData.cpp:
        (WebCore::isValidRendererForSelection):
        (WebCore::collect):
        (WebCore::SelectionRangeData::set):
        (WebCore::SelectionRangeData::clear):
        (WebCore::SelectionRangeData::repaint const):
        (WebCore::SelectionRangeData::collectBounds const):
        (WebCore::SelectionRangeData::apply):
        * rendering/SelectionRangeData.h:
        (WebCore::SelectionRangeData::Context::Context):
        (WebCore::SelectionRangeData::Context::start const):
        (WebCore::SelectionRangeData::Context::end const):
        (WebCore::SelectionRangeData::Context::startPosition const):
        (WebCore::SelectionRangeData::Context::endPosition const):
        (WebCore::SelectionRangeData::Context::operator== const):
        (WebCore::SelectionRangeData::start const):
        (WebCore::SelectionRangeData::end const):
        (WebCore::SelectionRangeData::startPosition const):
        (WebCore::SelectionRangeData::endPosition const):

2017-10-02  Olivier Blin  <olivier.blin@softathome.com>

        [WPE] Remove GnuTLS dependency
        https://bugs.webkit.org/show_bug.cgi?id=177750

        Reviewed by Michael Catanzaro.

        libgcrypt is used by default instead of GnuTLS.
        See bug 163125

        * PlatformWPE.cmake:

2017-10-02  Zalan Bujtas  <zalan@apple.com>

        Addressing post-review comments after r222621
        https://bugs.webkit.org/show_bug.cgi?id=177610

        Reviewed by Darin Adler.

        * rendering/RenderMenuList.cpp:
        (RenderMenuList::didUpdateActiveOption):

2017-10-02  Daniel Bates  <dabates@apple.com>

        Remove length argument from TextPainter::paint()
        https://bugs.webkit.org/show_bug.cgi?id=177758

        Reviewed by Alex Christensen.

        Have TextPainter.paint() use the length of the specified TextRun as opposed to
        taking an explicit argument for the length of the TextRun.

        Following r222670 InlineTextBox creates a TextRun with respect to the truncated
        line. Prior to r222670 InlineTextBox did not do this and hence it had to pass both
        the TextRun and truncated length to TextPainter.paint() to have the line painted.
        Code that needs to paint a substring of a TextRun can still do so by using TextPainter.paintRange().

        No functionality changed. So, no new tests.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paint):
        * rendering/SimpleLineLayoutFunctions.cpp:
        (WebCore::SimpleLineLayout::paintFlow):
        * rendering/TextPainter.cpp:
        (WebCore::TextPainter::paint):
        * rendering/TextPainter.h:

2017-10-02  Fujii Hironori  <Hironori.Fujii@sony.com>

        [curl] Crashes in CurlRequest::setupPUT()
        https://bugs.webkit.org/show_bug.cgi?id=177733

        Reviewed by Alex Christensen.

        Tests: http/tests/xmlhttprequest/xmlhttprequest-open-method-allowed.html

        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::setupPUT): Null-check the result of request.httpBody().

2017-10-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [CURL] Should handle redirects in WebCore
        https://bugs.webkit.org/show_bug.cgi?id=21242

        Reviewed by Alex Christensen.

        * platform/network/ResourceHandle.cpp:
        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlHandle::enableAutoReferer): Deleted.
        * platform/network/curl/CurlContext.h:
        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::setupTransfer):
        (WebCore::CurlRequest::didReceiveHeader):
        (WebCore::CurlRequest::didReceiveData):
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::start):
        (WebCore::ResourceHandle::continueDidReceiveResponse):
        (WebCore::ResourceHandle::continueWillSendRequest):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
        (WebCore::ResourceHandleCurlDelegate::shouldRedirectAsGET):
        (WebCore::ResourceHandleCurlDelegate::willSendRequest):
        (WebCore::ResourceHandleCurlDelegate::continueWillSendRequest):
        (WebCore::ResourceHandleCurlDelegate::continueAfterWillSendRequest):
        * platform/network/curl/ResourceHandleCurlDelegate.h:
        * platform/network/curl/ResourceResponse.h:
        * platform/network/curl/ResourceResponseCurl.cpp:
        (WebCore::ResourceResponse::shouldRedirect):
        (WebCore::ResourceResponse::isMovedPermanently const):
        (WebCore::ResourceResponse::isFound const):
        (WebCore::ResourceResponse::isSeeOther const):
        (WebCore::ResourceResponse::isRedirection const): Deleted.

2017-10-02  Antti Koivisto  <antti@apple.com>

        Crashes with guard malloc under RenderFullScreen::unwrapRenderer
        https://bugs.webkit.org/show_bug.cgi?id=177760

        Unreviewed.

        * rendering/RenderFullScreen.cpp:
        (WebCore::RenderFullScreen::unwrapRenderer):

        The assert accesses 'this' after it has been deleted. It is not very valuable so remove the assert.

2017-10-02  Zan Dobersek  <zdobersek@igalia.com>

        GraphicsContext: remove unused ENABLE(3D_TRANSFORMS) && USE(TEXTURE_MAPPER)
        https://bugs.webkit.org/show_bug.cgi?id=177757

        Reviewed by Michael Catanzaro.

        Remove three methods from the GraphicsContext class that were conditioned
        with the ENABLE(3D_TRANSFORMS) and USE(TEXTURE_MAPPER) guards. These aren't
        used anywhere at this point, but apparently used to be in the TextureMapper
        implementation.

        * platform/graphics/GraphicsContext.h:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::get3DTransform const): Deleted.
        (WebCore::GraphicsContext::concat3DTransform): Deleted.
        (WebCore::GraphicsContext::set3DTransform): Deleted.

2017-10-02  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>

        [GLib] NetworkStateNotifier implementation missing
        https://bugs.webkit.org/show_bug.cgi?id=177741

        Reviewed by Carlos Garcia Campos.

        No new tests. The DOM support is already being tested, but we would need a way
        of simulating a network outage to test GNetworkMonitor.

        * PlatformGTK.cmake: add new file.
        * PlatformWPE.cmake: add new file.
        * platform/network/NetworkStateNotifier.cpp: no longer need the empty implementations, all platforms covered.
        * platform/network/NetworkStateNotifier.h:
        * platform/network/glib/NetworkStateNotifierGLib.cpp: Added.
        (WebCore::NetworkStateNotifier::updateStateWithoutNotifying): update the network state using GNetworkMonitor's availability.
        (WebCore::NetworkStateNotifier::networkChangedCallback): when network-changed is emitted, trigger a state update.
        (WebCore::NetworkStateNotifier::startObserving): watch GNetworkMonitor's network-changed signal.

2017-10-02  Olivier Blin  <olivier.blin@softathome.com>

        Fix build with MathML disabled
        https://bugs.webkit.org/show_bug.cgi?id=177744

        Reviewed by Michael Catanzaro.

        These are regressions from r217549 (StyleResolver) and r221379 (RenderBlockFlow), which do not guard MathML usage.

        * css/StyleResolver.cpp:
        (WebCore::hasEffectiveDisplayNoneForDisplayContents):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::willCreateColumns const):

2017-10-02  Yusuke Suzuki  <utatane.tea@gmail.com>

        Use ThreadIdentifier instead of thread::this_thread::get_id
        https://bugs.webkit.org/show_bug.cgi?id=177729

        Reviewed by Sam Weinig.

        We can use WTF::ThreadIdentifier instead of thread::this_thread::get_id
        to make use of ThreadIdentifier consistent in WebKit. In the other places,
        we use ThreadIdentifier for this debugging purpose. And this is the only
        place using thread::this_thread::get_id for the exact same purpose.
        Furthermore, thread::this_thread::get_id in Windows platform. So we prefer
        using ThreadIdentifier than thread::this_thread::get_id.

        * Modules/webdatabase/DatabaseDetails.h:
        (WebCore::DatabaseDetails::DatabaseDetails):
        (WebCore::DatabaseDetails::threadID const):
        * Modules/webdatabase/DatabaseManager.cpp:
        (WebCore::DatabaseManager::detailsForNameAndOrigin):

2017-10-02  Antti Koivisto  <antti@apple.com>

        Fix memory leaks in RenderMultiColumnFlow
        https://bugs.webkit.org/show_bug.cgi?id=177735

        Reviewed by Zalan Bujtas.

        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):

            Switch from destroy() to removeFromParentAndDestroy() (they are currently equivalent in practice).

        (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):

            Destroy the placeholders instead of leaking them.

        (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):

            Destroy the placeholder instead of leaking it.

2017-10-02  Charles Turner  <cturner@igalia.com>

        Try to play AVC codec even if H.264 decoder only advertises byte-stream profile.
        https://bugs.webkit.org/show_bug.cgi?id=177550

        GStreamer's element factory filters will claim they can't play videos with AVC
        codec strings, but the elements really are capable of playing them when filters
        like videoconvert are inserted by playbin. Videos of this variety are in the YouTube
        2018 EME conformance tests.

        Also replace std::array with a stack array, this saves having to count
        the number of elements (the compiler does that now) and reduces braces.

        Reviewed by Carlos Alberto Lopez Perez.

        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
        (WebCore::codecSet):

2017-10-02  Tomas Popela  <tpopela@redhat.com>

        [SOUP] Default kerberos authentication credentials are used in ephemeral (private) mode
        https://bugs.webkit.org/show_bug.cgi?id=177738

        Reviewed by Carlos Garcia Campos.

        If the session is ephemeral then don't enable the Negotiate support in
        our SoupSession.

        * platform/network/soup/NetworkStorageSessionSoup.cpp: Pass the
        session ID if it's known to the SoupNetworkSession.
        (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
        (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const):
        * platform/network/soup/SoupNetworkSession.cpp:
        (WebCore::SoupNetworkSession::SoupNetworkSession): If the session is
        ephemeral (based on given session ID) then don't activate the
        Negotiate support in SoupSession.
        * platform/network/soup/SoupNetworkSession.h:
        Change the constructor to accept the PAL::SessionID with the default
        value set to PAL::SessionID::emptySessionID.

2017-10-02  Joanmarie Diggs  <jdiggs@igalia.com>

        REGRESSION(r222640) [GTK] Build broken with ATK 2.14
        https://bugs.webkit.org/show_bug.cgi?id=177634

        Reviewed by Michael Catanzaro.

        Use ATK_CHECK_VERSION to prevent the build failure.

        No new tests. This fixes a downstream build failure.

        * accessibility/atk/AXObjectCacheAtk.cpp:
        (WebCore::AXObjectCache::postPlatformNotification):

2017-10-01  Ryosuke Niwa  <rniwa@webkit.org>

        Pasteboard shouldn't add "Files" as a type
        https://bugs.webkit.org/show_bug.cgi?id=177731

        Reviewed by Wenson Hsieh.

        Removed the platform specific code to add "Files" when there is a file present in platform's pasteboard.
        DataTransfer::types now adds "Files" automatically when Pasteboard::containsFiles returns true.

        No new tests since there should be no behavioral change.

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::types const):
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::typesForLegacyUnsafeBindings):
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
        * platform/win/PasteboardWin.cpp:
        (WebCore::addMimeTypesForFormat): Removed the code to add "Text" and "URL" as separate types since
        this is not what the rest of ports do, and this type normalization is now taken care of by DataTransfer
        since r221063.

2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>

        Another attempt to fix Windows build after r222697.

        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::updateAppearance):
        * platform/DragImage.cpp:
        (WebCore::createDragImageForRange):
        * rendering/SelectionRangeData.cpp:
        (WebCore::SelectionRangeData::clear):
        * rendering/SelectionRangeData.h:
        (WebCore::SelectionRangeData::Context::Context):

2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>

        Windows build fix attempt after r222697.

        * platform/DragImage.cpp:
        (WebCore::createDragImageForRange):

2017-10-02  Ryosuke Niwa  <rniwa@webkit.org>

        Merge readFilenames() and read(PasteboardFileReader)
        https://bugs.webkit.org/show_bug.cgi?id=177728
        <rdar://problem/34761725>

        Reviewed by Sam Weinig.

        Generalized PasteboardFileReader to return multiple files instead of just one file, and replaced the use
        of Pasteboard::readFilenames() with it. Because eliminates the need for finding the list of types to read
        as files in addition to file names, this patch also removes Pasteboard::typesTreatedAsFiles().

        Note that Pasteboard::readFilenames() continues to exist in macOS and iOS as it's internally used by
        Pasteboard::read(PasteboardFileReader) in PasteboardCocoa.mm.

        No new tests since there should be no behavioral change.

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::files const): Now makes a single call to Pasteboard::read(PasteboardFileReader)
        instead of reading filenames and then falling back to it. Also got rid of if-def for drag drop checks
        since forDrag() and forFileDrag() are always defined since r222688.
        (WebCore::PasteboardFileTypeReader): Added. Gets the list of all file types.
        (WebCore::PasteboardFileTypeReader::readFilename): Added. Gets the list of all file types.
        (WebCore::PasteboardFileTypeReader::readBuffer): Added. Gets the list of all file types.
        (WebCore::DataTransfer::hasFileOfType): Reimplemented using PasteboardFileTypeReader.
        * editing/WebCorePasteboardFileReader.cpp:
        (WebCore::WebCorePasteboardFileReader::readFilename): Added.
        (WebCore::WebCorePasteboardFileReader::readBuffer): Renamed from read.
        * editing/WebCorePasteboardFileReader.h:
        * platform/Pasteboard.h:
        (WebCore::PasteboardFileReader): Removed the constructor since we no longer specify a specific type to
        read off of pasteboard, and renamed the existing read function to readBuffer, and added a new variant
        which takes a filename.
        * platform/StaticPasteboard.h:
        * platform/cocoa/PasteboardCocoa.mm:
        (WebCore::imageTypeToFakeFilename): Return "image/png" for ImageType::TIFF (to do TIFF-to-PNG conversion;
        see r222656 for why this is needed) now that this function is used to convert directly from image type
        converted from cocoa type instead of the one reverse-converted from MIME type.
        (WebCore::mimeTypeToImageType): Deleted.
        (WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
        (WebCore::Pasteboard::typesForLegacyUnsafeBindings): Use newly added readTypesWithSecurityCheck.
        (WebCore::convertTIFFToPNG): Extracted out of read(PasteboardFileReader).
        (WebCore::Pasteboard::read): Generalized to add filenames as well as image buffers as files. Because now
        we're concerting Cocoa types to ImageType, we no longer have to detect when TIFF-as-PNG conversion is
        happening here. We just treat ImageType::TIFF as PNG and do the conversion.
        (WebCore::Pasteboard::readStringInCustomData): Use newly added readBufferForTypeWithSecurityCheck.
        (WebCore::Pasteboard::readTypesWithSecurityCheck): Added.
        (WebCore::Pasteboard::readBufferForTypeWithSecurityCheck): Added.
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::read): Implemented.
        (WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
        (WebCore::Pasteboard::containsFiles): Implemented without calling readFilenames, which has been deleted.
        (WebCore::Pasteboard::readFilenames): Deleted.
        * platform/win/PasteboardWin.cpp:
        (WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
        (WebCore::PasteboardFileCounter): Added. Used to counts the number of files in the pasteboard.
        (WebCore::PasteboardFileCounter::readFilename):
        (WebCore::PasteboardFileCounter::readBuffer):
        (WebCore::Pasteboard::containsFiles):
        (WebCore::Pasteboard::read): Moved the code to extract filenames out of readFilenames.
        (WebCore::Pasteboard::readFilenames): Deleted.
        * platform/wpe/PasteboardWPE.cpp:
        (WebCore::Pasteboard::typesTreatedAsFiles): Deleted.
        (WebCore::Pasteboard::readFilenames): Deleted.

2017-10-01  Sam Weinig  <sam@webkit.org>

        [Settings] Move remaining simple settings to Settings.in
        https://bugs.webkit.org/show_bug.cgi?id=177730

        Reviewed by Darin Adler.

        - Adds new option type for Settings.in, 'getter', which allows you to specify
          a custom name for the setting's getter. For instance, the setting javaEnabled
          has a custom getter name, 'isJavaEnabled'.
        - Adds support for WTF::Seconds as a type of setting. Used by only 
          timeWithoutMouseMovementBeforeHidingControls at the moment.
        - Moves non-generated settings from Settings.h/cpp that don't require custom
          action when set, to Settings.in

        * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py:
        * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
        * Scripts/GenerateSettings/Settings.py:

            Add support for 'getter' and the Seconds type.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/text/FontRenderingMode.h: Copied from Source/WebCore/platform/text/TextFlags.h.
        * platform/text/TextFlags.h:
        
            Add FontRenderingMode.h. Moved out of TextFlags.h to be accessible by
            the settings generator.
        
        * page/Settings.cpp:
        (WebCore::Settings::Settings):
        (WebCore::Settings::setJavaEnabled): Deleted.
        (WebCore::Settings::setJavaEnabledForLocalFiles): Deleted.
        (WebCore::Settings::setPreferMIMETypeForImages): Deleted.
        (WebCore::Settings::setForcePendingWebGLPolicy): Deleted.
        (WebCore::Settings::setNeedsAdobeFrameReloadingQuirk): Deleted.
        (WebCore::Settings::setFontRenderingMode): Deleted.
        (WebCore::Settings::fontRenderingMode const): Deleted.
        (WebCore::Settings::setShowTiledScrollingIndicator): Deleted.
        (WebCore::Settings::setFontFallbackPrefersPictographs): Deleted.
        (WebCore::Settings::setWebFontsAlwaysFallBack): Deleted.
        * page/Settings.h:
        (WebCore::Settings::isJavaEnabled const): Deleted.
        (WebCore::Settings::isJavaEnabledForLocalFiles const): Deleted.
        (WebCore::Settings::preferMIMETypeForImages const): Deleted.
        (WebCore::Settings::needsAcrobatFrameReloadingQuirk const): Deleted.
        (WebCore::Settings::showTiledScrollingIndicator const): Deleted.
        (WebCore::Settings::setTouchEventEmulationEnabled): Deleted.
        (WebCore::Settings::isTouchEventEmulationEnabled const): Deleted.
        (WebCore::Settings::setTimeWithoutMouseMovementBeforeHidingControls): Deleted.
        (WebCore::Settings::timeWithoutMouseMovementBeforeHidingControls const): Deleted.
        (WebCore::Settings::fontFallbackPrefersPictographs const): Deleted.
        (WebCore::Settings::webFontsAlwaysFallBack const): Deleted.
        (WebCore::Settings::setMediaKeysStorageDirectory): Deleted.
        (WebCore::Settings::mediaKeysStorageDirectory const): Deleted.
        (WebCore::Settings::setMediaDeviceIdentifierStorageDirectory): Deleted.
        (WebCore::Settings::mediaDeviceIdentifierStorageDirectory const): Deleted.
        (WebCore::Settings::applePayEnabled const): Deleted.
        (WebCore::Settings::setApplePayEnabled): Deleted.
        (WebCore::Settings::applePayCapabilityDisclosureAllowed const): Deleted.
        (WebCore::Settings::setApplePayCapabilityDisclosureAllowed): Deleted.
        (WebCore::Settings::isForcePendingWebGLPolicy const): Deleted.
        * page/Settings.in:

            Moved hand-written settings to be Settings.in based.

2017-10-01  Zalan Bujtas  <zalan@apple.com>

        RenderView does not need to be a SelectionSubtreeRoot
        https://bugs.webkit.org/show_bug.cgi?id=177713

        Reviewed by Darin Adler and Antti Koivisto.

        1. SelectionSubtreeRoot -> SelectionRangeData 
        2. Move all selection logic from RenderView to SelectionRangeData
        3. class RenderView : public SelectionSubtreeRoot -> SelectionRangeData m_selection;
        4. Remove redundant code
        5. General modernization
 
        No change in functionality.

        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::setNeedsSelectionUpdate):
        (WebCore::DragCaretController::nodeWillBeRemoved):
        (WebCore::FrameSelection::respondToNodeModification):
        (WebCore::FrameSelection::prepareForDestruction):
        (WebCore::FrameSelection::focusedOrActiveStateChanged):
        (WebCore::FrameSelection::updateAppearance):
        (WebCore::FrameSelection::selectionBounds const):
        * page/FrameView.cpp:
        (WebCore::FrameView::paintContentsForSnapshot):
        * platform/DragImage.cpp:
        (WebCore::ScopedFrameSelectionState::ScopedFrameSelectionState):
        (WebCore::ScopedFrameSelectionState::~ScopedFrameSelectionState):
        (WebCore::createDragImageForRange):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::selectionState):
        (WebCore::InlineTextBox::selectionStartEnd const):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::isSelectionRoot const):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::isSelectionBorder const):
        * rendering/RenderObject.h:
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::isSelected const):
        * rendering/RenderText.cpp:
        (WebCore::RenderText::collectSelectionRectsForLineBoxes):
        * rendering/RenderTextLineBoxes.cpp:
        (WebCore::RenderTextLineBoxes::setSelectionState):
        * rendering/RenderView.cpp:
        (WebCore::RenderView::RenderView):
        (WebCore::SelectionIterator::SelectionIterator): Deleted.
        (WebCore::SelectionIterator::current const): Deleted.
        (WebCore::SelectionIterator::next): Deleted.
        (WebCore::SelectionIterator::checkForSpanner): Deleted.
        (WebCore::rendererAfterPosition): Deleted.
        (WebCore::RenderView::selectionBounds const): Deleted.
        (WebCore::RenderView::subtreeSelectionBounds const): Deleted.
        (WebCore::RenderView::repaintSelection const): Deleted.
        (WebCore::RenderView::repaintSubtreeSelection const): Deleted.
        (WebCore::RenderView::setSelection): Deleted.
        (WebCore::isValidObjectForNewSelection): Deleted.
        (WebCore::RenderView::clearSubtreeSelection const): Deleted.
        (WebCore::RenderView::applySubtreeSelection): Deleted.
        (WebCore::RenderView::getSelection const): Deleted.
        (WebCore::RenderView::clearSelection): Deleted.
        * rendering/RenderView.h:
        * rendering/SelectionSubtreeRoot.cpp:
        (WebCore::rendererAfterPosition):
        (WebCore::SelectionIterator::SelectionIterator):
        (WebCore::SelectionIterator::current const):
        (WebCore::SelectionIterator::next):
        (WebCore::SelectionIterator::checkForSpanner):
        (WebCore::SelectionRangeData::SelectionRangeData):
        (WebCore::SelectionRangeData::set):
        (WebCore::SelectionRangeData::clear):
        (WebCore::SelectionRangeData::repaint const):
        (WebCore::SelectionRangeData::bounds const):
        (WebCore::SelectionRangeData::collectAndClear const):
        (WebCore::SelectionRangeData::apply):
        (WebCore::SelectionRangeData::isValidRendererForNewSelection const):
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot): Deleted.
        * rendering/SelectionSubtreeRoot.h:
        (WebCore::SelectionRangeData::Context::operator== const):
        (WebCore::SelectionRangeData::get const):
        (WebCore::SelectionRangeData::start const):
        (WebCore::SelectionRangeData::end const):
        (WebCore::SelectionRangeData::startPosition const):
        (WebCore::SelectionRangeData::endPosition const):
        (WebCore::SelectionSubtreeRoot::OldSelectionData::OldSelectionData): Deleted.
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData): Deleted.
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStart const): Deleted.
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartPos const): Deleted.
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEnd const): Deleted.
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos const): Deleted.
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartEndPositions const): Deleted.
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::clearSelection): Deleted.
        (WebCore::SelectionSubtreeRoot::selectionData): Deleted.
        (WebCore::SelectionSubtreeRoot::selectionData const): Deleted.
        (WebCore::SelectionSubtreeRoot::setSelectionData): Deleted.

2017-10-01  Sam Weinig  <sam@webkit.org>

        [Settings] Enums should not be passed by const reference
        https://bugs.webkit.org/show_bug.cgi?id=177727

        Reviewed by Darin Adler.

        * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
        * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
        (printGetterAndSetter):
        
            Use the new typeIsAggregate predicate to determine whether to
            use const reference or not.
        
        (includeForSetting): Deleted.

            Move includeForSetting to Settings.py with the rest of the Setting
            helpers.

        * Scripts/GenerateSettings/Settings.py:
        (mapToIDLType):
        (typeIsPrimitive):
        (typeIsAggregate):
        
            Add predicate to determine if a setting's type is an aggregate (struct or class)
            or a primitive. Remove references to size_t, which is not used.

2017-10-01  Sam Weinig  <sam@webkit.org>

        Add support for DOM aborting (https://dom.spec.whatwg.org/#aborting-ongoing-activities)
        https://bugs.webkit.org/show_bug.cgi?id=177718

        Reviewed by Darin Adler.

        Adds standalone support for AbortController and AbortSignal. No integration
        with other specs yet.

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        
            Add new files.
        
        * dom/AbortController.cpp: Added.
        * dom/AbortController.h: Added.
        * dom/AbortController.idl: Added.
        * dom/AbortSignal.cpp: Added.
        * dom/AbortSignal.h: Added.
        * dom/AbortSignal.idl: Added.
        
            Add basic support AbortController and AbortSignal.
        
        * dom/EventTargetFactory.in:
        
            Add AbortSignal to the list of EventTargets.

2017-10-01  Antti Koivisto  <antti@apple.com>

        Use WeakPtr for first-letter memory management
        https://bugs.webkit.org/show_bug.cgi?id=177716

        Reviewed by Darin Adler.

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::destroyLeftoverChildren):

            Remove first-letter special case.
            Use removeAndDestroyChild instead of calling destroy() directly. The latter should
            eventually stop calling takeChild and assert that the renderer is not in the tree.

        * rendering/RenderTextFragment.cpp:
        (WebCore::RenderTextFragment::willBeDestroyed):
        (WebCore::RenderTextFragment::setText):
        * rendering/RenderTextFragment.h:

            Use WeakPtr.

2017-10-01  Sam Weinig  <sam@webkit.org>

        XMLHttpRequest's responseXML should be annotated with [Exposed=Window]
        https://bugs.webkit.org/show_bug.cgi?id=177714

        Reviewed by Darin Adler.

        Tests: imported/w3c/web-platform-tests/XMLHttpRequest/responseType-document-in-worker.html
               imported/w3c/web-platform-tests/XMLHttpRequest/responseXML-unavailable-in-worker.html

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::responseXML):
        
            Replace returning null for non-document contexts with an assertion now
            that the bindings layer ensures this doesn't get called.
        
        (WebCore::XMLHttpRequest::setResponseType):
        
            Match the spec and turn attempts to set a responseType of 'document' in
            non-documents contexts as a no-op.
        
        * xml/XMLHttpRequest.idl:
        
            Address FIXME and annotate responseXML with [Exposed=Window] now that it
            is supported.

2017-09-30  Ryosuke Niwa  <rniwa@webkit.org>

        Don't reveal file URL when pasting an image
        https://bugs.webkit.org/show_bug.cgi?id=177710
        <rdar://problem/34757924>

        Reviewed by Wenson Hsieh.

        Fixed the bug by generalizing the code we had for drag & drop to hide string types when there is a file.

        We don't hide string types when customPasteboardDataEnabled() is false to preserve the backwards compatiblity
        with apps that are relying on being able to read files URLs in the pasteboard.

        Test: editing/pasteboard/paste-image-does-not-reveal-file-url.html

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::getData const): Pretend there is no string data when there is a file in the pasteboard
        custom pasteboard data is enabled.
        (WebCore::DataTransfer::setData): Ditto.
        (WebCore::DataTransfer::types const): Ditto.
        * dom/DataTransfer.h:
        (WebCore::DataTransfer::forDrag const): Added for when drag & drop support is disabled at compilation time.
        (WebCore::DataTransfer::forFileDrag const): Ditto.
        * platform/Pasteboard.h:
        * platform/StaticPasteboard.h:
        * platform/cocoa/PasteboardCocoa.mm:
        (WebCore::Pasteboard::containsFiles): Added.
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::containsFiles): Added.
        * platform/win/PasteboardWin.cpp:
        (WebCore::Pasteboard::containsFiles): Added.
        * platform/wpe/PasteboardWPE.cpp:
        (WebCore::Pasteboard::containsFiles): Added.
        (WebCore::Pasteboard::readFilenames): Annotated this function with notImplemented().

2017-09-30  Sam Weinig  <sam@webkit.org>

        [Settings] Replace SettingsMacros.h with a generated base class for Settings
        https://bugs.webkit.org/show_bug.cgi?id=177681

        Reviewed by Darin Adler.

        - Adds a SettingsGenerated class that Settings inherits from. The new class
          has the members and getters/setters for all the generated bindings.
        - Some default values for settings are literals in Settings.in, but rather
          constants or functions defined externally. These have all been moved to
          SettingsDefaultValues.h to allow for the script to include them all for
          SettingsGenerated.
        - Previously, a few enums were declared in Settings.h for use by Settings.
          Now that SettingsGenerated needs access, we standarize the same way that
          exists for the IDL generator; expecting the enum to be in a header of the
          same name.

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

            Add new files / generation steps.
        
        * Scripts/GenerateSettings.py:
        * Scripts/GenerateSettings/GenerateSettings.py:
        * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Added.
        * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Added.
        * Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py: Removed.
        * Scripts/GenerateSettings/Settings.py:
        
            Replace script to generate SettingsMacros.h with scripts to generate a SettingsGenerated.{h,cpp}.
        
        * accessibility/ForcedAccessibilityValue.h: Added.
        * editing/EditableLinkBehavior.h: Added.
        * editing/EditingBehavior.h:
        * editing/EditingBehaviorType.h: Copied from editing/EditingBehaviorTypes.h.
        * editing/EditingBehaviorTypes.h: Removed.
        * editing/cocoa/DataDetection.h:
        * editing/cocoa/DataDetectorTypes.h: Added.
        * page/DebugOverlayRegions.h: Added.
        * page/FrameFlattening.h: Added.
        * page/PDFImageCachingPolicy.h: Added.
        * page/TextDirectionSubmenuInclusionBehavior.h: Added.
        * page/UserInterfaceDirectionPolicy.h: Added.
        * platform/text/TextDirection.h: Added.
        * platform/text/WritingMode.h:

            Split out enums from Settings.h

        * css/MediaQueryEvaluator.cpp:

            Update for new name of ForcedAccessibilityValue.

        * html/parser/HTMLParserOptions.cpp:

            Update for new name of defaultMaximumHTMLParserDOMTreeDepth.

        * page/Settings.cpp:
        * page/Settings.h:
        
            - Move defaults to SettingsDefaultValues.h (and SettingsDefaultValuesCocoa.mm for defaultTextAutosizingEnabled).
            - Move enums to their own files.
            - Inherit from SettingsGenerated.h
        
        * page/Settings.in:
        
            - Use new 'include' option for javaScriptRuntimeFlags setting to include <runtime/RuntimeFlags.h>,
              as it doesn't fit the normal idiomatic model.
            - Replace call to defaultMinimumZoomFontSize() with direct constant access.

        * page/SettingsDefaultValues.h: Added.
        * page/cocoa/SettingsDefaultValuesCocoa.mm: Added.

            Move default values from Settings to this new file.

        * page/cocoa/SettingsCocoa.mm:
        
            Move defaultTextAutosizingEnabled() out of here and into SettingsDefaultValuesCocoa.mm.
        
        * style/StyleTreeResolver.cpp:

            - Update for new scoping of defaultMaximumRenderTreeDepth.
            - Move defaultMaximumRenderTreeDepth from Settings here. This is the only use.

        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::forcedColorsAreInvertedAccessibilityValue const):
        (WebCore::InternalSettings::setForcedColorsAreInvertedAccessibilityValue):
        (WebCore::InternalSettings::forcedDisplayIsMonochromeAccessibilityValue const):
        (WebCore::InternalSettings::setForcedDisplayIsMonochromeAccessibilityValue):
        (WebCore::InternalSettings::forcedPrefersReducedMotionAccessibilityValue const):
        (WebCore::InternalSettings::setForcedPrefersReducedMotionAccessibilityValue):
        (WebCore::settingsToInternalSettingsValue): Deleted.
        (WebCore::internalSettingsToSettingsValue): Deleted.
        * testing/InternalSettings.h:
        
            Replace duplicate definition of ForcedAccessibilityValue with a using declaration
            and simplify code now that it doesn't need to map between the two enums.

2017-09-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS WK2] API test EditorStateTests.ContentViewHasTextInContentEditableElement is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=177698

        Reviewed by Ryosuke Niwa.

        The WebKit2 API test EditorStateTests.ContentViewHasTextInContentEditableElement is currently hitting
        intermittent failures on test runners. After inserting just an image in the editable element, we would expect
        that -hasText should return NO because the text content is an empty string, but we find that -hasText is YES.
        This is because we're bailing on an early return in computeEditableRootHasContentAndPlainText because the
        EditorState's PostLayoutData contains non-zero characters near the selection, which is incorrect.

        However, upon closer inspection, this is due to a latent bug in the charactersAroundPosition helper function.
        This function attempts to compute characters before and after the current selection by initializing a Vector
        of size 3 with the relevant character data, and then sets oneAfter, oneBefore and twoBefore to the UChar32
        values in the vector. However, in the case where there are less than three characters, we end up assigning
        the uninitialized values in the vector to one or more of oneAfter, oneBefore and twoBefore, which causes the
        helper added in r222654 to bail early when it should not.

        To fix this, we initialize the values in `characters` to 0 (which is the initial value for the 3 corresponding
        members in the PostLayoutData struct). We also turn `characters` into a UChar32 array on the stack, to avoid the
        heap allocations using a Vector<UChar32>.

        No new tests; fixes a flaky API test.

        * editing/VisibleUnits.cpp:
        (WebCore::charactersAroundPosition):

2017-09-30  Antti Koivisto  <antti@apple.com>

        Add makeWeakPtr for easier WeakPtr construction
        https://bugs.webkit.org/show_bug.cgi?id=177706

        Reviewed by Sam Weinig.

        Use it in render tree.

        * loader/SubframeLoader.cpp:
        (WebCore::SubframeLoader::loadPlugin):
        * page/FrameView.cpp:
        (WebCore::FrameView::updateEmbeddedObject):
        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
        * rendering/RenderObject.h:
        (WebCore::RenderObject::weakFactory const):
        (WebCore::RenderObject::createWeakPtr): Deleted.
        * rendering/RenderView.cpp:
        (WebCore::RenderView::RepaintRegionAccumulator::RepaintRegionAccumulator):
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::setWidgetGeometry):
        (WebCore::RenderWidget::setWidget):
        (WebCore::RenderWidget::updateWidgetPosition):

2017-09-30  Ryosuke Niwa  <rniwa@webkit.org>

        Share more pasteboard code between iOS and macOS and remove dependency on Settings
        https://bugs.webkit.org/show_bug.cgi?id=177700

        Reviewed by Wenson Hsieh.

        Moved more code from PasteboardIOS.mm and PasteboardMac.mm into PasteboardCocoa.mm to share code.

        This patch also removes the layering violation inadvertently introduced in r222595 whereby which
        Pasteboard code depends on Settings. To do this, this patch splits readStringForBindings is into
        readString and readStringInCustomData and typesForBindings into typesSafeForBindings and
        typesForLegacyUnsafeBindings, and moves the logic to decide whether a given type or string is read
        off of the native pasteboard entry or our custom data entry is moved to DataTransfer.

        No new tests since there should be no behavioral change.

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::getData const): Moved the code to decide whether string is
        read off of custom data or native pasteboard from readStringForBindings.
        (WebCore::DataTransfer::types const): Ditto from typesForBindings.
        * platform/Pasteboard.cpp:
        (WebCore::Pasteboard::isSafeTypeForDOMToReadAndWrite): Moved into Pasteboard.
        * platform/Pasteboard.h:
        * platform/StaticPasteboard.cpp:
        (WebCore::StaticPasteboard::readString): Renamed from readStringForBindings.
        (WebCore::StaticPasteboard::readStringInCustomData): Added.
        (WebCore::StaticPasteboard::writeString):
        * platform/StaticPasteboard.h:
        * platform/cocoa/PasteboardCocoa.mm:
        (WebCore::Pasteboard::typesSafeForBindings): Extracted out of typesForBindings in PasteboardIOS.mm
        and PasteboardMac.mm.
        (WebCore::Pasteboard::typesForLegacyUnsafeBindings): Ditto.
        (WebCore::Pasteboard::readString): Ditto.
        (WebCore::Pasteboard::readStringInCustomData): Ditto.
        (WebCore::Pasteboard::writeCustomData): Moved here from PasteboardIOS.mm and PasteboardCocoa.mm.
        (WebCore::Pasteboard::changeCount const): Ditto.
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::typesSafeForBindings): Added.
        (WebCore::Pasteboard::typesForLegacyUnsafeBindings): Renamed from readStringForBindings.
        (WebCore::Pasteboard::readString):
        (WebCore::Pasteboard::readStringInCustomData): Added.
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::writeCustomData): Moved to PasteboardCocoa.mm.
        (WebCore::Pasteboard::changeCount const): Ditto.
        (WebCore::Pasteboard::readPlatformValueAsString): Moved into Pasteboard.
        (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType): Ditto.
        (WebCore::Pasteboard::readStringForBindings): Moved to PasteboardCocoa.mm.
        (WebCore::Pasteboard::typesForBindings): Ditto.
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::changeCount const): Moved to PasteboardCocoa.mm.
        (WebCore::Pasteboard::writeCustomData): Ditto.
        (WebCore::Pasteboard::readPlatformValueAsString): Moved into Pasteboard.
        (WebCore::Pasteboard::readStringForBindings): Moved to PasteboardCocoa.mm.
        (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType): Moved into Pasteboard.
        (WebCore::Pasteboard::typesForBindings): Moved to PasteboardCocoa.mm.
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
        * platform/win/PasteboardWin.cpp:
        (WebCore::Pasteboard::typesSafeForBindings): Added.
        (WebCore::Pasteboard::typesForLegacyUnsafeBindings): Renamed from readStringForBindings.
        (WebCore::Pasteboard::readString): Renamed from readStringForBindings.
        (WebCore::Pasteboard::readStringInCustomData): Added.
        * platform/wpe/PasteboardWPE.cpp:
        (WebCore::Pasteboard::typesSafeForBindings): Added.
        (WebCore::PasteboardtypesForLegacyUnsafeBindings): Renamed from readStringForBindings.
        (WebCore::Pasteboard::readString): Renamed from readStringForBindings.
        (WebCore::Pasteboard::readStringInCustomData): Added.

2017-09-29  Antti Koivisto  <antti@apple.com>

        Use smart pointers for creating, adding and removing renderers
        https://bugs.webkit.org/show_bug.cgi?id=177603

        Reviewed by Zalan Bujtas.

        With this patch RenderObject ownership is consistently managed using RenderPtrs. It also
        clarifies that in-tree renderers are always owned by the parent renderer.

        - renderers are constructed with createRenderer<> which returns RenderPtr
        - addChild and related functions take RenderPtrs
        - removeChild is replaced with takeChild that returns a RenderPtr
        - only addChildInternal/takeChildInternal deal with raw ownder renderer pointers.

        There are still a few exception left, noted below, to be fixed later.

        * dom/Document.cpp:
        (WebCore::Document::webkitWillEnterFullScreenForElement):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::addChildToContinuation):
        (WebCore::RenderBlock::addChild):
        (WebCore::RenderBlock::addChildIgnoringContinuation):
        (WebCore::RenderBlock::makeChildrenNonInline):
        (WebCore::RenderBlock::dropAnonymousBoxChild):
        (WebCore::RenderBlock::takeChild):
        (WebCore::RenderBlock::createAnonymousBlockWithStyleAndDisplay):
        (WebCore::RenderBlock::removeChild): Deleted.
        * rendering/RenderBlock.h:
        (WebCore::RenderBlock::createAnonymousWithParentRendererAndDisplay):
        (WebCore::RenderBlock::createAnonymousBoxWithSameTypeAs const):
        (WebCore::RenderBlock::createAnonymousBlock const):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::addChild):
        (WebCore::RenderBlockFlow::takeChild):
        (WebCore::RenderBlockFlow::removeChild): Deleted.
        * rendering/RenderBlockFlow.h:
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::splitAnonymousBoxesAroundChild):
        * rendering/RenderBox.h:
        (WebCore::RenderBox::createAnonymousBoxWithSameTypeAs const):
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::moveChildTo):
        * rendering/RenderButton.cpp:
        (WebCore::RenderButton::addChild):
        (WebCore::RenderButton::takeChild):
        (WebCore::RenderButton::setText):
        (WebCore::RenderButton::removeChild): Deleted.
        * rendering/RenderButton.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::addChild):
        (WebCore::RenderElement::takeChild):
        (WebCore::RenderElement::removeAndDestroyChild):
        (WebCore::RenderElement::destroyLeftoverChildren):

            Keep the existing behavior and leak the firstLetter renderer. The comment claims they get destroyed by RenderTextFragment.
            To be cleaned up later.

        (WebCore::RenderElement::insertChildInternal):
        (WebCore::RenderElement::takeChildInternal):
        (WebCore::RenderElement::handleDynamicFloatPositionChange):
        (WebCore::RenderElement::removeChild): Deleted.
        (WebCore::RenderElement::removeChildInternal): Deleted.
        * rendering/RenderElement.h:
        (WebCore::RenderElement::addChildIgnoringContinuation):
        * rendering/RenderFullScreen.cpp:
        (WebCore::RenderFullScreen::willBeDestroyed):
        (WebCore::RenderFullScreen::wrapNewRenderer):
        (WebCore::RenderFullScreen::wrapExistingRenderer):

            Split wrapRenderer() into two functions, wrapNewRenderer() and wrapExistingRenderer().
            The first one deals with adding new renderers to the tree while the latter mutates
            existing render tree in-place.

        (WebCore::RenderFullScreen::unwrapRenderer):
        (WebCore::RenderFullScreen::createPlaceholder):
        (WebCore::RenderFullScreen::wrapRenderer): Deleted.
        * rendering/RenderFullScreen.h:
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::addChild):
        (WebCore::RenderGrid::takeChild):
        (WebCore::RenderGrid::removeChild): Deleted.
        * rendering/RenderGrid.h:
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::addChild):
        (WebCore::RenderInline::addChildIgnoringContinuation):
        (WebCore::RenderInline::splitInlines):
        (WebCore::RenderInline::splitFlow):
        (WebCore::RenderInline::addChildToContinuation):
        (WebCore::RenderInline::childBecameNonInline):
        * rendering/RenderInline.h:
        * rendering/RenderMenuList.cpp:
        (WebCore::RenderMenuList::createInnerBlock):
        (RenderMenuList::addChild):
        (RenderMenuList::takeChild):
        (RenderMenuList::setText):
        (RenderMenuList::removeChild): Deleted.
        * rendering/RenderMenuList.h:
        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
        (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
        (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):

            Keep the existing behavior and leak the placeholder renderer.
            To be cleaned up later.

        (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):

            Keep the existing behavior and leak the placeholder renderer.
            To be cleaned up later.

        * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
        (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
        * rendering/RenderMultiColumnSpannerPlaceholder.h:
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::removeFromParentAndDestroy):
        (WebCore::RenderObject::willBeDestroyed):
        (WebCore::RenderObject::destroy):
        (WebCore::RenderObject::removeFromParent): Deleted.
        * rendering/RenderObject.h:
        * rendering/RenderQuote.cpp:
        (WebCore::RenderQuote::updateTextRenderer):
        * rendering/RenderRuby.cpp:
        (WebCore::createAnonymousRubyInlineBlock):
        (WebCore::RenderRubyAsInline::addChild):
        (WebCore::RenderRubyAsInline::takeChild):
        (WebCore::RenderRubyAsBlock::addChild):
        (WebCore::RenderRubyAsBlock::takeChild):
        (WebCore::RenderRubyAsInline::removeChild): Deleted.
        (WebCore::RenderRubyAsBlock::removeChild): Deleted.
        * rendering/RenderRuby.h:
        * rendering/RenderRubyBase.cpp:
        (WebCore::RenderRubyBase::moveInlineChildren):
        * rendering/RenderRubyRun.cpp:
        (WebCore::RenderRubyRun::rubyBaseSafe):
        (WebCore::RenderRubyRun::addChild):
        (WebCore::RenderRubyRun::takeChild):
        (WebCore::RenderRubyRun::createRubyBase const):
        (WebCore::RenderRubyRun::staticCreateRubyRun):
        (WebCore::RenderRubyRun::removeChild): Deleted.
        * rendering/RenderRubyRun.h:
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::addChild):
        (WebCore::RenderTable::createTableWithStyle):
        (WebCore::RenderTable::createAnonymousWithParentRenderer):
        * rendering/RenderTable.h:
        (WebCore::RenderTable::createAnonymousBoxWithSameTypeAs const):
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::createTableCellWithStyle):
        (WebCore::RenderTableCell::createAnonymousWithParentRenderer):
        * rendering/RenderTableCell.h:
        (WebCore::RenderTableCell::createAnonymousBoxWithSameTypeAs const):
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::addChild):
        (WebCore::RenderTableRow::createTableRowWithStyle):
        (WebCore::RenderTableRow::createAnonymousWithParentRenderer):
        * rendering/RenderTableRow.h:
        (WebCore::RenderTableRow::createAnonymousBoxWithSameTypeAs const):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::addChild):
        (WebCore::RenderTableSection::createTableSectionWithStyle):
        (WebCore::RenderTableSection::createAnonymousWithParentRenderer):
        * rendering/RenderTableSection.h:
        (WebCore::RenderTableSection::createAnonymousBoxWithSameTypeAs const):
        * rendering/mathml/RenderMathMLFenced.cpp:
        (WebCore::RenderMathMLFenced::makeFences):
        (WebCore::RenderMathMLFenced::addChild):
        * rendering/mathml/RenderMathMLFenced.h:
        * rendering/svg/RenderSVGContainer.cpp:
        (WebCore::RenderSVGContainer::addChild):
        (WebCore::RenderSVGContainer::takeChild):
        (WebCore::RenderSVGContainer::removeChild): Deleted.
        * rendering/svg/RenderSVGContainer.h:
        * rendering/svg/RenderSVGInline.cpp:
        (WebCore::RenderSVGInline::addChild):
        (WebCore::RenderSVGInline::takeChild):
        (WebCore::RenderSVGInline::removeChild): Deleted.
        * rendering/svg/RenderSVGInline.h:
        * rendering/svg/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::addChild):
        (WebCore::RenderSVGRoot::takeChild):
        (WebCore::RenderSVGRoot::removeChild): Deleted.
        * rendering/svg/RenderSVGRoot.h:
        * rendering/svg/RenderSVGText.cpp:
        (WebCore::RenderSVGText::addChild):
        (WebCore::RenderSVGText::takeChild):
        (WebCore::RenderSVGText::removeChild): Deleted.
        * rendering/svg/RenderSVGText.h:
        * style/RenderTreePosition.h:
        (WebCore::RenderTreePosition::insert):
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::createRenderer):
        (WebCore::createTextRenderer):
        * style/RenderTreeUpdaterFirstLetter.cpp:
        (WebCore::updateFirstLetterStyle):
        (WebCore::createFirstLetterRenderer):
        * style/RenderTreeUpdaterGeneratedContent.cpp:
        (WebCore::createContentRenderers):
        * style/RenderTreeUpdaterListItem.cpp:
        (WebCore::RenderTreeUpdater::ListItem::updateMarker):
        * style/RenderTreeUpdaterMultiColumn.cpp:
        (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):

2017-09-29  Zalan Bujtas  <zalan@apple.com>

        Remove redundant RenderObject::selectionRoot and dependencies
        https://bugs.webkit.org/show_bug.cgi?id=177696

        Reviewed by Ryosuke Niwa.

        There's only one selection root (RenderView).

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::selectionState):
        (WebCore::InlineTextBox::selectionStartEnd const):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::selectionRoot const): Deleted.
        (WebCore::RenderObject::selectionStartEnd const): Deleted.
        * rendering/RenderObject.h:
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::isSelected const):
        * rendering/RenderText.cpp:
        (WebCore::RenderText::collectSelectionRectsForLineBoxes):
        * rendering/RenderTextLineBoxes.cpp:
        (WebCore::RenderTextLineBoxes::setSelectionState):
        * rendering/RenderView.h:
        * rendering/SelectionSubtreeRoot.h:

2017-09-29  Chris Dumez  <cdumez@apple.com>

        http/tests/preconnect/link-rel-preconnect-https.html is flaky
        https://bugs.webkit.org/show_bug.cgi?id=177673

        Reviewed by Alex Christensen.

        No new tests, unskipped test that is now passing consistently.

        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::loadLink):
        * loader/LoaderStrategy.h:

2017-09-29  Daniel Bates  <dabates@apple.com>

        Extract logic to compute text to render into common function
        https://bugs.webkit.org/show_bug.cgi?id=177607

        Reviewed by Zalan Bujtas.

        Currently we duplicate the logic to compute the text to render
        throughout InlineTextBox. Instead we should move this common
        code into a member function. This will allow us to audit the
        the code paths that render text and ensure such code paths
        account for hyphenation and combined text, if applicable.

        Note that a TextRun does not own the text. The caller owns it.

        No functionality changed. So, no new tests.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::localSelectionRect const): Modified to
        use text() and createTextRun() to compute the text to render
        and the text run for it.
        (WebCore::InlineTextBox::paint): Ditto.
        (WebCore::InlineTextBox::paintSelection): Ditto. Additionally query
        lineStyle() for the style of the line instead of requiring it to be
        passed as an argument.
        (WebCore::InlineTextBox::paintTextSubrangeBackground): Modified
        to use text() and createTextRun() to compute the text to render
        and the text run for it.
        (WebCore::InlineTextBox::paintDocumentMarker): Ditto.
        (WebCore::InlineTextBox::offsetForPosition const): Ditto.
        (WebCore::InlineTextBox::positionForOffset const): Ditto.
        (WebCore::InlineTextBox::createTextRun const): Added; formerly named constructTextRun.
        (WebCore::InlineTextBox::text const): Added.
        (WebCore::InlineTextBox::substringToRender const): Deleted.
        (WebCore::InlineTextBox::hyphenatedStringForTextRun const): Deleted.
        (WebCore::InlineTextBox::constructTextRun const): Deleted.
        * rendering/InlineTextBox.h:
        (WebCore::InlineTextBox::substringToRender): Deleted.
        (WebCore::InlineTextBox::hyphenatedStringForTextRun): Deleted.
        (WebCore::InlineTextBox::constructTextRun): Deleted; renamed to createTextRun.

2017-09-29  Zalan Bujtas  <zalan@apple.com>

        Remove SelectionSubtreeRoot::RenderSubtreesMap
        https://bugs.webkit.org/show_bug.cgi?id=177685

        Reviewed by Andy Estes.

        This is in preparation of removing redundant SelectionSubtreeRoot.
        (Now that we removed regions, RenderView is the only selection root) 

        No change in functionality.

        * rendering/RenderView.cpp:
        (WebCore::RenderView::selectionBounds const):
        (WebCore::RenderView::subtreeSelectionBounds const):
        (WebCore::RenderView::repaintSelection const):
        (WebCore::RenderView::repaintSubtreeSelection const):
        (WebCore::RenderView::setSelection):
        (WebCore::isValidObjectForNewSelection):
        (WebCore::RenderView::clearSubtreeSelection const):
        (WebCore::RenderView::applySubtreeSelection):
        (WebCore::RenderView::updateSelectionForSubtrees): Deleted.
        * rendering/RenderView.h:
        * rendering/SelectionSubtreeRoot.h:

2017-09-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Extract a features to manage HTTP communication from ResourceHandle
        https://bugs.webkit.org/show_bug.cgi?id=175148

        Reviewed by Alex Christensen.

        * platform/Curl.cmake:
        * platform/network/curl/CurlRequest.cpp: Added.
        (WebCore::CurlRequest::CurlRequest):
        (WebCore::CurlRequest::setUserPass):
        (WebCore::CurlRequest::start):
        (WebCore::CurlRequest::startWithJobManager):
        (WebCore::CurlRequest::cancel):
        (WebCore::CurlRequest::suspend):
        (WebCore::CurlRequest::resume):
        (WebCore::CurlRequest::callDelegate):
        (WebCore::CurlRequest::setupTransfer):
        (WebCore::CurlRequest::willSetupSslCtx):
        (WebCore::CurlRequest::willSendData):
        (WebCore::CurlRequest::didReceiveHeader):
        (WebCore::CurlRequest::didReceiveData):
        (WebCore::CurlRequest::didCompleteTransfer):
        (WebCore::CurlRequest::didCancelTransfer):
        (WebCore::CurlRequest::resolveBlobReferences):
        (WebCore::CurlRequest::setupPUT):
        (WebCore::CurlRequest::setupPOST):
        (WebCore::CurlRequest::setupFormData):
        (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
        (WebCore::CurlRequest::invokeDidReceiveResponse):
        (WebCore::CurlRequest::setPaused):
        (WebCore::CurlRequest::willSetupSslCtxCallback):
        (WebCore::CurlRequest::willSendDataCallback):
        (WebCore::CurlRequest::didReceiveHeaderCallback):
        (WebCore::CurlRequest::didReceiveDataCallback):
        * platform/network/curl/CurlRequest.h: Added.
        (WebCore::CurlRequest::~CurlRequest):
        (WebCore::CurlRequest::setDelegate):
        (WebCore::CurlRequest::isSyncRequest):
        (WebCore::CurlRequest::getNetworkLoadMetrics):
        * platform/network/curl/CurlRequestDelegate.h: Added.
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::cancel):
        (WebCore::ResourceHandle::platformSetDefersLoading):
        (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
        (WebCore::ResourceHandle::receivedCredential):
        (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
        (WebCore::ResourceHandle::receivedCancellation):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
        (WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
        (WebCore::ResourceHandleCurlDelegate::start):
        (WebCore::ResourceHandleCurlDelegate::cancel):
        (WebCore::ResourceHandleCurlDelegate::setDefersLoading):
        (WebCore::ResourceHandleCurlDelegate::setAuthentication):
        (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
        (WebCore::ResourceHandleCurlDelegate::createCurlRequest):
        (WebCore::ResourceHandleCurlDelegate::cancelledOrClientless):
        (WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
        (WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
        (WebCore::ResourceHandleCurlDelegate::curlDidComplete):
        (WebCore::ResourceHandleCurlDelegate::curlDidFailWithError):
        (WebCore::ResourceHandleCurlDelegate::response):
        (WebCore::ResourceHandleCurlDelegate::getCredential):
        (WebCore::ResourceHandleCurlDelegate::retain): Deleted.
        (WebCore::ResourceHandleCurlDelegate::release): Deleted.
        (WebCore::ResourceHandleCurlDelegate::setupTransfer): Deleted.
        (WebCore::ResourceHandleCurlDelegate::didCompleteTransfer): Deleted.
        (WebCore::ResourceHandleCurlDelegate::didCancelTransfer): Deleted.
        (WebCore::ResourceHandleCurlDelegate::setupAuthentication): Deleted.
        (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders): Deleted.
        (WebCore::ResourceHandleCurlDelegate::didReceiveContentData): Deleted.
        (WebCore::ResourceHandleCurlDelegate::handleLocalReceiveResponse): Deleted.
        (WebCore::ResourceHandleCurlDelegate::prepareSendData): Deleted.
        (WebCore::ResourceHandleCurlDelegate::didFinish): Deleted.
        (WebCore::ResourceHandleCurlDelegate::didFail): Deleted.
        (WebCore::ResourceHandleCurlDelegate::setupPOST): Deleted.
        (WebCore::ResourceHandleCurlDelegate::setupPUT): Deleted.
        (WebCore::ResourceHandleCurlDelegate::getFormElementsCount): Deleted.
        (WebCore::ResourceHandleCurlDelegate::setupFormData): Deleted.
        (WebCore::ResourceHandleCurlDelegate::applyAuthentication): Deleted.
        (WebCore::ResourceHandleCurlDelegate::getNetworkLoadMetrics): Deleted.
        (WebCore::ResourceHandleCurlDelegate::willSetupSslCtx): Deleted.
        (WebCore::ResourceHandleCurlDelegate::didReceiveHeader): Deleted.
        (WebCore::ResourceHandleCurlDelegate::didReceiveData): Deleted.
        (WebCore::ResourceHandleCurlDelegate::willSendData): Deleted.
        (WebCore::ResourceHandleCurlDelegate::willSetupSslCtxCallback): Deleted.
        (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderCallback): Deleted.
        (WebCore::ResourceHandleCurlDelegate::didReceiveDataCallback): Deleted.
        (WebCore::ResourceHandleCurlDelegate::willSendDataCallback): Deleted.
        * platform/network/curl/ResourceHandleCurlDelegate.h:

2017-09-29  Chris Dumez  <cdumez@apple.com>

        Split some logic out of VisitedLinkStore and make it reusable
        https://bugs.webkit.org/show_bug.cgi?id=177575

        Reviewed by Alex Christensen.

        Rename LinkHash to SharedStringHash to make it more reusable.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/StyleResolver.cpp:
        * dom/VisitedLinkState.cpp:
        (WebCore::linkHashForElement):
        (WebCore::VisitedLinkState::invalidateStyleForLink):
        (WebCore::VisitedLinkState::determineLinkStateSlowCase):
        * dom/VisitedLinkState.h:
        * html/HTMLAnchorElement.h:
        (WebCore::HTMLAnchorElement::visitedLinkHash const):
        * loader/EmptyClients.cpp:
        * loader/HistoryController.cpp:
        (WebCore::addVisitedLink):
        * page/Page.cpp:
        (WebCore::Page::invalidateStylesForLink):
        * page/Page.h:
        * page/VisitedLinkStore.cpp:
        (WebCore::VisitedLinkStore::invalidateStylesForLink):
        * page/VisitedLinkStore.h:
        * platform/SharedStringHash.cpp: Renamed from Source/WebCore/platform/LinkHash.cpp.
        (WebCore::needsTrailingSlash):
        (WebCore::computeSharedStringHashInline):
        (WebCore::computeSharedStringHash):
        * platform/SharedStringHash.h: Renamed from Source/WebCore/platform/LinkHash.h.
        (WebCore::SharedStringHashHash::hash):
        (WebCore::SharedStringHashHash::equal):
        (WebCore::SharedStringHashHash::avoidDeletedValue):

2017-09-29  Don Olmstead  <don.olmstead@sony.com>

        [WinCairo] Fix build after rev 222610
        https://bugs.webkit.org/show_bug.cgi?id=177674

        Reviewed by Per Arne Vollan.

        No new tests. No change in behavior.

        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:

2017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Remove unused pre-iOS 11 codepaths for writing to the pasteboard
        https://bugs.webkit.org/show_bug.cgi?id=177669

        Reviewed by Tim Horton.

        Now that PlatformPasteboardIOS codepaths for writing data on drag and copy have been unified to both use
        NSItemProviders, we can remove the legacy codepath that called -setItems on UIPasteboard, since nothing uses it
        any more. No change in behavior.

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::write):
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
        (WebCore::PlatformPasteboard::allowReadingURLAtIndex const):
        (WebCore::PlatformPasteboard::readURL):
        (WebCore::richTextRepresentationsForPasteboardWebContent): Deleted.

2017-09-28  Ryosuke Niwa  <rniwa@webkit.org>

        Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
        https://bugs.webkit.org/show_bug.cgi?id=170449
        <rdar://problem/31432525>

        Reviewed by Wenson Hsieh.

        The bug was caused by image types in NSPasteboard or UIPasteboard not being treated as file items in dataTransfer.
        Because there is no Web API to get binary data out of dataTransfer unlike text data, we need to treat any image
        data as files even if they're entirely in the memory.

        This patch introduces the notion of pasteboard types to be treated as files and expose them on dataTransfer.files
        as well as dataTransfer.items of type "file". Because in-memory images are stored as TIFF in macOS and websites
        don't typically support image/tiff, we convert all such in-memory TIFF images into PNG images ourselves for
        a better web compatibility. This is done inside read(PasteboardFileReader&) in PasteboardCocoa.mm.

        Note that PasteboardFileReader cannot directly have RefPtr<File> as a member variable as code in WebCore/platform
        including Pasteboard code is not supposed to depend on WebCore types. WebCorePasteboardFileReader, a subclass of
        PasteboardFileReader was introduced to resolve this reverse dependency.

        In addition, this patch removes the restriction on dataTransfer.items that it only includes files of the supported
        MIME types. This was unwarranted since 1. we don't have any restriction on what an user can drag & drop into a web
        page via input element so there is no security benefit in this, and 2. the user should be able to copy & paste
        whatever file he/she desires regardless of the MIME type on websites like Google Drive.

        Tests: PasteImage

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * WebCore/PlatformMac.cmake:
        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::types const): Now excludes image/gif, image/png, image/jpeg, and image/tiff.
        (WebCore::DataTransfer::files const): Add fake files we create for in-memory images but only when there are no real
        files in the pasteboard since it's expensive to copy image data across UI/Web processes to create a blob URL.
        * dom/DataTransferItemList.cpp:
        (WebCore::DataTransferItemList::ensureItems const): Just expose every file type. If the user had decided to paste
        a file, it's okay for the page to access that file regardless of whether it's a zip file, JPEG image, etc...
        * editing/WebCorePasteboardFileReader.cpp:
        (WebCorePasteboardFileReader::~WebCorePasteboardFileReader):
        (WebCorePasteboardFileReader::read):
        * editing/WebCorePasteboardFileReader.h:
        (WebCorePasteboardFileReader):
        * platform/Pasteboard.cpp:
        (WebCore::PasteboardImage::PasteboardImage): Moved from platform specific translation units.
        (WebCore::PasteboardImage::~PasteboardImage): Ditto.
        * platform/Pasteboard.h:
        (PasteboardFileReader): Added.
        (* platform/StaticPasteboard.h:
        (StaticPasteboard::typesForBindings): Added.
        (StaticPasteboard::typesTreatedAsFiles): Added. Returns an empty list we don't support the web content writing image
        files into pasteboard at the moment.
        * platform/cocoa/PasteboardCocoa.mm: Added.
        (WebCore::PasteboardWebContent::PasteboardWebContent): Moved from PasteboardMac.mm and PasteboardIOS.mm.
        (WebCore::PasteboardWebContent::~PasteboardWebContent):
        (WebCore::cocoaTypeToImageType): Added.
        (WebCore::imageTypeToMIMEType): Added. Pretends to have image/png when the Cocoa type is image/tiff since most of
        websites don't support image/tiff.
        (WebCore::imageTypeToFakeFilename): Added.
        (WebCore::mimeTypeToImageType): Added.
        (WebCore::Pasteboard::shouldTreatCocoaTypeAsFile): Added. Pasteboard::typesForBindings excludes the type for which
        this function returns true.
        (WebCore::Pasteboard::typesTreatedAsFiles): Returns the list of all in-memory image types in the pasteboard.
        (WebCore::Pasteboard::read): Added. On macOS, we convert TIFF to PNG for web compatibility. We don't do this rather
        memory intensive coercion on iOS where most of apps like Photos put PNG file into the pasteboard in the first place.
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::PasteboardImage::PasteboardImage): Deleted.
        (WebCore::PasteboardImage::~PasteboardImage): Deleted.
        (WebCore::Pasteboard::read):
        (WebCore::Pasteboard::typesForBindings): Renamed from types.
        (WebCore::Pasteboard::typesTreatedAsFiles):
        * platform/ios/PasteboardIOS.mm:
        (WebCore::addHTMLClipboardTypesForCocoaType):
        (WebCore::Pasteboard::typesForBindings):
        (WebCore::PasteboardWebContent::PasteboardWebContent): Deleted.
        (WebCore::PasteboardWebContent::~PasteboardWebContent): Deleted.
        (WebCore::PasteboardImage::PasteboardImage): Deleted.
        (WebCore::PasteboardImage::~PasteboardImage): Deleted.
        (WebCore::Pasteboard::types): Deleted.
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Add "Files" to dataTransfer.types when there is an in-memory
        image type in the pasteboard.
        * platform/mac/PasteboardMac.mm:
        (WebCore::PasteboardWebContent::PasteboardWebContent): Deleted.
        (WebCore::PasteboardWebContent::~PasteboardWebContent): Deleted.
        (WebCore::PasteboardImage::PasteboardImage): Deleted.
        (WebCore::PasteboardImage::~PasteboardImage): Deleted.
        (WebCore::addHTMLClipboardTypesForCocoaType): Moved the check for the legacy NeXT plain text check here. Also add
        "Files" to dataTransfer.types when there is an in-memory image type in the pasteboard.
        (WebCore::Pasteboard::typesForBindings): Renamed from types.
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Ditto to add "Files".
        * platform/win/PasteboardWin.cpp:
        (WebCore::Pasteboard::typesForBindings): Renamed from types.
        (WebCore::Pasteboard::typesTreatedAsFiles):
        (WebCore::Pasteboard::read):
        * platform/wpe/PasteboardWPE.cpp:
        (WebCore::Pasteboard::typesForBindings): Renamed from types.
        (WebCore::Pasteboard::typesTreatedAsFiles):
        (WebCore::Pasteboard::read):

2017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS WK2] Implement -[WKContentView hasText] for compatibility with the UITextInput protocol
        https://bugs.webkit.org/show_bug.cgi?id=177662
        <rdar://problem/33410373>

        Reviewed by Tim Horton.

        Adds a new TextIterator helper function to determine whether a Range has any plain text.

        Tests: EditorStateTests.ContentViewHasTextInContentEditableElement
               EditorStateTests.ContentViewHasTextInTextarea

        * editing/TextIterator.cpp:
        (WebCore::hasAnyPlainText):

        Add a new helper to determine whether a Range contains any plain text. While inspired by and very similar to the
        plainText() helper function, this variant does not create a new string buffer when invoked, and is therefore
        more efficient for the purposes of determining whether there is any plain text at all.

        * editing/TextIterator.h:

2017-09-29  Zalan Bujtas  <zalan@apple.com>

        Add WeakPtr support to RenderObject.
        https://bugs.webkit.org/show_bug.cgi?id=177429
        <rdar://problem/34625212>

        Reviewed by Dean Jackson.

        This is in preparation to start using weak pointers extensively in rendering.

        No change in functionality.

        * loader/SubframeLoader.cpp:
        (WebCore::SubframeLoader::loadPlugin):
        * page/FrameView.cpp:
        (WebCore::FrameView::updateEmbeddedObject):
        * rendering/RenderMultiColumnFlow.cpp:
        (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
        * rendering/RenderMultiColumnSpannerPlaceholder.h:
        * rendering/RenderObject.cpp:
        * rendering/RenderObject.h:
        (WebCore::RenderObject::createWeakPtr):
        * rendering/RenderView.cpp:
        (WebCore::RenderView::RepaintRegionAccumulator::RepaintRegionAccumulator):
        (WebCore::RenderView::RepaintRegionAccumulator::~RepaintRegionAccumulator):
        * rendering/RenderView.h:
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::setWidgetGeometry):
        (WebCore::RenderWidget::setWidget):
        (WebCore::RenderWidget::updateWidgetPosition):
        * rendering/RenderWidget.h:
        (WebCore::RenderWidget::createWeakPtr): Deleted.

2017-09-29  Enrique Ocaña González  <eocanha@igalia.com>

        [GStreamer] Refactor media player to use MediaTime consistently
        https://bugs.webkit.org/show_bug.cgi?id=174817

        Reviewed by Xabier Rodriguez-Calvar.

        Make consistent use of the MediaTime class in the GStreamer media
        player implementations.

        This patch is authored by Charlie Turner <cturner@igalia.com> plus
        some minor modifications by Enrique: migration of m_cachedPosition,
        usage of m_seekTime as MediaTime in the MSE player and more logging
        using toString().

        Covered by existing tests.

        * platform/graphics/gstreamer/GStreamerUtilities.cpp:
        (WebCore::toGstUnsigned64Time): Scales MediaTime to the precision used
        by GStreamer and returns a value compatible with GstClockTime.
        (WebCore::toGstClockTime): Deleted.
        * platform/graphics/gstreamer/GStreamerUtilities.h:
        (WebCore::toGstClockTime): Inlined, now it takes MediaTime and converts
        to GstClockTime.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        Several changes to use MediaTime instead of float and to log MediaTime
        values converting them toString().
        (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
        (WebCore::MediaPlayerPrivateGStreamer::load):
        (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
        (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
        (WebCore::MediaPlayerPrivateGStreamer::currentMediaTime const):
        (WebCore::MediaPlayerPrivateGStreamer::seek): Uses MediaTime.
        (WebCore::MediaPlayerPrivateGStreamer::doSeek):
        (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
        (WebCore::MediaPlayerPrivateGStreamer::buffered const):
        (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
        (WebCore::MediaPlayerPrivateGStreamer::maxMediaTimeSeekable const):
        (WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded const):
        (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
        (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
        (WebCore::MediaPlayerPrivateGStreamer::updateStates):
        (WebCore::MediaPlayerPrivateGStreamer::didEnd):
        (WebCore::MediaPlayerPrivateGStreamer::durationChanged):
        (WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable const): Deleted.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Changed
        seek(), playBackposition(), m_cachedPosition, m_durationAtEOS,
        m_seekTime and m_timeOfOverlappingSeek to be of MediaTime type.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        Prefer the methods based on MediaTime over those based on fload/double.
        (WebCore::MediaPlayerPrivateGStreamerBase::maxTimeLoaded const):
        * platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp:
        (WebCore::GStreamerMediaSample::offsetTimestampsBy): toGstClockTime()
        now can handle MediaTime.
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
        Several changes to use MediaTime instead of float and to log MediaTime
        values converting them toString().
        (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
        (WebCore::MediaPlayerPrivateGStreamerMSE::notifySeekNeedsDataForTime):
        (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
        (WebCore::MediaPlayerPrivateGStreamerMSE::maybeFinishSeek):
        (WebCore::MediaPlayerPrivateGStreamerMSE::isTimeBuffered const):
        (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
        (WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime const):
        (WebCore::MediaPlayerPrivateGStreamerMSE::maxTimeSeekable const):
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
        seek() now takes a MediaTime argument.
        * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
        (WebCore::PlaybackPipeline::enqueueSample): Use MediaTime values in
        MediaSample.
        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
        (webKitMediaSrcQueryWithParent): Use MediaTime values in
        durationMediaTime().

2017-09-28  Sam Weinig  <sam@webkit.org>

        Re-write Settings generation in python for some reason
        https://bugs.webkit.org/show_bug.cgi?id=177621

        Reviewed by Tim Horton.

        Re-writes and splits up generation of InternalSettingsGenerated.{h|cpp|idl}
        and SettingsMacros.h in python in preparation for larger changes.

        * DerivedSources.make:
        * Scripts/GenerateSettings: Added.
        * Scripts/GenerateSettings.py: Added.
        * Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py: Added.
        * Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py: Added.
        * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py: Added.
        * Scripts/GenerateSettings/GenerateSettings.py: Added.
        * Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py: Added.
        * Scripts/GenerateSettings/Settings.py: Added.
        * Scripts/GenerateSettings/__init__.py: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * page/make_settings.pl: Removed.

2017-09-28  Don Olmstead  <don.olmstead@sony.com>

        Simplify PLATFORM ifdefs within Editor around writing selections
        https://bugs.webkit.org/show_bug.cgi?id=177624

        Reviewed by Alex Christensen.

        No new tests. No change in behavior.

        * editing/Editor.cpp:
        (WebCore::Editor::performCutOrCopy):
        (WebCore::Editor::copyImage):
        * editing/Editor.h:

2017-09-28  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [ATK] object:state-changed notifications missing for multiple ARIA attributes
        https://bugs.webkit.org/show_bug.cgi?id=177542

        Add new notification types to AXObjectCache in order to support the notifications
        needed, post the notifications to all platforms, emit the signals for ATK.

        Reviewed by Chris Fleizach.

        Tests: accessibility/gtk/aria-disabled-changed-notification.html
               accessibility/gtk/aria-expanded-changed-notification.html
               accessibility/gtk/aria-pressed-changed-notification.html
               accessibility/gtk/aria-readonly-changed-notification.html
               accessibility/gtk/aria-required-changed-notification.html

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::handleAttributeChanged):
        * accessibility/AXObjectCache.h:
        * accessibility/atk/AXObjectCacheAtk.cpp:
        (WebCore::AXObjectCache::postPlatformNotification):

2017-09-28  Daniel Bates  <dabates@apple.com>

        Remove TextRun::setCharactersLength() and TextRun::charactersLength()
        https://bugs.webkit.org/show_bug.cgi?id=177620

        Reviewed by Zalan Bujtas.

        The purpose of TextRun::setCharactersLength() and TextRun::charactersLength() predate the
        use of WidthIterator to safely iterate over characters in a TextRun that may contain
        surrogate halves due to how it was created (without thought of surrogate pairs). Historically
        TextRun::charactersLength() complemented TextRun::length() and represented the length of the
        text to render ignoring and respecting truncation, respectively. We not longer need either
        of these member functions with the advent of WidthIterator.

        No functionality changed. So, no new tests.

        * platform/graphics/ComplexTextController.cpp:
        (WebCore::TextLayout::constructTextRun):
        * platform/graphics/TextRun.cpp: Remove one unsigned field from ExpectedTextRunSize as we
        reduced the size of TextRun with the removal of TextRun::m_charactersLength.
        * platform/graphics/TextRun.h:
        (WebCore::TextRun::TextRun):
        (WebCore::TextRun::charactersLength const): Deleted.
        (WebCore::TextRun::setCharactersLength): Deleted.
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::constructTextRun const):
        * rendering/InlineTextBox.h:
        (WebCore::InlineTextBox::constructTextRun): Deleted overload that took const RenderStyle& style
        and StringView.
        * rendering/RenderText.cpp:
        (WebCore::RenderText::widthFromCache const):
        (WebCore::maxWordFragmentWidth):
        (WebCore::RenderText::computePreferredLogicalWidths):
        (WebCore::RenderText::width const):
        * rendering/line/BreakingContext.h:
        (WebCore::textWidth):
        (WebCore::tryHyphenating):
        * rendering/svg/SVGInlineTextBox.cpp:
        (WebCore::SVGInlineTextBox::constructTextRun const):
        * rendering/svg/SVGTextMetrics.cpp:
        (WebCore::SVGTextMetrics::constructTextRun):
        * rendering/svg/SVGTextMetricsBuilder.cpp:
        (WebCore::SVGTextMetricsBuilder::currentCharacterStartsSurrogatePair const): Use TextRun::length().
        (WebCore::SVGTextMetricsBuilder::advance): Ditto.

2017-09-28  Tim Horton  <timothy_horton@apple.com>

        Remove constant() in favor of env()
        https://bugs.webkit.org/show_bug.cgi?id=177581
        <rdar://problem/34701321>

        Reviewed by Dean Jackson.

        No new tests, removing a feature.

        * css/CSSValueKeywords.in:
        * css/CSSVariableData.cpp:
        (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
        (WebCore::CSSVariableData::resolveTokenRange const):
        * css/parser/CSSVariableParser.cpp:
        (WebCore::classifyBlock):

2017-09-28  Brent Fulgham  <bfulgham@apple.com>

        Add ports 6679 and 6697 (IRC SSL) to port blacklist
        https://bugs.webkit.org/show_bug.cgi?id=177544
        <rdar://problem/34666525>

        Reviewed by Alex Christensen.

        Test: security/block-test.html

        * platform/URL.cpp:
        (WebCore::portAllowed): Also block port 6679.

2017-09-28  Chris Dumez  <cdumez@apple.com>

        Unreviewed, speculative Windows build fix after r222613.

        * dom/StringCallback.idl:

2017-09-28  Zalan Bujtas  <zalan@apple.com>

        Small cleanup in RenderMenuList::didUpdateActiveOption
        https://bugs.webkit.org/show_bug.cgi?id=177610

        Reviewed by Dean Jackson.

        No change in functionality.

        * rendering/RenderMenuList.cpp:
        (WebCore::RenderMenuList::RenderMenuList):
        (RenderMenuList::didUpdateActiveOption):
        * rendering/RenderMenuList.h:

2017-09-28  Ross Kirsling  <ross.kirsling@sony.com>

        [PAL] Move HysteresisActivity into PAL
        https://bugs.webkit.org/show_bug.cgi?id=177516

        Reviewed by Alex Christensen.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/UserActivity.cpp:
        (WebCore::UserActivity::UserActivity):
        (WebCore::UserActivity::hysteresisUpdated):
        * platform/UserActivity.h:
        * platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp:
        (WebCore::BackingStoreBackendCairoImpl::BackingStoreBackendCairoImpl):
        * platform/graphics/cairo/BackingStoreBackendCairoImpl.h:
        * platform/ios/WebSQLiteDatabaseTrackerClient.h:
        * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
        (WebCore::WebSQLiteDatabaseTrackerClient::WebSQLiteDatabaseTrackerClient):
        (WebCore::WebSQLiteDatabaseTrackerClient::hysteresisUpdated):

2017-09-28  Chris Dumez  <cdumez@apple.com>

        Add support for <link rel=preconnect>
        https://bugs.webkit.org/show_bug.cgi?id=177474
        <rdar://problem/33141380>

        Reviewed by Alex Christensen.

        Add support for <link rel=preconnect>:
        - https://w3c.github.io/resource-hints/#preconnect

        It is currently only enabled for WK2 on MacOS High Sierra+
        and iOS 11+.

        Tests: fast/dom/HTMLLinkElement/preconnect-support.html
               http/tests/preconnect/link-rel-preconnect-http.html
               http/tests/preconnect/link-rel-preconnect-https.html

        * bindings/js/JSDOMExceptionHandling.h:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateCallbackHeaderContent):
        * bindings/scripts/IDLAttributes.json:
        * dom/Document.cpp:
        (WebCore::Document::addConsoleMessage):
        (WebCore::Document::setConsoleMessageListener):
        * dom/Document.h:
        * dom/StringCallback.idl:
        * html/DOMTokenList.cpp:
        (WebCore::DOMTokenList::DOMTokenList):
        (WebCore::DOMTokenList::supports):
        * html/DOMTokenList.h:
        (WebCore::DOMTokenList::DOMTokenList):
        * html/HTMLAnchorElement.cpp:
        (WebCore::HTMLAnchorElement::relList):
        * html/HTMLIFrameElement.cpp:
        (WebCore::HTMLIFrameElement::sandbox):
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::parseAttribute):
        (WebCore::HTMLLinkElement::relList):
        * html/LinkRelAttribute.cpp:
        (WebCore::LinkRelAttribute::LinkRelAttribute):
        (WebCore::LinkRelAttribute::isSupported):
        * html/LinkRelAttribute.h:
        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::loadLinksFromHeader):
        (WebCore::LinkLoader::loadLink):
        * loader/LoaderStrategy.h:
        * page/Settings.in:
        * testing/Internals.cpp:
        (WebCore::Internals::Internals):
        (WebCore::Internals::setConsoleMessageListener):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-09-28  Zalan Bujtas  <zalan@apple.com>

        AX: Defer RenderListBox selectionChanged event until after layout is done.
        https://bugs.webkit.org/show_bug.cgi?id=177589
        <rdar://problem/34705785>

        Reviewed by Chris Fleizach.

        Defer AX update when the selection changed event is followed by a layout.

        Covered by existing tests.

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::remove):
        (WebCore::AXObjectCache::performDeferredCacheUpdate):
        (WebCore::AXObjectCache::deferSelectedChildrenChangedIfNeeded):
        * accessibility/AXObjectCache.h:
        (WebCore::AXObjectCache::deferSelectedChildrenChangedIfNeeded):
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::selectionChanged):

2017-09-28  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Remove the cairo_glyph_t complexity from GlyphBuffer
        https://bugs.webkit.org/show_bug.cgi?id=177598

        Reviewed by Carlos Garcia Campos.

        Remove the decade-old use of cairo_glyph_t as the underlying type for
        Glyph. The former spans 24 bytes in size, while the latte is just 2
        bytes. The x and y coordinate attributes of cairo_glyph_t were only
        used in FontCascade::drawGlyphs() implementation, where they were
        overridden even if the same GlyphBuffer object was used here repeatedly.

        FontCascade::drawGlyphs() now creates a new Vector<cairo_glyph_t> object
        and fills it only with the glyph index and coordinates data for glyphs
        that will actually be drawn. This will likely in the future be leveraged
        to pack the necessary data and perform the drawing operations in
        parallelized tasks. GlyphBuffer usages that before required USE(CAIRO)
        special-casing can now be simplified.

        This also removes the need for <cairo.h> header inclusion in the
        GlyphBuffer.h header. This further removes Cairo header inclusion in
        roughly 600 build targets.

        No new tests -- no change in behavior.

        * platform/graphics/FontCascade.cpp:
        (WebCore::FontCascade::widthForSimpleText const):
        * platform/graphics/GlyphBuffer.h:
        (WebCore::GlyphBuffer::glyphAt const):
        (WebCore::GlyphBuffer::add):
        * platform/graphics/cairo/FontCairo.cpp:
        (WebCore::drawGlyphsToContext):
        (WebCore::drawGlyphsShadow):
        (WebCore::FontCascade::drawGlyphs):
        * platform/graphics/displaylists/DisplayListItems.cpp:
        (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const):

2017-09-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, rolling out r222606.

        The debug assertion hit in these API tests should be fixed by
        r222608.

        Reverted changeset:

        "REGRESSION(r222595): Assertion failure in
        _preLoadedDataConformingToType"
        https://bugs.webkit.org/show_bug.cgi?id=177599
        http://trac.webkit.org/changeset/222606

2017-09-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS WK2] DataTransfer DataInteractionTests debug assert under -_preLoadedDataConformingToType:forItemProviderAtIndex:
        https://bugs.webkit.org/show_bug.cgi?id=177594

        Reviewed by Tim Horton.

        Currently, some API tests added in r222595 currently hit debug assertions under -preloadedDataConformingToType:
        forItemProviderAtIndex:. This is because the page may call DataTransfer.types, which now calls into
        PlatformPasteboard::typesSafeForDOMToReadAndWrite(). This calls on the AbstractPasteboard (either the
        UIPasteboard or WebItemProviderPasteboard, in the case of drag and drop) to fetch the custom WebKit pasteboard
        data blob, if it exists. For WebItemProviderPasteboard, this ends up calling into -[WebItemProviderPasteboard
        _preLoadedDataConformingToType:forItemProviderAtIndex:], which was previously only called after loading data off
        of the item providers. There's an existing sanity check in this preloaded data helper to make sure that the
        number of load results is equal to the number of item providers loaded from, but this sanity check only makes
        sense *after* the drop has happened, not before, since we should only attempt to read dropped data after any
        data at all has been dropped.

        We need to check whether or not this custom data blob exists in PlatformPasteboard::typesSafeForDOMToReadAndWrite
        to fetch the list of DOM-exposed types to propagate back to the page. So to fix this, we make the helper methods
        for fetching dropped data (-dataForPasteboardType:inItemSet: and -valuesForPasteboardType:inItemSet:) fail
        gracefully when invoked prior to drop, when PlatformPasteboard::typesSafeForDOMToReadAndWrite is invoked.

        No new tests; fixes iOS drag and drop API tests that currently hit this debug assertion.

        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
        (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):

2017-09-28  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r222595): Assertion failure in _preLoadedDataConformingToType
        https://bugs.webkit.org/show_bug.cgi?id=177599

        Temporarily remove the debug assertion to make API tests not crash since the relevant API tests are passing.

        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):

2017-09-27  Fujii Hironori  <Hironori.Fujii@sony.com>

        [REGRESSION] word-spacing property is incorrectly applied
        https://bugs.webkit.org/show_bug.cgi?id=142086
        <rdar://problem/19985240>

        Reviewed by Zalan Bujtas.

        word-spacing property isn't applied to text nodes with starting
        with '\n' if the kerning enabled. In Bug 165796, only ' ' and '\t'
        are treated for word-spacing, but '\n'. It should be treated as
        well.

        Test: fast/text/word-space-between-inlines.html

        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::setLogicalWidthForTextRun): Use
        FontCascade::treatAsSpace() instead of checking explicitly by
        comparing with ' ' and '\t'.

2017-09-27  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Remove unnecessary cairo.h includes
        https://bugs.webkit.org/show_bug.cgi?id=177540

        Reviewed by Carlos Garcia Campos.

        Drop unnecessary includes of the cairo.h header from the Font.h,
        FontPlatformData.h and Pattern.h headers. For the former two the
        header isn't required, while in the last one we can use a forward
        declaration for the cairo_pattern_t type instead of including
        the whole Cairo headers to have that available.

        * platform/graphics/Font.h:
        * platform/graphics/FontPlatformData.h:
        * platform/graphics/Pattern.h:

2017-09-27  Zan Dobersek  <zdobersek@igalia.com>

        [Cairo] Drop cairo_matrix_t conversion operators for AffineTransform, TransformationMatrix
        https://bugs.webkit.org/show_bug.cgi?id=177539

        Reviewed by Carlos Garcia Campos.

        Remove the cairo_matrix_t conversion operators from the AffineTransform
        and TransformationMatrix classes. These are rarely used, but enforce
        including the cairo.h header in both headers, which leads to the Cairo
        headers being included in around 800 build targets.

        Instead, the toCairoMatrix() function is added to CairoUtilities.h that
        creates a cairo_matrix_t object for the given AffineTransform. No
        toCairoMatrix() is needed for TransformationMatrix since objects of
        that type aren't converted to cairo_matrix_t anywhere in the codebase.

        This patch excludes unnecessary Cairo headers from about 550 build
        targets (with those headers being included in the other affected 250
        targets by some other header inclusion chain). CairoUtilities.h header
        is now included where necessary to make toCairoMatrix() available, and
        duplicated cairo.h inclusions are removed.

        No new tests -- no change in behavior.

        * editing/gtk/EditorGtk.cpp: Explicitly include <cairo.h> since it's
        necessary for Cairo operations used there.
        * platform/Cairo.cmake:
        * platform/graphics/cairo/CairoUtilities.cpp:
        (WebCore::drawPatternToCairoContext):
        (WebCore::toCairoMatrix):
        * platform/graphics/cairo/CairoUtilities.h:
        * platform/graphics/cairo/GradientCairo.cpp:
        (WebCore::Gradient::platformGradient):
        (WebCore::Gradient::setPlatformGradientSpaceTransform):
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::concatCTM):
        (WebCore::GraphicsContext::setCTM):
        * platform/graphics/cairo/PathCairo.cpp: No need to include AffineTransform.h.
        (WebCore::Path::addPath):
        (WebCore::Path::transform):
        * platform/graphics/cairo/PatternCairo.cpp: Ditto.
        (WebCore::Pattern::createPlatformPattern const):
        * platform/graphics/cairo/TransformationMatrixCairo.cpp: Removed.
        * platform/graphics/transforms/AffineTransform.h:
        * platform/graphics/transforms/TransformationMatrix.h:

2017-09-27  Alex Christensen  <achristensen@webkit.org>

        Add WKContentRuleList notify action type
        https://bugs.webkit.org/show_bug.cgi?id=177013
        <rdar://problem/31073936>

        Reviewed by Darin Adler.

        Covered by new API tests.

        * contentextensions/ContentExtensionActions.h:
        (WebCore::ContentExtensions::hasStringArgument):
        * contentextensions/ContentExtensionCompiler.cpp:
        (WebCore::ContentExtensions::resolvePendingDisplayNoneActions):
        (WebCore::ContentExtensions::serializeActions):
        * contentextensions/ContentExtensionError.cpp:
        (WebCore::ContentExtensions::contentExtensionErrorCategory):
        * contentextensions/ContentExtensionError.h:
        * contentextensions/ContentExtensionParser.cpp:
        (WebCore::ContentExtensions::loadAction):
        * contentextensions/ContentExtensionRule.cpp:
        (WebCore::ContentExtensions::Action::deserialize):
        (WebCore::ContentExtensions::Action::deserializeType):
        (WebCore::ContentExtensions::Action::serializedLength):
        * contentextensions/ContentExtensionRule.h:
        (WebCore::ContentExtensions::Action::Action):
        * contentextensions/ContentExtensionsBackend.cpp:
        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad):
        (WebCore::ContentExtensions::applyBlockedStatusToRequest):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadResourceSynchronously):
        * loader/PingLoader.cpp:
        (WebCore::processContentExtensionRulesForLoad):
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::willSendRequestInternal):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestResource):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::applyBlockedStatus):
        * loader/cache/CachedResourceRequest.h:
        * page/ChromeClient.h:

2017-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the internal build after r222596 and r222595.

        Guarding code in PlatformPasteboardIOS.mm TARGET_OS_IPHONE did not have the intended effect.

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

2017-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the internal build after r222595.

        Add missing iOS compiler guards.

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

2017-09-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        Drag event DataTransfer has unexpected types "dyn.ah62d4..."
        https://bugs.webkit.org/show_bug.cgi?id=172526
        <rdar://problem/32396081>

        Reviewed by Ryosuke Niwa.

        Currently, the pasteboard types we expose to web content are simply the types that appear on the platform
        pasteboard (i.e. the general NSPasteboard on Mac, and either the general UIPasteboard or a UIDragSession's
        NSItemProviders on iOS). This leads to DataTransfer.types exposing many private pasteboard types written by apps
        around the system to the page, such as dynamic UTIs, CorePasteboardFlavorTypes, or the "Apple WebKit dummy
        pasteboard type". These are not only confusing and not useful for web content (since they mostly hold values of
        empty string anyways), but can additionally pose privacy concerns by exposing information meant only for native
        applications to unvetted web content.

        To address this problem, other browsers (e.g. Chrome and Firefox on Mac) white-list MIME types in DataTransfer's
        list of types. By default, when dragging or copying, these are "text/plain", "text/html" and "text/uri-list".
        However, this policy alone is insufficient, because the page may also supply its own types, in which case our
        naive whitelist would prevent us from delivering them to the page. To address this additional constraint, both
        Chrome and Firefox write any custom data supplied by the page to custom pasteboard UTIs
        (org.chromium.drag-dummy-type and org.mozilla.custom-clipdata, respectively). The corresponding data is a map
        of custom UTI => custom data supplied by the page; upon drop or paste, this mapping is consulted if the page
        calls getData() with a custom UTI.

        This patch adopts this same approach in WebKit, and introduces the com.apple.WebKit.custom-pasteboard-data UTI
        (refer to per-method comments below for more information). These changes are covered by 18 new layout and API
        tests, as well as existing drag-and-drop tests.

        Tests: editing/pasteboard/data-transfer-get-data-on-drop-custom.html
               editing/pasteboard/data-transfer-get-data-on-drop-plain-text.html
               editing/pasteboard/data-transfer-get-data-on-drop-rich-text.html
               editing/pasteboard/data-transfer-get-data-on-drop-url.html
               editing/pasteboard/data-transfer-get-data-on-paste-custom.html
               editing/pasteboard/data-transfer-get-data-on-paste-plain-text.html
               editing/pasteboard/data-transfer-get-data-on-paste-rich-text.html
               DataInteractionTests.DataTransferGetDataWhenDroppingPlainText
               DataInteractionTests.DataTransferGetDataWhenDroppingCustomData
               DataInteractionTests.DataTransferGetDataWhenDroppingURL
               DataInteractionTests.DataTransferGetDataWhenDroppingImageWithFileURL
               DataInteractionTests.DataTransferGetDataWhenDroppingRespectsPresentationStyle
               DataInteractionTests.DataTransferSetDataCannotWritePlatformTypes
               DataInteractionTests.DataTransferGetDataCannotReadPrivatePlatformTypes
               UIPasteboardTests.DataTransferGetDataWhenPastingURL
               UIPasteboardTests.DataTransferGetDataWhenPastingPlatformRepresentations
               UIPasteboardTests.DataTransferSetDataCannotWritePlatformTypes
               UIPasteboardTests.DataTransferGetDataCannotReadPrivatePlatformTypes

        * CMakeLists.txt:

        Add Pasteboard.cpp to the WebCore CMakeList.

        * WebCore.xcodeproj/project.pbxproj:
        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::getData const):
        (WebCore::DataTransfer::createForDragStartEvent):

        Make a new static helper function to create a StaticPasteboard-backed DataTransfer when dispatching a dragstart
        event. Any data supplied by the page will be written to the static pasteboard of this DataTransfer.

        (WebCore::DataTransfer::moveDragState):

        Add a new helper on DataTransfer to transfer the data required to initiate a drag from one DataTransfer to
        another. This is used in EventHandler to transfer the contents of the temporary DataTransfer modified by the
        page during the dragstart event over to the DataTransfer used for the rest of the drag initiation codepath,
        which is actually connected to the platform. This includes committing the contents of the other
        DataTransfer's StaticPasteboard to the new platform-connected Pasteboard.

        (WebCore::DataTransfer::hasDragImage const):
        * dom/DataTransfer.h:
        * editing/cocoa/EditorCocoa.mm:
        (WebCore::Editor::selectionInHTMLFormat):
        (WebCore::Editor::writeSelectionToPasteboard):
        (WebCore::Editor::writeSelection):

        Write an additional HTML markup string on iOS. We already do this for Mac, but this data previously had no use
        on iOS. This is needed for to vend the "text/html" representation to the page on iOS when pasting.

        * editing/mac/EditorMac.mm:
        (WebCore::Editor::selectionInHTMLFormat): Deleted.
        * editing/wpe/EditorWPE.cpp:
        (WebCore::createFragmentFromPasteboardData):
        * page/EventHandler.cpp:
        (WebCore::EventHandler::dispatchDragStartEventOnSourceElement):

        Renamed from dispatchDragStartEvent to dispatchDragStartEventOnSourceElement. Additionally, simplified the logic
        significantly, so that we now just check to see if the StaticPasteboard exposed to the page has any data,
        instead of using platform-dependent logic to compare changeCounts. We can do this because StaticPasteboard is
        guaranteed to only contain content that the page has supplied during the dragstart event, since it is empty
        upon initialization and cannot be written to by the rest of the platform.

        (WebCore::EventHandler::handleDrag):

        Tweak dispatchDragStartEvent to take a DataTransfer to expose to bindings; at the call site in handleDrag,
        create a new DataTransfer backed by a StaticPasteboard that the page may mutate over the course of the dragstart
        event. After dispatching to the page, move the dragging information present on the drag start DataTransfer over
        to the DragState's DataTransfer. If the drag image has not been set, compute and set the default drag image
        element on the DragState's DataTransfer.

        (WebCore::EventHandler::dispatchDragStartEvent): Deleted.
        * page/EventHandler.h:
        * page/Settings.cpp:
        (WebCore::Settings::customPasteboardDataEnabled):
        * page/Settings.h:
        (WebCore::Settings::setCustomPasteboardDataEnabled):
        * page/ios/EventHandlerIOS.mm:
        (WebCore::EventHandler::createDraggingDataTransfer const): Deleted.
        * page/mac/EventHandlerMac.mm:
        (WebCore::EventHandler::createDraggingDataTransfer const): Deleted.
        * page/win/EventHandlerWin.cpp:
        (WebCore::EventHandler::createDraggingDataTransfer const): Deleted.

        Remove this helper on both iOS and Mac. This only called createForDrag() before, with the addition of clearing
        the platform pasteboard prior to returning. Now that a StaticPasteboard is used when starting a drag, we clear
        out the platform pasteboard in platform-invariant code in EventHandler::handleDrag, so these helpers are no
        longer useful.

        * platform/Pasteboard.cpp: Added.
        (WebCore::isSafeTypeForDOMToReadAndWrite):

        Add a new helper to determine whether or not a pasteboard type is one of the standard DOM-exposed types. These
        are "text/plain", "text/html" and "text/uri-list".

        (WebCore::sharedBufferFromCustomData):
        (WebCore::customDataFromSharedBuffer):

        Add helper methods to serialize and deserialize custom data. The serialized data blob consists of: (1)
        versioning information, (2) a dictionary mapping each custom type to a value, and (3) a full list of types
        written by the page, in the order they were written.

        * platform/Pasteboard.h:

        Rename Pasteboard::readString to Pasteboard::readStringForBindings, to reflect that the string being read and
        the given type are exposed to and from the DOM.

        * platform/PasteboardStrategy.h:
        * platform/PasteboardWriterData.h:
        * platform/PlatformPasteboard.h:
        * platform/StaticPasteboard.cpp:

        Split m_stringContents out into m_platformData and m_customData. The former contains type-to-data entries for
        the DOM-exposed types, while the second contains entries that don't belong in the former.

        (WebCore::StaticPasteboard::hasData):
        (WebCore::StaticPasteboard::readStringForBindings):
        (WebCore::StaticPasteboard::writeString):
        (WebCore::StaticPasteboard::clear):
        (WebCore::StaticPasteboard::commitToPasteboard):

        Rather than propagate each entry to the client layer one at a time, populate a new PasteboardCustomData struct
        and send it to the client layer in one go. This new struct consists of an array of types in the order they were
        written by the page, a dictionary of public types (types we want to write directly to the platform pasteboard)
        and private types (custom types we want to package under our custom data blob).

        (WebCore::StaticPasteboard::readString): Deleted.
        * platform/StaticPasteboard.h:
        * platform/glib/EventHandlerGLib.cpp:
        (WebCore::EventHandler::createDraggingDataTransfer const): Deleted.
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::readStringForBindings):
        (WebCore::Pasteboard::writeCustomData):
        (WebCore::Pasteboard::readString): Deleted.
        * platform/gtk/PlatformPasteboardGtk.cpp:
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
        (WebCore::PlatformPasteboard::write):

        Add stub implementations for new custom pasteboard data methods.

        * platform/ios/AbstractPasteboard.h:
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::writeCustomData):

        Add new plumbing to ship a custom data (PasteboardCustomData) struct from WebCore to the client layer.

        (WebCore::cocoaTypeFromHTMLClipboardType):
        (WebCore::readPlatformValueAsString):
        (WebCore::Pasteboard::readStringForBindings):
        (WebCore::Pasteboard::types):

        Rewritten to ask the client layer for DOM-exposed types rather than all types, in the case where custom
        pasteboard data is enabled in Settings.

        (WebCore::Pasteboard::readString): Deleted.
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::bufferForType):
        (WebCore::PlatformPasteboard::getPathnamesForType const):
        (WebCore::PlatformPasteboard::numberOfFiles const):
        (WebCore::PlatformPasteboard::platformPasteboardTypeForSafeTypeForDOMToReadAndWrite):

        Add a new helper to map DOM-safe pasteboard types to their platform counterparts.

        (WebCore::PlatformPasteboard::write):
        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):

        Add a new helper to map platform pasteboard types to their DOM-safe counterparts.

        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):

        Fetch a list of DOM-exposed types. On iOS, for drag and drop, we have the additional constraint of not being
        able to read any data before the drop happens. This is problematic, since the page needs to know the list of
        types during 'dragover' events. To support this, we instead keep the array of types in the teamData property of
        the generated item provider, which is immediately available, even when dragging across different apps. Note that
        we still need to check if the pasteboard contains the full custom data blob here to handle the case where we
        copy on Mac and perform a continuity paste on iOS, since teamData does not exist on Mac.

        (WebCore::PlatformPasteboard::readString):

        Tweak to account for how UIPasteboard may return data blobs when reading values.

        (WebCore::PlatformPasteboard::getPathnamesForType): Deleted.
        (WebCore::PlatformPasteboard::numberOfFiles): Deleted.
        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderRegistrationInfoList itemProvider]):
        (+[WebItemProviderLoadResult loadResultWithItemProvider:typesToLoad:]):
        (-[WebItemProviderLoadResult initWithItemProvider:typesToLoad:]):
        (-[WebItemProviderLoadResult typesToLoad]):
        (-[WebItemProviderLoadResult setFileURL:forType:]):
        (-[WebItemProviderLoadResult itemProvider]):
        (-[WebItemProviderPasteboard setItemProviders:]):
        (-[WebItemProviderPasteboard dataForPasteboardType:]):
        (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]):
        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
        (+[WebItemProviderLoadResult emptyLoadResult]): Deleted.
        (+[WebItemProviderLoadResult loadResultWithFileURLMap:presentationStyle:]): Deleted.
        (-[WebItemProviderLoadResult initWithFileURLMap:presentationStyle:]): Deleted.
        (-[WebItemProviderPasteboard typeIdentifierToLoadForRegisteredTypeIdentfiers:]): Deleted.

        In the case of drag and drop on iOS, we cannot load any data prior to performing the drop; additionally, any
        attempts to load data immediately after the drop is performed in the UI process will fail. This means any and
        all data that the web process may require in the future when handling the drop must be loaded out of the item
        providers and saved when the drop is being handled in the UI process.

        Currently, we only load the highest fidelity type we can handle (or, if we don't know what we can handle, we
        select the highest fidelity representation conforming to "public.content"). This is a problematic for supporting
        DataTransfer.getData() on drop on iOS, because the page can ask for any of the three web-exposed types. To
        address this, we refactor WebItemProviderPasteboard to support loading multiple representations per item being
        dropped. At minimum, we will load anything conforming to "public.html", "public.plain-text", "public.url", and
        the new "com.apple.WebKit.custom-pasteboard-data" so we have means to answer any question that the page could
        ask via DataTransfer.getData(). We additonally load the highest fidelity supported (or content-conformant) type,
        if it has not already been loaded as a result of the former.

        To make this possible, we refactor WebItemProviderLoadResult to take an item provider and a list of types to
        load. -doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout: then creates a list of load results and
        uses each one to represent the results of loading data from its item provider (i.e. a map of UTI => file URL).

        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::writeCustomData):
        (WebCore::cocoaTypeFromHTMLClipboardType):
        (WebCore::readPlatformValueAsString):
        (WebCore::Pasteboard::readStringForBindings):

        Change readStringForBindings (formerly, readString) so that if support for custom pasteboard data is enabled,
        we only allow reading directly from the platform pasteboard if the given type is DOM-safe; otherwise, we consult
        the custom data blob, if it exists. Otherwise, if support for custom pasteboard data is disabled, we fall back
        to our current behavior.

        (WebCore::Pasteboard::types):
        (WebCore::Pasteboard::readString): Deleted.
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::PlatformPasteboard::numberOfFiles const):
        (WebCore::PlatformPasteboard::getPathnamesForType const):
        (WebCore::PlatformPasteboard::stringForType):
        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):

        Add support for reading DOM-exposed types and fetching DOM-exposed data off of the pasteboard. The overall idea
        here is similar to iOS, though implementation details vary (e.g. no item provider support).

        (WebCore::PlatformPasteboard::write):
        (WebCore::PlatformPasteboard::platformPasteboardTypeForSafeTypeForDOMToReadAndWrite):
        (WebCore::PlatformPasteboard::numberOfFiles): Deleted.
        (WebCore::PlatformPasteboard::getPathnamesForType): Deleted.
        * platform/win/PasteboardWin.cpp:
        (WebCore::Pasteboard::readStringForBindings):
        (WebCore::Pasteboard::writeCustomData):
        (WebCore::Pasteboard::readString): Deleted.
        * platform/wpe/PasteboardWPE.cpp:
        (WebCore::Pasteboard::readStringForBindings):
        (WebCore::Pasteboard::writeCustomData):
        (WebCore::Pasteboard::readString): Deleted.
        * platform/wpe/PlatformPasteboardWPE.cpp:
        (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
        (WebCore::PlatformPasteboard::write):
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::Backup::Backup):
        (WebCore::InternalSettings::Backup::restoreTo):
        (WebCore::InternalSettings::setCustomPasteboardDataEnabled):

        Add a new internal settings hook for layout tests to opt in to using custom pasteboard data. By default, custom
        pasteboard data is enabled only in Safari, or on applications linked on or after certain releases of iOS and
        macOS.

        * testing/InternalSettings.h:
        * testing/InternalSettings.idl:

2017-09-27  Zalan Bujtas  <zalan@apple.com>

        Deferred image size change makes image-load-on-delay.html flaky.
        https://bugs.webkit.org/show_bug.cgi?id=177520
        <rdar://problem/34674299>

        Reviewed by Dean Jackson.

        Only defer recomputeIsIgnored when the image change actually triggers layout. 

        * accessibility/AXObjectCache.cpp:
        (WebCore::rendererNeedsDeferredUpdate):
        (WebCore::AXObjectCache::deferRecomputeIsIgnoredIfNeeded):
        (WebCore::AXObjectCache::deferTextChangedIfNeeded):
        * accessibility/AXObjectCache.h:
        (WebCore::AXObjectCache::deferRecomputeIsIgnoredIfNeeded):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::imageChanged):

2017-09-27  Tim Horton  <timothy_horton@apple.com>

        Try to fix the Mac CMake build

        * PlatformMac.cmake:

2017-09-27  Myles C. Maxfield  <mmaxfield@apple.com>

        Minimum font size may cause elements to have an infinite line-height
        https://bugs.webkit.org/show_bug.cgi?id=177573
        <rdar://problem/34573792>

        Reviewed by Dan Bernstein.

        When minimum font size is specified, we were trying to preserve the ratio of specified font-size
        and specified line-height in order to boost the computed font size proportionately to the font-size
        boost. However, this doesn't work when the specified font-size is 0, because the ratio between
        line-height and font-size is infinite.

        The most straightforward solution is just to make small font-sizes opt out of the line-height
        adjustment because the result would be too big.

        Test: fast/text/line-height-minimumFontSize-text-small-font-size.html

        * css/StyleBuilderCustom.h:
        (WebCore::computeLineHeightMultiplierDueToFontSize):
        (WebCore::StyleBuilderCustom::applyValueLineHeight):

2017-09-27  Alex Christensen  <achristensen@webkit.org>

        Allow modern decoding of std::optional<T>
        https://bugs.webkit.org/show_bug.cgi?id=177519

        Reviewed by Tim Horton.

        * platform/DragItem.h:
        (WebCore::DragItem::decode):

2017-09-27  Myles C. Maxfield  <mmaxfield@apple.com>

        "Tag" codepoints require the complex text codepath
        https://bugs.webkit.org/show_bug.cgi?id=177251
        <rdar://problem/34384001>

        Reviewed by David Hyatt.

        Previously, Tag codepoints (U+E0000 - U+E007F) weren't triggering the
        complex text codepath.

        Eventually, we should migrate the default from simple to complex. I'll do
        that in a separate patch.

        Test: fast/text/flag-codepoint.html

        * platform/graphics/FontCascade.cpp:
        (WebCore::FontCascade::characterRangeCodePath):

2017-09-27  David Hyatt  <hyatt@apple.com>

        Rename "FlowThread" to "FragmentedFlow"
        https://bugs.webkit.org/show_bug.cgi?id=177557

        Reviewed by Zalan Bujtas.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
        * dom/Element.cpp:
        (WebCore::Element::absoluteEventBounds):
        * rendering/LayoutState.cpp:
        (WebCore::LayoutState::LayoutState):
        * rendering/LayoutState.h:
        (WebCore::LayoutState::currentRenderFragmentedFlow const):
        (WebCore::LayoutState::setCurrentRenderFragmentedFlow):
        (WebCore::LayoutState::currentRenderFlowThread const): Deleted.
        (WebCore::LayoutState::setCurrentRenderFlowThread): Deleted.
        * rendering/LogicalSelectionOffsetCaches.h:
        (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::ContainingBlockInfo):
        (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock):
        (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::logicalLeftSelectionOffset const):
        (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::logicalRightSelectionOffset const):
        (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::hasFloatsOrFragmentedFlows const):
        (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
        (WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::hasFloatsOrFlowThreads const): Deleted.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::styleDidChange):
        (WebCore::RenderBlock::clone const):
        (WebCore::RenderBlock::removeLeftoverAnonymousBlock):
        (WebCore::RenderBlock::preparePaginationBeforeBlockLayout):
        (WebCore::RenderBlock::addOverflowFromChildren):
        (WebCore::RenderBlock::addVisualOverflowFromTheme):
        (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
        (WebCore::RenderBlock::simplifiedLayout):
        (WebCore::RenderBlock::isSelectionRoot const):
        (WebCore::RenderBlock::selectionGaps):
        (WebCore::RenderBlock::insertPositionedObject):
        (WebCore::isChildHitTestCandidate):
        (WebCore::RenderBlock::cachedEnclosingFragmentedFlow const):
        (WebCore::RenderBlock::cachedEnclosingFragmentedFlowNeedsUpdate const):
        (WebCore::RenderBlock::setCachedEnclosingFragmentedFlowNeedsUpdate):
        (WebCore::RenderBlock::updateCachedEnclosingFragmentedFlow const):
        (WebCore::RenderBlock::locateEnclosingFragmentedFlow const):
        (WebCore::RenderBlock::resetEnclosingFragmentedFlowAndChildInfoIncludingDescendants):
        (WebCore::RenderBlock::absoluteQuads const):
        (WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const):
        (WebCore::RenderBlock::fragmentAtBlockOffset const):
        (WebCore::canComputeFragmentRangeForBox):
        (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
        (WebCore::RenderBlock::computeFragmentRangeForBoxChild const):
        (WebCore::RenderBlock::estimateFragmentRangeForBoxChild const):
        (WebCore::RenderBlock::updateFragmentRangeForBoxChild const):
        (WebCore::RenderBlock::cachedFlowThreadContainingBlock const): Deleted.
        (WebCore::RenderBlock::cachedFlowThreadContainingBlockNeedsUpdate const): Deleted.
        (WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate): Deleted.
        (WebCore::RenderBlock::updateCachedFlowThreadContainingBlock const): Deleted.
        (WebCore::RenderBlock::locateFlowThreadContainingBlock const): Deleted.
        (WebCore::RenderBlock::resetFlowThreadContainingBlockAndChildInfoIncludingDescendants): Deleted.
        * rendering/RenderBlock.h:
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::willCreateColumns const):
        (WebCore::RenderBlockFlow::layoutBlock):
        (WebCore::RenderBlockFlow::layoutBlockChild):
        (WebCore::RenderBlockFlow::setStaticInlinePositionForChild):
        (WebCore::inNormalFlow):
        (WebCore::RenderBlockFlow::applyBeforeBreak):
        (WebCore::RenderBlockFlow::applyAfterBreak):
        (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
        (WebCore::RenderBlockFlow::hasNextPage const):
        (WebCore::RenderBlockFlow::adjustForUnsplittableChild):
        (WebCore::RenderBlockFlow::setPageBreak):
        (WebCore::RenderBlockFlow::updateMinimumPageHeight):
        (WebCore::RenderBlockFlow::pageLogicalTopForOffset const):
        (WebCore::RenderBlockFlow::pageLogicalHeightForOffset const):
        (WebCore::RenderBlockFlow::pageRemainingLogicalHeightForOffset const):
        (WebCore::RenderBlockFlow::styleDidChange):
        (WebCore::RenderBlockFlow::updateStylesForColumnChildren):
        (WebCore::RenderBlockFlow::computeOverflow):
        (WebCore::RenderBlockFlow::paintColumnRules):
        (WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
        (WebCore::RenderBlockFlow::setMultiColumnFlow):
        (WebCore::RenderBlockFlow::relayoutForPagination):
        (WebCore::RenderBlockFlow::layoutExcludedChildren):
        (WebCore::RenderBlockFlow::addChild):
        (WebCore::RenderBlockFlow::removeChild):
        (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
        (WebCore::RenderBlockFlow::setComputedColumnCountAndWidth):
        (WebCore::RenderBlockFlow::updateColumnProgressionFromStyle):
        (WebCore::RenderBlockFlow::computedColumnWidth const):
        (WebCore::RenderBlockFlow::computedColumnCount const):
        (WebCore::RenderBlockFlow::isTopLayoutOverflowAllowed const):
        (WebCore::RenderBlockFlow::isLeftLayoutOverflowAllowed const):
        (WebCore::RenderBlockFlow::setMultiColumnFlowThread): Deleted.
        * rendering/RenderBlockFlow.h:
        (WebCore::RenderBlockFlow::RenderBlockFlowRareData::RenderBlockFlowRareData):
        (WebCore::RenderBlockFlow::multiColumnFlow const):
        (WebCore::RenderBlockFlow::multiColumnFlowThread const): Deleted.
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
        (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
        (WebCore::RenderBlockFlow::layoutLineBoxes):
        (WebCore::RenderBlockFlow::determineStartPosition):
        (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
        (WebCore::RenderBlockFlow::lineWidthForPaginatedLineChanged const):
        (WebCore::RenderBlockFlow::addOverflowFromInlineChildren):
        (WebCore::RenderBlockFlow::updateFragmentForLine const):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::clampToStartAndEndFragments const):
        (WebCore::RenderBox::hasFragmentRangeInFragmentedFlow const):
        (WebCore::RenderBox::styleDidChange):
        (WebCore::RenderBox::absoluteQuads const):
        (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats const):
        (WebCore::RenderBox::containingBlockAvailableLineWidthInFragment const):
        (WebCore::RenderBox::offsetFromContainer const):
        (WebCore::RenderBox::computeRectForRepaint const):
        (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation const):
        (WebCore::RenderBox::availableLogicalHeightUsing const):
        (WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
        (WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
        (WebCore::RenderBox::computePositionedLogicalWidth const):
        (WebCore::RenderBox::computePositionedLogicalHeight const):
        (WebCore::RenderBox::positionForPoint):
        (WebCore::RenderBox::createsNewFormattingContext const):
        (WebCore::RenderBox::addVisualEffectOverflow):
        (WebCore::RenderBox::addOverflowFromChild):
        (WebCore::RenderBox::clearOverflow):
        (WebCore::RenderBox::offsetFromLogicalTopOfFirstPage const):
        (WebCore::RenderBox::hasFragmentRangeInFlowThread const): Deleted.
        * rendering/RenderBox.h:
        (WebCore::RenderBox::canHaveOutsideFragmentRange const):
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent const):
        (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint const):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::setStyle):
        (WebCore::RenderElement::insertChildInternal):
        (WebCore::RenderElement::removeChildInternal):
        (WebCore::RenderElement::propagateStyleToAnonymousChildren):
        (WebCore::RenderElement::adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded):
        (WebCore::RenderElement::removeFromRenderFragmentedFlow):
        (WebCore::RenderElement::removeFromRenderFragmentedFlowIncludingDescendants):
        (WebCore::RenderElement::resetEnclosingFragmentedFlowAndChildInfoIncludingDescendants):
        (WebCore::RenderElement::adjustFlowThreadStateOnContainingBlockChangeIfNeeded): Deleted.
        (WebCore::RenderElement::removeFromRenderFlowThread): Deleted.
        (WebCore::RenderElement::removeFromRenderFlowThreadIncludingDescendants): Deleted.
        (WebCore::RenderElement::resetFlowThreadContainingBlockAndChildInfoIncludingDescendants): Deleted.
        * rendering/RenderElement.h:
        (WebCore::RenderElement::canContainFixedPositionObjects const):
        * rendering/RenderFlowThread.cpp: Removed.
        * rendering/RenderFlowThread.h: Removed.
        * rendering/RenderFragmentContainer.cpp:
        (WebCore::RenderFragmentContainer::RenderFragmentContainer):
        (WebCore::RenderFragmentContainer::mapFragmentPointIntoFragmentedFlowCoordinates):
        (WebCore::RenderFragmentContainer::positionForPoint):
        (WebCore::RenderFragmentContainer::pageLogicalWidth const):
        (WebCore::RenderFragmentContainer::pageLogicalHeight const):
        (WebCore::RenderFragmentContainer::logicalHeightOfAllFragmentedFlowContent const):
        (WebCore::RenderFragmentContainer::fragmentedFlowPortionOverflowRect):
        (WebCore::RenderFragmentContainer::fragmentedFlowPortionLocation const):
        (WebCore::RenderFragmentContainer::overflowRectForFragmentedFlowPortion):
        (WebCore::RenderFragmentContainer::pageLogicalTopForOffset const):
        (WebCore::RenderFragmentContainer::isFirstFragment const):
        (WebCore::RenderFragmentContainer::isLastFragment const):
        (WebCore::RenderFragmentContainer::shouldClipFragmentedFlowContent const):
        (WebCore::RenderFragmentContainer::styleDidChange):
        (WebCore::RenderFragmentContainer::computeOverflowFromFragmentedFlow):
        (WebCore::RenderFragmentContainer::repaintFragmentedFlowContent):
        (WebCore::RenderFragmentContainer::repaintFragmentedFlowContentRectangle):
        (WebCore::RenderFragmentContainer::installFragmentedFlow):
        (WebCore::RenderFragmentContainer::attachFragment):
        (WebCore::RenderFragmentContainer::detachFragment):
        (WebCore::RenderFragmentContainer::logicalTopOfFragmentedFlowContentRect const):
        (WebCore::RenderFragmentContainer::logicalBottomOfFragmentedFlowContentRect const):
        (WebCore::RenderFragmentContainer::computeIntrinsicLogicalWidths const):
        (WebCore::RenderFragmentContainer::adjustFragmentBoundsFromFragmentedFlowPortionRect const):
        (WebCore::RenderFragmentContainer::ensureOverflowForBox):
        (WebCore::RenderFragmentContainer::rectFlowPortionForBox const):
        (WebCore::RenderFragmentContainer::addVisualOverflowForBox):
        (WebCore::RenderFragmentContainer::visualOverflowRectForBoxForPropagation):
        (WebCore::CurrentRenderFragmentContainerMaintainer::CurrentRenderFragmentContainerMaintainer):
        (WebCore::CurrentRenderFragmentContainerMaintainer::~CurrentRenderFragmentContainerMaintainer):
        (WebCore::RenderFragmentContainer::mapFragmentPointIntoFlowThreadCoordinates): Deleted.
        (WebCore::RenderFragmentContainer::logicalHeightOfAllFlowThreadContent const): Deleted.
        (WebCore::RenderFragmentContainer::flowThreadPortionOverflowRect): Deleted.
        (WebCore::RenderFragmentContainer::flowThreadPortionLocation const): Deleted.
        (WebCore::RenderFragmentContainer::overflowRectForFlowThreadPortion): Deleted.
        (WebCore::RenderFragmentContainer::shouldClipFlowThreadContent const): Deleted.
        (WebCore::RenderFragmentContainer::computeOverflowFromFlowThread): Deleted.
        (WebCore::RenderFragmentContainer::repaintFlowThreadContent): Deleted.
        (WebCore::RenderFragmentContainer::repaintFlowThreadContentRectangle): Deleted.
        (WebCore::RenderFragmentContainer::installFlowThread): Deleted.
        (WebCore::RenderFragmentContainer::logicalTopOfFlowThreadContentRect const): Deleted.
        (WebCore::RenderFragmentContainer::logicalBottomOfFlowThreadContentRect const): Deleted.
        (WebCore::RenderFragmentContainer::adjustFragmentBoundsFromFlowThreadPortionRect const): Deleted.
        * rendering/RenderFragmentContainer.h:
        (WebCore::RenderFragmentContainer::setFragmentedFlowPortionRect):
        (WebCore::RenderFragmentContainer::fragmentedFlowPortionRect const):
        (WebCore::RenderFragmentContainer::fragmentedFlow const):
        (WebCore::RenderFragmentContainer::logicalTopForFragmentedFlowContent const):
        (WebCore::RenderFragmentContainer::logicalBottomForFragmentedFlowContent const):
        (WebCore::RenderFragmentContainer::setFlowThreadPortionRect): Deleted.
        (WebCore::RenderFragmentContainer::flowThreadPortionRect const): Deleted.
        (WebCore::RenderFragmentContainer::flowThread const): Deleted.
        (WebCore::RenderFragmentContainer::logicalTopForFlowThreadContent const): Deleted.
        (WebCore::RenderFragmentContainer::logicalBottomForFlowThreadContent const): Deleted.
        * rendering/RenderFragmentContainerSet.cpp:
        (WebCore::RenderFragmentContainerSet::RenderFragmentContainerSet):
        (WebCore::RenderFragmentContainerSet::installFragmentedFlow):
        (WebCore::RenderFragmentContainerSet::expandToEncompassFragmentedFlowContentsIfNeeded):
        (WebCore::RenderFragmentContainerSet::installFlowThread): Deleted.
        (WebCore::RenderFragmentContainerSet::expandToEncompassFlowThreadContentsIfNeeded): Deleted.
        * rendering/RenderFragmentContainerSet.h:
        * rendering/RenderFragmentedFlow.cpp: Copied from rendering/RenderFlowThread.cpp.
        (WebCore::RenderFragmentedFlow::RenderFragmentedFlow):
        (WebCore::RenderFragmentedFlow::createFragmentedFlowStyle):
        (WebCore::RenderFragmentedFlow::styleDidChange):
        (WebCore::RenderFragmentedFlow::removeFlowChildInfo):
        (WebCore::RenderFragmentedFlow::removeFragmentFromThread):
        (WebCore::RenderFragmentedFlow::invalidateFragments):
        (WebCore::RenderFragmentedFlow::validateFragments):
        (WebCore::RenderFragmentedFlow::layout):
        (WebCore::RenderFragmentedFlow::updateLogicalWidth):
        (WebCore::RenderFragmentedFlow::computeLogicalHeight const):
        (WebCore::RenderFragmentedFlow::nodeAtPoint):
        (WebCore::RenderFragmentedFlow::shouldRepaint const):
        (WebCore::RenderFragmentedFlow::repaintRectangleInFragments const):
        (WebCore::RenderFragmentedFlow::fragmentAtBlockOffset const):
        (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
        (WebCore::RenderFragmentedFlow::pageLogicalTopForOffset const):
        (WebCore::RenderFragmentedFlow::pageLogicalWidthForOffset const):
        (WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
        (WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
        (WebCore::RenderFragmentedFlow::mapFromFlowToFragment const):
        (WebCore::RenderFragmentedFlow::removeRenderBoxFragmentInfo):
        (WebCore::RenderFragmentedFlow::removeLineFragmentInfo):
        (WebCore::RenderFragmentedFlow::logicalWidthChangedInFragmentsForBlock):
        (WebCore::RenderFragmentedFlow::contentLogicalWidthOfFirstFragment const):
        (WebCore::RenderFragmentedFlow::contentLogicalHeightOfFirstFragment const):
        (WebCore::RenderFragmentedFlow::contentLogicalLeftOfFirstFragment const):
        (WebCore::RenderFragmentedFlow::firstFragment const):
        (WebCore::RenderFragmentedFlow::lastFragment const):
        (WebCore::RenderFragmentedFlow::clearRenderBoxFragmentInfoAndCustomStyle):
        (WebCore::RenderFragmentedFlow::setFragmentRangeForBox):
        (WebCore::RenderFragmentedFlow::hasCachedFragmentRangeForBox const):
        (WebCore::RenderFragmentedFlow::getFragmentRangeForBoxFromCachedInfo const):
        (WebCore::RenderFragmentedFlow::getFragmentRangeForBox const):
        (WebCore::RenderFragmentedFlow::computedFragmentRangeForBox const):
        (WebCore::RenderFragmentedFlow::fragmentInRange const):
        (WebCore::RenderFragmentedFlow::objectShouldFragmentInFlowFragment const):
        (WebCore::RenderFragmentedFlow::objectInFlowFragment const):
        (WebCore::RenderFragmentedFlow::checkLinesConsistency const):
        (WebCore::RenderFragmentedFlow::clearLinesToFragmentMap):
        (WebCore::RenderFragmentedFlow::deleteLines):
        (WebCore::RenderFragmentedFlow::willBeDestroyed):
        (WebCore::RenderFragmentedFlow::markFragmentsForOverflowLayoutIfNeeded):
        (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
        (WebCore::RenderFragmentedFlow::addForcedFragmentBreak):
        (WebCore::RenderFragmentedFlow::collectLayerFragments):
        (WebCore::RenderFragmentedFlow::fragmentsBoundingBox):
        (WebCore::RenderFragmentedFlow::offsetFromLogicalTopOfFirstFragment const):
        (WebCore::RenderFragmentedFlow::FragmentSearchAdapter::collectIfNeeded):
        (WebCore::RenderFragmentedFlow::mapLocalToContainer const):
        (WebCore::RenderFragmentedFlow::mapFromLocalToFragmentedFlow const):
        (WebCore::RenderFragmentedFlow::mapFromFragmentedFlowToLocal const):
        (WebCore::RenderFragmentedFlow::flipForWritingModeLocalCoordinates const):
        (WebCore::RenderFragmentedFlow::addFragmentsVisualEffectOverflow):
        (WebCore::RenderFragmentedFlow::addFragmentsVisualOverflowFromTheme):
        (WebCore::RenderFragmentedFlow::addFragmentsOverflowFromChild):
        (WebCore::RenderFragmentedFlow::addFragmentsLayoutOverflow):
        (WebCore::RenderFragmentedFlow::addFragmentsVisualOverflow):
        (WebCore::RenderFragmentedFlow::clearFragmentsOverflow):
        (WebCore::RenderFragmentedFlow::currentFragment const):
        (WebCore::RenderFragmentedFlow::containingFragmentMap):
        (WebCore::RenderFlowThread::RenderFlowThread): Deleted.
        (WebCore::RenderFlowThread::createFlowThreadStyle): Deleted.
        (WebCore::RenderFlowThread::styleDidChange): Deleted.
        (WebCore::RenderFlowThread::removeFlowChildInfo): Deleted.
        (WebCore::RenderFlowThread::removeFragmentFromThread): Deleted.
        (WebCore::RenderFlowThread::invalidateFragments): Deleted.
        (WebCore::RenderFlowThread::validateFragments): Deleted.
        (WebCore::RenderFlowThread::layout): Deleted.
        (WebCore::RenderFlowThread::updateLogicalWidth): Deleted.
        (WebCore::RenderFlowThread::computeLogicalHeight const): Deleted.
        (WebCore::RenderFlowThread::nodeAtPoint): Deleted.
        (WebCore::RenderFlowThread::shouldRepaint const): Deleted.
        (WebCore::RenderFlowThread::repaintRectangleInFragments const): Deleted.
        (WebCore::RenderFlowThread::fragmentAtBlockOffset const): Deleted.
        (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent const): Deleted.
        (WebCore::RenderFlowThread::pageLogicalTopForOffset const): Deleted.
        (WebCore::RenderFlowThread::pageLogicalWidthForOffset const): Deleted.
        (WebCore::RenderFlowThread::pageLogicalHeightForOffset const): Deleted.
        (WebCore::RenderFlowThread::pageRemainingLogicalHeightForOffset const): Deleted.
        (WebCore::RenderFlowThread::mapFromFlowToFragment const): Deleted.
        (WebCore::RenderFlowThread::removeRenderBoxFragmentInfo): Deleted.
        (WebCore::RenderFlowThread::removeLineFragmentInfo): Deleted.
        (WebCore::RenderFlowThread::logicalWidthChangedInFragmentsForBlock): Deleted.
        (WebCore::RenderFlowThread::contentLogicalWidthOfFirstFragment const): Deleted.
        (WebCore::RenderFlowThread::contentLogicalHeightOfFirstFragment const): Deleted.
        (WebCore::RenderFlowThread::contentLogicalLeftOfFirstFragment const): Deleted.
        (WebCore::RenderFlowThread::firstFragment const): Deleted.
        (WebCore::RenderFlowThread::lastFragment const): Deleted.
        (WebCore::RenderFlowThread::clearRenderBoxFragmentInfoAndCustomStyle): Deleted.
        (WebCore::RenderFlowThread::setFragmentRangeForBox): Deleted.
        (WebCore::RenderFlowThread::hasCachedFragmentRangeForBox const): Deleted.
        (WebCore::RenderFlowThread::getFragmentRangeForBoxFromCachedInfo const): Deleted.
        (WebCore::RenderFlowThread::getFragmentRangeForBox const): Deleted.
        (WebCore::RenderFlowThread::computedFragmentRangeForBox const): Deleted.
        (WebCore::RenderFlowThread::fragmentInRange const): Deleted.
        (WebCore::RenderFlowThread::objectShouldFragmentInFlowFragment const): Deleted.
        (WebCore::RenderFlowThread::objectInFlowFragment const): Deleted.
        (WebCore::RenderFlowThread::checkLinesConsistency const): Deleted.
        (WebCore::RenderFlowThread::clearLinesToFragmentMap): Deleted.
        (WebCore::RenderFlowThread::deleteLines): Deleted.
        (WebCore::RenderFlowThread::willBeDestroyed): Deleted.
        (WebCore::RenderFlowThread::markFragmentsForOverflowLayoutIfNeeded): Deleted.
        (WebCore::RenderFlowThread::updateFragmentsFlowThreadPortionRect): Deleted.
        (WebCore::RenderFlowThread::addForcedFragmentBreak): Deleted.
        (WebCore::RenderFlowThread::collectLayerFragments): Deleted.
        (WebCore::RenderFlowThread::fragmentsBoundingBox): Deleted.
        (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstFragment const): Deleted.
        (WebCore::RenderFlowThread::FragmentSearchAdapter::collectIfNeeded): Deleted.
        (WebCore::RenderFlowThread::mapLocalToContainer const): Deleted.
        (WebCore::RenderFlowThread::mapFromLocalToFlowThread const): Deleted.
        (WebCore::RenderFlowThread::mapFromFlowThreadToLocal const): Deleted.
        (WebCore::RenderFlowThread::flipForWritingModeLocalCoordinates const): Deleted.
        (WebCore::RenderFlowThread::addFragmentsVisualEffectOverflow): Deleted.
        (WebCore::RenderFlowThread::addFragmentsVisualOverflowFromTheme): Deleted.
        (WebCore::RenderFlowThread::addFragmentsOverflowFromChild): Deleted.
        (WebCore::RenderFlowThread::addFragmentsLayoutOverflow): Deleted.
        (WebCore::RenderFlowThread::addFragmentsVisualOverflow): Deleted.
        (WebCore::RenderFlowThread::clearFragmentsOverflow): Deleted.
        (WebCore::RenderFlowThread::currentFragment const): Deleted.
        (WebCore::RenderFlowThread::containingFragmentMap): Deleted.
        * rendering/RenderFragmentedFlow.h: Copied from rendering/RenderFlowThread.h.
        * rendering/RenderGeometryMap.cpp:
        (WebCore::canMapBetweenRenderersViaLayers):
        (WebCore::RenderGeometryMap::pushRenderFragmentedFlow):
        (WebCore::RenderGeometryMap::pushRenderFlowThread): Deleted.
        * rendering/RenderGeometryMap.h:
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::layoutShadowControls):
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::addChild):
        (WebCore::RenderInline::clone const):
        (WebCore::RenderInline::splitInlines):
        (WebCore::RenderInline::offsetFromContainer const):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositions):
        (WebCore::RenderLayer::updatePagination):
        (WebCore::transparencyClipBox):
        (WebCore::accumulateOffsetTowardsAncestor):
        (WebCore::RenderLayer::paintLayerContents):
        (WebCore::RenderLayer::collectFragments):
        (WebCore::RenderLayer::hitTest):
        (WebCore::RenderLayer::enclosingFragmentedFlowAncestor const):
        (WebCore::RenderLayer::hitTestContents const):
        (WebCore::RenderLayer::calculateClipRects const):
        (WebCore::RenderLayer::enclosingFlowThreadAncestor const): Deleted.
        * rendering/RenderLayer.h:
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::canBeComposited const):
        * rendering/RenderMedia.cpp:
        * rendering/RenderMultiColumnFlow.cpp: Copied from rendering/RenderMultiColumnFlowThread.cpp.
        (WebCore::RenderMultiColumnFlow::RenderMultiColumnFlow):
        (WebCore::RenderMultiColumnFlow::~RenderMultiColumnFlow):
        (WebCore::RenderMultiColumnFlow::renderName const):
        (WebCore::RenderMultiColumnFlow::firstMultiColumnSet const):
        (WebCore::RenderMultiColumnFlow::lastMultiColumnSet const):
        (WebCore::RenderMultiColumnFlow::firstColumnSetOrSpanner const):
        (WebCore::RenderMultiColumnFlow::nextColumnSetOrSpannerSiblingOf):
        (WebCore::RenderMultiColumnFlow::previousColumnSetOrSpannerSiblingOf):
        (WebCore::RenderMultiColumnFlow::layout):
        (WebCore::findSetRendering):
        (WebCore::RenderMultiColumnFlow::populate):
        (WebCore::RenderMultiColumnFlow::evacuateAndDestroy):
        (WebCore::RenderMultiColumnFlow::addFragmentToThread):
        (WebCore::RenderMultiColumnFlow::willBeRemovedFromTree):
        (WebCore::RenderMultiColumnFlow::resolveMovedChild const):
        (WebCore::isValidColumnSpanner):
        (WebCore::spannerPlacehoderCandidate):
        (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
        (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
        (WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
        (WebCore::RenderMultiColumnFlow::fragmentedFlowRelativeWillBeRemoved):
        (WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantBoxLaidOut):
        (WebCore::RenderMultiColumnFlow::computeLogicalHeight const):
        (WebCore::RenderMultiColumnFlow::initialLogicalWidth const):
        (WebCore::RenderMultiColumnFlow::setPageBreak):
        (WebCore::RenderMultiColumnFlow::updateMinimumPageHeight):
        (WebCore::RenderMultiColumnFlow::fragmentAtBlockOffset const):
        (WebCore::RenderMultiColumnFlow::setFragmentRangeForBox):
        (WebCore::RenderMultiColumnFlow::addForcedFragmentBreak):
        (WebCore::RenderMultiColumnFlow::computeLineGridPaginationOrigin const):
        (WebCore::RenderMultiColumnFlow::offsetFromContainer const):
        (WebCore::RenderMultiColumnFlow::mapAbsoluteToLocalPoint const):
        (WebCore::RenderMultiColumnFlow::physicalTranslationFromFragmentToFlow const):
        (WebCore::RenderMultiColumnFlow::mapFromFlowToFragment const):
        (WebCore::RenderMultiColumnFlow::physicalTranslationOffsetFromFlowToFragment const):
        (WebCore::RenderMultiColumnFlow::physicalTranslationFromFlowToFragment const):
        (WebCore::RenderMultiColumnFlow::isPageLogicalHeightKnown const):
        (WebCore::RenderMultiColumnFlow::nodeAtPoint):
        (WebCore::RenderMultiColumnFlow::shouldCheckColumnBreaks const):
        (WebCore::RenderMultiColumnFlowThread::RenderMultiColumnFlowThread): Deleted.
        (WebCore::RenderMultiColumnFlowThread::~RenderMultiColumnFlowThread): Deleted.
        (WebCore::RenderMultiColumnFlowThread::renderName const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::firstMultiColumnSet const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::lastMultiColumnSet const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::firstColumnSetOrSpanner const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::nextColumnSetOrSpannerSiblingOf): Deleted.
        (WebCore::RenderMultiColumnFlowThread::previousColumnSetOrSpannerSiblingOf): Deleted.
        (WebCore::RenderMultiColumnFlowThread::layout): Deleted.
        (WebCore::RenderMultiColumnFlowThread::populate): Deleted.
        (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy): Deleted.
        (WebCore::RenderMultiColumnFlowThread::addFragmentToThread): Deleted.
        (WebCore::RenderMultiColumnFlowThread::willBeRemovedFromTree): Deleted.
        (WebCore::RenderMultiColumnFlowThread::resolveMovedChild const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant): Deleted.
        (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted): Deleted.
        (WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval): Deleted.
        (WebCore::RenderMultiColumnFlowThread::flowThreadRelativeWillBeRemoved): Deleted.
        (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantBoxLaidOut): Deleted.
        (WebCore::RenderMultiColumnFlowThread::computeLogicalHeight const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::initialLogicalWidth const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::setPageBreak): Deleted.
        (WebCore::RenderMultiColumnFlowThread::updateMinimumPageHeight): Deleted.
        (WebCore::RenderMultiColumnFlowThread::fragmentAtBlockOffset const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::setFragmentRangeForBox): Deleted.
        (WebCore::RenderMultiColumnFlowThread::addForcedFragmentBreak): Deleted.
        (WebCore::RenderMultiColumnFlowThread::computeLineGridPaginationOrigin const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::offsetFromContainer const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::mapAbsoluteToLocalPoint const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::physicalTranslationFromFragmentToFlow const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::mapFromFlowToFragment const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::physicalTranslationOffsetFromFlowToFragment const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::physicalTranslationFromFlowToFragment const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::isPageLogicalHeightKnown const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::nodeAtPoint): Deleted.
        (WebCore::RenderMultiColumnFlowThread::shouldCheckColumnBreaks const): Deleted.
        * rendering/RenderMultiColumnFlow.h: Copied from rendering/RenderMultiColumnFlowThread.h.
        * rendering/RenderMultiColumnFlowThread.cpp: Removed.
        * rendering/RenderMultiColumnFlowThread.h: Removed.
        * rendering/RenderMultiColumnSet.cpp:
        (WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
        (WebCore::RenderMultiColumnSet::firstRendererInFragmentedFlow const):
        (WebCore::RenderMultiColumnSet::lastRendererInFragmentedFlow const):
        (WebCore::RenderMultiColumnSet::containsRendererInFragmentedFlow const):
        (WebCore::RenderMultiColumnSet::setLogicalTopInFragmentedFlow):
        (WebCore::RenderMultiColumnSet::setLogicalBottomInFragmentedFlow):
        (WebCore::RenderMultiColumnSet::pageLogicalTopForOffset const):
        (WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight):
        (WebCore::RenderMultiColumnSet::distributeImplicitBreaks):
        (WebCore::RenderMultiColumnSet::calculateBalancedHeight const):
        (WebCore::RenderMultiColumnSet::recalculateColumnHeight):
        (WebCore::RenderMultiColumnSet::updateLogicalWidth):
        (WebCore::RenderMultiColumnSet::requiresBalancing const):
        (WebCore::RenderMultiColumnSet::prepareForLayout):
        (WebCore::RenderMultiColumnSet::beginFlow):
        (WebCore::RenderMultiColumnSet::endFlow):
        (WebCore::RenderMultiColumnSet::layout):
        (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight const):
        (WebCore::RenderMultiColumnSet::columnCount const):
        (WebCore::RenderMultiColumnSet::columnLogicalLeft const):
        (WebCore::RenderMultiColumnSet::columnLogicalTop const):
        (WebCore::RenderMultiColumnSet::columnIndexAtOffset const):
        (WebCore::RenderMultiColumnSet::fragmentedFlowPortionRectAt const):
        (WebCore::RenderMultiColumnSet::fragmentedFlowPortionOverflowRect):
        (WebCore::RenderMultiColumnSet::paintColumnRules):
        (WebCore::RenderMultiColumnSet::repaintFragmentedFlowContent):
        (WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting const):
        (WebCore::RenderMultiColumnSet::collectLayerFragments):
        (WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
        (WebCore::RenderMultiColumnSet::adjustFragmentBoundsFromFragmentedFlowPortionRect const):
        (WebCore::RenderMultiColumnSet::positionForPoint):
        (WebCore::RenderMultiColumnSet::translateFragmentPointToFragmentedFlow const):
        (WebCore::RenderMultiColumnSet::updateHitTestResult):
        (WebCore::RenderMultiColumnSet::firstRendererInFlowThread const): Deleted.
        (WebCore::RenderMultiColumnSet::lastRendererInFlowThread const): Deleted.
        (WebCore::RenderMultiColumnSet::containsRendererInFlowThread const): Deleted.
        (WebCore::RenderMultiColumnSet::setLogicalTopInFlowThread): Deleted.
        (WebCore::RenderMultiColumnSet::setLogicalBottomInFlowThread): Deleted.
        (WebCore::RenderMultiColumnSet::flowThreadPortionRectAt const): Deleted.
        (WebCore::RenderMultiColumnSet::flowThreadPortionOverflowRect): Deleted.
        (WebCore::RenderMultiColumnSet::repaintFlowThreadContent): Deleted.
        (WebCore::RenderMultiColumnSet::adjustFragmentBoundsFromFlowThreadPortionRect const): Deleted.
        (WebCore::RenderMultiColumnSet::translateFragmentPointToFlowThread const): Deleted.
        * rendering/RenderMultiColumnSet.h:
        * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
        (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
        (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
        * rendering/RenderMultiColumnSpannerPlaceholder.h:
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::setFragmentedFlowStateIncludingDescendants):
        (WebCore::RenderObject::computedFragmentedFlowState):
        (WebCore::RenderObject::initializeFragmentedFlowStateOnInsertion):
        (WebCore::RenderObject::resetFragmentedFlowStateOnRemoval):
        (WebCore::RenderObject::containerForRepaint const):
        (WebCore::RenderObject::repaintUsingContainer const):
        (WebCore::enclosingFragmentedFlowFromRenderer):
        (WebCore::RenderObject::outputRegionsInformation const):
        (WebCore::RenderObject::selectionRoot const):
        (WebCore::RenderObject::offsetFromContainer const):
        (WebCore::RenderObject::insertedIntoTree):
        (WebCore::RenderObject::locateEnclosingFragmentedFlow const):
        (WebCore::RenderObject::setIsRenderFragmentedFlow):
        (WebCore::RenderObject::setFlowThreadStateIncludingDescendants): Deleted.
        (WebCore::RenderObject::computedFlowThreadState): Deleted.
        (WebCore::RenderObject::initializeFlowThreadStateOnInsertion): Deleted.
        (WebCore::RenderObject::resetFlowThreadStateOnRemoval): Deleted.
        (WebCore::flowThreadContainingBlockFromRenderer): Deleted.
        (WebCore::RenderObject::locateFlowThreadContainingBlock const): Deleted.
        (WebCore::RenderObject::setIsRenderFlowThread): Deleted.
        * rendering/RenderObject.h:
        (WebCore::RenderObject::enclosingFragmentedFlow const):
        (WebCore::RenderObject::isInFlowRenderFragmentedFlow const):
        (WebCore::RenderObject::isOutOfFlowRenderFragmentedFlow const):
        (WebCore::RenderObject::isRenderMultiColumnFlow const):
        (WebCore::RenderObject::fragmentedFlowState const):
        (WebCore::RenderObject::setFragmentedFlowState):
        (WebCore::RenderObject::isAnonymousBlock const):
        (WebCore::RenderObject::isRenderFragmentedFlow const):
        (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
        (WebCore::RenderObject::RenderObjectBitfields::fragmentedFlowState const):
        (WebCore::RenderObject::RenderObjectBitfields::setFragmentedFlowState):
        (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
        (WebCore::RenderObject::flowThreadContainingBlock const): Deleted.
        (WebCore::RenderObject::isInFlowRenderFlowThread const): Deleted.
        (WebCore::RenderObject::isOutOfFlowRenderFlowThread const): Deleted.
        (WebCore::RenderObject::isRenderMultiColumnFlowThread const): Deleted.
        (WebCore::RenderObject::flowThreadState const): Deleted.
        (WebCore::RenderObject::setFlowThreadState): Deleted.
        (WebCore::RenderObject::isRenderFlowThread const): Deleted.
        (WebCore::RenderObject::RenderObjectBitfields::flowThreadState const): Deleted.
        (WebCore::RenderObject::RenderObjectBitfields::setFlowThreadState): Deleted.
        * rendering/RenderReplaced.cpp:
        * rendering/RenderRuby.cpp:
        (WebCore::isRubyChildForNormalRemoval):
        * rendering/RenderTextFragment.cpp:
        (WebCore::RenderTextFragment::blockForAccompanyingFirstLetter):
        * rendering/RenderView.cpp:
        (WebCore::RenderView::availableLogicalHeight const):
        (WebCore::RenderView::pageOrViewLogicalHeight const):
        (WebCore::RenderView::updateHitTestResult):
        (WebCore::RenderView::pageNumberForBlockProgressionOffset const):
        (WebCore::RenderView::pageCount const):
        * rendering/RenderView.h:
        * rendering/RenderingAllInOne.cpp:
        * rendering/RootInlineBox.cpp:
        (WebCore::containingFragmentMap):
        (WebCore::RootInlineBox::~RootInlineBox):
        (WebCore::RootInlineBox::containingFragment const):
        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::canUseForWithReason):
        * rendering/line/LineLayoutState.h:
        (WebCore::LineLayoutState::LineLayoutState):
        (WebCore::LineLayoutState::fragmentedFlow const):
        (WebCore::LineLayoutState::setFragmentedFlow):
        (WebCore::LineLayoutState::flowThread const): Deleted.
        (WebCore::LineLayoutState::setFlowThread): Deleted.
        * rendering/svg/RenderSVGText.cpp:
        (WebCore::RenderSVGText::layout):
        * style/RenderTreePosition.h:
        * style/RenderTreeUpdaterListItem.cpp:
        (WebCore::RenderTreeUpdater::ListItem::updateMarker):
        * style/RenderTreeUpdaterMultiColumn.cpp:
        (WebCore::RenderTreeUpdater::MultiColumn::update):
        (WebCore::RenderTreeUpdater::MultiColumn::createFragmentedFlow):
        (WebCore::RenderTreeUpdater::MultiColumn::createFlowThread): Deleted.
        * style/RenderTreeUpdaterMultiColumn.h:
        * style/StyleResolveForDocument.cpp:
        (WebCore::Style::resolveForDocument):

2017-09-27  Don Olmstead  <don.olmstead@sony.com>

        Default to void* for platform widgets
        https://bugs.webkit.org/show_bug.cgi?id=177518

        Reviewed by Michael Catanzaro.

        No new tests. No change in behavior.

        * platform/Cursor.h:
        * platform/DragData.h:
        * platform/Widget.h:

2017-09-27  Youenn Fablet  <youenn@apple.com>

        [Fetch API] Cloning an opaque response should not assert
        https://bugs.webkit.org/show_bug.cgi?id=177548

        Reviewed by Sam Weinig.

        Test: http/wpt/fetch/response-opaque-clone.html

        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::readableStream): Returning null if response is opaque.
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::clone): Making sure cloned responses keep their opaque state.
        (WebCore::FetchResponse::consumeBodyAsStream): Removing assertion as we need to create a stream for cloning.

2017-09-26  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Remove unused parameter of Page.reload
        https://bugs.webkit.org/show_bug.cgi?id=177522

        Reviewed by Matt Baker.

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::reload):
        (WebCore::InspectorPageAgent::frameNavigated):
        (WebCore::InspectorPageAgent::didClearWindowObjectInWorld): Deleted.
        * inspector/InspectorPageAgent.h:

2017-09-27  Chris Dumez  <cdumez@apple.com>

        cssFloat missing in CSSPropertyDeclaration.prototype
        https://bugs.webkit.org/show_bug.cgi?id=177487

        Reviewed by Sam Weinig.

        Add support for cssFloat attribute on CSSPropertyDeclaration, as per:
        - https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-cssfloat

        Test: fast/css/CSSStyleDeclaration-cssFloat.html

        * css/CSSStyleDeclaration.cpp:
        (WebCore::CSSStyleDeclaration::cssFloat):
        (WebCore::CSSStyleDeclaration::setCssFloat):
        * css/CSSStyleDeclaration.h:
        * css/CSSStyleDeclaration.idl:

2017-09-27  Antti Koivisto  <antti@apple.com>

        Ref element keys in CSSAnimationControllerPrivate
        https://bugs.webkit.org/show_bug.cgi?id=177543

        Reviewed by Zalan Bujtas.

        For safety.

        * page/animation/CSSAnimationControllerPrivate.h:

        This won't create ref cycle as elements are removed from the m_compositeAnimations maps when they
        are removed from the tree. We have assertions that verify the map is always cleared.

2017-09-27  David Hyatt  <hyatt@apple.com>

        Rename "Region" to "Fragment" for RenderRegion and associated classes/methods.
        https://bugs.webkit.org/show_bug.cgi?id=177506

        Reviewed by Zalan Bujtas.

        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator BreakInside const):
        * css/CSSValueKeywords.in:
        * dom/Element.cpp:
        * platform/graphics/cg/GraphicsContextCG.cpp:
        * rendering/FixedTableLayout.cpp:
        (WebCore::FixedTableLayout::calcWidthArray):
        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::computeMarginLogicalSizeForChild):
        (WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild const):
        (WebCore::DefiniteSizeStrategy::minLogicalWidthForChild const):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::preparePaginationBeforeBlockLayout):
        (WebCore::RenderBlock::addOverflowFromChildren):
        (WebCore::RenderBlock::clearLayoutOverflow):
        (WebCore::RenderBlock::addVisualOverflowFromTheme):
        (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
        (WebCore::RenderBlock::simplifiedLayout):
        (WebCore::RenderBlock::markFixedPositionObjectForLayoutIfNeeded):
        (WebCore::RenderBlock::layoutPositionedObject):
        (WebCore::RenderBlock::selectionGaps):
        (WebCore::RenderBlock::logicalLeftOffsetForContent const):
        (WebCore::RenderBlock::logicalRightOffsetForContent const):
        (WebCore::RenderBlock::adjustLogicalLeftOffsetForLine const):
        (WebCore::RenderBlock::adjustLogicalRightOffsetForLine const):
        (WebCore::RenderBlock::positionForPointWithInlineChildren):
        (WebCore::isChildHitTestCandidate):
        (WebCore::RenderBlock::positionForPoint):
        (WebCore::RenderBlock::offsetFromLogicalTopOfFirstPage const):
        (WebCore::RenderBlock::fragmentAtBlockOffset const):
        (WebCore::canComputeFragmentRangeForBox):
        (WebCore::RenderBlock::computeFragmentRangeForBoxChild const):
        (WebCore::RenderBlock::estimateFragmentRangeForBoxChild const):
        (WebCore::RenderBlock::updateFragmentRangeForBoxChild const):
        (WebCore::RenderBlock::regionAtBlockOffset const): Deleted.
        (WebCore::canComputeRegionRangeForBox): Deleted.
        (WebCore::RenderBlock::computeRegionRangeForBoxChild const): Deleted.
        (WebCore::RenderBlock::estimateRegionRangeForBoxChild const): Deleted.
        (WebCore::RenderBlock::updateRegionRangeForBoxChild const): Deleted.
        * rendering/RenderBlock.h:
        (WebCore::RenderBlock::availableLogicalWidthForLineInFragment const):
        (WebCore::RenderBlock::logicalRightOffsetForLineInFragment const):
        (WebCore::RenderBlock::logicalLeftOffsetForLineInFragment const):
        (WebCore::RenderBlock::startOffsetForLineInFragment const):
        (WebCore::RenderBlock::endOffsetForLineInFragment const):
        (WebCore::RenderBlock::availableLogicalWidthForLine const):
        (WebCore::RenderBlock::availableLogicalWidthForContent const):
        (WebCore::RenderBlock::startOffsetForContent const):
        (WebCore::RenderBlock::endOffsetForContent const):
        (WebCore::RenderBlock::logicalLeftOffsetForContent const):
        (WebCore::RenderBlock::logicalRightOffsetForContent const):
        (WebCore::RenderBlock::availableLogicalWidthForLineInRegion const): Deleted.
        (WebCore::RenderBlock::logicalRightOffsetForLineInRegion const): Deleted.
        (WebCore::RenderBlock::logicalLeftOffsetForLineInRegion const): Deleted.
        (WebCore::RenderBlock::startOffsetForLineInRegion const): Deleted.
        (WebCore::RenderBlock::endOffsetForLineInRegion const): Deleted.
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::layoutBlock):
        (WebCore::RenderBlockFlow::layoutBlockChild):
        (WebCore::RenderBlockFlow::setStaticInlinePositionForChild):
        (WebCore::RenderBlockFlow::applyBeforeBreak):
        (WebCore::RenderBlockFlow::applyAfterBreak):
        (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
        (WebCore::RenderBlockFlow::hasNextPage const):
        (WebCore::RenderBlockFlow::adjustForUnsplittableChild):
        (WebCore::RenderBlockFlow::pushToNextPageWithMinimumLogicalHeight const):
        (WebCore::RenderBlockFlow::positionNewFloats):
        (WebCore::RenderBlockFlow::getClearDelta):
        (WebCore::RenderBlockFlow::needsLayoutAfterFragmentRangeChange const):
        (WebCore::RenderBlockFlow::findClosestTextAtAbsolutePoint):
        (WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
        (WebCore::RenderBlockFlow::positionForPoint):
        (WebCore::RenderBlockFlow::layoutExcludedChildren):
        (WebCore::RenderBlockFlow::needsLayoutAfterRegionRangeChange const): Deleted.
        * rendering/RenderBlockFlow.h:
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
        (WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
        (WebCore::RenderBlockFlow::layoutLineBoxes):
        (WebCore::RenderBlockFlow::determineStartPosition):
        (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
        (WebCore::RenderBlockFlow::lineWidthForPaginatedLineChanged const):
        (WebCore::RenderBlockFlow::addOverflowFromInlineChildren):
        (WebCore::RenderBlockFlow::positionNewFloatOnLine):
        (WebCore::RenderBlockFlow::updateFragmentForLine const):
        (WebCore::RenderBlockFlow::updateRegionForLine const): Deleted.
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::clampToStartAndEndFragments const):
        (WebCore::RenderBox::hasFragmentRangeInFlowThread const):
        (WebCore::RenderBox::clientBoxRectInFragment const):
        (WebCore::RenderBox::borderBoxRectInFragment const):
        (WebCore::RenderBox::constrainLogicalWidthInFragmentByMinMax const):
        (WebCore::RenderBox::nodeAtPoint):
        (WebCore::RenderBox::paintBoxDecorations):
        (WebCore::RenderBox::overflowClipRect):
        (WebCore::RenderBox::clipRect):
        (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats const):
        (WebCore::RenderBox::containingBlockLogicalWidthForContentInFragment const):
        (WebCore::RenderBox::containingBlockAvailableLineWidthInFragment const):
        (WebCore::RenderBox::offsetFromContainer const):
        (WebCore::RenderBox::computeRectForRepaint const):
        (WebCore::RenderBox::updateLogicalWidth):
        (WebCore::RenderBox::computeLogicalWidthInFragment const):
        (WebCore::RenderBox::computeLogicalWidthInFragmentUsing const):
        (WebCore::RenderBox::renderBoxFragmentInfo const):
        (WebCore::tableCellShouldHaveZeroInitialSize):
        (WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
        (WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
        (WebCore::computeInlineStaticDistance):
        (WebCore::RenderBox::computePositionedLogicalWidth const):
        (WebCore::RenderBox::computePositionedLogicalHeight const):
        (WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
        (WebCore::RenderBox::positionForPoint):
        (WebCore::RenderBox::createsNewFormattingContext const):
        (WebCore::RenderBox::addVisualEffectOverflow):
        (WebCore::RenderBox::addOverflowFromChild):
        (WebCore::RenderBox::clearOverflow):
        (WebCore::RenderBox::clampToStartAndEndRegions const): Deleted.
        (WebCore::RenderBox::hasRegionRangeInFlowThread const): Deleted.
        (WebCore::RenderBox::clientBoxRectInRegion const): Deleted.
        (WebCore::RenderBox::borderBoxRectInRegion const): Deleted.
        (WebCore::RenderBox::constrainLogicalWidthInRegionByMinMax const): Deleted.
        (WebCore::RenderBox::containingBlockLogicalWidthForContentInRegion const): Deleted.
        (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion const): Deleted.
        (WebCore::RenderBox::computeLogicalWidthInRegion const): Deleted.
        (WebCore::RenderBox::computeLogicalWidthInRegionUsing const): Deleted.
        (WebCore::RenderBox::renderBoxRegionInfo const): Deleted.
        * rendering/RenderBox.h:
        (WebCore::RenderBox::overflowClipRectForChildLayers):
        (WebCore::RenderBox::canHaveOutsideFragmentRange const):
        (WebCore::RenderBox::needsLayoutAfterFragmentRangeChange const):
        (WebCore::RenderBox::canHaveOutsideRegionRange const): Deleted.
        (WebCore::RenderBox::needsLayoutAfterRegionRangeChange const): Deleted.
        * rendering/RenderBoxFragmentInfo.h: Copied from rendering/RenderBoxRegionInfo.h.
        (WebCore::RenderBoxFragmentInfo::RenderBoxFragmentInfo):
        (WebCore::RenderBoxRegionInfo::RenderBoxRegionInfo): Deleted.
        (WebCore::RenderBoxRegionInfo::logicalLeft const): Deleted.
        (WebCore::RenderBoxRegionInfo::logicalWidth const): Deleted.
        (WebCore::RenderBoxRegionInfo::shiftLogicalLeft): Deleted.
        (WebCore::RenderBoxRegionInfo::isShifted const): Deleted.
        (WebCore::RenderBoxRegionInfo::createOverflow): Deleted.
        (WebCore::RenderBoxRegionInfo::overflow const): Deleted.
        (WebCore::RenderBoxRegionInfo::clearOverflow): Deleted.
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent const):
        (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint const):
        * rendering/RenderBoxModelObject.h:
        (WebCore::RenderBoxModelObject::canHaveBoxInfoInFragment const):
        (WebCore::RenderBoxModelObject::canHaveBoxInfoInRegion const): Deleted.
        * rendering/RenderBoxRegionInfo.h: Removed.
        * rendering/RenderElement.cpp:
        * rendering/RenderFileUploadControl.cpp:
        (WebCore::RenderFileUploadControl::positionForPoint):
        * rendering/RenderFileUploadControl.h:
        * rendering/RenderFlexibleBox.cpp:
        (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
        (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
        * rendering/RenderFlowThread.cpp:
        (WebCore::RenderFlowThread::RenderFlowThread):
        (WebCore::RenderFlowThread::styleDidChange):
        (WebCore::RenderFlowThread::removeFlowChildInfo):
        (WebCore::RenderFlowThread::removeFragmentFromThread):
        (WebCore::RenderFlowThread::invalidateFragments):
        (WebCore::RenderFlowThread::validateFragments):
        (WebCore::RenderFlowThread::layout):
        (WebCore::RenderFlowThread::updateLogicalWidth):
        (WebCore::RenderFlowThread::computeLogicalHeight const):
        (WebCore::RenderFlowThread::repaintRectangleInFragments const):
        (WebCore::RenderFlowThread::fragmentAtBlockOffset const):
        (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent const):
        (WebCore::RenderFlowThread::pageLogicalTopForOffset const):
        (WebCore::RenderFlowThread::pageLogicalWidthForOffset const):
        (WebCore::RenderFlowThread::pageLogicalHeightForOffset const):
        (WebCore::RenderFlowThread::pageRemainingLogicalHeightForOffset const):
        (WebCore::RenderFlowThread::mapFromFlowToFragment const):
        (WebCore::RenderFlowThread::removeRenderBoxFragmentInfo):
        (WebCore::RenderFlowThread::removeLineFragmentInfo):
        (WebCore::RenderFlowThread::logicalWidthChangedInFragmentsForBlock):
        (WebCore::RenderFlowThread::contentLogicalWidthOfFirstFragment const):
        (WebCore::RenderFlowThread::contentLogicalHeightOfFirstFragment const):
        (WebCore::RenderFlowThread::contentLogicalLeftOfFirstFragment const):
        (WebCore::RenderFlowThread::firstFragment const):
        (WebCore::RenderFlowThread::lastFragment const):
        (WebCore::RenderFlowThread::clearRenderBoxFragmentInfoAndCustomStyle):
        (WebCore::RenderFlowThread::setFragmentRangeForBox):
        (WebCore::RenderFlowThread::hasCachedFragmentRangeForBox const):
        (WebCore::RenderFlowThread::getFragmentRangeForBoxFromCachedInfo const):
        (WebCore::RenderFlowThread::getFragmentRangeForBox const):
        (WebCore::RenderFlowThread::computedFragmentRangeForBox const):
        (WebCore::RenderFlowThread::fragmentInRange const):
        (WebCore::RenderFlowThread::objectShouldFragmentInFlowFragment const):
        (WebCore::RenderFlowThread::objectInFlowFragment const):
        (WebCore::RenderFlowThread::checkLinesConsistency const):
        (WebCore::RenderFlowThread::clearLinesToFragmentMap):
        (WebCore::RenderFlowThread::deleteLines):
        (WebCore::RenderFlowThread::willBeDestroyed):
        (WebCore::RenderFlowThread::markFragmentsForOverflowLayoutIfNeeded):
        (WebCore::RenderFlowThread::updateFragmentsFlowThreadPortionRect):
        (WebCore::RenderFlowThread::addForcedFragmentBreak):
        (WebCore::RenderFlowThread::collectLayerFragments):
        (WebCore::RenderFlowThread::fragmentsBoundingBox):
        (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstFragment const):
        (WebCore::RenderFlowThread::FragmentSearchAdapter::collectIfNeeded):
        (WebCore::RenderFlowThread::mapLocalToContainer const):
        (WebCore::RenderFlowThread::addFragmentsVisualEffectOverflow):
        (WebCore::RenderFlowThread::addFragmentsVisualOverflowFromTheme):
        (WebCore::RenderFlowThread::addFragmentsOverflowFromChild):
        (WebCore::RenderFlowThread::addFragmentsLayoutOverflow):
        (WebCore::RenderFlowThread::addFragmentsVisualOverflow):
        (WebCore::RenderFlowThread::clearFragmentsOverflow):
        (WebCore::RenderFlowThread::currentFragment const):
        (WebCore::RenderFlowThread::containingFragmentMap):
        (WebCore::RenderFlowThread::removeRegionFromThread): Deleted.
        (WebCore::RenderFlowThread::invalidateRegions): Deleted.
        (WebCore::RenderFlowThread::validateRegions): Deleted.
        (WebCore::RenderFlowThread::repaintRectangleInRegions const): Deleted.
        (WebCore::RenderFlowThread::regionAtBlockOffset const): Deleted.
        (WebCore::RenderFlowThread::mapFromFlowToRegion const): Deleted.
        (WebCore::RenderFlowThread::removeRenderBoxRegionInfo): Deleted.
        (WebCore::RenderFlowThread::removeLineRegionInfo): Deleted.
        (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock): Deleted.
        (WebCore::RenderFlowThread::contentLogicalWidthOfFirstRegion const): Deleted.
        (WebCore::RenderFlowThread::contentLogicalHeightOfFirstRegion const): Deleted.
        (WebCore::RenderFlowThread::contentLogicalLeftOfFirstRegion const): Deleted.
        (WebCore::RenderFlowThread::firstRegion const): Deleted.
        (WebCore::RenderFlowThread::lastRegion const): Deleted.
        (WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle): Deleted.
        (WebCore::RenderFlowThread::setRegionRangeForBox): Deleted.
        (WebCore::RenderFlowThread::hasCachedRegionRangeForBox const): Deleted.
        (WebCore::RenderFlowThread::getRegionRangeForBoxFromCachedInfo const): Deleted.
        (WebCore::RenderFlowThread::getRegionRangeForBox const): Deleted.
        (WebCore::RenderFlowThread::computedRegionRangeForBox const): Deleted.
        (WebCore::RenderFlowThread::regionInRange const): Deleted.
        (WebCore::RenderFlowThread::objectShouldFragmentInFlowRegion const): Deleted.
        (WebCore::RenderFlowThread::objectInFlowRegion const): Deleted.
        (WebCore::RenderFlowThread::clearLinesToRegionMap): Deleted.
        (WebCore::RenderFlowThread::markRegionsForOverflowLayoutIfNeeded): Deleted.
        (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect): Deleted.
        (WebCore::RenderFlowThread::addForcedRegionBreak): Deleted.
        (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion const): Deleted.
        (WebCore::RenderFlowThread::RegionSearchAdapter::collectIfNeeded): Deleted.
        (WebCore::RenderFlowThread::addRegionsVisualEffectOverflow): Deleted.
        (WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme): Deleted.
        (WebCore::RenderFlowThread::addRegionsOverflowFromChild): Deleted.
        (WebCore::RenderFlowThread::addRegionsLayoutOverflow): Deleted.
        (WebCore::RenderFlowThread::addRegionsVisualOverflow): Deleted.
        (WebCore::RenderFlowThread::clearRegionsOverflow): Deleted.
        (WebCore::RenderFlowThread::currentRegion const): Deleted.
        (WebCore::RenderFlowThread::containingRegionMap): Deleted.
        * rendering/RenderFlowThread.h:
        (WTF::ValueToString<WebCore::RenderFragmentContainer::string):
        (WTF::ValueToString<WebCore::RenderRegion::string): Deleted.
        * rendering/RenderFragmentContainer.cpp: Copied from rendering/RenderRegion.cpp.
        (WebCore::RenderFragmentContainer::RenderFragmentContainer):
        (WebCore::RenderFragmentContainer::mapFragmentPointIntoFlowThreadCoordinates):
        (WebCore::RenderFragmentContainer::positionForPoint):
        (WebCore::RenderFragmentContainer::pageLogicalWidth const):
        (WebCore::RenderFragmentContainer::pageLogicalHeight const):
        (WebCore::RenderFragmentContainer::logicalHeightOfAllFlowThreadContent const):
        (WebCore::RenderFragmentContainer::flowThreadPortionOverflowRect):
        (WebCore::RenderFragmentContainer::flowThreadPortionLocation const):
        (WebCore::RenderFragmentContainer::overflowRectForFlowThreadPortion):
        (WebCore::RenderFragmentContainer::pageLogicalTopForOffset const):
        (WebCore::RenderFragmentContainer::isFirstFragment const):
        (WebCore::RenderFragmentContainer::isLastFragment const):
        (WebCore::RenderFragmentContainer::shouldClipFlowThreadContent const):
        (WebCore::RenderFragmentContainer::styleDidChange):
        (WebCore::RenderFragmentContainer::computeOverflowFromFlowThread):
        (WebCore::RenderFragmentContainer::repaintFlowThreadContent):
        (WebCore::RenderFragmentContainer::repaintFlowThreadContentRectangle):
        (WebCore::RenderFragmentContainer::installFlowThread):
        (WebCore::RenderFragmentContainer::attachFragment):
        (WebCore::RenderFragmentContainer::detachFragment):
        (WebCore::RenderFragmentContainer::renderBoxFragmentInfo const):
        (WebCore::RenderFragmentContainer::setRenderBoxFragmentInfo):
        (WebCore::RenderFragmentContainer::takeRenderBoxFragmentInfo):
        (WebCore::RenderFragmentContainer::removeRenderBoxFragmentInfo):
        (WebCore::RenderFragmentContainer::deleteAllRenderBoxFragmentInfo):
        (WebCore::RenderFragmentContainer::logicalTopOfFlowThreadContentRect const):
        (WebCore::RenderFragmentContainer::logicalBottomOfFlowThreadContentRect const):
        (WebCore::RenderFragmentContainer::insertedIntoTree):
        (WebCore::RenderFragmentContainer::willBeRemovedFromTree):
        (WebCore::RenderFragmentContainer::computeIntrinsicLogicalWidths const):
        (WebCore::RenderFragmentContainer::computePreferredLogicalWidths):
        (WebCore::RenderFragmentContainer::adjustFragmentBoundsFromFlowThreadPortionRect const):
        (WebCore::RenderFragmentContainer::ensureOverflowForBox):
        (WebCore::RenderFragmentContainer::rectFlowPortionForBox const):
        (WebCore::RenderFragmentContainer::addLayoutOverflowForBox):
        (WebCore::RenderFragmentContainer::addVisualOverflowForBox):
        (WebCore::RenderFragmentContainer::layoutOverflowRectForBox):
        (WebCore::RenderFragmentContainer::visualOverflowRectForBox):
        (WebCore::RenderFragmentContainer::layoutOverflowRectForBoxForPropagation):
        (WebCore::RenderFragmentContainer::visualOverflowRectForBoxForPropagation):
        (WebCore::CurrentRenderFragmentContainerMaintainer::CurrentRenderFragmentContainerMaintainer):
        (WebCore::CurrentRenderFragmentContainerMaintainer::~CurrentRenderFragmentContainerMaintainer):
        (WebCore::RenderRegion::RenderRegion): Deleted.
        (WebCore::RenderRegion::mapRegionPointIntoFlowThreadCoordinates): Deleted.
        (WebCore::RenderRegion::positionForPoint): Deleted.
        (WebCore::RenderRegion::pageLogicalWidth const): Deleted.
        (WebCore::RenderRegion::pageLogicalHeight const): Deleted.
        (WebCore::RenderRegion::logicalHeightOfAllFlowThreadContent const): Deleted.
        (WebCore::RenderRegion::flowThreadPortionOverflowRect): Deleted.
        (WebCore::RenderRegion::flowThreadPortionLocation const): Deleted.
        (WebCore::RenderRegion::overflowRectForFlowThreadPortion): Deleted.
        (WebCore::RenderRegion::pageLogicalTopForOffset const): Deleted.
        (WebCore::RenderRegion::isFirstRegion const): Deleted.
        (WebCore::RenderRegion::isLastRegion const): Deleted.
        (WebCore::RenderRegion::shouldClipFlowThreadContent const): Deleted.
        (WebCore::RenderRegion::styleDidChange): Deleted.
        (WebCore::RenderRegion::computeOverflowFromFlowThread): Deleted.
        (WebCore::RenderRegion::repaintFlowThreadContent): Deleted.
        (WebCore::RenderRegion::repaintFlowThreadContentRectangle): Deleted.
        (WebCore::RenderRegion::installFlowThread): Deleted.
        (WebCore::RenderRegion::attachRegion): Deleted.
        (WebCore::RenderRegion::detachRegion): Deleted.
        (WebCore::RenderRegion::renderBoxRegionInfo const): Deleted.
        (WebCore::RenderRegion::setRenderBoxRegionInfo): Deleted.
        (WebCore::RenderRegion::takeRenderBoxRegionInfo): Deleted.
        (WebCore::RenderRegion::removeRenderBoxRegionInfo): Deleted.
        (WebCore::RenderRegion::deleteAllRenderBoxRegionInfo): Deleted.
        (WebCore::RenderRegion::logicalTopOfFlowThreadContentRect const): Deleted.
        (WebCore::RenderRegion::logicalBottomOfFlowThreadContentRect const): Deleted.
        (WebCore::RenderRegion::insertedIntoTree): Deleted.
        (WebCore::RenderRegion::willBeRemovedFromTree): Deleted.
        (WebCore::RenderRegion::computeIntrinsicLogicalWidths const): Deleted.
        (WebCore::RenderRegion::computePreferredLogicalWidths): Deleted.
        (WebCore::RenderRegion::adjustRegionBoundsFromFlowThreadPortionRect const): Deleted.
        (WebCore::RenderRegion::ensureOverflowForBox): Deleted.
        (WebCore::RenderRegion::rectFlowPortionForBox const): Deleted.
        (WebCore::RenderRegion::addLayoutOverflowForBox): Deleted.
        (WebCore::RenderRegion::addVisualOverflowForBox): Deleted.
        (WebCore::RenderRegion::layoutOverflowRectForBox): Deleted.
        (WebCore::RenderRegion::visualOverflowRectForBox): Deleted.
        (WebCore::RenderRegion::layoutOverflowRectForBoxForPropagation): Deleted.
        (WebCore::RenderRegion::visualOverflowRectForBoxForPropagation): Deleted.
        (WebCore::CurrentRenderRegionMaintainer::CurrentRenderRegionMaintainer): Deleted.
        (WebCore::CurrentRenderRegionMaintainer::~CurrentRenderRegionMaintainer): Deleted.
        * rendering/RenderFragmentContainer.h: Copied from rendering/RenderRegion.h.
        (WebCore::RenderFragmentContainer::isRenderFragmentContainerSet const):
        (WebCore::RenderFragmentContainer::absoluteQuadsForBoxInFragment):
        (WebCore::CurrentRenderFragmentContainerMaintainer::fragment const):
        (WebCore::RenderRegion::setFlowThreadPortionRect): Deleted.
        (WebCore::RenderRegion::flowThreadPortionRect const): Deleted.
        (WebCore::RenderRegion::flowThread const): Deleted.
        (WebCore::RenderRegion::isValid const): Deleted.
        (WebCore::RenderRegion::setIsValid): Deleted.
        (WebCore::RenderRegion::logicalTopForFlowThreadContent const): Deleted.
        (WebCore::RenderRegion::logicalBottomForFlowThreadContent const): Deleted.
        (WebCore::RenderRegion::isRenderRegionSet const): Deleted.
        (WebCore::RenderRegion::collectLayerFragments): Deleted.
        (WebCore::RenderRegion::absoluteQuadsForBoxInRegion): Deleted.
        (WebCore::CurrentRenderRegionMaintainer::region const): Deleted.
        * rendering/RenderFragmentContainerSet.cpp: Copied from rendering/RenderRegionSet.cpp.
        (WebCore::RenderFragmentContainerSet::RenderFragmentContainerSet):
        (WebCore::RenderFragmentContainerSet::installFlowThread):
        (WebCore::RenderFragmentContainerSet::expandToEncompassFlowThreadContentsIfNeeded):
        (WebCore::RenderRegionSet::RenderRegionSet): Deleted.
        (WebCore::RenderRegionSet::installFlowThread): Deleted.
        (WebCore::RenderRegionSet::expandToEncompassFlowThreadContentsIfNeeded): Deleted.
        * rendering/RenderFragmentContainerSet.h: Copied from rendering/RenderRegionSet.h.
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::computeMarginLogicalSizeForChild const):
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::positionForPoint):
        (WebCore::RenderInline::linesVisualOverflowBoundingBoxInFragment const):
        (WebCore::RenderInline::linesVisualOverflowBoundingBoxInRegion const): Deleted.
        * rendering/RenderInline.h:
        * rendering/RenderLayer.cpp:
        (WebCore::accumulateOffsetTowardsAncestor):
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::paintIntoLayer):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::canBeComposited const):
        * rendering/RenderLineBreak.cpp:
        (WebCore::RenderLineBreak::positionForPoint):
        * rendering/RenderLineBreak.h:
        * rendering/RenderMultiColumnFlowThread.cpp:
        (WebCore::RenderMultiColumnFlowThread::addFragmentToThread):
        (WebCore::RenderMultiColumnFlowThread::willBeRemovedFromTree):
        (WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant):
        (WebCore::RenderMultiColumnFlowThread::flowThreadRelativeWillBeRemoved):
        (WebCore::RenderMultiColumnFlowThread::setPageBreak):
        (WebCore::RenderMultiColumnFlowThread::updateMinimumPageHeight):
        (WebCore::RenderMultiColumnFlowThread::fragmentAtBlockOffset const):
        (WebCore::RenderMultiColumnFlowThread::setFragmentRangeForBox):
        (WebCore::RenderMultiColumnFlowThread::addForcedFragmentBreak):
        (WebCore::RenderMultiColumnFlowThread::offsetFromContainer const):
        (WebCore::RenderMultiColumnFlowThread::mapAbsoluteToLocalPoint const):
        (WebCore::RenderMultiColumnFlowThread::physicalTranslationFromFragmentToFlow const):
        (WebCore::RenderMultiColumnFlowThread::mapFromFlowToFragment const):
        (WebCore::RenderMultiColumnFlowThread::physicalTranslationOffsetFromFlowToFragment const):
        (WebCore::RenderMultiColumnFlowThread::physicalTranslationFromFlowToFragment const):
        (WebCore::RenderMultiColumnFlowThread::addRegionToThread): Deleted.
        (WebCore::RenderMultiColumnFlowThread::regionAtBlockOffset const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::setRegionRangeForBox): Deleted.
        (WebCore::RenderMultiColumnFlowThread::addForcedRegionBreak): Deleted.
        (WebCore::RenderMultiColumnFlowThread::physicalTranslationFromRegionToFlow const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::mapFromFlowToRegion const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::physicalTranslationOffsetFromFlowToRegion const): Deleted.
        (WebCore::RenderMultiColumnFlowThread::physicalTranslationFromFlowToRegion const): Deleted.
        * rendering/RenderMultiColumnFlowThread.h:
        * rendering/RenderMultiColumnSet.cpp:
        (WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
        (WebCore::RenderMultiColumnSet::updateLogicalWidth):
        (WebCore::RenderMultiColumnSet::beginFlow):
        (WebCore::RenderMultiColumnSet::endFlow):
        (WebCore::RenderMultiColumnSet::layout):
        (WebCore::RenderMultiColumnSet::flowThreadPortionOverflowRect):
        (WebCore::RenderMultiColumnSet::repaintFlowThreadContent):
        (WebCore::RenderMultiColumnSet::collectLayerFragments):
        (WebCore::RenderMultiColumnSet::adjustFragmentBoundsFromFlowThreadPortionRect const):
        (WebCore::RenderMultiColumnSet::positionForPoint):
        (WebCore::RenderMultiColumnSet::translateFragmentPointToFlowThread const):
        (WebCore::RenderMultiColumnSet::updateHitTestResult):
        (WebCore::RenderMultiColumnSet::adjustRegionBoundsFromFlowThreadPortionRect const): Deleted.
        (WebCore::RenderMultiColumnSet::translateRegionPointToFlowThread const): Deleted.
        * rendering/RenderMultiColumnSet.h:
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::containerForRepaint const):
        (WebCore::RenderObject::repaintUsingContainer const):
        (WebCore::RenderObject::outputRegionsInformation const):
        (WebCore::RenderObject::positionForPoint):
        * rendering/RenderObject.h:
        (WebCore::RenderObject::isRenderFragmentContainer const):
        (WebCore::RenderObject::isRenderRegion const): Deleted.
        * rendering/RenderRegion.cpp: Removed.
        * rendering/RenderRegion.h: Removed.
        * rendering/RenderRegionSet.cpp: Removed.
        * rendering/RenderRegionSet.h: Removed.
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::positionForPoint):
        * rendering/RenderReplaced.h:
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::updateLogicalWidth):
        (WebCore::RenderTable::overflowClipRect):
        * rendering/RenderTable.h:
        * rendering/RenderText.cpp:
        (WebCore::RenderText::positionForPoint):
        * rendering/RenderText.h:
        * rendering/RenderTreeAsText.cpp:
        * rendering/RenderingAllInOne.cpp:
        * rendering/RootInlineBox.cpp:
        (WebCore::containingFragmentMap):
        (WebCore::RootInlineBox::~RootInlineBox):
        (WebCore::RootInlineBox::containingFragment const):
        (WebCore::RootInlineBox::clearContainingFragment):
        (WebCore::RootInlineBox::setContainingFragment):
        (WebCore::containingRegionMap): Deleted.
        (WebCore::RootInlineBox::containingRegion const): Deleted.
        (WebCore::RootInlineBox::clearContainingRegion): Deleted.
        (WebCore::RootInlineBox::setContainingRegion): Deleted.
        * rendering/RootInlineBox.h:
        * rendering/shapes/ShapeOutsideInfo.cpp:
        (WebCore::ShapeOutsideInfo::logicalLeftOffset const):
        * rendering/style/RenderStyleConstants.h:
        * rendering/svg/RenderSVGInlineText.cpp:
        (WebCore::RenderSVGInlineText::positionForPoint):
        * rendering/svg/RenderSVGInlineText.h:
        * rendering/svg/RenderSVGText.cpp:
        (WebCore::RenderSVGText::positionForPoint):
        * rendering/svg/RenderSVGText.h:

2017-09-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Introduce CurlResponse to hold response information among threads.
        https://bugs.webkit.org/show_bug.cgi?id=177496

        Reviewed by Alex Christensen.

        * platform/network/curl/AuthenticationChallenge.h:
        * platform/network/curl/AuthenticationChallengeCurl.cpp:
        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
        (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlHandle::getHttpConnectCode):
        * platform/network/curl/CurlContext.h:
        * platform/network/curl/CurlResponse.h: Added.
        (WebCore::CurlResponse::isolatedCopy const):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
        (WebCore::ResourceHandleCurlDelegate::didReceiveContentData):
        (WebCore::ResourceHandleCurlDelegate::handleLocalReceiveResponse):
        (WebCore::ResourceHandleCurlDelegate::didFinish):
        (WebCore::ResourceHandleCurlDelegate::handleDataURL):
        (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
        (WebCore::isHttpInfo): Deleted.
        * platform/network/curl/ResourceHandleCurlDelegate.h:
        * platform/network/curl/ResourceResponse.h:
        (WebCore::ResourceResponse::ResourceResponse):
        (WebCore::ResourceResponse::setResponseFired): Deleted.
        (WebCore::ResourceResponse::responseFired): Deleted.
        * platform/network/curl/ResourceResponseCurl.cpp:
        (WebCore::ResourceResponse::ResourceResponse):
        (WebCore::ResourceResponse::appendHTTPHeaderField):
        (WebCore::ResourceResponse::setStatusLine):

2017-09-26  Chris Dumez  <cdumez@apple.com>

        Make StoredCredentials an enum class and rename its header
        https://bugs.webkit.org/show_bug.cgi?id=177455

        Reviewed by Youenn Fablet.

        Follow-up to r222467, actually make it an enum *class*.

        * platform/network/StoredCredentialsPolicy.h:
        (): Deleted.

2017-09-26  Daniel Bates  <dabates@apple.com>

        Remove extraneous includes of TextRun.h
        https://bugs.webkit.org/show_bug.cgi?id=177499

        Reviewed by Myles C. Maxfield.

        No functionality changed. So, no new tests.

        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
        * platform/mac/DragImageMac.mm:
        * platform/text/ios/LocalizedDateCache.mm:
        * testing/InternalSettings.cpp:

2017-09-26  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        [PAL] Move Clock into PAL
        https://bugs.webkit.org/show_bug.cgi?id=174342

        Reviewed by Myles C. Maxfield.

        No new tests. No change in behavior.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * html/MediaController.cpp:
        (MediaController::MediaController):
        * html/MediaController.h:
        * platform/Clock.cpp: Removed.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
        * platform/mac/PlatformClockCA.cpp: Removed. PlatformClockCA is no longer used.
        * platform/mac/PlatformClockCA.h: Removed.

2017-09-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Change member variable of CurlHandle to use std::unique_ptr
        https://bugs.webkit.org/show_bug.cgi?id=177492

        Reviewed by Alex Christensen.

        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::init):
        (WebCore::CurlDownload::getResponse const):
        (WebCore::CurlDownload::setupTransfer):
        (WebCore::CurlDownload::didCompleteTransfer):
        (WebCore::CurlDownload::didCancelTransfer):
        (WebCore::CurlDownload::didReceiveHeader):
        (WebCore::CurlDownload::addHeaders): Deleted.
        * platform/network/curl/CurlDownload.h:
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
        (WebCore::ResourceHandleCurlDelegate::start):
        (WebCore::ResourceHandleCurlDelegate::setDefersLoading):
        (WebCore::ResourceHandleCurlDelegate::setAuthentication):
        (WebCore::ResourceHandleCurlDelegate::setupTransfer):
        (WebCore::ResourceHandleCurlDelegate::didCompleteTransfer):
        (WebCore::ResourceHandleCurlDelegate::didCancelTransfer):
        (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
        (WebCore::ResourceHandleCurlDelegate::handleLocalReceiveResponse):
        (WebCore::ResourceHandleCurlDelegate::setupPOST):
        (WebCore::ResourceHandleCurlDelegate::setupPUT):
        (WebCore::ResourceHandleCurlDelegate::setupFormData):
        (WebCore::ResourceHandleCurlDelegate::applyAuthentication):
        (WebCore::ResourceHandleCurlDelegate::getNetworkLoadMetrics):
        (WebCore::ResourceHandleCurlDelegate::willSetupSslCtx):
        (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
        (WebCore::ResourceHandleCurlDelegate::didReceiveData):
        * platform/network/curl/ResourceHandleCurlDelegate.h:

2017-09-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Simplify JobManager's duty and move the tasks to client
        for easy handling. Also simlify CurlHandle by not storing internal
        error value as a member variable.
        https://bugs.webkit.org/show_bug.cgi?id=177466

        Reviewed by Alex Christensen.

        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlHandle::perform):
        (WebCore::CurlHandle::pause):
        (WebCore::CurlHandle::getEffectiveURL):
        (WebCore::CurlHandle::getPrimaryPort):
        (WebCore::CurlHandle::getResponseCode):
        (WebCore::CurlHandle::getContentLength):
        (WebCore::CurlHandle::getHttpAuthAvail):
        (WebCore::CurlHandle::getNetworkLoadMetrics):
        * platform/network/curl/CurlContext.h:
        (WebCore::CurlHandle::errorCode const): Deleted.
        (WebCore::CurlHandle::setErrorCode): Deleted.
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::start):
        (WebCore::CurlDownload::cancel):
        (WebCore::CurlDownload::setupTransfer):
        (WebCore::CurlDownload::didCompleteTransfer):
        (WebCore::CurlDownload::didCancelTransfer):
        (WebCore::CurlDownload::setupRequest): Deleted.
        (WebCore::CurlDownload::notifyFinish): Deleted.
        (WebCore::CurlDownload::notifyFail): Deleted.
        * platform/network/curl/CurlDownload.h:
        * platform/network/curl/CurlJobManager.cpp:
        (WebCore::CurlJobList::startJobs):
        (WebCore::CurlJobList::finishJobs):
        (WebCore::CurlJobManager::add):
        (WebCore::CurlJobManager::cancel):
        (WebCore::CurlJobManager::callOnJobThread):
        (WebCore::CurlJobManager::updateJobList):
        (WebCore::CurlJobManager::workerThread):
        (WebCore::CurlJobList::notifyResult): Deleted.
        * platform/network/curl/CurlJobManager.h:
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::start):
        (WebCore::ResourceHandleCurlDelegate::cancel):
        (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
        (WebCore::ResourceHandleCurlDelegate::setupTransfer):
        (WebCore::ResourceHandleCurlDelegate::didCompleteTransfer):
        (WebCore::ResourceHandleCurlDelegate::didCancelTransfer):
        (WebCore::ResourceHandleCurlDelegate::didFinish):
        (WebCore::ResourceHandleCurlDelegate::didFail):
        (WebCore::ResourceHandleCurlDelegate::setupRequest): Deleted.
        (WebCore::ResourceHandleCurlDelegate::notifyFinish): Deleted.
        (WebCore::ResourceHandleCurlDelegate::notifyFail): Deleted.
        * platform/network/curl/ResourceHandleCurlDelegate.h:

2017-09-26  Daniel Bates  <dabates@apple.com>

        Cleanup: Consolidate non-selection background painting code for text
        https://bugs.webkit.org/show_bug.cgi?id=177490

        Reviewed by Zalan Bujtas.

        Share code to paint the background of a text subrange instead of duplicating
        it for text match markers and composition underlines.

        Additionally standardize the argument order for various paint functions and
        make more paint functions private.

        No functionality changed. So, no new tests.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paint): Updated code as needed for changes below.
        (WebCore::InlineTextBox::paintSelection): Add FIXME comment to fix up this code for
        combined text while I am in this file.
        (WebCore::InlineTextBox::paintTextSubrangeBackground): Added. Extracted from the common code of
        paintCompositionBackground() and paintTextMatchMarker().
        (WebCore::InlineTextBox::paintCompositionBackground): Modified to use paintTextSubrangeBackground().
        (WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
        (WebCore::InlineTextBox::paintDocumentMarker): Add FIXME comment to fix up this code for
        combined and hyphenated text while I am here.
        (WebCore::InlineTextBox::paintDocumentMarkers): Update code as needed for changes
        above.
        * rendering/InlineTextBox.h: Change visibility of paintCompositionBackground(),
        paintDocumentMarkers() and paintCompositionUnderline() from protected to private
        as no derived class makes use of these functions. Group related functions to
        improve readability.

2017-09-26  Dean Jackson  <dino@apple.com>

        Unreviewed. Remove hardware concurrency from features list.

        * features.json:

2017-09-26  Antti Koivisto  <antti@apple.com>

        REGRESSION (222040): Google Maps Street View CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::PropertyWrapperAcceleratedTransform::blend const + 92
        https://bugs.webkit.org/show_bug.cgi?id=177485

        Reviewed by Zalan Bujtas.

        We crash when animating between two different types of transforms because renderer is null for the first frame.

        Test: fast/animation/animation-mixed-transform-crash.html

        * page/animation/AnimationBase.cpp:
        (WebCore::AnimationBase::currentStyle const):

            Add a way to get the current style from animations.
            This is either the render style or the inital style.

        * page/animation/AnimationBase.h:
        * page/animation/CSSPropertyAnimation.cpp:
        (WebCore::blendFunc):

            Renderer may be null when computing the first frame of the animation. Null check.

        (WebCore::blendFilter):

            Here too.

        * page/animation/CompositeAnimation.cpp:
        (WebCore::CompositeAnimation::updateTransitions):
        * page/animation/ImplicitAnimation.h:
        * page/animation/KeyframeAnimation.h:

2017-09-26  Zan Dobersek  <zdobersek@igalia.com>

        [EME] Add ClearKey support for persistent session data load and removal
        https://bugs.webkit.org/show_bug.cgi?id=177442

        Reviewed by Xabier Rodriguez-Calvar.

        Implement the session data load and removal for persistent sessions
        in the ClearKey implementation of the CDMInstance interface.

        CDMInstanceClearKey::loadSession() finds data for the specified session
        name, if any, and constructs a corresponding KeyStatusVector object that
        holds information about all known keys associated with this session before
        dispatching the LoadSessionCallback asynchronously.

        CDMInstanceClearKey::removeSessionData() similarly finds the session data,
        if any, and then removes it from the state tracker. The key data is still
        reused to construct the KeyStatusVector object that holds information
        about all the keys that were stored for this session. The key information
        is also embedded in the 'license release' JSON message. Both key status
        vector and message are then used in the RemoveSessionDataCallback dispatch
        that is again done asynchronously.

        No new tests -- affected tests have their baselines updated.

        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::CDMInstanceClearKey::loadSession):
        (WebCore::CDMInstanceClearKey::removeSessionData):

2017-09-26  Ms2ger  <Ms2ger@igalia.com>

        Update compressedTexImage3D to match the signature in the specification.
        https://bugs.webkit.org/show_bug.cgi?id=177431

        Reviewed by Sam Weinig.

        No new tests: not much point in adding tests now; this method doesn't
        do anything anyway.

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::compressedTexImage3D):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:

2017-09-25  Timothy Horton  <timothy_horton@apple.com>

        Fix the macOS WebCore CMake build

        * PlatformMac.cmake:

2017-09-25  Alex Christensen  <achristensen@webkit.org>

        Make PolicyAction an encodable enum class
        https://bugs.webkit.org/show_bug.cgi?id=177480

        Reviewed by Antti Koivisto.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::responseReceived):
        (WebCore::DocumentLoader::continueAfterContentPolicy):
        * loader/FrameLoaderTypes.h:
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNavigationPolicy):
        (WebCore::PolicyChecker::checkNewWindowPolicy):

2017-09-25  Timothy Horton  <timothy_horton@apple.com>

        Fix the macOS WebCore CMake build

        * PlatformMac.cmake:

2017-09-25  Frederik Riedel  <riedel@apple.com>

        Expose way to set values of classified form controls as {Legacy WebKit, WebKit} SPI
        https://bugs.webkit.org/show_bug.cgi?id=174394
        <rdar://problem/33183504>

        Reviewed by Ryosuke Niwa.

        * WebCore.xcodeproj/project.pbxproj:
        * editing/ios/AutofillElements.cpp: Added.
        (WebCore::isAutofillableElement): Returns true if the element is of type text or email.
        (WebCore::nextAutofillableElement): Returns the next focusable element that is autofillable.
        (WebCore::previousAutofillableElement): Returns the previous focusable element that is autofillable.
        (WebCore::AutofillElements::computeAutofillElements): Computes the autofill elements (username & password)
        for a given input element.
        (WebCore::AutofillElements::autofill): Fills the credentials into the pair of username/password elements.
        * editing/ios/AutofillElements.h: Added.

2017-09-25  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: move Console.addInspectedNode to DOM.setInspectedNode
        https://bugs.webkit.org/show_bug.cgi?id=176827

        Reviewed by Joseph Pecoraro.

        Tests: http/tests/inspector/dom/cross-domain-inspected-node-access.html
               inspector/dom/setInspectedNode.html

        * inspector/InspectorDOMAgent.h:
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::setInspectedNode):

        * inspector/PageConsoleAgent.h:
        * inspector/PageConsoleAgent.cpp:
        (WebCore::PageConsoleAgent::addInspectedNode): Deleted.

        * inspector/WorkerConsoleAgent.h:
        * inspector/WorkerConsoleAgent.cpp:
        (WebCore::WorkerConsoleAgent::addInspectedNode): Deleted.

2017-09-25  Sam Weinig  <sam@webkit.org>

        [WebIDL] Factor out IsExceptionOr check from toJS/toJSNewlyCreated signature
        https://bugs.webkit.org/show_bug.cgi?id=177457

        Reviewed by Youenn Fablet.

        Add new type, IsExceptionOr, that factors out the previously repeated logic of determining
        if a type is an ExceptionOr template type.

        * bindings/js/JSDOMConvertBase.h:
        (WebCore::toJS):
        (WebCore::toJSNewlyCreated):

2017-09-25  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Refactor and improve methods in the CurlHandle
        https://bugs.webkit.org/show_bug.cgi?id=177373

        Reviewed by Alex Christensen.

        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlShareHandle::~CurlShareHandle):
        (WebCore::CurlMultiHandle::~CurlMultiHandle):
        (WebCore::CurlHandle::~CurlHandle):
        (WebCore::CurlHandle::initialize):
        (WebCore::CurlHandle::pause):
        (WebCore::CurlHandle::setUrl):
        (WebCore::CurlHandle::appendRequestHeaders):
        (WebCore::CurlHandle::appendRequestHeader):
        (WebCore::CurlHandle::removeRequestHeader):
        (WebCore::CurlHandle::enableRequestHeaders):
        (WebCore::CurlHandle::getContentLength):
        (WebCore::CurlHandle::getNetworkLoadMetrics):
        (WebCore::CurlHandle::errorDescription const): Deleted.
        (WebCore::CurlHandle::clearUrl): Deleted.
        (WebCore::CurlHandle::getContentLenghtDownload): Deleted.
        (WebCore::CurlHandle::getTimes): Deleted.
        * platform/network/curl/CurlContext.h:
        (WebCore::CurlHandle::privateData const): Deleted.
        (WebCore::CurlHandle::setPrivateData): Deleted.
        (WebCore::CurlHandle::url const): Deleted.
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::setupRequest):
        * platform/network/curl/CurlSSLVerifier.cpp:
        (WebCore::CurlSSLVerifier::certVerifyCallback):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::setupRequest):
        (WebCore::ResourceHandleCurlDelegate::setupPUT):
        (WebCore::ResourceHandleCurlDelegate::getNetworkLoadMetrics):
        (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):

2017-09-25  Youenn Fablet  <youenn@apple.com>

        WebRTC video does not resume receiving when switching back to Safari 11 on iOS
        https://bugs.webkit.org/show_bug.cgi?id=175472
        <rdar://problem/33860863>

        Reviewed by Darin Adler.

        Test: webrtc/video-interruption.html and manual testing.

        Using new SetActive method from libwebrtc encoder/decoder to enable/disable them based on interuptions.
        For that purpose, LibWebRTCProvider is now storing the peer connection factory and keeping track of the encoder/decoder factories.
        LibWebRTCProvider is then notified by WebPage when backgrounded/foregrounded.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::staticFactoryAndThreads):
        (WebCore::initializePeerConnectionFactoryAndThreads):
        (WebCore::LibWebRTCProvider::factory):
        (WebCore::LibWebRTCProvider::setPeerConnectionFactory):
        (WebCore::LibWebRTCProvider::createPeerConnection):
        (WebCore::LibWebRTCProvider::setActive):
        (WebCore::LibWebRTCProvider::webRTCAvailable):
        (WebCore::LibWebRTCProvider::mayResumePlayback): Deleted.
        (WebCore::LibWebRTCProvider::suspendPlayback): Deleted.
        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
        * platform/mediastream/libwebrtc/VideoToolBoxDecoderFactory.cpp: Copied from Source/WebCore/platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp.
        (WebCore::VideoToolboxVideoDecoderFactory::setActive):
        (WebCore::VideoToolboxVideoDecoderFactory::CreateVideoDecoder):
        (WebCore::VideoToolboxVideoDecoderFactory::DestroyVideoDecoder):
        * platform/mediastream/libwebrtc/VideoToolBoxDecoderFactory.h: Copied from Source/WebCore/platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.h.
        * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp:
        (WebCore::VideoToolboxVideoEncoderFactory::setActive):
        (WebCore::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder):
        (WebCore::VideoToolboxVideoEncoderFactory::DestroyVideoEncoder):
        * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.h:
        * testing/Internals.cpp:
        (WebCore::Internals::resetToConsistentState):
        * testing/MockLibWebRTCPeerConnection.cpp:
        (WebCore::useRealRTCPeerConnectionFactory):
        (WebCore::useMockRTCPeerConnectionFactory):
        * testing/MockLibWebRTCPeerConnection.h:

2017-09-25  Sam Weinig  <sam@webkit.org>

        Remove unused EditorClient functions
        https://bugs.webkit.org/show_bug.cgi?id=177463

        Reviewed by Alex Christensen.

        Remove unused EditorClient functions.

        * loader/EmptyClients.cpp:
        * page/EditorClient.h:

2017-09-25  Per Arne Vollan  <pvollan@apple.com>

        Crash in WebCore::TreeScope::documentScope
        https://bugs.webkit.org/show_bug.cgi?id=176159

        Reviewed by Ryosuke Niwa.

        When all children are replaced with a new node in ContainerNode::replaceAllChildren,
        the treescope of the new node should be set after the call to willRemoveChildren,
        since this call can fire events, and execute JS code, which might change the treescope
        of the container node.

        Test: fast/dom/crash-moving-subtree-between-documents.html

        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::replaceAllChildren):

2017-09-25  Alex Christensen  <achristensen@webkit.org>

        Make Attribute an enum class
        https://bugs.webkit.org/show_bug.cgi?id=177414

        Reviewed by Yusuke Suzuki.

        No change in behavior.

        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
        * bindings/js/JSDOMMapLike.cpp:
        (WebCore::initializeBackingMap):
        (WebCore::createBackingMap):
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::finishCreation):
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
        (WebCore::JSDOMWindow::getOwnPropertySlot):
        (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
        * bindings/js/JSDOMWindowProperties.cpp:
        (WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter):
        * bindings/js/JSImageDataCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::getOwnPropertySlotCommon):
        * bindings/js/JSPluginElementFunctions.cpp:
        (WebCore::pluginElementCustomGetOwnPropertySlot):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateIndexedGetter):
        (GenerateNamedGetter):
        (GetJSCAttributesForAttribute):
        (GeneratePropertiesHashTable):
        (addUnscopableProperties):
        (GenerateImplementation):
        (GenerateCallbackImplementationContent):
        (GenerateHashTableValueArray):
        (GenerateConstructorHelperMethods):
        (ComputeFunctionSpecial):
        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        (WebCore::JSInterfaceNameConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSMapLike.cpp:
        (WebCore::JSMapLikeConstructor::initializeProperties):
        (WebCore::JSMapLikePrototype::finishCreation):
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        (WebCore::JSReadOnlyMapLikeConstructor::initializeProperties):
        (WebCore::JSReadOnlyMapLikePrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        (WebCore::JSTestActiveDOMObjectConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        (WebCore::JSTestCEReactionsConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        (WebCore::JSTestCEReactionsStringifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestCallTracer.cpp:
        (WebCore::JSTestCallTracerConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        (WebCore::JSTestCallbackInterfaceConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        (WebCore::JSTestClassWithJSBuiltinConstructorConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::initializeProperties):
        (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        (WebCore::JSTestDOMJITConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
        (WebCore::JSTestEnabledBySettingConstructor::initializeProperties):
        (WebCore::JSTestEnabledBySetting::finishCreation):
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        (WebCore::JSTestEventConstructorConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        (WebCore::JSTestEventTargetConstructor::initializeProperties):
        (WebCore::JSTestEventTarget::getOwnPropertySlot):
        (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestException.cpp:
        (WebCore::JSTestExceptionConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        (WebCore::JSTestGenerateIsReachableConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        (WebCore::JSTestGlobalObjectConstructor::initializeProperties):
        (WebCore::JSTestGlobalObject::finishCreation):
        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
        (WebCore::JSTestIndexedSetterNoIdentifierConstructor::initializeProperties):
        (WebCore::JSTestIndexedSetterNoIdentifier::getOwnPropertySlot):
        (WebCore::JSTestIndexedSetterNoIdentifier::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
        (WebCore::JSTestIndexedSetterThrowingExceptionConstructor::initializeProperties):
        (WebCore::JSTestIndexedSetterThrowingException::getOwnPropertySlot):
        (WebCore::JSTestIndexedSetterThrowingException::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
        (WebCore::JSTestIndexedSetterWithIdentifierConstructor::initializeProperties):
        (WebCore::JSTestIndexedSetterWithIdentifier::getOwnPropertySlot):
        (WebCore::JSTestIndexedSetterWithIdentifier::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        (WebCore::JSTestInterfaceConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        (WebCore::JSTestInterfaceLeadingUnderscoreConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        (WebCore::JSTestIterableConstructor::initializeProperties):
        (WebCore::JSTestIterablePrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        (WebCore::JSTestJSBuiltinConstructorConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        (WebCore::JSTestMediaQueryListListenerConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
        (WebCore::JSTestNamedAndIndexedSetterNoIdentifierConstructor::initializeProperties):
        (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::getOwnPropertySlot):
        (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
        (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionConstructor::initializeProperties):
        (WebCore::JSTestNamedAndIndexedSetterThrowingException::getOwnPropertySlot):
        (WebCore::JSTestNamedAndIndexedSetterThrowingException::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
        (WebCore::JSTestNamedAndIndexedSetterWithIdentifierConstructor::initializeProperties):
        (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertySlot):
        (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        (WebCore::JSTestNamedConstructorConstructor::initializeProperties):
        (WebCore::JSTestNamedConstructorNamedConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
        (WebCore::JSTestNamedDeleterNoIdentifierConstructor::initializeProperties):
        (WebCore::JSTestNamedDeleterNoIdentifier::getOwnPropertySlot):
        (WebCore::JSTestNamedDeleterNoIdentifier::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
        (WebCore::JSTestNamedDeleterThrowingExceptionConstructor::initializeProperties):
        (WebCore::JSTestNamedDeleterThrowingException::getOwnPropertySlot):
        (WebCore::JSTestNamedDeleterThrowingException::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
        (WebCore::JSTestNamedDeleterWithIdentifierConstructor::initializeProperties):
        (WebCore::JSTestNamedDeleterWithIdentifier::getOwnPropertySlot):
        (WebCore::JSTestNamedDeleterWithIdentifier::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
        (WebCore::JSTestNamedDeleterWithIndexedGetterConstructor::initializeProperties):
        (WebCore::JSTestNamedDeleterWithIndexedGetter::getOwnPropertySlot):
        (WebCore::JSTestNamedDeleterWithIndexedGetter::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
        (WebCore::JSTestNamedGetterCallWithConstructor::initializeProperties):
        (WebCore::JSTestNamedGetterCallWith::getOwnPropertySlot):
        (WebCore::JSTestNamedGetterCallWith::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
        (WebCore::JSTestNamedGetterNoIdentifierConstructor::initializeProperties):
        (WebCore::JSTestNamedGetterNoIdentifier::getOwnPropertySlot):
        (WebCore::JSTestNamedGetterNoIdentifier::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
        (WebCore::JSTestNamedGetterWithIdentifierConstructor::initializeProperties):
        (WebCore::JSTestNamedGetterWithIdentifier::getOwnPropertySlot):
        (WebCore::JSTestNamedGetterWithIdentifier::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
        (WebCore::JSTestNamedSetterNoIdentifierConstructor::initializeProperties):
        (WebCore::JSTestNamedSetterNoIdentifier::getOwnPropertySlot):
        (WebCore::JSTestNamedSetterNoIdentifier::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
        (WebCore::JSTestNamedSetterThrowingExceptionConstructor::initializeProperties):
        (WebCore::JSTestNamedSetterThrowingException::getOwnPropertySlot):
        (WebCore::JSTestNamedSetterThrowingException::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
        (WebCore::JSTestNamedSetterWithIdentifierConstructor::initializeProperties):
        (WebCore::JSTestNamedSetterWithIdentifier::getOwnPropertySlot):
        (WebCore::JSTestNamedSetterWithIdentifier::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
        (WebCore::JSTestNamedSetterWithIndexedGetterConstructor::initializeProperties):
        (WebCore::JSTestNamedSetterWithIndexedGetter::getOwnPropertySlot):
        (WebCore::JSTestNamedSetterWithIndexedGetter::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
        (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterConstructor::initializeProperties):
        (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::getOwnPropertySlot):
        (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
        (WebCore::JSTestNamedSetterWithOverrideBuiltinsConstructor::initializeProperties):
        (WebCore::JSTestNamedSetterWithOverrideBuiltins::getOwnPropertySlot):
        (WebCore::JSTestNamedSetterWithOverrideBuiltins::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
        (WebCore::JSTestNamedSetterWithUnforgablePropertiesConstructor::initializeProperties):
        (WebCore::JSTestNamedSetterWithUnforgableProperties::getOwnPropertySlot):
        (WebCore::JSTestNamedSetterWithUnforgableProperties::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
        (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::initializeProperties):
        (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getOwnPropertySlot):
        (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::JSTestNodeConstructor::initializeProperties):
        (WebCore::JSTestNodePrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::JSTestObjConstructor::initializeProperties):
        (WebCore::JSTestObjPrototype::finishCreation):
        (WebCore::JSTestObj::getOwnPropertySlot):
        (WebCore::JSTestObj::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        (WebCore::JSTestOverloadedConstructorsConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        (WebCore::JSTestOverloadedConstructorsWithSequenceConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        (WebCore::JSTestOverrideBuiltinsConstructor::initializeProperties):
        (WebCore::JSTestOverrideBuiltins::getOwnPropertySlot):
        (WebCore::JSTestOverrideBuiltins::getOwnPropertySlotByIndex):
        * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
        (WebCore::JSTestPluginInterfaceConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        (WebCore::JSTestPromiseRejectionEventConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        (WebCore::JSTestSerializationConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
        (WebCore::JSTestSerializationIndirectInheritanceConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        (WebCore::JSTestSerializationInheritConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        (WebCore::JSTestSerializationInheritFinalConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifier.cpp:
        (WebCore::JSTestStringifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
        (WebCore::JSTestStringifierAnonymousOperationConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
        (WebCore::JSTestStringifierNamedOperationConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
        (WebCore::JSTestStringifierOperationImplementedAsConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
        (WebCore::JSTestStringifierOperationNamedToStringConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
        (WebCore::JSTestStringifierReadOnlyAttributeConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
        (WebCore::JSTestStringifierReadWriteAttributeConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        (WebCore::JSTestTypedefsConstructor::initializeProperties):
        * bridge/runtime_array.cpp:
        (JSC::RuntimeArray::getOwnPropertySlot):
        (JSC::RuntimeArray::getOwnPropertySlotByIndex):
        * bridge/runtime_method.cpp:
        (JSC::RuntimeMethod::getOwnPropertySlot):
        * bridge/runtime_object.cpp:
        (JSC::Bindings::RuntimeObject::getOwnPropertySlot):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):

2017-09-25  Alex Christensen  <achristensen@webkit.org>

        Stop using PolicyCallback
        https://bugs.webkit.org/show_bug.cgi?id=176088

        Reviewed by Andy Estes.

        This is what lambdas are for. No change in behavior.
        Cancelling the callback is now the responsibility of the FrameLoaderClient, to whom we have given the lambda.
        That is why there are changes in WebKit and WebKitLegacy where the FrameLoaderClient::cancelPolicyCheck finds the lambda it has stored.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * loader/DocumentLoader.cpp:
        * loader/FrameLoader.cpp:
        * loader/FrameLoaderClient.h:
        * loader/PolicyCallback.cpp: Removed.
        * loader/PolicyCallback.h: Removed.
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNavigationPolicy):
        (WebCore::PolicyChecker::checkNewWindowPolicy):
        (WebCore::PolicyChecker::stopCheck):
        (WebCore::PolicyChecker::continueAfterNavigationPolicy): Deleted.
        * loader/PolicyChecker.h:
        (WebCore::PolicyChecker::setSuggestedFilename): Deleted.

2017-09-25  Youenn Fablet  <youenn@apple.com>

        MediaStreamTrack.getSettings should compute its deviceId/groupId like enumerateDevices
        https://bugs.webkit.org/show_bug.cgi?id=177433

        Reviewed by Jer Noble.

        Covered by improved test.

        Hash the deviceId returned by getSettings as done by enumerateDevices/getUserMedia.
        Do the same thing for groupId.
        Make sure mock sources have their deviceId set consistently with mock devices.

        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::getSettings const):
        * Modules/mediastream/MediaStreamTrack.h:
        * Modules/mediastream/MediaStreamTrack.idl:
        * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
        * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
        (WebCore::MockRealtimeAudioSource::create):
        (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac):
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
        (WebCore::MockRealtimeVideoSource::create):
        (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac):
        * platform/mock/MockRealtimeAudioSource.cpp:
        (WebCore::MockRealtimeAudioSource::create):
        (WebCore::MockRealtimeAudioSource::createMuted):
        (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource):
        * platform/mock/MockRealtimeAudioSource.h:
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::create):
        (WebCore::MockRealtimeVideoSource::createMuted):
        (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
        * platform/mock/MockRealtimeVideoSource.h:

2017-09-25  Chris Dumez  <cdumez@apple.com>

        Make StoredCredentials an enum class and rename its header
        https://bugs.webkit.org/show_bug.cgi?id=177455

        Reviewed by Youenn Fablet.

        Make StoredCredentials an enum class and rename its header for clarity. This was error-prone because 0 meant
        "allow" and and 1 meant "do not allow". It was trivial to convert it to a boolean by mistake and get the
        opposite behavior.

        * WebCore.xcodeproj/project.pbxproj:
        * css/StyleRuleImport.cpp:
        (WebCore::StyleRuleImport::requestStyleSheet):
        * loader/CrossOriginAccessControl.cpp:
        (WebCore::updateRequestForAccessControl):
        (WebCore::createAccessControlPreflightRequest):
        (WebCore::passesAccessControlCheck):
        (WebCore::validatePreflightResponse):
        * loader/CrossOriginAccessControl.h:
        * loader/CrossOriginPreflightChecker.cpp:
        (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
        (WebCore::CrossOriginPreflightChecker::doPreflight):
        * loader/CrossOriginPreflightResultCache.cpp:
        (WebCore::CrossOriginPreflightResultCacheItem::allowsRequest const):
        (WebCore::CrossOriginPreflightResultCache::canSkipPreflight):
        * loader/CrossOriginPreflightResultCache.h:
        (WebCore::CrossOriginPreflightResultCacheItem::CrossOriginPreflightResultCacheItem):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::startLoadingMainResource):
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
        (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
        (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
        (WebCore::DocumentThreadableLoader::redirectReceived):
        (WebCore::DocumentThreadableLoader::preflightSuccess):
        (WebCore::DocumentThreadableLoader::loadRequest):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadResourceSynchronously):
        * loader/FrameLoader.h:
        * loader/LoaderStrategy.h:
        * loader/MediaResourceLoader.cpp:
        (WebCore::MediaResourceLoader::requestResource):
        * loader/NetscapePlugInStreamLoader.cpp:
        (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::shouldUseCredentialStorage):
        (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
        * loader/ResourceLoaderOptions.h:
        (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):
        (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
        * loader/ThreadableLoader.cpp:
        (WebCore::ThreadableLoaderOptions::isolatedCopy const):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::loadFrom):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::defaultCachedResourceOptions):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
        (WebCore::CachedResourceRequest::updateForAccessControl):
        * 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):
        * platform/network/BlobRegistryImpl.cpp:
        (WebCore::loadBlobResourceSynchronously):
        * platform/network/ResourceHandle.cpp:
        (WebCore::ResourceHandle::loadResourceSynchronously):
        * platform/network/ResourceHandle.h:
        * platform/network/StoredCredentialsPolicy.h: Renamed from Source/WebCore/platform/network/ResourceHandleTypes.h.
        * platform/network/cf/ResourceHandleCFNet.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/soup/ResourceHandleSoup.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * style/StylePendingResources.cpp:
        (WebCore::Style::loadPendingImage):
        * xml/XSLTProcessorLibxslt.cpp:
        (WebCore::docLoaderFunc):
        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::openFunc):

2017-09-25  Sam Weinig  <sam@webkit.org>

        Remove unnecessary userVisibleString EditorClient function
        https://bugs.webkit.org/show_bug.cgi?id=177456

        Reviewed by Dan Bernstein.

        The implementation of userVisibleString has been in WebCore for sometime (in WebCoreNSURLExtras)
        so there is no need to call through the EditorClient, just for it to call back to WebCore.

        * editing/Editor.h:

            Keep userVisibleString helper function but make it static, as it no longer needs
            any state. It is useful to have this helper, so non-ObjC code in Editor can get a
            userVisibleString.

        * editing/cocoa/EditorCocoa.mm:
        (WebCore::Editor::userVisibleString):

            Call through to the WebCoreNSURLExtras implementation.

        * editing/mac/EditorMac.mm:
        (WebCore::Editor::plainTextFromPasteboard):
        (WebCore::Editor::writeImageToPasteboard):
        (WebCore::Editor::userVisibleString): Deleted.
        * editing/mac/WebContentReaderMac.mm:
        (WebCore::WebContentReader::readFilenames):

            Replace client calls with direct calls.

        * loader/EmptyClients.cpp:
        * page/EditorClient.h:

            Remove client function.

        * testing/Internals.mm:
        (WebCore::Internals::userVisibleString):

            Replace client call with direct call.

2017-09-25  Timothy Horton  <timothy_horton@apple.com>

        Fix the build with <attachment> disabled

        * editing/mac/WebContentReaderMac.mm:

2017-09-25  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed Windows build fix.

        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
        (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer):

2017-09-25  Commit Queue  <commit-queue@webkit.org>

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

        broke iOS build (Requested by alexchristensen on #webkit).

        Reverted changeset:

        "Add WKContentRuleList notify action type"
        https://bugs.webkit.org/show_bug.cgi?id=177013
        http://trac.webkit.org/changeset/222455

2017-09-25  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        Building release with -DLOG_DISABLED=0 fails
        https://bugs.webkit.org/show_bug.cgi?id=177441

        Reviewed by Michael Catanzaro.

        No new tests, it is a build fix.

        * Modules/indexeddb/IDBKeyPath.cpp:
        * Modules/indexeddb/IDBKeyPath.h:

2017-09-25  Brent Fulgham  <bfulgham@apple.com>

        Switch back to partitioning (rather than blocking) prevalent origins without interaction
        https://bugs.webkit.org/show_bug.cgi?id=177452
        <rdar://problem/34632618>

        Reviewed by Chris Dumez.

        Temporarily revert to "partition-only" behavior, due to site compatibility issues with
        full blocking.

        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):

2017-09-25  Alex Christensen  <achristensen@webkit.org>

        Separate form submission from PolicyChecker infrastructure
        https://bugs.webkit.org/show_bug.cgi?id=177396

        Reviewed by Geoffrey Garen.

        We used PolicyChecker for WillSubmitForm even though we just need a completion handler
        with no parameters.  That is what lambdas and WTF::Functions are for.

        No change in behavior.

        * loader/EmptyClients.cpp:
        (WebCore::EmptyFrameLoaderClient::dispatchWillSubmitForm):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
        (WebCore::FrameLoader::continueLoadAfterWillSubmitForm): Deleted.
        * loader/FrameLoader.h:
        * loader/FrameLoaderClient.h:
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::continueLoadAfterWillSubmitForm): Deleted.
        * loader/PolicyChecker.h:

2017-09-25  Alex Christensen  <achristensen@webkit.org>

        Add WKContentRuleList notify action type
        https://bugs.webkit.org/show_bug.cgi?id=177013
        <rdar://problem/31073936>

        Reviewed by Darin Adler.

        Covered by new API tests.

        * contentextensions/ContentExtensionActions.h:
        (WebCore::ContentExtensions::hasStringArgument):
        * contentextensions/ContentExtensionCompiler.cpp:
        (WebCore::ContentExtensions::resolvePendingDisplayNoneActions):
        (WebCore::ContentExtensions::serializeActions):
        * contentextensions/ContentExtensionError.cpp:
        (WebCore::ContentExtensions::contentExtensionErrorCategory):
        * contentextensions/ContentExtensionError.h:
        * contentextensions/ContentExtensionParser.cpp:
        (WebCore::ContentExtensions::loadAction):
        * contentextensions/ContentExtensionRule.cpp:
        (WebCore::ContentExtensions::Action::deserialize):
        (WebCore::ContentExtensions::Action::deserializeType):
        (WebCore::ContentExtensions::Action::serializedLength):
        * contentextensions/ContentExtensionRule.h:
        (WebCore::ContentExtensions::Action::Action):
        * contentextensions/ContentExtensionsBackend.cpp:
        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad):
        (WebCore::ContentExtensions::applyBlockedStatusToRequest):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadResourceSynchronously):
        * loader/PingLoader.cpp:
        (WebCore::processContentExtensionRulesForLoad):
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::willSendRequestInternal):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestResource):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::applyBlockedStatus):
        * loader/cache/CachedResourceRequest.h:
        * page/ChromeClient.h:

2017-09-25  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove GetterMayThrowException
        https://bugs.webkit.org/show_bug.cgi?id=177422

        Reviewed by Youenn Fablet.

        * bindings/js/JSDOMConvertBase.h:
        (WebCore::toJSNewlyCreated):
        (WebCore::toJS):

            Add overloads of toJS and toJSNewlyCreated that take ThrowScopes and a value that
            is not an ExceptionOr (keeping the existing overloads that take an ExceptionOr).
            This allows NativeToJSValue to not need to know of a conversion can throw, as the
            c++ type system will now make the determination for it.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateSerializerDefinition):
        (NativeToJSValueUsingReferences):
        (NativeToJSValueUsingPointers):
        (NativeToJSValue):

            Always assume an exception can be thrown for attributes now that the converters will
            do the right thing based on whether the value is an ExceptionOr or not. Also, remove 
            $suppressExceptionCheck and $excludeNullability, they were never being set.

        * bindings/scripts/IDLAttributes.json:

            Remove GetterMayThrowException from the list of supported extended attributes.

        * Modules/indexeddb/IDBRequest.idl:
        * Modules/mediasource/SourceBuffer.idl:
        * Modules/webdatabase/SQLResultSet.idl:
        * bindings/scripts/test/TestObj.idl:
        * bindings/scripts/test/TestTypedefs.idl:
        * dom/Document.idl:
        * html/HTMLInputElement.idl:
        * page/DOMWindow.idl:
        * page/History.idl:
        * svg/SVGLength.idl:
        * xml/XMLHttpRequest.idl:
        * xml/XPathResult.idl:
        
            Remove GetterMayThrowException extended attribute from IDL files.

        * bindings/scripts/test/JS/JSMapLike.cpp:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        * bindings/scripts/test/JS/JSTestCallTracer.cpp:
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        * bindings/scripts/test/JS/JSTestException.cpp:
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
        * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:

            Update test results.

2017-09-25  Timothy Horton  <timothy_horton@apple.com>

        Make progress on getting Mac CMake building again
        https://bugs.webkit.org/show_bug.cgi?id=177443

        Unreviewed, just "fixing" the build.

        * PlatformMac.cmake:
        Add some missing files and include paths.

2017-09-25  Ms2ger  <Ms2ger@igalia.com>

        Update waitSync and the TIMEOUT_IGNORED constant to use signed integers.
        https://bugs.webkit.org/show_bug.cgi?id=177239

        Reviewed by Žan Doberšek.

        This matches the specification.

        Test: fast/canvas/webgl/webgl2/constants.html

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::waitSync):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:

2017-09-25  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>

        Align Media Source Extension IDL with spec
        https://bugs.webkit.org/show_bug.cgi?id=177369

        Reviewed by Sam Weinig.

        Align IDL as per specification:
         - https://www.w3.org/TR/media-source/

        * Modules/mediasource/AudioTrackMediaSource.idl:
        * Modules/mediasource/SourceBuffer.idl:
        * Modules/mediasource/TextTrackMediaSource.idl:
        * Modules/mediasource/VideoTrackMediaSource.idl:

2017-09-25  Manuel Rego Casasnovas  <rego@igalia.com>

        [css-grid] Small refactoring adding RenderGrid::contentAlignment()
        https://bugs.webkit.org/show_bug.cgi?id=177130

        Reviewed by Sergio Villar Senin.

        As a follow-up of r221931, this patch does a small refactoring
        adding a new method RenderGrid::contentAlignment()
        that is used from RenderGrid and GridTrackSizingAlgorithm.

        No new tests, no change of behavior.

        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks):
        * rendering/RenderGrid.cpp:
        (WebCore::contentAlignmentNormalBehaviorGrid):
        (WebCore::RenderGrid::contentAlignment const):
        (WebCore::RenderGrid::computeContentPositionAndDistributionOffset const):
        (WebCore::RenderGrid::contentAlignmentNormalBehaviorGrid): Deleted.
        * rendering/RenderGrid.h:
        * rendering/style/RenderStyle.cpp:
        (WebCore::resolvedContentAlignment):
        (WebCore::RenderStyle::resolvedAlignContent const):
        (WebCore::RenderStyle::resolvedJustifyContent const):
        * rendering/style/RenderStyle.h:

2017-09-25  Manuel Rego Casasnovas  <rego@igalia.com>

        [css-grid] fit-content() tracks shouldn't stretch
        https://bugs.webkit.org/show_bug.cgi?id=177300

        Reviewed by Sergio Villar Senin.

        The spec is pretty clear regarding this
        (https://drafts.csswg.org/css-grid/#algo-stretch):
          "This step sizes expands tracks that have an auto max track sizing
           function by dividing any remaining positive, definite free space
           equally amongst them."

        The fit-content() tracks don't have an auto max track sizing function,
        so they shouldn't be considered in this step of the algorithm.

        The patch modifies GridTrackSizingAlgorithm::initializeTrackSizes()
        so it doesn't consider fit-content() tracks as auto sized ones
        (which are the ones later stretched in the last step of the algorithm).

        Test: imported/w3c/web-platform-tests/css/css-grid-1/alignment/grid-fit-content-tracks-dont-stretch-001.html

        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
        (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks):
        (WebCore::GridTrackSizingAlgorithm::setup):
        (WebCore::GridTrackSizingAlgorithm::reset):
        * rendering/GridTrackSizingAlgorithm.h:

2017-09-24  Antti Koivisto  <antti@apple.com>

        Remove CSS regions related fields from RenderStyle
        https://bugs.webkit.org/show_bug.cgi?id=177415

        Reviewed by Sam Weinig.

        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::operator RegionFragment const): Deleted.
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::adjustRenderStyle):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::avoidsFloats const): Deleted.
        * rendering/RenderBlock.h:
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::hasNextPage const):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::changeRequiresLayout const):
        * rendering/style/RenderStyle.h:
        (WebCore::pseudoElementRendererIsNeeded):
        (WebCore::RenderStyle::hasFlowInto const): Deleted.
        (WebCore::RenderStyle::flowThread const): Deleted.
        (WebCore::RenderStyle::hasFlowFrom const): Deleted.
        (WebCore::RenderStyle::regionThread const): Deleted.
        (WebCore::RenderStyle::regionFragment const): Deleted.
        (WebCore::RenderStyle::setFlowThread): Deleted.
        (WebCore::RenderStyle::setRegionThread): Deleted.
        (WebCore::RenderStyle::setRegionFragment): Deleted.
        (WebCore::RenderStyle::initialFlowThread): Deleted.
        (WebCore::RenderStyle::initialRegionThread): Deleted.
        (WebCore::RenderStyle::initialRegionFragment): Deleted.
        * rendering/style/RenderStyleConstants.h:
        * rendering/style/StyleRareNonInheritedData.cpp:
        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
        (WebCore::StyleRareNonInheritedData::operator== const):
        * rendering/style/StyleRareNonInheritedData.h:

2017-09-24  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] Object attributes are missing for ARIA live region roles
        https://bugs.webkit.org/show_bug.cgi?id=171174

        Reviewed by Chris Fleizach.

        Expose the values of aria-live, aria-atomic, and aria-relevant via AtkObject
        attributes on live region elements and their descendants. In order to accomplish
        exposure on descendants, add AccessibilityObject::ariaLiveRegionAncestor(). Add an
        optional argument, excludeIfOff, to AccessibilityObject::isInsideARIALiveRegion()
        and AccessibilityObject::supportsARIALiveRegion(). This is needed because we need
        to expose live region properties via ATK even in the case where the live region
        is disabled/off, but supportsARIALiveRegion() deliberately checks if the live
        region is enabled.

        Tests: accessibility/aria-liveregion-marquee-default.html
               accessibility/aria-liveregions-attributes.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::isInsideARIALiveRegion const):
        (WebCore::AccessibilityObject::ariaLiveRegionAncestor const):
        (WebCore::AccessibilityObject::supportsARIALiveRegion const):
        * accessibility/AccessibilityObject.h:
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):

2017-09-23  Youenn Fablet  <youenn@apple.com>

        Remove SetterMayThrowException
        https://bugs.webkit.org/show_bug.cgi?id=177408

        Reviewed by Sam Weinig.

        No change of behavior.

        Updating IDLs to remove SetterMayThrowException as it is no longer needed.
        Updating AttributeSetter to compute the return type using Functor.

        * Modules/indexeddb/IDBIndex.idl:
        * Modules/indexeddb/IDBObjectStore.idl:
        * Modules/mediasource/MediaSource.idl:
        * Modules/mediasource/SourceBuffer.idl:
        * Modules/mediastream/RTCDataChannel.idl:
        * Modules/webaudio/AnalyserNode.idl:
        * Modules/webaudio/AudioNode.idl:
        * Modules/webaudio/ConvolverNode.idl:
        * Modules/webaudio/OscillatorNode.idl:
        * Modules/websockets/WebSocket.idl:
        * bindings/js/JSDOMAttribute.h:
        (WebCore::AttributeSetter::call):
        (WebCore::AttributeSetter<ExceptionOr<void>>::call): Deleted.
        (WebCore::AttributeSetter<void>::call): Deleted.
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateAttributeSetterBodyDefinition):
        * bindings/scripts/IDLAttributes.json:
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        * bindings/scripts/test/JS/JSTestCallTracer.cpp:
        * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        * bindings/scripts/test/TestObj.idl:
        * bindings/scripts/test/TestTypedefs.idl:
        * css/CSSRule.idl:
        * css/CSSStyleDeclaration.idl:
        * css/DeprecatedCSSOMValue.idl:
        * css/FontFace.idl:
        * css/MediaList.idl:
        * dom/Document.idl:
        * dom/Element.idl:
        * dom/Node.idl:
        * dom/ShadowRoot.idl:
        * html/DOMURL.idl:
        * html/HTMLElement.idl:
        * html/HTMLInputElement.idl:
        * html/HTMLMarqueeElement.idl:
        * html/HTMLMediaElement.idl:
        * html/HTMLOptionsCollection.idl:
        * html/HTMLSelectElement.idl:
        * html/HTMLTableElement.idl:
        * html/HTMLTextAreaElement.idl:
        * html/MediaController.idl:
        * html/track/VTTCue.idl:
        * html/track/VTTRegion.idl:
        * page/History.idl:
        * page/Location.idl:
        * svg/SVGAltGlyphElement.idl:
        * svg/SVGAngle.idl:
        * svg/SVGAnimatedBoolean.idl:
        * svg/SVGAnimatedEnumeration.idl:
        * svg/SVGAnimatedInteger.idl:
        * svg/SVGAnimatedNumber.idl:
        * svg/SVGAnimatedString.idl:
        * svg/SVGLength.idl:
        * svg/SVGMatrix.idl:
        * svg/SVGNumber.idl:
        * svg/SVGPoint.idl:
        * svg/SVGPreserveAspectRatio.idl:
        * svg/SVGRect.idl:
        * svg/SVGViewSpec.idl:
        * xml/XMLHttpRequest.idl:

2017-09-23  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Images may render partial frames even after loading all the encoded data
        https://bugs.webkit.org/show_bug.cgi?id=177406

        Reviewed by Simon Fraser.

        Because we do not want to block the main thread waiting for the image decoding
        thread to terminate, we let the decoding thread finish its work even it will
        be thrown away. If a new decoding thread is created and the SynchronizedFixedQueue
        is reopened, the terminating decoding thread might have the chance to process
        a new frame request. After it finishes decoding it, it realize that it is
        terminating so it will drop the decoded frame to the floor. So the new request
        was not processed by the new thread and because it was processed by the
        terminating thread, nothing will be reported to the BitmapImage object and
        the renderer will not be repainted.

        The fix is to create a new SynchronizedFixedQueue every time a decoding 
        thread is created. This will guarantee that the terminating thread won't
        have access to the new frame request and will shut down after being notified
        by the old SynchronizedFixedQueue that it has been closed.

        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::frameRequestQueue):
        (WebCore::ImageFrameCache::startAsyncDecodingQueue):
        (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
        (WebCore::ImageFrameCache::stopAsyncDecodingQueue):
        * platform/graphics/ImageFrameCache.h:

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

        WeakPtrFactory should populate m_ref lazily.
        https://bugs.webkit.org/show_bug.cgi?id=177375

        Reviewed by Geoffrey Garen.

        * Modules/encryptedmedia/CDM.cpp:
        (WebCore::CDM::CDM):
        * Modules/encryptedmedia/CDM.h:
        (WebCore::CDM::createWeakPtr):
        * Modules/encryptedmedia/MediaKeySession.cpp:
        (WebCore::MediaKeySession::MediaKeySession):
        (WebCore::MediaKeySession::generateRequest):
        (WebCore::MediaKeySession::load):
        (WebCore::MediaKeySession::update):
        (WebCore::MediaKeySession::close):
        (WebCore::MediaKeySession::remove):
        * Modules/encryptedmedia/MediaKeys.cpp:
        (WebCore::MediaKeys::MediaKeys):
        (WebCore::MediaKeys::createSession):
        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::MediaDevices::MediaDevices):
        * Modules/mediastream/MediaDevices.h:
        (WebCore::MediaDevices::createWeakPtr):
        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::MediaStreamTrack):
        * Modules/mediastream/MediaStreamTrack.h:
        (WebCore::MediaStreamTrack::createWeakPtr):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
        * accessibility/AccessibilityRenderObject.h:
        (WebCore::AccessibilityRenderObject::createWeakPtr):
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::WebAnimation):
        * animation/WebAnimation.h:
        * css/FontFace.cpp:
        (WebCore::FontFace::FontFace):
        (WebCore::FontFace::createWeakPtr):
        (WebCore::FontFace::createWeakPtr const): Deleted.
        * css/FontFace.h:
        * css/StyleSheetContents.h:
        * dom/DataTransferItemList.cpp:
        (WebCore::DataTransferItemList::DataTransferItemList):
        (WebCore::DataTransferItemList::add):
        (WebCore::DataTransferItemList::ensureItems const):
        (WebCore::DataTransferItemList::didSetStringData):
        * dom/Document.cpp:
        (WebCore::Document::postTask):
        * dom/Document.h:
        (WebCore::Document::createWeakPtr):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::HTMLMediaElement):
        * html/HTMLMediaElement.h:
        (WebCore::HTMLMediaElement::createWeakPtr):
        * html/HTMLPictureElement.h:
        * html/parser/HTMLResourcePreloader.h:
        (WebCore::HTMLResourcePreloader::HTMLResourcePreloader):
        (WebCore::HTMLResourcePreloader::createWeakPtr):
        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::LinkLoader):
        * loader/LinkLoader.h:
        (WebCore::LinkLoader::createWeakPtr):
        * loader/MediaResourceLoader.cpp:
        (WebCore::MediaResourceLoader::MediaResourceLoader):
        * loader/MediaResourceLoader.h:
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::DOMWindow):
        * page/DOMWindow.h:
        * platform/GenericTaskQueue.cpp:
        (WebCore::TaskDispatcher<Timer>::TaskDispatcher):
        (WebCore::TaskDispatcher<Timer>::postTask):
        * platform/GenericTaskQueue.h:
        (WebCore::GenericTaskQueue::GenericTaskQueue):
        (WebCore::GenericTaskQueue::enqueueTask):
        * platform/ScrollableArea.h:
        (WebCore::ScrollableArea::createWeakPtr):
        * platform/Scrollbar.cpp:
        (WebCore::Scrollbar::Scrollbar):
        * platform/Scrollbar.h:
        (WebCore::Scrollbar::createWeakPtr):
        * platform/Widget.h:
        (WebCore::Widget::createWeakPtr):
        * platform/audio/mac/AudioHardwareListenerMac.cpp:
        (WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac):
        * platform/graphics/FontCascade.cpp:
        (WebCore::FontCascade::FontCascade):
        * platform/graphics/FontCascade.h:
        (WebCore::FontCascade::createWeakPtr const):
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
        (WebCore::MediaPlayerPrivateAVFoundation::createWeakPtr):
        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
        (WebCore::CDMSessionAVFoundationObjC::createWeakPtr):
        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
        (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
        (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createWeakPtr):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::createWeakPtr):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
        (WebCore::SourceBufferPrivateAVFObjC::append):
        (WebCore::SourceBufferPrivateAVFObjC::abort):
        * platform/graphics/cv/TextureCacheCV.mm:
        (WebCore::TextureCacheCV::TextureCacheCV):
        (WebCore::TextureCacheCV::textureFromImage):
        * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
        (WebCore::DisplayRefreshMonitorMac::DisplayRefreshMonitorMac):
        (WebCore::DisplayRefreshMonitorMac::displayLinkFired):
        * platform/ios/RemoteCommandListenerIOS.h:
        (WebCore::RemoteCommandListenerIOS::createWeakPtr):
        * platform/ios/RemoteCommandListenerIOS.mm:
        (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
        * platform/mac/RemoteCommandListenerMac.h:
        (WebCore::RemoteCommandListenerMac::createWeakPtr):
        * platform/mediastream/MediaStreamPrivate.cpp:
        (WebCore::MediaStreamPrivate::MediaStreamPrivate):
        * platform/mediastream/MediaStreamPrivate.h:
        (WebCore::MediaStreamPrivate::createWeakPtr):
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::RealtimeMediaSource):
        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mock/MockMediaEndpoint.cpp:
        (WebCore::MockMediaEndpoint::MockMediaEndpoint):
        (WebCore::MockMediaEndpoint::generateDtlsInfo):
        * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
        (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
        * rendering/RenderMultiColumnSpannerPlaceholder.h:
        * rendering/RenderView.cpp:
        (WebCore::RenderView::RenderView):
        * rendering/RenderView.h:
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::RenderWidget):
        * rendering/RenderWidget.h:
        (WebCore::RenderWidget::createWeakPtr):
        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::RootInlineBox):
        * rendering/RootInlineBox.h:
        (WebCore::RootInlineBox::createWeakPtr):
        * svg/SVGPathElement.cpp:
        (WebCore::SVGPathElement::SVGPathElement):
        * svg/SVGPathElement.h:
        * svg/properties/SVGMatrixTearOff.h:
        * testing/MockCDMFactory.cpp:
        (WebCore::MockCDMFactory::MockCDMFactory):
        (WebCore::MockCDMFactory::createCDM):
        (WebCore::MockCDM::MockCDM):
        (WebCore::MockCDM::createInstance):
        (WebCore::m_weakPtrFactory): Deleted.

2017-09-22  Tim Horton  <timothy_horton@apple.com>

        Add env() as an alias of constant()
        https://bugs.webkit.org/show_bug.cgi?id=177371

        Reviewed by Simon Fraser.

        * css/CSSValueKeywords.in:
        * css/CSSVariableData.cpp:
        (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
        (WebCore::CSSVariableData::resolveTokenRange const):
        * css/parser/CSSVariableParser.cpp:
        (WebCore::classifyBlock):
        Add env() as an alias of constant() everywhere it is mentioned.

2017-09-22  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Use didReceiveBuffer instead of didReceiveData
        https://bugs.webkit.org/show_bug.cgi?id=177260

        Reviewed by Alex Christensen.

        * platform/network/curl/CurlCacheEntry.cpp:
        (WebCore::CurlCacheEntry::readCachedData):
        * platform/network/curl/MultipartHandle.cpp:
        (WebCore::MultipartHandle::didReceiveData):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::didReceiveContentData):
        (WebCore::ResourceHandleCurlDelegate::handleDataURL):
        (WebCore::ResourceHandleCurlDelegate::didReceiveData):
        (WebCore::ResourceHandleCurlDelegate::didReceiveDataCallback):
        * platform/network/curl/ResourceHandleCurlDelegate.h:

2017-09-22  John Wilander  <wilander@apple.com>

        Non-prevalent resources should be allowed access to existing cookies in a third-party context
        https://bugs.webkit.org/show_bug.cgi?id=177336
        <rdar://problem/34578257>

        Reviewed by Brent Fulgham.

        No new tests. I will update existing tests and add at least
        one new test in a follow-up patch,
        see https://bugs.webkit.org/show_bug.cgi?id=177337. Need to
        land this to meet submission deadline and fix the regression.

        This patch restructures what is communicated to the network process,
        from two vectors - with user interaction and without user interaction -
        to three vectors - to partition, to block, to neither partition nor block.
        The previous two vectors did not allow proper categorization into which
        domains should be partitioned, blocked, or left alone. That was the cause
        of the regression where non-prevalent third-party domains erroneously had
        their cookies blocked when they should fall back to the old behavior of
        access but no new cookies allowed to be set.

        * loader/ResourceLoadStatistics.cpp:
        (WebCore::ResourceLoadStatistics::toString const):
        (WebCore::ResourceLoadStatistics::merge):
        * loader/ResourceLoadStatistics.h:
        * platform/network/NetworkStorageSession.h:
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::shouldPartitionCookies const):
        (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
        (WebCore::NetworkStorageSession::shouldBlockCookies const):
        (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
        (WebCore::NetworkStorageSession::removePrevalentDomains):
        (WebCore::NetworkStorageSession::shouldAllowThirdPartyCookies const): Deleted.
        (WebCore::NetworkStorageSession::setPrevalentDomainsWithAndWithoutInteraction): Deleted.
        * platform/network/mac/CookieJarMac.mm:
        (WebCore::cookiesInBlockedForURL):
        (WebCore::cookiesForURL):

2017-09-22  Fujii Hironori  <Hironori.Fujii@sony.com>

        [CMake][Win] EventTargetInterfaces.h are generated twice
        https://bugs.webkit.org/show_bug.cgi?id=177286

        Reviewed by Brent Fulgham.

        EventTargetInterfaces.h are generated twice in both
        WebCoreDerivedSources.vcxproj and WebCore.vcxproj. This causes
        unnecessary recompilation in CMake VisualStudio build.

        WebCore target already has a dependency to WebCoreDerivedSources
        target by calling add_dependencies. WebCore target doesn't need to
        generate it.

        * CMakeLists.txt: Don't ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES with EventTargetInterfaces.h.

2017-09-22  Antti Koivisto  <antti@apple.com>

        Add asserts against layout time render tree mutations
        https://bugs.webkit.org/show_bug.cgi?id=177361

        Reviewed by Zalan Bujtas.

        We don't have any mutations left. Add asserts.

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::insertChildInternal):
        (WebCore::RenderElement::removeChildInternal):

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

        Use high resolution timestamp for event time
        https://bugs.webkit.org/show_bug.cgi?id=154246
        <rdar://problem/34333304>

        Reviewed by Ryosuke Niwa.

        Have event.timeStamp return a DOMHighResTimeStamp instead of a DOMResTimeStamp. It now
        has better precision, is monotonic and is relative to PerformanceTiming.navigationStart.

        This is as per:
        - https://dom.spec.whatwg.org/#interface-event

        Chrome, Firefox and Edge all already ship this so the compatibility risk should be low.

        Also use WallTime / MonotonicTime instead of double type for clarity.

        Test: imported/w3c/web-platform-tests/dom/events/Event-timestamp-high-resolution.html

        * WebCore.xcodeproj/project.pbxproj:
        * dom/DOMHighResTimeStamp.h: Copied from Source/WebKit/Shared/WebTouchEvent.cpp.
        * dom/Element.cpp:
        (WebCore::Element::dispatchMouseForceWillBegin):
        * dom/Event.cpp:
        (WebCore::Event::Event):
        (WebCore::Event::timeStampForBindings const):
        * dom/Event.h:
        (WebCore::Event::timeStamp const):
        * dom/Event.idl:
        * dom/KeyboardEvent.cpp:
        (WebCore::KeyboardEvent::KeyboardEvent):
        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::create):
        (WebCore::MouseEvent::MouseEvent):
        * dom/MouseEvent.h:
        * dom/MouseRelatedEvent.cpp:
        (WebCore::MouseRelatedEvent::MouseRelatedEvent):
        * dom/MouseRelatedEvent.h:
        * dom/SimulatedClick.cpp:
        * dom/TouchEvent.cpp:
        (WebCore::TouchEvent::TouchEvent):
        * dom/UIEvent.cpp:
        (WebCore::UIEvent::UIEvent):
        * dom/UIEvent.h:
        * dom/UIEventWithKeyState.h:
        (WebCore::UIEventWithKeyState::UIEventWithKeyState):
        * dom/WheelEvent.cpp:
        (WebCore::WheelEvent::WheelEvent):
        * html/TypeAhead.cpp:
        (WebCore::TypeAhead::TypeAhead):
        (WebCore::TypeAhead::handleEvent):
        * html/TypeAhead.h:
        * page/AutoscrollController.cpp:
        (WebCore::AutoscrollController::AutoscrollController):
        (WebCore::AutoscrollController::updateDragAndDrop):
        (WebCore::AutoscrollController::autoscrollTimerFired):
        * page/AutoscrollController.h:
        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::showContextMenuAt):
        * page/DragController.cpp:
        (WebCore::createMouseEvent):
        * page/EventHandler.cpp:
        (WebCore::EventHandler::dispatchDragEvent):
        (WebCore::EventHandler::sendContextMenuEventForKey):
        (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
        * page/EventHandler.h:
        * page/Performance.cpp:
        (WebCore::Performance::now const):
        (WebCore::Performance::relativeTimeFromTimeOriginInReducedResolution const):
        * page/Performance.h:
        * page/ios/EventHandlerIOS.mm:
        (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
        * page/win/EventHandlerWin.cpp:
        * platform/PlatformEvent.h:
        (WebCore::PlatformEvent::timestamp const):
        (WebCore::PlatformEvent::PlatformEvent):
        * platform/PlatformKeyboardEvent.h:
        (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
        * platform/PlatformMouseEvent.h:
        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
        * platform/PlatformWheelEvent.h:
        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
        * platform/cocoa/ScrollController.mm:
        (WebCore::ScrollController::handleWheelEvent):
        * platform/glib/EventHandlerGLib.cpp:
        * platform/gtk/ScrollAnimatorGtk.cpp:
        (WebCore::ScrollAnimatorGtk::computeVelocity):
        (WebCore::ScrollAnimatorGtk::handleWheelEvent):
        * platform/ios/PlatformEventFactoryIOS.mm:
        (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
        (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder):
        (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
        (WebCore::PlatformTouchEventBuilder::PlatformTouchEventBuilder):
        * platform/mac/PlatformEventFactoryMac.h:
        * platform/mac/PlatformEventFactoryMac.mm:
        (WebCore::eventTimeStampSince1970):

2017-09-22  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>

        [GTK] HTMLMediaElement resize event not fired when video size changes
        https://bugs.webkit.org/show_bug.cgi?id=174582

        Reviewed by Xabier Rodriguez-Calvar.

        Modify AppendPipeline to notify MediaPlayerPrivateGStreamerMSE that a track is detected
        not only for the initial track detection but also for subsequent in particular when the
        video size has changed.

        Update test expectation for new passing tests.

        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::AppendPipeline::appsinkCapsChanged):
        (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
        * platform/graphics/gstreamer/mse/AppendPipeline.h:
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
        (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
        * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
        (WebCore::PlaybackPipeline::reattachTrack):
        * platform/graphics/gstreamer/mse/PlaybackPipeline.h:

2017-09-22  Ms2ger  <Ms2ger@igalia.com>

        [GTK] Couple of pasteboard related tests are failing after r222228
        https://bugs.webkit.org/show_bug.cgi?id=177295

        Reviewed by Michael Catanzaro.

        Call writeToClipboard() from Pasteboard::writeString() on GTK.

        When writePasteboard was replaced by commitToPasteboard in r222228,
        the call to writeToClipboard() did not make it into the
        platform-neutral code. This attempts to find another place in the
        GTK-specific code to make the call.

        Tests: editing/pasteboard/copy-without-selection.html
               editing/pasteboard/pasting-empty-html-falls-back-to-text.html

        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::writeString):

2017-09-21  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION (r221017): iCloud mail logs me out after looking at a few messages
        https://bugs.webkit.org/show_bug.cgi?id=177328

        Reviewed by Daniel Bates.
        <rdar://problem/34288629>

        Reviewed by Dan Bates.

        This site was triggering a log-out because the page was loading insecure images. We don't treat that as a security
        issue for deciding to display mixed content since it can only affect pixels on screen, not trigger a change in
        program logic or persistent storage.

        Consequently, we can correct thsi compatibility problem without relaxing the security fix by not blocking Secure cookies
        when we have merely displayed mixed content (i.e., encountered 'Inactive' mixed content), as opposed to executing mixed
        content (i.e., loaded 'Active' mixed content).

        * Modules/geolocation/Geolocation.cpp:
        (WebCore::Geolocation::shouldBlockGeolocationRequests): Revise for new API.
        * dom/SecurityContext.h:
        (WebCore::SecurityContext::foundMixedContent const): Change to return an OptionSet of
        mixed content types.
        (WebCore::SecurityContext::setFoundMixedContent): Accept an enum stating the type of mixed content found.
        * loader/CookieJar.cpp:
        (WebCore::cookies): Only block Secure cookies for Active mixed content.
        (WebCore::cookieRequestHeaderFieldValue): Ditto.
        * loader/MixedContentChecker.cpp:
        (WebCore::MixedContentChecker::canDisplayInsecureContent const): Mark the context as having found 'Inactive'
        mixed content.
        (WebCore::MixedContentChecker::canRunInsecureContent const): Mark the context as having found 'Active'
        mixed content.

2017-09-21  Simon Fraser  <simon.fraser@apple.com>

        Clean up RenderLayer z-order traversal code
        https://bugs.webkit.org/show_bug.cgi?id=177325

        Reviewed by Zalan Bujtas.

        Remove isStackingContainer() checks before accessing posZOrderList() or negZOrderList();
        we already have assertions in place to ensure that only stacking containers have non-null lists.

        Use more auto.

        No behavior change.

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::update3DTransformedDescendantStatus):
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::traverseVisibleNonCompositedDescendantLayers):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
        (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
        (WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
        (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
        (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
        (WebCore::RenderLayerCompositor::layerHas3DContent const):
        * rendering/RenderTreeAsText.cpp:
        (WebCore::writeLayers):

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

        Unreviewed Windows build fix after r222360.

        * PlatformWin.cmake:

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

        Remove the need for SetterMayThrowException
        https://bugs.webkit.org/show_bug.cgi?id=177099

        Reviewed by Sam Weinig.

        No change of behavior.
        Introducing AttributeSetter to handle exception raising attribute setters,
        based on the C++ class method instead of SetterMayThrowException.
        A follow-up patch should remove SetterMayThrowException from the IDLs

        * bindings/js/JSDOMAttribute.h:
        (WebCore::AttributeSetter<ExceptionOr<void>>::call):
        (WebCore::AttributeSetter<void>::call):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateAttributeSetterBodyDefinition):
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        * bindings/scripts/test/JS/JSTestCallTracer.cpp:
        * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:

2017-09-21  Ryosuke Niwa  <rniwa@webkit.org>

        DataTransfer.items should contain text/html and text/uri-list
        https://bugs.webkit.org/show_bug.cgi?id=176772
        <rdar://problem/34386899>

        Reviewed by Darin Adler.

        Expose text/html and text/uri-list in dataTransfer.items.

        Tests: editing/pasteboard/datatransfer-items-copy-html.html
               editing/pasteboard/datatransfer-items-copy-url.html

        * dom/DataTransferItemList.cpp:
        (WebCore::isSupportedType): Added both MIME types.
        (WebCore::DataTransferItemList::add): Fixed the bug that new data transfer item was using
        the original type string instead of the lowercased one.

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

        [Win] Compile error, PALHeaderDetection.h not found.
        https://bugs.webkit.org/show_bug.cgi?id=177309

        Reviewed by Brent Fulgham.

        Copy PAL header files to WebCore forwarding headers folder.

        * PlatformWin.cmake:

2017-09-21  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Remove support for CSS Regions
        https://bugs.webkit.org/show_bug.cgi?id=177287

        Reviewed by Matt Baker.

        * inspector/InspectorCSSAgent.cpp:
        (WebCore::InspectorCSSAgent::getNamedFlowCollection): Deleted.
        * inspector/InspectorCSSAgent.h:
        * inspector/InspectorOverlay.cpp:
        (WebCore::buildRendererHighlight):
        (WebCore::buildNodeHighlight):
        (WebCore::InspectorOverlay::getHighlight const):
        (WebCore::buildArrayForRendererFragments):
        (WebCore::buildQuadObjectForCSSRegionContentClip): Deleted.
        * inspector/InspectorOverlayPage.js:
        (_createElementTitle):
        (_drawElementTitle):
        (_drawFragmentHighlight):
        (drawNodeHighlight):
        (_drawRegionNumber): Deleted.
        (_quadMidPoint): Deleted.
        (_drawRegionLink): Deleted.
        (_drawRegionsHighlight): Deleted.

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

        Remove some more code from RenderFlowThread
        https://bugs.webkit.org/show_bug.cgi?id=177320

        Reviewed by David Hyatt.

        More dead code related to named flows.

        * rendering/RenderFlowThread.cpp:
        (WebCore::RenderFlowThread::RenderFlowThread):
        (WebCore::RenderFlowThread::invalidateRegions):
        (WebCore::RenderFlowThread::layout):
        (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
        (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
        (WebCore::RenderFlowThread::addForcedRegionBreak):
        (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion const):
        (WebCore::RenderFlowThread::hasCachedOffsetFromLogicalTopOfFirstRegion const): Deleted.
        (WebCore::RenderFlowThread::cachedOffsetFromLogicalTopOfFirstRegion const): Deleted.
        (WebCore::RenderFlowThread::setOffsetFromLogicalTopOfFirstRegion): Deleted.
        (WebCore::RenderFlowThread::clearOffsetFromLogicalTopOfFirstRegion): Deleted.
        (WebCore::RenderFlowThread::currentActiveRenderBox const): Deleted.
        (WebCore::RenderFlowThread::pushFlowThreadLayoutState): Deleted.
        (WebCore::RenderFlowThread::popFlowThreadLayoutState): Deleted.
        * rendering/RenderFlowThread.h:

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

        eventInitDict parameter to GamepadEvent constructor should be optional
        https://bugs.webkit.org/show_bug.cgi?id=177308

        Reviewed by Sam Weinig.

        eventInitDict parameter to GamepadEvent constructor should be optional to match Firefox
        and Chrome. Having such dictionary parameter is also not valid Web IDL:
        """
        If the type of an argument is a dictionary type (or a union type that has a dictionary as one
        of its flattened member types), and that dictionary type and its ancestors have no required
        members, and the argument is either the final argument or is followed only by optional arguments,
        then the argument must be specified as optional. Such arguments are always considered to have a
        default value of an empty dictionary, unless otherwise specified.
        """

        Test: gamepad/gamepad-event.html

        * Modules/gamepad/GamepadEvent.idl:

2017-09-21  Brian Burg  <bburg@apple.com>

        Web Inspector: keyboard shortcut for "Reload page from origin" doesn't match Safari, and doesn't work
        https://bugs.webkit.org/show_bug.cgi?id=177010
        <rdar://problem/33134548>

        Reviewed by Joseph Pecoraro.

        Use "reload from origin" nomenclature instead of "reload ignoring cache".

        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::reload):
        * inspector/InspectorPageAgent.h:

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

        Remove RenderNamedFlowFragment
        https://bugs.webkit.org/show_bug.cgi?id=177299

        Reviewed by David Hyatt.

        Remove the remaining named flow rendering code.

        The feature is already disabled, no functional changes.

        * WebCore.xcodeproj/project.pbxproj:
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::paint):
        (WebCore::RenderBlock::selectionGaps):
        (WebCore::RenderBlock::nodeAtPoint):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::insertedIntoTree):
        (WebCore::RenderBlockFlow::willBeDestroyed):
        (WebCore::RenderBlockFlow::layoutBlock):
        (WebCore::RenderBlockFlow::styleDidChange):
        (WebCore::RenderBlockFlow::updateLogicalHeight):
        (WebCore::RenderBlockFlow::positionForPoint):
        (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded): Deleted.
        (WebCore::RenderBlockFlow::canHaveChildren const): Deleted.
        (WebCore::RenderBlockFlow::canHaveGeneratedChildren const): Deleted.
        (WebCore::RenderBlockFlow::namedFlowFragmentNeedsUpdate const): Deleted.
        (WebCore::RenderBlockFlow::setRenderNamedFlowFragment): Deleted.
        * rendering/RenderBlockFlow.h:
        (WebCore::RenderBlockFlow::RenderBlockFlowRareData::RenderBlockFlowRareData):
        (WebCore::RenderBlockFlow::renderNamedFlowFragment const): Deleted.
        (WebCore::RenderElement::isRenderNamedFlowFragmentContainer const): Deleted.
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::nodeAtPoint):
        (WebCore::RenderBox::paintBoxDecorations):
        (WebCore::RenderBox::pushContentsClip):
        (WebCore::RenderBox::mapLocalToContainer const):
        (WebCore::RenderBox::isUnsplittableForPagination const):
        (WebCore::RenderBox::overflowRectForPaintRejection const):
        * rendering/RenderBox.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
        * rendering/RenderBoxModelObject.h:
        * rendering/RenderElement.h:
        (WebCore::RenderElement::generatingElement const):
        * rendering/RenderFlowThread.cpp:
        (WebCore::RenderFlowThread::RenderFlowThread):
        (WebCore::RenderFlowThread::invalidateRegions):
        (WebCore::RenderFlowThread::validateRegions):
        (WebCore::RenderFlowThread::layout):
        (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent const):
        (WebCore::RenderFlowThread::clearRenderBoxRegionInfoAndCustomStyle):
        (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
        (WebCore::RenderFlowThread::addForcedRegionBreak):
        (WebCore::RenderFlowThread::hasCompositingRegionDescendant const): Deleted.
        (WebCore::RenderFlowThread::getLayerListForRegion const): Deleted.
        (WebCore::RenderFlowThread::regionForCompositedLayer const): Deleted.
        (WebCore::RenderFlowThread::cachedRegionForCompositedLayer const): Deleted.
        (WebCore::RenderFlowThread::updateLayerToRegionMappings): Deleted.
        (WebCore::RenderFlowThread::updateAllLayerToRegionMappings): Deleted.
        (WebCore::RenderFlowThread::collectsGraphicsLayersUnderRegions const): Deleted.
        (WebCore::RenderFlowThread::isAutoLogicalHeightRegionsCountConsistent const): Deleted.
        (WebCore::RenderFlowThread::initializeRegionsComputedAutoHeight): Deleted.
        (WebCore::RenderFlowThread::markAutoLogicalHeightRegionsForLayout): Deleted.
        (WebCore::RenderFlowThread::incrementAutoLogicalHeightRegions): Deleted.
        (WebCore::RenderFlowThread::decrementAutoLogicalHeightRegions): Deleted.
        * rendering/RenderFlowThread.h:
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositions):
        (WebCore::expandClipRectForDescendantsAndReflection):
        (WebCore::RenderLayer::paintLayer):
        (WebCore::RenderLayer::paintLayerContents):
        (WebCore::RenderLayer::paintList):
        (WebCore::isHitCandidate):
        (WebCore::RenderLayer::hitTestLayer):
        (WebCore::RenderLayer::hitTestList):
        (WebCore::RenderLayer::calculateClipRects const):
        (WebCore::expandClipRectForRegionAndReflection): Deleted.
        (WebCore::RenderLayer::isFlowThreadCollectingGraphicsLayersUnderRegions const): Deleted.
        (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer const): Deleted.
        * rendering/RenderLayer.h:
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::shouldClipCompositedBounds const):
        (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
        (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
        (WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread const): Deleted.
        * rendering/RenderLayerBacking.h:
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
        (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
        (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
        (WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons):
        (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
        (WebCore::RenderLayerCompositor::computeRegionCompositingRequirements): Deleted.
        (WebCore::RenderLayerCompositor::rebuildRegionCompositingLayerTree): Deleted.
        * rendering/RenderLayerCompositor.h:
        * rendering/RenderNamedFlowFragment.cpp: Removed.
        * rendering/RenderNamedFlowFragment.h: Removed.
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::containerForRepaint const):
        (WebCore::RenderObject::fixedPositionedWithNamedFlowContainingBlock const): Deleted.
        (WebCore::hasFixedPosInNamedFlowContainingBlock): Deleted.
        (WebCore::RenderObject::currentRenderNamedFlowFragment const): Deleted.
        * rendering/RenderObject.h:
        (WebCore::RenderObject::isRenderRegion const):
        (WebCore::RenderObject::isAnonymousBlock const):
        (WebCore::RenderObject::isRenderNamedFlowFragment const): Deleted.
        * rendering/RenderRegion.cpp:
        * rendering/RenderRegion.h:
        (WebCore::RenderRegion::hasAutoLogicalHeight const): Deleted.
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::shouldPaint):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::overflowClipRect):
        (WebCore::RenderTable::nodeAtPoint):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::nodeAtPoint):
        * rendering/RenderTreeAsText.cpp:
        (WebCore::writeLayers):
        * rendering/RenderView.cpp:
        (WebCore::RenderView::layout):
        (WebCore::RenderView::pushLayoutState):
        (WebCore::RenderView::pushLayoutStateForPaginationIfNeeded):
        (WebCore::RenderView::layoutContentInAutoLogicalHeightRegions): Deleted.
        (WebCore::RenderView::checkTwoPassLayoutForAutoHeightRegions const): Deleted.
        (WebCore::RenderView::pushLayoutStateForCurrentFlowThread): Deleted.
        (WebCore::RenderView::popLayoutStateForCurrentFlowThread): Deleted.
        * rendering/RenderView.h:
        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::paint):
        * rendering/svg/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::paintReplaced):

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

        Fix all builds after r222325

        * loader/DocumentLoader.h:
        WebKit needs this, too.

2017-09-21  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        [PAL] Move MediaTimeAVFoundation into PAL
        https://bugs.webkit.org/show_bug.cgi?id=177222

        Reviewed by Myles C. Maxfield.

        No new tests. No change in behavior..

        * Configurations/WebCore.unexp:
        * PlatformAppleWin.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/audio/mac/AudioSampleDataSource.mm:
        (WebCore::AudioSampleDataSource::pushSamples):
        * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
        (WebCore::AudioSourceProviderAVFObjC::process):
        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
        (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
        * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
        (WebCore::MediaPlayerPrivateAVFoundationCF::platformDuration const):
        (WebCore::MediaPlayerPrivateAVFoundationCF::currentMediaTime const):
        (WebCore::MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRanges const):
        (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable const):
        (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable const):
        (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded const):
        (WebCore::AVFWrapper::seekToTime):
        (WebCore::AVFWrapper::legibleOutputCallback):
        (WebCore::AVFWrapper::createImageForTimeInRect):
        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
        (WebCore::ImageDecoderAVFObjC::readSampleMetadata):
        (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
        (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::currentMediaTime const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
        (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
        (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentMediaTime const):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::calculateTimelineOffset):
        * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
        (WebCore::MediaSampleAVFObjC::presentationTime const):
        (WebCore::MediaSampleAVFObjC::outputPresentationTime const):
        (WebCore::MediaSampleAVFObjC::decodeTime const):
        (WebCore::MediaSampleAVFObjC::duration const):
        (WebCore::MediaSampleAVFObjC::outputDuration const):
        (WebCore::MediaSampleAVFObjC::offsetTimestampsBy):
        (WebCore::MediaSampleAVFObjC::setTimestamps):
        (WebCore::MediaSampleAVFObjC::divide):
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
        (WebCore::WebCoreDecompressionSession::automaticDequeue):
        (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
        (WebCore::WebCoreDecompressionSession::imageForTime):
        * platform/mac/PlatformClockCM.mm:
        (PlatformClockCM::setCurrentMediaTime):
        (PlatformClockCM::currentMediaTime const):
        * platform/mac/PlaybackSessionInterfaceMac.mm:
        (WebCore::timeRangesToArray):
        * platform/mac/VideoFullscreenInterfaceMac.mm:
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
        (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
        * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
        (WebCore::RealtimeIncomingAudioSource::OnData):
        * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:

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

        Fix ASAN build after r222306
        https://bugs.webkit.org/show_bug.cgi?id=177255

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::setCustomHeaderFields):
        * loader/DocumentLoader.h:
        (WebCore::DocumentLoader::setCustomHeaderFields): Deleted.
        Moving a Vector of a type requires more than just a forward declaration of the type, but only in ASAN builds.  Weird.

2017-09-21  Zhifei FANG  <facetothefate@gmail.com>

        In regular block layout, the width of a child's margin box should always be equal to that of its containing block
        Merge from Blink https://bugs.chromium.org/p/chromium/issues/detail?id=708751
        https://bugs.webkit.org/show_bug.cgi?id=176620

        Reviewed by Zalan Bujtas.

        Test: fast/block/over-constrained-auto-margin.html

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::computeLogicalWidthInRegion const):

2017-09-21  Javier Fernandez  <jfernandez@igalia.com>

        Unpredictable selection when dragging out of float elements children of in-flow block-level box
        https://bugs.webkit.org/show_bug.cgi?id=176096

        Reviewed by David Hyatt.

        In order to improve Selection across float elements we need to
        consider them as HitTest candidates.  Additionally, since
        out-of-flow elements must not affect how in-flow elements are
        rendered we have to deal with some special cases when implementing
        the positionForPoint logic.

        This patch addresses the issues caused by the fact that an in-flow
        box's logicalBottom does not consider the out-of-flow children, as
        they don't affect its height. Hence, we should add the lowest float
        logical bottom to figure out the box the point is actually hitting.

        Tests: editing/selection/select-out-of-floated-non-editable-01.html
               editing/selection/select-out-of-floated-non-editable-02.html
               editing/selection/select-out-of-floated-non-editable-03.html
               editing/selection/select-out-of-floated-non-editable-04.html
               editing/selection/select-out-of-floated-non-editable-05.html
               editing/selection/select-out-of-floated-non-editable-06.html
               editing/selection/select-out-of-floated-non-editable-07.html
               editing/selection/select-out-of-floated-non-editable-08.html
               editing/selection/select-out-of-floated-non-editable-09.html
               editing/selection/select-out-of-floated-non-editable-10.html
               editing/selection/select-out-of-floated-non-editable-11.html
               editing/selection/select-out-of-floated-non-editable-12.html

        * rendering/RenderBlock.cpp:
        (WebCore::isChildHitTestCandidate):
        (WebCore::RenderBlock::positionForPoint):

2017-09-21  Zan Dobersek  <zdobersek@igalia.com>

        [WebCrypto] Support Elliptic Curve P-521
        https://bugs.webkit.org/show_bug.cgi?id=169231
        <rdar://problem/30881703>

        Reviewed by Jiewen Tan.

        Add support for the P-521 elliptic curve to the CryptoKeyEC class, but
        allow the underlying platform-specific implementations to opt out of
        supporting this feature.

        This is achieved with the platformSupportedCurve() static function that
        each platform has to implement, returning true if the passed-in curve
        type is supported. The function is called at each CryptoKeyEC entrypoint,
        that is in each static function that could generate a new CryptoKeyEC
        object. These functions return a NotSupportedError exception in case the
        platformSupportedCurve() call returns false.

        While the libgcrypt-based implementation will support P-521 curves in
        the near future, the CommonCrypto-based implementation might not. The use
        of platformSupportedCurve() ensures that the implementations that don't
        support EC P-521 continue to return the NotSupportedError exception at
        these entrypoints, instead of the OperationError exception that's returned
        when the platform-specific extensions of these entrypoints fail due to the
        specified elliptic curve not being supported.

        Both libgcrypt-based and CommonCrypto-based implementations mark P-256 and
        P-384 curves as supported. Switch statements handling NamedCurve values
        must now also handle the NamedCurve::P521 value, but both implementations
        treat that as an unreachable case since support is not indicated in
        platformSupportedCurve(), and all CryptoKeyEC operations should have
        returned with an NotSupportedError exception before entering
        platform-specific code. The common CryptoKeyEC constructor similarly asserts
        that the specified curve is supported by the underlying implementation.

        CryptoAlgorithmECDSA is modified to now also support 'ES512' as the algorithm
        identifier, matching it against the 'P-521' curve value.

        No new tests -- tests covering EC P-521 already exist, but no platform
        runs them yet due to missing implementations.

        * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
        (WebCore::CryptoAlgorithmECDSA::importKey):
        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        (WebCore::curveName):
        (WebCore::curveIdentifier):
        (WebCore::curveSize):
        (WebCore::curveUncompressedFieldElementSize):
        (WebCore::CryptoKeyEC::platformSupportedCurve):
        * crypto/keys/CryptoKeyEC.cpp:
        (WebCore::toNamedCurve):
        (WebCore::CryptoKeyEC::CryptoKeyEC):
        (WebCore::CryptoKeyEC::generatePair):
        (WebCore::CryptoKeyEC::importRaw):
        (WebCore::CryptoKeyEC::importJwk):
        (WebCore::CryptoKeyEC::importSpki):
        (WebCore::CryptoKeyEC::importPkcs8):
        (WebCore::CryptoKeyEC::exportJwk const):
        (WebCore::CryptoKeyEC::namedCurveString const):
        (WebCore::CryptoKeyEC::algorithm const):
        * crypto/keys/CryptoKeyEC.h:
        * crypto/mac/CryptoKeyECMac.cpp:
        (WebCore::doesUncompressedPointMatchNamedCurve):
        (WebCore::doesFieldElementMatchNamedCurve):
        (WebCore::getKeySizeFromNamedCurve):
        (WebCore::CryptoKeyEC::platformSupportedCurve):
        (WebCore::getOID):

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

        inspector/dom/content-node-region-info.html and inspector/dom/content-flow tests crashing
        https://bugs.webkit.org/show_bug.cgi?id=177249
        <rdar://problem/34559968>

        Unreviewed.

        * inspector/InspectorCSSAgent.cpp:
        (WebCore::InspectorCSSAgent::getNamedFlowCollection):

            Fix crashing by adding a few lines of removed code back.

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

        Remove redundant SelectionSubtreeData functions.
        https://bugs.webkit.org/show_bug.cgi?id=177288

        Reviewed by Simon Fraser.

        No change in functionality.

        * rendering/SelectionSubtreeRoot.h:
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData):
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos const):
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionClear const): Deleted.
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStart): Deleted.
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStartPos): Deleted.
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEnd): Deleted.
        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEndPos): Deleted.
        (): Deleted.

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

        Add infrastructure for adding custom headers to requests per website
        https://bugs.webkit.org/show_bug.cgi?id=177255

        Reviewed by Geoffrey Garen.

        Covered by API tests.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * loader/DocumentLoader.cpp:
        * loader/DocumentLoader.h:
        (WebCore::DocumentLoader::setCustomHeaderFields):
        * loader/HTTPHeaderField.cpp: Added.
        (WebCore::RFC7230::isTokenCharacter):
        (WebCore::RFC7230::isDelimiter):
        (WebCore::RFC7230::isVisibleCharacter):
        (WebCore::RFC7230::isWhitespace):
        (WebCore::RFC7230::isInRange):
        (WebCore::RFC7230::isOBSText):
        (WebCore::RFC7230::isQuotedTextCharacter):
        (WebCore::RFC7230::isQuotedPairSecondOctet):
        (WebCore::RFC7230::isCommentText):
        (WebCore::RFC7230::isValidName):
        (WebCore::RFC7230::isValidValue):
        (WebCore::HTTPHeaderField::HTTPHeaderField):
        * loader/HTTPHeaderField.h: Added.
        (WebCore::HTTPHeaderField::encode const):
        (WebCore::HTTPHeaderField::decode):

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

        REGRESSION(r191731): SVGPatternElement can only reference another SVGPatternElement in the same SVG document
        https://bugs.webkit.org/show_bug.cgi?id=176221

        Reviewed by Tim Horton.

        According to the specs:

        https://www.w3.org/TR/SVG11/filters.html#FilterElementHrefAttribute
        https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementHrefAttribute
        https://www.w3.org/TR/SVG11/pservers.html#RadialGradientElementHrefAttribute
        https://www.w3.org/TR/SVG11/pservers.html#PatternElementHrefAttribute

        The xlink:href attribute of the SVG filter, gradient and pattern elements
        must reference another element within the current SVG of the same type.

        In r191731, the code of SVGPatternElement::collectPatternAttributes() was
        removed and replaced by RenderSVGResourcePattern::collectPatternAttributes()
        to avoid cyclic reference in the pattern element. The problem is the old
        code used to check whether the referenced element is<SVGPatternElement>
        before casting it. This code was not copied to the new function. So we
        now allow the SVGPatternElement to reference any SVG resource element.

        To fix this issue, we need to prevent SVGResources from chaining an incorrect
        type of element to the SVG filter, gradient and pattern elements.

        We also need to use the SVGResources for getting the referenced element
        when collecting the attributes for the gradient elements. SVGResources solves
        the cyclic referencing issue so there is no need to repeat the same code
        in many places. Also, from now on the SVGResources will have valid linked
        resource only. So casting the referenced element should always be valid.

        Tests: svg/custom/pattern-invalid-content-inheritance.svg

        * rendering/svg/RenderSVGResourcePattern.cpp:
        (WebCore::RenderSVGResourcePattern::collectPatternAttributes const): Asserts
        the linkedResource is of type RenderSVGResourcePattern.
        * rendering/svg/SVGResources.cpp:
        (WebCore::SVGResources::SVGResources):
        (WebCore::isChainableResource): Ensure that an SVG resource can reference
        only an SVG resource with the valid type.
        (WebCore::SVGResources::buildCachedResources):
        * rendering/svg/SVGResources.h:

2017-09-20  Daniel Bates  <dabates@apple.com>

        Spelling and grammar dots should not overlap
        https://bugs.webkit.org/show_bug.cgi?id=177265
        <rdar://problem/34556424>

        Reviewed by David Hyatt.

        A line may contain both spelling and grammar errors such that these errors overlap.
        For example, "to mooof or not to mooof.". It is more pleasing aesthetically to
        paint spelling and grammar dots such that they do not overlap. This also matches
        AppKit's behavior.

        A side benefit of this change is that it adds support infrastructure towards
        implementing the CSS Pseudo-Elements Module Level 4 pseudo elements ::spelling-error
        and ::grammar-error (see <https://bugs.webkit.org/show_bug.cgi?id=175784>).
        It will also make it straightforward to add ::inactive-selection and allow us
        to make ::selection conform to CSS Pseudo-Elements Module Level 4.

        * CMakeLists.txt: Add file MarkerSubrange.cpp.
        * WebCore.xcodeproj/project.pbxproj: Add files MarkerSubrange.{cpp, h}.
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paintDocumentMarker): Modified to take a const MarkerSubrange&
        instead of a RenderedDocumentMarker&.
        (WebCore::InlineTextBox::paintTextMatchMarker): Modified to take a const MarkerSubrange&
        instead of a RenderedDocumentMarker& and take a boolean as to whether the text match is active.
        (WebCore::InlineTextBox::paintDocumentMarkers): Collect the subranges that need to be
        painted, subdivide them preserving only the frontmost subrange when two or more subranges
        overlap and paint the resulting subranges.
        (WebCore::lineStyleForMarkerType): Deleted; converted to a lambda function inlined
        in paintDocumentMarker() as this is the only place we made use of this function.
        * rendering/InlineTextBox.h:
        * rendering/MarkerSubrange.cpp: Added.
        (WebCore::subdivide): Subdivides the specified list of subranges and returns a list of non-overlapping
        subranges in paint order. The implementation of subdivide() is derived from an algorithm that
        Said Abou-Hallawa came up with.
        * rendering/MarkerSubrange.h: Added.
        (WebCore::MarkerSubrange::MarkerSubrange):

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

        Remove ActionType::CSSDisplayNoneStyleSheet
        https://bugs.webkit.org/show_bug.cgi?id=177275

        Reviewed by Andy Estes.

        It not a real action type anyways.  It was a fake action type
        that stored a String indicating which ContentRuleLists had not triggered
        an ignore-previous-rules action, so we should apply the default stylesheet,
        which is the css-display-none selectors that match everything.

        No change in behaviour.  Covered by existing tests.

        * contentextensions/ContentExtensionActions.h:
        * contentextensions/ContentExtensionCompiler.cpp:
        (WebCore::ContentExtensions::serializeActions):
        * contentextensions/ContentExtensionRule.cpp:
        (WebCore::ContentExtensions::Action::deserialize):
        (WebCore::ContentExtensions::Action::deserializeType):
        (WebCore::ContentExtensions::Action::serializedLength):
        * contentextensions/ContentExtensionRule.h:
        (WebCore::ContentExtensions::Action::Action):
        * contentextensions/ContentExtensionsBackend.cpp:
        (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad):
        * contentextensions/ContentExtensionsBackend.h:
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::open):
        * page/UserContentProvider.cpp:
        (WebCore::UserContentProvider::actionsForResourceLoad):
        * page/UserContentProvider.h:

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

        FloatingObject should not hold a raw pointer to RootInlineBox.
        https://bugs.webkit.org/show_bug.cgi?id=177266

        Reviewed by Simon Fraser.

        FloatingObject and RootInlineBox objects' lifetimes are very much independent from each other.

        Not testable.

        * rendering/FloatingObjects.cpp:
        (WebCore::FloatingObjects::clearLineBoxTreePointers):
        * rendering/FloatingObjects.h:
        (WebCore::FloatingObject::originatingLine const):
        (WebCore::FloatingObject::clearOriginatingLine):
        (WebCore::FloatingObject::setOriginatingLine):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::removeFloatingObject):
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::RenderBlockFlow::appendFloatingObjectToLastLine):
        (WebCore::RenderBlockFlow::reattachCleanLineFloats):
        (WebCore::RenderBlockFlow::determineStartPosition):
        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::RootInlineBox):
        * rendering/RootInlineBox.h:
        (WebCore::RootInlineBox::createWeakPtr):

2017-09-20  Chris Dumez  <cdumez@apple.com>

        Drop legacy DOMError type
        https://bugs.webkit.org/show_bug.cgi?id=177207

        Reviewed by Eric Carlson.

        Drop legacy DOMError type. It has been removed from the Web standards,
        is no longer used by our implementation and was not exposed to the
        Web in WebKit (i.e. marked as [NoInterfaceObject]).

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * Modules/mediastream/MediaEndpointSessionDescription.h:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMPromiseDeferred.cpp:
        * dom/DOMAllInOne.cpp:
        * dom/DOMError.cpp: Removed.
        * dom/DOMError.h: Removed.
        * dom/DOMError.idl: Removed.
        * platform/mock/RTCNotifiersMock.cpp:

2017-09-20  Commit Queue  <commit-queue@webkit.org>

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

        Caused fast/images/animated-gif-webkit-transform.html to time
        out, and possible perf regression (Requested by smfr on
        #webkit).

        Reverted changeset:

        "Simplify compositing layer updating"
        https://bugs.webkit.org/show_bug.cgi?id=176196
        http://trac.webkit.org/changeset/222254

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

        Remove ActionType::InvalidAction
        https://bugs.webkit.org/show_bug.cgi?id=177262

        Reviewed by Tim Horton.

        This was needed before r213322 because we needed to have a default constructor.
        With all these cool new C++14/17 types, we don't need this any more.

        No change in behaviour.

        * contentextensions/ContentExtensionActions.h:
        * contentextensions/ContentExtensionCompiler.cpp:
        (WebCore::ContentExtensions::serializeActions):
        * contentextensions/ContentExtensionRule.cpp:
        (WebCore::ContentExtensions::Action::deserialize):
        (WebCore::ContentExtensions::Action::deserializeType):
        (WebCore::ContentExtensions::Action::serializedLength):
        * contentextensions/ContentExtensionRule.h:
        * contentextensions/ContentExtensionsBackend.cpp:
        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad):

2017-09-20  Daniel Bates  <dabates@apple.com>

        RenderedDocumentMarker.h should include DocumentMarker.h
        https://bugs.webkit.org/show_bug.cgi?id=177263

        Reviewed by Andy Estes.

        RenderedDocumentMarker extends DocumentMarker. RenderedDocumentMarker.h should
        include DocumentMarker.h. Otherwise, both DocumentMarker.h and RenderedDocumentMarker.h
        must be explicitly included.

        * dom/RenderedDocumentMarker.h:
        * rendering/RenderText.cpp:
        * testing/Internals.cpp:

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

        Clean up content extensions code in preparation for more actions with string arguments
        https://bugs.webkit.org/show_bug.cgi?id=177258

        Reviewed by Tim Horton.

        No change in behaviour.  Covered by existing tests.

        * contentextensions/ContentExtensionCompiler.cpp:
        (WebCore::ContentExtensions::serializeString):
        (WebCore::ContentExtensions::resolvePendingDisplayNoneActions):
        (WebCore::ContentExtensions::serializeActions):
        (WebCore::ContentExtensions::serializeSelector): Deleted.
        * contentextensions/ContentExtensionParser.cpp:
        (WebCore::ContentExtensions::loadAction):
        (WebCore::ContentExtensions::loadRule):
        * contentextensions/ContentExtensionRule.cpp:
        (WebCore::ContentExtensions::deserializeString):
        (WebCore::ContentExtensions::Action::deserialize):
        (WebCore::ContentExtensions::Action::deserializeType):
        (WebCore::ContentExtensions::Action::serializedLength):
        * contentextensions/ContentExtensionRule.h:
        (WebCore::ContentExtensions::Action::Action):

2017-09-20  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] atk_table_get_n_rows() and atk_table_get_n_columns() should return values of aria-rowcount and aria-colcount, if present
        https://bugs.webkit.org/show_bug.cgi?id=171172

        Reviewed by Chris Fleizach.

        Modify webKitAccessibleTableGetNColumns() and webkitAccessibleTableGetNRows()
        to prefer the ARIA value over the DOM-based value.

        No new tests needed: We already have coverage through aria-table-attributes.html.
        Platform expectations for this test were updated.

        * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
        (webkitAccessibleTableGetNColumns):
        (webkitAccessibleTableGetNRows):

2017-09-20  Youenn Fablet  <youenn@apple.com>

        Rename CacheStorage to DOMCacheStorage
        https://bugs.webkit.org/show_bug.cgi?id=177025

        Reviewed by Chris Dumez.

        No change of behavior, just renaming CacheStorage class and files to DOMCacheStorage.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/cache/DOMCacheStorage.cpp: Renamed from Source/WebCore/Modules/cache/CacheStorage.cpp.
        (WebCore::DOMCacheStorage::DOMCacheStorage):
        (WebCore::DOMCacheStorage::origin const):
        (WebCore::doSequentialMatch):
        (WebCore::startSequentialMatch):
        (WebCore::copyCaches):
        (WebCore::DOMCacheStorage::match):
        (WebCore::DOMCacheStorage::has):
        (WebCore::DOMCacheStorage::retrieveCaches):
        (WebCore::logConsolePersistencyError):
        (WebCore::DOMCacheStorage::open):
        (WebCore::DOMCacheStorage::remove):
        (WebCore::DOMCacheStorage::keys):
        (WebCore::DOMCacheStorage::stop):
        (WebCore::DOMCacheStorage::activeDOMObjectName const):
        (WebCore::DOMCacheStorage::canSuspendForDocumentSuspension const):
        * Modules/cache/DOMCacheStorage.h: Renamed from Source/WebCore/Modules/cache/CacheStorage.h.
        (WebCore::DOMCacheStorage::create):
        * Modules/cache/DOMCacheStorage.idl: Renamed from Source/WebCore/Modules/cache/CacheStorage.idl.
        * Modules/cache/DOMWindowCaches.cpp:
        (WebCore::DOMWindowCaches::caches):
        (WebCore::DOMWindowCaches::caches const):
        * Modules/cache/DOMWindowCaches.h:
        * Modules/cache/DOMWindowCaches.idl:
        * Modules/cache/WorkerGlobalScopeCaches.cpp:
        (WebCore::WorkerGlobalScopeCaches::caches):
        (WebCore::WorkerGlobalScopeCaches::caches const):
        * Modules/cache/WorkerGlobalScopeCaches.h:
        * Modules/cache/WorkerGlobalScopeCaches.idl:
        * WebCore.xcodeproj/project.pbxproj:

2017-09-20  Eric Carlson  <eric.carlson@apple.com>

        Switch PeerConnection to release logging
        https://bugs.webkit.org/show_bug.cgi?id=177193
        <rdar://problem/34529014>

        Reviewed by Youenn Fablet.

        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::PeerConnectionBackend):
        (WebCore::PeerConnectionBackend::createOfferSucceeded):
        (WebCore::PeerConnectionBackend::createOfferFailed):
        (WebCore::PeerConnectionBackend::createAnswerSucceeded):
        (WebCore::PeerConnectionBackend::createAnswerFailed):
        (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
        (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
        (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
        (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
        (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
        (WebCore::PeerConnectionBackend::addIceCandidateFailed):
        (WebCore::PeerConnectionBackend::newICECandidate):
        (WebCore::PeerConnectionBackend::doneGatheringCandidates):
        (WebCore::PeerConnectionBackend::logChannel const):
        * Modules/mediastream/PeerConnectionBackend.h:
        (WebCore::PeerConnectionBackend::PeerConnectionBackend): Deleted.

        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::RTCPeerConnection):
        (WebCore::RTCPeerConnection::~RTCPeerConnection):
        (WebCore::RTCPeerConnection::addTrack):
        (WebCore::RTCPeerConnection::removeTrack):
        (WebCore::RTCPeerConnection::addTransceiver):
        (WebCore::RTCPeerConnection::queuedCreateOffer):
        (WebCore::RTCPeerConnection::queuedCreateAnswer):
        (WebCore::RTCPeerConnection::queuedSetLocalDescription):
        (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
        (WebCore::RTCPeerConnection::queuedAddIceCandidate):
        (WebCore::RTCPeerConnection::initializeConfiguration):
        (WebCore::RTCPeerConnection::setConfiguration):
        (WebCore::RTCPeerConnection::createDataChannel):
        (WebCore::RTCPeerConnection::setSignalingState):
        (WebCore::RTCPeerConnection::updateIceGatheringState):
        (WebCore::RTCPeerConnection::updateIceConnectionState):
        (WebCore::RTCPeerConnection::updateConnectionState):
        (WebCore::RTCPeerConnection::replaceTrack):
        (WebCore::RTCPeerConnection::dispatchEvent):
        (WebCore::RTCPeerConnection::logChannel const):
        (WebCore::rtcIceGatheringStateToString): Deleted.
        (WebCore::rtcIceConnectionStateToString): Deleted.
        * Modules/mediastream/RTCPeerConnection.h:

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
        (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
        (WebCore::LibWebRTCMediaEndpoint::startLoggingStats):
        (WebCore::LibWebRTCMediaEndpoint::logChannel const):
        (WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        (PAL::LogArgument<webrtc::RTCStats>::toString):

        * platform/mediastream/RTCIceConnectionState.h:
        (PAL::LogArgument<WebCore::RTCIceConnectionState>::toString):

        * platform/mediastream/RTCIceGatheringState.h:
        (PAL::LogArgument<WebCore::RTCIceGatheringState>::toString):

        * platform/mediastream/RTCPeerConnectionState.h:
        (PAL::LogArgument<WebCore::RTCPeerConnectionState>::toString):

        * platform/mediastream/RTCSignalingState.h:
        (PAL::LogArgument<WebCore::RTCSignalingState>::toString):

2017-09-20  Chris Dumez  <cdumez@apple.com>

        Video errors should be instances of Error
        https://bugs.webkit.org/show_bug.cgi?id=174573
        <rdar://problem/34445494>

        Reviewed by Youenn Fablet.

        Video errors should be instances of DOMException and Error as per:
        - https://html.spec.whatwg.org/multipage/media.html#reject-pending-play-promises
        - https://html.spec.whatwg.org/multipage/media.html#loading-the-media-resource:reject-pending-play-promises-2
        - https://html.spec.whatwg.org/multipage/media.html#loading-the-media-resource:reject-pending-play-promises-3
        - https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:reject-pending-play-promises-3
        - https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:reject-pending-play-promises

        No new tests, extended existing test.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::rejectPendingPlayPromises):
        (WebCore::HTMLMediaElement::noneSupported):
        (WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
        (WebCore::HTMLMediaElement::pauseInternal):
        * html/HTMLMediaElement.h:

2017-09-20  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] improve the implementation of FormDataStream
        https://bugs.webkit.org/show_bug.cgi?id=177111

        Reviewed by Alex Christensen.

        * platform/network/curl/FormDataStreamCurl.cpp:
        (WebCore::FormDataStream::read):
        (WebCore::FormDataStream::hasMoreElements const):
        * platform/network/curl/FormDataStreamCurl.h:
        (WebCore::FormDataStream::setHTTPBody):
        (WebCore::FormDataStream::FormDataStream): Deleted.
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
        (WebCore::ResourceHandleCurlDelegate::prepareSendData):
        (WebCore::ResourceHandleCurlDelegate::didFinish):
        (WebCore::ResourceHandleCurlDelegate::didFail):
        (WebCore::ResourceHandleCurlDelegate::setupFormData):
        * platform/network/curl/ResourceHandleCurlDelegate.h:

2017-09-20  Miguel Gomez  <magomez@igalia.com>

        [GTK] Completely garbled display in GMail
        https://bugs.webkit.org/show_bug.cgi?id=168964

        Reviewed by Carlos Garcia Campos.

        Do not try to decode images that are bigger than 32768 pixels, as cairo won't be able to render them,
        and they will break the rendering of the rest of the page.

        Covered by existent tests.

        * platform/graphics/ImageBackingStore.h:
        (WebCore::ImageBackingStore::isOverSize):

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

        Remove RenderNamedFlowThread and FlowThreadController
        https://bugs.webkit.org/show_bug.cgi?id=177229

        Reviewed by Andreas Kling.

        Get rid of some parts of the rendering code for CSS Regions.

        The feature is disabled, no functional changes.

        * WebCore.xcodeproj/project.pbxproj:
        * rendering/FlowThreadController.cpp: Removed.
        * rendering/FlowThreadController.h: Removed.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::paintObject):
        (WebCore::canComputeRegionRangeForBox):
        (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation const):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
        (WebCore::RenderBlockFlow::applyBeforeBreak):
        (WebCore::RenderBlockFlow::applyAfterBreak):
        (WebCore::RenderBlockFlow::logicalHeightForChildForFragmentation const):
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::borderBoxRectInRegion const):
        (WebCore::RenderBox::scroll):
        (WebCore::RenderBox::renderBoxRegionInfo const):
        (WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
        (WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
        (WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent const):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::willBeDestroyed):
        (WebCore::RenderElement::hoverAncestor const):
        * rendering/RenderFlowThread.cpp:
        (WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent const):
        (WebCore::RenderFlowThread::incrementAutoLogicalHeightRegions):
        (WebCore::RenderFlowThread::decrementAutoLogicalHeightRegions):
        (WebCore::RenderFlowThread::addRegionsOverflowFromChild):
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paintLayerContents):
        (WebCore::RenderLayer::hitTestLayer):
        (WebCore::RenderLayer::calculateClipRects const):
        (WebCore::RenderLayer::paintFixedLayersInNamedFlows): Deleted.
        (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows): Deleted.
        * rendering/RenderLayer.h:
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateCompositingLayers):
        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
        (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
        (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed): Deleted.
        (WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed): Deleted.
        * rendering/RenderLayerCompositor.h:
        * rendering/RenderNamedFlowFragment.cpp:
        (WebCore::RenderNamedFlowFragment::checkRegionStyle):
        (WebCore::RenderNamedFlowFragment::namedFlowThread const): Deleted.
        * rendering/RenderNamedFlowFragment.h:
        * rendering/RenderNamedFlowThread.cpp: Removed.
        * rendering/RenderNamedFlowThread.h: Removed.
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::selectionRoot const):
        (WebCore::RenderObject::offsetParent const):
        (WebCore::RenderObject::currentRenderNamedFlowFragment const):
        * rendering/RenderObject.h:
        (WebCore::RenderObject::isRenderGrid const):
        (WebCore::RenderObject::isRenderNamedFlowThread const): Deleted.
        * rendering/RenderRegion.cpp:
        (WebCore::RenderRegion::RenderRegion):
        (WebCore::RenderRegion::attachRegion):
        * rendering/RenderRegion.h:
        (WebCore::RenderRegion::parentNamedFlowThread const): Deleted.
        * rendering/RenderTreeAsText.cpp:
        (WebCore::writeLayers):
        (WebCore::writeRenderRegionList): Deleted.
        (WebCore::writeRenderNamedFlowThreads): Deleted.
        * rendering/RenderView.cpp:
        (WebCore::RenderView::layoutContent):
        (WebCore::RenderView::layoutContentInAutoLogicalHeightRegions):
        (WebCore::RenderView::layout):
        (WebCore::RenderView::selectionBounds const):
        (WebCore::RenderView::repaintSelection const):
        (WebCore::RenderView::setSelection):
        (WebCore::RenderView::updateSelectionForSubtrees):
        (WebCore::RenderView::styleDidChange):
        (WebCore::RenderView::checkTwoPassLayoutForAutoHeightRegions const):
        (WebCore::RenderView::pushLayoutStateForCurrentFlowThread):
        (WebCore::RenderView::popLayoutStateForCurrentFlowThread):
        (WebCore::RenderView::layoutContentToComputeOverflowInRegions): Deleted.
        (WebCore::RenderView::splitSelectionBetweenSubtrees): Deleted.
        (WebCore::RenderView::hasRenderNamedFlowThreads const): Deleted.
        (WebCore::RenderView::flowThreadController): Deleted.
        * rendering/RenderView.h:
        * rendering/SelectionSubtreeRoot.cpp:
        (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection): Deleted.
        * rendering/SelectionSubtreeRoot.h:
        (WebCore::SelectionSubtreeRoot::setSelectionData):

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

        Remove DOM and styling support for CSS Regions
        https://bugs.webkit.org/show_bug.cgi?id=177221

        Reviewed by Andreas Kling.

        This patch removes all CSS Regions (aka "named flow") related code excluding rendering.

        The feature is already disabled so no functional changes.

        * CMakeLists.txt:
        * Configurations/FeatureDefines.xcconfig:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSCSSRuleCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::contentToCSSValue):
        (WebCore::ComputedStyleExtractor::propertyValue):
        (WebCore::convertToRegionBreak): Deleted.
        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator BreakBetween const):
        * css/CSSProperties.json:
        * css/CSSRule.cpp:
        * css/CSSRule.h:
        * css/CSSRule.idl:
        * css/ElementRuleCollector.cpp:
        (WebCore::ElementRuleCollector::matchAuthorRules):
        (WebCore::ElementRuleCollector::matchUserRules):
        (WebCore::ElementRuleCollector::collectMatchingRulesForRegion): Deleted.
        * css/ElementRuleCollector.h:
        (WebCore::ElementRuleCollector::setSameOriginOnly):
        (WebCore::ElementRuleCollector::setRegionForStyling): Deleted.
        * css/InspectorCSSOMWrappers.cpp:
        (WebCore::InspectorCSSOMWrappers::collect):
        * css/RuleSet.cpp:
        (WebCore::determinePropertyWhitelistType):
        (WebCore::RuleData::RuleData):
        (WebCore::RuleSet::addChildRules):
        (WebCore::RuleSet::shrinkToFit):
        (WebCore::RuleSet::addRegionRule): Deleted.
        * css/RuleSet.h:
        (WebCore::RuleSet:: const):
        (WebCore::RuleSet::regionSelectorsAndRuleSets const): Deleted.
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertRegionBreakBetween): Deleted.
        (WebCore::StyleBuilderConverter::convertRegionBreakInside): Deleted.
        * css/StyleProperties.cpp:
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::State::clear):
        (WebCore::StyleResolver::State::State):
        (WebCore::StyleResolver::styleForElement):
        (WebCore::StyleResolver::CascadedProperties::addMatch):
        (WebCore::StyleResolver::checkRegionStyle): Deleted.
        (WebCore::isValidRegionStyleProperty): Deleted.
        * css/StyleResolver.h:
        (WebCore::StyleResolver::State::regionForStyling const): Deleted.
        (WebCore::checkRegionSelector): Deleted.
        * css/StyleRule.cpp:
        (WebCore::StyleRuleBase::destroy):
        (WebCore::StyleRuleBase::copy const):
        (WebCore::StyleRuleBase::createCSSOMWrapper const):
        (WebCore::StyleRuleRegion::StyleRuleRegion): Deleted.
        * css/StyleRule.h:
        (WebCore::StyleRuleBase::isStyleRule const):
        (WebCore::StyleRuleBase::isRegionRule const): Deleted.
        * css/StyleSheetContents.cpp:
        (WebCore::traverseSubresourcesInRules):
        * css/WebKitCSSRegionRule.cpp: Removed.
        * css/WebKitCSSRegionRule.h: Removed.
        * css/WebKitCSSRegionRule.idl: Removed.
        * css/parser/CSSAtRuleID.cpp:
        (WebCore::cssAtRuleID):
        * css/parser/CSSAtRuleID.h:
        * css/parser/CSSParserFastPaths.cpp:
        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
        (WebCore::CSSParserFastPaths::isKeywordPropertyID):
        * css/parser/CSSParserImpl.cpp:
        (WebCore::CSSParserImpl::consumeAtRule):
        (WebCore::CSSParserImpl::consumeRegionRule): Deleted.
        * css/parser/CSSParserImpl.h:
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::isLegacyBreakProperty):
        (WebCore::CSSPropertyParser::parseSingleValue):
        (WebCore::mapFromLegacyBreakProperty):
        (WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
        (WebCore::consumeFlowProperty): Deleted.
        (WebCore::mapFromRegionBreakBetween): Deleted.
        * dom/ContainerNode.cpp:
        (WebCore::destroyRenderTreeIfNeeded):
        * dom/DOMNamedFlowCollection.cpp: Removed.
        * dom/DOMNamedFlowCollection.h: Removed.
        * dom/DOMNamedFlowCollection.idl: Removed.
        * dom/Document.cpp:
        (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
        (WebCore::Document::webkitGetNamedFlows): Deleted.
        (WebCore::Document::namedFlows): Deleted.
        * dom/Document.h:
        * dom/Document.idl:
        * dom/Element.cpp:
        (WebCore::Element::~Element):
        (WebCore::Element::clearStyleDerivedDataBeforeDetachingRenderer):
        (WebCore::Element::unregisterNamedFlowContentElement): Deleted.
        (WebCore::Element::setIsNamedFlowContentElement): Deleted.
        (WebCore::Element::clearIsNamedFlowContentElement): Deleted.
        (WebCore::Element::rareDataIsNamedFlowContentElement const): Deleted.
        (WebCore::Element::setRegionOversetState): Deleted.
        (WebCore::Element::regionOversetState const): Deleted.
        (WebCore::Element::renderNamedFlowFragment const): Deleted.
        (WebCore::Element::shouldMoveToFlowThread const): Deleted.
        (WebCore::Element::webkitRegionOverset const): Deleted.
        (WebCore::Element::webkitGetRegionFlowRanges const): Deleted.
        * dom/Element.h:
        (WebCore::Element::isNamedFlowContentElement const): Deleted.
        * dom/Element.idl:
        * dom/ElementRareData.cpp:
        * dom/ElementRareData.h:
        (WebCore::ElementRareData::ElementRareData):
        (WebCore::ElementRareData::regionOversetState const): Deleted.
        (WebCore::ElementRareData::setRegionOversetState): Deleted.
        (WebCore::ElementRareData::isNamedFlowContentElement const): Deleted.
        (WebCore::ElementRareData::setIsNamedFlowContentElement): Deleted.
        * dom/EventTargetFactory.in:
        * dom/NamedFlowCollection.cpp: Removed.
        * dom/NamedFlowCollection.h: Removed.
        * dom/PseudoElement.h:
        * dom/WebKitNamedFlow.cpp: Removed.
        * dom/WebKitNamedFlow.h: Removed.
        * dom/WebKitNamedFlow.idl: Removed.
        * inspector/InspectorCSSAgent.cpp:
        (WebCore::InspectorCSSAgent::resetNonPersistentData):
        (WebCore::ChangeRegionOversetTask::ChangeRegionOversetTask): Deleted.
        (WebCore::ChangeRegionOversetTask::scheduleFor): Deleted.
        (WebCore::ChangeRegionOversetTask::unschedule): Deleted.
        (WebCore::ChangeRegionOversetTask::reset): Deleted.
        (WebCore::ChangeRegionOversetTask::timerFired): Deleted.
        (WebCore::InspectorCSSAgent::didCreateNamedFlow): Deleted.
        (WebCore::InspectorCSSAgent::willRemoveNamedFlow): Deleted.
        (WebCore::InspectorCSSAgent::didChangeRegionOverset): Deleted.
        (WebCore::InspectorCSSAgent::regionOversetChanged): Deleted.
        (WebCore::InspectorCSSAgent::didRegisterNamedFlowContentElement): Deleted.
        (WebCore::InspectorCSSAgent::didUnregisterNamedFlowContentElement): Deleted.
        (WebCore::InspectorCSSAgent::getNamedFlowCollection): Deleted.
        (WebCore::InspectorCSSAgent::documentNodeWithRequestedFlowsId): Deleted.
        (WebCore::InspectorCSSAgent::buildArrayForRegions): Deleted.
        (WebCore::InspectorCSSAgent::buildObjectForNamedFlow): Deleted.
        * inspector/InspectorCSSAgent.h:
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didCreateNamedFlowImpl): Deleted.
        (WebCore::InspectorInstrumentation::willRemoveNamedFlowImpl): Deleted.
        (WebCore::InspectorInstrumentation::didChangeRegionOversetImpl): Deleted.
        (WebCore::InspectorInstrumentation::didRegisterNamedFlowContentElementImpl): Deleted.
        (WebCore::InspectorInstrumentation::didUnregisterNamedFlowContentElementImpl): Deleted.
        * inspector/InspectorOverlay.cpp:
        (WebCore::buildRendererHighlight):
        (WebCore::buildObjectForElementData):
        (WebCore::buildObjectForRegion): Deleted.
        (WebCore::buildObjectForFlowRegions): Deleted.
        * page/EventHandler.cpp:
        (WebCore::handleWheelEventInAppropriateEnclosingBox):
        * rendering/FlowThreadController.cpp:
        (WebCore::FlowThreadController::ensureRenderFlowThreadWithName): Deleted.
        * rendering/FlowThreadController.h:
        * rendering/RegionOversetState.h: Removed.
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::applyBeforeBreak):
        (WebCore::RenderBlockFlow::applyAfterBreak):
        * rendering/RenderNamedFlowFragment.cpp:
        (WebCore::RenderNamedFlowFragment::getRanges const):
        (WebCore::RenderNamedFlowFragment::layoutBlock):
        (WebCore::RenderNamedFlowFragment::checkRegionStyle):
        (WebCore::RenderNamedFlowFragment::computeStyleInRegion const):
        (WebCore::RenderNamedFlowFragment::setRegionObjectsRegionStyle):
        (WebCore::RenderNamedFlowFragment::setRegionOversetState): Deleted.
        (WebCore::RenderNamedFlowFragment::regionOversetState const): Deleted.
        (WebCore::RenderNamedFlowFragment::updateOversetState): Deleted.
        * rendering/RenderNamedFlowFragment.h:
        * rendering/RenderNamedFlowThread.cpp:
        (WebCore::RenderNamedFlowThread::RenderNamedFlowThread):
        (WebCore::RenderNamedFlowThread::clearContentElements):
        (WebCore::RenderNamedFlowThread::registerNamedFlowContentElement):
        (WebCore::RenderNamedFlowThread::unregisterNamedFlowContentElement):
        (WebCore::RenderNamedFlowThread::hasContentElement const):
        (WebCore::RenderNamedFlowThread::flowThreadName const):
        (WebCore::RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded):
        (WebCore::RenderNamedFlowThread::regionOversetChangeEventTimerFired):
        (WebCore::RenderNamedFlowThread::setMarkForDestruction):
        (WebCore::RenderNamedFlowThread::resetMarkForDestruction):
        (WebCore::RenderNamedFlowThread::isMarkedForDestruction const):
        (WebCore::nextNodeInsideContentElement):
        * rendering/RenderNamedFlowThread.h:
        * rendering/RenderRegion.cpp:
        (WebCore::RenderRegion::installFlowThread):
        * rendering/style/RenderStyleConstants.h:
        * rendering/style/WillChangeData.cpp:
        (WebCore::WillChangeData::propertyCreatesStackingContext):
        * style/RenderTreePosition.cpp:
        (WebCore::RenderTreePosition::previousSiblingRenderer const):
        (WebCore::RenderTreePosition::nextSiblingRenderer const):
        (WebCore::RenderTreePosition::insertionPositionForFlowThread): Deleted.
        (WebCore::RenderTreePosition::isRendererReparented): Deleted.
        * style/RenderTreePosition.h:
        (WebCore::RenderTreePosition::RenderTreePosition):
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateElementRenderer):
        (WebCore::RenderTreeUpdater::createRenderer):
        (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
        (WebCore::registerElementForFlowThreadIfNeeded): Deleted.
        * style/RenderTreeUpdaterGeneratedContent.cpp:
        (WebCore::createContentRenderers):
        * style/StyleChange.cpp:
        (WebCore::Style::determineChange):
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::styleForElement):
        (WebCore::Style::affectsRenderedSubtree):
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::shouldMoveToFlowThread const): Deleted.
        * svg/SVGElement.h:

2017-09-20  Ms2ger  <Ms2ger@igalia.com>

        Add bindings for optional arguments to some WebGL2 methods.
        https://bugs.webkit.org/show_bug.cgi?id=177067

        Reviewed by Antti Koivisto.

        Add bindings for optional arguments to some WebGL2 methods.

        No new tests: not much point in adding tests now; these methods don't
        do anything anyway.

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::uniform1uiv):
        (WebCore::WebGL2RenderingContext::uniform2uiv):
        (WebCore::WebGL2RenderingContext::uniform3uiv):
        (WebCore::WebGL2RenderingContext::uniform4uiv):
        (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
        (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
        (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
        (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
        (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
        (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
        (WebCore::WebGL2RenderingContext::clearBufferiv):
        (WebCore::WebGL2RenderingContext::clearBufferuiv):
        (WebCore::WebGL2RenderingContext::clearBufferfv):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:

2017-09-19  Ryosuke Niwa  <rniwa@webkit.org>

        On Mac, dataTransfer claims to contain URL list when dropping files
        https://bugs.webkit.org/show_bug.cgi?id=177219

        Reviewed by Wenson Hsieh.

        Fixed the bug by removing code which was specifically adding local filenames as URLs in "text/uri-list"
        when pasting or dropping files. Neither Chrome nor Firefox exhibit this behavior, and exposing local
        filenames reveal sensitive information such as username.

        Test: editing/pasteboard/datatransfer-types-dropping-text-file.html

        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::readString):
        (WebCore::addHTMLClipboardTypesForCocoaType):
        (WebCore::absoluteURLsFromPasteboard): Deleted.

2017-09-19  Simon Fraser  <simon.fraser@apple.com>

        Simplify compositing layer updating
        https://bugs.webkit.org/show_bug.cgi?id=176196

        Reviewed by Zalan Bujtas.

        Remove compositing layer updating from the updateLayerPositions() code path, which
        was problematic because it wasn't pre-order. Instead, just rely on post-layout
        compositing updates, which now need to do geometry updates. Micro benchmarking shows
        this to be no slower.

        We can remove the 'OnHitTest' update type, since we always ensure that layout is updated
        before hit testing now.

        Also remove a code path that could trigger updateGeometry() during a style change, and
        in response to images loads, which were bad because layout may not be up-to-date at this time.

        Tested by existing compositing tests. Rebaselined two tests after confirming they are progressions.

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositions):
        (WebCore::RenderLayer::hitTestLayer):
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/RenderLayer.h:
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateGeometry):
        (WebCore::RenderLayerBacking::contentChanged):
        (WebCore::RenderLayerBacking::updateAfterLayout): Deleted.
        * rendering/RenderLayerBacking.h:
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateCompositingLayers):
        (WebCore::RenderLayerCompositor::layerStyleChanged):
        (WebCore::operator<<):
        * rendering/RenderLayerCompositor.h:

2017-09-19  Simon Fraser  <simon.fraser@apple.com>

        Do more math in terms of FloatSizes and FloatPoints
        https://bugs.webkit.org/show_bug.cgi?id=177217

        Reviewed by Zalan Bujtas.
        
        Add operator/(const FloatSize&, const FloatSize&), GraphicsContext::translate(const FloatPoint&),
        FloatRect.scale(FloatSize) and AffineTransform::translate(const FloatSize&)
        and use them in lots of places to do math in terms of points and sizes.

        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::drawImage):
        (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
        (WebCore::CanvasRenderingContext2D::drawTextInternal):
        * page/mac/TextIndicatorWindow.mm:
        (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
        * platform/Theme.cpp:
        (WebCore::Theme::drawNamedImage const):
        * platform/graphics/CrossfadeGeneratedImage.cpp:
        (WebCore::drawCrossfadeSubimage):
        (WebCore::CrossfadeGeneratedImage::draw):
        * platform/graphics/FloatRect.h:
        (WebCore::FloatRect::center const):
        (WebCore::FloatRect::scale):
        * platform/graphics/FloatSize.h:
        (WebCore::operator/):
        * platform/graphics/GradientImage.cpp:
        (WebCore::GradientImage::draw):
        * platform/graphics/GraphicsContext.cpp:
        (WebCore::GraphicsContext::scaleFactorForDrawing const):
        * platform/graphics/GraphicsContext.h:
        (WebCore::GraphicsContext::translate):
        * platform/graphics/Image.cpp:
        (WebCore::Image::drawTiled):
        * platform/graphics/ImageBuffer.cpp:
        (WebCore::ImageBuffer::clampedSize):
        (WebCore::ImageBuffer::createCompatibleBuffer):
        * platform/graphics/LayoutSize.h:
        * platform/graphics/NamedImageGeneratedImage.cpp:
        (WebCore::NamedImageGeneratedImage::draw):
        * platform/graphics/Path.cpp:
        (WebCore::Path::addRoundedRect):
        * platform/graphics/cg/ImageBufferCG.cpp:
        (WebCore::ImageBuffer::createCompatibleBuffer):
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::transformContextForPainting):
        (WebCore::applyRotationForPainting):
        (WebCore::PDFDocumentImage::drawPDFPage):
        * platform/graphics/filters/FETile.cpp:
        (WebCore::FETile::platformApplySoftware):
        * platform/graphics/transforms/AffineTransform.cpp:
        (WebCore::AffineTransform::translate):
        (WebCore::makeMapBetweenRects):
        * platform/graphics/transforms/AffineTransform.h:
        * platform/mac/ScrollbarThemeMac.mm:
        (WebCore::ScrollbarThemeMac::paint):
        * platform/mac/ThemeMac.mm:
        (WebCore::paintToggleButton):
        (WebCore::paintButton):
        (WebCore::paintStepper):
        * rendering/FilterEffectRenderer.cpp:
        (WebCore::FilterEffectRendererHelper::beginFilterEffect):
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
        (WebCore::RenderBoxModelObject::paintBoxShadow):
        * rendering/RenderEmbeddedObject.cpp:
        (WebCore::RenderEmbeddedObject::getReplacementTextGeometry const):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::paintContents):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::paintScrollbar):
        (WebCore::RenderLayerCompositor::paintContents):
        * rendering/RenderMediaControls.cpp:
        (WebCore::getUnzoomedRectAndAdjustCurrentContext):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::paintMenuList):
        (WebCore::RenderThemeMac::paintSliderThumb):
        (WebCore::RenderThemeMac::paintSearchField):
        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
        (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
        (WebCore::RenderThemeMac::paintImageControlsButton):
        * rendering/svg/RenderSVGForeignObject.cpp:
        (WebCore::RenderSVGForeignObject::RenderSVGForeignObject):
        (WebCore::RenderSVGForeignObject::localToParentTransform const):
        * rendering/svg/RenderSVGForeignObject.h:
        * rendering/svg/RenderSVGResourceClipper.cpp:
        (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
        (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
        (WebCore::RenderSVGResourceClipper::hitTestClipContent):
        (WebCore::RenderSVGResourceClipper::resourceBoundingBox):
        * rendering/svg/RenderSVGResourceGradient.cpp:
        (WebCore::clipToTextMask):
        (WebCore::RenderSVGResourceGradient::applyResource):
        * rendering/svg/RenderSVGResourceMarker.cpp:
        (WebCore::RenderSVGResourceMarker::markerTransformation const):
        (WebCore::RenderSVGResourceMarker::markerContentTransformation const):
        * rendering/svg/RenderSVGResourceMasker.cpp:
        (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
        (WebCore::RenderSVGResourceMasker::resourceBoundingBox):
        * rendering/svg/RenderSVGResourcePattern.cpp:
        (WebCore::RenderSVGResourcePattern::buildPattern):
        (WebCore::RenderSVGResourcePattern::createTileImage const):
        * rendering/svg/RenderSVGTransformableContainer.cpp:
        (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
        * rendering/svg/SVGRenderingContext.cpp:
        (WebCore::SVGRenderingContext::createImageBuffer):
        (WebCore::SVGRenderingContext::bufferForeground):
        * svg/SVGAnimateMotionElement.cpp:
        (WebCore::SVGAnimateMotionElement::buildTransformForProgress):
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::localCoordinateSpaceTransform const):
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::draw):

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

        IDBRequest and IDBTransaction error properties should be DOMExceptions
        https://bugs.webkit.org/show_bug.cgi?id=177201

        Reviewed by Alex Christensen.

        IDBRequest and IDBTransaction error properties should be DOMExceptions:
        - https://w3c.github.io/IndexedDB/#idbrequest
        - https://w3c.github.io/IndexedDB/#transaction

        Previously, we used a DOMError type, which is obsolete.

        No new tests, rebaselined existing test.

        * Modules/indexeddb/IDBOpenDBRequest.cpp:
        (WebCore::IDBOpenDBRequest::onError):
        (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
        * Modules/indexeddb/IDBRequest.cpp:
        (WebCore:: const):
        (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
        (WebCore::IDBRequest::onError):
        * Modules/indexeddb/IDBRequest.h:
        * Modules/indexeddb/IDBRequest.idl:
        * Modules/indexeddb/IDBTransaction.cpp:
        (WebCore::IDBTransaction::error const):
        (WebCore::IDBTransaction::abortDueToFailedRequest):
        (WebCore::IDBTransaction::didCreateIndexOnServer):
        (WebCore::IDBTransaction::connectionClosedFromServer):
        * Modules/indexeddb/IDBTransaction.h:
        * Modules/indexeddb/IDBTransaction.idl:
        * Modules/indexeddb/shared/IDBError.cpp:
        (WebCore::IDBError::toDOMException const):
        * Modules/indexeddb/shared/IDBError.h:

2017-09-19  Daewoong Jang  <daewoong.jang@naverlabs.com>

        [Curl] Fix r222147
        https://bugs.webkit.org/show_bug.cgi?id=177128

        Reviewed by Alex Christensen.

        * platform/network/curl/CurlSSLHandle.h:
        * platform/network/curl/CurlSSLVerifier.cpp:
        (WebCore::CurlSSLVerifier::certVerifyCallback):
        * platform/network/curl/CurlSSLVerifier.h:

2017-09-19  Simon Fraser  <simon.fraser@apple.com>

        Image subclasses should support is<> and downcast<>
        https://bugs.webkit.org/show_bug.cgi?id=177209

        Reviewed by Tim Horton.

        Add SPECIALIZE_TYPE_TRAITS_IMAGE() for Image subclasses.

        Also use #pragma once in these headers.

        * platform/graphics/CrossfadeGeneratedImage.h:
        * platform/graphics/GeneratedImage.h:
        * platform/graphics/GradientImage.h:
        * platform/graphics/Image.h:
        * platform/graphics/NamedImageGeneratedImage.h:

2017-09-19  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION (r215613): Incorrect corners clipping with border-radius
        https://bugs.webkit.org/show_bug.cgi?id=176498
        <rdar://problem/34112607>

        Reviewed by Tim Horton.

        http://trac.webkit.org/r215613 introduced an optimization to bail out of repainting borders if the invalidated
        rect to paint is fully contained within the inner rounded rect of the border. However, due to issues with
        coordinate and intersection math in RoundedRect::contains() and ellipseContainsPoint(), this causes
        RenderBoxModelObject::paintBorder to return early even in circumstances where the border requires a repaint.
        This patch fixes the contains() helper in RoundedRect and adds a new API test suite for RoundedRect that covers
        these changes.

        Test: WebCore.RoundedRectContainsRect

        * platform/graphics/GeometryUtilities.cpp:
        (WebCore::ellipseContainsPoint):

        This function attempts to return early if the Manhattan distance of the transformed point is less than the
        radius of the circle that results from applying the same transformation to the ellipse. However, this bails and
        returns true if `x + y <= R`, but this means that if x and y are negative, we'll always end up returning true.
        We fix this by adding the absolute values instead, so the check becomes: |x| + |y| <= R.

        * platform/graphics/RoundedRect.cpp:
        (WebCore::RoundedRect::contains const):

        Before this patch, otherRect's upper left location was being used to hit-test against the ellipses formed from
        each of the 4 corners of the rounded rect. Instead, this should use (x, y), (maxX, y), (x, maxY), (maxX, maxY)
        for the top left, top right, bottom left, and bottom right corners, respectively.

        Additionally, the checks for the bottom left and bottom right to determine whether the rect corner should be
        checked for intersection against the ellipse's corner are incorrect. In the bottom left corner, the check for
        `otherRect.maxX() >= center.x()` should instead be `otherRect.x() <= center.x()`, and the check for
        `otherRect.x() <= center.x()` should instead be `otherRect.maxX() >= center.x()`.

        * platform/graphics/RoundedRect.h:

2017-09-19  Alexey Proskuryakov  <ap@apple.com>

        Layering violation in Editor::createFragment
        https://bugs.webkit.org/show_bug.cgi?id=176123

        Reviewed by Darin Adler.

        * WebCore.xcodeproj/project.pbxproj:
        * editing/cocoa/WebArchiveResourceFromNSAttributedString.h: Added.
        * editing/cocoa/WebArchiveResourceFromNSAttributedString.mm: Added.
        Added a wrapper class for ArchiveResource, suitable for use as a WebResourceHandler.

        * editing/cocoa/WebArchiveResourceWebResourceHandler.h: Added.
        * editing/cocoa/WebArchiveResourceWebResourceHandler.mm: Added.
        Objects of this class can be passed as "WebResourceHandler", and created instances
        of the above class.

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::attributesForAttributedStringConversion):
        (WebCore::createFragment):
        On newer OS versions, don't use WebKitLegacy to convert NSAttributedString to a
        document fragment. We now only use system frameworks to convert the attributed
        string to HTML source, and parse HTML into a fragment directly in WebCore.

        * platform/URL.h: Exported fakeURLWithRelativePart.

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

        Allow WTF::map to use any class that is iterable and has a size getter
        https://bugs.webkit.org/show_bug.cgi?id=177026

        Reviewed by Darin Adler.

        No change of behavior.
        Using WTF::map to go from maps to vectors.

        * loader/appcache/ApplicationCacheHost.cpp:
        (WebCore::ApplicationCacheHost::resourceList):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):

2017-09-19  Eric Carlson  <eric.carlson@apple.com>

        Quiet media player private logging
        https://bugs.webkit.org/show_bug.cgi?id=177199

        Reviewed by Jer Noble.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):

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

        Allow modern decoding of Vectors
        https://bugs.webkit.org/show_bug.cgi?id=177102

        Reviewed by Andy Estes.

        * Modules/cache/DOMCacheEngine.h:
        (WebCore::DOMCacheEngine::CacheInfos::decode):
        (WebCore::DOMCacheEngine::CacheIdentifierOperationResult::decode):
        * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
        (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
        * Modules/indexeddb/IDBDatabaseIdentifier.h:
        (WebCore::IDBDatabaseIdentifier::decode):
        * Modules/indexeddb/IDBFactory.cpp:
        (WebCore::IDBFactory::openInternal):
        (WebCore::IDBFactory::deleteDatabase):
        * Modules/indexeddb/IDBGetAllResult.h:
        (WebCore::IDBGetAllResult::decode):
        * Modules/indexeddb/IDBGetResult.h:
        (WebCore::IDBGetResult::decode):
        * Modules/indexeddb/IDBKeyData.h:
        (WebCore::IDBKeyData::decode):
        * Modules/indexeddb/IDBKeyRangeData.h:
        (WebCore::IDBKeyRangeData::decode):
        * Modules/indexeddb/IDBValue.h:
        (WebCore::IDBValue::decode):
        * Modules/indexeddb/shared/IDBError.h:
        * Modules/indexeddb/shared/IDBIterateCursorData.h:
        (WebCore::IDBIterateCursorData::decode):
        * Modules/indexeddb/shared/IDBRequestData.h:
        (WebCore::IDBRequestData::decode):
        * Modules/indexeddb/shared/IDBResultData.h:
        (WebCore::IDBResultData::decode):
        * page/SecurityOriginData.h:
        (WebCore::SecurityOriginData::decode):
        * platform/Cookie.h:
        (WebCore::Cookie::decode):
        * platform/mediastream/MediaConstraints.h:
        (WebCore::MediaTrackConstraintSetMap::decode):
        * platform/network/FormData.h:
        (WebCore::FormDataElement::decode):
        * workers/service/ServiceWorkerJobData.h:
        (WebCore::ServiceWorkerJobData::decode):
        * workers/service/ServiceWorkerRegistrationData.h:
        (WebCore::ServiceWorkerRegistrationData::decode):
        * workers/service/ServiceWorkerRegistrationKey.h:
        (WebCore::ServiceWorkerRegistrationKey::decode):

2017-09-19  Ryosuke Niwa  <rniwa@webkit.org>

        On iOS, getData can't get text set by setData during copy event
        https://bugs.webkit.org/show_bug.cgi?id=176980
        <rdar://problem/34453915>

        Reviewed by Darin Adler.

        The bug was caused by iOS port not implementing Pasteboard::createPrivate(). Rather than implementing this in iOS,
        replace its use for copy & paste events by StaticPasteboard Wenson added for input events. This makes read-write
        pasteboard platform agnostic and paves the way to make writing to pasteboard in a single IPC in WebKit2.

        Also fixed a bug that iOS port's Pasteboard::types returned the list of all supported types instead of ones
        actually present in the pasteboard.

        This patch also adds a vector of types to StaticPasteboard to maintain the type order.

        Tests: editing/pasteboard/dataTransfer-types-is-initially-empty-on-copy.html
               editing/pasteboard/dataTransfer-types-pasting-plaintext.html

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::createForCopyAndPaste): Make StaticPasteboard instead of a private pasteboard.
        (WebCore::DataTransfer::createForInputEvent):
        * editing/Editor.cpp:
        (WebCore::dispatchClipboardEvent): Call newly added commitToPasteboard on StaticPasteboard.
        * platform/Pasteboard.h:
        (WebCore::Pasteboard::isStatic const):
        * platform/PasteboardStrategy.h:
        * platform/StaticPasteboard.cpp:
        (WebCore::StaticPasteboard::create): Deleted.
        (WebCore::StaticPasteboard::StaticPasteboard):
        (WebCore::StaticPasteboard::hasData):
        (WebCore::StaticPasteboard::types): Deleted. Now simply returns m_type.
        (WebCore::StaticPasteboard::readString): Added.
        (WebCore::StaticPasteboard::writeString): Added.
        (WebCore::StaticPasteboard::clear): Added.
        (WebCore::StaticPasteboard::commitToPasteboard): Added.
        (isType): Added.
        * platform/StaticPasteboard.h:
        (WebCore::Pasteboard::isStatic const): Added.
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::createPrivate): Deleted.
        (WebCore::Pasteboard::writePasteboard): Deleted.
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::createPrivate): Deleted.
        (WebCore::Pasteboard::writePasteboard): Deleted.
        (WebCore::addHTMLClipboardTypesForCocoaType):
        (WebCore::Pasteboard::types): Return the actual list of types in the pasteboard.
        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::createPrivate): Deleted.
        (WebCore::Pasteboard::writePasteboard): Deleted.
        * platform/win/PasteboardWin.cpp:
        (WebCore::Pasteboard::createPrivate): Deleted.
        (WebCore::Pasteboard::writePasteboard): Deleted.
        * platform/wpe/PasteboardWPE.cpp:
        (WebCore::Pasteboard::createPrivate): Deleted.
        (WebCore::Pasteboard::writePasteboard): Deleted.

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

        AXObjectCache::performDeferredCacheUpdate is called recursively through FrameView::layout. 
        https://bugs.webkit.org/show_bug.cgi?id=176218
        <rdar://problem/34205612>

        Reviewed by Simon Fraser.

        There are certain cases when we might re-enter performDeferredCacheUpdate through recursive
        layout calls (see webkit.org/b/177176) and mutate m_deferredTextChangedList multiple times.

        Test: accessibility/crash-table-recursive-layout.html

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

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

        [Cocoa] Add an ImageDecoder subclass backed by AVFoundation
        https://bugs.webkit.org/show_bug.cgi?id=176825

        Reviewed by Eric Carlson.

        Add a new concrete subclass of ImageDecoder which uses AVFoundation to parse and decode
        image data.

        AVFoundation APIs require prior knowledge of the media data's mime type to determine whether
        the media data is decodable, so the mime type information must be passed through from the
        CachedResource -> CachedImage -> ImageFrameCache -> ImageSource so as to be available when
        creating the ImageDecoder:

        (Drive-by fix: the createFrameImageAtIndex() method will mutate internal state, so make it
        non-const.)

        * loader/cache/CachedImage.h:
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::mimeType const):
        * platform/cf/CoreMediaSoftLink.cpp:
        * platform/cf/CoreMediaSoftLink.h:
        * platform/cocoa/VideoToolboxSoftLink.cpp:
        * platform/cocoa/VideoToolboxSoftLink.h:
        * platform/graphics/Image.cpp:
        (WebCore::Image::mimeType const):
        (WebCore::Image::expectedContentSize const):
        * platform/graphics/Image.h:
        * platform/graphics/ImageDecoder.cpp:
        (WebCore::ImageDecoder::create):
        * platform/graphics/ImageDecoder.h:
        (WebCore::ImageDecoder::setExpectedContentSize):
        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::mimeType const):
        * platform/graphics/ImageFrameCache.h:
        * platform/graphics/ImageObserver.h:
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::ensureDecoderAvailable):
        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::ImageDecoderCG::createFrameImageAtIndex):
        * platform/graphics/cg/ImageDecoderCG.h:

        Add the new class, ImageDecoderAVFObjC:

        AVFoundation expects to load all the media data for an AVURLAsset itself. To map between the
        provided SharedData and AVURLAsset's requirements, create a delegate object
        WebCoreSharedBufferResourceLoaderDelegate, which responds to requests from the AVURLAsset by
        extracting data from the SharedData object. Ensure AVURLAsset doesn't load any data outside
        this delegate by passing the AVURLAssetReferenceRestrictionsKey /
        AVAssetReferenceRestrictionForbidAll key and value in the AVURLAsset creation options.

        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h: Added.
        (WebCore::ImageDecoderAVFObjC::create):
        (WebCore::ImageDecoderAVFObjC::mimeType const):
        (WebCore::ImageDecoderAVFObjC::RotationProperties::isIdentity const):
        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: Added.
        (SOFT_LINK_CONSTANT):
        (-[WebCoreSharedBufferResourceLoaderDelegate initWithParent:]):
        (-[WebCoreSharedBufferResourceLoaderDelegate setExpectedContentSize:]):
        (-[WebCoreSharedBufferResourceLoaderDelegate updateData:complete:]):
        (-[WebCoreSharedBufferResourceLoaderDelegate canFulfillRequest:]):
        (-[WebCoreSharedBufferResourceLoaderDelegate enqueueRequest:]):
        (-[WebCoreSharedBufferResourceLoaderDelegate fulfillPendingRequests]):
        (-[WebCoreSharedBufferResourceLoaderDelegate fulfillRequest:]):
        (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
        (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
        (WebCore::customSchemeURL):
        (WebCore::imageDecoderAssetOptions):
        (WebCore::transformToRotationProperties):
        (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
        (WebCore::ImageDecoderAVFObjC::canDecodeType):
        (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
        (WebCore::ImageDecoderAVFObjC::readSampleMetadata): Parses the media data using AVSampleCursor to walk
            the media sample table, extracting frame presentation time, decode time, and duration.
        (WebCore::ImageDecoderAVFObjC::readTrackMetadata): Reads the affine transform and size information from
            the AVAssetTrack, and transforms the transform into a rotation value.
        (WebCore::ImageDecoderAVFObjC::storeSampleBuffer): Decompress the incoming sample data, optionally rotate
            the output, and store the results in the sample data vector.
        (WebCore::ImageDecoderAVFObjC::advanceCursor): Wrap around the end of the sample table.
        (WebCore::ImageDecoderAVFObjC::setTrack): Reset all sample and track metadata.
        (WebCore::ImageDecoderAVFObjC::encodedDataStatus const): Retrieve from sample data.
        (WebCore::ImageDecoderAVFObjC::frameCount const): Ditto.
        (WebCore::ImageDecoderAVFObjC::repetitionCount const): Ditto.
        (WebCore::ImageDecoderAVFObjC::uti const): Ditto.
        (WebCore::ImageDecoderAVFObjC::filenameExtension const): Ditto.
        (WebCore::ImageDecoderAVFObjC::frameSizeAtIndex const): Ditto.
        (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const): Ditto.
        (WebCore::ImageDecoderAVFObjC::frameOrientationAtIndex const): Ditto.
        (WebCore::ImageDecoderAVFObjC::frameDurationAtIndex const): Ditto.
        (WebCore::ImageDecoderAVFObjC::frameHasAlphaAtIndex const): Ditto.
        (WebCore::ImageDecoderAVFObjC::frameAllowSubsamplingAtIndex const): Ditto.
        (WebCore::ImageDecoderAVFObjC::frameBytesAtIndex const): Ditto.
        (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex): If the sample data has already been
            decompressed, return it. Otherwise, walk through the sample table decompressing frames
            until the desired frame is decoded.
        (WebCore::ImageDecoderAVFObjC::setData):
        (WebCore::ImageDecoderAVFObjC::clearFrameBufferCache):

        Modify WebCoreDecompressionSession so that it can emit frames which have been converted from
        YUV -> RGB as part of the decode operation. Also, add a synchronous decoding operation
        method, for use in ImageDecoderAVFObjC.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureDecompressionSession):
        * platform/graphics/cocoa/WebCoreDecompressionSession.h:
        (WebCore::WebCoreDecompressionSession::createOpenGL):
        (WebCore::WebCoreDecompressionSession::createRGB):
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::WebCoreDecompressionSession):
        (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
        (WebCore::WebCoreDecompressionSession::decodeSample):
        (WebCore::WebCoreDecompressionSession::decodeSampleSync):

        Other changes:

        * WebCore.xcodeproj/project.pbxproj: Add new files to project.
        * platform/cocoa/VideoToolboxSoftLink.cpp: Add newly referenced methods.
        * platform/cocoa/VideoToolboxSoftLink.h: Ditto.


2017-09-19  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Move Authentication related tasks into AuthenticationChallenge class
        https://bugs.webkit.org/show_bug.cgi?id=177105

        Currently those codes are in ResourceHandle or related companion. It will
        be reused with NetworkLoadTask so that it should be separated from them.

        Reviewed by Alex Christensen.

        * platform/Curl.cmake:
        * platform/network/curl/AuthenticationChallenge.h:
        (WebCore::AuthenticationChallenge::AuthenticationChallenge): Deleted.
        (WebCore::AuthenticationChallenge::authenticationClient const): Deleted.
        (WebCore::AuthenticationChallenge::setAuthenticationClient): Deleted.
        * platform/network/curl/AuthenticationChallengeCurl.cpp: Added.
        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
        (WebCore::AuthenticationChallenge::protectionSpaceServerTypeFromURI):
        (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
        (WebCore::AuthenticationChallenge::removeLeadingAndTrailingQuotes):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
        (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
        (WebCore::removeLeadingAndTrailingQuotes): Deleted.
        (WebCore::ResourceHandleCurlDelegate::getProtectionSpace): Deleted.
        * platform/network/curl/ResourceHandleCurlDelegate.h:

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

        Do not mutate RenderText content during layout.
        https://bugs.webkit.org/show_bug.cgi?id=176219
        <rdar://problem/34205724>

        Reviewed by David Hyatt.

        Update combined text when the style/content change as opposed to lazily, during layout.
        -content mutation during layout might make the inline tree go out of sync.

        Test: fast/text/international/dynamic-text-combine-crash.html

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
        * rendering/RenderCombineText.cpp:
        (WebCore::RenderCombineText::styleDidChange):
        (WebCore::RenderCombineText::setRenderedText):
        (WebCore::RenderCombineText::combineTextIfNeeded):
        (WebCore::RenderCombineText::combineText): Deleted.
        * rendering/RenderCombineText.h:
        * rendering/RenderText.h:
        * rendering/line/BreakingContext.h:
        (WebCore::BreakingContext::handleText):
        * rendering/line/LineBreaker.cpp:
        (WebCore::LineBreaker::skipLeadingWhitespace):

2017-09-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        createMarkupInternal should protect its pointer to the Range's common ancestor
        https://bugs.webkit.org/show_bug.cgi?id=177033
        <rdar://problem/34265390>

        Reviewed by Tim Horton.

        Adds basic safeguarding to codepaths hit while executing an outdent command.

        Test: editing/execCommand/outdent-with-media-query-listener-in-iframe.html

        * editing/IndentOutdentCommand.cpp:
        (WebCore::IndentOutdentCommand::outdentRegion):

        Avoid an infinite loop if endOfCurrentParagraph is a null position.

        * editing/markup.cpp:
        (WebCore::createMarkupInternal):

        Protect the raw pointer to the Range's common ancestor node.

2017-09-19  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r222217 and r222214.
        This change introduced two LayoutTest failures.
        https://bugs.webkit.org/show_bug.cgi?id=177026

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
        * rendering/RenderCombineText.cpp:
        (WebCore::RenderCombineText::styleDidChange):
        (WebCore::RenderCombineText::setRenderedText):
        (WebCore::RenderCombineText::combineText):
        (WebCore::RenderCombineText::combineTextIfNeeded): Deleted.
        * rendering/RenderCombineText.h:
        * rendering/RenderText.cpp:
        * rendering/RenderText.h:
        * rendering/line/BreakingContext.h:
        (WebCore::BreakingContext::handleText):
        * rendering/line/LineBreaker.cpp:
        (WebCore::LineBreaker::skipLeadingWhitespace):

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

        Attempt to fix Linux build.

        * rendering/RenderText.cpp:

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

        Do not mutate RenderText content during layout.
        https://bugs.webkit.org/show_bug.cgi?id=176219
        <rdar://problem/34205724>

        Reviewed by David Hyatt.

        Update combined text when the style/content change as opposed to lazily, during layout.
        -content mutation during layout might make the inline tree go out of sync.

        Test: fast/text/international/dynamic-text-combine-crash.html

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
        * rendering/RenderCombineText.cpp:
        (WebCore::RenderCombineText::styleDidChange):
        (WebCore::RenderCombineText::setRenderedText):
        (WebCore::RenderCombineText::combineTextIfNeeded):
        (WebCore::RenderCombineText::combineText): Deleted.
        * rendering/RenderCombineText.h:
        * rendering/RenderText.h:
        * rendering/line/BreakingContext.h:
        (WebCore::BreakingContext::handleText):
        * rendering/line/LineBreaker.cpp:
        (WebCore::LineBreaker::skipLeadingWhitespace):

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

        [GTK] The binding code of Media Source Extension of AudioTrack, VideoTrack and TextTrack is not generated
        https://bugs.webkit.org/show_bug.cgi?id=174620

        Reviewed by Michael Catanzaro.

        Add AudioTrackMediaSource, VideoTrackMediaSource and TextTrackMediaSource IDL files in CMakeLists. Fix WPT test
        that checks MSE interfaces. This test failed since webm is not supported for MSE in GTK port. PR already merged
        in WPT repository.

        Remove skipped test that is now passing in TestExpectation. Modify expected file for GTK (same as mac).

        * CMakeLists.txt:

2017-09-18  Carlos Garcia Campos  <cgarcia@igalia.com>

        [Harfbuzz] adjustSelectionRectForComplexText() should also pass the character range when shaping
        https://bugs.webkit.org/show_bug.cgi?id=177049

        Reviewed by Michael Catanzaro.

        Now that the shaper support receiving a range we should use that also in
        adjustSelectionRectForComplexText(). This will ensure consistent results with
        getGlyphsAndAdvancesForComplexText().

        * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
        (WebCore::FontCascade::adjustSelectionRectForComplexText const):

2017-09-19  Dean Jackson  <dino@apple.com>

        [WebGL] VideoTextureCopierCV doesn't correctly restore vertex attribute state
        https://bugs.webkit.org/show_bug.cgi?id=176771
        <rdar://problem/34386621>

        Reviewed by Antoine Quint.

        The OpenGL context in VideoTextureCopierCV wasn't being restored to
        the state it had before rendering a video to a texture. Specifically
        the vertex attribute values were never recorded by the state saver.

        Update the existing test of VideoTextureCopierCV so that it is
        explicitly doing something different from the WebCore code, which
        means that state will have to be correctly restored for the test
        to pass.

        * platform/graphics/cv/VideoTextureCopierCV.cpp:
        (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Make sure
        to record the vertex attribute state once we know the location of the position attribute.
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::saveVertexAttribState): Save all the
        applicable vertex attribute state information.
        * platform/graphics/cv/VideoTextureCopierCV.h: GC3DStateSaver can use a reference
        to the GC3D rather than a pointer.

2017-09-19  Dean Jackson  <dino@apple.com>

        [WebGL] accelerated texImage2D for video doesn't respect flipY
        https://bugs.webkit.org/show_bug.cgi?id=176491
        <rdar://problem/33833511>

        Reviewed by Jer Noble.

        (Take 3 - this was rolled out due to a test failure)

        Previously, if UNPACK_FLIP_Y_WEBGL was set to true, we'd either fall
        back to software or fail to upload texture data. Fix this by intercepting
        the texImage2D call, checking the orientation of the video, and running
        a small shader program to flip it if necessary.

        While there, implement UNPACK_PREMULTIPLY_ALPHA_WEBGL as well, although
        none of our media decoders support video with alpha, so unfortunately
        this will have no visible change.

        Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
               fast/canvas/webgl/texImage2D-video-flipY-true.html

        * platform/cocoa/CoreVideoSoftLink.cpp: Add link to CVOpenGL(ES)TextureGetCleanTexCoords,
        which is used to check the orientation of the source video.
        * platform/cocoa/CoreVideoSoftLink.h:

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): We can
        now handle flipped or premultiplied requests.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): Ditto.

        * platform/graphics/cv/VideoTextureCopierCV.cpp:
        (WebCore::VideoTextureCopierCV::VideoTextureCopierCV): Rename readFramebuffer to
        simply framebuffer.
        (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV): Delete the program and buffer
        if they were created.
        (WebCore::VideoTextureCopierCV::initializeContextObjects): Sets up the shader program
        and the vertex buffer for drawing. Also records the location of the uniforms.
        (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Create a new
        framebuffer object, and render the video texture into that framebuffer using a
        shader that can flip the coordinates.
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver): Helper to restore
        the state of the user's GraphicsContext3D while we're intercepting calls.
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
        * platform/graphics/cv/VideoTextureCopierCV.h:

        * platform/graphics/GraphicsContext3D.h: Add two new entry points, for direct shader
        compilation and attribute access. This avoids going through ANGLE.
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::compileShader):
        (WebCore::GraphicsContext3D::compileShaderDirect):
        (WebCore::GraphicsContext3D::getAttribLocationDirect):

2017-09-18  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Make ImageFrame::duration() return Seconds instead of float
        https://bugs.webkit.org/show_bug.cgi?id=177103

        Reviewed by Simon Fraser.

        ScalableImageDecoder stores milliseconds for the duration of its ImageFrames.
        But ImageFrameCache store seconds for the duration of its ImageFrames.
        To fix this issue use Seconds for the ImageFrame duration.

        * platform/graphics/BitmapImage.h:
        * platform/graphics/ImageDecoder.h:
        * platform/graphics/ImageFrame.h:
        (WebCore::ImageFrame::setDuration):
        (WebCore::ImageFrame::duration const):
        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::frameDurationAtIndex):
        * platform/graphics/ImageFrameCache.h:
        * platform/graphics/ImageSource.h:
        (WebCore::ImageSource::frameDurationAtIndex):
        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::ImageDecoderCG::frameDurationAtIndex const):
        * platform/graphics/cg/ImageDecoderCG.h:
        * platform/image-decoders/ScalableImageDecoder.cpp:
        (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
        * platform/image-decoders/ScalableImageDecoder.h:
        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::frameComplete):
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::readChunks):
        (WebCore::PNGImageDecoder::frameHeader): Deleted.
        (WebCore::PNGImageDecoder::init): Deleted.
        (WebCore::PNGImageDecoder::clearFrameBufferCache): Deleted.
        (WebCore::PNGImageDecoder::initFrameBuffer): Deleted.
        (WebCore::PNGImageDecoder::frameComplete): Deleted.
        (WebCore::PNGImageDecoder::processingStart): Deleted.
        (WebCore::PNGImageDecoder::processingFinish): Deleted.
        (WebCore::PNGImageDecoder::fallbackNotAnimated): Deleted.

2017-09-18  Per Arne Vollan  <pvollan@apple.com>

        [Win] Compile error in InbandTextTrackPrivateAVCF::readNativeSampleBuffer.
        https://bugs.webkit.org/show_bug.cgi?id=177108

        Reviewed by Brent Fulgham.

        The InbandTextTrackPrivateAVF::m_sampleInputBuffer is private and not accessible in this method.
 
        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:

2017-09-18  Tim Horton  <timothy_horton@apple.com>

        Support min() and max() in calc()
        https://bugs.webkit.org/show_bug.cgi?id=167000
        <rdar://problem/30153481>

        Reviewed by David Hyatt.
        Patch originally by Myles Maxfield.

        Add two new toplevel functions to CSS, min() and max(), which take an
        arbirary number of arguments and resolve to the minimum and maximum of
        the resolved value of the arguments, respectively. It is also possible
        to use min() and max() inside calc(), and to use calc()-like math
        inside min() and max().

        * css/CSSCalculationValue.cpp:
        (WebCore::determineCategory):
        min and max operators don't use determineCategory; we have a specific
        implementation for them in createMinOrMax.

        (WebCore::resolvedTypeForMinOrMax):
        The spec says that min() and max() should be marked as invalid if they
        have values of more than one type, but that percentages should resolve
        against the destination type before making this determination. So,
        if the destination type is length, percent turns into percent-length,
        and similarly for number.

        (WebCore::isIntegerResult):
        Add an n-way implementation of isIntegerResult.

        (WebCore::isSamePair):
        (WebCore::CSSCalcOperation::createMinOrMax): Create a min() or max()
        operation, as long as the types of arguments are all the same. Allow
        lengths to upgrade the whole operation to percent-length, and numbers
        to percent-number, which will cause us to use CalculationValue and friends
        in order to do proper resolution of all of the parameters instead of
        just comparing their numeric values.

        (WebCore::CSSCalcOperation::createCalcExpression):
        (WebCore::CSSCalcOperation::doubleValue):
        (WebCore::CSSCalcOperation::computeLengthPx):
        (WebCore::CSSCalcOperation::customCSSText):
        (WebCore::CSSCalcOperation::primitiveType):
        (WebCore::CSSCalcOperation::CSSCalcOperation):
        (WebCore::CSSCalcOperation::evaluate):
        (WebCore::CSSCalcOperation::evaluateOperator):
        Adapt to child counts greater than two.

        (WebCore::CSSCalcOperation::buildCssText):
        Add support for min() and max().

        (WebCore::CSSCalcExpressionNodeParser::parseCalc):
        parseCalc now accepts a CSSValueID parameter indicating which calc function
        it should parse (calc, webkit-calc, min, or max), and delegates to either
        parseValueExpression or parseMinMaxExpression.

        (WebCore::CSSCalcExpressionNodeParser::operatorValue):
        (WebCore::CSSCalcExpressionNodeParser::parseValue):
        If min() or max() are found while parsing a value (i.e. nested inside
        either calc or themselves), use parseMinMaxExpression on that subtree.

        (WebCore::CSSCalcExpressionNodeParser::parseValueTerm):
        (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
        (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
        Adjust to the CSSCalcBinaryOperation->CSSCalcOperation rename.

        (WebCore::CSSCalcExpressionNodeParser::parseMinMaxExpression):
        Added. Parse an arbitrary number of comma-and-whitespace-separated children.

        (WebCore::createBlendHalf):
        Adjust to the CSSCalcBinaryOperation->CSSCalcOperation rename.

        (WebCore::createCSS):
        Build the CSSCalcOperation for the platform-independent min and max operations.

        (WebCore::CSSCalcValue::create):
        Pass the function being parsed and the destination calc category for the
        property being parsed for into create, and then into the parser so that
        it can know which function it is parsing for, and what kind of result it
        needs (as previously mentioned above in resolvedTypeForMinOrMax).

        * css/CSSCalculationValue.h:
        * css/CSSValueKeywords.in:
        Add min and max functions as CSS keywords.

        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertLength):
        (WebCore::StyleBuilderConverter::convertTo100PercentMinusLength):
        * platform/Length.cpp:
        (WebCore::convertTo100PercentMinusLength):
        Adapt to the CalcExpressionOperation constructor taking a vector of
        arguments instead of two.

        * css/parser/CSSPropertyParserHelpers.cpp:
        (WebCore::CSSPropertyParserHelpers::CalcParser::CalcParser):
        Store and pass the specific function being parsed down into CSSCalcValue.

        (WebCore::CSSPropertyParserHelpers::consumeInteger):
        (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
        (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
        (WebCore::CSSPropertyParserHelpers::consumeNumber):
        (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
        (WebCore::CSSPropertyParserHelpers::consumeLength):
        (WebCore::CSSPropertyParserHelpers::consumePercent):
        (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
        (WebCore::CSSPropertyParserHelpers::consumeAngle):
        (WebCore::CSSPropertyParserHelpers::consumeTime):
        Pass the destination type into each calc parser.

        * platform/CalculationValue.cpp:
        (WebCore::CalcExpressionOperation::evaluate const):
        (WebCore::CalcExpressionOperation::operator== const):
        (WebCore::CalcExpressionOperation::dump const):
        (WebCore::operator<<):
        (WebCore::CalcExpressionBinaryOperation::evaluate const): Deleted.
        (WebCore::CalcExpressionBinaryOperation::operator== const): Deleted.
        (WebCore::CalcExpressionBinaryOperation::dump const): Deleted.
        * platform/CalculationValue.h:
        (WebCore::CalcExpressionOperation::CalcExpressionOperation):
        (WebCore::operator==):
        (WebCore::toCalcExpressionOperation):
        (WebCore::CalcExpressionBinaryOperation::CalcExpressionBinaryOperation): Deleted.
        (WebCore::toCalcExpressionBinaryOperation): Deleted.
        Adjust to the CSSCalcBinaryOperation->CSSCalcOperation rename.
        Adjust to having n>2 children.
        Support min() and max() operators in various places.
        

2017-09-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Move error generation task into ResourceError
        https://bugs.webkit.org/show_bug.cgi?id=176963

        Reviewed by Alex Christensen.

        * platform/Curl.cmake:
        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlHandle::errorDescription):
        (WebCore::CurlHandle::errorDescription const):
        * platform/network/curl/CurlContext.h:
        * platform/network/curl/ResourceError.h:
        (WebCore::ResourceError::setSslErrors):
        (WebCore::ResourceError::hasSSLConnectError const): Deleted.
        (WebCore::ResourceError::doPlatformIsolatedCopy): Deleted.
        * platform/network/curl/ResourceErrorCurl.cpp: Added.
        (WebCore::ResourceError::httpError):
        (WebCore::ResourceError::sslError):
        (WebCore::ResourceError::hasSSLConnectError const):
        (WebCore::ResourceError::doPlatformIsolatedCopy):
        (WebCore::ResourceError::platformCompare):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::notifyFail):
        (WebCore::ResourceHandleCurlDelegate::didFail):
        * platform/network/curl/ResourceHandleCurlDelegate.h:

2017-09-18  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r222170.

        The API test added with this change is failing.

        Reverted changeset:

        "Allow WTF::map to use any class that is iterable and has a
        size getter"
        https://bugs.webkit.org/show_bug.cgi?id=177026
        http://trac.webkit.org/changeset/222170

2017-09-18  Don Olmstead  <don.olmstead@sony.com>

        [Curl] Forward declare SSL context

        Unreviewed build fix after r222147. OpenSSL's SHA1 declaration conflicts with WTF's.

        No new tests. No change in behavior.

        * platform/network/curl/CurlSSLHandle.h:
        * platform/network/curl/CurlSSLVerifier.cpp:
        * platform/network/curl/CurlSSLVerifier.h:

2017-09-18  Ryosuke Niwa  <rniwa@webkit.org>

        getData('text/plain') doesn't work on iOS 10
        https://bugs.webkit.org/show_bug.cgi?id=177034

        Reviewed by Wenson Hsieh.

        The bug was caused by the mispatch of UTI between reading & writing plain text.
        Use kUTTypeText (instead of kUTTypePlainText) to read from UIPasteboard on iOS 10.

        Re-enabled tests were passing on iOS 11 and continues to pass after this code change.

        Tests: editing/pasteboard/clipboard-event.html
               editing/pasteboard/datatransfer-items-paste-plaintext.html
               editing/pasteboard/get-data-text-plain-paste.html

        * platform/ios/PasteboardIOS.mm:
        (WebCore::cocoaTypeFromHTMLClipboardType):

2017-09-18  Youenn Fablet  <youenn@apple.com>

        Allow WTF::map to use any class that is iterable and has a size getter
        https://bugs.webkit.org/show_bug.cgi?id=177026

        Reviewed by Darin Adler.

        No change of behavior.
        Using WTF::map to go from maps to vectors.

        * loader/appcache/ApplicationCacheHost.cpp:
        (WebCore::ApplicationCacheHost::resourceList):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):

2017-09-18  Emilio Cobos Álvarez  <emilio@crisal.io>

        Always update display: contents styles in RenderTreeUpdater.
        https://bugs.webkit.org/show_bug.cgi?id=177065

        Reviewed by Antti Koivisto.

        Otherwise we keep an old style around, making following style updates wrong.

        Test: fast/css/display-contents-style-update.html

        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateElementRenderer):

2017-09-18  Antti Koivisto  <antti@apple.com>

        Avoid style resolution when clearing focused element.
        https://bugs.webkit.org/show_bug.cgi?id=176224
        <rdar://problem/34206409>

        Reviewed by Zalan Bujtas.

        Test: fast/dom/focus-style-resolution.html

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

            Don't do synchronous style resolution with FocusRemovalEventsMode::DoNotDispatch.
            Style resolution may dispatch events.

        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::didBlur):

            Move resolveStyleIfNeeded call to setFocusedElement. It is the only client for didBlur.

2017-09-18  Antti Koivisto  <antti@apple.com>

        Rolling out the previous to land again with a test.

        * dom/Document.cpp:
        (WebCore::Document::setFocusedElement):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::didBlur):

2017-09-18  Antti Koivisto  <antti@apple.com>

        Avoid style resolution when clearing focused element.
        https://bugs.webkit.org/show_bug.cgi?id=176224
        <rdar://problem/34206409>

        Reviewed by Zalan Bujtas.

        Test: fast/dom/focus-style-resolution.html

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

            Don't do synchronous style resolution with FocusRemovalEventsMode::DoNotDispatch.
            Style resolution may dispatch events.

        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::didBlur):

            Move resolveStyleIfNeeded call to setFocusedElement. It is the only client for didBlur.

2017-09-18  Per Arne Vollan  <pvollan@apple.com>

        [WK1] Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing.
        https://bugs.webkit.org/show_bug.cgi?id=177071

        Reviewed by Brent Fulgham.

        The Page pointer in the history controller's frame is null. Add a null pointer check before
        accessing the page. 

        No new tests, covered by exiting tests.

        * loader/HistoryController.cpp:
        (WebCore::HistoryController::updateForStandardLoad):
        (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
        (WebCore::HistoryController::updateForClientRedirect):

2017-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html is failing since r221974
        https://bugs.webkit.org/show_bug.cgi?id=177036

        Reviewed by Michael Catanzaro.

        In r221974 I rewrote the characterIndexForXPosition implementation without taking into account that there can be
        multiple glyphs for the same character, so we can't simply do index++ and index-- to get the next and previous
        character index.

        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
        (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition): Always get the character index from
        m_glyphToCharacterIndexes array.

2017-09-18  Jer Noble  <jer.noble@apple.com>

        Virtualize ImageDecoder
        https://bugs.webkit.org/show_bug.cgi?id=176118

        Reviewed by Eric Carlson.

        Add an explicit, abstract base class ImageDecoder, and convert ImageDecoderCG to a true
        subclass. This will allow multiple ImageDecoder subclasses to exist simultaneously at
        runtime.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/ImageDecoders.cmake:
        * platform/graphics/ImageDecoder.cpp: Added.
        (WebCore::ImageDecoder::create):
        (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
        * platform/graphics/ImageDecoder.h: Added.
        (WebCore::ImageDecoder::isSizeAvailable):
        (WebCore::ImageDecoder::isAllDataReceived const):
        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::ImageDecoderCG::ImageDecoderCG):
        (WebCore::ImageDecoderCG::bytesDecodedToDetermineProperties):
        (WebCore::ImageDecoderCG::uti const):
        (WebCore::ImageDecoderCG::filenameExtension const):
        (WebCore::ImageDecoderCG::encodedDataStatus const):
        (WebCore::ImageDecoderCG::frameCount const):
        (WebCore::ImageDecoderCG::repetitionCount const):
        (WebCore::ImageDecoderCG::hotSpot const):
        (WebCore::ImageDecoderCG::frameSizeAtIndex const):
        (WebCore::ImageDecoderCG::frameIsCompleteAtIndex const):
        (WebCore::ImageDecoderCG::frameOrientationAtIndex const):
        (WebCore::ImageDecoderCG::frameDurationAtIndex const):
        (WebCore::ImageDecoderCG::frameAllowSubsamplingAtIndex const):
        (WebCore::ImageDecoderCG::frameHasAlphaAtIndex const):
        (WebCore::ImageDecoderCG::frameBytesAtIndex const):
        (WebCore::ImageDecoderCG::createFrameImageAtIndex const):
        (WebCore::ImageDecoderCG::setData):
        (WebCore::ImageDecoder::ImageDecoder): Deleted.
        (WebCore::ImageDecoder::bytesDecodedToDetermineProperties): Deleted.
        (WebCore::ImageDecoder::uti const): Deleted.
        (WebCore::ImageDecoder::filenameExtension const): Deleted.
        (WebCore::ImageDecoder::encodedDataStatus const): Deleted.
        (WebCore::ImageDecoder::frameCount const): Deleted.
        (WebCore::ImageDecoder::repetitionCount const): Deleted.
        (WebCore::ImageDecoder::hotSpot const): Deleted.
        (WebCore::ImageDecoder::frameSizeAtIndex const): Deleted.
        (WebCore::ImageDecoder::frameIsCompleteAtIndex const): Deleted.
        (WebCore::ImageDecoder::frameOrientationAtIndex const): Deleted.
        (WebCore::ImageDecoder::frameDurationAtIndex const): Deleted.
        (WebCore::ImageDecoder::frameAllowSubsamplingAtIndex const): Deleted.
        (WebCore::ImageDecoder::frameHasAlphaAtIndex const): Deleted.
        (WebCore::ImageDecoder::frameBytesAtIndex const): Deleted.
        (WebCore::ImageDecoder::createFrameImageAtIndex const): Deleted.
        (WebCore::ImageDecoder::setData): Deleted.
        * platform/graphics/cg/ImageDecoderCG.h:
        (WebCore::ImageDecoderCG::create):
        (WebCore::ImageDecoder::create): Deleted.
        (WebCore::ImageDecoder::isSizeAvailable): Deleted.
        (WebCore::ImageDecoder::isAllDataReceived const): Deleted.
        (WebCore::ImageDecoder::clearFrameBufferCache): Deleted.
        * platform/graphics/win/ImageDecoderDirect2D.cpp:
        (WebCore::ImageDecoderDirect2D::ImageDecoderDirect2D):
        (WebCore::ImageDecoderDirect2D::systemImagingFactory):
        (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties):
        (WebCore::ImageDecoderDirect2D::filenameExtension const):
        (WebCore::ImageDecoderDirect2D::isSizeAvailable const):
        (WebCore::ImageDecoderDirect2D::encodedDataStatus const):
        (WebCore::ImageDecoderDirect2D::size const):
        (WebCore::ImageDecoderDirect2D::frameCount const):
        (WebCore::ImageDecoderDirect2D::repetitionCount const):
        (WebCore::ImageDecoderDirect2D::hotSpot const):
        (WebCore::ImageDecoderDirect2D::frameSizeAtIndex const):
        (WebCore::ImageDecoderDirect2D::frameIsCompleteAtIndex const):
        (WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
        (WebCore::ImageDecoderDirect2D::frameDurationAtIndex const):
        (WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const):
        (WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const):
        (WebCore::ImageDecoderDirect2D::frameBytesAtIndex const):
        (WebCore::ImageDecoderDirect2D::setTargetContext):
        (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex const):
        (WebCore::ImageDecoderDirect2D::setData):
        * platform/graphics/win/ImageDecoderDirect2D.h:
        (WebCore::ImageDecoderDirect2D::create):
        (WebCore::ImageDecoder::create): Deleted.
        (WebCore::ImageDecoder::isAllDataReceived const): Deleted.
        (WebCore::ImageDecoder::clearFrameBufferCache): Deleted.
        * platform/image-decoders/ScalableImageDecoder.cpp: Renamed from Source/WebCore/platform/image-decoders/ImageDecoder.cpp.
        (WebCore::ScalableImageDecoder::create):
        (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
        (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
        (WebCore::ScalableImageDecoder::frameBytesAtIndex const):
        (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
        (WebCore::ScalableImageDecoder::createFrameImageAtIndex):
        (WebCore::ScalableImageDecoder::prepareScaleDataIfNecessary):
        (WebCore::ScalableImageDecoder::upperBoundScaledX):
        (WebCore::ScalableImageDecoder::lowerBoundScaledX):
        (WebCore::ScalableImageDecoder::upperBoundScaledY):
        (WebCore::ScalableImageDecoder::lowerBoundScaledY):
        (WebCore::ScalableImageDecoder::scaledY):
        * platform/image-decoders/ScalableImageDecoder.h: Renamed from Source/WebCore/platform/image-decoders/ImageDecoder.h.
        (WebCore::ScalableImageDecoder::ScalableImageDecoder):
        (WebCore::ScalableImageDecoder::~ScalableImageDecoder):
        (WebCore::ScalableImageDecoder::premultiplyAlpha const):
        (WebCore::ScalableImageDecoder::isAllDataReceived const):
        (WebCore::ScalableImageDecoder::size const):
        (WebCore::ScalableImageDecoder::scaledSize):
        (WebCore::ScalableImageDecoder::setSize):
        (WebCore::ScalableImageDecoder::setIgnoreGammaAndColorProfile):
        (WebCore::ScalableImageDecoder::ignoresGammaAndColorProfile const):
        (WebCore::ScalableImageDecoder::rgbColorProfile):
        (WebCore::ScalableImageDecoder::subsamplingLevelForScale):
        (WebCore::ScalableImageDecoder::inputDeviceColorProfile):
        (WebCore::ScalableImageDecoder::setFailed):
        (WebCore::ScalableImageDecoder::failed const):
        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
        (WebCore::BMPImageDecoder::BMPImageDecoder):
        (WebCore::BMPImageDecoder::setData):
        (WebCore::BMPImageDecoder::setFailed):
        * platform/image-decoders/bmp/BMPImageDecoder.h:
        * platform/image-decoders/bmp/BMPImageReader.h:
        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::GIFImageDecoder):
        (WebCore::GIFImageDecoder::setData):
        (WebCore::GIFImageDecoder::setSize):
        (WebCore::GIFImageDecoder::setFailed):
        * platform/image-decoders/gif/GIFImageDecoder.h:
        * platform/image-decoders/ico/ICOImageDecoder.cpp:
        (WebCore::ICOImageDecoder::ICOImageDecoder):
        (WebCore::ICOImageDecoder::setData):
        (WebCore::ICOImageDecoder::size):
        (WebCore::ICOImageDecoder::setSize):
        (WebCore::ICOImageDecoder::setFailed):
        * platform/image-decoders/ico/ICOImageDecoder.h:
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageDecoder::JPEGImageDecoder):
        (WebCore::JPEGImageDecoder::setSize):
        (WebCore::JPEGImageDecoder::setFailed):
        * platform/image-decoders/jpeg/JPEGImageDecoder.h:
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageReader::decode):
        (WebCore::PNGImageDecoder::PNGImageDecoder):
        (WebCore::PNGImageDecoder::setSize):
        (WebCore::PNGImageDecoder::frameBufferAtIndex):
        (WebCore::PNGImageDecoder::setFailed):
        * platform/image-decoders/png/PNGImageDecoder.h:
        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::WEBPImageDecoder):
        (WebCore::WEBPImageDecoder::decode):
        * platform/image-decoders/webp/WEBPImageDecoder.h:

2017-09-18  Andy Estes  <aestes@apple.com>

        [Mac] Upstream miscellaneous WebKitSystemInterface functions
        https://bugs.webkit.org/show_bug.cgi?id=177029

        Reviewed by Alex Christensen.

        * Configurations/WebCore.xcconfig: Used -force_load of libPAL instead of -ObjC. This forces
        the linker to load both Objective-C and C PAL symbols in WebCore. This change is needed for
        PAL::popUpMenu(), which is used by WebKit and WebKitLegacy but not WebCore.
        * platform/cocoa/LocalizedStringsCocoa.mm:
        (WebCore::contextMenuItemTagSearchWeb):
        * platform/cocoa/ScrollController.mm:
        (WebCore::elasticDeltaForTimeDelta):
        (WebCore::elasticDeltaForReboundDelta):
        (WebCore::reboundDeltaForElasticDelta):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
        * platform/mac/CursorMac.mm:
        (WebCore::WKCoreCursor_coreCursorType):
        (WebCore::createCoreCursorClass):
        (WebCore::coreCursorClass):
        (WebCore::cursor):
        (WebCore::Cursor::ensurePlatformCursor const):
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::paintTextArea):

2017-09-18  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        [Win][PAL] Move WebCoreHeaderDetection.h to PAL
        https://bugs.webkit.org/show_bug.cgi?id=176990

        Reviewed by Alex Christensen.

        * PlatformWin.cmake:
        Stop generating WebCoreHeaderDetection.h in WebCore.

        * config.h:
        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
        * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
        Include PALHeaderDetection.h instead of WebCoreHeaderDetection.h

2017-09-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Create classes dedicated to handle SSL related tasks
        and separate verifier and certificate management.
        https://bugs.webkit.org/show_bug.cgi?id=176910

        Reviewed by Alex Christensen.

        * platform/Curl.cmake:
        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlContext::CurlContext):
        (WebCore::CurlHandle::setCACertPath):
        (WebCore::certificatePath): Deleted.
        (WebCore::CurlHandle::enableCAInfoIfExists): Deleted.
        (WebCore::CurlHandle::setSslErrors): Deleted.
        (WebCore::CurlHandle::getSslErrors): Deleted.
        * platform/network/curl/CurlContext.h:
        (WebCore::CurlContext::sslHandle):
        (WebCore::CurlContext::getCertificatePath const): Deleted.
        (WebCore::CurlContext::shouldIgnoreSSLErrors const): Deleted.
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::setupRequest):
        * platform/network/curl/CurlSSLHandle.cpp: Added.
        (WebCore::CurlSSLHandle::CurlSSLHandle):
        (WebCore::CurlSSLHandle::getCACertPathEnv):
        (WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate):
        (WebCore::CurlSSLHandle::isAllowedHTTPSCertificateHost):
        (WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate):
        (WebCore::CurlSSLHandle::setClientCertificateInfo):
        (WebCore::CurlSSLHandle::getSSLClientCertificate):
        * platform/network/curl/CurlSSLHandle.h: Renamed from Source/WebCore/platform/network/curl/SSLHandle.h.
        (WebCore::CurlSSLHandle::shouldIgnoreSSLErrors const):
        (WebCore::CurlSSLHandle::getCACertPath const):
        * platform/network/curl/CurlSSLVerifier.cpp: Renamed from Source/WebCore/platform/network/curl/SSLHandle.cpp.
        (WebCore::CurlSSLVerifier::setSslCtx):
        (WebCore::CurlSSLVerifier::certVerifyCallback):
        (WebCore::CurlSSLVerifier::getPemDataFromCtx):
        (WebCore::CurlSSLVerifier::convertToSSLCertificateFlags):
        * platform/network/curl/CurlSSLVerifier.h: Added.
        (WebCore::CurlSSLVerifier::setCurlHandle):
        (WebCore::CurlSSLVerifier::setHostName):
        (WebCore::CurlSSLVerifier::sslErrors):
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate):
        (WebCore::ResourceHandle::setClientCertificateInfo):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
        (WebCore::ResourceHandleCurlDelegate::setupRequest):
        (WebCore::ResourceHandleCurlDelegate::notifyFail):
        (WebCore::ResourceHandleCurlDelegate::willSetupSslCtx):
        (WebCore::ResourceHandleCurlDelegate::willSetupSslCtxCallback):
        * platform/network/curl/ResourceHandleCurlDelegate.h:

2017-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r221974): [Harfbuzz] Test fast/text/international/hebrew-selection.html is failing since r221974
        https://bugs.webkit.org/show_bug.cgi?id=177036

        Reviewed by Michael Catanzaro.

        In r221974 I rewrote the characterIndexForXPosition implementation without taking into account that there can be
        multiple glyphs for the same character, so we can't simply do index++ and index-- to get the next and previous
        character index.

        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
        (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition): Always get the character index from
        m_glyphToCharacterIndexes array.

2017-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        [Harfbuzz] Test fast/text/complex-text-selection.html is failing since r222090
        https://bugs.webkit.org/show_bug.cgi?id=177035

        Reviewed by Michael Catanzaro.

        The problem was not actually introduced in r222090, but revelaed by that change. The bug was added in r222086,
        when adding the support for shaping a range of characters. We are not correctly filtering the characters in case
        of rtl in some cases.

        Fixes: fast/text/complex-text-selection.html

        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
        (WebCore::HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun): When checking if the current character is inside
        the given range, continue or break the loop depending on whether text is rtl or not.

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

        [GTK] Build failure with enchant-2.1.1
        https://bugs.webkit.org/show_bug.cgi?id=176877

        Unreviewed build fix for enchant 2.1.1.

        enchant_dict_free_suggestions() has been deprecated since at least 2005. Use its
        replacement, enchant_dict_free_string_list(), instead. That's also been around since at
        least 2005.

        * platform/text/enchant/TextCheckerEnchant.cpp:
        (WebCore::TextCheckerEnchant::getGuessesForWord):

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

        Computing animated style should not require renderers
        https://bugs.webkit.org/show_bug.cgi?id=171926
        <rdar://problem/34428035>

        Reviewed by Sam Weinig.

        CSS animation system is now element rather than renderer based. This allows cleaning up
        style resolution and render tree update code.

        This also fixes bug animation doesn't run if display property is animated from one rendered type
        to another. Added a test case for this.

        Test: transitions/transition-display-property-2.html

        * page/animation/CSSAnimationController.cpp:
        (WebCore::CSSAnimationController::updateAnimations):

            Pass in the old style instead of getting it from the renderer.
            Factor to return the animated style as a return value.

        * page/animation/CSSAnimationController.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::RenderElement):
        (WebCore::RenderElement::willBeDestroyed):

            Animation are now canceled by RenderTreeUpdater::tearDownRenderers.

        * rendering/RenderElement.h:
        (WebCore::RenderElement::hasInitialAnimatedStyle const): Deleted.
        (WebCore::RenderElement::setHasInitialAnimatedStyle): Deleted.

            We no longer need to this concept.

        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateElementRenderer):
        (WebCore::RenderTreeUpdater::createRenderer):

            We now get correct animated style from style resolution in all cases so we don't need to compute
            it separately for new renderers.

        (WebCore::RenderTreeUpdater::tearDownRenderers):

            Cancel animations when render tree is fully torn down. Keep them when updating style.

        * style/RenderTreeUpdater.h:
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::createAnimatedElementUpdate):

            We can now compute animated style without renderer. Special cases dealing with rendererless case
            can be removed.

2017-09-15  Carlos Garcia Campos  <cgarcia@igalia.com>

        [Harbuzz] Test fast/text/international/harfbuzz-runs-with-no-glyph.html is crashing
        https://bugs.webkit.org/show_bug.cgi?id=177005

        Reviewed by Michael Catanzaro.

        Fixes: fast/text/international/harfbuzz-runs-with-no-glyph.html

        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
        (WebCore::HarfBuzzShaper::HarfBuzzRun::xPositionForOffset): Return early if there aren't glyphs.

2017-09-15  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Avoid calling String::format() in PlatformCAFilters::setFiltersOnLayer()
        https://bugs.webkit.org/show_bug.cgi?id=177028

        Reviewed by Tim Horton.

        String::format() is a bigger hammer for what we need to do in this function.

        * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:

2017-09-15  Ryosuke Niwa  <rniwa@webkit.org>

        iOS: Use blob URL instead of a WebKit fake URL when pasting an image
        https://bugs.webkit.org/show_bug.cgi?id=176986
        <rdar://problem/34455052>

        Reviewed by Wenson Hsieh.

        Fixed the bug that pasting an image on iOS resulted in an img element with src attribute
        set to a WebKit fake URL so that the Web content could never save it.

        Like r208451 on Mac, use a Blob URL instead.

        This patch also removes createFragmentForImageResourceAndAddResource since it's no longer used.

        Tests: LayoutTests/editing/pasteboard/paste-image-as-blob-url.html

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::WebContentReader::readImage): Moved the code here from WebContentReaderMac.mm.
        * editing/ios/WebContentReaderIOS.mm:
        (WebCore::WebContentReader::readImage): Deleted. This is the code 
        * editing/mac/WebContentReaderMac.mm:
        (WebCore::WebContentReader::readImage): Moved to WebContentReaderCocoa.mm. Note that
        typeAsFilenameWithExtension was dead code after r208451
        * editing/markup.cpp:
        (WebCore::createFragmentForImageResourceAndAddResource): Deleted.
        * editing/markup.h:

2017-09-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        Avoid style recomputation when forwarding a focus event to an text field's input type
        https://bugs.webkit.org/show_bug.cgi?id=176160
        <rdar://problem/34184820>

        Reviewed by Ryosuke Niwa.

        Currently, TextFieldInputType::forwardEvent synchronously triggers style recomputation, for the purpose of
        scrolling to the origin upon handling a blur event, and also for updating caps lock state after a blur or focus.
        In synchronously triggering style recomputation, we may end up running arbitrary JavaScript, which may change
        the HTMLInputElement's type and cause the current TextFieldInputType to be destroyed.

        To mitigate this, we only update caps lock state when forwarding a focus or blur event to the InputType, and
        instead scroll blurred text fields to the origin later, in HTMLInputElement::didBlur (invoked from
        Document::setFocusedElement after blur and focusout events have fired). Instead of having the InputType update
        style, lift the call to Document::updateStyleIfNeeded up into HTMLInputElement so that we gracefully handle the
        case where the page destroys and sets a new InputType within the scope of this style update.

        Test: fast/forms/change-input-type-in-focus-handler.html

        * dom/Document.cpp:
        (WebCore::Document::setFocusedElement):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::didBlur):
        * html/HTMLInputElement.h:
        * html/InputType.h:
        (WebCore::InputType::elementDidBlur):
        * html/TextFieldInputType.cpp:
        (WebCore::TextFieldInputType::forwardEvent):
        (WebCore::TextFieldInputType::elementDidBlur):
        * html/TextFieldInputType.h:

2017-09-15  JF Bastien  <jfbastien@apple.com>

        WTF: use Forward.h when appropriate instead of Vector.h
        https://bugs.webkit.org/show_bug.cgi?id=176984

        Reviewed by Saam Barati.

        There's no need to include Vector.h when Forward.h will suffice. All we need is to move the template default parameters from Vector, and then the forward declaration can be used in so many new places: if a header only takes Vector by reference, rvalue reference, pointer, returns any of these, or has them as members then the header doesn't need to see the definition because the declaration will suffice.

        * Modules/entriesapi/FileSystemEntriesCallback.h:
        * Modules/indexeddb/IDBEventDispatcher.h:
        * Modules/indexeddb/IDBFactory.h:
        * Modules/indexeddb/client/IDBConnectionProxy.h:
        * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
        * Modules/webdatabase/DatabaseTask.h:
        * Modules/websockets/WebSocketChannelClient.h:
        * contentextensions/CombinedURLFilters.h:
        * crypto/SerializedCryptoKeyWrap.h:
        * css/InspectorCSSOMWrappers.h:
        * css/PageRuleCollector.h:
        * css/parser/CSSParserTokenRange.h:
        * dom/DocumentTouch.h:
        * dom/MutationCallback.h:
        * editing/EditingStyle.h:
        * editing/SpellChecker.h:
        * editing/markup.h:
        * fileapi/ThreadableBlobRegistry.h:
        * html/FileListCreator.h:
        * inspector/WebHeapAgent.h:
        * loader/ContentFilter.cpp:
        (WebCore::ContentFilter::ContentFilter):
        * loader/ContentFilter.h:
        * loader/CookieJar.h:
        * loader/FrameLoaderClient.h:
        * loader/LoaderStrategy.h:
        * loader/SubframeLoader.h:
        * page/ChromeClient.h:
        * page/FrameSnapshotting.h:
        * page/IntersectionObserverCallback.h:
        * page/PageSerializer.h:
        * page/UserContentURLPattern.h:
        * page/scrolling/AxisScrollSnapOffsets.h:
        * page/win/FrameWin.h:
        * platform/CookiesStrategy.h:
        * platform/KeyedCoding.h:
        * platform/PasteboardStrategy.h:
        * platform/SSLKeyGenerator.h:
        * platform/ScrollableArea.h:
        * platform/encryptedmedia/CDMFactory.h:
        * platform/gamepad/EmptyGamepadProvider.cpp:
        * platform/gamepad/GamepadProvider.h:
        * platform/gamepad/GamepadProviderClient.h:
        * platform/gamepad/PlatformGamepad.h:
        * platform/graphics/GeometryUtilities.cpp:
        * platform/graphics/GeometryUtilities.h:
        * platform/graphics/Icon.h:
        * platform/graphics/LayoutRect.h:
        * platform/graphics/Path.h:
        * platform/graphics/WOFFFileFormat.h:
        * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
        * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h:
        * platform/graphics/ca/PlatformCAAnimation.h:
        * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
        * platform/graphics/opentype/OpenTypeMathData.h:
        * platform/image-encoders/JPEGImageEncoder.h:
        * platform/image-encoders/PNGImageEncoder.h:
        * platform/network/BlobRegistry.h:
        * platform/network/HTTPParsers.h:
        * platform/network/PlatformCookieJar.h:
        * platform/network/cf/DownloadBundle.h:
        * platform/network/curl/CurlCacheEntry.h:
        * platform/network/curl/DownloadBundle.h:
        * platform/text/LineEnding.h:
        * platform/text/QuotedPrintable.cpp:
        * platform/text/QuotedPrintable.h:
        * rendering/FlexibleBoxAlgorithm.h:
        * rendering/style/QuotesData.h:
        * rendering/svg/SVGSubpathData.h:
        * storage/StorageEventDispatcher.h:
        * style/StyleInvalidator.h:
        * style/StyleRelations.h:
        * svg/SVGAltGlyphDefElement.h:
        * svg/SVGAltGlyphItemElement.h:

2017-09-15  Youenn Fablet  <youenn@apple.com>

        ASSERTION FAILED: writtenAudioDuration >= readAudioDuration in com.apple.WebCore:WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit() + 222
        https://bugs.webkit.org/show_bug.cgi?id=175164
        <rdar://problem/33712305>

        Reviewed by Eric Carlson.

        No observable change of behavior.

        * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
        (WebCore::RealtimeOutgoingAudioSource::hasBufferedEngouhData):
        (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): Calling pullData only if there is at least 0.01 seconds of available data.
        * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:

2017-09-15  Youenn Fablet  <youenn@apple.com>

        Move code using Vector::map to WTF:map
        https://bugs.webkit.org/show_bug.cgi?id=176860

        Reviewed by Jer Noble.

        No change of behavior.

        * loader/FormSubmission.cpp:
        (WebCore::FormSubmission::create): Moving to WTF::map.
        * page/Settings.cpp:
        (WebCore::Settings::setMediaContentTypesRequiringHardwareSupport): Using iterator split to not create a temporary vector.
        * platform/ContentType.cpp:
        (WebCore::ContentType::ContentType):
        (WebCore::splitParameters):
        (WebCore::ContentType::codecs const): Ditto.
        (WebCore::ContentType::profiles const): Ditto.
        (WebCore::stripHTMLWhiteSpace): Deleted.
        * platform/ContentType.h:
        (WebCore::ContentType::create): Deleted.
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::load): Minor count churning change.

2017-09-15  Youenn Fablet  <youenn@apple.com>

        MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData should enqueue data if still useful
        https://bugs.webkit.org/show_bug.cgi?id=177016

        Reviewed by Jer Noble.

        No change of behavior.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData): exciting early in block to prevent enqueueing.

2017-09-15  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r222040.

        The LayoutTest added with this change is a flaky image failure
        on mac-wk1 debug bots.

        Reverted changeset:

        "Computing animated style should not require renderers"
        https://bugs.webkit.org/show_bug.cgi?id=171926
        http://trac.webkit.org/changeset/222040

2017-09-15  Tim Horton  <timothy_horton@apple.com>

        Fix the macOS CMake build
        https://bugs.webkit.org/show_bug.cgi?id=177015

        Reviewed by Andy Estes.

        * CMakeLists.txt:
        Add Payment Request files.

        * PlatformMac.cmake:
        Add the CoreServices umbrella framework to the framework search path.
        Add service workers directories to the forwarding headers path.
        Add Modules/cache directory to the forwarding headers path.

        * rendering/svg/RenderSVGRoot.cpp:
        (WebCore::resolveLengthAttributeForSVG): Deleted unused function.

2017-09-15  John Wilander  <wilander@apple.com>

        Storage Access API: Deny access to nested iframes
        https://bugs.webkit.org/show_bug.cgi?id=176939
        <rdar://problem/34439609>

        Reviewed by Brent Fulgham.

        Test: http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-nested-iframe.html

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

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

        AnimationBase should ref the element
        https://bugs.webkit.org/show_bug.cgi?id=176993

        Reviewed by Simon Fraser.

        We now longer have renderer pointer. Element can be reffed for safety.

        This doesn't create reference cycle as the element pointer is cleared when render tree is
        torn down. This happens at the latest when the element is removed from the tree.

        * page/animation/AnimationBase.cpp:
        (WebCore::AnimationBase::~AnimationBase):
        (WebCore::AnimationBase::clear):
        * page/animation/AnimationBase.h:
        (WebCore::AnimationBase::~AnimationBase): Deleted.
        (WebCore::AnimationBase::clear): Deleted.
        * page/animation/ImplicitAnimation.cpp:
        (WebCore::ImplicitAnimation::pauseAnimation):
        (WebCore::ImplicitAnimation::sendTransitionEvent):
        (WebCore::ImplicitAnimation::reset):
        * page/animation/KeyframeAnimation.cpp:
        (WebCore::KeyframeAnimation::pauseAnimation):
        (WebCore::KeyframeAnimation::endAnimation):
        (WebCore::KeyframeAnimation::sendAnimationEvent):
        (WebCore::KeyframeAnimation::resolveKeyframeStyles):

2017-09-15  Brent Fulgham  <bfulgham@apple.com>

        Make DocumentLoader a FrameDestructionObserver
        https://bugs.webkit.org/show_bug.cgi?id=176364
        <rdar://problem/34254780>

        Reviewed by Alex Christensen.

        The DocumentLoader needs to know when its Frame is destroyed so that it can
        perform properly cleanup.

        Test: fast/events/beforeunload-dom-manipulation-crash.html

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::DocumentLoader): Call FrameDestructionObserver constructor.
        (WebCore::DocumentLoader::responseReceived): Drive-by fix. Make sure the current
        object is valid during the callback.
        (WebCore::DocumentLoader::attachToFrame): Use FrameDestructionObserver::observerFrame rather
        than setting the m_frame variable directly.
        (WebCore::DocumentLoader::detachFromFrame): Ditto.
        * loader/DocumentLoader.h:
        (WebCore::DocumentLoader::frame const): Deleted, as this is provided by the FrameDestructionObserver.

2017-09-15  Ms2ger  <Ms2ger@igalia.com>

        Update some WebGL2 return types to match the specification.
        https://bugs.webkit.org/show_bug.cgi?id=176996

        Reviewed by Alex Christensen.

        This should not change the behavior in any way, but it makes it simpler
        to compare our IDL with the specification's.

        No new tests because there is no behavior change.

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::getUniformIndices):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:

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

        Remove FilterOperation::blendingNeedsRendererSize()
        https://bugs.webkit.org/show_bug.cgi?id=176994

        Reviewed by Simon Fraser.

        It is not used.

        * page/animation/CSSPropertyAnimation.cpp:
        (WebCore::blendFunc):
        * platform/graphics/filters/FilterOperation.h:
        (WebCore::FilterOperation::blend):
        (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin const):
        (WebCore::FilterOperation::blendingNeedsRendererSize const): Deleted.

2017-09-15  Youenn Fablet  <youenn@apple.com>

        Add an URL method to remove both query string and fragment identifier
        https://bugs.webkit.org/show_bug.cgi?id=176911

        Reviewed by Alex Christensen.

        Covered by existing tests and new API tests.

        * Modules/cache/DOMCache.cpp:
        (WebCore::DOMCache::retrieveRecords): Using new helper method.
        * platform/URL.cpp:
        (WebCore::URL::removeQueryAndFragmentIdentifier):
        * platform/URL.h:

2017-09-15  Andy Estes  <aestes@apple.com>

        [Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions
        https://bugs.webkit.org/show_bug.cgi?id=176953

        Reviewed by Eric Carlson.

        * platform/cocoa/VideoToolboxSoftLink.cpp:
        * platform/cocoa/VideoToolboxSoftLink.h:
        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
        (WebCore::queryDecoderAvailability):
        (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
        (WebCore::exernalDeviceDisplayNameForPlayer):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const):
        * platform/ios/WebCoreSystemInterfaceIOS.mm:
        * platform/mac/MediaRemoteSoftLink.cpp:
        * platform/mac/MediaRemoteSoftLink.h:
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:

2017-09-15  Eric Carlson  <eric.carlson@apple.com>

        Switch text tracks to release logging
        https://bugs.webkit.org/show_bug.cgi?id=176809
        <rdar://problem/34397605>

        Reviewed by Jer Noble.

        Make all track objects use the same logger and log identifier as the media element they
        "belong" to. Convert all track logging from debug-only to release logging.

        * WebCore.xcodeproj/project.pbxproj:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
        * html/HTMLMediaElement.h:
        * html/track/AudioTrack.cpp:
        (WebCore::AudioTrack::AudioTrack):
        (WebCore::AudioTrack::setPrivate):
        (WebCore::AudioTrack::setMediaElement):
        * html/track/AudioTrack.h:
        * html/track/DataCue.cpp:
        (WebCore::DataCue::toString const):
        * html/track/DataCue.h:
        (PAL::LogArgument<WebCore::DataCue>::toString):
        * html/track/InbandDataTextTrack.cpp:
        (WebCore::InbandDataTextTrack::addDataCue):
        (WebCore::InbandDataTextTrack::updateDataCue):
        (WebCore::InbandDataTextTrack::removeDataCue):
        * html/track/InbandDataTextTrack.h:
        * html/track/InbandGenericTextTrack.cpp:
        (WebCore::InbandGenericTextTrack::addGenericCue):
        (WebCore::InbandGenericTextTrack::removeGenericCue):
        (WebCore::InbandGenericTextTrack::newCuesParsed):
        (WebCore::InbandGenericTextTrack::fileFailedToParse):
        * html/track/InbandGenericTextTrack.h:
        * html/track/InbandTextTrack.cpp:
        (WebCore::InbandTextTrack::InbandTextTrack):
        (WebCore::InbandTextTrack::setMediaElement):
        * html/track/InbandTextTrack.h:
        * html/track/InbandWebVTTTextTrack.cpp:
        (WebCore::InbandWebVTTTextTrack::newCuesParsed):
        (WebCore::InbandWebVTTTextTrack::fileFailedToParse):
        * html/track/InbandWebVTTTextTrack.h:
        * html/track/LoadableTextTrack.cpp:
        (WebCore::LoadableTextTrack::newCuesAvailable):
        (WebCore::LoadableTextTrack::cueLoadingCompleted):
        * html/track/LoadableTextTrack.h:
        * html/track/TextTrack.cpp:
        (WebCore::TextTrack::addCue):
        (WebCore::TextTrack::removeCue):
        (WebCore::TextTrack::setLanguage):
        * html/track/TextTrack.h:
        * html/track/TextTrackCue.cpp:
        (WebCore::TextTrackCue::toString const):
        * html/track/TextTrackCue.h:
        (PAL::LogArgument<WebCore::TextTrackCue>::toString):
        * html/track/TextTrackCueGeneric.cpp:
        (WebCore::TextTrackCueGeneric::setFontSize):
        (WebCore::TextTrackCueGeneric::toString const):
        * html/track/TextTrackCueGeneric.h:
        (PAL::LogArgument<WebCore::TextTrackCueGeneric>::toString):
        * html/track/TrackBase.cpp:
        (WebCore::nextLogIdentifier):
        (WebCore::nullLogger):
        (WebCore::TrackBase::TrackBase):
        (WebCore::TrackBase::setMediaElement):
        (WebCore::TrackBase::logChannel const):
        (WebCore::TrackBase::~TrackBase): Deleted.
        * html/track/TrackBase.h:
        (WebCore::TrackBase::setMediaElement): Deleted.
        * html/track/VTTCue.cpp:
        (WebCore::VTTCue::setFontSize):
        (WebCore::VTTCue::toString const):
        * html/track/VTTCue.h:
        (PAL::LogArgument<WebCore::VTTCue>::toString):
        * html/track/VideoTrack.cpp:
        (WebCore::VideoTrack::VideoTrack):
        (WebCore::VideoTrack::setPrivate):
        (WebCore::VideoTrack::setMediaElement):
        * html/track/VideoTrack.h:
        * platform/graphics/AudioTrackPrivate.h:
        * platform/graphics/InbandTextTrackPrivate.h:
        (WebCore::InbandTextTrackPrivate::setClient):
        * platform/graphics/InbandTextTrackPrivateClient.h:
        (WebCore::GenericCueData::toString const):
        (PAL::LogArgument<WebCore::GenericCueData>::toString):
        * platform/graphics/TrackPrivateBase.cpp: Added.
        (WebCore::TrackPrivateBase::setLogger):
        (WebCore::TrackPrivateBase::logChannel const):
        * platform/graphics/TrackPrivateBase.h:
        * platform/graphics/VideoTrackPrivate.h:
        * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
        * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
        (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
        (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
        * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
        (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
        (WebCore::InbandTextTrackPrivateAVF::removeCompletedCues):
        (WebCore::InbandTextTrackPrivateAVF::resetCueValues):
        (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
        (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
        * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
        * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
        (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
        * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:

2017-09-15  Carlos Garcia Campos  <cgarcia@igalia.com>

        [Harfbuzz] Material icons not rendered correctly when using the web font
        https://bugs.webkit.org/show_bug.cgi?id=176995

        Reviewed by Michael Catanzaro.

        Only a few of them are correctly rendered and some others are wrong. We only render correctly the ones that
        don't have an underscore in their name (or that start with a number like 3d_rotation). In the cases where the
        name before the underscore is also an icon, we render that icon instead, that's why some of them are wrong. This
        is happening because the underscore is causing the HarfbuffShaper to split the text in 3 runs, one for the word
        before the underscore, another one for the underscore and another for the word after the underscore. So, we
        end up trying to shape the 3 runs independently and we fail when the icon doesn't exist, or when it exists but
        it's not the one we are looking for. The cause of this is that the underscore has a different script (Common)
        than the rest of characters (Latin) which is a condition in HarfbuffShaper to create a different run. The
        unicode spec says that characters with Common script should be handled differently, but we are just ignoring
        it. The spec proposes to use an heuristic based on simply inheriting the script of the previous character, which
        should work in most of the cases. We could take a more conservative approach and do that only if both characters
        are ASCII. We should also consider handling other cases mentioned by the spec like brackets and quotation marks,
        but that belongs to a different bug/commit.

        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
        (WebCore::scriptsAreCompatibleForCharacters): Helper function to check if the current and previous scripts are
        compatible,
        (WebCore::HarfBuzzShaper::collectHarfBuzzRuns): Use scriptsAreCompatibleForCharacters() to decided whether to
        finish the current run or not. In case of Common script, inherit also the script from the previous character.

2017-09-15  Carlos Garcia Campos  <cgarcia@igalia.com>

        [Harfbuzz] Fix incorrect font rendering when selecting texts in pages which specifies text-rendering: optimizeLegibility
        https://bugs.webkit.org/show_bug.cgi?id=148220

        Reviewed by Michael Catanzaro.

        Add support for shaping a range of characters and return the advance to the first glyph in the range.

        Covered by existing tests.

        * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
        (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Pass "from" and "to" parameters to
        HarfBuzzShaper::shape and return the x position of the selection rect.
        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
        (WebCore::HarfBuzzShaper::shape): Forward "from" and "to" parameters to fillGlyphBuffer().
        (WebCore::HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun): Only add glyphs for the given character range.
        (WebCore::HarfBuzzShaper::fillGlyphBuffer): Only consider runs in the given character range.
        * platform/graphics/harfbuzz/HarfBuzzShaper.h:

2017-09-15  Zan Dobersek  <zdobersek@igalia.com>

        [EME] ClearKey: list 'persistent-license' sessions as supported
        https://bugs.webkit.org/show_bug.cgi?id=176985

        Reviewed by Xabier Rodriguez-Calvar.

        The ClearKey implementation should support the 'persistent-license'
        session type for testing purposes. Methods in the CDMPrivateClearKey
        class have been updated to handle that session type as supported:
        - supportsSessionTypeWithConfiguration() returns true for the
          'persistent-license' session type values,
        - supportsConfiguration() allows persistent state as required in
          case of the configured session type being 'persistent-license',
        - supportsConfigurationWithRestrictions() as well allows persistent
        state as required for 'persistent-license' session types.

        No new tests -- affected tests have their baselines updated.

        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::CDMPrivateClearKey::supportsConfiguration const):
        (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const):
        (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const):

2017-09-15  Ms2ger  <Ms2ger@igalia.com>

        Disallow passing a null program to getFragDataLocation.
        https://bugs.webkit.org/show_bug.cgi?id=176895

        Reviewed by Sam Weinig.

        This matches the specification as well as Gecko and Chromium.

        Test: fast/canvas/webgl/webgl2/bindings.html

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::getFragDataLocation):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:

2017-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>

        [FreeType] Complex text is enabled too often after r221909
        https://bugs.webkit.org/show_bug.cgi?id=176907

        Reviewed by Sergio Villar Senin.

        In r221909 we enabled complex text by default following the same cocoa ifdefs, but I forgot another ifdef in the
        cpp file.

        * platform/graphics/FontCascade.cpp:
        (WebCore::FontCascade::codePath const):

2017-09-14  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r221932 and r221933.
        https://bugs.webkit.org/show_bug.cgi?id=176969

        This change did not fix the webgl test flakiness. (Requested
        by ryanhaddad on #webkit).

        Reverted changesets:

        "[WebGL] accelerated texImage2D for video doesn't respect
        flipY"
        https://bugs.webkit.org/show_bug.cgi?id=176491
        http://trac.webkit.org/changeset/221932

        "[WebGL] VideoTextureCopierCV doesn't correctly restore vertex
        attribute state"
        https://bugs.webkit.org/show_bug.cgi?id=176771
        http://trac.webkit.org/changeset/221933

2017-09-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Replace the implementation with NetworkLoadMetrics
        https://bugs.webkit.org/show_bug.cgi?id=176906

        Reviewed by Alex Christensen.

        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlHandle::getEffectiveURL):
        (WebCore::CurlHandle::getPrimaryPort):
        (WebCore::CurlHandle::getResponseCode):
        (WebCore::CurlHandle::getContentLenghtDownload):
        (WebCore::CurlHandle::getHttpAuthAvail):
        (WebCore::CurlHandle::getTimes):
        (WebCore::CurlHandle::getEffectiveURL const): Deleted.
        * platform/network/curl/CurlContext.h:
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::didReceiveHeader):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
        (WebCore::ResourceHandleCurlDelegate::notifyFinish):
        (WebCore::ResourceHandleCurlDelegate::getProtectionSpace):
        (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
        (WebCore::ResourceHandleCurlDelegate::handleLocalReceiveResponse):
        (WebCore::ResourceHandleCurlDelegate::didFinish):
        (WebCore::ResourceHandleCurlDelegate::getNetworkLoadMetrics):
        (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
        (WebCore::ResourceHandleCurlDelegate::didReceiveData):
        (WebCore::ResourceHandleCurlDelegate::setWebTimings): Deleted.
        * platform/network/curl/ResourceHandleCurlDelegate.h:
        * platform/network/curl/ResourceResponse.h:
        (WebCore::ResourceResponse::setDeprecatedNetworkLoadMetrics):

2017-09-14  Daniel Bates  <dabates@apple.com>

        [Mac] Spelling, grammar and correction dots are painted upside down
        https://bugs.webkit.org/show_bug.cgi?id=176949
        <rdar://problem/34441098>

        Reviewed by Simon Fraser.

        Painting occurs in a vertically flipped context. Vertically flip the context ("unflip" it)
        before painting the document markers on macOS so that they are painted right-side. This makes
        the appearance of spelling, grammar and correction dots in WebKit match the AppKit appearance
        of these dots.

        * platform/graphics/cocoa/GraphicsContextCocoa.mm:
        (WebCore::GraphicsContext::drawLineForDocumentMarker): Flip the context as described above.
        Also make use of RAII object CGContextStateSaver instead of manually saving and restoring
        the state of the context.

2017-09-14  Joseph Pecoraro  <pecoraro@apple.com>

        Unreviewed rollout r222036.
        
        The LayoutTests added with this change is flaky.

        Reverted changeset
        Web Inspector: Timeline should show when events preventDefault() was called on an event or not
        https://bugs.webkit.org/show_bug.cgi?id=176824
        http://trac.webkit.org/changeset/222036

2017-09-14  Ryosuke Niwa  <rniwa@webkit.org>

        WebContentReader::readWebArchive doesn't need to handle image MIME type
        https://bugs.webkit.org/show_bug.cgi?id=176884

        Reviewed by Sam Weinig.

        Remove the code to handle image MIME types in the web archive on macOS since we have a separate code path
        to handle images in the pasteboard directly. As far as I can tell, this code is never used in practice.

        This allows merging iOS and macOS code to read web archive from the pasteboard. Also merged member functions
        for handling RTFD and RTF in iOS and macOS in WebContentReaderCocoa.mm.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * editing/WebContentReader.cpp: Added.
        (WebCore::WebContentReader::addFragment): Moved from WebContentReaderIOS.mm and simplified since appendChild
        knows how to add a DocumentFragment.
        * editing/WebContentReader.h:
        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::createFragmentAndAddResources):
        (WebCore::WebContentReader::readWebArchive): Merged iOS / macOS code here.
        (WebCore::WebContentReader::readRTFD): Ditto.
        (WebCore::WebContentReader::readRTF): Ditto.
        (WebCore::WebContentReader::readPlainText): Ditto.
        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::pasteWithPasteboard):
        * editing/ios/WebContentReaderIOS.mm:
        (WebCore::WebContentReader::readImage):
        (WebCore::WebContentReader::readURL):
        (WebCore::WebContentReader::readWebArchive): Moved to WebContentReaderCocoa.mm.
        (WebCore::WebContentReader::readRTFD): Ditto.
        (WebCore::WebContentReader::readRTF): Ditto.
        (WebCore::WebContentReader::readPlainText): Ditto.
        * editing/mac/WebContentReaderMac.mm:
        (WebCore::WebContentReader::readWebArchive): Ditto.
        (WebCore::WebContentReader::readRTFD): Ditto.
        (WebCore::WebContentReader::readRTF): Ditto.

2017-09-14  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: make recording swizzle async
        https://bugs.webkit.org/show_bug.cgi?id=176936

        Reviewed by Joseph Pecoraro.

        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
        (WebCore::InspectorCanvas::buildAction):
        For objects that are not able to be stringified (e.g. elements), send a deduplicated string
        with the name of the object as a placeholder value (e.g. "Element").

2017-09-14  Andy Estes  <aestes@apple.com>

        [Mac] Upstream SpeechSynthesis-related WebKitSystemInterface functions
        https://bugs.webkit.org/show_bug.cgi?id=176931

        Reviewed by Joseph Pecoraro.

        * platform/mac/PlatformSpeechSynthesizerMac.mm:
        (WebCore::speechSynthesisGetVoiceIdentifiers):
        (WebCore::speechSynthesisGetDefaultVoiceIdentifierForLocale):
        (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:

2017-09-14  Youenn Fablet  <youenn@apple.com>

        RTCDataChannel connectivity issues in Safari 11
        https://bugs.webkit.org/show_bug.cgi?id=173052
        <rdar://problem/32712143>

        Reviewed by Alex Christensen.

        Covered by updated test.

        Before the patch, when sending an ArrayBufferView, RTCDataChannel was sending the whole ArrayBuffer backing the ArrayBufferView.
        With this patch, RTCDataChannel will now send only the bytes the ArrayBufferView is exposing.

        * Modules/mediastream/RTCDataChannel.cpp:
        (WebCore::RTCDataChannel::send): Correctly handling sending of ArrayBufferView.
        (WebCore::RTCDataChannel::sendRawData): Helper routine for raw data sending.
        * Modules/mediastream/RTCDataChannel.h:

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

        Computing animated style should not require renderers
        https://bugs.webkit.org/show_bug.cgi?id=171926
        <rdar://problem/34428035>

        Reviewed by Sam Weinig.

        CSS animation system is now element rather than renderer based. This allows cleaning up
        style resolution and render tree update code.

        This also fixes bug animation doesn't run if display property is animated from one rendered type
        to another. Added a test case for this.

        Test: transitions/transition-display-property-2.html

        * page/animation/CSSAnimationController.cpp:
        (WebCore::CSSAnimationController::updateAnimations):

            Pass in the old style instead of getting it from the renderer.
            Factor to return the animated style as a return value.

        * page/animation/CSSAnimationController.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::RenderElement):
        (WebCore::RenderElement::willBeDestroyed):

            Animation are now canceled by RenderTreeUpdater::tearDownRenderers.

        * rendering/RenderElement.h:
        (WebCore::RenderElement::hasInitialAnimatedStyle const): Deleted.
        (WebCore::RenderElement::setHasInitialAnimatedStyle): Deleted.

            We no longer need to this concept.

        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateElementRenderer):
        (WebCore::RenderTreeUpdater::createRenderer):

            We now get correct animated style from style resolution in all cases so we don't need to compute
            it separately for new renderers.

        (WebCore::RenderTreeUpdater::tearDownRenderers):

            Cancel animations when render tree is fully torn down. Keep them when updating style.

        * style/RenderTreeUpdater.h:
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::createAnimatedElementUpdate):

            We can now compute animated style without renderer. Special cases dealing with rendererless case
            can be removed.

2017-09-14  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Timeline should show when events preventDefault() was called on an event or not
        https://bugs.webkit.org/show_bug.cgi?id=176824
        <rdar://problem/34290931>

        Reviewed by Devin Rousso.

        Test: inspector/timeline/timeline-event-EventDispatch.html

        * dom/EventTarget.cpp:
        (WebCore::EventTarget::fireEventListeners):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::dispatchEvent):
        Include defaultPrevented when notifying inspector.

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didDispatchEventImpl):
        (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didDispatchEvent):
        (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
        Pass defaultPrevented on to agent.

        * inspector/InspectorTimelineAgent.cpp:
        (WebCore::InspectorTimelineAgent::didDispatchEvent):
        (WebCore::InspectorTimelineAgent::didLayout):
        (WebCore::InspectorTimelineAgent::didPaint):
        * inspector/InspectorTimelineAgent.h:
        * inspector/TimelineRecordFactory.cpp:
        (WebCore::TimelineRecordFactory::appendLayoutRoot):
        (WebCore::TimelineRecordFactory::appendDidDispatchEventData):
        * inspector/TimelineRecordFactory.h:
        Append a boolean defaultPrevented property on the EventDispatch timeline record's data.

2017-09-14  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r222015.

        The LayoutTests added with this change are flaky.

        Reverted changeset:

        "Web Inspector: Timeline should show when events
        preventDefault() was called on an event or not"
        https://bugs.webkit.org/show_bug.cgi?id=176824
        http://trac.webkit.org/changeset/222015

2017-09-14  Ms2ger  <Ms2ger@igalia.com>

        Allow passing sequences to various WebGL2 methods.
        https://bugs.webkit.org/show_bug.cgi?id=176892

        Reviewed by Sam Weinig.

        This matches the specification as well as Gecko and Chromium.

        Test: fast/canvas/webgl/webgl2/sequences.html

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::uniform1uiv):
        (WebCore::WebGL2RenderingContext::uniform2uiv):
        (WebCore::WebGL2RenderingContext::uniform3uiv):
        (WebCore::WebGL2RenderingContext::uniform4uiv):
        (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
        (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
        (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
        (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
        (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
        (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
        (WebCore::WebGL2RenderingContext::vertexAttribI4iv):
        (WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
        (WebCore::WebGL2RenderingContext::clearBufferiv):
        (WebCore::WebGL2RenderingContext::clearBufferuiv):
        (WebCore::WebGL2RenderingContext::clearBufferfv):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:

2017-09-14  Sam Weinig  <sam@webkit.org>

        [Cleanup] Cleanup uses of the FileList class
        https://bugs.webkit.org/show_bug.cgi?id=176800

        Reviewed by Alex Christensen.

        * fileapi/FileList.cpp:
        * fileapi/FileList.h:

            Store list of files as Refs, rather than RefPtrs.
            Add direct accessor to the underlying Vector for faster iteration.
            Add file(unsigned) function to allow direct indexing, rather than using
            the DOM exposed item function which always does a length check.

        * Modules/entriesapi/HTMLInputElementEntriesAPI.cpp:
        
            Remove unused RuntimeEnabledFeatures.h #include.
            Use modern for loop and the new direct file vector access. 
        
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneSerializer::dumpIfTerminal):
        (WebCore::CloneSerializer::write):
        (WebCore::CloneDeserializer::readFile):
        (WebCore::CloneDeserializer::readTerminal):
        
            Remove unnecessary #includes, adopt auto, and use modern for-loop
            for FileList.
        
        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::files const):
        (WebCore::DataTransfer::hasFileOfType):
        
            Use auto.
        
        (WebCore::DataTransfer::createForInputEvent):
        
            Use initializer list for the typeToStringMap.
        
        * dom/DataTransferItemList.cpp:
        (WebCore::DataTransferItemList::ensureItems const):
        
            Use auto and modern for-loop for FileList.
        
        * html/FileInputType.cpp:
        (WebCore::FileInputType::filesFromFormControlState):
        (WebCore::FileInputType::saveFormControlState const):
        (WebCore::FileInputType::appendFormData const):
        (WebCore::FileInputType::handleDOMActivateEvent):
        (WebCore::FileInputType::getTypeSpecificValue):
        (WebCore::FileInputType::disabledAttributeChanged):
        (WebCore::FileInputType::multipleAttributeChanged):
        (WebCore::FileInputType::setFiles):
        (WebCore::FileInputType::receiveDroppedFiles):
        (WebCore::FileInputType::defaultToolTip const):

            Adopt auto, brace-initialization, and modern for-loops.

        * html/FileListCreator.cpp:
        (WebCore::appendDirectoryFiles):
        (WebCore::FileListCreator::createFileList):
        
            Update to work in terms of Vector<Ref<File>>.

        * html/FormController.h:
        (WebCore::FormControlState::FormControlState):
        
            Re-format existing constructors and add one that takes an r-value
            Vector<String> to allow construction from a pre-created list (used 
            in FileInputType::saveFormControlState)
        
        * platform/DragData.h:
        * platform/gtk/DragDataGtk.cpp:
        (WebCore::DragData::asFilenames const):
        * platform/mac/DragDataMac.mm:
        (WebCore::DragData::asFilenames const):
        * platform/win/DragDataWin.cpp:
        (WebCore::DragData::asFilenames const):
        
            Convert asFilenames to return, rather than take, a Vector<String>.

2017-09-14  Carlos Garcia Campos  <cgarcia@igalia.com>

        [Harfbuzz] Wrong offset returned by HarfBuzzShaper::offsetForPosition() when target point is at the middle of a character
        https://bugs.webkit.org/show_bug.cgi?id=176897

        Reviewed by Michael Catanzaro.

        We should include the character when the point is greater than the center of the character.

        Fixes: fast/multicol/hit-test-end-of-column-with-line-height.html
               fast/multicol/newmulticol/compare-with-old-impl/hit-test-end-of-column-with-line-height.html

        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
        (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition):

2017-09-14  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Add PrivateSymbolMode::{Include,Exclude} for PropertyNameArray
        https://bugs.webkit.org/show_bug.cgi?id=176867

        Reviewed by Sam Weinig.

        * bindings/js/JSDOMConvertRecord.h:
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneSerializer::serialize):
        * bridge/NP_jsobject.cpp:
        (_NPN_Enumerate):

2017-09-14  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Timeline should show when events preventDefault() was called on an event or not
        https://bugs.webkit.org/show_bug.cgi?id=176824
        <rdar://problem/34290931>

        Reviewed by Devin Rousso.

        Tests: inspector/timeline/timeline-event-CancelAnimationFrame.html
               inspector/timeline/timeline-event-EventDispatch.html
               inspector/timeline/timeline-event-FireAnimationFrame.html
               inspector/timeline/timeline-event-RequestAnimationFrame.html
               inspector/timeline/timeline-event-TimerFire.html
               inspector/timeline/timeline-event-TimerInstall.html
               inspector/timeline/timeline-event-TimerRemove.html

        * dom/EventTarget.cpp:
        (WebCore::EventTarget::fireEventListeners):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::dispatchEvent):
        Include defaultPrevented when notifying inspector.

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didDispatchEventImpl):
        (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didDispatchEvent):
        (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
        Pass defaultPrevented on to agent.

        * inspector/InspectorTimelineAgent.cpp:
        (WebCore::InspectorTimelineAgent::didDispatchEvent):
        (WebCore::InspectorTimelineAgent::didLayout):
        (WebCore::InspectorTimelineAgent::didPaint):
        * inspector/InspectorTimelineAgent.h:
        * inspector/TimelineRecordFactory.cpp:
        (WebCore::TimelineRecordFactory::appendLayoutRoot):
        (WebCore::TimelineRecordFactory::appendDidDispatchEventData):
        * inspector/TimelineRecordFactory.h:
        Append a boolean defaultPrevented property on the EventDispatch timeline record's data.

2017-09-14  Maureen Daum  <mdaum@apple.com>

        Introduce the option to mark an HTML element as having AutoFill available.
        https://bugs.webkit.org/show_bug.cgi?id=176710

        Reviewed by Alex Christensen.

        Introduce the option to mark an HTML element as having AutoFill available. Accessibility
        can use this property when deciding whether to announce that the focused field offers
        AutoFill.

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::isValueAutofillAvailable const):
        Check if the field is explicitly marked as having AutoFill available.
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::HTMLInputElement):
        * html/HTMLInputElement.h:
        (WebCore::HTMLInputElement::isAutoFillAvailable const):
        (WebCore::HTMLInputElement::setAutoFillAvailable):

2017-09-13  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Move response related features into ResourceResponse
        https://bugs.webkit.org/show_bug.cgi?id=174654

        Reviewed by Alex Christensen.

        * platform/Curl.cmake:
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
        (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
        (WebCore::isHttpRedirect): Deleted.
        (WebCore::isHttpAuthentication): Deleted.
        (WebCore::isHttpNotModified): Deleted.
        (WebCore::isAppendableHeader): Deleted.
        (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderLine): Deleted.
        * platform/network/curl/ResourceHandleCurlDelegate.h:
        * platform/network/curl/ResourceResponse.h:
        (WebCore::ResourceResponse::platformSuggestedFilename const): Deleted.
        * platform/network/curl/ResourceResponseCurl.cpp: Added.
        (WebCore::ResourceResponse::isAppendableHeader):
        (WebCore::ResourceResponse::appendHTTPHeaderField):
        (WebCore::ResourceResponse::setStatusLine):
        (WebCore::ResourceResponse::platformSuggestedFilename const):
        (WebCore::ResourceResponse::isRedirection const):
        (WebCore::ResourceResponse::isNotModified const):
        (WebCore::ResourceResponse::isUnauthorized const):

2017-09-13  Zalan Bujtas  <zalan@apple.com>

        Switch multicolumn's spanner map from raw over to weak pointers.
        https://bugs.webkit.org/show_bug.cgi?id=176367
        <rdar://problem/34254896>

        Reviewed by Antti Koivisto.

        Test: fast/multicol/spanner-crash-when-adding-summary.html

        * rendering/RenderMultiColumnFlowThread.cpp:
        (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
        (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
        (WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval):
        * rendering/RenderMultiColumnFlowThread.h:
        * rendering/RenderMultiColumnSet.cpp:
        (WebCore::RenderMultiColumnSet::firstRendererInFlowThread const):
        (WebCore::RenderMultiColumnSet::lastRendererInFlowThread const):
        * rendering/RenderMultiColumnSpannerPlaceholder.cpp:
        (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
        * rendering/RenderMultiColumnSpannerPlaceholder.h:

2017-09-13  John Wilander  <wilander@apple.com>

        Introduce Storage Access API (document parts) as an experimental feature
        https://bugs.webkit.org/show_bug.cgi?id=175759
        <rdar://problem/34414107>

        Reviewed by Alex Christensen.

        Storage Access API is an experimental feature which allows cross-origin,
        sandboxed iframes to request access to their first-party storage (as
        opposed to partitioned storage). This might be restricted to cookies or
        might cover all stateful mechanisms.

        It introduces the following three developer-facing things:
        - A new readonly attribute, document.hasStorageAccess.
        - A new function, document.requestStorageAccess().
        - A new iframe sandbox token, allow-storage-access-by-user-activation.

        Tests: http/tests/storageAccess/request-and-deny-storage-access-cross-origin-iframe.html
               http/tests/storageAccess/request-and-deny-storage-access-cross-origin-sandboxed-iframe.html
               http/tests/storageAccess/request-and-grant-storage-access-cross-origin-iframe.html
               http/tests/storageAccess/request-and-grant-storage-access-cross-origin-sandboxed-iframe.html
               http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-with-unique-origin.html
               http/tests/storageAccess/request-storage-access-cross-origin-sandboxed-iframe-without-allow-token.html
               http/tests/storageAccess/request-storage-access-same-origin-iframe.html
               http/tests/storageAccess/request-storage-access-same-origin-sandboxed-iframe-without-allow-token.html
               http/tests/storageAccess/request-storage-access-same-origin-sandboxed-iframe.html
               http/tests/storageAccess/request-storage-access-top-frame.html

        * dom/Document.cpp:
        (WebCore::Document::requestStorageAccess):
        * dom/Document.h:
        (WebCore::Document::hasStorageAccess const):
        (WebCore::Document::setUserGrantsStorageAccessOverride):
            See comments on WebCore::Internals below.
        * dom/Document.idl:
        * dom/SecurityContext.cpp:
        (WebCore::SecurityContext::isSupportedSandboxPolicy):
        (WebCore::SecurityContext::parseSandboxPolicy):
            Support for allow-storage-access-by-user-activation.
        * dom/SecurityContext.h:
        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::registerStorageAccess):
            Newly granted storage access is reported to 
            WebCore::ResourceLoadObserver.
        * loader/ResourceLoadObserver.h:
        * loader/ResourceLoadStatistics.cpp:
        (WebCore::encodeHashSet):
        (WebCore::ResourceLoadStatistics::encode const):
        (WebCore::decodeHashSet):
        (WebCore::ResourceLoadStatistics::decode):
        (WebCore::appendHashSet):
        (WebCore::ResourceLoadStatistics::toString const):
        (WebCore::mergeHashSet):
        (WebCore::ResourceLoadStatistics::merge):
            Storage of the new type of data.
        * loader/ResourceLoadStatistics.h:
        * page/Settings.in:
        * testing/Internals.cpp:
        (WebCore::Internals::resetToConsistentState):
        (WebCore::Internals::setUserGrantsStorageAccess):
        * testing/Internals.h:
        * testing/Internals.idl:
            Added setUserGrantsStorageAccess(). It is used to
            override the eventSender's keyboard input which
            always results in a cancel action on the confirm()
            dialog.

2017-09-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        Submitting a form can cause HTMLFormElement's associated elements vector to be mutated during iteration
        https://bugs.webkit.org/show_bug.cgi?id=176368
        <rdar://problem/34254998>

        Reviewed by Ryosuke Niwa.

        In the process of iterating over form.associatedElements() during form submission in FormSubmission::create, the
        page may cause us to clobber the vector of FormAssociatedElements* we're currently iterating over by inserting
        new form controls beneath the form element we're in the process of submitting. This happens because
        FormSubmission::create calls HTMLTextAreaElement::appendFormData, which requires layout to be up to date, which
        in turn makes us updateLayout() and set focus, which fires a `change` event, upon which the page's JavaScript
        inserts additonal DOM nodes into the form, modifying the vector of associated elements.

        To mitigate this, instead of iterating over HTMLFormElement::associatedElements(), which returns a reference to
        the HTMLFormElement's actual m_associatedElements vector, we iterate over a new vector of
        Ref<FormAssociatedElement>s created from m_associatedElements.

        This patch also removes an event dispatch assertion added in r212026. This assertion was added to catch any
        other events dispatched in this scope, since dispatching events there would have had security implications, but
        after making iteration over associated elements robust, this NoEventDispatchAssertion is no longer useful.

        Test: fast/forms/append-children-during-form-submission.html

        * loader/FormSubmission.cpp:
        (WebCore::FormSubmission::create):

2017-09-13  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: Event Listeners section does not update when listeners are added/removed
        https://bugs.webkit.org/show_bug.cgi?id=170570
        <rdar://problem/31501645>

        Reviewed by Joseph Pecoraro.

        Test: inspector/dom/event-listener-add-remove.html

        * dom/EventTarget.cpp:
        (WebCore::EventTarget::setAttributeEventListener):
        Fire willRemoveEventListener/didAddEventListener events when an attribute event listener is
        replaced by another event listener.

        * inspector/InspectorDOMAgent.h:
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::didAddEventListener):
        (WebCore::InspectorDOMAgent::willRemoveEventListener):
        Dispatch an event to the inspector frontend whenever an event listener is added/removed.

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
        (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
        Tie into existing instrumentation points for adding/removing event listeners.

2017-09-13  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Bug fix for synchronous transfer
        https://bugs.webkit.org/show_bug.cgi?id=176552

        Reviewed by Alex Christensen.

        ResourceHandleInternal::m_delegate is null when transfer is synchronous. It should be set ResourceHandleCurlDelegate.
        Also the callback functions called when transfer is completed is wrong.

        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
        (WebCore::ResourceHandleCurlDelegate::notifyFinish):
        (WebCore::ResourceHandleCurlDelegate::notifyFail):
        (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
        (WebCore::ResourceHandleCurlDelegate::didReceiveData):
        (WebCore::ResourceHandleCurlDelegate::willSendData):

2017-09-13  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r221976.

        The test introduced was flaky from point of addition.

        Reverted changeset:

        "Introduce Storage Access API (document parts) as an
        experimental feature"
        https://bugs.webkit.org/show_bug.cgi?id=175759
        http://trac.webkit.org/changeset/221976

2017-09-13  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Followup (r221805): Address comments and add more tests
        https://bugs.webkit.org/show_bug.cgi?id=176732

        Reviewed by Darin Adler.

        Test: http/tests/images/decode-slow-load-static-image.html

        Code clean up and adding a new test to ensure multiple decode() promises
        can be resolved or rejected simultaneously without any issues.

        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::decode):
        (WebCore::ImageLoader::decodeError):
        * loader/ImageLoader.h:
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::decode):
        (WebCore::BitmapImage::callDecodingCallbacks):
        * platform/graphics/BitmapImage.h:

2017-09-13  Youenn Fablet  <youenn@apple.com>

        Internals clearCacheStorageMemoryRepresentation should return a Promise
        https://bugs.webkit.org/show_bug.cgi?id=176818

        Reviewed by Alex Christensen.

        No observable change of behavior.

        * Modules/cache/DOMCacheEngine.h:
        * testing/Internals.cpp:
        (WebCore::Internals::clearCacheStorageMemoryRepresentation): Returning a promise when clearing is completed.
        * testing/Internals.h:
        * testing/Internals.idl:

2017-09-13  Nikita Vasilyev  <nvasilyev@apple.com>

        Web Inspector: Frontend should be made to expect and handle disabled properties
        https://bugs.webkit.org/show_bug.cgi?id=166787
        <rdar://problem/34379593>

        Reviewed by Joseph Pecoraro.

        Include disabled (commented out) CSS properties in the payload.

        Tests: inspector/css/css-property.html
               inspector/css/matched-style-properties.html

        * inspector/InspectorStyleSheet.cpp:
        (WebCore::InspectorStyle::populateAllProperties const):
        (WebCore::InspectorStyle::styleWithProperties const):

2017-09-13  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK] Fails to build because 'Float32Array' has not been declared in AudioContext.h
        https://bugs.webkit.org/show_bug.cgi?id=176870

        Reviewed by Konstantin Tokarev.

        Add missing include of Float32Array.h

        No new tests, its a build fix.

        * Modules/webaudio/AudioContext.h:

2017-09-13  Andy Estes  <aestes@apple.com>

        [CF] Upstream CFNetwork-related WebKitSystemInterface functions
        https://bugs.webkit.org/show_bug.cgi?id=176729

        Reviewed by Alex Christensen.

        * platform/ios/WebCoreSystemInterfaceIOS.mm:
        * platform/mac/PublicSuffixMac.mm:
        (WebCore::isPublicSuffix):
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:
        * platform/network/cf/ResourceRequestCFNet.cpp:
        (WebCore::ResourceRequest::doUpdatePlatformRequest):
        (WebCore::ResourceRequest::doUpdateResourceRequest):
        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
        (WebCore::setCONNECTProxyForStream):
        (WebCore::SocketStreamHandleImpl::createStreams):
        (WebCore::setCONNECTProxyAuthorizationForStream):
        (WebCore::SocketStreamHandleImpl::addCONNECTCredentials):
        (WebCore::copyCONNECTProxyResponse):
        (WebCore::SocketStreamHandleImpl::readStreamCallback):
        (WebCore::SocketStreamHandleImpl::writeStreamCallback):
        * platform/network/cocoa/ResourceRequestCocoa.mm:
        (WebCore::ResourceRequest::doUpdateResourceRequest):
        (WebCore::ResourceRequest::doUpdatePlatformRequest):

2017-09-13  Antti Koivisto  <antti@apple.com>

        Make more of the CSS animation system internals element based
        https://bugs.webkit.org/show_bug.cgi?id=176832

        Reviewed by Zalan Bujtas.

        CSS animations animate element style. Continue moving away from renderers in the animation code.

        Also do some general modernization.

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::computeRenderStyleForProperty):
        * page/animation/AnimationBase.cpp:
        (WebCore::AnimationBase::AnimationBase):
        * page/animation/AnimationBase.h:
        * page/animation/CSSAnimationController.cpp:
        (WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
        (WebCore::CSSAnimationControllerPrivate::clear):
        (WebCore::CSSAnimationControllerPrivate::updateAnimations):
        (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForElement):
        (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
        (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
        (WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime):
        (WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime):
        (WebCore::CSSAnimationControllerPrivate::animatedStyleForElement):
        (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
        (WebCore::CSSAnimationController::cancelAnimations):
        (WebCore::CSSAnimationController::updateAnimations):
        (WebCore::CSSAnimationController::animatedStyleForRenderer):
        (WebCore::CSSAnimationController::computeExtentOfAnimation const):
        (WebCore::CSSAnimationController::pauseAnimationAtTime):
        (WebCore::CSSAnimationController::pauseTransitionAtTime):
        (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer): Deleted.
        (WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer): Deleted.
        (WebCore::CSSAnimationController::getAnimatedStyleForRenderer): Deleted.
        * page/animation/CSSAnimationController.h:
        * page/animation/CSSAnimationControllerPrivate.h:
        * page/animation/CompositeAnimation.cpp:
        (WebCore::CompositeAnimation::~CompositeAnimation):
        (WebCore::CompositeAnimation::clearElement):
        (WebCore::CompositeAnimation::updateTransitions):
        (WebCore::CompositeAnimation::updateKeyframeAnimations):
        (WebCore::CompositeAnimation::animate):
        (WebCore::CompositeAnimation::clearRenderer): Deleted.
        * page/animation/CompositeAnimation.h:
        * page/animation/ImplicitAnimation.cpp:
        (WebCore::ImplicitAnimation::ImplicitAnimation):
        (WebCore::ImplicitAnimation::animate):
        * page/animation/ImplicitAnimation.h:
        (WebCore::ImplicitAnimation::create):
        * page/animation/KeyframeAnimation.cpp:
        (WebCore::KeyframeAnimation::KeyframeAnimation):
        (WebCore::KeyframeAnimation::animate):
        * page/animation/KeyframeAnimation.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::willBeDestroyed):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::currentTransform const):
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::createRenderer):
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
        * testing/Internals.cpp:
        (WebCore::Internals::pauseAnimationAtTimeOnElement):
        (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement):
        (WebCore::Internals::pauseTransitionAtTimeOnElement):
        (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement):

2017-09-13  Daniel Bates  <dabates@apple.com>

        Make history.pushState()/replaceState() more closely aligned to the HTML standard
        https://bugs.webkit.org/show_bug.cgi?id=176730
        <rdar://problem/33839265>

        Reviewed by Alex Christensen.

        Update history.pushState()/replaceState() to more closely align with the algorithm
        specified in <https://html.spec.whatwg.org/multipage/history.html#dom-history-pushstate-2> (9 September 2017).

        Test: http/tests/security/history-pushState-replaceState-from-sandboxed-iframe.html

        * page/History.cpp:
        (WebCore::History::stateObjectAdded):
        * page/SecurityOrigin.cpp:
        (WebCore::SecurityOrigin::extractInnerURL): Use URL constructor that takes a base URL as opposed
        to using the special ParsedURLString-variant because the latter can only be used to parse a string
        returned from URL::string(). And the extracted inner URL does not meet this criterion. Using the
        ParsedURLString-variant of the URL constructor with a string that is not the result of URL::string()
        will cause an assertion failure in a debug build.

2017-09-13  John Wilander  <wilander@apple.com>

        Introduce Storage Access API (document parts) as an experimental feature
        https://bugs.webkit.org/show_bug.cgi?id=175759
        <rdar://problem/33666847>

        Reviewed by Alex Christensen.

        Storage Access API is an experimental feature which allows cross-origin,
        sandboxed iframes to request access to their first-party storage (as
        opposed to partitioned storage). This might be restricted to cookies or
        might cover all stateful mechanisms.

        It introduces the following three developer-facing things:
        - A new readonly attribute, document.hasStorageAccess.
        - A new function, document.requestStorageAccess().
        - A new iframe sandbox token, allow-storage-access-by-user-activation.

        Tests: http/tests/loading/resourceLoadStatistics/request-and-deny-storage-access-cross-origin-iframe.html
               http/tests/loading/resourceLoadStatistics/request-and-deny-storage-access-cross-origin-sandboxed-iframe.html
               http/tests/loading/resourceLoadStatistics/request-and-grant-storage-access-cross-origin-iframe.html
               http/tests/loading/resourceLoadStatistics/request-and-grant-storage-access-cross-origin-sandboxed-iframe.html
               http/tests/loading/resourceLoadStatistics/request-storage-access-cross-origin-sandboxed-iframe-with-unique-origin.html
               http/tests/loading/resourceLoadStatistics/request-storage-access-cross-origin-sandboxed-iframe-without-allow-token.html
               http/tests/loading/resourceLoadStatistics/request-storage-access-same-origin-iframe.html
               http/tests/loading/resourceLoadStatistics/request-storage-access-same-origin-sandboxed-iframe-without-allow-token.html
               http/tests/loading/resourceLoadStatistics/request-storage-access-same-origin-sandboxed-iframe.html
               http/tests/loading/resourceLoadStatistics/request-storage-access-top-frame.html

        * dom/Document.cpp:
        (WebCore::Document::requestStorageAccess):
        * dom/Document.h:
        (WebCore::Document::hasStorageAccess const):
        (WebCore::Document::setUserGrantsStorageAccessOverride):
            See comments on WebCore::Internals below.
        * dom/Document.idl:
        * dom/SecurityContext.cpp:
        (WebCore::SecurityContext::isSupportedSandboxPolicy):
        (WebCore::SecurityContext::parseSandboxPolicy):
            Support for allow-storage-access-by-user-activation.
        * dom/SecurityContext.h:
        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::registerStorageAccess):
            Newly granted storage access is reported to 
            WebCore::ResourceLoadObserver.
        * loader/ResourceLoadObserver.h:
        * loader/ResourceLoadStatistics.cpp:
        (WebCore::encodeHashSet):
        (WebCore::ResourceLoadStatistics::encode const):
        (WebCore::decodeHashSet):
        (WebCore::ResourceLoadStatistics::decode):
        (WebCore::appendHashSet):
        (WebCore::ResourceLoadStatistics::toString const):
        (WebCore::mergeHashSet):
        (WebCore::ResourceLoadStatistics::merge):
            Storage of the new type of data.
        * loader/ResourceLoadStatistics.h:
        * page/Settings.in:
        * testing/Internals.cpp:
        (WebCore::Internals::resetToConsistentState):
        (WebCore::Internals::setUserGrantsStorageAccess):
        * testing/Internals.h:
        * testing/Internals.idl:
            Added setUserGrantsStorageAccess(). It is used to
            override the eventSender's keyboard input which
            always results in a cancel action on the confirm()
            dialog.

2017-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>

        [HarfBuzz] Wrong offset returned by HarfBuzzShaper::offsetForPosition in some cases
        https://bugs.webkit.org/show_bug.cgi?id=176848

        Reviewed by Michael Catanzaro.

        This patch rewrites HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition() to make it simpler and ensure we
        return the right offset in all the cases, also honoring now the includePartialGlyphs parameter that we were
        ignoring in FontCascade::offsetForPositionForComplexText().

        Fixes several tests that started to fail after r221909.

        * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
        (WebCore::FontCascade::offsetForPositionForComplexText const):
        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
        (WebCore::HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition):
        (WebCore::HarfBuzzShaper::offsetForPosition):
        * platform/graphics/harfbuzz/HarfBuzzShaper.h:

2017-09-13  Per Arne Vollan  <pvollan@apple.com>

        Initialize InternalSettings member variable.
        https://bugs.webkit.org/show_bug.cgi?id=176838

        Reviewed by Brent Fulgham.

        Initialize the m_webVREnabled member in the constructor.

        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::Backup::Backup):

2017-09-13  Ms2ger  <Ms2ger@igalia.com>

        Make WebGLRenderingContextBase::TypedList::data() const-correct.
        https://bugs.webkit.org/show_bug.cgi?id=176833

        Reviewed by Sam Weinig.

        No change of behavior.

        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters):
        * html/canvas/WebGLRenderingContextBase.h:
        (WebCore::WebGLRenderingContextBase::TypedList::data const):
        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::uniform1fv):
        (WebCore::GraphicsContext3D::uniform2fv):
        (WebCore::GraphicsContext3D::uniform3fv):
        (WebCore::GraphicsContext3D::uniform4fv):
        (WebCore::GraphicsContext3D::uniform1iv):
        (WebCore::GraphicsContext3D::uniform2iv):
        (WebCore::GraphicsContext3D::uniform3iv):
        (WebCore::GraphicsContext3D::uniform4iv):
        (WebCore::GraphicsContext3D::uniformMatrix2fv):
        (WebCore::GraphicsContext3D::uniformMatrix3fv):
        (WebCore::GraphicsContext3D::uniformMatrix4fv):
        (WebCore::GraphicsContext3D::vertexAttrib1fv):
        (WebCore::GraphicsContext3D::vertexAttrib2fv):
        (WebCore::GraphicsContext3D::vertexAttrib3fv):
        (WebCore::GraphicsContext3D::vertexAttrib4fv):

2017-09-13  Sam Weinig  <sam@webkit.org>

        Remove CanvasRenderingContext2D.commit(), it is a no-op and not part the standard
        https://bugs.webkit.org/show_bug.cgi?id=176821

        Reviewed by Darin Adler.

        * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/CanvasRenderingContext2D.idl:
        
            Remove the commit operation. It is no longer part the standard (it was
            moved to OffscreenCanvasRenderingContext2D) and it was a no-op.

2017-09-12  Matt Rajca  <mrajca@apple.com>

        Ensure the user interacted with the page before setting m_userHasInteractedWithMediaElement
        https://bugs.webkit.org/show_bug.cgi?id=176816

        Reviewed by Eric Carlson.

        Currently, when the user presses a keyboard shortcut in the client to reload a page, that may
        get registered as a user gesture on the reloaded page. Before setting the
        m_userHasInteractedWithMediaElement flag, we should check if a user gesture was actually handled
        by checking the userDidInteractWithPage flag. In case of key events that aren't handled by the
        page, this will be set to false by EventHandler:

            // If the key event was not handled, do not treat it as user interaction with the page.
            if (topDocument && !wasHandled)
                topDocument->setUserDidInteractWithPage(savedUserDidInteractWithPage);

        We need to revisit this in the future in webkit.org/b/176817 and ensure user gesture tokens
        don't carry over across reloads of the page.

        Tests: I wasn't able to trigger the pathological scenario this aims to fix with a test that calls
        window.location.reload() from a synthetic keyDown event.

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

2017-09-13  Ms2ger  <Ms2ger@igalia.com>

        Disallow passing null values to various WebGL2 methods.
        https://bugs.webkit.org/show_bug.cgi?id=176829

        Reviewed by Yusuke Suzuki.

        This matches the specification as well as Gecko and Chromium.

        Test: fast/canvas/webgl/webgl2/bindings.html

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::beginQuery):
        (WebCore::WebGL2RenderingContext::getQueryParameter):
        (WebCore::WebGL2RenderingContext::samplerParameteri):
        (WebCore::WebGL2RenderingContext::samplerParameterf):
        (WebCore::WebGL2RenderingContext::getSamplerParameter):
        (WebCore::WebGL2RenderingContext::clientWaitSync):
        (WebCore::WebGL2RenderingContext::waitSync):
        (WebCore::WebGL2RenderingContext::getSyncParameter):
        (WebCore::WebGL2RenderingContext::transformFeedbackVaryings):
        (WebCore::WebGL2RenderingContext::getTransformFeedbackVarying):
        (WebCore::WebGL2RenderingContext::getUniformIndices):
        (WebCore::WebGL2RenderingContext::getUniformBlockIndex):
        (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter):
        (WebCore::WebGL2RenderingContext::getActiveUniformBlockName):
        (WebCore::WebGL2RenderingContext::uniformBlockBinding):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:

2017-09-13  Sergio Villar Senin  <svillar@igalia.com>

        [WebVR] Add IDLs and stubs
        https://bugs.webkit.org/show_bug.cgi?id=174202

        Reviewed by Dean Jackson.

        Adding the complete set of IDLs for the WebVR 1.1 spec including the interface stubs which
        currently do nothing.

        Tests: webvr/webvr-disabled.html
               webvr/webvr-enabled.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/webvr/DOMWindowWebVR.idl: Added.
        * Modules/webvr/GamepadWebVR.cpp: Added.
        (WebCore::GamepadWebVR::GamepadWebVR):
        (WebCore::GamepadWebVR::~GamepadWebVR):
        (WebCore::GamepadWebVR::displayId):
        * Modules/webvr/GamepadWebVR.h: Added.
        * Modules/webvr/GamepadWebVR.idl: Added.
        * Modules/webvr/NavigatorWebVR.cpp: Added.
        (WebCore::NavigatorWebVR::getVRDisplays):
        (WebCore::NavigatorWebVR::activeVRDisplays):
        (WebCore::NavigatorWebVR::vrEnabled):
        * Modules/webvr/NavigatorWebVR.h: Added.
        * Modules/webvr/NavigatorWebVR.idl: Added.
        * Modules/webvr/VRDisplay.cpp: Added.
        (WebCore::VRDisplay::create):
        (WebCore::VRDisplay::VRDisplay):
        (WebCore::VRDisplay::isConnected const):
        (WebCore::VRDisplay::isPresenting const):
        (WebCore::VRDisplay::capabilities const):
        (WebCore::VRDisplay::stageParameters const):
        (WebCore::VRDisplay::getEyeParameters const):
        (WebCore::VRDisplay::displayId const):
        (WebCore::VRDisplay::displayName const):
        (WebCore::VRDisplay::getFrameData const):
        (WebCore::VRDisplay::getPose const):
        (WebCore::VRDisplay::resetPose):
        (WebCore::VRDisplay::depthNear const):
        (WebCore::VRDisplay::setDepthNear):
        (WebCore::VRDisplay::depthFar const):
        (WebCore::VRDisplay::setDepthFar):
        (WebCore::VRDisplay::requestAnimationFrame):
        (WebCore::VRDisplay::cancelAnimationFrame):
        (WebCore::VRDisplay::requestPresent):
        (WebCore::VRDisplay::exitPresent):
        (WebCore::VRDisplay::getLayers const):
        (WebCore::VRDisplay::submitFrame):
        (WebCore::VRDisplay::hasPendingActivity const):
        (WebCore::VRDisplay::activeDOMObjectName const):
        (WebCore::VRDisplay::canSuspendForDocumentSuspension const):
        (WebCore::VRDisplay::stop):
        * Modules/webvr/VRDisplay.h: Added.
        * Modules/webvr/VRDisplay.idl: Added.
        * Modules/webvr/VRDisplayCapabilities.cpp: Added.
        (WebCore::VRDisplayCapabilities::hasPosition const):
        (WebCore::VRDisplayCapabilities::hasOrientation const):
        (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
        (WebCore::VRDisplayCapabilities::canPresent const):
        (WebCore::VRDisplayCapabilities::maxLayer const):
        * Modules/webvr/VRDisplayCapabilities.h: Added.
        (WebCore::VRDisplayCapabilities::create):
        * Modules/webvr/VRDisplayCapabilities.idl: Added.
        * Modules/webvr/VRDisplayEvent.cpp: Added.
        (WebCore::VRDisplayEvent::VRDisplayEvent):
        (WebCore::VRDisplayEvent::display const):
        (WebCore::VRDisplayEvent::reason const):
        (WebCore::VRDisplayEvent::eventInterface const):
        * Modules/webvr/VRDisplayEvent.h: Added.
        * Modules/webvr/VRDisplayEvent.idl: Added.
        * Modules/webvr/VRDisplayEventReason.h: Added.
        * Modules/webvr/VRDisplayEventReason.idl: Added.
        * Modules/webvr/VREye.h: Added.
        * Modules/webvr/VREye.idl: Added.
        * Modules/webvr/VREyeParameters.cpp: Added.
        (WebCore::VREyeParameters::VREyeParameters):
        (WebCore::VREyeParameters::offset const):
        (WebCore::VREyeParameters::fieldOfView const):
        (WebCore::VREyeParameters::renderWidth const):
        (WebCore::VREyeParameters::renderHeight const):
        * Modules/webvr/VREyeParameters.h: Added.
        (WebCore::VREyeParameters::create):
        * Modules/webvr/VREyeParameters.idl: Added.
        * Modules/webvr/VRFieldOfView.cpp: Added.
        (WebCore::VRFieldOfView::upDegrees const):
        (WebCore::VRFieldOfView::rightDegrees const):
        (WebCore::VRFieldOfView::downDegrees const):
        (WebCore::VRFieldOfView::leftDegrees const):
        * Modules/webvr/VRFieldOfView.h: Added.
        (WebCore::VRFieldOfView::create):
        * Modules/webvr/VRFieldOfView.idl: Added.
        * Modules/webvr/VRFrameData.cpp: Added.
        (WebCore::VRFrameData::VRFrameData):
        (WebCore::VRFrameData::timestamp const):
        (WebCore::VRFrameData::leftProjectionMatrix const):
        (WebCore::VRFrameData::leftViewMatrix const):
        (WebCore::VRFrameData::rightProjectionMatrix const):
        (WebCore::VRFrameData::rightViewMatrix const):
        (WebCore::VRFrameData::pose const):
        * Modules/webvr/VRFrameData.h: Added.
        (WebCore::VRFrameData::create):
        * Modules/webvr/VRFrameData.idl: Added.
        * Modules/webvr/VRLayerInit.h: Added.
        * Modules/webvr/VRLayerInit.idl: Added.
        * Modules/webvr/VRPose.cpp: Added.
        (WebCore::VRPose::position const):
        (WebCore::VRPose::linearVelocity const):
        (WebCore::VRPose::linearAcceleration const):
        (WebCore::VRPose::orientation const):
        (WebCore::VRPose::angularVelocity const):
        (WebCore::VRPose::angularAcceleration const):
        * Modules/webvr/VRPose.h: Added.
        (WebCore::VRPose::create):
        * Modules/webvr/VRPose.idl: Added.
        * Modules/webvr/VRStageParameters.cpp: Added.
        (WebCore::VRStageParameters::sittingToStandingTransform const):
        (WebCore::VRStageParameters::sizeX const):
        (WebCore::VRStageParameters::sizeZ const):
        * Modules/webvr/VRStageParameters.h: Added.
        (WebCore::VRStageParameters::create):
        * Modules/webvr/VRStageParameters.idl: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/WebCoreBuiltinNames.h:
        * dom/EventNames.h:
        * dom/EventNames.in:
        * dom/EventTargetFactory.in:
        * features.json:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setWebVREnabled):
        (WebCore::RuntimeEnabledFeatures::webVREnabled const):
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::Backup::restoreTo):
        (WebCore::InternalSettings::setWebVREnabled):
        * testing/InternalSettings.h:
        * testing/InternalSettings.idl:

2017-09-13  Ms2ger  <Ms2ger@igalia.com>

        Update the type of the texture argument to framebufferTextureLayer().
        https://bugs.webkit.org/show_bug.cgi?id=176785

        Reviewed by Yusuke Suzuki.

        This matches the specification as well as Gecko and Chromium.

        Also move getInternalformatParameter() to the position it has in the
        specification, for easier comparison.

        Test: fast/canvas/webgl/webgl2/bindings.html

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::framebufferTextureLayer):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:

2017-09-13  Zan Dobersek  <zdobersek@igalia.com>

        [EME] Implement CDMInstanceClearKey::updateLicense()
        https://bugs.webkit.org/show_bug.cgi?id=176791

        Reviewed by Xabier Rodriguez-Calvar.

        Implement the updateLicense() method for CDMInstanceClearKey.
        The response data is parsed as JSON, matching that agains either
        'license' or 'license release acknowledgement' formats (depending
        on either 'keys' or 'kids' object keys being present). If any
        format is recognized, appropriate steps are taken.

        In case of the 'license' format, the passed-in keys are matched
        against existing ones. If some keys have changed or have been
        newly introduced, the key information is sorted by key ID size
        and data to enforce order. After that the KeyStatusVector object
        is constructed, containing key ID and status information for all
        the keys associated with this session. Finally callback is
        dispatched, signalling a successful operation and passing the
        KeyStatusVector, if any, back to the caller.

        In case of the 'license release acknowledgement' format, the
        session data for this session ID is removed from the ClearKey state
        singleton. The callback is dispatched signalling the session closure
        and successfull completion of the operation.

        Finally, if no format is deduced, the callback is again dispatched,
        but now signalling an operation failure.

        No new tests -- expectations for the relevant tests are updated
        to reflect the introduced changes.

        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::ClearKeyState::keys):
        (WebCore::ClearKeyState::singleton):
        (WebCore::parseLicenseFormat):
        (WebCore::parseLicenseReleaseAcknowledgementFormat):
        (WebCore::CDMInstanceClearKey::updateLicense):

2017-09-13  Ryosuke Niwa  <rniwa@webkit.org>

        Refactor WebContentReader out of EditorMac and EditorIOS
        https://bugs.webkit.org/show_bug.cgi?id=176770

        Reviewed by Sam Weinig.

        Extracted WebContentReader.h, WebContentReaderMac.mm, and WebContentIOS.mm from Pasteboard.h,
        EditorMac.mm, and EditorIOS.mm respectively.

        Also moved createFragmentAndAddResources from EditorCocoa.mm to WebContentReaderCocoa.mm
        and createFragmentForImageAndURL and createFragmentForImageResourceAndAddResource to markup.cpp.

        * Configurations/WebCore.xcconfig:
        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * editing/Editor.cpp:
        (WebCore::Editor::createFragmentForImageAndURL): Deleted.
        * editing/Editor.h:
        * editing/WebContentReader.h: Added.
        * editing/cocoa/EditorCocoa.mm:
        (WebCore::Editor::replaceSelectionWithAttributedString):
        (WebCore::Editor::createFragment): Deleted.
        (WebCore::Editor::createFragmentForImageResourceAndAddResource): Deleted.
        (WebCore::Editor::createFragmentAndAddResources): Deleted.
        * editing/cocoa/WebContentReaderCocoa.mm: Added.
        (WebCore::createFragmentForImageResourceAndAddResource):
        (WebCore::createFragment):
        (WebCore::createFragmentAndAddResources):
        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::WebContentReader): Moved to WebContentReaderIOS.mm.
        * editing/ios/WebContentReaderIOS.mm: Added.
        (WebCore::WebContentReader::addFragment):
        (WebCore::WebContentReader::readWebArchive):
        (WebCore::WebContentReader::readFilenames):
        (WebCore::WebContentReader::readHTML):
        (WebCore::WebContentReader::readRTFD):
        (WebCore::WebContentReader::readRTF):
        (WebCore::WebContentReader::readImage):
        (WebCore::WebContentReader::readURL):
        (WebCore::WebContentReader::readPlainText):
        * editing/mac/EditorMac.mm:
        (WebCore::Editor::WebContentReader): Moved to WebContentReaderMac.mm.
        * editing/mac/WebContentReaderMac.mm: Added.
        (WebCore::WebContentReader::readWebArchive):
        (WebCore::WebContentReader::readFilenames):
        (WebCore::WebContentReader::readHTML):
        (WebCore::WebContentReader::readRTFD):
        (WebCore::WebContentReader::readRTF):
        (WebCore::WebContentReader::readImage):
        (WebCore::WebContentReader::readURL):
        (WebCore::WebContentReader::readPlainText):
        * editing/markup.cpp:
        (WebCore::createFragmentForImageAndURL):
        (WebCore::createFragmentForImageResourceAndAddResource):
        * editing/markup.h:

2017-09-12  Yusuke Suzuki  <utatane.tea@gmail.com>

        [DFG] Optimize WeakMap::get by adding intrinsic and fixup
        https://bugs.webkit.org/show_bug.cgi?id=176010

        Reviewed by Filip Pizlo.

        * platform/network/curl/CurlJobManager.cpp:
        (WebCore::CurlJobList::finishJobs):

2017-09-12  Frederic Wang  <fwang@igalia.com>

        Rename isRootLayer to isRenderViewLayer
        https://bugs.webkit.org/show_bug.cgi?id=176684

        Reviewed by Darin Adler.

        This patch was generated with the help of do-webcore-rename with some coding style adjustment.

        No new tests, behavior unchanged.

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::RenderLayer):
        (WebCore::RenderLayer::enclosingTransformedAncestor const):
        (WebCore::RenderLayer::enclosingFilterRepaintLayer const):
        (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
        (WebCore::RenderLayer::clippingRootForPainting const):
        (WebCore::RenderLayer::beginTransparencyLayers):
        (WebCore::shouldSuppressPaintingLayer):
        (WebCore::RenderLayer::paintFixedLayersInNamedFlows):
        (WebCore::RenderLayer::hitTest):
        (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/RenderLayer.h:
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::RenderLayerBacking):
        (WebCore::RenderLayerBacking::updateConfiguration):
        (WebCore::RenderLayerBacking::updateAfterDescendants):
        (WebCore::RenderLayerBacking::paintsIntoWindow const):
        (WebCore::RenderLayerBacking::paintIntoLayer):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::logLayerInfo):
        (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const):
        (WebCore::RenderLayerCompositor::updateBacking):
        (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
        (WebCore::RenderLayerCompositor::addToOverlapMap):
        (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
        (WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed):
        (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
        (WebCore::RenderLayerCompositor::needsToBeComposited const):
        (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): Also move the IOS condition
        up to avoid that check-webkit-style complains.
        (WebCore::RenderLayerCompositor::reasonsForCompositing const):
        (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
        (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

2017-09-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS DnD] Support DataTransfer.getData and DataTransfer.setData when dragging or dropping
        https://bugs.webkit.org/show_bug.cgi?id=176672
        <rdar://problem/34353723>

        Reviewed by Ryosuke Niwa.

        Makes several tweaks to support DataTransfer.getData and DataTransfer.setData when dragging and dropping on iOS.
        See per-method changes below for more details. This patch also renames some old variable and property names
        along the way, so they no longer reference "data interaction", and instead refer to the feature by its post-WWDC
        name.

        New test: DataInteractionTests.ExternalSourceInlineTextToFileInput
        Modified: DataInteractionTests.CanStartDragOnDivWithDraggableAttribute
                  DataInteractionTests.SinglePlainTextURLTypeIdentifiers
                  DataInteractionTests.SinglePlainTextWordTypeIdentifiers

        * platform/ios/AbstractPasteboard.h:
        * platform/ios/PasteboardIOS.mm:
        (WebCore::cocoaTypeFromHTMLClipboardType):

        In cocoaTypeFromHTMLClipboardType, map the "text/plain" MIME type to the "public.plain-text" UTI. Previously,
        this corresponded to "public.text", which is incorrect, since "public.text" also includes non-plain-text types
        such as "public.html", thereby confusing NSItemProviders. Importantly, this makes it so that plain text strings
        written via DataTransfer.setData() can actually be read back as a cocoa value, since "public.plain-text" is one
        of the UTIs in +[NSString readableTypeIdentifiersForItemProvider].

        (WebCore::Pasteboard::writeString):

        Instead of writing { type : data } to the pasteboard, write { cocoaType : data }. It appears that this was
        changed unintentionally in r156588 when upstreaming the iOS pasteboard implementation. This is made apparent by
        how Pasteboard::readString() requests the cocoa UTI from the platform pasteboard, but Pasteboard::writeString()
        sends the MIME type.

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::filenamesForDataInteraction):
        (WebCore::PlatformPasteboard::write):

        When writing plain text or a URL, specify that the item wants inline style representation. This prevents odd and
        unexpected behaviors (for instance, being able to drag plain text into the Files app as a file), but it also
        makes getData() not bail and return the null string on drop, due to forFileDrag() being true in
        DataTransfer::getData().

        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderRegistrationInfoList init]):
        (uiPreferredPresentationStyle):
        (-[WebItemProviderRegistrationInfoList itemProvider]):

        Set the preferred presentation style when generating an item provider from a registration list.

        (+[WebItemProviderLoadResult emptyLoadResult]):
        (+[WebItemProviderLoadResult loadResultWithFileURLMap:presentationStyle:]):
        (-[WebItemProviderLoadResult initWithFileURLMap:presentationStyle:]):
        (-[WebItemProviderLoadResult fileURLForType:]):
        (-[WebItemProviderLoadResult loadedFileURLs]):
        (-[WebItemProviderLoadResult loadedTypeIdentifiers]):

        Introduce WebItemProviderLoadResult, an object that encapsulates information needed to represent the contents of
        an NSItemProvider dropped in web content. Previously, WebItemProviderPasteboard maintained an array of
        dictionaries of UTI => file URL, where each dictionary represents where the dropped data for a given item
        provider lives. Now that we additionally need to remember (for each item provider) whether we should consider
        its data as a file upload, it's more helpful to have a separate object representing the "load results" of a
        dropped item provider.

        (-[WebItemProviderPasteboard init]):
        (-[WebItemProviderPasteboard pasteboardTypes]):
        (-[WebItemProviderPasteboard setItemProviders:]):
        (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
        (-[WebItemProviderPasteboard droppedFileURLs]):

        Respect item provider load results that should not be exposed as a file to the page.

        (-[WebItemProviderPasteboard numberOfFiles]):

        Respect item providers with UIPreferredPresentationStyleInline by not counting them towards the number of files.

        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):

        Adjust for the transition from an array of dictionaries representing loaded item providers to an array of
        WebItemProviderLoadResults.

        (-[WebItemProviderPasteboard fileURLsForDataInteraction]): Deleted.
        * platform/mac/DragDataMac.mm:
        (WebCore::DragData::containsFiles const):

        DragData::containsFiles previously only considered whether or not particular UTIs appear in the pasteboard. In
        the case of Mac, this is NSFilesPromisePboardType and NSFilenamesPboardType, but in the case of iOS, this is a
        much broader category (anything conforming to "public.content"), since files are not exposed explicitly as
        "promise" or "file" types in the list of registered UTIs. This caused us to always bail in
        DataTransfer.getData() on drop on iOS, since we will always believe there's a file on the pasteboard if there's
        anything conforming to "public.content" at all.

        To fix this and simplify the code at the same time, we simply replace the currently implementation of
        DragData::containsFiles to return true iff the number of files is nonzero. On Mac, DragData::numberOfFiles
        checks the same UTIs as DragData::containsFiles (NSFilesPromisePboardType and NSFilenamesPboardType), but
        additionally counts the number of file URLs corresponding to those UTIs.

        On iOS, the implementation of numberOfFiles is new to iOS 11, and relevant only in the drag and drop flow.
        Previously, we would consider an item provider to "contain" a file if it had a UTI conforming to one of the UTIs
        acceptable for drag and drop (at the time of writing, these are ["public.content", "public.zip",
        "public.folder"]). With this patch, anything conforming to these UTIs will continue to be represented as files,
        but importantly, if an item provider indicates that it should be represented inline (i.e. a plain text
        selection), then we don't consider that item provider as vending a file. This allows us to distinguish between
        cases where we are dragging a plain text selection over a file input, and when we are dragging a plain text file.
        In both cases, "public.plain-text" is offered as a registered UTI, but in the former, the item provider should
        indicate that inline presentation style is preferred. Refer to <rdar://problem/32202542> for more details.

2017-09-12  Joseph Pecoraro  <pecoraro@apple.com>

        QualifiedName::init should assume AtomicStrings::init was already called
        https://bugs.webkit.org/show_bug.cgi?id=176639

        Reviewed by Sam Weinig.

        * dom/QualifiedName.cpp:
        (WebCore::QualifiedName::init):
        All callers of QualifiedName::init precede it with their own call to
        AtomicString::init, so QualifiedName doesn't need to do it.

2017-09-12  Myles C. Maxfield  <mmaxfield@apple.com>

        Unskip fast/text/system-font-synthetic-italic.html
        https://bugs.webkit.org/show_bug.cgi?id=175944
        <rdar://problem/32864306>

        Reviewed by Jon Lee.

        Our buildbots now all have this symbol.

        * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
        (WebCore::FontFamilySpecificationCoreText::fontRanges const):

2017-09-12  Myles C. Maxfield  <mmaxfield@apple.com>

        ASSERTION FAILED: !m_valueOrException under FontFaceSet::completedLoading loading a Serious Eats page
        https://bugs.webkit.org/show_bug.cgi?id=175899

        Reviewed by Tim Horton.

        Slight style update to r221835. Also adds a test.

        Test: fast/text/document-fonts-while-loading-crash.html

        * css/CSSFontFaceSet.h:
        * css/FontFaceSet.cpp:
        (WebCore::FontFaceSet::FontFaceSet):

2017-09-12  Myles C. Maxfield  <mmaxfield@apple.com>

        Inline ParserUtilities.h
        https://bugs.webkit.org/show_bug.cgi?id=176572

        Reviewed by Darin Adler.

        Its contents are only ever used from SVG files which also include SVGParserUtilities.h.

        No new tests because there is no behavior change.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/text/ParserUtilities.h: Removed.
        * svg/SVGParserUtilities.h:
        (WebCore::skipString):

2017-09-12  Ryosuke Niwa  <rniwa@webkit.org>

        Dragging & dropping a file creates an attachment element even when it's disabled
        https://bugs.webkit.org/show_bug.cgi?id=176769

        Reviewed by Tim Horton.

        The bug that dropping a file always created an attachment element even when it's disabled by settings
        was caused by WebContentReader::readFilenames always creating an attachment element. Fixed this by
        checking the runtime flag. The fix is tested by drag-files-to-editable-element-as-URLs.html

        To fix the bug that HTMLAttachmentElement is always exposed on the global object even when it's disabled
        by settings, replaced the setting to enable attachment element by an equivalent runtime enabled flag,
        and hid both the interface as well as the element behind it. Fixed various bugs in our code generator
        to make this work.

        Tests: editing/pasteboard/drag-files-to-editable-element-as-URLs.html
               editing/pasteboard/drag-files-to-editable-element-as-attachment.html

        * bindings/js/WebCoreBuiltinNames.h: Added symbols used in the generated code.
        * dom/make_event_factory.pl:
        (defaultItemFactory): Replaced "runtimeConditonal" option by "runtimeEnabled".
        (generateImplementation):
        * dom/make_names.pl:
        (defaultTagPropertyHash):
        (printConstructorInterior): Return a HTMLUnknownElement if the element is disabled by a runtime flag.
        (printTypeHelpers): Make is<HTMLAttachmentElement>(~) returns false when the feature is disabled by
        checking whether the given element is an instance of HTMLUnknownElement.
        (printWrapperFunctions): Simplified this code by matching the code for settingsConditional.
        * editing/mac/EditorMac.mm:
        (WebCore::Editor::WebContentReader::readFilenames): Fixed the bug that this code was always creating
        an attachment element even when the feature is disabled.
        * html/HTMLAttachmentElement.idl: Hide this behind a runtime flag.
        * html/HTMLTagNames.in: 
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setAttachmentElementEnabled): Added.
        (WebCore::RuntimeEnabledFeatures::attachmentElementEnabled const): Added.
        * page/Settings.in: Removed attachmentElementEnabled.

2017-09-12  Youenn Fablet  <youenn@apple.com>

        Introduce a RecordData for Cache to efficiently check whether it matches a corresponding request or not
        https://bugs.webkit.org/show_bug.cgi?id=176579

        Reviewed by Alex Christensen.

        No change of behavior.

        Introducing another version of queryCacheMatch used for the NetworkProcess implementation of the Cache.
        Exporting the copy of a response body to be used also there.

        * Modules/cache/DOMCacheEngine.cpp:
        (WebCore::DOMCacheEngine::matchURLs):
        (WebCore::DOMCacheEngine::queryCacheMatch):
        (WebCore::DOMCacheEngine::copyResponseBody):
        * Modules/cache/DOMCacheEngine.h:

2017-09-12  Antti Koivisto  <antti@apple.com>

        AnimationBase should point to Element instead of RenderElement
        https://bugs.webkit.org/show_bug.cgi?id=176807

        Reviewed by Andreas Kling.

        This is a step towards making animation system operate on elements and styles instead renderers.

        No functional changes.

        * page/animation/AnimationBase.cpp:
        (WebCore::AnimationBase::AnimationBase):
        (WebCore::AnimationBase::renderer const):
        (WebCore::AnimationBase::compositedRenderer const):
        (WebCore::AnimationBase::updateStateMachine):
        (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
        (WebCore::AnimationBase::timeToNextService):
        (WebCore::AnimationBase::freezeAtTime):
        (WebCore::AnimationBase::getElapsedTime const):
        * page/animation/AnimationBase.h:
        (WebCore::AnimationBase::clear):
        (WebCore::AnimationBase::renderer const): Deleted.
        * page/animation/ImplicitAnimation.cpp:
        (WebCore::ImplicitAnimation::shouldSendEventForListener const):
        (WebCore::ImplicitAnimation::computeExtentOfTransformAnimation const):
        (WebCore::ImplicitAnimation::startAnimation):
        (WebCore::ImplicitAnimation::pauseAnimation):
        (WebCore::ImplicitAnimation::endAnimation):
        (WebCore::ImplicitAnimation::sendTransitionEvent):
        (WebCore::ImplicitAnimation::reset):
        * page/animation/KeyframeAnimation.cpp:
        (WebCore::KeyframeAnimation::getAnimatedStyle):
        (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
        (WebCore::KeyframeAnimation::startAnimation):
        (WebCore::KeyframeAnimation::pauseAnimation):
        (WebCore::KeyframeAnimation::endAnimation):
        (WebCore::KeyframeAnimation::shouldSendEventForListener const):
        (WebCore::KeyframeAnimation::sendAnimationEvent):
        (WebCore::KeyframeAnimation::resolveKeyframeStyles):

2017-09-12  Per Arne Vollan  <pvollan@apple.com>

        [Win] Add Modules/fetch to list of forwarding headers folders.
        https://bugs.webkit.org/show_bug.cgi?id=176747

        Reviewed by Brent Fulgham.

        * PlatformWin.cmake:

2017-09-12  Jer Noble  <jer.noble@apple.com>

        [MSE] Don't increase the reported totalFrameDelay for non-displayed frames (or frames coming in while paused).
        https://bugs.webkit.org/show_bug.cgi?id=175900

        Reviewed by Eric Carlson.

        When seeking to a specific time, the decompression session necessarily needs to be fed samples from before that
        time (i.e., all samples from the previous I-frame forward). These shouldn't contribute to the "total frame
        delay" metric. Neither should samples delivered when the video is paused (like, during seeking), as a frame can't
        be "late" if time is not moving forward.

        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
        * platform/cf/CoreMediaSoftLink.cpp:
        * platform/cf/CoreMediaSoftLink.h:

2017-09-12  Sam Weinig  <sam@webkit.org>

        Gtk build fix for "Finish off the FormData implementation" - https://bugs.webkit.org/show_bug.cgi?id=176659

        * fileapi/Blob.cpp:
        (WebCore::Blob::Blob):
        * fileapi/Blob.h:
        * fileapi/File.cpp:
        (WebCore::File::File):
        
            Replace copy constructor with a tagged constructor.

2017-09-12  Dean Jackson  <dino@apple.com>

        [WebGL] VideoTextureCopierCV doesn't correctly restore vertex attribute state
        https://bugs.webkit.org/show_bug.cgi?id=176771
        <rdar://problem/34386621>

        Reviewed by Antoine Quint.

        The OpenGL context in VideoTextureCopierCV wasn't being restored to
        the state it had before rendering a video to a texture. Specifically
        the vertex attribute values were never recorded by the state saver.

        Update the existing test of VideoTextureCopierCV so that it is
        explicitly doing something different from the WebCore code, which
        means that state will have to be correctly restored for the test
        to pass.

        * platform/graphics/cv/VideoTextureCopierCV.cpp:
        (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Make sure
        to record the vertex attribute state once we know the location of the position attribute.
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver):
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::saveVertexAttribState): Save all the
        applicable vertex attribute state information.
        * platform/graphics/cv/VideoTextureCopierCV.h: GC3DStateSaver can use a reference
        to the GC3D rather than a pointer.

2017-09-12  Dean Jackson  <dino@apple.com>

        [WebGL] accelerated texImage2D for video doesn't respect flipY
        https://bugs.webkit.org/show_bug.cgi?id=176491
        <rdar://problem/33833511>

        Reviewed by Jer Noble.

        (Take 2 - this was rolled out due to a test failure, but the following
        commit will fix that)

        Previously, if UNPACK_FLIP_Y_WEBGL was set to true, we'd either fall
        back to software or fail to upload texture data. Fix this by intercepting
        the texImage2D call, checking the orientation of the video, and running
        a small shader program to flip it if necessary.

        While there, implement UNPACK_PREMULTIPLY_ALPHA_WEBGL as well, although
        none of our media decoders support video with alpha, so unfortunately
        this will have no visible change.

        Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
               fast/canvas/webgl/texImage2D-video-flipY-true.html

        * platform/cocoa/CoreVideoSoftLink.cpp: Add link to CVOpenGL(ES)TextureGetCleanTexCoords,
        which is used to check the orientation of the source video.
        * platform/cocoa/CoreVideoSoftLink.h:

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): We can
        now handle flipped or premultiplied requests.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): Ditto.

        * platform/graphics/cv/VideoTextureCopierCV.cpp:
        (WebCore::VideoTextureCopierCV::VideoTextureCopierCV): Rename readFramebuffer to
        simply framebuffer.
        (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV): Delete the program and buffer
        if they were created.
        (WebCore::VideoTextureCopierCV::initializeContextObjects): Sets up the shader program
        and the vertex buffer for drawing. Also records the location of the uniforms.
        (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Create a new
        framebuffer object, and render the video texture into that framebuffer using a
        shader that can flip the coordinates.
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver): Helper to restore
        the state of the user's GraphicsContext3D while we're intercepting calls.
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
        * platform/graphics/cv/VideoTextureCopierCV.h:

        * platform/graphics/GraphicsContext3D.h: Add two new entry points, for direct shader
        compilation and attribute access. This avoids going through ANGLE.
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::compileShader):
        (WebCore::GraphicsContext3D::compileShaderDirect):
        (WebCore::GraphicsContext3D::getAttribLocationDirect):

2017-09-12  Manuel Rego Casasnovas  <rego@igalia.com>

        [css-grid] Stretching auto tracks should be done as part of the track sizing algorithm
        https://bugs.webkit.org/show_bug.cgi?id=176783

        Reviewed by Sergio Villar Senin.

        CSS WG has agreed to modify the track sizing algorithm to include
        a new step: https://drafts.csswg.org/css-grid/#algo-stretch
        We used to do the stretch of the "auto" tracks at the end of
        the track sizing algorithm, however this change integrates it
        into the algorithm itself as the last step.
        See: https://github.com/w3c/csswg-drafts/issues/1150

        The patch moves the method
        RenderGrid::applyStretchAlignmentToTracksIfNeeded() to
        GridTrackSizingAlgorithm::stretchAutoTracks().
        And then modifies the grid track sizing algorithm to execute
        the new step.

        This patch uses the WPT test updated to check the new behavior.

        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes): Initialize
        the list of auto tracks.
        (WebCore::GridTrackSizingAlgorithm::stretchFlexibleTracks): Add
        early return if there are not flexible tracks.
        (WebCore::GridTrackSizingAlgorithm::stretchAutoTracks): Code moved from
        RenderGrid::applyStretchAlignmentToTracksIfNeeded().
        (WebCore::GridTrackSizingAlgorithm::setup): Reset list of auto tracks.
        (WebCore::GridTrackSizingAlgorithm::run): Add new step
        stretchAutoTracks().
        (WebCore::GridTrackSizingAlgorithm::reset): Reset auto tracks.
        * rendering/GridTrackSizingAlgorithm.h: Add m_autoSizedTracksIndex.
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::layoutBlock): Avoid applying stretch here.
        (WebCore::RenderGrid::contentAlignmentNormalBehaviorGrid): Make public.
        (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): Moved to
        GridTrackSizingAlgorithm::stretchAutoTracks().
        * rendering/RenderGrid.h:

2017-09-12  Eric Carlson  <eric.carlson@apple.com>

        Switch MediaPlayerPrivateAVFoundation to release logging
        https://bugs.webkit.org/show_bug.cgi?id=176621
        <rdar://problem/34335311>

        Reviewed by Jer Noble.

        * html/HTMLMediaElement.h:
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::nullLogger):
        (WebCore::MediaPlayer::mediaPlayerLogger):
        * platform/graphics/MediaPlayer.h:
        (WebCore::MediaPlayerClient::mediaPlayerLogIdentifier):
        (WebCore::MediaPlayerClient::mediaPlayerLogger):
        (WebCore::MediaPlayer::mediaPlayerLogIdentifier):
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
        (WebCore::MediaPlayerPrivateAVFoundation::~MediaPlayerPrivateAVFoundation):
        (WebCore::MediaPlayerPrivateAVFoundation::setUpVideoRendering):
        (WebCore::MediaPlayerPrivateAVFoundation::tearDownVideoRendering):
        (WebCore::MediaPlayerPrivateAVFoundation::load):
        (WebCore::MediaPlayerPrivateAVFoundation::playabilityKnown):
        (WebCore::MediaPlayerPrivateAVFoundation::prepareToPlay):
        (WebCore::MediaPlayerPrivateAVFoundation::play):
        (WebCore::MediaPlayerPrivateAVFoundation::pause):
        (WebCore::MediaPlayerPrivateAVFoundation::durationMediaTime const):
        (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance):
        (WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize):
        (WebCore::MediaPlayerPrivateAVFoundation::maxMediaTimeSeekable const):
        (WebCore::MediaPlayerPrivateAVFoundation::minMediaTimeSeekable const):
        (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
        (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
        (WebCore::MediaPlayerPrivateAVFoundation::timeChanged):
        (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted):
        (WebCore::MediaPlayerPrivateAVFoundation::invalidateCachedDuration):
        (WebCore::MediaPlayerPrivateAVFoundation::setPreload):
        (WebCore::MediaPlayerPrivateAVFoundation::mainThreadCallback):
        (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
        (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
        (WebCore::MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks):
        (WebCore::MediaPlayerPrivateAVFoundation::logChannel const):
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
        (WebCore::MediaPlayerPrivateAVFoundation::logClassName const):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyImageGenerator):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMedia const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformDuration const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoOutput):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createOpenGLVideoOutput):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyOpenGLVideoOutput):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
        (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
        (WebCore::boolString): Deleted.

2017-09-12  Daniel Bates  <dabates@apple.com>

        REGRESSION (r215784): The title of right-to-left pages are empty
        https://bugs.webkit.org/show_bug.cgi?id=176746
        <rdar://problem/34211419>

        Reviewed by Brent Fulgham.

        Left truncate a long right-to-left title.

        Right-to-left text represents the visual ordering of text. Internally WebKit stores
        right-to-left text identically to left-to-right text in memory. So, we can use the
        same string operation to truncate right-to-left text as we do to truncate left-to-right
        text.

        * platform/text/StringWithDirection.h:
        (WebCore::truncateFromEnd):

2017-09-12  Chris Fleizach  <cfleizach@apple.com>

        AX: On generic container elements, WebKit should distinguish between tooltip (e.g. @title) and label (e.g. @aria-label) attributes
        https://bugs.webkit.org/show_bug.cgi?id=170475
        <rdar://problem/31439222>

        Reviewed by Joanmarie Diggs.

        Test: accessibility/title-tag-on-unimportant-elements-is-help-text.html

        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::helpText):
        (WebCore::AccessibilityNodeObject::accessibilityDescription):
        (WebCore::AccessibilityNodeObject::roleIgnoresTitle):
        * accessibility/AccessibilityNodeObject.h:

2017-09-12  Brent Fulgham  <bfulgham@apple.com>

        Show punycode to user if a URL mixes Armenian Seh or Vo with other scripts
        https://bugs.webkit.org/show_bug.cgi?id=176578
        <rdar://problem/33906231>

        Reviewed by Alex Christensen.

        Revise our "lookalike character" logic to include the Armenian Vo and Seh
        characters, which can be mistaken for 'n' and 'v' when displayed in
        certain fonts.

        Tested by new API tests.

        * platform/mac/WebCoreNSURLExtras.mm:
        (WebCore::isArmenianLookalikeCharacter): Added utility function.
        (WebCore::isArmenianScriptCharacter): Ditto.
        (WebCore::isLookalikeCharacter): Handle Armenian-lookalike cases.

2017-09-12  Antti Koivisto  <antti@apple.com>

        Remove RenderElement::isCSSAnimating boolean
        https://bugs.webkit.org/show_bug.cgi?id=176779

        Reviewed by Andreas Kling.

        This optimization can be replaced with a simple style test that doesn't require keeping
        two sources of truth in sync.

        * page/animation/CSSAnimationController.cpp:
        (WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
        (WebCore::CSSAnimationControllerPrivate::clear):

            Can't test here as style might have become non-animating and we don't clear animation when that happens.
            This is only called on renderer destruction so it is not an important optimization.

        (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
        (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
        (WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer):
        (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
        (WebCore::CSSAnimationController::cancelAnimations):
        (WebCore::CSSAnimationController::getAnimatedStyleForRenderer):
        (WebCore::CSSAnimationController::computeExtentOfAnimation const):
        (WebCore::CSSAnimationController::isRunningAnimationOnRenderer const):
        (WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const):

            Test if the style has any animations. This is roughly equivalent of the old test.
            (it is actually somewhat better as the boolean was never cleared on style changes)

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::RenderElement):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::isCSSAnimating const): Deleted.
        (WebCore::RenderElement::setIsCSSAnimating): Deleted.
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::hasAnimationsOrTransitions const):

2017-09-12  Ms2ger  <Ms2ger@igalia.com>

        Disallow passing null data to uniform1uiv() and friends.
        https://bugs.webkit.org/show_bug.cgi?id=176777

        Reviewed by Sam Weinig.

        This matches the specification as well as Gecko and Chromium.

        Test: fast/canvas/webgl/webgl2/bindings.html

        * html/canvas/WebGL2RenderingContext.idl:

2017-09-12  Sam Weinig  <sam@webkit.org>

        [Cleanup] Follow up cleanup for DOMFormData implementation
        https://bugs.webkit.org/show_bug.cgi?id=176740

        Reviewed by Alex Christensen.

        - Merges FormDataList into DOMFormData.
        - Streamline / refactor FormData creation from DOMFormData.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * html/FormDataList.cpp: Removed.
        * html/FormDataList.h: Removed.

            Remove FormDataList.

        * html/DOMFormData.cpp:
        (WebCore::DOMFormData::DOMFormData):
        (WebCore::DOMFormData::createFileEntry):
        (WebCore::DOMFormData::append):
        (WebCore::DOMFormData::set):
        (WebCore::DOMFormData::Iterator::next):
        * html/DOMFormData.h:
        (WebCore::DOMFormData::items const):
        (WebCore::DOMFormData::encoding const):

            Merge FormDataList into DOMFormData. FormDataList's additional
            appendData/appendBlob functions have been removed, and their
            functionality inlined into DOMFormData's append functions. 

            Adopted makeKeyValuePair in DOMFormData::Iterator::next().

        * platform/network/FormData.cpp:
        (WebCore::FormData::create):
        (WebCore::FormData::createMultiPart):
        (WebCore::normalizeStringData):
        (WebCore::FormData::appendMultiPartFileValue):
        (WebCore::FormData::appendMultiPartStringValue):
        (WebCore::FormData::appendMultiPartKeyValuePairItems):
        (WebCore::FormData::appendNonMultiPartKeyValuePairItems):
        (WebCore::FormData::appendKeyValuePairItems): Deleted.
        * platform/network/FormData.h:

            Split-up appendKeyValuePairItems into separate multipart and non-multipart
            functions, as the two edges of the branch didn't share much in common. Further
            split out multipart file and multipart string appending, since they too did not
            share that much in common and makes the code easier to follow. 

            String value normalization has been moved entirely here (previously it was a member 
            function of FormDataList) as FormData is the only user.

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::send):
        * loader/FormSubmission.cpp:
        (WebCore::FormSubmission::create):
        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::extract):
        
            Update for new FormData create functions which don't need the
            encoding passed explicitly, since it is part of the DOMFormData.
        
        * html/BaseButtonInputType.cpp:
        * html/BaseButtonInputType.h:
        * html/BaseCheckableInputType.cpp:
        * html/BaseCheckableInputType.h:
        * html/FileInputType.cpp:
        * html/FileInputType.h:
        * html/FormAssociatedElement.h:
        * html/HTMLButtonElement.cpp:
        * html/HTMLButtonElement.h:
        * html/HTMLFormControlElement.h:
        * html/HTMLInputElement.cpp:
        * html/HTMLInputElement.h:
        * html/HTMLKeygenElement.cpp:
        * html/HTMLKeygenElement.h:
        * html/HTMLMeterElement.cpp:
        * html/HTMLObjectElement.cpp:
        * html/HTMLObjectElement.h:
        * html/HTMLSelectElement.cpp:
        * html/HTMLSelectElement.h:
        * html/HTMLTextAreaElement.cpp:
        * html/HTMLTextAreaElement.h:
        * html/HiddenInputType.cpp:
        * html/HiddenInputType.h:
        * html/ImageInputType.cpp:
        * html/ImageInputType.h:
        * html/InputType.cpp:
        * html/InputType.h:
        * html/SubmitInputType.cpp:
        * html/SubmitInputType.h:
        * html/TextFieldInputType.cpp:
        * html/TextFieldInputType.h:

            Update to use DOMFormData directly, rather than the FormDataList, which 
            has been removed.

        * page/csp/ContentSecurityPolicy.cpp:

            Remove unnecessary #include of unused (and now removed) FormDataList.h

2017-09-12  Zan Dobersek  <zdobersek@igalia.com>

        [EME] Implement CDMInstanceClearKey::requestLicense()
        https://bugs.webkit.org/show_bug.cgi?id=176773

        Reviewed by Xabier Rodriguez-Calvar.

        Implement the requestLicense() method for CDMInstanceClearKey. Per
        the specification, the session ID must be a 32-bit numerical value.
        A session ID value counter is thus kept in a static uint32_ object
        and incremented upon each call of requestLicense(). Init data and
        the session ID value are then embedded in the asynchronous dispatch
        that invokes the callback. That invocation now also passes along the
        init data, the session ID in string format, and Succeeded to now
        indicate the operation was completed successfully.

        No new tests -- expectations for the relevant tests are updated
        to reflect the introduced changes.

        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::CDMInstanceClearKey::requestLicense):

2017-09-12  Manuel Rego Casasnovas  <rego@igalia.com>

        [css-grid] Use transferred size over content size for automatic minimum size
        https://bugs.webkit.org/show_bug.cgi?id=176688

        Reviewed by Sergio Villar Senin.

        CSS WG has agreed to modify the spec so now the transferred size is used
        (if it exists) independently if it's bigger or smaller
        than the content size.
        See: https://github.com/w3c/csswg-drafts/issues/1149

        The spec text (https://drafts.csswg.org/css-grid/#min-size-auto):
          "The automatic minimum size for a grid item in a given dimension is
           its specified size if it exists, otherwise its transferred size
           if that exists, else its content size"

        This patch use the WPT tests updated to check the new behavior.

        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
        Modified so it always returns the transferred size (if any).

2017-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Freetype] Doesn't support coloured fonts
        https://bugs.webkit.org/show_bug.cgi?id=156579

        Reviewed by Michael Catanzaro.

        Covered by existing tests. This needs a large rebaseline that will be done in follow up commits.

        * platform/graphics/FontCascade.h: Enable advance text rendering mode by default.
        (WebCore::FontCascade::advancedTextRenderingMode const):
        (WebCore::FontCascade::computeRequiresShaping const):
        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
        (WebCore::Font::platformInit): Do not get metrics from OS/2 table for non-scalable fonts.
        * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
        (WebCore::harfBuzzGetGlyph): Use U8_APPEND_UNSAFE() instead of converting to a String and then encoding it with
        UTF8Encoding().

2017-09-12  Frederic Wang  <fwang@igalia.com>

        Remove unnecessary virtual keyword from JS test files
        https://bugs.webkit.org/show_bug.cgi?id=176683

        Reviewed by Simon Fraser.

        JS bindings headers do not comply with the WebKit coding style since they use both the
        "virtual" and "override" keywords. This patch modifies the generator script to only use
        "override" and regenerates the bindings accordingly.

        No new tests, behavior unchanged.

        * bindings/scripts/CodeGeneratorJS.pm:
        * bindings/scripts/test/JS/JSTestCallbackFunction.h:
        * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h:
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h:
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
        * bindings/scripts/test/JS/JSTestCallbackInterface.h:
        * bindings/scripts/test/JS/JSTestVoidCallbackFunction.h:

2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS DnD] Support DataTransfer.setDragImage when starting a drag on iOS
        https://bugs.webkit.org/show_bug.cgi?id=176721
        <rdar://problem/34373660>

        Reviewed by Tim Horton.

        Adds support for setting the drag lift preview frame in the case where DataTransfer.setDragImage is being used
        to override the default drag preview. Currently, the frame of the drag preview we supply in this case is the
        same as the bounds of the source element in root view coordinates, but this means that any custom drag image
        the page supplies will be stretched to fill the frame of the source element. Instead, when handling a DHTML drag,
        position the lift and cancel drag previews relative to the event location, respecting any drag offset specified
        in setDragImage. The size of this preview matches the size of the drag image source (since this is all in root
        view coordinates, this means the drag preview will also enlarge if the user pinches to zoom in). If a
        disconnected image source element was provided, then we just fall back to the image size.

        Additionally, renames DragItem's elementBounds to dragPreviewFrameInRootViewCoordinates to better reflect the
        purpose of this variable. This patch also introduces API test plumbing to grab targeted drag previews from the
        drag interaction delegate (i.e. WKContentView), and uses this in a new API test that checks the frame of the
        resulting UITargetedDragPreview after initiating a drag in various circumstances (see changes in Tools/ for more
        detail).

        Test: DataInteractionTests.DragLiftPreviewDataTransferSetDragImage

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::dragImageElement const):
        * dom/DataTransfer.h:
        * page/DragController.cpp:
        (WebCore::dragLocForDHTMLDrag):

        The logic to flip the y offset when computing the drag location is only relevant on Mac, but currently, this is
        guarded by #if PLATFORM(COCOA), which causes the y offset to shift the drag image in the opposite direction on
        iOS. To fix this, simply change the platform define to Mac.

        (WebCore::DragController::doSystemDrag):
        * platform/DragItem.h:
        (WebCore::DragItem::encode const):
        (WebCore::DragItem::decode):

2017-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS WK2] Support tapping to add items to the current drag session in web content
        https://bugs.webkit.org/show_bug.cgi?id=176421
        <rdar://problem/31144674>

        Reviewed by Tim Horton.

        Refactors some drag initiation logic to handle starting a drag when data has already been written to the
        pasteboard (in the case of iOS, WebItemProviderPasteboard). See annotated comments below for more detail.

        Tests: DataInteractionTests.AdditionalLinkAndImageIntoContentEditable

        * page/DragActions.h:
        * page/DragController.cpp:
        (WebCore::DragController::startDrag):

        Add a HasNonDefaultPasteboardData argument here, and replace checks for !dataTransfer.pasteboard().hasData()
        with checks for whether the argument is HasNonDefaultPasteboardData::No. These checks for Pasteboard::hasData()
        currently prevent us from overwriting custom pasteboard data, in the case that the page has written pasteboard
        data using the event's DataTransfer. However, in the case of adding additional drag items to the session, we
        will already have pasteboard data, so these checks will prevent us from writing default data to the pasteboard.
        See EventHandler::handleDrag for more detail.

        * page/DragController.h:
        * page/DragState.h:

        Remove the draggedContentRange member from DragState. See below.

        * page/EventHandler.cpp:
        (WebCore::removeDraggedContentDocumentMarkersFromAllFramesInPage):

        Simplify the handling of dragged content range markers. Instead of storing the DOM Range being dragged and
        removing/repainting the range after dragging ends, just repaint the contentRenderer of the frame being dragged.
        When the dragging session has completely ended, remove all dragged content ranges from the page's mainframe and
        all of its subframes, and repaint everything.

        (WebCore::EventHandler::dragCancelled):
        (WebCore::EventHandler::didStartDrag):
        (WebCore::EventHandler::dragSourceEndedAt):

        Add a MayExtendDragSession argument, indicating whether or not the web process will attempt to continue the drag
        session, in which case EventHandler::dragSourceEndedAt should not remove any existing dragged content range
        document markers.

        (WebCore::EventHandler::dispatchDragStartEvent):

        Helper method to dispatch a `dragstart` event, return whether or not to proceed with the drag, and also compute
        (as an outparam) whether or not custom pasteboard data was written during the event.

        (WebCore::EventHandler::handleDrag):

        If custom data was written during `dragstart`, pass along HasNonDefaultPasteboardData::Yes when calling
        DragController::startDrag.

        (WebCore::repaintContentsOfRange): Deleted.
        * page/EventHandler.h:
        * page/ios/EventHandlerIOS.mm:
        (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
        * platform/Pasteboard.h:
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::changeCount const):
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard setItemProviders:]):

        Stop clearing out the staged item provider registration list when setting item providers. After refactoring in
        r221595, staged registration lists are now automatically cleared out when (1) the drag-and-drop interaction
        state is cleared out in the UI process, or (2) when the registration list is taken by WKContentView (see
        -takeRegistrationList) when generating an item provider.

        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::changeCount const):

        Add a changeCount method to Pasteboard on Cocoa platforms (Mac, iOS) which support changeCount natively. In
        theory, there's no reason Windows, GTK and WPE ports can't also implement a similar mechanism in
        PlatformPasteboard, but this isn't needed for anything yet. Upon dragstart, it is safe to assume that the
        pasteboard has been cleared on these platforms, so checking for Pasteboard::hasData (as we do for all platforms
        currently) is sufficient.

2017-09-11  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r221762.

        This change caused flakiness in a webgl LayoutTest.

        Reverted changeset:

        "[WebGL] accelerated texImage2D for video doesn't respect
        flipY"
        https://bugs.webkit.org/show_bug.cgi?id=176491
        http://trac.webkit.org/changeset/221762

2017-09-11  Per Arne Vollan  <pvollan@apple.com>

        [Win] Add Modules/cache to list of forwarding headers folders.
        https://bugs.webkit.org/show_bug.cgi?id=176737

        Reviewed by Alex Christensen.

        * PlatformWin.cmake:

2017-09-11  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [ATK] aria-autocomplete not exposed on comboboxes
        https://bugs.webkit.org/show_bug.cgi?id=176724

        Reviewed by Chris Fleizach.

        Add a check to AccessibilityObject::supportsARIAAutoComplete() for
        combobox because isARIATextControl() returns false for that role.

        Add new combobox test cases to existing aria-autocomplete.html test.

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::supportsARIAAutoComplete const):

2017-09-11  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r221854.

        The test added with this change fails on 32-bit JSC bots.

        Reverted changeset:

        "[DFG] Optimize WeakMap::get by adding intrinsic and fixup"
        https://bugs.webkit.org/show_bug.cgi?id=176010
        http://trac.webkit.org/changeset/221854

2017-09-11  Dean Jackson  <dino@apple.com>

        [WebGL macOS] No need to multisample when blitting into WebGLLayer
        https://bugs.webkit.org/show_bug.cgi?id=176666
        <rdar://problem/27774626>

        Reviewed by Sam Weinig.

        We were seeing performance profiles suggesting WebGL was
        doing 8x MSAA, even though we explicitly set it to only
        use 4 samples in the GLPixelFormatObj used to create
        the WebGL CGLContextObj. However, that same CGLPixelFormatObj
        was also used for the WebGLLayer's CGLContextObj, meaning the
        blit of the WebGL FBO into the WebGLLayer's backing store was
        multisampling as well -- so an extra 4 samples on top of the
        original 4, making it look like we were doing 8x.

        This was obviously unnecessary, since we already have the
        multisampled FBO and just want to copy it, as is, into the layer.

        Now, instead of copying the CGLPixelFormatObj, we create
        a new one and copy most of the attributes, leaving out
        the multisample flags (and the depth buffer, since we're
        only doing 2d blits).

        Covered by existing WebGL tests, since there should be no
        visible change.

        * platform/graphics/cocoa/WebGLLayer.mm:
        (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]): Create a new
        CGLPixelFormatObj that copies most of the values from
        the corresponding object on the WebGL's backing CGLContextObj.

2017-09-11  Zan Dobersek  <zdobersek@igalia.com>

        [EME] ClearKey: implement CDMInstanceClearKey state modifiers, callback dispatches
        https://bugs.webkit.org/show_bug.cgi?id=176687

        Reviewed by Xabier Rodriguez-Calvar.

        Implement the state modification methods on the CDMInstanceClearKey class.
        Initialization method is a no-op, but returns Succeeded. Distinctive
        identifier and persistent state setters return Succeeded if the passed-in
        value is false. setServerCertificate() still returns Failed due to server
        certificates not being supported in this ClearKey implementation.

        The license and session operation methods are also implemented, but for
        now the implementations simply schedule a main thread dispatch that
        invokes the callback with failure-indicating values. This avoids various
        tests timing out, instead preferring that the tests for now fail with an
        exception (in most cases NotSupportedError).

        No new tests -- relevant tests have baselines updated.

        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::CDMInstanceClearKey::CDMInstanceClearKey):
        (WebCore::CDMInstanceClearKey::initializeWithConfiguration):
        (WebCore::CDMInstanceClearKey::setDistinctiveIdentifiersAllowed):
        (WebCore::CDMInstanceClearKey::setPersistentStateAllowed):
        (WebCore::CDMInstanceClearKey::setServerCertificate):
        (WebCore::CDMInstanceClearKey::requestLicense):
        (WebCore::CDMInstanceClearKey::updateLicense):
        (WebCore::CDMInstanceClearKey::loadSession):
        (WebCore::CDMInstanceClearKey::closeSession):
        (WebCore::CDMInstanceClearKey::removeSessionData):
        * platform/encryptedmedia/clearkey/CDMClearKey.h:

2017-09-11  Alex Christensen  <achristensen@webkit.org>

        Modernize BoxExtent into RectEdges
        https://bugs.webkit.org/show_bug.cgi?id=176437

        Reviewed by Simon Fraser.

        And give it its own header.
        No change in behavior.

        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSProperty.cpp:
        (WebCore::resolveToPhysicalProperty):
        (WebCore::CSSProperty::resolveDirectionAwareProperty):
        * platform/LengthBox.h:
        (WebCore::LengthBox::LengthBox):
        (WebCore::BoxExtent::BoxExtent): Deleted.
        (WebCore::BoxExtent::at): Deleted.
        (WebCore::BoxExtent::top): Deleted.
        (WebCore::BoxExtent::right): Deleted.
        (WebCore::BoxExtent::bottom): Deleted.
        (WebCore::BoxExtent::left): Deleted.
        (WebCore::BoxExtent::at const): Deleted.
        (WebCore::BoxExtent::top const): Deleted.
        (WebCore::BoxExtent::right const): Deleted.
        (WebCore::BoxExtent::bottom const): Deleted.
        (WebCore::BoxExtent::left const): Deleted.
        (WebCore::BoxExtent::setAt): Deleted.
        (WebCore::BoxExtent::setTop): Deleted.
        (WebCore::BoxExtent::setRight): Deleted.
        (WebCore::BoxExtent::setBottom): Deleted.
        (WebCore::BoxExtent::setLeft): Deleted.
        (WebCore::BoxExtent::before): Deleted.
        (WebCore::BoxExtent::after): Deleted.
        (WebCore::BoxExtent::start): Deleted.
        (WebCore::BoxExtent::end): Deleted.
        (WebCore::BoxExtent::before const): Deleted.
        (WebCore::BoxExtent::after const): Deleted.
        (WebCore::BoxExtent::start const): Deleted.
        (WebCore::BoxExtent::end const): Deleted.
        (WebCore::BoxExtent::setBefore): Deleted.
        (WebCore::BoxExtent::setAfter): Deleted.
        (WebCore::BoxExtent::setStart): Deleted.
        (WebCore::BoxExtent::setEnd): Deleted.
        (WebCore::BoxExtent::operator== const): Deleted.
        (WebCore::BoxExtent::operator!= const): Deleted.
        * platform/RectEdges.h: Added.
        (WebCore::RectEdges::RectEdges):
        (WebCore::RectEdges::at):
        (WebCore::RectEdges::top):
        (WebCore::RectEdges::right):
        (WebCore::RectEdges::bottom):
        (WebCore::RectEdges::left):
        (WebCore::RectEdges::at const):
        (WebCore::RectEdges::top const):
        (WebCore::RectEdges::right const):
        (WebCore::RectEdges::bottom const):
        (WebCore::RectEdges::left const):
        (WebCore::RectEdges::setAt):
        (WebCore::RectEdges::setTop):
        (WebCore::RectEdges::setRight):
        (WebCore::RectEdges::setBottom):
        (WebCore::RectEdges::setLeft):
        (WebCore::RectEdges::before):
        (WebCore::RectEdges::after):
        (WebCore::RectEdges::start):
        (WebCore::RectEdges::end):
        (WebCore::RectEdges::before const):
        (WebCore::RectEdges::after const):
        (WebCore::RectEdges::start const):
        (WebCore::RectEdges::end const):
        (WebCore::RectEdges::setBefore):
        (WebCore::RectEdges::setAfter):
        (WebCore::RectEdges::setStart):
        (WebCore::RectEdges::setEnd):
        (WebCore::RectEdges::operator== const):
        (WebCore::RectEdges::operator!= const):
        * platform/graphics/ca/TileController.cpp:
        (WebCore::TileController::setHasMargins):
        * platform/graphics/ca/TileController.h:
        * platform/text/WritingMode.h:
        (WebCore::isHorizontalPhysicalSide):
        * rendering/style/NinePieceImage.cpp:
        (WebCore::NinePieceImage::isEmptyPieceRect):
        * rendering/style/NinePieceImage.h:
        (WebCore::imagePieceHorizontalSide):
        (WebCore::imagePieceVerticalSide):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::getShadowInsetExtent const):

2017-09-11  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        [WinCairo] Fix the wincairo build after r221839
        https://bugs.webkit.org/show_bug.cgi?id=176681

        Reviewed by Per Arne Vollan.

        * platform/network/curl/ResourceHandleCurlDelegate.cpp:
        (WebCore::ResourceHandleCurlDelegate::setupPOST):

2017-09-11  Andy Estes  <aestes@apple.com>

        [Mac] Upstream QTKit-related WebKitSystemInterface functions
        https://bugs.webkit.org/show_bug.cgi?id=176472

        Reviewed by Eric Carlson.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::disableComponentsOnce):
        (WebCore::MediaPlayerPrivateQTKit::createQTMovie):
        (WebCore::MediaPlayerPrivateQTKit::hasClosedCaptions const):
        (WebCore::MediaPlayerPrivateQTKit::setClosedCaptionsVisible):
        (WebCore::selectPreferredAlternateTrackForMediaType):
        (WebCore::selectPreferredAlternates):
        (WebCore::MediaPlayerPrivateQTKit::updateStates):
        (WebCore::mimeModernTypesCache):
        (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache):
        (WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
        (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins):
        (WebCore::MediaPlayerPrivateQTKit::hasSingleSecurityOrigin const):
        (WebCore::MediaPlayerPrivateQTKit::movieLoadType const):
        (WebCore::MediaPlayerPrivateQTKit::canSaveMediaData const):
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:
        * platform/mac/WebVideoFullscreenHUDWindowController.mm:
        (createMediaUIControl):
        (createControlWithMediaUIControlType):
        (createMediaUIBackgroundView):
        (-[WebVideoFullscreenHUDWindowController windowDidLoad]):

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

        Try to fix the Internal El Capitan build after r221773.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::mimeModernTypesCache):

2017-09-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [WPE] Bump freetype version to 2.8.0
        https://bugs.webkit.org/show_bug.cgi?id=176501

        Reviewed by Michael Catanzaro.

        Enable back the changes done by r221670 that were disabled for WPE on r221719.

        Covered by existing tests.

        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
        (WebCore::scaledFontWithoutMetricsHinting):
        (WebCore::Font::platformInit):

2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>

        [DFG] Optimize WeakMap::get by adding intrinsic and fixup
        https://bugs.webkit.org/show_bug.cgi?id=176010

        Reviewed by Filip Pizlo.

        * platform/network/curl/CurlJobManager.cpp:
        (WebCore::CurlJobList::finishJobs):

2017-09-10  Zan Dobersek  <zdobersek@igalia.com>

        [GStreamer] Drop libgcrypt initialization in webkit_media_clear_key_decrypt_init()
        https://bugs.webkit.org/show_bug.cgi?id=176656

        Reviewed by Michael Catanzaro.

        * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
        (webkit_media_clear_key_decrypt_init): Don't re-initialize libgcrypt here
        since that's already done in the WebProcess main(), and the calls here
        only result in libgcrypt writing out 'Oops' warnings on stderr.

2017-09-10  Mark Lam  <mark.lam@apple.com>

        Fix all ExceptionScope verification failures in JavaScriptCore.
        https://bugs.webkit.org/show_bug.cgi?id=176662
        <rdar://problem/34352085>

        Reviewed by Filip Pizlo.

        No new tests because this is covered by existing tests with the JSC_validateExceptionChecks=true enabled.

        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::tryToConstructCustomElement):
        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::whenDefinedPromise):
        * bindings/js/JSDOMConvertRecord.h:
        * bindings/js/JSDOMMapLike.cpp:
        (WebCore::createBackingMap):
        * bindings/js/JSDOMPromiseDeferred.cpp:
        (WebCore::DeferredPromise::callFunction):
        (WebCore::DeferredPromise::reject):
        * bindings/js/JSDOMPromiseDeferred.h:
        (WebCore::callPromiseFunction):

2017-09-10  Frederic Wang  <fwang@igalia.coml>

        Make RenderLayerCompositor always use isRootLayer()
        https://bugs.webkit.org/show_bug.cgi?id=176591

        Reviewed by Darin Adler.

        RenderLayerCompositor contains a few comparisons of the form &layer == m_renderView.layer().
        This patch replaces them with "layer.isRootLayer()" which simply verifies that "layer" is
        associated to the one (and only one) RenderView of the RenderLayerCompositor. It makes things
        more readable and more consistent with the rest of the file.

        No new tests, behavior unchanged.

        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
        (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

2017-09-09  Sam Weinig  <sam@webkit.org>

        Finish off the FormData implementation
        https://bugs.webkit.org/show_bug.cgi?id=176659

        Reviewed by Darin Adler.

        * fileapi/Blob.cpp:
        * fileapi/Blob.h:
        * fileapi/File.cpp:
        * fileapi/File.h:

            Add constructors / create functions for making File objects
            from an existing Blob or File with an override name.

        * html/DOMFormData.cpp:
        * html/DOMFormData.h:

            Add missing operations and iterator implementation
            and bring append up to spec by no ignoring empty names.

        * html/DOMFormData.idl:

            Bring IDL up to spec. Leave its exposure to just the window for
            now, as FormData currently depends on the Document/Page for replace
            file generation and therefore cannot operate in a worker.

        * html/FormDataList.cpp:
        * html/FormDataList.h:

            Changes FormDataList::Item to a String key and Variant<RefPtr<File>, String>
            data, matching spec concepts more cleanly. Normalization / encoding has also
            been made lazy, and now does not happen until creating a FormData from the
            FormDataList.

            Since we now store Files, rather than Blobs, we follow the spec's 'create an 
            entry' algorithm to convert Blobs into Files with the same backing bytes. This
            was previously done as part of FormData::appendKeyValuePairItems.

        * html/HTMLKeygenElement.cpp:
        (WebCore::HTMLKeygenElement::appendFormData):

            Remove unnecessary conversion to utf8, the data is base64 encoded, allowing
            us to remove an overload of appendData that took a CString.

        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::buildObjectForResourceRequest):

            Update for new signature of FormData::flatten() which now
            returns a Vector, rather than takes one in.

        * platform/network/FormData.h:
        * platform/network/FormData.cpp:
        (WebCore::FormData::FormData):
        (WebCore::FormData::create):
        (WebCore::FormData::createMultiPart):
        
            Cleanup redundancy by using auto.
        
        (WebCore::FormData::appendKeyValuePairItems):
        
            Updated to handle new FormDataList item format (e.g. pairs of key / data) allowing
            us to remove two-by-two iteration. Some complexity was removed around Blobs, as
            FormDataList now always creates File. 

            Since FormDataList no longer eagerly encodes / normalizes the keys and string data
            values, we now perform those operations here.
        
        (WebCore::FormData::expandDataStore):
        (WebCore::appendBlobResolved):
        (WebCore::FormData::resolveBlobReferences):
        (WebCore::FormData::generateFiles):
        (WebCore::FormData::hasGeneratedFiles const):
        (WebCore::FormData::hasOwnedGeneratedFiles const):
        (WebCore::FormData::removeGeneratedFilesIfNeeded):

            Adopt auto and modern for-in loops.

        (WebCore::FormData::flatten const):
        (WebCore::FormData::flattenToString const):

            Update flatten to return a Vector, rather than take it in.

2017-09-10  Darin Adler  <darin@apple.com>

        Refactor Document::updateTitleElement to use traits instead of function pointers
        https://bugs.webkit.org/show_bug.cgi?id=176671

        Reviewed by Sam Weinig.

        This template implementation seems slightly more readable and
        also likely to be slightly more efficient. Also takes a suggestion
        from Antti of factoring out the "select a new title element" into a
        function, which is a natural thing to do in this version.

        * dom/Document.cpp:
        (WebCore::TitleTraits<HTMLTitleElement>::isInEligibleLocation): Added.
        (WebCore::TitleTraits<HTMLTitleElement>::findTitleElement): Added.
        (WebCore::TitleTraits<SVGTitleElement>::isInEligibleLocation): Added.
        (WebCore::TitleTraits<SVGTitleElement>::findTitleElement): Added.
        (WebCore::selectNewTitleElement): Added.
        (WebCore::findHTMLTitle): Deleted.
        (WebCore::isHTMLTitle): Deleted.
        (WebCore::isHTMLTitleEligible): Deleted.
        (WebCore::findSVGTitle): Deleted.
        (WebCore::isSVGTitle): Deleted.
        (WebCore::isSVGTitleEligible): Deleted.
        (WebCore::Document::updateTitleElement): Call selectNewTitleElement
        instead of having the logic here.

2017-09-07  Darin Adler  <darin@apple.com>

        Fix double resolve assertion in FontFaceSet seen while running tests
        https://bugs.webkit.org/show_bug.cgi?id=176525

        Reviewed by Brent Fulgham.

        * css/FontFaceSet.cpp:
        (WebCore::FontFaceSet::FontFaceSet): Only resolve the promise if the CSSFontFaceSet
        is already loaded. Otherwise, we will resolve it later when it calls completedLoading.

2017-09-08  Dean Jackson  <dino@apple.com>

        gl.detachShader breaks shader program
        https://bugs.webkit.org/show_bug.cgi?id=137689
        <rdar://problem/34025056>

        Reviewed by Sam Weinig.

        It should be possible to compile shaders, attach them to a program,
        link the program, detach the shaders, delete the shaders, and then
        ask for the uniform and attribute locations. That is, once you've
        linked, the shaders can be thrown away.

        We were using the attached shaders to look up uniform locations, so
        we now keep around a separate map that remembers what shaders were
        attached when the program links.

        This fixes the bug, but the whole area is still a bit messy. For one,
        we're keeping around all the shader information even after it is
        no longer used.
        See https://bugs.webkit.org/show_bug.cgi?id=98204

        Test: fast/canvas/webgl/detachShader-before-accessing-uniform.html

        * platform/graphics/GraphicsContext3D.h: Add another map to remember
        what shaders were used when a program was linked.
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::mappedSymbolInShaderSourceMap): New helper
        to look up a name in our source maps.
        (WebCore::GraphicsContext3D::mappedSymbolName): Use the helper, and look
        at linked shaders if there are no attached shaders.
        (WebCore::GraphicsContext3D::originalSymbolInShaderSourceMap): Does the
        reverse of the above.
        (WebCore::GraphicsContext3D::originalSymbolName):
        (WebCore::GraphicsContext3D::linkProgram): Add to the new map.
        (WebCore::GraphicsContext3D::deleteProgram): Delete the program from
        our shader entries.

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

        Avoid duplicate computations of ExecState::vm().
        https://bugs.webkit.org/show_bug.cgi?id=176647

        Reviewed by Saam Barati.

        No new tests because this is only a refactoring patch.  There is no
        significant behavior change.

        * Modules/mediastream/SDPProcessor.cpp:
        (WebCore::SDPProcessor::callScript const):
        * Modules/plugins/QuickTimePluginReplacement.mm:
        (WebCore::QuickTimePluginReplacement::installReplacement):
        * bindings/js/JSCallbackData.cpp:
        (WebCore::JSCallbackData::invokeCallback):
        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::constructCustomElementSynchronously):
        (WebCore::JSCustomElementInterface::upgradeElement):
        (WebCore::JSCustomElementInterface::invokeCallback):
        * bindings/js/JSDOMConvertRecord.h:
        * bindings/js/JSDOMMapLike.h:
        (WebCore::forwardSizeToMapLike):
        (WebCore::forwardEntriesToMapLike):
        (WebCore::forwardKeysToMapLike):
        (WebCore::forwardValuesToMapLike):
        (WebCore::forwardGetToMapLike):
        (WebCore::forwardHasToMapLike):
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
        (WebCore::addCrossOriginWindowOwnPropertyNames):
        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::reportMemoryForDocumentIfFrameless):
        * bindings/js/JSErrorHandler.cpp:
        (WebCore::JSErrorHandler::handleEvent):
        * bindings/js/JSImageDataCustom.cpp:
        (WebCore::toJSNewlyCreated):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::getOwnPropertySlotCommon):
        (WebCore::putCommon):
        (WebCore::addCrossOriginLocationPropertyNames):
        (WebCore::addCrossOriginLocationOwnPropertyNames):
        (WebCore::JSLocation::defineOwnProperty):
        (WebCore::JSLocationPrototype::put):
        (WebCore::JSLocationPrototype::defineOwnProperty):
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneSerializer::serialize):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):
        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        (WebCore::setJSInterfaceNameConstructor):
        * bindings/scripts/test/JS/JSMapLike.cpp:
        (WebCore::setJSMapLikeConstructor):
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        (WebCore::setJSReadOnlyMapLikeConstructor):
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        (WebCore::setJSTestActiveDOMObjectConstructor):
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        (WebCore::setJSTestCEReactionsConstructor):
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        (WebCore::setJSTestCEReactionsStringifierConstructor):
        * bindings/scripts/test/JS/JSTestCallTracer.cpp:
        (WebCore::setJSTestCallTracerConstructor):
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
        (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        (WebCore::setJSTestDOMJITConstructor):
        * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
        (WebCore::setJSTestEnabledBySettingConstructor):
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        (WebCore::setJSTestEventConstructorConstructor):
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        (WebCore::setJSTestEventTargetConstructor):
        * bindings/scripts/test/JS/JSTestException.cpp:
        (WebCore::setJSTestExceptionConstructor):
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        (WebCore::setJSTestGenerateIsReachableConstructor):
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        (WebCore::setJSTestGlobalObjectConstructor):
        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
        (WebCore::setJSTestIndexedSetterNoIdentifierConstructor):
        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
        (WebCore::setJSTestIndexedSetterThrowingExceptionConstructor):
        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
        (WebCore::setJSTestIndexedSetterWithIdentifierConstructor):
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        (WebCore::setJSTestInterfaceConstructor):
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        (WebCore::setJSTestIterableConstructor):
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        (WebCore::setJSTestJSBuiltinConstructorConstructor):
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        (WebCore::setJSTestMediaQueryListListenerConstructor):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
        (WebCore::setJSTestNamedAndIndexedSetterNoIdentifierConstructor):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
        (WebCore::setJSTestNamedAndIndexedSetterThrowingExceptionConstructor):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
        (WebCore::setJSTestNamedAndIndexedSetterWithIdentifierConstructor):
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        (WebCore::setJSTestNamedConstructorConstructor):
        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
        (WebCore::setJSTestNamedDeleterNoIdentifierConstructor):
        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
        (WebCore::setJSTestNamedDeleterThrowingExceptionConstructor):
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
        (WebCore::setJSTestNamedDeleterWithIdentifierConstructor):
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
        (WebCore::setJSTestNamedDeleterWithIndexedGetterConstructor):
        * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
        (WebCore::setJSTestNamedGetterCallWithConstructor):
        * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
        (WebCore::setJSTestNamedGetterNoIdentifierConstructor):
        * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
        (WebCore::setJSTestNamedGetterWithIdentifierConstructor):
        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
        (WebCore::setJSTestNamedSetterNoIdentifierConstructor):
        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
        (WebCore::setJSTestNamedSetterThrowingExceptionConstructor):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
        (WebCore::setJSTestNamedSetterWithIdentifierConstructor):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
        (WebCore::setJSTestNamedSetterWithIndexedGetterConstructor):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
        (WebCore::setJSTestNamedSetterWithIndexedGetterAndSetterConstructor):
        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
        (WebCore::setJSTestNamedSetterWithOverrideBuiltinsConstructor):
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
        (WebCore::setJSTestNamedSetterWithUnforgablePropertiesConstructor):
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
        (WebCore::setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor):
        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::setJSTestNodeConstructor):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::setJSTestObjConstructor):
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        (WebCore::setJSTestOverloadedConstructorsConstructor):
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        (WebCore::setJSTestOverrideBuiltinsConstructor):
        * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
        (WebCore::setJSTestPluginInterfaceConstructor):
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        (WebCore::setJSTestPromiseRejectionEventConstructor):
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        (WebCore::setJSTestSerializationConstructor):
        * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
        (WebCore::setJSTestSerializationIndirectInheritanceConstructor):
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        (WebCore::setJSTestSerializationInheritConstructor):
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        (WebCore::setJSTestSerializationInheritFinalConstructor):
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
        * bindings/scripts/test/JS/JSTestStringifier.cpp:
        (WebCore::setJSTestStringifierConstructor):
        * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
        (WebCore::setJSTestStringifierAnonymousOperationConstructor):
        * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
        (WebCore::setJSTestStringifierNamedOperationConstructor):
        * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
        (WebCore::setJSTestStringifierOperationImplementedAsConstructor):
        * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
        (WebCore::setJSTestStringifierOperationNamedToStringConstructor):
        * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
        (WebCore::setJSTestStringifierReadOnlyAttributeConstructor):
        * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
        (WebCore::setJSTestStringifierReadWriteAttributeConstructor):
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        (WebCore::setJSTestTypedefsConstructor):
        * bridge/NP_jsobject.cpp:
        (_NPN_SetProperty):
        (_NPN_RemoveProperty):
        (_NPN_Enumerate):
        * bridge/c/c_instance.cpp:
        (JSC::Bindings::CRuntimeMethod::create):
        * bridge/objc/WebScriptObject.mm:
        (-[WebScriptObject setValue:forKey:]):
        (-[WebScriptObject removeWebScriptKey:]):
        (-[WebScriptObject setWebScriptValueAtIndex:value:]):
        * bridge/objc/objc_instance.mm:
        (ObjCRuntimeMethod::create):
        * bridge/objc/objc_runtime.h:
        (JSC::Bindings::ObjcFallbackObjectImp::create):
        * bridge/runtime_array.cpp:
        (JSC::RuntimeArray::getOwnPropertyNames):
        (JSC::RuntimeArray::getOwnPropertySlot):
        (JSC::RuntimeArray::put):
        * bridge/runtime_array.h:
        (JSC::RuntimeArray::create):
        * bridge/runtime_method.cpp:
        (JSC::RuntimeMethod::getOwnPropertySlot):
        * bridge/runtime_method.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::updateCaptionContainer):
        (WebCore::HTMLMediaElement::setControllerJSProperty):
        (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
        (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
        (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
        * testing/Internals.cpp:
        (WebCore::Internals::cloneArrayBuffer):

2017-09-09  Zan Dobersek  <zdobersek@igalia.com>

        [EME] MediaKeySession: handle MediaKeys association through a WeakPtr
        https://bugs.webkit.org/show_bug.cgi?id=176584

        Reviewed by Xabier Rodriguez-Calvar.

        Don't keep a raw pointer to the originating MediaKeys object in
        MediaKeySession that gets nulled out once MediaKeys is destroyed.
        Instead, make MediaKeys a WeakPtrFactory and use a WeakPtr<MediaKeys>
        object to maintain the association between MediaKeySession and
        MediaKeys.

        * Modules/encryptedmedia/MediaKeySession.cpp:
        (WebCore::MediaKeySession::create):
        (WebCore::MediaKeySession::MediaKeySession):
        (WebCore::MediaKeySession::detachKeys): Deleted.
        * Modules/encryptedmedia/MediaKeySession.h:
        * Modules/encryptedmedia/MediaKeys.cpp:
        (WebCore::MediaKeys::MediaKeys):
        (WebCore::MediaKeys::createSession):
        (WebCore::MediaKeys::~MediaKeys): Deleted.
        * Modules/encryptedmedia/MediaKeys.h:

2017-09-09  Zan Dobersek  <zdobersek@igalia.com>

        [GStreamer] Missing GRefPtr adoptions in MediaPlayerPrivateGStreamerBase, PlaybackPipeline
        https://bugs.webkit.org/show_bug.cgi?id=176646

        Reviewed by Carlos Garcia Campos.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::registerWebKitGStreamerElements): Adopt the return value
        of gst_element_factory_find(), which is transferred in full.
        * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
        (WebCore::PlaybackPipeline::flush): Adopt the return values
        of gst_element_get_static_pad() and gst_pad_get_peer(), both being
        transferred in full.

2017-09-09  Frederic Wang  <fwang@igalia.com>

        Use RenderLayerBacking::renderer() when possible
        https://bugs.webkit.org/show_bug.cgi?id=176585

        The private member renderer() is a shorthand for m_owningLayer.renderer(). This patch uses
        it in RenderLayerBacking when possible.

        Reviewed by Carlos Garcia Campos.

        No new tests, behavior not changed.

        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateGeometry):
        (WebCore::RenderLayerBacking::setContentsNeedDisplay):
        (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):

2017-09-08  Sam Weinig  <sam@webkit.org>

        Replace JS builtin implementation of the FetchResponse constructor with a C++ one
        https://bugs.webkit.org/show_bug.cgi?id=176627

        Reviewed by Alex Christensen.

        Removes the last of the Fetch related JS builtin code.

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * Modules/fetch/FetchInternals.js: Removed.
        * Modules/fetch/FetchResponse.js: Removed.
        
            Remove FetchInternals.js and FetchResponse.js.


        * Modules/fetch/FetchBody.idl:
        * Modules/fetch/FetchBodyConsumer.h:

            Remove no longer correct FIXMEs.

        * Modules/fetch/FetchBodySource.cpp:

            Add missing newline between functions.

        * Modules/fetch/FetchHeaders.idl:
        * Modules/fetch/FetchResponse.idl:

            Remove builtin related operations and extended attributes.

        * Modules/fetch/FetchHeaders.h:
        (WebCore::FetchHeaders::fastHas const):
        * Modules/fetch/FetchHeaders.cpp:

            Added fastHas to allow checking for a header using a HTTPHeaderName. Remove
            now unused filter function.

        * Modules/fetch/FetchResponse.cpp:
        (WebCore::isNullBodyStatus):

            Added helper predicate for 'null body status' concept.

        (WebCore::FetchResponse::create):

            Add spec defined constructor implementation.

        (WebCore::FetchResponse::setBodyData):

            Reformatted to match more common WTF::switchOn style.

        (WebCore::FetchResponse::setStatus): Deleted.
        (WebCore::FetchResponse::initializeWith): Deleted.

            Removed now unused functions.

        * Modules/fetch/FetchResponse.h:
        (WebCore::FetchResponse::create):

            Move inline create out of the class definition to make things a bit less crowded.

2017-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Implement HTMLImageElement.decoode() method
        https://bugs.webkit.org/show_bug.cgi?id=176016

        Reviewed by Simon Fraser.

        The specs is:
        https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode.

        -- img.decode() waits till loading the image finishes. Otherwise it starts
        decoding the image immediately.
        -- If the image frame is already decoded, the promise will be resolved
        before return.
        -- If an error happens in loading the image or decoding the image frame,
        the promise will be rejected with 'EncodingError' exception.
        -- Animated image resolves the promise when the next frame is decoded and 
        the animation is advanced it. If the image is not displayed, decode() will
        request the decoding the first frame and start animating the image.

        Tests: fast/images/decode-animated-image.html
               fast/images/decode-render-animated-image.html
               fast/images/decode-render-static-image.html
               fast/images/decode-static-image-reject.html
               fast/images/decode-static-image-resolve.html

        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::decode):
        * html/HTMLImageElement.h:
        * html/HTMLImageElement.idl:
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::notifyFinished):
        (WebCore::ImageLoader::decode):
        (WebCore::ImageLoader::decodeError):
        * loader/ImageLoader.h:
        (WebCore::ImageLoader::hasPendingDecodePromise const):
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::internalStartAnimation):
        (WebCore::BitmapImage::internalAdvanceAnimation):
        (WebCore::BitmapImage::decode):
        (WebCore::BitmapImage::imageFrameAvailableAtIndex):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/Image.h:
        (WebCore::Image::decode):

2017-09-08  Joseph Pecoraro  <pecoraro@apple.com>

        Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses
        https://bugs.webkit.org/show_bug.cgi?id=176479

        Reviewed by Alex Christensen.

        Test: http/wpt/fetch/response-status-text.html

        HTTP/2 doesn't include a status reason phrase. So the "status line"
        ends up just being the version and status code. Fallback to the empty
        string instead of the full line.

        * platform/network/HTTPParsers.cpp:
        (WebCore::extractReasonPhraseFromHTTPStatusLine):

2017-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Implement the attribute HTMLImageElement.async 
        https://bugs.webkit.org/show_bug.cgi?id=176204

        Reviewed by Darin Adler.

        Adding this attribute to the <img> element will force async decoding for
        this image all the times. None of the heuristics, which  prevents flickering
        the image, will be checked.

        Test: fast/images/async-attribute-with-small-image.html

        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::parseAttribute):
        * html/HTMLImageElement.h:
        (WebCore::HTMLImageElement::async const):
        * html/HTMLImageElement.idl:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::decodingModeForImageDraw const):

2017-09-08  Commit Queue  <commit-queue@webkit.org>

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

        This caused build failures. (Requested by mlewis13 on
        #webkit).

        Reverted changeset:

        "[Mac] Upstream QTKit-related WebKitSystemInterface functions"
        https://bugs.webkit.org/show_bug.cgi?id=176472
        http://trac.webkit.org/changeset/221773

2017-09-08  Antti Koivisto  <antti@apple.com>

        Remove support for >> descendant combinator syntax
        https://bugs.webkit.org/show_bug.cgi?id=175765

        Reviewed by Sam Weinig.

        This is an alternative syntax for the normal descendant combinator (just space) that was
        advertised as being consistent with > (child combinator) and >>> (shadow piercing combinator).
        The latter has been killed so it is not consistent with anything anymore.

        No other engine besides WebKit has implemented this and the WPT tests have been removed
        (in https://github.com/w3c/web-platform-tests/pull/6785). Full removal from spec is still
        open (https://github.com/w3c/csswg-drafts/issues/641) but we shouldn't encourage adoption of
        this pointless feature.

        While this has shipped the compatibility risk is low as no other engine implemented it and
        there were no incentives to use it over the standard syntax.

        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::selectorText const):
        * css/CSSSelector.h:
        (WebCore::CSSSelector::hasDescendantRelation const):
        * css/SelectorChecker.cpp:
        (WebCore::SelectorChecker::matchRecursively const):
        * css/SelectorFilter.cpp:
        (WebCore::SelectorFilter::collectIdentifierHashes):
        * css/parser/CSSParserSelector.cpp:
        (WebCore::CSSParserSelector::appendTagHistory):
        * css/parser/CSSParserSelector.h:
        * css/parser/CSSSelectorParser.cpp:
        (WebCore::isDescendantCombinator):
        (WebCore::CSSSelectorParser::consumeCombinator):
        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):

2017-09-08  Zan Dobersek  <zdobersek@igalia.com>

        [GStreamer] initializationDataEncountered() dispatch can outlive MediaPlayerPrivateGStreamerBase
        https://bugs.webkit.org/show_bug.cgi?id=176544

        Reviewed by Xabier Rodriguez-Calvar.

        The RunLoop dispatch that invokes MediaPlayer::initializationDataEncountered()
        can outlive the MediaPlayerPrivateGStreamerBase object that is referenced
        from the dispatched functor. To avoid this, a WeakPtrFactory is placed onto
        MediaPlayerPrivateGStreamerBase and a WeakPtr object is kept in the functor,
        bailing during dispatch if the factory (along with MediaPlayerPrivateGStreamerBase)
        has already been destroyed since the schedule of this dispatch.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
        (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
        Also remove the unused `sessionId` string.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

2017-09-08  Zan Dobersek  <zdobersek@igalia.com>

        [GStreamer] Add GRefPtr specializations for GstGLDisplay, GstGLContext
        https://bugs.webkit.org/show_bug.cgi?id=176543

        Reviewed by Xabier Rodriguez-Calvar.

        Both GstGLDisplay and GstGLContext inherit from GstObject, meaning
        gst_object_ref_sink() and gst_object_unref() should be used for
        incrementing and decrementing reference count. Template specializations
        for the adoptGRef(), refGPtr() and derefGPtr() are added for both types,
        preventing GRefPtr<> from falling back to using g_object_ref() and
        g_object_unref() for reference count modification purposes.

        * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
        (WTF::adoptGRef):
        (WTF::refGPtr<GstGLDisplay>):
        (WTF::derefGPtr<GstGLDisplay>):
        (WTF::refGPtr<GstGLContext>):
        (WTF::derefGPtr<GstGLContext>):
        * platform/graphics/gstreamer/GRefPtrGStreamer.h:

2017-09-08  Zan Dobersek  <zdobersek@igalia.com>

        [GStreamer] Incorrect GstCaps unreffing in GStreamerEMEUtilities::createDecryptor()
        https://bugs.webkit.org/show_bug.cgi?id=176540

        Reviewed by Xabier Rodriguez-Calvar.

        * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
        Include the GRefPtrGStreamer.h header in order to use specialized template
        functions that correctly adopt and dereference GstCaps object that is
        wrapped the GRefPtr<>.

2017-09-07  Joseph Pecoraro  <pecoraro@apple.com>

        WebKit should claim that it can show responses for a broader range of JSON MIMETypes
        https://bugs.webkit.org/show_bug.cgi?id=176252
        <rdar://problem/34212885>

        Reviewed by Ryosuke Niwa.

        * platform/MIMETypeRegistry.h:
        * platform/MIMETypeRegistry.cpp:
        (WebCore::MIMETypeRegistry::canShowMIMEType):
        Extend this to support JavaScript and JSON MIMETypes that WebKit
        knows how to treat as text.

2017-09-07  Andy Estes  <aestes@apple.com>

        [Mac] Upstream QTKit-related WebKitSystemInterface functions
        https://bugs.webkit.org/show_bug.cgi?id=176472

        Reviewed by Eric Carlson.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::disableComponentsOnce):
        (WebCore::MediaPlayerPrivateQTKit::createQTMovie):
        (WebCore::MediaPlayerPrivateQTKit::hasClosedCaptions const):
        (WebCore::MediaPlayerPrivateQTKit::setClosedCaptionsVisible):
        (WebCore::selectPreferredAlternateTrackForMediaType):
        (WebCore::selectPreferredAlternates):
        (WebCore::MediaPlayerPrivateQTKit::updateStates):
        (WebCore::mimeModernTypesCache):
        (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache):
        (WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
        (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins):
        (WebCore::MediaPlayerPrivateQTKit::hasSingleSecurityOrigin const):
        (WebCore::MediaPlayerPrivateQTKit::movieLoadType const):
        (WebCore::MediaPlayerPrivateQTKit::canSaveMediaData const):
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:
        * platform/mac/WebVideoFullscreenHUDWindowController.mm:
        (createMediaUIControl):
        (createControlWithMediaUIControlType):
        (createMediaUIBackgroundView):
        (-[WebVideoFullscreenHUDWindowController windowDidLoad]):

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

        Align FetchResponse and FetchRequest body handling
        https://bugs.webkit.org/show_bug.cgi?id=176539

        Reviewed by Alex Christensen.

        Covered by rebased tests.

        Removing most of FetchResponse JS Builtins now that ReadableStream has full support.
        Implementing FetchResponse body cloning through ReadableStream.
        Cloning a loading FetchResponse still requires to create a ReadableStream for the purpose of teeing.

        Moving exposure of the body from FetchResponse to FetchBodyOwner.
        This is controlled by a boolean flag set according response tainting.

        Moving handling of body ReadableStream consuming from FetchResponse to FetchBodyConsumer.
        For that purpose, a loading boolean flag is added to FetchBodyConsumer so that it will resolve consume promises
        when loading is finished.

        Added support for getting a body in case the request/response body is already consumed.
        In that case, a locked ReadableStream is returned.

        * Modules/cache/DOMCache.cpp:
        (WebCore::DOMCache::doMatch):
        (WebCore::DOMCache::matchAll):
        * Modules/fetch/FetchBody.h:
        (WebCore::FetchBody::loadingBody):
        (WebCore::FetchBody::FetchBody):
        * Modules/fetch/FetchBody.idl:
        * Modules/fetch/FetchBodyConsumer.cpp:
        (WebCore::FetchBodyConsumer::resolve):
        (WebCore::FetchBodyConsumer::loadingFailed):
        (WebCore::FetchBodyConsumer::loadingSucceeded):
        * Modules/fetch/FetchBodyConsumer.h:
        (WebCore::FetchBodyConsumer::setAsLoading):
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::arrayBuffer):
        (WebCore::FetchBodyOwner::blob):
        (WebCore::FetchBodyOwner::formData):
        (WebCore::FetchBodyOwner::json):
        (WebCore::FetchBodyOwner::text):
        (WebCore::FetchBodyOwner::readableStream):
        * Modules/fetch/FetchBodyOwner.h:
        (WebCore::FetchBodyOwner::isBodyNullOrOpaque const):
        (WebCore::FetchBodyOwner::setBodyAsOpaque):
        (WebCore::FetchBodyOwner::isBodyOpaque const):
        * Modules/fetch/FetchInternals.js:
        (fillFetchHeaders):
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::clone):
        (WebCore::FetchResponse::fetch):
        (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
        (WebCore::FetchResponse::setBodyData):
        (WebCore::FetchResponse::consumeChunk):
        (WebCore::FetchResponse::consumeBodyAsStream):
        * Modules/fetch/FetchResponse.h:
        * Modules/fetch/FetchResponse.idl:
        * Modules/fetch/FetchResponse.js:
        (initializeFetchResponse):
        * bindings/js/ReadableStream.cpp:
        (WebCore::ReadableStream::create):
        (WebCore::ReadableStream::lock):
        * bindings/js/ReadableStream.h:
        * bindings/js/WebCoreBuiltinNames.h:

2017-09-07  Michael Saboff  <msaboff@apple.com>

        Add support for RegExp named capture groups
        https://bugs.webkit.org/show_bug.cgi?id=176435

        Reviewed by Filip Pizlo.

        Implemented stub routines to support named capture groups.  These are no-ops
        just like for number capture group.

        No new tests as this is covered by existing tests.

        * contentextensions/URLFilterParser.cpp:
        (WebCore::ContentExtensions::PatternParser::atomNamedBackReference):
        (WebCore::ContentExtensions::PatternParser::atomParenthesesSubpatternBegin):

2017-09-07  Myles C. Maxfield  <mmaxfield@apple.com>

        [PAL] Unify PlatformUserPreferredLanguages.h with Language.h
        https://bugs.webkit.org/show_bug.cgi?id=176561

        Reviewed by Brent Fulgham.

        No new tests because there is no behavior change.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * accessibility/AccessibilitySVGElement.cpp:
        * bindings/js/JSDOMWindowBase.cpp:
        * bindings/js/JSWorkerGlobalScopeBase.cpp:
        * dom/Document.cpp:
        * html/HTMLInputElement.cpp:
        * html/HTMLMediaElement.cpp:
        * html/shadow/MediaControlElements.cpp:
        * html/track/TrackBase.cpp:
        * page/CaptionUserPreferences.cpp:
        * page/CaptionUserPreferencesMediaAF.cpp:
        * page/DOMWindow.cpp:
        * page/Navigator.cpp:
        * page/NavigatorBase.cpp:
        * platform/graphics/FontGenericFamilies.cpp:
        * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
        * platform/network/HTTPParsers.cpp:
        * platform/text/PlatformLocale.h:
        * platform/text/cf/HyphenationCF.cpp:
        * platform/text/mac/LocaleMac.mm:
        * svg/SVGTests.cpp:
        * testing/InternalSettings.cpp:
        * testing/Internals.cpp:
        (WebCore::Internals::resetToConsistentState):
        (WebCore::Internals::userPreferredLanguages const):
        (WebCore::Internals::setUserPreferredLanguages):

2017-09-06  Dean Jackson  <dino@apple.com>

        [WebGL] accelerated texImage2D for video doesn't respect flipY
        https://bugs.webkit.org/show_bug.cgi?id=176491
        <rdar://problem/33833511>

        Reviewed by Jer Noble.

        Previously, if UNPACK_FLIP_Y_WEBGL was set to true, we'd either fall
        back to software or fail to upload texture data. Fix this by intercepting
        the texImage2D call, checking the orientation of the video, and running
        a small shader program to flip it if necessary.

        While there, implement UNPACK_PREMULTIPLY_ALPHA_WEBGL as well, although
        none of our media decoders support video with alpha, so unfortunately
        this will have no visible change.

        Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html
               fast/canvas/webgl/texImage2D-video-flipY-true.html

        * platform/cocoa/CoreVideoSoftLink.cpp: Add link to CVOpenGL(ES)TextureGetCleanTexCoords,
        which is used to check the orientation of the source video.
        * platform/cocoa/CoreVideoSoftLink.h:

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): We can
        now handle flipped or premultiplied requests.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::copyVideoTextureToPlatformTexture): Ditto.

        * platform/graphics/cv/VideoTextureCopierCV.cpp:
        (WebCore::VideoTextureCopierCV::VideoTextureCopierCV): Rename readFramebuffer to
        simply framebuffer.
        (WebCore::VideoTextureCopierCV::~VideoTextureCopierCV): Delete the program and buffer
        if they were created.
        (WebCore::VideoTextureCopierCV::initializeContextObjects): Sets up the shader program
        and the vertex buffer for drawing. Also records the location of the uniforms.
        (WebCore::VideoTextureCopierCV::copyVideoTextureToPlatformTexture): Create a new
        framebuffer object, and render the video texture into that framebuffer using a
        shader that can flip the coordinates.
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::GC3DStateSaver): Helper to restore
        the state of the user's GraphicsContext3D while we're intercepting calls.
        (WebCore::VideoTextureCopierCV::GC3DStateSaver::~GC3DStateSaver):
        * platform/graphics/cv/VideoTextureCopierCV.h:

        * platform/graphics/GraphicsContext3D.h: Add two new entry points, for direct shader
        compilation and attribute access. This avoids going through ANGLE.
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::compileShader):
        (WebCore::GraphicsContext3D::compileShaderDirect):
        (WebCore::GraphicsContext3D::getAttribLocationDirect):

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

        [Directory Upload] Extend drag and drop support to iOS
        https://bugs.webkit.org/show_bug.cgi?id=176492
        <rdar://problem/34291584>

        Reviewed by Tim Horton.

        Adds support for accepting dropped folders on iOS.

        Tests: DataInteractionTests.ExternalSourceDataTransferItemGetFolderAsEntry
               DataInteractionTests.ExternalSourceDataTransferItemGetPlainTextFileAsEntry

        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):

        Add "public.folder" as a compatible pasteboard type for drops on iOS. This means file inputs and custom drop
        targets that preventDefault() will, by default, be able to accept incoming folders.

        * platform/ios/WebItemProviderPasteboard.mm:
        (linkTemporaryItemProviderFilesToDropStagingDirectory):

        Tweak temporaryFileURLForDataInteractionContent to also hard link UIKit's temporary files instead, and return
        a non-null destination URL only if the necessary file operations succeeded. Also renames this helper to
        linkTemporaryItemProviderFilesToDropStagingDirectory to better reflect its new purpose. This makes logic much
        cleaner at the call site, which no longer checks against various conditions before proceeding to set the data
        transfer URL.

        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
        (temporaryFileURLForDataInteractionContent): Deleted.

2017-09-07  Alex Christensen  <achristensen@webkit.org>

        Modernize Geolocation code
        https://bugs.webkit.org/show_bug.cgi?id=176496

        Reviewed by Andy Estes.

        No change in behavior.  Just more references instead of pointers.

        * Modules/geolocation/Geolocation.cpp:
        (WebCore::createPositionError):
        (WebCore::Geolocation::resetAllGeolocationPermission):
        (WebCore::Geolocation::stop):
        (WebCore::Geolocation::requestPermission):
        (WebCore::Geolocation::setError):
        (WebCore::Geolocation::startUpdating):
        (WebCore::Geolocation::stopUpdating):
        * Modules/geolocation/Geolocation.h:
        * Modules/geolocation/GeolocationClient.h:
        * Modules/geolocation/GeolocationController.cpp:
        (WebCore::GeolocationController::addObserver):
        (WebCore::GeolocationController::removeObserver):
        (WebCore::GeolocationController::requestPermission):
        (WebCore::GeolocationController::cancelPermissionRequest):
        (WebCore::GeolocationController::positionChanged):
        (WebCore::GeolocationController::errorOccurred):
        (WebCore::GeolocationController::activityStateDidChange):
        (WebCore::provideGeolocationTo):
        * Modules/geolocation/GeolocationController.h:

2017-09-07  Adrian Perez de Castro  <aperez@igalia.com>

        [ARM] Building FELightningNEON.cpp fails due to missing {Point,Spot}LightSource declarations
        https://bugs.webkit.org/show_bug.cgi?id=176531

        Reviewed by Žan Doberšek.

        The m_lightSource member is a Ref<LightSource>, and its get() method returns
        a reference, therefore the casts have to be done to the corresponding reference
        types.

        * platform/graphics/cpu/arm/filters/FELightingNEON.h:
        (WebCore::FELighting::platformApplyNeon): Adjust casts and member accesses accordingly.

2017-09-07  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r221716.

        This change caused assertion failures on macOS Debug WK2.

        Reverted changeset:

        "Fetch's Response.statusText is unexpectedly the full http
        status line for HTTP/2 responses"
        https://bugs.webkit.org/show_bug.cgi?id=176479
        http://trac.webkit.org/changeset/221716

2017-09-07  Zan Dobersek  <zdobersek@igalia.com>

        [EME] CDMClearKey: implement remaining methods of CDMPrivate derivative
        https://bugs.webkit.org/show_bug.cgi?id=176495

        Reviewed by Xabier Rodriguez-Calvar.

        Implement the remaining CDMPrivateClearKey methods, following the
        ClearKey specification:
         - server certificates are not supported, but sessions are;
         - 'keyids' init data in JSON format is acceptable;
         - JSON responses are acceptable;
         - session IDs must use the 32-bit integer format.

        No new tests -- covered by imported W3C tests that utilize ClearKey.

        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::parseJSONObject):
        (WebCore::CDMPrivateClearKey::loadAndInitialize):
        (WebCore::CDMPrivateClearKey::supportsServerCertificates const):
        (WebCore::CDMPrivateClearKey::supportsSessions const):
        (WebCore::CDMPrivateClearKey::supportsInitData const):
        (WebCore::CDMPrivateClearKey::sanitizeResponse const):
        (WebCore::CDMPrivateClearKey::sanitizeSessionId const):

2017-09-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Bring back line height rounding when computing font metrics
        https://bugs.webkit.org/show_bug.cgi?id=176497

        Reviewed by Žan Doberšek.

        In r221670 we changed the way we get the metrics to avoid rounding that was causing a negative line gap to be
        computed. Since the font metrics value is indeed a float value, we also removed the rounding when setting the
        line height. However, this caused some test failures because now we report non integer line heights.

        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
        (WebCore::Font::platformInit):

2017-09-06  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Temporary disable the changes introduced in r221670 for WPE.

        It caused a lot of test failures. Once WPE upgrades to Freetype 2.8 and removes the 2.4.11 patch, we can enable
        it again.

        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
        (WebCore::Font::platformInit):

2017-09-06  Zan Dobersek  <zdobersek@igalia.com>

        [GStreamer] Implement MediaPlayerPrivateGStreamerMSE::attempToDecryptWithInstance()
        https://bugs.webkit.org/show_bug.cgi?id=176445

        Reviewed by Xabier Rodriguez-Calvar.

        Implement MediaPlayerPrivateGStreamerMSE::attempToDecryptWithInstance(), also
        adding support for dispatching ClearKey keys into the append pipelines.

        CDMInstanceClearKey::Key is added, containing key ID and value buffers as well
        as the key status value. Vector of keys for a specific CDMInstance is
        accessible through the CDMInstanceClearKey::keys() getter.

        In MediaPlayerPrivateGStreamerMSE, that Vector is retrieved and then iterated
        over, constructing corresponding key ID and key value lists that contain
        GstBuffer objects into which each key ID and value data is copied. Both lists
        are then set on the 'drm-cipher-clearkey' structure before it's dispatched
        against each AppendPipeline object.

        * platform/encryptedmedia/clearkey/CDMClearKey.h:
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
        (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:

2017-09-06  Joseph Pecoraro  <pecoraro@apple.com>

        Fetch's Response.statusText is unexpectedly the full http status line for HTTP/2 responses
        https://bugs.webkit.org/show_bug.cgi?id=176479

        Reviewed by Alexey Proskuryakov.

        Test: http/wpt/fetch/response-status-text.html

        HTTP/2 doesn't include a status reason phrase. So the "status line"
        ends up just being the version and status code. Fallback to the empty
        string instead of the full line.

        * platform/network/HTTPParsers.cpp:
        (WebCore::extractReasonPhraseFromHTTPStatusLine):

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

        Require LoggingHelper overrides to provide identifier
        https://bugs.webkit.org/show_bug.cgi?id=176477

        Reviewed by Jer Noble.

        No new tests, updated API test.

        * html/HTMLMediaElement.cpp:
        (WebCore::nextLogIdentifier): New.
        (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_logIdendifier. LOGTHIS -> LOGIDENTIFIER.
        (WebCore::HTMLMediaElement::~HTMLMediaElement): Ditto.
        * html/HTMLMediaElement.h:

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

        NetworkProcess Cache and Caches should be cleared when the last related WebProcess Cache or CacheStorage is destroyed
        https://bugs.webkit.org/show_bug.cgi?id=176249

        Reviewed by Alex Christensen.

        Test: http/tests/cache-storage/cache-representation.https.html

        Each Cache construction/destruction is notified to the CacheStorageConnection
        so that the WebKit2 engine can handle memory management accordingly.

        Adding an internal API to grab the representation of an engine at any time.

        * Modules/cache/Cache.cpp:
        (WebCore::Cache::Cache):
        (WebCore::Cache::~Cache):
        * Modules/cache/CacheStorageConnection.h:
        (WebCore::CacheStorageConnection::reference):
        (WebCore::CacheStorageConnection::dereference):
        * Modules/cache/WorkerCacheStorageConnection.cpp:
        (WebCore::WorkerCacheStorageConnection::reference):
        (WebCore::WorkerCacheStorageConnection::dereference):
        * Modules/cache/WorkerCacheStorageConnection.h:
        * testing/Internals.cpp:
        (WebCore::Internals::cacheStorageEngineRepresentation):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-09-05  Matt Rajca  <mrajca@apple.com>

        Support new autoplay quirk for arbitrary user gestures.
        https://bugs.webkit.org/show_bug.cgi?id=176402

        Reviewed by Eric Carlson.

        This quirk allows any user gesture to allow autoplay in a document.

        No new tests because this specifically targets one host.

        * html/MediaElementSession.cpp:
        (WebCore::needsArbitraryUserGestureAutoplayQuirk):
        (WebCore::MediaElementSession::playbackPermitted const):

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

        Support caching of Response with a ReadableStream body
        https://bugs.webkit.org/show_bug.cgi?id=176462

        Reviewed by Alex Christensen.

        Tests: http/wpt/cache-storage/cache-put-stream.https.any.html
               http/wpt/cache-storage/cache-put-stream.https.any.worker.html

        Making FetchResponse use more of ReadableStream:
        - Cloning of its body is done through ReadableStream.
        - Computation of disturbed and locked is done through ReadableStream.
        - Storing of the ReadableStream body given at constructor time is done in FetchBody for FetchResponse.
        This allows making FetchResponse closer to FetchRequest.
        This also allows to correctly compute disturbed and locked in clone cases.

        Adding the ability to consume a Response ReadableStream body as a SharedBuffer.
        Using that ability in DOMCache.

        * Modules/cache/DOMCache.cpp:
        (WebCore::DOMCache::putWithResponseData):
        (WebCore::DOMCache::put):
        * Modules/cache/DOMCache.h:
        * Modules/fetch/FetchBody.h:
        (WebCore::FetchBody::readableStream const):
        * Modules/fetch/FetchBodyConsumer.cpp:
        (WebCore::FetchBodyConsumer::extract):
        * Modules/fetch/FetchBodyConsumer.h:
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::isDisturbed const):
        (WebCore::FetchBodyOwner::isDisturbedOrLocked const):
        * Modules/fetch/FetchBodyOwner.h:
        (WebCore::FetchBodyOwner::hasReadableStreamBody const):
        * Modules/fetch/FetchBodySource.cpp:
        * Modules/fetch/FetchBodySource.h:
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::consumeBodyFromReadableStream):
        (WebCore::FetchResponse::consumeBodyWhenLoaded):
        (WebCore::FetchResponse::consumeBodyAsStream):
        * Modules/fetch/FetchResponse.h:
        * Modules/fetch/FetchResponse.idl:
        * Modules/fetch/FetchResponse.js:
        (initializeFetchResponse):
        (clone):
        * bindings/js/ReadableStream.cpp:
        (WebCore::callFunction):
        (WebCore::ReadableStream::pipeTo):
        (WebCore::ReadableStream::tee):
        (WebCore::checkReadableStream):
        (WebCore::ReadableStream::isLocked const):
        (WebCore::ReadableStream::isDisturbed const):
        (WebCore::ReadableStream::isDisturbed):
        * bindings/js/ReadableStream.h:
        * bindings/js/ReadableStreamDefaultController.cpp:
        * bindings/js/ReadableStreamDefaultController.h:
        * bindings/js/WebCoreBuiltinNames.h:
        * testing/Internals.cpp:
        (WebCore::Internals::isReadableStreamDisturbed):

2017-09-06  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r221461.

        The LayoutTest added with this change crashes under
        GuardMalloc.

        Reverted changeset:

        "Add (entirely incorrect) fetching of ServiceWorker scripts."
        https://bugs.webkit.org/show_bug.cgi?id=176179
        http://trac.webkit.org/changeset/221461

2017-09-06  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: Support overloaded CanvasRenderingContext2D actions with identical parameter counts
        https://bugs.webkit.org/show_bug.cgi?id=176178
        <rdar://problem/34192229>

        Reviewed by Matt Baker.

        Update existing tests.

        * WebCore.xcodeproj/project.pbxproj:

        * inspector/InspectorCanvas.cpp:
        (WebCore::buildArrayForVector):
        (WebCore::InspectorCanvas::buildAction):
        Add another array to each action that contains a swizzle type for each parameter. This is
        used by the frontend to determine how to regenerate the value from what is given in the JSON.

        * inspector/RecordingSwizzleTypes.h: Added.
        Contains a value-specified enum of types that translate into int values, which are mirrored
        by an object in the frontend, that indicate the type of each parameter. This enum matches
        the values in WI.Recording.Swizzle.

2017-09-06  Per Arne Vollan  <pvollan@apple.com>

        [Win] WebCore failed to build, InbandTextTrackPrivateAVF: base class undefined.
        https://bugs.webkit.org/show_bug.cgi?id=176431

        Reviewed by Alex Christensen.

        AVFoundation header detection should be done in WebCore because of build dependencies.

        No new tests, covered by existing tests.

        * AVFoundationSupport.py: Copied from Source/WTF/AVFoundationSupport.py.
        * PlatformWin.cmake:
        * config.h:
        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
        * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:

2017-09-06  Sam Weinig  <sam@webkit.org>

        REGRESSION (r221598): Legacy "round" and "bevel" options can no longer be used with the legacy CanvasRenderingContext2D setLineJoin operation
        https://bugs.webkit.org/show_bug.cgi?id=176461

        Reviewed by Alex Christensen.

        Tests: fast/canvas/canvas-strokePath-cap-join-legacy-functions-match-attribute.html
               fast/canvas/canvas-strokePath-cap-join-legacy.html

        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::setLineJoin):
        
            Fix silly typo, ifs -> else ifs.

2017-09-06  Per Arne Vollan  <pvollan@apple.com>

        [Win] Compile errors in Document::updateTitleElement.
        https://bugs.webkit.org/show_bug.cgi?id=176381

        Reviewed by Alex Christensen.

        MSVC is not able to compile the statement:
        'auto result = boolExpression ? lambda1 : lambda2;'
        where 'lambda1' and 'lambda2' have the same signature.

        * dom/Document.cpp:
        (WebCore::findHTMLTitle):
        (WebCore::isHTMLTitle):
        (WebCore::isHTMLTitleEligible):
        (WebCore::findSVGTitle):
        (WebCore::isSVGTitle):
        (WebCore::isSVGTitleEligible):
        (WebCore::Document::updateTitleElement):

2017-09-06  Brent Fulgham  <bfulgham@apple.com>

        Deny third-party cookie creation for prevalent resources without interaction
        https://bugs.webkit.org/show_bug.cgi?id=175232
        <rdar://problem/33709386>

        Reviewed by Alex Christensen.

        Prior to Intelligent Tracking Prevention, WebKit would deny the ability to create a third party cookie if the user's
        settings prohibited it. Due to the internal mechanics of cookie partitioning, we now accept the third party cookie,
        but destroy it at some arbitrary moment which is difficult for websites to work with.
        
        This patch revises WebKit so that attempts to set third party cookies without user interaction fails immediately,
        which is what sites are expecting from Safari.

        Tests: http/tests/loading/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html

        * platform/network/NetworkStorageSession.h:
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::shouldPartitionCookies const): Revise for new naming.
        (WebCore::NetworkStorageSession::shouldAllowThirdPartyCookies const): Allow third party cookies when the
        user interaction property applies.
        (WebCore::NetworkStorageSession::shouldBlockCookies const): Deny cookies for origins that are not allowed by
        user interaction, and that are not being partitioned.
        (WebCore::NetworkStorageSession::setPrevalentDomainsWithAndWithoutInteraction): Revise for new naming, and
        to track prevalent origins with and without user interaction.
        (WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts): Renamed to setPrevalentDomainsWithAndWithoutInteraction.
        (WebCore::NetworkStorageSession::removePrevalentDomains): New helper function for testing.

2017-09-06  Tomas Popela  <tpopela@redhat.com>

        Missing break in URLParser
        https://bugs.webkit.org/show_bug.cgi?id=176357

        Reviewed by Darin Adler.

        Add a missing break so the currently set state is not overwritten
        after the block. Found by Coverity scan.

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

2017-09-06  Dominik Röttsches  <dominik.rottsches@intel.com>

        [GTK] Bump freetype version to 2.8.0
        https://bugs.webkit.org/show_bug.cgi?id=176351

        Reviewed by Carlos Alberto Lopez Perez.

        Retrieving line spacing info without metrics hinting - FreeType's metric hinting
        uses rounding which results in the sum of ascent and descent being larger
        than the line height. To work around this without globally disabling font metrics
        hinting, I am temporarily creating a new cairo scaled font with metrics hinting
        off and retrieving the height values from this one.

        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
        (WebCore::scaledFontWithoutMetricsHinting): New function to clone the existing font, only with metrics hinting
        disabled.
        (WebCore::Font::platformInit): Get height info from non-metrics hinted font, disable rounding for linespacing.

2017-09-06  Frédéric Wang  <fwang@igalia.com>

        Introduce ScrollingTreeScrollingNodeDelegateIOS to share code between overflow and frame scrolling
        https://bugs.webkit.org/show_bug.cgi?id=174097

        Reviewed by Darin Adler.

        No new tests, behavior unchanged.

        * WebCore.xcodeproj/project.pbxproj: Add ScrollingTreeScrollingNodeDelegate.
        * page/scrolling/ScrollingTreeScrollingNode.h: Make ScrollingTreeScrollingNodeDelegate a
        friend so that it can access private members.
        * page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp: Added. New delegate class for a
        scrolling node, which is used by the UI process.
        (WebCore::ScrollingTreeScrollingNodeDelegate::ScrollingTreeScrollingNodeDelegate):
        Constructor, taking the scrolling node as a parameter.
        (WebCore::ScrollingTreeScrollingNodeDelegate::~ScrollingTreeScrollingNodeDelegate):
        (WebCore::ScrollingTreeScrollingNodeDelegate::scrollingTree const): Expose the scrolling
        tree containing the scrolling node.
        (WebCore::ScrollingTreeScrollingNodeDelegate::lastCommittedScrollPosition const): Expose
        the last committed scroll position of the scrolling node.
        * page/scrolling/ScrollingTreeScrollingNodeDelegate.h: Added.
        (WebCore::ScrollingTreeScrollingNodeDelegate::scrollingNode): Expose the scrolling node.
        (WebCore::ScrollingTreeScrollingNodeDelegate::scrollingNode const): Ditto.

2017-09-06  Manuel Rego Casasnovas  <rego@igalia.com>

        [css-grid] grid shorthand should not reset the gutter properties
        https://bugs.webkit.org/show_bug.cgi?id=176375

        Reviewed by Sergio Villar Senin.

        The CSS WG has resolved that the "grid" shorthand shouldn't reset
        the gutter properties anymore:
        https://github.com/w3c/csswg-drafts/issues/1036

        This was originally implemented in r195529, so this is somehow
        a revert of that change.

        Test: imported/w3c/web-platform-tests/css/css-grid-1/grid-definition/grid-shorthand-001.html

        * css/CSSProperties.json:
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::CSSPropertyParser::consumeGridShorthand):

2017-09-06  Zan Dobersek  <zdobersek@igalia.com>

        [WebGL2] Implement getActiveUniforms()
        https://bugs.webkit.org/show_bug.cgi?id=175203

        Reviewed by Darin Adler.

        Align getActiveUniforms() WebIDL signature with the spec -- making it
        return a WebGLAny object, making the program parameter non-nullable,
        and making the uniformIndices parameter a sequence on GLuint values.

        The getActiveUniforms() implementation in WebGL2RenderingContext
        validates the passed-in program and parameter name and then calls the
        GraphicsContext3D::getActiveUniforms() method, retrieving an array of
        integers that represent values of the requested parameter name for
        each uniform whose index was passed through uniformIndices.

        Test: fast/canvas/webgl/webgl2-getActiveUniforms.html

        * bindings/js/JSDOMConvertWebGL.cpp:
        (WebCore::convertToJSValue):
        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::getActiveUniforms):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGL2RenderingContext.idl:
        * html/canvas/WebGLAny.h:
        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::getActiveUniforms):

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

        [WebCrypto] Downcast parameters and keys at the platform operation callsites
        https://bugs.webkit.org/show_bug.cgi?id=176392

        Reviewed by Sam Weinig.

        Downcast to algorithm-specific parameter and key types in the shared
        code that then invokes platform-specific operation implementations.
        This reduces the duplicated downcasts across different implementations
        that don't differ at all in this behavior.

        Covered by existing tests.

        * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
        (WebCore::CryptoAlgorithmAES_CBC::encrypt):
        (WebCore::CryptoAlgorithmAES_CBC::decrypt):
        * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
        * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
        (WebCore::CryptoAlgorithmAES_CFB::encrypt):
        (WebCore::CryptoAlgorithmAES_CFB::decrypt):
        * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
        * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
        (WebCore::CryptoAlgorithmAES_CTR::encrypt):
        (WebCore::CryptoAlgorithmAES_CTR::decrypt):
        * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
        * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
        (WebCore::CryptoAlgorithmAES_GCM::encrypt):
        (WebCore::CryptoAlgorithmAES_GCM::decrypt):
        * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
        * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
        (WebCore::CryptoAlgorithmAES_KW::wrapKey):
        (WebCore::CryptoAlgorithmAES_KW::unwrapKey):
        * crypto/algorithms/CryptoAlgorithmAES_KW.h:
        * crypto/algorithms/CryptoAlgorithmECDH.cpp:
        (WebCore::CryptoAlgorithmECDH::deriveBits):
        * crypto/algorithms/CryptoAlgorithmECDH.h:
        * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
        (WebCore::CryptoAlgorithmECDSA::sign):
        (WebCore::CryptoAlgorithmECDSA::verify):
        * crypto/algorithms/CryptoAlgorithmECDSA.h:
        * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
        (WebCore::CryptoAlgorithmHKDF::deriveBits):
        * crypto/algorithms/CryptoAlgorithmHKDF.h:
        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
        (WebCore::CryptoAlgorithmHMAC::sign):
        (WebCore::CryptoAlgorithmHMAC::verify):
        * crypto/algorithms/CryptoAlgorithmHMAC.h:
        * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
        (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
        * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
        (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
        (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
        * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
        (WebCore::CryptoAlgorithmRSA_PSS::sign):
        (WebCore::CryptoAlgorithmRSA_PSS::verify):
        * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
        * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
        (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
        (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
        (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
        (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
        (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
        (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
        * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
        (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
        * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
        (WebCore::CryptoAlgorithmECDSA::platformSign):
        (WebCore::CryptoAlgorithmECDSA::platformVerify):
        * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
        (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
        * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
        (WebCore::CryptoAlgorithmHMAC::platformSign):
        (WebCore::CryptoAlgorithmHMAC::platformVerify):
        * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
        (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
        * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
        * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
        (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
        (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
        (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
        (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
        * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
        (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
        * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
        (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
        * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
        (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
        * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
        (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
        * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
        (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
        (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
        * crypto/mac/CryptoAlgorithmECDHMac.cpp:
        (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
        * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
        (WebCore::CryptoAlgorithmECDSA::platformSign):
        (WebCore::CryptoAlgorithmECDSA::platformVerify):
        * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
        (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
        * crypto/mac/CryptoAlgorithmHMACMac.cpp:
        (WebCore::CryptoAlgorithmHMAC::platformSign):
        (WebCore::CryptoAlgorithmHMAC::platformVerify):
        * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
        (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
        * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
        * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
        * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
        (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
        (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
        * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
        (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
        (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):

2017-09-05  Darin Adler  <darin@apple.com>

        Fix a few minor problems found while working toward removing unneeded calls to updateStyle
        https://bugs.webkit.org/show_bug.cgi?id=176279

        Reviewed by Antti Koivisto.

        * dom/Document.cpp:
        (WebCore::Document::updateTitleElement): Fix the algorithm so that an SVG title won't
        ever become the title when the document element is not an SVG element. We had this wrong
        before but we were passing the test because SVGTitleElement::insertedInto had a bug that
        hid the problem.
        (WebCore::Document::titleElementAdded): Pass a reference instead of a pointer.
        (WebCore::Document::titleElementRemoved): Pass a reference instead of nullptr since we
        want to know which element is being removed.

        * dom/Document.h: Update the argument name and type for updateTitleElement.

        * html/HTMLTitleElement.cpp:
        (WebCore::HTMLTitleElement::insertedInto): Call titleElementAdded unconditionally.
        The checks to see if the title element is connected to the document and not in the
        shadow tree are now handled by the Document class.
        (WebCore::HTMLTitleElement::removedFrom): Same for titleElementRemoved.

        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::applySize): Removed incorrect caching of FontCascade
        objects; these need to be created each time we draw.
        (WebCore::MockRealtimeVideoSource::drawText): Create all the fonts here. Since this is
        a mock for testing, there is no real performance concern with doing this.
        * platform/mock/MockRealtimeVideoSource.h: Removed the FontCascade data members.

        * rendering/RenderTreeAsText.cpp:
        (WebCore::updateLayoutIgnoringPendingStylesheetsIncludingSubframes): Added. Used below
        to update layout more thoroughly.
        (WebCore::externalRepresentation): Update layout of all descendant frames, not just
        the top level frame.

        * svg/SVGTitleElement.cpp:
        (WebCore::SVGTitleElement::insertedInto): Removed bogus firstChild check, bogus isSVGDocument
        check, and unneeded isConnected check and call titleElementAdded unconditionally. The checks
        are now handled by the Document class.
        (WebCore::SVGTitleElement::removedFrom): Same for titleElementRemoved.

        * testing/Internals.cpp:
        (WebCore::Internals::layerTreeAsText const): Added missing updateLayoutIgnorePendingStylesheets,
        since dumping the layer tree without first doing a layout will yield stale results.
        (WebCore::Internals::layerIDForElement): Added missing updateLayoutIgnorePendingStylesheets,
        since using a renderer to check if a layer exists without first doing a layout will yield stale results.
        (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
        (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
        (WebCore::Internals::displayListForElement): Ditto.
        (WebCore::Internals::replayDisplayListForElement): Ditto.
        (WebCore::Internals::isSelectPopupVisible): Added missing updateLayoutIgnorePendingStylesheets,
        since working with the RenderMenuList without first doing a layout will yield stale results.
        Also removed unneeded strict handling of null renderer, instead just returning false.
        (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Removed unnneeded check of
        renderer class, since the HTMLPlugInElement::isReplacementObscured already handles that correctly.
        (WebCore::Internals::pageOverlayLayerTreeAsText const): Use updateLayoutIgnorePendingStylesheets
        instead of the normal updateLayout for consistency with the behavior of the other functions in this
        file, and because we need a real answer here.
        (WebCore::Internals::scrollSnapOffsets): Ditto. Also rearranged the code so the renderer check is
        done after updating the renderer tree.

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

        Unreviewed, rolling out r221495.

        This change introduced  assertion failures on El Capitan Debug
        WK2.

        Reverted changeset:

        "Move ServiceWorkerJob from FetchLoader to ThreadableLoader."
        https://bugs.webkit.org/show_bug.cgi?id=176231
        http://trac.webkit.org/changeset/221495

2017-09-05  Chris Dumez  <cdumez@apple.com>

        Add support for input.webkitEntries
        https://bugs.webkit.org/show_bug.cgi?id=176257
        <rdar://problem/34218671>

        Reviewed by Andreas Kling.

        Add support for input.webkitEntries as per:
        - https://wicg.github.io/entries-api/#html-forms

        Our behavior matches Chrome and Firefox, rather than the specification. This means
        that webkitEntries is only populated if the webkitdirectory flag is unset.

        Tests: fast/forms/file/entries-api/drag-folder-webkitEntries.html
               fast/forms/file/entries-api/webkitdirectory-drag-folder-webkitEntries.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/entriesapi/HTMLInputElementEntriesAPI.cpp: Added.
        (WebCore::HTMLInputElementEntriesAPI::webkitEntries):
        * Modules/entriesapi/HTMLInputElementEntriesAPI.h: Added.
        * Modules/entriesapi/HTMLInputElementEntriesAPI.idl: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/scripts/generate-bindings.pl:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        (WebCore::jsTestInterfaceReflectAttributeGetter):
        (WebCore::jsTestInterfaceReflectAttribute):
        (WebCore::setJSTestInterfaceReflectAttributeSetter):
        (WebCore::setJSTestInterfaceReflectAttribute):
        * bindings/scripts/test/TestSupplemental.idl:
        * html/HTMLInputElement.idl:

2017-09-05  Chris Dumez  <cdumez@apple.com>

        FileSystemEntry API should ignore hidden files
        https://bugs.webkit.org/show_bug.cgi?id=176292
        <rdar://problem/34257666>

        Reviewed by Andreas Kling.

        FileSystemEntry API should ignore hidden files as the user likely does not mean
        to expose those when drag'n dropping a folder.

        Test: editing/pasteboard/enties-api/datatransfer-items-drop-hidden-file.html

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::listDirectoryWithMetadata):
        (WebCore::validatePathIsExpectedType):
        (WebCore::fileType):
        (WebCore::DOMFileSystem::getEntry):

2017-09-05  Myles C. Maxfield  <mmaxfield@apple.com>

        Update font selection algorithm to match latest CSS spec
        https://bugs.webkit.org/show_bug.cgi?id=175236

        Reviewed by Darin Adler.

        The CSS WG tweaked the generalization of the font selection
        algorithm between levels 3 and 4. In particular, the behavior
        of weights between 400 and 500 works a little differently.

        https://github.com/w3c/csswg-drafts/commit/f6973a21847f1c200ed38bff05dc543cebe1c827

        Test: fast/text/variations/font-selection-font-weight.html

        * platform/graphics/FontSelectionAlgorithm.cpp:
        (WebCore::FontSelectionAlgorithm::weightDistance const):
        * platform/graphics/FontSelectionAlgorithm.h:
        (WebCore::lowerWeightSearchThreshold):
        (WebCore::upperWeightSearchThreshold):
        (WebCore::weightSearchThreshold): Deleted.

2017-09-05  Per Arne Vollan  <pvollan@apple.com>

        [Win] Compile errors in pathByAppendingComponents.
        https://bugs.webkit.org/show_bug.cgi?id=176387

        Reviewed by Brent Fulgham.

        The pathByAppendingComponents function has changed signature.

        * platform/win/FileSystemWin.cpp:
        (WebCore::pathByAppendingComponents):

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

        Fix capitalization of scheduleinvalidateStyleAndLayerComposition
        https://bugs.webkit.org/show_bug.cgi?id=176266

        Reviewed by Antti Koivisto.

        * html/HTMLFrameOwnerElement.cpp:
        (WebCore::HTMLFrameOwnerElement::scheduleInvalidateStyleAndLayerComposition):
        (WebCore::HTMLFrameOwnerElement::scheduleinvalidateStyleAndLayerComposition): Deleted.
        * html/HTMLFrameOwnerElement.h:
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::attachRootLayer):
        (WebCore::RenderLayerCompositor::detachRootLayer):
        (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):

2017-09-05  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r221603.

        This caused accessibility/mac/select-element-selection-with-
        optgroups.html to consistently timeout on macOS

        Reverted changeset:

        "Fix a few minor problems found while working toward removing
        unneeded calls to updateStyle"
        https://bugs.webkit.org/show_bug.cgi?id=176279
        http://trac.webkit.org/changeset/221603

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

        Allow retrieving Cache Storage records for a given URL only
        https://bugs.webkit.org/show_bug.cgi?id=176202

        Reviewed by Alex Christensen.

        No observable change of behavior.

        Adding a URL parameter to CacheStorageConnection::retrieveRecords.
        If given URL is null, all records will be retrieved, which is useful for the keys method.
        Other operations only need records that share the same URL (modulo query string and frag id).

        * Modules/cache/Cache.cpp:
        (WebCore::Cache::matchAll):
        (WebCore::Cache::keys):
        (WebCore::Cache::retrieveRecords):
        (WebCore::Cache::queryCache):
        * Modules/cache/Cache.h:
        * Modules/cache/CacheStorageConnection.cpp:
        (WebCore::CacheStorageConnection::retrieveRecords):
        * Modules/cache/CacheStorageConnection.h:
        (WebCore::CacheStorageConnection::doRetrieveRecords):
        * Modules/cache/WorkerCacheStorageConnection.cpp:
        (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
        * Modules/cache/WorkerCacheStorageConnection.h:
        * platform/URL.h:

2017-09-05  Tim Horton  <timothy_horton@apple.com>

        Remove some unused bits of code and resources
        https://bugs.webkit.org/show_bug.cgi?id=176275

        Reviewed by Dan Bernstein.

        No new tests, just removing things.

        * Resources/textAreaResizeCorner.tiff: Removed.
        * Resources/missingImage.tiff: Removed.
        These files have PNG versions that include more resolutions.

        * Resources/hScrollControl_left.png: Removed.
        * Resources/hScrollControl_middle.png: Removed.
        * Resources/hScrollControl_right.png: Removed.
        * Resources/vScrollControl_bottom.png: Removed.
        * Resources/vScrollControl_middle.png: Removed.
        * Resources/vScrollControl_top.png: Removed.
        * Resources/decrementArrow.tiff: Removed.
        * Resources/incrementArrow.tiff: Removed.
        * Resources/markedLeft.png: Removed.
        * Resources/markedMiddle.png: Removed.
        * Resources/markedRight.png: Removed.
        These were added in r161638 as part of the iOS upstreaming, but were
        unused even then.

        * Resources/inputSpeech.tiff: Removed.
        The feature this image was for was removed in r172259; the PNG version
        of this image was removed in r172384.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/ios/FileSystemIOS.h: Removed.
        * platform/ios/FileSystemIOS.mm: Removed.
        Remove FileSystemIOS; one function is unused, the other is not at all
        iOS-specific and can be folded into FileSystemCocoa.

        * platform/FileSystem.h:
        * platform/cocoa/FileSystemCocoa.mm:
        (WebCore::createTemporaryDirectory):
        Move this in from FileSystemIOS.

        * platform/PlatformEvent.cpp: Removed.
        Remove this unused file.
        
        * platform/ios/QuickLook.mm:
        * platform/ios/WebItemProviderPasteboard.mm:
        Include FileSystem instead of FileSystemIOS.

2017-09-05  Frederic Wang  <fwang@igalia.com>

        Use TilesBacking for iframes when async frame scrolling is enabled
        https://bugs.webkit.org/show_bug.cgi?id=173644

        Reviewed by Simon Fraser.

        This patch adds creation of TilesBacking for non-main frames when async frame scrolling is
        enabled. RenderLayerBacking::m_isMainFrameLayerWithTiledBacking is also renamed to reflect
        that tiled backing is not exclusive to the main frame. More adjustments might be needed for
        non-main frames and will be handled in follow-up commits.

        Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html

        * rendering/RenderLayerBacking.cpp: Rename m_isMainFrameLayerWithTiledBacking
        * rendering/RenderLayerBacking.h: Rename isMainFrameLayerWithTiledBacking and
        m_isMainFrameLayerWithTiledBacking.
        * rendering/RenderLayerCompositor.cpp: Use isFrameLayerWithTiledBacking

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

        HTMLMediaElement: attach any existing EME CDMInstance in mediaEngineWasUpdated()
        https://bugs.webkit.org/show_bug.cgi?id=176354

        Reviewed by Xabier Rodriguez-Calvar.

        It's common for MediaKeys to be set on an HTMLMediaElement object before
        any resource is loaded for that element, meaning no underlying MediaPlayer
        exists at that point. In order to not stall the pipeline when encrypted
        content is finally loaded, the CDMInstance object of the current MediaKeys
        set on this element should be attached in mediaEngineWasUpdated() that's
        called whenever the underlying MediaPlayerPrivate object is replaced.

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

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

        [EME] HTMLMediaElement: setMediaKeys() should attach CDMInstance from the arriving MediaKeys
        https://bugs.webkit.org/show_bug.cgi?id=176352

        Reviewed by Xabier Rodriguez-Calvar.

        In HTMLMediaElement::setMediaKeys(), use the incoming MediaKeys object
        to retrieve the CDMInstance that is then attached to the current
        MediaPlayer, if any.

        Covered by existing W3C tests that focus on multi-key use cases.

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

2017-09-05  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        [Win] Fix the wincairo build after r221558 and r221583
        https://bugs.webkit.org/show_bug.cgi?id=176353

        Reviewed by Yusuke Suzuki.

        * platform/win/FileSystemWin.cpp:
        (WebCore::isSymbolicLink): Fix a "missing type specifier" error
        (WebCore::findDataToFileMetadata): Fix a narrowing convertion error

2017-09-04  Chris Dumez  <cdumez@apple.com>

        Use StringView more in DOMFileSystem code
        https://bugs.webkit.org/show_bug.cgi?id=176347

        Reviewed by Darin Adler.

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::resolveRelativeVirtualPath):
        (WebCore::DOMFileSystem::evaluatePath):
        * platform/FileSystem.h:
        * platform/glib/FileSystemGlib.cpp:
        (WebCore::pathByAppendingComponents):
        * platform/posix/FileSystemPOSIX.cpp:
        (WebCore::pathByAppendingComponents):
        * platform/win/FileSystemWin.cpp:
        (WebCore::pathByAppendingComponents):

2017-09-04  Eric Carlson  <eric.carlson@apple.com>

        Switch HTMLMediaElement to release logging
        https://bugs.webkit.org/show_bug.cgi?id=176065

        Reviewed by Jer Noble.

        * dom/Document.cpp:
        (WebCore::Document::privateBrowsingStateDidChange): Disable the logger when private browsing
        mode is enabled.
        (WebCore::Document::logger const):
        * dom/Document.h:

        Convert debug-only logging to configurable release logging.
        * html/HTMLMediaElement.cpp:
        (PAL::LogArgument<WebCore::URL>::toString): Logger template for URL that returns the url as a
        String when only when the LOG_DISABLED build flag is not defined. Returns "[url]" when it is.
        * html/HTMLMediaElement.h:

2017-09-04  Sam Weinig  <sam@webkit.org>

        [Canvas] Move non-standard functionality/aliases back to CanvasRenderingContext2D.idl
        https://bugs.webkit.org/show_bug.cgi?id=176340

        Reviewed by Darin Adler.

        In r221598 (https://webkit.org/b/176276), the CanvasRenderingContext2D was split out into
        separate interfaces to the match the spec and prepare for implementing OffscreenCanvas. While
        doing that, related non-standard functionality and aliases were moved as well. In retrospect,
        that doesn't really makes sense, as we don't want to add these legacy properties to any new
        interfaces that happen to implement/use the broken out interfaces. Since they are specific
        to CanvasRenderingContext2D, let's move them back.

        * html/canvas/CanvasCompositing.idl:
        * html/canvas/CanvasDrawImage.idl:
        * html/canvas/CanvasFillStrokeStyles.idl:
        * html/canvas/CanvasImageData.idl:
        * html/canvas/CanvasImageSmoothing.idl:
        * html/canvas/CanvasPathDrawingStyles.idl:
        * html/canvas/CanvasShadowStyles.idl:
        * html/canvas/CanvasRenderingContext2D.idl:

            Move non-standard operation and attributes back to CanvasRenderingContext2D.idl.

            * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::stringForCanvasFillRule): Deleted.
            
            Remove unused function.

        (WebCore::CanvasRenderingContext2D::setAlpha): Deleted.
        (WebCore::CanvasRenderingContext2D::setCompositeOperation): Deleted.

            Removed. Instead, the IDL uses [ImplementedAs] to forward to the 
            underlying setGlobalAlpha/setGlobalCompositeOperation. This reduces
            code and makes it clear they are strict aliases.

2017-09-03  Darin Adler  <darin@apple.com>

        Fix a few minor problems found while working toward removing unneeded calls to updateStyle
        https://bugs.webkit.org/show_bug.cgi?id=176279

        Reviewed by Antti Koivisto.

        * dom/Document.cpp:
        (WebCore::Document::updateTitleElement): Fix the algorithm so that an SVG title won't
        ever become the title when the document element is not an SVG element. We had this wrong
        before but we were passing the test because SVGTitleElement::insertedInto had a bug that
        hid the problem.
        (WebCore::Document::titleElementAdded): Pass a reference instead of a pointer.
        (WebCore::Document::titleElementRemoved): Pass a reference instead of nullptr since we
        want to know which element is being removed.

        * dom/Document.h: Update the argument name and type for updateTitleElement.

        * html/HTMLTitleElement.cpp:
        (WebCore::HTMLTitleElement::insertedInto): Call titleElementAdded unconditionally.
        The checks to see if the title element is connected to the document and not in the
        shadow tree are now handled by the Document class.
        (WebCore::HTMLTitleElement::removedFrom): Same for titleElementRemoved.

        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::applySize): Removed incorrect caching of FontCascade
        objects; these need to be created each time we draw.
        (WebCore::MockRealtimeVideoSource::drawText): Create all the fonts here. Since this is
        a mock for testing, there is no real performance concern with doing this.
        * platform/mock/MockRealtimeVideoSource.h: Removed the FontCascade data members.

        * rendering/RenderTreeAsText.cpp:
        (WebCore::updateLayoutIgnoringPendingStylesheetsIncludingSubframes): Added. Used below
        to update layout more thoroughly.
        (WebCore::externalRepresentation): Update layout of all descendant frames, not just
        the top level frame.

        * svg/SVGTitleElement.cpp:
        (WebCore::SVGTitleElement::insertedInto): Removed bogus firstChild check, bogus isSVGDocument
        check, and unneeded isConnected check and call titleElementAdded unconditionally. The checks
        are now handled by the Document class.
        (WebCore::SVGTitleElement::removedFrom): Same for titleElementRemoved.

        * testing/Internals.cpp:
        (WebCore::Internals::layerTreeAsText const): Added missing updateLayoutIgnorePendingStylesheets,
        since dumping the layer tree without first doing a layout will yield stale results.
        (WebCore::Internals::layerIDForElement): Added missing updateLayoutIgnorePendingStylesheets,
        since using a renderer to check if a layer exists without first doing a layout will yield stale results.
        (WebCore::Internals::setElementUsesDisplayListDrawing): Ditto.
        (WebCore::Internals::setElementTracksDisplayListReplay): Ditto.
        (WebCore::Internals::displayListForElement): Ditto.
        (WebCore::Internals::replayDisplayListForElement): Ditto.
        (WebCore::Internals::isSelectPopupVisible): Added missing updateLayoutIgnorePendingStylesheets,
        since working with the RenderMenuList without first doing a layout will yield stale results.
        Also removed unneeded strict handling of null renderer, instead just returning false.
        (WebCore::Internals::isPluginUnavailabilityIndicatorObscured): Removed unnneeded check of
        renderer class, since the HTMLPlugInElement::isReplacementObscured already handles that correctly.
        (WebCore::Internals::pageOverlayLayerTreeAsText const): Use updateLayoutIgnorePendingStylesheets
        instead of the normal updateLayout for consistency with the behavior of the other functions in this
        file, and because we need a real answer here.
        (WebCore::Internals::scrollSnapOffsets): Ditto. Also rearranged the code so the renderer check is
        done after updating the renderer tree.

2017-09-04  Yusuke Suzuki  <utatane.tea@gmail.com>

        Remove OS(SOLARIS) support
        https://bugs.webkit.org/show_bug.cgi?id=176341

        Reviewed by Sam Weinig.

        * bindings/scripts/preprocessor.pm:
        (applyPreprocessor):
        * dom/make_names.pl:
        * inspector/InspectorFrontendHost.cpp:
        (WebCore::InspectorFrontendHost::platform):
        * page/Page.h:

2017-09-04  Yusuke Suzuki  <utatane.tea@gmail.com>

        Unreviewed, fixing unused constant for initial buffer size
        https://bugs.webkit.org/show_bug.cgi?id=176310

        Follow-up patch after r221583. Pointed by darin@.

        * platform/graphics/win/FontPlatformDataWin.cpp:
        (WebCore::FontPlatformData::FontPlatformData):

2017-09-04  Sam Weinig  <sam@webkit.org>

        [Canvas] Split CanvasRenderingContext2D.idl into separate IDLs to match current HTML spec
        https://bugs.webkit.org/show_bug.cgi?id=176276

        Reviewed by Dean Jackson.

        - Splits CanvasRenderingContext2D.idl out into:
            CanvasState
            CanvasTransform
            CanvasCompositing
            CanvasImageSmoothing
            CanvasFillStrokeStyles
            CanvasShadowStyles
            CanvasFilters
            CanvasRect
            CanvasDrawPath
            CanvasUserInterface
            CanvasText
            CanvasDrawImage
            CanvasImageData
            CanvasPathDrawingStyles
            CanvasTextDrawingStyles
        - Renames CanvasWindingRule enum to CanvasFillRule, and moves it to its own file
          so it can be reused by multiple IDLs.
        - Renames DOMPath to Path2D, which is what it is supposed to be called, and doesn't
          conflict with any WebCore names.
        - Converts lineCap, lineJoin, textAlign, textBaseline, direction to use enums, rather
          than DOMStrings, allowing us to remove a bunch of custom parsing.
        - Non-standard canvas API was grouped with related functionality in the broken out
          IDLs and clearly marked as non-standard.
        - Comments were added for places where we break with the standard, mostly around use
          of float where we should be using double.

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        
            Add new files.
        
        * bindings/js/CallTracerTypes.h:
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::buildInitialState):
        (WebCore::InspectorCanvas::buildAction):

            Update for renames, and use new convertEnumerationToString to
            serialize enumerations.
        
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateEnumerationImplementationContent):
        (GenerateEnumerationHeaderContent):

            Split string conversion out of convertEnumerationToJS, and into
            its own function, convertEnumerationToString, to allow serialization
            to string outside of the bindings context, in this case, for the 
            InspectorCanvas.

        (GenerateParametersCheck):
        
            Improve error message to make it clear which operation has the issue
            in order to make debugging easier.

        * html/ImageData.idl:
        
            Re-order constructors to match specification, and add FIXME for incorrect
            default argument.
        
        * html/TextMetrics.idl:
            
            Add spec'd exposure and spec comments, as well a FIXME to convert the
            unrestricted float parameters should be doubles.

        * html/canvas/CanvasCompositing.idl: Added.
        * html/canvas/CanvasDirection.h: Added.
        * html/canvas/CanvasDirection.idl: Added.
        * html/canvas/CanvasDrawImage.idl: Added.
        * html/canvas/CanvasDrawPath.idl: Added.
        * html/canvas/CanvasFillRule.h: Added.
        * html/canvas/CanvasFillRule.idl: Added.
        * html/canvas/CanvasFillStrokeStyles.idl: Added.
        * html/canvas/CanvasFilters.idl: Added.
        * html/canvas/CanvasImageData.idl: Added.
        * html/canvas/CanvasImageSmoothing.idl: Added.
        * html/canvas/CanvasLineCap.h: Added.
        * html/canvas/CanvasLineCap.idl: Added.
        * html/canvas/CanvasLineJoin.h: Added.
        * html/canvas/CanvasLineJoin.idl: Added.
        * html/canvas/CanvasPathDrawingStyles.idl: Added.
        * html/canvas/CanvasRect.idl: Added.
        * html/canvas/CanvasShadowStyles.idl: Added.
        * html/canvas/CanvasState.idl: Added.
        * html/canvas/CanvasText.idl: Added.
        * html/canvas/CanvasTextAlign.h: Added.
        * html/canvas/CanvasTextAlign.idl: Added.
        * html/canvas/CanvasTextBaseline.h: Added.
        * html/canvas/CanvasTextBaseline.idl: Added.
        * html/canvas/CanvasTextDrawingStyles.idl: Added.
        * html/canvas/CanvasTransform.idl: Added.
        * html/canvas/CanvasUserInterface.idl: Added.
        * html/canvas/ImageSmoothingQuality.h: Added.
        * html/canvas/ImageSmoothingQuality.idl: Added.

            Move CanvasRenderingContext2D.idl content into separate files to
            match the specification.

        * html/canvas/CanvasGradient.idl:
        * html/canvas/CanvasPath.idl:
        * html/canvas/CanvasPattern.idl:

            Add exposure and FIXMEs on changes need to match the spec.

        * html/canvas/CanvasRenderingContext2D.cpp:
        * html/canvas/CanvasRenderingContext2D.h:

            Switch to using enums for lineCap, lineJoin, textAlign, textBaseline, and direction.
            Rather than using the parsing / stringifying functions from GraphicsTypes, add simple
            switch based to/from converters to convert to/from the canvas type to the platform
            type. Also update for rename of DOMPath -> Path2D and WindingRule -> CanvasFillRule.

            Unfortunately, not all custom parsing could be removed. To support the legacy functions
            setLineCap and setLineJoin, which take Strings, two simply parse paths had to be
            brought back. They can't use the enums, because the rules for enums as parameters
            is stricter that what was implemented in the custom code (e.g. the bindings would
            have thrown for strings not in the enum set).

        * html/canvas/CanvasRenderingContext2D.idl:

            Move most of the functions into the new files, which are then 'implemented' by
            this.

        * html/canvas/DOMPath.cpp: Removed.
        * html/canvas/DOMPath.h: Removed.
        * html/canvas/DOMPath.idl: Removed.
        * html/canvas/Path2D.cpp: Copied from Source/WebCore/html/canvas/DOMPath.cpp.
        * html/canvas/Path2D.h: Copied from Source/WebCore/html/canvas/DOMPath.h.
        * html/canvas/Path2D.idl: Copied from Source/WebCore/html/canvas/DOMPath.idl.

            Rename DOMPath to Path2D to match the spec..

        * platform/graphics/GraphicsTypes.cpp:
        (WebCore::parseLineCap): Deleted.
        (WebCore::lineCapName): Deleted.
        (WebCore::parseLineJoin): Deleted.
        (WebCore::lineJoinName): Deleted.
        (WebCore::textAlignName): Deleted.
        (WebCore::parseTextAlign): Deleted.
        (WebCore::textBaselineName): Deleted.
        (WebCore::parseTextBaseline): Deleted.
        * platform/graphics/GraphicsTypes.h:

            Remove now unused parsing / stringifying functions.

        * testing/Internals.cpp:

            Remove unused #include.

        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.h:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestObj.h:
        * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
        * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
        * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
        * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:

            Update test results to add convertEnumerationToString.

2017-09-03  Darin Adler  <darin@apple.com>

        Follow up FrameView::updateLayoutAndStyleIfNeededRecursive changes with related improvements
        https://bugs.webkit.org/show_bug.cgi?id=176277

        Reviewed by Antti Koivisto.

        * page/FrameView.cpp:
        (WebCore::FrameView::needsStyleRecalcOrLayout): Deleted. This function was only used
        by an assertion inside updateLayoutAndStyleIfNeededRecursive, and thus there is no reason
        for it to be in the header file, or for it to be a public member function.
        (WebCore::appendRenderedChildren): Deleted. This function was only used inside
        updateLayoutAndStyleIfNeededRecursive, and it is now packaged in an even better way
        for efficient use inside that function.
        (WebCore::FrameView::renderedChildFrameViews): Deleted. This function was only used
        inside needsStyleRecalcOrLayout, and it's now packaged in a better way inside that function.
        (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): Created a new lambda called
        nextRendereredDescendant that packages up the process of repeatedly iterating this view
        and all of its descendants in an easy-to-use way. Replaces both of the functions above.
        Rewrote to use it; it made the logic clear enough that it was good to get rid of the
        updateOneFrame lambda, too. Added two separate functions, one that checks for needed
        style recalculation and a separate one that checked for needed layout. Using those,
        replaced the old single assertion with two separate assertions.

        * page/FrameView.h: Removed needsStyleRecalcOrLayout, renderedChildFrameViews, and
        FrameViewList.

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

        [iOS DnD] Refactor drag and drop logic in WKContentView in preparation for supporting multiple drag items in a drag session
        https://bugs.webkit.org/show_bug.cgi?id=176264
        <rdar://problem/31144674>

        Reviewed by Darin Adler.

        Makes some small adjustments to WebItemProviderPasteboard. Rather than just -setItemProviders: on the
        WebItemProviderPasteboard when initiating a drag, also stage the WebItemProviderRegistrationList that will be
        used to generate an item provider. While it would be cleaner to avoid directly setting item providers so we
        don't overwrite item providers on the WebItemProviderPasteboard when adding items to an existing drag session,
        this isn't possible without breaking binary compability with older UIKit versions.

        Importantly, WKContentView will now ignore any item providers that have been set on the
        WebItemProviderPasteboard when initiating a drag or adding items to an existing drag session, and instead only
        consider the staged registration list when generating item providers for dragging. This only has the drawback of
        generating an unnecessary item provider, but otherwise maintains backwards compatibility while allowing us to
        provide WebKit2 support for multiple items per drag session.

        Tests: DataInteractionTests.DragEventClientCoordinatesBasic
               DataInteractionTests.DragEventClientCoordinatesWithScrollOffset
               DataInteractionTests.DragEventPageCoordinatesBasic
               DataInteractionTests.DragEventPageCoordinatesWithScrollOffset

        * platform/ios/AbstractPasteboard.h:
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::registerItemToPasteboard):

        Changed to only stage registration info on the item provider pasteboard, if possible. This has no effect on the
        copy/paste codepath, since it uses a UIPasteboard.

        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:

        Rename _registrationInfoLists to _stagedRegistrationInfoList, and change it from an array of registration info
        lists to a single registration info list. This could be updated in the future to be an array of registration
        lists, but currently, it serves no purpose and makes coordination with DragItem info more difficult. This would
        need to support multiple registration lists if we are to add a way to begin a drag containing multiple items in
        vanilla web content, such as dragging multiple selections.

        (-[WebItemProviderPasteboard init]):
        (-[WebItemProviderPasteboard setItemProviders:]):
        (-[WebItemProviderPasteboard stageRegistrationList:]):

        Sets the staged item provider registration list.

        (-[WebItemProviderPasteboard takeRegistrationList]):

        Removes the staged item provider registration list from the WebItemProviderPasteboard and also returns it.

        (-[WebItemProviderPasteboard registrationInfoAtIndex:]): Deleted.
        (-[WebItemProviderPasteboard setRegistrationInfoLists:]): Deleted.

2017-09-04  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r221494 and r221500.
        https://bugs.webkit.org/show_bug.cgi?id=176258

        This caused the windows build to fail. (Requested by mlewis13
        on #webkit).

        Reverted changesets:

        "Switch HTMLMediaElement to release logging"
        https://bugs.webkit.org/show_bug.cgi?id=176065
        http://trac.webkit.org/changeset/221494

        "Switch HTMLMediaElement to release logging"
        https://bugs.webkit.org/show_bug.cgi?id=176065
        http://trac.webkit.org/changeset/221500

2017-09-04  Sam Weinig  <sam@webkit.org>

        [WebIDL] Simplify EnabledBySettings generation
        https://bugs.webkit.org/show_bug.cgi?id=176312

        Reviewed by Darin Adler.

        * bindings/scripts/CodeGeneratorJS.pm:
        (NeedsRuntimeCheck):
        (OperationShouldBeOnInstance):
        (GeneratePropertiesHashTable):
        (GenerateRuntimeEnableConditionalString):
        (GenerateImplementation):
        (GenerateAttributeGetterBodyDefinition):

            - Simplify the [EnabledBySetting] code generation by merging it with the other
            runtime checks (Exposed, EnabledAtRuntime, EnabledForWorld, and SecureContext).

            - Switches to using WebCoreBuiltinNames for identifiers, rather than relying
            on the appropriate identifiers being available on JavaScriptCore's CommonIdentifiers
            which was an unnecessary layering violation. There are still problems with this
            as we continue to be inconsistent  about which identifiers deserve to be in 
            WebCoreBuiltinNames, and which ones can be created each time and there is no
            automation of WebCoreBuiltinNames from the IDLs.

            - Enforce at code generation time that [EnabledBySetting] can only be used
            on interfaces that are uniquely exposed to the window environment. This is a
            condition we should find a way to remove (e.g. propagating necessary settings 
            to an object the ScriptExecutionContext owns), but for now, Settings is a main
            thread only object.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
        (WebCore::JSDOMWindow::getOwnPropertySlot):
        (WebCore::JSDOMWindow::put):
        (WebCore::addCrossOriginWindowPropertyNames):
        (WebCore::addCrossOriginWindowOwnPropertyNames):

            Switch to using WebCoreBuiltinNames for WebCore specific identifiers.

        * bindings/js/WebCoreBuiltinNames.h:

            Add WebCore specific identifiers from JavaScriptCore's CommonIdentifiers
            as well as some new ones need by the [EnableBySetting] unification.

        * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: Added.
        * bindings/scripts/test/JS/JSTestEnabledBySetting.h: Added.
        * bindings/scripts/test/TestEnabledBySetting.idl: Added.

            Add new test for [EnabledBySetting].

        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/TestObj.idl:

            Remove use of [EnabledBySetting] from TestObj, as it is no longer
            valid to use [EnabledBySetting] on interfaces that are no uniquely
            exposed to the window environment.

2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>

        Remove "malloc" and "free" use
        https://bugs.webkit.org/show_bug.cgi?id=176310

        Reviewed by Darin Adler.

        Use MallocPtr<>, fastMalloc/fastFree, or Vector instead of manual call of system malloc/free.
        In this patch, we apply the above change if we can easily find the pair of malloc/free.
        And we do not touch plugin directory since the external code could call free() onto the
        fastMalloc-ed memory.

        Also, we still use malloc if the system adopts the allocated memory. Later, the system
        will deallocate it by calling the system "free".

        * platform/audio/mac/FFTFrameMac.cpp:
        (WebCore::FFTFrame::fftSetupForSize):
        (WebCore::FFTFrame::cleanup):
        * platform/graphics/win/FontCacheWin.cpp:
        (WebCore::getLinkedFonts):
        * platform/graphics/win/FontCustomPlatformData.cpp:
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/graphics/win/FontPlatformDataWin.cpp:
        (WebCore::FontPlatformData::FontPlatformData):
        * platform/mac/WebCoreNSURLExtras.mm:
        (WebCore::URLByTruncatingOneCharacterBeforeComponent):
        (WebCore::dataForURLComponentType):
        (WebCore::URLByRemovingComponentAndSubsequentCharacter):
        (WebCore::createStringWithEscapedUnsafeCharacters):
        (WebCore::userVisibleString):
        * platform/win/ClipboardUtilitiesWin.cpp:
        (WebCore::markupToCFHTML):

2017-09-03  Chris Dumez  <cdumez@apple.com>

        Use StringView in DOMFileSystem::evaluatePath()
        https://bugs.webkit.org/show_bug.cgi?id=176324

        Reviewed by Darin Adler.

        Use StringView in DOMFileSystem::evaluatePath() for performance.

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::resolveRelativeVirtualPath):
        (WebCore::DOMFileSystem::evaluatePath):
        * Modules/entriesapi/DOMFileSystem.h:

2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>

        String#utf8() allocates new CString
        https://bugs.webkit.org/show_bug.cgi?id=176302

        Reviewed by Sam Weinig.

        Several places uses String#utf8() like an accessor. In reality, it allocates new CString per call.
        It is very costly. Furthermore, some places uses this incorrectly. For example,
        `std::vector<char>(srtpAuth.utf8().data(), srtpAuth.utf8().data() + srtpAuth.utf8().length());`
        is incorrect since each time strpAuth.utf8() allocates different CString.

        This patch calls utf8() first and use it.

        * Modules/websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::startClosingHandshake):
        * platform/wpe/PlatformPasteboardWPE.cpp:
        (WebCore::PlatformPasteboard::write):

2017-09-03  Yusuke Suzuki  <utatane.tea@gmail.com>

        [SOUP] Use fastMalloced SoupBuffer in ResourcehandleSoup
        https://bugs.webkit.org/show_bug.cgi?id=176311

        Reviewed by Michael Catanzaro.

        Use fastMalloced memory instead of g_malloc for SoupBuffer.

        * platform/network/soup/ResourceHandleSoup.cpp:
        (WebCore::ResourceHandle::ensureReadBuffer):

2017-09-03  Chris Dumez  <cdumez@apple.com>

        Have getFileMetadata() return a std::optional<FileMetadata>
        https://bugs.webkit.org/show_bug.cgi?id=176293

        Reviewed by Darin Adler.

        Have getFileMetadata() return a std::optional<FileMetadata> instead of
        using an out parameter for the metadata.

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::listDirectoryWithMetadata):
        (WebCore::validatePathIsExpectedType):
        (WebCore::DOMFileSystem::getEntry):
        * html/FileListCreator.cpp:
        (WebCore::appendDirectoryFiles):
        * platform/FileSystem.cpp:
        (WebCore::fileIsDirectory):
        * platform/FileSystem.h:
        * platform/glib/FileSystemGlib.cpp:
        (WebCore::getFileMetadata):
        * platform/network/BlobDataFileReference.cpp:
        (WebCore::BlobDataFileReference::startTrackingModifications):
        * platform/network/mac/BlobDataFileReferenceMac.mm:
        (WebCore::BlobDataFileReference::generateReplacementFile):
        * platform/posix/FileSystemPOSIX.cpp:
        (WebCore::getFileMetadata):
        * platform/win/FileSystemWin.cpp:
        (WebCore::getFileMetadata):

2017-09-03  Sam Weinig  <sam@webkit.org>

        Remove CanvasProxy
        https://bugs.webkit.org/show_bug.cgi?id=176288

        Reviewed by Yusuke Suzuki.

        CanvasProxy does not appear to be in any current HTML spec
        and was disabled and unimplemented in our tree. Time to 
        get rid of it.

        * CMakeLists.txt:
        * Configurations/FeatureDefines.xcconfig:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * html/canvas/CanvasProxy.cpp: Removed.
        * html/canvas/CanvasProxy.h: Removed.
        * html/canvas/CanvasProxy.idl: Removed.

2017-09-02  Sam Weinig  <sam@webkit.org>

        DOMMatrix/DOMMatrixReadOnly validation is incorrect for NaN values
        https://bugs.webkit.org/show_bug.cgi?id=176287

        Reviewed by Chris Dumez.

        * css/DOMMatrixReadOnly.cpp:
        (WebCore::sameValueZero): Added.
        (WebCore::DOMMatrixReadOnly::validateAndFixup):

            Switch from using standard != to added sameValueZero helper
            which implements https://tc39.github.io/ecma262/#sec-samevaluezero

2017-09-02  Chris Dumez  <cdumez@apple.com>

        Implement FileSystemFileEntry.file()
        https://bugs.webkit.org/show_bug.cgi?id=176166
        <rdar://problem/34187756>

        Reviewed by Sam Weinig.

        Implement FileSystemFileEntry.file():
        - https://wicg.github.io/entries-api/#dom-filesystemfileentry-file

        Test: editing/pasteboard/datatransfer-items-drop-fileEntry-file.html

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::validatePathIsExpectedType):
        (WebCore::DOMFileSystem::listDirectory):
        (WebCore::DOMFileSystem::getParent):
        (WebCore::DOMFileSystem::getFile):
        * Modules/entriesapi/DOMFileSystem.h:
        * Modules/entriesapi/FileSystemFileEntry.cpp:
        (WebCore::FileSystemFileEntry::file):

2017-09-02  Andy Estes  <aestes@apple.com>

        [CA] Upstream QuartzCore-related WebKitSystemInterface functions
        https://bugs.webkit.org/show_bug.cgi?id=176270

        Reviewed by Tim Horton.

        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        (PlatformCALayerCocoa::enumerateRectsBeingDrawn):
        * platform/graphics/cocoa/WebCoreCALayerExtras.h:
        * platform/graphics/cocoa/WebCoreCALayerExtras.mm:
        (+[CALayer _web_renderLayerWithContextID:]):
        * platform/ios/WebCoreSystemInterfaceIOS.mm:
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:

2017-09-02  Emilio Cobos Álvarez  <emilio@crisal.io>

        Wrong getComputedStyle result for pseudo-elements in display: none subtrees.
        https://bugs.webkit.org/show_bug.cgi?id=176259

        Reviewed by Antti Koivisto.

        Before this patch, we were wrongly returning the parent style when there wasn't
        a cached pseudo style.

        With this, the only remaining failures in getComputedStyle-pseudo is a
        serialisation bug for the "content" property, and the display: contents test,
        which is because we don't support pseudo-elements of display: contents elements
        yet.

        Tests: imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html

        * dom/Document.cpp:
        (WebCore::Document::styleForElementIgnoringPendingStylesheets):
        * dom/Document.h:
        * dom/Element.cpp:
        (WebCore::Element::resolvePseudoElementStyle):
        (WebCore::Element::computedStyle):
        * dom/Element.h:

2017-09-02  Chris Dumez  <cdumez@apple.com>

        Implement FileSystemDirectoryEntry.getDirectory()
        https://bugs.webkit.org/show_bug.cgi?id=176168
        <rdar://problem/34187787>

        Reviewed by Darin Adler.

        Implement FileSystemDirectoryEntry.getDirectory() as per:
        - https://wicg.github.io/entries-api/#dom-filesystemdirectoryentry-getdirectory

        Test: editing/pasteboard/datatransfer-items-drop-getDirectory.html

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::isValidVirtualPath):
        (WebCore::resolveRelativeVirtualPath):
        (WebCore::DOMFileSystem::getEntry):
        * Modules/entriesapi/DOMFileSystem.h:
        * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
        (WebCore::FileSystemDirectoryEntry::getEntry):
        (WebCore::FileSystemDirectoryEntry::getFile):
        (WebCore::FileSystemDirectoryEntry::getDirectory):
        * Modules/entriesapi/FileSystemDirectoryEntry.h:

2017-09-02  Joseph Pecoraro  <pecoraro@apple.com>

        Performance / PerformanceObserver leaks seen on bots
        https://bugs.webkit.org/show_bug.cgi?id=176269

        Reviewed by Darin Adler.

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::removeAllEventListeners):
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::removeAllEventListeners):
        Also use this opportunity to break up the reference cycle
        between PerformanceObservers and the Performance object.

        * page/Performance.h:
        * page/Performance.cpp:
        (WebCore::Performance::removeAllObservers):
        Disassociate and clear observers.

        * page/PerformanceObserver.h:
        * page/PerformanceObserver.cpp:
        (WebCore::PerformanceObserver::disassociate):
        Clear the back-reference to the Performance object to
        break the cycle.

2017-09-02  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][Wayland] Use fast malloc to allocate backing store cairo surfaces data
        https://bugs.webkit.org/show_bug.cgi?id=176226

        Reviewed by Michael Catanzaro.

        It reduces the memory consumption and improves the performance. Also, since performance is better we don't need
        to keep the scroll surface allocated all the time, we can create it on demand and keep it allocated only while
        scrolling too fast.

        * platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp:
        (WebCore::createCairoImageSurfaceWithFastMalloc): Helper to create a cairo image surface using fast malloc.
        (WebCore::BackingStoreBackendCairoImpl::BackingStoreBackendCairoImpl): Create the main surface, but no the
        scroll one. Initialize the hysteresis activity to discard the scroll surface after scrolling.
        (WebCore::BackingStoreBackendCairoImpl::scroll): Create the scroll surface only if it's nullptr, and notify the
        hysteresis activity.
        * platform/graphics/cairo/BackingStoreBackendCairoImpl.h:

2017-09-01  Sam Weinig  <sam@webkit.org>

        DOMMatrix and DOMMatrixReadOnly should be available in workers
        https://bugs.webkit.org/show_bug.cgi?id=176255

        Reviewed by Simon Fraser.

        * WebCore.xcodeproj/project.pbxproj:

            Add GlobalPerformance.idl to the project. It was missing.

        * bindings/scripts/CodeGeneratorJS.pm:
        (IsAlwaysExposedOnInterface):
        (NeedsRuntimeCheck):
        (GenerateRuntimeEnableConditionalStringForExposed):
        (GenerateRuntimeEnableConditionalString):

            Adds support for [Exposed] extended attributes on operations, attributes and
            constants. This allows an interface that is exposed to both windows and workers 
            (with [Exposed=(Window,Worker)]), to indicate that a specific property should
            only be be exposed somewhere, e.g only the window. This is need by DOMMatrixReadOnly's
            stringifier, which is only exposed in the window environment.

        * bindings/scripts/IDLParser.pm:
        (parseExtendedAttributeRest2):

            Fix bug where array extended attributes, like those found in Exposed expressions
            where being converter to scalars.

        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/TestObj.idl:

            Add tests and update results. Some results are just improved
            includes.

        * css/DOMMatrix.cpp:
        * css/DOMMatrix.h:
        * css/DOMMatrix.idl:
        * css/DOMMatrixReadOnly.cpp:
        * css/DOMMatrixReadOnly.h:
        * css/DOMMatrixReadOnly.idl:
            
            Expose DOMMatrix and DOMMatrixReadOnly to workers and update the constructors
            to match the current spec, throwing if the argument is a string, and the context
            is not the window / document context. Also did some refactoring to avoid allocating
            the DOMMatrix or DOMMatrixReadOnly until after all the exceptional cases were handled.

2017-09-01  Chris Dumez  <cdumez@apple.com>

        Implement FileSystemDirectoryEntry.getFile()
        https://bugs.webkit.org/show_bug.cgi?id=176167
        <rdar://problem/34187775>

        Reviewed by Andreas Kling.

        Implement FileSystemDirectoryEntry.getFile():
        - https://wicg.github.io/entries-api/#dom-filesystemdirectoryentry-getfile

        Test: editing/pasteboard/datatransfer-items-drop-getFile.html

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::isValidPathNameCharacter):
        (WebCore::isValidPathSegment):
        (WebCore::isValidRelativeVirtualPath):
        (WebCore::isValidAbsoluteVirtualPath):
        (WebCore::isValidVirtualPath):
        Implement various path validation functions as per:
        - https://wicg.github.io/entries-api/#names-paths

        (WebCore::resolveRelativeVirtualPath):
        - Use StringView for second parameter for efficiency. Had to keep
          a String for the first parameter because I need the split to
          return a Vector.
        - If the input path is absolute, call recursively with '/' as
          base path so that the virtual path gets sanitized (i.e. '..'
          and '.' in the absolute URL get resolved).

        (WebCore::DOMFileSystem::listDirectory):
        Use String instead of auto. It is not much longer and is clearer.

        (WebCore::validatePathIsDirectory):
        (WebCore::DOMFileSystem::getParent):
        Move logic to validate that the path is a directory from getParent() to a
        separate function. This only makes sure the ScriptExecutionContext is only
        ref'd / deref'd on the main thread.

        (WebCore::validatePathIsFile):
        Logic for validating that a path is a file, used by getFile().

        (WebCore::DOMFileSystem::getFile):
        Implement getFile() as per:
        - https://wicg.github.io/entries-api/#dom-filesystemdirectoryentry-getfile

        * Modules/entriesapi/DOMFileSystem.h:
        * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
        (WebCore::FileSystemDirectoryEntry::getFile):
        Add implementation of FileSystemDirectoryEntry::getFile() which merely calls
        DOMFileSystem::getFile().

2017-09-01  Brady Eidson  <beidson@apple.com>

        ASSERTION FAILED: taken.get() == &job in WebCore::ServiceWorkerContainer::jobDidFinish(WebCore::ServiceWorkerJob &).
        https://bugs.webkit.org/show_bug.cgi?id=176234

        Rubberstamped by Tim Horton, reluctantly.

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::jobDidFinish): It's valid for the job to be missing after navigations, which is
          why this was hitting downstream tests.

2017-09-01  Youenn Fablet  <youenn@apple.com>

        Do not Reject CacheStorage promises when updating the persistent filesystem data fails
        https://bugs.webkit.org/show_bug.cgi?id=176241

        Reviewed by Alex Christensen.

        Open/Remove caches may succeed in updating the memory representation but the write-to-disk operation may fail.
        In that case, the corresponding promise is now resolved since the web page can still proceeed.

        There is no way to test that currently as this would require a write disk failure to be triggered.

        * Modules/cache/CacheStorage.cpp:
        (WebCore::logConsolePersistencyError):
        (WebCore::CacheStorage::open):
        (WebCore::CacheStorage::remove):
        * Modules/cache/DOMCacheEngine.h:
        (WebCore::DOMCacheEngine::CacheIdentifierOperationResult::encode const):
        (WebCore::DOMCacheEngine::CacheIdentifierOperationResult::decode):

2017-09-01  Youenn Fablet  <youenn@apple.com>

        [Fetch API] Add support for consuming a Request ReadableStream body
        https://bugs.webkit.org/show_bug.cgi?id=176182

        Reviewed by Alex Christensen.

        Tests: http/wpt/fetch/request-stream-empty.html
               http/wpt/fetch/request-stream-error.html

        Adding a ReadableStreamSink which allows to pipe all ReadableStream data back to C++ code.
        This sink only takes BufferSource as the only user is Fetch which has this restriction.
        This sink is tied to the readableStreamPipeTo builtin internal function that reads all data from the ReadableStream
        and send it to the sink.

        Adding a ReadableStreamToSharedBufferSink specialization to get the data as a SharedBuffer.

        Use that class in FetchBodyConsumer to get the data back from the ReadableStream and transform it according
        the desired body type (text, JSON, ArrayBuffer).

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::consume):
        (WebCore::FetchBody::loadingSucceeded):
        * Modules/fetch/FetchBodyConsumer.cpp:
        (WebCore::resolveWithTypeAndData):
        (WebCore::FetchBodyConsumer::clean):
        (WebCore::FetchBodyConsumer::resolveWithData):
        (WebCore::FetchBodyConsumer::resolve):
        * Modules/fetch/FetchBodyConsumer.h:
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::finishConsumingStream):
        * Modules/streams/ReadableStreamInternals.js:
        (readableStreamPipeTo):
        * Modules/streams/ReadableStreamSink.cpp: Added.
        (WebCore::ReadableStreamToSharedBufferSink::ReadableStreamToSharedBufferSink):
        (WebCore::ReadableStreamToSharedBufferSink::pipeFrom):
        (WebCore::ReadableStreamToSharedBufferSink::enqueue):
        (WebCore::ReadableStreamToSharedBufferSink::close):
        (WebCore::ReadableStreamToSharedBufferSink::error):
        * Modules/streams/ReadableStreamSink.h: Added.
        * Modules/streams/ReadableStreamSink.idl: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/ReadableStream.cpp:
        (WebCore::ReadableStream::pipeTo):
        * bindings/js/ReadableStream.h:

2017-09-01  Emilio Cobos Álvarez  <emilio@crisal.io>

        Wrong getComputedStyle behavior for pseudo-elements for layout-dependent properties.
        https://bugs.webkit.org/show_bug.cgi?id=175936

        Reviewed by Antti Koivisto.

        Before this patch we may wrongly end up using the wrong renderer to resolve
        this.

        Tests: imported/w3c/web-platform-tests/cssom/getComputedStyle-pseudo.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::styledElement const):
        (WebCore::ComputedStyleExtractor::styledRenderer const):
        (WebCore::ComputedStyleExtractor::propertyValue):
        * css/CSSComputedStyleDeclaration.h:

2017-09-01  Per Arne Vollan  <pvollan@apple.com>

        [Win] Compile error, 'Cache' is not declared.
        https://bugs.webkit.org/show_bug.cgi?id=176062

        Reviewed by Youenn Fablet.

        Rename Cache to DOMCache.

        No new tests, covered by existing tests. 

        * DerivedSources.make:
        * Modules/cache/Cache.cpp: Removed.
        * Modules/cache/Cache.h: Removed.
        * Modules/cache/Cache.idl: Removed.
        * Modules/cache/CacheStorage.cpp:
        (WebCore::doSequentialMatch):
        (WebCore::startSequentialMatch):
        (WebCore::copyCaches):
        (WebCore::CacheStorage::match):
        (WebCore::CacheStorage::retrieveCaches):
        (WebCore::CacheStorage::open):
        * Modules/cache/CacheStorage.h:
        * Modules/cache/DOMCache.cpp: Copied from Source/WebCore/Modules/cache/Cache.cpp.
        (WebCore::DOMCache::DOMCache):
        (WebCore::DOMCache::~DOMCache):
        (WebCore::DOMCache::match):
        (WebCore::DOMCache::doMatch):
        (WebCore::DOMCache::matchAll):
        (WebCore::DOMCache::add):
        (WebCore::DOMCache::requestFromInfo):
        (WebCore::DOMCache::addAll):
        (WebCore::DOMCache::put):
        (WebCore::DOMCache::remove):
        (WebCore::DOMCache::keys):
        (WebCore::DOMCache::retrieveRecords):
        (WebCore::DOMCache::queryCache):
        (WebCore::DOMCache::queryCacheWithTargetStorage):
        (WebCore::DOMCache::batchDeleteOperation):
        (WebCore::DOMCache::batchPutOperation):
        (WebCore::DOMCache::updateRecords):
        (WebCore::DOMCache::stop):
        (WebCore::DOMCache::activeDOMObjectName const):
        (WebCore::DOMCache::canSuspendForDocumentSuspension const):
        (WebCore::Cache::Cache): Deleted.
        (WebCore::Cache::~Cache): Deleted.
        (WebCore::Cache::match): Deleted.
        (WebCore::Cache::doMatch): Deleted.
        (WebCore::Cache::matchAll): Deleted.
        (WebCore::Cache::add): Deleted.
        (WebCore::Cache::requestFromInfo): Deleted.
        (WebCore::Cache::addAll): Deleted.
        (WebCore::Cache::put): Deleted.
        (WebCore::Cache::remove): Deleted.
        (WebCore::Cache::keys): Deleted.
        (WebCore::Cache::retrieveRecords): Deleted.
        (WebCore::Cache::queryCache): Deleted.
        (WebCore::Cache::queryCacheWithTargetStorage): Deleted.
        (WebCore::Cache::batchDeleteOperation): Deleted.
        (WebCore::Cache::batchPutOperation): Deleted.
        (WebCore::Cache::updateRecords): Deleted.
        (WebCore::Cache::stop): Deleted.
        (WebCore::Cache::activeDOMObjectName const): Deleted.
        (WebCore::Cache::canSuspendForDocumentSuspension const): Deleted.
        * Modules/cache/DOMCache.h: Copied from Source/WebCore/Modules/cache/Cache.h.
        * Modules/cache/DOMCache.idl: Copied from Source/WebCore/Modules/cache/Cache.idl.
        * WebCore.xcodeproj/project.pbxproj:

2017-09-01  Brady Eidson  <beidson@apple.com>

        Move ServiceWorkerJob from FetchLoader to ThreadableLoader.
        https://bugs.webkit.org/show_bug.cgi?id=176231

        Reviewed by Youenn Fablet.

        No new tests (No behavior change).

        * WebCore.xcodeproj/project.pbxproj:

        Re-indent these headers. Yuck!
        * loader/ThreadableLoader.h:
        (WebCore::ThreadableLoader::ref):
        (WebCore::ThreadableLoader::deref):
        (WebCore::ThreadableLoader::ThreadableLoader):
        (WebCore::ThreadableLoader::~ThreadableLoader):
        * loader/ThreadableLoaderClient.h:
        (WebCore::ThreadableLoaderClient::didSendData):
        (WebCore::ThreadableLoaderClient::didReceiveResponse):
        (WebCore::ThreadableLoaderClient::didReceiveData):
        (WebCore::ThreadableLoaderClient::didFinishLoading):
        (WebCore::ThreadableLoaderClient::didFail):
        (WebCore::ThreadableLoaderClient::didFinishTiming):
        (WebCore::ThreadableLoaderClient::ThreadableLoaderClient):
        (WebCore::ThreadableLoaderClient::~ThreadableLoaderClient):

        Move from FetchLoaderClient to ThreadableLoaderClient:
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::fetchScriptWithContext):
        (WebCore::ServiceWorkerJob::didReceiveResponse):
        (WebCore::ServiceWorkerJob::didReceiveData):
        (WebCore::ServiceWorkerJob::didFinishLoading):
        (WebCore::ServiceWorkerJob::didFail):
        (WebCore::ServiceWorkerJob::didSucceed): Deleted.
        * workers/service/ServiceWorkerJob.h:

        * workers/service/server/SWClientConnection.cpp: Add a now-required include.

2017-09-01  Eric Carlson  <eric.carlson@apple.com>

        Switch HTMLMediaElement to release logging
        https://bugs.webkit.org/show_bug.cgi?id=176065

        Reviewed by Jer Noble.

        * dom/Document.cpp:
        (WebCore::Document::privateBrowsingStateDidChange): Disable the logger when private browsing
        mode is enabled.
        (WebCore::Document::logger const):
        * dom/Document.h:

        Convert debug-only logging to configurable release logging.
        * html/HTMLMediaElement.cpp:
        (PAL::LogArgument<WebCore::URL>::toString): Logger template for URL that returns the url as a
        String when only when the LOG_DISABLED build flag is not defined. Returns "[url]" when it is.
        * html/HTMLMediaElement.h:

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

        transformCanLikelyUseFastPath() can read off the end of a string
        https://bugs.webkit.org/show_bug.cgi?id=176232
        rdar://problem/33851237

        Reviewed by Tim Horton.
        
        Code added in r220382 could read one byte past the end of the string when looking for the 'z'
        of a rotateZ() function. The code was actually incorrect, testing for the 'z at i+6 after
        already incrementing i by 6. This patch makes the code correctly detect rotateZ().
        
        Also, rotate functions at the end of a string could be ignored because kShortestValidTransformStringLength
        was too long, so set it to the length of "rotate(0)", the shortest transform function that we currently
        fast-parse.

        There's an implicit assumption in this code that chars is not indexed past i+kShortestValidTransformStringLength.
        If the 'translate' path is taken, i is incremented by 9 (==kShortestValidTransformStringLength), but that's
        OK because WTF::find() doesn't index into chars if i >= length.

        Test: fast/css/transform-fast-paths.html

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

2017-09-01  Andy Estes  <aestes@apple.com>

        [CG] Upstream CoreGraphics-related WebKitSystemInterface functions
        https://bugs.webkit.org/show_bug.cgi?id=176200

        Reviewed by Tim Horton.

        * platform/graphics/GraphicsContext.h:
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::subsamplingLevelForScaleFactor):
        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::GraphicsContext::clipOut):
        (WebCore::applyShadowOffsetWorkaroundIfNeeded):
        * platform/graphics/cg/PatternCG.cpp:
        (WebCore::Pattern::createPlatformPattern const):
        * platform/graphics/cocoa/GraphicsContextCocoa.mm:
        (WebCore::GraphicsContext::focusRingColor):
        (WebCore::drawFocusRingAtTime):
        (WebCore::drawFocusRing):
        (WebCore::drawFocusRingToContext):
        (WebCore::drawFocusRingToContextAtTime):
        * platform/ios/WebCoreSystemInterfaceIOS.mm:
        * platform/mac/PasteboardMac.mm:
        (WebCore::flipImageSpec):
        (WebCore::setDragImageImpl):
        (WebCore::Pasteboard::setDragImage):
        * platform/mac/PlatformEventFactoryMac.mm:
        * platform/mac/ScrollbarThemeMac.mm:
        (WebCore::linenBackgroundColor):
        * platform/mac/ThemeMac.mm:
        (WebCore::drawCellFocusRingWithFrameAtTime):
        (WebCore::drawCellFocusRing):
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:
        * platform/mac/WebWindowAnimation.mm:
        (flipRect):
        (mainWindowServerConnectionID):
        (setScaledFrameForWindow):
        (-[WebWindowScaleAnimation setCurrentProgress:]):
        (-[WebWindowFadeAnimation setCurrentProgress:]):

2017-09-01  Youenn Fablet  <youenn@apple.com>

        Reject promises in case of internal CacheStorage engine errors.
        https://bugs.webkit.org/show_bug.cgi?id=176194

        Reviewed by Alex Christensen.

        No new tests as this covers error cases that should not happen in regular cases.
        Replacing lambdas that take no parameters to lambdas taking an optional error.
        Reject promise if an error is found.

        * Modules/cache/Cache.cpp:
        (WebCore::Cache::doMatch):
        (WebCore::Cache::matchAll):
        (WebCore::Cache::keys):
        (WebCore::Cache::retrieveRecords):
        (WebCore::Cache::queryCache):
        * Modules/cache/Cache.h:
        * Modules/cache/CacheStorage.cpp:
        (WebCore::CacheStorage::match):
        (WebCore::CacheStorage::has):
        (WebCore::CacheStorage::retrieveCaches):
        (WebCore::CacheStorage::open):
        (WebCore::CacheStorage::remove):
        (WebCore::CacheStorage::keys):
        * Modules/cache/CacheStorage.h:

2017-09-01  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed WPE build fix after r221439.

        * html/canvas/WebGL2RenderingContext.cpp: Add the HeapInlines.h
        header include in order to properly inline a Heap::vm() call.

2017-09-01  Chris Dumez  <cdumez@apple.com>

        Implement FileSystemEntry.getParent()
        https://bugs.webkit.org/show_bug.cgi?id=176165
        <rdar://problem/34187743>

        Reviewed by Andreas Kling.

        Implement FileSystemEntry.getParent():
        - https://wicg.github.io/entries-api/#dom-filesystementry-getparent

        Tests: editing/pasteboard/datatransfer-items-drop-getParent-root.html
               editing/pasteboard/datatransfer-items-drop-getParent.html
               editing/pasteboard/datatransfer-items-drop-getParent2.html

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::toFileSystemEntries):
        Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.

        (WebCore::isAbsoluteVirtualPath):
        Add utility function to determine if a virtual path is absolute:
        - https://wicg.github.io/entries-api/#absolute-path

        (WebCore::DOMFileSystem::root):
        Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.

        (WebCore::DOMFileSystem::fileAsEntry):
        Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.

        (WebCore::resolveRelativePath):
        Add implementation for:
        - https://wicg.github.io/entries-api/#resolve-a-relative-path

        (WebCore::DOMFileSystem::listDirectory):
        Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.

        (WebCore::DOMFileSystem::getParent):
        Add implementation of getParent() as per:
        - https://wicg.github.io/entries-api/#dom-filesystementry-getparent

        * Modules/entriesapi/DOMFileSystem.h:
        (WebCore::DOMFileSystem::createEntryForFile):
        * Modules/entriesapi/DOMFileSystem.idl:
        * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
        (WebCore::FileSystemDirectoryEntry::FileSystemDirectoryEntry):
        * Modules/entriesapi/FileSystemDirectoryEntry.h:
        * Modules/entriesapi/FileSystemDirectoryReader.cpp:
        (WebCore::FileSystemDirectoryReader::readEntries):
        Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.

        * Modules/entriesapi/FileSystemEntry.cpp:
        (WebCore::FileSystemEntry::FileSystemEntry):
        (WebCore::FileSystemEntry::activeDOMObjectName const):
        (WebCore::FileSystemEntry::canSuspendForDocumentSuspension const):
        (WebCore::FileSystemEntry::getParent):
        * Modules/entriesapi/FileSystemEntry.h:
        * Modules/entriesapi/FileSystemEntry.idl:
        - Add implementation of FileSystemEntry.getParent() which relies on
          DOMFileSystem::getParent()
        - Make FileSystemEntry an ActiveDOMObject as getParent() is an asynchronous
          operation which causes delayed JS execution.

        * Modules/entriesapi/FileSystemFileEntry.cpp:
        (WebCore::FileSystemFileEntry::FileSystemFileEntry):
        * Modules/entriesapi/FileSystemFileEntry.h:
        * dom/DataTransferItem.cpp:
        (WebCore::DataTransferItem::getAsEntry const):
        * dom/DataTransferItem.h:
        * dom/DataTransferItem.idl:
        Take a ScriptExecutionContext now that FileSystemEntry is an ActiveDOMObject.

2017-09-01  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        Ensure RenderStyle and SameSizeAsRenderStyle have the same size
        https://bugs.webkit.org/show_bug.cgi?id=176210

        Reviewed by Daniel Bates.

        SameSizeAsRenderStyle::m_nonInheritedFlags requires a 64 bit alignment,
        which currently produces an extra 32 bit padding with 32 bit build.

        * rendering/style/RenderStyle.cpp:
        Make m_nonInheritedFlags 32 bit aligned and restore the size check.

2017-09-01  Per Arne Vollan  <pvollan@apple.com>

        [Win] Compile error, 'Cache' is not declared.
        https://bugs.webkit.org/show_bug.cgi?id=176062

        Reviewed by Youenn Fablet.

        Rename DOMCache to DOMCacheEngine.

        No new tests, covered by existing tests. 

        * Modules/cache/Cache.cpp:
        (WebCore::Cache::addAll):
        (WebCore::Cache::put):
        (WebCore::queryCacheMatch):
        (WebCore::Cache::batchDeleteOperation):
        (WebCore::toConnectionRecord):
        (WebCore::Cache::batchPutOperation):
        * Modules/cache/Cache.h:
        * Modules/cache/CacheStorage.cpp:
        (WebCore::CacheStorage::open):
        (WebCore::CacheStorage::remove):
        * Modules/cache/CacheStorageConnection.cpp:
        * Modules/cache/CacheStorageConnection.h:
        (WebCore::CacheStorageConnection::clearMemoryRepresentation):
        (WebCore::CacheStorageConnection::openCompleted):
        (WebCore::CacheStorageConnection::removeCompleted):
        (WebCore::CacheStorageConnection::doOpen):
        (WebCore::CacheStorageConnection::doRemove):
        (WebCore::CacheStorageConnection::doBatchDeleteOperation):
        (WebCore::CacheStorageConnection::doBatchPutOperation):
        * Modules/cache/DOMCache.cpp: Removed.
        * Modules/cache/DOMCache.h: Removed.
        * Modules/cache/DOMCacheEngine.cpp: Copied from Source/WebCore/Modules/cache/DOMCache.cpp.
        (WebCore::DOMCacheEngine::isolatedResponseBody):
        (WebCore::DOMCacheEngine::copyResponseBody):
        (WebCore::DOMCache::errorToException): Deleted.
        (WebCore::DOMCache::queryCacheMatch): Deleted.
        (WebCore::DOMCache::isolatedResponseBody): Deleted.
        (WebCore::DOMCache::copyResponseBody): Deleted.
        (WebCore::DOMCache::Record::copy const): Deleted.
        * Modules/cache/DOMCacheEngine.h: Copied from Source/WebCore/Modules/cache/DOMCache.h.
        * Modules/cache/WorkerCacheStorageConnection.cpp:
        * Modules/cache/WorkerCacheStorageConnection.h:
        * WebCore.xcodeproj/project.pbxproj:
        * testing/Internals.cpp:
        (WebCore::Internals::clearCacheStorageMemoryRepresentation):

2017-08-31  Andy Estes  <aestes@apple.com>

        [Mac] Upstream AppKit-related WebKitSystemInterface functions
        https://bugs.webkit.org/show_bug.cgi?id=176175

        Reviewed by Brady Eidson.

        * Configurations/WebCore.xcconfig: Added -ObjC to OTHER_LDFLAGS so that Objective-C classes
        in PAL are exported by WebCore even if WebCore doesn't use them.
        * platform/mac/PlatformEventFactoryMac.h:
        * platform/mac/PlatformEventFactoryMac.mm:
        (WebCore::getWheelEventDeltas):
        (WebCore::keyCharForEvent):
        (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder):
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:

2017-08-31  Alex Christensen  <achristensen@webkit.org>

        Fix Windows build after r221422
        https://bugs.webkit.org/show_bug.cgi?id=174924

        * platform/text/win/LocaleWin.cpp:
        (WebCore::LocaleWin::getLocaleInfoString):
        StringVector is now the type that can be adopted by String::adopt.

2017-08-31  Daniel Bates  <dabates@apple.com>

        Another attempt to fix the Apple Windows build following <https://trac.webkit.org/changeset/221459>
        (https://bugs.webkit.org/show_bug.cgi?id=176171)

        Temporarily weaken the size check for RenderStyle from a strict equality to <=.

        * rendering/style/RenderStyle.cpp:

2017-08-31  Daniel Bates  <dabates@apple.com>

        Attempt to fix the Apple Windows and WinCairo build following <https://trac.webkit.org/changeset/221459>
        (https://bugs.webkit.org/show_bug.cgi?id=176171)

        Explicitly cast PseudoIds to unsigned before computing a difference between two PseudoIds.

        * rendering/style/RenderStyle.h:

2017-08-31  Alex Christensen  <achristensen@webkit.org>

        Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolveWebGLLoadPolicy
        https://bugs.webkit.org/show_bug.cgi?id=175779
        <rdar://problem/22367975>

        Reviewed by Tim Horton.

        Covered by new API tests.

        * loader/FrameLoaderClient.h:

2017-08-31  Andreas Kling  <akling@apple.com>

        Element focus appearance update should be either immediate or a post-layout task
        https://bugs.webkit.org/show_bug.cgi?id=176193

        Reviewed by Antti Koivisto.

        This change removes an old mechanism for avoiding element focus appearance updates
        while we might be in the middle of attaching a renderer.

        Focus appearance updates depend on a clean layout, since they want to be able to
        scroll the element into the visible viewport if needed.
        We now simply do the updates either immediately after layout in Element::focus(),
        or as a post-layout callback when needed for HTMLInputElement::didAttachRenderers().

        * dom/Document.cpp:
        (WebCore::Document::Document):
        (WebCore::Document::updateFocusAppearanceSoon): Deleted.
        (WebCore::Document::cancelFocusAppearanceUpdate): Deleted.
        (WebCore::Document::updateFocusAppearanceTimerFired): Deleted.
        * dom/Document.h:
        * dom/Element.cpp:
        (WebCore::Element::focus):
        (WebCore::Element::blur):
        (WebCore::Element::clearStyleDerivedDataBeforeDetachingRenderer):
        (WebCore::Element::updateFocusAppearanceAfterAttachIfNeeded): Deleted.
        (WebCore::Element::cancelFocusAppearanceUpdate): Deleted.
        * dom/Element.h:
        * dom/ElementRareData.h:
        (WebCore::ElementRareData::ElementRareData):
        (WebCore::ElementRareData::needsFocusAppearanceUpdateSoonAfterAttach const): Deleted.
        (WebCore::ElementRareData::setNeedsFocusAppearanceUpdateSoonAfterAttach): Deleted.
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::didAttachRenderers):

2017-08-31  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Make USE_CF conditional within Windows
        https://bugs.webkit.org/show_bug.cgi?id=176173

        Reviewed by Alex Christensen.

        No new tests. No change in behavior.

        * PlatformWin.cmake:
        * WebCorePrefix.h:
        * testing/js/WebCoreTestSupportPrefix.h:

2017-08-31  Sam Weinig  <sam@webkit.org>

        Implement DOMMatrix2DInit for setTransform()/addPath()
        https://bugs.webkit.org/show_bug.cgi?id=176048

        Reviewed by Simon Fraser.

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

            Add new files.

        * bindings/js/CallTracerTypes.h:
        * inspector/InspectorCanvas.cpp:
        
            Swap out DOMMatrixInit for DOMMatrix2DInit in canvas tracing infrastructure.

        * css/DOMMatrix2DInit.h: Added.
        * css/DOMMatrix2DInit.idl: Added.
        * css/DOMMatrixInit.h:
        * css/DOMMatrixInit.idl:
        Split DOMMatrixInit in two, with the 2D bits going into DOMMatrix2DInit.
        
        * css/DOMMatrixReadOnly.cpp:
        * css/DOMMatrixReadOnly.h:
        
            Add a validateAndFixup overload for DOMMatrix2DInit.
        
        * html/canvas/CanvasRenderingContext2D.cpp:
        * html/canvas/CanvasRenderingContext2D.h:

            Swap out DOMMatrixInit for DOMMatrix2DInit in setTransform. This
            should have no observable difference, since we ignored the 3D prior.

        * html/canvas/DOMPath.cpp:
        * html/canvas/DOMPath.h:
        * html/canvas/DOMPath.idl:

            Update DOMPath (actually called Path2D) to take an optional DOMMatrix2DInit
            rather than an SVGMatrix. Passing an SVGMatrix is still valid, as it conforms
            as a DOMMatrix2DInit dictionary (having the necessary properties), so the
            risk of compatibility issues is minimal.

2017-08-31  Brady Eidson  <beidson@apple.com>

        Add (entirely incorrect) fetching of ServiceWorker scripts.
        https://bugs.webkit.org/show_bug.cgi?id=176179

        Reviewed by Andy Estes.

        No new tests (Covered by changes to existing tests).

        When the Storage process is running the "Update" algorithm and a ServiceWorker script file needs to be fetched, this patch:
          - Messages back to the WebContent process that started the register/update job
          - Executes a FetchLoad in that script context for the script
          - Sends the results back to the Storage process

        We don't do anything with the results yet.

        Soon.

        * WebCore.xcodeproj/project.pbxproj:

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
        (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
        (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
        * workers/service/ServiceWorkerContainer.h:

        * workers/service/ServiceWorkerFetchResult.h: Copied from Source/WebCore/workers/service/server/SWClientConnection.h.
        (WebCore::ServiceWorkerFetchResult::encode const):
        (WebCore::ServiceWorkerFetchResult::decode):

        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::startScriptFetch):
        (WebCore::ServiceWorkerJob::fetchScriptWithContext):
        (WebCore::ServiceWorkerJob::didReceiveResponse):
        (WebCore::ServiceWorkerJob::didReceiveData):
        (WebCore::ServiceWorkerJob::didSucceed):
        (WebCore::ServiceWorkerJob::didFail):
        * workers/service/ServiceWorkerJob.h:

        * workers/service/ServiceWorkerJobClient.h:

        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::finishedFetchingScript):
        (WebCore::SWClientConnection::failedFetchingScript):
        (WebCore::SWClientConnection::startScriptFetchForServer):
        * workers/service/server/SWClientConnection.h:

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::finishFetchingScriptInServer):
        (WebCore::SWServer::startScriptFetch):
        (WebCore::SWServer::scriptFetchFinished):
        * workers/service/server/SWServer.h:

        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::scriptFetchFinished):
        (WebCore::SWServerRegistration::runUpdateJob):
        (WebCore::SWServerRegistration::startScriptFetchFromMainThread):
        (WebCore::SWServerRegistration::startScriptFetchForCurrentJob):
        * workers/service/server/SWServerRegistration.h:

2017-08-31  Daniel Bates  <dabates@apple.com>

        Make RenderStyle's non-inherited flags more human friendly
        https://bugs.webkit.org/show_bug.cgi?id=176171

        Reviewed by Antti Koivisto.

        Revert r166465 as we never followed through and made the CSS JIT update
        RenderStyle's non-inherited flags directly.

        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::RenderStyle):
        (WebCore::RenderStyle::hashForTextAutosizing const):
        (WebCore::RenderStyle::equalForTextAutosizing const):
        (WebCore::RenderStyle::changeRequiresLayout const):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::styleType const):
        (WebCore::RenderStyle::setStyleType):
        (WebCore::RenderStyle::setHasViewportUnits):
        (WebCore::RenderStyle::hasViewportUnits const):
        (WebCore::RenderStyle::affectedByHover const):
        (WebCore::RenderStyle::affectedByActive const):
        (WebCore::RenderStyle::affectedByDrag const):
        (WebCore::RenderStyle::setAffectedByHover):
        (WebCore::RenderStyle::setAffectedByActive):
        (WebCore::RenderStyle::setAffectedByDrag):
        (WebCore::RenderStyle::isFloating const):
        (WebCore::RenderStyle::display const):
        (WebCore::RenderStyle::position const):
        (WebCore::RenderStyle::floating const):
        (WebCore::RenderStyle::overflowX const):
        (WebCore::RenderStyle::overflowY const):
        (WebCore::RenderStyle::verticalAlign const):
        (WebCore::RenderStyle::unicodeBidi const):
        (WebCore::RenderStyle::clear const):
        (WebCore::RenderStyle::tableLayout const):
        (WebCore::RenderStyle::hasExplicitlySetDirection const):
        (WebCore::RenderStyle::isLink const):
        (WebCore::RenderStyle::setDisplay):
        (WebCore::RenderStyle::setOriginalDisplay):
        (WebCore::RenderStyle::setPosition):
        (WebCore::RenderStyle::setFloating):
        (WebCore::RenderStyle::setOverflowX):
        (WebCore::RenderStyle::setOverflowY):
        (WebCore::RenderStyle::setVerticalAlign):
        (WebCore::RenderStyle::setUnicodeBidi):
        (WebCore::RenderStyle::setClear):
        (WebCore::RenderStyle::setTableLayout):
        (WebCore::RenderStyle::setHasExplicitlySetDirection):
        (WebCore::RenderStyle::setIsLink):
        (WebCore::RenderStyle::hasExplicitlySetWritingMode const):
        (WebCore::RenderStyle::setHasExplicitlySetWritingMode):
        (WebCore::RenderStyle::hasExplicitlySetTextAlign const):
        (WebCore::RenderStyle::setHasExplicitlySetTextAlign):
        (WebCore::RenderStyle::unique const):
        (WebCore::RenderStyle::setUnique):
        (WebCore::RenderStyle::emptyState const):
        (WebCore::RenderStyle::setEmptyState):
        (WebCore::RenderStyle::firstChildState const):
        (WebCore::RenderStyle::setFirstChildState):
        (WebCore::RenderStyle::lastChildState const):
        (WebCore::RenderStyle::setLastChildState):
        (WebCore::RenderStyle::setHasExplicitlyInheritedProperties):
        (WebCore::RenderStyle::hasExplicitlyInheritedProperties const):
        (WebCore::RenderStyle::inheritUnicodeBidiFrom):
        (WebCore::RenderStyle::NonInheritedFlags::operator!= const):
        (WebCore::RenderStyle::NonInheritedFlags::hasAnyPublicPseudoStyles const):
        (WebCore::RenderStyle::originalDisplay const):
        (WebCore::RenderStyle::NonInheritedFlags::operator== const):
        (WebCore::RenderStyle::NonInheritedFlags::copyNonInheritedFrom):
        (WebCore::RenderStyle::NonInheritedFlags::hasPseudoStyle const):
        (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyle):
        (WebCore::RenderStyle::NonInheritedFlags::overflowX const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setOverflowX): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::overflowY const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setOverflowY): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::clear const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setClear): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::effectiveDisplay const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setEffectiveDisplay): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::position const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setPosition): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::originalDisplay const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setOriginalDisplay): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::unicodeBidi const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setUnicodeBidi): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::hasViewportUnits const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setHasViewportUnits): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::verticalAlign const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setVerticalAlign): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlyInheritedProperties const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlyInheritedProperties): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::isFloating const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::floating const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setFloating): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::tableLayout const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setTableLayout): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::styleType const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setStyleType): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::isUnique const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setIsUnique): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::emptyState const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setEmptyState): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::firstChildState const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setFirstChildState): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::lastChildState const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setLastChildState): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::affectedByHover const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setAffectedByHover): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::affectedByActive const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setAffectedByActive): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::affectedByDrag const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setAffectedByDrag): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::isLink const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setIsLink): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetDirection const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetDirection): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetWritingMode const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetWritingMode): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetTextAlign const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetTextAlign): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::flagsMemoryOffset): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::flagIsaffectedByActive): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::flagIsaffectedByHover): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::flagPseudoStyle): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setFirstChildStateFlags): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setLastChildStateFlags): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::flagIsUnique): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::flagFirstChildState): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::flagLastChildState): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::NonInheritedFlags): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::setHasPseudoStyles): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::updateBoolean): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::getBoolean const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::updateValue): Deleted.
        (WebCore::RenderStyle::InheritedFlags::operator== const): Deleted.
        (WebCore::RenderStyle::NonInheritedFlags::getValue const): Deleted.
        (WebCore::adjustForAbsoluteZoom): Deleted.
        (WebCore::adjustFloatForAbsoluteZoom): Deleted.
        (WebCore::adjustLayoutUnitForAbsoluteZoom): Deleted.
        (WebCore::collapsedBorderStyle): Deleted.
        (WebCore::RenderStyle::hasBackground const): Deleted.
        (WebCore::RenderStyle::autoWrap): Deleted.
        (WebCore::RenderStyle::preserveNewline): Deleted.
        (WebCore::RenderStyle::collapseWhiteSpace): Deleted.
        (WebCore::RenderStyle::isCollapsibleWhiteSpace const): Deleted.
        (WebCore::RenderStyle::breakOnlyAfterWhiteSpace const): Deleted.
        (WebCore::RenderStyle::breakWords const): Deleted.
        (WebCore::RenderStyle::hasInlineColumnAxis const): Deleted.
        (WebCore::RenderStyle::imageOrientation const): Deleted.
        (WebCore::RenderStyle::setLogicalWidth): Deleted.
        (WebCore::RenderStyle::setLogicalHeight): Deleted.
        (WebCore::RenderStyle::setBorderRadius): Deleted.
        (WebCore::RenderStyle::setZoom): Deleted.
        (WebCore::RenderStyle::setEffectiveZoom): Deleted.
        (WebCore::RenderStyle::setTextOrientation): Deleted.
        (WebCore::RenderStyle::adjustBackgroundLayers): Deleted.
        (WebCore::RenderStyle::adjustMaskLayers): Deleted.
        (WebCore::RenderStyle::clearAnimations): Deleted.
        (WebCore::RenderStyle::clearTransitions): Deleted.
        (WebCore::RenderStyle::setShapeOutside): Deleted.
        (WebCore::RenderStyle::setShapeImageThreshold): Deleted.
        (WebCore::RenderStyle::setClipPath): Deleted.
        (WebCore::RenderStyle::willChangeCreatesStackingContext const): Deleted.
        (WebCore::RenderStyle::isDisplayRegionType const): Deleted.
        (WebCore::RenderStyle::setWritingMode): Deleted.
        (WebCore::RenderStyle::getShadowInlineDirectionExtent const): Deleted.
        (WebCore::RenderStyle::getShadowBlockDirectionExtent const): Deleted.
        (WebCore::RenderStyle::isDisplayReplacedType): Deleted.
        (WebCore::RenderStyle::isDisplayInlineType): Deleted.
        (WebCore::RenderStyle::isDisplayFlexibleBox): Deleted.
        (WebCore::RenderStyle::isDisplayGridBox): Deleted.
        (WebCore::RenderStyle::isDisplayFlexibleOrGridBox): Deleted.
        (WebCore::RenderStyle::hasAnyPublicPseudoStyles const): Deleted.
        (WebCore::RenderStyle::hasPseudoStyle const): Deleted.
        (WebCore::RenderStyle::setHasPseudoStyle): Deleted.
        (WebCore::RenderStyle::setHasPseudoStyles): Deleted.
        (WebCore::RenderStyle::setBoxReflect): Deleted.
        (WebCore::pseudoElementRendererIsNeeded): Deleted.

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

        Remove newBlockInsideInlineModel and anonymous inline block
        https://bugs.webkit.org/show_bug.cgi?id=176181

        Reviewed by Zalan Bujtas.

        Anonymous inline block exists to support newBlockInsideInlineModel which was planned as the replacement for continuations.
        It has never been enabled and it is time to remove it.

        * page/Settings.in:
        * rendering/InlineElementBox.cpp:
        (WebCore::InlineElementBox::paint):
        (WebCore::InlineElementBox::nodeAtPoint):
        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::addToLine):
        (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
        (WebCore::InlineFlowBox::nodeAtPoint):
        (WebCore::InlineFlowBox::paint):
        (WebCore::InlineFlowBox::anonymousInlineBlock const): Deleted.
        * rendering/InlineFlowBox.h:
        (WebCore::InlineFlowBox::InlineFlowBox):
        (WebCore::InlineFlowBox::hasAnonymousInlineBlock const): Deleted.
        (WebCore::InlineFlowBox::setHasAnonymousInlineBlock): Deleted.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::lineHeight const):
        (WebCore::RenderBlock::baselinePosition const):
        (WebCore::RenderBlock::renderName const):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
        (WebCore::RenderBlockFlow::childrenPreventSelfCollapsing const):
        (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
        (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
        * rendering/RenderBlockFlow.h:
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::updateLogicalInlinePositions):
        (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
        (WebCore::RenderBlockFlow::layoutRunsAndFloats):
        (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
        (WebCore::RenderBlockFlow::layoutLineBoxes):
        (WebCore::RenderBlockFlow::determineStartPosition):
        (WebCore::RenderBlockFlow::matchedEndLine):
        (WebCore::RenderBlockFlow::marginCollapseLinesFromStart): Deleted.
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::sizesLogicalWidthToFitContent const):
        (WebCore::RenderBox::createsNewFormattingContext const):
        (WebCore::RenderBox::avoidsFloats const):
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::addChildIgnoringContinuation):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::isAnonymousInlineBlock const): Deleted.
        * rendering/RenderObject.h:
        (WebCore::RenderObject::isAnonymousBlock const):
        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::alignBoxesInBlockDirection):
        (WebCore::RootInlineBox::ascentAndDescentForBox const):
        * rendering/line/BreakingContext.h:
        (WebCore::BreakingContext::BreakingContext):
        (WebCore::BreakingContext::handleReplaced):
        * rendering/line/LineBreaker.cpp:
        (WebCore::LineBreaker::nextLineBreak):
        * rendering/line/LineBreaker.h:
        * rendering/line/LineLayoutState.h:
        (WebCore::LineLayoutState::marginInfo):
        (WebCore::LineLayoutState::prevFloatBottomFromAnonymousInlineBlock): Deleted.
        (WebCore::LineLayoutState::maxFloatBottomFromAnonymousInlineBlock): Deleted.

2017-08-31  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r221445.

        This change broke Sierra Release builds.

        Reverted changeset:

        "Switch HTMLMediaElement to release logging"
        https://bugs.webkit.org/show_bug.cgi?id=176065
        http://trac.webkit.org/changeset/221445

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

        Update CacheStorage caches only if it is updated
        https://bugs.webkit.org/show_bug.cgi?id=176135

        Reviewed by Alex Christensen.

        Covered by existing tests.

        When retrieving caches from the engine, CacheStorage gets an update counter.
        When this counter is different from the previous received one, CacheStorage will update its cache list.
        Otherwise it will skip this update step.

        * Modules/cache/CacheStorage.cpp:
        (WebCore::CacheStorage::retrieveCaches):
        * Modules/cache/CacheStorage.h:
        * Modules/cache/CacheStorageConnection.cpp:
        (WebCore::CacheStorageConnection::retrieveCaches):
        * Modules/cache/CacheStorageConnection.h:
        (WebCore::CacheStorageConnection::doRetrieveCaches):
        * Modules/cache/DOMCache.cpp:
        (WebCore::DOMCache::CacheInfos::isolatedCopy):
        * Modules/cache/DOMCache.h:
        (WebCore::DOMCache::CacheInfos::encode const):
        (WebCore::DOMCache::CacheInfos::decode):
        * Modules/cache/WorkerCacheStorageConnection.cpp:
        (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
        * Modules/cache/WorkerCacheStorageConnection.h:

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

        Switch HTMLMediaElement to release logging
        https://bugs.webkit.org/show_bug.cgi?id=176065

        Reviewed by Jer Noble.

        * dom/Document.cpp:
        (WebCore::Document::privateBrowsingStateDidChange): Disable the logger when private browsing
        mode is enabled.
        (WebCore::Document::logger const):
        * dom/Document.h:

        Convert debug-only logging to configurable release logging.
        * html/HTMLMediaElement.cpp:
        (PAL::LogArgument<WebCore::URL>::toString): Logger template for URL that returns the url as a
        String when only when the LOG_DISABLED build flag is not defined. Returns "[url]" when it is.
        * html/HTMLMediaElement.h:

2017-08-31  David Quesada  <david_quesada@apple.com>

        WKNavigationDelegatePrivate client redirect SPI needs to be able to detect redirects scheduled before the document finishes loading
        https://bugs.webkit.org/show_bug.cgi?id=176128
        rdar://problem/34068476

        Reviewed by Brady Eidson.

        Removed FrameLoaderClient::dispatchDidPerformClientRedirect() since no client cares about this event anymore.
        Also removed FrameLoader::performClientRedirect() since it wouldn't do anything but call changeLocation().

        No new tests - no change in functionality.

        * loader/FrameLoader.cpp:
        * loader/FrameLoader.h:
        * loader/FrameLoaderClient.h:
        * loader/NavigationScheduler.cpp:

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

        getFileMetadata() does not work as expected for symbolic links
        https://bugs.webkit.org/show_bug.cgi?id=176143

        Reviewed by Andreas Kling.

        getFileMetadata() does not work as expected for symbolic links:
        On POSIX, getFileMetadata() always followed symlinks, which meant that FileMetadata.type could
        never be TypeSymbolicLink. On Windows, the function properly did not follow symlinks but failed to set
        FileMetadata.type to TypeSymbolicLink when the file was a symbolic link.

        This patch adds a new ShouldFollowSymbolicLinks parameter to getFileMetadata() so that
        the call site can decide the behavior it wants. If getFileMetadata() is called on a
        symbolic link with ShouldFollowSymbolicLinks::No as parameter, FileMetadata.type is now
        properly set to TypeSymbolicLink.

        No new tests, covered by new API test.

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::listDirectoryWithMetadata):
        It is important we do not follow symlinks here since the code wants to discard them
        and does so by checking FileMetadata.type.

        * WebCore.xcodeproj/project.pbxproj:
        * fileapi/File.cpp:
        (WebCore::File::isDirectory const):

        * html/FileListCreator.cpp:
        (WebCore::appendDirectoryFiles):
        (WebCore::FileListCreator::createFileList):
        It is important we do not follow symlinks here since the code wants to discard them
        and does so by checking FileMetadata.type.

        * platform/FileSystem.cpp:
        (WebCore::fileIsDirectory):
        * platform/FileSystem.h:
        * platform/glib/FileSystemGlib.cpp:
        (WebCore::getFileLStat):
        (WebCore::getFileMetadata):
        * platform/posix/FileSystemPOSIX.cpp:
        (WebCore::getFileMetadata):
        (WebCore::createSymbolicLink):
        * platform/win/FileSystemWin.cpp:
        (WebCore::getFinalPathName):
        (WebCore::getFileMetadata):
        (WebCore::createSymbolicLink):
        - Add new createSymbolicLink() function for testing purposes.
        - On Posix, call lstat() instead of stat if ShouldFollowSymbolicLinks::No.
        - On Windows, since FindFirstFileW() does not follow symlinks, resolve
          final path using GetFinalPathNameByHandleW() if ShouldFollowSymbolicLinks::Yes.
        - On Windows, properly set FileMetadata.type to TypeSymbolicLink if the file
          is a symbolic link.

2017-08-31  Michael Catanzaro  <mcatanzaro@igalia.com>

        REGRESSION(r221226): [SOUP] libsoup-CRITICAL **: soup_cookies_to_cookie_header: assertion 'cookies != NULL' failed
        https://bugs.webkit.org/show_bug.cgi?id=176140

        Reviewed by Carlos Garcia Campos.

        This should fix unexpected stderr output in several tests.

        * platform/network/soup/CookieJarSoup.cpp:
        (WebCore::cookiesForSession):

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

        Add support for Request body stream cloning
        https://bugs.webkit.org/show_bug.cgi?id=176148

        Reviewed by Alex Christensen.

        Tests: http/wpt/fetch/request-clone.html
               http/wpt/fetch/request-consume-stream.html
               http/wpt/fetch/request-stream-disturbed-1.html
               http/wpt/fetch/request-stream-disturbed-2.html
               http/wpt/fetch/request-stream-disturbed-3.html

        Adding support for ReadableStream teeing for cloning fetch bodies.
        Adding support for pushing request body data to its ReadableStream.
        Renamed FetchResponseSource to FetchBodySource for that purpose.

        Tests extracting body from a ReadableStream through JS API pass.
        Tests extracting data stored in a ReadableStream to resolve fetch body promises are failing.
        There is no support yet, this will be added as a follow-up.

        * CMakeLists.txt:
        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::consume):
        (WebCore::FetchBody::consumeAsStream):
        (WebCore::FetchBody::clone):
        * Modules/fetch/FetchBody.h:
        * Modules/fetch/FetchBodyConsumer.h:
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::cloneBody):
        (WebCore::FetchBodyOwner::loadBlob):
        (WebCore::FetchBodyOwner::readableStream):
        (WebCore::FetchBodyOwner::consumeBodyAsStream):
        * Modules/fetch/FetchBodyOwner.h:
        (WebCore::FetchBodyOwner::feedStream):
        (WebCore::FetchBodyOwner::cancel):
        * Modules/fetch/FetchBodySource.cpp: Renamed from Source/WebCore/Modules/fetch/FetchResponseSource.cpp.
        * Modules/fetch/FetchBodySource.h: Renamed from Source/WebCore/Modules/fetch/FetchResponseSource.h.
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::consumeBodyAsStream):
        (WebCore::FetchResponse::createReadableStream):
        * Modules/fetch/FetchResponse.h:
        * Modules/fetch/FetchResponse.idl:
        * Modules/fetch/FetchResponse.js:
        (getter.body):
        (clone):
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/ReadableStream.cpp:
        (WebCore::ReadableStream::tee):
        * bindings/js/ReadableStream.h:
        * bindings/js/WebCoreBuiltinNames.h:

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

        Use WTF::crossThreadCopy() in more places
        https://bugs.webkit.org/show_bug.cgi?id=176169

        Reviewed by Andreas Kling.

        Use WTF::crossThreadCopy() in more places to make code more concise.

        * Modules/indexeddb/IDBValue.cpp:
        (WebCore::IDBValue::setAsIsolatedCopy):

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

        MSE-to-Canvas painting can become "stuck" during heavy workloads
        https://bugs.webkit.org/show_bug.cgi?id=176170

        Reviewed by Eric Carlson.

        During heavy workloads, the trigger from CMBufferQueue notifying us that we have dipped below
        the "low-water mark" of decoded (and decoding) frames will not fire. Instead of using a trigger
        (since it will not fire when the number of "frames being decoded" changes, just the number of
        decoded frames), just call maybeBecomeReadyForMoreMediaData() whenever the number of frames in
        the decoded queue decreases, or when the number of frames being decoded decreases.

        * platform/graphics/cocoa/WebCoreDecompressionSession.h:
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaData):
        (WebCore::WebCoreDecompressionSession::enqueueSample):
        (WebCore::WebCoreDecompressionSession::decodeSample):
        (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
        (WebCore::WebCoreDecompressionSession::getFirstVideoFrame):
        (WebCore::WebCoreDecompressionSession::automaticDequeue):
        (WebCore::WebCoreDecompressionSession::imageForTime):
        (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaDataCallback): Deleted.

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

        Move consume promise from FetchBody to FetchBodyConsumer
        https://bugs.webkit.org/show_bug.cgi?id=176121

        Reviewed by Alex Christensen.

        No change of behavior.

        FetchBodyConsumer should be made responsible for data consumption through promise getters and ReadableStream.
        This will allow making data consumption consistent for Request and Response.
        This patch is doing the first step.

        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::consumeOnceLoadingFinished):
        (WebCore::FetchBody::consumeBlob):
        (WebCore::FetchBody::loadingFailed):
        (WebCore::FetchBody::loadingSucceeded):
        (WebCore::FetchBody::clone const):
        * Modules/fetch/FetchBody.h:
        (WebCore::FetchBody::cleanConsumer):
        (WebCore::FetchBody::cleanConsumePromise): Deleted.
        * Modules/fetch/FetchBodyConsumer.cpp:
        (WebCore::FetchBodyConsumer::setConsumePromise):
        (WebCore::FetchBodyConsumer::loadingFailed):
        (WebCore::FetchBodyConsumer::loadingSucceeded):
        (WebCore::FetchBodyConsumer::clean):
        * Modules/fetch/FetchBodyConsumer.h:
        (WebCore::FetchBodyConsumer::clean): Deleted.
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::stop):

2017-08-22  Darin Adler  <darin@apple.com>

        REGRESSION (r220052): ASSERTION FAILED: !frame().isMainFrame() || !needsStyleRecalcOrLayout()  in WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive()
        https://bugs.webkit.org/show_bug.cgi?id=175270

        Reviewed by Simon Fraser and Antti Koivisto.

        * dom/Document.cpp:
        (WebCore::Document::Document): Initialize m_styleRecalcTimer with a lamdba so it can work
        with a function that returns a bool and ignore the return value.
        (WebCore::Document::updateStyleIfNeeded): Added a boolean return value indicating if the
        function did any work or not.
        * dom/Document.h: Updated for above change.

        * page/FrameView.cpp:
        (WebCore::appendRenderedChildren): Added helper that will later replace the
        FrameView::renderedChildFrameViews function and is used below.
        (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): Instead of always doing two
        passes of style and layout update do up to 25 passes, but stop as soon as a pass does
        no work. This is slightly more efficient in cases where no layout and style update is
        needed, and works correctly when a additional passes are needed, which is what happens
        in the test that was failing. We can eventually improve this further, but this resolves
        the immediate problem we are seeing in the test.

2017-08-22  Filip Pizlo  <fpizlo@apple.com>

        Strings need to be in some kind of gigacage
        https://bugs.webkit.org/show_bug.cgi?id=174924

        Reviewed by Oliver Hunt.

        No new tests because no new behavior.

        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::normalizeSpaces):

2017-08-31  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Use reifying system for "name" property of builtin JSFunction
        https://bugs.webkit.org/show_bug.cgi?id=175260

        Reviewed by Saam Barati.

        Test: js/dom/builtin-getter-name.html

        Use @getter for JSBuiltin getters.

        * Modules/fetch/FetchResponse.js:
        (bodyUsed): Deleted.
        (body): Deleted.
        * Modules/streams/ReadableByteStreamController.js:
        (byobRequest): Deleted.
        (desiredSize): Deleted.
        * Modules/streams/ReadableStream.js:
        (locked): Deleted.
        * Modules/streams/ReadableStreamBYOBReader.js:
        (closed): Deleted.
        * Modules/streams/ReadableStreamBYOBRequest.js:
        (view): Deleted.
        * Modules/streams/ReadableStreamDefaultController.js:
        (desiredSize): Deleted.
        * Modules/streams/ReadableStreamDefaultReader.js:
        (closed): Deleted.
        * Modules/streams/WritableStream.js:
        (closed): Deleted.
        (ready): Deleted.
        (state): Deleted.
        * bindings/js/JSDOMBuiltinConstructor.h:
        (WebCore::JSDOMBuiltinConstructor<JSClass>::finishCreation):

2017-08-30  Chris Dumez  <cdumez@apple.com>

        Implement FileSystemDirectoryReader.readEntries()
        https://bugs.webkit.org/show_bug.cgi?id=176091
        <rdar://problem/34168015>

        Reviewed by Andreas Kling.

        Tests: editing/pasteboard/datatransfer-items-drop-directoryReader-error.html
               editing/pasteboard/datatransfer-items-drop-directoryReader-root.html
               editing/pasteboard/datatransfer-items-drop-directoryReader.html

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::ListedChild::isolatedCopy const):
        (WebCore::listDirectoryWithMetadata):
        (WebCore::toFileSystemEntries):
        (WebCore::DOMFileSystem::DOMFileSystem):
        (WebCore::DOMFileSystem::root):
        (WebCore::DOMFileSystem::fileAsEntry):
        (WebCore::DOMFileSystem::evaluatePath):
        (WebCore::DOMFileSystem::listDirectory):
        * Modules/entriesapi/DOMFileSystem.h:
        (WebCore::DOMFileSystem::createEntryForFile):
        * Modules/entriesapi/DOMFileSystem.idl:
        - Implement directory listing operation for supporting
          FileSystemDirectoryReader::readEntries().
        - Implement evaluatePath() operation as per:
          - https://wicg.github.io/entries-api/#evaluate-a-path
        - DOMFileSystem should no longer hold a strong reference to
          the root entry and FileSystemEntry now holds a strong
          reference to the DOMFileSystem and this would create a
          cycle.

        * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
        (WebCore::FileSystemDirectoryEntry::createReader):
        * Modules/entriesapi/FileSystemDirectoryEntry.h:
        * Modules/entriesapi/FileSystemDirectoryEntry.idl:
        Have createReader() take a ScriptExecutionContext, which is needed
        to construct a FileSystemDirectoryReader, now that FileSystemDirectoryReader
        is an ActiveDOMObject.

        * Modules/entriesapi/FileSystemDirectoryReader.cpp:
        (WebCore::FileSystemDirectoryReader::FileSystemDirectoryReader):
        (WebCore::FileSystemDirectoryReader::activeDOMObjectName const):
        (WebCore::FileSystemDirectoryReader::canSuspendForDocumentSuspension const):
        (WebCore::FileSystemDirectoryReader::readEntries):
        * Modules/entriesapi/FileSystemDirectoryReader.h:
        * Modules/entriesapi/FileSystemDirectoryReader.idl:
        Provide implementation for FileSystemDirectoryReader.readEntries() as per:
        - https://wicg.github.io/entries-api/#dom-filesystemdirectoryreader-readentries
        For the actual directory listing operation, we ask the DOMFileSystem, which is
        where all filesystem operations should live.
        Also made the FileSystemDirectoryReader an ActiveDOMObject to keep it and its
        wrapper alive while a file system operation is pending.

        * Modules/entriesapi/FileSystemEntry.cpp:
        (WebCore::FileSystemEntry::~FileSystemEntry):
        (WebCore::FileSystemEntry::filesystem const):
        * Modules/entriesapi/FileSystemEntry.h:
        Make FileSystemEntry keep a strong reference to its DOMFileSystem object.
        Previously, the DOMFileSystem was kept alive by the DataTransferItem but
        this was unsafe because FileSystemEntry may outlive the DataTransferItem.

        * dom/ActiveDOMObject.h:
        (WebCore::ActiveDOMObject::PendingActivity::PendingActivity):
        (WebCore::ActiveDOMObject::PendingActivity::~PendingActivity):
        (WebCore::ActiveDOMObject::makePendingActivity):
        Add PendingActivity / makePendingActivity() as a less error-prone
        replacement for setPendingActivity() / unsetPendingActivity().

        * dom/DOMException.cpp:
        (WebCore::DOMException::create):
        * dom/DOMException.h:
        Add factory to construct a DOMException from an Exception.

        * dom/DataTransferItem.cpp:
        (WebCore::DataTransferItem::getAsEntry const):
        * dom/DataTransferItem.h:

        * dom/Exception.h:
        (WebCore::Exception::isolatedCopy const):
        * dom/ExceptionOr.h:
        Make ExceptionOr<> / Exception work with CrossThreadCopier for convenience.

        * html/FileListCreator.cpp:
        (WebCore::FileListCreator::FileListCreator):
        Use crossThreadCopy() instead of longer form.

        * platform/FileSystem.h:
        * platform/glib/FileSystemGlib.cpp:
        (WebCore::pathByAppendingComponents):
        * platform/posix/FileSystemPOSIX.cpp:
        (WebCore::pathByAppendingComponents):
        * platform/win/FileSystemWin.cpp:
        (WebCore::pathByAppendingComponents):
        Add pathByAppendingComponents() utility function, which is similar to
        pathByAppendingComponent() but supports appending multiple components
        in an efficient fashion.

2017-08-30  Antti Koivisto  <antti@apple.com>

        Factor RenderMultiColumnFlowThread construction and destruction into RenderTreeUpdater helper
        https://bugs.webkit.org/show_bug.cgi?id=176130

        Reviewed by Zalan Bujtas.

        Move mutation code out of the render tree.

        * WebCore.xcodeproj/project.pbxproj:
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::createMultiColumnFlowThread): Deleted.
        (WebCore::RenderBlockFlow::destroyMultiColumnFlowThread): Deleted.
        * rendering/RenderBlockFlow.h:
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::commit):
        (WebCore::RenderTreeUpdater::updateAfterDescendants):
        (WebCore::updateMultiColumnFlowThread): Deleted.
        * style/RenderTreeUpdater.h:
        * style/RenderTreeUpdaterMultiColumn.cpp: Added.
        (WebCore::RenderTreeUpdater::MultiColumn::update):
        (WebCore::RenderTreeUpdater::MultiColumn::createFlowThread):
        * style/RenderTreeUpdaterMultiColumn.h: Added.

2017-08-30  Myles C. Maxfield  <mmaxfield@apple.com>

        Previous elements with lang= can affect fonts selected for subsequent elements
        https://bugs.webkit.org/show_bug.cgi?id=175959
        <rdar://problem/33785853>

        Reviewed by Zalan Bujtas.

        FontCascade::update() was erroneously getting a cache hit. Elements with different lang=
        should be distinct inside the FontCascadeCache. We should be keying off of the locale
        string instead of the script enum because the string is the thing we actually pass to the
        platform APIs when performing font selection. This is a regression because we only
        recently (within the past few years) started making font selection sensitive to lang= at
        all.

        Test: fast/text/lang-font-selection-cache.html

        * platform/graphics/FontCache.h:
        (WebCore::FontDescriptionKey::FontDescriptionKey):
        (WebCore::FontDescriptionKey::operator== const):
        (WebCore::FontDescriptionKey::computeHash const):

2017-08-30  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r221327.

        This change caused test262 failures.

        Reverted changeset:

        "[JSC] Use reifying system for "name" property of builtin
        JSFunction"
        https://bugs.webkit.org/show_bug.cgi?id=175260
        http://trac.webkit.org/changeset/221327

2017-08-30  Youenn Fablet  <youenn@apple.com>

        [Cache API] Support cache names persistency
        https://bugs.webkit.org/show_bug.cgi?id=175995

        Reviewed by Alex Christensen.

        Test: http/tests/cache-storage/cache-persistency.https.html

        Adding method to clear the memory representation of the cache storage.
        Exposing it as internals so that layout tests can be used for testing persistency by combining clearing and private browsing mode.

        Introducing ReadDisk and WriteDisk errors that are used by CacheStorage::Engine.

        * Modules/cache/CacheStorageConnection.h:
        (WebCore::CacheStorageConnection::clearMemoryRepresentation):
        * Modules/cache/DOMCache.cpp:
        (WebCore::DOMCache::errorToException):
        * Modules/cache/DOMCache.h:
        * testing/Internals.cpp:
        (WebCore::Internals::clearCacheStorageMemoryRepresentation):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-08-30  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r221384.

        This patch caused multiple 32-bit JSC test failures.

        Reverted changeset:

        "Strings need to be in some kind of gigacage"
        https://bugs.webkit.org/show_bug.cgi?id=174924
        http://trac.webkit.org/changeset/221384

2017-08-30  Brady Eidson  <beidson@apple.com>

        Add "Identified" base class to replace a whole bunch of custom identifier generators.
        https://bugs.webkit.org/show_bug.cgi?id=176120

        Reviewed by Alex Christensen.

        No new tests (No behavior change).

        Instead of repeating the common pattern of a class with an integer identifier keeping its
        own static counter of the next identifier and generating it for each instance, this
        uses a common template in WTF that does that automatically.

        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionPendingCloseFromClient):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::confirmDidCloseFromServer):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
        (WebCore::IDBServer::nextDatabaseConnectionIdentifier): Deleted.
        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::identifier const): Deleted.

        * workers/service/ServiceWorkerJobData.cpp:
        (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
        (WebCore::ServiceWorkerJobData::isolatedCopy const):
        * workers/service/ServiceWorkerJobData.h:
        (WebCore::ServiceWorkerJobData::encode const):
        (WebCore::ServiceWorkerJobData::decode):
        (WebCore::ServiceWorkerJobData::identifier const): Deleted.

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::Connection):
        * workers/service/server/SWServer.h:
        (WebCore::SWServer::Connection::identifier const): Deleted.

        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::SWServerRegistration):
        (WebCore::SWServerRegistration::data const):
        * workers/service/server/SWServerRegistration.h:
        (WebCore::SWServerRegistration::identifier const): Deleted.

2017-08-30  Youenn Fablet  <youenn@apple.com>

        Remove FetchRequest::InternalRequest
        https://bugs.webkit.org/show_bug.cgi?id=176085

        Reviewed by Alex Christensen.

        No change of behavior.

        Removing InternalRequest struct and passing/defining fields directly.

        * Modules/cache/Cache.cpp:
        (WebCore::Cache::updateRecords):
        * Modules/fetch/FetchRequest.cpp:
        (WebCore::computeReferrer):
        (WebCore::buildOptions):
        (WebCore::methodCanHaveBody):
        (WebCore::FetchRequest::initializeOptions):
        (WebCore::FetchRequest::initializeWith):
        (WebCore::FetchRequest::setBody):
        (WebCore::FetchRequest::create):
        (WebCore::FetchRequest::referrer const):
        (WebCore::FetchRequest::urlString const):
        (WebCore::FetchRequest::resourceRequest const):
        (WebCore::FetchRequest::clone):
        (WebCore::setReferrer): Deleted.
        * Modules/fetch/FetchRequest.h:
        (WebCore::FetchRequest::FetchRequest):
        (WebCore::FetchRequest::cache const):
        (WebCore::FetchRequest::credentials const):
        (WebCore::FetchRequest::destination const):
        (WebCore::FetchRequest::mode const):
        (WebCore::FetchRequest::redirect const):
        (WebCore::FetchRequest::referrerPolicy const):
        (WebCore::FetchRequest::type const):

2017-08-30  Youenn Fablet  <youenn@apple.com>

        Add support for FetchRequest.body
        https://bugs.webkit.org/show_bug.cgi?id=176066
        <rdar://problem/34148373>

        Reviewed by Sam Weinig and Alex Christensen.

        Follow-up to https://trac.webkit.org/r221329 as per post landing comments.
        Returning a RefPtr<ReadableStream> so as to to not specialize ReadableStream converter.

        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::readableStream):
        * Modules/fetch/FetchBodyOwner.h:
        * bindings/js/ReadableStream.h:
        (WebCore::toJS):
        (WebCore::JSConverter<IDLInterface<ReadableStream>>::convert): Deleted.

2017-08-30  Per Arne Vollan  <pvollan@apple.com>

        [Win] Crash in MathML layout test.
        https://bugs.webkit.org/show_bug.cgi?id=176109

        Reviewed by Brent Fulgham.

        Return early if no font can be found for code point.

        No new tests, covered by existing tests. 

        * rendering/mathml/MathOperator.cpp:
        (WebCore::MathOperator::paintVerticalGlyphAssembly):
        (WebCore::MathOperator::paintHorizontalGlyphAssembly):

2017-08-30  Brady Eidson  <beidson@apple.com>

        Implement all of "Register" right up until where the script is fetched.
        https://bugs.webkit.org/show_bug.cgi?id=176082

        Reviewed by Andy Estes.

        Test: http/tests/workers/service/basic-register-exceptions.html

        This patch implements every detail of the "Register" and "Update" algorithms right up to
        where we would actually fetch the service worker script file.

        It also includes miscellaneous refactoring and cleanup along the way.

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

        * page/SecurityOrigin.cpp:
        (WebCore::shouldTreatAsPotentiallyTrustworthy): Expose in the header for other files to use.
        * page/SecurityOrigin.h:

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration): Add some more exception cases from the spec.
        (WebCore::ServiceWorkerContainer::scheduleJob): Use the correct job identifier.
        (WebCore::ServiceWorkerContainer::jobFailedWithException):
        (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
        (WebCore::ServiceWorkerContainer::jobDidFinish):
        * workers/service/ServiceWorkerContainer.h:

        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::ServiceWorkerJob):
        (WebCore::ServiceWorkerJob::failedWithException): Call through to the client to handle the failure.
        (WebCore::ServiceWorkerJob::resolvedWithRegistration): Call through to the client to handle success.
        * workers/service/ServiceWorkerJob.h:
        (WebCore::ServiceWorkerJob::promise):
        (WebCore::ServiceWorkerJob::identifier const): Deleted. Rely on the identifier from the JobData.

        * workers/service/ServiceWorkerJobClient.h:

        * workers/service/ServiceWorkerJobData.cpp:
        (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
        (WebCore::ServiceWorkerJobData::isolatedCopy const):
        * workers/service/ServiceWorkerJobData.h:
        (WebCore::ServiceWorkerJobData::identifier const):
        (WebCore::ServiceWorkerJobData::encode const):
        (WebCore::ServiceWorkerJobData::decode):
        (WebCore::ServiceWorkerJobData::jobIdentifier const): Deleted.

        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration): Make this class an ActiveDOMObject
          both because it *is* an active DOM object and because we need to get at the ScriptExecutionContext.
        * workers/service/ServiceWorkerRegistration.h:

        Add a class to encapsulate everything about a registration for encode/decode/crossthread:
        * workers/service/ServiceWorkerRegistrationData.cpp:
        (WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
        * workers/service/ServiceWorkerRegistrationData.h: 
        (WebCore::ServiceWorkerRegistrationData::encode const):
        (WebCore::ServiceWorkerRegistrationData::decode):

        * workers/service/ServiceWorkerRegistrationKey.cpp:
        (WebCore::ServiceWorkerRegistrationKey::isolatedCopy const):
        * workers/service/ServiceWorkerRegistrationKey.h:
        (WebCore::ServiceWorkerRegistrationKey::encode const):
        (WebCore::ServiceWorkerRegistrationKey::decode):

        * workers/service/server/SWClientConnection.cpp:
        (WebCore::SWClientConnection::scheduleJob):
        (WebCore::SWClientConnection::jobResolvedInServer):
        * workers/service/server/SWClientConnection.h:

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::~SWServer):
        (WebCore::SWServer::Connection::scheduleJobInServer):
        (WebCore::SWServer::scheduleJob):
        (WebCore::SWServer::rejectJob):
        (WebCore::SWServer::resolveJob):
        * workers/service/server/SWServer.h:

        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::SWServerRegistration):
        (WebCore::SWServerRegistration::startNextJob):
        (WebCore::SWServerRegistration::isEmpty):
        (WebCore::SWServerRegistration::getNewestWorker): Implement "Get Newest Worker" algorithm.
        (WebCore::SWServerRegistration::runRegisterJob): Implement the rest of the "Register" algorithm.
        (WebCore::SWServerRegistration::runUpdateJob): Implement every part of "Update" up to where we would fetch.
        (WebCore::SWServerRegistration::rejectWithExceptionOnMainThread):
        (WebCore::SWServerRegistration::resolveWithRegistrationOnMainThread):
        (WebCore::SWServerRegistration::resolveCurrentJob):
        (WebCore::SWServerRegistration::data const):
        (WebCore::SWServerRegistration::performCurrentJob): Deleted.
        * workers/service/server/SWServerRegistration.h:
        (WebCore::SWServerRegistration::identifier const):

        Add a stub class to represent "active service workers" in the SWServer:
        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::SWServerWorker):
        (WebCore::SWServerWorker::~SWServerWorker):
        * workers/service/server/SWServerWorker.h: 
        (WebCore::SWServerWorker::scriptURL const):

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

        [CMake][WinCairo] Use find_package for libpng and libjpeg
        https://bugs.webkit.org/show_bug.cgi?id=176113

        Reviewed by Alex Christensen.

        No new tests. No change in behavior.

        * PlatformWinCairo.cmake:
        * platform/ImageDecoders.cmake:

2017-08-22  Matt Rajca  <mrajca@apple.com>

        Opt all Mac clients into document-level media user gesture quirks.
        https://bugs.webkit.org/show_bug.cgi?id=175831

        This un-breaks many of the sites that take a long time to load video ad elements on-demand.

        Reviewed by Eric Carlson.

        Test: media/document-level-media-user-gesture-quirk.html

        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::playbackPermitted const):
        (WebCore::needsDocumentLevelMediaUserGestureQuirk): Deleted.

2017-08-22  Filip Pizlo  <fpizlo@apple.com>

        Strings need to be in some kind of gigacage
        https://bugs.webkit.org/show_bug.cgi?id=174924

        Reviewed by Oliver Hunt.

        No new tests because no new behavior.

        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::normalizeSpaces):

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

        [Mac] Upstream Accessibility-related WebKitSystemInterface functions
        https://bugs.webkit.org/show_bug.cgi?id=176093

        Reviewed by Eric Carlson.

        * accessibility/mac/AXObjectCacheMac.mm:
        (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper unregisterUniqueIdForUIElement]):
        (AXObjectIsTextMarker):
        (AXObjectIsTextMarkerRange):
        (AXTextMarkerRange):
        (AXTextMarkerRangeStart):
        (AXTextMarkerRangeEnd):
        (getBytesFromAXTextMarker):
        (isTextMarkerIgnored):
        (accessibilityObjectForTextMarker):
        (startOrEndTextmarkerForRange):
        (nextTextMarkerForCharacterOffset):
        (previousTextMarkerForCharacterOffset):
        (textMarkerForCharacterOffset):
        (characterOffsetForTextMarker):
        (textMarkerForVisiblePosition):
        (-[WebAccessibilityObjectWrapper textMarkerForFirstPositionInTextControl:]):
        (visiblePositionForTextMarker):
        (AXAttributeStringSetElement):
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:

2017-08-30  Antti Koivisto  <antti@apple.com>

        RenderMultiColumnFlowThread - Avoid render tree mutation during layout
        https://bugs.webkit.org/show_bug.cgi?id=176026
        <rdar://problem/33402891>

        Reviewed by Zalan Bujtas.

        Mutations should be done in RenderTreeUpdater.

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::willCreateColumns const):

            Don't create columns for RenderSVGBlock. Before this patch this was avoided because it
            has custom layout() function that doesn't call to setComputedColumnCountAndWidth.
            Same for mathml and ruby.

            Don't create columns for pseudo elements (first-letter mostly).

        (WebCore::RenderBlockFlow::setComputedColumnCountAndWidth):

            This now assumes that the multicolumn renderer has been initialized correctly already.

        * rendering/RenderBlockFlow.h:
        * style/RenderTreeUpdater.cpp:
        (WebCore::updateMultiColumnFlowThread):

            Create or delte multicolumn renderer after descendants are known.

        (WebCore::RenderTreeUpdater::commit):
        (WebCore::RenderTreeUpdater::updateAfterDescendants):

2017-08-30  Said Abou-Hallawa  <sabouhallawa@apple.com>

        The SVG fragment identifier is not respected if it is a part of an HTTP URL
        https://bugs.webkit.org/show_bug.cgi?id=163811

        Reviewed by Darin Adler.

        If an image is referenced more than once in a page and the URL to that
        image is an HTTP URL, one CachedImage is created for all the renderers
        even if the original URLs have different fragmentIdentifiers. In this
        case the fragment will be removed from the request which is associated
        with the shared CachedImage. This CachedImage creates an SVGImage with
        a URL but without a fragmentIdentifier. So SVGImage::draw() does not call
        FrameView::scrollToFragment() and therefore the viewport is not setup
        correctly for displaying the SVG in this case.

        The fix is to move the url from the SVGImage to SVGImageForContainer.
        Because there is one SVGImageForContainer created for every renderer,
        we can move the full URL there. The drawing of an SVGImage has to start
        from the SVGImageForContainer::draw() because the SVGImage may not have
        an intrinsic size and the SVGImageForContainer is the one which knows
        the destination rectangle. So SVGImageForContainer can pass the full url
        to SVGImage::drawForContainer() which can be used to scrollToFragment()
        before calling SVGImage::draw().
        
        For clarity and consistency, all setContainerSizeForRenderer() will be 
        changed to setContainerContext() and the pair SizeAndZoom will be replaced
        by the struct ContainerContext.

        Tests: http/tests/svg/svg-fragment-background.html
               http/tests/svg/svg-fragment-image.html

        * css/CSSCursorImageValue.h:
        * css/CSSImageSetValue.cpp:
        (WebCore::CSSImageSetValue::fillImageSet):
        * css/CSSImageSetValue.h:
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::didRemoveClient):
        (WebCore::CachedImage::switchClientsToRevalidatedResource):
        (WebCore::CachedImage::allClientsRemoved):
        (WebCore::CachedImage::setContainerContextForClient):
        (WebCore::CachedImage::clear):
        (WebCore::CachedImage::createImage):
        (WebCore::CachedImage::setContainerSizeForRenderer): Deleted.
        * loader/cache/CachedImage.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
        (WebCore::RenderBoxModelObject::paintNinePieceImage):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::updateInnerContentRect):
        (WebCore::RenderImage::repaintOrMarkForLayout):
        * rendering/RenderImageResource.cpp:
        (WebCore::RenderImageResource::setContainerContext):
        (WebCore::RenderImageResource::setContainerSizeForRenderer): Deleted.
        * rendering/RenderImageResource.h:
        * rendering/RenderImageResourceStyleImage.cpp:
        (WebCore::RenderImageResourceStyleImage::setContainerContext):
        (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer): Deleted.
        * rendering/RenderImageResourceStyleImage.h:
        * rendering/RenderListMarker.cpp:
        (WebCore::RenderListMarker::updateContent):
        * rendering/shapes/ShapeOutsideInfo.cpp:
        (WebCore::ShapeOutsideInfo::createShapeForImage const):
        * rendering/style/StyleCachedImage.cpp:
        (WebCore::StyleCachedImage::imageURL):
        (WebCore::StyleCachedImage::setContainerContextForRenderer):
        (WebCore::StyleCachedImage::setContainerSizeForRenderer): Deleted.
        * rendering/style/StyleCachedImage.h:
        * rendering/style/StyleGeneratedImage.h:
        * rendering/style/StyleImage.h:
        * rendering/svg/RenderSVGImage.cpp:
        (WebCore::RenderSVGImage::updateImageViewport):
        * svg/SVGImageElement.h:
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::SVGImage):
        (WebCore::SVGImage::drawForContainer):
        (WebCore::SVGImage::drawPatternForContainer):
        (WebCore::SVGImage::draw):
        (WebCore::SVGImage::dump const): Deleted.
        * svg/graphics/SVGImage.h:
        * svg/graphics/SVGImageCache.cpp:
        (WebCore::SVGImageCache::setContainerContextForClient):
        (WebCore::SVGImageCache::setContainerSizeForRenderer): Deleted.
        * svg/graphics/SVGImageCache.h:
        * svg/graphics/SVGImageForContainer.cpp:
        (WebCore::SVGImageForContainer::size const):
        (WebCore::SVGImageForContainer::draw):
        (WebCore::SVGImageForContainer::drawPattern):
        * svg/graphics/SVGImageForContainer.h:

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

        REGRESSION(r210287) On drop, event.dataTransfer.getData("text") returns an empty string when dragging an image
        https://bugs.webkit.org/show_bug.cgi?id=170637
        <rdar://problem/31347248>

        Reviewed by Ryosuke Niwa.

        In r210287, the behavior of DragData::containsFiles was changed to return true if NSFilesPromisePboardType is
        present in the pasteboard. This means that we will consider images dragged from web content, for which we add
        the NSFilesPromisePboardType UTI, as containing files on the pasteboard; this, in turn, means we'll initialize
        the DataTransfer upon drop with m_forFileDrag set to true. Due to early returns in getData() and setData() to
        deny data access when dropping a dragged file, this means the page won't ever get access to the URL in the
        pasteboard due to the presence of the NSFilesPromisePboardType UTI.

        To fix this, we replace the early m_forFileDrag returns in getData and setData, instead early returning the null
        string if there are any file URLs present on the pasteboard (determined via readFilenames() retrieving a non-
        empty result).

        Test: editing/pasteboard/drag-drop-href-as-text-data.html

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::DataTransfer):
        (WebCore::DataTransfer::getData const):
        (WebCore::DataTransfer::setData):

        Rather than bail upon forFileDrag() (formerly, m_forFileDrag) being true, bail if there are any file URLs
        present on the pasteboard. It seems like this was the intention of the early return in the first place, to
        prevent the page from being able to ask for a real file URL when dragging a file.

        (WebCore::DataTransfer::files const):
        (WebCore::DataTransfer::setDragImage):
        (WebCore::DataTransfer::setDropEffect):
        (WebCore::DataTransfer::setEffectAllowed):

        Swap m_forDrag and m_forFileDrag with forDrag() and forFileDrag(), respectively.

        * dom/DataTransfer.h:
        (WebCore::DataTransfer::forDrag const):
        (WebCore::DataTransfer::forFileDrag const):

        Instead of caching two bools to represent state (m_forDrag and m_forFileDrag), just remember the DataTransfer's
        m_type and turn the flags into const helpers that check for the value of m_type.

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

        [Fetch API] Request should throw when keep alive is true and body is a ReadableStream
        https://bugs.webkit.org/show_bug.cgi?id=176083

        Reviewed by Alex Christensen.

        Covered by rebased test.

        * Modules/fetch/FetchRequest.cpp:
        (WebCore::FetchRequest::setBody):

2017-08-29  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Use find_package for zlib
        https://bugs.webkit.org/show_bug.cgi?id=176075

        Reviewed by Alex Christensen.

        No new tests. No change in behavior.

        * CMakeLists.txt:
        * PlatformAppleWin.cmake:
        * PlatformMac.cmake:
        * PlatformWinCairo.cmake:

2017-08-29  Devin Rousso  <webkit@devinrousso.com>

        CallTracingCallback should ignore `readonly attribute`
        https://bugs.webkit.org/show_bug.cgi?id=176070

        Reviewed by Matt Baker.

        Update existing tests to remove calls to existing readonly attributes.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateAttributeGetterBodyDefinition):
        If the attribute is marked `readonly` do not add logic for the `CallTracingCallback`.

        * bindings/scripts/test/TestCallTracer.idl:
        * bindings/scripts/test/JS/JSTestCallTracer.cpp:
        (WebCore::JSTestCallTracerConstructor::initializeProperties):
        (WebCore::jsTestCallTracerTestReadonlyAttributeGetter):
        (WebCore::jsTestCallTracerTestReadonlyAttribute):

2017-08-29  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Assertion failure when opening a file with a missing tag closing bracket
        https://bugs.webkit.org/show_bug.cgi?id=176061

        Reviewed by Darin Adler.

        If a tag is missing its closing bracket, the tokenizer just needs to advance()
        the character position without checking m_currentCharacter != '\n'. Newline
        character is a valid ending for partially closed tags.

        Test: fast/tokenizer/missing-script-tag-closing-bracket.html

        * html/parser/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::commitToPartialEndTag):

2017-08-29  Brady Eidson  <beidson@apple.com>

        Rename "potentionally trustworthy" to "potentially trustworthy"
        https://bugs.webkit.org/show_bug.cgi?id=176081

        Reviewed by Daniel Bates.

        The Secure Context spec refers to this as "potentially trustworthy"
        
        It's possible that this was done potentionally, but we should follow the spec to alleviate confusion.

        * dom/Document.cpp:
        (WebCore::Document::isSecureContext const):
        * page/SecurityOrigin.cpp:
        (WebCore::shouldTreatAsPotentiallyTrustworthy):
        (WebCore::shouldTreatAsPotentionallyTrustworthy): Deleted.
        * page/SecurityOrigin.h:
        (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
        (WebCore::SecurityOrigin::isPotentionallyTrustworthy const): Deleted.
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::isSecureContext const):

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

        Add support for FetchRequest.body
        https://bugs.webkit.org/show_bug.cgi?id=176066

        Reviewed by Alex Christensen.

        Covered by existing tests.

        Adding support for body attribute getter for FetchRequest.
        To do so, FetchRequest will need to create a ReadableStream.
        Adding support for DOM based creation of ReadableStream and conversion to JS values.
        Small refactoring to make names more consistent.

        * CMakeLists.txt:
        * Modules/beacon/NavigatorBeacon.cpp:
        (WebCore::NavigatorBeacon::sendBeacon):
        * Modules/cache/Cache.cpp:
        (WebCore::Cache::put):
        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::extract):
        * Modules/fetch/FetchBody.h:
        (WebCore::FetchBody::hasReadableStream const):
        (WebCore::FetchBody::readableStream):
        (WebCore::FetchBody::setReadableStream):
        (WebCore::FetchBody::FetchBody):
        (WebCore::FetchBody::isReadableStream const): Deleted.
        (WebCore::FetchBody::setAsReadableStream): Deleted.
        * Modules/fetch/FetchBody.idl:
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::readableStream):
        * Modules/fetch/FetchBodyOwner.h:
        (WebCore::FetchBodyOwner::hasReadableStreamBody const):
        (WebCore::FetchBodyOwner::isReadableStreamBody const): Deleted.
        * Modules/fetch/FetchRequest.cpp:
        (WebCore::FetchRequest::setBody):
        * Modules/fetch/FetchRequest.h:
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::setBodyAsReadableStream):
        (WebCore::FetchResponse::fetch):
        * Modules/fetch/FetchResponse.h:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/ReadableStream.h:
        (WebCore::JSConverter<IDLInterface<ReadableStream>>::convert):

2017-08-29  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Use reifying system for "name" property of builtin JSFunction
        https://bugs.webkit.org/show_bug.cgi?id=175260

        Reviewed by Saam Barati.

        Use @getter for JSBuiltin getters.

        * Modules/fetch/FetchResponse.js:
        (bodyUsed): Deleted.
        (body): Deleted.
        * Modules/streams/ReadableByteStreamController.js:
        (byobRequest): Deleted.
        (desiredSize): Deleted.
        * Modules/streams/ReadableStream.js:
        (locked): Deleted.
        * Modules/streams/ReadableStreamBYOBReader.js:
        (closed): Deleted.
        * Modules/streams/ReadableStreamBYOBRequest.js:
        (view): Deleted.
        * Modules/streams/ReadableStreamDefaultController.js:
        (desiredSize): Deleted.
        * Modules/streams/ReadableStreamDefaultReader.js:
        (closed): Deleted.
        * Modules/streams/WritableStream.js:
        (closed): Deleted.
        (ready): Deleted.
        (state): Deleted.
        * bindings/js/JSDOMBuiltinConstructor.h:
        (WebCore::JSDOMBuiltinConstructor<JSClass>::finishCreation):

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

        REGRESSION (r215290): "Where From" metadata is empty when dragging an image out of Safari
        https://bugs.webkit.org/show_bug.cgi?id=176068

        Reviewed by Wenson Hsieh.

        If you drag an image out of Safari, drop it on the Desktop, and open "Get Info", there is a
        "Where from:" field under "More Info" that should list the image's URL. After r215290, this
        field is blank due to a mixup with the string passed to URLWithUserTypedString().

        Fix this by passing metadataURLString to URLWithUserTypedString() instead of urlString.

        Not possible to reliably test this since WebKit adds metadata on a global concurrent queue.

        * platform/mac/FileSystemMac.mm:
        (WebCore::setMetadataURL):

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

        CacheStorage does not need to sort its caches
        https://bugs.webkit.org/show_bug.cgi?id=176059

        Reviewed by Chris Dumez.

        Covered by existing tests.

        * Modules/cache/CacheStorage.cpp:
        (WebCore::CacheStorage::retrieveCaches):

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

        Setting the cache storage engine root path according the session WebsiteDataStore
        https://bugs.webkit.org/show_bug.cgi?id=176055

        Reviewed by Alex Christensen.

        No test right now as the engine is not making any read/write operations.

        * platform/network/NetworkStorageSession.h:
        (WebCore::NetworkStorageSession::cacheStorageDirectory const):
        (WebCore::NetworkStorageSession::setCacheStorageDirectory):

2017-08-29  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Use find_package for libxml2 and libxstl
        https://bugs.webkit.org/show_bug.cgi?id=176042

        Reviewed by Konstantin Tokarev.

        No new tests. No change in behavior.

        * CMakeLists.txt:
        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * PlatformWinCairo.cmake:

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

        CacheQueryOptions::isolatedCopy() copies the cache name twice
        https://bugs.webkit.org/show_bug.cgi?id=175974

        Reviewed by Youenn Fablet.

        Currently CacheQueryOptions has a user-defined constructor that calls String.isolatedCopy()
        on the passed cache name. CacheQueryOptions::isolatedCopy() also calls String.isolatedCopy()
        on the cache name before passing the result to the user-defined constructor; => we malloc
        and copy the cache name twice. Ideally we would remove the user-defined constructors and
        have callers use aggregate initializer syntax to instantiate a CacheQueryOptions. Unfortunately
        we cannot do this until we upgrade from Visual Studio 2015 to Visual Studio 2017 as the former
        does not support non-static data member initializers (NSDMI) for aggregates and CacheQueryOptions
        has some. Therefore we modify the user-defined, non-default, constructor to take a String&&
        and conditionally compile the the constructors when building with compilers that do not
        support NSDMI for aggregates.

        * Modules/cache/CacheQueryOptions.h:
        (WebCore::CacheQueryOptions::CacheQueryOptions):

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

        CanvasCaptureMediaStreamTrack clone is not a CanvasCaptureMediaStreamTrack
        https://bugs.webkit.org/show_bug.cgi?id=176036

        Reviewed by Eric Carlson.

        Covered by existing tests.

        Instead of creating a MediaStreamTrack clone when cloning a CanvasCaptureMediaStreamTrack,
        we are now creating a CanvasCaptureMediaStreamTrack.
        This allows exposing the expected methods and having the expected functionality.

        * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
        (WebCore::CanvasCaptureMediaStreamTrack::clone):
        * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::clone):
        * Modules/mediastream/MediaStreamTrack.h:

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

        Add initial support for dataTransferItem.webkitGetAsEntry()
        https://bugs.webkit.org/show_bug.cgi?id=176038
        <rdar://problem/34121095>

        Reviewed by Wenson Hsieh.

        Add initial support for dataTransferItem.webkitGetAsEntry() as per:
        - https://wicg.github.io/entries-api/#html-data

        The method works as expected and returns a FileSystemEntry. The entry
        can be either a file or a directory. All of the attributes exposed on
        the FileSystemEntry return correct values.

        What remains to be implemented for this new API to actually be useful:
        - directory.getFile() / directory.getDirectory()
        - file.file()
        - entry.getParent()
        - directoryReader.readEntries()

        Test: editing/pasteboard/datatransfer-items-drop-getAsEntry.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        Add new files to projects.

        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::DOMFileSystem::DOMFileSystem):
        * Modules/entriesapi/DOMFileSystem.h:
        (WebCore::DOMFileSystem::create):
        DOMFileSystem factory now takes a name parameter. This name is a UUID, as suggested in
        the specification and implemented by Firefox.

        * Modules/entriesapi/ErrorCallback.cpp: Added.
        * Modules/entriesapi/ErrorCallback.h:
        Add scheduleCallback() convenience method as we often need to call this callback
        asynchronously.

        * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
        (WebCore::FileSystemDirectoryEntry::FileSystemDirectoryEntry):
        (WebCore::FileSystemDirectoryEntry::createReader):
        (WebCore::FileSystemDirectoryEntry::getFile):
        (WebCore::FileSystemDirectoryEntry::getDirectory):
        * Modules/entriesapi/FileSystemDirectoryEntry.h:
        - Add implementation for createReader().
        - Update getFile() / getDirectory() to call the error callback for now as they are
          unimplemented.
        - Have the factory take the virtual path of the entry so that it can be
          exposed via the fullPath attribute in IDL.

        * Modules/entriesapi/FileSystemDirectoryEntry.idl:
        Expose createReader() now that we have stubs for FileSystemDirectoryReader.

        * Modules/entriesapi/FileSystemDirectoryReader.cpp: Added.
        * Modules/entriesapi/FileSystemDirectoryReader.h: Added.
        * Modules/entriesapi/FileSystemDirectoryReader.idl: Added.
        * Modules/entriesapi/FileSystemEntriesCallback.cpp: Added.
        * Modules/entriesapi/FileSystemEntriesCallback.h: Added.
        * Modules/entriesapi/FileSystemEntriesCallback.idl: Added.
        Land stubs for FileSystemDirectoryReader and its FileSystemEntriesCallback.

        * Modules/entriesapi/FileSystemEntry.cpp:
        (WebCore::FileSystemEntry::FileSystemEntry):
        * Modules/entriesapi/FileSystemEntry.h:
        (WebCore::FileSystemEntry::virtualPath const):
        * Modules/entriesapi/FileSystemEntry.idl:
        Update constructor to take a virtual path, which is exposed via fullPath
        attribute in IDL.

        * Modules/entriesapi/FileSystemFileEntry.cpp:
        (WebCore::FileSystemFileEntry::FileSystemFileEntry):
        (WebCore::FileSystemFileEntry::file):
        * Modules/entriesapi/FileSystemFileEntry.h:
        (isType):
        * Modules/entriesapi/FileSystemFileEntry.idl:
        - Update file() to call the error callback for now as they are
          unimplemented.
        - Have the factory take the virtual path of the entry so that it can be
          exposed via the fullPath attribute in IDL.

        * bindings/js/JSFileSystemEntryCustom.cpp: Added.
        (WebCore::toJSNewlyCreated):
        (WebCore::toJS):
        Add custom implementation of FileSystemEntry's toJS() function. This is
        needed because FileSystemEntry has 2 subclasses and we need to type check
        at runtime to construct the right wrapper.

        * dom/DataTransferItem.cpp:
        (WebCore::DataTransferItem::getAsEntry const):
        * dom/DataTransferItem.h:
        * dom/DataTransferItem.idl:
        Add initial implementation for getAsEntry(), currently exposed as
        webkitGetAsEntry().

        * dom/DataTransferItemList.cpp:
        (WebCore::DataTransferItemList::ensureItems const):
        Construct a DataTransferItem if the file is a directory now that we
        support getAsEntry().

        * fileapi/File.cpp:
        (WebCore::File::isDirectory const):
        * fileapi/File.h:
        Add convenience method to query if a File is a directory.

2017-08-29  Zan Dobersek  <zdobersek@igalia.com>

        [WebCrypto] Push WorkQueue dispatches for HKDF, HMAC, PBKDF2 algorithms into shared code
        https://bugs.webkit.org/show_bug.cgi?id=175620

        Reviewed by Jiewen Tan.

        Push the WorkQueue dispatch code and other code duplicated between the
        Mac and libgcrypt implementations of Web Crypto into the shared layer.
        This patch focuses on the HKDF, HMAC and PBKDF2 algorithms.

        Functions with platform-specific implementations that are invoked from
        these asynchronous dispatches are made static and return an ExceptionOr
        value. CryptoAlgorithmParameters objects are passed through non-const
        references because data getters could lazily construct the underlying
        Vector objects. CryptoKey objects are passed through const references.
        Implementations can then manually retrieve and further validate any key
        or parameter data, as required for that specific implementation. Input
        data is passed through const references to the original Vector objects.

        No new tests -- no changes in behavior that's covered by existing tests.

        * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
        (WebCore::CryptoAlgorithmHKDF::deriveBits):
        * crypto/algorithms/CryptoAlgorithmHKDF.h:
        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
        (WebCore::CryptoAlgorithmHMAC::sign):
        (WebCore::CryptoAlgorithmHMAC::verify):
        * crypto/algorithms/CryptoAlgorithmHMAC.h:
        * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
        (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
        * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
        * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
        (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
        * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
        (WebCore::CryptoAlgorithmHMAC::platformSign):
        (WebCore::CryptoAlgorithmHMAC::platformVerify):
        * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
        (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
        * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
        (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
        * crypto/mac/CryptoAlgorithmHMACMac.cpp:
        (WebCore::CryptoAlgorithmHMAC::platformSign):
        (WebCore::CryptoAlgorithmHMAC::platformVerify):
        * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
        (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):

2017-08-29  Zan Dobersek  <zdobersek@igalia.com>

        [WebCrypto] Push WorkQueue dispatches for EC algorithms into shared code
        https://bugs.webkit.org/show_bug.cgi?id=175619

        Reviewed by Jiewen Tan.

        Push the WorkQueue dispatch code duplicated between the Mac and libgcrypt
        implementations of Web Crypto into the shared layer. This patch focuses on
        the EC-based algorithms.

        Functions with platform-specific implementations that are invoked from
        these asynchronous dispatches are made static and return an ExceptionOr or
        std::optional value. CryptoKey and CryptoAlgorithmParameters objects are
        passed to those through const references. Input data is passed through
        const references to the original Vector objects.

        No new tests -- no changes in behavior that's covered by existing tests.

        * crypto/algorithms/CryptoAlgorithmECDH.cpp:
        (WebCore::CryptoAlgorithmECDH::deriveBits):
        * crypto/algorithms/CryptoAlgorithmECDH.h:
        * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
        (WebCore::CryptoAlgorithmECDSA::sign):
        (WebCore::CryptoAlgorithmECDSA::verify):
        * crypto/algorithms/CryptoAlgorithmECDSA.h:
        * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
        (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
        * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
        (WebCore::CryptoAlgorithmECDSA::platformSign):
        (WebCore::CryptoAlgorithmECDSA::platformVerify):
        * crypto/keys/CryptoKeyEC.h:
        * crypto/mac/CryptoAlgorithmECDHMac.cpp:
        (WebCore::CryptoAlgorithmECDH::platformDeriveBits):
        * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
        (WebCore::CryptoAlgorithmECDSA::platformSign):
        (WebCore::CryptoAlgorithmECDSA::platformVerify):

2017-08-19  Sergio Villar Senin  <svillar@igalia.com>

        [SVG] Leak in SVGAnimatedListPropertyTearOff
        https://bugs.webkit.org/show_bug.cgi?id=172545

        Reviewed by Darin Adler.

        SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
        SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
        reference to SVGAnimatedProperty.

        When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
        SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
        SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
        is going to be added to. This effectively creates a reference cycle between the
        SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.

        In order to effectively break the cycle without freeing too many wrappers we should take two
        measures:
        1) Break the reference cycle by storing raw pointers in the m_wrappers Vector
        2) Remove the ListItemTearOff which is being deleted (it notifies the animated property by
        calling propertyWillBeDeleted) from the m_wrappers Vector.

        This is a re-land of r219334 which caused early releases of custom data attribute objects
        added to SVG elements (wkb.ug/175023).

        Tests: svg/animations/animation-leak-list-property-instances.html
               svg/dom/SVGAnimatedListPropertyTearOff-crash-2.html
               svg/dom/SVGAnimatedListPropertyTearOff-crash.html
               svg/dom/SVGAnimatedListPropertyTearOff-leak.html

        * svg/properties/SVGAnimatedListPropertyTearOff.h:
        * svg/properties/SVGListProperty.h:
        (WebCore::SVGListProperty::getItemValuesAndWrappers):
        * svg/properties/SVGListPropertyTearOff.h:
        (WebCore::SVGListPropertyTearOff::removeItemFromList):

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

        [Mac] Upstream WKSetMetadataURL() from WebKitSystemInterface
        https://bugs.webkit.org/show_bug.cgi?id=176046

        Reviewed by Alex Christensen.

        * platform/FileSystem.cpp:
        (WebCore::setMetadataURL):
        * platform/FileSystem.h:
        (WebCore::setMetadataURL):
        * platform/mac/FileSystemMac.mm:
        (WebCore::setMetadataURL):
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:

2017-08-29  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed WPE debug build fix.

        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::AppendPipeline::dispatchPendingDecryptionStructure):
        AppendState is an enum class, enum values have to be accessed
        using scope resolution.

2017-08-28  Andy Estes  <aestes@apple.com>

        [Cocoa] Upstream WKGetWebDefaultCFStringEncoding()
        https://bugs.webkit.org/show_bug.cgi?id=176039

        Reviewed by Alex Christensen.

        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/ios/WebCoreSystemInterfaceIOS.mm:
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:
        * platform/text/TextEncodingRegistry.cpp:
        (WebCore::defaultTextEncodingNameForSystemLanguage):
        * platform/text/TextEncodingRegistry.h:
        * platform/text/ios/TextEncodingRegistryIOS.mm: Added.
        (WebCore::webDefaultCFStringEncoding):
        * platform/text/mac/TextEncodingRegistryMac.mm: Added.
        (WebCore::webDefaultCFStringEncoding):

2017-08-28  Joseph Pecoraro  <pecoraro@apple.com>

        REGRESSION(r220278): Web Inspector: ContextMenu items are not getting triggered
        https://bugs.webkit.org/show_bug.cgi?id=176034

        Reviewed by Devin Rousso.

        * inspector/InspectorFrontendHost.cpp:
        (WebCore::InspectorFrontendHost::showContextMenu):
        Responses go through InspectorFrontendAPI not InspectorFrontendHost.

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

        WebRTC MediaStream created without tracks does not update active state after tracks are added
        https://bugs.webkit.org/show_bug.cgi?id=175434

        Reviewed by Eric Carlson.

        Covered by updated test.

        Removing active/inactive events.
        active attribute is still kept and is updated synchronously on every track change.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::MediaStream):
        (WebCore::MediaStream::activeStatusChanged):
        (WebCore::MediaStream::internalAddTrack):
        (WebCore::MediaStream::updateActiveState):
        (WebCore::MediaStream::hasPendingActivity const):
        (WebCore::MediaStream::scheduleActiveStateChange): Deleted.
        (WebCore::MediaStream::activityEventTimerFired): Deleted.
        * Modules/mediastream/MediaStream.h:
        * Modules/mediastream/MediaStream.idl:

2017-08-28  Andy Estes  <aestes@apple.com>

        [Cocoa] Upstream CFNetwork-related WebKitSystemInterface functions
        https://bugs.webkit.org/show_bug.cgi?id=176032

        Reviewed by Alex Christensen.

        * platform/ios/WebCoreSystemInterfaceIOS.mm:
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:
        * platform/network/NetworkStorageSession.h:
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::switchToNewTestingSession):
        (WebCore::NetworkStorageSession::ensureSession):
        * platform/network/cf/ResourceRequest.h:
        * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
        (WebCore::createPrivateStorageSession):
        * platform/network/cocoa/ResourceRequestCocoa.mm:
        (WebCore::ResourceRequest::setStorageSession):
        (WebCore::copyRequestWithStorageSession):
        (WebCore::cachedResponseForRequest):
        * platform/network/mac/CookieJarMac.mm:
        (WebCore::httpCookies):
        (WebCore::setHTTPCookiesForURL):
        (WebCore::deleteHTTPCookie):
        (WebCore::deleteAllHTTPCookies):
        (WebCore::setCookiesFromDOM):
        (WebCore::httpCookieAcceptPolicy):
        (WebCore::cookiesEnabled):
        (WebCore::deleteCookie):
        (WebCore::getHostnamesWithCookies):
        (WebCore::deleteAllCookies):
        (WebCore::deleteCookiesForHostnames):
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::createNSURLConnection):

2017-08-28  Brent Fulgham  <bfulgham@apple.com>

        Disable access to secure cookies if an HTTPS site loads mixed content (Part 2: Header Requests)
        https://bugs.webkit.org/show_bug.cgi?id=175992
        <rdar://problem/34086613>

        Reviewed by Daniel Bates.

        The original work in Bug 157053 did not properly handle the case of websockets. This patch completes
        the changes to secure cookie handling to make sure websockets are also protected.

        Tests: http/tests/websocket/tests/hybi/secure-cookie-insecure-connection.pl
               http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl

        * Modules/websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::clientHandshakeRequest): Remove 'const' declaration so we can work with
        a mutable Document object. This allows us to mark the Document as having accessed secure cookies.
        (WebCore::WebSocketChannel::clientHandshakeRequest const): Deleted.
        * Modules/websockets/WebSocketChannel.h:
        * Modules/websockets/WebSocketHandshake.cpp:
        (WebCore::WebSocketHandshake::clientHandshakeMessage): Ditto.
        (WebCore::WebSocketHandshake::clientHandshakeRequest): Ditto.
        (WebCore::WebSocketHandshake::clientHandshakeMessage const): Deleted.
        (WebCore::WebSocketHandshake::clientHandshakeRequest const): Deleted.
        * Modules/websockets/WebSocketHandshake.h:
        * loader/CookieJar.cpp:
        (WebCore::cookies): Small naming cleanup.
        (WebCore::cookieRequestHeaderFieldValue): Pass a flag indicating whether secure cookies should be
        included in the result or not. Set the document flag indicating secure cookies were accessed (if
        they were), and return the resulting cookie string.
        * loader/CookieJar.h:
        * platform/CookiesStrategy.h:
        * platform/network/CacheValidation.cpp:
        (WebCore::headerValueForVary): Revise to pass a flag indicating whether secure cookies should be included
        or not.
        * platform/network/PlatformCookieJar.h:
        * platform/network/cf/CookieJarCFNet.cpp:
        (WebCore::doesContainSecureCookies): Added helper method.
        (WebCore::cookiesForDOM): Revise to use new helper function.
        (WebCore::cookieRequestHeaderFieldValue): Revise to accept a flag indicating if secure cookies should
        be included in the result. Return a pair consisting of the cookie string, and a flag indicating whether
        secure cookies were accessed or not.
        * platform/network/curl/CookieJarCurl.cpp:
        (WebCore::CookieJarCurlFileSystem::cookieRequestHeaderFieldValue): Ditto.
        (WebCore::cookieRequestHeaderFieldValue): Ditto.
        * platform/network/curl/CookieJarCurl.h:
        * platform/network/mac/CookieJarMac.mm:
        (WebCore::cookiesForSession): Ditto.
        (WebCore::cookiesForDOM): Update for new 'cookiesForSession' signature.
        (WebCore::cookieRequestHeaderFieldValue): Ditto.
        * platform/network/soup/CookieJarSoup.cpp:
        (WebCore::cookieRequestHeaderFieldValue): Revise to accept a flag indicating if secure cookies should
        be included in the result. Return a pair consisting of the cookie string, and a flag indicating whether
        secure cookies were accessed or not.

2017-08-28  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK] [WPE] Rename EventHandlerGlib to EventHandlerGLib
        https://bugs.webkit.org/show_bug.cgi?id=175864

        Unreviewed cosmetic follow-up patch after r221075.

        No new tests. No change in behavior.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * platform/glib/EventHandlerGLib.cpp: Renamed from Source/WebCore/platform/glib/EventHandlerGlib.cpp.
        (WebCore::EventHandler::tabsToAllFormControls const):
        (WebCore::EventHandler::focusDocumentView):
        (WebCore::EventHandler::passWidgetMouseDownEventToWidget):
        (WebCore::EventHandler::passMouseDownEventToWidget):
        (WebCore::EventHandler::eventActivatedView const):
        (WebCore::EventHandler::widgetDidHandleWheelEvent):
        (WebCore::EventHandler::createDraggingDataTransfer const):
        (WebCore::EventHandler::passMousePressEventToSubframe):
        (WebCore::EventHandler::passMouseMoveEventToSubframe):
        (WebCore::EventHandler::passMouseReleaseEventToSubframe):
        (WebCore::EventHandler::accessKeyModifiers):
        (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const):

2017-08-28  Zan Dobersek  <zdobersek@igalia.com>

        [WebCrypto] Push WorkQueue dispatches for AES algorithms into shared code
        https://bugs.webkit.org/show_bug.cgi?id=175539

        Reviewed by Sam Weinig.

        Push the WorkQueue dispatch code and other code duplicated between the
        Mac and libgcrypt implementations of Web Crypto into the shared layer.
        This patch focuses on the AES-based algorithms.

        Functions with platform-specific implementations that are invoked from
        these asynchronous dispatches are made static and return an ExceptionOr
        value. CryptoAlgorithmParameters objects are passed through non-const
        references because data getters could lazily construct the underlying
        Vector objects. CryptoKey objects are passed through const references.
        Implementations can then manually retrieve and further validate any key
        or parameter data, as required for that specific implementation. Input
        data is passed through const references to the original Vector objects.

        No new tests -- no changes in behavior that's covered by existing tests.

        * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
        (WebCore::CryptoAlgorithmAES_CBC::encrypt):
        (WebCore::CryptoAlgorithmAES_CBC::decrypt):
        * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
        * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
        (WebCore::CryptoAlgorithmAES_CFB::encrypt):
        (WebCore::CryptoAlgorithmAES_CFB::decrypt):
        * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
        * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
        (WebCore::CryptoAlgorithmAES_CTR::encrypt):
        (WebCore::CryptoAlgorithmAES_CTR::decrypt):
        * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
        * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
        (WebCore::CryptoAlgorithmAES_GCM::encrypt):
        (WebCore::CryptoAlgorithmAES_GCM::decrypt):
        * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
        * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
        (WebCore::CryptoAlgorithmAES_KW::wrapKey):
        (WebCore::CryptoAlgorithmAES_KW::unwrapKey):
        * crypto/algorithms/CryptoAlgorithmAES_KW.h:
        * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
        (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
        (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
        (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
        (WebCore::gcryptEncrypt):
        (WebCore::gcryptDecrypt):
        (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
        (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
        (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
        * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
        (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
        * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
        (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
        * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
        (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
        * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
        (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
        * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
        (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
        (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):

2017-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS WK2] Web process crashes after changing selection to the end of the document when speaking a selection
        https://bugs.webkit.org/show_bug.cgi?id=176011
        <rdar://problem/32614095>

        Reviewed by Ryosuke Niwa.

        Adds a null check to visiblePositionForPositionWithOffset. This is a crash point for accessibility codepaths,
        since indexForVisiblePosition is not guaranteed to set the given `root` outparam to a non-null value, yet
        visiblePositionForIndex requires root to be non-null. This causes a crash when selecting some text, hitting
        'Speak', and then changing the selection to somewhere near the end of the document, since accessibility code
        will attempt to speak words at an offset past the end of the document. While this is a bug in and of itself, the
        web process should still handle this case gracefully and not crash. To fix this, we simply bail and return a
        null VisiblePosition if a root container node was not found.

        Currently, visiblePositionForPositionWithOffset is implemented twice, in WebCore (AXObjectCache.cpp) and also in
        WebKit (WebPageIOS.mm), as identical static functions. This patch moves this helper into Editing.cpp and removes
        it from AXObjectCache and WebPageIOS.

        Tests: AccessibilityTests.RectsForSpeakingSelectionBasic
               AccessibilityTests.RectsForSpeakingSelectionWithLineWrapping
               AccessibilityTests.RectsForSpeakingSelectionDoNotCrashWhenChangingSelection

        * accessibility/AXObjectCache.cpp:
        (WebCore::visiblePositionForPositionWithOffset): Deleted.
        * editing/Editing.cpp:
        (WebCore::visiblePositionForPositionWithOffset):
        * editing/Editing.h:

2017-08-27  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: Record actions performed on WebGLRenderingContext
        https://bugs.webkit.org/show_bug.cgi?id=174483
        <rdar://problem/34040722>

        Reviewed by Matt Baker.

        Tests: inspector/canvas/recording-webgl.html
               inspector/canvas/recording-webgl-snapshots.html

        * bindings/js/CallTracerTypes.h:
        Add types for WebGL parameters.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateAttributeSetterBodyDefinition):
        (GenerateImplementationFunctionCall):
        (GenerateCallTracerParameter):
        Modify the generated code for `CallTracingCallback` so that optional/nullable types are only
        dereferenced if they have a value.

        * html/canvas/WebGLRenderingContext.idl:
        Add `CallTracingCallback` to interface to record all API calls.

        * inspector/InspectorCanvas.h:
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::resetRecordingData):
        (WebCore::shouldSnapshotWebGLAction):
        (WebCore::InspectorCanvas::recordAction):
        (WebCore::InspectorCanvas::releaseInitialState):
        (WebCore::InspectorCanvas::releaseFrames):
        (WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
        (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
        (WebCore::InspectorCanvas::buildInitialState):
        (WebCore::InspectorCanvas::buildAction):
        For all non-primitive WebGL objects, send a string corresponding to the object's name. The
        value isn't needed since the preview will be generated by the `toDataURL` snapshots taken
        after every visual action.

        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):

        * bindings/scripts/test/TestCallTracer.idl:
        * bindings/scripts/test/JS/JSTestCallTracer.cpp:
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgumentBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgument):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgumentBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgument):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgumentBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgument):

2017-08-26  Dan Bernstein  <mitz@apple.com>

        REGRESSION (r220105): Storage service appears in macOS Activity Monitor as “localized string not found”
        https://bugs.webkit.org/show_bug.cgi?id=176007

        Reviewed by Tim Horton.

        * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.

2017-08-26  Alex Christensen  <achristensen@webkit.org>

        Remove PolicyChecker::cancelCheck
        https://bugs.webkit.org/show_bug.cgi?id=176002

        Reviewed by Darin Adler.

        cancelCheck is conceptually equivalent to not calling a completion handler.
        stopCheck is conceptually equivalent to calling a completion handler with PolicyIgnore just before cleaning up everything,
        which is semantically cleaner and necessary when I replace the last use of PolicyCallback with a CompletionHandler.
        Before this change, we were probably causing some loading objects to hang right before deleting them, and this cleans them up better.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::cancelPolicyCheckIfNeeded):
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::cancelCheck): Deleted.
        * loader/PolicyChecker.h:

2017-08-26  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, tighten up scope of variable in previous commit

        * platform/network/soup/CookieJarSoup.cpp:
        (WebCore::cookiesForSession):

2017-08-26  Michael Catanzaro  <mcatanzaro@igalia.com>

        [SOUP] Update cookie jar implementation to filter out secure cookies
        https://bugs.webkit.org/show_bug.cgi?id=175850

        Reviewed by Brent Fulgham.

        Filter out secure cookies when indicated.

        * platform/network/soup/CookieJarSoup.cpp:
        (WebCore::cookiesForSession):
        (WebCore::cookiesForDOM):
        (WebCore::cookieRequestHeaderFieldValue):
        (WebCore::getRawCookies):

2017-08-26  Xabier Rodriguez Calvar  <calvaris@igalia.com>

        [EME][GStreamer] Connect CDM to GStreamer
        https://bugs.webkit.org/show_bug.cgi?id=175983

        Reviewed by Žan Doberšek.

        This is still a version that will need some changes for some other
        use cases but it should be enough to begin with some passes in the
        tests and some basic use cases.

        We use the attach CDMInstance interface in the private player to
        get the instance in time for the initializationDataEncountered
        event, which is handled when the demuxer reports synchronously the
        events even before configuring the decryptors. We wait there in
        case we don't have the CDMInstance attached (which contains info
        about the key system now) and when we get it we report it back to
        the demuxer and continue sending the event.

        We also handled the events when handled by the decryptors but for
        now this will remain a FIXME. The events handled by the
        AppendPipeline will end up here too for now.

        The CDM instance is created with the key system because some CDMs
        can handle more than one, not ClearKey yet but others in the
        (near) future.

        MockCDMFactory is adapted to the changes as expected.

        * Modules/encryptedmedia/CDM.cpp:
        (WebCore::CDM::CDM):
        * platform/encryptedmedia/CDMFactory.h:
        * platform/encryptedmedia/CDMInstance.h:
        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::CDMFactoryClearKey::createCDM):
        (WebCore::CDMInstanceClearKey::keySystem const):
        * platform/encryptedmedia/clearkey/CDMClearKey.h:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
        (WebCore::extractEventsAndSystemsFromMessage):
        (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
        (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
        (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
        (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithInstance):
        (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance):
        (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
        (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::appendPipelineElementMessageCallback):
        (WebCore::AppendPipeline::AppendPipeline):
        (WebCore::AppendPipeline::~AppendPipeline):
        (WebCore::AppendPipeline::handleNeedContextSyncMessage):
        (WebCore::AppendPipeline::handleElementMessage):
        (WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
        (WebCore::AppendPipeline::appsinkNewSample):
        * platform/graphics/gstreamer/mse/AppendPipeline.h:
        * testing/MockCDMFactory.cpp:
        (WebCore::MockCDMFactory::createCDM):
        (WebCore::MockCDMInstance::keySystem const):
        * testing/MockCDMFactory.h:

2017-08-26  Zan Dobersek  <zdobersek@igalia.com>

        [WebCrypto] Push WorkQueue dispatches for RSA algorithms into shared code
        https://bugs.webkit.org/show_bug.cgi?id=175621

        Reviewed by Darin Adler.

        Push the WorkQueue dispatch code and other code duplicated between the
        Mac and libgcrypt implementations of Web Crypto into the shared layer.
        This patch focuses on the RSA-based algorithms.

        The WorkQueue dispatch code is condensed into two static functions on
        the CryptoAlgorithm class, the first variation handling VectorCallback
        as the callback type and the other handling BoolCallback. The operation
        is kept in a WTF::Function<> object that returns an ExceptionOr<> value
        embedding either a Vector<uint8_t> object or a boolean value, as
        appropriate for the callback type.

        Functions with platform-specific implementations that are invoked from
        these asynchronous dispatches are made static and return an ExceptionOr
        value. CryptoAlgorithmParameters objects are passed through non-const
        references because data getters could lazily construct the underlying
        Vector objects. CryptoKey objects are passed through const references.
        Implementations can then manually retrieve and further validate any key
        or parameter data, as required for that specific implementation. Input
        data is passed through const references to the original Vector objects.

        No new tests -- no changes in behavior that's covered by existing tests.

        * crypto/CryptoAlgorithm.cpp:
        (WebCore::dispatchOperationImpl):
        (WebCore::CryptoAlgorithm::dispatchOperation):
        * crypto/CryptoAlgorithm.h:
        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
        (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
        (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
        * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
        (WebCore::CryptoAlgorithmRSA_PSS::sign):
        (WebCore::CryptoAlgorithmRSA_PSS::verify):
        * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
        * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
        (WebCore::gcryptEncrypt):
        (WebCore::gcryptDecrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
        * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
        (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
        (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
        (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
        (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
        * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
        * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
        * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
        (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
        (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
        * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
        (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
        (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):

2017-08-25  Daniel Bates  <dabates@apple.com>

        Demarcate code added due to lack of NSDMI for aggregates
        https://bugs.webkit.org/show_bug.cgi?id=175990

        Reviewed by Andy Estes.

        * html/canvas/CanvasStyle.h:
        * platform/mediastream/IceCandidate.h:
        (WebCore::IceCandidate::IceCandidate):
        * platform/text/StringWithDirection.h: Replace const String& and String&& constructor
        overloads with a single user-defined constructor that takes a String by value to handle
        both cases.
        (WebCore::StringWithDirection::StringWithDirection):
        (WebCore::truncateFromEnd):
        * style/StyleUpdate.h:
        (WebCore::Style::ElementUpdate::ElementUpdate):
        (WebCore::Style::TextUpdate::TextUpdate):

2017-08-25  Daniel Bates  <dabates@apple.com>

        InlineTextBox::paintDocumentMarker() does not need to special case painting of grammar and
        dictation alternatives
        https://bugs.webkit.org/show_bug.cgi?id=175966

        Reviewed by Tim Horton.

        Remove code that forced computing the marker rect for grammar and dictation alternative
        regardless of whether the marker spans the entire width of the line box. InlineTextBox::paintDocumentMarker()
        has performance optimizations to avoid computing the marker rect if it spans the entire line box.
        Prior to r190363 we had to opt out of these optimizations for grammar and dictation alternative
        markers so that we could store their computed marker rect. In r190363 we removed the logic in
        InlineTextBox::paintDocumentMarker() to store the computed marker rect and hence no longer
        needed to opt out of the optimization for these marker types, but inadvertently left in the
        conditional code that opts them out.

        No functionality changed. So no new tests.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paintDocumentMarker): Remove unnecessary argument grammar and
        code that special cased handling of grammar an dictation alternative markers.
        (WebCore::InlineTextBox::paintDocumentMarkers): Update as necessary.
        * rendering/InlineTextBox.h:

2017-08-25  Chris Dumez  <cdumez@apple.com>

        Land stubs for File and Directory Entries API interfaces
        https://bugs.webkit.org/show_bug.cgi?id=175993
        <rdar://problem/34087477>

        Reviewed by Ryosuke Niwa.

        Land stubs for File and Directory Entries API interfaces:
        - https://wicg.github.io/entries-api/#idl-index

        Those will be needed to support drag and drop.

        Test: http/wpt/entries-api/interfaces.html

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * Modules/entriesapi/DOMFileSystem.cpp: Added.
        (WebCore::DOMFileSystem::DOMFileSystem):
        (WebCore::DOMFileSystem::~DOMFileSystem):
        * Modules/entriesapi/DOMFileSystem.h: Added.
        (WebCore::DOMFileSystem::create):
        (WebCore::DOMFileSystem::name const):
        (WebCore::DOMFileSystem::root const):
        * Modules/entriesapi/DOMFileSystem.idl: Added.
        * Modules/entriesapi/ErrorCallback.h: Added.
        * Modules/entriesapi/ErrorCallback.idl: Added.
        * Modules/entriesapi/FileCallback.h: Added.
        * Modules/entriesapi/FileCallback.idl: Added.
        * Modules/entriesapi/FileSystemDirectoryEntry.cpp: Added.
        (WebCore::FileSystemDirectoryEntry::FileSystemDirectoryEntry):
        (WebCore::FileSystemDirectoryEntry::getFile):
        (WebCore::FileSystemDirectoryEntry::getDirectory):
        * Modules/entriesapi/FileSystemDirectoryEntry.h: Added.
        * Modules/entriesapi/FileSystemDirectoryEntry.idl: Added.
        * Modules/entriesapi/FileSystemEntry.cpp: Added.
        (WebCore::FileSystemEntry::FileSystemEntry):
        * Modules/entriesapi/FileSystemEntry.h: Added.
        (WebCore::FileSystemEntry::~FileSystemEntry):
        (WebCore::FileSystemEntry::isFile const):
        (WebCore::FileSystemEntry::isDirectory const):
        (WebCore::FileSystemEntry::name const):
        (WebCore::FileSystemEntry::fullPath const):
        (WebCore::FileSystemEntry::filesystem const):
        * Modules/entriesapi/FileSystemEntry.idl: Added.
        * Modules/entriesapi/FileSystemEntryCallback.h: Added.
        * Modules/entriesapi/FileSystemEntryCallback.idl: Added.
        * Modules/entriesapi/FileSystemFileEntry.cpp: Added.
        (WebCore::FileSystemFileEntry::FileSystemFileEntry):
        (WebCore::FileSystemFileEntry::file):
        * Modules/entriesapi/FileSystemFileEntry.h: Added.
        * Modules/entriesapi/FileSystemFileEntry.idl: Added.
        * WebCore.xcodeproj/project.pbxproj:

2017-08-25  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r221017): Quip stuck in a perpetual loading loop
        https://bugs.webkit.org/show_bug.cgi?id=175991
        <rdar://problem/34044445>

        Reviewed by Daniel Bates.

        This is a quick fix to return proper function to WebKit. I'll relate a follow-up fix that
        addresses WebSockets more completely.

        * platform/network/mac/CookieJarMac.mm:
        (WebCore::cookieRequestHeaderFieldValue): Don't hard code a value of 'No' for returning secure
        cookies. HTTPS connection should get secure cookies.

2017-08-25  Youenn Fablet  <youenn@apple.com>

        Add support for ReadableStream storage in FetchBody
        https://bugs.webkit.org/show_bug.cgi?id=175866

        Reviewed by Sam Weinig.

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

        Add support for IDLInterface<ReadableStream>, in particular to handle union conversions.
        Adding a ReadableStream that guards JSReadableStream from being collected.
        With this object, FetchBody will be able to store and manipulate ReadableStream.

        Ensure conversion of BodyInit union with ReadableStream is working by adding support for beacon rejection in case of request body streams. 

        * Modules/beacon/NavigatorBeacon.cpp:
        (WebCore::NavigatorBeacon::sendBeacon):
        * Modules/beacon/NavigatorBeacon.idl:
        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::extract):
        * Modules/fetch/FetchBody.h:
        * Modules/fetch/FetchRequest.idl:
        * Modules/fetch/FetchRequestInit.idl:
        * Modules/fetch/FetchResponse.idl:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMConvertInterface.h:
        (WebCore::JSToWrappedOverloader::toWrapped):
        (WebCore::Converter<IDLInterface<T>>::convert):
        * bindings/js/JSDOMConvertUnion.h:
        * bindings/js/ReadableStream.h: Added.
        (WebCore::JSReadableStreamWrapperConverter::toWrapped):

2017-08-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        Using the touchbar, both align left and align justify send a beforeinput event with the 'formatJustifyLeft' inputType.
        https://bugs.webkit.org/show_bug.cgi?id=168669
        <rdar://problem/30639155>

        Reviewed by Beth Dakin.

        Small tweak to add a "formatJustifyFull" inputType when justifying text using the touch bar's rich text
        formatting controls. Currently, the EditActionJustify edit command incorrectly maps to "formatJustifyLeft".

        Test: fast/events/input-events-text-alignment.html

        * editing/EditCommand.cpp:
        (WebCore::inputTypeNameForEditingAction):

2017-08-25  Brady Eidson  <beidson@apple.com>

        Introduce ServerWorkerRegistration task queues.
        https://bugs.webkit.org/show_bug.cgi?id=175851

        Reviewed by Andy Estes.

        Test: http/tests/workers/service/registration-task-queue-scheduling-1.html

        This change introduces:
        - A task thread/queue owned by each SWServer object.
        - The SWServerRegistration object, which is the in-server representation of a
          service worker registration scope.
        - A registration job queue per SWServerRegistration object which actually runs the
          jobs as tasks on the owning SWServer's thread.

        With that infrastructure in place, it moves the "register" job to something that is
        scheduled and rejected asynchronously, as opposed to synchronously rejected.

        The test verifies that two different registration scopes (localhost and 127.0.0.1) 
        can both spam the SWServer with registration requests, but neither of their queues
        starve the other.

        The rest of this change is a lot of support and plumbing for making the above happen.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        
        * dom/ExceptionData.cpp:
        (WebCore::ExceptionData::isolatedCopy const):
        * dom/ExceptionData.h:
        
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::connectionIdentifier):
        * workers/service/ServiceWorkerContainer.h:
        
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::ServiceWorkerJob):
        (WebCore::ServiceWorkerJob::data const): Deleted.
        * workers/service/ServiceWorkerJob.h:
        (WebCore::ServiceWorkerJob::create):
        (WebCore::ServiceWorkerJob::data const):
        (WebCore::ServiceWorkerJob::createRegisterJob): Deleted.
        
        * workers/service/ServiceWorkerJobClient.h:
        
        * workers/service/ServiceWorkerJobData.cpp:
        (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
        (WebCore::ServiceWorkerJobData::registrationKey const):
        (WebCore::ServiceWorkerJobData::isolatedCopy const):
        * workers/service/ServiceWorkerJobData.h:
        (WebCore::ServiceWorkerJobData::jobIdentifier const):
        (WebCore::ServiceWorkerJobData::connectionIdentifier const):
        (WebCore::ServiceWorkerJobData::encode const):
        (WebCore::ServiceWorkerJobData::decode):

        * workers/service/ServiceWorkerRegistrationKey.cpp:
        (WebCore::ServiceWorkerRegistrationKey::emptyKey):
        (WebCore::ServiceWorkerRegistrationKey::hash const):
        (WebCore::ServiceWorkerRegistrationKey::operator== const):
        * workers/service/ServiceWorkerRegistrationKey.h:
        (WTF::ServiceWorkerRegistrationKeyHash::hash):
        (WTF::ServiceWorkerRegistrationKeyHash::equal):
        (WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::emptyValue):
        (WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::constructDeletedValue):
        (WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::isDeletedValue):

        * workers/service/ServiceWorkerRegistrationOptions.cpp:
        (WebCore::RegistrationOptions::isolatedCopy const):
        * workers/service/ServiceWorkerRegistrationOptions.h:
        (WebCore::RegistrationOptions::encode const):
        (WebCore::RegistrationOptions::decode):

        * workers/service/server/SWClientConnection.h:

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::Connection):
        (WebCore::SWServer::~SWServer):
        (WebCore::SWServer::Connection::scheduleJobInServer):
        (WebCore::SWServer::SWServer):
        (WebCore::SWServer::scheduleJob):
        (WebCore::SWServer::rejectJob):
        (WebCore::SWServer::taskThreadEntryPoint):
        (WebCore::SWServer::postTask):
        (WebCore::SWServer::postTaskReply):
        (WebCore::SWServer::handleTaskRepliesOnMainThread):
        (WebCore::SWServer::registerConnection):
        (WebCore::SWServer::unregisterConnection):
        * workers/service/server/SWServer.h:
        (WebCore::SWServer::Connection::identifier const):

        * workers/service/server/SWServerRegistration.cpp: Added.
        (WebCore::SWServerRegistration::SWServerRegistration):
        (WebCore::SWServerRegistration::~SWServerRegistration):
        (WebCore::SWServerRegistration::enqueueJob):
        (WebCore::SWServerRegistration::startNextJob):
        (WebCore::SWServerRegistration::performCurrentJob):
        (WebCore::SWServerRegistration::rejectCurrentJob):
        (WebCore::SWServerRegistration::finishCurrentJob):
        * workers/service/server/SWServerRegistration.h:

2017-08-25  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, add comment warning that some flags have been copied into Epiphany

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

2017-07-25  Frederic Wang  <fwang@igalia.com>

        Add flag allow-modals to iframe sandbox
        https://bugs.webkit.org/show_bug.cgi?id=171321

        This patch implements the "allow-modals" value for the iframe sandbox attribute. It changes
        the behavior for sandboxed document so that alert, confirm, prompt, print as well as dialogs
        generated from a beforeunload event are blocked when allow-modals is not set, as defined in
        the specification. For consistency, we do the same for document.execCommand('print', ...).
        Users should use the allow-modals flag in order to explictly allow modal dialogs.

        See https://html.spec.whatwg.org/multipage/origin.html#sandboxed-modals-flag

        Reviewed by Brent Fulgham.

        Tests: http/tests/security/sandboxed-iframe-ALLOWED-modals.html
               http/tests/security/sandboxed-iframe-DENIED-modals.html

        * dom/SecurityContext.cpp: Implement parsing for allow-modals
        (WebCore::SecurityContext::isSupportedSandboxPolicy):
        (WebCore::SecurityContext::parseSandboxPolicy):
        * dom/SecurityContext.h: Introduce flag for allow-modals
        * loader/FrameLoader.cpp:
        (WebCore::shouldAskForNavigationConfirmation): Prevent confirm dialog from beforeunload when
        allow-modals is not set.
        * page/Chrome.h: Change the signature of print, so it may return a failure when the
        allow-modals flag is not set.
        * page/Chrome.cpp:
        (WebCore::Chrome::print): Returns false and print a message error when the allow-modals flag
        on the frame's document is not set. Otherwise, execute the command and returns true.
        * editing/EditorCommand.cpp:
        (WebCore::executePrint): Ensure that document.execCommand for 'print' returns false when the
        allow-modals flag is not set.
        * page/DOMWindow.cpp: Add early exit when alert, confirm or prompt when the allow-modals flag
        for that document is not set. Note that print is handled in Chrome.cpp.
        (WebCore::DOMWindow::alert): Add early exit.
        (WebCore::DOMWindow::confirm): Add early exit with the return value indicated in the spec.
        (WebCore::DOMWindow::prompt): Ditto.

2017-08-25  Brady Eidson  <beidson@apple.com>

        Unreviewed, rolling out r221181.

        Broke builds that use CryptoAlgorithmRSA_PSSMac.cpp

        Reverted changeset:

        "[WebCrypto] Push WorkQueue dispatches for RSA algorithms into
        shared code"
        https://bugs.webkit.org/show_bug.cgi?id=175621
        http://trac.webkit.org/changeset/221181

2017-08-25  Xabier Rodriguez Calvar  <calvaris@igalia.com>

        [EME][ClearKey] Fixed warning in CDM compilation
        https://bugs.webkit.org/show_bug.cgi?id=175979

        Reviewed by Žan Doberšek.

        * platform/encryptedmedia/clearkey/CDMClearKey.h: Added a final to
        avoid the compiler warning about the missing override keyword.

2017-08-25  Miguel Gomez  <magomez@igalia.com>

        [GTK] Completely garbled display in Transifex in accelerated compositing mode
        https://bugs.webkit.org/show_bug.cgi?id=174632

        Reviewed by Michael Catanzaro.

        Remove the copy constructor from PlatformContextCairo::State. This is because it will be used by WTF::Vector
        to copy the instances around when allocating new memory, but it doesn't copy the m_imageMaskInformation
        attribute, so it will be lost when the Vector reallocates its contents. When this happens, renderings that use
        GraphicsContext::clipToImageBuffer() fail to render properly.

        Covered by existent tests.

        * platform/graphics/cairo/PlatformContextCairo.cpp:
        (WebCore::PlatformContextCairo::State::State):
        (WebCore::PlatformContextCairo::save):

2017-08-25  Xabier Rodriguez Calvar  <calvaris@igalia.com>

        [EME][GStreamer] Move createDescryptor function to GStreamerEMEUtilities
        https://bugs.webkit.org/show_bug.cgi?id=175930

        Reviewed by Žan Doberšek.

        * platform/graphics/gstreamer/GStreamerUtilities.cpp:
        (WebCore::createGstDecryptor): Deleted.
        * platform/graphics/gstreamer/GStreamerUtilities.h:
        * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
        (WebCore::GStreamerEMEUtilities::createDecryptor): Created.
        * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::AppendPipeline::parseDemuxerSrcPadCaps): Use
        GStreamerEMEUtilities::createDecryptor instead.

2017-08-25  Zan Dobersek  <zdobersek@igalia.com>

        [WebCrypto] Push WorkQueue dispatches for RSA algorithms into shared code
        https://bugs.webkit.org/show_bug.cgi?id=175621

        Reviewed by Darin Adler.

        Push the WorkQueue dispatch code and other code duplicated between the
        Mac and libgcrypt implementations of Web Crypto into the shared layer.
        This patch focuses on the RSA-based algorithms.

        The WorkQueue dispatch code is condensed into two static functions on
        the CryptoAlgorithm class, the first variation handling VectorCallback
        as the callback type and the other handling BoolCallback. The operation
        is kept in a WTF::Function<> object that returns an ExceptionOr<> value
        embedding either a Vector<uint8_t> object or a boolean value, as
        appropriate for the callback type.

        Functions with platform-specific implementations that are invoked from
        these asynchronous dispatches are made static and return an ExceptionOr
        value. CryptoAlgorithmParameters objects are passed through non-const
        references because data getters could lazily construct the underlying
        Vector objects. CryptoKey objects are passed through const references.
        Implementations can then manually retrieve and further validate any key
        or parameter data, as required for that specific implementation. Input
        data is passed through const references to the original Vector objects.

        No new tests -- no changes in behavior that's covered by existing tests.

        * crypto/CryptoAlgorithm.cpp:
        (WebCore::dispatchOperationImpl):
        (WebCore::CryptoAlgorithm::dispatchOperation):
        * crypto/CryptoAlgorithm.h:
        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
        (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
        (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
        * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
        (WebCore::CryptoAlgorithmRSA_PSS::sign):
        (WebCore::CryptoAlgorithmRSA_PSS::verify):
        * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
        * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
        (WebCore::gcryptEncrypt):
        (WebCore::gcryptDecrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
        * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
        (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
        (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
        * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
        (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
        (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
        * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
        * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
        * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
        (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
        (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
        * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
        (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
        (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):

2017-08-24  Chris Dumez  <cdumez@apple.com>

        Unreviewed, add File and Directory Entries API to status page.

        * features.json:

2017-08-24  Chris Dumez  <cdumez@apple.com>

        Unreviewed, update status of Beacon API.

        It is now supported in Safari Technology Preview.

        * features.json:

2017-08-24  Chris Dumez  <cdumez@apple.com>

        [Directory Upload] Add basic support for input.webkitdirectory
        https://bugs.webkit.org/show_bug.cgi?id=175950
        <rdar://problem/33951915>

        Reviewed by Geoffrey Garen.

        Add basic support for input.webkitdirectory attribute, as per:
        - https://wicg.github.io/entries-api/#html-forms

        The following is supported:
        - input.webkitdirectory IDL and content attributes
        - The webkitdirectory content attribute is properly consulted
          to communicate to the client that the file picker should
          allow selecting directories.
        - When WebCore gets the list of selected files from the file picker,
          it properly resolves folders in a background thread to properly
          initialize input.files before firing the 'change' event at the
          input element.
        - When resolving files in a directory, we ignore both hidden files and
          symbolic links for security reasons. I did not check symlinks but Firefox
          and Chrome both seem to upload hidden files (such as .DS_Store files).
        - File.webkitRelativePath IDL attribute is properly populated for
          files coming from a selected directory.
        - Form submission just works because it relies on input.files being
          properly populated. No change needed in this area.

        What is not supported:
        - input.webkitEntries IDL attribute.
        - FileSystemEntry / FileSystemDirectoryEntry / FileSystemDirectoryReader
          /  FileSystemFileEntry / FileSystem IDL interfaces.
        - dataTransferItem.webkitGetAsEntry() for proper drag and drop support.

        Those will be taken care of in follow-up patches.

        The feature is currently behind an experimental feature flag, disabled by
        default.

        Tests: fast/forms/file/webkitdirectory-drag-folder.html
               fast/forms/file/webkitdirectory-open-panel.html

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * fileapi/File.cpp:
        (WebCore::File::createWithRelativePath):
        * fileapi/File.h:
        * fileapi/File.idl:
        * html/FileInputType.cpp:
        (WebCore::FileInputType::~FileInputType):
        (WebCore::FileInputType::handleDOMActivateEvent):
        (WebCore::FileInputType::allowsDirectories const):
        (WebCore::FileInputType::filesChosen):
        * html/FileInputType.h:
        * html/FileListCreator.cpp: Added.
        (WebCore::appendDirectoryFiles):
        (WebCore::FileListCreator::FileListCreator):
        (WebCore::FileListCreator::createFileList):
        (WebCore::FileListCreator::cancel):
        * html/FileListCreator.h: Copied from Source/WebKit/UIProcess/API/APIOpenPanelParameters.h.
        (WebCore::FileListCreator::create):
        * html/HTMLAttributeNames.in:
        * html/HTMLInputElement.idl:
        * page/Settings.in:
        * platform/FileChooser.h:
        (WebCore::FileChooserFileInfo::isolatedCopy const):
        * platform/FileMetadata.h:
        * platform/FileSystem.cpp:
        (WebCore::fileIsDirectory):
        * platform/FileSystem.h:
        * platform/glib/FileSystemGlib.cpp:
        (WebCore::getFileMetadata):
        * platform/posix/FileSystemPOSIX.cpp:
        (WebCore::getFileMetadata):
        * platform/win/FileSystemWin.cpp:
        (WebCore::getFileMetadata):

2017-08-24  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r221139.

        This change did not resolve the LayoutTest assertion failure.

        Reverted changeset:

        "REGRESSION (r220052): ASSERTION FAILED:
        !frame().isMainFrame() || !needsStyleRecalcOrLayout()  in
        WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive()"
        https://bugs.webkit.org/show_bug.cgi?id=175270
        http://trac.webkit.org/changeset/221139

2017-08-24  Jon Lee  <jonlee@apple.com>

        Unreviewed.

        * Modules/mediastream/MediaStreamTrack.idl: Remove extraneous and confusing comment in IDL.
        The 'new' enum was removed via r215198, so we can remove this specific FIXME.

2017-08-24  Alex Christensen  <achristensen@webkit.org>

        Stop using PolicyCallback for new window policies
        https://bugs.webkit.org/show_bug.cgi?id=175907

        Reviewed by Andy Estes.

        PolicyCallback is an artifact from the days before C++11.  Let's use lambdas instead!
        No change in behaviour.

        * loader/PolicyCallback.cpp:
        (WebCore::PolicyCallback::set):
        (WebCore::PolicyCallback::call):
        (WebCore::PolicyCallback::cancel):
        * loader/PolicyCallback.h:
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNewWindowPolicy):
        (WebCore::PolicyChecker::continueAfterNewWindowPolicy): Deleted.
        * loader/PolicyChecker.h:

2017-08-24  Michael Saboff  <msaboff@apple.com>

        Add support for RegExp "dotAll" flag
        https://bugs.webkit.org/show_bug.cgi?id=175924

        Reviewed by Keith Miller.

        Changed due to refactoring NewlineClassID to DotClassID.

        No new tests. No change in behavior.

        * contentextensions/URLFilterParser.cpp:
        (WebCore::ContentExtensions::PatternParser::atomBuiltInCharacterClass):

2017-08-24  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, revert part of r221152 to fix internal builds.

        * crypto/mac/CryptoKeyRSAMac.cpp:
        (WebCore::CryptoKeyRSA::create):

2017-08-24  Kirill Ovchinnikov  <kirill.ovchinn@gmail.com>

        HTMLTrackElement behavior violates the standard
        https://bugs.webkit.org/show_bug.cgi?id=175888

        Reviewed by Eric Carlson.

        Test: media/track/text-track-src-change.html: added asserts

        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::parseAttribute):
        (WebCore::HTMLTrackElement::loadTimerFired):
        * html/track/LoadableTextTrack.cpp:
        (WebCore::LoadableTextTrack::scheduleLoad):
        * html/track/TextTrack.cpp:
        (WebCore::TextTrack::removeAllCues):
        * html/track/TextTrackCueList.cpp:
        (WebCore::TextTrackCueList::removeAll):
        * html/track/TextTrackCueList.h:

2017-08-24  David Kilzer  <ddkilzer@apple.com>

        Fix -Wcast-qual and -Wunused-lambda-capture warnings in WebCore with new clang compiler
        <https://webkit.org/b/175910>
        <rdar://problem/33667497>

        Reviewed by Alex Christensen.

        Fix -Wunused-lambda-capture warnings:

        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::setBodyData): Remove unused lambda
        capture of 'this'.
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::createRenderer): Add
        UNUSED_PARAM(style) when ENABLE(CSS_REGIONS) is turned off.

        Fix -Wcast-qual warnings:

        * crypto/mac/CryptoKeyRSAMac.cpp:
        (WebCore::CryptoKeyRSA::create): Switch from C-style cast to
        reinterpret_cast with const keyword.  This better matches the
        argument types used in CCRSACryptorCreateFromData().
        * platform/audio/mac/FFTFrameMac.cpp:
        (WebCore::FFTFrame::doFFT): Switch from C-style cast to
        reinterpret_cast with const keyword.  This better matches the
        argument type used in vDSP_ctoz().
        * platform/graphics/FontPlatformData.h: Only define
        WebCore::toCTFont() and WebCore::toNSFont() when building for
        Objective-C++.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
        Switch from C-style cast to reinterpret_cast with const keyword.
        This better matches the argument type used in
        Uint8Array::setRange().
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::CMTimebaseEffectiveRateChangedCallback): Use
        const_cast to avoid warning.
        * platform/mac/SSLKeyGeneratorMac.mm:
        (WebCore::signedPublicKeyAndChallengeString): Use const_cast to
        avoid warning, and switch C-style cast to reinterpret_cast.
        * xml/XSLTProcessorLibxslt.cpp:
        (WebCore::XSLTProcessor::transformToString):
        - Use const_cast to avoid warning, and switch C-style cast to
          reinterpret_cast.
        - Switch C-style cast to reinterpret_cast and add const keyword.
        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::XMLParserContext::createMemoryParser): Use const_cast
        to avoid warning, and switch C-style cast to reinterpret_cast.

2017-08-22  Dave Hyatt  <hyatt@apple.com>

        [Repaint Outside Layout] Add a pref for repainting outside of layout
        https://bugs.webkit.org/show_bug.cgi?id=175729

        Reviewed by Daniel Bates.

        * page/Settings.in:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::checkForRepaintDuringLayout):

2017-08-22  Darin Adler  <darin@apple.com>

        REGRESSION (r220052): ASSERTION FAILED: !frame().isMainFrame() || !needsStyleRecalcOrLayout()  in WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive()
        https://bugs.webkit.org/show_bug.cgi?id=175270

        Reviewed by Simon Fraser.

        * dom/Document.cpp:
        (WebCore::Document::Document): Initialize m_styleRecalcTimer with a lamdba so it can work
        with a function that returns a bool and ignore the return value.
        (WebCore::Document::updateStyleIfNeeded): Added a boolean return value indicating if the
        function did any work or not.
        * dom/Document.h: Updated for above change.

        * page/FrameView.cpp:
        (WebCore::appendRenderedChildren): Added helper that will later replace the
        FrameView::renderedChildFrameViews function and is used below.
        (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): Instead of always doing two
        passes of style and layout update do up to four passes, but stop as soon as a pass does
        no work. This is slightly more efficient in cases where no layout and style update is
        needed, and works correctly when a third pass is needed, which is what happens in the
        test that was failing. We can eventually improve this further, but this resolves the
        immediate problem we are seeing in the test.

2017-08-24  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Use find_package for SQLite
        https://bugs.webkit.org/show_bug.cgi?id=175803

        Reviewed by Konstantin Tokarev.

        No new tests. No change in behavior.

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

2017-08-23  Adrian Perez de Castro  <aperez@igalia.com>

        Geoclue2 based backend should provide the right desktop ID
        https://bugs.webkit.org/show_bug.cgi?id=129879

        Reviewed by Michael Catanzaro.

        * platform/geoclue/GeolocationProviderGeoclue.cpp:
        (GeolocationProviderGeoclue::createGeoclueClientProxyCallback): Try first obtaining the application
        identifier using GApplication first, keeping a fallback to the value returned by g_get_prgname().

2017-08-24  Zan Dobersek  <zdobersek@igalia.com>

        [EME] Implement HTMLMediaElement dispatch of the onencrypted event
        https://bugs.webkit.org/show_bug.cgi?id=175927

        Reviewed by Xabier Rodriguez-Calvar.

        Add the MediaPlayerClient::mediaPlayerInitializationDataEncountered()
        method that the platform-layer media pipeline can invoke when it hits
        encrypted content in the media data. The initialization data and its type
        are passed by the caller, allowing the HTMLMediaElement override to
        process it further.

        This is done in the mediaPlayerInitializationDataEncountered() override
        in the HTMLMediaElement class. Partially implementing the 'Initialization
        Data Encountered' algorithm, the 'encrypted' event is dispatched, with the
        MediaEncryptedEvent interface being leveraged to embed init data and init
        data type information. CORS and mixed-content validation of the media data
        is skipped for now.

        MediaPlayer::initializationDataEncountered() method should be used to
        dispatch the corresponding method on the client, passing on the given init
        data and init data type values.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
        * html/HTMLMediaElement.h:
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::initializationDataEncountered):
        * platform/graphics/MediaPlayer.h:
        (WebCore::MediaPlayerClient::mediaPlayerInitializationDataEncountered):

2017-08-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        DeleteSelectionCommand should be robust when starting and ending editable positions cannot be found
        https://bugs.webkit.org/show_bug.cgi?id=175914
        <rdar://problem/29792688>

        Reviewed by Ryosuke Niwa.

        DeleteSelectionCommand can cause a null dereference if editable start and end positions are not found. This can
        happen when attempting to delete after selecting the contents within a canvas or output element with `read-write`
        `-webkit-user-modify` style. To fix this, we make the initialization step of the DeleteSelectionCommand robust
        when editable start and end positions are missing.

        Test: editing/execCommand/forward-delete-read-write-canvas.html

        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::initializePositionData):

        Make this initialization helper indicate failure via a bool return value. DeleteSelectionCommand::doApply bails
        early if initializePositionData returned false.

        (WebCore::DeleteSelectionCommand::doApply):
        * editing/DeleteSelectionCommand.h:

2017-08-23  Youenn Fablet  <youenn@apple.com>

        [Cache API] Unify WebCore and WebKit error handling
        https://bugs.webkit.org/show_bug.cgi?id=175902
        <rdar://problem/34045933>

        Unreviewed.

        * Modules/cache/DOMCache.h: Fixing Windows build.

2017-08-23  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r221109.

        This change caused assertion failures on iOS and macOS debug
        bots.

        Reverted changeset:

        "Stop using PolicyCallback for new window policies"
        https://bugs.webkit.org/show_bug.cgi?id=175907
        http://trac.webkit.org/changeset/221109

2017-08-23  Jer Noble  <jer.noble@apple.com>

        [EME] WebCoreDecompressionSession should only report having an available frame if it has one for the current time.
        https://bugs.webkit.org/show_bug.cgi?id=175901

        Reviewed by Eric Carlson.

        The WebCoreDecompressionSession will trigger the hasAvailableFrame callback whenever a frame is decoded,
        regardless of its presentation time. For formats which have out-of-order decoding, the newly decoded frame could
        have a presentation time far in the future. Instead, only fire the callback if the decoded frame's presentation
        times contains the timebase's current time.

        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):

2017-08-23  Youenn Fablet  <youenn@apple.com>

        [Cache API] Unify WebCore and WebKit error handling
        https://bugs.webkit.org/show_bug.cgi?id=175902

        Reviewed by Alex Christensen.

        No change of behavior.

        Introducing a DOMCache namespace enclosing structures, callbacks and function definitions
        previously found in either WebCore::CacheStorageConnection or WebKit::CacheStorage.

        Some previously used callbacks had no way to pass errors in WebCore while they had in WebKit.
        Updated Cache, CacheStorage, CacheStorageConnection and WorkerCacheStorageConnection to deal with these potential errors.

        * CMakeLists.txt:
        * Modules/cache/Cache.cpp:
        (WebCore::FetchTasksHandler::FetchTasksHandler):
        (WebCore::FetchTasksHandler::records const):
        (WebCore::FetchTasksHandler::addRecord):
        (WebCore::Cache::addAll):
        (WebCore::Cache::put):
        (WebCore::Cache::retrieveRecords):
        (WebCore::queryCacheMatch):
        (WebCore::Cache::batchDeleteOperation):
        (WebCore::toConnectionRecord):
        (WebCore::Cache::batchPutOperation):
        (WebCore::Cache::updateRecords):
        * Modules/cache/Cache.h:
        * Modules/cache/CacheStorage.cpp:
        (WebCore::CacheStorage::retrieveCaches):
        (WebCore::CacheStorage::open):
        (WebCore::CacheStorage::remove):
        * Modules/cache/CacheStorage.h:
        * Modules/cache/CacheStorageConnection.cpp:
        (WebCore::CacheStorageConnection::open):
        (WebCore::CacheStorageConnection::remove):
        (WebCore::CacheStorageConnection::retrieveCaches):
        (WebCore::CacheStorageConnection::batchDeleteOperation):
        (WebCore::CacheStorageConnection::batchPutOperation):
        (WebCore::CacheStorageConnection::openOrRemoveCompleted):
        (WebCore::CacheStorageConnection::updateCaches):
        (WebCore::CacheStorageConnection::updateRecords):
        (WebCore::CacheStorageConnection::deleteRecordsCompleted):
        (WebCore::CacheStorageConnection::putRecordsCompleted):
        * Modules/cache/CacheStorageConnection.h:
        (WebCore::CacheStorageConnection::openCompleted):
        (WebCore::CacheStorageConnection::removeCompleted):
        (WebCore::CacheStorageConnection::doOpen):
        (WebCore::CacheStorageConnection::doRemove):
        (WebCore::CacheStorageConnection::doBatchDeleteOperation):
        (WebCore::CacheStorageConnection::doBatchPutOperation):
        * Modules/cache/WorkerCacheStorageConnection.cpp:
        (WebCore::toCrossThreadRecordData):
        (WebCore::fromCrossThreadRecordData):
        (WebCore::WorkerCacheStorageConnection::doOpen):
        (WebCore::WorkerCacheStorageConnection::doRemove):
        (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
        (WebCore::recordsDataFromRecords):
        (WebCore::recordsDataOrErrorFromRecords):
        (WebCore::recordsFromRecordsData):
        (WebCore::recordsOrErrorFromRecordsData):
        (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
        (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
        (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
        * Modules/cache/DOMCache.cpp: Added.
        * Modules/cache/DOMCache.h: Added.
        * Modules/cache/WorkerCacheStorageConnection.h:
        * WebCore.xcodeproj/project.pbxproj:

2017-08-23  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Optimize Map iteration with intrinsic
        https://bugs.webkit.org/show_bug.cgi?id=174355

        Reviewed by Saam Barati.

        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneSerializer::serialize):

2017-08-23  Alex Christensen  <achristensen@webkit.org>

        Stop using PolicyCallback for new window policies
        https://bugs.webkit.org/show_bug.cgi?id=175907

        Reviewed by Andy Estes.

        PolicyCallback is an artifact from the days before C++11.  Let's use lambdas instead!
        No change in behaviour.

        * loader/PolicyCallback.cpp:
        (WebCore::PolicyCallback::set):
        (WebCore::PolicyCallback::call):
        (WebCore::PolicyCallback::cancel):
        * loader/PolicyCallback.h:
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNewWindowPolicy):
        (WebCore::PolicyChecker::continueAfterNewWindowPolicy): Deleted.
        * loader/PolicyChecker.h:

2017-08-23  Alex Christensen  <achristensen@webkit.org>

        Stop using PolicyChecker for ContentPolicy
        https://bugs.webkit.org/show_bug.cgi?id=175904

        Reviewed by Tim Horton.

        PolicyChecker is an artifact from the days before C++11.  Now we have lambdas which
        have a cleaner flow than one class that exists to be effectively one of three lambda types.
        Let's remove them one at a time, starting with ContentPolicy checks.
        
        No change in behaviour.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::responseReceived):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::checkContentPolicy):
        * loader/FrameLoader.h:
        * loader/PolicyCallback.cpp:
        (WebCore::PolicyCallback::set):
        (WebCore::PolicyCallback::call):
        (WebCore::PolicyCallback::cancel):
        * loader/PolicyCallback.h:
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkContentPolicy): Deleted.
        (WebCore::PolicyChecker::continueAfterContentPolicy): Deleted.
        * loader/PolicyChecker.h:

2017-08-23  Jer Noble  <jer.noble@apple.com>

        Build fix for 32-bit Mac after r221098. Make sure constant used in WebCoreDecompressionSession is SoftLinked.

        * platform/cf/CoreMediaSoftLink.cpp:
        * platform/cf/CoreMediaSoftLink.h:

2017-08-23  Jer Noble  <jer.noble@apple.com>

        Track VideoPlaybackQuality metrics when using WebCoreDecompressionSession.
        https://bugs.webkit.org/show_bug.cgi?id=175835
        <rdar://problem/34022234>

        Reviewed by Eric Carlson.

        Test: platform/mac/media/media-source/videoplaybackquality-decompressionsession.html

        Track the total number of frames decoded, dropped, & corrupted, as well as the total
        delay imposed by decoding in the WebCoreDecompressionSession.

        Drive-by fix: implement frame dropping by skipping frames whose presentation times are
        before the video's current time and which aren't depended upon by other frames.

        * platform/cf/CoreMediaSoftLink.cpp:
        * platform/cf/CoreMediaSoftLink.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
        * platform/graphics/cocoa/WebCoreDecompressionSession.h:
        (WebCore::WebCoreDecompressionSession::totalVideoFrames):
        (WebCore::WebCoreDecompressionSession::droppedVideoFrames):
        (WebCore::WebCoreDecompressionSession::corruptedVideoFrames):
        (WebCore::WebCoreDecompressionSession::totalFrameDelay):
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::shouldDecodeSample):
        (WebCore::WebCoreDecompressionSession::decodeSample):
        (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):

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

        [Payment Request] Update to "In Development" in features.json
        https://bugs.webkit.org/show_bug.cgi?id=175897

        Reviewed by Sam Weinig.

        * features.json:

2017-08-22  Dean Jackson  <dino@apple.com>

        Default passive touch event listeners on the root
        https://bugs.webkit.org/show_bug.cgi?id=175346
        <rdar://problem/33164597>

        Reviewed by Sam Weinig.

        Make any touchstart or touchmove event listeners passive by default
        if they are on the document, window, body or document element targets.
        This follows the "intervention" first implemented by Chrome/Blink:

        https://github.com/WICG/interventions/issues/35
        https://docs.google.com/document/d/1II7oSIpd8pK91V5kEM3tDLKcIj398jOJn8Niqy6_loI/edit
        https://github.com/whatwg/dom/issues/365

        If the event listener explicitly defines "passive" to false in their
        options dictionary, then they'll still get a non-passive listener.

        NOTE: Any fallout from this bug should be collected in:
        https://bugs.webkit.org/show_bug.cgi?id=175869
        Please do not revert this change just because a site is broken. We'll
        gather the issues and see if we can evangelise or detect via code.

        Tests: fast/events/touch/ios/passive-by-default-on-document-and-window.html
               fast/events/touch/ios/passive-by-default-overridden-on-document-and-window.html

        * dom/EventNames.h:
        (WebCore::EventNames::isTouchScrollBlockingEventType const): Added this helper
        to identify the types of touches we want to check for.
        * dom/EventTarget.cpp:
        (WebCore::EventTarget::addEventListener): Check for the event being one of the touch-types
        that we care about, and the target being one of the Node/Window types we care about. If
        so, tell the event listener to be passive.
        * dom/EventTarget.h: Use an optional for the passive member.
        (WebCore::EventTarget::AddEventListenerOptions::AddEventListenerOptions):
        * dom/EventTarget.idl: Change "passive" to not have a default value, so we
        can detect if it was explicitly set to false.

2017-08-23  Tim Horton  <timothy_horton@apple.com>

        Try to fix the WinCairo build after r221068

        * platform/win/PlatformScreenWin.cpp:

2017-08-23  Youenn Fablet  <youenn@apple.com>

        [Cache API] Enable persistent coder to encode FetchOptions
        https://bugs.webkit.org/show_bug.cgi?id=175883

        Reviewed by Alex Christensen.

        No change of behavior.
        Adding encode/decode routines for FetchOptions.

        * loader/FetchOptions.h:
        (WebCore::FetchOptions::encode const):
        (WebCore::FetchOptions::decode):
        * platform/ReferrerPolicy.h:

2017-08-23  Yusuke Suzuki  <utatane.tea@gmail.com>

        Race condition in StartWebThread causing crash
        https://bugs.webkit.org/show_bug.cgi?id=175852

        Reviewed by Mark Lam.

        When starting web thread, the main thread waits for completion of web thread initialization
        by using pthread_cond_t. However, the main thread may be woken up due to the existence of
        the spurious wake up of pthread_cond_t.

        Instead, we should use WTF::Lock and WTF::Condition. Since our StartWebThread already calls
        WTF::initializeThreading, it is safe to use WTF::Lock and WTF::Condition. And our WTF::Condition
        does not have the spurious wake up problem as described in Condition.h.

        * platform/ios/wak/WebCoreThread.mm:
        (RunWebThread):
        (StartWebThread):

2017-08-23  Brent Fulgham  <bfulgham@apple.com>

        Ensure media controls host exists before using it
        https://bugs.webkit.org/show_bug.cgi?id=175833
        <rdar://problem/34001219>

        Reviewed by Jer Noble.

        Although we ensure that the media controls shadow root exists before updating the text track
        container, we don't check that the media controls host has been created yet. We do check
        and create in other places in HTMLMediaElement.

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

2017-08-23  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [WPE] Some event handlers not working.
        https://bugs.webkit.org/show_bug.cgi?id=175864

        Reviewed by Michael Catanzaro.

        Share the EventHandler implementation with the GTK port and add ifdefs where needed.

        Covered by existing tests.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * page/wpe/EventHandlerWPE.cpp: Removed.
        * platform/glib/EventHandlerGlib.cpp: Renamed from Source/WebCore/page/gtk/EventHandlerGtk.cpp.
        (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const):

2017-08-22  Tim Horton  <timothy_horton@apple.com>

        _WKThumbnailView should use the screen color space instead of sRGB
        https://bugs.webkit.org/show_bug.cgi?id=175858
        <rdar://problem/33925559>

        Reviewed by Dean Jackson.

        * platform/PlatformScreen.h:
        * platform/ios/PlatformScreenIOS.mm:
        (WebCore::screenColorSpace):
        * platform/mac/PlatformScreenMac.mm:
        (WebCore::screenColorSpace):
        (WebCore::screenSupportsExtendedColor):
        * platform/win/PlatformScreenWin.cpp:
        (WebCore::screenColorSpace):
        Add screenColorSpace, which returns the active color space for the
        given Widget's screen. On Windows, just fall back to sRGB like we usually do.

2017-08-22  Ryosuke Niwa  <rniwa@webkit.org>

        Consolidate the code to normalize MIME type in DataTransfer
        https://bugs.webkit.org/show_bug.cgi?id=175810

        Rubber-stamped by Wenson Hsieh.

        Address the forgotten review comment by Wenson.

        Tests: editing/pasteboard/datatransfer-getdata-plaintext.html

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

2017-08-20  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div
        https://bugs.webkit.org/show_bug.cgi?id=175116
        <rdar://problem/28279301>

        Reviewed by Darin Adler and Ryosuke Niwa.

        WebCore support for WebPage::editorState refactoring. See WebKit ChangeLogs for more detail.

        Tests: EditorStateTests.TypingAttributesBold
               EditorStateTests.TypingAttributesItalic
               EditorStateTests.TypingAttributesUnderline
               EditorStateTests.TypingAttributesTextAlignmentAbsoluteAlignmentOptions
               EditorStateTests.TypingAttributesTextAlignmentStartEnd
               EditorStateTests.TypingAttributesTextAlignmentDirectionalText
               EditorStateTests.TypingAttributesTextColor
               EditorStateTests.TypingAttributesMixedStyles
               EditorStateTests.TypingAttributesLinkColor

        * css/StyleProperties.cpp:
        (WebCore::StyleProperties::propertyAsColor const):
        (WebCore::StyleProperties::propertyAsValueID const):

        Introduces some helper functions in StyleProperties to convert CSS property values to Color or a CSSValueID.

        * css/StyleProperties.h:
        * editing/EditingStyle.cpp:
        (WebCore::EditingStyle::hasStyle):

        Pull out logic in selectionStartHasStyle that asks for a style TriState into EditingStyle::hasStyle. This is
        because WebPage::editorState will now query for multiple styles at the selection start, but
        selectionStartHasStyle currently recomputes styleAtSelectionStart every time it is called. To prevent extra work
        from being done, we can just call selectionStartHasStyle once and use ask for EditingStyle::hasStyle on the
        computed EditingStyle at selection start.

        * editing/EditingStyle.h:
        * editing/Editor.cpp:
        (WebCore::Editor::selectionStartHasStyle const):

2017-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WK2] EditorState updates should be rolled into the layer update lifecycle when possible
        https://bugs.webkit.org/show_bug.cgi?id=175370
        <rdar://problem/33799806>

        Reviewed by Ryosuke Niwa.

        Remove didChangeSelectionAndUpdateLayout -- EditorState updates that are scheduled due to missing post-layout
        data will now be scheduled for the next presentation update. Additionally, add editor client hooks to notify the
        WebKit layer when we've updated the current composition. See WebKit ChangeLog for more details. This patch
        adjusts and rebaselines existing layout tests.

        * editing/Editor.cpp:
        (WebCore::SetCompositionScope::SetCompositionScope):
        (WebCore::SetCompositionScope::~SetCompositionScope):

        Introduce a helper RAII class to ensure that we ignore selection changes during the scope of
        Editor::setComposition and call out to the client with WebEditorClient::didUpdateComposition afterwards. This
        also maintains a UserTypingGestureIndicator over its lifetime, so we don't additionally need to create a
        UserTypingGestureIndicator in Editor::setComposition.

        (WebCore::Editor::setComposition):
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::setSelection):
        (WebCore::FrameSelection::updateAndRevealSelection):
        (WebCore::FrameSelection::setSelectedRange):
        * editing/FrameSelection.h:
        (WebCore::FrameSelection::defaultSetSelectionOptions):

        Plumb state about whether or not the selection change was triggered by the user to FrameSelection::setSelection,
        and if so, notify the editing client. A separate SetSelectionOptions flag is used here instead of
        RevealSelection to avoid calling out to the client in places where we want to reveal the selection regardless of
        whether or not the selection is user triggered.

        * loader/EmptyClients.cpp:
        * page/EditorClient.h:

2017-08-21  Ryosuke Niwa  <rniwa@webkit.org>

        Consolidate the code to normalize MIME type in DataTransfer
        https://bugs.webkit.org/show_bug.cgi?id=175810

        Reviewed by Wenson Hsieh.

        Factored out the code to convert MIME type to lowercase after stripping whitespace,
        and treat "text" as "text/plain" and "url" as "text/uri-list".

        Specifications:
        https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-getdata-2
        https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-setdata-2
        https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-cleardata-2

        Stripping of whitespace only happens in WebKit/Blink but it's probably required for compatbility.
        Spec bug: https://github.com/whatwg/html/issues/2946

        Test: editing/pasteboard/datatransfer-getdata-plaintext.html

        * dom/DataTransfer.cpp:
        (WebCore::normalizeType):
        (WebCore::DataTransfer::clearData):
        (WebCore::DataTransfer::getData const):
        (WebCore::DataTransfer::setData):
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::selectionDataTypeFromHTMLClipboardType):
        * platform/ios/PasteboardIOS.mm:
        (WebCore::cocoaTypeFromHTMLClipboardType):
        * platform/mac/PasteboardMac.mm:
        (WebCore::cocoaTypeFromHTMLClipboardType):
        * platform/win/PasteboardWin.cpp:
        (WebCore::clipboardTypeFromMIMEType):

2017-08-22  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r221033.

        This revision caused assertion failures on all Open Source
        Debug testers. See Radar for more information.

        Reverted changeset:

        "Ensure media controls host exists before using it"
        https://bugs.webkit.org/show_bug.cgi?id=175833
        http://trac.webkit.org/changeset/221033

2017-08-22  Per Arne Vollan  <pvollan@apple.com>

        [Win] Fix compile errors.
        https://bugs.webkit.org/show_bug.cgi?id=175860

        Reviewed by Brent Fulgham.

        Add required header files. 

        * platform/network/cf/CookieJarCFNet.cpp:

2017-08-22  Brent Fulgham  <bfulgham@apple.com>

        Correct SOUP builds after r221017 and r221050.
        https://bugs.webkit.org/show_bug.cgi?id=175846

        Reviewed by Michael Catanzaro.

        * platform/network/soup/CookieJarSoup.cpp:
        (WebCore::cookiesForDOM): Revise return type.

2017-08-22  Brent Fulgham  <bfulgham@apple.com>

        Correct SOUP and cURL builds after r221017.
        https://bugs.webkit.org/show_bug.cgi?id=175846

        Reviewed by Michael Catanzaro.

        Correct the method signatures for 'cookiesForDOM' on the SOUP and cURL backends.
        Note that these ports will need to add specific logic to find/filter secure cookies
        if requested by the caller.

        * platform/network/curl/CookieJarCurl.cpp:
        (WebCore::CookieJarCurlFileSystem::cookiesForDOM):
        (WebCore::cookiesForDOM):
        * platform/network/curl/CookieJarCurl.h:
        * platform/network/soup/CookieJarSoup.cpp:
        (WebCore::cookiesForDOM):

2017-08-22  Chris Dumez  <cdumez@apple.com>

        [EnabledBySetting] in WebIDL uses Document but does not include Document.h
        https://bugs.webkit.org/show_bug.cgi?id=175843

        Reviewed by Sam Weinig.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):

2017-08-22  Jer Noble  <jer.noble@apple.com>

        Refactor videoPerformanceQuality() MediaPlayer methods into single call.
        https://bugs.webkit.org/show_bug.cgi?id=175830

        Reviewed by Eric Carlson.

        Allow MediaPlayerPrivate subclasses to return all the metrics required for VideoPerformanceQuality in
        a single call. For clients which incur significant overhead to request this data, this reduces the cost
        of requesting data by the number of calls removed.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::getVideoPlaybackQuality):
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::videoPlaybackQualityMetrics):
        (WebCore::MediaPlayer::totalVideoFrames): Deleted.
        (WebCore::MediaPlayer::droppedVideoFrames): Deleted.
        (WebCore::MediaPlayer::corruptedVideoFrames): Deleted.
        (WebCore::MediaPlayer::totalFrameDelay): Deleted.
        * platform/graphics/MediaPlayer.h:
        (WebCore::PlatformVideoPlaybackQualityMetrics::PlatformVideoPlaybackQualityMetrics):
        * platform/graphics/MediaPlayerPrivate.h:
        (WebCore::MediaPlayerPrivateInterface::videoPlaybackQualityMetrics):
        (WebCore::MediaPlayerPrivateInterface::totalVideoFrames): Deleted.
        (WebCore::MediaPlayerPrivateInterface::droppedVideoFrames): Deleted.
        (WebCore::MediaPlayerPrivateInterface::corruptedVideoFrames): Deleted.
        (WebCore::MediaPlayerPrivateInterface::totalFrameDelay): Deleted.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::totalVideoFrames): Deleted.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::droppedVideoFrames): Deleted.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::corruptedVideoFrames): Deleted.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::totalFrameDelay): Deleted.
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
        * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
        (WebCore::MockMediaPlayerMediaSource::videoPlaybackQualityMetrics):
        (WebCore::MockMediaPlayerMediaSource::totalVideoFrames): Deleted.
        (WebCore::MockMediaPlayerMediaSource::droppedVideoFrames): Deleted.
        (WebCore::MockMediaPlayerMediaSource::corruptedVideoFrames): Deleted.
        (WebCore::MockMediaPlayerMediaSource::totalFrameDelay): Deleted.
        * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
        * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
        (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
        * platform/mock/mediasource/MockMediaSourcePrivate.h:

2017-08-22  Brent Fulgham  <bfulgham@apple.com>

        Ensure media controls host exists before using it
        https://bugs.webkit.org/show_bug.cgi?id=175833
        <rdar://problem/34001219>

        Reviewed by Jer Noble.

        Although we ensure that the media controls shadow root exists before updating the text track
        container, we don't check that the media controls host has been created yet. We do check
        and create in other places in HTMLMediaElement.

        Tests: media/track/track-display-before-controls-crash.html

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

2017-08-22  Youenn Fablet  <youenn@apple.com>

        [Cache API] Optimize whitespace trimming in Vary header values
        https://bugs.webkit.org/show_bug.cgi?id=175837

        Reviewed by Alex Christensen.

        No change of behavior.

        Introducing a StringView version of stripLeadingAndTrailingHTTPSpaces.

        * Modules/cache/Cache.cpp:
        (WebCore::hasResponseVaryStarHeaderValue):
        * platform/network/HTTPParsers.h:
        (WebCore::stripLeadingAndTrailingHTTPSpaces):

2017-08-22  Alex Christensen  <achristensen@webkit.org>

        Remove ChromeClient::scrollbarsModeDidChange
        https://bugs.webkit.org/show_bug.cgi?id=175805

        Reviewed by Daniel Bates.

        No change in behavior.  It was never called, and no implementations did anything.

        * loader/EmptyClients.h:
        * page/Chrome.cpp:
        (WebCore::Chrome::scrollbarsModeDidChange const): Deleted.
        * page/Chrome.h:
        * page/ChromeClient.h:
        * platform/HostWindow.h:

2017-08-22  Devin Rousso  <webkit@devinrousso.com>

        Web Inspector: provide way for ShaderPrograms to be enabled/disabled
        https://bugs.webkit.org/show_bug.cgi?id=175400

        Reviewed by Matt Baker.

        Test: inspector/canvas/setShaderProgramDisabled.html

        * inspector/InspectorShaderProgram.h:
        (WebCore::InspectorShaderProgram::disabled):
        (WebCore::InspectorShaderProgram::setDisabled):

        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::drawArrays):
        (WebCore::WebGLRenderingContextBase::drawElements):
        If the current program is disabled, return early. This will prevent the current shader
        program from drawing anything to the canvas.

        * inspector/InspectorCanvasAgent.h:
        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
        (WebCore::InspectorCanvasAgent::isShaderProgramDisabled):
        * inspector/InspectorInstrumentation.h:
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::isShaderProgramDisabled):
        (WebCore::InspectorInstrumentation::isShaderProgramDisabledImpl):

2017-08-22  Youenn Fablet  <youenn@apple.com>

        [Cache API] Add support for overwriting responses with put on an existing record
        https://bugs.webkit.org/show_bug.cgi?id=175825

        Reviewed by Geoffrey Garen.

        Tests: http/wpt/cache-storage/cache-put-keys.https.any.html
               http/wpt/cache-storage/cache-put-keys.https.any.worker.html

        Adding support for the new response update counter.
        Overwriting local cached response with new retrieved response when the counter is different.
        Adding support for passing this value from/to workers.

        * Modules/cache/Cache.cpp:
        (WebCore::Cache::queryCacheWithTargetStorage):
        (WebCore::toConnectionRecord):
        (WebCore::Cache::updateRecords):
        * Modules/cache/CacheStorageConnection.cpp:
        (WebCore::CacheStorageConnection::Record::copy const):
        * Modules/cache/CacheStorageConnection.h:
        * Modules/cache/CacheStorageRecord.h:
        * Modules/cache/WorkerCacheStorageConnection.cpp:
        (WebCore::toCrossThreadRecordData):
        (WebCore::fromCrossThreadRecordData):

2017-08-22  Alex Christensen  <achristensen@webkit.org>

        Remove ChromeClient::hasOpenedPopup
        https://bugs.webkit.org/show_bug.cgi?id=175804

        Reviewed by Sam Weinig.

        No change in behavior.  All implementations just returned false.

        * loader/EmptyClients.h:
        * page/Chrome.cpp:
        (WebCore::Chrome::hasOpenedPopup const): Deleted.
        * page/Chrome.h:
        * page/ChromeClient.h:
        * rendering/RenderMenuList.cpp:
        (RenderMenuList::showPopup):

2017-08-22  Andy Estes  <aestes@apple.com>

        [Payment Request] Implement error checking for show(), abort(), and canMakePayment()
        https://bugs.webkit.org/show_bug.cgi?id=175789

        Reviewed by Brady Eidson.

        Implement many of the exceptions and promise rejections specified for PaymentRequest's
        show(), abort(), and canMakePayment() methods. Also implement basic state tracking.

        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::PaymentRequest::create): Changed serializedMethodData from a
        HashMap<String, String> to a Vector<PaymentRequest::Method>.
        (WebCore::PaymentRequest::PaymentRequest):
        (WebCore::PaymentRequest::show): Added promise rejection for invalid state, updated the
        state to Interactive, stored the promise in m_showPromise, and dispatched finishShowing().
        (WebCore::PaymentRequest::finishShowing): Added JSON parsing of payment method serialized
        data and exception propagation. If there are no exceptions, rejected m_showPromise with
        NotSupportedError since we don't yet support any payment methods.
        (WebCore::PaymentRequest::abort): Added promise rejection for invalid state and stored the
        promise in m_abortPromise. Dispatched a lambda to update the state to Closed, reject
        m_showPromise, and resolve m_abortPromise.
        (WebCore::PaymentRequest::canMakePayment): Added promise rejection for invalid state and
        stored the promise in m_canMakePaymentPromise. Dispatched a lambda to resolve
        m_canMakePaymentPromise with false since we don't yet support any payment methods.
        * Modules/paymentrequest/PaymentRequest.h:
        * Modules/paymentrequest/PaymentRequest.idl: Annotated abort() with MayThrowException.

2017-08-22  Brent Fulgham  <bfulgham@apple.com> and Pranjal Jumde  <pjumde@apple.com>

        Disable access to secure cookies if an HTTPS site loads mixed content
        https://bugs.webkit.org/show_bug.cgi?id=157053
        <rdar://problem/11290808>

        Reviewed by Dan Bates.

        Tests: http/tests/security/mixedContent/insecure-css-with-secure-cookies.html
               http/tests/security/mixedContent/insecure-image-with-securecookie-block.html
               http/tests/security/mixedContent/insecure-image-with-securecookie.html
               http/tests/security/mixedContent/insecure-script-with-secure-cookies.html
               http/tests/security/mixedContent/redirect-https-to-http-image-secure-cookies-block.html
               http/tests/security/mixedContent/redirect-https-to-http-image-secure-cookies.html

        * dom/SecurityContext.h: 
        (WebCore::SecurityContext::secureCookiesAccessed): Added.
        (WebCore::SecurityContext::setSecureCookiesAccessed): Added.
        * loader/CookieJar.cpp:
        (WebCore::cookies): Pass Document as non-const so we can call 'setSecureCookiesAccessed' if necessary.
        * loader/CookieJar.h:
        * loader/MixedContentChecker.cpp:
        (WebCore::MixedContentChecker::canRunInsecureContent): Updated checks to avoid running insecure content
        if secure cookies were accessed. 
        * platform/CookiesStrategy.h:
        (WebCore::CookiesStrategy::cookiesForDOM): Pass new argument indicating whether secure cookies should be included in the response.
        * platform/network/PlatformCookieJar.h:
        * platform/network/cf/CookieJarCFNet.cpp:
        (copyCookiesForURLWithFirstPartyURL): Revise to accept new 'IncludeSecureCookiesOrNot' argument.
        (WebCore::cookiesForSession): Updated to accept new 'IncludeSecureCookiesOrNot' argument. Also determine if secure cookies were
        included in the response, and return this to the caller.
        (WebCore::cookieRequestHeaderFieldValue): Revise for new 'copyCookiesForURLWithFirstPartyURL' signature.
        (WebCore::getRawCookies): Ditto.
        * platform/network/mac/CookieJarMac.mm:
        (WebCore::cookiesForSession): Updated checks to keep track of secure cookies and filter out secure cookies if insecure content
        was accessed.
        (WebCore::cookiesForDOM): Update for new arguments and to return a pair.
        (WebCore::cookieRequestHeaderFieldValue): Ditto.

2017-08-22  Jer Noble  <jer.noble@apple.com>

        Autoplay Muted Videos Don't Play When Outside Viewport
        https://bugs.webkit.org/show_bug.cgi?id=175748
        <rdar://problem/33974383>

        Reviewed by Eric Carlson.

        Test: media/video-restricted-invisible-autoplay-not-allowed-source.html

        The media session is notified that its client (the media element) will begin autoplaying inside
        prepareForLoad(), where the m_autoplaying flag is also set. But loading via <source> elements does not go
        through prepareForLoad(); the HTML standard states that the <source> element loading path does not trigger the
        "media element load algorithm" which is implemented in prepareForLoad(). Since the m_autoplaying flag is
        initially set to true, notify the media session that the element will begin autoplaying inside the element's
        constructor.

        Drive-by fix: Doing the above causes other tests to crash, as purturbing play state during style change can cause
        re-entrancy in the native controls code, or fail, since we will transition from autoplay -> play even if there's
        not yet a src or source to the media element. Add a task queue for updating the autoplay state and check the ready
        state before allowing autoplay to transition to play.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::HTMLMediaElement):
        (WebCore::HTMLMediaElement::~HTMLMediaElement):
        (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
        (WebCore::HTMLMediaElement::isVisibleInViewportChanged):

2017-08-21  Matt Rajca  <mrajca@apple.com>

        Call updateIsPlayingMedia whenever m_userHasInteractedWithMediaElement changes
        https://bugs.webkit.org/show_bug.cgi?id=175796

        Reviewed by Eric Carlson.

        Test: media/video-user-gesture-tracking.html

        The page media state depends on m_userHasInteractedWithMediaElement, so force it to update
        as soon as m_userHasInteractedWithMediaElement changes. This fixes an issue where the media
        state would not reflect the user interaction flag until a call to updateIsPlayingMedia was made.

        * dom/Document.cpp:
        (WebCore::Document::noteUserInteractionWithMediaElement):
        * dom/Document.h:
        (WebCore::Document::noteUserInteractionWithMediaElement): Deleted.
        * testing/Internals.cpp:
        (WebCore::Internals::pageMediaState):

2017-08-22  Zan Dobersek  <zdobersek@igalia.com>

        GLContext: zero-initialize the GLContext pointer in ThreadGlobalGLContext
        https://bugs.webkit.org/show_bug.cgi?id=175819

        Reviewed by Xabier Rodriguez-Calvar.

        * platform/graphics/GLContext.cpp: The ThreadGlobalGLContext object is
        allocated on heap, so the embedded GLContext pointer can contain a
        non-null value that can cause problems when e.g. checking for a current
        GLContext on some specific thread on which a GLContext hasn't yet been
        made current. Zero-initializing this pointer will avoid false positives
        that can occur in these circumstances.

2017-08-21  Youenn Fablet  <youenn@apple.com>

        [Cache API] Add support for Cache.add/addAll
        https://bugs.webkit.org/show_bug.cgi?id=175677

        Reviewed by Alex Christensen.

        Covered by rebased tests.

        Cache.addAll implementation is then as follow:
        - Fetch the resources in parallel.
        - Wait for all them to complete using FetchTaskCounter.
        - If an error happens in any load or if the response is not as expected for Cache API, reject the promise.
        - Call the batch put operation with all received FetchResponse objects.

        FetchTaskCounter is responsible to wait for each response to arrive.
        It then checks whether the response is fine,
        If not, the addAll promise is rejected.
        Otherwise, it waits for the body to be received.

        Introducing a helper routine to create a FetchRequest from a given RequestInfo.
        Introducing a helper routine to check for Vary Header '*' value in response headers.

        * Modules/cache/Cache.cpp:
        (WebCore::Cache::doMatch):
        (WebCore::Cache::add):
        (WebCore::queryCacheMatch):
        (WebCore::hasResponseVaryStarHeaderValue):
        (WebCore::FetchTaskCounter::FetchTaskCounter):
        (WebCore::FetchTaskCounter::~FetchTaskCounter):
        (WebCore::FetchTaskCounter::addRecord):
        (WebCore::FetchTaskCounter::isDone const):
        (WebCore::FetchTaskCounter::reject):
        (WebCore::Cache::requestFromInfo):
        (WebCore::Cache::addAll):
        (WebCore::Cache::put):
        (WebCore::Cache::remove):
        (WebCore::Cache::keys):
        (WebCore::toConnectionRecord):
        (WebCore::Cache::batchPutOperation):
        * Modules/cache/Cache.h:

2017-08-21  Myles C. Maxfield  <mmaxfield@apple.com>

        DataInteractionTests.ExternalSourceAttributedStringToContentEditable hits a debug assertion
        https://bugs.webkit.org/show_bug.cgi?id=175787
        <rdar://problem/33996612>

        Reviewed by Wenson Hsieh.

        The variation axis values of San Francisco changed from the GX-style scale to the CSS-style
        scale. Previously, we were normalizing the values we got from Core Text to fit the CSS scale;
        however, this is no longer necessary since the font now does this itself.

        The assertion was getting hit because the normalized values were huge and were overflowing
        a single FontSelectionValue (and going negative). This patch adds handling for this
        situation.

        Test: DataInteractionTests.ExternalSourceBoldSystemAttributedStringToContentEditable

        * platform/graphics/FontSelectionAlgorithm.h: Typedef the backing type for a FontSelectionValue.
        (WebCore::FontSelectionValue::rawValue const):
        (WebCore::FontSelectionValue::maximumValue):
        (WebCore::FontSelectionValue::minimumValue):
        (WebCore::FontSelectionValue::FontSelectionValue):
        * platform/graphics/cocoa/FontCacheCoreText.cpp: Opt-out of normalization for San Francisco.
        (WebCore::variationCapabilitiesForFontDescriptor):
        (WebCore::capabilitiesForFontDescriptor):

2017-08-21  Chris Dumez  <cdumez@apple.com>

        [Beacon] Content extensions should be able to intercept Beacon / Ping redirects
        https://bugs.webkit.org/show_bug.cgi?id=175746
        <rdar://problem/33946050>

        Reviewed by Alex Christensen.

        Update PingLoad to process content extension rules upon redirect. This allows content
        extensions to block and upgrade to HTTPS beacon / ping loads.

        Because ping loads can outlive the WebProcess, the content extensions rules are passed
        to the NetworkProcess when starting the Ping load. The PingLoad can then consult those
        rules upon redirect, on the NetworkProcess side.

        Tests: http/wpt/beacon/contentextensions/beacon-blocked.html
               http/wpt/beacon/contentextensions/beacon-redirect-blocked.html

        * contentextensions/ContentExtensionActions.h:
        * contentextensions/ContentExtensionsBackend.cpp:
        (WebCore::ContentExtensions::ContentExtensionsBackend::forEach):
        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad):
        * contentextensions/ContentExtensionsBackend.h:
        * page/Page.h:
        * page/UserContentProvider.cpp:
        (WebCore::UserContentProvider::forEachContentExtension):
        * page/UserContentProvider.h:

2017-08-21  Brady Eidson  <beidson@apple.com>

        ASSERTION FAILED: !m_connections.contains(&connection) in WebCore::SWServer::unregisterConnection(WebCore::SWServer::Connection&).
        https://bugs.webkit.org/show_bug.cgi?id=175795

        Rubber-stamped by Andy Estes.

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::unregisterConnection): Flip the ASSERT to be... correct.

2017-08-21  Daniel Bates  <dabates@apple.com>

        Cleanup TextPainter
        https://bugs.webkit.org/show_bug.cgi?id=175782

        Reviewed by Myles C. Maxfield.

        Remove redundant mention of "text" in the name of TextPainter member functions, add separate
        setters for selection and non-selection shadows, and do some other minor cleanups.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paint): Update code for renamed functions.
        * rendering/SimpleLineLayoutFunctions.cpp:
        (WebCore::SimpleLineLayout::paintFlow): Ditto.
        * rendering/TextPainter.cpp: Include ShadowData.h.
        (WebCore::ShadowApplier::ShadowApplier): Use C++11 brace-initialization syntax.
        (WebCore::ShadowApplier::isLastShadowIteration): Moved from TextPainter.h.
        (WebCore::ShadowApplier::shadowIsCompletelyCoveredByText): Ditto.
        (WebCore::TextPainter::paintTextOrEmphasisMarks): Renamed; formerly named drawTextOrEmphasisMarks.
        (WebCore::TextPainter::paintTextWithShadows): Update code for renamed functions.
        (WebCore::TextPainter::paintRange): Renamed; formerly named paintTextInRange.
        (WebCore::TextPainter::paint): Renamed; formerly named paintText.
        (WebCore::TextPainter::drawTextOrEmphasisMarks): Renamed to paintTextOrEmphasisMarks() to match
        the naming convention of all the other paint functions in this class.
        (WebCore::TextPainter::paintTextInRange): Renamed to paintRange.
        (WebCore::TextPainter::paintText): Renamed to paint.
        * rendering/TextPainter.h: Forward declare ShadowData.
        (WebCore::TextPainter::setStyle): Renamed; formerly named setTextPaintStyle.
        (WebCore::TextPainter::setSelectionStyle): Renamed; formerly named setSelectionPaintStyle.
        (WebCore::TextPainter::setShadow): Added.
        (WebCore::TextPainter::setSelectionShadow): Added.
        (WebCore::TextPainter::setEmphasisMark): Renamed; formerly named addEmphasis. 
        (WebCore::TextPainter::setTextPaintStyle): Renamed to setStyle.
        (WebCore::TextPainter::setSelectionPaintStyle): Renamed to setSelectionStyle.
        (WebCore::TextPainter::addEmphasis): Renamed to setEmphasisMark.
        (WebCore::TextPainter::addTextShadow): Split functionality into setShadow and setSelectionShadow.
        (WebCore::ShadowApplier::isLastShadowIteration): Moved to TextPainter.cpp.
        (WebCore::ShadowApplier::shadowIsCompletelyCoveredByText): Ditto.

2017-08-21  Myles C. Maxfield  <mmaxfield@apple.com>

        Addressing post-review comments after r220725
        https://bugs.webkit.org/show_bug.cgi?id=175382

        Reviewed by Darin Adler.

        * css/CSSFontFace.cpp:
        (WebCore::CSSFontFace::setUnicodeRange):

2017-08-21  Youenn Fablet  <youenn@apple.com>

        [Cache API] Add support for CacheStorage.match
        https://bugs.webkit.org/show_bug.cgi?id=175747

        Reviewed by Chris Dumez.

        Covered by rebased tests.

        Introducing Cache::doMatch so that CacheStorage can use it.
        Make Cache::match use Cache::doMatch as well.

        Implementing CacheStorage.match as per spec:
        - If name is provided, query only the cache with the given name.
        - Otherwise pick the first matching response in the caches.
        The sequential asynchronous search is done in doSequentialMatch.

        Making sure that response with a status code are returning false to isNull.
        This allows passing more tests.

        * Modules/cache/Cache.cpp:
        (WebCore::Cache::match):
        (WebCore::Cache::doMatch):
        (WebCore::Cache::matchAll):
        (WebCore::toConnectionRecord):
        * Modules/cache/Cache.h:
        * Modules/cache/CacheStorage.cpp:
        (WebCore::doSequentialMatch):
        (WebCore::copyCaches):
        (WebCore::CacheStorage::match):
        * platform/network/ResourceResponseBase.cpp:
        (WebCore::ResourceResponseBase::setHTTPStatusCode):

2017-08-21  Dean Jackson  <dino@apple.com>

        Persistent WebGL Warning "vertex WARNING: 0:1: extension 'GL_ARB_gpu_shader5' is not supported" in Safari 10.1.2
        https://bugs.webkit.org/show_bug.cgi?id=175783
        <rdar://problem/33623867>

        Reviewed by Alex Christensen.

        The version of ANGLE we use inserts this line into each shader:
        #extension GL_ARB_gpu_shader5 : enable
        It causes our lower-level GLSL compiler to give a warning, which is
        confusing to developers because they didn't write this code.

        Until we upgrade our OpenGL support to version 4.1, we should remove
        this error message from the log returned to the developer.
        See https://bugs.webkit.org/show_bug.cgi?id=175785

        Test: fast/canvas/webgl/no-info-log-for-simple-shaders.html

        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::getUnmangledInfoLog): Search for and remove
        this warning.

2017-08-21  Andy Estes  <aestes@apple.com>

        [Payment Request] Use ExistingExceptionError to propagate JS exceptions thrown during JSON stringification
        https://bugs.webkit.org/show_bug.cgi?id=175776

        Reviewed by Darin Adler.

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

2017-08-21  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        [PAL] Move spi/mac directory into PAL
        https://bugs.webkit.org/show_bug.cgi?id=175649

        Reviewed by Myles C. Maxfield.

        * WebCore.xcodeproj/project.pbxproj:
        * editing/cocoa/DataDetection.mm:
        * editing/mac/DictionaryLookup.h:
        * editing/mac/DictionaryLookup.mm:
        * page/mac/ServicesOverlayController.mm:
        * page/mac/WheelEventDeltaFilterMac.mm:
        * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
        * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
        * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        * platform/graphics/mac/FontCacheMac.mm:
        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        * platform/graphics/mac/MediaTimeQTKit.h:
        * platform/mac/MediaRemoteSoftLink.cpp:
        * platform/mac/MediaRemoteSoftLink.h:
        * platform/mac/PasteboardWriter.mm:
        * platform/mac/PlatformEventFactoryMac.mm:
        * platform/mac/ScrollAnimatorMac.mm:
        * platform/mac/ScrollbarThemeMac.mm:
        * platform/mac/VideoFullscreenInterfaceMac.mm:
        * platform/mac/WebVideoFullscreenController.mm:
        * rendering/RenderThemeMac.mm:

2017-08-21  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE][GSTREAMER_GL] Overriden virtual function not marked “override” in MediaPlayerPrivateGStreamerBase.h
        https://bugs.webkit.org/show_bug.cgi?id=175780

        Reviewed by Konstantin Tokarev.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Add missing "override" qualifier.

2017-08-21  Brady Eidson  <beidson@apple.com>

        Split the one SWServer::Connection into SWClientConnection and SWServer::Connection.
        https://bugs.webkit.org/show_bug.cgi?id=175745

        Reviewed by Andy Estes.

        No new tests (No behavior change).

        Each of these has a much different environment that it lives in, so being the same object
        hinders clean development.
        
        This split will also make it easier for the WebCore objects to directly handle WK2 messages.
        
        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        
        * platform/Logging.h:

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::scheduleJob):
        * workers/service/ServiceWorkerContainer.h:

        * workers/service/ServiceWorkerProvider.h:

        * workers/service/server/SWClientConnection.cpp: Copied from Source/WebCore/workers/service/server/SWServer.cpp.
        (WebCore::SWClientConnection::SWClientConnection):
        (WebCore::SWClientConnection::~SWClientConnection):
        (WebCore::SWClientConnection::scheduleJob):
        (WebCore::SWClientConnection::jobRejectedInServer):
        * workers/service/server/SWClientConnection.h: Copied from Source/WebCore/workers/service/server/SWServer.h.

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::Connection):
        (WebCore::SWServer::Connection::~Connection):
        (WebCore::SWServer::~SWServer):
        (WebCore::SWServer::Connection::scheduleJobInServer):
        (WebCore::SWServer::scheduleJob):
        (WebCore::SWServer::registerConnection):
        (WebCore::SWServer::unregisterConnection):
        (WebCore::SWServer::Connection::scheduleJob): Deleted.
        (WebCore::SWServer::Connection::jobRejected): Deleted.
        * workers/service/server/SWServer.h:
        (WebCore::SWServer::Connection::server):
        (WebCore::SWServer::Connection::~Connection): Deleted.

2017-08-21  Andy Estes  <aestes@apple.com>

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

        Reviewed by Darin Adler.

        * Modules/paymentrequest/PaymentDetailsModifier.h: Changed total to an std::optional<PaymentItem>.
        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::isWellFormedCurrencyCode): Implements the IsWellFormedCurrencyCode abstract operation from ECMA 402.
        (WebCore::isValidDecimalMonetaryValue): Implements the "valid decimal monetary value" validity checker.
        (WebCore::checkAndCanonicalizeAmount): Implements the "check and canonicalize amount" validity checker.
        (WebCore::checkAndCanonicalizeTotal): Implements the "check and canonicalize total" validity checker.
        (WebCore::PaymentRequest::create): Implements the PaymentRequest Constructor
        (WebCore::PaymentRequest::PaymentRequest):
        (WebCore::PaymentRequest::id const): Implements the PaymentRequest id attribute.
        (WebCore::PaymentRequest::shippingType const): Implements the PaymentRequest shippingType attribute.
        * Modules/paymentrequest/PaymentRequest.h:
        * Modules/paymentrequest/PaymentRequest.idl: Annotated PaymentRequest with ConstructorMayThrowException.
        * WebCore.xcodeproj/project.pbxproj:

2017-08-21  Per Arne Vollan  <pvollan@apple.com>

        [Win] DRT should only allow any https certificate for localhost.
        https://bugs.webkit.org/show_bug.cgi?id=175147

        Reviewed by Brent Fulgham.

        Disabling validation of certificate chains, breaks SSL on Windows. In order
        for SSL tests to succeed on Windows, we should avoid disabling it.

        No new tests, covered by existing tests.

        * platform/network/cf/ResourceHandleCFNet.cpp:
        (WebCore::ResourceHandle::createCFURLConnection):

2017-08-21  Zan Dobersek  <zdobersek@igalia.com>

        [EME] HTMLMediaElement: basic implementations of 'Attempt to Decrypt', 'Attempt to Resume Playback If Necessary'
        https://bugs.webkit.org/show_bug.cgi?id=175761

        Reviewed by Xabier Rodriguez-Calvar.

        Add initial and incomplete implementations of the 'Attempt to Decrypt' and
        'Attempt to Resume Playback If Necessary' algorithms.  The implementations
        are interleaved with the specification text for clarity.

        'Attempt to Decrypt' implementation doesn't yet address the encrypted block
        queue or the 'decryption blocked waiting for key' flag since it's not yet
        clear whether it would make more sense for this state to reside lower, in
        the platform layer. The gist of the algorithm is to invoke the decryption
        attempt through the MediaPlayer object, passing along the CDMInstance object
        retrieved from the MediaKeys object that is associated with this media
        element.

        'Attempt to Resume Playback if Necessary' implementation similarly for now
        omits the various state flag operations. The main task at this point is to
        dispatch the 'Attempt to Decrypt' algorithm.

        HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary() method now
        invokes the attemptToResumePlaybackIfNecessary() method.

        MediaKeys::hasOpenSessions() is introduced, returning true if any session
        that was created through this MediaKeys instance is still open. This allows
        the 'Attempt to Decrypt' algorithm to proceed with the decryption attempt
        dispatch into the MediaPlayer hierarchy.

        For that, the MediaPlayer::attemptToDecryptWithInstance() method is added,
        which simply dispatches the mirror method on MediaPlayerPrivate interface.
        This will enable the platform-layer implementations to use the passed-in
        CDMInstance object for decryption purposes.

        * Modules/encryptedmedia/MediaKeySession.h:
        * Modules/encryptedmedia/MediaKeys.cpp:
        (WebCore::MediaKeys::hasOpenSessions const):
        * Modules/encryptedmedia/MediaKeys.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::attemptToDecrypt):
        (WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
        (WebCore::HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary):
        * html/HTMLMediaElement.h: Mark cdmClientAttemptToResumePlaybackIfNecessary() as final.
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::attemptToDecryptWithInstance):
        * platform/graphics/MediaPlayer.h:
        * platform/graphics/MediaPlayerPrivate.h:
        (WebCore::MediaPlayerPrivateInterface::attemptToDecryptWithInstance):

2017-08-20  Zan Dobersek  <zdobersek@igalia.com>

        [EME] Add basic implementation of HTMLMediaElement::setMediaKeys()
        https://bugs.webkit.org/show_bug.cgi?id=175717

        Reviewed by Xabier Rodriguez-Calvar.

        Add an initial and incomplete implementation of HTMLMediaElement::setMediaKeys(),
        interleaved with the specification wording of how this operation should behave.
        The implementation still doesn't cover cases of CDM instances being already
        associated with a different HTMLMediaElement, of CDM instances that can't be
        disassociated from the current HTMLMediaElement, and of failures during both
        association and disassociation of MediaKeys with the HTMLMediaElement.

        The HTMLMediaElement (as a CDMClient inheritor) has to be attached or detached
        from the MediaKeys object as appropriate. This attachment allows MediaKeys to
        initiate an attempt to resume playback whenever the key statuses of the
        associated MediaKeys object are updated.

        Upon association and disassociation with MediaKeys, the CDMInstance object of
        that specific MediaKeys instance is attached to or detached from the MediaPlayer
        instance. This allows the platform layer to gather information about the
        CDMInstance that will be used for decryption of media content for this specific
        media element.

        Additionally, the detachment from both MediaKeys and MediaPlayer is done upon
        HTMLMediaElement destruction.

        Upon setting the MediaKeys object, a task is queued that launches the 'Attempt to
        Resume Playback If Necessary' algorithm. A placeholder method is added that will
        implement the algorithm in the future.

        The HTMLMediaElement::mediaKeys() getter is also implemented, returning pointer
        held in m_mediaKeys.

        Covered to a degree by existing imported W3C tests, with a setMediaKeys()-oriented
        test having WPE-specific baseline update.

        * Modules/encryptedmedia/MediaKeys.h:
        (WebCore::MediaKeys::cdmInstance const):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::~HTMLMediaElement):
        (WebCore::HTMLMediaElement::mediaKeys const):
        (WebCore::HTMLMediaElement::setMediaKeys):
        (WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
        (WebCore::HTMLMediaElement::contextDestroyed):
        * html/HTMLMediaElement.h:
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::cdmInstanceAttached):
        (WebCore::MediaPlayer::cdmInstanceDetached):
        * platform/graphics/MediaPlayer.h:
        * platform/graphics/MediaPlayerPrivate.h:
        (WebCore::MediaPlayerPrivateInterface::cdmInstanceAttached):
        (WebCore::MediaPlayerPrivateInterface::cdmInstanceDetached):

2017-08-20  Chris Dumez  <cdumez@apple.com>

        Simplify calls to LoaderStrategy::startPingLoad()
        https://bugs.webkit.org/show_bug.cgi?id=175756

        Reviewed by Sam Weinig.

        Simplify calls to LoaderStrategy::startPingLoad() by passing the Frame to it
        and let its implementation gets what it needs from the frame. This reduces
        the number of parameters to startPingLoad() and is more easily extensible.

        * dom/Document.h:
        * loader/LoaderStrategy.h:
        * loader/PingLoader.cpp:
        (WebCore::PingLoader::loadImage):
        (WebCore::PingLoader::sendPing):
        (WebCore::PingLoader::sendViolationReport):
        (WebCore::PingLoader::startPingLoad):
        * loader/PingLoader.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load):

2017-08-20  Antti Koivisto  <antti@apple.com>

        Factor :before/:after render tree mutations into a RenderTreeUpdater helper class
        https://bugs.webkit.org/show_bug.cgi?id=175752

        Reviewed by Andreas Kling.

        Move code that constructs generated content renderers out from PseudoElement.
        Also refactor the related code from RenderTreeUpdater main class into
        RenderTreeUpdater::GeneratedContent helper class.

        * WebCore.xcodeproj/project.pbxproj:
        * dom/PseudoElement.cpp:
        (WebCore::PseudoElement::resolveCustomStyle): Deleted.

            Not needed anymore.

        (WebCore::PseudoElement::didAttachRenderers): Deleted.

            Moves to createContentRenderers in GeneratedContent.

        (WebCore::PseudoElement::didRecalcStyle): Deleted.

            Moves to updateStyleForContentRenderers in GeneratedContent.

        * dom/PseudoElement.h:
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::RenderTreeUpdater):
        (WebCore::RenderTreeUpdater::~RenderTreeUpdater):
        (WebCore::RenderTreeUpdater::commit):
        (WebCore::RenderTreeUpdater::updateBeforeDescendants):
        (WebCore::RenderTreeUpdater::updateAfterDescendants):
        (WebCore::needsPseudoElement): Deleted.
        (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): Deleted.
        (WebCore::RenderTreeUpdater::updateQuotesUpTo): Deleted.

            Quotes and other :before/:after support moves to GeneratedContent helpwe.

        * style/RenderTreeUpdater.h:
        (WebCore::RenderTreeUpdater::generatedContent):
        * style/RenderTreeUpdaterGeneratedContent.cpp: Added.
        (WebCore::RenderTreeUpdater::GeneratedContent::GeneratedContent):
        (WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement):
        (WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement):
        (WebCore::RenderTreeUpdater::GeneratedContent::updateRemainingQuotes):
        (WebCore::RenderTreeUpdater::GeneratedContent::updateQuotesUpTo):
        (WebCore::createContentRenderers):
        (WebCore::updateStyleForContentRenderers):
        (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
        (WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
        * style/RenderTreeUpdaterGeneratedContent.h: Added.

2017-08-19  Andy Estes  <aestes@apple.com>

        [Payment Request] Add interface stubs
        https://bugs.webkit.org/show_bug.cgi?id=175730

        Reviewed by Youenn Fablet.

        * DerivedSources.make:
        * Modules/paymentrequest/PaymentAddress.h: Added.
        * Modules/paymentrequest/PaymentAddress.idl: Added.
        * Modules/paymentrequest/PaymentComplete.h: Added.
        * Modules/paymentrequest/PaymentComplete.idl: Added.
        * Modules/paymentrequest/PaymentCurrencyAmount.h: Added.
        * Modules/paymentrequest/PaymentCurrencyAmount.idl: Added.
        * Modules/paymentrequest/PaymentDetailsBase.h: Added.
        * Modules/paymentrequest/PaymentDetailsBase.idl: Added.
        * Modules/paymentrequest/PaymentDetailsInit.h: Added.
        * Modules/paymentrequest/PaymentDetailsInit.idl: Added.
        * Modules/paymentrequest/PaymentDetailsModifier.h: Added.
        * Modules/paymentrequest/PaymentDetailsModifier.idl: Added.
        * Modules/paymentrequest/PaymentDetailsUpdate.h: Added.
        * Modules/paymentrequest/PaymentDetailsUpdate.idl: Added.
        * Modules/paymentrequest/PaymentItem.h: Added.
        * Modules/paymentrequest/PaymentItem.idl: Added.
        * Modules/paymentrequest/PaymentMethodData.h: Added.
        * Modules/paymentrequest/PaymentMethodData.idl: Added.
        * Modules/paymentrequest/PaymentOptions.h: Added.
        * Modules/paymentrequest/PaymentOptions.idl: Added.
        * Modules/paymentrequest/PaymentRequest.cpp: Added.
        (WebCore::PaymentRequest::create):
        (WebCore::PaymentRequest::PaymentRequest):
        (WebCore::PaymentRequest::~PaymentRequest):
        (WebCore::PaymentRequest::show):
        (WebCore::PaymentRequest::abort):
        (WebCore::PaymentRequest::canMakePayment):
        * Modules/paymentrequest/PaymentRequest.h: Added.
        * Modules/paymentrequest/PaymentRequest.idl: Added.
        * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp: Added.
        (WebCore::PaymentRequestUpdateEvent::~PaymentRequestUpdateEvent):
        (WebCore::PaymentRequestUpdateEvent::updateWith):
        * Modules/paymentrequest/PaymentRequestUpdateEvent.h: Added.
        * Modules/paymentrequest/PaymentRequestUpdateEvent.idl: Added.
        * Modules/paymentrequest/PaymentRequestUpdateEventInit.h: Added.
        * Modules/paymentrequest/PaymentRequestUpdateEventInit.idl: Added.
        * Modules/paymentrequest/PaymentResponse.cpp: Added.
        (WebCore::PaymentResponse::complete):
        * Modules/paymentrequest/PaymentResponse.h: Added.
        * Modules/paymentrequest/PaymentResponse.idl: Added.
        * Modules/paymentrequest/PaymentShippingOption.h: Added.
        * Modules/paymentrequest/PaymentShippingOption.idl: Added.
        * Modules/paymentrequest/PaymentShippingType.h: Added.
        * Modules/paymentrequest/PaymentShippingType.idl: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * dom/EventNames.h:
        * dom/EventNames.in:
        * dom/EventTargetFactory.in:

2017-08-19  Sam Weinig  <sam@webkit.org>

        [WebCrypto] Remove the KeyAlgorithm type hierarchy
        https://bugs.webkit.org/show_bug.cgi?id=175750

        Reviewed by Chris Dumez.

        Removes the unnecessary indirection that existed to generate a
        KeyAlgorithm dictionary (or rather, one of its derived dictionaries)
        for a CryptoKey. We were calling the virtual buildAlgorithm(), which
        return a std::unique_ptr<KeyAlgorithm>, which we then casted to the 
        correct derived class and called dictionary() on. This can now be
        simplified by making each CryptoKey derived class override a function
        that returns the KeyAlgorithm variant.

        * crypto/CryptoKey.cpp:
        (WebCore::CryptoKey::algorithm const): Deleted.
        * crypto/CryptoKey.h:
        (WebCore::CryptoKey::extractable const):
        (WebCore::KeyAlgorithm::~KeyAlgorithm): Deleted.
        (WebCore::KeyAlgorithm::name const): Deleted.
        (WebCore::KeyAlgorithm::KeyAlgorithm): Deleted.
        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
        (WebCore::CryptoKeyRSA::algorithm const):
        (WebCore::CryptoKeyRSA::buildAlgorithm const): Deleted.
        * crypto/keys/CryptoKeyAES.cpp:
        (WebCore::CryptoKeyAES::algorithm const):
        (WebCore::AesKeyAlgorithm::dictionary const): Deleted.
        (WebCore::CryptoKeyAES::buildAlgorithm const): Deleted.
        * crypto/keys/CryptoKeyAES.h:
        * crypto/keys/CryptoKeyEC.cpp:
        (WebCore::CryptoKeyEC::algorithm const):
        (WebCore::EcKeyAlgorithm::dictionary const): Deleted.
        (WebCore::CryptoKeyEC::buildAlgorithm const): Deleted.
        * crypto/keys/CryptoKeyEC.h:
        (WebCore::EcKeyAlgorithm::EcKeyAlgorithm): Deleted.
        (WebCore::EcKeyAlgorithm::namedCurve const): Deleted.
        * crypto/keys/CryptoKeyHMAC.cpp:
        (WebCore::CryptoKeyHMAC::algorithm const):
        (WebCore::HmacKeyAlgorithm::dictionary const): Deleted.
        (WebCore::CryptoKeyHMAC::buildAlgorithm const): Deleted.
        * crypto/keys/CryptoKeyHMAC.h:
        * crypto/keys/CryptoKeyRSA.cpp:
        (WebCore::RsaKeyAlgorithm::dictionary const): Deleted.
        (WebCore::RsaHashedKeyAlgorithm::dictionary const): Deleted.
        * crypto/keys/CryptoKeyRSA.h:
        (WebCore::RsaKeyAlgorithm::RsaKeyAlgorithm): Deleted.
        (WebCore::RsaKeyAlgorithm::modulusLength const): Deleted.
        (WebCore::RsaKeyAlgorithm::publicExponent const): Deleted.
        * crypto/keys/CryptoKeyRaw.cpp:
        (WebCore::CryptoKeyRaw::algorithm const):
        (WebCore::RawKeyAlgorithm::dictionary const): Deleted.
        (WebCore::CryptoKeyRaw::buildAlgorithm const): Deleted.
        * crypto/keys/CryptoKeyRaw.h:
        (WebCore::RawKeyAlgorithm::RawKeyAlgorithm): Deleted.
        * crypto/mac/CryptoKeyRSAMac.cpp:
        (WebCore::CryptoKeyRSA::algorithm const):
        (WebCore::CryptoKeyRSA::buildAlgorithm const): Deleted.

2017-08-19  Sam Weinig  <sam@webkit.org>

        [Mac] Change uint8_t* to Vector<uint8_t> type in all crypto algorithm implementation
        https://bugs.webkit.org/show_bug.cgi?id=164939

        Reviewed by Chris Dumez.

        Address FIXMEs, replacing uint8_t*/size_t parameters with Vector<uint8_t>&.

        * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
        (WebCore::transformAES_CBC):
        (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
        * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
        (WebCore::wrapKeyAES_KW):
        (WebCore::unwrapKeyAES_KW):
        (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
        (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
        * crypto/mac/CryptoAlgorithmHMACMac.cpp:
        (WebCore::calculateSignature):
        (WebCore::CryptoAlgorithmHMAC::platformSign):
        (WebCore::CryptoAlgorithmHMAC::platformVerify):
        * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
        (WebCore::encryptRSAES_PKCS1_v1_5):
        (WebCore::decryptRSAES_PKCS1_v1_5):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):
        * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
        (WebCore::signRSASSA_PKCS1_v1_5):
        (WebCore::verifyRSASSA_PKCS1_v1_5):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):
        * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
        (WebCore::encryptRSA_OAEP):
        (WebCore::decryptRSA_OAEP):
        (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
        (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):

2017-08-18  Ryosuke Niwa  <rniwa@webkit.org>

        Forbid setDragImage after dragstart
        https://bugs.webkit.org/show_bug.cgi?id=175751

        Reviewed by Wenson Hsieh.

        Removed the code to allow setting the drag mage after dragstart had happened.

        The feature was apparently used in Mac WebKit1 port but using it today causes the drag image
        to disapepar while the user is moving the mouse cursor and being drawn once it's stopped
        and results in the contionus flickering of the drag image.

        The feaure was never supported in WebKit2 and doesn't match the HTML5 specification:
        https://html.spec.whatwg.org/multipage/dnd.html#concept-dnd-rw
        https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-setdragimage
        or the behaviors of other browsers such as Chrome and Firefox.

        No new tests. This patch simply removes code.

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::setDragImage):
        (WebCore::DataTransfer::canSetDragImage const): Deleted.
        * dom/DataTransfer.h:
        (WebCore::DataTransfer::makeDragImageWritable): Deleted.
        * page/EventHandler.cpp:
        (WebCore::EventHandler::handleDrag):

2017-08-18  Sam Weinig  <sam@webkit.org>

        [WebCrypto] Get rid of CryptoKeyData class and all its subclasses
        https://bugs.webkit.org/show_bug.cgi?id=169806

        Reviewed by Chris Dumez.

        - Replaces the CryptoKeyData type hierarchy 

            CryptoKeyData
              - CryptoKeyDataOctetSequence
              - CryptoKeyDataRSAComponents

          with the renamed CryptoKeyRSAComponents.

        - Removes pure virtual exportData function on CryptoKey, and all
          the implementations except the one on CryptoKeyRSA, which now is
          non-virtual, and returns a CryptoKeyRSAComponents. Update the one
          external caller, SerializedScriptValue, to handle this.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/SerializedScriptValue.cpp:
        * crypto/CryptoAlgorithm.h:
        * crypto/CryptoKey.h:
        * crypto/CryptoKeyData.h: Removed.
        * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
        * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
        (WebCore::CryptoKeyRSA::create):
        (WebCore::CryptoKeyRSA::exportData const):
        * crypto/keys/CryptoKeyAES.cpp:
        (WebCore::CryptoKeyAES::exportData const): Deleted.
        * crypto/keys/CryptoKeyAES.h:
        * crypto/keys/CryptoKeyDataOctetSequence.cpp: Removed.
        * crypto/keys/CryptoKeyDataOctetSequence.h: Removed.
        * crypto/keys/CryptoKeyDataRSAComponents.cpp: Removed.
        * crypto/keys/CryptoKeyDataRSAComponents.h: Removed.
        * crypto/keys/CryptoKeyEC.cpp:
        (WebCore::CryptoKeyEC::exportData const): Deleted.
        * crypto/keys/CryptoKeyEC.h:
        * crypto/keys/CryptoKeyHMAC.cpp:
        (WebCore::CryptoKeyHMAC::exportData const): Deleted.
        * crypto/keys/CryptoKeyHMAC.h:
        * crypto/keys/CryptoKeyRSA.cpp:
        (WebCore::CryptoKeyRSA::importJwk):
        (WebCore::CryptoKeyRSA::exportJwk const):
        * crypto/keys/CryptoKeyRSA.h:
        * crypto/keys/CryptoKeyRSAComponents.cpp: Copied from crypto/keys/CryptoKeyDataRSAComponents.cpp.
        (WebCore::CryptoKeyRSAComponents::CryptoKeyRSAComponents):
        (WebCore::CryptoKeyRSAComponents::~CryptoKeyRSAComponents):
        (WebCore::CryptoKeyDataRSAComponents::CryptoKeyDataRSAComponents): Deleted.
        (WebCore::CryptoKeyDataRSAComponents::~CryptoKeyDataRSAComponents): Deleted.
        * crypto/keys/CryptoKeyRSAComponents.h: Copied from crypto/keys/CryptoKeyDataRSAComponents.h.
        (WebCore::CryptoKeyRSAComponents::createPublic):
        (WebCore::CryptoKeyRSAComponents::createPrivate):
        (WebCore::CryptoKeyRSAComponents::createPrivateWithAdditionalData):
        * crypto/keys/CryptoKeyRaw.cpp:
        (WebCore::CryptoKeyRaw::exportData const): Deleted.
        * crypto/keys/CryptoKeyRaw.h:
        * crypto/mac/CryptoKeyRSAMac.cpp:
        (WebCore::getPrivateKeyComponents):
        (WebCore::CryptoKeyRSA::create):
        (WebCore::CryptoKeyRSA::exportData const):

2017-08-18  Youenn Fablet  <youenn@apple.com>

        [Cache API] Add support for being loaded responses
        https://bugs.webkit.org/show_bug.cgi?id=175732

        Reviewed by Chris Dumez.

        Covered by existing and rebased tests.

        Introducing a callback-based method to consume the body when the load is finished.
        Using that new method in Cache::put and calling batchPutOperation when the load is finished.

        Fixing the case of a fetch response being cloned, in which case its body should be marked as ReadableStream.

        * Modules/cache/Cache.cpp:
        (WebCore::Cache::put): Changing order of checks to reduce test flakiness risks as there is not yet support for putting responses with ReadableStream.
        (WebCore::toConnectionRecord):
        (WebCore::Cache::batchPutOperation):
        * Modules/cache/Cache.h:
        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::readableStreamBody): Deleted.
        * Modules/fetch/FetchBody.h:
        (WebCore::FetchBody::loadingBody):
        (WebCore::FetchBody::setAsReadableStream):
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::BodyLoader::didSucceed):
        (WebCore::FetchResponse::BodyLoader::didFail):
        (WebCore::FetchResponse::consumeBody):
        (WebCore::FetchResponse::consumeBodyWhenLoaded):
        * Modules/fetch/FetchResponse.h:

2017-08-18  Chris Dumez  <cdumez@apple.com>

        [Beacon] Improve error reporting
        https://bugs.webkit.org/show_bug.cgi?id=175723

        Reviewed by Darin Adler.

        Have Ping loads such as beacons report errors via their completion handler.
        The Beacon API is using this error to log a console message when beacon loads
        fail, provided that the page is still alive.

        Test: http/wpt/beacon/beacon-async-error-logging.html

        * Modules/beacon/NavigatorBeacon.cpp:
        (WebCore::NavigatorBeacon::NavigatorBeacon):
        (WebCore::NavigatorBeacon::~NavigatorBeacon):
        (WebCore::NavigatorBeacon::from):
        (WebCore::NavigatorBeacon::supplementName):
        (WebCore::NavigatorBeacon::notifyFinished):
        (WebCore::NavigatorBeacon::logError):
        (WebCore::NavigatorBeacon::sendBeacon):
        * Modules/beacon/NavigatorBeacon.h:
        * loader/LoaderStrategy.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestBeaconResource):
        * loader/cache/CachedResourceLoader.h:
        * platform/network/PingHandle.h:

2017-08-18  Sam Weinig  <sam@webkit.org>

        Remove the deprecated WebKitSubtleCrypto interface
        https://bugs.webkit.org/show_bug.cgi?id=164938
        <rdar://problem/29894563>

        Reviewed by Chris Dumez.

        Remove WebKitSubtleCrypto and all of its helper classes / functionality.

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSCryptoAlgorithmDictionary.cpp: Removed.
        * bindings/js/JSCryptoAlgorithmDictionary.h: Removed.
        * bindings/js/JSCryptoKeySerializationJWK.cpp: Removed.
        * bindings/js/JSCryptoKeySerializationJWK.h: Removed.
        * bindings/js/JSCryptoOperationData.cpp: Removed.
        * bindings/js/JSCryptoOperationData.h: Removed.
        * bindings/js/JSWebKitSubtleCryptoCustom.cpp: Removed.
        * crypto/CryptoAlgorithm.cpp:
        (WebCore::CryptoAlgorithm::deriveKey): Deleted.
        (WebCore::CryptoAlgorithm::encryptForWrapKey): Deleted.
        (WebCore::CryptoAlgorithm::decryptForUnwrapKey): Deleted.
        * crypto/CryptoAlgorithm.h:
        * crypto/CryptoAlgorithmParametersDeprecated.h: Removed.
        * crypto/CryptoKeySerialization.h: Removed.
        * crypto/WebKitSubtleCrypto.cpp: Removed.
        * crypto/WebKitSubtleCrypto.h: Removed.
        * crypto/WebKitSubtleCrypto.idl: Removed.
        * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
        (WebCore::CryptoAlgorithmAES_CBC::keyAlgorithmMatches const): Deleted.
        * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
        * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
        (WebCore::CryptoAlgorithmAES_KW::encryptForWrapKey): Deleted.
        (WebCore::CryptoAlgorithmAES_KW::decryptForUnwrapKey): Deleted.
        * crypto/algorithms/CryptoAlgorithmAES_KW.h:
        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
        (WebCore::CryptoAlgorithmHMAC::keyAlgorithmMatches const): Deleted.
        * crypto/algorithms/CryptoAlgorithmHMAC.h:
        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::keyAlgorithmMatches const): Deleted.
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
        (WebCore::CryptoAlgorithmRSA_OAEP::keyAlgorithmMatches const): Deleted.
        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
        * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
        * crypto/algorithms/CryptoAlgorithmSHA1.h:
        * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
        * crypto/algorithms/CryptoAlgorithmSHA224.h:
        * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
        * crypto/algorithms/CryptoAlgorithmSHA256.h:
        * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
        * crypto/algorithms/CryptoAlgorithmSHA384.h:
        * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
        * crypto/algorithms/CryptoAlgorithmSHA512.h:
        * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
        * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
        (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Deleted.
        (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Deleted.
        * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
        * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
        * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
        * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
        * crypto/keys/CryptoKeySerializationRaw.cpp: Removed.
        * crypto/keys/CryptoKeySerializationRaw.h: Removed.
        * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
        * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
        (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Deleted.
        (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Deleted.
        * crypto/mac/CryptoAlgorithmHMACMac.cpp:
        * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
        * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
        * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
        * crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h: Removed.
        * crypto/parameters/CryptoAlgorithmAesKeyGenParamsDeprecated.h: Removed.
        * crypto/parameters/CryptoAlgorithmHmacKeyParamsDeprecated.h: Removed.
        * crypto/parameters/CryptoAlgorithmHmacParamsDeprecated.h: Removed.
        * crypto/parameters/CryptoAlgorithmRsaKeyGenParamsDeprecated.h: Removed.
        * crypto/parameters/CryptoAlgorithmRsaKeyParamsWithHashDeprecated.h: Removed.
        * crypto/parameters/CryptoAlgorithmRsaOaepParamsDeprecated.h: Removed.
        * crypto/parameters/CryptoAlgorithmRsaSsaParamsDeprecated.h: Removed.
        * features.json:
        * page/Crypto.cpp:
        * page/Crypto.h:
        * page/Crypto.idl:

2017-08-18  Tim Horton  <timothy_horton@apple.com>

        Remove classic mode screen scale clamping
        https://bugs.webkit.org/show_bug.cgi?id=175739
        <rdar://problem/33894531>

        Reviewed by Andy Estes.

        * platform/ios/PlatformScreenIOS.mm:
        (WebCore::screenScaleFactor):
        This code is no longer needed.

2017-08-18  Daewoong Jang  <daewoong.jang@navercorp.com>

        [Curl] Improve multi-threaded networking
        https://bugs.webkit.org/show_bug.cgi?id=175713

        Reviewed by Alex Christensen.

        * platform/Curl.cmake:
        * platform/network/ResourceHandleInternal.h:
        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
        (WebCore::ResourceHandleInternal::m_failureTimer): Deleted.
        * platform/network/curl/CurlCacheManager.cpp:
        (WebCore::CurlCacheManager::didReceiveResponse):
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::init):
        (WebCore::CurlDownload::start):
        (WebCore::CurlDownload::cancel):
        (WebCore::CurlDownload::retain):
        (WebCore::CurlDownload::release):
        (WebCore::CurlDownload::setupRequest):
        (WebCore::CurlDownload::notifyFinish):
        (WebCore::CurlDownload::notifyFail):
        * platform/network/curl/CurlDownload.h:
        * platform/network/curl/CurlJobManager.cpp:
        (WebCore::CurlJobList::isEmpty const):
        (WebCore::CurlJobList::startJobs):
        (WebCore::CurlJobList::finishJobs):
        (WebCore::CurlJobList::notifyResult):
        (WebCore::CurlJobManager::add):
        (WebCore::CurlJobManager::cancel):
        (WebCore::CurlJobManager::callOnJobThread):
        (WebCore::CurlJobManager::startThreadIfNeeded):
        (WebCore::CurlJobManager::updateJobList):
        (WebCore::CurlJobManager::workerThread):
        (WebCore::CurlJobList::append): Deleted.
        (WebCore::CurlJobList::cancel): Deleted.
        (WebCore::CurlJobList::complete): Deleted.
        (WebCore::CurlJobList::withJob): Deleted.
        (WebCore::CurlJobList::withCurlHandle): Deleted.
        (WebCore::CurlJob::invoke): Deleted.
        (WebCore::CurlJobManager::updateJobs): Deleted.
        * platform/network/curl/CurlJobManager.h:
        (WebCore::CurlJob::CurlJob): Deleted.
        (WebCore::CurlJob::~CurlJob): Deleted.
        (WebCore::CurlJob::operator=): Deleted.
        (WebCore::CurlJob::curlHandle const): Deleted.
        (WebCore::CurlJob::ticket const): Deleted.
        (WebCore::CurlJob::finished): Deleted.
        (WebCore::CurlJob::error): Deleted.
        (WebCore::CurlJob::cancel): Deleted.
        (WebCore::CurlJobManager::isActiveJob const): Deleted.
        * platform/network/curl/MultipartHandle.cpp:
        (WebCore::MultipartHandle::didReceiveData):
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
        (WebCore::ResourceHandle::start):
        (WebCore::ResourceHandle::cancel):
        (WebCore::ResourceHandle::platformSetDefersLoading):
        (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
        (WebCore::ResourceHandle::receivedCredential):
        (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        (WebCore::ResourceHandleInternal::initialize): Deleted.
        (WebCore::ResourceHandleInternal::applyAuthentication): Deleted.
        (WebCore::getFormElementsCount): Deleted.
        (WebCore::ResourceHandleInternal::setupPUT): Deleted.
        (WebCore::ResourceHandleInternal::setupPOST): Deleted.
        (WebCore::ResourceHandleInternal::setupFormData): Deleted.
        (WebCore::ResourceHandleInternal::didFinish): Deleted.
        (WebCore::ResourceHandleInternal::didFail): Deleted.
        (WebCore::ResourceHandleInternal::calculateWebTimingInformations): Deleted.
        (WebCore::ResourceHandleInternal::handleLocalReceiveResponse): Deleted.
        (WebCore::isHttpInfo): Deleted.
        (WebCore::isHttpRedirect): Deleted.
        (WebCore::isHttpAuthentication): Deleted.
        (WebCore::isHttpNotModified): Deleted.
        (WebCore::isAppendableHeader): Deleted.
        (WebCore::removeLeadingAndTrailingQuotes): Deleted.
        (WebCore::getProtectionSpace): Deleted.
        (WebCore::ResourceHandleInternal::willPrepareSendData): Deleted.
        (WebCore::ResourceHandleInternal::didReceiveHeaderLine): Deleted.
        (WebCore::ResourceHandleInternal::didReceiveAllHeaders): Deleted.
        (WebCore::ResourceHandleInternal::didReceiveContentData): Deleted.
        (WebCore::ResourceHandleInternal::readCallback): Deleted.
        (WebCore::ResourceHandleInternal::headerCallback): Deleted.
        (WebCore::ResourceHandleInternal::writeCallback): Deleted.
        (WebCore::ResourceHandleInternal::dispatchSynchronousJob): Deleted.
        (WebCore::ResourceHandleInternal::handleDataURL): Deleted.
        * platform/network/curl/ResourceHandleCurlDelegate.cpp: Added.
        (WebCore::ResourceHandleCurlDelegate::ResourceHandleCurlDelegate):
        (WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
        (WebCore::ResourceHandleCurlDelegate::hasHandle const):
        (WebCore::ResourceHandleCurlDelegate::releaseHandle):
        (WebCore::ResourceHandleCurlDelegate::start):
        (WebCore::ResourceHandleCurlDelegate::cancel):
        (WebCore::ResourceHandleCurlDelegate::setDefersLoading):
        (WebCore::ResourceHandleCurlDelegate::setAuthentication):
        (WebCore::ResourceHandleCurlDelegate::dispatchSynchronousJob):
        (WebCore::ResourceHandleCurlDelegate::retain):
        (WebCore::ResourceHandleCurlDelegate::release):
        (WebCore::ResourceHandleCurlDelegate::setupRequest):
        (WebCore::ResourceHandleCurlDelegate::notifyFinish):
        (WebCore::ResourceHandleCurlDelegate::notifyFail):
        (WebCore::ResourceHandleCurlDelegate::response):
        (WebCore::ResourceHandleCurlDelegate::setupAuthentication):
        (WebCore::removeLeadingAndTrailingQuotes):
        (WebCore::ResourceHandleCurlDelegate::getProtectionSpace):
        (WebCore::isHttpInfo):
        (WebCore::isHttpRedirect):
        (WebCore::isHttpAuthentication):
        (WebCore::isHttpNotModified):
        (WebCore::isAppendableHeader):
        (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderLine):
        (WebCore::ResourceHandleCurlDelegate::didReceiveAllHeaders):
        (WebCore::ResourceHandleCurlDelegate::didReceiveContentData):
        (WebCore::ResourceHandleCurlDelegate::handleLocalReceiveResponse):
        (WebCore::ResourceHandleCurlDelegate::prepareSendData):
        (WebCore::ResourceHandleCurlDelegate::didFinish):
        (WebCore::ResourceHandleCurlDelegate::didFail):
        (WebCore::ResourceHandleCurlDelegate::handleDataURL):
        (WebCore::ResourceHandleCurlDelegate::setupPOST):
        (WebCore::ResourceHandleCurlDelegate::setupPUT):
        (WebCore::ResourceHandleCurlDelegate::getFormElementsCount):
        (WebCore::ResourceHandleCurlDelegate::setupFormData):
        (WebCore::ResourceHandleCurlDelegate::applyAuthentication):
        (WebCore::ResourceHandleCurlDelegate::setWebTimings):
        (WebCore::ResourceHandleCurlDelegate::didReceiveHeader):
        (WebCore::ResourceHandleCurlDelegate::didReceiveData):
        (WebCore::ResourceHandleCurlDelegate::willSendData):
        (WebCore::ResourceHandleCurlDelegate::didReceiveHeaderCallback):
        (WebCore::ResourceHandleCurlDelegate::didReceiveDataCallback):
        (WebCore::ResourceHandleCurlDelegate::willSendDataCallback):
        * platform/network/curl/ResourceHandleCurlDelegate.h: Added.

2017-08-18  Ryosuke Niwa  <rniwa@webkit.org>

        iOS 10 debug build fix.

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

2017-08-18  Ryosuke Niwa  <rniwa@webkit.org>

        Rename DataTransferAccessPolicy to match spec and refactor related node
        https://bugs.webkit.org/show_bug.cgi?id=175704

        Reviewed by Wenson Hsieh.

        Renamed DataTransferAccessPolicy to DataTransfer::StoreMode to match the drag data store mode concept
        in the HTML5 specification:
        https://html.spec.whatwg.org/multipage/dnd.html#drag-data-store-mode

        DataTransfer in addition to those states can be disassociated from the drag data store when it becomes
        no longer valid. We also support a special mode which allows only updating the drag image.
        These two states, Invalid and DragImageWritable, are added in addition to the three states in the spec.

        Also split DragAndDrop type of DataTransfer into DragAndDropData and DragAndDropFiles, and refactored
        the related code.

        No new tests since there should be no behavioral change.

        * WebCore.xcodeproj/project.pbxproj:
        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::DataTransfer): No longer takes forFileDrag boolean since it's folded into type.
        (WebCore::DataTransfer::createForCopyAndPaste):
        (WebCore::DataTransfer::~DataTransfer):
        (WebCore::DataTransfer::setAccessPolicy): Deleted.
        (WebCore::DataTransfer::canReadTypes const):
        (WebCore::DataTransfer::canReadData const):
        (WebCore::DataTransfer::canWriteData const):
        (WebCore::DataTransfer::createForInputEvent):
        (WebCore::DataTransfer::createForDrag):
        (WebCore::DataTransfer::createForDrop):
        (WebCore::DataTransfer::canSetDragImage const):
        * dom/DataTransfer.h:
        (WebCore::DataTransfer::makeInvalidForSecurity): Added.
        (WebCore::DataTransfer::makeDragImageWritable): Added.
        * dom/DataTransferAccessPolicy.h: Removed.
        * editing/Editor.cpp:
        (WebCore::dispatchClipboardEvent): Moved and renamed from dispatchCPPEvent. Now computes the store mode
        inside the function to match the spec: https://w3c.github.io/clipboard-apis/#fire-a-clipboard-event
        (WebCore::Editor::canDHTMLCut):
        (WebCore::Editor::canDHTMLCopy):
        (WebCore::Editor::canDHTMLPaste):
        (WebCore::Editor::tryDHTMLCopy):
        (WebCore::Editor::tryDHTMLCut):
        (WebCore::Editor::tryDHTMLPaste):
        (WebCore::Editor::dispatchCPPEvent): Deleted.
        * editing/Editor.h:
        * page/DragController.cpp:
        (WebCore::createDataTransferToUpdateDrag): Extracted to share code.
        (WebCore::DragController::dragExited):
        (WebCore::DragController::performDragOperation):
        (WebCore::DragController::tryDHTMLDrag):
        * page/EventHandler.cpp:
        (WebCore::EventHandler::invalidateDataTransfer):
        (WebCore::EventHandler::handleDrag):

2017-08-18  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Followup (r220289): RenderImageResourceStyleImage code clean up
        https://bugs.webkit.org/show_bug.cgi?id=175444

        Reviewed by Darin Adler.

        RenderImageResourceStyleImage may be created with a StyleImage of type
        StyleGeneratedImage. It may also be associated with a CachedImage which 
        is loaded through a source URL. In this case, adding and removing m_renderer
        as a client of the CachedImage will be done through 
        RenderImageResource::setCachedImage().

        RenderImageResource::setCachedImage() is already called from 
        ImageLoader::updateRenderer() when the CachedImage finishes loading. This
        call adds m_renderer to the clients of the CachedImage. 
        RenderImageResource::setCachedImage() will also be called from 
        RenderImageResourceStyleImage::shutdown() via RenderImageResource::shutdown()
        to remove m_renderer from the clients of CachedImage by passing a null pointer.

        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::styleWillChange):
        * rendering/RenderImageResource.cpp:
        (WebCore::RenderImageResource::initialize):
        (WebCore::RenderImageResource::shutdown):
        (WebCore::RenderImageResource::setCachedImage):
        (WebCore::RenderImageResource::resetAnimation):
        (WebCore::RenderImageResource::image const):
        (WebCore::RenderImageResource::setContainerSizeForRenderer):
        (WebCore::RenderImageResource::imageSize const):
        (WebCore::RenderImageResource::~RenderImageResource): Deleted.
        (WebCore::RenderImageResource::errorOccurred const): Deleted.
        (WebCore::RenderImageResource::imageHasRelativeWidth const): Deleted.
        (WebCore::RenderImageResource::imageHasRelativeHeight const): Deleted.
        (WebCore::RenderImageResource::intrinsicSize const): Deleted.
        (WebCore::RenderImageResource::getImageSize const): Deleted.
        * rendering/RenderImageResource.h:
        (WebCore::RenderImageResource::initialize):
        (WebCore::RenderImageResource::renderer const):
        (WebCore::RenderImageResource::errorOccurred const):
        (WebCore::RenderImageResource::imageHasRelativeWidth const):
        (WebCore::RenderImageResource::imageHasRelativeHeight const):
        (WebCore::RenderImageResource::imageSize const):
        (WebCore::RenderImageResource::intrinsicSize const):
        (WebCore::RenderImageResource::imagePtr const):
        * rendering/RenderImageResourceStyleImage.cpp:
        (WebCore::RenderImageResourceStyleImage::initialize):
        (WebCore::RenderImageResourceStyleImage::shutdown):
        (WebCore::RenderImageResourceStyleImage::image const):
        (WebCore::RenderImageResourceStyleImage::setContainerSizeForRenderer):
        (WebCore::RenderImageResourceStyleImage::~RenderImageResourceStyleImage): Deleted.
        * rendering/RenderImageResourceStyleImage.h:
        * rendering/RenderSnapshottedPlugIn.cpp:
        (WebCore::RenderSnapshottedPlugIn::RenderSnapshottedPlugIn):
        * rendering/svg/RenderSVGImage.cpp:
        (WebCore::RenderSVGImage::RenderSVGImage):

2017-08-18  Jiewen Tan  <jiewen_tan@apple.com>

        [WebCrypto][Mac] Replace CCECCryptorGetKeyComponents with CCECCryptorExportKey for exporting ECC JWKs
        https://bugs.webkit.org/show_bug.cgi?id=175657
        <rdar://problem/33797150>

        Reviewed by Brent Fulgham.

        CCECCryptorGetKeyComponents returns components in unpadded formats. In some minor cases, the ECC components
        do need padding. Therefore, we occasionally see some corrupted outputs in JWKs. To overcome that, this patch
        replaces CCECCryptorGetKeyComponents with CCECCryptorExportKey which does padding all the time.

        In the meantime, this patch also makes export* methods return OperationError if any error occur in the
        underlying operations though very unlikely.

        Test: crypto/subtle/ecdsa-generate-export-import-jwk-sign-verify.html

        * crypto/algorithms/CryptoAlgorithmECDH.cpp:
        (WebCore::CryptoAlgorithmECDH::exportKey):
        * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
        (WebCore::CryptoAlgorithmECDSA::exportKey):
        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        (WebCore::CryptoKeyEC::platformAddFieldElements const):
        * crypto/keys/CryptoKeyEC.cpp:
        (WebCore::CryptoKeyEC::exportRaw const):
        (WebCore::CryptoKeyEC::exportJwk const):
        (WebCore::CryptoKeyEC::exportSpki const):
        (WebCore::CryptoKeyEC::exportPkcs8 const):
        * crypto/keys/CryptoKeyEC.h:
        * crypto/mac/CryptoKeyECMac.cpp:
        (WebCore::CryptoKeyEC::platformExportRaw const):
        (WebCore::CryptoKeyEC::platformAddFieldElements const):
        (WebCore::CryptoKeyEC::platformExportSpki const):
        (WebCore::CryptoKeyEC::platformExportPkcs8 const):

2017-08-18  Per Arne Vollan  <pvollan@apple.com>

        [Win] accessibility/heading-crash-after-hidden.html is a flaky crash.
        https://bugs.webkit.org/show_bug.cgi?id=173536

        Reviewed by Brent Fulgham.

        If the tree state is dirty, accessible objects are deleted while iterating over children
        under AccessibilityNodeObject::textUnderElement when the style is updated. Make sure the
        style is updated before this method is called.

        No new tests, covered by existing tests.

        * accessibility/win/AccessibilityObjectWrapperWin.cpp:
        (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue):

2017-08-18  Youenn Fablet  <youenn@apple.com>

        [Cache API] Add response body storage
        https://bugs.webkit.org/show_bug.cgi?id=175658

        Reviewed by Alex Christensen.

        Covered by rebased tests.
        Tests are still flaky until waiting for end of fetch load is implemented.

        Adding a response body within CacheStorageConnection::Record.
        Adding ability to pass this body from/to the main thread.

        Adding response body consumption into a CacheStorageConnection::Record.
        Adding response body setting from a CacheStorageConnection::Record.

        * Modules/beacon/NavigatorBeacon.cpp:
        (WebCore::NavigatorBeacon::sendBeacon):
        * Modules/cache/Cache.cpp:
        (WebCore::Cache::put):
        (WebCore::toConnectionRecord):
        (WebCore::Cache::updateRecords):
        * Modules/cache/CacheStorageConnection.cpp:
        (WebCore::CacheStorageConnection::copyResponseBody):
        (WebCore::CacheStorageConnection::isolatedResponseBody):
        (WebCore::CacheStorageConnection::Record::copy const):
        * Modules/cache/CacheStorageConnection.h:
        * Modules/cache/WorkerCacheStorageConnection.cpp:
        (WebCore::toCrossThreadRecordData):
        (WebCore::fromCrossThreadRecordData):
        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::bodyAsFormData const):
        (WebCore::FetchBody::take):
        (WebCore::FetchBody::bodyForInternalRequest const): Deleted.
        * Modules/fetch/FetchBody.h:
        (WebCore::FetchBody::setAsFormData):
        * Modules/fetch/FetchBodyConsumer.h:
        (WebCore::FetchBodyConsumer::setData):
        * Modules/fetch/FetchRequest.cpp:
        (WebCore::FetchRequest::resourceRequest const):
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::consumeBody):
        (WebCore::FetchResponse::setBodyData):
        * Modules/fetch/FetchResponse.h:

2017-08-18  Youenn Fablet  <youenn@apple.com>

        [Fetch API] Add support for a callback-based fetch
        https://bugs.webkit.org/show_bug.cgi?id=175710

        Reviewed by Alex Christensen.

        No change of behavior.

        Moving from a DOMPromise to a Callback taking an ExceptionOr<FetchResponse&>.
        Updating window and worker call sites.

        * Modules/fetch/DOMWindowFetch.cpp:
        (WebCore::DOMWindowFetch::fetch):
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::fetch):
        (WebCore::FetchResponse::BodyLoader::didFail):
        (WebCore::FetchResponse::BodyLoader::BodyLoader):
        (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
        (WebCore::FetchResponse::BodyLoader::stop):
        * Modules/fetch/FetchResponse.h:
        * Modules/fetch/WorkerGlobalScopeFetch.cpp:
        (WebCore::WorkerGlobalScopeFetch::fetch):

2017-08-18  Brady Eidson  <beidson@apple.com>

        Bounce ServiceWorker jobs to the Storage Process.
        https://bugs.webkit.org/show_bug.cgi?id=175650

        Reviewed by Andy Estes.

        No new tests (Covered by both changes and consistencies in existing tests)

        This lays the groundwork for the SW job queue being in the StorageProcess by actually
        setting up some objects for IPC communication and actually sending things over the wire.

        The main point of IPC is the WebCore abstract base class "SWServer::Connection"

        A collection of them will soon be managed by the SWServer itself in the StorageProcess.

        That object will be the stand-in for IPC on both the WebProcess and StorageProcess side.

        Currently, any job that we try to schedule still immediately rejects (though now it does
        so asynchronously instead of synchronously).

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

        * dom/ExceptionData.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
        (WebCore::ExceptionData::toException const):
        (WebCore::ExceptionData::encode const):
        (WebCore::ExceptionData::decode):

        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::scheduleJob):
        * workers/service/ServiceWorkerContainer.h:

        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::failedWithException):
        (WebCore::ServiceWorkerJob::data const):
        * workers/service/ServiceWorkerJob.h:

        * workers/service/ServiceWorkerJobData.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
        (WebCore::ServiceWorkerJobData::encode const):
        (WebCore::ServiceWorkerJobData::decode):

        * workers/service/ServiceWorkerJobType.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.

        * workers/service/ServiceWorkerProvider.h:

        * workers/service/ServiceWorkerRegistrationParameters.h:

        * workers/service/server/SWServer.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp.
        (WebCore::SWServer::Connection::scheduleJob):
        (WebCore::SWServer::Connection::jobRejected):
        * workers/service/server/SWServer.h: Copied from Source/WebCore/workers/service/ServiceWorkerProvider.h.
        (WebCore::SWServer::Connection::~Connection):

2017-08-18  Chris Dumez  <cdumez@apple.com>

        [Beacon] Add support for quota limitation
        https://bugs.webkit.org/show_bug.cgi?id=175443
        <rdar://problem/33729002>

        Reviewed by Youenn Fablet.

        LoaderStrategy::startPingLoad() now takes a completion handler parameter, allowing CachedResource::load()
        to know when a Beacon load is complete. This was needed in order for the fetch in-flight keepalive request
        quota limit to work properly for beacon loads as well. We need to know when the beacon load completes in
        order to know if the beacon is in-flight or not and only free up its allocated quota once it is no longer
        in-flight.

        No new tests, updated existing test.

        * loader/LoaderStrategy.h:
        * loader/PingLoader.cpp:
        (WebCore::PingLoader::startPingLoad):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load):
        * platform/network/PingHandle.h:

2017-08-18  Youenn Fablet  <youenn@apple.com>

        [Cache API] Add a WK2 implementation of CacheStorageConnection
        https://bugs.webkit.org/show_bug.cgi?id=175640

        Reviewed by Alex Christensen & Chris Dumez.

        * Modules/cache/CacheStorageConnection.cpp: Adding Internal error.
        * Modules/cache/CacheStorageConnection.h: Ditto.
        * WebCore.xcodeproj/project.pbxproj: Exporting CacheQueryOptions.h header.

2017-08-18  Antti Koivisto  <antti@apple.com>

        Factor render tree mutation code from RenderListItem to RenderTreeUpdater
        https://bugs.webkit.org/show_bug.cgi?id=175718

        Reviewed by Andreas Kling.

        We already stopped doing layout time mutations. We can now move the code out too.

        * WebCore.xcodeproj/project.pbxproj:
        * rendering/RenderListItem.cpp:
        (WebCore::isHTMLListElement):
        (WebCore::getParentOfFirstLineBox): Deleted.
        (WebCore::firstNonMarkerChild): Deleted.
        (WebCore::RenderListItem::updateMarkerRenderer): Deleted.

            Moved to RenderTreeUpdater::ListItem.

        * rendering/RenderListItem.h:
        * rendering/RenderListMarker.cpp:
        (WebCore::RenderListMarker::willBeDestroyed):
        * rendering/TextAutoSizing.cpp:
        (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::pushParent):
        (WebCore::RenderTreeUpdater::popParent):
        (WebCore::RenderTreeUpdater::updateBeforeDescendants):
        (WebCore::RenderTreeUpdater::updateAfterDescendants):

            Factor pre/post update into functions.

        (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
        * style/RenderTreeUpdater.h:
        * style/RenderTreeUpdaterListItem.cpp: Added.

            Mutation functions move here.

        (WebCore::getParentOfFirstLineBox):
        (WebCore::firstNonMarkerChild):
        (WebCore::RenderTreeUpdater::ListItem::updateMarker):
        * style/RenderTreeUpdaterListItem.h: Added.

2017-08-18  Ms2ger  <Ms2ger@gmail.com>

        [GTK] Show controls if a video element isn't allowed to play inline.
        https://bugs.webkit.org/show_bug.cgi?id=141705

        Reviewed by Xabier Rodriguez-Calvar.

        Test: covered by media/video-fullscreeen-only-controls.html [sic].

        * Modules/mediacontrols/mediaControlsGtk.js:
        (ControllerGtk.prototype.shouldHaveControls):

2017-08-18  Zan Dobersek  <zdobersek@igalia.com>

        [EME] MediaKeySession has to initiate playback resume on HTMLMediaElement
        https://bugs.webkit.org/show_bug.cgi?id=175671

        Reviewed by Xabier Rodriguez-Calvar.

        In MediaKeySession::updateKeyStatuses(), HTMLMediaElement objects that are
        associated with the MediaKeys instance that created this session have to
        be notified in order to run the 'Attempt to Resume Playback If Necessary'
        algorithm.

        MediaKeys object now tracks the sessions that were created through it.
        MediaKeySession object is passed a MediaKeys reference, and has that
        reference invalidated if/when the MediaKeys object is destroyed.

        In MediaKeySession::updateKeyStatuses(), a task is now queued, notifying
        the MediaKeys object, if any, that the associated HTMLMediaElement
        instances have to run the mentioned algorithm. The associated media
        elements are stored through CDMClient pointers, with HTMLMediaElement
        class inheriting from the newly-introduced CDMClient interface.

        HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary() is left
        unimplemented for now. The object will attach itself to and detach from
        the associated MediaKeys object in setMediaKeys() and the destructor,
        enabling the MediaKeys object to properly dispatch the playback resume
        requests for the attached clients.

        * Modules/encryptedmedia/CDMClient.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeys.h.
        (WebCore::CDMClient::~CDMClient):
        * Modules/encryptedmedia/MediaKeySession.cpp:
        (WebCore::MediaKeySession::create):
        (WebCore::MediaKeySession::MediaKeySession):
        (WebCore::MediaKeySession::detachKeys):
        (WebCore::MediaKeySession::updateKeyStatuses):
        * Modules/encryptedmedia/MediaKeySession.h:
        * Modules/encryptedmedia/MediaKeys.cpp:
        (WebCore::MediaKeys::~MediaKeys):
        (WebCore::MediaKeys::createSession):
        (WebCore::MediaKeys::attachCDMClient):
        (WebCore::MediaKeys::detachCDMClient):
        (WebCore::MediaKeys::attemptToResumePlaybackOnClients):
        * Modules/encryptedmedia/MediaKeys.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::cdmClientAttemptToResumePlaybackIfNecessary):
        * html/HTMLMediaElement.h:

2017-08-18  Commit Queue  <commit-queue@webkit.org>

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

        I'm not sure we really need this (Requested by KaL on
        #webkit).

        Reverted changeset:

        "[GTK][WPE] Add NTLM authentication enabled API"
        https://bugs.webkit.org/show_bug.cgi?id=122952
        http://trac.webkit.org/changeset/220854

2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Input Events] Rename inputType "formatForeColor" to "formatFontColor"
        https://bugs.webkit.org/show_bug.cgi?id=175703

        Reviewed by Ryosuke Niwa.

        Renames an inputType value to match the spec. There is no other change in behavior.
        Rebaselines fast/events/input-events-selection-forecolor-data.html and fast/events/input-events-forecolor-data.html.

        * editing/EditCommand.cpp:
        (WebCore::inputTypeNameForEditingAction):

2017-08-17  Daewoong Jang  <daewoong.jang@navercorp.com>

        [Curl] Improve multi-threaded networking
        https://bugs.webkit.org/show_bug.cgi?id=175253

        Reviewed by Alex Christensen.

        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlMultiHandle::CurlMultiHandle):
        (WebCore::CurlHandle::CurlHandle):
        (WebCore::CurlHandle::initialize):
        (WebCore::CurlHandle::setSslKeyPassword):
        (WebCore::CurlHandle::setSslErrors):
        (WebCore::CurlHandle::getSslErrors):
        * platform/network/curl/CurlContext.h:
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::init):
        (WebCore::CurlDownload::getResponse const):
        (WebCore::CurlDownload::setupRequest):
        (WebCore::CurlDownload::didReceiveHeader):
        (WebCore::CurlDownload::didReceiveData):
        (WebCore::CurlDownload::headerCallback):
        (WebCore::CurlDownload::getTempPath const): Deleted.
        (WebCore::CurlDownload::getUrl const): Deleted.
        (WebCore::CurlDownload::downloadFinishedCallback): Deleted.
        (WebCore::CurlDownload::downloadFailedCallback): Deleted.
        (WebCore::CurlDownload::receivedDataCallback): Deleted.
        (WebCore::CurlDownload::receivedResponseCallback): Deleted.
        * platform/network/curl/CurlDownload.h:
        * platform/network/curl/ResourceError.h:
        (WebCore::ResourceError::ResourceError):
        (WebCore::ResourceError::sslErrors const):
        (WebCore::ResourceError::setSSLErrors): Deleted.
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandleInternal::initialize):
        (WebCore::ResourceHandleInternal::didFail):
        (WebCore::ResourceHandleInternal::dispatchSynchronousJob):
        * platform/network/curl/SSLHandle.cpp:
        (WebCore::allowedClientHosts):
        (WebCore::addAllowedClientCertificate):
        (WebCore::getSSLClientCertificate):
        (WebCore::certVerifyCallback):
        (WebCore::setSSLVerifyOptions):
        (WebCore::setSSLClientCertificate): Deleted.
        * platform/network/curl/SSLHandle.h:

2017-08-17  Chris Dumez  <cdumez@apple.com>

        Regression(r220817): We should only copy the original request headers for Ping loads
        https://bugs.webkit.org/show_bug.cgi?id=175679

        Reviewed by Youenn Fablet.

        For performance reason, we should only copy the original request headers for Ping loads
        (Beacon at the moment), not for all CachedResourceRequests.

        * loader/LoaderStrategy.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::CachedResource):
        (WebCore::CachedResource::load):
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::shouldUsePingLoad):
        (WebCore::CachedResource::setOriginalRequestHeaders):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestResource):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::CachedResourceRequest):
        * loader/cache/CachedResourceRequest.h:
        (WebCore::CachedResourceRequest::releaseResourceRequest):
        (WebCore::CachedResourceRequest::releaseOriginalRequestHeaders): Deleted.

2017-08-17  Don Olmstead  <don.olmstead@sony.com>

        [PAL] Relocate SessionID to root
        https://bugs.webkit.org/show_bug.cgi?id=175684

        Reviewed by Alex Christensen.

        No new tests. No change in functionality.

        * dom/Document.h:
        * html/HTMLMediaElement.cpp:
        * loader/cache/CachedResource.h:
        * loader/cache/CachedResourceLoader.cpp:
        * loader/cache/MemoryCache.h:
        * loader/cocoa/DiskCacheMonitorCocoa.h:
        * page/CacheStorageProvider.h:
        * page/Page.h:
        * page/PlugInClient.h:
        * page/SocketProvider.h:
        * platform/CookiesStrategy.h:
        * platform/WebCoreCrossThreadCopier.cpp:
        * platform/network/CacheValidation.h:
        * platform/network/NetworkStorageSession.cpp:
        * platform/network/NetworkStorageSession.h:
        * platform/network/cf/SocketStreamHandleImpl.h:
        * platform/network/curl/SocketStreamHandleImpl.h:
        * platform/network/soup/SocketStreamHandleImpl.h:
        * workers/WorkerGlobalScope.h:
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerRegistrationParameters.h:

2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>

        Fix the build on other platforms after r220865
        https://bugs.webkit.org/show_bug.cgi?id=175683

        Reviewed by Tim Horton.

        Instead of special casing iOS 10 behavior with __IPHONE_OS_VERSION_MAX_ALLOWED < 110000, revert to special
        casing iOS 11 behavior with __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000. This is because other targets that are
        neither iOS 10 nor 11 will fail the "before iOS 11" compile-time check, and subsequently assume that item
        providers exist. To fix this, flip the compiler-time checks and the order of codeblocks in the
        PlatformPasteboard::write methods.

        There is no change in behavior.

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::registerItemToPasteboard):
        (WebCore::PlatformPasteboard::write):

2017-08-17  Michael Catanzaro  <mcatanzaro@igalia.com>

        -Wreturn-type warnings in CryptoKey.cpp and SubtleCrypto.cpp
        https://bugs.webkit.org/show_bug.cgi?id=175675

        Reviewed by Jiewen Tan.

        * crypto/CryptoKey.cpp:
        (WebCore::CryptoKey::algorithm const):
        * crypto/SubtleCrypto.cpp:
        (WebCore::toCryptoKeyUsageBitmap):
        (WebCore::toKeyData):

2017-08-17  Andreas Kling  <akling@apple.com>

        Disable CSS regions at compile time
        https://bugs.webkit.org/show_bug.cgi?id=175630

        Reviewed by Antti Koivisto.

        * Configurations/FeatureDefines.xcconfig:

2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Respect type fidelities when copying image elements to the pasteboard
        https://bugs.webkit.org/show_bug.cgi?id=175638
        <rdar://problem/26556043>

        Reviewed by Ryosuke Niwa.

        Ensures that we respect type fidelities when copying on iOS, by unifying pasteboard writing codepaths across
        dragging and copying. When dragging and copying, we now generate and set UIItemProviders on the UIPasteboard.

        Tests: ActionSheetTests.CopyImageElementWithHREF
               ActionSheetTests.CopyImageElementWithoutHREF

        * platform/PlatformPasteboard.h:

        Remove all variants of the writeObjectRepresentations helper method. Now that both paths for writing to the
        pasteboard are unified, it's no longer useful to separate out item-provider-based pasteboard logic.

        * platform/ios/AbstractPasteboard.h:
        * platform/ios/PlatformPasteboardIOS.mm:

        Replaces -setItemsUsingRegistrationInfoLists: with -setRegistrationInfoLists:. Rather than have a helper that
        both sets up item providers and item registration lists, split this functionality out into two setters. This is
        because UIPasteboard does not need to know about the registration info lists used to set up the item providers
        in the first place, but internal drag-and-drop clients require this information immediately when starting a drag
        in order to construct custom drag previews.

        (WebCore::richTextRepresentationsForPasteboardWebContent):
        (WebCore::registerItemToPasteboard):

        Add a new helper to register item providers to the pasteboard, given an WebItemProviderRegistrationInfoList.

        (WebCore::PlatformPasteboard::write):
        (WebCore::PlatformPasteboard::writeObjectRepresentations): Deleted.

        Refactors PlatformPasteboard::write to always generate and set item providers, unless we're building for an SDK
        prior to iOS 11. For images, strings and URLs, we can simply transition to using the new item-provider-based
        codepaths used for drag and drop. For web content, we add two additional UTIs that were present when copying,
        but not when dragging: flat RTFD and a string constant used to indicate to UIKit that the pasteboard contains
        rich text.

        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderRegistrationInfoList init]):
        (-[WebItemProviderRegistrationInfoList addData:forType:]):
        (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
        (-[WebItemProviderRegistrationInfoList numberOfItems]):
        (-[WebItemProviderRegistrationInfoList itemAtIndex:]):
        (-[WebItemProviderRegistrationInfoList itemProvider]):
        (-[WebItemProviderRegistrationInfoList description]):

        Make some small tweaks in WebItemProviderPasteboard (and related classes):
        1. Transition to preferredPresentationSize from estimatedDisplayedSize, which is now deprecated.
        2. Remove calls to -initWithItemProviderData:typeIdentifier:error:, which is deprecated.
        3. Rename _items to _representations to better reflect the role of WebItemProviderRegistrationInfo.
        4. Implement -description for WebItemProviderRegistrationInfoList for debugging purposes.

        (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
        (-[WebItemProviderPasteboard setRegistrationInfoLists:]):
        (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]): Deleted.

2017-08-17  Youenn Fablet  <youenn@apple.com>

        Add a DOMPromiseDeferred method to handle ExceptionOr<> results
        https://bugs.webkit.org/show_bug.cgi?id=175603

        Reviewed by Darin Adler.

        No change of behavior.

        Introduce DOMPromiseDeferred::settle to reject/resolve a promise with an ExceptionOr<>.
        Making batchPutOperation/batchDeleteOperation take a Function with an ExceptionOr<>.
        Using DOMPromiseDeferred::settle in Cache put/remove.
        Updated CacheStorageConnection to create ExceptionOr<> from CacheStorageConnection::Error.

        * Modules/cache/Cache.cpp:
        (WebCore::Cache::put):
        (WebCore::Cache::remove):
        (WebCore::Cache::batchDeleteOperation):
        (WebCore::Cache::batchPutOperation):
        * Modules/cache/Cache.h:
        * Modules/cache/CacheStorage.cpp:
        (WebCore::CacheStorage::open):
        (WebCore::CacheStorage::remove):
        * Modules/cache/CacheStorageConnection.cpp:
        (WebCore::CacheStorageConnection::errorToException):
        * Modules/cache/CacheStorageConnection.h:
        (WebCore::CacheStorageConnection::errorToException):
        (WebCore::CacheStorageConnection::exceptionOrResult):
        * bindings/js/JSDOMPromiseDeferred.h:
        (WebCore::DOMPromiseDeferred::settle):
        (WebCore::DOMPromiseDeferred<void>::settle):

2017-08-17  Zan Dobersek  <zdobersek@igalia.com>

        [GStreamer] AppendPipeline: support dispatch of decryption-specific GstStructure into the pipeline
        https://bugs.webkit.org/show_bug.cgi?id=175668

        Reviewed by Xabier Rodriguez-Calvar.

        Add the AppendPipeline::dispatchDecryptionStructure() method. Callers can
        pass in a GstStructure object that contains all the information the
        decryption elements in the pipeline will require to properly decrypt the
        content. In case the decryptor element isn't available yet, the
        GstStructure is stored and dispatched when that element becomes available.

        The dispatch itself simply creates a new custom GstEvent that adopts the
        given GstStructure object, sends that into the pipeline element, and
        shifts the state to 'ongoing'.

        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
        (WebCore::AppendPipeline::dispatchPendingDecryptionStructure):
        (WebCore::AppendPipeline::dispatchDecryptionStructure):
        * platform/graphics/gstreamer/mse/AppendPipeline.h: Remove a redundant private: label.

2017-08-17  Zan Dobersek  <zdobersek@igalia.com>

        [GStreamer] GstStructure shouldn't be handled through GRefPtr
        https://bugs.webkit.org/show_bug.cgi?id=175673

        Reviewed by Xabier Rodriguez-Calvar.

        * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
        (webkitMediaCommonEncryptionDecryptTransformCaps): GstStructure isn't
        ref-counted, so it should be handled through the GUniquePtr<GstStructure>
        smart pointer.

2017-08-17  Youenn Fablet  <youenn@apple.com>

        [Mac/iOS] Increase the audio buffer size when audio capture is on but web audio is not used
        https://bugs.webkit.org/show_bug.cgi?id=175631

        Reviewed by Eric Carlson.

        * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
        (PlatformMediaSessionManager::updateSessionState): Change value from 128 to the equivalent of 20ms when audio capture happens but not web audio.

2017-08-17  Antti Koivisto  <antti@apple.com>

        RenderListItem - Avoid render tree mutation during layout
        https://bugs.webkit.org/show_bug.cgi?id=175666

        Reviewed by Andreas Kling.

        Mutations should be done by RenderTreeUpdater only.

        * rendering/RenderListItem.cpp:
        (WebCore::RenderListItem::updateMarkerRenderer):

            This is now called by RenderTreeUpdater only.
            Remove code dealing with this being called at layout time.
            Merged marker construction code from styleDidChange here and renamed for clarity.

        (WebCore::RenderListItem::layout):
        (WebCore::RenderListItem::computePreferredLogicalWidths):

            Remove mutating calls.

        (WebCore::RenderListItem::styleDidChange): Deleted.
        (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded): Deleted.
        * rendering/RenderListItem.h:
        * rendering/TextAutoSizing.cpp:
        (WebCore::TextAutoSizingValue::adjustTextNodeSizes):

            Call updateMarkerRenderer.

        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::popParent):
        (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):

            Call updateMarkerRenderer.

2017-08-17  Don Olmstead  <don.olmstead@sony.com>

        [PAL] Move SessionID into PAL
        https://bugs.webkit.org/show_bug.cgi?id=174192

        Reviewed by Antti Koivisto.

        No new tests. No change in behavior.

        * CMakeLists.txt:
        * Modules/websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::connect):
        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::Document::sessionID const):
        * dom/Document.h:
        * dom/ScriptExecutionContext.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::elementWithID):
        (WebCore::HTMLMediaElement::finishParsingChildren):
        (WebCore::HTMLMediaElement::scheduleEvent):
        (WebCore::HTMLMediaElement::canPlayType const):
        (WebCore::HTMLMediaElement::load):
        (WebCore::HTMLMediaElement::loadResource):
        (WebCore::HTMLMediaElement::textTracksAreReady const):
        (WebCore::HTMLMediaElement::textTrackModeChanged):
        (WebCore::HTMLMediaElement::noneSupported):
        (WebCore::HTMLMediaElement::mediaLoadingFailedFatally):
        (WebCore::HTMLMediaElement::mediaLoadingFailed):
        (WebCore::HTMLMediaElement::setReadyState):
        (WebCore::HTMLMediaElement::addPlayedRange):
        (WebCore::HTMLMediaElement::seekTask):
        (WebCore::HTMLMediaElement::refreshCachedTime const):
        (WebCore::HTMLMediaElement::currentMediaTime const):
        (WebCore::HTMLMediaElement::setWebkitPreservesPitch):
        (WebCore::HTMLMediaElement::ended const):
        (WebCore::HTMLMediaElement::playInternal):
        (WebCore::HTMLMediaElement::pause):
        (WebCore::HTMLMediaElement::togglePlayState):
        (WebCore::HTMLMediaElement::beginScrubbing):
        (WebCore::HTMLMediaElement::playbackProgressTimerFired):
        (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
        (WebCore::HTMLMediaElement::didAddTextTrack):
        (WebCore::HTMLMediaElement::didRemoveTextTrack):
        (WebCore::controllerJSValue):
        (WebCore::HTMLMediaElement::configureTextTracks):
        (WebCore::HTMLMediaElement::selectNextSourceChild):
        (WebCore::HTMLMediaElement::sourceWasAdded):
        (WebCore::HTMLMediaElement::sourceWasRemoved):
        (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
        (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
        (WebCore::HTMLMediaElement::potentiallyPlaying const):
        (WebCore::HTMLMediaElement::endedPlayback const):
        (WebCore::HTMLMediaElement::stoppedDueToErrors const):
        (WebCore::HTMLMediaElement::updatePlayState):
        (WebCore::HTMLMediaElement::userCancelledLoad):
        (WebCore::HTMLMediaElement::canSuspendForDocumentSuspension const):
        (WebCore::HTMLMediaElement::addEventListener):
        (WebCore::HTMLMediaElement::isFullscreen const):
        (WebCore::HTMLMediaElement::toggleStandardFullscreenState):
        (WebCore::HTMLMediaElement::waitForPreparedForInlineThen):
        (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
        (WebCore::HTMLMediaElement::updateTextTrackDisplay):
        (WebCore::HTMLMediaElement::mediaControls const):
        (WebCore::HTMLMediaElement::configureTextTrackDisplay):
        (WebCore::HTMLMediaElement::setMediaGroup):
        (WebCore::HTMLMediaElement::setControllerForBindings):
        (WebCore::HTMLMediaElement::isBlockedOnMediaController const):
        (WebCore::HTMLMediaElement::prepareMediaFragmentURI):
        (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
        (WebCore::HTMLMediaElement::fileSize const):
        (WebCore::HTMLMediaElement::mediaSessionTitle const):
        (WebCore::needsSeekingSupportQuirk):
        (WebCore::HTMLMediaElement::supportsSeeking const):
        (WebCore::HTMLMediaElement::doesHaveAttribute const):
        (WebCore::HTMLMediaElement::isVideoTooSmallForInlinePlayback):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::continueAfterContentPolicy):
        * loader/EmptyClients.cpp:
        * loader/FrameLoaderClient.h:
        * loader/cache/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
        * loader/cache/CachedCSSStyleSheet.h:
        * loader/cache/CachedFont.cpp:
        (WebCore::CachedFont::CachedFont):
        * loader/cache/CachedFont.h:
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::CachedImage):
        * loader/cache/CachedImage.h:
        * loader/cache/CachedRawResource.cpp:
        (WebCore::CachedRawResource::CachedRawResource):
        * loader/cache/CachedRawResource.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::CachedResource):
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::sessionID const):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::createResource):
        (WebCore::CachedResourceLoader::sessionID const):
        * loader/cache/CachedResourceLoader.h:
        * loader/cache/CachedSVGDocument.cpp:
        (WebCore::CachedSVGDocument::CachedSVGDocument):
        * loader/cache/CachedSVGDocument.h:
        * loader/cache/CachedSVGFont.cpp:
        (WebCore::CachedSVGFont::CachedSVGFont):
        * loader/cache/CachedSVGFont.h:
        * loader/cache/CachedScript.cpp:
        (WebCore::CachedScript::CachedScript):
        * loader/cache/CachedScript.h:
        * loader/cache/CachedTextTrack.cpp:
        (WebCore::CachedTextTrack::CachedTextTrack):
        * loader/cache/CachedTextTrack.h:
        * loader/cache/CachedXSLStyleSheet.cpp:
        (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
        * loader/cache/CachedXSLStyleSheet.h:
        * loader/cache/MemoryCache.cpp:
        (WebCore::MemoryCache::sessionResourceMap const):
        (WebCore::MemoryCache::ensureSessionResourceMap):
        (WebCore::MemoryCache::resourceForRequest):
        (WebCore::MemoryCache::addImageToCache):
        (WebCore::MemoryCache::removeImageFromCache):
        (WebCore::MemoryCache::forEachSessionResource):
        (WebCore::MemoryCache::removeResourcesWithOrigins):
        (WebCore::MemoryCache::originsWithCache const):
        (WebCore::MemoryCache::evictResources):
        * loader/cache/MemoryCache.h:
        * loader/cocoa/DiskCacheMonitorCocoa.h:
        (WebCore::DiskCacheMonitor::sessionID const):
        * loader/cocoa/DiskCacheMonitorCocoa.mm:
        (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation):
        (WebCore::DiskCacheMonitor::DiskCacheMonitor):
        * page/CacheStorageProvider.h:
        * page/DatabaseProvider.h:
        * page/Page.cpp:
        (WebCore::Page::Page):
        (WebCore::Page::enableLegacyPrivateBrowsing):
        (WebCore::Page::sessionID const):
        (WebCore::Page::setSessionID):
        * page/Page.h:
        * page/PlugInClient.h:
        * page/SocketProvider.cpp:
        (WebCore::SocketProvider::createSocketStreamHandle):
        * page/SocketProvider.h:
        * platform/CookiesStrategy.h:
        * platform/WebCoreCrossThreadCopier.cpp:
        (WTF::PAL::SessionID>::copy):
        (WTF::WebCore::SessionID>::copy): Deleted.
        * platform/WebCoreCrossThreadCopier.h:
        * platform/network/CacheValidation.cpp:
        (WebCore::headerValueForVary):
        (WebCore::collectVaryingRequestHeaders):
        (WebCore::verifyVaryingRequestHeaders):
        * platform/network/CacheValidation.h:
        * platform/network/NetworkStorageSession.cpp:
        (WebCore::NetworkStorageSession::globalSessionMap):
        (WebCore::NetworkStorageSession::storageSession):
        (WebCore::NetworkStorageSession::destroySession):
        * platform/network/NetworkStorageSession.h:
        (WebCore::NetworkStorageSession::sessionID const):
        * platform/network/NetworkStorageSessionStub.cpp:
        (WebCore::NetworkStorageSession::NetworkStorageSession):
        (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
        (WebCore::NetworkStorageSession::ensureSession):
        (WebCore::NetworkStorageSession::defaultStorageSession):
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::NetworkStorageSession):
        (WebCore::NetworkStorageSession::switchToNewTestingSession):
        (WebCore::NetworkStorageSession::defaultStorageSession):
        (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
        (WebCore::NetworkStorageSession::ensureSession):
        * platform/network/cf/SocketStreamHandleImpl.h:
        (WebCore::SocketStreamHandleImpl::create):
        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
        (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
        * platform/network/curl/SocketStreamHandleImpl.h:
        (WebCore::SocketStreamHandleImpl::create):
        * platform/network/soup/NetworkStorageSessionSoup.cpp:
        (WebCore::NetworkStorageSession::NetworkStorageSession):
        (WebCore::NetworkStorageSession::defaultStorageSession):
        (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
        (WebCore::NetworkStorageSession::ensureSession):
        (WebCore::NetworkStorageSession::switchToNewTestingSession):
        * platform/network/soup/SocketStreamHandleImpl.h:
        * platform/network/soup/SocketStreamHandleImplSoup.cpp:
        (WebCore::SocketStreamHandleImpl::create):
        * workers/DedicatedWorkerGlobalScope.cpp:
        (WebCore::DedicatedWorkerGlobalScope::create):
        (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
        * workers/DedicatedWorkerGlobalScope.h:
        * workers/DedicatedWorkerThread.cpp:
        (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
        (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
        * workers/DedicatedWorkerThread.h:
        * workers/Worker.cpp:
        (WebCore::Worker::notifyFinished):
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::WorkerGlobalScope):
        * workers/WorkerGlobalScope.h:
        * workers/WorkerGlobalScopeProxy.h:
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
        * workers/WorkerMessagingProxy.h:
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
        (WebCore::WorkerThread::WorkerThread):
        * workers/WorkerThread.h:
        * workers/service/ServiceWorkerContainer.h:
        * workers/service/ServiceWorkerRegistrationParameters.h:

2017-08-17  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add NTLM authentication enabled API
        https://bugs.webkit.org/show_bug.cgi?id=122952

        Reviewed by Michael Catanzaro.

        Add/remove NTLM feature to/from soup session depending on whether the feature is enabled or disabled.

        * platform/network/soup/SoupNetworkSession.cpp:
        (WebCore::SoupNetworkSession::SoupNetworkSession):
        (WebCore::SoupNetworkSession::setInitialNTLMAuthenticationEnabled):
        (WebCore::SoupNetworkSession::setNTLMAuthenticationEnabled):
        * platform/network/soup/SoupNetworkSession.h:

2017-08-16  Ryosuke Niwa  <rniwa@webkit.org>

        Add the support for mutating clipboard data via DataTransferItemList
        https://bugs.webkit.org/show_bug.cgi?id=175639

        Reviewed by Wenson Hsieh.

        Added the support for adding plaintext data via dataTransfer.items.add, clearing data via clear,
        and removing an entry via remove. When DataTransferItem is removed from DataTransferItemList,
        we must put into the disabled mode.

        To support the removal of DataTransferItem, this patch replaces a reference to DataTransfer by
        a WeakPtr to DataTransferItemList, and stops forwarding ref from DataTransferItem to DataTransfer.
        This means that DataTransfer can now be GC'ed before DataTransferItem is GC'ed.

        Because the identify and the order of DataTransferItems need to be preserved, we can't simply
        re-popluate m_itemList in DataTransferItemList. Instead, whenever the clipboard content is mutated,
        we make the parallel modifications to m_itemList. This includes changes made via DataTransfer
        methods such as setData and clearData.

        Test: editing/pasteboard/datatransfer-items-copy-plaintext.html

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::clearData): Invoke didClearStringData when m_itemList exists.
        (WebCore::DataTransfer::setData): Ditto.
        (WebCore::DataTransfer::createForInputEvent):
        (WebCore::DataTransfer::createForDrag):
        (WebCore::DataTransfer::createForDrop):
        * dom/DataTransferItem.cpp:
        (WebCore::DataTransferItem::create):
        (WebCore::DataTransferItem::DataTransferItem):
        (WebCore::DataTransferItem::clearListAndPutIntoDisabledMode): Added.
        (WebCore::DataTransferItem::type const): Moved from the header.
        (WebCore::DataTransferItem::getAsString const):
        (WebCore::DataTransferItem::getAsFile const):
        * dom/DataTransferItem.h:
        (WebCore::DataTransferItem::ref): Deleted.
        (WebCore::DataTransferItem::deref): Deleted.
        (WebCore::DataTransferItem::isFile const): Added.
        (WebCore::DataTransferItem::type const): Move to the cpp file.
        * dom/DataTransferItemList.cpp:
        (WebCore::isSupportedType): Moved.
        (WebCore::DataTransferItemList::DataTransferItemList): Moved from the header.
        (WebCore::DataTransferItemList::~DataTransferItemList): Added.
        (WebCore::DataTransferItemList::item):
        (WebCore::DataTransferItemList::add): Implemented the variant to add string data.
        (WebCore::DataTransferItemList::remove): Implemented. For now, we don't have to deal with removing
        a file since a writable dataTransfer never contains a File object.
        (WebCore::DataTransferItemList::clear): Implemented.
        (WebCore::DataTransferItemList::ensureItems const):
        (WebCore::removeStringItemOfLowercasedType): Added.
        (WebCore::DataTransferItemList::didClearStringData): Called when dataTransfer.clear is called.
        (WebCore::DataTransferItemList::didSetStringData): Ditto for 
        * dom/DataTransferItemList.h:
        (WebCore::DataTransferItemList): Added a WeakPtrFactory. Also use a vector of Ref<DataTransferItem>
        instead of unique_ptr<DataTransferItem> since DataTransferItem can outlive DataTransferItemList.
        (WebCore::DataTransferItemList::dataTransfer): Added.
        * dom/DataTransferItemList.idl:

2017-08-16  Andy Estes  <aestes@apple.com>

        [Apple Pay] Rename PaymentRequest to ApplePaySessionPaymentRequest
        https://bugs.webkit.org/show_bug.cgi?id=175648

        Reviewed by Tim Horton.

        The W3C Payment Request API defines an interface called PaymentRequest, which conflicts with
        an existing Apple Pay class. This patch renames PaymentRequest to
        ApplePaySessionPaymentRequest so that a follow-on patch can introduce PaymentRequest for the
        W3C API.

        * Modules/applepay/ApplePayError.h:
        * Modules/applepay/ApplePayLineItem.h:
        * Modules/applepay/ApplePayPaymentRequest.h:
        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::convertAndValidateTotal):
        (WebCore::convertAndValidate):
        (WebCore::ApplePaySession::ApplePaySession):
        (WebCore::ApplePaySession::didSelectShippingMethod):
        * Modules/applepay/ApplePaySession.h:
        * Modules/applepay/ApplePaySessionPaymentRequest.cpp: Renamed from Source/WebCore/Modules/applepay/PaymentRequest.cpp.
        (WebCore::ApplePaySessionPaymentRequest::ApplePaySessionPaymentRequest):
        (WebCore::ApplePaySessionPaymentRequest::~ApplePaySessionPaymentRequest):
        (WebCore::ApplePaySessionPaymentRequest::isValidSupportedNetwork):
        * Modules/applepay/ApplePaySessionPaymentRequest.h: Renamed from Source/WebCore/Modules/applepay/PaymentRequest.h.
        * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
        (WebCore::convert):
        (WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent):
        * Modules/applepay/ApplePayShippingMethodSelectedEvent.h:
        * Modules/applepay/PaymentCoordinator.cpp:
        (WebCore::PaymentCoordinator::beginPaymentSession):
        (WebCore::PaymentCoordinator::didSelectShippingMethod):
        * Modules/applepay/PaymentCoordinator.h:
        * Modules/applepay/PaymentCoordinatorClient.h:
        * Modules/applepay/PaymentHeaders.h:
        * Modules/applepay/PaymentRequestValidator.cpp:
        (WebCore::PaymentRequestValidator::validate):
        (WebCore::PaymentRequestValidator::validateTotal):
        (WebCore::validateMerchantCapabilities):
        (WebCore::validateShippingMethod):
        (WebCore::validateShippingMethods):
        * Modules/applepay/PaymentRequestValidator.h:
        * WebCore.xcodeproj/project.pbxproj:
        * loader/EmptyClients.cpp:

2017-08-16  Chris Dumez  <cdumez@apple.com>

        Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight
        https://bugs.webkit.org/show_bug.cgi?id=175628
        <rdar://problem/33919278>

        Reviewed by Geoffrey Garen.

        Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight.
        To achieve this, the following changes were made:
        1. Revert r220779 which caused us to use a non CORS-safelisted Content-Type header for such payload
        2. Teach PingLoad how to deal with "simple" cross origin requests (i.e. Don't assume we need a CORS
           preflight merely because the fetch mode is set to "cors").

        Test: http/wpt/beacon/cors/crossorigin-arraybufferview-no-preflight.html

        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::extract):
        * loader/CrossOriginAccessControl.h:
        * loader/LoaderStrategy.h:
        * loader/PingLoader.cpp:
        (WebCore::PingLoader::loadImage):
        (WebCore::PingLoader::sendPing):
        (WebCore::PingLoader::sendViolationReport):
        (WebCore::PingLoader::startPingLoad):
        * loader/PingLoader.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::CachedResource):
        (WebCore::CachedResource::load):
        * loader/cache/CachedResource.h:
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::CachedResourceRequest):
        * loader/cache/CachedResourceRequest.h:
        (WebCore::CachedResourceRequest::releaseOriginalRequestHeaders):
        * platform/network/HTTPHeaderValues.cpp:
        * platform/network/HTTPHeaderValues.h:

2017-08-16  Matt Baker  <mattbaker@apple.com>

        Web Inspector: capture async stack trace when workers/main context posts a message
        https://bugs.webkit.org/show_bug.cgi?id=167084
        <rdar://problem/30033673>

        Reviewed by Brian Burg.

        Add instrumentation to DOMWindow to support showing asynchronous
        stack traces when the debugger pauses in a MessageEvent handler.

        Test: inspector/debugger/async-stack-trace.html

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didPostMessageImpl):
        (WebCore::InspectorInstrumentation::didFailPostMessageImpl):
        (WebCore::InspectorInstrumentation::willDispatchPostMessageImpl):
        (WebCore::InspectorInstrumentation::didDispatchPostMessageImpl):

        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didPostMessage):
        (WebCore::InspectorInstrumentation::didFailPostMessage):
        (WebCore::InspectorInstrumentation::willDispatchPostMessage):
        (WebCore::InspectorInstrumentation::didDispatchPostMessage):

        * inspector/PageDebuggerAgent.cpp:
        (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
        (WebCore::PageDebuggerAgent::didPostMessage):
        (WebCore::PageDebuggerAgent::didFailPostMessage):
        (WebCore::PageDebuggerAgent::willDispatchPostMessage):
        (WebCore::PageDebuggerAgent::didDispatchPostMessage):
        * inspector/PageDebuggerAgent.h:

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::postMessage):
        (WebCore::DOMWindow::postMessageTimerFired):

2017-08-16  Timothy Horton  <timothy_horton@apple.com>

        Try to fix the build

        * platform/ios/PlatformPasteboardIOS.mm:

2017-08-16  Simon Fraser  <simon.fraser@apple.com>

        Build fix after r220812

        Fix builds where LOG_DISABLED is defined.

        * css/MediaQueryEvaluator.cpp:

2017-08-16  Simon Fraser  <simon.fraser@apple.com>

        Add a log channel for media queries
        https://bugs.webkit.org/show_bug.cgi?id=175591

        Reviewed by Zalan Bujtas.

        Add a "MediaQueries" log channel which logs data about media query evaluation.

        * css/MediaList.cpp:
        (WebCore::MediaQuerySet::MediaQuerySet):
        (WebCore::operator<<):
        * css/MediaList.h:
        * css/MediaQuery.cpp:
        (WebCore::operator<<):
        * css/MediaQuery.h:
        * css/MediaQueryEvaluator.cpp:
        (WebCore::operator<<):
        (WebCore::MediaQueryEvaluator::evaluate const):
        (WebCore::aspectRatioValueAsString):
        (WebCore::orientationEvaluate):
        (WebCore::aspectRatioEvaluate):
        (WebCore::deviceAspectRatioEvaluate):
        (WebCore::evaluateResolution):
        (WebCore::deviceHeightEvaluate):
        (WebCore::deviceWidthEvaluate):
        (WebCore::heightEvaluate):
        (WebCore::widthEvaluate):
        * css/MediaQueryExpression.cpp:
        (WebCore::operator<<):
        * css/MediaQueryExpression.h:
        * css/MediaQueryMatcher.cpp:
        (WebCore::MediaQueryMatcher::styleResolverChanged):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::hasMediaQueriesAffectedByViewportChange const):
        (WebCore::StyleResolver::hasMediaQueriesAffectedByAccessibilitySettingsChange const):
        * dom/InlineStyleSheetOwner.cpp:
        (WebCore::InlineStyleSheetOwner::createSheet):
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::process):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::selectNextSourceChild):
        * html/HTMLPictureElement.cpp:
        (WebCore::HTMLPictureElement::viewportChangeAffectedPicture const):
        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
        * page/FrameView.cpp:
        (WebCore::FrameView::layout):
        * platform/Logging.cpp:
        (WebCore::initializeLogChannelsIfNecessary):
        * platform/Logging.h:
        * platform/URL.cpp:
        (WebCore::isSchemeFirstChar):
        (WebCore::operator<<):
        * platform/URL.h:

2017-08-16  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove the need for JSSubtleCryptoCustom.cpp
        https://bugs.webkit.org/show_bug.cgi?id=175526

        Reviewed by Chris Dumez.

        - Generates bindings for all of SubtleCrypto except AlgorithmIdentifier normalization, 
          which is defined in the WebCrypto spec to happen after normal IDL operations.
        - Adds initial support for IDL object types in unions (some, unneeded at the moment,
          edge cases remain).

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSSubtleCryptoCustom.cpp: Removed.

            Remove JSSubtleCryptoCustom.cpp, added CryptoKeyFormat.h

        * bindings/js/JSDOMConvertObject.h:

            Add needed, when included in generated code, #include of StrongInlines.h

        * bindings/js/JSDOMConvertUnion.h:
        
            Add initial support for object (needed for AlgorithmIdentifier which is 
            (object or DOMString)). Remaining support will be handled by https://webkit.org/b/175616

            Also add remaining spec comments while in the area.

        * bindings/js/JSDOMPromiseDeferred.cpp:
        (WebCore::DeferredPromise::reject):

            Add support for the special ExistingExceptionError error code. Capturing
            the current exception and using it as the rejection value.

        * crypto/SubtleCrypto.cpp:
        (WebCore::SubtleCrypto::~SubtleCrypto):
        (WebCore::toHashIdentifier):
        (WebCore::normalizeCryptoAlgorithmParameters):
        (WebCore::toCryptoKeyUsageBitmap):
        (WebCore::rejectWithException):
        (WebCore::normalizeJsonWebKey):
        (WebCore::toKeyData):
        (WebCore::copyToVector):
        (WebCore::isSupportedExportKey):
        (WebCore::SubtleCrypto::encrypt):
        (WebCore::SubtleCrypto::decrypt):
        (WebCore::SubtleCrypto::sign):
        (WebCore::SubtleCrypto::verify):
        (WebCore::SubtleCrypto::digest):
        (WebCore::SubtleCrypto::generateKey):
        (WebCore::SubtleCrypto::deriveKey):
        (WebCore::SubtleCrypto::deriveBits):
        (WebCore::SubtleCrypto::importKey):
        (WebCore::SubtleCrypto::exportKey):
        (WebCore::SubtleCrypto::wrapKey):
        (WebCore::SubtleCrypto::unwrapKey):
        * crypto/SubtleCrypto.h:
        * crypto/SubtleCrypto.idl:

            Moves implementation from JSSubtleCryptoCustom.cpp -> here. Important changes that come
            with that are:
            - All parameters are now converted / type checked for us.
            - Rather than throwing exceptions and expecting the bindings layer to convert
              them to promise rejections, all rejections are now explicitly made.
            - Algorithms are no longer checked for being supported twice, once in normalizeCryptoAlgorithmParameters
              and then again in the operation. We instead rely on normalizeCryptoAlgorithmParameters to return
              an Exception if its not supported.
            - Shaves 251 lines off the file.

        * crypto/CryptoKeyFormat.h: Added.

            Add new header for unified key format enum. (For bindings purposes, SubtleCrypto
            re aliases it to SubtleCrypto::KeyFormat).

        * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
        * crypto/CryptoAlgorithm.cpp:
        * crypto/CryptoAlgorithm.h:
        * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
        * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
        * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
        * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
        * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
        * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
        * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
        * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
        * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
        * crypto/algorithms/CryptoAlgorithmAES_KW.h:
        * crypto/algorithms/CryptoAlgorithmECDH.cpp:
        * crypto/algorithms/CryptoAlgorithmECDH.h:
        * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
        * crypto/algorithms/CryptoAlgorithmECDSA.h:
        * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
        * crypto/algorithms/CryptoAlgorithmHKDF.h:
        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
        * crypto/algorithms/CryptoAlgorithmHMAC.h:
        * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
        * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
        * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
        * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
        * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:

            Use CryptoKeyFormat enum directly, rather than SubtleCrypto::KeyFormat,
            to allow not including SubtleCrypto.h.

        * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
        * crypto/parameters/CryptoAlgorithmHkdfParams.h:
        * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
        * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
        * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
        * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h:
        * crypto/parameters/EcdsaParams.idl:
        * crypto/parameters/HkdfParams.idl:
        * crypto/parameters/HmacKeyParams.idl:
        * crypto/parameters/Pbkdf2Params.idl:
        * crypto/parameters/RsaHashedImportParams.idl:
        * crypto/parameters/RsaHashedKeyGenParams.idl:

            Update IDLs and implementations to use the correct definition of HashAlgorithmIdentifier,
            which is (object or DOMString), now that it is supported.

2017-08-16  Youenn Fablet  <youenn@apple.com>

        [Cache API] Implement Worker connection to the Cache storage engine
        https://bugs.webkit.org/show_bug.cgi?id=175599

        Reviewed by Chris Dumez.

        Covered by existing tests.

        Adding a WorkerCacheStorageConnection to connect workers Cache/CacheStorage
        to the cache storage engine.
        WorkerCacheStorageConnection does this by hopping to the main thread to call the document cache storage connection to do the actual job.
        Doing some CacheStorageConnection refactoring to share code with WK2 implementation of the cache storage connection. 

        * Modules/cache/CacheQueryOptions.h:
        (WebCore::CacheQueryOptions::isolatedCopy const):
        * Modules/cache/CacheStorageConnection.cpp:
        (WebCore::CacheStorageConnection::open):
        (WebCore::CacheStorageConnection::remove):
        (WebCore::CacheStorageConnection::retrieveCaches):
        (WebCore::CacheStorageConnection::retrieveRecords):
        (WebCore::CacheStorageConnection::batchDeleteOperation):
        (WebCore::CacheStorageConnection::batchPutOperation):
        (WebCore::CacheStorageConnection::openOrRemoveCompleted):
        (WebCore::CacheStorageConnection::updateCaches):
        (WebCore::CacheStorageConnection::updateRecords):
        (WebCore::CacheStorageConnection::removeRecordsCompleted):
        (WebCore::CacheStorageConnection::putRecordsCompleted):
        * Modules/cache/CacheStorageConnection.h:
        (WebCore::CacheStorageConnection::openCompleted):
        (WebCore::CacheStorageConnection::removeCompleted):
        (WebCore::CacheStorageConnection::doOpen):
        (WebCore::CacheStorageConnection::doRemove):
        (WebCore::CacheStorageConnection::doRetrieveCaches):
        (WebCore::CacheStorageConnection::doRetrieveRecords):
        (WebCore::CacheStorageConnection::doBatchDeleteOperation):
        (WebCore::CacheStorageConnection::doBatchPutOperation):
        * Modules/cache/WorkerCacheStorageConnection.cpp: Added.
        (WebCore::toCrossThreadRecordData):
        (WebCore::fromCrossThreadRecordData):
        (WebCore::WorkerCacheStorageConnection::create):
        (WebCore::WorkerCacheStorageConnection::WorkerCacheStorageConnection):
        (WebCore::WorkerCacheStorageConnection::doOpen):
        (WebCore::WorkerCacheStorageConnection::doRemove):
        (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
        (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
        (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
        (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
        * Modules/cache/WorkerCacheStorageConnection.h: Added.
        * Modules/cache/WorkerGlobalScopeCaches.cpp:
        (WebCore::WorkerGlobalScopeCaches::caches const):
        * WebCore.xcodeproj/project.pbxproj:
        * loader/FetchOptions.h:
        (WebCore::FetchOptions::isolatedCopy const):
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::cacheStorageConnection):
        * workers/WorkerGlobalScope.h:

2017-08-16  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        [PAL] Move spi/ios and spi/win directories into PAL
        https://bugs.webkit.org/show_bug.cgi?id=175171

        Reviewed by Antti Koivisto.

        * PlatformWin.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * editing/cocoa/DataDetection.mm:
        * loader/ios/PreviewLoader.mm:
        * page/CaptionUserPreferencesMediaAF.cpp:
        * page/cocoa/MemoryReleaseCocoa.mm:
        * page/cocoa/SettingsCocoa.mm:
        * page/ios/UserAgentIOS.mm:
        * platform/audio/ios/MediaSessionManagerIOS.mm:
        * platform/graphics/ca/PlatformCALayer.cpp:
        * platform/graphics/cocoa/FontCascadeCocoa.mm:
        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
        * platform/graphics/opentype/OpenTypeCG.h:
        * platform/graphics/win/SimpleFontDataCGWin.cpp:
        * platform/graphics/win/SimpleFontDataDirect2D.cpp:
        * platform/ios/Device.h:
        * platform/ios/PlatformPasteboardIOS.mm:
        * platform/ios/PlatformScreenIOS.mm:
        * platform/ios/QuickLookSoftLink.h:
        * platform/ios/QuickLookSoftLink.mm:
        * platform/ios/ValidationBubbleIOS.mm:
        * platform/ios/WebItemProviderPasteboard.mm:
        * platform/network/ios/PreviewConverter.mm:
        * platform/sql/SQLiteFileSystem.cpp:
        * rendering/RenderThemeIOS.mm:

2017-08-16  Tim Horton  <timothy_horton@apple.com>

        2-3% of main thread time under UTTypeCreatePreferredIdentifierForTag on wunderground map
        https://bugs.webkit.org/show_bug.cgi?id=175618

        Reviewed by Simon Fraser.

        No new tests, just a perf win.

        UTTypeCreatePreferredIdentifierForTag is fairly expensive, and is called
        under every toDataURL, which the Wunderground wundermap does a /lot/.

        Keep a 16-item LRU cache of MIMEType->UTI mappings.

        Also, make other callers of UTTypeCreatePreferredIdentifierForTag use
        the UTIUtilities version so they can share in the caching.

        Also, as a drive-by, add and make other callers use mimeTypeFromUTI too,
        and make the UTIUtilities operate on Strings for a slightly more WebCore-y feel.

        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::WebContentReader::readImage):
        * platform/MIMETypeRegistry.cpp:
        (WebCore::initializeSupportedImageMIMETypes):
        (WebCore::initializeSupportedImageMIMETypesForEncoding):
        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::createFileTypesSet):
        * platform/graphics/cg/ImageSourceCGMac.mm:
        (WebCore::MIMETypeForImageSourceType):
        Adopt newly-added MIMETypeFromUTI().

        * platform/graphics/cg/ImageBufferCG.cpp:
        (WebCore::utiFromImageBufferMIMEType):
        (WebCore::ImageBuffer::toCFData const):
        (WebCore::cfData):
        (WebCore::utiFromMIMEType): Deleted.
        Adopt UTIFromMIMEType, and rename the local helper that does something
        different (a small static map) on iOS and Windows to not have an overlapping name.

        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::resourceMIMEType):
        (WebCore::utiTypeFromCocoaType):
        Adopt UTIFromMIMEType().

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::writeObjectRepresentations):
        * platform/mac/PasteboardMac.mm:
        (WebCore::cocoaTypeFromHTMLClipboardType):
        Adopt isDeclaredUTI and UTIFromMIMEType().

        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
        (WebCore::WebCoreAVFResourceLoader::responseReceived):
        * platform/network/ios/WebCoreURLResponseIOS.mm:
        (WebCore::adjustMIMETypeIfNecessary):
        * platform/network/mac/WebCoreURLResponse.mm:
        (WebCore::adjustMIMETypeIfNecessary):
        * rendering/RenderThemeIOS.mm:
        (WebCore::iconForAttachment):
        * rendering/RenderThemeMac.mm:
        (WebCore::iconForAttachment):
        Deal with the fact that UTI utilities deal in Strings now.

        * platform/network/mac/UTIUtilities.h:
        * platform/network/mac/UTIUtilities.mm:
        (WebCore::MIMETypeFromUTI):
        Added. This doesn't crawl up the UTI tree if the first conversion fails,
        which is what most of the existing code does. It's possible we want to
        use MIMETypeFromUTITree's logic everywhere, but I didn't want to change
        that in this patch.

        (WebCore::MIMETypeFromUTITree):
        (WebCore::isDeclaredUTI):
        Take and return strings.

        (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
        (WebCore::UTIFromMIMEType):
        Add the aforementioned cache.

2017-08-16  Simon Fraser  <simon.fraser@apple.com>

        Make RenderLayer and RenderLayerBacking TextStream-loggable, and clean up compositing logging
        https://bugs.webkit.org/show_bug.cgi?id=175634

        Reviewed by Zalan Bujtas.

        Add operator<<(TextStream&) for RenderLayer and RenderLayer backing, and use them for compositing logging.

        Convert CompositingUpdateType to an enum class.

        * page/FrameView.cpp:
        (WebCore::FrameView::updateCompositingLayersAfterLayout):
        (WebCore::FrameView::updateCompositingLayersAfterScrolling):
        * page/ios/FrameIOS.mm:
        (WebCore::Frame::viewportOffsetChanged):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
        (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/RenderLayer.h:
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateAfterLayout):
        (WebCore::RenderLayerBacking::updateGeometry):
        (WebCore::operator<<):
        * rendering/RenderLayerBacking.h:
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
        (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
        (WebCore::RenderLayerCompositor::updateCompositingLayersTimerFired):
        (WebCore::RenderLayerCompositor::updateCompositingLayers):
        (WebCore::RenderLayerCompositor::layerTreeAsText):
        (WebCore::operator<<):
        * rendering/RenderLayerCompositor.h:

2017-08-16  Eric Carlson  <eric.carlson@apple.com>

        Consider allow gUM to be called from localhost without https
        https://bugs.webkit.org/show_bug.cgi?id=173457
        <rdar://problem/33900527>

        Reviewed by Youenn Fablet.

        Tests: http/tests/media/media-stream/get-user-media-localhost.html
               http/tests/media/media-stream/get-user-media-loopback-ip.html

        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::isSecure): Call SchemeRegistry::shouldTreatURLSchemeAsSecure instead of looking for
        the string 'https'.
        (WebCore::canCallGetUserMedia): Allow localhost or loopback address.

        * page/SecurityOrigin.cpp:
        (WebCore::isLoopbackIPAddress): Add a comment.
        (WebCore::shouldTreatAsPotentionallyTrustworthy): Move tests for localhost and loopback address
        to isLocalHostOrLoopbackIPAddress, call it.
        (WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress): 
        * page/SecurityOrigin.h:

2017-08-16  Chris Dumez  <cdumez@apple.com>

        EventSource: ignore IDs with U+0000
        https://bugs.webkit.org/show_bug.cgi?id=175178

        Reviewed by Darin Adler.

        EventSource: ignore IDs with U+0000 as per:
        https://github.com/whatwg/html/pull/2849

        Test: imported/w3c/web-platform-tests/eventsource/format-field-id-null.htm

        * page/EventSource.cpp:
        (WebCore::EventSource::parseEventStreamLine):

2017-08-16  Fujii Hironori  <Hironori.Fujii@sony.com>

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

        Reviewed by Michael Catanzaro.

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

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

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

2017-08-16  Antti Koivisto  <antti@apple.com>

        Move first-letter renderer mutation code out of RenderBlock and into RenderTreeUpdater
        https://bugs.webkit.org/show_bug.cgi?id=175627

        Reviewed by Andreas Kling.

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

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

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

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

2017-08-16  Xabier Rodriguez Calvar  <calvaris@igalia.com>

        [GStreamer][EME] Rework handling key systems and UUIDs
        https://bugs.webkit.org/show_bug.cgi?id=175567

        Reviewed by Žan Doberšek.

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

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

2017-08-16  Andy Estes  <aestes@apple.com>

        [Payment Request] Add an ENABLE flag and an experimental feature preference
        https://bugs.webkit.org/show_bug.cgi?id=175622

        Reviewed by Tim Horton.

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

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

        Make DataTransferItemList work with plain text entries
        https://bugs.webkit.org/show_bug.cgi?id=175596

        Reviewed by Wenson Hsieh.

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

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

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

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

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

2017-08-15  Simon Fraser  <simon.fraser@apple.com>

        Remove ScrollView::clipsRepaints() which was only used by Chromium
        https://bugs.webkit.org/show_bug.cgi?id=175594

        Reviewed by Tim Horton.

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

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

2017-08-15  Simon Fraser  <simon.fraser@apple.com>

        Allow WebCore logging channels to be set from the UI process
        https://bugs.webkit.org/show_bug.cgi?id=175608

        Reviewed by Tim Horton.

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

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

2017-08-15  Chris Dumez  <cdumez@apple.com>

        Fetch / Beacon: Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView
        https://bugs.webkit.org/show_bug.cgi?id=175600

        Reviewed by Youenn Fablet.

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

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

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

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

2017-08-15  Robin Morisset  <rmorisset@apple.com>

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

        Reviewed by Saam Barati.

        No change of behavior.

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

2017-08-15  Youenn Fablet  <youenn@apple.com>

        [Cache API] Ensure ResourceResponse is not null when redirected/tainting/type fields are set
        https://bugs.webkit.org/show_bug.cgi?id=175538

        Reviewed by Chris Dumez.

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

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

2017-08-15  Chris Dumez  <cdumez@apple.com>

        Update CachedResourceLoader::requestResource() to return a WTF::Expected
        https://bugs.webkit.org/show_bug.cgi?id=175505

        Reviewed by Youenn Fablet.

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

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

2017-08-15  Don Olmstead  <don.olmstead@sony.com>

        [PAL] Move Sleep classes into PAL
        https://bugs.webkit.org/show_bug.cgi?id=175456

        Reviewed by Ryosuke Niwa.

        No new tests. No change in behavior.

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

2017-08-15  Youenn Fablet  <youenn@apple.com>

        [Cache API] Adding generic support for CacheStorage and Cache methods
        https://bugs.webkit.org/show_bug.cgi?id=175455

        Reviewed by Chris Dumez.

        Covered by existing tests.

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

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

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

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

2017-08-15  Chris Dumez  <cdumez@apple.com>

        Implement quota limitation for keepalive Fetch requests
        https://bugs.webkit.org/show_bug.cgi?id=175482

        Reviewed by Sam Weinig and Youenn Fablet.

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

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

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

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

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

2017-08-15  Darin Adler  <darin@apple.com>

        REGRESSION(r220052): http/tests/appcache/deferred-events-delete-while-raising-timer.html is crashing.
        https://bugs.webkit.org/show_bug.cgi?id=175107

        Reviewed by Alexey Proskuryakov.

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

2017-08-15  Commit Queue  <commit-queue@webkit.org>

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

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

        Reverted changeset:

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

2017-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: handle click events on option elements
        https://bugs.webkit.org/show_bug.cgi?id=174710
        <rdar://problem/33459305>

        Reviewed by Brian Burg.

        Export WebCore symbols required by WebKit layer.

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

2017-08-14  Simon Fraser  <simon.fraser@apple.com>

        Remove Proximity Events and related code
        https://bugs.webkit.org/show_bug.cgi?id=175545

        Reviewed by Daniel Bates.

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

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

2017-08-14  Simon Fraser  <simon.fraser@apple.com>

        Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
        https://bugs.webkit.org/show_bug.cgi?id=175504

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

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

2017-08-14  Chris Dumez  <cdumez@apple.com>

        XHR should only fire an abort event if the cancellation was requested by the client
        https://bugs.webkit.org/show_bug.cgi?id=175546

        Reviewed by Youenn Fablet.

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

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

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

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

2017-08-14  Simon Fraser  <simon.fraser@apple.com>

        Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code
        https://bugs.webkit.org/show_bug.cgi?id=175557

        Reviewed by Jon Lee.

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

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

2017-08-14  Myles C. Maxfield  <mmaxfield@apple.com>

        Parse font-display
        https://bugs.webkit.org/show_bug.cgi?id=175382

        Reviewed by Simon Fraser.

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

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

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

2017-08-14  Jer Noble  <jer.noble@apple.com>

        Obj-C exception crash in AVStreamSession when using EME in Private Browsing mode
        https://bugs.webkit.org/show_bug.cgi?id=175547

        Reviewed by Eric Carlson.

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

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

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

2017-08-14  Andy Estes  <aestes@apple.com>

        REGRESSION (r220456): Crash in PreviewLoader::shouldCreateForMIMEType() when a ResourceResponse has a null MIME type
        https://bugs.webkit.org/show_bug.cgi?id=175548
        <rdar://problem/33866206>

        Reviewed by Brady Eidson.

        New API test: QuickLook.ShouldCreateForMIMEType

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

2017-08-14  Andy Estes  <aestes@apple.com>

        [Apple Pay] Add support for phonetic contact names
        https://bugs.webkit.org/show_bug.cgi?id=175537
        <rdar://problem/32002644>

        Reviewed by Tim Horton.

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

2017-08-14  Said Abou-Hallawa  <sabouhallawa@apple.com>

        The none smooth stroke applied to an SVG shape breaks its hit testing
        https://bugs.webkit.org/show_bug.cgi?id=175506

        Reviewed by Simon Fraser.

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

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

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

2017-08-14  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE] Implement WebCore::standardUserAgent()
        https://bugs.webkit.org/show_bug.cgi?id=175507

        Reviewed by Michael Catanzaro.

        Remove "_GLIB" from user-agent version macros.

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

2017-08-14  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rollout r220622 & r220696
        https://bugs.webkit.org/show_bug.cgi?id=175482
        <rdar://problem/33860695>

        Seems to have caused failures on iOS.

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

2017-08-14  Daniel Bates  <dabates@apple.com>

        [css-ui] Implement caret-color support
        https://bugs.webkit.org/show_bug.cgi?id=166572
        <rdar://problem/33852589>

        Reviewed by David Hyatt.

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

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

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

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

2017-08-14  Zan Dobersek  <zdobersek@igalia.com>

        REGRESSION(r220517-r220521) [GTK] Various compositing tests fail
        https://bugs.webkit.org/show_bug.cgi?id=175478

        Reviewed by Sergio Villar Senin.

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

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

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

2017-08-14  Chris Dumez  <cdumez@apple.com>

        Unreviewed fix after r220622 to address crashes on iOS.

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

2017-08-14  Antti Koivisto  <antti@apple.com>

        Factor text autosizing into a class
        https://bugs.webkit.org/show_bug.cgi?id=175530

        Reviewed by Andreas Kling.

        Move the remaining parts out of Document.

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

2017-08-14  Antti Koivisto  <antti@apple.com>

        [Render Tree Mutation] First letter should not mutate the render tree while in layout.
        https://bugs.webkit.org/show_bug.cgi?id=163848

        Reviewed by Zalan Bujtas.

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

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

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

            No more updateFirstLetter calls during layout...

        (WebCore::RenderBlock::computePreferredLogicalWidths):

            ...or preferred width computation.

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

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

2017-08-13  Manuel Rego Casasnovas  <rego@igalia.com>

        Composition underline color is always black
        https://bugs.webkit.org/show_bug.cgi?id=174675

        Reviewed by Ryosuke Niwa.

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

        Test: editing/composition-underline-color.html

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

2017-08-13  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] stop kinetic scrolling when a zero movement is reached
        https://bugs.webkit.org/show_bug.cgi?id=175468

        Reviewed by Michael Catanzaro.

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

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

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

2017-08-13  Chris Dumez  <cdumez@apple.com>

        Drop non-const getter for CachedResource::resourceRequest()
        https://bugs.webkit.org/show_bug.cgi?id=175524

        Reviewed by Youenn Fablet.

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

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

2017-08-13  Adrian Perez de Castro  <aperez@igalia.com>

        [WPE] Implement WebCore::standardUserAgent()
        https://bugs.webkit.org/show_bug.cgi?id=175507

        Reviewed by Carlos Alberto Lopez Perez.

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

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

2017-08-11  Ryosuke Niwa  <rniwa@webkit.org>

        Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
        https://bugs.webkit.org/show_bug.cgi?id=175474
        <rdar://problem/33844628>

        Reviewed by Wenson Hsieh.

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

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

        Tests: editing/pasteboard/datatransfer-idl.html

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

2017-08-11  Brady Eidson  <beidson@apple.com>

        Move files inside WebCore/workers to WebCore/workers/service.
        https://bugs.webkit.org/show_bug.cgi?id=175495

        Rubberstamped by Tim Horton.

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

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

2017-08-11  Chris Dumez  <cdumez@apple.com>

        Implement quota limitation for keepalive Fetch requests
        https://bugs.webkit.org/show_bug.cgi?id=175482

        Reviewed by Sam Weinig and Youenn Fablet.

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

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

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

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

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

2017-08-11  Don Olmstead  <don.olmstead@sony.com>

        [WTF] Move ValueToString into WTF
        https://bugs.webkit.org/show_bug.cgi?id=175469

        Reviewed by Sam Weinig.

        No new tests. No change in behavior.

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

2017-08-11  Sam Weinig  <sam@webkit.org>

        [Bindings] Simplify DOMPromiseProxy now that WTF::Function can return references
        https://bugs.webkit.org/show_bug.cgi?id=175394

        Reviewed by Chris Dumez.

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

            Remove no longer used convertToParameterType.

        * bindings/js/DOMPromiseProxy.h:

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

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

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

2017-08-11  Sam Weinig  <sam@webkit.org>

        [WebIDL] Replace JSCryptoKeyCustom and JSCryptoAlgorithmBuilder with generated code
        https://bugs.webkit.org/show_bug.cgi?id=175457

        Reviewed by Chris Dumez.

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

            Remove JSCryptoAlgorithmBuilder and JSCryptoKeyCustom, add KeyAlgorithm
            IDLs and headers.

        * crypto/CryptoKey.cpp:
        * crypto/CryptoKey.h:
        * crypto/CryptoKey.idl:
        
            Replace custom algorithm attribute with a union of the supported key algorithms.
        
        * crypto/keys/CryptoAesKeyAlgorithm.h: Added.
        * crypto/keys/CryptoAesKeyAlgorithm.idl: Added.
        * crypto/keys/CryptoEcKeyAlgorithm.h: Added.
        * crypto/keys/CryptoEcKeyAlgorithm.idl: Added.
        * crypto/keys/CryptoHmacKeyAlgorithm.h: Added.
        * crypto/keys/CryptoHmacKeyAlgorithm.idl: Added.
        * crypto/keys/CryptoKeyAlgorithm.h: Added.
        * crypto/keys/CryptoKeyAlgorithm.idl: Added.
        * crypto/keys/CryptoRsaHashedKeyAlgorithm.h: Added.
        * crypto/keys/CryptoRsaHashedKeyAlgorithm.idl: Added.
        * crypto/keys/CryptoRsaKeyAlgorithm.h: Added.
        * crypto/keys/CryptoRsaKeyAlgorithm.idl: Added.

            Add IDLs and headers fo the supported key algorithms.

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

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

2017-08-11  Simon Fraser  <simon.fraser@apple.com>

        Some RenderSVGResource cleanup
        https://bugs.webkit.org/show_bug.cgi?id=175494

        Reviewed by Zalan Bujtas.

        Use more initializers. Remove spurious use of bitfields that didn't save any space at all.
        0 -> nullptr.

        No behavior change.

        * rendering/svg/RenderSVGResourceContainer.cpp:
        (WebCore::RenderSVGResourceContainer::RenderSVGResourceContainer):
        * rendering/svg/RenderSVGResourceContainer.h:
        * rendering/svg/RenderSVGResourceGradient.cpp:
        (WebCore::RenderSVGResourceGradient::RenderSVGResourceGradient):
        (WebCore::RenderSVGResourceGradient::applyResource):
        * rendering/svg/RenderSVGResourceGradient.h:
        * rendering/svg/RenderSVGResourcePattern.cpp:
        (WebCore::RenderSVGResourcePattern::RenderSVGResourcePattern):
        * rendering/svg/RenderSVGResourcePattern.h:
        * rendering/svg/RenderSVGShape.cpp:
        (WebCore::RenderSVGShape::fillShape):
        (WebCore::RenderSVGShape::strokeShape):
        * rendering/svg/SVGRenderingContext.cpp:
        (WebCore::SVGRenderingContext::~SVGRenderingContext):
        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
        * rendering/svg/SVGRenderingContext.h:
        (WebCore::SVGRenderingContext::SVGRenderingContext):

2017-08-11  Tim Horton  <timothy_horton@apple.com>

        Fix the build with modern Clang's -Wexpansion-to-defined
        https://bugs.webkit.org/show_bug.cgi?id=175467
        <rdar://problem/33667497>

        Reviewed by Simon Fraser.

        * crypto/mac/SerializedCryptoKeyWrapMac.mm:

2017-08-11  Brady Eidson  <beidson@apple.com>

        Crash under ServiceWorkerJob::failedWithException.
        https://bugs.webkit.org/show_bug.cgi?id=175488

        Reviewed by Tim Horton.

        Covered by existing tests.

        * workers/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::failedWithException): jobDidFinish might cause the Job to be deleted, so make it last.

2017-08-10  Sam Weinig  <sam@webkit.org>

        WTF::Function does not allow for reference / non-default constructible return types
        https://bugs.webkit.org/show_bug.cgi?id=175244

        Reviewed by Chris Dumez.

        * bindings/js/JSCustomElementInterface.h:
        (WebCore::JSCustomElementInterface::invokeCallback):
        Update the default value for the addArguments parameter to be an empty lambda, rather than
        default initialization, which leads to a null WTF::Function. This allows us to remove support
        for calling null WTF::Function. No change in behavior.

2017-08-11  Antti Koivisto  <antti@apple.com>

        Remove RenderQuote collection from RenderView
        https://bugs.webkit.org/show_bug.cgi?id=175479

        Reviewed by Andreas Kling.

        We can do it well enough without maintaining this pointer structure.

        Global updating doesn't work well with future direction for first-letter and similar anyway.
        We need to update quote immediately when updating its style.

        * rendering/RenderQuote.cpp:
        (WebCore::RenderQuote::insertedIntoTree):
        (WebCore::RenderQuote::willBeRemovedFromTree):

            Just tell the view that there are renderers to update.

        (WebCore::RenderQuote::styleDidChange):
        (WebCore::RenderQuote::isOpen const):
        (WebCore::RenderQuote::updateRenderer):
        (WebCore::RenderQuote::updateRenderers): Deleted.

            Update single renderer only. RenderTreeUpdater provides the previous renderer to compute the depth.

        * rendering/RenderQuote.h:
        * rendering/RenderView.cpp:
        (WebCore::RenderView::registerQuote): Deleted.
        (WebCore::RenderView::unregisterQuote): Deleted.
        (WebCore::RenderView::updateSpecialRenderers): Deleted.

            Remove the quote list.

        * rendering/RenderView.h:
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::commit):

            Ensure that all quotes are updated.

        (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
        (WebCore::RenderTreeUpdater::updateQuotesUpTo):

            Traverse render tree to find quotes to update starting from the previous updated quote.

        * style/RenderTreeUpdater.h:

2017-08-11  Adrian Perez de Castro  <aperez@igalia.com>

        [CMake] Many warning about missing “override” keywords in ANGLE with Clang
        https://bugs.webkit.org/show_bug.cgi?id=175475

        Reviewed by Michael Catanzaro.

        * CMakeLists.txt: Add "-Wno-inconsistent-missing-override" to the
        compiler flags using for building the ANGLE sources.

2017-08-11  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][WPE] Overriden virtual function not marked “override” in ImageBufferDataCairo.h
        https://bugs.webkit.org/show_bug.cgi?id=175476

        Reviewed by Carlos Garcia Campos.

        * platform/graphics/cairo/ImageBufferDataCairo.h: Add missing "override" qualifier.

2017-08-11  Carlos Garcia Campos  <cgarcia@igalia.com>

        [Soup] Cannot access HTTPS sites using a HTTP proxy that requires authentication
        https://bugs.webkit.org/show_bug.cgi?id=175378

        Reviewed by Sergio Villar Senin.

        Bring back part of the code removed in r206732, to keep a reference to the SoupMessage in the
        AuthenticationChallenge since it can be different to the resource message.

        * platform/network/soup/AuthenticationChallenge.h:
        (WebCore::AuthenticationChallenge::AuthenticationChallenge): Deleted.
        (WebCore::AuthenticationChallenge::authenticationClient const): Deleted.
        (WebCore::AuthenticationChallenge::soupAuth const): Deleted.
        (WebCore::AuthenticationChallenge::setProposedCredential): Deleted.
        * platform/network/soup/AuthenticationChallengeSoup.cpp:
        (WebCore::AuthenticationChallenge::AuthenticationChallenge):
        (WebCore::AuthenticationChallenge::platformCompare):

2017-08-10  Dan Bernstein  <mitz@apple.com>

        Fixed building for macOS 10.12 with the macOS 10.13 SDK.

        Suppressed the unguarded-availability-new warning around uses of AVSampleBufferAudioRenderer
        and AVSampleBufferRenderSynchronizer. Even though the 10.13 SDK declares them as available
        starting in that release, they have been available as SPI earlier.

        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
        (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
        (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
        (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
        (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
        (WebCore::SourceBufferPrivateAVFObjC::flush):

2017-08-10  Brady Eidson  <beidson@apple.com>

        Rename the source files for the WTF persistent coders.
        https://bugs.webkit.org/show_bug.cgi?id=175441

        Reviewed by Tim Horton.

        * platform/network/NetworkLoadMetrics.h:

2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>

        Make ThreadGlobalData RefCounted for web thread
        https://bugs.webkit.org/show_bug.cgi?id=175439

        Reviewed by Mark Lam.

        When the web thread is enabled, we share ThreadGlobalData between the web thread and the main thread.
        The problem happens when the main thread is dying. It could start deallocating TLS and the web
        thread may see the destructed ThreadGlobalData.

        Even though, the current implementation is safe because the main thread do not perform TLS deallocation
        in the Darwin environment. But this is not true in Windows. And we should not rely on this condition
        that depends on the platforms.

        In this patch, we make ThreadGlobalData ThreadSafeRefCounted. This type verbosely describes that
        ThreadGlobalData could be shared between threads when the web thread enabled. And make the life time
        management simple instead of relying on the platform dependent TLS implementation.

        * platform/ThreadGlobalData.cpp:
        (WebCore::ThreadGlobalData::setWebCoreThreadData):
        (WebCore::threadGlobalData):
        * platform/ThreadGlobalData.h:
        (WebCore::ThreadGlobalData::cachedResourceRequestInitiators): Deleted.
        (WebCore::ThreadGlobalData::eventNames): Deleted.
        (WebCore::ThreadGlobalData::threadTimers): Deleted.
        (WebCore::ThreadGlobalData::qualifiedNameCache): Deleted.
        (WebCore::ThreadGlobalData::cachedConverterICU): Deleted.
        (WebCore::ThreadGlobalData::cachedConverterTEC): Deleted.

2017-08-10  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Use @toNumber in builtins
        https://bugs.webkit.org/show_bug.cgi?id=172692

        Reviewed by Sam Weinig.

        Use @toNumber bytecode intrinsic. It emits op_to_number, which efficiently converts
        a given argument to a number.

        * Modules/streams/ReadableByteStreamInternals.js:
        (privateInitializeReadableByteStreamController):
        (readableByteStreamControllerRespond):
        * Modules/streams/StreamInternals.js:
        (validateAndNormalizeQueuingStrategy):
        (enqueueValueWithSize):

2017-08-10  Nan Wang  <n_wang@apple.com>

        AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24
        https://bugs.webkit.org/show_bug.cgi?id=175340
        <rdar://problem/33782159>

        Reviewed by Chris Fleizach.

        The issue here is that we manualy set the parent object of the AccessibilitySVGRoot object
        and there are chances that the parent doesn't detach it properly during the parent's destroying
        process. Accessing the stale parent object will lead to a crash.
        Fixed this by making the parent object a weak pointer so we don't access an invalid memory. 

        Test: accessibility/add-children-pseudo-element.html

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
        * accessibility/AccessibilityRenderObject.h:
        (WebCore::AccessibilityRenderObject::createWeakPtr):
        * accessibility/AccessibilitySVGRoot.cpp:
        (WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot):
        (WebCore::AccessibilitySVGRoot::setParent):
        (WebCore::AccessibilitySVGRoot::parentObject const):
        * accessibility/AccessibilitySVGRoot.h:

2017-08-10  Chris Dumez  <cdumez@apple.com>

        [Beacon] Do connect-src CSP check on redirects as well
        https://bugs.webkit.org/show_bug.cgi?id=175410
        <rdar://problem/33815470>

        Reviewed by Youenn Fablet.

        Pass ContentSecurityPolicy object to createPingHandle so that we can send
        enough data to the NetworkProcess so do CSP checks for Ping loads such
        as Beacon. For the IPC, we serialize the ContentSecurityPolicy's response
        headers. Those headers are now cached in ContentSecurityPolicy for
        performance reasons. CSP headers are rarely updated in practice but
        sendBeacon() may get called repeatedly for a given document.

        Tests: http/wpt/beacon/connect-src-beacon-redirect-allowed.sub.html
               http/wpt/beacon/connect-src-beacon-redirect-blocked.sub.html

        * loader/LoaderStrategy.h:
        * loader/PingLoader.cpp:
        (WebCore::PingLoader::loadImage):
        (WebCore::PingLoader::sendPing):
        (WebCore::PingLoader::sendViolationReport):
        (WebCore::PingLoader::startPingLoad):
        * loader/PingLoader.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load):
        * page/csp/ContentSecurityPolicy.cpp:
        (WebCore::ContentSecurityPolicy::responseHeaders const):
        (WebCore::ContentSecurityPolicy::didReceiveHeader):
        * page/csp/ContentSecurityPolicy.h:
        * page/csp/ContentSecurityPolicyResponseHeaders.h:
        (WebCore::ContentSecurityPolicyResponseHeaders::encode const):
        (WebCore::ContentSecurityPolicyResponseHeaders::decode):

2017-08-09  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] ThreadSpecific should not introduce additional indirection
        https://bugs.webkit.org/show_bug.cgi?id=175187

        Reviewed by Mark Lam.

        We drop ThreadSpecific::replace feature which is only used by
        Web thread. Instead, we use ThreadSpecific<std::unique_ptr<T>> here.

        While this std::unique_ptr<T> shares one instance between main thread
        and web thread, this is the same to the current implementation. It is
        safe because the web thread never finishes.

        And for non-web thread implementation, we just use ThreadSpecific<T>,
        since it is the most efficient.

        * platform/ThreadGlobalData.cpp:
        (WebCore::ThreadGlobalData::ThreadGlobalData):
        (WebCore::ThreadGlobalData::setWebCoreThreadData):
        (WebCore::threadGlobalData):
        We also drop StringImpl::empty() call since it is not necessary now:
        StringImpl::empty data is statically initialized by using constexpr.

        * platform/ThreadGlobalData.h:
        We make it FAST_ALLOCATED since it is previously allocated by fast malloc
        in ThreadSpecific.

2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>

        REGRESSION(r220515) [GTK][CMake] Build with ENABLE_GEOLOCATION fails on Debian Jessie
        https://bugs.webkit.org/show_bug.cgi?id=175426

        Reviewed by Carlos Alberto Lopez Perez.

        Also stop using GEOCLUE_LIBRARIES and GEOCLUE_INCLUDE_DIRS, since they are empty. Apparently
        we have not actually been using the client library at all this whole time, only the D-Bus
        interface.

        * PlatformGTK.cmake:

2017-08-10  Brady Eidson  <beidson@apple.com>

        Add ServiceWorkerJob.
        https://bugs.webkit.org/show_bug.cgi?id=175241

        Reviewed by Tim Horton.

        Test: http/tests/workers/service/basic-register.html

        This patch does a few things:
        - Adds the spec concept of a ServiceWorkerJob (in the WebProcess, at least)
        - Adds a ServiceWorkerProvider interface for WebKit to implement
        - Actually creates a job for service worker registration and "schedules" it,
          though it always immediately errors out the promise.

        Actually queuing jobs and executing asynchronously is coming up soon.

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

        * dom/Document.cpp:
        (WebCore::Document::sessionID const):
        * dom/Document.h:

        * workers/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::scheduleJob):
        (WebCore::ServiceWorkerContainer::jobDidFinish):
        * workers/ServiceWorkerContainer.h:

        * workers/ServiceWorkerJob.cpp: Added.
        (WebCore::ServiceWorkerJob::ServiceWorkerJob):
        (WebCore::ServiceWorkerJob::~ServiceWorkerJob):
        (WebCore::ServiceWorkerJob::failedWithException):
        * workers/ServiceWorkerJob.h: Copied from Source/WebCore/workers/ServiceWorkerContainer.h.
        (WebCore::ServiceWorkerJob::createRegisterJob):
        (WebCore::ServiceWorkerJob::identifier const):

        * workers/ServiceWorkerJobClient.h: Added.
        (WebCore::ServiceWorkerJobClient::~ServiceWorkerJobClient):

        * workers/ServiceWorkerProvider.cpp: Added.
        (WebCore::ServiceWorkerProvider::singleton):
        (WebCore::ServiceWorkerProvider::setSharedProvider):
        * workers/ServiceWorkerProvider.h: Added.
        * workers/ServiceWorkerRegistrationOptions.h: Copied from Source/WebCore/workers/ServiceWorkerContainer.h.
        * workers/ServiceWorkerRegistrationParameters.cpp: Added.
        * workers/ServiceWorkerRegistrationParameters.h: Added.

2017-08-10  Tim Horton  <timothy_horton@apple.com>

        Remove some unused lambda captures so that WebKit builds with -Wunused-lambda-capture
        https://bugs.webkit.org/show_bug.cgi?id=175436
        <rdar://problem/33667497>

        Reviewed by Simon Fraser.

        * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
        (PlatformMediaSessionManager::updateSessionState):
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):

2017-08-10  Commit Queue  <commit-queue@webkit.org>

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

        unaccepted fix (Requested by n_wang on #webkit).

        Reverted changeset:

        "AX: crash at
        WebCore::AccessibilityObject::supportsARIALiveRegion() const +
        24"
        https://bugs.webkit.org/show_bug.cgi?id=175340
        http://trac.webkit.org/changeset/220463

2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>

        Remove ENABLE_GAMEPAD_DEPRECATED
        https://bugs.webkit.org/show_bug.cgi?id=175361

        Reviewed by Carlos Garcia Campos.

        * CMakeLists.txt:
        * Configurations/FeatureDefines.xcconfig:
        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * platform/Linux.cmake: Removed.
        * platform/gamepad/deprecated/Gamepads.h: Removed.
        * platform/gamepad/glib/GamepadsGlib.cpp: Removed.
        * platform/gamepad/linux/GamepadDeviceLinux.cpp: Removed.
        * platform/gamepad/linux/GamepadDeviceLinux.h: Removed.

2017-08-10  Myles C. Maxfield  <mmaxfield@apple.com>

        Addressing post-review comments after r219173.
        https://bugs.webkit.org/show_bug.cgi?id=174149

        Unreviewed.

        * css/CSSFontStyleValue.h:
        * editing/EditingStyle.cpp:
        (WebCore::identifierForStyleProperty):

2017-08-10  Antti Koivisto  <antti@apple.com>

        Try to fix windows build.

        * style/StyleUpdate.h:
        (WebCore::Style::TextUpdate::TextUpdate):

2017-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Crashes in WebCore::PasteboardHelper::fillSelectionData when source file of drag is unavailable
        https://bugs.webkit.org/show_bug.cgi?id=174161

        Reviewed by Xabier Rodriguez-Calvar.

        In r219385 we changed the early return in fillSelectionData() to check the selection data length instead of the
        data pointer. However, the gtk_selection_data_get_length() can return -1, so we need to check also if the value
        less than 0. The case of setting an empty string could be valid depending on the target type, so it's better to
        return early only when data lenght is less than 0 and handle the 0 length case in each target.

        * platform/gtk/PasteboardHelper.cpp:
        (WebCore::PasteboardHelper::fillSelectionData):

2017-08-10  Antti Koivisto  <antti@apple.com>

        Text renderer updates should be done by RenderTreeUpdater
        https://bugs.webkit.org/show_bug.cgi?id=175417

        Reviewed by Andreas Kling.

        All render tree mutations should be done by RenderTreeUpdater. Currently
        Text::updateRendererAfterContentChange calls RenderText::setTextWithOffset directly.

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

            Add range argument.

        * dom/Document.h:
        * dom/Text.cpp:
        (WebCore::Text::updateRendererAfterContentChange):

            Remove call to setTextWithOffset and pass the range to updateTextRenderer

        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateRenderTree):
        (WebCore::RenderTreeUpdater::updateTextRenderer):

            Call setTextWithOffset here.

        * style/RenderTreeUpdater.h:
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::resolveComposedTree):
        * style/StyleUpdate.cpp:
        (WebCore::Style::Update::textUpdate const):
        (WebCore::Style::Update::addText):

            Add TextUpdate struct similar to ElementUpdate to pass the range to the RenderTreeUpdater.

        * style/StyleUpdate.h:

2017-08-10  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed GTK+ build fix for ENABLE_GLES2=ON.

        * platform/graphics/texmap/TextureMapperGLHeaders.h:
        Define various GL constants that are not provided in GLES2 headers
        but are only leveraged in OpenGL calls if at runtime the underlying
        OpenGL is GLES2-capable.

2017-08-10  Zan Dobersek  <zdobersek@igalia.com>

        [TexMap] Remove GraphicsContext3D usage from BitmapTexturePool
        https://bugs.webkit.org/show_bug.cgi?id=175319

        Reviewed by Carlos Garcia Campos.

        Drop the GraphicsContext3D reference in BitmapTexturePool now
        that the BitmapTextureGL doesn't require it anymore.

        No new tests -- no change in behavior.

        * platform/graphics/texmap/BitmapTexturePool.cpp:
        (WebCore::BitmapTexturePool::BitmapTexturePool):
        * platform/graphics/texmap/BitmapTexturePool.h:
        * platform/graphics/texmap/TextureMapperGL.cpp:
        (WebCore::TextureMapperGL::TextureMapperGL):

2017-08-10  Zan Dobersek  <zdobersek@igalia.com>

        [TexMap] Drop GraphicsContext3D usage from BitmapTextureGL
        https://bugs.webkit.org/show_bug.cgi?id=175317

        Reviewed by Carlos Garcia Campos.

        Have BitmapTextureGL use direct OpenGL API entrypoints and constants
        instead of leveraging the GraphicsContext3D class. Any GraphicsContext3D
        object passed to BitmapTextureGL would assume rendering to the GL context
        that's current on that thread, translating method invocations to the
        OpenGL API. We can do this by ourselves and benefit by avoiding allocating
        GraphicsContext3D resources like the ANGLE compiler that are by most useful
        for WebGL.

        BitmapTextureGL::create() call sites are adjusted to stop passing a
        GraphicsContext3D reference. BitmapTextureGL::bindAsSurface() doesn't need
        a replacement for the passed-in GraphicsContext3D object since that object
        originated from the TextureMapperGL instance, whose GraphicsContext3D is by
        default of the render-to-current-context nature. Other changes are direct
        translations of GraphicsContext3D methods to OpenGL API calls, or of
        GraphicsContext3D values to OpenGL API constants.

        No new tests -- no change in behavior.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
        * platform/graphics/texmap/BitmapTextureGL.cpp:
        Also remove an unnecessary GraphicsContext.h header inclusion.
        (WebCore::BitmapTextureGL::BitmapTextureGL):
        (WebCore::BitmapTextureGL::didReset):
        (WebCore::BitmapTextureGL::updateContentsNoSwizzle):
        (WebCore::BitmapTextureGL::updateContents):
        (WebCore::BitmapTextureGL::initializeStencil):
        (WebCore::BitmapTextureGL::initializeDepthBuffer):
        (WebCore::BitmapTextureGL::clearIfNeeded):
        (WebCore::BitmapTextureGL::createFboIfNeeded):
        (WebCore::BitmapTextureGL::bindAsSurface):
        (WebCore::BitmapTextureGL::~BitmapTextureGL):
        (WebCore::BitmapTextureGL::copyFromExternalTexture):
        * platform/graphics/texmap/BitmapTextureGL.h:
        (WebCore::BitmapTextureGL::create):
        (WebCore::BitmapTextureGL::textureTarget const):
        (WebCore::BitmapTextureGL::internalFormat const):
        * platform/graphics/texmap/BitmapTexturePool.cpp:
        (WebCore::BitmapTexturePool::createTexture):
        * platform/graphics/texmap/TextureMapperGL.cpp:
        (WebCore::TextureMapperGL::bindSurface):
        (WebCore::TextureMapperGL::createTexture):

2017-08-09  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Remove support for geoclue1
        https://bugs.webkit.org/show_bug.cgi?id=164205

        Reviewed by Carlos Garcia Campos.

        * PlatformGTK.cmake:
        * platform/geoclue/GeolocationProviderGeoclue.h:
        * platform/geoclue/GeolocationProviderGeoclue1.cpp: Removed.
        * platform/geoclue/GeolocationProviderGeoclue2.cpp: Removed.

2017-08-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        [PAL] Move spi/cocoa and spi/cg directories into PAL
        https://bugs.webkit.org/show_bug.cgi?id=175175

        Reviewed by Myles C. Maxfield.

        * Modules/applepay/cocoa/PaymentCocoa.mm:
        * Modules/applepay/cocoa/PaymentContactCocoa.mm:
        * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
        * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
        * PlatformAppleWin.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * editing/cocoa/EditorCocoa.mm:
        * editing/cocoa/HTMLConverter.mm:
        * editing/ios/EditorIOS.mm:
        * page/cocoa/ResourceUsageThreadCocoa.mm:
        * page/mac/TextIndicatorWindow.mm:
        * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
        * platform/cocoa/DataDetectorsCoreSoftLink.h:
        * platform/cocoa/MIMETypeRegistryCocoa.mm:
        * platform/cocoa/NetworkExtensionContentFilter.mm:
        * platform/cocoa/ParentalControlsContentFilter.mm:
        * platform/cocoa/SleepDisablerCocoa.cpp:
        * platform/graphics/Font.cpp:
        * platform/graphics/Font.h:
        * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
        * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
        * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
        * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        * platform/graphics/cg/ColorCG.cpp:
        * platform/graphics/cg/GraphicsContextCG.cpp:
        * platform/graphics/cg/ImageBufferCG.cpp:
        * platform/graphics/cg/ImageBufferDataCG.cpp:
        * platform/graphics/cg/ImageDecoderCG.cpp:
        * platform/graphics/cg/NativeImageCG.cpp:
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        * platform/graphics/cocoa/FontCascadeCocoa.mm:
        * platform/graphics/cocoa/FontCocoa.mm:
        * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
        * platform/graphics/cocoa/IOSurface.mm:
        * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
        * platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h:
        * platform/graphics/ios/FontAntialiasingStateSaver.h:
        * platform/graphics/ios/FontCacheIOS.mm:
        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
        * platform/graphics/mac/FontCacheMac.mm:
        * platform/graphics/mac/GlyphPageMac.cpp:
        * platform/graphics/win/FontCacheWin.cpp:
        * platform/ios/LegacyTileCache.mm:
        * platform/ios/LegacyTileGrid.mm:
        * platform/ios/LegacyTileGridTile.mm:
        * platform/ios/PlaybackSessionInterfaceAVKit.mm:
        * platform/ios/QuickLook.mm:
        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
        * platform/ios/WebAVPlayerController.h:
        * platform/ios/WebAVPlayerController.mm:
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        * platform/ios/wak/WKGraphics.mm:
        * platform/mac/DragImageMac.mm:
        * platform/mac/PlatformScreenMac.mm:
        * platform/mac/PlaybackSessionInterfaceMac.mm:
        * platform/mac/ThemeMac.mm:
        * platform/mac/VideoFullscreenInterfaceMac.mm:
        * platform/mac/WebPlaybackControlsManager.h:
        * platform/mac/WebVideoFullscreenHUDWindowController.mm:
        * platform/network/cocoa/CookieStorageObserver.mm:
        * platform/network/cocoa/NetworkLoadMetrics.mm:
        * platform/network/mac/AuthenticationMac.mm:
        * platform/network/mac/ResourceHandleMac.mm:
        * platform/spi/ios/DataDetectorsUISPI.h:
        * platform/spi/mac/DataDetectorsSPI.h:
        * platform/spi/mac/NSViewSPI.h:
        * rendering/RenderThemeCocoa.mm:
        * rendering/RenderThemeIOS.mm:
        * rendering/RenderThemeMac.mm:

2017-08-09  Don Olmstead  <don.olmstead@sony.com>

        [WTF] Move TextStream into WTF
        https://bugs.webkit.org/show_bug.cgi?id=175211

        Reviewed by Myles C. Maxfield.

        No new tests. No change in behavior.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/ComposedTreeIterator.cpp:
        * dom/Position.cpp:
        * dom/Position.h:
        * dom/Range.cpp:
        (WebCore::operator<<):
        * dom/Range.h:
        * dom/ViewportArguments.cpp:
        * dom/ViewportArguments.h:
        * editing/VisiblePosition.cpp:
        * editing/VisiblePosition.h:
        * editing/VisibleSelection.cpp:
        * editing/VisibleSelection.h:
        * html/HTMLVideoElement.cpp:
        * html/canvas/CanvasRenderingContext2D.cpp:
        * page/FrameView.cpp:
        * page/ViewportConfiguration.cpp:
        * page/ViewportConfiguration.h:
        * page/WheelEventDeltaFilter.cpp:
        * page/animation/CSSPropertyAnimation.cpp:
        * page/scrolling/AsyncScrollingCoordinator.cpp:
        * page/scrolling/ScrollingConstraints.cpp:
        * page/scrolling/ScrollingConstraints.h:
        * page/scrolling/ScrollingCoordinator.cpp:
        * page/scrolling/ScrollingCoordinator.h:
        * page/scrolling/ScrollingStateFixedNode.cpp:
        * page/scrolling/ScrollingStateFixedNode.h:
        * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
        * page/scrolling/ScrollingStateFrameScrollingNode.h:
        * page/scrolling/ScrollingStateNode.cpp:
        * page/scrolling/ScrollingStateNode.h:
        * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
        * page/scrolling/ScrollingStateOverflowScrollingNode.h:
        * page/scrolling/ScrollingStateScrollingNode.cpp:
        * page/scrolling/ScrollingStateScrollingNode.h:
        * page/scrolling/ScrollingStateStickyNode.cpp:
        * page/scrolling/ScrollingStateStickyNode.h:
        * page/scrolling/ScrollingTree.cpp:
        * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
        * page/scrolling/ScrollingTreeFrameScrollingNode.h:
        * page/scrolling/ScrollingTreeNode.cpp:
        * page/scrolling/ScrollingTreeNode.h:
        * page/scrolling/ScrollingTreeScrollingNode.cpp:
        * page/scrolling/ScrollingTreeScrollingNode.h:
        * page/scrolling/mac/ScrollingTreeFixedNode.h:
        * page/scrolling/mac/ScrollingTreeFixedNode.mm:
        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
        * page/scrolling/mac/ScrollingTreeStickyNode.h:
        * page/scrolling/mac/ScrollingTreeStickyNode.mm:
        * platform/CalculationValue.cpp:
        * platform/CalculationValue.h:
        * platform/LayoutUnit.cpp:
        * platform/LayoutUnit.h:
        * platform/Length.cpp:
        * platform/Length.h:
        * platform/LengthBox.cpp:
        * platform/LengthBox.h:
        * platform/LengthPoint.cpp:
        * platform/LengthPoint.h:
        * platform/LengthSize.cpp:
        * platform/LengthSize.h:
        * platform/LogMacros.h:
        * platform/ScrollView.cpp:
        * platform/ScrollableArea.cpp:
        * platform/animation/TimingFunction.cpp:
        * platform/animation/TimingFunction.h:
        * platform/graphics/BitmapImage.cpp:
        * platform/graphics/BitmapImage.h:
        * platform/graphics/Color.cpp:
        * platform/graphics/Color.h:
        * platform/graphics/CrossfadeGeneratedImage.cpp:
        * platform/graphics/CrossfadeGeneratedImage.h:
        * platform/graphics/FloatPoint.cpp:
        * platform/graphics/FloatPoint.h:
        * platform/graphics/FloatPoint3D.cpp:
        * platform/graphics/FloatPoint3D.h:
        * platform/graphics/FloatRect.cpp:
        * platform/graphics/FloatRect.h:
        * platform/graphics/FloatRoundedRect.cpp:
        * platform/graphics/FloatRoundedRect.h:
        * platform/graphics/FloatSize.cpp:
        * platform/graphics/FloatSize.h:
        * platform/graphics/FontTaggedSettings.cpp:
        * platform/graphics/FontTaggedSettings.h:
        * platform/graphics/GradientImage.cpp:
        (WebCore::GradientImage::dump const):
        * platform/graphics/GradientImage.h:
        * platform/graphics/GraphicsContext.cpp:
        * platform/graphics/GraphicsContext.h:
        * platform/graphics/GraphicsLayer.cpp:
        * platform/graphics/GraphicsLayer.h:
        (WebCore::GraphicsLayer::dumpAdditionalProperties const):
        * platform/graphics/GraphicsTypes.cpp:
        * platform/graphics/GraphicsTypes.h:
        * platform/graphics/Image.cpp:
        * platform/graphics/Image.h:
        * platform/graphics/ImageSource.h:
        * platform/graphics/IntPoint.cpp:
        * platform/graphics/IntPoint.h:
        * platform/graphics/IntRect.cpp:
        * platform/graphics/IntRect.h:
        * platform/graphics/IntSize.cpp:
        * platform/graphics/IntSize.h:
        * platform/graphics/LayoutPoint.cpp:
        * platform/graphics/LayoutPoint.h:
        * platform/graphics/LayoutRect.cpp:
        * platform/graphics/LayoutRect.h:
        * platform/graphics/LayoutSize.cpp:
        * platform/graphics/LayoutSize.h:
        * platform/graphics/NamedImageGeneratedImage.cpp:
        * platform/graphics/NamedImageGeneratedImage.h:
        * platform/graphics/Path.cpp:
        * platform/graphics/Path.h:
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        * platform/graphics/ca/GraphicsLayerCA.h:
        * platform/graphics/ca/PlatformCAAnimation.cpp:
        * platform/graphics/ca/PlatformCAAnimation.h:
        * platform/graphics/ca/PlatformCALayer.cpp:
        * platform/graphics/ca/PlatformCALayer.h:
        * platform/graphics/ca/TileController.cpp:
        * platform/graphics/ca/TileGrid.cpp:
        * platform/graphics/cg/GraphicsContextCG.cpp:
        * platform/graphics/cg/PDFDocumentImage.cpp:
        * platform/graphics/cg/PDFDocumentImage.h:
        * platform/graphics/cocoa/IOSurface.h:
        * platform/graphics/cocoa/IOSurface.mm:
        * platform/graphics/displaylists/DisplayList.cpp:
        (WebCore::DisplayList::DisplayList::description const):
        * platform/graphics/displaylists/DisplayList.h:
        * platform/graphics/displaylists/DisplayListItems.cpp:
        * platform/graphics/displaylists/DisplayListItems.h:
        * platform/graphics/displaylists/DisplayListRecorder.cpp:
        * platform/graphics/displaylists/DisplayListReplayer.cpp:
        * platform/graphics/filters/DistantLightSource.cpp:
        * platform/graphics/filters/DistantLightSource.h:
        * platform/graphics/filters/FEBlend.cpp:
        * platform/graphics/filters/FEBlend.h:
        * platform/graphics/filters/FEColorMatrix.cpp:
        * platform/graphics/filters/FEColorMatrix.h:
        * platform/graphics/filters/FEComponentTransfer.cpp:
        * platform/graphics/filters/FEComponentTransfer.h:
        * platform/graphics/filters/FEComposite.cpp:
        * platform/graphics/filters/FEComposite.h:
        * platform/graphics/filters/FEConvolveMatrix.cpp:
        * platform/graphics/filters/FEConvolveMatrix.h:
        * platform/graphics/filters/FEDiffuseLighting.cpp:
        * platform/graphics/filters/FEDiffuseLighting.h:
        * platform/graphics/filters/FEDisplacementMap.cpp:
        * platform/graphics/filters/FEDisplacementMap.h:
        * platform/graphics/filters/FEDropShadow.cpp:
        * platform/graphics/filters/FEDropShadow.h:
        * platform/graphics/filters/FEFlood.cpp:
        * platform/graphics/filters/FEFlood.h:
        * platform/graphics/filters/FEGaussianBlur.cpp:
        * platform/graphics/filters/FEGaussianBlur.h:
        * platform/graphics/filters/FEMerge.cpp:
        * platform/graphics/filters/FEMerge.h:
        * platform/graphics/filters/FEMorphology.cpp:
        * platform/graphics/filters/FEMorphology.h:
        * platform/graphics/filters/FEOffset.cpp:
        * platform/graphics/filters/FEOffset.h:
        * platform/graphics/filters/FESpecularLighting.cpp:
        * platform/graphics/filters/FESpecularLighting.h:
        * platform/graphics/filters/FETile.cpp:
        * platform/graphics/filters/FETile.h:
        * platform/graphics/filters/FETurbulence.cpp:
        * platform/graphics/filters/FETurbulence.h:
        * platform/graphics/filters/FilterEffect.cpp:
        * platform/graphics/filters/FilterEffect.h:
        * platform/graphics/filters/FilterOperation.cpp:
        * platform/graphics/filters/FilterOperation.h:
        * platform/graphics/filters/FilterOperations.cpp:
        * platform/graphics/filters/FilterOperations.h:
        * platform/graphics/filters/LightSource.h:
        * platform/graphics/filters/PointLightSource.cpp:
        * platform/graphics/filters/PointLightSource.h:
        * platform/graphics/filters/SourceAlpha.cpp:
        * platform/graphics/filters/SourceAlpha.h:
        * platform/graphics/filters/SourceGraphic.cpp:
        * platform/graphics/filters/SourceGraphic.h:
        * platform/graphics/filters/SpotLightSource.cpp:
        * platform/graphics/filters/SpotLightSource.h:
        * platform/graphics/transforms/AffineTransform.cpp:
        * platform/graphics/transforms/AffineTransform.h:
        * platform/graphics/transforms/IdentityTransformOperation.h:
        * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
        * platform/graphics/transforms/Matrix3DTransformOperation.h:
        * platform/graphics/transforms/MatrixTransformOperation.cpp:
        * platform/graphics/transforms/MatrixTransformOperation.h:
        * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
        * platform/graphics/transforms/PerspectiveTransformOperation.h:
        * platform/graphics/transforms/RotateTransformOperation.cpp:
        * platform/graphics/transforms/RotateTransformOperation.h:
        * platform/graphics/transforms/ScaleTransformOperation.cpp:
        * platform/graphics/transforms/ScaleTransformOperation.h:
        * platform/graphics/transforms/SkewTransformOperation.cpp:
        * platform/graphics/transforms/SkewTransformOperation.h:
        * platform/graphics/transforms/TransformOperation.cpp:
        * platform/graphics/transforms/TransformOperation.h:
        * platform/graphics/transforms/TransformOperations.cpp:
        * platform/graphics/transforms/TransformOperations.h:
        * platform/graphics/transforms/TransformationMatrix.cpp:
        * platform/graphics/transforms/TransformationMatrix.h:
        * platform/graphics/transforms/TranslateTransformOperation.cpp:
        * platform/graphics/transforms/TranslateTransformOperation.h:
        * platform/ios/SelectionRect.cpp:
        (WebCore::operator<<):
        * platform/ios/SelectionRect.h:
        * platform/mac/ScrollAnimatorMac.mm:
        * platform/text/TextAllInOne.cpp:
        * rendering/InlineBox.cpp:
        * rendering/InlineBox.h:
        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::outputLineTreeAndMark const):
        * rendering/InlineFlowBox.h:
        * rendering/InlineTextBox.cpp:
        * rendering/InlineTextBox.h:
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::outputLineTreeAndMark const):
        * rendering/RenderBlockFlow.h:
        * rendering/RenderLayer.cpp:
        * rendering/RenderLayerCompositor.cpp:
        * rendering/RenderObject.cpp:
        * rendering/RenderObject.h:
        * rendering/RenderTreeAsText.cpp:
        * rendering/RenderTreeAsText.h:
        * rendering/ScrollAlignment.cpp:
        * rendering/ScrollAlignment.h:
        * rendering/SimpleLineLayoutCoverage.cpp:
        * rendering/SimpleLineLayoutFunctions.cpp:
        * rendering/SimpleLineLayoutFunctions.h:
        * rendering/style/FillLayer.cpp:
        * rendering/style/FillLayer.h:
        * rendering/style/NinePieceImage.cpp:
        * rendering/style/NinePieceImage.h:
        * rendering/style/RenderStyleConstants.cpp:
        * rendering/style/RenderStyleConstants.h:
        * rendering/svg/SVGRenderTreeAsText.cpp:
        (WebCore::operator<<):
        * rendering/svg/SVGRenderTreeAsText.h:
        (WebCore::operator<<):
        * svg/SVGLengthValue.cpp:
        * svg/SVGLengthValue.h:
        * svg/graphics/SVGImage.cpp:
        * svg/graphics/SVGImage.h:
        * svg/graphics/filters/SVGFEImage.cpp:
        * svg/graphics/filters/SVGFEImage.h:

2017-08-09  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r220466, r220477, and r220487.
        https://bugs.webkit.org/show_bug.cgi?id=175411

        This change broke existing API tests and follow up fixes did
        not resolve all the issues. (Requested by ryanhaddad on
        #webkit).

        Reverted changesets:

        https://bugs.webkit.org/show_bug.cgi?id=175244
        http://trac.webkit.org/changeset/220466

        "WTF::Function does not allow for reference / non-default
        constructible return types"
        https://bugs.webkit.org/show_bug.cgi?id=175244
        http://trac.webkit.org/changeset/220477

        https://bugs.webkit.org/show_bug.cgi?id=175244
        http://trac.webkit.org/changeset/220487

2017-08-09  Chris Dumez  <cdumez@apple.com>

        [Beacon][NetworkSession] Support CORS-preflighting on redirects
        https://bugs.webkit.org/show_bug.cgi?id=175386
        <rdar://problem/33801370>

        Reviewed by Youenn Fablet.

        Export a couple of WebCore symbols so I can use them in WebKit2.

        Tests: http/wpt/beacon/cors/cors-preflight-redirect-failure.html
               http/wpt/beacon/cors/cors-preflight-redirect-from-crossorigin-to-sameorigin.html
               http/wpt/beacon/cors/cors-preflight-redirect-success.html

        * loader/CrossOriginAccessControl.h:
        * page/SecurityOrigin.h:

2017-08-09  Jeremy Jones  <jeremyj@apple.com>

        Use MPAVRoutingController instead of deprecated versions.
        https://bugs.webkit.org/show_bug.cgi?id=175063

        Reviewed by Tim Horton.

        No new tests because no behavior change. This uses a different platform class to present
        an interface.

        Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
        Add MPMediaControlsViewController.

        * platform/spi/ios/MediaPlayerSPI.h:

2017-08-09  Myles C. Maxfield  <mmaxfield@apple.com>

        Mark font-display as in development
        https://bugs.webkit.org/show_bug.cgi?id=175387

        Unreviewed.

        * features.json:

2017-08-09  Commit Queue  <commit-queue@webkit.org>

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

        Caused bug 175023 (Requested by ap on #webkit).

        Reverted changeset:

        "[SVG] Leak in SVGAnimatedListPropertyTearOff"
        https://bugs.webkit.org/show_bug.cgi?id=172545
        http://trac.webkit.org/changeset/219334

2017-08-09  Dave Hyatt  <hyatt@apple.com>

        [Repaint from Layout Removal] Move layer repaint rects into a map
        https://bugs.webkit.org/show_bug.cgi?id=175393

        Reviewed by Zalan Bujtas.

        Move the two repaint rects held by RenderLayer into a RenderLayerModelObject -> RepaintLayoutRects hash map.
        RepaintLayoutRects is a new struct that holds both rects.

        Eventually more objects than just self painting layers will be caching repaint rects, so this takes a first
        step towards having a common cache for these repaint rects. In addition this change saves memory, since
        layers that aren't self-painting no longer have empty repaint rects taking up space in RenderLayer.

        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::RenderBlockFlow::layoutRunsAndFloats):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::RenderLayer):
        (WebCore::RenderLayer::updateLayerPositions):
        (WebCore::RenderLayer::repaintRectIncludingNonCompositingDescendants):
        (WebCore::RenderLayer::computeRepaintRects):
        (WebCore::RenderLayer::clearRepaintRects):
        (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
        (WebCore::RenderLayer::scrollTo):
        * rendering/RenderLayer.h:
        * rendering/RenderLayerModelObject.cpp:
        (WebCore::RepaintLayoutRects::RepaintLayoutRects):
        (WebCore::RenderLayerModelObject::willBeDestroyed):
        (WebCore::RenderLayerModelObject::destroyLayer):
        (WebCore::RenderLayerModelObject::styleDidChange):
        (WebCore::RenderLayerModelObject::hasRepaintLayoutRects):
        (WebCore::RenderLayerModelObject::setRepaintLayoutRects):
        (WebCore::RenderLayerModelObject::clearRepaintLayoutRects):
        (WebCore::RenderLayerModelObject::repaintLayoutRects):
        (WebCore::RenderLayerModelObject::computeRepaintLayoutRects):
        * rendering/RenderLayerModelObject.h:
        (WebCore::RepaintLayoutRects::RepaintLayoutRects):

2017-08-09  Sam Weinig  <sam@webkit.org>

        WTF::Function does not allow for reference / non-default constructible return types
        https://bugs.webkit.org/show_bug.cgi?id=175244

        Reviewed by Chris Dumez.

        * bindings/js/JSCustomElementInterface.h:
        (WebCore::JSCustomElementInterface::invokeCallback):
        Update the default value for the addArguments parameter to be an empty lambda, rather than
        default initialization, which leads to a null WTF::Function. This allows us to remove support
        for calling null WTF::Function. No change in behavior.

2017-08-09  Brady Eidson  <beidson@apple.com>

        Teach ScriptExecutionContexts about their SessionID.
        https://bugs.webkit.org/show_bug.cgi?id=175391

        Reviewed by Andy Estes.

        No new tests (No current change in behavior).

        Turns out that Workers need to know their SessionID for future feature development.
        So let's teach it to them.

        * dom/ScriptExecutionContext.h: Expose a pure virtual SessionID accessor.

        * dom/Document.cpp:
        (WebCore::Document::sessionID const):
        * dom/Document.h:

        * page/SessionID.cpp:
        (WebCore::SessionID::isolatedCopy const):
        * page/SessionID.h:

        * workers/DedicatedWorkerGlobalScope.cpp:
        (WebCore::DedicatedWorkerGlobalScope::create):
        (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
        * workers/DedicatedWorkerGlobalScope.h:

        * workers/DedicatedWorkerThread.cpp:
        (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
        (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
        * workers/DedicatedWorkerThread.h:

        * workers/Worker.cpp:
        (WebCore::Worker::notifyFinished):

        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::WorkerGlobalScope):
        * workers/WorkerGlobalScope.h:

        * workers/WorkerGlobalScopeProxy.h:

        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
        * workers/WorkerMessagingProxy.h:

        * workers/WorkerThread.cpp:
        (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
        (WebCore::WorkerThread::WorkerThread):
        (WebCore::WorkerThread::workerThread):
        * workers/WorkerThread.h:

2017-08-09  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS DnD] ENABLE_DRAG_SUPPORT should be turned off for iOS 10 and enabled by default
        https://bugs.webkit.org/show_bug.cgi?id=175392
        <rdar://problem/33783207>

        Reviewed by Tim Horton and Megan Gardner.

        Tweak FeatureDefines to enable drag and drop by default, and disable only on unsupported platforms (i.e. iOS 10).
        No change in behavior.

        * Configurations/FeatureDefines.xcconfig:

2017-08-09  Kirill Ovchinnikov  <kirill.ovchinnikov@lge.com>

        Old subtitle track is not deleted on 'src' attribute change event
        https://bugs.webkit.org/show_bug.cgi?id=175031

        Reviewed by Eric Carlson.

        Test: media/track/text-track-src-change.html

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::textTrackReadyStateChanged):
        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::loadTimerFired):
        * html/shadow/MediaControls.cpp:
        (WebCore::MediaControls::clearTextDisplayContainer):
        * html/shadow/MediaControls.h:

2017-08-09  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r220457.

        This change introduced API test failures.

        Reverted changeset:

        "WTF::Function does not allow for reference / non-default
        constructible return types"
        https://bugs.webkit.org/show_bug.cgi?id=175244
        http://trac.webkit.org/changeset/220457

2017-08-09  Don Olmstead  <don.olmstead@sony.com>

        [WinCairo] Fix build after rev 220399
        https://bugs.webkit.org/show_bug.cgi?id=175360

        Reviewed by Žan Doberšek.

        No new tests. No change in behavior.

        * platform/graphics/texmap/TextureMapperGLHeaders.h:

2017-08-09  Nan Wang  <n_wang@apple.com>

        AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24
        https://bugs.webkit.org/show_bug.cgi?id=175340
        <rdar://problem/33782159>

        Reviewed by Chris Fleizach.

        When adding a psuedo element child to a RenderBlockFlow element, there might be a chance where
        the element has already been layed out but we are still holding onto its stale children. Fixed it
        by notifying AX correctly when inserting/removing children during layout.

        Test: accessibility/add-children-pseudo-element.html

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::insertFloatingObject):
        (WebCore::RenderBlockFlow::removeFloatingObject):

2017-08-09  Charlie Turner  <cturner@igalia.com>

        [GStreamer][MSE] Add missing lock around getStreamByTrackId
        https://bugs.webkit.org/show_bug.cgi?id=175323

        Reviewed by Xabier Rodriguez-Calvar.

        Covered by existing tests.

        * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
        (WebCore::PlaybackPipeline::enqueueSample): Ensure the media source
        lock is taken before modifiying the track queues indirectly via the
        iterator use in getTrackId.

2017-08-09  Daniel Bates  <dabates@apple.com>

        REGRESSION (r219013): OAuth flows are broken when redirecting back to application after authentication
        https://bugs.webkit.org/show_bug.cgi?id=175247
        <rdar://problem/33679804>

        Reviewed by Brady Eidson.

        Add SPI so that Safari can differentiate between a form submission and a redirected form submission
        and have PolicyCheck notify the frame loader client if the navigation was in response to receiving a
        redirect response. This is the WebKit portion to fix an issue when a native app makes use of an OAuth
        OAuth flow that bounces to Safari for user login and then bounce back to the app. Microsoft Graph's
        OAuth flow is one example.

        Safari was differentiating between a form submission and a redirected form submission based on the
        nullity of WKNavigationAction.sourceFrame because in both cases the navigation type was WKNavigationTypeFormSubmitted.
        The navigation type is the same for both navigations because WebKit always used the navigation
        action from the original request for the redirect request when the original request redirected.
        Prior to r219013, WKNavigationAction.sourceFrame would be nil for a form submission that redirects.
        Following r219013, WKNavigationAction.sourceFrame is non-nil unless the navigation was initiated by
        API. In particular, WKNavigationAction.sourceFrame is non-nil for the redirect navigation corresponding
        to a form submission that redirects.

        * loader/EmptyClients.cpp:
        (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * loader/FrameLoaderClient.h:
        Have dispatchDecidePolicyForNavigationAction() take a boolean as to whether the navigation was in
        response to receiving a redirect response.
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNavigationPolicy): Notify the frame loader client whether the navigation
        is in response to receiving a redirect response.

2017-08-09  Sam Weinig  <sam@webkit.org>

        WTF::Function does not allow for reference / non-default constructible return types
        https://bugs.webkit.org/show_bug.cgi?id=175244

        Reviewed by Chris Dumez.

        * bindings/js/JSCustomElementInterface.h:
        (WebCore::JSCustomElementInterface::invokeCallback):
        Update the default value for the addArguments parameter to be an empty lambda, rather than
        default initialization, which leads to a null WTF::Function. This allows us to remove support
        for calling null WTF::Function. No change in behavior.

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

        [QuickLook] Use case-insensitive comparison of preview MIME types
        https://bugs.webkit.org/show_bug.cgi?id=175350
        <rdar://problem/33761159>

        Reviewed by Brady Eidson.

        MIME types are case-insensitive, but PreviewLoader was using a case-sensitive comparison to
        determine if a MIME type was supported by QLPreviewConverter. As a result we would fail to
        preview Excel macro-enabled workbooks, since CFNetwork would sniff a MIME type of
        "application/vnd.ms-excel.sheet.macroEnabled.12" but QuickLook contained
        "application/vnd.ms-excel.sheet.macroenabled.12" in its set of supported MIME type strings.

        Fix this by copying the QuickLook supported MIME type set into a HashSet using
        ASCIICaseInsensitiveHash and using that HashSet for MIME type checks.

        Test: quicklook/excel-macro-enabled.html

        * loader/ios/PreviewLoader.mm:
        (WebCore::PreviewLoader::shouldCreateForMIMEType):

2017-08-09  Ms2ger  <Ms2ger@igalia.com>

        Remove unnecessary copies of PlatformMediaSessionManager::m_sessions
        https://bugs.webkit.org/show_bug.cgi?id=175375

        Reviewed by Sam Weinig.

        Remove unnecessary copies of PlatformMediaSessionManager::m_sessions.

        These should have been removed in r207688.

        No new tests: no behavior change.

        * platform/audio/PlatformMediaSessionManager.cpp:
        (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const):
        (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
        (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const):
        (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const):

2017-08-09  Chris Dumez  <cdumez@apple.com>

        Reinstate active flag for iterators
        https://bugs.webkit.org/show_bug.cgi?id=175312

        Reviewed by Sam Weinig.

        NodeIterator / TreeWalker should no longer allow recursive filters
        after the following change to the DOM specification:
        - https://github.com/whatwg/dom/pull/359

        This patch aligns our behavior with the latest specification.

        No new tests, updated existing tests.

        * dom/NodeIterator.cpp:
        (WebCore::NodeIterator::nextNode):
        (WebCore::NodeIterator::previousNode):
        Note that we now also call m_candidateNode.clear() before returning an
        exception. This was a pre-existing bug that we failed to do so in the
        exception case but it became more obvious after this change now that
        we throw. This was causing traversal/moz-bug559526.html to fail
        otherwise (the filter was called one too many times). The test case
        is passing in Firefox (The filter is called 4 times and they throw
        each time).

        * dom/Traversal.cpp:
        (WebCore::NodeIteratorBase::NodeIteratorBase):
        (WebCore::NodeIteratorBase::acceptNode):
        * dom/Traversal.h:
        * dom/TreeWalker.cpp:

2017-08-09  Antti Koivisto  <antti@apple.com>

        RenderQuote should not mutate render tree
        https://bugs.webkit.org/show_bug.cgi?id=175328

        Reviewed by Zalan Bujtas.

        RenderQuote text renderers are currently created and deleted in a quirky fashion using a linked list.
        This patch moves to a simpler model that guarantees the mutations are always done in controlled fashion
        during render tree update.

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

            Move text renderer updating to Document so we can set the inRenderTreeUpdate bit for it too.

        * dom/Document.h:
        * dom/Text.cpp:
        (WebCore::Text::updateRendererAfterContentChange):
        * rendering/RenderDescendantIterator.h:
        (WebCore::RenderDescendantIteratorAdapter<T>::at):
        (WebCore::RenderDescendantConstIteratorAdapter<T>::at const):

            Add at() function for starting iteration from a specified renderer.

        * rendering/RenderQuote.cpp:
        (WebCore::RenderQuote::insertedIntoTree):
        (WebCore::RenderQuote::willBeRemovedFromTree):

            Register and unregister quotes to RenderView.
            Don't do any mutations.

        (WebCore::RenderQuote::styleDidChange):

            Invalidate the text renderer but don't mutate it.

        (WebCore::RenderQuote::updateTextRenderer):
        (WebCore::RenderQuote::computeText const):
        (WebCore::RenderQuote::updateRenderers):

            Compute depth of all render quotes and update the text renderer as needed.

        (WebCore::RenderQuote::willBeDestroyed): Deleted.
        (WebCore::RenderQuote::attachQuote): Deleted.
        (WebCore::RenderQuote::detachQuote): Deleted.
        (WebCore::RenderQuote::updateDepth): Deleted.

            Get rid of the linked list.

        * rendering/RenderQuote.h:
        * rendering/RenderView.cpp:
        (WebCore::RenderView::registerQuote):
        (WebCore::RenderView::unregisterQuote):

            Maintain a render tree order ListHashSet of RenderQuotes.

        (WebCore::RenderView::updateSpecialRenderers):

            Add a function for making additional render tree mutations at the end of a render tree update.
            Currently this just invokes RenderQuote::updateRenderers.

        * rendering/RenderView.h:
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::commit):

            Call RenderView::updateSpecialRenderers after committing all other changes.

2017-08-09  Zan Dobersek  <zdobersek@igalia.com>

        [Soup] Incorrect conversion in msToSoupDate()
        https://bugs.webkit.org/show_bug.cgi?id=175320

        Reviewed by Carlos Garcia Campos.

        Original patch by VaL Doroshchuk.

        * platform/network/soup/NetworkStorageSessionSoup.cpp:
        (WebCore::msToSoupDate): monthFromDayInYear() returns a value in the [0,11] range,
        while soup_date_new() expects a month value in the [1,12] range. The return value
        must be thus incremented by one to match that expectation.

2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, rolling out r220393.

        This patch regresses the performance of WebPage::editorState.

        Reverted changeset:

        "[iOS WK2] WKWebView schedules nonstop layout after pressing
        cmb+b,i,u inside a contenteditable div"
        https://bugs.webkit.org/show_bug.cgi?id=175116
        http://trac.webkit.org/changeset/220393

2017-08-08  Chris Dumez  <cdumez@apple.com>

        [Beacon] Add support for CORS-preflighting for WK2 / NETWORK_SESSION
        https://bugs.webkit.org/show_bug.cgi?id=175264
        <rdar://problem/33547793>

        Reviewed by Youenn Fablet.

        Pass additional information when creating a PingHandle so that the PingLoad
        can deal with CORS-preflighting on Network process side.

        Tests: http/wpt/beacon/cors/cors-preflight-arraybufferview-failure.html
               http/wpt/beacon/cors/cors-preflight-arraybufferview-success.html
               http/wpt/beacon/cors/cors-preflight-blob-failure.html
               http/wpt/beacon/cors/cors-preflight-blob-success.html
               http/wpt/beacon/cors/cors-preflight-cookie.html

        * WebCore.xcodeproj/project.pbxproj:
        * loader/CrossOriginAccessControl.cpp:
        (WebCore::validatePreflightResponse):
        * loader/CrossOriginAccessControl.h:
        * loader/CrossOriginPreflightChecker.cpp:
        (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
        * loader/CrossOriginPreflightResultCache.h:
        * loader/LoaderStrategy.h:
        * loader/PingLoader.cpp:
        (WebCore::PingLoader::loadImage):
        (WebCore::PingLoader::sendPing):
        (WebCore::PingLoader::sendViolationReport):
        (WebCore::PingLoader::startPingLoad):
        * loader/PingLoader.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load):
        * page/SecurityOrigin.h:

2017-08-08  Sam Weinig  <sam@webkit.org>

        Address review feedback from https://bugs.webkit.org/show_bug.cgi?id=175246.

        * bindings/js/DOMPromiseProxy.h:
        * css/FontFaceSet.cpp:
        * css/FontFaceSet.h:

2017-08-08  Devin Rousso  <drousso@apple.com>

        Web Inspector: Canvas: support editing WebGL shaders
        https://bugs.webkit.org/show_bug.cgi?id=124211
        <rdar://problem/15448958>

        Reviewed by Matt Baker.

        Test: inspector/canvas/updateShader.html

        * inspector/InspectorCanvasAgent.h:
        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::updateShader):

        * html/canvas/WebGLRenderingContextBase.h:
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::linkProgram):
        (WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
        Normally, when a program is linked, it invalidates any WebGLUniformLocation associated with
        the program by incrementing its `linkCount`. In order to allow live editing of shaders, we
        need to be able to compile and link a shader without invalidating these locations. This
        patch moves the shader linking logic to its own function that is called by `linkProgram` so
        that InspectorCanvasAgent can compile and link without invalidation.

2017-08-08  Sam Weinig  <sam@webkit.org>

        [WebIDL] Add support for Promise<> attributes
        https://bugs.webkit.org/show_bug.cgi?id=175246

        Reviewed by Yusuke Suzuki.

        Introduces and adopts DOMPromiseProxy, a new class for binding promises in a more
        straightforward and safe (from a wrapper world perspective) way.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSFontFaceCustom.cpp: Removed.
        * bindings/js/JSFontFaceSetCustom.cpp: Removed.
        * bindings/js/JSMediaKeySessionCustom.cpp: Removed.
        * bindings/js/JSServiceWorkerContainerCustom.cpp: Removed.
        * bindings/js/JSWebGPUCommandBufferCustom.cpp: Removed.

            Remove custom bindings only needed for promise attributes. Add DOMPromiseProxy.h

        * Modules/encryptedmedia/MediaKeySession.cpp:
        (WebCore::MediaKeySession::sessionClosed):
        (WebCore::MediaKeySession::registerClosedPromise): Deleted.
        * Modules/encryptedmedia/MediaKeySession.h:
        * Modules/encryptedmedia/MediaKeySession.idl:

            Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.

        * bindings/IDLTypes.h:

            Add StorageType type alias to allow specifying a specific form for storage. This allows
            use to use Ref<> for interfaces in DOMPromiseProxy.

        (WebCore::IDLWrapper::convertToParameterType):
            
            Also add convertToParameterType, an annoying hack to workaround the fact WTF::Function
            can't return references / no

        * bindings/js/DOMPromiseProxy.h: Added.
        (WebCore::DOMPromiseProxy<IDLType>):
        
            DOMPromiseProxy is a new class (set of classes) to represent promises that works with the 
            standard toJS<> / JSDOMConvert infrastructure used by the bindings generator. From the
            implementation perspective, it is similar to DOMPromiseDeferred, but instead of receiving
            one as a parameter, you can initialize it directly in your constructor and start using it.

            From the bindings perspective, a DOMPromiseProxy can be converted into a JS Promise by calling
            its promise function, which will either create a new promise, or return a cached one.

            To make this work, DOMPromiseProxy maintains a Vector of DeferredPromises that hold onto those
            actualized promises. The reason it has a Vector, is that we need one DeferredPromises per
            DOMWrapperWorld, just like we need one wrapper for an interface per DOMWrapperWorld in the 
            wrapper cache. In most cases, only the normal world will be in play, so the Vector has an inline
            capacity of one.
            
            In addition, DOMPromiseProxy maintains a Variant of either an Exception or the result value type.
            This allows the DOMPromiseProxy to be resolved or rejected at anytime. Then, when the bindings
            request the promise, the stored result / exception can be resolved / rejected into the promise.

        (WebCore::DOMPromiseProxy<IDLVoid>):

            For void promises, we need slightly different semantics (resolve takes no parameters, Value is
            a bit indicating resolved state), so it is specialized.

        (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>):

            In addition to the void specialization, we have DOMPromiseProxyWithResolveCallback. Instead of
            storing the value of the resolution directly, this specialization allows the owner to specify
            callback to be called when the resolved value is needed. This is needed to avoid reference
            cycles when the resolved value is the owner such as is the case with FontFace and FontFaceSet.

        * bindings/js/JSDOMConvertPromise.h:
        (WebCore::JSConverter<IDLPromise<T>>::convert):
        Add converter that calls through to the DOMPromiseProxy function promise.

        * bindings/js/JSDOMPromiseDeferred.cpp:
        (WebCore::DeferredPromise::callFunction):
        (WebCore::DeferredPromise::reject):
        * bindings/js/JSDOMPromiseDeferred.h:
        (WebCore::DeferredPromise::create):
        (WebCore::DeferredPromise::DeferredPromise):

            Add a new create function for DeferredPromise that creates the JSPromiseDeferred for you.
            Also adds a mode to DeferredPromise to allow keeping the promise after resolution. Maintain
            the old behavior as the default.

            Change reject to take an Exception as sink rather than an r-value, to allow DOMPromiseProxy
            to copy a Exception into multiple DeferredPromises. For callers already moving into reject,
            this should be no change.

        * bindings/scripts/CodeGeneratorJS.pm:
        (AddToIncludesForIDLType):
        (GenerateParametersCheck):
        (GenerateImplementationFunctionCall):
        (NativeToJSValueDOMConvertNeedsState):
        (NativeToJSValueDOMConvertNeedsGlobalObject):

            Add support DOMPromiseProxy. For now, this means a new extended attribute, [PromiseProxy],
            but once I convert all the existing promises over to using DOMPromiseProxy, it will be removed.
            
            Also specify the right #includes for promises and necessary parameters for conversion.

        * bindings/scripts/IDLAttributes.json:
        
            Add [PromiseProxy], a temporary extended attribute for using DOMPromiseProxy.

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

            Replace custom promise code using the registerPromise idiom with DOMPromiseProxyWithResolveCallback.
            The callback is necessary for these two classes since the value the resolve is themselves, and using
            a normal resolve would create a cycle.

        * html/canvas/WebGPUCommandBuffer.cpp:
        * html/canvas/WebGPUCommandBuffer.h:
        * html/canvas/WebGPUCommandBuffer.idl:
        * platform/graphics/cocoa/GPUCommandBufferMetal.mm:
        * platform/graphics/gpu/GPUCommandBuffer.cpp:
        * platform/graphics/gpu/GPUCommandBuffer.h:

            Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.

        * page/NavigatorBase.cpp:
        (WebCore::NavigatorBase::NavigatorBase):
        * page/NavigatorBase.h:

            Forward declare ServiceWorkerContainer and add an explicit constructor to allow
            removing #include of ServiceWorkerContainer.h in the header, avoiding an #include cycle.

        * workers/ServiceWorkerContainer.cpp:
        * workers/ServiceWorkerContainer.h:
        * workers/ServiceWorkerContainer.idl:

            Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.

        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        * bindings/scripts/test/TestObj.idl:

            Add / update tests.

2017-08-08  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Merge of dataRecordsRemoved should use std::max()
        https://bugs.webkit.org/show_bug.cgi?id=175348
        <rdar://problem/33785695>

        Reviewed by Chris Dumez.

        No new tests. Online change of a statistic that doesn't affect logic flow.

        * loader/ResourceLoadStatistics.cpp:
        (WebCore::ResourceLoadStatistics::merge):
            Now uses std::max() instead of addition.

2017-08-08  Brent Fulgham  <bfulgham@apple.com>

        Sandbox flags do not support document.domain control
        https://bugs.webkit.org/show_bug.cgi?id=175281
        <rdar://problem/33778936>

        Reviewed by Chris Dumez.

        Update the 'setDomain' logic to honor the sandbox properties as defined in the current
        HTML5 specification. This brings us in line with how Chrome and other browsers have
        worked for some time.

        Test: fast/frames/sandboxed-iframe-domain.html

        * dom/Document.cpp:
        (WebCore::Document::setDomain): Add check for sandbox flag (with appropriate error message)
        * dom/SecurityContext.h:

2017-08-08  Jeremy Jones  <jeremyj@apple.com>

        Change fast seek logic to prevent ping-ponging.
        https://bugs.webkit.org/show_bug.cgi?id=175167
        rdar://problem/32936116

        Reviewed by Jer Noble.

        Updated test: media/video-fast-seek.html

        Changed fast seek behavior to always seek early than seek time; and after current time when seeking forward.
        This prevents ping-ponging, where a fast seek overshoots the target looking for a keyframe.
        A subsequent seek will suddenly be on the other side of current time and
        will search in the opposite direction for a key frame; repeat.

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

2017-08-08  Ms2ger  <Ms2ger@igalia.com>

        Unreviewed. Correct the function name in a debug message.
        https://bugs.webkit.org/show_bug.cgi?id=175262

        No new tests: debug logs are not tested.

        * platform/audio/PlatformMediaSessionManager.cpp:
        (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):

2017-08-08  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed build fix after r220376.

        Don't attempt to use isPublicSuffix when building without that
        feature enabled.

        * dom/Document.cpp:
        (WebCore::Document::domainIsRegisterable const):

2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>

        [CMake] Properly test if compiler supports compiler flags
        https://bugs.webkit.org/show_bug.cgi?id=174490

        Reviewed by Konstantin Tokarev.

        * CMakeLists.txt:
        * PlatformGTK.cmake:
        * PlatformWPE.cmake:

2017-08-08  Zan Dobersek  <zdobersek@igalia.com>

        [GStreamer] Don't use GraphicsContext3D in VideoTextureCoperGStreamer
        https://bugs.webkit.org/show_bug.cgi?id=174774

        Reviewed by Carlos Garcia Campos.

        VideoTextureCoperGStreamer class creates a new GraphicsContext3D internally
        that's used to render to whichever OpenGL context is current. Such usage
        doesn't add anything to the user since there's no underlying offscreen-based
        OpenGL context created, and instead all GraphicsContext3D calls are directly
        translated to usual OpenGL API calls. We should avoid using GraphicsContext3D
        in such cases and instead use direct OpenGL API calls.

        This patch achieves that for the VideoTextureCoperGStreamer class. A
        GraphicsContext3D object is still created because it's needed to construct an
        instance of the TextureMapperShaderProgram class, but this will be removed as
        soon as TextureMapperShaderProgram drops the GraphicsContext3D dependence.

        No new tests -- no change in behavior.

        * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
        (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
        (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
        (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
        * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
        (WebCore::VideoTextureCopierGStreamer::resultTexture):

2017-08-08  Zan Dobersek  <zdobersek@igalia.com>

        [TexMap] Drop GC3D* type usage from TextureMapperPlatformLayer{Buffer,Proxy}
        https://bugs.webkit.org/show_bug.cgi?id=175314

        Reviewed by Carlos Garcia Campos.

        Switch to using OpenGL types in the TextureMapperPlatformLayerBuffer and
        TextureMapperPlatformLayerProxy classes, instead of the equivalent GC3D*
        types provided in the GraphicsTypes3D.h header.

        No new tests -- no change in behavior.

        * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
        (WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer):
        (WebCore::TextureMapperPlatformLayerBuffer::canReuseWithoutReset):
        * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
        (WebCore::TextureMapperPlatformLayerProxy::getAvailableBuffer):
        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:

2017-08-08  Zan Dobersek  <zdobersek@igalia.com>

        [TexMap] Don't use GraphicsContext3D in ClipStack
        https://bugs.webkit.org/show_bug.cgi?id=174776

        Reviewed by Carlos Garcia Campos.

        Any GraphicsContext3D object that's passed to ClipStack methods is of the
        render-to-current-context nature, meaning there's no internally owned GL
        context that has to be properly handled and all calls are simply passed to
        OpenGL APIs. We should drop such (non-)usage of GraphicsContext3D in favor
        of direct OpenGL API invocations.

        This patch covers TextureMapper's ClipStack. Call sites to the apply() and
        applyIfNeeded() are modified to not pass a reference to any
        GraphicsContext3D object. Internally, OpenGL API entrypoints and constants
        are used instead of GraphicsContext3D invocations.

        No new tests -- no change in behavior.

        * platform/graphics/texmap/BitmapTextureGL.cpp:
        (WebCore::BitmapTextureGL::clearIfNeeded):
        (WebCore::BitmapTextureGL::bindAsSurface):
        * platform/graphics/texmap/ClipStack.cpp:
        (WebCore::ClipStack::apply):
        (WebCore::ClipStack::applyIfNeeded):
        * platform/graphics/texmap/ClipStack.h:
        * platform/graphics/texmap/TextureMapperGL.cpp:
        (WebCore::TextureMapperGL::bindDefaultSurface):
        (WebCore::TextureMapperGL::beginScissorClip):
        (WebCore::TextureMapperGL::beginClip):
        (WebCore::TextureMapperGL::endClip):

2017-08-08  Javier Fernandez  <jfernandez@igalia.com>

        Not possible to remove the 'li' element inside the table cell
        https://bugs.webkit.org/show_bug.cgi?id=173148

        Reviewed by Ryosuke Niwa.

        We need to add a new case for breaking out empty list items when they are
        at the start of an editable area. Since list items can be also inside
        table cells, we need to consider this kind of elements as well.

        Tests: editing/deleting/delete-list-items-in-table-cell-1.html
               editing/deleting/delete-list-items-in-table-cell-2.html
               editing/deleting/delete-list-items-in-table-cell-3.html
               editing/deleting/delete-list-items-in-table-cell-4.html
               editing/deleting/delete-list-items-in-table-cell-5.html
               editing/deleting/delete-list-items-in-table-cell-6.html
               editing/deleting/delete-list-items-in-table-cell-7.html
               editing/deleting/delete-list-items-in-table-cell-8.html

        * editing/TypingCommand.cpp:
        (WebCore::TypingCommand::deleteKeyPressed):

2017-08-08  Zan Dobersek  <zdobersek@igalia.com>

        [TexMap] Isolate the TextureMapperPlatformLayerProxyProvider class
        https://bugs.webkit.org/show_bug.cgi?id=175316

        Reviewed by Carlos Garcia Campos.

        Move the TextureMapperPlatformLayerProxyProvider class (which is the type
        aliased to PlatformLayer for threaded CoordGraphics) into its own header
        file. This prevents including the TextureMapperPlatformLayerProxy.h header
        file in MediaPlayerPrivateGStreamerBase.h, avoiding spilling OpenGL types
        and function declarations before the GStreamer GL headers include them
        later in the MediaPlayerPrivateGStreamerBase implementation file.

        In the MediaPlayerPrivateGStreamerBase.h header file, only the new header
        is included, and a forward declaration of the TextureMapperPlatformLayerProxy
        class is used. proxy() and swapBuffersIfNeeded() methods are moved into
        the implementation file to avoid requiring the full definition of the
        TextureMapperPlatformLayerProxy class.

        Similar is done for the TextureMapperGC3DPlatformLayer class and the
        Cairo-specific implementation of the ImageBufferData class. The
        CoordinatedGraphicsLayer implementation file also gains an include of the
        TextureMapperPlatformLayerProxyProvider.h header since it requires the full
        definition of that class.

        No new tests -- no change in behavior.

        * platform/graphics/cairo/ImageBufferCairo.cpp:
        (WebCore::ImageBufferData::proxy const):
        * platform/graphics/cairo/ImageBufferDataCairo.h:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
        (WebCore::MediaPlayerPrivateGStreamerBase::proxy const):
        (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
        * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
        * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h: Added.
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:

2017-08-08  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed. Follow-up to r220392 that fixes build on configurations
        that disable USE(GSTREAMER_GL).

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
        When creating the BitmapTextureGL object, also provide an initialized
        TextureMapperContextAttributes object.

2017-08-08  Zan Dobersek  <zdobersek@igalia.com>

        [TexMap] Group GL header file inclusions in a single header file
        https://bugs.webkit.org/show_bug.cgi?id=175313

        Reviewed by Carlos Garcia Campos.

        Add a helper header file to the TextureMapper subsystem that includes
        the OpenGL headers, properly addressing the build configuration to
        include headers as provided by either libepoxy, the OpenGL ES library,
        or the OpenGL library.

        TextureMapperContextAttributes implementation file is the only one
        that can leverage the header at the moment, but more will follow.

        * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
        * platform/graphics/texmap/TextureMapperGLHeaders.h: Copied from Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp.

2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div
        https://bugs.webkit.org/show_bug.cgi?id=175116
        <rdar://problem/28279301>

        Reviewed by Darin Adler and Ryosuke Niwa.

        WebCore support for WebPage::editorState refactoring. See WebKit ChangeLogs for more detail.

        Tests: EditorStateTests.TypingAttributesBold
               EditorStateTests.TypingAttributesItalic
               EditorStateTests.TypingAttributesUnderline
               EditorStateTests.TypingAttributesTextAlignmentAbsoluteAlignmentOptions
               EditorStateTests.TypingAttributesTextAlignmentStartEnd
               EditorStateTests.TypingAttributesTextAlignmentDirectionalText
               EditorStateTests.TypingAttributesTextColor
               EditorStateTests.TypingAttributesMixedStyles
               EditorStateTests.TypingAttributesLinkColor

        * css/StyleProperties.cpp:
        (WebCore::StyleProperties::propertyAsColor const):
        (WebCore::StyleProperties::propertyAsValueID const):

        Introduces some helper functions in StyleProperties to convert CSS property values to Color or a CSSValueID.

        * css/StyleProperties.h:
        * editing/EditingStyle.cpp:
        (WebCore::EditingStyle::hasStyle):

        Pull out logic in selectionStartHasStyle that asks for a style TriState into EditingStyle::hasStyle. This is
        because WebPage::editorState will now query for multiple styles at the selection start, but
        selectionStartHasStyle currently recomputes styleAtSelectionStart every time it is called. To prevent extra work
        from being done, we can just call selectionStartHasStyle once and use ask for EditingStyle::hasStyle on the
        computed EditingStyle at selection start.

        * editing/EditingStyle.h:
        * editing/Editor.cpp:
        (WebCore::Editor::selectionStartHasStyle const):

2017-08-08  Zan Dobersek  <zdobersek@igalia.com>

        [TexMap] Add TextureMapperContextAttributes
        https://bugs.webkit.org/show_bug.cgi?id=175311

        Reviewed by Carlos Garcia Campos.

        Add and use TextureMapperContextAttributes, a slim struct that holds
        information about the type and extensions supported by the OpenGL
        context that's being used for one specific TextureMapperGL instance.

        This struct is initialized in the TextureMapperGL constructor for the
        OpenGL context that's been made current on that thread, and that will
        be used for that TextureMapperGL instance through its lifetime. The
        struct is then also copied into any BitmapTextureGL objects that have
        been created through this TextureMapperGL (or its texture pool).

        The struct is initialized with information about GLES2 support (which
        is at this point done through the USE_OPENGL_ES_2 macro) and about
        specific OpenGL extensions that are supported. These are then used in
        TextureMapperGL (NPOT textures) and BitmapTextureGL (BGRA support,
        sub-image unpacking) to deploy specific optimizations or workarounds.

        This ultimately serves as a replacement for clunky static functions
        that need to operate on GraphicsContext3D objects to retrieve this
        information.

        No new tests -- no change in behavior.

        * platform/TextureMapper.cmake:
        * platform/graphics/texmap/BitmapTextureGL.cpp:
        (WebCore::BitmapTextureGL::BitmapTextureGL):
        (WebCore::BitmapTextureGL::updateContentsNoSwizzle):
        (WebCore::BitmapTextureGL::updateContents):
        (WebCore::driverSupportsSubImage): Deleted.
        * platform/graphics/texmap/BitmapTextureGL.h:
        (WebCore::BitmapTextureGL::create):
        * platform/graphics/texmap/BitmapTexturePool.cpp:
        (WebCore::BitmapTexturePool::BitmapTexturePool):
        (WebCore::BitmapTexturePool::createTexture):
        * platform/graphics/texmap/BitmapTexturePool.h:
        * platform/graphics/texmap/TextureMapperContextAttributes.cpp: Added.
        (WebCore::TextureMapperContextAttributes::initialize):
        * platform/graphics/texmap/TextureMapperContextAttributes.h: Added.
        * platform/graphics/texmap/TextureMapperGL.cpp:
        (WebCore::TextureMapperGL::TextureMapperGL):
        (WebCore::TextureMapperGL::drawTexture):
        (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
        (WebCore::TextureMapperGL::createTexture):
        (WebCore::driverSupportsNPOTTextures): Deleted.
        * platform/graphics/texmap/TextureMapperGL.h:

2017-08-08  Zan Dobersek  <zdobersek@igalia.com>

        [TexMap] Don't expose GraphicsContext3D object
        https://bugs.webkit.org/show_bug.cgi?id=175310

        Reviewed by Carlos Garcia Campos.

        Remove the GraphicsContext3D getter from the TextureMapperGL class. Instead,
        the clearColor() method is added that's to be used by the CoordinatedGraphicsScene
        class which was accessing the GraphicsContext3D object for this purpose.

        * platform/graphics/texmap/TextureMapper.h:
        * platform/graphics/texmap/TextureMapperGL.cpp:
        (WebCore::TextureMapperGL::clearColor):
        * platform/graphics/texmap/TextureMapperGL.h:
        (WebCore::TextureMapperGL::graphicsContext3D const): Deleted.

2017-08-07  Simon Fraser  <simon.fraser@apple.com>

        RenderStyle:diff() was inadvertently doing deep compares of StyleRareNonInheritedData etc
        https://bugs.webkit.org/show_bug.cgi?id=175304

        Reviewed by Tim Horton.

        r210758 changed DataRef::get() from returning a pointer to a reference. This caused all the places
        in RenderStyle::diff() and related functions, where we intended to do a quick pointer comparison,
        to doing deep compares via operator!=. This made the code slightly slower.

        Fix by exposing ptr() on DataRef and using it wherever we wish to do pointer comparison.

        * rendering/style/DataRef.h:
        (WebCore::DataRef::ptr const):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::inheritedDataShared const):
        (WebCore::RenderStyle::changeAffectsVisualOverflow const):
        (WebCore::RenderStyle::changeRequiresLayout const):
        (WebCore::RenderStyle::changeRequiresRecompositeLayer const):
        (WebCore::RenderStyle::listStyleImage const): Expand the function onto multiple lines.

2017-08-07  Simon Fraser  <simon.fraser@apple.com>

        Add a fast path for rotate() and rotateZ() transform parsing
        https://bugs.webkit.org/show_bug.cgi?id=175308

        Reviewed by Zalan Bujtas.

        Fast paths only existed for translate-related functions, matrix3d() and scale3d(). Add
        rotate() and rotateX(), which gives a small boost to one of the MotionMark tests.

        * css/parser/CSSParserFastPaths.cpp:
        (WebCore::parseSimpleAngle):
        (WebCore::parseTransformAngleArgument):
        (WebCore::parseSimpleTransformValue):
        (WebCore::transformCanLikelyUseFastPath):

2017-08-07  Simon Fraser  <simon.fraser@apple.com>

        Re-order the tests in RenderLayerCompositor::requiresCompositingLayer() for performance
        https://bugs.webkit.org/show_bug.cgi?id=175306

        Reviewed by Tim Horton.

        Re-order the tests for compositing reasons so that reasons more likely to happen are higher in the list.

        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
        (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):

2017-08-07  Simon Fraser  <simon.fraser@apple.com>

        Avoid a hash lookup in FilterInfo::remove()
        https://bugs.webkit.org/show_bug.cgi?id=175301

        Reviewed by Sam Weinig.

        FilterInfo::remove() always called map().remove(&layer)), even when layer.m_hasFilterInfo
        was false (and even asserted that layer.m_hasFilterInfo == map().contains(&layer)).

        So we can early return if layer.m_hasFilterInfo is false.

        * rendering/RenderLayerFilterInfo.cpp:
        (WebCore::RenderLayer::FilterInfo::getIfExists):
        (WebCore::RenderLayer::FilterInfo::remove):

2017-08-07  Simon Fraser  <simon.fraser@apple.com>

        Make TransformOperation::type() non-virtual
        https://bugs.webkit.org/show_bug.cgi?id=175297

        Reviewed by Sam Weinig.

        Store the OperationType in the base class so that type() and isSameType() can
        be non-virtual.

        Small perf win on some benchmarks.

        * platform/graphics/transforms/IdentityTransformOperation.h:
        * platform/graphics/transforms/Matrix3DTransformOperation.h:
        * platform/graphics/transforms/MatrixTransformOperation.h:
        * platform/graphics/transforms/PerspectiveTransformOperation.h:
        * platform/graphics/transforms/RotateTransformOperation.cpp:
        (WebCore::RotateTransformOperation::blend):
        * platform/graphics/transforms/RotateTransformOperation.h:
        * platform/graphics/transforms/ScaleTransformOperation.cpp:
        (WebCore::ScaleTransformOperation::blend):
        * platform/graphics/transforms/ScaleTransformOperation.h:
        * platform/graphics/transforms/SkewTransformOperation.cpp:
        (WebCore::SkewTransformOperation::blend):
        * platform/graphics/transforms/SkewTransformOperation.h:
        * platform/graphics/transforms/TransformOperation.h:
        (WebCore::TransformOperation::TransformOperation):
        (WebCore::TransformOperation::type const):
        (WebCore::TransformOperation::isSameType const):
        * platform/graphics/transforms/TranslateTransformOperation.cpp:
        (WebCore::TranslateTransformOperation::blend):
        * platform/graphics/transforms/TranslateTransformOperation.h:

2017-08-07  Simon Fraser  <simon.fraser@apple.com>

        Inline ~Color and Color::isExtended()
        https://bugs.webkit.org/show_bug.cgi?id=175293

        Reviewed by Zalan Bujtas.

        The Color destructor and Color::isExtended() show up on profiles, so inline them.
        Before r207265 the destructor was inlined.
        
        Also make sure that LengthSize::operator== is inlined, which it was not (according
        to profiles).

        * platform/LengthSize.h:
        (WebCore::operator==):
        * platform/graphics/Color.cpp:
        (WebCore::Color::~Color): Deleted.
        (WebCore::Color::isExtended const): Deleted.
        * platform/graphics/Color.h:
        (WebCore::Color::~Color):
        (WebCore::Color::isExtended const):

2017-08-04  Brent Fulgham  <bfulgham@apple.com>

        Implement the HTML5 same-origin restriction specification
        https://bugs.webkit.org/show_bug.cgi?id=175226
        <rdar://problem/11079948>

        Reviewed by Chris Dumez.

        Follow the algorithms defined in the HTML5 specification for relaxing
        the same-origin restriction. We were missing a few steps related to
        checking for public suffix and presence of a browsing context.

        Tested by new TestWebKitAPI tests.

        * dom/Document.cpp:
        (WebCore::Document::domainIsRegisterable): Added helper function.
        (WebCore::Document::setDomain):

2017-08-07  Devin Rousso  <drousso@apple.com>

        Web Inspector: Preview Canvas path when viewing a recording
        https://bugs.webkit.org/show_bug.cgi?id=174967

        Reviewed by Brian Burg.

        Tests: fast/canvas/2d.currentPoint.html
               fast/canvas/2d.getPath.modification.html
               fast/canvas/2d.getPath.newobject.html
               fast/canvas/2d.setPath.html

        * html/canvas/CanvasPath.idl:
        * html/canvas/CanvasPath.h:
        * html/canvas/CanvasPath.cpp:
        (WebCore::CanvasPath::currentX const):
        (WebCore::CanvasPath::currentY const):

        * html/canvas/CanvasRenderingContext2D.idl:
        * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::setPath):
        (WebCore::CanvasRenderingContext2D::getPath const):

        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setInspectorAdditionsEnabled):
        (WebCore::RuntimeEnabledFeatures::inspectorAdditionsEnabled const):
        Add runtime flag for added IDL items above so that they are only usable within the inspector
        process. The runtime flag is not enabled from anywhere else as of now.

        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::buildInitialState):
        Send current path as part of the InitialState.
        Drive-by: deduplicate more string values.

2017-08-07  Chris Dumez  <cdumez@apple.com>

        Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest
        https://bugs.webkit.org/show_bug.cgi?id=175280

        Reviewed by Youenn Fablet.

        Update sendBeacon() to rely on FetchBody instead of the whole FetchRequest. FetchBody
        for data extraction is really the only thing we need at the moment.
        The new code also properly sets the CORS mode, which will be needed for Bug 175264.

        * Modules/beacon/NavigatorBeacon.cpp:
        (WebCore::NavigatorBeacon::sendBeacon):

2017-08-07  Michael Catanzaro  <mcatanzaro@igalia.com>

        -Wimplicit-fallthrough warning in ComputedStyleExtractor::propertyValue
        https://bugs.webkit.org/show_bug.cgi?id=174469
        <rdar://problem/33311638>

        Reviewed by Simon Fraser.

        Add a RELEASE_ASSERT_NOT_REACHED to silence this warning.

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::propertyValue):

2017-08-06  Filip Pizlo  <fpizlo@apple.com>

        Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
        https://bugs.webkit.org/show_bug.cgi?id=174919

        Reviewed by Keith Miller.

        No new tests because no change in behavior.
        
        Adapting to API changes - we now specify the AlignedMemoryAllocator differently and we need to be
        specific about which Gigacage we're using.

        * bindings/js/WebCoreJSClientData.cpp:
        (WebCore::JSVMClientData::JSVMClientData):
        * platform/graphics/cocoa/GPUBufferMetal.mm:
        (WebCore::GPUBuffer::GPUBuffer):

2017-08-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Add abstraction layer of cookie jar implementation for Curl port
        https://bugs.webkit.org/show_bug.cgi?id=174943

        Reviewed by Brent Fulgham.

        * platform/network/curl/CookieJarCurl.cpp:
        (WebCore::CookieJarCurlFileSystem::setCookiesFromDOM):
        (WebCore::CookieJarCurlFileSystem::cookiesForDOM):
        (WebCore::CookieJarCurlFileSystem::cookieRequestHeaderFieldValue):
        (WebCore::CookieJarCurlFileSystem::cookiesEnabled):
        (WebCore::CookieJarCurlFileSystem::getRawCookies):
        (WebCore::CookieJarCurlFileSystem::deleteCookie):
        (WebCore::CookieJarCurlFileSystem::getHostnamesWithCookies):
        (WebCore::CookieJarCurlFileSystem::deleteCookiesForHostnames):
        (WebCore::CookieJarCurlFileSystem::deleteAllCookies):
        (WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince):
        (WebCore::cookiesForDOM):
        (WebCore::setCookiesFromDOM):
        (WebCore::cookieRequestHeaderFieldValue):
        (WebCore::cookiesEnabled):
        (WebCore::getRawCookies):
        (WebCore::deleteCookie):
        (WebCore::getHostnamesWithCookies):
        (WebCore::deleteCookiesForHostnames):
        (WebCore::deleteAllCookies):
        (WebCore::deleteAllCookiesModifiedSince):
        * platform/network/curl/CookieJarCurl.h: Added.
        * platform/network/curl/CurlContext.cpp:
        * platform/network/curl/CurlContext.h:
        (WebCore::CurlContext::cookieJar):

2017-08-07  Brady Eidson  <beidson@apple.com>

        Implement most of ServiceWorkerContainer::addRegistration.
        https://bugs.webkit.org/show_bug.cgi?id=175237

        Reviewed by Andy Estes.

        No new tests (Covered by changes to existing tests).

        There's still so much supporting infrastructure to add with these early patches
        that I'm still moving them in baby steps for now, hence not implementing
        register() all in one shot.
        
        Things will start moving very quickly once we no longer need to add lots of new
        primitives in each change.
        
        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::navigator const):
        
        * page/Navigator.cpp:
        (WebCore::Navigator::Navigator): Make the constructor take a ScriptExecutionContext for 
          creation of objects where its import (e.g. ServiceWorkerContainer).
        * page/Navigator.h:

        * page/WorkerNavigator.cpp:
        (WebCore::WorkerNavigator::WorkerNavigator): Ditto.
        * page/WorkerNavigator.h:

        * page/NavigatorBase.cpp:
        (WebCore::NavigatorBase::NavigatorBase): Create the ServiceWorkerContainer upfront with
          the passed-in ScriptExecutionContext.
        (WebCore::NavigatorBase::serviceWorker):
        * page/NavigatorBase.h:
        
        Make ServiceWorkerContainer into an ActiveDOMObject. This will eventually be necessary for
        Document suspension reasons, but is also necessary because it also needs to be a
        ContextDestructionObserver (which ActiveDOMObject is):
        * workers/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
        (WebCore::ServiceWorkerContainer::ready):
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::getRegistration):
        (WebCore::ServiceWorkerContainer::getRegistrations):
        (WebCore::ServiceWorkerContainer::activeDOMObjectName const):
        (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const):
        (WebCore::rejectLater): Deleted.
        (WebCore::ServiceWorkerContainer::eventTargetInterface const): Deleted.
        (WebCore::ServiceWorkerContainer::scriptExecutionContext const): Deleted.
        * workers/ServiceWorkerContainer.h:
        * workers/ServiceWorkerContainer.idl:

        Add updateViaCache, etc:
        * workers/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::updateViaCache const):
        (WebCore::ServiceWorkerRegistration::update):
        (WebCore::ServiceWorkerRegistration::unregister):
        * workers/ServiceWorkerRegistration.h:
        * workers/ServiceWorkerRegistration.idl:

        * workers/ServiceWorkerUpdateViaCache.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
        * workers/ServiceWorkerUpdateViaCache.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.

        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::navigator):
        (WebCore::WorkerGlobalScope::navigator const): Deleted.
        * workers/WorkerGlobalScope.h:

        * workers/WorkerType.h: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.
        * workers/WorkerType.idl: Copied from Source/WebCore/workers/ServiceWorkerRegistration.idl.

2017-08-07  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r220299.

        This change caused LayoutTest inspector/dom-debugger/dom-
        breakpoints.html to fail.

        Reverted changeset:

        "Web Inspector: capture async stack trace when workers/main
        context posts a message"
        https://bugs.webkit.org/show_bug.cgi?id=167084
        http://trac.webkit.org/changeset/220299

2017-08-07  Brian Burg  <bburg@apple.com>

        Cleanup: simplify WebSockets code for RuntimeEnabledFeatures
        https://bugs.webkit.org/show_bug.cgi?id=175190

        Reviewed by Sam Weinig.

        This runtime enabled flag is not used by anything. It was added
        for V8 in <https://bugs.webkit.org/show_bug.cgi?id=29896>.

        * Modules/websockets/WebSocket.cpp:
        (WebCore::WebSocket::setIsAvailable): Deleted.
        (WebCore::WebSocket::isAvailable): Deleted.
        * Modules/websockets/WebSocket.h:
        * Modules/websockets/WebSocket.idl:
        * page/RuntimeEnabledFeatures.cpp:
        (WebCore::RuntimeEnabledFeatures::webSocketEnabled const): Deleted.
        * page/RuntimeEnabledFeatures.h:

2017-08-07  Brian Burg  <bburg@apple.com>

        Remove CANVAS_PATH compilation guard
        https://bugs.webkit.org/show_bug.cgi?id=175207

        Reviewed by Sam Weinig.

        * Configurations/FeatureDefines.xcconfig:
        * html/canvas/DOMPath.h:
        * html/canvas/DOMPath.idl:

2017-08-07  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [WPE][CMake] Only pass pkg-config CFLAGS from (E)GL when not using libepoxy.
        https://bugs.webkit.org/show_bug.cgi?id=175125

        Reviewed by Michael Catanzaro.

        No change of behavior, covered by existing tests.

        * CMakeLists.txt: Instead of negating 3 times the use of libepoxy
        move the logic for (E)GL detection inside an else() block.

2017-08-07  Antti Koivisto  <antti@apple.com>

        REGRESSION (r219121): Airmail 3 prints header part only.
        https://bugs.webkit.org/show_bug.cgi?id=175258
        <rdar://problem/33601173>

        Reviewed by Andreas Kling.

        When a WK1 WebViw is printed via AppKit view hierarchy it won't explictly set the page width
        but uses the existing width. r219121 assumes that all printing code paths set the page width.

        No test, there appears to be no good way to test AppKit printing behaviors without adding complicated
        new testing infrastructure.

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

            If we are in printing layout and don't have page width set yet then use the current view width.
            This matches the behavior prior r219121.

2017-08-05  Youenn Fablet  <youenn@apple.com>

        [Fetch API] Response should keep all ResourceResponse information
        https://bugs.webkit.org/show_bug.cgi?id=175099

        Reviewed by Sam Weinig.

        No change of behavior, covered by existing tests.

        Disabling filtering of resource response at DocumentThreadableLoader for fetch API and doing the filtering at FetchResponse level.
        This requires passing the tainting parameter to FetchResponse. For that purpose, we store the tainting on the ResourceResponse itself.
        This allows mimicking the concept of internal response from the fetch spec.
        This might be useful for future developments related to caching the responses.

        The body is now also stored in FetchResponse so a flag is added to ensure we only expose the body if allowed.

        Changing storage of opaque redirect information to keep the redirection information in the response.

        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::blob):
        (WebCore::FetchBodyOwner::consumeNullBody):
        * Modules/fetch/FetchBodyOwner.h:
        * Modules/fetch/FetchLoader.cpp:
        (WebCore::FetchLoader::start):
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
        (WebCore::FetchResponse::consume):
        (WebCore::FetchResponse::consumeBodyAsStream):
        (WebCore::FetchResponse::createReadableStreamSource):
        * Modules/fetch/FetchResponse.h:
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::responseReceived):
        (WebCore::DocumentThreadableLoader::didReceiveResponse):
        (WebCore::DocumentThreadableLoader::didFinishLoading):
        (WebCore::DocumentThreadableLoader::loadRequest):
        * loader/DocumentThreadableLoader.h:
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::willSendRequestInternal):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::setBodyDataFrom):
        (WebCore::CachedResource::setResponse):
        * platform/network/ResourceResponseBase.cpp:
        (WebCore::ResourceResponseBase::crossThreadData const):
        (WebCore::ResourceResponseBase::fromCrossThreadData):
        (WebCore::ResourceResponseBase::filter):
        * platform/network/ResourceResponseBase.h:
        (WebCore::ResourceResponseBase::setTainting):
        (WebCore::ResourceResponseBase::tainting const):
        (WebCore::ResourceResponseBase::encode const):
        (WebCore::ResourceResponseBase::decode):

2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        WebDriver: use in-view center point for clicks instead of bounding box center point
        https://bugs.webkit.org/show_bug.cgi?id=174863

        Reviewed by Simon Fraser.

        Make DOMRect, and FloatPoint::narrowPrecision() available to WebKit layer. Also add
        FrameView::clientToDocumentPoint().

        * WebCore.xcodeproj/project.pbxproj:
        * dom/Element.h:
        * page/FrameView.h:
        * platform/graphics/FloatPoint.h:

2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        getClientRects doesn't work with list box option elements
        https://bugs.webkit.org/show_bug.cgi?id=175016

        Reviewed by Darin Adler.

        Since HTMLOptionElement and HTMLOptGroupElement don't have a renderer, we are always returning an empty list
        from getClientRects. This is working fine in both chromium and firefox, option elements return its own bounding
        box and group elements return the bounding box of the group label and all its children items.

        Test: fast/dom/HTMLSelectElement/listbox-items-client-rects.html

        * dom/Element.cpp:
        (WebCore::listBoxElementBoundingBox): Helper function to return the bounding box of a HTMLOptionElement or
        HTMLOptGroupElement element.
        (WebCore::Element::getClientRects): Use listBoxElementBoundingBox() in case of HTMLOptionElement or
        HTMLOptGroupElement.
        (WebCore::Element::boundingClientRect): Ditto.

2017-08-04  Youenn Fablet  <youenn@apple.com>

        [Cache API] Add Cache and CacheStorage IDL definitions
        https://bugs.webkit.org/show_bug.cgi?id=175201

        Reviewed by Brady Eidson.

        Covered by activated tests.
        Adding IDLs as per https://www.w3.org/TR/service-workers-1/#idl-index.
        Implementation is guarded by a runtime flag which is off by default.
        It is off for DRT but on for WTR.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/cache/Cache.cpp: Added.
        (WebCore::Cache::match):
        (WebCore::Cache::matchAll):
        (WebCore::Cache::add):
        (WebCore::Cache::addAll):
        (WebCore::Cache::put):
        (WebCore::Cache::remove):
        (WebCore::Cache::keys):
        * Modules/cache/Cache.h: Added.
        (WebCore::Cache::create):
        (WebCore::Cache::Cache):
        * Modules/cache/Cache.idl: Added.
        * Modules/cache/CacheQueryOptions.h: Added.
        * Modules/cache/CacheQueryOptions.idl: Added.
        * Modules/cache/CacheStorage.cpp: Added.
        (WebCore::CacheStorage::match):
        (WebCore::CacheStorage::has):
        (WebCore::CacheStorage::open):
        (WebCore::CacheStorage::remove):
        (WebCore::CacheStorage::keys):
        * Modules/cache/CacheStorage.h: Added.
        (WebCore::CacheStorage::create):
        * Modules/cache/CacheStorage.idl: Added.
        * Modules/cache/DOMWindowCaches.cpp: Added.
        (WebCore::DOMWindowCaches::DOMWindowCaches):
        (WebCore::DOMWindowCaches::supplementName):
        (WebCore::DOMWindowCaches::from):
        (WebCore::DOMWindowCaches::caches):
        (WebCore::DOMWindowCaches::caches const):
        * Modules/cache/DOMWindowCaches.h: Added.
        * Modules/cache/DOMWindowCaches.idl: Added.
        * Modules/cache/WorkerGlobalScopeCaches.cpp: Added.
        (WebCore::WorkerGlobalScopeCaches::supplementName):
        (WebCore::WorkerGlobalScopeCaches::from):
        (WebCore::WorkerGlobalScopeCaches::caches):
        (WebCore::WorkerGlobalScopeCaches::caches const):
        * Modules/cache/WorkerGlobalScopeCaches.h: Added.
        * Modules/cache/WorkerGlobalScopeCaches.idl: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setCacheAPIEnabled):
        (WebCore::RuntimeEnabledFeatures::cacheAPIEnabled const):

2017-08-04  Brady Eidson  <beidson@apple.com>

        Have navigator.serviceWorker() actually return a ServiceWorkerContainer object.
        https://bugs.webkit.org/show_bug.cgi?id=175215

        Reviewed by Youenn Fablet.

        * page/NavigatorBase.cpp:
        (WebCore::NavigatorBase::serviceWorker): Actually create and remember an object.
        * page/NavigatorBase.h:

        * workers/ServiceWorkerContainer.cpp:
        (WebCore::rejectLater): Asynchronously reject the given promise with an error message.
        (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
        (WebCore::ServiceWorkerContainer::refEventTarget): Ref the underlying Navigator.
        (WebCore::ServiceWorkerContainer::derefEventTarget): Deref the underlying Navigator.
        (WebCore::ServiceWorkerContainer::ready): rejectLater the promise.
        (WebCore::ServiceWorkerContainer::addRegistration): Ditto.
        (WebCore::ServiceWorkerContainer::getRegistration): Ditto.
        (WebCore::ServiceWorkerContainer::getRegistrations): Ditto.
        * workers/ServiceWorkerContainer.h:

2017-08-04  Chris Dumez  <cdumez@apple.com>

        [Beacon] Update sendBeacon to use the CachedResourceLoader
        https://bugs.webkit.org/show_bug.cgi?id=175192
        <rdar://problem/33725923>

        Reviewed by Youenn Fablet.

        Update sendBeacon to use the FetchRequest / CachedResourceLoader instead of
        the PingLoader. This gets us closer to the specification which is based on
        Fetch and reduces code duplication. This also fixes an issue where our
        Origin header was not properly set on Beacon resquests.

        In a follow-up, we will implement in CachedResourceLoader Fetch's quota for
        inflight keepalive requests which is needed to fully support sendBeacon().

        * Modules/beacon/NavigatorBeacon.cpp:
        (WebCore::NavigatorBeacon::sendBeacon):
        * Modules/beacon/NavigatorBeacon.h:
        * loader/LinkLoader.cpp:
        (WebCore::createLinkPreloadResourceClient):
        * loader/PingLoader.cpp:
        * loader/PingLoader.h:
        * loader/ResourceLoadInfo.cpp:
        (WebCore::toResourceType):
        * loader/SubresourceLoader.cpp:
        (WebCore::logResourceLoaded):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::defaultPriorityForResourceType):
        (WebCore::CachedResource::load):
        * loader/cache/CachedResource.h:
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::createResource):
        (WebCore::CachedResourceLoader::requestBeaconResource):
        (WebCore::contentTypeFromResourceType):
        (WebCore::CachedResourceLoader::checkInsecureContent const):
        (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
        (WebCore::isResourceSuitableForDirectReuse):
        * loader/cache/CachedResourceLoader.h:

2017-08-04  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Report user interaction immediately, but only when needed
        https://bugs.webkit.org/show_bug.cgi?id=175090
        <rdar://problem/33685546>

        Reviewed by Chris Dumez.

        Test: http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::ResourceLoadObserver):
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
            Now tells the UI process immediately but also records that it has
            done so to avoid doing it when not needed.
        (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
            Conditional throttling gone, now always throttles.
        (WebCore::ResourceLoadObserver::notifyObserver):
            Renamed from ResourceLoadObserver::notificationTimerFired().
        (WebCore::ResourceLoadObserver::clearState):
            New function to allow the test runner to reset the web process'
            statistics state now that we keep track of whether or not we've
            reported user interaction to the UI process.
        (WebCore::ResourceLoadObserver::setShouldThrottleObserverNotifications): Deleted.
        (WebCore::ResourceLoadObserver::notificationTimerFired): Deleted.
        * loader/ResourceLoadObserver.h:
        (): Deleted.
        * testing/Internals.cpp:
        (WebCore::Internals::resetToConsistentState):
        (WebCore::Internals::setResourceLoadStatisticsShouldThrottleObserverNotifications): Deleted.
            No longer needed since user interaction is always communicated
            immediately.
        * testing/Internals.h:
        * testing/Internals.idl:

2017-08-04  Matt Baker  <mattbaker@apple.com>

        Web Inspector: capture async stack trace when workers/main context posts a message
        https://bugs.webkit.org/show_bug.cgi?id=167084
        <rdar://problem/30033673>

        Reviewed by Brian Burg.

        Add instrumentation to DOMWindow to support showing asynchronous
        stack traces when the debugger pauses in a MessageEvent handler.

        Test: inspector/debugger/async-stack-trace.html

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didPostMessageImpl):
        (WebCore::InspectorInstrumentation::didFailPostMessageImpl):
        (WebCore::InspectorInstrumentation::willDispatchPostMessageImpl):
        (WebCore::InspectorInstrumentation::didDispatchPostMessageImpl):

        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didPostMessage):
        (WebCore::InspectorInstrumentation::didFailPostMessage):
        (WebCore::InspectorInstrumentation::willDispatchPostMessage):
        (WebCore::InspectorInstrumentation::didDispatchPostMessage):

        * inspector/PageDebuggerAgent.cpp:
        (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
        (WebCore::PageDebuggerAgent::didPostMessage):
        (WebCore::PageDebuggerAgent::didFailPostMessage):
        (WebCore::PageDebuggerAgent::willDispatchPostMessage):
        (WebCore::PageDebuggerAgent::didDispatchPostMessage):
        * inspector/PageDebuggerAgent.h:

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::postMessage):
        (WebCore::DOMWindow::postMessageTimerFired):

2017-08-04  Devin Rousso  <drousso@apple.com>

        Web Inspector: add source view for WebGL shader programs
        https://bugs.webkit.org/show_bug.cgi?id=138593
        <rdar://problem/18936194>

        Reviewed by Matt Baker.

        Test: inspector/canvas/requestShaderSource.html

        * inspector/InspectorCanvasAgent.h:
        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::requestShaderSource):

        * inspector/InspectorShaderProgram.h:
        * inspector/InspectorShaderProgram.cpp:
        (WebCore::InspectorShaderProgram::shaderForType):

2017-08-04  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r220288.

        This broke multiple builds.

        Reverted changeset:

        "Use MPAVRoutingController instead of deprecated versions."
        https://bugs.webkit.org/show_bug.cgi?id=175063
        http://trac.webkit.org/changeset/220288

2017-08-03  Filip Pizlo  <fpizlo@apple.com>

        The allocator used to allocate memory for MarkedBlocks and LargeAllocations should not be the Subspace itself
        https://bugs.webkit.org/show_bug.cgi?id=175141

        Reviewed by Mark Lam.

        No new tests because no new behavior.
        
        Just adapting to an API change.

        * ForwardingHeaders/heap/FastMallocAlignedMemoryAllocator.h: Added.
        * bindings/js/WebCoreJSClientData.cpp:
        (WebCore::JSVMClientData::JSVMClientData):

2017-08-04  Chris Dumez  <cdumez@apple.com>

        Match newly-clarified spec on textarea defaultValue/value/child text content
        https://bugs.webkit.org/show_bug.cgi?id=173878

        Reviewed by Darin Adler.

        Update HTMLTextArea.defaultValue to match align with other browsers and match the
        latest HTML specification:
        - https://html.spec.whatwg.org/#dom-textarea-defaultvalue

        The defaultValue getter should return the child text content:
        - https://dom.spec.whatwg.org/#concept-child-text-content
        Our code was traversing all Text descendants, not just the children.

        The defaultValue setter should act as the setter of the Element's textContent
        IDL attribute. Previously, we had a custom logic that was only removing the
        text children.

        Test: imported/w3c/web-platform-tests/html/semantics/forms/the-textarea-element/value-defaultValue-textContent.html

        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::scriptContent const):
        * dom/TextNodeTraversal.cpp:
        (WebCore::TextNodeTraversal::childTextContent):
        * dom/TextNodeTraversal.h:
        * html/HTMLTextAreaElement.cpp:
        (WebCore::HTMLTextAreaElement::defaultValue const):
        (WebCore::HTMLTextAreaElement::setDefaultValue):
        * html/HTMLTitleElement.cpp:
        (WebCore::HTMLTitleElement::text const):

2017-08-04  Said Abou-Hallawa  <sabouhallawa@apple.com>

        RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available
        https://bugs.webkit.org/show_bug.cgi?id=174874
        <rdar://problem/33530130>

        Reviewed by Simon Fraser.

        If an <img> element has a non-CachedImage content data, e.g. -webkit-named-image,
        RenderImageResourceStyleImage will be created and  attached to the RenderImage.
        RenderImageResourceStyleImage::m_cachedImage will be set to null at the 
        beginning because the m_styleImage->isCachedImage() is false in this case.
        When ImageLoader finishes loading the url of the src attribute,
        RenderImageResource::setCachedImage() will be called to set m_cachedImage.

        A crash will happen when the RenderImage is destroyed. Destroying the 
        RenderImage calls RenderImageResourceStyleImage::shutdown() which checks
        m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image()
        which ends up calling CSSNamedImageValue::image() which returns a null pointer
        because the size is empty. RenderImageResourceStyleImage::shutdown() calls
        image()->stopAnimation() without checking the return value of image().

        Another crash will happen later when deleting the CachedImage from the memory
        cache if CachedImage::canDestroyDecodedData() is called because the client
        it gets from m_clients is a freed pointer. This happens because RenderImageResourceStyleImage
        has m_styleImage of type StyleGeneratedImage but its m_cachedImage is set
        by RenderImageResource::setCachedImage(). When RenderImageResourceStyleImage::shutdown()
        is called, it calls  StyleGeneratedImage::removeClient() which does not 
        know anything about RenderImageResourceStyleImage::m_cachedImage. So we 
        end up having a freed pointer in the m_clients of the CachedImage.

        Test: fast/images/image-element-image-content-data.html

        * rendering/RenderImageResourceStyleImage.cpp:
        (WebCore::RenderImageResourceStyleImage::shutdown):  Revert back the changes
        of r208511 in this function. Add a call to image()->stopAnimation() without
        checking the return of image() since it will return the nullImage() if
        the image not available. There is no need to check m_cachedImage before 
        calling image() because image() does not check or access m_cachedImage.

        If m_styleImage is not a CachedStyleImage but m_cachedImage is not null,
        we need to remove m_renderer from the set of the clients of this m_cachedImage.

        (WebCore::RenderImageResourceStyleImage::image const): The base class method
        RenderImageResource::image() returns the nullImage() if the image not
        available. This is because CachedImage::imageForRenderer() returns
        the nullImage() if the image is not available; see CachedImage.h. We should
        do the same for the derived class for consistency.

2017-08-04  Jeremy Jones  <jeremyj@apple.com>

        Use MPAVRoutingController instead of deprecated versions.
        https://bugs.webkit.org/show_bug.cgi?id=175063

        Reviewed by Tim Horton.

        No new tests because no behavior change. This uses a different platform class to present
        an interface.

        Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
        Add MPMediaControlsViewController.

        * platform/spi/ios/MediaPlayerSPI.h:

2017-08-04  Matt Baker  <mattbaker@apple.com>

        Web Inspector: REGRESSION (r220233): Check for null pointer passed to WebGLRenderingContextBase::deleteProgram
        https://bugs.webkit.org/show_bug.cgi?id=175196
        <rdar://problem/33727603>

        Reviewed by Devin Rousso.

        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::deleteProgram):

2017-08-04  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r220271.

        Rolling out due to Layout Test failing on iOS Simulator.

        Reverted changeset:

        "Remove STREAMS_API compilation guard"
        https://bugs.webkit.org/show_bug.cgi?id=175165
        http://trac.webkit.org/changeset/220271

2017-08-03  Sam Weinig  <sam@webkit.org>

        [Cleanup] Remove ScriptGlobalObject
        https://bugs.webkit.org/show_bug.cgi?id=175173

        Reviewed by Darin Adler.

        ScriptGlobalObject's two functions were only being used in
        four places. Three of those uses (ScriptGlobalObject::set in 
        InspectorFrontendClientLocal, WebInspectorUI, and RemoteWebInspectorUI)
        were merged into the new function addSelfToGlobalObjectInWorld on
        InspectorFrontendHost. The remaining function (ScriptGlobalObject::get
        in InspectorFrontendHost) was easily inlined.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/ScriptGlobalObject.cpp: Removed.
        * bindings/js/ScriptGlobalObject.h: Removed.
        Removed ScriptGlobalObject.

        * inspector/InspectorFrontendClientLocal.cpp:
        (WebCore::InspectorFrontendClientLocal::windowObjectCleared):
        Remove call to ScriptGlobalObject::set and use addSelfToGlobalObjectInWorld instead.

        * inspector/InspectorFrontendHost.h:
        * inspector/InspectorFrontendHost.cpp:
        (WebCore::InspectorFrontendHost::showContextMenu):
        Inline ScriptGlobalObject::get.

        (WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld):
        Add helper which inlines ScriptGlobalObject::set and works
        as a helper for the three inspector frontends.

2017-08-04  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r220268.

        This change caused assertion failures on macOS and iOS Debug
        WK2.

        Reverted changeset:

        "Resource Load Statistics: Report user interaction
        immediately, but only when needed"
        https://bugs.webkit.org/show_bug.cgi?id=175090
        http://trac.webkit.org/changeset/220268

2017-08-04  Youenn Fablet  <youenn@apple.com>

        Remove STREAMS_API compilation guard
        https://bugs.webkit.org/show_bug.cgi?id=175165

        Reviewed by Darin Adler.

        No change of behavior.

        * Configurations/FeatureDefines.xcconfig:
        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::consumeAsStream):
        * Modules/fetch/FetchBody.h:
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::isDisturbedOrLocked const):
        (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/ReadableByteStreamController.idl:
        * Modules/streams/ReadableByteStreamController.js:
        * Modules/streams/ReadableByteStreamInternals.js:
        * Modules/streams/ReadableStream.idl:
        * Modules/streams/ReadableStream.js:
        * Modules/streams/ReadableStreamBYOBReader.idl:
        * Modules/streams/ReadableStreamBYOBReader.js:
        * Modules/streams/ReadableStreamBYOBRequest.idl:
        * Modules/streams/ReadableStreamBYOBRequest.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::isReadableByteStreamAPIEnabled):
        (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
        * bindings/js/JSReadableStreamPrivateConstructors.cpp:
        * bindings/js/JSReadableStreamPrivateConstructors.h:
        * bindings/js/JSReadableStreamSourceCustom.cpp:
        * bindings/js/ReadableStreamDefaultController.cpp:
        * bindings/js/ReadableStreamDefaultController.h:
        * page/RuntimeEnabledFeatures.h:
        * testing/Internals.cpp:
        * testing/Internals.h:
        * testing/Internals.idl:

2017-08-04  Zan Dobersek  <zdobersek@igalia.com>

        [EME][GStreamer] Register ClearKey CDMFactory
        https://bugs.webkit.org/show_bug.cgi?id=175136

        Reviewed by Xabier Rodriguez-Calvar.

        Register the ClearKey CDM factory in CDMFactoryGStreamer. A CDMFactoryClearKey
        singleton object is introduced and used for that registration.

        The basic CDMFactoryClearKey and CDMPrivateClearKey methods are implemented,
        marking `org.w3.clearkey` as the supported key system and `keyids` as the
        supported init data type. Additional logic around key system configurations,
        distinctive identifiers, persistent state and related restrictions and
        requirements is implemented.

        This improves the ClearKey EME tests a bit, now progressing to the point of
        failing with a NotAllowedError exception due to the CDMInstance object failing
        to properly initialize because of missing implementation.

        No new tests -- relevant tests have underlying baselines updated to reflect
        changes in behavior.

        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::CDMFactoryClearKey::singleton):
        (WebCore::CDMFactoryClearKey::supportsKeySystem):
        (WebCore::CDMPrivateClearKey::supportsInitDataType const):
        (WebCore::CDMPrivateClearKey::supportsConfiguration const):
        (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const):
        (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const):
        (WebCore::CDMPrivateClearKey::supportsRobustness const):
        (WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement const):
        (WebCore::CDMPrivateClearKey::persistentStateRequirement const):
        * platform/encryptedmedia/clearkey/CDMClearKey.h:
        * platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp:
        (WebCore::CDMFactory::platformRegisterFactories):

2017-08-04  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Report user interaction immediately, but only when needed
        https://bugs.webkit.org/show_bug.cgi?id=175090
        <rdar://problem/33685546>

        Reviewed by Chris Dumez.

        Test: http/tests/loading/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::ResourceLoadObserver):
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
            Now tells the UI process immediately but also records that it has
            done so to avoid doing it when not needed.
        (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
            Conditional throttling gone, now always throttles.
        (WebCore::ResourceLoadObserver::notifyObserver):
            Renamed from ResourceLoadObserver::notificationTimerFired().
        (WebCore::ResourceLoadObserver::clearState):
            New function to allow the test runner to reset the web process'
            statistics state now that we keep track of whether or not we've
            reported user interaction to the UI process.
        (WebCore::ResourceLoadObserver::setShouldThrottleObserverNotifications): Deleted.
        (WebCore::ResourceLoadObserver::notificationTimerFired): Deleted.
        * loader/ResourceLoadObserver.h:
        (): Deleted.
        * testing/Internals.cpp:
        (WebCore::Internals::resetToConsistentState):
        (WebCore::Internals::setResourceLoadStatisticsShouldThrottleObserverNotifications): Deleted.
            No longer needed since user interaction is always communicated
            immediately.
        * testing/Internals.h:
        * testing/Internals.idl:

2017-08-04  Zan Dobersek  <zdobersek@igalia.com>

        [EME] Push CDMFactory into the platform layer
        https://bugs.webkit.org/show_bug.cgi?id=175129

        Reviewed by Xabier Rodriguez-Calvar.

        This is a follow-up to r219678 that moved the majority of CDM abstraction
        classes into the platform layer, but missed the CDMFactory class.

        The CDMFactory abstraction is now also placed in the platform layer. Only
        change to the interface is that the createCDM() method can't accept a CDM
        object reference anymore since that class is cemented into the WebCore
        layer, and no current implementation used it anyway.

        Additionally, the static Vector object of registered factories is moved
        under the CDMFactory class, along with the register and unregister
        functions. The platformRegisterFactories() function is added to allow for
        platform-specific factory registrations to occur when the registered
        factories are queried for the first time. Empty implementation for this
        function is provided for non-GStreamer platforms, while for GStreamer
        the implementation is kept in CDMFactoryGStreamer.cpp. It's still empty
        for now, but it will register the ClearKey factory there in the near
        future.

        No new tests -- none affected, only refactoring.

        * CMakeLists.txt:
        * Modules/encryptedmedia/CDM.cpp:
        (WebCore::createCDMPrivateForKeySystem):
        (WebCore::CDM::supportsKeySystem):
        (WebCore::CDM::CDM):
        (): Deleted.
        (WebCore::CDM::registerCDMFactory): Deleted.
        (WebCore::CDM::unregisterCDMFactory): Deleted.
        * Modules/encryptedmedia/CDM.h:
        (WebCore::CDMFactory::~CDMFactory): Deleted.
        * PlatformWPE.cmake:
        * platform/GStreamer.cmake:
        * platform/encryptedmedia/CDMFactory.cpp: Added.
        (WebCore::CDMFactory::registerFactory):
        (WebCore::CDMFactory::unregisterFactory):
        (WebCore::CDMFactory::platformRegisterFactories):
        * platform/encryptedmedia/CDMFactory.h: Added.
        (WebCore::CDMFactory::~CDMFactory):
        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::CDMFactoryClearKey::createCDM):
        * platform/encryptedmedia/clearkey/CDMClearKey.h:
        * platform/encryptedmedia/gstreamer/CDMFactoryGStreamer.cpp: Added.
        (WebCore::CDMFactory::platformRegisterFactories):
        * testing/MockCDMFactory.cpp:
        (WebCore::m_weakPtrFactory):
        (WebCore::MockCDMFactory::unregister):
        (WebCore::MockCDMFactory::createCDM):
        * testing/MockCDMFactory.h:

2017-08-04  Frederic Wang  <fwang@igalia.com>

        ScrollingTreeOverflowScrollingNodeIOS uses the wrong fixed position rectangle
        https://bugs.webkit.org/show_bug.cgi?id=175135

        Reviewed by Simon Fraser.

        This patch modifies ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll so
        that it uses the fixed position rectangle relative of the first frame ancestor instead of
        the one of the main frame. This makes it consistent with ScrollingTreeFrameScrollingNodeIOS
        and RenderLayerCompositor. This fixes some flickering issues on iOS.

        Test: fast/scrolling/ios/fixed-inside-overflow-inside-iframe.html

        * page/scrolling/ScrollingTreeFrameScrollingNode.h:
        (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Helper function to get the
        fixed position rect to use for that frame.
        * page/scrolling/ScrollingTreeNode.cpp:
        (WebCore::ScrollingTreeNode::enclosingFrameNode const): Helper function to get the enclosing
        frame for this scrolling node or null if there is none.
        * page/scrolling/ScrollingTreeNode.h: Declare enclosingFrameNode.

2017-08-04  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed. Removing redundant NotImplemented.h header inclusions
        and cleaning up whitespace issues in libgcrypt-specific CryptoKeyEC
        and CryptoKeyRSA implementation files.

        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:

2017-08-04  Jeremy Jones  <jeremyj@apple.com>

        Remove unnecesary call to status bar SPI.
        https://bugs.webkit.org/show_bug.cgi?id=175176
        rdar://problem/20887306

        Reviewed by Darin Adler.

        No new tests because no behavior change.

        This removes an obsolete call to SPI.

        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
        (VideoFullscreenInterfaceAVKit::cleanupFullscreen):

2017-08-03  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement CryptoKeyEC PKCS#8 imports
        https://bugs.webkit.org/show_bug.cgi?id=173647

        Reviewed by Jiewen Tan.

        No new tests -- affected tests are now passing and are unskipped.

        Implement libgcrypt-based support for PKCS#8 imports of EC keys.

        Existing libtasn1 utilities are used to achieve this. First, the provided key data
        is decoded against the PrivateKeyInfo ASN.1 definition. First, the version member
        of that structure is validated, followed by the algorithm member. The latter is
        also properly tested depending on this being an import of an ECDSA or ECDH key.

        Data of the parameters member is decoded against the ECParameters ASN.1 definition,
        and the namedCurve object identifier is validated, making sure it represents a
        valid EC curve and that this curve maches the one specified for the import
        operation.

        Data of the privateKey member is decoded against the ECPrivateKey ASN.1 definition.
        The version member of that structure is properly validated. The optional parameters
        member of that structure is already decoded against the ECParameters ASN.1
        definition. If present, it is checked to contain a valid EC curve identifier that
        matches the specified curve.

        The optional publicKey member of the ECPrivateKey structure is validated, testing
        that its data matches in size an uncompressed EC point, and that the first byte
        of this data is 0x04, as expected for an uncompressed EC point.

        What's left is the private key data on the initial ECPrivateKey structure. That
        data is retrieved and validated, making sure its size matches the size of the
        specified curve. The `private-key` s-expression is then constructed, embedding
        the curve name and the validated private key data. This s-expression is then used
        to construct an EC context.

        If the optional publicKey data was provided, it's used to set the `q` parameter
        for this EC context. Otherwise, the value for `q` is computed on-the-fly for the
        specified EC and the provided private key. The `q` point is then tested through
        the gcry_mpi_ec_curve_point() function, making sure that the derived point is
        indeed located on the given EC.

        Finally, with the private key properly validated, a new CryptoKeyEC object is
        constructed, using the `private-key` s-expression and the parameters that were
        specified for this import operation.

        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        (WebCore::CryptoKeyEC::platformImportPkcs8):
        * crypto/gcrypt/GCryptUtilities.h:

2017-08-03  Chris Dumez  <cdumez@apple.com>

        Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.' without a leading 0
        https://bugs.webkit.org/show_bug.cgi?id=175132

        Reviewed by Darin Adler.

        Fix parsing of <meta http-equiv=refresh> to allow time starting with a '.', without
        a leading 0. This is as per https://github.com/whatwg/html/pull/2852.

        The latest spec is at:
        - https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-http-equiv-refresh

        Test: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html

        * html/parser/HTMLParserIdioms.cpp:
        (WebCore::parseHTTPRefreshInternal):

2017-08-03  Brian Burg  <bburg@apple.com>

        Remove ENABLE(WEB_SOCKET) guards
        https://bugs.webkit.org/show_bug.cgi?id=167044

        Reviewed by Joseph Pecoraro.

        * Configurations/FeatureDefines.xcconfig:
        * Modules/websockets/ThreadableWebSocketChannel.cpp:
        * Modules/websockets/ThreadableWebSocketChannel.h:
        * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
        * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
        * Modules/websockets/WebSocket.cpp:
        * Modules/websockets/WebSocket.h:
        * Modules/websockets/WebSocket.idl:
        * Modules/websockets/WebSocketChannel.cpp:
        * Modules/websockets/WebSocketChannel.h:
        * Modules/websockets/WebSocketChannelClient.h:
        * Modules/websockets/WebSocketDeflateFramer.cpp:
        * Modules/websockets/WebSocketDeflateFramer.h:
        * Modules/websockets/WebSocketDeflater.cpp:
        * Modules/websockets/WebSocketDeflater.h:
        * Modules/websockets/WebSocketExtensionDispatcher.cpp:
        * Modules/websockets/WebSocketExtensionDispatcher.h:
        * Modules/websockets/WebSocketExtensionParser.cpp:
        * Modules/websockets/WebSocketExtensionParser.h:
        * Modules/websockets/WebSocketExtensionProcessor.h:
        * Modules/websockets/WebSocketFrame.cpp:
        * Modules/websockets/WebSocketFrame.h:
        * Modules/websockets/WebSocketHandshake.cpp:
        * Modules/websockets/WebSocketHandshake.h:
        * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
        * Modules/websockets/WorkerThreadableWebSocketChannel.h:
        * dom/Document.cpp:
        (WebCore::Document::Document):
        (WebCore::Document::idbConnectionProxy):
        (WebCore::Document::socketProvider):
        * dom/Document.h:
        * dom/ScriptExecutionContext.h:
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didSendWebSocketFrameImpl):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didSendWebSocketFrame):
        * inspector/InspectorNetworkAgent.cpp:
        * inspector/InspectorNetworkAgent.h:
        * page/RuntimeEnabledFeatures.cpp:
        (WebCore::RuntimeEnabledFeatures::webSocketEnabled const):
        * page/RuntimeEnabledFeatures.h:
        * page/SocketProvider.cpp:
        * page/SocketProvider.h:
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::WorkerGlobalScope):
        * workers/WorkerGlobalScope.h:
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::WorkerThread):
        (WebCore::WorkerThread::socketProvider):
        * workers/WorkerThread.h:

2017-08-03  Don Olmstead  <don.olmstead@sony.com>

        Remove LayoutUnit dependency in TextStream
        https://bugs.webkit.org/show_bug.cgi?id=175110

        Reviewed by Zalan Bujtas.

        No new tests. No change in behavior.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/LayoutUnit.cpp: Added.
        (WebCore::operator<<):
        * platform/LayoutUnit.h:
        * platform/text/TextStream.cpp:
        * platform/text/TextStream.h:

2017-08-03  Jeremy Jones  <jeremyj@apple.com>

        Improve WebKitLegacy video fullscreen animation begin and end rects.
        https://bugs.webkit.org/show_bug.cgi?id=175152
        rdar://problem/32840576

        Reviewed by Eric Carlson.

        No new tests, becuase this change has no effect on the DOM.

        This change uses different rects for fullscreen animation to prevent the animation
        from failing, and to improve the aesthetics of the animation.

        * platform/mac/WebVideoFullscreenController.mm:
        (frameExpandedToRatioOfFrame):
        (-[WebVideoFullscreenController enterFullscreen:]):
        (-[WebVideoFullscreenController exitFullscreen]):
        (-[WebVideoFullscreenWindow animateFromRect:toRect:withSubAnimation:controllerAction:]):
        (constrainFrameToRatioOfFrame): Deleted.

2017-08-03  Jer Noble  <jer.noble@apple.com>

        [EME][Mac] SecureStop left on disk in Private Browsing mode.
        https://bugs.webkit.org/show_bug.cgi?id=175162

        Reviewed by Eric Carlson.

        Return an empty string from mediaKeysStorageDirectory() when the page indicates that storage should
        be ephemeral(). Previously, an empty string in this case would be treated as an error. Instead, treat
        an empty string as valid, and do not try to store or retrieve session information to disk in that case.

        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
        (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory const):
        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
        (WebCore::CDMSessionAVContentKeySession::releaseKeys):
        (WebCore::CDMSessionAVContentKeySession::update):
        (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
        (WebCore::CDMSessionAVContentKeySession::contentKeySession):
        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
        (WebCore::CDMSessionMediaSourceAVFObjC::storagePath const):

2017-08-03  Youenn Fablet  <youenn@apple.com>

        [Fetch API] Add support for Request keepalive getter
        https://bugs.webkit.org/show_bug.cgi?id=175151

        Reviewed by Chris Dumez.

        Test: imported/w3c/web-platform-tests/fetch/api/request/request-keepalive.html

        Adding keepalive as a fetch option.
        Adding initialization and getter of keepalive into FetchRequest.

        * Modules/fetch/FetchRequest.cpp:
        (WebCore::buildOptions):
        * Modules/fetch/FetchRequest.h:
        * Modules/fetch/FetchRequest.idl:
        * loader/FetchOptions.h:

2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>

        [PAL] Move spi/cf directory into PAL
        https://bugs.webkit.org/show_bug.cgi?id=175057

        Reviewed by Antti Koivisto.

        * WebCore.xcodeproj/project.pbxproj:
        * loader/cocoa/DiskCacheMonitorCocoa.mm:
        * loader/cocoa/SubresourceLoaderCocoa.mm:
        * loader/mac/ResourceLoaderMac.mm:
        * platform/cf/CoreMediaSoftLink.cpp:
        * platform/cf/CoreMediaSoftLink.h:
        * platform/mac/PluginBlacklist.mm:
        * platform/mac/WebCoreNSStringExtras.mm:
        * platform/mac/WebGLBlacklist.mm:
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        * platform/network/NetworkStorageSession.h:
        * platform/network/cf/CookieJarCFNet.cpp:
        * platform/network/cf/CredentialStorageCFNet.cpp:
        * platform/network/cf/ResourceHandleCFNet.cpp:
        * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
        * platform/network/cf/ResourceRequestCFNet.cpp:
        * platform/network/cf/ResourceRequestCFNet.h:
        * platform/network/cf/ResourceResponse.h:
        * platform/network/cf/ResourceResponseCFNet.cpp:
        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
        * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
        * platform/network/cocoa/CookieStorageObserver.h:
        * platform/network/cocoa/CredentialCocoa.h:
        * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
        * platform/network/cocoa/ResourceRequestCocoa.mm:
        * platform/network/cocoa/ResourceResponseCocoa.mm:
        * platform/network/ios/ResourceRequestIOS.mm:
        * platform/network/mac/CookieJarMac.mm:
        * platform/network/mac/FormDataStreamMac.mm:
        * platform/network/mac/ResourceHandleMac.mm:
        * platform/network/mac/ResourceRequestMac.mm:
        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        * platform/network/mac/WebCoreURLResponse.h:
        * testing/cocoa/WebArchiveDumpSupport.mm:

2017-08-03  Youenn Fablet  <youenn@apple.com>

        Remove FETCH_API compilation guard
        https://bugs.webkit.org/show_bug.cgi?id=175154

        Reviewed by Chris Dumez.

        No change of behavior.

        * Configurations/FeatureDefines.xcconfig:
        * Modules/fetch/DOMWindowFetch.cpp:
        * Modules/fetch/DOMWindowFetch.h:
        * Modules/fetch/DOMWindowFetch.idl:
        * Modules/fetch/FetchBody.cpp:
        * Modules/fetch/FetchBody.h:
        * Modules/fetch/FetchBody.idl:
        * Modules/fetch/FetchBodyConsumer.cpp:
        * Modules/fetch/FetchBodyConsumer.h:
        * Modules/fetch/FetchBodyOwner.cpp:
        * Modules/fetch/FetchBodyOwner.h:
        * Modules/fetch/FetchHeaders.cpp:
        * Modules/fetch/FetchHeaders.h:
        * Modules/fetch/FetchHeaders.idl:
        * Modules/fetch/FetchInternals.js:
        * Modules/fetch/FetchLoader.cpp:
        * Modules/fetch/FetchLoader.h:
        * Modules/fetch/FetchLoaderClient.h:
        * Modules/fetch/FetchRequest.cpp:
        * Modules/fetch/FetchRequest.h:
        * Modules/fetch/FetchRequest.idl:
        * Modules/fetch/FetchResponse.cpp:
        * Modules/fetch/FetchResponse.h:
        * Modules/fetch/FetchResponse.idl:
        * Modules/fetch/FetchResponse.js:
        * Modules/fetch/FetchResponseSource.cpp:
        * Modules/fetch/FetchResponseSource.h:
        * Modules/fetch/WorkerGlobalScopeFetch.cpp:
        * Modules/fetch/WorkerGlobalScopeFetch.h:
        * Modules/fetch/WorkerGlobalScopeFetch.idl:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::fetchAPIEnabled const):

2017-08-03  Devin Rousso  <drousso@apple.com>

        Web Inspector: add button to open Inspector^2
        https://bugs.webkit.org/show_bug.cgi?id=175108

        Reviewed by Brian Burg.

        This patch just exposes a function to the inspector page. No new functionality was added.

        * inspector/InspectorFrontendHost.idl:
        * inspector/InspectorFrontendHost.h:
        * inspector/InspectorFrontendHost.cpp:
        (WebCore::InspectorFrontendHost::inspectInspector):

2017-08-03  Matt Baker  <mattbaker@apple.com>

        Web Inspector: Instrument WebGLProgram created/deleted
        https://bugs.webkit.org/show_bug.cgi?id=175059

        Reviewed by Devin Rousso.

        Tests: inspector/canvas/shaderProgram-add-remove-webgl.html
               inspector/canvas/shaderProgram-add-remove-webgl2.html

        This patch adds instrumentation to WebGLRenderingContextBase for tracking
        WebGLPrograms. A new helper class, InspectorShaderProgram, is used by
        the CanvasAgent to hold related data.

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

        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::createProgram):
        (WebCore::WebGLRenderingContextBase::deleteProgram):

        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::enable):
        (WebCore::InspectorCanvasAgent::frameNavigated):
        (WebCore::InspectorCanvasAgent::didCreateProgram):
        (WebCore::InspectorCanvasAgent::willDeleteProgram):
        (WebCore::InspectorCanvasAgent::clearCanvasData):
        (WebCore::InspectorCanvasAgent::unbindCanvas):
        (WebCore::InspectorCanvasAgent::unbindProgram):
        (WebCore::InspectorCanvasAgent::assertInspectorProgram):
        (WebCore::InspectorCanvasAgent::findInspectorProgram):
        * inspector/InspectorCanvasAgent.h:

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
        (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
        (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
        (WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl):
        (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
        (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
        (WebCore::InspectorInstrumentation::didCreateProgramImpl):
        (WebCore::InspectorInstrumentation::willDeleteProgramImpl):

        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
        (WebCore::InspectorInstrumentation::didCreateCSSCanvas):
        (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
        (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
        (WebCore::InspectorInstrumentation::didChangeCanvasMemory):
        (WebCore::InspectorInstrumentation::recordCanvasAction):
        (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrame):
        (WebCore::InspectorInstrumentation::didCreateProgram):
        (WebCore::InspectorInstrumentation::willDeleteProgram):

        * inspector/InspectorShaderProgram.cpp: Added.
        (WebCore::InspectorShaderProgram::create):
        (WebCore::InspectorShaderProgram::InspectorShaderProgram):
        (WebCore::InspectorShaderProgram::context const):
        * inspector/InspectorShaderProgram.h: Added.

2017-08-03  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r220209.

        This caused internal build failures.

        Reverted changeset:

        "Use MPAVRoutingController instead of deprecated versions."
        https://bugs.webkit.org/show_bug.cgi?id=175063
        http://trac.webkit.org/changeset/220209

2017-08-03  Brady Eidson  <beidson@apple.com>

        Add SW IDLs and stub out basic functionality.
        https://bugs.webkit.org/show_bug.cgi?id=175115

        Reviewed by Chris Dumez.

        No new tests (Currently no behavior change).

        Overall note: This feature is EnabledAtRuntime as opposed to EnabledBySetting because
        the Settings-based code generation is completely broken for non-Document contexts,
        whereas the RuntimeEnabledFeatures-based generation is not.
    
        * CMakeLists.txt:
        * Configurations/FeatureDefines.xcconfig:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:

        * bindings/scripts/preprocess-idls.pl: Handle the new global scope c'tor file.

        * bindings/js/JSServiceWorkerContainerCustom.cpp: Added.
        (WebCore::JSServiceWorkerContainer::ready const):

        * bindings/js/JSWorkerGlobalScopeBase.cpp:
        (WebCore::toJSWorkerGlobalScope): Refactor to handle both types of derived workers.
        (WebCore::toJSServiceWorkerGlobalScope):
        * bindings/js/JSWorkerGlobalScopeBase.h:

        * dom/EventNames.h:
        * dom/EventTargetFactory.in:

        * features.json: Change status of feature.

        * page/Navigator.idl:
        * page/NavigatorBase.cpp:
        (WebCore::NavigatorBase::serviceWorker):
        * page/NavigatorBase.h:
        * page/NavigatorServiceWorker.idl: Added.

        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::serviceWorkerEnabled const):
        (WebCore::RuntimeEnabledFeatures::setServiceWorkerEnabled):

        * workers/ServiceWorker.cpp: Added.
        (WebCore::ServiceWorker::postMessage):
        (WebCore::ServiceWorker::~ServiceWorker):
        (WebCore::ServiceWorker::scriptURL const):
        (WebCore::ServiceWorker::state const):
        (WebCore::ServiceWorker::eventTargetInterface const):
        (WebCore::ServiceWorker::scriptExecutionContext const):
        * workers/ServiceWorker.h: Added.
        * workers/ServiceWorker.idl: Added.

        * workers/ServiceWorkerContainer.cpp: Added.
        (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
        (WebCore::ServiceWorkerContainer::controller const):
        (WebCore::ServiceWorkerContainer::ready):
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::getRegistration):
        (WebCore::ServiceWorkerContainer::getRegistrations):
        (WebCore::ServiceWorkerContainer::startMessages):
        (WebCore::ServiceWorkerContainer::eventTargetInterface const):
        (WebCore::ServiceWorkerContainer::scriptExecutionContext const):
        * workers/ServiceWorkerContainer.h: Added.
        * workers/ServiceWorkerContainer.idl: Added.

        * workers/ServiceWorkerGlobalScope.cpp: Added.
        (WebCore::ServiceWorkerGlobalScope::registration):
        (WebCore::ServiceWorkerGlobalScope::skipWaiting):
        * workers/ServiceWorkerGlobalScope.h: Added.
        * workers/ServiceWorkerGlobalScope.idl: Added.

        * workers/ServiceWorkerRegistration.cpp: Added.
        (WebCore::ServiceWorkerRegistration::~ServiceWorkerRegistration):
        (WebCore::ServiceWorkerRegistration::installing):
        (WebCore::ServiceWorkerRegistration::waiting):
        (WebCore::ServiceWorkerRegistration::active):
        (WebCore::ServiceWorkerRegistration::scope const):
        (WebCore::ServiceWorkerRegistration::update):
        (WebCore::ServiceWorkerRegistration::unregister):
        (WebCore::ServiceWorkerRegistration::eventTargetInterface const):
        (WebCore::ServiceWorkerRegistration::scriptExecutionContext const):
        * workers/ServiceWorkerRegistration.h: Added.
        * workers/ServiceWorkerRegistration.idl: Added.

2017-08-03  Yoshiaki Jitsukawa  <jitsu@rd.scei.sony.co.jp>

        [WebCore] Sort Xcode project files
        https://bugs.webkit.org/show_bug.cgi?id=175121

        Reviewed by Antti Koivisto.

        * WebCore.xcodeproj/project.pbxproj:

2017-08-02  Sam Weinig  <sam@webkit.org>

        [WebIDL] Convert MutationCallback to be a normal generated callback
        https://bugs.webkit.org/show_bug.cgi?id=174140

        Reviewed by Darin Adler.

        To make this work more nicely, I:
        - Added the ability to for non-nullable interfaces in sequences to be passed
          via a Ref<> rather than a RefPtr<> as a parameter to a callback function.
          (e.g. callback MyCallback = void (sequence<Foo> foos) will now have the 
          signature, CallbackResult<void> handleEvent(const Vector<Ref<Foo>>&) rather
          than CallbackResult<void> handleEvent(const Vector<RefPtr<Foo>>&).
        - Added a new extended attribute for callback functions called [CallbackThisObject=Type]
          which allows you to specify that the callback needs a this object in addition
          to its arguments. When specified, the first argument of the C++ implementation
          function will now correspond to the this object, with the remaining arguments
          shifted over one.
        - Converted callback objects to all inherit directly from ActiveDOMCallback rather
          than having the generated JS callback derived class inherit from it. This allows
          us to have access to a callback's canInvokeCallback() function anywhere (needed
          for MutationCallback) as well as giving a place to put an optional virtual 
          visitJSFunction to allow marking weak callbacks (while not an ideal layering, 
          this matches what we do in EventListener). This change requires each callback to
          have a bit more code to import the ActiveDOMCallback's constructor and requires
          non-JS derived callbacks to pass a ScriptExecutionContext (e.g. the Document).

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSMutationCallback.cpp: Removed.
        * bindings/js/JSMutationCallback.h: Removed.
        Remove custom JSMutationCallback.h/cpp

        * Modules/geolocation/PositionCallback.h:
        * Modules/geolocation/PositionErrorCallback.h:
        * Modules/notifications/NotificationPermissionCallback.h:
        * Modules/webaudio/AudioBufferCallback.h:
        * Modules/webdatabase/DatabaseCallback.h:
        * Modules/webdatabase/SQLStatementCallback.h:
        * Modules/webdatabase/SQLStatementErrorCallback.h:
        * Modules/webdatabase/SQLTransactionCallback.h:
        * Modules/webdatabase/SQLTransactionErrorCallback.h:
        * css/MediaQueryListListener.h:
        * dom/NodeFilter.h:
        * dom/RequestAnimationFrameCallback.h:
        * dom/StringCallback.h:
        * fileapi/BlobCallback.h:
        * html/VoidCallback.h:
        * page/IntersectionObserverCallback.h:
        * page/PerformanceObserverCallback.h:
        Add ActiveDOMCallback as a base class. Import the ActiveDOMCallback constructor.

        * Modules/mediastream/MediaDevicesRequest.cpp:
        (WebCore::MediaDevicesRequest::filterDeviceList):
        (WebCore::MediaDevicesRequest::start):
        * Modules/mediastream/MediaDevicesRequest.h:
        Change filterDeviceList to take a Vector of Refs.

        * bindings/IDLTypes.h:
        Add InnerParameterType and NullableInnerParameterType type hooks
        and specialize wrappers to use Ref for InnerParameterType, and RefPtr
        for NullableInnerParameterType.

        * bindings/js/JSCallbackData.cpp:
        * bindings/js/JSCallbackData.h:
        Add support for passing a this object and give JSCallbackDataWeak a visitJSFunction
        to allow marking the underlying function.

        * bindings/js/JSMutationObserverCustom.cpp:
        (WebCore::JSMutationObserver::visitAdditionalChildren):
        (WebCore::constructJSMutationObserver): Deleted.
        Remove the custom constructor and replace it with a custom visitAdditionalChildren
        that calls the new ActiveDOMObject's visitJSFunction.

        * bindings/scripts/CodeGenerator.pm:
        (ParseType):
        Add helper to parse a type and cache the result.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateCallbackHeaderContent):
        (GenerateCallbackImplementationContent):
        (GetJSCallbackDataType): Deleted.
        - Add support for [CallbackThisObject]. When [CallbackThisObject] is not specified, use jsUndefined() 
          as the this object as specified by WebIDL.
        - Stop inheriting from ActiveDOMCallback now that callbacks need to do this themselves.
        - Add a visitJSFunction override for weak callback functions which calls into the callback data.

        * bindings/scripts/IDLAttributes.json:
        Add [CallbackThisObject].

        * bindings/scripts/IDLParser.pm:
        (ParseType):
        Add entry point to parse a single type.

        * css/FontFaceSet.h:
        Use Ref rather than RefPtr for the faces sequence.

        * dom/ActiveDOMCallback.h:
        (WebCore::ActiveDOMCallback::visitJSFunction):
        Add an optional visitJSFunction virtual function so that derived classes
        have a way of marking underlying function objects.

        * dom/MutationCallback.h:
        Convert to support generation (return a CallbackResult, inherit from ActiveDOMObject).

        * dom/MutationCallback.idl: Added.
        Added to generate the callback. Uses the new [CallbackThisObject].

        * dom/MutationObserver.cpp:
        (WebCore::MutationObserver::deliver):
        Switch to call idiomatic handleEvent, and pass *this as the first parameter
        which will be translated into the this object.

        * dom/MutationObserver.h:
        (WebCore::MutationObserver::callback):
        Expose the callback so it can marked during GC.

        * dom/MutationObserver.idl:
        Remove CustomConstructor and replace it with a custom mark function.

        * dom/NativeNodeFilter.cpp:
        * dom/NativeNodeFilter.h:
        * inspector/InspectorDatabaseAgent.cpp:
        Pass now needed ScriptExecutionContext to non-js based callbacks.

        * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: Added.
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: Added.
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.h:
        * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
        * bindings/scripts/test/TestCallbackFunctionWithThisObject.idl: Added.
        * bindings/scripts/test/TestCallbackInterface.idl:
        Add/update tests.

2017-08-03  Jeremy Jones  <jeremyj@apple.com>

        Use MPAVRoutingController instead of deprecated versions.
        https://bugs.webkit.org/show_bug.cgi?id=175063

        Reviewed by Tim Horton.

        No new tests because no behavior change. This uses a different platform class to present
        an interface.

        Remove deprecated MPAudioVideoRoutingPopoverController and MPAVRoutingSheet
        Add MPMediaControlsViewController.

        * platform/spi/ios/MediaPlayerSPI.h:

2017-08-03  Chris Dumez  <cdumez@apple.com>

        Improve our support for referrer policies
        https://bugs.webkit.org/show_bug.cgi?id=175069
        <rdar://problem/33677313>

        Reviewed by Darin Adler.

        Improve our support for referrer policies. In particular, we now support the
        additional following ones: "same-origin", "origin-when-cross-origin" and
        "strict-origin-when-cross-origin".

        This is as per the following specification:
        - https://www.w3.org/TR/referrer-policy/#referrer-policies

        Also refactor the code a bit for clarity: I merged the ReferrerPolicy enum and the
        FetchOptions::ReferrerPolicy one.

        Tests: http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http-http.html
               http/tests/referrer-policy/origin-when-cross-origin/cross-origin-http.https.html
               http/tests/referrer-policy/origin-when-cross-origin/same-origin.html
               http/tests/referrer-policy/same-origin/cross-origin-http-http.html
               http/tests/referrer-policy/same-origin/cross-origin-http.https.html
               http/tests/referrer-policy/same-origin/same-origin.html
               http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http-http.html
               http/tests/referrer-policy/strict-origin-when-cross-origin/cross-origin-http.https.html
               http/tests/referrer-policy/strict-origin-when-cross-origin/same-origin.html
               http/tests/referrer-policy/strict-origin/cross-origin-http-http.html
               http/tests/referrer-policy/strict-origin/cross-origin-http.https.html
               http/tests/referrer-policy/strict-origin/same-origin.html

        * Modules/fetch/FetchLoader.cpp:
        (WebCore::FetchLoader::start):
        * Modules/fetch/FetchReferrerPolicy.h:
        * Modules/fetch/FetchReferrerPolicy.idl:
        * Modules/fetch/FetchRequest.h:
        * Modules/fetch/FetchRequestInit.h:
        * dom/Document.cpp:
        (WebCore::Document::processReferrerPolicy):
        (WebCore::Document::applyQuickLookSandbox):
        (WebCore::Document::applyContentDispositionAttachmentSandbox):
        * dom/Document.h:
        * loader/FetchOptions.h:
        * loader/FrameNetworkingContext.h:
        * loader/PingLoader.cpp:
        (WebCore::PingLoader::sendBeacon):
        Drop explicit call to SecurityPolicy::shouldHideReferrer(). This is already called inside
        SecurityPolicy::generateReferrerHeader() and used only when needed, depending on the
        actual referrer policy.

        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
        * page/SecurityPolicy.cpp:
        (WebCore::referrerToOriginString):
        (WebCore::SecurityPolicy::generateReferrerHeader):
        * page/SecurityPolicy.h:
        * platform/ReferrerPolicy.h:

2017-08-03  Daniel Bates  <dabates@apple.com>

        Support ::marker pseudo-element
        https://bugs.webkit.org/show_bug.cgi?id=141477

        Reviewed by David Hyatt.

        Implements the ::marker pseudo element as per the CSS Pseudo-Element Module Level 4
        spec., <https://drafts.csswg.org/css-pseudo-4> (Editor's Draft, 24 July 2017).

        The ::marker pseudo element is a convenience pseudo element that allows a person to
        style the appearance of a list item marker. For example, to render all list item
        markers in bolded, blue text you would define a stylesheet with the following content:

        li::marker {
            color: blue;
            font-weight: bold;
        }

        and this could be applied to a page that contains markup of the form:

        <ol>
            <li>Item 1</li>
            <li>Item 2</li>
            ...
            <li>Item N-1</li>
            <li>Item N</li>
        </ol>

        Formerly to the achieve the same effect you would need to use a stylesheet of the form:

        li {
            color: blue;
            font-weight: bold;
        }

        .list-item-content {
            all: initial;
        }

        and then write your markup to have the form:

        <ol>
            <li><span class="list-item-content">Item 1</span></li>
            <li><span class="list-item-content">Item 2</span></li>
            ...
            <li><span class="list-item-content">Item N-1</span></li>
            <li><span class="list-item-content">Item N</span></li>
        </ol>

        The ::marker pseudo element only supports stylizing all font properties and the color property
        of a list item marker.

        Tests: fast/lists/list-marker-with-display.html
               http/wpt/css/css-pseudo-4/marker-and-other-pseudo-elements.html
               http/wpt/css/css-pseudo-4/marker-color.html
               http/wpt/css/css-pseudo-4/marker-font-properties.html
               http/wpt/css/css-pseudo-4/marker-inherit-values.html

        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::pseudoId): Return the pseudo id for the ::marker pseudo element.
        * css/CSSSelector.h: Add enumerator PseudoElementMarker to the pseudo element enum.
        * css/RuleSet.cpp:
        (WebCore::determinePropertyWhitelistType): Return whitelist type PropertyWhitelistMarker for ::marker
        so that we match rules against the acceptable rules for ::marker.
        * css/RuleSet.h: Add enumerator PropertyWhitelistMarker to the property whitelist type enum.
        * css/SelectorPseudoElementTypeMap.in: Add "marker" to the list of pseudo element types.
        * css/StyleResolver.cpp:
        (WebCore::isValidMarkerStyleProperty): Determines if the specified CSS property is valid inside ::marker.
        (WebCore::StyleResolver::CascadedProperties::addMatch): Only recognize CSS properties in the content block
        of ::marker that match the ::marker whitelist policy.
        * rendering/RenderListItem.cpp:
        (WebCore::RenderListItem::computeMarkerStyle): Computes the style object for the list item marker. We
        apply the user-agent style to the marker here as opposed to defining ::marker in the UA sheet as per
        the spec. as an optimization to avoid having the style resolver apply the pseudo element to all elements.
        For now, we always inherit style from the originating element (list item). Added FIXME to selectively
        inherit styles.
        (WebCore::RenderListItem::styleDidChange): Always apply the list marker style to the list marker renderer.
        * rendering/RenderListItem.h:
        * rendering/style/RenderStyleConstants.h: Add pseudo ID for the ::marker pseudo element.

2017-08-03  Antti Koivisto  <antti@apple.com>

        Factor common code in Style::*ChangeInvalidation into helper functions
        https://bugs.webkit.org/show_bug.cgi?id=174312

        Reviewed by Andreas Kling.

        There is a lot of copy code here.

        * Style/StyleInvalidationFunctions.h: Added.
        (WebCore::Style::traverseRuleFeaturesInShadowTree):
        (WebCore::Style::traverseRuleFeaturesForSlotted):
        (WebCore::Style::traverseRuleFeatures):

            Add functions for traversing rule features that may affect style of an element.
            Use lambdas to implement client-specific behavior.

        * WebCore.xcodeproj/project.pbxproj:
        * style/AttributeChangeInvalidation.cpp:
        (WebCore::Style::mayBeAffectedByAttributeChange):
        (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
        (WebCore::Style::mayBeAffectedByHostRules): Deleted.
        (WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
        * style/ClassChangeInvalidation.cpp:
        (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
        (WebCore::Style::mayBeAffectedByHostRules): Deleted.
        (WebCore::Style::mayBeAffectedBySlottedRules): Deleted.
        * style/IdChangeInvalidation.cpp:
        (WebCore::Style::IdChangeInvalidation::invalidateStyle):
        (WebCore::Style::mayBeAffectedByHostRules): Deleted.
        (WebCore::Style::mayBeAffectedBySlottedRules): Deleted.

2017-08-03  Zan Dobersek  <zdobersek@igalia.com>

        [EME] CDM constructor assigns CDMPrivate member multiple times
        https://bugs.webkit.org/show_bug.cgi?id=175128

        Reviewed by Xabier Rodriguez-Calvar.

        In the CDM class constructor, iterate over the registered CDM
        factories, finding one that supports the specified key system.
        A CDMPrivate object is created through that factory, and the
        iteration is now stopped at that point, while previously it
        contined to potentially create CDMPrivate objects through
        other factories.

        Helper createCDMPrivateForKeySystem() function is removed.

        * Modules/encryptedmedia/CDM.cpp:
        (WebCore::CDM::CDM):
        (WebCore::createCDMPrivateForKeySystem): Deleted.

2017-08-03  Emilio Cobos Álvarez  <ecobos@igalia.com>

        Don't always recalc the style of display: contents elements.
        https://bugs.webkit.org/show_bug.cgi?id=172753

        Reviewed by Antti Koivisto.

        No new tests (no functionality change). This only removes an
        inefficiency.

        * dom/Element.cpp:
        (WebCore::Element::existingComputedStyle):
        * dom/Element.h:
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateRenderTree):
        (WebCore::RenderTreeUpdater::updateElementRenderer):
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::renderOrDisplayContentsStyle):
        (WebCore::Style::TreeResolver::resolveElement):
        (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
        (WebCore::Style::shouldResolveElement):
        (WebCore::Style::TreeResolver::resolveComposedTree):

2017-08-02  Devin Rousso  <drousso@apple.com>

        Web Inspector: add stack trace information for each RecordingAction
        https://bugs.webkit.org/show_bug.cgi?id=174663

        Reviewed by Joseph Pecoraro.

        Tests: inspector/canvas/recording-2d.html
               inspector/model/recording.html

        * inspector/InspectorCanvas.h:
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::indexForData):
        (WebCore::InspectorCanvas::buildAction):

2017-08-02  Yusuke Suzuki  <utatane.tea@gmail.com>

        Merge WTFThreadData to Thread::current
        https://bugs.webkit.org/show_bug.cgi?id=174716

        Reviewed by Mark Lam.

        Use Thread::current() instead.

        * fileapi/AsyncFileStream.cpp:
        * platform/ThreadGlobalData.cpp:
        (WebCore::ThreadGlobalData::ThreadGlobalData):
        * platform/graphics/cocoa/WebCoreDecompressionSession.h:
        * platform/ios/wak/WebCoreThread.mm:
        (StartWebThread):
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::workerThread):

2017-08-02  Sam Weinig  <sam@webkit.org>

        Fix crashes in GC creating a document fragment on a background thread
        https://bugs.webkit.org/show_bug.cgi?id=175111

        Reviewed by Chris Dumez.

        r220095 (https://webkit.org/b/175006) change JSHTMLTemplateElement from using a
        private name + property to manager the lifetime of the reference DocumentFragment
        to using the idiomatic visitAdditionalChildren. Unfortunately, the function to access
        the DocumentFragment lazily creates it. If this lazy creation happens on a GC thread,
        badness ensues. This introduces an accessor that returns the DocumentFragment if it
        has been created or null if it has not.

        * bindings/js/JSHTMLTemplateElementCustom.cpp:
        (WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
        * html/HTMLTemplateElement.cpp:
        (WebCore::HTMLTemplateElement::contentIfAvailable):
        * html/HTMLTemplateElement.h:

2017-08-02  Sam Weinig  <sam@webkit.org>

        [WebIDL] Simplify [EnabledBySettings] extended attribute code to not require passing a global object to finishCreation
        https://bugs.webkit.org/show_bug.cgi?id=175087

        Reviewed by Chris Dumez.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):
        (GeneratePrototypeDeclaration):
        Remove unnecessary passing of the global object to finishCreation for [EnabledBySettings].

        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        Update tests.

2017-08-02  Andy Estes  <aestes@apple.com>

        REGRESSION (r207155): Unable to switch sheets when previewing Numbers '09 spreadsheets
        https://bugs.webkit.org/show_bug.cgi?id=175098
        <rdar://problem/31416763>

        Reviewed by Daniel Bates.

        r207155 enabled sandboxing on the frame displaying a QuickLook preview. This restricted
        frames within the sandbox from navigating their sandboxed siblings or ancestors, which
        breaks the functionality of multi-sheet Numbers '09 spreadsheet previews. These previews
        contain a frameset with a table of contents frame and a content frame, and the table of
        contents frame needs to be able to navigate the content frame when the sheet selection
        changes.

        Fix this by disabling the SandboxNavigation flag in the QuickLook sandbox. Frames within the
        sandbox will be able to navigate each other, but will not be able to navigate the top frame
        (due to SandboxTopNavigation still being enabled), nor will they be able to navigate any
        other ancestor frame outside the sandbox (due to QuickLook previews being in a different
        origin than the hosting frame). These two cases are covered by existing tests.

        Test: quicklook/multi-sheet-numbers-09.html

        * dom/Document.cpp:
        (WebCore::Document::applyQuickLookSandbox): Added a call to
        disableSandboxFlags(SandboxNavigation) after applying the content security policy.
        * dom/SecurityContext.h:
        (WebCore::SecurityContext::disableSandboxFlags): Defined disableSandboxFlags().

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

        [MSE] Removing samples when presentation order does not match decode order can cause bad behavior.
        https://bugs.webkit.org/show_bug.cgi?id=175091

        Reviewed by Eric Carlson.

        Address follow-up comments to r219519.

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

2017-08-02  Jeremy Jones  <jeremyj@apple.com>

        Remove unused and obsolete setting mediaDocumentEntersFullscreenAutomatically
        https://bugs.webkit.org/show_bug.cgi?id=175080

        Reviewed by Jon Lee.

        No new tests because this only removes unused code.

        This is obsolete because of the alternate solution in
        https://bugs.webkit.org/show_bug.cgi?id=174850

        * page/Settings.in:

2017-08-02  Filip Pizlo  <fpizlo@apple.com>

        GPUBuffer::length() should return the size of the array buffer backing the GPU buffer, not the rounded-up GPU buffer length
        https://bugs.webkit.org/show_bug.cgi?id=175079

        Reviewed by Simon Fraser.

        This fixes a failure in the GPU.BufferCreate unit test.
        
        The problem is that in order to have a Metal buffer wrap memory we allocated, we have to tell Metal
        that the memory is page-aligned. This means that the Metal buffer reports back a page-aligned size,
        which is different than what the test expected.
        
        It seems that it's most convenient for our GPUBuffer class to return the unaligned length, rather
        than the aligned length. This is just a simple matter of returning the length from the ArrayBuffer
        rather than the Metal buffer.
        
        This fixes the unit test and is probably more sensible for actual users of this class, since the page
        alignment of the length is a goofy implementation detail.

        * platform/graphics/cocoa/GPUBufferMetal.mm:
        (WebCore::GPUBuffer::length const):

2017-08-01  Brian Burg  <bburg@apple.com>

        HTML file input elements do not support file extensions in the "accept" attribute
        https://bugs.webkit.org/show_bug.cgi?id=95698
        <rdar://problem/12231850>

        Reviewed by Darin Adler.

        Serialize the accepted file extensions so they can be accessed in the UI process.

        * platform/FileChooser.h:
        * platform/FileChooser.cpp:
        (WebCore::FileChooser::invalidate): Modernize.
        (WebCore::FileChooserSettings::acceptTypes const): Deleted.
        This is dead code, it was only used by Chromium.

2017-08-02  Fujii Hironori  <Hironori.Fujii@sony.com>

        Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
        https://bugs.webkit.org/show_bug.cgi?id=175010
        <rdar://problem/33647818>

        Reviewed by Alex Christensen.

        No new tests because no behavior change.

        Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.

        * contentextensions/ContentExtensionParser.cpp:
        (WebCore::ContentExtensions::isValidCSSSelector):
        Call QualifiedName::init().
        * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp.
        * dom/QualifiedName.cpp:
        (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct
        instead of placement new.
        * dom/QualifiedName.h: Use LazyNeverDestroyed.

2017-08-01  Joseph Pecoraro  <pecoraro@apple.com>

        CFString leak dragging an image - allocation under PlatformPasteboard::writeObjectRepresentations
        https://bugs.webkit.org/show_bug.cgi?id=175064

        Reviewed by Tim Horton.

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::writeObjectRepresentations):
        Adopt a created string into the RetainPtr.

        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderRegistrationInfoList dealloc]):
        Release suggestedName and switch from -strong to -copy.

2017-08-01  Chris Dumez  <cdumez@apple.com>

        Unreviewed, update Beacon API status to "In Development".

        * features.json:

2017-08-01  Chris Dumez  <cdumez@apple.com>

        Add initial support for navigator.sendBeacon
        https://bugs.webkit.org/show_bug.cgi?id=175007
        <rdar://problem/33547728>

        Reviewed by Sam Weinig.

        Add initial support for navigator.sendBeacon behind an experimental
        feature runtime flag. The specification is available at:
        - https://w3c.github.io/beacon/

        The current implementation supports sending beacons with all types of
        payloads except for ReadableStream. Some functionality is incomplete
        and will be taken care of in follow-up patches:
        - Support for CORS preflight for the cases where it is required. We currently
          return false and do not send the beacon in such cases.
        - Better support for redirects.
        - Use a more power-friendly network priority for beacon requests.

        Tests: http/tests/blink/sendbeacon/*
               http/tests/security/mixedContent/beacon/insecure-beacon-in-iframe.html
               http/wpt/beacon/*
               imported/blink/fast/beacon/*
               imported/w3c/web-platform-tests/beacon/*

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/beacon/NavigatorBeacon.cpp: Added.
        (WebCore::NavigatorBeacon::sendBeacon):
        * Modules/beacon/NavigatorBeacon.h: Added.
        * Modules/beacon/NavigatorBeacon.idl: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * loader/PingLoader.cpp:
        (WebCore::PingLoader::sendBeacon):
        * loader/PingLoader.h:

2017-08-01  Filip Pizlo  <fpizlo@apple.com>

        Bmalloc and GC should put auxiliaries (butterflies, typed array backing stores) in a gigacage (separate multi-GB VM region)
        https://bugs.webkit.org/show_bug.cgi?id=174727

        Reviewed by Mark Lam.

        No new tests because no change in behavior.
        
        Needed to teach Metal how to allocate in the Gigacage.

        * platform/graphics/cocoa/GPUBufferMetal.mm:
        (WebCore::GPUBuffer::GPUBuffer):
        (WebCore::GPUBuffer::contents):

2017-08-01  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] Implement Font::platformBoundsForGlyph
        https://bugs.webkit.org/show_bug.cgi?id=174813

        Reviewed by Alex Christensen.

        Test: fast/text/emphasis.html

        * platform/graphics/win/SimpleFontDataCairoWin.cpp:
        (WebCore::Font::platformBoundsForGlyph): Implemented by copying
        the code from Font::boundsForGDIGlyph().

2017-08-01  Zalan Bujtas  <zalan@apple.com>

        REGRESSION (r217197): New Yorker website hangs for a long time on load, lots of blank tiles
        https://bugs.webkit.org/show_bug.cgi?id=175009
        <rdar://problem/33505791>

        Reviewed by Simon Fraser.

        This patch ensures that we report the desktop, non-frame-flattened frame size for media queries in subframes.
        Some websites don't expect the iframes to be expanded to the size of the content and when the media query
        callback mutates the content (triggering frame resize), they might end up getting into a never ending layout.

        Test: fast/frames/flattening/media-query-growing-content.html

        * css/MediaQueryEvaluator.cpp:
        (WebCore::orientationEvaluate):
        (WebCore::aspectRatioEvaluate):
        (WebCore::heightEvaluate):
        (WebCore::widthEvaluate):
        * page/FrameView.cpp:
        (WebCore::FrameView::layout):
        (WebCore::FrameView::layoutSizeForMediaQuery const):
        (WebCore::FrameView::evaluateMediaQueryList):
        * page/FrameView.h:

2017-07-26  Jiewen Tan  <jiewen_tan@apple.com>

        Add tests to detect mistakes in backward compatibility when the structured clone algorithm is changed in the future
        https://bugs.webkit.org/show_bug.cgi?id=173998

        Reviewed by Darin Adler.

        * bindings/js/SerializedScriptValue.cpp:
        Add a comment.

2017-08-01  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r220089.

        This caused multiple crashes on macOS Debug testers.

        Reverted changeset:

        "Use LazyNeverDestroyed instead of DEFINE_GLOBAL for
        QualifiedName"
        https://bugs.webkit.org/show_bug.cgi?id=175010
        http://trac.webkit.org/changeset/220089

2017-08-01  Sam Weinig  <sam@webkit.org>

        [WebIDL] Swap a custom attribute for a custom mark function for HTMLTemplateElement
        https://bugs.webkit.org/show_bug.cgi?id=175006

        Reviewed by Chris Dumez.

        Use the standard way of augmenting GC, visitAdditionalChildren, rather
        than using a private name to create ownership.

        * bindings/js/JSHTMLTemplateElementCustom.cpp:
        (WebCore::JSHTMLTemplateElement::visitAdditionalChildren):
        (WebCore::JSHTMLTemplateElement::content const): Deleted.
        * html/HTMLTemplateElement.idl:

2017-08-01  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Gather crypto constants in a single location
        https://bugs.webkit.org/show_bug.cgi?id=174091

        Reviewed by Jiewen Tan.

        Gather common constants used across the libgcrypt-specific Web Crypto
        implementations in a single place -- in the GCryptUtilities.h header,
        inside the CryptoConstants namespace. The various ASN.1 object identifiers
        and other helper values are placed inside, in the std::array<uint8_t, N>
        container.

        Additionally, CryptoConstants::matches() helper function is provided. It
        compares the provided data-and-size pair with the given std::array
        container and returns true if the std::memcmp() call returns 0.

        Changes in CryptoKeyEC and CryptoKeyRSA consist mostly of switching to the
        use of CryptoConstants::matches() and the CryptoConstants data arrays, as
        well as some whitespace cleanup.

        Additionallity in CryptoKeyEC, the helper functions covering various curve
        attributes are reordered, renamed and reorganized for simplicity.

        No new tests -- no changes in behavior.

        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        (WebCore::curveIdentifier):
        (WebCore::curveSize):
        (WebCore::curveUncompressedFieldElementSize):
        (WebCore::curveUncompressedPointSize):
        (WebCore::CryptoKeyEC::platformImportRaw):
        (WebCore::CryptoKeyEC::platformImportJWKPublic):
        (WebCore::CryptoKeyEC::platformImportJWKPrivate):
        (WebCore::supportedAlgorithmIdentifier):
        (WebCore::curveForIdentifier):
        (WebCore::CryptoKeyEC::platformImportSpki):
        (WebCore::CryptoKeyEC::platformExportRaw):
        (WebCore::CryptoKeyEC::platformAddFieldElements):
        (WebCore::CryptoKeyEC::platformExportSpki):
        (WebCore::CryptoKeyEC::platformExportPkcs8):
        (WebCore::uncompressedPointSizeForCurve): Deleted.
        (WebCore::uncompressedFieldElementSizeForCurve): Deleted.
        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
        (WebCore::supportedAlgorithmIdentifier):
        (WebCore::CryptoKeyRSA::importPkcs8):
        (WebCore::CryptoKeyRSA::exportSpki):
        (WebCore::CryptoKeyRSA::exportPkcs8):
        * crypto/gcrypt/GCryptUtilities.h:
        (WebCore::CryptoConstants::matches):

2017-07-31  Fujii Hironori  <Hironori.Fujii@sony.com>

        Use LazyNeverDestroyed instead of DEFINE_GLOBAL for MediaFeatureNames
        https://bugs.webkit.org/show_bug.cgi?id=175008

        Reviewed by Alex Christensen.

        No new tests because no behavior change.

        Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.

        * css/MediaFeatureNames.cpp:
        (WebCore::MediaFeatureNames::init): Do not include
        <wtf/StaticConstructors.h>. Use LazyNeverDestroyed instead of
        DEFINE_GLOBAL. Call LazyNeverDestroyed::construct instead of
        placement new.
        * css/MediaFeatureNames.h: Use LazyNeverDestroyed.
        * css/MediaQueryEvaluator.cpp:
        (WebCore::MediaQueryEvaluator::evaluate const): Dereference with ->.

2017-07-31  Fujii Hironori  <Hironori.Fujii@sony.com>

        Use LazyNeverDestroyed instead of DEFINE_GLOBAL for QualifiedName
        https://bugs.webkit.org/show_bug.cgi?id=175010

        Reviewed by Alex Christensen.

        No new tests because no behavior change.

        Stop using DEFINE_GLOBAL hack in favor of LazyNeverDestroyed.

        * dom/DOMAllInOne.cpp: Remove the warning. Include QualifiedName.cpp.
        * dom/QualifiedName.cpp:
        (WebCore::QualifiedName::init): Call LazyNeverDestroyed::construct
        instead of placement new.
        * dom/QualifiedName.h: Use LazyNeverDestroyed.

2017-07-31  Matt Rajca  <mrajca@apple.com>

        Support quirk for letting media autoplay if the user interacted with at least one media element.
        https://bugs.webkit.org/show_bug.cgi?id=175005
        <rdar://problem/33476038>

        Reviewed by Eric Carlson.

        If the user has interacted with at least one media element, let other media elements auto-play
        as a quirk.

        * dom/Document.cpp:
        (WebCore::Document::updateIsPlayingMedia):
        * dom/Document.h:
        (WebCore::Document::noteUserInteractionWithMediaElement):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
        * html/MediaElementSession.cpp:
        (WebCore::needsDocumentLevelMediaUserGestureQuirk):
        (WebCore::MediaElementSession::playbackPermitted const):
        * page/MediaProducer.h:

2017-07-31  Nan Wang  <n_wang@apple.com>

        AX: CFEqual is failing on text markers with exact same data
        https://bugs.webkit.org/show_bug.cgi?id=175002
        <rdar://problem/33636985>

        Reviewed by Chris Fleizach.

        We should zero the memory of the TextMarkerData instance so that it
        can be tested for byte-equivalence.

        Made sure this change won't break any of the existing tests.

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
        (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):

2017-07-28  Matt Rajca  <mrajca@apple.com>

        Propagate user gesture tokens when script elements are loaded.
        https://bugs.webkit.org/show_bug.cgi?id=174959

        Reviewed by Eric Carlson.

        Propagate user gesture tokens when script elements are loaded (i.e. between the time an
        element is created and its onload handler is invoked).

        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::ScriptElement):
        (WebCore::ScriptElement::dispatchLoadEventRespectingUserGestureIndicator):
        (WebCore::ScriptElement::executeScriptAndDispatchEvent):
        (WebCore::ScriptElement::executePendingScript):
        * dom/ScriptElement.h:

2017-07-31  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r220048.

        This revision caused multiple crashes in fast/images. See
        webkit.org/b/174990

        Reverted changeset:

        "RenderImageResourceStyleImage::image() should return the
        nullImage() if the image is not available"
        https://bugs.webkit.org/show_bug.cgi?id=174874
        http://trac.webkit.org/changeset/220048

2017-07-31  Sam Weinig  <sam@webkit.org>

        Remove unnecessary exceptions from storage code
        https://bugs.webkit.org/show_bug.cgi?id=174572

        Reviewed by Chris Dumez.

        Remove checks for canAccessStorage() and the exceptions they would cause.
        These were used for Storage in ephemeral sessions, but they are now supported.
        Add checks for a null frame to functions that can mutate the storage, as the
        frame is needed for that, and it retains our existing behavior for disconnected
        frames. By removing these checks / exceptions, we can fully generate Storage.idl.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSStorageCustom.cpp: Removed.
        Remove JSStorageCustom.cpp

        * loader/EmptyClients.cpp:
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::sessionStorage):
        (WebCore::DOMWindow::localStorage):
        * storage/StorageArea.h:
        Remove canAccessStorage.

        * storage/Storage.cpp:
        (WebCore::Storage::length):
        (WebCore::Storage::key):
        (WebCore::Storage::getItem):
        (WebCore::Storage::setItem):
        (WebCore::Storage::removeItem):
        (WebCore::Storage::clear):
        (WebCore::Storage::contains):
        (WebCore::Storage::isSupportedPropertyName):
        (WebCore::Storage::supportedPropertyNames):
        * storage/Storage.h:
        * storage/Storage.idl:
        Remove canAccessStorage checks and corresponding exceptions. Add supportedPropertyNames
        to allow the removal of the [CustomGetOwnPropertyNames].

2017-07-31  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r220060.

        This broke our internal builds. Contact reviewer of patch for
        more information.

        Reverted changeset:

        "Merge WTFThreadData to Thread::current"
        https://bugs.webkit.org/show_bug.cgi?id=174716
        http://trac.webkit.org/changeset/220060

2017-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>

        Merge WTFThreadData to Thread::current
        https://bugs.webkit.org/show_bug.cgi?id=174716

        Reviewed by Sam Weinig.

        Use Thread::current() instead.

        * fileapi/AsyncFileStream.cpp:
        * platform/ThreadGlobalData.cpp:
        (WebCore::ThreadGlobalData::ThreadGlobalData):
        * platform/graphics/cocoa/WebCoreDecompressionSession.h:
        * platform/ios/wak/WebCoreThread.mm:
        (StartWebThread):
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::workerThread):

2017-07-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>

        Created a bool pretty printer at WTF for debugging purposes
        https://bugs.webkit.org/show_bug.cgi?id=174893

        Reviewed by Darin Adler.

        Use WTF::boolPrettyPrinter in debugging messages.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
        (WebCore::MediaPlayerPrivateGStreamerMSE::seek):

2017-07-30  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed. Suppress the -Wextra compiler warning when building with GCC 6.3.0,
        explicitly initializing the RefCounted<> base class in the
        FetchHeaders(const FetchHeaders&) constructor.

        Note that while that's the signature of the copy constructor for the FetchHeaders
        class, the base RefCounted<> class is not copyable, so the default RefCounted<>
        constructor is used, but the FetchHeaders resources are normally copied into the
        new object from the one that's passed in.

        * Modules/fetch/FetchHeaders.h:
        (WebCore::FetchHeaders::FetchHeaders):

2017-07-30  Darin Adler  <darin@apple.com>

        Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout
        https://bugs.webkit.org/show_bug.cgi?id=130653

        Reviewed by Antti Koivisto.

        Also fixes a bug where load events are delivered prematurely in some cases
        when an object, embed, frame, or iframe element is still loading.

        * dom/Document.cpp:
        (WebCore::Document::loadEventDelayTimerFired): Added a call to
        FrameLoader::checkLoadComplete. Goes along with the change to
        FrameLoader::checkLoadCompleteForThisFrame, which now respects the
        isDelayingLoadEvent flag.

        * html/HTMLAppletElement.cpp:
        (WebCore::HTMLAppletElement::HTMLAppletElement): Removed the createdByParser argument,
        no longer needed by the base class.
        (WebCore::HTMLAppletElement::create): Added call to finishCreating, which is now part of
        the process of creating any object in a class derived from HTMLPlugInImageElement.
        (WebCore::HTMLAppletElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
        is only called when it's becoming false; avoids a false/true/false round trip that can
        cause trouble.
        * html/HTMLAppletElement.h: Updated for the above.

        * html/HTMLEmbedElement.cpp:
        (WebCore::HTMLEmbedElement::HTMLEmbedElement): Removed the createdByParser argument,
        no longer needed by the base class.
        (WebCore::HTMLEmbedElement::create): Added call to finishCreating, which is now part of
        the process of creating any object in a class derived from HTMLPlugInImageElement.
        (WebCore::HTMLEmbedElement::parseAttribute): Changed srcAttr to call
        updateImageLoaderWithNewURLSoon to do the image loading logic.
        (WebCore::HTMLEmbedElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
        is only called when it's becoming false; avoids a false/true/false round trip that can
        cause trouble.
        * html/HTMLEmbedElement.h: Updated for the above.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::setReadyState): Call setShouldDelayLoadEvent(false) when
        transitioning to HAVE_CURRENT_DATA (or beyond), even if we have already fired a loadeddata
        event in the past. This matches what the HTML specification calls for, but only if you
        read it carefully. Without this change, and with the more complete implementation of
        load event delay below, one of the regression tests hangs because are permanently stuck
        dealying load events. Also added a FIXME about other code that likely has a similar
        problem; the symptom is likely to be subtle and minor, though.

        * html/HTMLObjectElement.cpp:
        (WebCore::HTMLObjectElement::HTMLObjectElement): Removed the createdByParser argument,
        no longer needed by the base class.
        (WebCore::HTMLObjectElement::create): Added call to finishCreating, which is now part of
        the process of creating any object in a class derived from HTMLPlugInImageElement.
        (WebCore::HTMLObjectElement::parseAttribute): Changed dataAttr to use
        updateImageLoaderWithNewURLSoon. Explicitly call scheduleUpdateForAfterStyleResolution
        since just calling invalidateStyleAndRenderersForSubtree alone is no longer sufficient.
        (WebCore::HTMLObjectElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
        is only called when it's becoming false; avoids a false/true/false round trip that can
        cause trouble.
        (WebCore::HTMLObjectElement::childrenChanged): Added calls to the new
        scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
        (WebCore::HTMLObjectElement::renderFallbackContent): Remove the call to
        updateStyleIfNeeded. This is the main change that the title of this bug refers to.
        * html/HTMLObjectElement.h: Updated for the above. Also removed the
        clearUseFallbackContent function because it's clearer to set the data member in
        line at the single call site in HTMLObjectElement::parseAttribute.

        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Removed the createdByParser
        argument; no need to set an m_needsWidgetUpdate flag differently for parser cases now.
        (WebCore::HTMLPlugInImageElement::finshCreating): Added. To be called after creating
        an element to do work that can't be done in a constructor.
        (WebCore::HTMLPlugInImageElement::didRecalcStyle): Added. Calls the new
        scheduleUpdateForAfterStyleResolution function.
        (WebCore::HTMLPlugInImageElement::didAttachRenderers): Moved all the logic from this
        function into scheduleUpdateForAfterStyleResolution. Also added a call through to the base
        class; cleans things up, even though it's just an assertion.
        (WebCore::HTMLPlugInImageElement::willDetachRenderers): Removed the call to
        setNeedsWidgetUpdate(true) here; no longer needed because the new logic already
        does the right thing in this case.
        (WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary): Deleted. Now handled by
        updateAfterStyleResolution instead.
        (WebCore::HTMLPlugInImageElement::finishParsingChildren): Deleted. Handling updates
        after parsing all the children now comes naturally out of the new implementation.
        (WebCore::HTMLPlugInImageElement::scheduleUpdateForAfterStyleResolution): Added.
        Schedules a call to updateAfterStyleResolution when needed, and equally importantly,
        increments the load event delay count to make sure that loads that are part of that
        update can participate in decision about whether it's time for the load event.
        (WebCore::HTMLPlugInImageElement::updateAfterStyleResolution): Added.
        Combines updateWidgetIfNecessary and startLoadingImage, and also deals with the new
        m_needsImageReload boolean in cases where no actual loading is done.
        (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Update load event delay
        count when moving an element that is in the middle of loading. This lets the
        updateAfterStyleResolution function do the right thing even when the element is
        moved without leaving anything stuck in a strange state.
        (WebCore::HTMLPlugInImageElement::prepareForDocumentSuspension): Call the new
        scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
        (WebCore::HTMLPlugInImageElement::startLoadingImage): Deleted. Now handled by
        updateAfterStyleResolution instead.
        (WebCore::HTMLPlugInImageElement::updateImageLoaderWithNewURLSoon): Added. Does all
        the right things for when an image URL is changed; for use by the concrete derived classes.
        * html/HTMLPlugInImageElement.h: Updated for above changes. Also made m_imageLoader
        private rather than protected, and added the two new boolean data members.

        * html/HTMLTagNames.in: Removed unneeded constructorNeedsCreatedByParser flags for
        applet, embed, and object.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::isLoadingInAPISense): Return true if the document is
        delaying a load event.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Don't do any work if
        isDelayingLoadEvent is true; otherwise this function can have a side effect of
        triggering the load event.
        (WebCore::FrameLoader::detachFromParent): Schedule a checkLoadComplete here, too, not
        just a checkCompleted. This is relevant if the frame we are detaching was delaying
        a load event because it no longer will be and so the load might be complete.

2017-07-30  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove JS builtin bindings for FetchRequest, DOMWindowFetch and WorkerGlobalScopeFetch
        https://bugs.webkit.org/show_bug.cgi?id=174974

        Reviewed by Darin Adler.

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * Modules/fetch/DOMWindowFetch.js: Removed.
        * Modules/fetch/FetchRequest.js: Removed.
        * Modules/fetch/WorkerGlobalScopeFetch.js: Removed.
        Remove builtin files.

        * Modules/fetch/DOMWindowFetch.cpp:
        (WebCore::DOMWindowFetch::fetch):
        * Modules/fetch/DOMWindowFetch.h:
        * Modules/fetch/DOMWindowFetch.idl:
        * Modules/fetch/WorkerGlobalScopeFetch.cpp:
        (WebCore::WorkerGlobalScopeFetch::fetch):
        * Modules/fetch/WorkerGlobalScopeFetch.h:
        * Modules/fetch/WorkerGlobalScopeFetch.idl:
        Remove builtin and instead create FetchRequest in the implementation.

        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::extract):
        * Modules/fetch/FetchBody.h:
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::extractBody):
        * Modules/fetch/FetchBodyOwner.h:
        * Modules/fetch/FetchResponse.cpp:
        * Modules/fetch/FetchResponse.h:
        Rename FetchBody::BindingDataType to FetchBody::Init to match its IDL naming.

        * Modules/fetch/FetchHeaders.cpp:
        (WebCore::appendToHeaderMap):
        (WebCore::fillHeaderMap):
        (WebCore::FetchHeaders::create):
        (WebCore::FetchHeaders::fill):
        * Modules/fetch/FetchHeaders.h:
        Add helpers to implement the fill algorithm for various input types.
        Leave the existing fill for now, as it is still used by the FetchResponse
        builtin, but will eventually be removed.

        * Modules/fetch/FetchRequest.cpp:
        (WebCore::FetchRequest::initializeOptions):
        (WebCore::FetchRequest::initializeWith):
        (WebCore::FetchRequest::setBody):
        (WebCore::FetchRequest::create):
        (WebCore::FetchRequest::setBodyFromInputRequest): Deleted.
        * Modules/fetch/FetchRequest.h:
        Migrate builtin code to the implementation. This is 1-to-1 re-implementation,
        so I did not attempt to fix any conformance issues. That will come in follow up.

        * Modules/fetch/FetchRequest.idl:
        Replace builtins with an IDL constructor.

        * Modules/fetch/FetchRequestInit.h:
        * Modules/fetch/FetchRequestInit.idl:
        Add missing headers and body to FetchRequestInit.

2017-07-30  Said Abou-Hallawa  <sabouhallawa@apple.com>

        RenderImageResourceStyleImage::image() should return the nullImage() if the image is not available
        https://bugs.webkit.org/show_bug.cgi?id=174874
        <rdar://problem/33530130>

        Reviewed by Darin Adler.

        If an <img> element has image content data for a none cached image, e.g.
        -webkit-named-image, RenderImageResourceStyleImage will be created and 
        attached to the RenderImage. RenderImageResourceStyleImage::m_cachedImage
        will be set to null because the m_styleImage->isCachedImage() is false in
        this case. When ImageLoader finishes loading the url of the src attribute, 
        RenderImageResource::setCachedImage() will be called to set m_cachedImage.

        A crash will happen when the RenderImage is destroyed. Destroying the 
        RenderImage calls RenderImageResourceStyleImage::shutdown() which checks
        m_cachedImage and finds it not null, so it calls RenderImageResourceStyleImage::image()
        which ends up calling CSSNamedImageValue::image() which returns a null pointer
        because the size is empty. RenderImageResourceStyleImage::shutdown() calls
        image()->stopAnimation() without checking the return value of image().

        Like the base class virtual method RenderImageResource::image(), 
        RenderImageResourceStyleImage::image() should return the nullImage() if
        the image is not available.

        Test: fast/images/image-element-image-content-data.html

        * css/CSSCrossfadeValue.cpp:
        * css/CSSFilterImageValue.cpp:
        * page/EventHandler.cpp:
        * page/PageSerializer.cpp:
        * rendering/RenderElement.cpp:
        * rendering/RenderImageResource.cpp:
        * rendering/RenderImageResourceStyleImage.cpp:
        (WebCore::RenderImageResourceStyleImage::initialize):

        (WebCore::RenderImageResourceStyleImage::shutdown): Revert back the changes
        of r208511 in this function. Add a call to image()->stopAnimation() without
        checking the return of image() since it will return the nullImage() if
        the image not available. There is no need to check m_cachedImage before 
        calling image() because image() does not check or access m_cachedImage.

        (WebCore::RenderImageResourceStyleImage::image): The base class method
        RenderImageResource::image() returns the nullImage() if the image not
        available. This is because CachedImage::imageForRenderer() returns
        the nullImage() if the image is not available; see CachedImage.h. We should
        do the same for the derived class for consistency.

        * rendering/style/ContentData.cpp:
        * rendering/style/StyleCachedImage.cpp:
        * style/StylePendingResources.cpp:

2017-07-29  Filip Pizlo  <fpizlo@apple.com>

        Unreviewed, rollout r220044 because it set the bots on fire.
        
        It seems that the "-Wunguarded-availability-new" pragma is not widely supported. So, a bunch of the
        Mac bots are now unable to build and that includes EWS.
        
        Fixing by rolling it out.

        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
        (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
        (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
        (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
        (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
        (WebCore::SourceBufferPrivateAVFObjC::flush):

2017-07-29  Dan Bernstein  <mitz@apple.com>

        Fixed building for macOS 10.12 with the macOS 10.13 SDK.

        Suppressed the unguarded-availability-new warning around uses of AVSampleBufferAudioRenderer
        and AVSampleBufferRenderSynchronizer. Even though the 10.13 SDK declares them as available
        starting in that release, they have been available as SPI earlier.

        * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer):
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
        (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
        (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
        (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
        (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
        (WebCore::SourceBufferPrivateAVFObjC::flush):

2017-07-29  Nan Wang  <n_wang@apple.com>

        AX: findMatchingObjects doesn't work when the startObject is ignored
        https://bugs.webkit.org/show_bug.cgi?id=174965

        Reviewed by Chris Fleizach.

        findMatchingObjects would return a wrong element if we pass in an ignored
        start object. To fix this, we should use the closest accessible sibling as 
        the start object.

        Test: accessibility/mac/search-predicate-from-ignored-element.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::appendChildrenToArray):

2017-07-29  Aaron Chu  <aaron_chu@apple.com>

        AX: FKA: Buttons need a visible focus indicator
        https://bugs.webkit.org/show_bug.cgi?id=171040
        <rdar://problem/30922548>

        Reviewed by Antoine Quint.

        Added a background color for the focus state of the icon buttons in modern media controls.

        Test: media/modern-media-controls/button/button-focus-state.html

        * Modules/modern-media-controls/controls/button.css:
        (button:focus):
        (button:focus > picture):
        * Modules/modern-media-controls/controls/slider.css:
        (.slider > input):

2017-07-28  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove JS builtin bindings for FetchHeaders
        https://bugs.webkit.org/show_bug.cgi?id=174905

        Reviewed by Alex Christensen.

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * Modules/fetch/FetchHeaders.js: Removed.
        Remove FetchHeaders.js

        * Modules/fetch/FetchHeaders.cpp:
        (WebCore::appendToHeaderMap):
        (WebCore::FetchHeaders::create):
        (WebCore::FetchHeaders::append):
        * Modules/fetch/FetchHeaders.h:
        (WebCore::FetchHeaders::FetchHeaders):
        Add create function for generated constructor.
        Add appendToHeaderMap static function which takes the functionality
        from the existing append function, and makes it useable in create.

        * Modules/fetch/FetchHeaders.idl:
        Replace [JSBuiltinConstructor] with real constructor. Keep other builtin
        attributes as they are still used by other Fetch code.

        * bindings/js/JSDOMConvertRecord.h:
        Fix record conversion to work with proxies by changing to use the method table
        for getOwnPropertyNames, and undefined values by not excluding undefined values. 

2017-07-28  Matt Baker  <mattbaker@apple.com>

        Web Inspector: capture an async stack trace when web content calls addEventListener
        https://bugs.webkit.org/show_bug.cgi?id=174739
        <rdar://problem/33468197>

        Reviewed by Brian Burg.

        Test: inspector/debugger/async-stack-trace.html

        Add instrumentation to EventTarget to support showing asynchronous
        stack traces when the debugger breaks in a script event listener.

        * dom/EventTarget.cpp:
        (WebCore::EventTarget::addEventListener):
        (WebCore::EventTarget::removeEventListener):
        (WebCore::EventTarget::fireEventListeners):
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
        (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
        (WebCore::InspectorInstrumentation::willHandleEventImpl):
        (WebCore::InspectorInstrumentation::didHandleEventImpl):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didAddEventListener):
        (WebCore::InspectorInstrumentation::willRemoveEventListener):
        (WebCore::InspectorInstrumentation::willHandleEvent):
        (WebCore::InspectorInstrumentation::didHandleEvent):
        * inspector/PageDebuggerAgent.cpp:
        (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData):
        (WebCore::PageDebuggerAgent::didAddEventListener):
        (WebCore::PageDebuggerAgent::willRemoveEventListener):
        (WebCore::PageDebuggerAgent::willHandleEvent):
        * inspector/PageDebuggerAgent.h:

2017-07-28  Matt Rajca  <mrajca@apple.com>

        Don't add autoplay restrictions to media elements created in response to user gestures.
        https://bugs.webkit.org/show_bug.cgi?id=174947

        Reviewed by Eric Carlson.

        Test: media/video-create-with-user-gesture.html

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

2017-07-28  Jeremy Jones  <jeremyj@apple.com>

        WebMediaSessionHelper calls -[UIApplication beginReceivingRemoteControlEvents] from WebThread
        https://bugs.webkit.org/show_bug.cgi?id=174934
        rdar://problem/33586772

        Reviewed by Eric Carlson.

        No new tests because no effect on DOM.

        This dispatches a UIKit call to the main thread since it might happen on WebThread in WK1.

        * platform/audio/ios/MediaSessionManagerIOS.mm:
        (-[WebMediaSessionHelper initWithCallback:]):

2017-07-28  Myles C. Maxfield  <mmaxfield@apple.com>

        [macOS] Reeder's defaults font is Times instead of San Francisco
        https://bugs.webkit.org/show_bug.cgi?id=174885
        <rdar://problem/33462483>

        Reviewed by Simon Fraser.

        Reeder uses explicit dot-prefixed names in its source code. Within Core Text,
        dot-prefixed names cannot be matched case insensitively. The solution is to
        not case-fold these family names, and to make our caches case sensitive for
        these special names.

        Tests: fast/text/font-lookup-dot-prefix-case-sensitive-2.html
               fast/text/font-lookup-dot-prefix-case-sensitive.html

        * platform/graphics/FontCache.cpp:
        (WebCore::FontPlatformDataCacheKey::operator==):
        (WebCore::FontPlatformDataCacheKeyHash::hash):
        * platform/graphics/FontCascade.cpp:
        (WebCore::keysMatch):
        (WebCore::computeFontCascadeCacheHash):
        * platform/graphics/FontDescription.cpp:
        (WebCore::FontCascadeDescription::familyNamesAreEqual):
        (WebCore::FontCascadeDescription::familyNameHash):
        (WebCore::FontCascadeDescription::foldedFamilyName):
        * platform/graphics/FontDescription.h:
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::FontDatabase::fontForPostScriptName):

2017-07-28  Devin Rousso  <drousso@apple.com>

        Web Inspector: Record actions performed on CanvasRenderingContext2D
        https://bugs.webkit.org/show_bug.cgi?id=174482

        Reviewed by Joseph Pecoraro.

        Tests: inspector/canvas/recording-2d.html
               inspector/canvas/recording.html

        * html/canvas/CanvasRenderingContext2D.idl:
        Add CallTracingCallback to interface to record all API calls.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::paint):
        If a recording is active, mark the current frame as completed.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateAttributeGetterBodyDefinition):
        (GenerateAttributeSetterBodyDefinition):
        (GenerateImplementationFunctionCall):
        (GenerateCallTracerParameter):
        (GenerateCallTracer):
        * bindings/scripts/test/TestCallTracer.idl:
        * bindings/scripts/test/JS/JSTestCallTracer.cpp:
        (WebCore::setJSTestCallTracerTestAttributeInterfaceSetter):
        (WebCore::setJSTestCallTracerTestAttributeSpecifiedSetter):
        (WebCore::jsTestCallTracerTestAttributeWithVariantGetter):
        (WebCore::jsTestCallTracerTestAttributeWithVariant):
        (WebCore::setJSTestCallTracerTestAttributeWithVariantSetter):
        (WebCore::setJSTestCallTracerTestAttributeWithVariant):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgument):
        * inspector/InspectorCanvas.h:
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::recordAction):
        (WebCore::InspectorCanvas::buildAction):
        Change CallTracer IDL generation to flatten any variants so that all types for the
        parameters of an action are able to be listed in a single variant. This prevents possible
        ambiguity when constructing the variant, as they require that exactly one type be
        constructible and a sub-variant might not satisfy that condition. This was only an issue for
        older mac SDKs.

        * bindings/js/CallTracer.h:
        * bindings/js/CallTracer.cpp:
        (WebCore::CallTracer::recordCanvasAction):
        * bindings/js/CallTracerTypes.h:
        * inspector/InspectorCanvasAgent.h:
        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::recordCanvasAction):
        * inspector/InspectorInstrumentation.h:
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::recordCanvasAction):
        (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
        Rename CanvasActionParameterVariant to RecordCanvasActionVariant to match what is expected by
        the IDL generator. Also remove unnecessary includes now that they are in CallTracerTypes.h.

        * CMakeLists.txt:
        * bindings/js/JSBindingsAllInOne.cpp:
        Add CallTracer for CMake builds.

2017-07-28  Sam Weinig  <sam@webkit.org>

        [WebIDL] Split-up and cleanup Fetch IDL files in preparation for removing unnecessary js builtins
        https://bugs.webkit.org/show_bug.cgi?id=174915

        Reviewed by Alex Christensen.

        - Split FetchRequest enums and Init dictionary out of FetchRequest so they
          can be used from other files like WorkerGlobalScopeFetch and DOMWindowFetch.
        - Add missing FetchResponseInit. Currently unused but will be in a subsequent patch.
        - Add and update comments about missing properties and functions.

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * Modules/fetch/DOMWindowFetch.idl:
        * Modules/fetch/FetchBody.idl:
        * Modules/fetch/FetchBodyOwner.h:
        * Modules/fetch/FetchHeaders.h:
        * Modules/fetch/FetchHeaders.idl:
        * Modules/fetch/FetchReferrerPolicy.h: Added.
        * Modules/fetch/FetchReferrerPolicy.idl: Added.
        * Modules/fetch/FetchRequest.h:
        * Modules/fetch/FetchRequest.idl:
        * Modules/fetch/FetchRequestCache.h: Added.
        * Modules/fetch/FetchRequestCache.idl: Added.
        * Modules/fetch/FetchRequestCredentials.h: Added.
        * Modules/fetch/FetchRequestCredentials.idl: Added.
        * Modules/fetch/FetchRequestInit.h: Added.
        * Modules/fetch/FetchRequestInit.idl: Added.
        * Modules/fetch/FetchRequestMode.h: Added.
        * Modules/fetch/FetchRequestMode.idl: Added.
        * Modules/fetch/FetchRequestRedirect.h: Added.
        * Modules/fetch/FetchRequestRedirect.idl: Added.
        * Modules/fetch/FetchResponse.h:
        * Modules/fetch/FetchResponse.idl:
        * Modules/fetch/WorkerGlobalScopeFetch.idl:

2017-07-28  Myles C. Maxfield  <mmaxfield@apple.com>

        REGRESSION(r216944): Fallback fonts erroneously visible when the primary font is loading
        https://bugs.webkit.org/show_bug.cgi?id=174772
        <rdar://problem/33267643>

        Reviewed by Simon Fraser.

        During a font load, we try pretty hard to find a font to use that isn't the
        last resort font (which happens to be Times). We do this by iterating through
        all the fonts in the font-family list, as well as through all the relevant
        @font-face blocks which share the requested font family name. 

        Unfortunately, if we find one of these fallback fonts, we were simply using it
        directly, which means that it was being drawn as visible (because the
        visibility setting lives inside the Font object). Instead, we should carry the
        invisibility setting from the interstitial font to this used fallback font.

        This patch is an extension of r219221, which fixed the problem only for system
        fallback fonts. This patch adopts the same methodology to all fallback fonts.

        Test: http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html

        * platform/graphics/FontCascadeFonts.cpp:
        (WebCore::FontCascadeFonts::glyphDataForVariant):
        (WebCore::glyphPageFromFontRanges):
        * platform/graphics/FontRanges.cpp:
        (WebCore::FontRanges::glyphDataForCharacter):

2017-07-28  Frederic Wang  <fwang@igalia.cpm>

        Fix typo in scrollPositionChangedViaDelegatedScrolling
        https://bugs.webkit.org/show_bug.cgi?id=174937

        Reviewed by Wenson Hsieh.

        No new tests, fix typo in the inUserInteraction parameter.

        * page/scrolling/ScrollingTree.cpp:
        (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
        * page/scrolling/ScrollingTree.h:

2017-07-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS DnD] [WK1] Snapshots generated using -[DOMRange renderImageForcingBlackText:] are upside down
        https://bugs.webkit.org/show_bug.cgi?id=174928
        <rdar://problem/33584280>

        Reviewed by Tim Horton.

        Pulls the implementation of createDragImageForRange out into DragImageIOS, and use TextIndicator to generate a
        snapshot instead of FrameSelection's snapshotting utilities. This makes snapshotting a DOMRange behave the same
        way as snapshotting a dragged selection.

        No way of testing TextIndicator-based snapshotting yet.

        * platform/DragImage.cpp:

        Guard createDragImageForRange for !PLATFORM(IOS).

        * platform/ios/DragImageIOS.mm:
        (WebCore::createDragImageForSelection):

        Add a FIXME to point out that having an additional context flip inside the UIGraphicsImageRenderer block results
        in an upside-down drag image being returned from createDragImageFromImage. This image is being flipped elsewhere
        in drag initiation code, which eventually results in the correct orientation; we'll need further investigation
        to remove this extraneous flip.

        (WebCore::createDragImageForRange):

2017-07-28  Jeremy Jones  <jeremyj@apple.com>

        Remove Web prefix from WebVideoFullscreen and WebPlaybackSession classes.
        https://bugs.webkit.org/show_bug.cgi?id=174437

        Reviewed by Darin Adler.

        No new tests because no behavior change.

        Remove redundant Web- prefix from classes in WebCore namespace.

        * WebCore.xcodeproj/project.pbxproj:
        * html/HTMLMediaElement.cpp:
        * html/HTMLVideoElement.cpp:
        * platform/cocoa/PlaybackSessionInterface.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionInterface.h.
        (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface):
        * platform/cocoa/PlaybackSessionModel.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h.
        (WebCore::PlaybackSessionModel::~PlaybackSessionModel):
        (WebCore::PlaybackSessionModelClient::~PlaybackSessionModelClient):
        (WebCore::PlaybackSessionModelClient::externalPlaybackChanged):
        * platform/cocoa/PlaybackSessionModelMediaElement.h: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h.
        * platform/cocoa/PlaybackSessionModelMediaElement.mm: Renamed from Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm.
        * platform/cocoa/VideoFullscreenChangeObserver.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenChangeObserver.h.
        (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver):
        * platform/cocoa/VideoFullscreenModel.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h.
        (WebCore::VideoFullscreenModel::~VideoFullscreenModel):
        (WebCore::VideoFullscreenModelClient::~VideoFullscreenModelClient):
        * platform/cocoa/VideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h.
        (WebCore::VideoFullscreenModelVideoElement::create):
        * platform/cocoa/VideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm.
        * platform/ios/PlaybackSessionInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.h.
        * platform/ios/PlaybackSessionInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.mm.
        * platform/ios/VideoFullscreenInterfaceAVKit.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h.
        * platform/ios/VideoFullscreenInterfaceAVKit.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm.
        * platform/ios/WebAVPlayerController.h:
        * platform/ios/WebAVPlayerController.mm:
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        * platform/mac/PlaybackSessionInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.h.
        * platform/mac/PlaybackSessionInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm.
        * platform/mac/VideoFullscreenInterfaceMac.h: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h.
        * platform/mac/VideoFullscreenInterfaceMac.mm: Renamed from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm.
        * platform/mac/WebPlaybackControlsManager.h:
        * platform/mac/WebPlaybackControlsManager.mm:

2017-07-27  Jeremy Jones  <jeremyj@apple.com>

        Don't override _allowsMediaDocumentInlinePlayback in MediaDocument with playsinlineAttr.
        https://bugs.webkit.org/show_bug.cgi?id=174850
        rdar://problem/33449903

        Reviewed by Jon Lee.

        This change removes playsinlineAttr from MediaDocument so that it doesn't override the setting
        from _allowsMediaDocumentInlinePlayback. In its place is an update to requiresFullscreenForVideoPlayback
        that implements the details of exactly which media documents are still allowed to play inlne.

        Media documents always use a video element; but when there are no video tracks, it has behavior like 
        an audio element. See media-controller.js isAudio().

        This change preserves this behavior with respect to fullscreen requirements for media document by
        mirroring the isAudio() check in requiresFullscreenForVideoPlayback.

        * html/MediaDocument.cpp:
        (WebCore::MediaDocumentParser::createDocumentStructure):
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):

2017-07-27  Jeremy Jones  <jeremyj@apple.com>

        MediaDocument fullscreen pinch gesture should trigger navigate back.
        https://bugs.webkit.org/show_bug.cgi?id=174914

        Reviewed by Jon Lee.

        No new tests because only effect is from interaction with platform.

        For media documents, pressing the "done" button on fullscreen video navigates back
        to the previous page. The same should happen for other gestures that pause playback
        when returning to inline. This allows the gesture to have the same behavior as the
        button.

        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):

2017-07-27  Aaron Chu  <aaron_chu@apple.com>

        AX: VoiceOver silent or skipping over time values on media player.
        https://bugs.webkit.org/show_bug.cgi?id=174324
        <rdar://problem/32021784>

        Reviewed by Antoine Quint.

        Added role attribute to modern media controls time lable class so that VoiceOver can access the time label when the media is playing.

        Test Updated: media/modern-media-controls/time-label/time-label.html
        Test Added: media/modern-media-controls/time-label/ios-time-label.html
        
        * Modules/modern-media-controls/controls/time-label.js:

2017-07-27  Yusuke Suzuki  <utatane.tea@gmail.com>

        Hoist DOM binding attribute getter prologue into JavaScriptCore taking advantage of DOMJIT / CheckSubClass
        https://bugs.webkit.org/show_bug.cgi?id=171637

        Reviewed by Darin Adler.

        We use DOMAttribute. When DOMAttribute is specified, ClassInfo check is performed by JSC side.
        So, we can drop ClassInfo check from the actual function.

        We also simplify DOMJIT::GetterSetter to make it smaller size.

        WebCore size comparison
            Before: 48443292
            After:  48087800 (0.7% reduction)

        Speedometer Scores show 0.8% improvement.
            Before: 158.9 +- 0.46
            After:  160.2 +- 0.36

        Dromaeo DOM core Scores show 5.8% improvement.
                                        Before                   After
            Total Score:         8424.12runs/s ±1.38%     8911.60runs/s ±1.47%
              DOM Attributes    12627.27runs/s ±1.87%    14023.17runs/s ±1.87%
              DOM Modification   1207.82runs/s ±2.48%     1204.21runs/s ±3.05%
              DOM Query         68068.82runs/s ±0.63%    74273.38runs/s ±0.69%
              DOM Traversal      1240.07runs/s ±1.96%     1256.64runs/s ±1.77%

        Performance improvement can be explained by the following optimizations.

        1. Type checks are typically eliminated in all the JIT tiers. IC / DFG / FTL can
           drop type checks since get_by_id operation already performs a structure check
           which subsumes this type check.
        2. Direct getter call by CallDOMGetter without creating IC in DFG and FTL.

        * bindings/js/JSDOMAttribute.h:
        (WebCore::IDLAttribute::get):
        Add CastedThisErrorBehavior::Assert case. When this is specified, we perform casting without using jsDynamicCast.

        * bindings/scripts/CodeGeneratorJS.pm:
        (IsAcceleratedDOMAttribute):
        (GetJSCAttributesForAttribute):
        (GenerateHeader):
        (GeneratePropertiesHashTable):
        (GenerateImplementation):
        (GenerateAttributeGetterTrampolineDefinition):
        (GenerateAttributeGetterDefinition):
        (GenerateCallbackImplementationContent):
        (GenerateHashTableValueArray):
        (GenerateHashTable):
        (GenerateConstructorHelperMethods):
        Update CodeGeneratorJS to emit DOMAttribute. And DOMJIT::GetterSetter becomes changed to be smaller size.

        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        (WebCore::JSInterfaceNamePrototype::finishCreation):
        * bindings/scripts/test/JS/JSMapLike.cpp:
        (WebCore::JSMapLikePrototype::finishCreation):
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        (WebCore::JSReadOnlyMapLikePrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        (WebCore::JSTestActiveDOMObjectPrototype::finishCreation):
        (WebCore::jsTestActiveDOMObjectExcitingAttr):
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        (WebCore::JSTestCEReactionsPrototype::finishCreation):
        (WebCore::jsTestCEReactionsAttributeWithCEReactions):
        (WebCore::jsTestCEReactionsReflectAttributeWithCEReactions):
        (WebCore::jsTestCEReactionsStringifierAttribute):
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        (WebCore::JSTestCEReactionsStringifierPrototype::finishCreation):
        (WebCore::jsTestCEReactionsStringifierValue):
        * bindings/scripts/test/JS/JSTestCallTracer.cpp:
        (WebCore::JSTestCallTracerPrototype::finishCreation):
        (WebCore::jsTestCallTracerTestAttributeInterface):
        (WebCore::jsTestCallTracerTestAttributeSpecified):
        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        (WebCore::JSTestCallbackInterfaceConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        (WebCore::JSTestClassWithJSBuiltinConstructorPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        (WebCore::JSTestDOMJITPrototype::finishCreation):
        (WebCore::TestDOMJITAnyAttrDOMJIT::TestDOMJITAnyAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITAnyAttr): Deleted.
        (WebCore::TestDOMJITBooleanAttrDOMJIT::TestDOMJITBooleanAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITBooleanAttr): Deleted.
        (WebCore::TestDOMJITByteAttrDOMJIT::TestDOMJITByteAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITByteAttr): Deleted.
        (WebCore::TestDOMJITOctetAttrDOMJIT::TestDOMJITOctetAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITOctetAttr): Deleted.
        (WebCore::TestDOMJITShortAttrDOMJIT::TestDOMJITShortAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITShortAttr): Deleted.
        (WebCore::TestDOMJITUnsignedShortAttrDOMJIT::TestDOMJITUnsignedShortAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortAttr): Deleted.
        (WebCore::TestDOMJITLongAttrDOMJIT::TestDOMJITLongAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITLongAttr): Deleted.
        (WebCore::TestDOMJITUnsignedLongAttrDOMJIT::TestDOMJITUnsignedLongAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongAttr): Deleted.
        (WebCore::TestDOMJITLongLongAttrDOMJIT::TestDOMJITLongLongAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITLongLongAttr): Deleted.
        (WebCore::TestDOMJITUnsignedLongLongAttrDOMJIT::TestDOMJITUnsignedLongLongAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongAttr): Deleted.
        (WebCore::TestDOMJITFloatAttrDOMJIT::TestDOMJITFloatAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITFloatAttr): Deleted.
        (WebCore::TestDOMJITUnrestrictedFloatAttrDOMJIT::TestDOMJITUnrestrictedFloatAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatAttr): Deleted.
        (WebCore::TestDOMJITDoubleAttrDOMJIT::TestDOMJITDoubleAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITDoubleAttr): Deleted.
        (WebCore::TestDOMJITUnrestrictedDoubleAttrDOMJIT::TestDOMJITUnrestrictedDoubleAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleAttr): Deleted.
        (WebCore::TestDOMJITDomStringAttrDOMJIT::TestDOMJITDomStringAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITDomStringAttr): Deleted.
        (WebCore::TestDOMJITByteStringAttrDOMJIT::TestDOMJITByteStringAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITByteStringAttr): Deleted.
        (WebCore::TestDOMJITUsvStringAttrDOMJIT::TestDOMJITUsvStringAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITUsvStringAttr): Deleted.
        (WebCore::TestDOMJITNodeAttrDOMJIT::TestDOMJITNodeAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITNodeAttr): Deleted.
        (WebCore::TestDOMJITBooleanNullableAttrDOMJIT::TestDOMJITBooleanNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITBooleanNullableAttr): Deleted.
        (WebCore::TestDOMJITByteNullableAttrDOMJIT::TestDOMJITByteNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITByteNullableAttr): Deleted.
        (WebCore::TestDOMJITOctetNullableAttrDOMJIT::TestDOMJITOctetNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITOctetNullableAttr): Deleted.
        (WebCore::TestDOMJITShortNullableAttrDOMJIT::TestDOMJITShortNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITShortNullableAttr): Deleted.
        (WebCore::TestDOMJITUnsignedShortNullableAttrDOMJIT::TestDOMJITUnsignedShortNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITUnsignedShortNullableAttr): Deleted.
        (WebCore::TestDOMJITLongNullableAttrDOMJIT::TestDOMJITLongNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITLongNullableAttr): Deleted.
        (WebCore::TestDOMJITUnsignedLongNullableAttrDOMJIT::TestDOMJITUnsignedLongNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongNullableAttr): Deleted.
        (WebCore::TestDOMJITLongLongNullableAttrDOMJIT::TestDOMJITLongLongNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITLongLongNullableAttr): Deleted.
        (WebCore::TestDOMJITUnsignedLongLongNullableAttrDOMJIT::TestDOMJITUnsignedLongLongNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITUnsignedLongLongNullableAttr): Deleted.
        (WebCore::TestDOMJITFloatNullableAttrDOMJIT::TestDOMJITFloatNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITFloatNullableAttr): Deleted.
        (WebCore::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT::TestDOMJITUnrestrictedFloatNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedFloatNullableAttr): Deleted.
        (WebCore::TestDOMJITDoubleNullableAttrDOMJIT::TestDOMJITDoubleNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITDoubleNullableAttr): Deleted.
        (WebCore::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT::TestDOMJITUnrestrictedDoubleNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITUnrestrictedDoubleNullableAttr): Deleted.
        (WebCore::TestDOMJITDomStringNullableAttrDOMJIT::TestDOMJITDomStringNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITDomStringNullableAttr): Deleted.
        (WebCore::TestDOMJITByteStringNullableAttrDOMJIT::TestDOMJITByteStringNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITByteStringNullableAttr): Deleted.
        (WebCore::TestDOMJITUsvStringNullableAttrDOMJIT::TestDOMJITUsvStringNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITUsvStringNullableAttr): Deleted.
        (WebCore::TestDOMJITNodeNullableAttrDOMJIT::TestDOMJITNodeNullableAttrDOMJIT): Deleted.
        (WebCore::domJITGetterSetterForTestDOMJITNodeNullableAttr): Deleted.
        * bindings/scripts/test/JS/JSTestDOMJIT.h:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        (WebCore::JSTestEventConstructorPrototype::finishCreation):
        (WebCore::jsTestEventConstructorAttr1):
        (WebCore::jsTestEventConstructorAttr2):
        (WebCore::jsTestEventConstructorAttr3):
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        (WebCore::JSTestEventTargetPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestException.cpp:
        (WebCore::JSTestExceptionPrototype::finishCreation):
        (WebCore::jsTestExceptionName):
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
        (WebCore::jsTestGenerateIsReachableASecretAttribute):
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        (WebCore::jsTestGlobalObjectRegularAttribute):
        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
        (WebCore::JSTestIndexedSetterNoIdentifierPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
        (WebCore::JSTestIndexedSetterThrowingExceptionPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
        (WebCore::JSTestIndexedSetterWithIdentifierPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        (WebCore::JSTestInterfaceConstructor::initializeProperties):
        (WebCore::JSTestInterfacePrototype::finishCreation):
        (WebCore::jsTestInterfaceImplementsStr1):
        (WebCore::jsTestInterfaceImplementsStr2):
        (WebCore::jsTestInterfaceImplementsStr3):
        (WebCore::jsTestInterfaceImplementsNode):
        (WebCore::jsTestInterfaceSupplementalStr1):
        (WebCore::jsTestInterfaceSupplementalStr2):
        (WebCore::jsTestInterfaceSupplementalStr3):
        (WebCore::jsTestInterfaceSupplementalNode):
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        (WebCore::JSTestInterfaceLeadingUnderscorePrototype::finishCreation):
        (WebCore::jsTestInterfaceLeadingUnderscoreReadonly):
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        (WebCore::JSTestIterablePrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        (WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation):
        (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom):
        (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom):
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        (WebCore::JSTestMediaQueryListListenerPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
        (WebCore::JSTestNamedAndIndexedSetterNoIdentifierPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
        (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
        (WebCore::JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        (WebCore::JSTestNamedConstructorPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
        (WebCore::JSTestNamedDeleterNoIdentifierPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
        (WebCore::JSTestNamedDeleterThrowingExceptionPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
        (WebCore::JSTestNamedDeleterWithIdentifierPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
        (WebCore::JSTestNamedDeleterWithIndexedGetterPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
        (WebCore::JSTestNamedGetterCallWithPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
        (WebCore::JSTestNamedGetterNoIdentifierPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
        (WebCore::JSTestNamedGetterWithIdentifierPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
        (WebCore::JSTestNamedSetterNoIdentifierPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
        (WebCore::JSTestNamedSetterThrowingExceptionPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
        (WebCore::JSTestNamedSetterWithIdentifierPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
        (WebCore::JSTestNamedSetterWithIndexedGetterPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
        (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
        (WebCore::JSTestNamedSetterWithOverrideBuiltinsPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
        (WebCore::JSTestNamedSetterWithUnforgablePropertiesPrototype::finishCreation):
        (WebCore::jsTestNamedSetterWithUnforgablePropertiesUnforgeableAttribute):
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
        (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::finishCreation):
        (WebCore::jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute):
        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::JSTestNodePrototype::finishCreation):
        (WebCore::jsTestNodeName):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::JSTestObjConstructor::initializeProperties):
        (WebCore::JSTestObjPrototype::finishCreation):
        (WebCore::jsTestObjReadOnlyLongAttr):
        (WebCore::jsTestObjReadOnlyStringAttr):
        (WebCore::jsTestObjReadOnlyTestObjAttr):
        (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::jsTestObjUnforgeableAttr):
        (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString):
        (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString):
        (WebCore::jsTestObjByteStringAttrTreatingNullAsEmptyString):
        (WebCore::jsTestObjStringLongRecordAttr):
        (WebCore::jsTestObjUsvstringLongRecordAttr):
        (WebCore::jsTestObjStringObjRecordAttr):
        (WebCore::jsTestObjStringNullableObjRecordAttr):
        (WebCore::jsTestObjDictionaryAttr):
        (WebCore::jsTestObjNullableDictionaryAttr):
        (WebCore::jsTestObjAnnotatedTypeInUnionAttr):
        (WebCore::jsTestObjAnnotatedTypeInSequenceAttr):
        (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::jsTestObjEnabledBySettingAttribute):
        (WebCore::jsTestObjTypedArrayAttr):
        (WebCore::jsTestObjAttributeWithGetterException):
        (WebCore::jsTestObjAttributeWithSetterException):
        (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::jsTestObjConditionalAttr1):
        (WebCore::jsTestObjConditionalAttr2):
        (WebCore::jsTestObjConditionalAttr3):
        (WebCore::jsTestObjCachedAttribute1):
        (WebCore::jsTestObjCachedAttribute2):
        (WebCore::jsTestObjAnyAttribute):
        (WebCore::jsTestObjObjectAttribute):
        (WebCore::jsTestObjContentDocument):
        (WebCore::jsTestObjMutablePoint):
        (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::jsTestObjNullableByteStringSettableAttribute):
        (WebCore::jsTestObjNullableStringValue):
        (WebCore::jsTestObjAttribute):
        (WebCore::jsTestObjAttributeWithReservedEnumType):
        (WebCore::jsTestObjPutForwardsAttribute):
        (WebCore::jsTestObjPutForwardsNullableAttribute):
        (WebCore::jsTestObjStringifierAttribute):
        (WebCore::jsTestObjConditionallyReadWriteAttribute):
        (WebCore::jsTestObjConditionalAndConditionallyReadWriteAttribute):
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        (WebCore::JSTestOverloadedConstructorsPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        (WebCore::JSTestOverloadedConstructorsWithSequencePrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        (WebCore::JSTestOverrideBuiltinsPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
        (WebCore::JSTestPluginInterfacePrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        (WebCore::JSTestPromiseRejectionEventPrototype::finishCreation):
        (WebCore::jsTestPromiseRejectionEventReason):
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        (WebCore::JSTestSerializationPrototype::finishCreation):
        (WebCore::jsTestSerializationFirstStringAttribute):
        (WebCore::jsTestSerializationSecondLongAttribute):
        (WebCore::jsTestSerializationThirdUnserializableAttribute):
        (WebCore::jsTestSerializationFourthUnrestrictedDoubleAttribute):
        (WebCore::jsTestSerializationFifthLongAttribute):
        (WebCore::jsTestSerializationSixthTypedefAttribute):
        (WebCore::jsTestSerializationSeventhDirectlySerializableAttribute):
        (WebCore::jsTestSerializationEighthIndirectlyAttribute):
        * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
        (WebCore::JSTestSerializationIndirectInheritancePrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        (WebCore::JSTestSerializationInheritPrototype::finishCreation):
        (WebCore::jsTestSerializationInheritInheritLongAttribute):
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        (WebCore::JSTestSerializationInheritFinalPrototype::finishCreation):
        (WebCore::jsTestSerializationInheritFinalFinalLongAttributeFoo):
        (WebCore::jsTestSerializationInheritFinalFinalLongAttributeBar):
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        (WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation):
        (WebCore::jsTestSerializedScriptValueInterfaceValue):
        (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
        (WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
        (WebCore::jsTestSerializedScriptValueInterfacePorts):
        (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
        * bindings/scripts/test/JS/JSTestStringifier.cpp:
        (WebCore::JSTestStringifierPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
        (WebCore::JSTestStringifierAnonymousOperationPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
        (WebCore::JSTestStringifierNamedOperationPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
        (WebCore::JSTestStringifierOperationImplementedAsPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
        (WebCore::JSTestStringifierOperationNamedToStringPrototype::finishCreation):
        * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
        (WebCore::JSTestStringifierReadOnlyAttributePrototype::finishCreation):
        (WebCore::jsTestStringifierReadOnlyAttributeIdentifier):
        * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
        (WebCore::JSTestStringifierReadWriteAttributePrototype::finishCreation):
        (WebCore::jsTestStringifierReadWriteAttributeIdentifier):
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        (WebCore::JSTestTypedefsConstructor::initializeProperties):
        (WebCore::JSTestTypedefsPrototype::finishCreation):
        (WebCore::jsTestTypedefsUnsignedLongLongAttr):
        (WebCore::jsTestTypedefsSerializedScriptValue):
        (WebCore::jsTestTypedefsAttributeWithClamp):
        (WebCore::jsTestTypedefsAttributeWithClampInTypedef):
        (WebCore::jsTestTypedefsAttrWithGetterException):
        (WebCore::jsTestTypedefsAttrWithSetterException):
        (WebCore::jsTestTypedefsStringAttrWithGetterException):
        (WebCore::jsTestTypedefsStringAttrWithSetterException):
        (WebCore::jsTestTypedefsBufferSourceAttr):
        (WebCore::jsTestTypedefsDomTimeStampAttr):
        They are binding test rebaselines.

        * domjit/DOMJITIDLTypeFilter.h:
        * domjit/JSDocumentDOMJIT.cpp:
        (WebCore::compileDocumentDocumentElementAttribute):
        (WebCore::compileDocumentBodyAttribute):
        (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter): Deleted.
        (WebCore::DocumentBodyDOMJIT::callDOMGetter): Deleted.
        * domjit/JSNodeDOMJIT.cpp:
        (WebCore::compileNodeFirstChildAttribute):
        (WebCore::compileNodeLastChildAttribute):
        (WebCore::compileNodeNextSiblingAttribute):
        (WebCore::compileNodePreviousSiblingAttribute):
        (WebCore::compileNodeParentNodeAttribute):
        (WebCore::compileNodeNodeTypeAttribute):
        (WebCore::compileNodeOwnerDocumentAttribute):
        (WebCore::NodeFirstChildDOMJIT::callDOMGetter): Deleted.
        (WebCore::NodeLastChildDOMJIT::callDOMGetter): Deleted.
        (WebCore::NodeNextSiblingDOMJIT::callDOMGetter): Deleted.
        (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter): Deleted.
        (WebCore::NodeParentNodeDOMJIT::callDOMGetter): Deleted.
        (WebCore::NodeNodeTypeDOMJIT::callDOMGetter): Deleted.
        (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter): Deleted.
        DOMJIT::GetterSetter becomes smaller constexpr data.

2017-07-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>

        [GStreamer][EME] Not having a key id buffer should not always error
        https://bugs.webkit.org/show_bug.cgi?id=174889

        Reviewed by Žan Doberšek.

        In r219946 we introduced a hard requirement for a key id buffer
        that does not happen for all CDMs.

        * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
        (webKitMediaClearKeyDecryptorSetupCipher): Check for key id buffer
        and error if we didn't get it.
        * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
        (webkitMediaCommonEncryptionDecryptTransformInPlace): Soften the
        requirement for key id buffer.

2017-07-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>

        [GStreamer][EME] Fix phony debug output in player base for supported key system
        https://bugs.webkit.org/show_bug.cgi?id=174888

        Reviewed by Žan Doberšek.

        The debug output was returning always false because that method
        was not checking anything before. Now it is and should reflect it.

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

2017-07-27  Zan Dobersek  <zdobersek@igalia.com>

        [EME][GStreamer] Add barebones CDM interface implementations for ClearKey
        https://bugs.webkit.org/show_bug.cgi?id=174887

        Reviewed by Xabier Rodriguez-Calvar.

        Add empty ClearKey derivations of CDMFactory, CDMPrivate and CDMInstance
        classes. These will be enhanced as the implementation progresses.

        ClearKey is added to CDMInstance::ImplementationType, and the
        CDMInstanceClearKey::implementationType() override returns that value.
        Type traits specialization for the CDMInstanceClearKey class is also
        added, utilizing the CDMInstance::ImplementationType::ClearKey value.

        The implementation file is added to the WPE build, along with the
        necessary inclusion directory.

        * PlatformWPE.cmake:
        * platform/encryptedmedia/CDMInstance.h:
        * platform/encryptedmedia/clearkey/CDMClearKey.cpp: Added.
        (WebCore::CDMFactoryClearKey::createCDM):
        (WebCore::CDMFactoryClearKey::supportsKeySystem):
        (WebCore::CDMPrivateClearKey::supportsInitDataType):
        (WebCore::CDMPrivateClearKey::supportsConfiguration):
        (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions):
        (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration):
        (WebCore::CDMPrivateClearKey::supportsRobustness):
        (WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement):
        (WebCore::CDMPrivateClearKey::persistentStateRequirement):
        (WebCore::CDMPrivateClearKey::distinctiveIdentifiersAreUniquePerOriginAndClearable):
        (WebCore::CDMPrivateClearKey::createInstance):
        (WebCore::CDMPrivateClearKey::loadAndInitialize):
        (WebCore::CDMPrivateClearKey::supportsServerCertificates):
        (WebCore::CDMPrivateClearKey::supportsSessions):
        (WebCore::CDMPrivateClearKey::supportsInitData):
        (WebCore::CDMPrivateClearKey::sanitizeResponse):
        (WebCore::CDMPrivateClearKey::sanitizeSessionId):
        (WebCore::CDMInstanceClearKey::initializeWithConfiguration):
        (WebCore::CDMInstanceClearKey::setDistinctiveIdentifiersAllowed):
        (WebCore::CDMInstanceClearKey::setPersistentStateAllowed):
        (WebCore::CDMInstanceClearKey::setServerCertificate):
        (WebCore::CDMInstanceClearKey::requestLicense):
        (WebCore::CDMInstanceClearKey::updateLicense):
        (WebCore::CDMInstanceClearKey::loadSession):
        (WebCore::CDMInstanceClearKey::closeSession):
        (WebCore::CDMInstanceClearKey::removeSessionData):
        (WebCore::CDMInstanceClearKey::storeRecordOfKeyUsage):
        * platform/encryptedmedia/clearkey/CDMClearKey.h: Added.

2017-07-27  Zan Dobersek  <zdobersek@igalia.com>

        [EME] Allow CDMInstance type traits specialization
        https://bugs.webkit.org/show_bug.cgi?id=174886

        Reviewed by Xabier Rodriguez-Calvar.

        Allow using the trait-based type casting for the CDMInstance class and its
        derivatives. ImplementationType enumeration values are to be used and
        returned from the new implementationType() virtual method. This method is
        leveraged in the type trait specialization that enables using is<>() and
        downcast<>() helpers for CDMInstance objects.

        This will allow differentiating between CDMInstance implementations once
        the media playback pipeline has to retrieve any key information that's
        necessary for playback of encrypted content.

        MockCDMInstance class overrides the implementationType() method, returning
        the ImplementationType::Mock value. Type trait specializations for this
        class aren't added since they're not needed anywhere at this point.

        * platform/encryptedmedia/CDMInstance.h:
        * testing/MockCDMFactory.h:

2017-07-27  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Key serialization support
        https://bugs.webkit.org/show_bug.cgi?id=173883

        Reviewed by Jiewen Tan.

        Implement crypto key serialization for platforms that use libgcrypt.

        Despite the function names and the existing implementation for the Mac port,
        we don't perform the KEK wrapping and unwrapping due to the review feedback
        advising against it.

        Instead the passed-in key data is simply copied and returned as the result of
        the 'wrapping' operation, and similarly the passed-in serialized data is simply
        copied and returned as the result of the 'unwrapping' operation.

        No new tests -- related tests are now passing and are unskipped.

        * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp:
        (WebCore::getDefaultWebCryptoMasterKey):
        (WebCore::wrapSerializedCryptoKey):
        (WebCore::unwrapSerializedCryptoKey):

2017-07-26  Arnaud Renevier  <a.renevier@sisa.samsung.com> and Fujii Hironori  <Hironori.Fujii@sony.com>

        Implement new TextMetrics, returned by canvas measureText()
        https://bugs.webkit.org/show_bug.cgi?id=82798
        <rdar://problem/11159332>

        Reviewed by Dean Jackson.

        The specification: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-measuretext

        Add new attributes to TextMetrics.

        Add a new method textOffset() of CanvasRenderingContext2D by
        extracting from drawTextInternal() to use the same horizontal and
        vertical offsets of a text in both drawTextInternal() and
        measureText().

        Test: fast/canvas/canvas-measureText-2.html

        * html/TextMetrics.h:
        (WebCore::TextMetrics::actualBoundingBoxLeft):
        (WebCore::TextMetrics::setActualBoundingBoxLeft):
        (WebCore::TextMetrics::actualBoundingBoxRight):
        (WebCore::TextMetrics::setActualBoundingBoxRight):
        (WebCore::TextMetrics::fontBoundingBoxAscent):
        (WebCore::TextMetrics::setFontBoundingBoxAscent):
        (WebCore::TextMetrics::fontBoundingBoxDescent):
        (WebCore::TextMetrics::setFontBoundingBoxDescent):
        (WebCore::TextMetrics::actualBoundingBoxAscent):
        (WebCore::TextMetrics::setActualBoundingBoxAscent):
        (WebCore::TextMetrics::actualBoundingBoxDescent):
        (WebCore::TextMetrics::setActualBoundingBoxDescent):
        (WebCore::TextMetrics::emHeightAscent):
        (WebCore::TextMetrics::setEmHeightAscent):
        (WebCore::TextMetrics::emHeightDescent):
        (WebCore::TextMetrics::setEmHeightDescent):
        (WebCore::TextMetrics::hangingBaseline):
        (WebCore::TextMetrics::setHangingBaseline):
        (WebCore::TextMetrics::alphabeticBaseline):
        (WebCore::TextMetrics::setAlphabeticBaseline):
        (WebCore::TextMetrics::ideographicBaseline):
        (WebCore::TextMetrics::setIdeographicBaseline):
        Added getters and setters.
        (WebCore::TextMetrics::TextMetrics): Deleted.
        * html/TextMetrics.idl: Added new attributes.
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics):
        Changed the return value type to a const reference of FontMetrics
        not to copy it.
        (WebCore::CanvasRenderingContext2D::FontProxy::width):
        Added the second arguemnt of GlyphOverflow type.
        (WebCore::CanvasRenderingContext2D::measureText): Calculate and
        set the new attributes of TextMetrics.
        (WebCore::CanvasRenderingContext2D::textOffset): Extracted from drawTextInternal.
        (WebCore::CanvasRenderingContext2D::drawTextInternal): Removed the
        offset calculation code and call textOffset.
        * html/canvas/CanvasRenderingContext2D.h: Added the method
        declaration of textOffset. Change types of fontMetrics and width
        methods.
        * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
        (WebCore::FontCascade::floatWidthForComplexText): Added a dummy
        implementation of calculating GlyphOverflow.

2017-07-26  Devin Rousso  <drousso@apple.com>

        Web Inspector: create protocol for recording Canvas contexts
        https://bugs.webkit.org/show_bug.cgi?id=174481

        Reviewed by Joseph Pecoraro.

        Currently, a recording doesn't actually "start" until an action is performed on the context.
        This change adds the recording logic, but it does not use it anywhere. Additonal tests will
        be added in the patches that add uses:
         - <https://webkit.org/b/174482> Web Inspector: Record actions performed on CanvasRenderingContext2D
         - <https://webkit.org/b/174483> Web Inspector: Record actions performed on WebGLRenderingContext

        Test: inspector/model/recording.html

        * bindings/scripts/IDLAttributes.json:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateAttributeGetterBodyDefinition):
        (GenerateAttributeSetterBodyDefinition):
        (GenerateImplementationFunctionCall):
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/CallTracer.h: Added.
        * bindings/js/CallTracer.cpp: Added.
        (WebCore::CallTracer::recordCanvasAction):
        * bindings/js/CallTracerTypes.h: Added.
        * bindings/scripts/test/TestCallTracer.idl: Added.
        * bindings/scripts/test/JS/JSTestCallTracer.h: Added.
        * bindings/scripts/test/JS/JSTestCallTracer.cpp: Added.

        Create new IDL extended attribute called "CallTracingCallback" that will add code to call a
        static function on CallTracer with the given extended attribute value as the function name,
        the `impl` object as the first parameter, the name of the attribute/operation as the second,
        and an optional object that accepts an initializer list of all the parameters as the third.

        This function will not be called, however, unless a `callTracingActive` function on the
        `impl` object returns true, and this is marked as UNLIKELY.

        "CallTracingCallback" can be added to an Interface, in which case it will apply to all
        attributes/operations of the generated class, or an individual Attribute/Operation.

        * html/canvas/CanvasRenderingContext.h:
        (WebCore::CanvasRenderingContext::callTracingActive):
        (WebCore::CanvasRenderingContext::setCallTracingActive):

        * inspector/InspectorCanvas.h:
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::~InspectorCanvas):
        (WebCore::InspectorCanvas::resetRecordingData):
        (WebCore::InspectorCanvas::hasRecordingData):
        (WebCore::InspectorCanvas::recordAction):
        (WebCore::InspectorCanvas::releaseInitialState):
        (WebCore::InspectorCanvas::releaseFrames):
        (WebCore::InspectorCanvas::releaseData):
        (WebCore::InspectorCanvas::markNewFrame):
        (WebCore::InspectorCanvas::markCurrentFrameIncomplete):
        (WebCore::InspectorCanvas::setBufferLimit):
        (WebCore::InspectorCanvas::hasBufferSpace):
        (WebCore::InspectorCanvas::singleFrame):
        (WebCore::InspectorCanvas::setSingleFrame):
        (WebCore::InspectorCanvas::indexForData):
        (WebCore::buildArrayForAffineTransform):
        (WebCore::buildArrayForVector):
        (WebCore::InspectorCanvas::buildInitialState):
        (WebCore::InspectorCanvas::buildAction):
        (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
        (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
        (WebCore::InspectorCanvas::buildArrayForImageData):

        Hold the recording data on the corresponding InspectorCanvas. Recording Frames are
        completed when the HTMLCanvasElement paints or a  0_s timer is fired. A recording is not
        considered valid until at least one action is performed on the canvas context. Once that
        condition is satisfied, canceling the recording will flush the data.

        * inspector/InspectorCanvasAgent.h:
        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
        (WebCore::InspectorCanvasAgent::disable):
        (WebCore::InspectorCanvasAgent::requestRecording):
        (WebCore::InspectorCanvasAgent::cancelRecording):
        (WebCore::InspectorCanvasAgent::recordCanvasAction):
        (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
        (WebCore::InspectorCanvasAgent::canvasDestroyed):
        (WebCore::InspectorCanvasAgent::canvasRecordingTimerFired):
        (WebCore::InspectorCanvasAgent::clearCanvasData):

        * inspector/InspectorInstrumentation.h:
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::recordCanvasAction):
        (WebCore::InspectorInstrumentation::recordCanvasActionImpl):
        (WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):

        * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::stringForWindingRule):
        (WebCore::CanvasRenderingContext2D::stringForImageSmoothingQuality):

        * platform/graphics/Gradient.h:
        (WebCore::Gradient::stops):

        * svg/SVGPathUtilities.h:
        * svg/SVGPathUtilities.cpp:
        (WebCore::buildStringFromPath):

2017-07-26  Ali Juma  <ajuma@chromium.org>

        Implement document.elementsFromPoint
        https://bugs.webkit.org/show_bug.cgi?id=153137

        Reviewed by Simon Fraser.

        This ports Blink's implementation of elementsFromPoint, from the
        following patches by Philip Rogers (pdr@chromium.org):
        -https://src.chromium.org/viewvc/blink?revision=190686&view=revision
        -https://src.chromium.org/viewvc/blink?revision=191240&view=revision
        -https://src.chromium.org/viewvc/blink?revision=199214&view=revision

        Tests: imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-iframes.html
               imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-invalid-cases.html
               imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-shadowroot.html
               imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-simple.html
               imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-svg.html
               imported/w3c/web-platform-tests/cssom-view/elementsFromPoint-table.html

        * dom/DocumentOrShadowRoot.idl:
        * dom/TreeScope.cpp:
        (WebCore::absolutePointIfNotClipped):
        (WebCore::TreeScope::nodeFromPoint):
        (WebCore::TreeScope::elementFromPoint):
        (WebCore::TreeScope::elementsFromPoint):
        * dom/TreeScope.h:
        * page/EventHandler.cpp:
        (WebCore::EventHandler::hitTestResultAtPoint):
        * rendering/EllipsisBox.cpp:
        (WebCore::EllipsisBox::nodeAtPoint):
        * rendering/HitTestRequest.h:
        (WebCore::HitTestRequest::HitTestRequest):
        (WebCore::HitTestRequest::resultIsElementList):
        (WebCore::HitTestRequest::includesAllElementsUnderPoint):
        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::HitTestResult):
        (WebCore::HitTestResult::operator=):
        (WebCore::HitTestResult::addNodeToListBasedTestResult):
        (WebCore::HitTestResult::append):
        (WebCore::HitTestResult::listBasedTestResult):
        (WebCore::HitTestResult::mutableListBasedTestResult):
        (WebCore::HitTestResult::addNodeToRectBasedTestResult): Deleted.
        (WebCore::HitTestResult::rectBasedTestResult): Deleted.
        (WebCore::HitTestResult::mutableRectBasedTestResult): Deleted.
        * rendering/HitTestResult.h:
        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::nodeAtPoint):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::nodeAtPoint):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::nodeAtPoint):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::nodeAtPoint):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::nodeAtPoint):
        * rendering/RenderInline.cpp:
        (WebCore::RenderInline::hitTestCulledInline):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
        (WebCore::RenderLayer::hitTestLayer):
        (WebCore::RenderLayer::hitTestContents):
        (WebCore::RenderLayer::hitTestList):
        (WebCore::RenderLayer::calculateClipRects):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::nodeAtPoint):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::nodeAtPoint):
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::nodeAtPoint):
        * rendering/SimpleLineLayoutFunctions.cpp:
        (WebCore::SimpleLineLayout::hitTestFlow):
        * rendering/svg/RenderSVGContainer.cpp:
        (WebCore::RenderSVGContainer::nodeAtFloatPoint):
        * rendering/svg/RenderSVGImage.cpp:
        (WebCore::RenderSVGImage::nodeAtFloatPoint):
        * rendering/svg/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::nodeAtPoint):
        * rendering/svg/RenderSVGShape.cpp:
        (WebCore::RenderSVGShape::nodeAtFloatPoint):
        * rendering/svg/SVGInlineTextBox.cpp:
        (WebCore::SVGInlineTextBox::nodeAtPoint):
        * testing/Internals.cpp:
        (WebCore::Internals::nodesFromRect):

2017-07-26  Charlie Turner  <cturner@igalia.com>

        [GStreamer] Review WebKitWebSource after r219252.
        https://bugs.webkit.org/show_bug.cgi?id=174415

        Reviewed by Carlos Garcia Campos.

        Remove ResourceHandleStreamingClient, and flatten the StreamingClient
        into CachedResourceStreamingClient (the only implemetation left). They
        are no longer required after r219252.

        Also remove the locking code. It's not needed now, and what existed
        was heavy-handed and missed several cases it was supposed to protect

        Covered by existing tests.

        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (webkit_web_src_init):
        (webKitWebSrcDispose):
        (webKitWebSrcStop):
        (webKitWebSrcStart):
        (webKitWebSrcNeedData):
        (webKitWebSrcEnoughData):
        (webKitWebSrcSeek):
        (webKitWebSrcSetMediaPlayer):
        (CachedResourceStreamingClient::CachedResourceStreamingClient):
        (CachedResourceStreamingClient::~CachedResourceStreamingClient):
        (CachedResourceStreamingClient::getOrCreateReadBuffer):
        (CachedResourceStreamingClient::responseReceived):
        (CachedResourceStreamingClient::dataReceived):
        (CachedResourceStreamingClient::loadFinished):
        (ResourceHandleStreamingClient::create): Deleted.
        (): Deleted.
        (StreamingClient::StreamingClient): Deleted.
        (StreamingClient::~StreamingClient): Deleted.
        (StreamingClient::createReadBuffer): Deleted.
        (StreamingClient::handleResponseReceived): Deleted.
        (StreamingClient::handleDataReceived): Deleted.
        (StreamingClient::handleNotifyFinished): Deleted.
        (ResourceHandleStreamingClient::ResourceHandleStreamingClient): Deleted.
        (ResourceHandleStreamingClient::~ResourceHandleStreamingClient): Deleted.
        (ResourceHandleStreamingClient::cleanupAndStopRunLoop): Deleted.
        (ResourceHandleStreamingClient::invalidate): Deleted.
        (ResourceHandleStreamingClient::loadFailed): Deleted.
        (ResourceHandleStreamingClient::setDefersLoading): Deleted.
        (ResourceHandleStreamingClient::getOrCreateReadBuffer): Deleted.
        (ResourceHandleStreamingClient::willSendRequest): Deleted.
        (ResourceHandleStreamingClient::didReceiveResponse): Deleted.
        (ResourceHandleStreamingClient::didReceiveData): Deleted.
        (ResourceHandleStreamingClient::didReceiveBuffer): Deleted.
        (ResourceHandleStreamingClient::didFinishLoading): Deleted.
        (ResourceHandleStreamingClient::didFail): Deleted.
        (ResourceHandleStreamingClient::wasBlocked): Deleted.
        (ResourceHandleStreamingClient::cannotShowURL): Deleted.

2017-07-26  Brian Burg  <bburg@apple.com>

        Remove WEB_TIMING feature flag
        https://bugs.webkit.org/show_bug.cgi?id=174795

        Reviewed by Alex Christensen.

        * Configurations/FeatureDefines.xcconfig:
        * bindings/js/JSPerformanceEntryCustom.cpp:
        * dom/Document.cpp:
        (WebCore::Document::setReadyState):
        (WebCore::Document::finishedParsing):
        * dom/Document.h:
        (WebCore::Document::timing):
        * dom/DocumentTiming.h:
        * dom/EventTargetFactory.in:
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad):
        (WebCore::DocumentThreadableLoader::loadRequest):
        * loader/DocumentThreadableLoader.h:
        * loader/ResourceTimingInformation.cpp:
        * loader/ResourceTimingInformation.h:
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::didFinishLoading):
        (WebCore::SubresourceLoader::reportResourceTiming):
        * loader/SubresourceLoader.h:
        * loader/ThreadableLoaderClient.h:
        (WebCore::ThreadableLoaderClient::didFail):
        (WebCore::ThreadableLoaderClient::didFinishTiming):
        * loader/WorkerThreadableLoader.cpp:
        (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
        * loader/WorkerThreadableLoader.h:
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestResource):
        (WebCore::CachedResourceLoader::revalidateResource):
        (WebCore::CachedResourceLoader::loadResource):
        * loader/cache/CachedResourceLoader.h:
        (WebCore::CachedResourceLoader::resourceTimingInformation):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::~DOMWindow):
        (WebCore::DOMWindow::resetDOMWindowProperties):
        (WebCore::DOMWindow::nowTimestamp):
        (WebCore::DOMWindow::removeAllEventListeners):
        * page/DOMWindow.h:
        * page/GlobalPerformance.idl:
        * page/Performance.cpp:
        * page/Performance.h:
        * page/Performance.idl:
        * page/PerformanceEntry.cpp:
        * page/PerformanceEntry.h:
        * page/PerformanceEntry.idl:
        * page/PerformanceMark.h:
        * page/PerformanceMark.idl:
        * page/PerformanceMeasure.h:
        * page/PerformanceMeasure.idl:
        * page/PerformanceNavigation.cpp:
        * page/PerformanceNavigation.h:
        * page/PerformanceNavigation.idl:
        * page/PerformanceObserver.cpp:
        * page/PerformanceObserver.h:
        * page/PerformanceObserver.idl:
        * page/PerformanceObserverCallback.h:
        * page/PerformanceObserverCallback.idl:
        * page/PerformanceObserverEntryList.cpp:
        * page/PerformanceObserverEntryList.h:
        * page/PerformanceObserverEntryList.idl:
        * page/PerformanceResourceTiming.cpp:
        * page/PerformanceResourceTiming.h:
        * page/PerformanceResourceTiming.idl:
        * page/PerformanceTiming.cpp:
        * page/PerformanceTiming.h:
        * page/PerformanceTiming.idl:
        * page/PerformanceUserTiming.cpp:
        * page/PerformanceUserTiming.h:
        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleInternal.h:
        * platform/network/cf/ResourceHandleCFNet.cpp:
        (WebCore::ResourceHandle::start):
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
        * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
        (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandleInternal::didFinish):
        (WebCore::ResourceHandleInternal::calculateWebTimingInformations):
        (WebCore::ResourceHandleInternal::dispatchSynchronousJob):
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::createNSURLConnection):
        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
        (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
        * platform/network/soup/ResourceHandleSoup.cpp:
        (WebCore::restartedCallback):
        (WebCore::sendRequestCallback):
        (WebCore::createSoupMessageForHandleAndRequest):
        (WebCore::ResourceHandle::sendPendingRequest):
        * platform/network/soup/SoupNetworkSession.cpp:
        (WebCore::SoupNetworkSession::SoupNetworkSession):
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::WorkerGlobalScope):
        (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
        (WebCore::WorkerGlobalScope::removeAllEventListeners):
        * workers/WorkerGlobalScope.h:

2017-07-26  Chris Dumez  <cdumez@apple.com>

        Pressing the Escape key should not be a valid user gesture to enter fullscreen
        https://bugs.webkit.org/show_bug.cgi?id=174864
        <rdar://problem/33009088>

        Reviewed by Geoffrey Garen.

        Pressing the Escape key should not be a valid user gesture to enter fullscreen since this
        is the gesture to exit fullscreen already.

        Test: fullscreen/requestFullscreen-escape-key.html

        * dom/Document.cpp:
        (WebCore::Document::requestFullScreenForElement):
        * dom/UserGestureIndicator.cpp:
        (WebCore::UserGestureIndicator::UserGestureIndicator):
        * dom/UserGestureIndicator.h:
        (WebCore::UserGestureToken::create):
        (WebCore::UserGestureToken::gestureType):
        (WebCore::UserGestureToken::UserGestureToken):
        * page/EventHandler.cpp:
        (WebCore::EventHandler::internalKeyEvent):

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

        AX: Incorrect range from index and length in contenteditable with <p> tags
        https://bugs.webkit.org/show_bug.cgi?id=174856

        Reviewed by Chris Fleizach.

        When asking for the string inside a text control with a given range, we sometimes get
        a wrong string at the line boundary due to a bad plain range to text marker conversion.
        To fix this, we should use the exsisting method on text controls to avoid this issue. 

        Updated the test to test the problematic case.

        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

2017-07-26  Daewoong Jang  <daewoong.jang@navercorp.com>

        [Curl] Bug fix after r219606
        https://bugs.webkit.org/show_bug.cgi?id=174845

        Reviewed by Alex Christensen.

        * platform/network/curl/CurlContext.h:
        (WebCore::CurlSList::isEmpty):
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandleInternal::didReceiveHeaderLine):
        (WebCore::ResourceHandleInternal::headerCallback):

2017-07-26  Zan Dobersek  <zdobersek@igalia.com>

        [EME][GStreamer] Multi-key support in the GStreamer ClearKey decryptor
        https://bugs.webkit.org/show_bug.cgi?id=174779

        Reviewed by Xabier Rodriguez-Calvar.

        In the CENC decryptor, the key ID value is retrieved from the info structure
        on the GstProtectionMeta object. GstBuffer for that value is retrieved and
        passed to the setupCipher() function.

        In the ClearKey decryptor (which extends the CENC decryptor), the single
        GstBuffer object on the private instance that holds the key value is replaced
        with a Vector object that holds pairs of key ID and value GstBuffers. In the
        handleKeyResponse() implementation that Vector is emptied and then refilled
        with key ID and value pairs that are passed in through the drm-cipher-clearkey
        structure that's attached to the GstEvent that signalled new key information.

        In the ClearKey decryptor's setupCipher() implementation the passed-in key ID
        buffer is used to find a matching key ID and value pair stored on the private
        instance. If not found, an error is thrown. If found, the matching key value
        is used for decryption.

        * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
        (webKitMediaClearKeyDecryptorHandleKeyResponse):
        (webKitMediaClearKeyDecryptorSetupCipher):
        * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
        (webkitMediaCommonEncryptionDecryptTransformInPlace):
        (webKitMediaCommonEncryptionDecryptDefaultSetupCipher):
        * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:

2017-07-26  Zan Dobersek  <zdobersek@igalia.com>

        [EME][GStreamer] Handle ClearKey as a supported key system
        https://bugs.webkit.org/show_bug.cgi?id=174778

        Reviewed by Xabier Rodriguez-Calvar.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
        Return true for the 'org.w3.clearkey' key system when building with
        ENCRYPTED_MEDIA enabled. The underlying implementation will follow.

2017-07-26  Claudio Saavedra  <csaavedra@igalia.com>

        [WPE] Fix a potential crash in the platform pasteboard when reading a string
        https://bugs.webkit.org/show_bug.cgi?id=174859

        Reviewed by Žan Doberšek.

        We shouldn't assume that the wpe_pasteboard_string struct will be
        filled in, so initialize it.

        * platform/wpe/PlatformPasteboardWPE.cpp:
        (WebCore::PlatformPasteboard::readString): Initialize the struct
        before passing it to wpe and early return if it's still empty.

2017-07-26  Javier Fernandez  <jfernandez@igalia.com>

        InsertOrderedList command applied to table cells inserts an extra BR before the table
        https://bugs.webkit.org/show_bug.cgi?id=174593

        Reviewed by Darin Adler.

        Don't add BR when pruning empty blocks if it's the start of a paragraph.

        The function MoveParagraph is used for several operations and editing
        commands, like 'insertOrderedList'. When moving paragraphs we check out
        whether we should add a 'br' element to avoid undesired block collapse.

        However, we shouldn't do this when destination is the start of a
        paragraph.

        Tests: editing/inserting/insert-list-in-table-cell-01.html
               editing/inserting/insert-list-in-table-cell-02.html
               editing/inserting/insert-list-in-table-cell-03.html
               editing/inserting/insert-list-in-table-cell-04.html
               editing/inserting/insert-list-in-table-cell-05.html
               editing/inserting/insert-list-in-table-cell-06.html
               editing/inserting/insert-list-in-table-cell-07.html
               editing/inserting/insert-list-in-table-cell-08.html

        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::moveParagraphs):

2017-07-26  Zan Dobersek  <zdobersek@igalia.com>

        [WPE] WebGL2 support
        https://bugs.webkit.org/show_bug.cgi?id=174249

        Reviewed by Alex Christensen.

        Implement WebGL2 support in GraphicsContext3DCairo for the WPE port, but keep
        the implementation specific to libepoxy (which WPE leverages by default).

        In the GraphicsContext3D::create() method, we first construct the
        GraphicsContext3D object that also ensures a current GL context on this thread.
        Only then can we determine through libepoxy whether the underlying GL library
        is able to support WebGL2.

        For WebGL2, the GLES3 support is required. The initial libepoxy implementation
        ensures this only in case of 'non-desktop GL' library of minimum version 3.0.
        This effectively translates to the only supported configuration being the
        EGL and OpenGL ES 3.0 (or higher) combination. If this cannot be ensured, we
        discard the existing GraphicsContext3D object and return null.

        WebGL2 can also be supported via OpenGL (i.e. 'desktop GL'), but this hasn't
        been tested yet. Implementation will in the future be extended to support that
        as required.

        In the GraphicsContext3D constructor itself, the ANGLEWebKitBridge constructor
        has to now receive the second argument, the desired shader specification that's
        used when parsing the provided shaders. This should be SH_WEBGL_SPEC for WebGL1,
        and SH_WEBGL2_SPEC for WebGL2.

        No new tests -- a small set of existing WebGL2 tests is unskipped and passing.

        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
        (WebCore::GraphicsContext3D::create):
        (WebCore::GraphicsContext3D::GraphicsContext3D):
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        Add WebGL2-specific methods to the build.

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

        AX: should dispatch accessibilityPerformPressAction async on MacOS
        https://bugs.webkit.org/show_bug.cgi?id=174849

        Reviewed by Chris Fleizach.

        If performing the accessibility press action results in a modal alert being displayed,
        it can cause VoiceOver to hang. To fix it, we should dispatch the action asynchronously.

        Updated tests to adapt to this change.

        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper accessibilityPerformPressAction]):
        (-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]):

2017-07-25  Carlos Garcia Campos  <cgarcia@igalia.com>

        Icon loader error on startup
        https://bugs.webkit.org/show_bug.cgi?id=174787

        Reviewed by Brady Eidson.

        This is a regression of the new icon loading, it happens with pages that shouldn't have a favicon, like about
        pages. IconController::startLoader() did several checks before starting the load that
        DocumentLoader::startIconLoading() is not doing. It checked that the frame is the main one, the document can have
        an icon (document url is not empty and not about:blank) and that favicon url is in HTTP family. We should do the
        same checks now before starting to load icons.

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

2017-07-25  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove custom bindings for HTMLCanvasElement
        https://bugs.webkit.org/show_bug.cgi?id=174847

        Reviewed by Darin Adler.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSHTMLCanvasElementCustom.cpp: Removed.
        Remove JSHTMLCanvasElementCustom.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::getContext):
        (WebCore::HTMLCanvasElement::getContext2d):
        (WebCore::HTMLCanvasElement::getContextWebGL):
        (WebCore::HTMLCanvasElement::getContextWebGPU):
        * html/HTMLCanvasElement.h:
        * html/HTMLCanvasElement.idl:
        Move context picking code to HTMLCanvasElement. Give more
        exact types to remaining context getters.

2017-07-25  Chris Dumez  <cdumez@apple.com>

        Clean up ExceptionCode enumeration
        https://bugs.webkit.org/show_bug.cgi?id=174812

        Reviewed by Darin Adler.

        Clean up ExceptionCode enumeration:
        - Updated comments to reflect the latest WebIDL specification
        - Drop special values given to some exception codes. Those legacy codes are already in the
          table inside DOMException.cpp. This also allows us to drop empty rows in the DOMException
          table
        - Drop NoException value in the enumeration and use std::optional<ExceptionCode> when needed
          instead.

        * Modules/indexeddb/shared/IDBError.cpp:
        (WebCore::IDBError::IDBError):
        (WebCore::IDBError::name):
        (WebCore::IDBError::message):
        * Modules/indexeddb/shared/IDBError.h:
        (WebCore::IDBError::code):
        (WebCore::IDBError::encode):
        (WebCore::IDBError::decode):
        * dom/DOMException.cpp:
        * dom/ExceptionCode.h:
        * fileapi/FileReaderSync.cpp:
        (WebCore::errorCodeToException):
        (WebCore::FileReaderSync::startLoading):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::createRequest):
        * xml/XMLHttpRequest.h:

2017-07-25  Andy Estes  <aestes@apple.com>

        [Apple Pay] Add "carteBancaire" as a supported payment network
        https://bugs.webkit.org/show_bug.cgi?id=174841
        <rdar://problem/31935596>

        Reviewed by Alex Christensen.

        Tests: http/tests/ssl/applepay/ApplePaySession.html
               http/tests/ssl/applepay/ApplePaySessionV3.html

        * Modules/applepay/PaymentRequest.cpp:
        (WebCore::PaymentRequest::isValidSupportedNetwork):

2017-07-25  Daniel Bates  <dabates@apple.com>

        Make StyleResolver::isValid{Cue, Region}StyleProperty() static, inline, non-member functions
        https://bugs.webkit.org/show_bug.cgi?id=174827

        Reviewed by Simon Fraser.

        StyleResolver::isValid{Cue, Region}StyleProperty() access neither instance nor
        class data. Moreover, they are private member functions and hence cannot be
        used outside of StyleResolver's implementation. So, make these static, inline,
        non-member functions.

        * css/StyleResolver.cpp:
        (WebCore::isValidRegionStyleProperty):
        (WebCore::isValidCueStyleProperty):
        (WebCore::StyleResolver::CascadedProperties::addMatch):
        (WebCore::StyleResolver::isValidRegionStyleProperty): Deleted.
        (WebCore::StyleResolver::isValidCueStyleProperty): Deleted.
        * css/StyleResolver.h:

2017-07-25  Per Arne Vollan  <pvollan@apple.com>

        Dragged links are blurry on 1x displays.
        https://bugs.webkit.org/show_bug.cgi?id=174831
        <rdar://problem/33519698>

        Reviewed by Simon Fraser.

        When the width and height of the drag image is a multiple of 2, the drag image is not blurry
        on a 1x display. This is a workaround which should be removed when <rdar://problem/33059739>
        is fixed.

        No new tests, since this is not straightforward to test with a layout test.

        * platform/mac/DragImageMac.mm:
        (WebCore::LinkImageLayout::LinkImageLayout):

2017-07-25  Matt Baker  <mattbaker@apple.com>

        Web Inspector: Refactoring: extract async stack trace logic from InspectorInstrumentation
        https://bugs.webkit.org/show_bug.cgi?id=174738

        Reviewed by Brian Burg.

        Relocate AsyncCallType from InspectorInstrumentation to the debugger
        agent. Plumbing for `requestAnimationFrame` notifications has been added
        to PageDebuggerAgent, which is responsible for managing async stack traces. 

        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::registerCallback):
        (WebCore::ScriptedAnimationController::cancelCallback):
        (WebCore::ScriptedAnimationController::serviceScriptedAnimations):

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didInstallTimerImpl):
        (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
        (WebCore::InspectorInstrumentation::willFireTimerImpl):
        (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
        (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
        (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
        (): Deleted.
        (WebCore::didScheduleAsyncCall): Deleted.

        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didRequestAnimationFrame):
        (WebCore::InspectorInstrumentation::didCancelAnimationFrame):
        (WebCore::InspectorInstrumentation::willFireAnimationFrame):
        Replaced Frame and Document pointers with references and moved
        pointer validation upstream.

        * inspector/PageDebuggerAgent.cpp:
        (WebCore::PageDebuggerAgent::didRequestAnimationFrame):
        (WebCore::PageDebuggerAgent::willFireAnimationFrame):
        (WebCore::PageDebuggerAgent::didCancelAnimationFrame):
        * inspector/PageDebuggerAgent.h:

2017-07-25  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Async image decoding for large images should be disabled after the first time a tile is painted
        https://bugs.webkit.org/show_bug.cgi?id=174451
        <rdar://problem/31246421>

        Reviewed by Simon Fraser.

        Flashing because of DOM mutation can be fixed by disabling the asynchronous
        image decoding after the first time a tile was painted.

        We can detect this by consulting the tile repaintCount. If it is zero, then
        it is safe to use asynchronous image decoded. If the tile repaintCount is
        greater than zero, we are not sure if the renderer rectangle has an image
        drawn in it already or not. In this case we have to use the synchronous
        image decoding to avoid causing a flash.

        Tests: fast/images/async-image-background-change.html
               fast/images/async-image-src-change.html
               http/tests/multipart/multipart-async-image.html

        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
        * page/FrameView.cpp:
        (WebCore::FrameView::willPaintContents):
        (WebCore::FrameView::paintContentsForSnapshot):
        * page/PageOverlayController.cpp:
        (WebCore::PageOverlayController::paintContents):
        * page/PageOverlayController.h:
        * page/linux/ResourceUsageOverlayLinux.cpp:
        * page/mac/ServicesOverlayController.h:
        * page/mac/ServicesOverlayController.mm:
        (WebCore::ServicesOverlayController::Highlight::paintContents):
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::draw):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::GraphicsLayer::paintGraphicsLayerContents):
        * platform/graphics/GraphicsLayer.h:
        * platform/graphics/GraphicsLayerClient.h:
        (WebCore::GraphicsLayerClient::paintContents):
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
        (WebCore::LayerClient::platformCALayerPaintContents):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
        * platform/graphics/ca/GraphicsLayerCA.h:
        * platform/graphics/ca/PlatformCALayer.h:
        * platform/graphics/ca/PlatformCALayerClient.h:
        (WebCore::PlatformCALayerClient::platformCALayerRepaintCount):
        * platform/graphics/ca/TileCoverageMap.cpp:
        (WebCore::TileCoverageMap::platformCALayerPaintContents):
        * platform/graphics/ca/TileCoverageMap.h:
        * platform/graphics/ca/TileGrid.cpp:
        (WebCore::TileGrid::platformCALayerPaintContents):
        (WebCore::TileGrid::platformCALayerRepaintCount):
        * platform/graphics/ca/TileGrid.h:
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        (PlatformCALayer::drawLayerContents):
        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
        (PlatformCALayer::drawLayerContents):
        * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
        (PlatformCALayerWinInternal::displayCallback):
        * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
        (WebTiledBackingLayerWin::displayCallback):
        * platform/graphics/mac/WebLayer.mm:
        (-[WebLayer drawInContext:]):
        (-[WebSimpleLayer drawInContext:]):
        * rendering/PaintPhase.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::decodingModeForImageDraw):
        * rendering/RenderElement.h:
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paintLayerContents):
        (WebCore::RenderLayer::paintForegroundForFragments):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::paintContents):
        * rendering/RenderLayerBacking.h:
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::paintContents):
        * rendering/RenderLayerCompositor.h:
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::paintContents):
        * testing/Internals.cpp:
        (WebCore::imageFromImageElement):
        (WebCore::bitmapImageFromImageElement):
        (WebCore::Internals::imageFrameIndex):
        (WebCore::Internals::setImageFrameDecodingDuration):
        (WebCore::Internals::resetImageAnimation):
        (WebCore::Internals::isImageAnimating):
        (WebCore::Internals::setClearDecoderAfterAsyncFrameRequestForTesting):
        (WebCore::Internals::imageDecodeCount):
        (WebCore::Internals::setLargeImageAsyncDecodingEnabledForTesting):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-07-23  Sam Weinig  <sam@webkit.org>

        [WebIDL] Add support for generating timer bindings
        https://bugs.webkit.org/show_bug.cgi?id=174766

        Reviewed by Darin Adler.

        Adds a new non-standard type, ScheduledAction, which stands in for the
        standard (DOMString or Function). It would be good to move to that in
        future, but for now, this allows for forward momentum on removing custom
        bindings.

        * WebCore.xcodeproj/project.pbxproj:
        Add JSDOMConvertScheduledAction.h.

        * bindings/IDLTypes.h:
        Add IDLScheduledAction.

        * bindings/js/JSDOMConvertScheduledAction.h: Added.
        (WebCore::Converter<IDLScheduledAction>::convert):
        Add conversion from JSValue -> ScheduledAction. This is moved from the old ScheduledAction
        create function.

        * bindings/js/JSDOMConvertVariadic.h:
        (WebCore::convertVariadicArguments):
        (WebCore::Detail::VariadicConverterBase::convert): Deleted.
        (WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert): Deleted.
        * bindings/js/JSDOMConvertBase.h:
        * bindings/js/JSDOMConvertAny.h:
        (WebCore::VariadicConverter<IDLAny>::convert):
        * bindings/js/JSDOMConvertInterface.h:
        (WebCore::VariadicConverter<IDLInterface<T>>::convert):
        Rename VariadicConverter to VariadicConverterDetails, and remove base class. Rename 
        VariadicConverterBase to VariadicConverter, and move specializations to the file
        containing the base converter for that IDL type 

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::setTimeout): Deleted.
        (WebCore::JSDOMWindow::setInterval): Deleted.
        * bindings/js/JSWorkerGlobalScopeCustom.cpp:
        (WebCore::JSWorkerGlobalScope::setTimeout): Deleted.
        (WebCore::JSWorkerGlobalScope::setInterval): Deleted.
        Remove custom implementations of setTimeout and setInterval.

        * bindings/js/ScheduledAction.cpp:
        (WebCore::ScheduledAction::create):
        (WebCore::ScheduledAction::ScheduledAction):
        (WebCore::ScheduledAction::~ScheduledAction):
        (WebCore::ScheduledAction::addArguments):
        (WebCore::ScheduledAction::executeFunctionInContext):
        * bindings/js/ScheduledAction.h:
        (WebCore::ScheduledAction::ScheduledAction): Deleted.
        Rework ScheduledAction. Now has two create functions, one for the function
        form, one for the string form. These are now called by the Converter. Also,
        rather than extracting the arguments directly from the ExecState, allow the
        bindings to work as designed, and have the arguments come in as variadic 
        arguments to setTimeout/setInterval and get added to the ScheduledAction if
        needed. Also, move ContentSecurityPolicy check out of construction, and into
        setTimeout/setInterval.

        * bindings/scripts/CodeGenerator.pm:
        (IsBuiltinType):
        Add ScheduledAction to the builtin list.

        * bindings/scripts/CodeGeneratorJS.pm:
        (AddToIncludesForIDLType):
        Add the correct include when ScheduledAction is used.

        (GenerateParametersCheck):
        Remove rule disallowing optional arguments before variadic arguments. That works
        just fine.

        (GetBaseIDLType):
        Add mapping of ScheduledAction -> IDLScheduledAction.

        (JSValueToNativeDOMConvertNeedsGlobalObject):
        Add ScheduledAction to the list of types that need a global object
        for conversion.

        * page/WindowOrWorkerGlobalScope.idl:
        Update interface to match spec and add FIXMEs for moving to TimerHandler.

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::setTimeout):
        (WebCore::DOMWindow::setInterval):
        * page/DOMWindow.h:
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::setTimeout):
        (WebCore::WorkerGlobalScope::setInterval):
        * workers/WorkerGlobalScope.h:
        Update for new signatures. WorkerGlobalScope now has to return ExceptionOr<int>
        even though it never throws, due to having one IDL file defining these. This is 
        unfortunate and something we should look at addressing the future.

2017-07-25  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        [WinCairo] Fix build with AllInOnes disabled
        https://bugs.webkit.org/show_bug.cgi?id=174784
        <rdar://problem/33488914>

        Reviewed by Alex Christensen.

        * PlatformWin.cmake:
        Add RenderThemeWin.cpp to WebCore_SOURCES

        * rendering/RenderingAllInOne.cpp:
        Remove #include "RenderThemeWin.cpp"

        * testing/MemoryInfo.h:
        Remove #include "JSDomWindow.h"

        * bindings/js/JSDOMGlobalObject.cpp:
        * bindings/js/JSDOMPromiseDeferred.cpp:
        * bindings/js/JSDOMWrapper.cpp:
        * bindings/js/JSImageDataCustom.cpp:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateCallWith):
        * dom/ScriptExecutionContext.cpp:
        * inspector/InspectorController.cpp:
        * inspector/InspectorTimelineAgent.cpp:
        * rendering/RenderMediaControls.cpp:
        * rendering/RenderMediaControls.h:
        * rendering/RenderThemeWin.cpp:

        * bindings/scripts/test/JS/JSTestObj.cpp:
        Update test results.

2017-07-25  Konstantin Tokarev  <annulen@yandex.ru>

        Unreviewed, fix Mac CMake build after r219567

        * PlatformMac.cmake:

2017-07-23  Darin Adler  <darin@apple.com>

        More NeverDestroyed and related cleanup
        https://bugs.webkit.org/show_bug.cgi?id=174745

        Reviewed by Alex Christensen.

        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::constructElementWithFallback):
        Use isNull() rather than comparing against nullAtom() since it's
        slightly more efficient.

        * css/MediaQueryEvaluator.cpp:
        (WebCore::prefersReducedMotionEvaluate): Use a switch statement for the
        three states of forcedPrefersReducedMotionAccessibilityValue. Also update
        to use Theme::singleton() instead of platformTheme().

        * dom/QualifiedName.h: Removed some unneeded includes, minor style tweaks,
        and use isNull() rather than comparing against nullAtom() since it's
        slightly more efficient.

        * html/Autofill.cpp:
        (WebCore::AutofillData::createFromHTMLFormControlElement): Use isNull()
        rather than comparing against nullAtom() since it's slightly more efficient.

        * html/HTMLDocument.cpp:
        (WebCore::addLocalNameToSet): Deleted.
        (WebCore::createHtmlCaseInsensitiveAttributesSet): Deleted.
        (WebCore::HTMLDocument::isCaseSensitiveAttribute): Moved the case-sensitive
        attribute set in here and made it use makeNeverDestroyed.

        * html/HTMLNameCollection.cpp:
        (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch):
        Formatted vertically and sorted so it's easier to see what it does.
        (WebCore::WindowNameCollection::elementMatches): Use boolean logic instead
        of multiple return statements to make this a little more straightforward.
        (WebCore::isObjectElementForDocumentNameCollection): Added. Calls the new
        isExposed function. The old code called this isDocNamedItem.
        (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch):
        Use isObjectElementForDocumentNameCollection to clean up logic. Also
        sorted classes.
        (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch):
        Use isObjectElementForDocumentNameCollection to clean up logic. Also
        sorted classes and formatted vertically.
        (WebCore::DocumentNameCollection::elementMatches): Write in terms of
        above functions for clarity. Efficiency is roughly the same.

        * html/HTMLObjectElement.cpp:
        (WebCore::HTMLObjectElement::HTMLObjectElement): Initialize data members
        in class definition instead of here.
        (WebCore::HTMLObjectElement::childrenChanged): Update for name change;
        function is now called updateExposedState rather than updateDocNamedItem.
        Also use m_useFallbackContent directly instead of through a function.
        (WebCore::HTMLObjectElement::renderFallbackContent): Ditto.
        (WebCore::preventsParentObjectFromExposure): Added. Replaces the old
        isRecognizedTagName function, and does almost the same thing, but the
        argument type is different and the param tag is now one of the tags
        exempted here. Also broke up into two overloads so we can handle the
        Element, Text, and other Node cases.
        (WebCore::shouldBeExposed): Added. Helper for the updateExposedState
        function that handles the logic of when the element should be exposed,
        separating it from what to do when the state changes.
        (WebCore::HTMLObjectElement::updateExposedState): Renamed from
        updateDocNamedItem.

        * html/HTMLObjectElement.h: Renamed isDocNamedItem -> isExposed,
        m_docNamedItem -> m_isExposed, updateDocNamedItem -> updateExposedState,
        stopped using bit fields for the two boolean data members, and
        initialized those data members here in the class definition.

        * platform/Theme.cpp:
        (WebCore::Theme::baselinePositionAdjustment): Moved here from header.
        (WebCore::Theme::controlFont): Ditto.
        (WebCore::Theme::controlSize): Ditto.
        (WebCore::Theme::minimumControlSize): Ditto.
        (WebCore::Theme::controlRequiresPreWhiteSpace): Ditto.
        (WebCore::Theme::paint): Ditto.
        (WebCore::Theme::inflateControlPaintRect): Ditto.
        (WebCore::Theme::userPrefersReducedMotion): Ditto.
        (WebCore::Theme::controlBorder): Fixed switch statement indentation.
        (WebCore::Theme::controlPadding): Ditto.

        * platform/Theme.h: Removed the many unnecessary includes. The one
        I was really after here was FontCascade.h. Replaced the platformTheme
        function with a singleton function, following our normal style. Also
        changed the return type to a reference rather than a pointer.
        Removed many unused function and data members.

        * platform/cocoa/ThemeCocoa.h: Tightened up implementation, removing
        unnecessary members and making overrides private.
        * platform/cocoa/ThemeCocoa.mm: Moved include in here.

        * platform/gamepad/glib/GamepadsGlib.cpp:
        (WebCore::sampleGamepads): Use NeverDestroyed instead of
        DEPRECATED_DEFINE_STATIC_LOCAL.

        * platform/graphics/FontCascade.cpp:
        (WebCore::useBackslashAsYenSignForFamily): Build the set in a cleaner
        way and use a NeverDestroyed set instead of a heap-allocated one.
        (WebCore::FontCascade::FontCascade): Moved initialization of data members
        to the class definition.

        * platform/graphics/FontCascade.h: Initialize GlyphOverflow and
        FonstCascade data members in the class definition. Remove the constructor
        for GlyphOverflow entirely. Added FIXME about the peculiar != operator we
        defined for GlyphOverflow.

        * platform/graphics/NamedImageGeneratedImage.cpp:
        (WebCore::NamedImageGeneratedImage::draw): Use Theme::singleton() instead
        of platformTheme().
        (WebCore::NamedImageGeneratedImage::drawPattern): Ditto.

        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
        (WebCore::CMTimeRangeStartKey): Use CFSTR directly instead of using
        DEPRECATED_DEFINE_STATIC_LOCAL.
        (WebCore::CMTimeRangeDurationKey): Ditto.
        (WebCore::CACFContextNeedsFlushNotification): Ditto.

        * platform/graphics/ca/win/LayerChangesFlusher.cpp:
        (WebCore::LayerChangesFlusher::singleton): Use NeverDestroyed instead of
        DEPRECATED_DEFINE_STATIC_LOCAL.
        * platform/graphics/ca/win/LayerChangesFlusher.h: Ditto.

        * platform/graphics/cg/ImageSourceCGWin.cpp:
        (WebCore::preferredExtensionForImageSourceType): Use HashMap constructor
        instead of writing out a lot of add calls.

        * platform/graphics/harfbuzz/HarfBuzzFace.cpp:
        (WebCore::harfBuzzFaceCache): Use NeverDestroyed instead of
        DEPRECATED_DEFINE_STATIC_LOCAL.
        * platform/graphics/win/FontCacheWin.cpp:
        (WebCore::FontCache::lastResortFallbackFont): Ditto.

        * platform/ios/ThemeIOS.h: Tightened up implementation, removing
        unnecessary members and making overrides private.
        * platform/ios/ThemeIOS.mm:
        (WebCore::Theme::singleton): Renamed from platformTheme.

        * platform/mac/ThemeMac.h: Tightened up implementation, removing
        unnecessary members and making overrides private. Removed unneeded
        WTF_MAKE_FAST_ALLOCATED since this is never allocated on the heap.
        Removed unused -[NSFont webCoreFamilyName] method.
        * platform/mac/ThemeMac.mm:
        (-[NSFont webCoreFamilyName]): Deleted.
        (WebCore::Theme::singleton): Renamed from platformTheme.

        * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
        Removed unneeded include of FontCascade.h.
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
        Ditto.
        * platform/mock/MockRealtimeAudioSource.h: Ditto.

        * platform/network/win/DownloadBundleWin.cpp:
        (WebCore::DownloadBundle::fileExtension): Use NeverDestroyed
        instead of DEPRECATED_DEFINE_STATIC_LOCAL.

        * platform/win/ClipboardUtilitiesWin.cpp:
        (WebCore::replaceNewlinesWithWindowsStyleNewlines): Use
        appendLiteral instead of DEPRECATED_DEFINE_STATIC_LOCAL.

        * platform/win/FileSystemWin.cpp:
        (WebCore::bundleName): Use NeverDestroyed instead of
        DEPRECATED_DEFINE_STATIC_LOCAL, and used a lambda to initialize
        rather than a boolean to control one-time code.
        (WebCore::storageDirectory): Removed unneeded use of
        DEPRECATED_DEFINE_STATIC_LOCAL for a prefix we are appending to
        a String. The + operator can handle a literal just as efficiently
        without first storing it in a String.

        * platform/wpe/ThemeWPE.cpp:
        (WebCore::Theme::singleton): Renamed from platformTheme.
        * platform/wpe/ThemeWPE.h: Tightened up implementation, removing
        unnecessary members and making overrides private.

        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::RenderTheme): No need to initialize m_theme.
        (WebCore::RenderTheme::adjustStyle): Use Theme::singleton() instead
        of accessing it through m_theme.
        (WebCore::RenderTheme::paint): Ditto.
        (WebCore::RenderTheme::baselinePosition): Ditto.
        (WebCore::RenderTheme::adjustRepaintRect): Ditto.
        (WebCore::RenderTheme::setCustomFocusRingColor): Ditto.
        (WebCore::RenderTheme::platformTapHighlightColor): Ditto.

        * rendering/RenderTheme.h: Removed unneded m_theme and unneeded
        inclusion of Theme.h.

        * rendering/line/LineBreaker.h: Removed unneeded include of
        FontCascade.h.

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

        ExceptionCode enumeration should use modern exception names
        https://bugs.webkit.org/show_bug.cgi?id=174794

        Reviewed by Geoffrey Garen.

        ExceptionCode enumeration should use modern exception names consistently.
        This makes the code nicer and closer to the text of the specification.

2017-07-24  Andy Estes  <aestes@apple.com>

        Consider implementing W3C Payment Request API
        https://bugs.webkit.org/show_bug.cgi?id=174796

        Reviewed by Daniel Bates.

        Add Payment Request to features.json as "Under Consideration".

        * features.json:

2017-07-24  Konstantin Tokarev  <annulen@yandex.ru>

        Unreviewed attempt to fix Mac cmake build

        * PlatformMac.cmake:

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

        Make ExceptionCode a proper enumeration
        https://bugs.webkit.org/show_bug.cgi?id=174771

        Reviewed by Sam Weinig.

        Make ExceptionCode a proper enumeration instead of a typedef to uint8_t.

        * Modules/fetch/FetchBody.h:
        (WebCore::FetchBody::formData):
        * Modules/indexeddb/shared/IDBError.h:
        (WebCore::IDBError::encode):
        (WebCore::IDBError::decode):
        * bindings/js/JSSubtleCryptoCustom.cpp:
        (WebCore::rejectWithException):
        * dom/Exception.h:
        * dom/ExceptionCode.h:
        * fileapi/FileReaderSync.cpp:
        (WebCore::errorCodeToExceptionCode):
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::texSubImage2D):
        (WebCore::WebGLRenderingContextBase::texImage2D):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::createRequest):
        * xml/XMLHttpRequest.h:

2017-07-24  Simon Fraser  <simon.fraser@apple.com>

        Change "client" coordinates back to match scrolling coordinates
        https://bugs.webkit.org/show_bug.cgi?id=174734
        rdar://problem/33336930

        Reviewed by Tim Horton.

        Baidu.com (which uses jQuery), and various iOS apps make the assumption that getBoundingClientRect() returns a rectangle
        that can be used to set or compare with the scroll position. With visual viewports, that assumption is no longer valid
        when the page is zoomed, or when the keyboard has caused the visual viewport to detach from the layout viewport.

        At this point the compatibility cost of shipping layout viewport-based client rects seems higher than the gain, so revert
        to the shipping behavior. This reverts r216803, and will re-introduce bugs that occurred on zoomed pages on macOS,
        many of which are noted in webkit.org/b/170981.

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

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

        [WPE] libepoxy headers can use EGL_CAST, which might not be defined by eglplatform.h
        https://bugs.webkit.org/show_bug.cgi?id=174780

        Reviewed by Carlos Garcia Campos.

        Newer versions of libepoxy provide EGL definitions that already use the EGL_CAST macro.
        We'd like to compile on systems where the eglplatform.h header doesn't yet provide
        that macro that was added only recently (e.g. it's available in Mesa 17.1, but not
        before).

        To address that, the EpoxyEGL.h header is added that first includes the libepoxy's EGL
        header and then provides the EGL_CAST definition in case the eglplatform.h header doesn't.
        This header should be included in place of <epoxy/egl.h> (which is included in this new
        header).

        The EpoxyEGL.h and EpoxyShims.h headers are also moved under the platform/graphics/epoxy/
        directory, with the new directory added to the list of inclusion paths for WPE.

        * PlatformWPE.cmake:
        * platform/graphics/PlatformDisplay.cpp:
        * platform/graphics/cairo/CairoUtilities.cpp:
        * platform/graphics/cairo/ImageBufferCairo.cpp:
        * platform/graphics/egl/GLContextEGL.cpp:
        * platform/graphics/egl/GLContextEGLWPE.cpp:
        * platform/graphics/epoxy/EpoxyEGL.h: Added.
        * platform/graphics/epoxy/EpoxyShims.h: Renamed from Source/WebCore/platform/graphics/EpoxyShims.h.
        * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
        * platform/graphics/wpe/PlatformDisplayWPE.cpp:

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

        [CoordinatedGraphics] Remove unused GLDefs.h header
        https://bugs.webkit.org/show_bug.cgi?id=174712

        Reviewed by Michael Catanzaro.

        * platform/graphics/opengl/GLDefs.h: Remove this unused header.
        As far as my recollection goes it was used in the IPC-based
        CoordinatedGraphics subsystem, which has been removed already.

2017-07-11  Frederic Wang  <fwang@igalia.com>

        Add attribute allow-top-navigation-by-user-activation to iframe sandbox
        https://bugs.webkit.org/show_bug.cgi?id=171327

        Reviewed by Chris Dumez.

        Tests: http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-1.html
               http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-2.html
               imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation_without_user_gesture-expected.txt
               imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation-3-expected.txt

        * dom/Document.cpp:
        (WebCore::Document::canNavigate): Case 2 of conformance verification is refined to match the
        current specification: Top navigation is allowed when it is triggered by user activation and
        when allow-top-navigation-by-user-activation is set. Because we have additional "security
        origin" rules with respect to the specification we also add some early return to ensure that
        navigation is really allowed for this new case.
        * dom/SecurityContext.cpp:
        (WebCore::SecurityContext::isSupportedSandboxPolicy): Add allow-top-navigation-by-user-activation flag.
        (WebCore::SecurityContext::parseSandboxPolicy): Parse the new flag to allow top user
        navigation by user activation. Also, make sure that allow-top-navigation allows such
        navigation as defined by the specification.
        * dom/SecurityContext.h: Declare new sandboxing flag.

2017-07-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS WK2] 5 DataInteractionTests are failing: observed selection rects after dropping don't match expected values
        https://bugs.webkit.org/show_bug.cgi?id=174769
        <rdar://problem/33478864>

        Reviewed by Tim Horton.

        These tests began failing after r219541, due to a change in behavior of whether or not we call
        setIgnoreSelectionChanges(false, RevealSelection::No) or setIgnoreSelectionChanges(false, RevealSelection::Yes)
        when performing a text editing drop.

        Before r219541, we would not reveal the selection when performing an edit drag operation. This is because in
        WebPage::performDragControllerAction, we would begin ignoring selection changes by calling
        setIgnoreSelectionChanges(true). However, while taking a text indicator snapshot, we would stop ignoring
        selection in TextIndicator::createWithRange due to us calling setIgnoreSelectionChanges(false,
        RevealSelection::No) at the end of the function. Then, when we return to the scope of
        WebPage::performDragControllerAction and try to setIgnoreSelectionChanges(false), this is a no-op because we've
        already stopped ignoring selection changes.

        After r219541, switching to using TemporarySelectionChange means that TextIndicator::createWithRange now means
        we respect whether or not we were already ignoring selection before taking the snapshot, so we won't always
        setIgnoreSelectionChanges(false) at the end. This means that selection changes will now be correctly ignored
        when performing a drag operation, but this also means that we'll try to reveal the selection, since
        WebPage::performDragControllerAction calls setIgnoreSelectionChanges(false), for which RevealSelection::Yes
        is used by default.

        Revealing the selection in WebPage::performDragControllerAction was unintended in the first place, so we should
        revert to calling setIgnoreSelectionChanges(false, RevealSelection::No). To ensure this, we adopt
        TemporarySelectionChange here and pass only TemporarySelectionOptionIgnoreSelectionChanges, so that we won't
        additionally try to reveal selection after the drop. This is consistent with behavior prior to macOS 10.13 and
        iOS 11. Additionally, this patch also moves the call to ignore selection change from WebKit into WebCore, so
        that whether we ignore selection is consistent across both WebKit1 and WebKit2.

        * page/DragController.cpp:
        (WebCore::DragController::performDragOperation):

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

        Drop ExceptionCodeDescription class
        https://bugs.webkit.org/show_bug.cgi?id=174757

        Reviewed by Darin Adler.

        Drop ExceptionCodeDescription class now that there is only one exception
        type: DOMException. Instead, we now have static methods on DOMException
        to get the name / message for a given exception code.

        * CMakeLists.txt:
        * Modules/indexeddb/shared/IDBError.cpp:
        (WebCore::IDBError::name):
        (WebCore::IDBError::message):
        * Modules/quota/StorageErrorCallback.cpp:
        (WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMExceptionHandling.cpp:
        (WebCore::createDOMException):
        * dom/DOMAllInOne.cpp:
        * dom/DOMException.cpp:
        (WebCore::errorCodeFromName):
        (WebCore::DOMException::create):
        (WebCore::DOMException::DOMException):
        (WebCore::DOMException::name):
        (WebCore::DOMException::message):
        * dom/DOMException.h:
        * dom/ExceptionCodeDescription.cpp: Removed.
        * dom/ExceptionCodeDescription.h: Removed.
        * inspector/DOMEditor.cpp:
        (WebCore::populateErrorString):
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::toErrorString):
        * inspector/InspectorDOMStorageAgent.cpp:
        (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):

2017-07-22  Dan Bernstein  <mitz@apple.com>

        Fixed building for macOS 10.12 with the macOS 10.13 SDK after r219644.

        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
        (WebCore::CDMSessionAVStreamSession::update): Suppress the objc-literal-conversion warning
          in one place where we are calling a class method on a Class and the compiler can’t tell
          which class it is, so it chooses wrong and emits a warning.

2017-07-22  Chris Dumez  <cdumez@apple.com>

        Merge ExceptionBase into DOMException and drop custom toString
        https://bugs.webkit.org/show_bug.cgi?id=174755

        Reviewed by Sam Weinig.

        Merge ExceptionBase into DOMException and drop custom toString, now that DOMException
        is the only remaining exception type.

        * CMakeLists.txt:
        * Modules/mediastream/MediaStream.h:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMExceptionHandling.cpp:
        (WebCore::retrieveErrorMessage):
        * dom/DOMAllInOne.cpp:
        * dom/DOMException.cpp:
        (WebCore::DOMException::DOMException):
        (WebCore::DOMException::initializeDescription):
        * dom/DOMException.h:
        (WebCore::DOMException::code):
        (WebCore::DOMException::name):
        (WebCore::DOMException::message):
        * dom/ExceptionBase.cpp: Removed.
        * dom/ExceptionBase.h: Removed.

2017-07-14  Filip Pizlo  <fpizlo@apple.com>

        It should be easy to decide how WebKit yields
        https://bugs.webkit.org/show_bug.cgi?id=174298

        Reviewed by Saam Barati.

        No new tests because the WebCore change is just a change to how we #include things.

        * inspector/InspectorPageAgent.h:
        * inspector/TimelineRecordFactory.h:
        * workers/Worker.h:
        * workers/WorkerGlobalScopeProxy.h:
        * workers/WorkerMessagingProxy.h:

2017-07-22  Said Abou-Hallawa  <sabouhallawa@apple.com>

        REGRESSION(r219045): A partially loaded image may not be repainted when its complete frame finishes decoding
        https://bugs.webkit.org/show_bug.cgi?id=174230

        Reviewed by Simon Fraser.

        Because of r219045, we now only repaint the CachedImageClinets which tried
        to draw the image but they could not because they have to wait for the image
        decoding to finish. This was done by keeping a HashSet of these clients 
        and make CachedImage own it. This HashSet is cleared once the image frame
        finishes decoding and all the waited clients are repainted.

        But Multiple asynchronous image decoding requests are allowed for the same
        frame if new data is added to the image source. If we tried to draw the 
        same image twice before it finishes decoding the first request, we will
        not be to record this second request since the HashSet will not add the
        same client twice. When he second request finishes decoding, CachedImage
        will not repaint any client since its HashSet is empty.

        To fix this problem we can do the following. When an image frame finishes
        decoding, CachedImage will keep its HashSet of pending drawing clients as
        long as the image frame is a partially loaded frame.

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::CachedImageObserver::imageFrameAvailable):
        (WebCore::CachedImage::imageFrameAvailable):
        * loader/cache/CachedImage.h:
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::destroyDecodedData):
        (WebCore::BitmapImage::dataChanged):
        (WebCore::BitmapImage::setCurrentFrameDecodingStatusIfNecessary):
        (WebCore::BitmapImage::draw):
        (WebCore::BitmapImage::internalStartAnimation):
        (WebCore::BitmapImage::internalAdvanceAnimation):
        (WebCore::BitmapImage::imageFrameAvailableAtIndex):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/ImageFrame.cpp:
        (WebCore::ImageFrame::decodingStatus):
        * platform/graphics/ImageFrame.h: Move DecodingStatus out of this class
        to ImageTypes.h to avoid adding other header files to ImageObvsever.h
        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::setNativeImage):
        (WebCore::ImageFrameCache::cacheMetadataAtIndex):
        (WebCore::ImageFrameCache::cacheNativeImageAtIndex):
        (WebCore::ImageFrameCache::cacheNativeImageAtIndexAsync):
        (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
        (WebCore::ImageFrameCache::frameDecodingStatusAtIndex):
        * platform/graphics/ImageFrameCache.h:
        * platform/graphics/ImageObserver.h:
        * platform/graphics/ImageSource.h:
        (WebCore::ImageSource::frameDecodingStatusAtIndex):
        * platform/graphics/ImageTypes.h:
        * platform/image-decoders/bmp/BMPImageReader.cpp:
        (WebCore::BMPImageReader::decodeBMP):
        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::frameComplete):
        (WebCore::GIFImageDecoder::initFrameBuffer):
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageDecoder::outputScanlines):
        (WebCore::JPEGImageDecoder::jpegComplete):
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::rowAvailable):
        (WebCore::PNGImageDecoder::pngComplete):
        (WebCore::PNGImageDecoder::frameComplete):
        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::decode):
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::decodingModeForImageDraw):

2017-07-22  Timothy Horton  <timothy_horton@apple.com>

        Drag and Drop preview image for Twitter link is the wrong shape
        ​https://bugs.webkit.org/show_bug.cgi?id=174731
        <rdar://problem/33335616>

        * dom/Range.cpp:
        (WebCore::Range::absoluteRectsForRangeInText):
        * page/TextIndicator.cpp:
        (WebCore::initializeIndicator):
        Apply some post-landing review feedback for r219756.

2017-07-21  Chris Dumez  <cdumez@apple.com>

        Drop IDBDatabaseException class
        https://bugs.webkit.org/show_bug.cgi?id=174743

        Reviewed by Darin Adler.

        Drop IDBDatabaseException class and use DOMException directly. IDBDatabaseException was
        only an internal concept and was already exposed to the Web as a DOMException. This
        simplifies the code a bit and will allow for further simplification in a follow-up patch.

        No new tests, no Web-facing behavior change, except for some exception messages
        being slightly different.

        * CMakeLists.txt:
        * Modules/indexeddb/IDBCursor.cpp:
        (WebCore::IDBCursor::update):
        (WebCore::IDBCursor::advance):
        (WebCore::IDBCursor::continuePrimaryKey):
        (WebCore::IDBCursor::continueFunction):
        (WebCore::IDBCursor::deleteFunction):
        * Modules/indexeddb/IDBDatabase.cpp:
        (WebCore::IDBDatabase::createObjectStore):
        (WebCore::IDBDatabase::transaction):
        (WebCore::IDBDatabase::deleteObjectStore):
        * Modules/indexeddb/IDBDatabaseError.h: Removed.
        * Modules/indexeddb/IDBDatabaseException.cpp: Removed.
        * Modules/indexeddb/IDBDatabaseException.h: Removed.
        * Modules/indexeddb/IDBFactory.cpp:
        (WebCore::IDBFactory::cmp):
        * Modules/indexeddb/IDBIndex.cpp:
        (WebCore::IDBIndex::setName):
        (WebCore::IDBIndex::openCursor):
        (WebCore::IDBIndex::openKeyCursor):
        (WebCore::IDBIndex::count):
        (WebCore::IDBIndex::doCount):
        (WebCore::IDBIndex::get):
        (WebCore::IDBIndex::doGet):
        (WebCore::IDBIndex::getKey):
        (WebCore::IDBIndex::doGetKey):
        (WebCore::IDBIndex::getAll):
        (WebCore::IDBIndex::getAllKeys):
        * Modules/indexeddb/IDBKeyRange.cpp:
        (WebCore::IDBKeyRange::only):
        (WebCore::IDBKeyRange::lowerBound):
        (WebCore::IDBKeyRange::upperBound):
        (WebCore::IDBKeyRange::bound):
        (WebCore::IDBKeyRange::includes):
        * Modules/indexeddb/IDBObjectStore.cpp:
        (WebCore::IDBObjectStore::setName):
        (WebCore::IDBObjectStore::openCursor):
        (WebCore::IDBObjectStore::openKeyCursor):
        (WebCore::IDBObjectStore::get):
        (WebCore::IDBObjectStore::getKey):
        (WebCore::IDBObjectStore::putOrAdd):
        (WebCore::IDBObjectStore::doDelete):
        (WebCore::IDBObjectStore::deleteFunction):
        (WebCore::IDBObjectStore::clear):
        (WebCore::IDBObjectStore::createIndex):
        (WebCore::IDBObjectStore::index):
        (WebCore::IDBObjectStore::deleteIndex):
        (WebCore::IDBObjectStore::count):
        (WebCore::IDBObjectStore::doCount):
        (WebCore::IDBObjectStore::getAll):
        (WebCore::IDBObjectStore::getAllKeys):
        * Modules/indexeddb/IDBOpenDBRequest.cpp:
        (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
        * Modules/indexeddb/IDBRequest.cpp:
        (WebCore::IDBRequest::result):
        (WebCore::IDBRequest::error):
        (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
        * Modules/indexeddb/IDBTransaction.cpp:
        (WebCore::IDBTransaction::objectStore):
        (WebCore::IDBTransaction::abort):
        (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
        (WebCore::IDBTransaction::didCreateIndexOnServer):
        (WebCore::IDBTransaction::putOrAddOnServer):
        * Modules/indexeddb/server/IndexValueStore.cpp:
        (WebCore::IDBServer::IndexValueStore::addRecord):
        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
        (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
        (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
        (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
        (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
        (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
        (WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
        (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
        (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
        (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
        (WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
        (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
        (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
        (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
        (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
        (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
        (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
        (WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
        (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
        (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
        * Modules/indexeddb/server/MemoryIndex.cpp:
        (WebCore::IDBServer::MemoryIndex::putIndexKey):
        * Modules/indexeddb/server/MemoryObjectStore.cpp:
        (WebCore::IDBServer::MemoryObjectStore::createIndex):
        (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
        (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
        (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
        (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
        (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
        (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
        (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
        (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
        (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
        (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
        (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
        (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
        (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
        (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
        (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
        (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
        (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
        (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
        (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
        (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
        * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
        (WebCore::IDBServer::SQLiteIDBTransaction::begin):
        (WebCore::IDBServer::SQLiteIDBTransaction::commit):
        (WebCore::IDBServer::SQLiteIDBTransaction::abort):
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
        (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
        (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
        (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
        (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
        (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
        (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
        (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
        * Modules/indexeddb/shared/IDBError.cpp:
        (WebCore::IDBError::name):
        (WebCore::IDBError::message):
        (WebCore::IDBError::toDOMError):
        * Modules/indexeddb/shared/IDBError.h:
        (WebCore::IDBError::userDeleteError):
        (WebCore::IDBError::isNull):
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMExceptionHandling.cpp:
        (WebCore::createDOMException):

        * dom/DOMException.cpp:
        (WebCore::DOMException::initializeDescription):
        Initialize description->code from using the actual error codes in the
        coreExceptions table, instead of initializing it using |ec|. |ec| is
        the index in the ExceptionCode enumeration and it matches the error
        code only for legacy exceptions. New exceptions such as DataError
        should have a code of 0. Without this change, w3c for IDB would start
        failing.

        * dom/ExceptionCodeDescription.cpp:
        (WebCore::ExceptionCodeDescription::ExceptionCodeDescription):
        * dom/ExceptionCodeDescription.h:

2017-07-21  Sam Weinig  <sam@webkit.org>

        [WebIDL] Simplify XMLHttpRequest bindings by removing built-ins
        https://bugs.webkit.org/show_bug.cgi?id=174740

        Reviewed by Chris Dumez.

        The behavior we were getting from XMLHttpRequest.js can be implemented
        with the [CachedAttribute] extended attribute. This reduces the number
        of JS -> C++ jumps required and makes the code more similar to other
        bindings that need caching of an IDL any value.

        * CMakeLists.txt:
        * DerivedSources.make:
        * xml/XMLHttpRequest.js: Removed.
        Remove XMLHttpRequest.js.

        * bindings/js/JSXMLHttpRequestCustom.cpp:
        (WebCore::JSXMLHttpRequest::response):
        (WebCore::JSXMLHttpRequest::retrieveResponse): Deleted.
        * xml/XMLHttpRequest.idl:
        Replace builtin with a [CachedAttribute] and [CustomGetter]
        for the response property.

2017-07-21  Timothy Horton  <timothy_horton@apple.com>

        Drag and Drop preview image for Twitter link is the wrong shape
        https://bugs.webkit.org/show_bug.cgi?id=174731
        <rdar://problem/33335616>

        Reviewed by Zalan Bujtas.

        TextIndicator uses Range::borderAndTextQuads and ::absoluteTextRects
        in order to get the rects of the indicated text. Currently, these
        functions do not respect clipping, so clipped-out text (e.g. as seen
        inside links on Twitter) generates lots of meaningless indicated rects.

        * page/TextIndicator.cpp:
        (WebCore::estimatedBackgroundColorForRange):
        (WebCore::hasAnyIllegibleColors):
        Change adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary
        to instead be hasAnyIllegibleColors, and referred to in the same place
        as hasNonInlineOrReplacedElements, so that it follows the same
        upgrade path (leaving textRects empty, so that it is later filled in
        with the absoluteBoundingRect). This was a mistake in r219033, which
        instead would end up painting all content, but filling in textRects
        with the actual individual text rects.

        This alone changes the behavior on Twitter from lots of jagged misplaced
        rects to a too-large bounding rect. Combined with the following changes,
        the bounding rect is reduced to the right size:

        (WebCore::initializeIndicator):
        Adopt the new Range::borderAndTextQuads and ::absoluteTextRects parameter
        and opt-in to respecting clipping for text rects.

        * dom/DOMRectList.cpp:
        (WebCore::DOMRectList::DOMRectList):
        * dom/DOMRectList.h:
        (WebCore::DOMRectList::create):
        Add a DOMRectList constructor and create() that take FloatRects, similar
        to the one that takes FloatQuads, but without the boundingRect() calls.

        * dom/Document.h:
        * dom/Document.cpp:
        (WebCore::Document::convertAbsoluteToClientRects):
        Add convertAbsoluteToClientRects, similar to covertAbsoluteToClientQuads,
        except acting on rects instead of quads.

        * dom/Range.cpp:
        (WebCore::Range::absoluteRectsForRangeInText):
        (WebCore::Range::absoluteTextRects):
        (WebCore::Range::getClientRects):
        (WebCore::Range::borderAndTextRects):
        (WebCore::Range::boundingRect):
        (WebCore::Range::absoluteBoundingRect):
        (WebCore::Range::borderAndTextQuads): Deleted.
        * dom/Range.h:
        Replace borderAndTextQuads with borderAndTextRects, because all callers
        just ended up calling boundingBox() on the quads.

        Factor absoluteRectsForRangeInText out of absoluteTextRects and
        borderAndTextQuads, and teach it to optionally intersect the text rects
        with their renderer's absoluteClippedOverflowRect.

2017-07-21  Per Arne Vollan  <pvollan@apple.com>

        Round-tripping stroke-width styles through getComputedStyle cause the text to gain a stroke.
        https://bugs.webkit.org/show_bug.cgi?id=174701
        <rdar://problem/32903679>

        Reviewed by Simon Fraser.

        The initial value of stroke-color should be transparent, see https://www.w3.org/TR/fill-stroke-3/#stroke-color.
        Also, there is no need to set the graphics context in text stroke mode, if the stroke color is not visible.

        Test: fast/css/round-trip-stroke-width-using-computed-style.html

        * rendering/TextPaintStyle.cpp:
        (WebCore::updateGraphicsContext):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::initialStrokeWidth):
        (WebCore::RenderStyle::initialStrokeColor):
        * rendering/style/StyleRareInheritedData.cpp:
        (WebCore::StyleRareInheritedData::StyleRareInheritedData):

2017-07-21  Timothy Horton  <timothy_horton@apple.com>

        Remove an inaccurate comment from RenderTextLineBoxes

        * rendering/RenderTextLineBoxes.cpp:
        (WebCore::RenderTextLineBoxes::absoluteRectsForRange):
        This comment has been wrong for at least 4 years.

2017-07-21  Timothy Horton  <timothy_horton@apple.com>

        TextIndicator::estimatedTextColorsForRange asserts inside HashSet code (inserting reserved value)
        https://bugs.webkit.org/show_bug.cgi?id=174733

        Reviewed by Wenson Hsieh.

        * page/TextIndicator.cpp:
        (WebCore::estimatedTextColorsForRange):
        (WebCore::adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary):
        RGBA32 isn't a valid hash key, because we have no traits that define the
        empty or deleted values, nor do we have any bits we could feasibly
        use -- the full range of RGBA32 is easy to reach with various colors.

        Instead, hash Color directly.

2017-07-21  Nan Wang  <n_wang@apple.com>

        AX: Expose form validation on iOS as hint
        https://bugs.webkit.org/show_bug.cgi?id=174722
        <rdar://problem/33459761>

        Reviewed by Chris Fleizach.

        Adding the validation message to the hint of the form control element.

        Test: accessibility/ios-simulator/form-control-validation-message.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::isShowingValidationMessage):
        (WebCore::AccessibilityObject::validationMessage):
        * accessibility/AccessibilityObject.h:
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper accessibilityHint]):
        (-[WebAccessibilityObjectWrapper accessibilityIsShowingValidationMessage]):
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::isShowingValidationMessage):
        * html/HTMLFormControlElement.h:

2017-07-21  Konstantin Tokarev  <annulen@yandex.ru>

        [cmake][Mac] Unreviewed, fix linking WebKitSystemInterface

        After r219560 link_directories() in PlatformXXX.cmake files does not
        affect corresponding targets.

        * PlatformMac.cmake:

2017-07-21  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove the need for the side map of DeprecatedCSSOMValue roots
        https://bugs.webkit.org/show_bug.cgi?id=174713

        Reviewed by Andreas Kling.

        We used to not want to bloat the size of CSSValues with a pointer to the
        owner CSSStyleDeclaration, so, for GC purposes we need kept a mapping of
        them on DOMWrapperWorld that only got set if a wrapper was made. Now that
        we have DeprecatedCSSOMValue, a wrapper for CSSValue that only gets created
        for the bindings, we no longer need the side table, and simply have the
        DeprecatedCSSOMValue maintain a reference to the CSSStyleDeclaration.

        * bindings/js/DOMWrapperWorld.h:
        (WebCore::DOMWrapperWorld::wrappers):
        Remove m_deprecatedCSSOMValueRoots and make m_wrappers private with a getter.

        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
        (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Deleted.
        Remove custom implementation of getPropertyCSSValue, now that it no longer
        needs to update m_deprecatedCSSOMValueRoots.

        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
        * bindings/js/JSDOMWrapperCache.h:
        (WebCore::getCachedWrapper):
        (WebCore::cacheWrapper):
        (WebCore::uncacheWrapper):
        * bindings/js/JSNodeCustom.cpp:
        (WebCore::getOutOfLineCachedWrapper):
        Use wrappers getter rather than direct member variable.

        * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
        (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
        Rather than checking the side table for roots, now get the root
        via the reference CSSStyleDeclaration.

        (WebCore::JSDeprecatedCSSOMValueOwner::finalize): Deleted.
        Remove custom finalize now that we don't have to remove ourself
        from m_deprecatedCSSOMValueRoots.

        * css/CSSStyleDeclaration.idl:
        Remove [Custom] from getPropertyCSSValue.

        * css/DeprecatedCSSOMValue.idl:
        Remove [JSCustomFinalize].

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
        * css/CSSImageValue.cpp:
        (WebCore::CSSImageValue::createDeprecatedCSSOMWrapper):
        * css/CSSImageValue.h:
        * css/CSSPrimitiveValue.cpp:
        (WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper):
        * css/CSSPrimitiveValue.h:
        * css/CSSStyleDeclaration.h:
        * css/CSSValue.cpp:
        (WebCore::CSSValue::createDeprecatedCSSOMWrapper):
        * css/CSSValue.h:
        * css/DeprecatedCSSOMCounter.h:
        * css/DeprecatedCSSOMPrimitiveValue.cpp:
        (WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue):
        (WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue):
        (WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue):
        * css/DeprecatedCSSOMPrimitiveValue.h:
        (WebCore::DeprecatedCSSOMPrimitiveValue::create):
        (WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue):
        * css/DeprecatedCSSOMRGBColor.h:
        * css/DeprecatedCSSOMRect.h:
        * css/DeprecatedCSSOMValue.h:
        (WebCore::DeprecatedCSSOMValue::owner):
        (WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue):
        (WebCore::DeprecatedCSSOMComplexValue::create):
        (WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue):
        * css/DeprecatedCSSOMValueList.h:
        (WebCore::DeprecatedCSSOMValueList::create):
        (WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList):
        * css/PropertySetCSSStyleDeclaration.cpp:
        (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
        * css/PropertySetCSSStyleDeclaration.h:
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::getPresentationAttribute):
        Pass owning CSSStyleDeclaration to DeprecatedCSSOMValue and derived classes.

2017-07-21  Andreas Kling  <akling@apple.com>

        Use more references in event dispatch code
        https://bugs.webkit.org/show_bug.cgi?id=174681

        Reviewed by Geoffrey Garen.

        Make EventListener::handleEvent() take a ScriptExecutionContext&, Event&.
        Then make everything build again. Various null checks and assertions
        disappear in the process.

        * bindings/js/JSErrorHandler.cpp:
        (WebCore::JSErrorHandler::handleEvent):
        * bindings/js/JSErrorHandler.h:
        * bindings/js/JSEventListener.cpp:
        (WebCore::JSEventListener::initializeJSFunction):
        (WebCore::JSEventListener::handleEvent):
        (WebCore::eventHandlerAttribute):
        * bindings/js/JSEventListener.h:
        (WebCore::JSEventListener::jsFunction):
        * bindings/js/JSLazyEventListener.cpp:
        (WebCore::JSLazyEventListener::initializeJSFunction):
        * bindings/js/JSLazyEventListener.h:
        * dom/EventListener.h:
        * dom/EventTarget.cpp:
        (WebCore::EventTarget::fireEventListeners):
        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::defaultEventHandler):
        * html/ImageDocument.cpp:
        (WebCore::ImageEventListener::handleEvent):
        * inspector/CommandLineAPIHost.cpp:
        (WebCore::listenerEntriesFromListenerInfo):
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::buildObjectForEventListener):
        * inspector/InspectorIndexedDBAgent.cpp:
        * platform/Widget.h:
        (WebCore::Widget::handleEvent):
        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        (WebCore::WebPlaybackSessionModelMediaElement::handleEvent):
        * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
        * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
        (WebVideoFullscreenModelVideoElement::handleEvent):
        * svg/SVGTRefElement.cpp:
        (WebCore::SVGTRefTargetEventListener::handleEvent):
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::ConditionEventListener::handleEvent):
        (WebCore::SVGSMILElement::handleConditionEvent):
        * svg/animation/SVGSMILElement.h:

2017-07-21  Zalan Bujtas  <zalan@apple.com>

        iBooks: Overlapping/missing content at beginning/end of paragraph.
        https://bugs.webkit.org/show_bug.cgi?id=174717
        <rdar://problem/33117912>

        Reviewed by Simon Fraser.

        By definiton simple and normal line layout should always produce the exact same lineboxes. It enables us not
        to force repaint while swapping between these 2 line layouts.
        However in certain cases (font size pixel rounding as an example) they don't agree on how much content fits the line and
        that could result in missing/overlapping content due to the lack of repaint. 

        Unable to test.

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::ensureLineBoxes):

2017-07-21  Chris Dumez  <cdumez@apple.com>

        Drop make_dom_exceptions.pl script that we only have DOMException
        https://bugs.webkit.org/show_bug.cgi?id=174699

        Reviewed by Darin Adler.

        Drop make_dom_exceptions.pl script that we only have DOMException.

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * WebCoreMacros.cmake:
        * bindings/js/JSDOMExceptionHandling.cpp:
        * css/FontFaceSet.cpp:
        * dom/DOMAllInOne.cpp:
        * dom/DOMExceptions.in: Removed.
        * dom/ExceptionCodeDescription.cpp: Added.
        (WebCore::ExceptionCodeDescription::ExceptionCodeDescription):
        * dom/ExceptionCodeDescription.h: Added.
        * dom/make_dom_exceptions.pl: Removed.
        * inspector/WebInjectedScriptHost.cpp:
        (WebCore::WebInjectedScriptHost::subtype):

2017-07-21  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [CG] An image should not invoke many system calls before confirming its format is supported
        https://bugs.webkit.org/show_bug.cgi?id=174692

        Reviewed by Tim Horton.

        We should be careful when invoking system calls before confirming that the
        image type is available and it is one of the whitelist formats. Otherwise
        we will be calling the parsers of the unsupported formats.

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::setImageDataBuffer): The check isAllowedImageUTI()
        is now done in ImageDecoder::encodedDataStatus() which will return Error
        if there is an error in the data or "isAllowedImageUTI() returns false."

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::dataChanged): Avoid calling canUseAsyncDecodingForLargeImages()
        before confirming the image type is available and it's supported by WebKit.
        canUseAsyncDecodingForLargeImages() tries to cache the first frame of the
        image to know its size. Asking the ImageFrameCache to destroy its decoded
        frames is not needed unless ImageFrameCache::decodedSize() is not zero.

        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::ImageDecoder::encodedDataStatus): Avoid calling CGImageSourceGetStatus()
        before knowing the UTI of the image. When knowing it, we call CGImageSourceGetStatus()
        and if it returns kCGImageStatusIncomplete or kCGImageStatusComplete, we
        check whether isAllowedImageUTI() or not. If isAllowedImageUTI() returns
        false, return Error which will make the CachedImage cancel loading the 
        rest of the image.

2017-07-21  Jeremy Jones  <jeremyj@apple.com>

        AudioTrackPrivateMediaStreamCocoa shouldn't set AudioSession::setPreferredBufferSize
        https://bugs.webkit.org/show_bug.cgi?id=174707
        rdar://problem/33446809

        Reviewed by Eric Carlson.

        Manually tested for audio side effects.

        AudioChannel::copyFrom fails when AudioChannel lengths don't match.

        This happens because PlatformMediaSessionManager::updateSessionState() owns and sets
        AudioSession::setPreferredBufferSize().

        However, AudioTrackPrivateMediaStreamCocoa::createAudioUnit, when it creates an input
        audio unit is setting AudioSession::setPreferredBufferSize() directly to its own arbitrary value.

        AudioSession::setPreferredBufferSize() should be managed by the higher level 
        PlatformMediaSessionManager, and not modified by audio unit creation, in order to keep harmony
        within the audio pipeline.

        * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
        (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):

2017-07-21  Jeremy Jones  <jeremyj@apple.com>

        Noise when AudioChannel lengths don't match.
        https://bugs.webkit.org/show_bug.cgi?id=174706
        rdar://problem/33389856

        Reviewed by Eric Carlson.

        When AudioChannel lengths don't match, copyFrom() returns early leaving uninitialized data in the audio buffer.
        This change zeros out the data, so there isn't objectionable noise sent to the speaker.

        * platform/audio/AudioChannel.cpp:
        (WebCore::AudioChannel::copyFrom):

2017-07-21  Sam Weinig  <sam@webkit.org>

        [WebIDL] Make a few parameters non-nullable in inspector IDL files
        https://bugs.webkit.org/show_bug.cgi?id=174719

        Reviewed by Joseph Pecoraro.

        * inspector/CommandLineAPIHost.cpp:
        (WebCore::CommandLineAPIHost::databaseId):
        (WebCore::CommandLineAPIHost::storageId):
        * inspector/CommandLineAPIHost.h:
        * inspector/CommandLineAPIHost.idl:
        * inspector/InspectorDOMStorageAgent.cpp:
        (WebCore::InspectorDOMStorageAgent::storageId):
        * inspector/InspectorDOMStorageAgent.h:
        * inspector/InspectorDatabaseAgent.cpp:
        (WebCore::InspectorDatabaseAgent::databaseId):
        * inspector/InspectorDatabaseAgent.h:
        * inspector/InspectorFrontendHost.cpp:
        (WebCore::InspectorFrontendHost::showContextMenu):
        (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent):
        * inspector/InspectorFrontendHost.h:
        * inspector/InspectorFrontendHost.idl:
        Remove nullability from arguments that should never be null.

2017-07-21  Brady Eidson  <beidson@apple.com>

        Get rid of WebCore IconDatabase code.
        https://bugs.webkit.org/show_bug.cgi?id=174700

        Reviewed by Tim Horton.

        No new tests (No behavior change).
        
        Tons of red.
        Very little green.
        No further explanation.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::Document::implicitClose):
        * history/HistoryItem.cpp:
        (WebCore::HistoryItem::HistoryItem):
        (WebCore::HistoryItem::~HistoryItem):
        (WebCore::HistoryItem::reset):
        (WebCore::HistoryItem::setURLString):
        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::willSendRequest):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::~DocumentLoader):
        (WebCore::DocumentLoader::startIconLoading):
        (WebCore::DocumentLoader::iconLoadDecisionAvailable): Deleted.
        (WebCore::iconLoadDecisionCallback): Deleted.
        (WebCore::DocumentLoader::getIconLoadDecisionForIconURL): Deleted.
        (WebCore::DocumentLoader::continueIconLoadWithDecision): Deleted.
        (WebCore::iconDataCallback): Deleted.
        (WebCore::DocumentLoader::getIconDataForIconURL): Deleted.
        * loader/DocumentLoader.h:
        (WebCore::DocumentLoader::linkIcons):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::FrameLoader):
        (WebCore::FrameLoader::stop):
        * loader/FrameLoader.h:
        (WebCore::FrameLoader::subframeLoader):
        (WebCore::FrameLoader::icon): Deleted.
        * loader/FrameLoaderClient.h:
        * loader/archive/cf/LegacyWebArchive.cpp:
        (WebCore::LegacyWebArchive::create):
        * loader/icon/IconController.cpp: Removed.
        * loader/icon/IconController.h: Removed.
        * loader/icon/IconDatabase.cpp: Removed.
        * loader/icon/IconDatabase.h: Removed.
        * loader/icon/IconDatabaseBase.cpp: Removed.
        * loader/icon/IconDatabaseBase.h: Removed.
        * loader/icon/IconDatabaseClient.h: Removed.
        * loader/icon/IconLoader.cpp:
        (WebCore::IconLoader::IconLoader):
        (WebCore::IconLoader::startLoading):
        (WebCore::IconLoader::notifyFinished):
        * loader/icon/IconLoader.h:
        * loader/icon/IconRecord.cpp: Removed.
        * loader/icon/IconRecord.h: Removed.
        * loader/icon/PageURLRecord.cpp: Removed.
        * loader/icon/PageURLRecord.h: Removed.
        * testing/Internals.cpp:
        (WebCore::Internals::shortcutIconURLs):

2017-07-21  Chris Dumez  <cdumez@apple.com>

        Rename DOMCoreException class to DOMException
        https://bugs.webkit.org/show_bug.cgi?id=174698

        Reviewed by Darin Adler.

        Rename DOMCoreException class to DOMException to match its Web-exposed name.

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * Modules/quota/StorageErrorCallback.cpp:
        (WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
        * Modules/quota/StorageErrorCallback.h:
        * Modules/quota/StorageErrorCallback.idl:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMExceptionHandling.cpp:
        (WebCore::retrieveErrorMessage):
        (WebCore::createDOMException):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateOverloadDispatcher):
        * css/FontFaceSet.cpp:
        * css/FontFaceSet.h:
        * dom/DOMAllInOne.cpp:
        * dom/DOMException.cpp: Renamed from Source/WebCore/dom/DOMCoreException.cpp.
        (WebCore::DOMException::create):
        (WebCore::DOMException::DOMException):
        (WebCore::DOMException::initializeDescription):
        * dom/DOMException.h: Renamed from Source/WebCore/dom/DOMCoreException.h.
        (WebCore::DOMException::create):
        (WebCore::DOMException::DOMException):
        * dom/DOMException.idl: Renamed from Source/WebCore/dom/DOMCoreException.idl.
        * dom/DOMExceptions.in:
        * dom/make_dom_exceptions.pl:
        (generateImplementation):

2017-07-21  Sam Weinig  <sam@webkit.org>

        Follow up to https://bugs.webkit.org/show_bug.cgi?id=174659.

        * inspector/InspectorFrontendHost.idl:
        Remove unnecessary JSGenerateToJSObject noticed in review.

2017-07-20  Chris Dumez  <cdumez@apple.com>

        Drop legacy SVGException type
        https://bugs.webkit.org/show_bug.cgi?id=174695

        Reviewed by Darin Adler.

        Drop legacy SVGException type and use DOMException instead, as per the latest
        SVG specification. Both Chrome and Firefox no longer expose the SVGException
        type.

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMExceptionHandling.cpp:
        (WebCore::createDOMException):
        * bindings/js/JSExceptionBase.cpp:
        (WebCore::toExceptionBase):
        * dom/DOMExceptions.in:
        * svg/SVGAllInOne.cpp:
        * svg/SVGCircleElement.cpp:
        * svg/SVGException.cpp: Removed.
        * svg/SVGException.h: Removed.
        * svg/SVGException.idl: Removed.
        * svg/SVGGraphicsElement.idl:
        * svg/SVGLocatable.cpp:
        (WebCore::SVGLocatable::getTransformToElement):
        * svg/SVGMatrixValue.h:
        * svg/SVGPathSegList.cpp:
        (WebCore::SVGPathSegList::getItem):
        (WebCore::SVGPathSegList::replaceItem):
        (WebCore::SVGPathSegList::removeItem):
        * svg/SVGPathSegList.h:
        * svg/SVGPathSegList.idl:
        * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
        * svg/properties/SVGListProperty.h:

2017-07-20  Chris Dumez  <cdumez@apple.com>

        Hook up ITP quirks to the needsSiteSpecificQuirks setting
        https://bugs.webkit.org/show_bug.cgi?id=174691

        Reviewed by Darin Adler.

        Hook up ITP quirks to the needsSiteSpecificQuirks setting to make it easier for
        Web-developers to test their fixes.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::shouldEnableSiteSpecificQuirks):
        (WebCore::areDomainsAssociated):
        (WebCore::ResourceLoadObserver::logFrameNavigation):
        (WebCore::resourceNeedsSSOQuirk):
        (WebCore::ResourceLoadObserver::logSubresourceLoading):
        (WebCore::ResourceLoadObserver::logWebSocketLoading):

2017-07-20  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219700.

        This revision caused consistent timouts on iOS.

        Reverted changeset:

        "Turn tests at media/modern-media-controls/start-support back
        on"
        https://bugs.webkit.org/show_bug.cgi?id=174683
        http://trac.webkit.org/changeset/219700

2017-07-20  David Quesada  <david_quesada@apple.com>

        Add SPI to notify WKNavigationDelegate about client redirects
        https://bugs.webkit.org/show_bug.cgi?id=174680
        rdar://problem/33184886

        Reviewed by Brady Eidson.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::performClientRedirect):
        * loader/FrameLoader.h:
        Add a convenience method for NavigationScheduler that handles a FrameLoadRequest
        as a client redirect. Currently this means loading the request and informing the
        client about it.

        * loader/FrameLoaderClient.h:
        Add FrameLoaderClient::dispatchDidPerformClientRedirect() to inform the client when
        a client redirect occurs.

        * loader/NavigationScheduler.cpp:
        Removed ScheduledURLNavigation::fire(). This class was never instantiated directly,
        and all subclasses override fire(), so this was unused code.
        For ScheduledRedirects and ScheduledLocationChange, use FrameLoader's new method to
        load the request as a client redirect.

2017-07-20  Chris Dumez  <cdumez@apple.com>

        Drop legacy XPathException type
        https://bugs.webkit.org/show_bug.cgi?id=174679

        Reviewed by Sam Weinig.

        Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
        no longer expose XPathException.

        Test: fast/dom/DOMException/XPathException-obsolete.html

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMExceptionHandling.cpp:
        (WebCore::createDOMException):
        * bindings/js/JSExceptionBase.cpp:
        (WebCore::toExceptionBase):
        * dom/DOMExceptions.in:
        * xml/XPathException.cpp: Removed.
        * xml/XPathException.h: Removed.
        * xml/XPathException.idl: Removed.
        * xml/XPathExpression.cpp:
        (WebCore::XPathExpression::evaluate):
        * xml/XPathParser.cpp:
        (WebCore::XPath::Parser::parseStatement):
        * xml/XPathResult.cpp:
        (WebCore::XPathResult::convertTo):
        (WebCore::XPathResult::numberValue):
        (WebCore::XPathResult::stringValue):
        (WebCore::XPathResult::booleanValue):
        (WebCore::XPathResult::singleNodeValue):
        (WebCore::XPathResult::snapshotLength):
        (WebCore::XPathResult::iterateNext):
        (WebCore::XPathResult::snapshotItem):

2017-07-20  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r219706.

        Broke iOS build

        Reverted changeset:

        "Drop legacy XPathException type"
        https://bugs.webkit.org/show_bug.cgi?id=174679
        http://trac.webkit.org/changeset/219706

2017-07-20  Chris Dumez  <cdumez@apple.com>

        Drop legacy XPathException type
        https://bugs.webkit.org/show_bug.cgi?id=174679

        Reviewed by Sam Weinig.

        Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
        no longer expose XPathException.

        Test: fast/dom/DOMException/XPathException-obsolete.html

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMExceptionHandling.cpp:
        (WebCore::createDOMException):
        * bindings/js/JSExceptionBase.cpp:
        (WebCore::toExceptionBase):
        * dom/DOMExceptions.in:
        * xml/XPathException.cpp: Removed.
        * xml/XPathException.h: Removed.
        * xml/XPathException.idl: Removed.
        * xml/XPathExpression.cpp:
        (WebCore::XPathExpression::evaluate):
        * xml/XPathParser.cpp:
        (WebCore::XPath::Parser::parseStatement):
        * xml/XPathResult.cpp:
        (WebCore::XPathResult::convertTo):
        (WebCore::XPathResult::numberValue):
        (WebCore::XPathResult::stringValue):
        (WebCore::XPathResult::booleanValue):
        (WebCore::XPathResult::singleNodeValue):
        (WebCore::XPathResult::snapshotLength):
        (WebCore::XPathResult::iterateNext):
        (WebCore::XPathResult::snapshotItem):

2017-07-20  Chris Dumez  <cdumez@apple.com>

        Regression(ITP): May get frequently logged out of wsj.com
        https://bugs.webkit.org/show_bug.cgi?id=174661
        <rdar://problem/32343256>

        Reviewed by Geoffrey Garen.

        Add the concept of associated domains in the ResourceLoadObserver. We
        previously ignore loads to and from the same domains. We now do the same
        if the to and from domains are associated (i.e. owned by the same entity).

        For now, only add domains owned by Dow Jones & Company, Inc. to the list,
        to address login issues on wsj.com.

        No new tests, verified manually on wsj.com.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::areDomainsAssociated):
        (WebCore::ResourceLoadObserver::logFrameNavigation):
        (WebCore::ResourceLoadObserver::logSubresourceLoading):
        (WebCore::ResourceLoadObserver::logWebSocketLoading):

2017-07-20  Chris Dumez  <cdumez@apple.com>

        Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable
        https://bugs.webkit.org/show_bug.cgi?id=174660

        Reviewed by Geoffrey Garen.

        Replace calls to Vector::resize() with calls to more efficient shrink() / grow() when applicable.
        This essentially replaces a branch to figure out if the new size is less or greater than the
        current size by an assertion.

        * Modules/gamepad/Gamepad.cpp:
        (WebCore::Gamepad::Gamepad):
        * Modules/webaudio/AudioContext.cpp:
        (WebCore::AudioContext::addReaction):
        * Modules/websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::skipBuffer):
        * Modules/websockets/WebSocketDeflater.cpp:
        (WebCore::WebSocketDeflater::finish):
        * contentextensions/ContentExtensionCompiler.cpp:
        (WebCore::ContentExtensions::serializeSelector):
        * contentextensions/DFABytecodeCompiler.cpp:
        (WebCore::ContentExtensions::append):
        * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
        (WebCore::gcryptEncrypt):
        (WebCore::gcryptDecrypt):
        * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
        (WebCore::gcryptDerive):
        * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
        (WebCore::GameControllerGamepadProvider::controllerDidConnect):
        * platform/gamepad/mac/HIDGamepadProvider.cpp:
        (WebCore::HIDGamepadProvider::deviceAdded):
        * platform/graphics/ImageBackingStore.h:
        (WebCore::ImageBackingStore::setSize):
        * platform/graphics/WOFFFileFormat.cpp:
        * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
        (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
        (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
        (WebCore::InbandTextTrackPrivateAVF::resetCueValues):
        (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer):
        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
        (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer):
        * platform/graphics/cg/ImageBufferCG.cpp:
        (WebCore::cfData):
        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
        (WebCore::BMPImageDecoder::frameBufferAtIndex):
        * platform/image-decoders/ico/ICOImageDecoder.cpp:
        (WebCore::ICOImageDecoder::decode):
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageDecoder::frameBufferAtIndex):
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::frameBufferAtIndex):
        (WebCore::PNGImageDecoder::readChunks):
        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::frameBufferAtIndex):
        * platform/image-encoders/JPEGImageEncoder.cpp:
        (WebCore::compressRGBABigEndianToJPEG):
        * platform/text/DecodeEscapeSequences.h:
        (WebCore::URLEscapeSequence::decodeRun):
        * platform/text/SuffixTree.h:
        (WebCore::SuffixTree::Node::Node):
        * rendering/Grid.cpp:
        (WebCore::Grid::setNeedsItemsPlacement):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::invalidateCachedColumns):

2017-07-20  Chris Dumez  <cdumez@apple.com>

        Regression(ITP): Can no longer log in on abc.go.com
        https://bugs.webkit.org/show_bug.cgi?id=174533
        <rdar://problem/33325881>

        Reviewed by Geoffrey Garen.

        Add quirk for sp.auth.adobe.com which is used for SSO by web sites such as
        abc.go.com. This would otherwise cause adobe.com to be identified as a
        tracker and log in on abc.go.com would break.

        No new tests, tested manually on abc.go.com.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::resourceNeedsSSOQuirk):
        (WebCore::ResourceLoadObserver::logSubresourceLoading):

2017-07-20  Antoine Quint  <graouts@apple.com>

        Turn tests at media/modern-media-controls/start-support back on
        https://bugs.webkit.org/show_bug.cgi?id=174683

        Reviewed by Dean Jackson.

        Turning those tests back on revealed a small bug that is unlikely to really affect content
        on the Web. In the case where the size of the video is known right away, without the need
        for loading its metadata, as is the case in the start-support-click-to-start.html test with
        a local media resource, all queued layouts are flushed at once and we may call the layout()
        method of the left ButtonsContainer which originally is set to contain the play/pause button,
        which would remove the play/pause button from the center of the media. So before we potentially
        set the play/pause button as the central button, we first assign the default button set for
        the two ButtonsContainer instances and only add the play/pause button when we're not showing
        the prominent play/pause button.

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

2017-07-20  Chris Dumez  <cdumez@apple.com>

        Drop legacy FileException type
        https://bugs.webkit.org/show_bug.cgi?id=174676

        Reviewed by Alex Christensen.

        Drop legacy FileException type and use DOMException instead, as per the latest
        File API specification:
        - https://w3c.github.io/FileAPI/#ErrorAndException

        Both Firefox and Chrome no longer expose FileException.

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMExceptionHandling.cpp:
        (WebCore::createDOMException):
        * dom/DOMExceptions.in:
        * fileapi/FileException.cpp: Removed.
        * fileapi/FileException.h: Removed.
        * fileapi/FileException.idl: Removed.
        * fileapi/FileReaderLoader.cpp:
        (WebCore::FileReaderLoader::FileReaderLoader):
        (WebCore::FileReaderLoader::failed):
        * fileapi/FileReaderLoader.h:
        (WebCore::FileReaderLoader::errorCode):
        * fileapi/FileReaderSync.cpp:
        (WebCore::errorCodeToExceptionCode):
        (WebCore::FileReaderSync::startLoading):

2017-07-20  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove custom bindings for InspectorFrontendHost
        https://bugs.webkit.org/show_bug.cgi?id=174659

        Reviewed by Chris Dumez.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSInspectorFrontendHostCustom.cpp: Removed.
        Remove JSInspectorFrontendHostCustom.cpp.

        * inspector/InspectorFrontendHost.cpp:
        (WebCore::populateContextMenu):
        (WebCore::InspectorFrontendHost::showContextMenu):
        * inspector/InspectorFrontendHost.h:
        * inspector/InspectorFrontendHost.idl:
        Re-implement showContextMenu by using an IDL defined ContextMenuItem dictionary
        and converting from that to a WebCore::ContextMenu in the implementation.

2017-07-20  Charlie Turner  <cturner@igalia.com>

        [GTK] Layout Test http/tests/media/hls/hls-progress.html is failing
        https://bugs.webkit.org/show_bug.cgi?id=141469

        Reviewed by Xabier Rodriguez-Calvar.

        A work-around for getting progress information in a timely manner from
        live pipelines. We cannot rely on getting BUFFERING messages within
        the stalled time window (3s), so we have to poll for progress
        information somehow.

        Makes the following pass reliably
         http/tests/media/hls/hls-audio-tracks-has-audio.html passed unexpectedly
         http/tests/media/hls/hls-audio-tracks.html passed unexpectedly
         http/tests/media/hls/hls-progress.html passed unexpectedly

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::findHLSQueue):
        (WebCore::isHLSProgressing):
        (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):

2017-07-20  Andreas Kling  <akling@apple.com>

        Minor Node->Element type tightening fixes
        https://bugs.webkit.org/show_bug.cgi?id=174651

        Reviewed by Sam Weinig.

        Tighten up some Node* into Element* or even better, Element&.

        * dom/Document.cpp:
        (WebCore::acceptsEditingFocus): Take a const Element&.
        (WebCore::Document::setFocusedElement):
        * editing/Editor.cpp:
        (WebCore::Editor::findEventTargetFrom): Return an Element*.
        (WebCore::Editor::findEventTargetFromSelection): Ditto.
        (WebCore::Editor::pasteAsPlainText):
        (WebCore::Editor::pasteAsFragment):
        (WebCore::Editor::dispatchCPPEvent):
        * editing/Editor.h:
        * page/DragController.cpp:
        (WebCore::DragController::dispatchTextInputEventFor):

2017-07-20  Brady Eidson  <beidson@apple.com>

        WKHTTPCookieStore API tests fail on High Sierra.
        <rdar://problem/33410271> and https://bugs.webkit.org/show_bug.cgi?id=174666

        Reviewed by Andy Estes.

        Covered by existing API tests.

        In r219567 I'd moved cookie storage observation off of NSHTTPCookieStorage and NSNotificationCenter
        to CFHTTPCookieStorage observation callbacks.
        
        This is because notifications were only sent for the default [NSHTTPCookieStorage sharedHTTPCookieStorage]
        and not any of the other ones we keep in flight.
        
        Unfortunately that SPI has been disabled in High Sierra.
        Fortunately we found a way we can get non-shared NSHTTPCookieStorages to send notifications that works everywhere.
        
        * platform/network/cocoa/CookieStorageObserver.h:
        * platform/network/cocoa/CookieStorageObserver.mm:
        (-[WebCookieObserverAdapter initWithObserver:]):
        (-[WebCookieObserverAdapter cookiesChangedNotificationHandler:]):
        (WebCore::CookieStorageObserver::create):
        (WebCore::CookieStorageObserver::CookieStorageObserver):
        (WebCore::CookieStorageObserver::~CookieStorageObserver):
        (WebCore::CookieStorageObserver::startObserving): Use a trick to call some SPI on non-shared NSHTTPCookieStorages
          to get them to send notifications.
        (WebCore::CookieStorageObserver::stopObserving):
        (WebCore::cookiesChanged): Deleted.

        * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
        (WebCore::NetworkStorageSession::cookieStorageObserver):

2017-07-20  Miguel Gomez  <magomez@igalia.com>

        [GStreamer] Some layout tests issue "g_mutex_clear() called on uninitialised or locked mutex" and flaky crash in ~MediaPlayerPrivateGStreamerBase
        https://bugs.webkit.org/show_bug.cgi?id=173952

        Reviewed by Carlos Garcia Campos.

        Adjust MediaPlayerPrivateGStreamerBase to avoid concurrence problems with the GStreamer thread when
        destroying the object.

        Covered by existent tests.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
        (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
        (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):

2017-07-19  Zan Dobersek  <zdobersek@igalia.com>

        [EME] Push CDMInstance, CDMPrivate and associated types into the Platform layer
        https://bugs.webkit.org/show_bug.cgi?id=174496

        Reviewed by Xabier Rodriguez-Calvar.

        Move the CDMInstance and CDMPrivate interfaces into the platform layer, enabling
        implementations of specific key systems at that level, as well as integration with
        the MediaPlayerPrivate stack without any layering violations.

        While the platform layer still uses the WebCore namespace, the two interface files
        have now been moved under the platform/encryptedmedia/ directory and out of the
        Modules/encryptedmedia/ directory where the Web-facing API implementation resides.

        The two interfaces integrated closely with the Web-facing enumerations and
        dictionaries: MediaKeyMessageType, MediaKeySessionType, MediaKeyStatus,
        MediaKeySystemConfiguration, MediaKeySystemCapability, MediaKeysRequirement
        and MediaKeysRestrictions. Definitions of these types are also moved to the
        platform layer without any changes (apart from renaming), and the previous
        types now alias against the types now located in the platform layer.

        No new tests -- no change in behavior.

        * CMakeLists.txt:
        * Modules/encryptedmedia/CDM.cpp:
        * Modules/encryptedmedia/CDM.h:
        * Modules/encryptedmedia/MediaKeyMessageType.h:
        * Modules/encryptedmedia/MediaKeySessionType.h:
        * Modules/encryptedmedia/MediaKeyStatus.h:
        * Modules/encryptedmedia/MediaKeySystemAccess.cpp:
        * Modules/encryptedmedia/MediaKeySystemAccess.h:
        * Modules/encryptedmedia/MediaKeySystemConfiguration.h:
        * Modules/encryptedmedia/MediaKeySystemMediaCapability.h:
        * Modules/encryptedmedia/MediaKeysRequirement.h:
        * Modules/encryptedmedia/MediaKeysRestrictions.h:
        * platform/encryptedmedia/CDMInstance.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMInstance.h.
        * platform/encryptedmedia/CDMKeyStatus.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyStatus.h.
        * platform/encryptedmedia/CDMKeySystemConfiguration.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemConfiguration.h.
        * platform/encryptedmedia/CDMMediaCapability.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySystemMediaCapability.h.
        * platform/encryptedmedia/CDMMessageType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageType.h.
        * platform/encryptedmedia/CDMPrivate.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivate.h.
        * platform/encryptedmedia/CDMRequirement.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRequirement.h.
        * platform/encryptedmedia/CDMRestrictions.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeysRestrictions.h.
        * platform/encryptedmedia/CDMSessionType.h: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeySessionType.h.

2017-07-19  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed follow-up to r219674.

        * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
        Remove the AsyncScrollingCoordinator.h header include that was added by accident.

2017-07-19  Zan Dobersek  <zdobersek@igalia.com>

        [CMake] Clean up Web Crypto build targets
        https://bugs.webkit.org/show_bug.cgi?id=174253

        Reviewed by Alex Christensen.

        Gather the common WebCrypto source files in CMakeLists.txt, including them
        in the build unconditionally and instead relying on ENABLE_SUBTLE_CRYPTO
        build guards to exclude the code from compilation if the feature is disabled.

        PlatformGTK.cmake, PlatformMac.cmake and PlatformWPE.cmake can then remove
        duplicated build targets. PlatformMac.cmake still lists all the Mac-specific
        Web Crypto build targets.

        PlatformGTK.cmake and PlatformWPE.cmake now include GCrypt.cmake if the
        USE_GCRYPT variable is enabled. Both ports at the moment enable that variable
        though as they by default leverage a libgcrypt-based CrpytoDigest implementation
        in the PAL library.

        The new GCrypt.cmake file adds the libgcrypt-specific Web Crypto build targets to
        the build and also sets up libgcrypt include directiories and libraries.

        No new tests -- no change in behavior.

        * CMakeLists.txt:
        * PlatformGTK.cmake:
        * PlatformMac.cmake:
        * PlatformWPE.cmake:
        * platform/GCrypt.cmake: Added.

2017-07-19  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove custom bindings for CommandLineAPIHost
        https://bugs.webkit.org/show_bug.cgi?id=174642

        Reviewed by Joseph Pecoraro.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSCommandLineAPIHostCustom.cpp: Removed.
        Remove JSCommandLineAPIHostCustom.cpp.

        * bindings/js/JSDOMConvertObject.h:
        (WebCore::JSConverter<IDLObject>::convert):
        Add missing JSConverter specialization for IDLObject.

        * inspector/CommandLineAPIHost.cpp:
        (WebCore::CommandLineAPIHost::inspect):
        (WebCore::listenerEntriesFromListenerInfo):
        (WebCore::CommandLineAPIHost::inspectedObject):
        (WebCore::CommandLineAPIHost::databaseId):
        (WebCore::CommandLineAPIHost::storageId):
        (WebCore::CommandLineAPIHost::inspectImpl): Deleted.
        (WebCore::CommandLineAPIHost::getEventListenersImpl): Deleted.
        (WebCore::CommandLineAPIHost::databaseIdImpl): Deleted.
        (WebCore::CommandLineAPIHost::storageIdImpl): Deleted.
        * inspector/CommandLineAPIHost.h:
        * inspector/CommandLineAPIHost.idl:
        Replace custom bindings with modern bindings affordances: dictionaries, records and sequences.

2017-07-19  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed CoordGraphics build fix.

        * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
        (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints):
        This should be defined for the ScrollingCoordinatorCoordinatedGraphics class.
        Also fix the setFixedToViewport() call, fishing out the GraphicsLayer object from
        the ScrollingStateNode's LayerRepresentation.
        (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted.

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

        Drop SQLException type
        https://bugs.webkit.org/show_bug.cgi?id=174665

        Reviewed by Sam Weinig.

        Drop SQLException type. We never throw such exception. Also, Firefox
        and Chrome no longer expose this type.

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * Modules/webdatabase/SQLException.cpp: Removed.
        * Modules/webdatabase/SQLException.h: Removed.
        * Modules/webdatabase/SQLException.idl: Removed.
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMExceptionHandling.cpp:
        (WebCore::createDOMException):
        * bindings/js/JSExceptionBase.cpp:
        (WebCore::toExceptionBase):
        * dom/DOMExceptions.in:

2017-07-19  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, tweak a comment above TemporarySelectionOptionIgnoreSelectionChanges in Editor.cpp.

        The comment references the UI process, but it describes an entity in WebCore. This should have been generalized
        to instead refer to the client layer in general (i.e. WebKit1 or WebKit2).

        * editing/Editor.h:

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

        getBoundingClientRects not updated for programmatic scrolls
        https://bugs.webkit.org/show_bug.cgi?id=174538
        rdar://problem/33049012

        Reviewed by Tim Horton.

        Baidu.com has two event handlers on its <input>, and both query the input location with getBoundingClientRect()
        and the current pageYOffset (via jQuery), then try to scroll the input to the top of the screen. The bug is that
        programmatic scrolls did not immediately update the layout viewport rect, so the second call to
        getBoundingClientRect() would return stale coordinates, triggering an extra scroll.

        To fix this, undo the fix for r219320 which tried to keep getBoundingClientRect() current during unstable scroll
        updates by adding a shadow layout viewport rect. Instead, almost always update the layout viewport rect on
        FrameView, even during unstable visible rect updates, but not if content insets are being changed interactively,
        since changing viewport heights cause problems with bottom-fixed elements. Also, we need to compute a new layout
        viewport rect in FrameView::updateLayoutViewport() for programmatic scrolls.

        However, always updating the layout viewport triggered issues with the scrolling tree. The scrolling state tree
        fossilizes layer positions relative to a specific viewport rect, and that relationship has to be maintained.
        There are code paths that recompute fixed/sticky viewport constraints when the layout viewport has changed but
        we haven't done layout or recomputed layer positions (e.g. updating viewport-constrained layers via
        updateScrollCoordinatedLayersAfterFlush()) and in these cases using a new layout viewport for those computations
        results in an inconsistent scrolling tree.

        Fix this by not updating scrolling constraints every time we have to re-register scrolling nodes.
        updateScrollCoordinatedLayersAfterFlush() only needs to update the layer on the scrolling node (to handle
        tiled/non-tiled switches), so make updateScrollCoordinatedLayer() a little more fine-grained, and only update
        constraints when we've just computed layer geometry. This allows for different scrolling nodes to have
        constraints computed at different times, with different layout viewports, which happens.

        Two additional fixes were required to make bottom-fixed bars behave correctly.

        First, FrameView::computeLayoutViewportOrigin() had a bug where rounding of half-pixel values would cause it to
        fall into the if (visualViewport.height() > layoutViewport.height()) clause, but then fail to clamp for
        rubber-banding.
        
        Second, the FrameView::unscaledMaximumScrollPosition() was wrong after zooming on iOS, since it uses visibleSize()
        which is affected by page scale on iOS only (and the function wants scale-independent values). Fix with a hack that
        should be cleaned up via webkit.org/b/174648.

        Tested by existing tests.

        * page/FrameView.cpp:
        (WebCore::FrameView::computeUpdatedLayoutViewportRect):
        (WebCore::FrameView::computeLayoutViewportOrigin):
        (WebCore::FrameView::setLayoutViewportOverrideRect):
        (WebCore::FrameView::updateLayoutViewport):
        (WebCore::FrameView::unscaledMaximumScrollPosition):
        (WebCore::FrameView::documentToClientOffset):
        (WebCore::FrameView::setUnstableLayoutViewportRect): Deleted.
        * page/FrameView.h:
        * page/scrolling/AsyncScrollingCoordinator.cpp:
        (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
        (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
        (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
        (WebCore::AsyncScrollingCoordinator::updateNodeLayer):
        (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints):
        (WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode): Deleted.
        * page/scrolling/AsyncScrollingCoordinator.h:
        * page/scrolling/ScrollingCoordinator.cpp:
        (WebCore::operator<<):
        * page/scrolling/ScrollingCoordinator.h:
        (WebCore::ScrollingCoordinator::reconcileScrollingState):
        (WebCore::ScrollingCoordinator::updateNodeLayer):
        (WebCore::ScrollingCoordinator::updateNodeViewportConstraints):
        (WebCore::ScrollingCoordinator::updateViewportConstrainedNode): Deleted.
        * page/scrolling/ScrollingStateFixedNode.cpp:
        (WebCore::ScrollingStateFixedNode::updateConstraints):
        * page/scrolling/ScrollingStateStickyNode.cpp:
        (WebCore::ScrollingStateStickyNode::updateConstraints):
        (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
        * page/scrolling/ScrollingTree.cpp:
        (WebCore::ScrollingTree::commitTreeState):
        * page/scrolling/mac/ScrollingTreeFixedNode.mm:
        (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
        * page/scrolling/mac/ScrollingTreeStickyNode.mm:
        (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateGeometry):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
        (WebCore::RenderLayerCompositor::updateBacking):
        (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged):
        (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
        (WebCore::RenderLayerCompositor::computeFixedViewportConstraints):
        (WebCore::RenderLayerCompositor::computeStickyViewportConstraints):
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
        (WebCore::RenderLayerCompositor::didAddScrollingLayer):
        * rendering/RenderLayerCompositor.h:

2017-07-19  Megan Gardner  <megan_gardner@apple.com>

        Don't write file URLs to iOS Pasteboard
        https://bugs.webkit.org/show_bug.cgi?id=174647
        <rdar://problem/33199730>

        Reviewed by Wenson Hsieh.

        Tests updated to reflect the changes. We are no longer vending file URLs in Drag & Drop and Copy/Paste.

        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::writeImageToPasteboard):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::write):

2017-07-19  Myles C. Maxfield  <mmaxfield@apple.com>

        Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
        https://bugs.webkit.org/show_bug.cgi?id=174406

        Reviewed by Simon Fraser.
        <rdar://problem/10139227>

        Reviewed by NOBODY.

        When the minimumFontSize API preference is set, we will increase the font size without increasing
        the line height. If the content specifies line-height as an absolute value, there can be two
        unfortunate results:

        - Adjacent lines in a paragraph can overlap
        - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines
        can be cut off and potentially indecipherable.

        Instead, we should use the minimum font size preference as a signal that we should increase the
        line-height as well as the font-size. Eventually, we will want to increase it by an amount
        proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize,
        text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause
        a behavior change on many webpages which use small text, so such a change would be too risky right now.
        Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the
        only signal to boost the corresponding line-height.

        Tests: fast/text/line-height-minimumFontSize-text-zoom.html
               fast/text/line-height-minimumFontSize-visual.html
               fast/text/line-height-minimumFontSize-zoom.html
               fast/text/line-height-minimumFontSize.html
               fast/text/line-height-minimumFontSize-autosize.html

        * css/StyleBuilderCustom.h:
        (WebCore::computeBaseSpecifiedFontSize):
        (WebCore::computeLineHeightMultiplierDueToFontSize):
        (WebCore::StyleBuilderCustom::applyValueLineHeight):
        (WebCore::StyleBuilderCustom::applyValueFill):
        (WebCore::StyleBuilderCustom::applyValueStroke):
        (WebCore::StyleBuilderCustom::applyValueContent):
        * rendering/TextAutoSizing.cpp:

2017-07-18  Myles C. Maxfield  <mmaxfield@apple.com>

        Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
        https://bugs.webkit.org/show_bug.cgi?id=174406
        <rdar://problem/10139227>

        Reviewed by Simon Fraser.

        When the minimumFontSize API preference is set, we will increase the font size without increasing
        the line height. If the content specifies line-height as an absolute value, there can be two
        unfortunate results:

        - Adjacent lines in a paragraph can overlap
        - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines
        can be cut off and potentially indecipherable.

        Instead, we should use the minimum font size preference as a signal that we should increase the
        line-height as well as the font-size. Eventually, we will want to increase it by an amount
        proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize,
        text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause
        a behavior change on many webpages which use small text, so such a change would be too risky right now.
        Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the
        only signal to boost the corresponding line-height.

        Tests: fast/text/line-height-minimumFontSize-text-zoom.html
               fast/text/line-height-minimumFontSize-visual.html
               fast/text/line-height-minimumFontSize-zoom.html
               fast/text/line-height-minimumFontSize.html
               fast/text/line-height-minimumFontSize-autosize.html

        * css/StyleBuilderCustom.h:
        (WebCore::computeBaseSpecifiedFontSize):
        (WebCore::computeLineHeightMultiplierDueToFontSize):
        (WebCore::StyleBuilderCustom::applyValueLineHeight):
        (WebCore::StyleBuilderCustom::applyValueFill):
        (WebCore::StyleBuilderCustom::applyValueStroke):
        (WebCore::StyleBuilderCustom::applyValueContent):
        * rendering/TextAutoSizing.cpp:

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

        DOMException should not have its own toString()
        https://bugs.webkit.org/show_bug.cgi?id=174630

        Reviewed by Sam Weinig.

        DOMException should not have its own toString() and should use the one from Error.prototype.toString()
        instead:
        - https://heycam.github.io/webidl/#idl-DOMException

        No new tests, rebaselined existing tests.

        * dom/DOMCoreException.idl:

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

        [iOS] REGRESSION: Scrubbing media using built-in controls does not pause media
        https://bugs.webkit.org/show_bug.cgi?id=174650
        <rdar://problem/33401877>

        Reviewed by Dean Jackson.

        We would only pause when scrubbing on macOS because we only listened to "mousedown" events on the
        scrubber's backing <input> element to identify that the user had started interacting with the
        scrubber.

        Implementing the same technique on iOS required a little more work than just listening to "touchstart"
        events on the same element. On top of that, we needed to make sure that we would only respond to
        "touchstart" events on the slider's thumb, and not on the track, since only on macOS should the user
        be able to click anywhere on the track to scrub. So we turn off pointer-events for the <input> on iOS
        only, and turn them back on specifically for the thumb.

        There is also some finessing when dealing with touch events where we need to track the identifier of
        the touch that started the user interaction. So we keep track of it in an ivar and wait until we get
        a "touchend" event where the changedTouches list contains a touch with that same identifier to ensure
        the same touch that initiates and ends the scrubbing interaction.

        Finally, we fix another issue that was uncovered while turning back on the ScrubbingSupport tests
        where we would not trash the cached _value ivar when we initiated scrubbing, which was important since
        we would mistakenly use the pre-srubbing value during a scrub.

        * Modules/modern-media-controls/controls/slider.css:
        (.ios .slider > input):
        (.slider > input::-webkit-slider-thumb):
        * Modules/modern-media-controls/controls/slider.js:
        (Slider.prototype.handleEvent):
        (Slider.prototype._handleMousedownEvent):
        (Slider.prototype._interactionEndTarget):
        (Slider.prototype._handleTouchstartEvent):
        (Slider.prototype._valueWillStartChanging):
        (Slider.prototype._valueDidStopChanging):
        (Slider.prototype._handleMouseupEvent):
        (Slider.prototype._handleTouchendEvent):

2017-07-19  Nan Wang  <n_wang@apple.com>

        AX: Web page reloaded when a node is labelling multiple childnodes
        https://bugs.webkit.org/show_bug.cgi?id=174655

        Reviewed by Chris Fleizach.

        When we are asking for the aria-labelledby attribute of a node and its
        sibling is also labelled by the same node, we get into an infinite loop
        in textUnderElement since we only ignore one child. Added checks for 
        siblings to avoid such loop.

        Test: accessibility/mac/aria-labelledby-multiple-child-crash.html

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

2017-07-19  Andy Estes  <aestes@apple.com>

        Use a cast to work around clang's false -Wobjc-literal-conversion warnings
        https://bugs.webkit.org/show_bug.cgi?id=174631

        Reviewed by Dan Bernstein.

        Instead of ignoring -Wobjc-literal-conversion, use a cast to work around rdar://problem/33383354.

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

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

        Make cross-origin properties enumerable
        https://bugs.webkit.org/show_bug.cgi?id=174576

        Reviewed by Darin Adler.

        Makes cross-origin properties enumerable on Window and Location objects
        as per:
        - https://github.com/whatwg/html/pull/2777

        This simplifies our code quite a bit.

        No new tests, updated existing tests.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
        (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
        (WebCore::JSDOMWindow::getOwnPropertyNames):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::getOwnPropertySlotCommon):
        (WebCore::JSLocation::getOwnPropertyNames):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):

2017-07-18  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [EME] Build failure with Clang-3.8 on InitDataRegistry.cpp
        https://bugs.webkit.org/show_bug.cgi?id=174628

        Reviewed by Žan Doberšek.

        * Modules/encryptedmedia/InitDataRegistry.cpp:
        (WebCore::extractKeyIDsKeyids): Add an explicit cast to unsigned.

2017-07-19  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219646.

        The test added are failing on all platforms

        Reverted changeset:

        "Setting the minimum font size preference doesn’t affect
        absolute line-height values, so lines overlap"
        https://bugs.webkit.org/show_bug.cgi?id=174406
        http://trac.webkit.org/changeset/219646

2017-07-19  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Implement WTF::ThreadGroup
        https://bugs.webkit.org/show_bug.cgi?id=174081

        Reviewed by Mark Lam.

        * page/ResourceUsageThread.h:

2017-07-18  Andy Estes  <aestes@apple.com>

        [Xcode] Enable CLANG_WARN_RANGE_LOOP_ANALYSIS
        https://bugs.webkit.org/show_bug.cgi?id=174631

        Reviewed by Tim Horton.

        * Configurations/Base.xcconfig:
        * rendering/Grid.cpp:
        (WebCore::Grid::insert):
        * rendering/RenderTreeAsText.cpp:
        (WebCore::write):
        * rendering/SimpleLineLayoutCoverage.cpp:
        (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):

2017-07-18  Yusuke Suzuki  <utatane.tea@gmail.com>

        WTF::Thread should have the threads stack bounds.
        https://bugs.webkit.org/show_bug.cgi?id=173975

        Reviewed by Mark Lam.

        When creating WebThread, we first allocate WebCore::ThreadGlobalData in UI thread
        and share it with WebThread.
        The problem is that WebCore::ThreadGlobalData has CachedResourceRequestInitiators.
        It allocates AtomicString, which requires WTFThreadData.

        In this patch, we call WTF::initializeThreading() before allocating WebCore::ThreadGlobalData.
        And we also call AtomicString::init() before calling WebCore::ThreadGlobalData since
        WebCore::ThreadGlobalData allocates AtomicString.

        * platform/ios/wak/WebCoreThread.mm:
        (StartWebThread):

2017-07-18  Myles C. Maxfield  <mmaxfield@apple.com>

        Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
        https://bugs.webkit.org/show_bug.cgi?id=174406
        <rdar://problem/10139227>

        Reviewed by Simon Fraser.

        When the minimumFontSize API preference is set, we will increase the font size without increasing
        the line height. If the content specifies line-height as an absolute value, there can be two
        unfortunate results:

        - Adjacent lines in a paragraph can overlap
        - If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines
        can be cut off and potentially indecipherable.

        Instead, we should use the minimum font size preference as a signal that we should increase the
        line-height as well as the font-size. Eventually, we will want to increase it by an amount
        proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize,
        text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause
        a behavior change on many webpages which use small text, so such a change would be too risky right now.
        Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the
        only signal to boost the corresponding line-height.

        Tests: fast/text/line-height-minimumFontSize-text-zoom.html
               fast/text/line-height-minimumFontSize-visual.html
               fast/text/line-height-minimumFontSize-zoom.html
               fast/text/line-height-minimumFontSize.html
               fast/text/line-height-minimumFontSize-autosize.html

        * css/StyleBuilderCustom.h:
        (WebCore::computeBaseSpecifiedFontSize):
        (WebCore::computeLineHeightMultiplierDueToFontSize):
        (WebCore::StyleBuilderCustom::applyValueLineHeight):
        (WebCore::StyleBuilderCustom::applyValueFill):
        (WebCore::StyleBuilderCustom::applyValueStroke):
        (WebCore::StyleBuilderCustom::applyValueContent):
        * rendering/TextAutoSizing.cpp:

2017-07-18  Zalan Bujtas  <zalan@apple.com>

        Media controls are missing content in fullscreen when document has scroll offset.
        https://bugs.webkit.org/show_bug.cgi?id=174644
        <rdar://problem/32415323>

        Reviewed by Simon Fraser.

        If a non-user initiated scrolling (result of resize for example) is processed asynchronously, it might
        leapfrog other, programatic scrollings and trigger unintentional scroll offsets (and turn into unwanted clippings). 
        This patch ensures that both resize and top content inset change are translated into programatic scrolling. 

        Unable to test full screen video.

        * page/FrameView.cpp:
        (WebCore::FrameView::setFrameRect):
        (WebCore::FrameView::topContentInsetDidChange):

2017-07-18  Andy Estes  <aestes@apple.com>

        [Xcode] Enable CLANG_WARN_OBJC_LITERAL_CONVERSION
        https://bugs.webkit.org/show_bug.cgi?id=174631

        Reviewed by Sam Weinig.

        * Configurations/Base.xcconfig:
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::write):

2017-07-18  Ali Juma  <ajuma@chromium.org>

        Align quirky number parsing with other browsers
        https://bugs.webkit.org/show_bug.cgi?id=155874

        Reviewed by Simon Fraser.

        Parse unit-less non-zero values for animation-duration and transition-duration
        as invalid time values in quirks mode.

        Test: fast/css/animation-transition-duration-quirksmode.html

        * css/parser/CSSPropertyParser.cpp:
        (WebCore::consumeAnimationValue):

2017-07-18  Chris Dumez  <cdumez@apple.com>

        HysteresisActivity cannot be used in the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=174643
        <rdar://problem/33086442>

        Reviewed by Tim Horton.

        Port HysteresisActivity to RunLoop::Timer so that it can safely be used in
        the UIProcess as well.

        * platform/HysteresisActivity.h:

2017-07-18  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Modernize InjectedScriptSource
        https://bugs.webkit.org/show_bug.cgi?id=173890

        Reviewed by Brian Burg.

        Covered by existing tests.

        * inspector/CommandLineAPIModuleSource.js:
        (CommandLineAPIImpl.prototype.copy):
        (CommandLineAPIImpl.prototype._inspect):
        Use RemoteObject, a new parameter.

2017-07-18  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r218910): Crash when password field changes to text field
        https://bugs.webkit.org/show_bug.cgi?id=174560

        Reviewed by Zalan Bujtas.

        The crash was caused by textMarkerDataForFirstPositionInTextControl accessing a nullptr returned by getOrCreate.
        Unfortunately, in order to this fix bug while preserving the exact behavior would require synchronously creating
        a renderer for the editing host when the input type changed since we can't create an accessbility object out of
        a renderer-less node.

        Instead, revert back to pre-r218910 behavior of always using the text control element's axID when notifying
        the value change. While this is inconsistent with the way editing commands report content changes, I've since
        learned that VoiceOver has code to deal with this exact situation.

        Test: accessibility/mac/input-type-change-crash-2.html

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

2017-07-18  Matt Baker  <mattbaker@apple.com>

        Web Inspector: Refactoring: replace InspectorCanvasAgent::CanvasEntry with a helper class
        https://bugs.webkit.org/show_bug.cgi?id=174311

        Reviewed by Devin Rousso.

        This patch adds a helper class for tracking canvases and their data. The
        current approach of defining a helper structure in the agent's header is
        awkward to use and maintain, and won't scale well as more canvas instrumentation
        points and data are added.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        New file.

        * inspector/InspectorCanvas.cpp: Added.
        (WebCore::InspectorCanvas::create):
        (WebCore::InspectorCanvas::InspectorCanvas):
        (WebCore::InspectorCanvas::buildObjectForCanvas):
        * inspector/InspectorCanvas.h: Added.

        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
        (WebCore::InspectorCanvasAgent::enable):
        (WebCore::InspectorCanvasAgent::requestNode):
        (WebCore::InspectorCanvasAgent::requestContent):
        (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
        (WebCore::InspectorCanvasAgent::resolveCanvasContext):
        (WebCore::InspectorCanvasAgent::frameNavigated):
        (WebCore::InspectorCanvasAgent::didCreateCSSCanvas):
        (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
        (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
        (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
        (WebCore::InspectorCanvasAgent::canvasDestroyed):
        (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
        (WebCore::InspectorCanvasAgent::clearCanvasData):
        (WebCore::InspectorCanvasAgent::unbindCanvas):
        (WebCore::InspectorCanvasAgent::assertInspectorCanvas):
        (WebCore::InspectorCanvasAgent::findInspectorCanvas):
        (WebCore::InspectorCanvasAgent::getCanvasEntry): Deleted.
        (WebCore::InspectorCanvasAgent::buildObjectForCanvas): Deleted.
        * inspector/InspectorCanvasAgent.h:

        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::InspectorController):
        Remove unused constructor argument.

2017-07-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Move detail implementation from ResourceHandle to ResourceHandleInternal
        https://bugs.webkit.org/show_bug.cgi?id=174641

        After moving stuff from ResourceHandleManager to ResourceHandle on 
        https://bugs.webkit.org/show_bug.cgi?id=173630, still there're many violation
        remains between ResourceHandle and ResourceHandleInternal classes.
        Many of implementation detail should be move to ResourceHandleInternal
        to improve build speed.

        Reviewed by Alex Christensen.

        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleInternal.h:
        (WebCore::ResourceHandleInternal::ResourceHandleInternal):
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
        (WebCore::ResourceHandle::start):
        (WebCore::ResourceHandle::cancel):
        (WebCore::ResourceHandleInternal::initialize):
        (WebCore::ResourceHandleInternal::applyAuthentication):
        (WebCore::ResourceHandleInternal::setupPUT):
        (WebCore::ResourceHandleInternal::setupPOST):
        (WebCore::ResourceHandleInternal::setupFormData):
        (WebCore::ResourceHandle::platformSetDefersLoading):
        (WebCore::ResourceHandleInternal::didFinish):
        (WebCore::ResourceHandleInternal::didFail):
        (WebCore::ResourceHandleInternal::calculateWebTimingInformations):
        (WebCore::ResourceHandleInternal::handleLocalReceiveResponse):
        (WebCore::ResourceHandleInternal::willPrepareSendData):
        (WebCore::ResourceHandleInternal::didReceiveHeaderLine):
        (WebCore::ResourceHandleInternal::didReceiveAllHeaders):
        (WebCore::ResourceHandleInternal::didReceiveContentData):
        (WebCore::ResourceHandleInternal::readCallback):
        (WebCore::ResourceHandleInternal::headerCallback):
        (WebCore::ResourceHandleInternal::writeCallback):
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        (WebCore::ResourceHandleInternal::dispatchSynchronousJob):
        (WebCore::ResourceHandleInternal::handleDataURL):
        (WebCore::ResourceHandle::initialize): Deleted.
        (WebCore::ResourceHandle::applyAuthentication): Deleted.
        (WebCore::ResourceHandle::setupPUT): Deleted.
        (WebCore::ResourceHandle::setupPOST): Deleted.
        (WebCore::ResourceHandle::setupFormData): Deleted.
        (WebCore::ResourceHandle::didFinish): Deleted.
        (WebCore::ResourceHandle::didFail): Deleted.
        (WebCore::ResourceHandle::calculateWebTimingInformations): Deleted.
        (WebCore::ResourceHandle::handleLocalReceiveResponse): Deleted.
        (WebCore::ResourceHandle::willPrepareSendData): Deleted.
        (WebCore::ResourceHandle::didReceiveHeaderLine): Deleted.
        (WebCore::ResourceHandle::didReceiveAllHeaders): Deleted.
        (WebCore::ResourceHandle::didReceiveContentData): Deleted.
        (WebCore::ResourceHandle::readCallback): Deleted.
        (WebCore::ResourceHandle::headerCallback): Deleted.
        (WebCore::ResourceHandle::writeCallback): Deleted.
        (WebCore::ResourceHandle::dispatchSynchronousJob): Deleted.
        (WebCore::ResourceHandle::handleDataURL): Deleted.

2017-07-18  Andy Estes  <aestes@apple.com>

        [Xcode] Enable CLANG_WARN_NON_LITERAL_NULL_CONVERSION
        https://bugs.webkit.org/show_bug.cgi?id=174631

        Reviewed by Dan Bernstein.

        * Configurations/Base.xcconfig:

2017-07-18  Antoine Quint  <graouts@apple.com>

        [macOS] Mouse pointer does not hide during fullscreen playback
        https://bugs.webkit.org/show_bug.cgi?id=174638
        <rdar://problem/33244399>

        Reviewed by Dean Jackson.

        Test: media/modern-media-controls/css/webkit-cursor-visibility-auto-hide.html

        The user-agent stylesheet sets the "-webkit-cursor-visibility" to "auto-hide" for fullscreen <video>
        elements. Since we reset the page styles, including UA styles, on .media-controls-container, we need
        to explicitly inherit this style property from the page to ensure the mouse pointer automatically
        hides in fullscreen.

        * Modules/modern-media-controls/controls/media-controls.css:
        (.media-controls-container):

2017-07-18  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove custom bindings for MockContentFilterSettings
        https://bugs.webkit.org/show_bug.cgi?id=174606

        Reviewed by Andy Estes.

        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSMockContentFilterSettingsCustom.cpp: Removed.
        Remove JSMockContentFilterSettingsCustom.

        * testing/MockContentFilterSettings.h:
        * testing/MockContentFilterSettings.idl:
        Switch from constants to IDL enums to make the bindings and tests simpler.

2017-07-18  Sam Weinig  <sam@webkit.org>

        [WebIDL] Replace some custom bindings code in JSCSSStyleDeclarationCustom.cpp with named getters/setters
        https://bugs.webkit.org/show_bug.cgi?id=174529

        Reviewed by Chris Dumez.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSAllInOne.cpp:
        Add CSSStyleDeclaration.cpp

        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
        Move getter / setter / getOwnProperties logic from here to CSSStyleDeclaration.cpp.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateGetOwnPropertySlot):
        (GenerateGetOwnPropertySlotByIndex):
        (InstanceOverridesGetOwnPropertySlot):
        (GenerateHeader):
        Remove support for no longer needed [CustomGetOwnPropertySlotAndDescriptor].
        Add support for [PutOnlyForSupportedProperties], which allows named setters to behave
        a bit more like normal setters by allowing the implementation to note which properties
        are supported which in turn, allows the bindings to continue down the normal put path
        for unsupported properties. This is necessary to mimic the behavior of CSSStyleDeclaration
        which is using named setters in place hundreds of additional properties.

        (InstanceOverridesDefineOwnProperty):
        Add [DefaultDefineOwnProperty] to allow disabling defineOwnProperty overriding that comes
        automatically with named setters. We need this for CSSStyleDeclaration since the named
        setter usage modeling real properties, not a dictionary style setter. We may want to 
        revisit this, and add support for DefineOwnProperty here, but this allows us to maintain
        the status quo.

        (GenerateDefineOwnProperty):
        Fix the case when you have a named setter, an indexed getter, but no indexed setter. In that
        case, we would get a compile error, due to the index variable being unused.

        * bindings/scripts/IDLAttributes.json:
        Remove support for no longer needed [CustomGetOwnPropertySlotAndDescriptor], add
        [PutOnlyForSupportedProperties] and [DefaultDefineOwnProperty].

        * css/CSSStyleDeclaration.h:
        * css/CSSStyleDeclaration.cpp: Added.
        (WebCore::CSSStyleDeclaration::namedItem):
        (WebCore::CSSStyleDeclaration::setNamedItem):
        (WebCore::CSSStyleDeclaration::isSupportedPropertyName):
        (WebCore::CSSStyleDeclaration::supportedPropertyNames):
        Use standard getter / setter functions to implement CSS property name getting and setting.
        Convert from Identifier to AtomicString, which are now bridgeable.

        * css/CSSStyleDeclaration.idl:
        Add named getter and setter. Remove [CustomGetOwnPropertyNames], [CustomGetOwnPropertySlotAndDescriptor]
        and [CustomPut], add [DefaultDefineOwnProperty].

        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h: Added.
        * bindings/scripts/test/TestNamedSetterWithIndexedGetter.idl: Added.
        * bindings/scripts/test/TestNamedSetterWithIndexedGetterAndSetter.idl: Added.
        Add tests for improved behavior when using named setters with variations of indexed getters and setters as well.

2017-07-18  Antoine Quint  <graouts@apple.com>

        [iOS] WebKit media controls are sometimes shown after exiting full screen on vimeo.com
        https://bugs.webkit.org/show_bug.cgi?id=174627
        <rdar://problem/33301005>

        Reviewed by Dean Jackson, provisionally reviewed by Jeremy Jones.

        On iOS 11, both the WebKit media controls and the Vimeo custom controls would appear sometimes when exiting
        from fullscreen when the video was playing and the user would tap the X button, which would pause the video
        as well as exit fullscreen.

        The reason this happens is that the ControlsVisibilitySupport object, which governs whether the WebKit media
        controls should be displayed for a given video, woud listen to "pause" and "webkitfullscreenchange" events
        and determine whether to show the WebKit media controls. We listen to the "pause" event because when media
        pauses, and the video has the "controls" attribute set, we should show the controls and suspend the controls
        auto-hide timer. And we're interested in knowing when we enter and exit fullscreen because we want to override
        the "controls" attribute not being set when we enter fullscreen.

        However, on iOS 11, it appears that the "webkitfullscreenchange" event is not reliably fired as the user enters
        and exits fullscreen, which is tracked by webkit.org/b/174626. So, when the user exits fullscreen, we would be
        informed of the video being paused via a "pause" event, but not of the video exiting fullscreen. And because
        media events are asynchronous, the "pause" event would sometimes be fired before we exited fullscreen, and when
        the _updateControls() would run, we would sometimes determine that we are in fullscreen still and determine
        that the WebKit media controls should be shown.

        Of course, on iOS, the WebKit media controls are not shown and instead we delegate to AVKit to display media controls.
        So we could simply disregard this whole logic in iOS. But we choose to instead use the "webkitpresentationmodechanged"
        when the presentation mode API is supported, as is the case on iOS 11, to determine changes of media fullscreen state.
        This way, should we ever choose to support fullscreen media controls provided by WebKit on iOS, this logic is already
        correct and we write less platform-specific code.

        This, alas, cannot be tested since we can't force the X button to be tapped within the AVKit fullscreen controls.

        * Modules/modern-media-controls/media/controls-visibility-support.js:
        (ControlsVisibilitySupport.prototype.get mediaEvents):
        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController):
        * Modules/modern-media-controls/media/start-support.js:
        (StartSupport.prototype.get mediaEvents):

2017-07-18  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219610.

        This caused an api failure on all platforms for the test
        SnapshotImageLargeAsyncDecoding

        Reverted changeset:

        "Async image decoding for large images should be disabled
        after the first time a tile is painted"
        https://bugs.webkit.org/show_bug.cgi?id=174451
        http://trac.webkit.org/changeset/219610

2017-07-18  Devin Rousso  <drousso@apple.com>

        Add CanvasRenderingContext2D::getTransform
        https://bugs.webkit.org/show_bug.cgi?id=174278

        Reviewed by Dean Jackson.

        Tests: fast/canvas/2d.getTransform.modification.html
               fast/canvas/2d.getTransform.newobject.html
               fast/canvas/2d.setTransform.matrix.html

        * css/DOMMatrixReadOnly.h:
        Make DOMMatrixReadOnly::validateAndFixup public so that values of DOMMatrixInit are still
        usable without having to construct a DOMMatrixReadOnly. This is beneficial in the case that
        an exception is thrown, as the validateAndFixup check can happen without any allocations.

        * html/canvas/CanvasRenderingContext2D.idl:
        * html/canvas/CanvasRenderingContext2D.h:
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::getTransform):
        (WebCore::CanvasRenderingContext2D::setTransform):

2017-07-18  Andy Estes  <aestes@apple.com>

        [Xcode] Enable CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING
        https://bugs.webkit.org/show_bug.cgi?id=174631

        Reviewed by Darin Adler.

        * Configurations/Base.xcconfig:

2017-07-18  Jonathan Bedard  <jbedard@apple.com>

        Unreviewed build fix after r219595

        * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
        (WebCore::makeNeverDestroyed): Remove duplicate makeNeverDestroyed definition.
        * platform/ios/DragImageIOS.mm:
        (WebCore::cascadeForSystemFont): Return correct FontCascade object.
        (WebCore::createDragImageForLink): Fix compiler error.

2017-07-18  Daniel Bates  <dabates@apple.com>

        Cleanup: Remove AlternativeTextInfo and use Variant to represent alternative text info details
        https://bugs.webkit.org/show_bug.cgi?id=174604

        I inadvertently did not commit some of my local changes.

        * editing/AlternativeTextController.cpp:
        (WebCore::AlternativeTextController::startAlternativeTextUITimer):
        (WebCore::AlternativeTextController::stopAlternativeTextUITimer):
        (WebCore::AlternativeTextController::applyPendingCorrection):
        (WebCore::AlternativeTextController::hasPendingCorrection):
        (WebCore::AlternativeTextController::show):
        (WebCore::AlternativeTextController::handleCancelOperation):
        (WebCore::AlternativeTextController::dismiss):
        (WebCore::AlternativeTextController::dismissSoon):
        (WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate):
        (WebCore::AlternativeTextController::timerFired):
        (WebCore::AlternativeTextController::handleAlternativeTextUIResult):
        (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
        (WebCore::AlternativeTextController::markerDescriptionForAppliedAlternativeText):

2017-07-17  Daniel Bates  <dabates@apple.com>

        Cleanup: Remove AlternativeTextInfo and use Variant to represent alternative text info details
        https://bugs.webkit.org/show_bug.cgi?id=174604

        Reviewed by Darin Adler.

        Remove struct AlternativeTextInfo and represent the alternative text info as instance variables
        using Variant to hold either an autocorrection replacement string or the alternative dictation
        context.

        Not functionality changed. So, no new tests.

        * editing/AlternativeTextController.cpp: Remove header Event.h as it is ultimately included by TextEvent.h.
        (WebCore::AlternativeTextController::show): Update code as needed.
        (WebCore::AlternativeTextController::timerFired): Ditto.
        (WebCore::AlternativeTextController::alternativeTextClient): Substitute nullptr for 0.
        (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): Update code as needed.
        (WebCore::AutocorrectionAlternativeDetails::create): Deleted.
        (WebCore::AutocorrectionAlternativeDetails::replacementString): Deleted.
        (WebCore::AutocorrectionAlternativeDetails::AutocorrectionAlternativeDetails): Deleted.
        (WebCore::DictationAlternativeDetails::create): Deleted.
        (WebCore::DictationAlternativeDetails::dictationContext): Deleted.
        (WebCore::DictationAlternativeDetails::DictationAlternativeDetails): Deleted.
        * editing/AlternativeTextController.h: Remove header Range.h and forward declare Range. Include header
        Position.h and wtf/Variant.h. Sort forward declarations.
        (WebCore::AlternativeTextDetails::~AlternativeTextDetails): Deleted.

2017-07-18  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Async image decoding for large images should be disabled after the first time a tile is painted
        https://bugs.webkit.org/show_bug.cgi?id=174451

        Reviewed by Simon Fraser.

        Flashing because of DOM mutation can be fixed by disabling the asynchronous
        image decoding after the first time a tile was painted.

        We can detect this by consulting the tile repaintCount. If it is zero, then
        it is safe to use asynchronous image decoded. If the tile repaintCount is
        greater than zero, we are not sure if the renderer rectangle has an image
        drawn in it already or not. In this case we have to use the synchronous
        image decoding to avoid causing a flash.

        Tests: fast/images/async-image-background-change.html
               fast/images/async-image-src-change.html
               http/tests/multipart/multipart-async-image.html

        * page/PageOverlayController.cpp:
        (WebCore::PageOverlayController::paintContents):
        * page/PageOverlayController.h:
        * page/linux/ResourceUsageOverlayLinux.cpp:
        * page/mac/ServicesOverlayController.h:
        * page/mac/ServicesOverlayController.mm:
        (WebCore::ServicesOverlayController::Highlight::paintContents):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::GraphicsLayer::paintGraphicsLayerContents):
        * platform/graphics/GraphicsLayer.h:
        * platform/graphics/GraphicsLayerClient.h:
        (WebCore::GraphicsLayerClient::paintContents):
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
        (WebCore::LayerClient::platformCALayerPaintContents):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
        * platform/graphics/ca/GraphicsLayerCA.h:
        * platform/graphics/ca/PlatformCALayer.h:
        * platform/graphics/ca/PlatformCALayerClient.h:
        (WebCore::PlatformCALayerClient::platformCALayerRepaintCount):
        * platform/graphics/ca/TileCoverageMap.cpp:
        (WebCore::TileCoverageMap::platformCALayerPaintContents):
        * platform/graphics/ca/TileCoverageMap.h:
        * platform/graphics/ca/TileGrid.cpp:
        (WebCore::TileGrid::platformCALayerPaintContents):
        (WebCore::TileGrid::platformCALayerRepaintCount):
        * platform/graphics/ca/TileGrid.h:
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        (PlatformCALayer::drawLayerContents):
        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
        (PlatformCALayer::drawLayerContents):
        * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
        (PlatformCALayerWinInternal::displayCallback):
        * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
        (WebTiledBackingLayerWin::displayCallback):
        * platform/graphics/mac/WebLayer.mm:
        (-[WebLayer drawInContext:]):
        (-[WebSimpleLayer drawInContext:]):
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::decodingModeForImageDraw):
        * rendering/RenderElement.h:
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::paintContents):
        * rendering/RenderLayerBacking.h:
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::paintContents):
        * rendering/RenderLayerCompositor.h:
        * testing/Internals.cpp:
        (WebCore::imageFromImageElement):
        (WebCore::bitmapImageFromImageElement):
        (WebCore::Internals::imageFrameIndex):
        (WebCore::Internals::setImageFrameDecodingDuration):
        (WebCore::Internals::resetImageAnimation):
        (WebCore::Internals::isImageAnimating):
        (WebCore::Internals::setClearDecoderAfterAsyncFrameRequestForTesting):
        (WebCore::Internals::imageDecodeCount):
        (WebCore::Internals::setLargeImageAsyncDecodingEnabledForTesting):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-07-18  Chris Dumez  <cdumez@apple.com>

        DOMException should have its properties on the prototype
        https://bugs.webkit.org/show_bug.cgi?id=174597

        Reviewed by Alex Christensen.

        DOMException should have its properties on the prototype, as other interfaces:
        - https://heycam.github.io/webidl/#idl-DOMException

        No new tests, rebaselined existing tests.

        * bindings/scripts/CodeGeneratorJS.pm:
        (InterfaceRequiresAttributesOnInstance):

2017-07-18  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Unify ResourceHandleManager into CurlJobManager.
        https://bugs.webkit.org/show_bug.cgi?id=173991

        Use CurlJobManager to make ResourceHandle run in background.
        CurlJobManager::start() now accept callback to manage life cycle
        of the resource easily in a same context.
        Actual management tasks of CurlJobManager is now private class
        in CurlJobManager which is better thread safeness.
        ResourceHandleManager is deleted at all.

        Reviewed by Alex Christensen.

        * platform/Curl.cmake:
        * platform/network/ResourceHandle.h:
        * platform/network/curl/CookieJarCurl.cpp:
        (WebCore::cookiesForSession):
        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlHandle::CurlHandle):
        (WebCore::CurlHandle::~CurlHandle):
        (WebCore::CurlHandle::errorDescription):
        (WebCore::CurlHandle::perform):
        (WebCore::CurlHandle::pause):
        (WebCore::CurlHandle::appendRequestHeaders):
        (WebCore::CurlHandle::appendRequestHeader):
        (WebCore::CurlHandle::enableRequestHeaders):
        (WebCore::CurlHandle::fetchCookieList):
        (WebCore::CurlHandle::getEffectiveURL):
        (WebCore::CurlHandle::setPrivateData): Deleted.
        (WebCore::CurlHandle::clearRequestHeaders): Deleted.
        (WebCore::CurlHandle::getCookieList): Deleted.
        (WebCore::CurlHandle::clearCookieList): Deleted.
        * platform/network/curl/CurlContext.h:
        (WebCore::CurlSList::CurlSList):
        (WebCore::CurlSList::~CurlSList):
        (WebCore::CurlSList::operator struct curl_slist** ):
        (WebCore::CurlSList::head):
        (WebCore::CurlSList::isEmpty):
        (WebCore::CurlSList::clear):
        (WebCore::CurlSList::append):
        (WebCore::CurlHandle::errorCode):
        (WebCore::CurlHandle::setErrorCode):
        (WebCore::CurlHandle::privateData):
        (WebCore::CurlHandle::setPrivateData):
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::start):
        (WebCore::CurlDownload::cancel):
        (WebCore::CurlDownload::addHeaders):
        (WebCore::CurlDownload::didReceiveData):
        (WebCore::CurlDownload::didFail):
        (WebCore::CurlDownload::handleCurlMsg): Deleted.
        * platform/network/curl/CurlDownload.h:
        * platform/network/curl/CurlJobManager.cpp:
        (WebCore::CurlJobList::append):
        (WebCore::CurlJobList::cancel):
        (WebCore::CurlJobList::complete):
        (WebCore::CurlJobList::isEmpty):
        (WebCore::CurlJobList::withJob):
        (WebCore::CurlJobList::withCurlHandle):
        (WebCore::CurlJob::invoke):
        (WebCore::CurlJobManager::add):
        (WebCore::CurlJobManager::cancel):
        (WebCore::CurlJobManager::callOnJobThread):
        (WebCore::CurlJobManager::startThreadIfNeeded):
        (WebCore::CurlJobManager::stopThreadIfNoMoreJobRunning):
        (WebCore::CurlJobManager::stopThread):
        (WebCore::CurlJobManager::updateJobs):
        (WebCore::CurlJobManager::workerThread):
        (WebCore::CurlJobManager::CurlJobManager): Deleted.
        (WebCore::CurlJobManager::~CurlJobManager): Deleted.
        (WebCore::CurlJobManager::remove): Deleted.
        (WebCore::CurlJobManager::getActiveCount): Deleted.
        (WebCore::CurlJobManager::getPendingCount): Deleted.
        (WebCore::CurlJobManager::stopThreadIfIdle): Deleted.
        (WebCore::CurlJobManager::updateHandleList): Deleted.
        (WebCore::CurlJobManager::addToCurl): Deleted.
        (WebCore::CurlJobManager::removeFromCurl): Deleted.
        * platform/network/curl/CurlJobManager.h:
        (WebCore::CurlJob::CurlJob):
        (WebCore::CurlJob::~CurlJob):
        (WebCore::CurlJob::operator=):
        (WebCore::CurlJob::curlHandle):
        (WebCore::CurlJob::ticket):
        (WebCore::CurlJob::finished):
        (WebCore::CurlJob::error):
        (WebCore::CurlJob::cancel):
        (WebCore::CurlJobManager::singleton):
        (WebCore::CurlJobManager::~CurlJobManager):
        (WebCore::CurlJobManager::isActiveJob):
        (WebCore::CurlJobManager::runThread): Deleted.
        (WebCore::CurlJobManager::setRunThread): Deleted.
        * platform/network/curl/ResourceError.h:
        (WebCore::ResourceError::ResourceError):
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::~ResourceHandle):
        (WebCore::ResourceHandle::start):
        (WebCore::ResourceHandle::cancel):
        (WebCore::ResourceHandle::initialize):
        (WebCore::ResourceHandle::applyAuthentication):
        (WebCore::getFormElementsCount):
        (WebCore::ResourceHandle::setupPUT):
        (WebCore::ResourceHandle::setupPOST):
        (WebCore::ResourceHandle::setupFormData):
        (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate):
        (WebCore::ResourceHandle::setClientCertificateInfo):
        (WebCore::ResourceHandle::platformSetDefersLoading):
        (WebCore::ResourceHandle::didFinish):
        (WebCore::ResourceHandle::didFail):
        (WebCore::ResourceHandle::shouldUseCredentialStorage):
        (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
        (WebCore::ResourceHandle::receivedCredential):
        (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
        (WebCore::ResourceHandle::receivedCancellation):
        (WebCore::ResourceHandle::calculateWebTimingInformations):
        (WebCore::ResourceHandle::handleLocalReceiveResponse):
        (WebCore::ResourceHandle::willPrepareSendData):
        (WebCore::ResourceHandle::didReceiveHeaderLine):
        (WebCore::ResourceHandle::didReceiveAllHeaders):
        (WebCore::ResourceHandle::didReceiveContentData):
        (WebCore::ResourceHandle::readCallback):
        (WebCore::ResourceHandle::headerCallback):
        (WebCore::ResourceHandle::writeCallback):
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        (WebCore::ResourceHandle::dispatchSynchronousJob):
        (WebCore::calculateWebTimingInformations): Deleted.
        (WebCore::handleLocalReceiveResponse): Deleted.
        (WebCore::writeCallback): Deleted.
        (WebCore::headerCallback): Deleted.
        (WebCore::readCallback): Deleted.
        (WebCore::setupFormData): Deleted.
        (WebCore::ResourceHandle::handleCurlMsg): Deleted.
        * platform/network/curl/ResourceHandleManager.cpp: Removed.
        * platform/network/curl/ResourceHandleManager.h: Removed.

2017-07-17  Konstantin Tokarev  <annulen@yandex.ru>

        Unreviewed fix to Mac CMake build after r219474.

        * PlatformMac.cmake:

2017-07-17  Konstantin Tokarev  <annulen@yandex.ru>

        [cmake] Set library types before their targets are created
        https://bugs.webkit.org/show_bug.cgi?id=174600

        Reviewed by Michael Catanzaro.

        Since r219560 library targets are created before PlatformXXX.cmake
        files are processed, however library type must be passed in
        add_library() call and cannot be changed afterwards. Set these
        variables in OptionsXXX.cmake.

        No new tests needed.

        * PlatformMac.cmake:

2017-07-17  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        Move USE_AVFOUNDATION definition on Windows to wtf/Platform.h
        https://bugs.webkit.org/show_bug.cgi?id=174356

        Reviewed by Brent Fulgham.

        Move the definition of USE_AVFOUNDATION on Windows to wtf/platform.h

        Rename WebCoreHeaderDetection.h to AVFoundationHeaderDetection.h

        * AVFoundationSupport.py: Moved to Source/WTF/AVFoundationSupport.py.
        * DerivedSources.make:
        * PlatformWin.cmake:
        * config.h:
        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
        * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:

2017-07-17  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove custom bindings that require non-caching JS strings
        https://bugs.webkit.org/show_bug.cgi?id=174552

        Reviewed by Darin Adler.

        Adds two new types, UncachedString and OwnedString (both of which
        are simple structs that wrap a String) to communicate to the bindings
        layer which function to use when converting to a JS string.

        * bindings/IDLTypes.h:
        (WebCore::IDLString::isNullValue):
        Add overloads of isNullValue for UncachedString and OwnedString.

        * bindings/js/JSDOMConvertStrings.h:
        (WebCore::JSConverter<IDLDOMString>::convert):
        (WebCore::JSConverter<IDLByteString>::convert):
        (WebCore::JSConverter<IDLUSVString>::convert):
        Add overloads of convert for UncachedString that uses JSC::jsString 
        and for OwnedString that uses JSC::jsOwnedString.

        * bindings/js/JSHTMLCanvasElementCustom.cpp:
        (WebCore::JSHTMLCanvasElement::toDataURL): Deleted.
        Remove custom binding for toDataURL.

        * bindings/js/JSXMLHttpRequestCustom.cpp:
        (WebCore::JSXMLHttpRequest::retrieveResponse):
        (WebCore::JSXMLHttpRequest::responseText): Deleted.
        Remove custom binding for responseText. Replace the caller of the 
        binding function with a simple conversion that will do the same thing.

        * bindings/js/StringAdaptors.h: Added.
        Add UncachedString and OwnedString adaptors.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::toDataURL):
        Move quality conversion here, matching toBlob and the spec. Return a UncachedString
        to instruct the bindings to use JSC::jsString and not JSC::jsStringWithCache.

        (WebCore::HTMLCanvasElement::toBlob):
        Use asNumber() rather than toNumber(), since we just checked that it is a number.

        * html/HTMLCanvasElement.h:
        Update header to account for returning an UncachedString.

        * html/HTMLCanvasElement.idl:
        Remove [Custom] and make the signature of toDataURL match the spec (and what we have been doing).

        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::requestContent):
        Update to account for UncachedString.

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::responseText):
        * xml/XMLHttpRequest.h:
        Update responseText to return OwnedString. OwnedString instruct the bindings to 
        use JSC::jsOwnedString and not JSC::jsStringWithCache.

        * xml/XMLHttpRequest.idl:
        Remove [CustomGetter].

2017-07-17  Daniel Bates  <dabates@apple.com>

        Cleanup: Use OptionSet to represent marker types
        https://bugs.webkit.org/show_bug.cgi?id=174594

        Reviewed by Darin Adler.

        Remove class DocumentMarker::MarkerTypes that duplicates most of functionality of OptionSet
        and use OptionSet directly to represent a set of marker types.

        No functionality changed. So, no new tests.

        * dom/Document.cpp:
        (WebCore::Document::updateLayout):
        * dom/DocumentMarker.h:
        (WebCore::DocumentMarker::MarkerTypes::MarkerTypes): Deleted.
        (WebCore::DocumentMarker::MarkerTypes::contains): Deleted.
        (WebCore::DocumentMarker::MarkerTypes::intersects): Deleted.
        (WebCore::DocumentMarker::MarkerTypes::operator==): Deleted.
        (WebCore::DocumentMarker::MarkerTypes::add): Deleted.
        (WebCore::DocumentMarker::MarkerTypes::remove): Deleted.
        (WebCore::DocumentMarker::AllMarkers::AllMarkers): Deleted.
        * dom/DocumentMarkerController.cpp:
        (WebCore::DocumentMarkerController::possiblyHasMarkers):
        (WebCore::DocumentMarkerController::detach):
        (WebCore::DocumentMarkerController::removeMarkers):
        (WebCore::DocumentMarkerController::addMarker):
        (WebCore::DocumentMarkerController::copyMarkers):
        (WebCore::DocumentMarkerController::markersFor):
        (WebCore::DocumentMarkerController::markersInRange):
        (WebCore::DocumentMarkerController::removeMarkersFromList):
        (WebCore::DocumentMarkerController::repaintMarkers):
        (WebCore::DocumentMarkerController::shiftMarkers):
        (DocumentMarkerController::setMarkersActive):
        (DocumentMarkerController::hasMarkers):
        (DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange):
        Update code as needed.

        * dom/DocumentMarkerController.h:
        (WebCore::DocumentMarkerController::hasMarkers):
        Update code as needed.

        * editing/AlternativeTextController.cpp:
        (WebCore::markerTypesForAutocorrection):
        (WebCore::markerTypesForReplacement):
        (WebCore::markerTypesForAppliedDictationAlternative):
        Marked as inline and returns an OptionSet<DocumentMarker::MarkerType>. It is unnecessary to use NeverDestroyed
        in these functions as constructing an OptionSet and copying/moving it is very efficient. Such operations are
        effectively equivalent to an integral assignment and copy of an integral value, respectively.

        (WebCore::AlternativeTextController::applyAlternativeTextToRange):
        (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
        (WebCore::AlternativeTextController::markCorrection):
        Update code as needed.

        * editing/AlternativeTextController.h: While I am here, remove some unnecessary #includes and group
        forward declarations of structs.
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Update code as needed.
        * editing/Editor.cpp:
        (WebCore::Editor::updateMarkersForWordsAffectedByEditing): Ditto.
        * editing/SpellChecker.cpp:
        (WebCore::SpellChecker::didCheckSucceed): Ditto.
        * page/ios/FrameIOS.mm:
        (WebCore::Frame::interpretationsForCurrentRoot): Ditto.
        * testing/Internals.cpp:
        (WebCore::markerTypesFrom): Ditto.
        (WebCore::Internals::markerCountForNode): Ditto.
        (WebCore::Internals::markerAt): Ditto.

2017-07-17  Devin Rousso  <drousso@apple.com>

        Web Inspector: overlay page highlight doesn't disappear when a page is constantly updating
        https://bugs.webkit.org/show_bug.cgi?id=174468

        Reviewed by Simon Fraser.

        Do not allow the PageOverlay to start another fade animation of the same type if one has
        already started. As an example, if the PageOverlay is fading out, startFadeOutAnimation
        should just return.

        * page/PageOverlay.cpp:
        (WebCore::PageOverlay::startFadeInAnimation):
        (WebCore::PageOverlay::startFadeOutAnimation):

2017-07-17  Darin Adler  <darin@apple.com>

        Improve use of NeverDestroyed
        https://bugs.webkit.org/show_bug.cgi?id=174348

        Reviewed by Sam Weinig.

        * Modules/encryptedmedia/MediaKeySession.cpp: Removed unneeded include of
        NeverDestroyed.h.

        * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
        (WebCore::installedCDMFactories): Use makeNeverDestroyed and a lambda rather
        than a separate boolean for initialization.

        * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
        (WebCore::clearKeyVM): Removed unneeded use of NeverDestroyed to hold a
        RefPtr. Simple to just use leakRef instead.

        * Modules/gamepad/GamepadManager.cpp: Added an include of NeverDestroyed.h.

        * Modules/indexeddb/IDBTransaction.cpp: Removed unneeded include of
        NeverDestroyed.h.
        * Modules/indexeddb/server/MemoryObjectStore.cpp: Ditto.

        * Modules/mediasession/MediaSessionManager.cpp: Moved include of
        NeverDestroyed.h here ...
        * Modules/mediasession/MediaSessionManager.h: ... from here.

        * Modules/mediasource/MediaSourceRegistry.cpp: Moved include of
        NeverDestroyed.h here ...
        * Modules/mediasource/MediaSourceRegistry.h: ... from here.

        * Modules/mediasource/SourceBuffer.cpp: Removed unneeded include of
        NeverDestroyed.h.

        * Modules/plugins/QuickTimePluginReplacement.h: Initialize
        m_scriptObject in the class definition.

        * Modules/plugins/QuickTimePluginReplacement.mm:
        (WebCore::QuickTimePluginReplacement::supportsMimeType): Use
        makeNeverDestroyed and the HashSet constructor instead of a loop.
        (WebCore::QuickTimePluginReplacement::supportsFileExtension): Ditto.
        (WebCore::QuickTimePluginReplacement::QuickTimePluginReplacement): Did a
        slight cleanup of the initializers.
        (WebCore::QuickTimePluginReplacement::~QuickTimePluginReplacement): Added
        a FIXME; unclear why there is code here at all.

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::inheritsPresentationalRole): Use
        makeNeverDestroyed and the Vector constructor instead of using empty
        vector checks and Vector::add. Use std::any_of rather than Vector::contains
        since we now are matching against pointers.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateEnumerationImplementationContent): Use const NeverDestroyed.

        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
        * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
        Regenerated.

        * css/CSSProperty.cpp:
        (WebCore::borderDirections): Removed unnecesssary use of NeverDestroyed
        for a global object that has a trivial destructor.

        * css/ElementRuleCollector.cpp:
        (WebCore::leftToRightDeclaration): Removed unneeded use of NeverDestroyed to hold a
        Ref. Simple to just use leakRef instead. Also use a lambda instead of an explicit
        isEmpty check each time this is called.
        (WebCore::rightToLeftDeclaration): Ditto.

        * css/makeprop.pl: Removed unneeded include of NeverDestroyed.h and the
        uneeded global emptyShorthand. Constructing an empty StylePropertyShorthand
        is no less efficient than copying a global empty one was.

        * dom/CustomElementReactionQueue.cpp: Added an include of NeverDestroyed.h.

        * dom/DOMImplementation.cpp: Removed unneeded include of NeverDestroyed.h.
        * dom/InputEvent.cpp: Ditto.

        * dom/Microtasks.cpp: Moved include of NeverDestroyed.h here ...
        * dom/Microtasks.h: ... from here.

        * dom/MutationObserver.cpp: Added an include of NeverDestroyed.h.

        * dom/ScopedEventQueue.cpp: Moved include of NeverDestroyed.h here ...
        * dom/ScopedEventQueue.h: ... from here. Added Forward.h.

        * dom/ScriptElement.cpp:
        (WebCore::isLegacySupportedJavaScriptLanguage): Use makeNeverDestroyed
        and the HashSet constructor rather than an isEmpty check and a lot of
        add function calls. Also removed comments that don't have value any more,
        with dubious no longer relevant claims about the behavior of old web browsers.
        The function that calls this one already has sufficient comments about why we
        hope some day this function can be eliminated.

        * dom/SecurityContext.cpp: Removed unneeded include of NeverDestroyed.h.

        * dom/make_names.pl:
        (printFactoryCppFile): Instead of using a "populate" function, use a function
        that creates as HashMap. Then use const auto and makeNeverDestroyed.
        (printWrapperFactoryCppFile): Ditto.

        * editing/AlternativeTextController.cpp:
        (WebCore::markerTypesForAutocorrection): Use makeNeverDestroyed
        and the Vector constructor rather than an isEmpty check and a lot of
        append function calls.
        (WebCore::markerTypesForReplacement): Ditto.
        (WebCore::markerTypesForAppliedDictationAlternative): Ditto.

        * editing/EditingStyle.cpp:
        (WebCore::htmlElementEquivalents): Use const auto, makeNeverDestroyed,
        the Vector constructor, and new rather than make_unique. Changed return
        type to use const pointers rather than unique_ptr with non-const type.
        (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement): Updated
        for the above change to htmlElementEquivalents.
        (WebCore::htmlAttributeEquivalents): Same approach as above.
        (WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes): Ditto.
        (WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl): Take
        references instead of pointers.
        (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement): Updated
        for the above.

        * editing/FormatBlockCommand.cpp:
        (WebCore::isElementForFormatBlock): Use const auto, makeNeverDestroyed,
        and the HashSet constructor rather than isEmpty and a lot of calls to add.
        * editing/RemoveFormatCommand.cpp:
        (WebCore::isElementForRemoveFormatCommand): Ditto.

        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::isProhibitedParagraphChild): Use const auto, makeNeverDestroyed,
        and a lambda, rather than isEmpty and a lot of calls to add.

        * html/Autofill.cpp:
        (WebCore::fieldNameMap): Changed return type to be const. Use const auto,
        makeNeverDestroyed, a lambda, and an array of values rather than isEmpty
        and a lot of calls to add. Stopped doing the ConstructFromLiteral
        optimization here. (Easy to add it back if that is a mistake.)

        * html/HTMLObjectElement.cpp:
        (WebCore::isRecognizedTagName): Use const auto, makeNeverDestroyed, and
        a lambda rather than isEmpty.

        * html/HTMLStyleElement.cpp: Added include of NeverDestroyed.h.

        * html/HTMLVideoElement.cpp: Removed uneeded include of NeverDestroyed.h.

        * html/InputType.cpp:
        (WebCore::createInputTypeFactoryMap): Replaced the populate function
        with this create function.
        (WebCore::InputType::create): Use const auto and makeNeverDestroyed
        istead of isEmpty. Also put the map right where it is used so it's
        not initialized in code path where not needed.

        * html/parser/HTMLParserIdioms.cpp: Removed uneeded include of
        NeverDestroyed.h.

        * inspector/InspectorApplicationCacheAgent.cpp:
        (WebCore::InspectorApplicationCacheAgent::networkStateChanged):
        Merged into a single line.

        * loader/ContentFilter.cpp:
        (WebCore::blockedPageURL): Use const auto and makeNeverDestroyed
        rather than std::call_once. Since this is a URL and has a non-thread-safe
        reference count, this was not thread safe before, so no need to use the
        more roundabout and less efficient idiom for its thread safety.

        * loader/CrossOriginAccessControl.cpp:
        (WebCore::isOnAccessControlResponseHeaderWhitelist): Deleted.
        * loader/CrossOriginAccessControl.h: Deleted unused function
        isOnAccessControlResponseHeaderWhitelist.

        * loader/EmptyClients.cpp: Use leakRef instead of NeverDestroyed<Ref>.

        * loader/appcache/ApplicationCacheStorage.cpp: Removed unneeded include of
        NeverDestroyed.h.
        * page/CaptionUserPreferences.cpp: Ditto.

        * page/DebugPageOverlays.cpp:
        (WebCore::touchEventRegionColors): Changed the return type to const, since
        the callers do not modify the map. Use const auto, makeNeverDestroyed, and
        a lambda rather than isEmpty and repeated calls to add.

        * page/MainFrame.cpp: Removed unneeded include of NeverDestroyed.h.

        * page/MemoryRelease.cpp:
        (WebCore::releaseMemory): Use a function directly instead of calling it
        inside a lambda.

        * page/NavigatorBase.cpp:
        (WebCore::NavigatorBase::onLine): Updated to call
        NetworkStateNotifier::singleton.

        * page/Page.cpp:
        (WebCore::allPages): Made this a function instead of a global to use the
        normal idiom for such globals.
        (WebCore::Page::forEachPage): Updated for change to allPages.
        (WebCore::networkStateChanged): Ditto. Also removed a bit of unnecessary
        churn by using const AtomicString& instead of AtomicString.
        (WebCore::Page::Page): Moved initialization of most data members to the
        class definition. Removed initialiation of allPages. Updated the use of
        NetworkStateNotifier for its new slightly changed  interface.
        (WebCore::Page::~Page): Updated for change to allPages.
        (WebCore::Page::clearPreviousItemFromAllPages): Ditto.
        (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment): Ditto.
        (WebCore::Page::refreshPlugins): Ditto.

        * page/Page.h: Moved initialization of most data members here.

        * page/PerformanceUserTiming.cpp: Removed many unneded includes.
        (WebCore::restrictedMarkFunction): Use const auto, makeNeverDestroyed, and
        a lambda instead of isEmpty. Also use an array rather than std::array and
        got rid fo the unneeded use of anonymous namespace since this is fine in
        the top level WebCore namespace.
        (WebCore::clearPerformanceEntries): Tweaked coding style.
        (WebCore::UserTiming::mark): Ditto.
        (WebCore::UserTiming::findExistingMarkStartTime): Got rid of double hash
        table lookup by using find instead of using contains followed by get.
        removed unneeded explicit cast to double. Tweaked coding style.
        (WebCore::convertToEntrySequence): Tweaked coding style.
        (WebCore::getEntrySequenceByName): Deleted.
        (WebCore::UserTiming::getMarks): Call get directly instead of getEntrySequenceByName.
        (WebCore::UserTiming::getMeasures): Ditto.

        * page/RuntimeEnabledFeatures.cpp: Moved include of NeverDestroyed.h here ...
        * page/RuntimeEnabledFeatures.h: ... from here. Added Forward.h and Noncopyable.h.

        * platform/LocalizedStrings.cpp: Removed unneeded include of NeverDestroyed.h.

        * platform/MIMETypeRegistry.cpp:
        (WebCore::initializeSupportedImageMIMETypes): Added a missing const for a global
        constant array.
        (WebCore::initializeSupportedJavaScriptMIMETypes): Ditto.
        (WebCore::initializeSupportedNonImageMimeTypes): Ditto.
        (WebCore::typesForCommonExtension): Replaced the old mediaMIMETypeMap function
        with this one. Moved the common media types array here since it's only used here.
        Use const auto, makeNeverDestroyed, and a lambda instead of using an isEmpty check.
        Iterate the array using a mdoern for loop. Use HashMap::ensure to avoid the
        double hashing that the old code was doing. And moved the code to find an entry
        in the map in here from the client functions.
        (WebCore::MIMETypeRegistry::getMediaMIMETypeForExtension): Updated to use the
        typesForCommonExtension, and changed logic to use this first, and only call
        getMIMETypeForExtension for extensions not in the map. This gives the same
        result but should be slightly more efficient.
        (WebCore::MIMETypeRegistry::getMediaMIMETypesForExtension): Updated to use the
        typesForCommonExtension function. Comment about strategy is now in there.
        (WebCore::initializeUnsupportedTextMIMETypes): Added a missing const for a global
        constant array. Also started using ASCIILiteral.

        * platform/MainThreadSharedTimer.cpp: Moved include of NeverDestroyed.h here ...
        * platform/MainThreadSharedTimer.h: ... from here. Added Forward.h.

        * platform/SchemeRegistry.cpp:
        (WebCore::add): Added helper functions to keep code below simpler.
        (WebCore::makeNeverDestroyedSchemeSet): Ditto.
        (WebCore::allBuiltinSchemes): Use const auto, makeNeverDestroyed, a lambda,
        and the helper functions above, rather than isEmpty.
        (WebCore::builtinLocalURLSchemes): Use const auto, makeNeverDestroyed, and
        the HashSet constructor instead of isEmpty and add calls. Also changed the
        return type to be const.
        (WebCore::localURLSchemes): Copy the map using assignment instead of an
        isEmpty function and a loop with calls to add.
        (WebCore::builtinSecureSchemes): Use const auto, makeNeverDestroyed, and
        the Vector constructor rather than isEmpty, repeated calls to append,
        and shrinkToFit.
        (WebCore::secureSchemes): Use auto and makeNeverDestroyedSchemeSet rather
        than isEmpty and repeated calls to add.
        (WebCore::builtinSchemesWithUniqueOrigins): More of the same.
        (WebCore::schemesWithUniqueOrigins): Ditto.
        (WebCore::builtinEmptyDocumentSchemes): Ditto.
        (WebCore::emptyDocumentSchemes): Ditto.
        (WebCore::schemesForbiddenFromDomainRelaxation): Ditto.
        (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes): Ditto.
        (WebCore::canDisplayOnlyIfCanRequestSchemes): Ditto.
        (WebCore::builtinCORSEnabledSchemes): Ditto.
        (WebCore::CORSEnabledSchemes): Ditto.
        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal): Replaced check for
        empty string with check for null string, since that's slightly more efficient
        for non-null, non-empty strings, and the hash table can handle empty strings
        just fine.
        (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess): Added null check here.
        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess): Ditto.
        (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated): Ditto.
        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated): Ditto.
        (WebCore::SchemeRegistry::registerURLSchemeAsSecure): Ditto.
        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure): Ditto.
        (WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument): Ditto.
        (WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument): Ditto.
        (WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme): Ditto.
        (WebCore::SchemeRegistry::isDomainRelaxationForbiddenForURLScheme): Ditto.
        (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest): Ditto.
        (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest): Ditto.
        (WebCore::SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs): Ditto.
        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs): Ditto.
        (WebCore::SchemeRegistry::registerURLSchemeAsAllowingLocalStorageAccessInPrivateBrowsing): Ditto.
        (WebCore::SchemeRegistry::allowsLocalStorageAccessInPrivateBrowsing): Ditto.
        (WebCore::SchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing): Ditto.
        (WebCore::SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing): Ditto.
        (WebCore::SchemeRegistry::registerURLSchemeAsCORSEnabled): Ditto.
        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled): Ditto.
        (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy): Ditto.
        (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy): Ditto.
        (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy): Ditto.
        (WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated): Ditto.
        (WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme): Ditto.
        (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned): Ditto.
        (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme): Ditto.
        (WebCore::SchemeRegistry::isUserExtensionScheme): Tweaked #if a bit.
        (WebCore::SchemeRegistry::isBuiltinScheme): Added null check.

        * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
        (WebVideoFullscreenModelVideoElement::observedEventNames): Use const auto,
        makeNeverDestroyed, and the Vector constructor rather than a call to size
        and then append eacn time this funciton is called.

        * platform/gamepad/cocoa/GameControllerGamepadProvider.h: Moved include of
        NeverDestroyed.h from here ...
        * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: ... to here.

        * platform/gamepad/mac/HIDGamepadProvider.cpp: Moved include of
        NeverDestroyed.h here ...
        * platform/gamepad/mac/HIDGamepadProvider.h: ... from here.

        * platform/graphics/FontCascade.cpp:
        (WebCore::FontCascade::hasValidAverageCharWidth): Use const auto,
        makeNeverDestroyed, and the HashSet constructor.

        * platform/graphics/ImageBuffer.cpp:
        (WebCore::ImageBuffer::transformColorSpace): Removed unneeded use of
        NeverDestroyed<Vector<int>> here, instead using const std::array.

        * platform/graphics/ImageBuffer.h: Changed platformTransformColorSpace to take
        const std::array<uint8_t, 256>& instead of const Vector<int>&, since the whole
        pointer of the argument is that it's a table to map bytes onto other bytes.

        * platform/graphics/MediaPlaybackTarget.h: Removed unneeded include of
        NeverDestroyed.h, unneeded unused noMediaPlaybackTargetContext function,
        and unneeded include of MediaPlaybackTargetContext.h, forward declaring instead.
        Made most functions in this class pure virtual instead of having default
        implementations.

        * platform/graphics/avfoundation/MediaPlaybackTargetMac.h: Added include
        of MediaPlaybackTargetContext.h now that it was removed above.

        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList): Use const auto,
        makeNeverDestroyed, and the HashSet constructor.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Reversed the sense
        of the boolean logic here to make this simpler and easier to read.
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes): Changed
        the implementation here, which empties out the passed in hash set, to use
        the clear function rather than assignment from a global empty hash set. Added
        a FIXME because it seems peculiar that this would be considered OK.
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsType): Used ? : to make
        this a little more terse; I think it's clearer.

        * platform/graphics/cairo/ImageBufferCairo.cpp:
        (WebCore::ImageBuffer::platformTransformColorSpace): Updated for change to
        argument type.

        * platform/graphics/cg/ImageDecoderCG.cpp: Removed unneeded include of
        NeverDestroyed.h.
        (WebCore::appendImageSourceOption): Streamlined code using auto with
        adoptCF; there is no need to write out the type of the RetainPtr.
        (WebCore::imageSourceOptions): Instead of NeverDestroyed<RetainPtr>, just use
        const auto and leakRef.
        (WebCore::imageSourceAsyncOptions): Ditto.

        * platform/graphics/gtk/GdkCairoUtilities.cpp:
        (WebCore::getDefaultCairoFontOptions): Instead of using LazyNeverDestroyed
        on a pointer, just use a global pointer. There is no need to use any kind
        of NeverDestroyed on a type with a trivial destructor such as a pointer.

        * platform/graphics/ios/FontCacheIOS.mm:
        (WebCore::platformFontWithFamilySpecialCase): Instead of using
        NeverDestroyed<RetainPtr> just use a raw pointer global.
        * platform/graphics/mac/FontCacheMac.mm:
        (WebCore::platformFontWithFamilySpecialCase): Ditto.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::createFileTypesSet): Return the HashSet instead of adding to it.
        Use Objective-C for/in syntax for an NSArray, not C++ for syntax, although
        it seems the C++ syntax was working fine.
        (WebCore::mimeCommonTypesCache): Fixed return type so we won't copy the
        HashMap every time this function is called. Use const auto and makeNeverDestroyed
        instead of using a boolean to do one time initialization.
        (WebCore::mimeModernTypesCache): Ditto.
        (WebCore::MediaPlayerPrivateQTKit::disableUnsupportedTracks): Marked a
        constant array const.

        * platform/ios/Device.cpp:
        (WebCore::deviceClass): Use a lambda to initialize a variable here instead
        of using std::call_once. This function does not need to be thread safe.
        (WebCore::deviceName): Use const NeverDestroyed instead of LazyNeverDestroyed
        and std::call_once. This function does not need to be thread safe.

        * platform/ios/DragImageIOS.mm: Make defaultLinkIndicatorOptions be a
        constant instead of a variable.
        (WebCore::cascadeForSystemFont): Added helper function.
        (WebCore::createDragImageForLink): Use const auto and makeNeverDestroyed
        instead of LazyNeverDestroyed and dispatch_once. This code does not need
        to be thread safe since its arguments include, for example, a DOM element.

        * platform/ios/LegacyTileLayerPool.h: Removed unneeded include of
        NeverDestroyed.h.

        * platform/ios/QuickLook.mm:
        (WebCore::QLPreviewGetSupportedMIMETypesSet): Use a global raw pointer
        instead of NeverDestroyed<RetainPtr<NSSet>>.
        (WebCore::createQLPreviewProtocol): Deleted.
        (WebCore::QLPreviewProtocol): Use a global raw pointer instead of
        a NeverDestroyed<Vector<char>>. It's cleaner to use fastStrdup instead
        of appending to an array, and less wasteful of memory too.

        * platform/ios/WebCoreMotionManager.mm: Removed unneeded include of
        NeverDestroyed.h.
        * platform/ios/WebSQLiteDatabaseTrackerClient.h: Ditto.
        * platform/mac/DragImageMac.mm: Ditto.
        * platform/mediastream/CaptureDeviceManager.cpp: Ditto.
        * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp: Ditto.

        * platform/mock/MockRealtimeMediaSource.cpp:
        (WebCore::MockRealtimeMediaSource::audioDevices): Use auto,
        makeNeverDestroyed, and a lambda instead of checking size each time.
        (WebCore::MockRealtimeMediaSource::videoDevices): Ditto.

        * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
        (WebCore::mimeTypeCache): Use const auto, makeNeverDestroyed, and the
        HashSet constructor instead of an explicit boolean to initialize.

        * platform/network/BlobRegistryImpl.cpp:
        (WebCore::blobUtilityQueue): Use a global with a raw reference instead
        of a NeverDestroyed<Ref>.

        * platform/network/NetworkStateNotifier.cpp:
        (WebCore::NetworkStateNotifier::singleton): Renamed this from
        networkStateNotifier. We must have missed this when we changed to use the
        singleton idiom consistently. Also changed to use normal NeverDestroyed
        rather than using LazyNeverDestroyed and call_once, because this is not
        used from multiple threads and has no special thread safety requirements.
        (WebCore::NetworkStateNotifier::NetworkStateNotifier): Moved the constructor
        here and construct the timer. Before the timer was used only on the Mac
        platform but now it is there for all platforms.
        (WebCore::NetworkStateNotifier::onLine): Moved function here from the header.
        It's a littlel less trivial than before because it now triggers a call to
        updateState as needed.
        (WebCore::NetworkStateNotifier::addListener): Renamed from
        addNetworkStateChangeListener since there is only one kind of listener and
        the old name was too wordy. Changed to call the new startObserving function,
        and guaranteed to call it onlh once. The platform-specific logic for iOS is
        now inside the iOS version of that function instead of here.
        (WebCore::NetworkStateNotifier::updateState): Moved here now that it is the
        same for all platforms. The actual state updating is done in a function named
        updateStateWithoutNotifying, which is implemented for each platform.
        (WebCore::NetworkStateNotifier::updateStateSoon): New function which takes
        advantage of the timer to coalesce network state updates.
        (WebCore::NetworkStateNotifier::updateStateWithoutNotifying): Empty stub
        version of this function.
        (WebCore::NetworkStateNotifier::startObserving): Ditto.
        (WebCore::NetworkStateNotifier::notifyNetworkStateChange): Deleted. Code from
        this has moved into updateState.

        * platform/network/NetworkStateNotifier.h: Greatly cut down what part of this
        class is platform-specific.

        * platform/network/ios/NetworkStateNotifierIOS.mm:
        (-[WebNetworkStateObserver initWithBlock:]): Simplified this class so it
        takes a block, rather than using a pointer to the C++ notifier and doing
        WebThreadRun.
        (-[WebNetworkStateObserver dealloc]): Ditto.
        (-[WebNetworkStateObserver networkStateChanged:]): Ditto.
        (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
        This now calls isNetworkReachable.
        (WebCore::NetworkStateNotifier::startObserving): Check the
        Settings::shouldOptOutOfNetworkStateObservation function, and if it's OK
        to observe, then create the observer. This code now takes care of the
        WebThreadRun and calls updateStateSoon.
        (WebCore::NetworkStateNotifier::NetworkStateNotifier): Deleted. The
        constructor is now platform independent.
        (WebCore::NetworkStateNotifier::~NetworkStateNotifier): Deleted. This
        object is never destroyed so we should not write a destructor for it.
        (WebCore::NetworkStateNotifier::registerObserverIfNecessary): Deleted.
        Replaced by startObserving.
        (WebCore::NetworkStateNotifier::onLine): Deleted. This function is now
        platform-independent.
        (WebCore::setOnLine): Deleted. The logic from this is now in
        updateState and updateStateWithoutNotifying.

        * platform/network/mac/NetworkStateNotifierMac.cpp:
        (WebCore::NetworkStateNotifier::updateStateWithoutNotifying): Renamed
        this from updateState and tightened up the code a bit. Also changed
        to not assume anything. If there is an error, we leave m_isOnLine alone.
        Default behavior is now in the platform-independent code, and the default
        is to treat things as on-line if updateStateWithoutNotifying was called
        and it was never able to update the state even once.
        (WebCore::NetworkStateNotifier::startObserving): Moved most of the code
        from the constructor into this function.
        (WebCore::NetworkStateNotifier::dynamicStoreCallback): Deleted. This is
        now a lambda inside startObserving.
        (WebCore::NetworkStateNotifier::networkStateChangeTimerFired): Deleted.
        This function is now platform-independent and is named updateState.

        * platform/network/win/NetworkStateNotifierWin.cpp:
        (WebCore::NetworkStateNotifier::updateStateWithoutNotifying): Renamed
        from updateState and tightened the code up a bit. Also changed
        to not assume anything. If there is an error, we leave m_isOnLine alone.
        Default behavior is now in the platform-independent code, and the default
        is to treat things as on-line if updateStateWithoutNotifying was called
        and it was never able to update the state even once.
        (WebCore::NetworkStateNotifier::addressChanged): Deleted.
        This function is now platform-independent and is named updateState.
        (WebCore::NetworkStateNotifier::addressChangeCallback): Renamed from
        addrChangeCallback. Simplified by using the singleton function instead
        of relying on the context pointer.
        (WebCore::NetworkStateNotifier::startObserving): Moved most of the code
        from the constructor here.

        * platform/text/LocaleToScriptMappingDefault.cpp:
        (WebCore::scriptNameToCode): Use makeNeverDestroyed.
        (WebCore::localeToScriptCodeForFontSelection): Ditto.

        * platform/text/ios/LocalizedDateCache.h: Moved include of
        NeverDestroyed.h from here ...
        * platform/text/ios/LocalizedDateCache.mm: ... to here.

        * platform/wpe/RenderThemeWPE.cpp:
        (WebCore::RenderTheme::singleton): Use a theme that is never destroyed
        rather than Ref that is never destroyed.

        * platform/wpe/RenderThemeWPE.h: Use friend NeverDestroyed rather than
        a create function since RenderTheme is no longer reference counted.

        * rendering/RenderTheme.h: Made RenderTheme no longer reference counted.

        * rendering/RenderThemeGtk.cpp:
        (WebCore::RenderThemeGtk::create): Deleted.
        (WebCore::RenderTheme::singleton): Use a theme that is never destroyed
        rather than Ref that is never destroyed.

        * rendering/RenderThemeGtk.h: Use friend NeverDestroyed rather than
        a create function since RenderTheme is no longer reference counted.
        * rendering/RenderThemeIOS.h: Ditto.

        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::create): Deleted.
        (WebCore::RenderTheme::singleton): Use a theme that is never destroyed
        rather than Ref that is never destroyed.

        * rendering/RenderThemeMac.h: Use friend NeverDestroyed rather than
        a create function since RenderTheme is no longer reference counted.
        Also marked a lot of functions final rather than override and initialized
        data members in the class deifnition.

        * rendering/RenderThemeMac.mm: Moved some SPI interfaces to the top of the
        file. They should really go into SPI headers.
        (-[WebCoreRenderThemeNotificationObserver init]): Removed the theme argument
        here because the theme is a singleton and we don't need a pointer to it.
        Add the observer here instead of doing it in the caller.
        (-[WebCoreRenderThemeNotificationObserver systemColorsDidChange:]): Call
        platformColorsDidChange through the singleton rather than using a pointer.
        (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
        Tightened up the code a bit by using CFAutorelease instead of using a
        combination of NSMakeCollectable, autorelease, and a typecast to accomplish
        the same thing.
        (WebCore::RenderTheme::singleton): Use a theme that is never destroyed
        rather than Ref that is never destroyed.
        (WebCore::RenderThemeMac::create): Deleted.
        (WebCore::RenderThemeMac::RenderThemeMac): Moved initialization into the
        class definition and observing into the WebCoreRenderThemeNotificationObserver
        init function.
        (WebCore::RenderThemeMac::~RenderThemeMac): Deleted. No need for this since
        the object will never be destroyed.
        (WebCore::RenderThemeMac::mediaControlsBase64StringForIconNameAndType):
        Removed an unnecessary conversion from C string literal to WTF::String and
        then to NSString. Instead, just use an NSString literal.

        * rendering/RenderThemeWin.cpp:
        (WebCore::RenderThemeWin::create): Deleted.
        (WebCore::RenderTheme::singleton): Use a theme that is never destroyed
        rather than Ref that is never destroyed.

        * rendering/RenderThemeWin.h: Use friend NeverDestroyed rather than
        a create function since RenderTheme is no longer reference counted.

        * rendering/svg/RenderSVGResource.cpp:
        (WebCore::removeFromCacheAndInvalidateDependencies): Moved a global into
        the code where it is used.

        * svg/SVGAnimatedLength.cpp: Removed unneeded include of NeverDestroyed.h.

        * svg/SVGAnimationElement.cpp:
        (WebCore::SVGAnimationElement::isSupportedAttribute): Use const auto,
        makeNeverDestroyed, a lambda, and the new HashSet::add overload instead of
        an isEmpty check and lots of separate add function calls.
        * svg/SVGClipPathElement.cpp:
        (WebCore::SVGClipPathElement::isSupportedAttribute): Ditto.
        * svg/SVGComponentTransferFunctionElement.cpp:
        (WebCore::SVGComponentTransferFunctionElement::isSupportedAttribute): Ditto.
        * svg/SVGCursorElement.cpp:
        (WebCore::SVGCursorElement::isSupportedAttribute): Ditto.

        * svg/SVGElement.cpp:
        (WebCore::createAttributeNameToCSSPropertyIDMap): Replaced the populate
        function with this create function.
        (WebCore::createAttributeNameToAnimatedPropertyTypeMap): Ditto.
        (WebCore::attributeNameToAnimatedPropertyTypeMap): Changed return type to
        const reference. Use const auto and makeNeverDestroyed instead of using
        isEmpty and a populate function.
        (WebCore::createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap):
        More of the same.
        (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Ditto.
        (WebCore::SVGElement::childShouldCreateRenderer): Use an array instead of
        a HashSet since we are checking against only 3 or 4 values.
        (WebCore::addQualifiedName): Deleted.
        (WebCore::SVGElement::animatableAttributeForName): Use const auto,
        makeNeverDestroyed, and a lambda to efficiently build the map in this function.
        (WebCore::SVGElement::cssPropertyIdForSVGAttributeName): Use const auto and
        makeNeverDestroyed instead of using isEmpty and a populate function.

        * svg/SVGFilterElement.cpp:
        (WebCore::SVGFilterElement::isSupportedAttribute): Use const auto,
        makeNeverDestroyed, a lambda, and the new HashSet::add overload instead of
        an isEmpty check and lots of separate add function calls.
        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
        (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute): Ditto.
        * svg/SVGForeignObjectElement.cpp:
        (WebCore::SVGForeignObjectElement::isSupportedAttribute): Ditto.
        * svg/SVGGElement.cpp:
        (WebCore::SVGGElement::isSupportedAttribute): Ditto.
        * svg/SVGGradientElement.cpp:
        (WebCore::SVGGradientElement::isSupportedAttribute): Ditto.
        * svg/SVGGraphicsElement.cpp:
        (WebCore::SVGGraphicsElement::isSupportedAttribute): Ditto.
        * svg/SVGImageElement.cpp:
        (WebCore::SVGImageElement::isSupportedAttribute): Ditto.
        * svg/SVGLangSpace.cpp:
        (WebCore::addWithAndWithoutXMLPrefix): Added helper. Uses xmlAtom instead
        of making our own NeverDestroyed local xmlPrefix.
        (WebCore::SVGLangSpace::addSupportedAttributes): Rewrote to use helper.
        * svg/SVGLineElement.cpp:
        (WebCore::SVGLineElement::isSupportedAttribute): Use const auto,
        makeNeverDestroyed, a lambda, and the new HashSet::add overload instead of
        an isEmpty check and lots of separate add function calls.
        * svg/SVGLinearGradientElement.cpp:
        (WebCore::SVGLinearGradientElement::isSupportedAttribute): Ditto.
        * svg/SVGMarkerElement.cpp:
        (WebCore::SVGMarkerElement::isSupportedAttribute): Ditto.
        * svg/SVGMaskElement.cpp:
        (WebCore::SVGMaskElement::isSupportedAttribute): Ditto.
        * svg/SVGPathElement.cpp:
        (WebCore::SVGPathElement::isSupportedAttribute): Ditto.
        * svg/SVGPatternElement.cpp:
        (WebCore::SVGPatternElement::isSupportedAttribute): Ditto.
        * svg/SVGRadialGradientElement.cpp:
        (WebCore::SVGRadialGradientElement::isSupportedAttribute): Ditto.
        * svg/SVGTextContentElement.cpp:
        (WebCore::SVGTextContentElement::isSupportedAttribute): Ditto.
        * svg/SVGTextPathElement.cpp:
        (WebCore::SVGTextPathElement::isSupportedAttribute): Ditto.
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::isSupportedAttribute): Ditto.

        * testing/MockContentFilterSettings.h: Removed unneeded include of
        NeverDestroyed.h.

        * testing/MockGamepadProvider.cpp: Moved include of
        NeverDestroyed.h here ...
        * testing/MockGamepadProvider.h: ... from here.

        * testing/MockPreviewLoaderClient.h: Removed unneeded include of
        NeverDestroyed.h.

        * workers/Worker.cpp:
        (WebCore::allWorkers): Changed this from a global to a function.
        (WebCore::Worker::networkStateChanged): Updated for above change and
        made this a member function.
        (WebCore::Worker::Worker): Updated for above change and
        change to NetworkStateNotifier.
        (WebCore::Worker::~Worker): Ditto.
        * workers/Worker.h: Made networkStateChanged a static member instead of
        a friend since that is a cleaner way to give it access to private member
        functions.

        * xml/XPathFunctions.cpp:
        (WebCore::XPath::createFunctionMap): Use create instead of populate style.
        (WebCore::XPath::Function::create): Use const auto and makeNeverDestroyed
        instead of an isEmpty check.

        * xml/XPathParser.cpp:
        (WebCore::XPath::createAxisNamesMap): Use create instead of populate style.
        (WebCore::XPath::parseAxisName): Use const auto and makeNeverDestroyed
        instead of an isEmpty check.

2017-07-17  Brady Eidson  <beidson@apple.com>

        REGRESSION(r219298): imported/w3c/IndexedDB-private-browsing/idbfactory_open.html is crashing occassionaly (UniqueIDBDatabase being taken from the IDBServer set twice).
        <rdar://problem/33294987> and https://bugs.webkit.org/show_bug.cgi?id=174354

        Reviewed by Alex Christensen.

        No new tests (Covered by existing tests).

        * Modules/indexeddb/server/IDBServer.cpp:
        (WebCore::IDBServer::IDBServer::postDatabaseTaskReply): Remove a now invalid ASSERT
        
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose): Add a RELEASE_ASSERT.
        (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore): Instead of an ad-hoc main thread dispatch, use the "schedule task reply" system
          to keep dispatch ordering in tact.
        (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply): Remove a now invalid ASSERT
        (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete): Only take the owning pointer if the object doesn't already own itself.

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

        [iOS DnD] Web process uses too much memory when beginning a drag on a very large image
        https://bugs.webkit.org/show_bug.cgi?id=174585
        <rdar://problem/33302541>

        Reviewed by Tim Horton.

        Currently, attempting to drag a very large image fails, either due to us telling CoreGraphics to create an image
        buffer that is too large, or because the web process exceeds its memory limit and gets jetsamed. There are two
        places where we can optimize our memory use during the drag initialization sequence, and this patch improves
        both.

        First, on iOS, we attempt to encode and send over a WebCore::Image in the PasteboardImage when writing to the
        item providers upon starting a drag. Currently, this Image is only used in the drag and drop codepath, in
        PlatformPasteboard::writeObjectRepresentations, to grab the size of the image being written for the purpose of
        specifying estimated display size. Serializing and deserializing an Image calls into Image::nativeImage, which
        attempts to draw the contents of the image into a buffer so that it can be shipped across to the UI process.
        Instead, we can simply compute the size in the web process while we already have the Image, and simply send that
        across. For copy/paste, this doesn't result in any behavior change, since we don't use the PasteboardImage's
        image in the first place.

        Secondly, when starting a drag, we try to allocate create an image buffer the size of the WebCore::Image for the
        purpose of generating the drag preview. Instead, this patch establishes a limit on the size of this drag preview
        image, such that if the Image's size is larger, we'll scale down the drag preview image to be the maximum
        allowed size.

        Test: DataInteractionTests.CanStartDragOnEnormousImage.

        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::writeImageToPasteboard):
        * platform/Pasteboard.h:
        * platform/graphics/GeometryUtilities.cpp:
        (WebCore::sizeWithAreaAndAspectRatio):

        Introduce a new helper function to compute a size with the given aspect ratio and area.

        * platform/graphics/GeometryUtilities.h:
        * platform/ios/DragImageIOS.mm:
        (WebCore::createDragImageFromImage):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::writeObjectRepresentations):

2017-07-17  Michael Catanzaro  <mcatanzaro@igalia.com>

        [CMake] Include most CMake modules from WebKitCommon.cmake
        https://bugs.webkit.org/show_bug.cgi?id=174546

        Reviewed by Konstantin Tokarev.

        * WebCoreMacros.cmake:

2017-07-17  Michael Catanzaro  <mcatanzaro@igalia.com>

        [CMake] Macros in WebKitMacros.cmake should be prefixed with WEBKIT_ namespace
        https://bugs.webkit.org/show_bug.cgi?id=174547

        Reviewed by Alex Christensen.

        * CMakeLists.txt:
        * WebCoreMacros.cmake:

2017-07-17  Alex Christensen  <achristensen@webkit.org>

        Modernize content extension code
        https://bugs.webkit.org/show_bug.cgi?id=174588

        Reviewed by Sam Weinig.

        No change in behavior.  Just use Ref instead of RefPtr where possible.

        * contentextensions/ContentExtension.cpp:
        (WebCore::ContentExtensions::ContentExtension::create):
        * contentextensions/ContentExtension.h:
        * contentextensions/ContentExtensionsBackend.cpp:
        (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
        (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
        * contentextensions/ContentExtensionsBackend.h:

2017-07-17  Simon Fraser  <simon.fraser@apple.com>

        clientX/clientY on TouchEvent.touches are wrong
        https://bugs.webkit.org/show_bug.cgi?id=174561
        rdar://problem/33336041

        Reviewed by Tim Horton.
        
        Do some refactoring so that WebKitAdditions code that computes Touch coordinates can use
        the same code that MouseRelatedEvent uses.
        
        There is no behavior change in this patch, but the test exercises a behavior change in
        WebKitAdditions code.

        Test: fast/events/touch/ios/touches-client-coords-after-zoom.html

        * dom/MouseRelatedEvent.cpp:
        (WebCore::MouseRelatedEvent::init):
        (WebCore::MouseRelatedEvent::frameViewFromDOMWindow):
        (WebCore::MouseRelatedEvent::pagePointToClientPoint):
        (WebCore::MouseRelatedEvent::pagePointToAbsolutePoint):
        (WebCore::MouseRelatedEvent::initCoordinates):
        (WebCore::MouseRelatedEvent::documentToAbsoluteScaleFactor):
        (WebCore::MouseRelatedEvent::computePageLocation):
        (WebCore::MouseRelatedEvent::locationInRootViewCoordinates):
        (WebCore::MouseRelatedEvent::frameView): Deleted.
        * dom/MouseRelatedEvent.h:

2017-07-17  Jeremy Jones  <jeremyj@apple.com>

        Add video fullscreen transition logging.
        https://bugs.webkit.org/show_bug.cgi?id=174474

        Reviewed by Jer Noble.

        No new tests, because there is no functional change.

        This change just adds logging.

        * html/HTMLVideoElement.cpp:
        (WebCore::HTMLVideoElement::webkitEnterFullscreen):
        (WebCore::HTMLVideoElement::webkitExitFullscreen):
        (WebCore::HTMLVideoElement::webkitSetPresentationMode):

2017-07-17  Chris Dumez  <cdumez@apple.com>

        click event does not dispatch to parent when child target stops hit testing after mousedown
        https://bugs.webkit.org/show_bug.cgi?id=174564
        <rdar://problem/33340234>

        Reviewed by Simon Fraser.

        As per [1], if the mouse down node and the mouse release node differ, then we are supposed to
        fire the click event at their common ancestor, if such node exists. This patch implements this
        logic. This also aligns our behavior with Blink.

        [1] https://w3c.github.io/uievents/#events-mouseevent-event-order

        Test: fast/events/mouse-click-different-mouseDown-mouseUp-nodes.html

        * page/EventHandler.cpp:
        (WebCore::targetNodeForClickEvent):

2017-07-17  Brady Eidson  <beidson@apple.com>

        WKHTTPCookieStore observing only works on the default cookie store.
        <rdar://problem/33330724> and https://bugs.webkit.org/show_bug.cgi?id=174580

        Reviewed by Sam Weinig.

        Covered by new API tests.
        
        startObservingCookieChanges and stopObservingCookieChanges are passed a NetworkStorageSession to observe.
        On Mac/iOS, the passed-in storage session was ignored and the shared cookie storage was assumed.
        Let's fix that.
        
        Also, since using NSNotification based observing only works reliably for the shared cookie storage,
        switch to direct CFHTTPCookieStorageRef observing.

        * WebCore.xcodeproj/project.pbxproj:
        
        * platform/network/NetworkStorageSession.h:
        
        * platform/network/cocoa/CookieStorageObserver.h: Added.
        * platform/network/cocoa/CookieStorageObserver.mm: Added.
        (WebCore::cookiesChanged):
        (WebCore::CookieStorageObserver::create):
        (WebCore::CookieStorageObserver::CookieStorageObserver):
        (WebCore::CookieStorageObserver::~CookieStorageObserver):
        (WebCore::CookieStorageObserver::startObserving):
        (WebCore::CookieStorageObserver::stopObserving):
        (WebCore::CookieStorageObserver::cookiesDidChange):
        
        * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
        (WebCore::NetworkStorageSession::cookieStorageObserver):
        
        * platform/network/mac/CookieStorageMac.mm:
        (WebCore::startObservingCookieChanges):
        (WebCore::stopObservingCookieChanges):
        (-[WebCookieStorageObjCAdapter notifyCookiesChangedOnMainThread]): Deleted.
        (-[WebCookieStorageObjCAdapter cookiesChangedNotificationHandler:]): Deleted.
        (-[WebCookieStorageObjCAdapter startListeningForCookieChangeNotificationsWithCallback:]): Deleted.
        (-[WebCookieStorageObjCAdapter stopListeningForCookieChangeNotifications]): Deleted.
        
        * platform/spi/cf/CFNetworkSPI.h:

2017-07-17  Sam Weinig  <sam@webkit.org>

        [WebIDL] Rename JSCSSValueCustom.cpp to JSDeprecatedCSSOMValueCustom.cpp to match the underlying class
        https://bugs.webkit.org/show_bug.cgi?id=174550

        Reviewed by Brady Eidson.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSCSSValueCustom.cpp: Removed.
        * bindings/js/JSDeprecatedCSSOMValueCustom.cpp: Renamed from bindings/js/JSCSSValueCustom.cpp.
        Rename file and update references.

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

        REGRESSION: order of AirPlay and volume controls is inconsistent between <audio> and <video>
        https://bugs.webkit.org/show_bug.cgi?id=174581
        <rdar://problem/33297519>

        Reviewed by Sam Weinig.

        We had an inconsistency between <audio> and <video> controls for the relative order of the
        volume and AirPlay buttons. The <video> layout was correct (volume first and AirPlay after)
        and the <audio> layout now is the same.

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

2017-07-17  Konstantin Tokarev  <annulen@yandex.ru>

        [CMake] Create targets before WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS is called
        https://bugs.webkit.org/show_bug.cgi?id=174557

        Reviewed by Michael Catanzaro.

        No new tests needed.

        * CMakeLists.txt:

2017-07-17  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, rolling out r219556.

        Broke build without WebCrypto

        Reverted changeset:

        "[CMake] Clean up Web Crypto build targets"
        https://bugs.webkit.org/show_bug.cgi?id=174253
        http://trac.webkit.org/changeset/219556

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

        Media controls draw behind captions
        https://bugs.webkit.org/show_bug.cgi?id=174579
        <rdar://problem/33295427>

        Reviewed by Dean Jackson.

        Ensure the captions container is added as a previous sibling to the controls container.

        Test: media/modern-media-controls/media-controls/media-controls-display-above-captions.html

        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController):

2017-07-17  Zan Dobersek  <zdobersek@igalia.com>

        [CMake] Clean up Web Crypto build targets
        https://bugs.webkit.org/show_bug.cgi?id=174253

        Reviewed by Michael Catanzaro.

        Gather the common WebCrypto source files in CMakeLists.txt, including them
        in the build unconditionally and instead relying on ENABLE_SUBTLE_CRYPTO
        build guards to exclude the code from compilation if the feature is disabled.

        PlatformGTK.cmake, PlatformMac.cmake and PlatformWPE.cmake can then remove
        duplicated build targets. PlatformMac.cmake still lists all the Mac-specific
        Web Crypto build targets.

        PlatformGTK.cmake and PlatformWPE.cmake now include GCrypt.cmake if the build
        was configured to enable the use of libgcrypt. The new CMake file adds the
        libgcrypt-specific Web Crypto build targets to the build if the feature was
        enabled, and also sets up libgcrypt include directiories and libraries.

        No new tests -- no change in behavior.

        * CMakeLists.txt:
        * PlatformGTK.cmake:
        * PlatformMac.cmake:
        * PlatformWPE.cmake:
        * platform/GCrypt.cmake: Added.

2017-07-16  Michael Catanzaro  <mcatanzaro@igalia.com>

        -Wreorder warning caused by GraphicsContext3D cleanup
        https://bugs.webkit.org/show_bug.cgi?id=174511

        Reviewed by Carlos Garcia Campos.

        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
        (WebCore::GraphicsContext3D::GraphicsContext3D):
        * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
        (WebCore::GraphicsContext3D::GraphicsContext3D):

2017-07-16  Antoine Quint  <graouts@apple.com>

        Dismissing the captions panel using the mouse is too eager to remove the captions panel and media controls
        https://bugs.webkit.org/show_bug.cgi?id=174571
        <rdar://problem/33294968>

        Reviewed by Eric Carlson.

        We did several things wrong when dismissing the tracks panel:

            - we did not check whether we were hosted in a shadow root when figuring if a click was on the tracks panel
            - we did not check whether we clicked over the media when dismissing the tracks panel
            - we did not check whether auto-hide was on before fading the media controls out when we clicked outside
              the media controls bounds

        We now correctly account for all of those cases and implement the following behavior when clickng as the tracks
        panel is presented:
        
            - dismiss the panel if the click is outside of the panel
            - dismiss the panel and the media controls if the click is outside the video and the media controls have
              auto-hide on (ie. media is playing)
            - dismiss the panel and the media controls after the track selection animation is finished if a track is selected

        Tests: media/modern-media-controls/tracks-panel/tracks-panel-up-click-outside-media-does-not-dimiss-media-controls-when-media-is-paused.html
               media/modern-media-controls/tracks-panel/tracks-panel-up-click-over-media-does-not-dimiss-media-controls-when-media-is-playing.html

        * Modules/modern-media-controls/controls/media-controls.js:
        (MediaControls.prototype.hideTracksPanel): Only hide the media controls if we clicked outside of the media
        controls bounds and if we have auto-hide on when idle (ie. the media is playing).
        (MediaControls.prototype.isPointInControls): Add an option to specify whether the container should be
        considered when checking if a point is contained within the media controls bounds.
        * Modules/modern-media-controls/controls/tracks-panel.js:
        (TracksPanel.prototype._handleMousedown):
        (TracksPanel.prototype._isPointInTracksPanel): Correctly check whether the element that we started pressing
        on is contained within the tracks panel, accounting for the case where we are presented within a shadow root
        (ie. always when runing inside a Web page).

2017-07-16  Ali Juma  <ajuma@chromium.org>

        DisallowUserAgentShadowContent moves out of non-UA shadow roots
        https://bugs.webkit.org/show_bug.cgi?id=165647

        Reviewed by Ryosuke Niwa.

        Make rect-based hit-testing include nodes in non-UA shadow trees when the
        HitTestRequest has type DisallowUserAgentShadowContent.

        Test: fast/dom/nodesFromRect/nodesFromRect-shadow.html

        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::addNodeToRectBasedTestResult):
        * testing/Internals.cpp:
        (WebCore::Internals::nodesFromRect):
        * testing/Internals.h:

2017-07-16  Antoine Quint  <graouts@apple.com>

        Clicking edges of media control buttons changes visual state of button (pressed) but doesn't execute action
        https://bugs.webkit.org/show_bug.cgi?id=174565
        <rdar://problem/33294833>

        Reviewed by Dean Jackson.

        WebCore doesn't dispatch a "click" event to a parent element when a child that was the original target when
        the "mousedown" occured is no longer hit-testing at the location where the mouse pointer is at when the "mouseup"
        occurs (see webkit.org/b/174564). Since button icons, which are a <picture> element that is a child of the
        <button> element for media controls buttons, shrink to 89% of their size when the ":active" pseudo-class matches,
        clicking on the edges of the media controls buttons would not trigger the expected action.

        Test: media/modern-media-controls/button/button-click-on-edges.html

        * Modules/modern-media-controls/controls/button.css:
        (button > picture):

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

        Make the decision for asynchronously decoding an image be in one place
        https://bugs.webkit.org/show_bug.cgi?id=174479

        Reviewed by Tim Horton.

        Move all the logic of whether a large image should be asynchronously decoded 
        or not be in one place: RenderBoxModelObject::decodingModeForImageDraw().

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::addPendingImageDrawingClient): Fixing unrelated 
        spelling error.
        * platform/RuntimeApplicationChecks.h:
        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
        (WebCore::IOSApplication::isIBooks):
        (WebCore::IOSApplication::isIBooksStorytime):
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::updateFromSettings): Remove reading the setting
        largeImageAsyncDecodingEnabled from this function because it will be read
        by RenderBoxModelObject::decodingModeForImageDraw().
        (WebCore::BitmapImage::dataChanged):
        (WebCore::BitmapImage::draw):
        (WebCore::BitmapImage::shouldAnimate):
        (WebCore::BitmapImage::canAnimate):
        (WebCore::BitmapImage::canUseAsyncDecodingForLargeImages):
        (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages):
        (WebCore::BitmapImage::canDestroyDecodedData):
        (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): Deleted.
        * platform/graphics/BitmapImage.h:
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::canUseAsyncDecoding): It is okay to keep the 
        decoded frame if canUseAsyncDecodingForLargeImages() is true by the setting
        largeImageAsyncDecodingEnabled is false.
        (WebCore::ImageSource::shouldUseAsyncDecoding): Deleted.
        * platform/graphics/ImageSource.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::decodingModeForImageDraw): The plan is to
        add a new Internal settings to force asynchronous image decoding regardless
        of the image size and the settings.
        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
        * rendering/RenderBoxModelObject.h:
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintIntoRect):

2017-07-16  Michael Catanzaro  <mcatanzaro@igalia.com>

        [CMake] Raise minimum CMake requirement
        https://bugs.webkit.org/show_bug.cgi?id=174545

        Reviewed by Konstantin Tokarev.

        * WebCoreMacros.cmake:

2017-07-15  Brady Eidson  <beidson@apple.com>

        Make sure all CFHTTPCookieStorageRefs we create are scheduled.
        <rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513

        Reviewed by Tim Horton.

        * platform/spi/cf/CFNetworkSPI.h:

2017-07-15  Myles C. Maxfield  <mmaxfield@apple.com>

        Rename RenderStyle::fontSize() to RenderStyle::computedFontPixelSize()
        https://bugs.webkit.org/show_bug.cgi?id=174509

        Reviewed by Simon Fraser.

        We have three font size functions:
        - computedFontSize(): returns a float
        - specifiedFontSize(): also returns a float
        - fontSize(): returns the rounded computedFontSize()

        FontDescription uses the convention of labelling rounded values as "pixel",
        so a better name font fontSize() is computedFontPixelSize().

        Also, because font sizes can never be negative, switch the type from an int
        to an unsigned.

        No new tests because there is no behavior change.

        * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
        (getAttributeSetForAccessibilityObject):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::adjustRenderStyle):
        * platform/graphics/FontDescription.h:
        (WebCore::FontDescription::computedPixelSize):
        (WebCore::FontDescription::fontSelectionRequest):
        * rendering/RenderBlock.cpp:
        (WebCore::styleForFirstLetter):
        * rendering/RenderRubyRun.cpp:
        (WebCore::shouldOverhang):
        (WebCore::RenderRubyRun::getOverhang):
        * rendering/RenderRubyText.cpp:
        (WebCore::RenderRubyText::adjustInlineDirectionLineBounds):
        * rendering/RenderThemeGtk.cpp:
        (WebCore::adjustSearchFieldIconStyle):
        (WebCore::paintSearchFieldIcon):
        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::adjustCheckboxStyle):
        (WebCore::RenderThemeIOS::adjustRadioStyle):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::controlSizeForFont):
        (WebCore::RenderThemeMac::controlSizeForSystemFont):
        (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
        (WebCore::RenderThemeMac::popupInternalPaddingBox):
        (WebCore::RenderThemeMac::adjustMenuListButtonStyle):
        * rendering/RenderThemeWin.cpp:
        (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle):
        (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle):
        (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle):
        * rendering/TextDecorationPainter.cpp:
        (WebCore::TextDecorationPainter::paintTextDecoration):
        * rendering/mathml/RenderMathMLRow.cpp:
        (WebCore::RenderMathMLRow::computeLineVerticalStretch):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::computedFontPixelSize):
        (WebCore::RenderStyle::computedLineHeight):
        (WebCore::RenderStyle::fontSize): Deleted.
        * rendering/style/RenderStyle.h:
        * style/InlineTextBoxStyle.cpp:
        (WebCore::visualOverflowForDecorations):
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::resolveElement):
        * svg/SVGLengthContext.cpp:
        (WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS):
        (WebCore::SVGLengthContext::convertValueFromEMSToUserUnits):

2017-07-15  Myles C. Maxfield  <mmaxfield@apple.com>

        line-height: <number> gets visually applied twice when text autosizing is in effect
        https://bugs.webkit.org/show_bug.cgi?id=174536
        <rdar://problem/33338259>

        Reviewed by Simon Fraser.

        StyleBuilderConverter::convertLineHeight() converts line-height: <number> into a
        "percentage" length. Then, when layout needs to know what the computed value of
        line-height is, RenderStyle::computedLineHeight() multiplies this percentage by
        the computed font size.

        With autosizing, the computed font size already incorporates the autosizing
        multiplier, so we shouldn't also incorporate this multiplier into the percentage
        value itself. getComputedStyle()'s lineHeightFromStyle() was compensating for
        this double application by multiplying the percentage by the font-size's specified
        value instead of its computed value, which is incorrect.

        Test: fast/text-autosizing/line-height-number.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::lineHeightFromStyle):
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertLineHeight):

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

        [iOS WK2] Presenting an action sheet on an image map prevents selection UI from updating
        https://bugs.webkit.org/show_bug.cgi?id=174539
        <rdar://problem/33307395>

        Reviewed by Darin Adler.

        Currently, if TextIndicator fails to take a snapshot in TextIndicator::createWithRange, we will enter an
        inconsistent state in the web process where Editor will continue to ignore selection changes until the next time
        Editor::setIgnoreSelectionChanges(false) is called. This causes us to indefinitely defer EditorState updates to
        the UI process, which leads to selection UI appearing unresponsive.

        To fix this, we introduce a new TemporarySelectionChange object to simplify selection changes and/or
        EditorState-update-ignoring behaviors within the scope of a single function. The constructor applies these
        temporary changes, and the destructor reverts them as needed to their prior values.

        This patch only adopts TemporarySelectionChange in order to fix this bug, but future patches will replace the
        remaining places where we temporarily change selection and/or ignore selection with this helper.

        Test: ActionSheetTests.ImageMapDoesNotDestroySelection.

        * editing/Editor.cpp:
        (WebCore::TemporarySelectionChange::TemporarySelectionChange):
        (WebCore::TemporarySelectionChange::~TemporarySelectionChange):
        * editing/Editor.h:
        * editing/FrameSelection.h:
        (WebCore::FrameSelection::isUpdateAppearanceEnabled):
        * page/TextIndicator.cpp:
        (WebCore::TextIndicator::createWithRange):

2017-07-15  Myles C. Maxfield  <mmaxfield@apple.com>

        Clean up line-height and minimumFontSize functions
        https://bugs.webkit.org/show_bug.cgi?id=174535

        Reviewed by Simon Fraser.

        No behavior change.

        No new tests because there is no behavior change.

        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertLineHeight):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::styleForKeyframe):
        (WebCore::StyleResolver::adjustRenderStyle):
        (WebCore::StyleResolver::pseudoStyleRulesForElement):
        (WebCore::StyleResolver::applyMatchedProperties):
        (WebCore::StyleResolver::cascadedPropertiesForRollback):
        (WebCore::StyleResolver::applyProperty):
        (WebCore::StyleResolver::checkForZoomChange):
        (WebCore::StyleResolver::createFilterOperations):
        (WebCore::StyleResolver::CascadedProperties::set):
        (WebCore::StyleResolver::applyCascadedProperties):
        * style/StyleFontSizeFunctions.cpp:
        (WebCore::Style::computedFontSizeFromSpecifiedSize):
        (WebCore::Style::computedFontSizeFromSpecifiedSizeForSVGInlineText):
        (): Deleted.

2017-07-14  Jonathan Bedard  <jbedard@apple.com>

        Add iOS 11 SPI
        https://bugs.webkit.org/show_bug.cgi?id=174430
        <rdar://problem/33269288>

        Reviewed by Tim Horton.

        * WebCore.xcodeproj/project.pbxproj: Add sqlite3SPI.h header.
        * platform/ios/PlatformPasteboardIOS.mm: Move UIKit SPI to UIKitSPI.h.
        * platform/ios/WebItemProviderPasteboard.mm: Ditto.
        * platform/network/cf/FormDataStreamCFNet.cpp: Explicitly define fnfErr and remove
        MacErrors.h header for iOS.
        * platform/spi/cocoa/IOSurfaceSPI.h: IOSurface is no longer SPI in iOS 11.
        * platform/spi/cocoa/PassKitSPI.h: Do not re-define setRequiredShippingContactFields
        and setRequiredBillingContactFields in iOS 11.
        * platform/spi/cocoa/QuartzCoreSPI.h: Added QuartzCoreSPI used in iOS 11.
        * platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI.
        * platform/spi/ios/sqlite3SPI.h: Define required sqlite3 macros.
        * platform/sql/SQLiteFileSystem.cpp: Use sqlite3SPI.h.

2017-07-14  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement CryptoKeyRSA PKCS#8 exports
        https://bugs.webkit.org/show_bug.cgi?id=173697

        Reviewed by Jiewen Tan.

        Implement the PKCS#8 import operation for RSA keys for platforms that use
        libgcrypt.

        In CryptoKeyRSA::exportPkcs8(), we bail early with an invalid access exception if
        this export is not being done for a private key. Otherwise, we start with creating
        the `RSAPrivateKey` ASN.1 structure, writing out '0' under the `version` element
        and then retrieving the modulus, public and private exponent and both primes.
        MPI data for those parameters is written out into corresponding elements in the
        `RSAPrivateKey` structure. We then manually compute values of both exponents and
        the coefficient parameters, using the private exponent's and both primes' MPI
        values. The p and q parameters (i.e. the primes) are switched in libgcrypt,
        deviating from the standard practice, so we have to operate with those two
        accordingly. We eliminate the optional `otherPrimeInfos` attribute on the
        `RSAPrivateKey` structure. Support for this attribute will be added later.

        We then create the `PrivateKeyInfo` ASN.1 structure, and write out '0' under the
        `version` element. The id-rsaEncryption object identifier is written out under
        the `algorithm.algorithm` element. In the future, an object identifier that
        matches this key's algorithm will have to be written out here (id-RSASSA-PSS or
        id-RSAES-OAEP), along with the appropriate parameters structure, but no test in
        WebKit or the web-platform-tests suite covers this detail. For now, a null value
        is written out under the `algorithm.parameters` element.

        Data for the `RSAPrivateKey` structure is retrieved and written out under the
        `privateKey` element.  The optional `attributes` element on the `PrivateKeyInfo`
        structure is eliminated.

        Data that was encoded through the `PrivateKeyInfo` structure is then retrieved
        and returned from the exportPkcs8() method.

        No new tests -- related tests are now passing and are unskipped.

        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
        (WebCore::CryptoKeyRSA::exportPkcs8):

2017-07-14  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement CryptoKeyRSA PKCS#8 imports
        https://bugs.webkit.org/show_bug.cgi?id=173696

        Reviewed by Jiewen Tan.

        Implement the PKCS#8 import operation for RSA keys for platforms that use
        libgcrypt.

        In CryptoKeyRSA::importPkcs8(), the provided key data is decoded against the
        'PrivateKeyInfo` ASN.1 structure. We then validate the `version` element and
        check that the `privateKeyAlgorithm.algorithm` element contains a supported
        object identifier. This check is for now mostly superficial, only ensuring
        that the object identifier is either id-rsaEncryption, id-RSAES-OAEP or
        id-RSASSA-PSS. This has to be further extended to also check the
        id-sha{1,256,384,512}WithRSAEncryption identifiers as well as decoding the
        `privateKeyAlgorithm.parameters` element against a specific ASN.1 structure, if
        necessary (RSASSA-PSS-params or RSAES-OAEP-params), and cross-checking the
        specified digest algorithm with the algorithm that's specified through the main
        object identifier or the structure contained in `privateKeyAlgorithm.parameters`.
        This is avoided for now because no test in WebKit or the web-platform-tests
        suite covers this detail of the specification.

        Data under the `privateKey` element is decoded against the `RSAPrivateKey` ASN.1
        structure, and the `version` element of that structure is validated. We then
        retrieve data from that structure for the modulus, public exponent, private
        exponent, both primes, both exponents and the coefficient parameters, bailing if
        any of them is missing. Because libgcrypt switches the use of p and q parameters,
        deviating from the standard use, we have to recompute the u parameter (the
        coefficient). With that calculated, we're then able to construct the `private-key`
        s-expression, embedding into it all the necessary parameters, and transferring
        the ownership of this object to the new CryptoKeyRSA object that's then returned
        from the importPkcs8() method.

        No new tests -- related tests are now passing and are unskipped.

        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
        (WebCore::CryptoKeyRSA::importPkcs8):

2017-07-14  Chris Dumez  <cdumez@apple.com>

        Possible crash in ~UserGestureIndicator() when on non-main thread
        https://bugs.webkit.org/show_bug.cgi?id=174522
        <rdar://problem/30283071>

        Reviewed by Sam Weinig.

        UserGestureIndicator objects may be constructed / destructed in worker thread
        (e.g. in DOMTimer::fired()). The UserGestureIndicator constructor / destructor
        are supposed to be no-op on non-main threads so that it is safe. However,
        we were mistakenly initializing m_previousToken data member in the constructor
        on background thread, which meant that we could crash later on in the
        UserGestureIndicator destructor when destroying m_previousToken.

        Test: fast/workers/worker-user-gesture.html

        * dom/UserGestureIndicator.cpp:
        (WebCore::currentToken):
        (WebCore::UserGestureIndicator::UserGestureIndicator):

2017-07-14  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219516.

        This caused an API failure on macOS.

        Reverted changeset:

        "Make sure all CFHTTPCookieStorageRefs we create are
        scheduled."
        https://bugs.webkit.org/show_bug.cgi?id=174513
        http://trac.webkit.org/changeset/219516

2017-07-14  Jer Noble  <jer.noble@apple.com>

        Allow clients to override their own hardware media requirements where no fallback media exists.
        https://bugs.webkit.org/show_bug.cgi?id=174426
        <rdar://problem/32537704>

        Reviewed by Eric Carlson.

        Add a new setting which allows clients to specify their own mediaContentTypesRequiringHardwareSupport should be
        ignared in the case where no fallback exists, such as the case of a single <source> element, or setting the src
        attribute directly.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::havePotentialSourceChild):
        (WebCore::HTMLMediaElement::selectNextSourceChild):
        (WebCore::HTMLMediaElement::sourceWasAdded):
        (WebCore::HTMLMediaElement::sourceWasRemoved):
        (WebCore::HTMLMediaElement::mediaPlayerShouldCheckHardwareSupport):
        * html/HTMLMediaElement.h:
        * page/Settings.h:
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::shouldCheckHardwareSupport):
        * platform/graphics/MediaPlayer.h:
        (WebCore::MediaPlayerClient::mediaPlayerShouldCheckHardwareSupport):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus):
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):

2017-07-14  Chris Dumez  <cdumez@apple.com>

        Possible crash under NetworkSocketStream::didFailSocketStream()
        https://bugs.webkit.org/show_bug.cgi?id=174526
        <rdar://problem/32831441>

        Reviewed by Brent Fulgham.

        Call m_client.didFailSocketStream() asynchronously in the constructor as our
        caller (the client) is also being initialized at this point.

        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
        (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):

2017-07-14  Youenn Fablet  <youenn@apple.com>

        WebRTC: silence data not sent for disabled audio track
        https://bugs.webkit.org/show_bug.cgi?id=174456
        <rdar://problem/33284623>

        Reviewed by Eric Carlson.

        Test: webrtc/audio-muted-stats.html
              webrtc/audio-muted-stats2.html

        Adding a timer-based approach to send 10ms of silence every second.
        This is consistent with how muted video tracks are implemented.
        In case the audio track is muted at the time it is added, no silence data is sent.

        * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
        (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
        (WebCore::RealtimeOutgoingAudioSource::initializeConverter):
        (WebCore::RealtimeOutgoingAudioSource::stop):
        (WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
        (WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
        (WebCore::RealtimeOutgoingAudioSource::handleMutedIfNeeded):
        (WebCore::RealtimeOutgoingAudioSource::sendSilence):
        * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:

2017-07-14  Michael Catanzaro  <mcatanzaro@igalia.com>

        [CMake] Unclear distinction between WebKitHelpers and WebKitMacros
        https://bugs.webkit.org/show_bug.cgi?id=153189

        Reviewed by Antonio Gomes.

        * CMakeLists.txt: Include WebCoreMacros.cmake.
        * WebCoreMacros.cmake: Added.

2017-07-14  Jeremy Jones  <jeremyj@apple.com>

        Fix style for name of class alloc function in WebVideoFullscreenInterfaceAVKit.
        https://bugs.webkit.org/show_bug.cgi?id=174476

        Reviewed by Alex Christensen.

        No new tests because no behavior change.

        This is a rename for per style requirements.

        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (allocWebAVPictureInPicturePlayerLayerViewInstance):
        (WebAVPlayerLayerView_pictureInPicturePlayerLayerView):
        (allocWebAVPlayerLayerViewInstance):
        (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
        (getWebAVPictureInPicturePlayerLayerViewClass): Deleted.
        (getWebAVPlayerLayerViewClass): Deleted.

2017-07-14  Jer Noble  <jer.noble@apple.com>

        [MSE] Removing samples when presentation order does not match decode order can cause bad behavior.
        https://bugs.webkit.org/show_bug.cgi?id=174514

        Reviewed by Sam Weinig.

        Test: media/media-source/media-source-remove-decodeorder-crash.html

        Fix the algorithm in removeCodedFrames() so that it's not possible to have a removePresentationStart >
        removePresentationEnd (and also removeDecodeStart > removeDecodeEnd).

        * Modules/mediasource/SampleMap.cpp:
        (WebCore::PresentationOrderSampleMap::findSampleContainingOrAfterPresentationTime):
        (WebCore::PresentationOrderSampleMap::findSampleStartingAfterPresentationTime):
        * Modules/mediasource/SampleMap.h:
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::removeCodedFrames):

2017-07-14  Youenn Fablet  <youenn@apple.com>

        Increase CoreAudio render audio buffer sizes for WebRTC
        https://bugs.webkit.org/show_bug.cgi?id=174508

        Reviewed by Eric Carlson.

        Covered by manually testing audio rendering through WebRTC sites.

        * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
        (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit): Setting audio buffer size equivalent to 20 ms.

2017-07-14  Brady Eidson  <beidson@apple.com>

        Make sure all CFHTTPCookieStorageRefs we create are scheduled.
        <rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513

        Reviewed by Tim Horton.

        * platform/spi/cf/CFNetworkSPI.h:

2017-07-14  Youenn Fablet  <youenn@apple.com>

        Remove CoreAudioCaptureSource speaker configuration
        https://bugs.webkit.org/show_bug.cgi?id=174512

        Reviewed by Eric Carlson.

        Covered by manually testing audio rendering through WebRTC sites.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioSharedUnit::setupAudioUnit):

2017-07-14  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Limit the number of remote video samples queued
        https://bugs.webkit.org/show_bug.cgi?id=174505
        <rdar://problem/33223015>

        Reviewed by Youenn Fablet.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::removeOldSamplesFromPendingQueue): Only
        enqueue a fixed number of frames with invalid or negative decode times.

2017-07-14  Youenn Fablet  <youenn@apple.com>

        Report CoreAudioCaptureSource failure in case shared unit stops working properly
        https://bugs.webkit.org/show_bug.cgi?id=174494

        Reviewed by Eric Carlson.

        Manual test by interrupting an audio capture on Mac.

        This patch adds a timer to CoreAudioSharedUnit.
        In case the capture callback is not called after one second, the shared unit is said to fail.
        Each source is notified that capture is failing.
        This will in turn trigger onend track event so that web pages can remedy capture failure.

        Timer starts with 10 seconds for audio data to start being captured.
        It is then decreased to 2 seconds.

        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::captureFailed):
        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioSharedUnit::CoreAudioSharedUnit):
        (WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
        (WebCore::CoreAudioSharedUnit::startInternal):
        (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
        (WebCore::CoreAudioSharedUnit::stopInternal):

2017-07-14  Jer Noble  <jer.noble@apple.com>

        Adding the 'autoplay' attribute to a media element during a user gesture should remove user gesture restrictions.
        https://bugs.webkit.org/show_bug.cgi?id=174373

        Reviewed by Eric Carlson.

        Test: media/video-add-autoplay-user-gesture.html

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

2017-07-14  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219500.

        The test is consistently failing on iOS simulator.

        Reverted changeset:

        "AX: VoiceOver silent or skipping over time values on media
        player."
        https://bugs.webkit.org/show_bug.cgi?id=174324
        http://trac.webkit.org/changeset/219500

2017-07-14  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] error 'm_compositorTexture': undeclared identifier since Bug 174345
        https://bugs.webkit.org/show_bug.cgi?id=174493

        Reviewed by Alex Christensen.

        Compilation errors are reported by the code using a member
        m_compositorTexture of GraphicsContext3D which exists only if
        USE(COORDINATED_GRAPHICS_THREADED). WinCairo port doesn't use it.

        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
        (WebCore::GraphicsContext3D::GraphicsContext3D):
        Use m_compositorTexture only if USE(COORDINATED_GRAPHICS_THREADED).
        (WebCore::GraphicsContext3D::~GraphicsContext3D): Ditto.
        * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
        (WebCore::GraphicsContext3D::reshapeFBOs):
        Ditto. Fix the wrong indentation level.

2017-07-14  Fujii Hironori  <Hironori.Fujii@sony.com>

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

        Reviewed by Michael Catanzaro.

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

        Test: fast/text/international/vietnamese-nfd.html

        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
        (WebCore::HarfBuzzShaper::HarfBuzzShaper):
        Call setNormalizedBuffer instead of normalizeCharacters.
        (WebCore::normalizeCharacters): Deleted.

2017-07-14  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] Build broken "Cannot open include file: 'GL/glext.h'" since Bug 172104
        https://bugs.webkit.org/show_bug.cgi?id=174492

        Reviewed by Žan Doberšek.

        WinCairo port uses GLES. OpenGLShims.h shouldn't be included.

        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
        Include "OpenGLShims.h" only if !USE(OPENGL_ES_2) instead of USE(OPENGL).

2017-07-14  Chris Dumez  <cdumez@apple.com>

        PageCache::removeAllItemsForPage(Page&) may reenter itself and cause crashes
        https://bugs.webkit.org/show_bug.cgi?id=174473
        <rdar://problem/32177485>

        Reviewed by Antti Koivisto.

        This could happen when a Page containing an SVGImage is removed from PageCache and
        this resulted in the destruction of the SVGImage. Because the SVGImage has an internal
        utility Page, it will also call PageCache::removeAllItemsForPage(WebCore::Page&) upon
        destruction, causing us to reenter.

        Address the issue by not calling PageCache::removeAllItemsForPage() for utility pages
        since those cannot be in PageCache in the first place.

        Also add assertions to make sure:
        1. We never insert a utility page into PageCache
        2. PageCache::removeAllItemsForPage() does not reenter

        No new tests, because I was unable to write a test which reproduced the crash. This
        is in theory testable using an API test which enables PageCache, loads a page
        containing an SVGImage, navigates away from this page so that it goes into PageCache,
        and then calls [WebView _close]. However, when I tried writing such test, I could
        not get the SVGImage to get destroyed while PageCache::removeAllItemsForPage() is
        called for the top-level page for some reason. Something seems to be keeping the
        SVGImage alive longer. I tried disabling the MemoryCache but it did not help.

        * history/PageCache.cpp:
        (WebCore::PageCache::addIfCacheable):
        (WebCore::PageCache::removeAllItemsForPage):
        * history/PageCache.h:
        * page/Page.cpp:
        (WebCore::Page::~Page):

2017-07-14  Aaron Chu  <aaron_chu@apple.com>

        AX: VoiceOver silent or skipping over time values on media player.
        https://bugs.webkit.org/show_bug.cgi?id=174324
        <rdar://problem/32021784>

        Reviewed by Antoine Quint.

        Added role attribute to modern media controls time lable class so that VoiceOver can access the time label when the media is playing.

        Updated: media/modern-media-controls/time-label/time-label.html

        * Modules/modern-media-controls/controls/time-label.js:

2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>

        Fix compiler warnings when building with GCC 7
        https://bugs.webkit.org/show_bug.cgi?id=174463

        Reviewed by Darin Adler.

        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::setShouldManageAudioSessionCategory):

2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>

        Incorrect call to StyledElement::setInlineStyleProperty in ImageDocument::createDocumentStructure
        https://bugs.webkit.org/show_bug.cgi?id=174470

        Reviewed by Darin Adler.

        * html/ImageDocument.cpp:
        (WebCore::ImageDocument::createDocumentStructure):

2017-07-13  Dean Jackson  <dino@apple.com>

        Fix iOS build.

        * platform/graphics/GraphicsContext3D.h:

2017-07-12  Dean Jackson  <dino@apple.com>

        Rename GraphicsContext[3D]Mac to Cocoa and move things into graphics/cocoa
        https://bugs.webkit.org/show_bug.cgi?id=174453
        <rdar://problem/33281481>

        Reviewed by Simon Fraser.

        Two renames, two moves:
        graphics/mac/GraphicsContext3DMac.mm -> graphics/cocoa/GraphicsContext3DCocoa.mm
        graphics/mac/GraphicsContext.mm -> graphics/cocoa/GraphicsContextCocoa.mm
        graphics/mac/WebGLLayer.h -> graphics/cocoa/WebGLLayer.h
        graphics/mac/WebGLLayer.mm -> graphics/cocoa/WebGLLayer.mm

        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm: Renamed from Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm.
        * platform/graphics/cocoa/GraphicsContextCocoa.mm: Renamed from Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm.
        * platform/graphics/cocoa/WebGLLayer.h: Renamed from Source/WebCore/platform/graphics/mac/WebGLLayer.h.
        * platform/graphics/cocoa/WebGLLayer.mm: Renamed from Source/WebCore/platform/graphics/mac/WebGLLayer.mm.

2017-07-12  Dean Jackson  <dino@apple.com>

        Clean-up some things in GraphicsContext3D
        https://bugs.webkit.org/show_bug.cgi?id=174452
        <rdar://problem/33281257>

        Reviewed by Simon Fraser.

        General clean-up in GC3D.

        Covered by existing tests.

        * platform/graphics/GraphicsContext3D.h: Use initial values where possible.
        (WebCore::GraphicsContext3D::GraphicsContext3DState::GraphicsContext3DState): Deleted.
        * platform/graphics/mac/GraphicsContext3DMac.mm:
        (WebCore::GraphicsContext3D::GraphicsContext3D): Nearly everything can come from the
        initial values now.
        (WebCore::GraphicsContext3D::~GraphicsContext3D): Remove code that won't be enabled
        on this platform.
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): While unlikely to happen,
        and possibly harmless in this case, add some checked arithmetic to make sure we don't overflow
        when working out how big a buffer to create.
        (WebCore::GraphicsContext3D::paintRenderingResultsToImageData): Ditto.
        (WebCore::GraphicsContext3D::reshape): Do nothing if we are ever given negative
        width or height. Again unlikely.

2017-07-13  Dean Jackson  <dino@apple.com>

        Avoid unnecessary copy of framebuffer into WebGL Layer
        https://bugs.webkit.org/show_bug.cgi?id=174345
        <rdar://problem/33228950>

        Reviewed by Sam Weinig.

        On macOS, we're unnecessarily copying the framebuffer into another
        texture before pushing it into the compositing layer. Instead we
        should simply render the FBO into the CALayer we use to draw on
        the screen.

        Covered by the existing WebGL tests.

        * platform/graphics/GraphicsContext3D.h:
        (WebCore::GraphicsContext3D::platformTexture): Return the FBO texture instead.
        * platform/graphics/mac/GraphicsContext3DMac.mm:
        (WebCore::GraphicsContext3D::GraphicsContext3D): No need to have a compositing
        texture.
        (WebCore::GraphicsContext3D::~GraphicsContext3D):
        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
        (WebCore::GraphicsContext3D::reshapeFBOs):
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::prepareTexture): Don't copy the pixels from
        the FBO into the compositing texture

2017-07-13  Mark Lam  <mark.lam@apple.com>

        Implementors of memoryCost() need to be thread-safe.
        https://bugs.webkit.org/show_bug.cgi?id=172738
        <rdar://problem/32474881>

        Reviewed by Keith Miller.

        No new tests. This patch fixes a race condition bug that can result in random
        crashes (and other unpredictable behavior), and is very difficult to test for.

        * Modules/webaudio/AudioBuffer.cpp:
        (WebCore::AudioBuffer::releaseMemory):
        (WebCore::AudioBuffer::memoryCost):
        * Modules/webaudio/AudioBuffer.h:
        * dom/ChildNodeList.h:
        * dom/CollectionIndexCache.h:
        (WebCore::CollectionIndexCache::memoryCost):
        * dom/LiveNodeList.h:
        * html/CachedHTMLCollection.h:
        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::memoryCost):
        (WebCore::HTMLCanvasElement::externalMemoryCost):
        (WebCore::HTMLCanvasElement::setImageBuffer):
        * html/HTMLCanvasElement.h:
        * html/HTMLCollection.cpp:
        (WebCore::HTMLCollection::invalidateNamedElementCache):
        * html/HTMLCollection.h:
        (WebCore::CollectionNamedElementCache::memoryCost):
        (WebCore::HTMLCollection::memoryCost):
        (WebCore::HTMLCollection::setNamedItemCache):
        * platform/graphics/ImageBuffer.cpp:
        (WebCore::ImageBuffer::memoryCost):
        * platform/graphics/cg/ImageBufferCG.cpp:
        (WebCore::ImageBuffer::memoryCost):
        (WebCore::ImageBuffer::externalMemoryCost):

2017-07-13  Jeremy Jones  <jeremyj@apple.com>

        Fix style. Use #pragma once in VideoFullscreen and PlaybackSession headers.
        https://bugs.webkit.org/show_bug.cgi?id=174448

        Reviewed by Eric Carlson.

        No behavior change.

        * platform/cocoa/WebPlaybackSessionInterface.h:
        * platform/cocoa/WebVideoFullscreenChangeObserver.h:
        * platform/cocoa/WebVideoFullscreenModel.h:
        * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
        * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
        * platform/ios/WebVideoFullscreenControllerAVKit.h:
        * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
        * platform/mac/WebVideoFullscreenInterfaceMac.h:

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

        Deleting last URLSearchParams key should remove trailing ? in associated URL
        https://bugs.webkit.org/show_bug.cgi?id=174465

        Reviewed by Chris Dumez.

        This makes us match the behavior of Chrome and Firefox, and the spec after https://github.com/whatwg/url/issues/332 is approved.
        This will be covered by an upcoming web platform test, and I updated fast/dom/DOMURL/searchparams.html to cover it now.

        * platform/URLParser.cpp:
        (WebCore::URLParser::serialize):
        If there are no tuples, serialize to the null string instead of a non-null empty string.
        This makes it so URL::setQuery removes the ?

2017-07-13  Jeremy Jones  <jeremyj@apple.com>

        Style fix. Replace strongThis with protectedThis.
        https://bugs.webkit.org/show_bug.cgi?id=174444

        Reviewed by Eric Carlson.

        Rename, no behavior change.

        * Modules/webaudio/AudioScheduledSourceNode.cpp:
        (WebCore::AudioScheduledSourceNode::finish):
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaData):
        (WebCore::WebCoreDecompressionSession::enqueueSample):
        (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
        (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
        (WebCore::WebCoreDecompressionSession::requestMediaDataWhenReady):
        (WebCore::WebCoreDecompressionSession::flush):

2017-07-13  Jeremy Jones  <jeremyj@apple.com>

        Fix block style in WebVideoFullscreen classes.
        https://bugs.webkit.org/show_bug.cgi?id=174446

        Reviewed by Eric Carlson.

        No behavior change.

        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        (WebVideoFullscreenControllerContext::setVideoLayerFrame):
        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (-[WebAVPlayerLayer layoutSublayers]):
        (getWebAVPictureInPicturePlayerLayerViewClass):
        (getWebAVPlayerLayerViewClass):

2017-07-13  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Remove unused and untested Page domain commands
        https://bugs.webkit.org/show_bug.cgi?id=174429

        Reviewed by Timothy Hatcher.

        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::disable):
        (WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
        (WebCore::InspectorPageAgent::addScriptToEvaluateOnLoad): Deleted.
        (WebCore::InspectorPageAgent::removeScriptToEvaluateOnLoad): Deleted.
        * inspector/InspectorPageAgent.h:

2017-07-13  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement CryptoKeyRSA SPKI exports
        https://bugs.webkit.org/show_bug.cgi?id=173695

        Reviewed by Jiewen Tan.

        Implement the SPKI export operation for RSA keys for platforms that use
        libgcrypt.

        In CryptoKeyRSA::exportSpki(), we bail early with an invalid access exception if
        this export is not being done for a public key. Otherwise, we start with creating
        the `RSAPublicKey` ASN.1 structure, filling in the modulus and public exponent
        data that's retrieved from the `public-key` s-expression in the signed MPI format.

        We then create the `SubjectPublicKeyInfo` ASN.1 structure and fill it out with
        the necessary data. The id-rsaEncryption object identifier is written out under
        the `algorithm.algorithm` element, and a null value is written out under the
        `algorithm.parameters` element. This doesn't follow the specification at the
        moment, since id-RSASSA-PSS would have to be written for the RSA-PSS algorithm,
        and id-RSAES-OAEP for the RSA-OAEP algorithm, along with specific parameter
        structures. But no test in WebKit or the web-platform-tests suite covers this,
        so this deviation should be addressed later.

        Data of the previously-constructed `RSAPublicKey` structure is retrieved and
        written out under the `subjectPublicKey` element, before finally retrieving
        data of the `SubjectPublicKeyInfo` structure and returning that to the caller.

        A helper mpiSignedData() function is added, providing overloads for gcry_mpi_t
        and gcry_sexp_t parameters. MPI data for that parameter is retrieved and the
        first byte of that data is tested, inserting an additional 0x00 byte at the
        beginning of the Vector if that first byte has the first bit set, avoiding this
        data accidentally being interpreted as a signed integer.

        No new tests -- related tests are now passing and are unskipped.

        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
        (WebCore::CryptoKeyRSA::exportSpki):
        * crypto/gcrypt/GCryptUtilities.h:
        (WebCore::mpiSignedData):

2017-07-13  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement CryptoKeyRSA SPKI imports
        https://bugs.webkit.org/show_bug.cgi?id=173694

        Reviewed by Jiewen Tan.

        Implement the SPKI import operation for RSA keys for platforms that use
        libgcrypt.

        The passed-in key data is decoded against the `SubjectPublicKeyInfo` ASN.1
        structure. We then validate the `algorithm.algorithm` element, ensuring that
        the value under that represents a supported object identifier. This check is
        for now mostly superficial, only ensuring that the object identifier is either
        id-rsaEncryption, id-RSAES-OAEP or id-RSASSA-PSS. This has to be further extended
        to also check the id-sha{1,256,384,512}WithRSAEncryption identifiers as well as
        decoding the `algorithm.parameters` element against a specific ASN.1 structure,
        if necessary (RSASSA-PSS-params or RSAES-OAEP-params), and cross-checking the
        specified digest algorithm with the algorithm that's specified through the main
        object identifier or the structure contained in `algorithm.parameters`. This is
        avoided for now because no test in WebKit or the web-platform-tests suite covers
        this detail of the specification.

        After the algorithm is identified as supported, we proceed with decoding the
        `subjectPublicKey` data against the `RSAPublicKey` ASN.1 structure. From there,
        we retrieve the `modulus` and `publicExponent` data from which we can construct
        an RSA `public-key` s-expression that can be used through libgcrypt. A new
        CryptoKeyRSA object is then created, taking over ownership of the `public-key`
        s-expression, and returned.

        No new tests -- related tests are now passing and are unskipped.

        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
        (WebCore::supportedAlgorithmIdentifier):
        (WebCore::CryptoKeyRSA::importSpki):

2017-07-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        REGRESSION(r219332): [GTK] 9 new failures on fast/forms spinbutton related tests
        https://bugs.webkit.org/show_bug.cgi?id=174395

        Reviewed by Carlos Garcia Campos.

        Covered by existing tests.

        Before r219332 the height of the spin button widget was
        calculated as the maximum value between the individual button
        ( the [+] or [-] ) width (33 pixels) and height (16 pixels).
        And r219332 caused the height of the widget to be calculated as
        the height of the button (16 pixels), which was incorrect as
        each button should be first expanded vertically to fit the
        preferred size of the widget.

        Fix this by making the calculations about the spin button widget
        on a new function spinButtonSize() that takes this into account,
        and use this values both for adjusting the style of the input
        field and the spin button widget itself.

        * rendering/RenderThemeGtk.cpp:
        (WebCore::spinButtonSize):
        (WebCore::RenderThemeGtk::adjustTextFieldStyle):
        (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):

2017-07-13  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE] border-radius with non visible border doesn't work on images that have their own RenderLayer
        https://bugs.webkit.org/show_bug.cgi?id=174157

        Reviewed by Carlos Garcia Campos.

        Do not allow direct compositing of images when they have a border-radius property on WebKitGTK+ and WPE.
        These platforms don't support clipping using rounded rectangles during composition, which is required
        when using border-radius and the border is not visible. Due to this, they need to perform the clippping
        with cairo.

        This is a temporal fix, until appropriate clipping is implemented in the TextureMapper.

        No new tests.

        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::isDirectlyCompositedImage):

2017-07-13  Chris Fleizach  <cfleizach@apple.com>

        AX: WebView crashes app after opening VoiceOver context box menu from modal dialog
        https://bugs.webkit.org/show_bug.cgi?id=163999
        <rdar://problem/28949013>

        Reviewed by Joanmarie Diggs.

        Protect when m_object goes away.

        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):

2017-07-12  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Async image decoding for large images should be disabled by default
        https://bugs.webkit.org/show_bug.cgi?id=174432

        Reviewed by Simon Fraser.

        -- Rename GraphicsLayerPaintFlags::Snapshotting to AllowAsyncImageDecoding.
        -- Replace every reference to GraphicsLayerPaintFlags::Snapshotting by
           GraphicsLayerPaintFlags::None and every GraphicsLayerPaintFlags::None
           by AllowAsyncImageDecoding.
        -- Rename PaintBehaviorSnapshotting to PaintBehaviorAllowAsyncImageDecoding.
        -- Propagate PaintBehaviorAllowAsyncImageDecoding from a parent view to 
           a child view instead of propagating PaintBehaviorSnapshotting.
        -- Remove setting the bit PaintBehaviorSnapshotting in any new PaintBehavoir.
        -- Replace setting the bit PaintBehaviorSnapshotting in an existing PaintBehavoir
           by resetting the bit PaintBehaviorAllowAsyncImageDecoding.

        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
        * page/FrameView.cpp:
        (WebCore::FrameView::willPaintContents):
        (WebCore::FrameView::paintContentsForSnapshot):
        * platform/graphics/GraphicsLayer.h:
        * platform/graphics/GraphicsLayerClient.h:
        * platform/graphics/mac/WebLayer.mm:
        (-[WebLayer drawInContext:]):
        (-[WebSimpleLayer drawInContext:]):
        * rendering/PaintPhase.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::decodingModeForImageDraw):
        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
        * rendering/RenderBoxModelObject.h:
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintIntoRect):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paintLayerContents):
        (WebCore::RenderLayer::paintForegroundForFragments):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::paintContents):
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::paintContents): We need to propagate the 
        PaintBehaviorAllowAsyncImageDecoding from RenderWidget to the FrameView.
        We did not need to do that for PaintBehaviorSnapshotting because 
        FrameView was setting it in its m_paintBehavior if (document->printing())
        in FrameView::willPaintContents().

2017-07-12  Timothy Hatcher  <timothy@hatcher.name>

        REGRESSION(r219391): Broke the USE(OPENGL_ES_2) build
        https://bugs.webkit.org/show_bug.cgi?id=174442

        Unreviewed build fix.

        * platform/graphics/egl/GLContextEGL.cpp: Fix typo of OPENGL_ES2.

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

        Recreate the AudioUnit when restarting capture
        https://bugs.webkit.org/show_bug.cgi?id=174439

        Reviewed by Jer Noble.

        Sometimes other applications in the system like FaceTime may make the audio unit not functional.
        Reloading the tab capturing audio will trigger a call to stop the audio shared unit.
        When the tab requests again audio, the shared unit will restart.
        At that time, the AudioUnit shared unit will be fully recreated.

        Manually tested by doing a webrtc call and then doing a FaceTime call.
        Remote WebRTC endpoints may not receive any audio.
        With the patch, reloading the web page will get back the audio.
        Previously, restarting the UIProcess was the only way.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioSharedUnit::startProducingData): Cleaning the audio unit when starting to produce data if there is a preexisting audio unit.

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

        Accessing localDescription, remoteDescription, etc. after setTimeout raises EXC_BAD_ACCESS
        https://bugs.webkit.org/show_bug.cgi?id=174323
        <rdar://problem/33267876>

        Reviewed by Eric Carlson.

        Test: webrtc/calling-peerconnection-once-closed.html

        In case the libwebrtc backend is null, we should not use it to get description from it.
        Return null in that case.

        Adding ASSERT to other calls where the layer above LibWebRTCMediaEndpoint should protect
        from calling a function on a null libwebrtc backend.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::currentLocalDescription):
        (WebCore::LibWebRTCMediaEndpoint::currentRemoteDescription):
        (WebCore::LibWebRTCMediaEndpoint::pendingLocalDescription):
        (WebCore::LibWebRTCMediaEndpoint::pendingRemoteDescription):
        (WebCore::LibWebRTCMediaEndpoint::localDescription):
        (WebCore::LibWebRTCMediaEndpoint::remoteDescription):
        (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
        (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
        (WebCore::LibWebRTCMediaEndpoint::addTrack):
        (WebCore::LibWebRTCMediaEndpoint::removeTrack):
        (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
        (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
        (WebCore::LibWebRTCMediaEndpoint::createDataChannel):

2017-07-12  Commit Queue  <commit-queue@webkit.org>

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

        "Can cause infinite recursion on iOS" (Requested by mlam on
        #webkit).

        Reverted changeset:

        "WTF::Thread should have the threads stack bounds."
        https://bugs.webkit.org/show_bug.cgi?id=173975
        http://trac.webkit.org/changeset/219176

2017-07-12  Nan Wang  <n_wang@apple.com>

        AX: [iOS] Implement a way to retrieve a text marker range with desired text that is closest to a position
        https://bugs.webkit.org/show_bug.cgi?id=174393
        <rdar://problem/33248006>

        Reviewed by Chris Fleizach.

        Used the existing findClosestPlainText function to search the range on iOS.
        Also exposed a function on the iOS wrapper to return the selection rects of
        the result range from the searching. 

        Test: accessibility/ios-simulator/text-marker-range-matches-text.html

        * accessibility/AXObjectCache.cpp:
        (WebCore::visiblePositionForPositionWithOffset):
        (WebCore::AXObjectCache::rangeMatchesTextNearRange):
        * accessibility/AXObjectCache.h:
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper rangeFromMarkers:withText:]):
        (-[WebAccessibilityObjectWrapper textMarkerRangeFromMarkers:withText:]):
        (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]):
        (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):

2017-07-12  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219409.

        The revision caused the Windows builds to fail.

        Reverted changeset:

        "AX: [iOS] Implement a way to retrieve a text marker range
        with desired text that is closest to a position"
        https://bugs.webkit.org/show_bug.cgi?id=174393
        http://trac.webkit.org/changeset/219409

2017-07-12  Alicia Boya García  <aboya@igalia.com>

        [FreeType] Enable BCI on webfonts
        https://bugs.webkit.org/show_bug.cgi?id=174403

        Reviewed by Michael Catanzaro.

        The FreeType BCI hinter used to be disabled on webfonts in favor of
        the autohinter.

        FreeType BCI hinter has improved considerably in the past and now most
        other browsers enable it too. Given the old reasons no longer apply,
        the BCI has now been enabled in order to get better text rendering when
        embedded hints are available.

        * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
        (WebCore::FontCustomPlatformData::FontCustomPlatformData):

2017-07-12  Commit Queue  <commit-queue@webkit.org>

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

        Huge PLUM memory regression on iOS (Requested by kling on
        #webkit).

        Reverted changeset:

        "[WebIDL] Convert MutationCallback to be a normal generate
        callback"
        https://bugs.webkit.org/show_bug.cgi?id=174140
        http://trac.webkit.org/changeset/219361

2017-07-12  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] a capture source failure should end the MediaStreamTrack
        https://bugs.webkit.org/show_bug.cgi?id=174375

        Reviewed by Youenn Fablet.

        Test: fast/mediastream/media-stream-track-source-failure.html

        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::captureFailed): New, signal observers that the source has ended.
        * platform/mediastream/RealtimeMediaSource.h:

        * platform/mediastream/mac/AVMediaCaptureSource.h:
        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        (WebCore::AVMediaCaptureSource::setupSession): Call captureFailed if setupCaptureSession fails.

        * platform/mediastream/mac/AVVideoCaptureSource.h:
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::setupCaptureSession): Return false on failure.
        (WebCore::AVVideoCaptureSource::shutdownCaptureSession): Delete unused instance variable.
        (WebCore::AVVideoCaptureSource::processNewFrame): Ditto.

        * testing/Internals.cpp:
        (WebCore::Internals::endMediaStreamTrackCaptureSource): Call track.source.captureFailed().
        * testing/Internals.h:
        * testing/Internals.idl:

2017-07-12  Timothy Hatcher  <timothy@hatcher.name>

        Improve font matching with FontConfig and FreeType
        https://bugs.webkit.org/show_bug.cgi?id=174374

        Reviewed by Michael Catanzaro.

        * platform/graphics/freetype/FontCacheFreeType.cpp:
        (WebCore::FontCache::createFontPlatformData): Loop through all family name matches from FcFontMatch.

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

        Reactivate audio ducking when restarting the shared unit
        https://bugs.webkit.org/show_bug.cgi?id=174428

        Reviewed by Eric Carlson.

        Currently, when another application ducks WebKit, there is no other way than to quit the UIProcess and restart it.
        By again audio ducking when starting the audio unit, reloading the page will be enough.
        Testing by launching a tab with audio capture and audio playing.
        Then make a FaceTime call and hear the tab volume go down.
        End the call to FaceTime and the tab volume remains low.
        Reload the tab and the volume has a normal level.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioSharedUnit::setupAudioUnit):
        (WebCore::CoreAudioSharedUnit::startInternal):

2017-07-12  Antoine Quint  <graouts@apple.com>

        Playback controls should not hide while AirPlay is active
        https://bugs.webkit.org/show_bug.cgi?id=174422
        <rdar://problem/33011477>

        Reviewed by Eric Carlson.

        We now also track changes in AirPlay playback status and account for it when identifying whether we
        ought to let media controls automatically hide, which should only happen if the media is playing and
        not playing back through AirPlay.

        * Modules/modern-media-controls/media/controls-visibility-support.js:
        (ControlsVisibilitySupport.prototype.get mediaEvents):
        (ControlsVisibilitySupport.prototype._updateControls):
        (ControlsVisibilitySupport):

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

        Attempt to fix the build following <https://trac.webkit.org/changeset/219407>
        (https://bugs.webkit.org/show_bug.cgi?id=174386)

        Fix bad merge after <https://trac.webkit.org/changeset/219404>.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadURL):
        (WebCore::FrameLoader::loadWithNavigationAction):
        (WebCore::FrameLoader::loadPostRequest):
        (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
        (WebCore::FrameLoader::loadDifferentDocumentItem):
        * loader/FrameLoader.h:

2017-07-12  Nan Wang  <n_wang@apple.com>

        AX: [iOS] Implement a way to retrieve a text marker range with desired text that is closest to a position
        https://bugs.webkit.org/show_bug.cgi?id=174393
        <rdar://problem/33248006>

        Reviewed by Chris Fleizach.

        Used the existing findClosestPlainText function to search the range on iOS.
        Also exposed a function on the iOS wrapper to return the selection rects of
        the result range from the searching. 

        Test: accessibility/ios-simulator/text-marker-range-matches-text.html

        * accessibility/AXObjectCache.cpp:
        (WebCore::visiblePositionForPositionWithOffset):
        (WebCore::AXObjectCache::rangeMatchesTextNearRange):
        * accessibility/AXObjectCache.h:
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper rangeFromMarkers:withText:]):
        (-[WebAccessibilityObjectWrapper textMarkerRangeFromMarkers:withText:]):
        (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]):
        (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):

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

        NavigationAction should track whether the navigation was initiated by the main frame
        https://bugs.webkit.org/show_bug.cgi?id=174386
        <rdar://problem/33245267>

        Reviewed by Brady Eidson.

        Although we added state to NavigationAction to track whether the navigation was
        initiated by the main frame in r219170 it is not possible to initialize this state
        when instantiating a NavigationAction. Having NavigationAction track this state
        will be useful to ensure that we can always compute the source frame information
        when asking the embedding client whether to allow a navigation. We will make use
        of it in the fix for <https://bugs.webkit.org/show_bug.cgi?id=174385>.

        No behavior changed. So, no new tests.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadURL): Pass whether the load was initiated by the main frame
        when instantiating the NavigationAction.
        (WebCore::FrameLoader::load): For now, pass InitiatedByMainFrame::Unknown when instantiating
        the NavigationAction as we do not know if the load was initiated by the main frame.
        (WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
        (WebCore::FrameLoader::reload): Ditto
        (WebCore::FrameLoader::loadDifferentDocumentItem): Ditto.
        (WebCore::createWindow): Pass whether the load was initiated by the main frame when
        instantiating the NavigationAction.
        * loader/NavigationAction.cpp:
        (WebCore::NavigationAction::NavigationAction): Modified to take argument of type InitiatedByMainFrame
        that indicates whether the navigation was initiated by the main frame.
        * loader/NavigationAction.h:
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNavigationPolicy): For now, pass InitiatedByMainFrame::Unknown
        when instantiating the NavigationAction as we do not know if the load was initiated by the
        main frame.
        * page/ContextMenuController.cpp:
        (WebCore::openNewWindow): Pass whether the load was initiated by the main frame when
        instantiating the NavigationAction.

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

        Rename NavigationInitiatedByMainFrame to InitiatedByMainFrame
        https://bugs.webkit.org/show_bug.cgi?id=174427

        Rubber-stamped by Brady Eidson.

        * inspector/InspectorFrontendClientLocal.cpp:
        (WebCore::InspectorFrontendClientLocal::openInNewTab):
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::navigate):
        * loader/FrameLoadRequest.cpp:
        (WebCore::FrameLoadRequest::FrameLoadRequest):
        * loader/FrameLoadRequest.h:
        (WebCore::FrameLoadRequest::FrameLoadRequest):
        (WebCore::FrameLoadRequest::initiatedByMainFrame):
        (WebCore::FrameLoadRequest::navigationInitiatedByMainFrame): Deleted.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::urlSelected):
        (WebCore::FrameLoader::loadURLIntoChildFrame):
        (WebCore::shouldOpenExternalURLsPolicyToApply):
        (WebCore::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
        (WebCore::FrameLoader::loadURL):
        (WebCore::FrameLoader::loadWithNavigationAction):
        (WebCore::FrameLoader::reloadWithOverrideEncoding):
        (WebCore::FrameLoader::reload):
        (WebCore::FrameLoader::loadPostRequest):
        (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
        (WebCore::FrameLoader::loadDifferentDocumentItem):
        * loader/FrameLoader.h:
        * loader/FrameLoaderTypes.h:
        * loader/NavigationAction.h:
        (WebCore::NavigationAction::initiatedByMainFrame):
        (WebCore::NavigationAction::navigationInitiatedByMainFrame): Deleted.
        * loader/NavigationScheduler.cpp:
        (WebCore::ScheduledNavigation::ScheduledNavigation):
        (WebCore::ScheduledNavigation::initiatedByMainFrame):
        (WebCore::NavigationScheduler::scheduleLocationChange):
        (WebCore::ScheduledNavigation::navigationInitiatedByMainFrame): Deleted.
        * page/ContextMenuController.cpp:
        (WebCore::openNewWindow):
        (WebCore::ContextMenuController::contextMenuItemSelected):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::createWindow):

2017-07-12  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219401.

        This revision rolled out the previous patch, but after talking
        with reviewer, a rebaseline is what was needed.Rolling back in
        before rebaseline.

        Reverted changeset:

        "Unreviewed, rolling out r219379."
        https://bugs.webkit.org/show_bug.cgi?id=174400
        http://trac.webkit.org/changeset/219401

2017-07-12  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219379.

        This revision caused a consistent failure in the test
        fast/dom/Window/property-access-on-cached-window-after-frame-
        removed.html.

        Reverted changeset:

        "Remove NAVIGATOR_HWCONCURRENCY"
        https://bugs.webkit.org/show_bug.cgi?id=174400
        http://trac.webkit.org/changeset/219379

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

        Paginated mode: Infinite recursion in RenderTable::layout
        https://bugs.webkit.org/show_bug.cgi?id=174413

        Reviewed by Simon Fraser.

        This patch is a workaround for avoiding infinite recursion when the table layout does not stabilize.
        Apparently we leak some context (computed padding in this case) from the current to the subsequent layout.
        The subsequent layouts always end up producing different line heights for some of the cells in the <thead>.
        In paginated mode, when the section moves (<thead>, <tbody> etc) we call layout again recursively.
        This could lead to infinite recursion for unstable table layout.

        Unable to come up with a reduction yet.

        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::layout):
        * rendering/RenderTable.h:

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

        WebRTC: Incorrect sdpMLineIndex for video breaks Firefox interop
        https://bugs.webkit.org/show_bug.cgi?id=173530

        Reviewed by Alex Christensen.

        Test: webrtc/ice-candidate-sdpMLineIndex.html

        Reading missing parameter from libwebrtc backend and setting it when firing the RTCIceCandidate event.

        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::disableICECandidateFiltering):
        (WebCore::PeerConnectionBackend::newICECandidate):
        * Modules/mediastream/PeerConnectionBackend.h:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):

2017-07-12  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement CryptoKeyEC PKCS#8 exports
        https://bugs.webkit.org/show_bug.cgi?id=173648

        Reviewed by Jiewen Tan.

        Implement the PKCS#8 export operation for EC keys for platforms that use
        libgcrypt.

        First, the `ECParameters` and the `ECPrivateKey` ASN.1 structures are created
        and filled out accordingly. For the former, the appropriate object identifier
        is written under the `namedCurve` element of the structure. For the latter, we
        write out '1' under `version`, and eliminate the optional `parameters` element.
        An libgcrypt EC context is then used to retrieve the private and public key
        MPIs that are then written out under the `privateKey` and `publicKey` elements,
        respectively.

        After that, we can proceed to create and fill out the `PrivateKeyInfo` structure.
        0 is written out under the `version` element, and the id-ecPublicKey object
        identifier is written out under the `privateKeyAlgorithm.algorithm` element. This
        doesn't strictly follow the specification, since the id-ecDH identifier should be
        used for ECDH keys, but no test in WebKit or the web-platform-tests suite covers
        this, so this specific detail should be revisited later.

        Data of the previously-constructed `ECParameters` structure is retrieved and
        written out under the `privateKeyAlgorithm.parameters` element. Similarly is done
        for the `ECPrivateKey` structure, writing out its data under the `privateKey`
        element. Finally, the optional `attributes` element of the `PrivateKeyInfo`
        structure is eliminated, and the encoded data of this structure is retrieved and
        returned.

        No new tests -- relevant tests are now passing and are unskipped.

        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        (WebCore::CryptoKeyEC::platformExportPkcs8):

2017-07-12  Zan Dobersek  <zdobersek@igalia.com>

        [WPE] Use libepoxy
        https://bugs.webkit.org/show_bug.cgi?id=172104

        Reviewed by Michael Catanzaro.

        No new tests -- no changes in behavior.

        Implement the proper libepoxy header inclusion for ports that enable it.

        The library acts as a loading facility working on top of the system-provided
        OpenGL and EGL libraries, with the headers providing a complete collection of
        specification-defined OpenGL and EGL types, constants and entrypoints.

        Support is added through the USE(LIBEPOXY) build guard. Note that this guard
        isn't exclusive with USE(OPENGL), USE(OPENGL_ES_2) or USE(EGL), so the
        USE(LIBEPOXY) condition is tested before those.

        In case of OpenGL headers, the <epoxy/gl.h> header is included, and in
        case of EGL headers, the <epoxy/egl.h> header. <epoxy/egl.h> includes
        <epoxy/gl.h> on its own, so in some cases the inclusion of the latter is
        omitted.

        EpoxyShims.h header is added, doing a job similar to OpenGLESShims.h. The
        EXT-suffixed GL entrypoints are redefined to the non-suffixed versions.
        No suffixed constants are defined because those are defined by the libepoxy
        headers to the well-known values.

        * CMakeLists.txt:
        * PlatformWPE.cmake:
        * platform/graphics/ANGLEWebKitBridge.h:
        * platform/graphics/EpoxyShims.h: Added.
        * platform/graphics/GLContext.cpp:
        (WebCore::initializeOpenGLShimsIfNeeded):
        * platform/graphics/GraphicsContext3DPrivate.cpp:
        * platform/graphics/PlatformDisplay.cpp:
        * platform/graphics/cairo/CairoUtilities.cpp:
        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
        (WebCore::GraphicsContext3D::create):
        * platform/graphics/cairo/ImageBufferCairo.cpp:
        * platform/graphics/egl/GLContextEGL.cpp:
        * platform/graphics/egl/GLContextEGLWPE.cpp:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
        * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
        * platform/graphics/opengl/Extensions3DOpenGLES.h:
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
        * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
        * platform/graphics/wpe/PlatformDisplayWPE.cpp:

2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        ImageDecoder: Gifs with infinite animation only play once very often
        https://bugs.webkit.org/show_bug.cgi?id=173403

        Reviewed by Michael Catanzaro.

        It doesn't always happen, it's easier to reproduce when loading big files from the network, but it also depends
        on every file. The problem is that ImageFrameCache is caching the repetition count value always when the size is
        already available. In the case of gif files, the loop count value can be at any point of the image stream, so
        having the size available doesn't mean we also have the loop count. So, if the value is queried before it's
        available, the default value is cached (repeat once) and then always used. We should clear the cached value when
        new data is added to the decoder, like we do with other cached values that can change when more data is decoded.

        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::clearMetadata): Clear m_repetitionCount.

2017-07-12  Adrian Perez de Castro  <aperez@igalia.com>

        [SOUP] Do not use C linkage for functions using C++ features
        https://bugs.webkit.org/show_bug.cgi?id=174392

        Reviewed by Michael Catanzaro.

        No new tests because there is no behavior change.

        * platform/network/soup/WebKitSoupRequestGeneric.h: Move G_END_DECLS
        to leave functions which use C++ features outside of the block it
        delimits.

2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Crashes in WebCore::PasteboardHelper::fillSelectionData when source file of drag is unavailable
        https://bugs.webkit.org/show_bug.cgi?id=174161

        Reviewed by Michael Catanzaro.

        It seems selection data could contain an empty string, in which case gtk_selection_data_get_data() returns a
        valid pointer, but gtk_selection_data_get_length() returns 0. When this happens we end up trying to split an
        empty string resulting in an empty vector, but we unconditionally access the first element of the vector.

        * platform/gtk/PasteboardHelper.cpp:
        (WebCore::selectionDataToUTF8String): Return a null string in case selection data length is 0.
        (WebCore::PasteboardHelper::fillSelectionData): Return early if selection data length is 0, instead of checking
        the selection data pointer.

2017-07-11  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Enable FILE_LOCK and implement lockFile and unlockFile
        https://bugs.webkit.org/show_bug.cgi?id=174357

        Reviewed by Michael Catanzaro.

        Implement lockFile and unlockFile using flock().

        * PlatformWPE.cmake:
        * platform/glib/FileSystemGlib.cpp:
        (WebCore::lockFile):
        (WebCore::unlockFile):

2017-07-11  Yusuke Suzuki  <utatane.tea@gmail.com>

        Use FastAllocator in STL containers
        https://bugs.webkit.org/show_bug.cgi?id=174366

        Rubber stamped by Sam Weinig.

        This patch uses FastAllocator for STL containers including std::set and std::map.
        STL can take a template parameter to be used as allocator for containers.
        We prepare FastAllocator, which uses fastMalloc for allocation.
        This allows us to use bmalloc (if supported) for STL containers which offers
        functionalities that is not supported in WTF containers.

        * Modules/indexeddb/IDBKeyData.h:
        * Modules/indexeddb/server/IndexValueEntry.cpp:
        (WebCore::IDBServer::IndexValueEntry::IndexValueEntry):
        (WebCore::IDBServer::IndexValueEntry::Iterator::Iterator):
        (WebCore::IDBServer::IndexValueEntry::reverseFind):
        * Modules/indexeddb/server/IndexValueEntry.h:
        * Modules/indexeddb/server/IndexValueStore.cpp:
        (WebCore::IDBServer::IndexValueStore::lowestIteratorInRange):
        (WebCore::IDBServer::IndexValueStore::highestReverseIteratorInRange):
        (WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
        * Modules/indexeddb/server/IndexValueStore.h:
        * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
        (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared):
        * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
        * Modules/indexeddb/server/MemoryObjectStore.cpp:
        (WebCore::IDBServer::MemoryObjectStore::replaceKeyValueStore):
        (WebCore::IDBServer::MemoryObjectStore::addRecord):
        (WebCore::IDBServer::MemoryObjectStore::updateCursorsForPutRecord):
        * Modules/indexeddb/server/MemoryObjectStore.h:
        (WebCore::IDBServer::MemoryObjectStore::orderedKeys):
        * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
        (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
        (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
        (WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
        (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
        (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
        (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
        * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
        * Modules/mediasource/SampleMap.h:
        * page/WheelEventTestTrigger.cpp:
        (WebCore::WheelEventTestTrigger::deferTestsForReason):
        (WebCore::dumpState):
        * page/WheelEventTestTrigger.h:
        * platform/graphics/cv/VideoTextureCopierCV.cpp:
        (WebCore::enumToStringMap):
        * rendering/OrderIterator.h:

2017-07-11  Per Arne Vollan  <pvollan@apple.com>

        [Win] Build error when building WebKit.dll from WebKit.proj project file.
        https://bugs.webkit.org/show_bug.cgi?id=174410

        Reviewed by Brent Fulgham.

        Copy required header files to forwarding headers folder.

        * PlatformWin.cmake:

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

        Remove NAVIGATOR_HWCONCURRENCY
        https://bugs.webkit.org/show_bug.cgi?id=174400

        Reviewed by Sam Weinig.

        * Configurations/FeatureDefines.xcconfig:
        * WebCore.xcodeproj/project.pbxproj:
        * page/NavigatorBase.cpp:
        (WebCore::NavigatorBase::hardwareConcurrency): Deleted.
        * page/NavigatorBase.h:
        * page/NavigatorConcurrentHardware.idl: Removed.

2017-07-11  Youenn Fablet  <youenn@apple.com>

        RealtimeOutgoingAudioSource should not push more audio data if the WebRTC thread is not able to process it
        https://bugs.webkit.org/show_bug.cgi?id=174383

        Reviewed by Eric Carlson.

        This patch adds support to check for pending-processing audio data.
        If the amount of audio data is bigger than a high water mark of 0.5 seconds,
        we stop pushing new audio data until buffered audio data is lower than a low water mark of 0.1 seconds.
        Patch is tested by adding breakpoints to trigger the high water mark, verifying that low water mark is triggered
        and receiving audio is fine on the other connection endpoint.

        * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
        (WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit):
        (WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataLowLimit):
        (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
        * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:

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

        Rolling out r219372.

        * Configurations/FeatureDefines.xcconfig:
        * WebCore.xcodeproj/project.pbxproj:
        * page/NavigatorBase.cpp:
        (WebCore::NavigatorBase::hardwareConcurrency):
        * page/NavigatorBase.h:
        * page/NavigatorConcurrentHardware.idl: Added.

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

        Remove NAVIGATOR_HWCONCURRENCY
        https://bugs.webkit.org/show_bug.cgi?id=174400

        Reviewed by Sam Weinig.

        * Configurations/FeatureDefines.xcconfig:
        * WebCore.xcodeproj/project.pbxproj:
        * page/NavigatorBase.cpp:
        (WebCore::NavigatorBase::hardwareConcurrency): Deleted.
        * page/NavigatorBase.h:
        * page/NavigatorConcurrentHardware.idl: Removed.

2017-07-11  Jiewen Tan  <jiewen_tan@apple.com>

        [WebCrypto] CryptoKeyECMac::Custom OpenSSL tag is actually tagged type [1]
        https://bugs.webkit.org/show_bug.cgi?id=174382
        <rdar://problem/33244871>

        Reviewed by Brent Fulgham.

        No change of behaviour.

        * crypto/mac/CryptoKeyECMac.cpp:
        (WebCore::CryptoKeyEC::platformImportPkcs8):
        (WebCore::CryptoKeyEC::platformExportPkcs8):
        Replace CustomECParameters with TaggedType1 according to X.690(08/2015) section 8.14:
        https://www.itu.int/rec/T-REC-X.690-201508-I/en
        and RFC 5915 Appendix A:
        http://www.ietf.org/rfc/rfc5915.txt.

2017-07-11  Said Abou-Hallawa  <sabouhallawa@apple.com>

        REGRESSION(r219045): The <body> element does not get repainted when its background image finishes decoding
        https://bugs.webkit.org/show_bug.cgi?id=174376

        Reviewed by Simon Fraser.

        When adding a CachedImageClient to CachedImage::m_pendingImageDrawingClients
        and the CachedImageClient is not one of the CachedImage::m_clients, we
        should cancel the repaint optimization in CachedImage::imageFrameAvailable().
        This can be done by adding all the CachedImage::m_clients to CachedImage::
        m_pendingImageDrawingClients.

        Test: fast/images/async-image-body-background-image.html

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::addPendingImageDrawingClient):

2017-07-11  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix Windows build after r219355.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::addCrossOriginWindowPropertyNames):
        (WebCore::addCrossOriginWindowOwnPropertyNames):
        (WebCore::JSDOMWindow::getOwnPropertyNames):
        (WebCore::addCrossOriginPropertyNames): Deleted.
        (WebCore::addCrossOriginOwnPropertyNames): Deleted.
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::addCrossOriginLocationPropertyNames):
        (WebCore::addCrossOriginLocationOwnPropertyNames):
        (WebCore::JSLocation::getOwnPropertyNames):
        (WebCore::addCrossOriginPropertyNames): Deleted.
        (WebCore::addCrossOriginOwnPropertyNames): Deleted.

2017-07-10  Sam Weinig  <sam@webkit.org>

        [WebIDL] Convert MutationCallback to be a normal generate callback
        https://bugs.webkit.org/show_bug.cgi?id=174140

        Reviewed by Chris Dumez.

        To make this work more nicely, I:
        - Added the ability to for non-nullable interfaces in sequences to be passed
          via a Ref<> rather than a RefPtr<> as a parameter to a callback function.
          (e.g. callback MyCallback = void (sequence<Foo> foos) will now have the 
          signature, CallbackResult<void> handleEvent(const Vector<Ref<Foo>>&) rather
          than CallbackResult<void> handleEvent(const Vector<RefPtr<Foo>>&).
        - Added a new extended attribute for callback functions called [CallbackNeedsCanInvoke]
          that adds a virtual function called canInvoke() to the generated callback.
          All it does is forward to ActiveDOMCallback's canInvokeCallback, but it
          allows the implementation to get to it. We may one day want to move the 
          inheritance of ActiveDOMCallback from the generated source to the base class.
        - Added a new extended attribute for callback functions called [CallbackThisObject=Type]
          which allows you to specify that the callback needs a this object in addition
          to its arguments. When specified, the first argument of the C++ implementation
          function will now correspond to the this object, with the remaining arguments
          shifted over one.

        * DerivedSources.make:
        Add MutationCallback.

        * WebCore.xcodeproj/project.pbxproj:
        Remove non-generated JSMutationCallback.cpp, and add generated JSMutationCallback.cpp.

        * Modules/mediastream/MediaDevicesRequest.cpp:
        (WebCore::MediaDevicesRequest::filterDeviceList):
        (WebCore::MediaDevicesRequest::start):
        * Modules/mediastream/MediaDevicesRequest.h:
        Switch to using Ref.

        * bindings/IDLTypes.h:
        Add InnerParameterType and NullableInnerParameterType type hooks
        and specialize wrappers to use Ref for InnerParameterType, and RefPtr
        for NullableInnerParameterType.

        * bindings/js/JSCallbackData.cpp:
        * bindings/js/JSCallbackData.h:
        Add support for passing a this object.

        * bindings/js/JSMutationCallback.cpp: Removed.
        * bindings/js/JSMutationCallback.h: Removed.
        Remove custom callback code.

        * bindings/js/JSMutationObserverCustom.cpp:
        (WebCore::constructJSMutationObserver): Deleted.
        Remove no longer needed custom constructor.

        * bindings/scripts/CodeGenerator.pm:
        (ParseType):
        Add helper to parse a type and cache the result.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateCallbackHeaderContent):
        (GenerateCallbackImplementationContent):
        Add support for [CallbackNeedsCanInvoke] and [CallbackThisObject]. When [CallbackThisObject]
        is not specified, use jsUndefined() as the this object as specified by WebIDL.

        * bindings/scripts/IDLAttributes.json:
        Add [CallbackNeedsCanInvoke] and [CallbackThisObject].

        * bindings/scripts/IDLParser.pm:
        (ParseType):
        Add entry point to parse a single type.

        * css/FontFaceSet.h:
        Switch to using Ref.

        * dom/MutationCallback.h:
        Update signatures.

        * dom/MutationCallback.idl: Added.
    
        * dom/MutationObserver.cpp:
        (WebCore::MutationObserver::canDeliver):
        (WebCore::MutationObserver::deliver):
        Switch to new signatures.

        * dom/MutationObserver.idl:
        Remove CustomConstructor.

        * page/IntersectionObserverCallback.h:
        Switch to using Ref.

        * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: Added.
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: Added.
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.h:
        * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
        Add / update bindings tests.

2017-07-11  Said Abou-Hallawa  <sabouhallawa@apple.com>

        RenderImage should not add itself as a RelevantRepaintedObject if its image frame is being decoded
        https://bugs.webkit.org/show_bug.cgi?id=174336

        Reviewed by Simon Fraser.

        Since nothing will be drawn till the image frame finishes decoding we should
        treat returning ImageDrawResult::DidRequestDecoding from BitmapImage::draw
        the same as we do when the image is still loading.

        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintReplaced):
        (WebCore::RenderImage::paintIntoRect):
        * rendering/RenderImage.h:

2017-07-11  Youenn Fablet  <youenn@apple.com>

        [WebRTC] Hanging under LibWebRTCMediaEndpoint::getStats
        https://bugs.webkit.org/show_bug.cgi?id=174377

        Reviewed by Eric Carlson.

        No change of behavior.
        Moving calls to libwebrtc getStats in the signalling thread since doing it in the main thread
        would block the main thread until the signalling thread is ready to handle getStats.
        Reducing stat logging since this may be too much for some devices.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::getStats):
        (WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
        (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
        (WebCore::LibWebRTCMediaEndpoint::startLoggingStats):

2017-07-11  Michael Catanzaro  <mcatanzaro@igalia.com>

        Remove unused OpenGL files
        https://bugs.webkit.org/show_bug.cgi?id=174371

        Reviewed by Timothy Hatcher.

        * platform/graphics/opengl/GLPlatformContext.cpp: Removed.
        * platform/graphics/opengl/GLPlatformContext.h: Removed.
        * platform/graphics/opengl/GLPlatformSurface.h: Removed.

2017-07-11  Chris Dumez  <cdumez@apple.com>

        Window's [[OwnPropertyKeys]] is wrong for cross origin windows
        https://bugs.webkit.org/show_bug.cgi?id=174364
        <rdar://problem/33238056>

        Reviewed by Brent Fulgham.

        Window's [[OwnPropertyKeys]] should not list descendant frame names
        when the window is cross-origin:
        - https://github.com/whatwg/html/pull/2777

        This aligns our behavior with Firefox and Chrome.

        No new tests, updated existing test.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::addCrossOriginPropertyNames):
        (WebCore::addCrossOriginOwnPropertyNames):
        (WebCore::JSDOMWindow::getOwnPropertyNames):

2017-07-11  Timothy Hatcher  <timothy@hatcher.name>

        Fix broken build when ENABLE_VIDEO is disabled.
        https://bugs.webkit.org/show_bug.cgi?id=174368

        Reviewed by Alex Christensen.

        * dom/Document.cpp:
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::texSubImage2D):
        (WebCore::WebGLRenderingContextBase::texImage2D):
        * html/canvas/WebGLRenderingContextBase.h:
        * html/canvas/WebGLRenderingContextBase.idl:
        * testing/Internals.cpp:
        (WebCore::Internals::mediaResponseSources):
        (WebCore::Internals::mediaResponseContentRanges):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-07-11  Ali Juma  <ajuma@chromium.org>

        elementFromPoint() should consider x and y to be in client (layout viewport) coordinates
        https://bugs.webkit.org/show_bug.cgi?id=172019

        Reviewed by Simon Fraser.

        When visual viewports are enabled, this makes TreeScope::nodeFromPoint consider its
        input to be in client coordinates, and clips this input to the layout viewport. This change
        affects the behavior of document.elementFromPoint() and document.caretRangeFromPoint.

        No new tests. Modified an existing test, and made a previously-failing test pass on ios.

        * dom/TreeScope.cpp:
        (WebCore::TreeScope::nodeFromPoint):
        * page/FrameView.cpp:
        (WebCore::FrameView::layoutViewportToAbsoluteRect):
        (WebCore::FrameView::layoutViewportToAbsolutePoint):
        (WebCore::FrameView::clientToLayoutViewportPoint):
        * page/FrameView.h:
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::hitTest):

2017-07-11  Timothy Hatcher  <timothy@hatcher.name>

        Broken build when !USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
        https://bugs.webkit.org/show_bug.cgi?id=174369

        Reviewed by Alex Christensen.

        * dom/ScriptedAnimationController.h: Include PlatformScreen.h.

2017-07-11  Wenson Hsieh  <wenson_hsieh@apple.com>

        Address post-review feedback after http://trac.webkit.org/r219310
        https://bugs.webkit.org/show_bug.cgi?id=174300
        <rdar://problem/33030639>

        Reviewed by Simon Fraser.

        Removes pan-gesture-related plumbing introduced in r219310 that is no longer necessary.

        * page/scrolling/ScrollingTree.h:
        (WebCore::ScrollingTree::scrollingTreeNodeWillStartPanGesture):
        (WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted.

2017-07-11  Alex Christensen  <achristensen@webkit.org>

        Reduce URL size
        https://bugs.webkit.org/show_bug.cgi?id=174319

        Reviewed by Andreas Kling.

        m_fragmentEnd is redundant information. If a URL is valid, then it is always m_string.length().
        If a URL is not valid, then it is always 0. Rather than storing additional information,
        deduce the fragment end from the validity of the URL and the String's length.

        No change in behavior.  This reduces sizeof(URL) from 56 to 48 and reduces operations when parsing.

        * platform/URL.cpp:
        (WebCore::URL::invalidate):
        (WebCore::URL::fragmentIdentifier):
        (WebCore::URL::hasFragmentIdentifier):
        (WebCore::URL::removeFragmentIdentifier):
        * platform/URL.h:
        (WebCore::URL::encode):
        (WebCore::URL::decode):
        (WebCore::URL::hasFragment):
        * platform/URLParser.cpp:
        (WebCore::URLParser::urlLengthUntilPart):
        (WebCore::URLParser::copyURLPartsUntil):
        (WebCore::URLParser::parse):
        (WebCore::URLParser::allValuesEqual):
        (WebCore::URLParser::internalValuesConsistent):

2017-07-11  Alex Christensen  <achristensen@webkit.org>

        SharedBuffer::size should return a size_t
        https://bugs.webkit.org/show_bug.cgi?id=174328

        Reviewed by Andreas Kling.

        No change in behaviour.

        * html/FTPDirectoryDocument.cpp:
        (WebCore::createTemplateDocumentData):
        * loader/ContentFilter.cpp:
        (WebCore::ContentFilter::handleProvisionalLoadFailure):
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::loadDataURL):
        * loader/ResourceLoader.h:
        * loader/appcache/ApplicationCacheStorage.cpp:
        (WebCore::ApplicationCacheStorage::store):
        * loader/cache/CachedScript.cpp:
        (WebCore::CachedScript::script):
        * platform/SharedBuffer.cpp:
        (WebCore::SharedBuffer::tryCreateArrayBuffer):
        * platform/SharedBuffer.h:

2017-07-11  Per Arne Vollan  <pvollan@apple.com>

        [Win] Build error when building WebCore from WebCore.proj project file.
        https://bugs.webkit.org/show_bug.cgi?id=174330

        Reviewed by Brent Fulgham.

        The CMake variable PAL_DIR should be set in the project file.

        * WebCore.vcxproj/WebCore.proj:

2017-05-24  Sergio Villar Senin  <svillar@igalia.com>

        [SVG] Leak in SVGAnimatedListPropertyTearOff
        https://bugs.webkit.org/show_bug.cgi?id=172545

        Reviewed by Said Abou-Hallawa.

        SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
        SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
        reference to SVGAnimatedProperty.

        When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
        SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
        SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
        is going to be added to. This effectively creates a reference cycle between the
        SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.

        We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.

        * svg/properties/SVGAnimatedListPropertyTearOff.h:

2017-07-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK] Spin buttons on input type number appear over the value itself for small widths
        https://bugs.webkit.org/show_bug.cgi?id=173572

        Reviewed by Carlos Garcia Campos.

        When drawing the spin buttons, override the width of the input
        element to increment it with the width of the spin button.
        This ensures that we don't end up covering the input values with
        the spin buttons.

        Do this also for user controlled styles, because most web authors
        won't test how their site renders on WebKitGTK+, and they will
        assume spin buttons in the order of 13 pixels wide (that is what
        most browsers use), but the GTK+ spin button is much wider (66 pixels).

        Test: platform/gtk/fast/forms/number/number-size-spinbutton-nocover.html

        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::adjustStyle):
        * rendering/RenderThemeGtk.cpp:
        (WebCore::RenderThemeGtk::adjustTextFieldStyle): Call the theme's adjustTextFieldStyle() also for user controlled styles.
        (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):

2017-07-11  Youenn Fablet  <youenn@apple.com>

        We should do ICE candidate filtering at the Document level
        https://bugs.webkit.org/show_bug.cgi?id=173861
        <rdar://problem/33122058>

        Reviewed by Eric Carlson.

        Tests: http/tests/webrtc/filtering-ice-candidate-cross-origin-frame.html
               http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html
               http/tests/webrtc/filtering-ice-candidate-same-origin-frame2.html
               webrtc/filtering-ice-candidate-after-reload.html

        Making UserMediaRequest disable the ICE candidate filtering for the page RTCController.
        All RTCPeerConnection of the page that are created on a document that are same-origin as the top document
        are now registered to the RTCController.
        This allows disabling filtering to only these RTCPeerConnection.

        The page keeps the default ICE candidate filtering policy.
        This policy allows disabling ICE candidate filtering for all RTCPeerConnection.

        When the top document is changing, the RTCController filtering policy is reset
        and its list of RTCPeerConnection is emptied.

        Internals no longer disables ICE candidate filtering by default.
        This allows finer grained testing.
        ICE candidate filtering is disabled for tests including testharnessreport.js
        to enable web-platform-tests to run without modifications.

        * Modules/mediastream/RTCController.cpp:
        (WebCore::RTCController::reset):
        * Modules/mediastream/RTCController.h:
        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::allow):
        * page/Frame.cpp:
        (WebCore::Frame::setDocument):
        * page/Page.cpp:
        (WebCore::Page::disableICECandidateFiltering):
        * page/Page.h:
        (WebCore::Page::shouldEnableICECandidateFilteringByDefault):
        (WebCore::Page::disableICECandidateFiltering): Deleted.
        (WebCore::Page::enableICECandidateFiltering): Deleted.
        (WebCore::Page::isICECandidateFilteringEnabled): Deleted.
        * testing/Internals.cpp:
        (WebCore::Internals::Internals):
        (WebCore::Internals::setICECandidateFiltering):
        (WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
        (WebCore::Internals::isICECandidateFilteringEnabled): Deleted.
        * testing/Internals.h:
        * testing/Internals.idl:

2017-07-11  Sergio Villar Senin  <svillar@igalia.com>

        Unreviewed, rolling out r219325.

        The test is still flaky

        Reverted changeset:

        "[SVG] Leak in SVGAnimatedListPropertyTearOff"
        https://bugs.webkit.org/show_bug.cgi?id=172545
        http://trac.webkit.org/changeset/219325

2017-05-24  Sergio Villar Senin  <svillar@igalia.com>

        [SVG] Leak in SVGAnimatedListPropertyTearOff
        https://bugs.webkit.org/show_bug.cgi?id=172545

        Reviewed by Said Abou-Hallawa.

        SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
        SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
        reference to SVGAnimatedProperty.

        When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
        SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
        SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
        is going to be added to. This effectively creates a reference cycle between the
        SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.

        We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.

        * svg/properties/SVGAnimatedListPropertyTearOff.h:

2017-07-10  Simon Fraser  <simon.fraser@apple.com>

        [WK2 iOS] REGRESSION (r216803) During momentum scroll, getBoundingClientRect returns wrong coordinates (missing images on pinterest, elle.com and many other sites)
        https://bugs.webkit.org/show_bug.cgi?id=174286
        rdar://problem/32864180

        Reviewed by Dean Jackson.

        r216803 made getBoundingClientRects relative to the layout viewport, but when scrolling we
        only update that on stable viewport updates (at the end of the scroll). This meant that during
        unstable updates, getBoundingClientRects() used a "frozen" viewport origin so things on-screen
        would appear to be off-screen, causing sites to fail to dynamically load images etc. when
        scrolling.

        Fix by pushing an optional "unstable" layout viewport rect onto FrameView, which gets used by
        FrameView::documentToClientOffset(). This is cleared when we do a stable update.

        This is a short-term solution. Longer term, I would prefer to always call setLayoutViewportOverrideRect(),
        but fix the scrolling tree logic to work correctly in this case.

        Add a bit more scrolling logging.

        Test: fast/visual-viewport/ios/get-bounding-client-rect-unstable.html

        * page/FrameView.cpp:
        (WebCore::FrameView::setUnstableLayoutViewportRect):
        (WebCore::FrameView::documentToClientOffset):
        * page/FrameView.h:
        * page/scrolling/AsyncScrollingCoordinator.cpp:
        (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
        * page/scrolling/ScrollingStateFixedNode.cpp:
        (WebCore::ScrollingStateFixedNode::updateConstraints):
        (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):

2017-07-10  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Prune statistics in orders of importance
        https://bugs.webkit.org/show_bug.cgi?id=174215
        <rdar://problem/33164403>

        Reviewed by Chris Dumez.

        Test: http/tests/loading/resourceLoadStatistics/prune-statistics.html

        * loader/ResourceLoadObserver.cpp:
        (WebCore::reduceTimeResolution):
        (WebCore::ResourceLoadObserver::logFrameNavigation):
        (WebCore::ResourceLoadObserver::logSubresourceLoading):
        (WebCore::ResourceLoadObserver::logWebSocketLoading):
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
            Now all set the new statistics field lastSeen.
        * loader/ResourceLoadStatistics.cpp:
        (WebCore::ResourceLoadStatistics::encode):
        (WebCore::ResourceLoadStatistics::decode):
        (WebCore::ResourceLoadStatistics::toString):
        (WebCore::ResourceLoadStatistics::merge):
            Handling of the new statistics field lastSeen.
        * loader/ResourceLoadStatistics.h:

2017-07-10  Devin Rousso  <drousso@apple.com>

        Web Inspector: Highlight matching CSS canvas clients when hovering contexts in the Resources tab
        https://bugs.webkit.org/show_bug.cgi?id=174279

        Reviewed by Matt Baker.

        Test: inspector/dom/highlightNodeList.html

        * inspector/InspectorDOMAgent.h:
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::highlightNodeList):

2017-07-10  Javier Fernandez  <jfernandez@igalia.com>

        [css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved
        https://bugs.webkit.org/show_bug.cgi?id=172707

        Reviewed by Antti Koivisto.

        The CSS Box Alignment specification has been changed recently so that
        now all the propeties have the specificed value as computed value. The
        rationale of this change are at the associated W3C github issue [1].

        This change implies that we don't need to execute the StyleAdjuter
        logic we implemented specifically for supporting 'auto' values
        resolution for computed style. We can live now with resolution at
        layout time only.

        [1] https://github.com/w3c/csswg-drafts/issues/440

        No new tests, just updating the already defined tests.

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::propertyValue):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::adjustRenderStyle): Removed
        * css/StyleResolver.h:
        * html/shadow/TextControlInnerElements.cpp:
        (WebCore::TextControlInnerElement::resolveCustomStyle):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::columnFlexItemHasStretchAlignment):
        (WebCore::RenderBox::hasStretchedLogicalWidth):
        * rendering/RenderFlexibleBox.cpp:
        (WebCore::RenderFlexibleBox::styleDidChange): Added
        (WebCore::RenderFlexibleBox::alignmentForChild):
        * rendering/RenderFlexibleBox.h:

2017-07-10  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WK2] Ignore touch events that interrupt platform-driven momentum scrolling
        https://bugs.webkit.org/show_bug.cgi?id=174300
        <rdar://problem/33030639>

        Reviewed by Simon Fraser.

        See Source/WebKit2/ChangeLog for more detail.

        Tests: fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe.html
               fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-overflow.html
               fast/events/ios/touch-events-during-scroll-deceleration-in-overflow.html

        * page/scrolling/ScrollingTree.h:
        (WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture):

2017-07-10  Jeremy Jones  <jeremyj@apple.com>

        Captions and subtitles not showing up in picture-in-picture for MSE content
        https://bugs.webkit.org/show_bug.cgi?id=174317
        rdar://problem/33188591

        Reviewed by Eric Carlson.

        Reverts a regression created by r218403.

        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):

2017-07-10  Per Arne Vollan  <pvollan@apple.com>

        [Win] Link error when building WTF from WTF.proj project file.
        https://bugs.webkit.org/show_bug.cgi?id=174316
        <rdar://problem/33178200>

        Reviewed by Brent Fulgham.

        WTF_CPU_X86 cmake variable needs to be set for link libraries directories to be correct.

        * WebCore.vcxproj/WebCore.proj:

2017-07-10  Jeremy Jones  <jeremyj@apple.com>

        media element handle adding source immediately before src.
        https://bugs.webkit.org/show_bug.cgi?id=174284
        rdar://problem/33115439

        Reviewed by David Kilzer.

        Test: media/video-source-before-src.html

        Adding a source causes a selectMediaResource block to be enqueued.
        If dataLoadingPermitted prevents creating the m_player but sets the srcAttr, then
        the enqueued selectMediaResource will be in a bad state, with a srcAttr but no m_player.

        This fix prevents selectMediaResource from being called, if data loading is not permitted
        when adding a source element, to match how it prevents player creation when setting srcAttr.

        This fix also adds a debug assert to catch the problem earlier and adds an early return to
        prevent the crash in release builds.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::selectMediaResource):
        (WebCore::HTMLMediaElement::sourceWasAdded):

2017-07-10  Megan Gardner  <megan_gardner@apple.com>

        Add location to NavigationActionData
        https://bugs.webkit.org/show_bug.cgi?id=174233
        <rdar://problem/29165518>

        Reviewed by Simon Fraser.
        
        Add the root view location of a tap to a NavigationAction to vend to Safari.

        Test: small enough change to not be tested alone.

        * dom/MouseRelatedEvent.cpp:
        (WebCore::MouseRelatedEvent::absoluteLocationConvertedToRootView):
        * dom/MouseRelatedEvent.h:

2017-07-10  Sam Weinig  <sam@webkit.org>

        [WebIDL] Move plugin object customization into the generator
        https://bugs.webkit.org/show_bug.cgi?id=174238

        Reviewed by Chris Dumez.

        - Added [Plugin] extended attribute to forward the necessary hooks
          for get/set/delete to the plugin code.
        - Removed [CustomNamedSetter] and replaced it's remaining uses
          [CustomPut] (formally called [CustomPutFunction]).
        - Renamed [CustomNamedGetterOnPrototype] to [CustomPutOnPrototype]
          because that is actually what it does.
        - Removed [CustomGetOwnPropertySlotByIndex] and made 
          [CustomGetOwnPropertySlot] imply it, as the other custom hooks
          do.
        - Renamed [CustomEnumerateProperty] to [CustomGetOwnPropertyNames]
          to conform with other attribute names.
        - Renamed [CustomCall] to [CustomGetCallData] to conform with other 
          attribute names.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSHTMLAppletElementCustom.cpp: Removed.
        * bindings/js/JSHTMLEmbedElementCustom.cpp: Removed.
        * bindings/js/JSHTMLObjectElementCustom.cpp: Removed.
        Remove custom bindings.

        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
        (WebCore::putCommon):
        (WebCore::JSCSSStyleDeclaration::put):
        (WebCore::JSCSSStyleDeclaration::putByIndex):
        (WebCore::JSCSSStyleDeclaration::putDelegate): Deleted.
        Use [CustomPut] rather than [CustomNamedSetter] to allow us
        to get rid of [CustomNamedSetter]. Reuse put delegate as
        common code to share between put and putByIndex.

        * bindings/js/JSLocationCustom.cpp:
        (WebCore::getOwnPropertySlotCommon):
        (WebCore::JSLocation::getOwnPropertySlot):
        (WebCore::JSLocation::getOwnPropertySlotByIndex):
        Replace [CustomGetOwnPropertySlotAndDescriptor] with [CustomGetOwnPropertySlot]
        which is more clear and reduces the number of variants of this hook override
        we need.

        (WebCore::putCommon):
        (WebCore::JSLocation::put):
        (WebCore::JSLocation::putByIndex):
        Use [CustomPut] rather than [CustomNamedSetter] to allow us
        to get rid of [CustomNamedSetter]. Reuse put delegate as
        common code to share between put and putByIndex.

        (WebCore::JSLocationPrototype::put):
        [CustomPutOnPrototype] (which weirdly used incorrectly be called 
        [CustomNamedGetterOnPrototype]) now works like [CustomPut] meaning
        you need to call Base.

        * bindings/js/JSPluginElementFunctions.cpp:
        (WebCore::pluginElementPropertyGetter):
        (WebCore::pluginElementCustomGetOwnPropertySlot):
        (WebCore::pluginElementCustomPut):
        * bindings/js/JSPluginElementFunctions.h:
        (WebCore::pluginElementCustomGetOwnPropertySlot): Deleted.
        Remove templatized pluginElementCustomGetOwnPropertySlot, which was 
        completely unnecessary and merge its functionality into the out of
        line overload. Remove pluginElementPropertyGetter from the header,
        since it is only used in implementation, and unify the naming and
        argument position (JSHTMLElement* comes first) of the hooks.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateIndexedGetter):
        (GenerateNamedGetter):
        (GenerateGetOwnPropertySlot):
        (GenerateGetOwnPropertySlotByIndex):
        (GenerateGetOwnPropertyNames):
        (GeneratePut):
        (GeneratePutByIndex):
        (GenerateDeleteProperty):
        (GenerateDeletePropertyByIndex):
        (GenerateNamedDeleterDefinition):
        (InstanceOverridesGetOwnPropertySlot):
        (InstanceOverridesGetOwnPropertyNames):
        (InstanceOverridesPut):
        (InstanceOverridesDeleteProperty):
        (GenerateHeader):
        (GenerateImplementation):
        (GenerateGetCallData):
        (GeneratePluginCall):
        (GenerateLegacyCallerDefinitions):
        (GenerateLegacyCallerDefinition):
        (GeneratePrototypeDeclaration):
        (InstanceOverridesGetCallData):
        (HeaderNeedsPrototypeDeclaration):
        - Add support for [Plugin]
        - Remove support for [CustomNamedSetter]
        - Replace [CustomGetOwnPropertySlotByIndex] with [CustomGetOwnPropertySlot]
        - Replace [CustomEnumerateProperty] with [CustomGetOwnPropertyNames]
        - Replace [CustomPutFunction] with [CustomPut].
        - Make subroutine names more consistent (remove a few Definition suffixes)

        * bindings/scripts/IDLAttributes.json:
        Update for new / removed attributes.

        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestInterface.h:
        * bindings/scripts/test/JS/JSTestPluginInterface.cpp: Added.
        * bindings/scripts/test/JS/JSTestPluginInterface.h: Added.
        * bindings/scripts/test/TestInterface.idl:
        * bindings/scripts/test/TestPluginInterface.idl: Added.
        Update / add tests.

        * css/CSSStyleDeclaration.idl:
        * html/HTMLAppletElement.idl:
        * html/HTMLEmbedElement.idl:
        * html/HTMLObjectElement.idl:
        * page/DOMWindow.idl:
        * page/Location.idl:
        * storage/Storage.idl:
        Update for new / renamed attributes.

2017-07-03  Brian Burg  <bburg@apple.com>

        Web Replay: remove some unused code
        https://bugs.webkit.org/show_bug.cgi?id=173903

        Rubber-stamped by Joseph Pecoraro.

        * CMakeLists.txt:
        * Configurations/FeatureDefines.xcconfig:
        * DerivedSources.make:
        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::Document::Document):
        (WebCore::Document::lastModified):
        (WebCore::Document::inputCursor): Deleted.
        (WebCore::Document::setInputCursor): Deleted.
        * dom/Document.h:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::InspectorController):
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::willDispatchEventImpl):
        (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
        (WebCore::InspectorInstrumentation::frameDetachedFromParentImpl):
        (WebCore::InspectorInstrumentation::didCommitLoadImpl):
        (WebCore::InspectorInstrumentation::sessionCreatedImpl): Deleted.
        (WebCore::InspectorInstrumentation::sessionLoadedImpl): Deleted.
        (WebCore::InspectorInstrumentation::sessionModifiedImpl): Deleted.
        (WebCore::InspectorInstrumentation::segmentCreatedImpl): Deleted.
        (WebCore::InspectorInstrumentation::segmentCompletedImpl): Deleted.
        (WebCore::InspectorInstrumentation::segmentLoadedImpl): Deleted.
        (WebCore::InspectorInstrumentation::segmentUnloadedImpl): Deleted.
        (WebCore::InspectorInstrumentation::captureStartedImpl): Deleted.
        (WebCore::InspectorInstrumentation::captureStoppedImpl): Deleted.
        (WebCore::InspectorInstrumentation::playbackStartedImpl): Deleted.
        (WebCore::InspectorInstrumentation::playbackPausedImpl): Deleted.
        (WebCore::InspectorInstrumentation::playbackHitPositionImpl): Deleted.
        (WebCore::InspectorInstrumentation::playbackFinishedImpl): Deleted.
        (WebCore::InspectorInstrumentation::replayAgentEnabled): Deleted.
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::sessionCreated): Deleted.
        (WebCore::InspectorInstrumentation::sessionLoaded): Deleted.
        (WebCore::InspectorInstrumentation::sessionModified): Deleted.
        (WebCore::InspectorInstrumentation::segmentCreated): Deleted.
        (WebCore::InspectorInstrumentation::segmentCompleted): Deleted.
        (WebCore::InspectorInstrumentation::segmentLoaded): Deleted.
        (WebCore::InspectorInstrumentation::segmentUnloaded): Deleted.
        (WebCore::InspectorInstrumentation::captureStarted): Deleted.
        (WebCore::InspectorInstrumentation::captureStopped): Deleted.
        (WebCore::InspectorInstrumentation::playbackStarted): Deleted.
        (WebCore::InspectorInstrumentation::playbackPaused): Deleted.
        (WebCore::InspectorInstrumentation::playbackFinished): Deleted.
        (WebCore::InspectorInstrumentation::playbackHitPosition): Deleted.
        * inspector/InspectorReplayAgent.cpp: Removed.
        * inspector/InspectorReplayAgent.h: Removed.
        * inspector/InstrumentingAgents.cpp:
        (WebCore::InstrumentingAgents::reset):
        * inspector/InstrumentingAgents.h:
        (WebCore::InstrumentingAgents::inspectorReplayAgent): Deleted.
        (WebCore::InstrumentingAgents::setInspectorReplayAgent): Deleted.
        * page/EventHandler.h:
        * page/Page.cpp:
        (WebCore::Page::Page):
        * page/Page.h:
        (WebCore::Page::replayController): Deleted.
        * page/scrolling/ScrollingCoordinator.cpp:
        (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
        (WebCore::ScrollingCoordinator::replaySessionStateDidChange): Deleted.
        * page/scrolling/ScrollingCoordinator.h:
        * platform/Logging.h:
        * plugins/DOMMimeTypeArray.cpp:
        (WebCore::DOMMimeTypeArray::getPluginData):
        * plugins/DOMPluginArray.cpp:
        (WebCore::DOMPluginArray::pluginData):
        * replay/AllReplayInputs.h: Removed.
        * replay/CapturingInputCursor.cpp: Removed.
        * replay/CapturingInputCursor.h: Removed.
        * replay/EventLoopInput.cpp: Removed.
        * replay/EventLoopInput.h: Removed.
        * replay/EventLoopInputDispatcher.cpp: Removed.
        * replay/EventLoopInputDispatcher.h: Removed.
        * replay/FunctorInputCursor.h: Removed.
        * replay/MemoizedDOMResult.cpp: Removed.
        * replay/MemoizedDOMResult.h: Removed.
        * replay/ReplayController.cpp: Removed.
        * replay/ReplayController.h: Removed.
        * replay/ReplayInputCreationMethods.cpp: Removed.
        * replay/ReplayInputDispatchMethods.cpp: Removed.
        * replay/ReplaySession.cpp: Removed.
        * replay/ReplaySession.h: Removed.
        * replay/ReplaySessionSegment.cpp: Removed.
        * replay/ReplaySessionSegment.h: Removed.
        * replay/ReplayingInputCursor.cpp: Removed.
        * replay/ReplayingInputCursor.h: Removed.
        * replay/SegmentedInputStorage.cpp: Removed.
        * replay/SegmentedInputStorage.h: Removed.
        * replay/SerializationMethods.cpp: Removed.
        * replay/SerializationMethods.h: Removed.
        * replay/WebInputs.json: Removed.

2017-07-10  Brady Eidson  <beidson@apple.com>

        Cleanup lifetime issues of UniqueIDBDatabase and IDBBackingStore.
        <rdar://problem/32908525> and https://bugs.webkit.org/show_bug.cgi?id=174244

        Reviewed by David Kilzer and Alex Christensen. 

        No targeted test possible, implicitly covered by all IDB tests.

        The original idea behind UniqueIDBDatabase lifetime was that they are ThreadSafeRefCounted and
        we take protector Refs when any operation that needs it alive is in flight.
        
        This added variability to their lifetime which made it difficult to enforce a few different 
        design invariants, namely:
            - UniqueIBDDatabase objects are always created and destroyed only on the main thread.
            - IDBBackingStore objects are always created and destroyed only on the database thread.
        
        This patch removes the ref counting and instead ties UniqueIDBDatabase lifetime to a
        std::unique_ptr that is owned by the IDBServer.
        
        Whenever any operations on the UniqueIDBDatabase are in flight it is kept alive by virtue
        of that unique_ptr in the IDBServer. Once a UniqueIDBDatabase is completely done with all of
        its work, the following happens:
            - On the main thread the IDBServer removes the unique_ptr owning the UniqueIDBDatabase
              from its map.
            - It hands the unique_ptr to the UniqueIDBDatabase itself, which schedules one final 
              database thread task.
            - That database thread task is to destroy the IDBBackingStore, kill its message queues,
              and then message back to the main thread for one final task.
            - That main thread task is to release the unique_ptr, resulting in destruction of the
              UniqueIDBDatabase object.
        
        This is safe, predictable, solves the lifetime issues that r218516 originally tried to solve,
        and solves the lifetime issues that r218516 introduced.

        (This patch also adds many more assertions to cover various design invariants throughout the
        lifecycle of a particular UniqueIDBDatabase)

        ASSERT that IDBBackingStores are only ever created and destroyed on the background thread:
        * Modules/indexeddb/server/IDBBackingStore.h:
        (WebCore::IDBServer::IDBBackingStore::~IDBBackingStore):
        (WebCore::IDBServer::IDBBackingStore::IDBBackingStore):
        
        Transition UniqueIDBDatabase ownership from a RefPtr to a std::unique_ptr:
        * Modules/indexeddb/server/IDBServer.cpp:
        (WebCore::IDBServer::IDBServer::getOrCreateUniqueIDBDatabase):
        (WebCore::IDBServer::IDBServer::closeAndTakeUniqueIDBDatabase):
        (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
        (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
        (WebCore::IDBServer::IDBServer::closeUniqueIDBDatabase): Deleted.
        * Modules/indexeddb/server/IDBServer.h:
        
        Make all the other changes mentioned above:
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase): Bulk up on ASSERTs
        (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection): 
        (WebCore::IDBServer::UniqueIDBDatabase::performUnconditionalDeleteBackingStore):
        (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
        (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
        (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
        (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
        (WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
        (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
        (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
        (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
        (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
        (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
        (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
        (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
        (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
        (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
        (WebCore::IDBServer::UniqueIDBDatabase::maybeFinishHardClose):
        (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):
        (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
        (WebCore::IDBServer::UniqueIDBDatabase::didPerformUnconditionalDeleteBackingStore): Deleted.
        * Modules/indexeddb/server/UniqueIDBDatabase.h:
        (WebCore::IDBServer::UniqueIDBDatabase::create): Deleted.

2017-07-10  Chris Dumez  <cdumez@apple.com>

        Further WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore clean up
        https://bugs.webkit.org/show_bug.cgi?id=174301

        Reviewed by Brent Fulgham.

        Moved some generic file system utility functions down to platform's FileSystem.h.

        * platform/FileSystem.cpp:
        (WebCore::openAndLockFile):
        (WebCore::unlockAndCloseFile):
        * platform/FileSystem.h:

2017-07-10  Andreas Kling  <akling@apple.com>

        REGRESSION(r210226): Keyboard-focused element not preserved when navigating back through page cache, causing multiple elements to have focus
        https://bugs.webkit.org/show_bug.cgi?id=174302
        <rdar://problem/33204273>

        Reviewed by Antti Koivisto.

        Don't clear the active/hovered/focused elements when destroying the render tree,
        since we might need to reconstruct it later, and would like to remember which
        elements those were.

        Only the focused state actually stuck when going in and out of the page cache,
        but this patch removes all the element pointer clearing for consistency.

        Test: fast/history/page-cache-element-state-focused.html

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

2017-07-10  Daniel Bates  <dabates@apple.com>

        REGRESSION (r218616): Cannot build WebCore for macOS 10.12 with macOS 10.13 SDK
        https://bugs.webkit.org/show_bug.cgi?id=173939

        Reviewed by Dan Bernstein.

        (The code in this change was either suggested or written by Dan Bernstein with a very
        minor adjustment to get it to build).

        Allow WebCore to link even though CTFontCreatePhysicalFontForCharactersWithLanguage() is
        undefined when building against the macOS 10.13 SDK targeting macOS 10.12. Let the dynamic
        linker resolve the undefined symbol.

        For completeness the SPI CTFontCreatePhysicalFontForCharactersWithLanguage() was removed
        from the macOS 10.13 SDK.

        * Configurations/WebCore.xcconfig: Tell the linker that CTFontCreatePhysicalFontForCharactersWithLanguage()
        can be undefined when building against macOS 10.13 or later SDK.
        * platform/spi/cocoa/CoreTextSPI.h: Annotate CTFontCreatePhysicalFontForCharactersWithLanguage()
        with its availability information.

2017-07-10  Zalan Bujtas  <zalan@apple.com>

        Block of text is missing in iBooks sample books.
        https://bugs.webkit.org/show_bug.cgi?id=174295
        <rdar://problem/32955620>

        Reviewed by Antti Koivisto.

        In the simple line layout context, translating y coordinate to a line index is
        normally just a (y / line height) operation. However in case of strut offsets (pagination)
        we need to take these extra paddings into account while resolving the line index.
        This patch fixes the boundary checking for a given line by using the font size only
        when the font is taller than the line.

        * rendering/SimpleLineLayoutResolver.cpp:
        (WebCore::SimpleLineLayout::RunResolver::adjustLineIndexForStruts):

2017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>

        [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around)
        https://bugs.webkit.org/show_bug.cgi?id=166029

        Reviewed by Michael Catanzaro.

        Add clearSoupNetworkSessionAndCookieStorage() to clear the SoupNetworkSession and cookie storage of the main
        network session, ensuring the cookies database is properly closed.

        * platform/network/NetworkStorageSession.h:
        * platform/network/soup/NetworkStorageSessionSoup.cpp:
        (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):

2017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>

        Move make-js-file-arrays.py from WebCore to JavaScriptCore
        https://bugs.webkit.org/show_bug.cgi?id=174024

        Reviewed by Michael Catanzaro.

        * CMakeLists.txt: Explicitly add files generated by MAKE_JS_FILE_ARRAYS to the build, since the macro no longer
        does it.
        * DerivedSources.make: Updated to use make-js-file-arrays.py from JavaScriptCore. It's no longer needed to set
        PYTHON_PATH to find jsmin.py.

2017-07-10  Charlie Turner  <cturner@igalia.com>

        [GTK] http/tests/media/video-redirect.html is failing
        https://bugs.webkit.org/show_bug.cgi?id=174260

        Reviewed by Carlos Garcia Campos.

        Make sure we're testing new URLs within the same security origin.

        Covered by existing tests.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::convertToInternalProtocol): Factor out setting our
        internal URL schema.
        (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Use the
        refactored helper.
        (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Use
        refactored helper to ensure both URLs have the same origin.

2017-07-08  John Wilander  <wilander@apple.com>

        Resource Load Statistics: User interaction should always go to top document
        https://bugs.webkit.org/show_bug.cgi?id=174120
        <rdar://problem/33117899>

        Reviewed by Chris Dumez.

        Test: http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html

        * dom/UserGestureIndicator.cpp:
        (WebCore::UserGestureIndicator::UserGestureIndicator):
            Now logs user interaction for the top document.
        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::setThrottledObserverNotifications):
            Test infrastructure.
        (WebCore::ResourceLoadObserver::setNotificationCallback):
            Callback now takes a ResourceLoadObserver::NotificationType.
        (WebCore::ResourceLoadObserver::logFrameNavigation):
            Submits the configured ResourceLoadObserver::NotificationType.
        (WebCore::ResourceLoadObserver::logSubresourceLoading):
            Submits the configured ResourceLoadObserver::NotificationType.
        (WebCore::ResourceLoadObserver::logWebSocketLoading):
            Submits the configured ResourceLoadObserver::NotificationType.
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
            Submits the configured ResourceLoadObserver::NotificationType.
        * loader/ResourceLoadObserver.h:
        * testing/Internals.cpp:
        (WebCore::Internals::resetToConsistentState):
            Resets to throttled notifications.
        (WebCore::Internals::setResourceLoadStatisticsThrottledObserverNotifications):
            Test infrastructure.
        * testing/Internals.h:
        * testing/Internals.idl:
            Added internals.setResourceLoadStatisticsThrottledObserverNotifications().

2017-07-09  Brady Eidson  <beidson@apple.com>

        Remove some obsolete WebKitVersionChecks.
        https://bugs.webkit.org/show_bug.cgi?id=174294

        Reviewed by Dan Bernstein.

        No new tests (No change to testable behavior)

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::dispatchErrorEvent):
        
        * page/Settings.in:
        
        * platform/RuntimeApplicationChecks.h:
        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
        (WebCore::IOSApplication::isOkCupid): Deleted.
        (WebCore::IOSApplication::isFacebook): Deleted.
        
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::layoutOverflowRectForPropagation):

2017-07-08  Brady Eidson  <beidson@apple.com>

        Remove some obsolete RuntimeApplicationChecks.
        https://bugs.webkit.org/show_bug.cgi?id=174293

        Reviewed by Dan Bernstein.

        No new tests (No change to testable behavior)

        * html/HTMLObjectElement.cpp:
        (WebCore::HTMLObjectElement::parametersForPlugin):
        (WebCore::shouldNotPerformURLAdjustment): Deleted.

        * platform/RuntimeApplicationChecks.h:
        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
        (WebCore::IOSApplication::isDaijisenDictionary): Deleted.
        (WebCore::IOSApplication::isNASAHD): Deleted.
        (WebCore::IOSApplication::isTheEconomistOnIphone): Deleted.

        * platform/ios/wak/WebCoreThread.h:
        * platform/ios/wak/WebCoreThread.mm:
        (StartWebThread):
        (WebThreadSetDelegateSourceRunLoopMode): Deleted.

2017-07-08  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Safe access and life cycle management of bare Curl handle
        by wrapping with C++ class
        https://bugs.webkit.org/show_bug.cgi?id=174002

        Reviewed by Alex Christensen.

        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleInternal.h:
        * platform/network/curl/CookieJarCurl.cpp:
        (WebCore::setCookiesFromDOM):
        (WebCore::cookiesForSession):
        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlContext::CurlContext):
        (WebCore::CurlContext::~CurlContext):
        (WebCore::CurlContext::initCookieSession):
        (WebCore::CurlShareHandle::CurlShareHandle):
        (WebCore::CurlShareHandle::~CurlShareHandle):
        (WebCore::CurlShareHandle::lockCallback):
        (WebCore::CurlShareHandle::unlockCallback):
        (WebCore::CurlShareHandle::mutexFor):
        (WebCore::CurlMultiHandle::CurlMultiHandle):
        (WebCore::CurlMultiHandle::~CurlMultiHandle):
        (WebCore::CurlMultiHandle::addHandle):
        (WebCore::CurlMultiHandle::removeHandle):
        (WebCore::CurlMultiHandle::getFdSet):
        (WebCore::CurlMultiHandle::perform):
        (WebCore::CurlMultiHandle::readInfo):
        (WebCore::CurlHandle::CurlHandle):
        (WebCore::CurlHandle::~CurlHandle):
        (WebCore::CurlHandle::perform):
        (WebCore::CurlHandle::pause):
        (WebCore::CurlHandle::enableShareHandle):
        (WebCore::CurlHandle::setPrivateData):
        (WebCore::CurlHandle::setUrl):
        (WebCore::CurlHandle::clearUrl):
        (WebCore::CurlHandle::clearRequestHeaders):
        (WebCore::CurlHandle::appendRequestHeader):
        (WebCore::CurlHandle::enableRequestHeaders):
        (WebCore::CurlHandle::enableHttpGetRequest):
        (WebCore::CurlHandle::enableHttpHeadRequest):
        (WebCore::CurlHandle::enableHttpPostRequest):
        (WebCore::CurlHandle::setPostFields):
        (WebCore::CurlHandle::setPostFieldLarge):
        (WebCore::CurlHandle::enableHttpPutRequest):
        (WebCore::CurlHandle::setInFileSizeLarge):
        (WebCore::CurlHandle::setHttpCustomRequest):
        (WebCore::CurlHandle::enableAcceptEncoding):
        (WebCore::CurlHandle::enableAllowedProtocols):
        (WebCore::CurlHandle::enableFollowLocation):
        (WebCore::CurlHandle::enableAutoReferer):
        (WebCore::CurlHandle::enableHttpAuthentication):
        (WebCore::CurlHandle::setHttpAuthUserPass):
        (WebCore::CurlHandle::enableCAInfoIfExists):
        (WebCore::CurlHandle::setSslVerifyPeer):
        (WebCore::CurlHandle::setSslVerifyHost):
        (WebCore::CurlHandle::setSslCert):
        (WebCore::CurlHandle::setSslCertType):
        (WebCore::CurlHandle::setSslKeyPassword):
        (WebCore::CurlHandle::enableCookieJarIfExists):
        (WebCore::CurlHandle::setCookieList):
        (WebCore::CurlHandle::getCookieList):
        (WebCore::CurlHandle::clearCookieList):
        (WebCore::CurlHandle::enableProxyIfExists):
        (WebCore::CurlHandle::enableTimeout):
        (WebCore::CurlHandle::setHeaderCallbackFunction):
        (WebCore::CurlHandle::setWriteCallbackFunction):
        (WebCore::CurlHandle::setReadCallbackFunction):
        (WebCore::CurlHandle::setSslCtxCallbackFunction):
        (WebCore::CurlHandle::getEffectiveURL):
        (WebCore::CurlHandle::getPrimaryPort):
        (WebCore::CurlHandle::getResponseCode):
        (WebCore::CurlHandle::getContentLenghtDownload):
        (WebCore::CurlHandle::getHttpAuthAvail):
        (WebCore::CurlHandle::getTimes):
        (WebCore::CurlHandle::maxCurlOffT):
        (WebCore::CurlHandle::expectedSizeOfCurlOffT):
        (WebCore::CurlHandle::enableVerboseIfUsed):
        (WebCore::CurlHandle::enableStdErrIfUsed):
        (WebCore::CurlContext::getEffectiveURL): Deleted.
        (WebCore::CurlContext::createMultiHandle): Deleted.
        (WebCore::CurlContext::mutexFor): Deleted.
        (WebCore::CurlContext::lock): Deleted.
        (WebCore::CurlContext::unlock): Deleted.
        * platform/network/curl/CurlContext.h:
        (WebCore::CurlGlobal::CurlGlobal):
        (WebCore::CurlGlobal::~CurlGlobal):
        (WebCore::CurlShareHandle::handle):
        (WebCore::CurlContext::shareHandle):
        (WebCore::CurlHandle::handle):
        (WebCore::CurlHandle::url):
        (WebCore::CurlContext::curlShareHandle): Deleted.
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::~CurlDownload):
        (WebCore::CurlDownload::init):
        (WebCore::CurlDownload::start):
        (WebCore::CurlDownload::cancel):
        (WebCore::CurlDownload::getUrl):
        (WebCore::CurlDownload::addHeaders):
        (WebCore::CurlDownload::didReceiveHeader):
        (WebCore::CurlDownload::writeCallback):
        * platform/network/curl/CurlDownload.h:
        * platform/network/curl/CurlJobManager.cpp:
        (WebCore::CurlJobManager::CurlJobManager):
        (WebCore::CurlJobManager::~CurlJobManager):
        (WebCore::CurlJobManager::addToCurl):
        (WebCore::CurlJobManager::removeFromCurl):
        (WebCore::CurlJobManager::workerThread):
        * platform/network/curl/CurlJobManager.h:
        (WebCore::CurlJobManager::getMultiHandle): Deleted.
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
        (WebCore::ResourceHandle::platformSetDefersLoading):
        (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
        (WebCore::ResourceHandle::receivedCredential):
        (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
        (WebCore::calculateWebTimingInformations):
        (WebCore::handleLocalReceiveResponse):
        (WebCore::writeCallback):
        (WebCore::getProtectionSpace):
        (WebCore::headerCallback):
        (WebCore::readCallback):
        (WebCore::setupFormData):
        (WebCore::ResourceHandle::setupPUT):
        (WebCore::ResourceHandle::setupPOST):
        (WebCore::ResourceHandle::dispatchSynchronousJob):
        (WebCore::ResourceHandle::applyAuthentication):
        (WebCore::ResourceHandle::initialize):
        (WebCore::ResourceHandle::handleCurlMsg):
        * platform/network/curl/ResourceHandleManager.cpp:
        (WebCore::ResourceHandleManager::ResourceHandleManager):
        (WebCore::ResourceHandleManager::~ResourceHandleManager):
        (WebCore::ResourceHandleManager::downloadTimerCallback):
        (WebCore::ResourceHandleManager::removeFromCurl):
        (WebCore::ResourceHandleManager::startJob):
        * platform/network/curl/ResourceHandleManager.h:
        * platform/network/curl/SSLHandle.cpp:
        (WebCore::setSSLClientCertificate):
        (WebCore::certVerifyCallback):
        (WebCore::setSSLVerifyOptions):

2017-07-08  Antoine Quint  <graouts@apple.com>

        REGRESSION: "visibility:hidden" does not hide play button for video elements
        https://bugs.webkit.org/show_bug.cgi?id=174258
        <rdar://problem/33181452>

        Reviewed by Dean Jackson.

        In order to not have most styles from the page affect the shadow root, we set "all: initial" on the
        media controls container. However, we need to still make the "visibility" property inherit from its
        host such that "visibility: hidden" on the host won't be overridden by setting the property back to
        its initial value, which is "visible".

        Test: media/modern-media-controls/css/visibility-hidden.html

        * Modules/modern-media-controls/controls/media-controls.css:
        (.media-controls-container):

2017-07-08  Yusuke Suzuki  <utatane.tea@gmail.com>

        Drop NOSNIFF compile flag
        https://bugs.webkit.org/show_bug.cgi?id=174289

        Reviewed by Michael Catanzaro.

        * Configurations/FeatureDefines.xcconfig:
        * css/StyleSheetContents.cpp:
        (WebCore::StyleSheetContents::parseAuthorStyleSheet):
        (WebCore::StyleSheetContents::notifyLoadedSheet):
        * dom/LoadableClassicScript.cpp:
        (WebCore::LoadableClassicScript::notifyFinished):
        * loader/cache/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff):
        (WebCore::CachedCSSStyleSheet::canUseSheet):
        * loader/cache/CachedCSSStyleSheet.h:
        * platform/network/HTTPParsers.cpp:
        (WebCore::parseContentTypeOptionsHeader):
        * platform/network/HTTPParsers.h:
        * platform/network/ResourceResponseBase.cpp:
        (WebCore::isScriptAllowedByNosniff):
        * platform/network/ResourceResponseBase.h:
        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::didReceiveResponse):

2017-07-07  Brent Fulgham  <bfulgham@apple.com>

        [WK2] Use a rolling 30-day uptime for processing statistics
        https://bugs.webkit.org/show_bug.cgi?id=174235
        <rdar://problem/33164381>

        Reviewed by Chris Dumez.

        Add a KeyedDecoder specialization for Deque.

        * platform/KeyedCoding.h:
        (WebCore::KeyedDecoder::decodeObjects):

2017-07-07  Daniel Bates  <dabates@apple.com>

        [AppCache] Ignore fallback entries whose namespace is not prefixed with manifest path
        https://bugs.webkit.org/show_bug.cgi?id=174273
        <rdar://problem/33011682>

        Reviewed by Brent Fulgham.

        As per <https://html.spec.whatwg.org/multipage/offline.html#parsing-cache-manifests> (07/06/2017)
        we should ignore fallback entires whose fallback namespace URL is not prefixed with
        the manifest path. For now we only apply this policy when the manifest is served with
        a non-standard Content-Type to minimize web compatibility risk.

        Test: http/tests/appcache/fallback-namespace-outside-manifest-path.html

        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): Pass the MIME type of the manifest.
        * loader/appcache/ManifestParser.cpp:
        (WebCore::manifestPath): Computes the manifest path from a manifest URL.
        (WebCore::parseManifest): Modified to take the MIME type of the manifest. If the MIME type is
        non-standard (i.e. not text/cached-manifest) then skip fallback entries whose namespace is not
        prefixed with the manifest path. Otherwise, process fallback entries as we do now. Also cleaned
        up the code a bit while I was here, including renaming a local variable to be more descriptive
        and using a const character array for the manifest signature to avoid the need to document the
        length of the manifest signature in a comment.
        * loader/appcache/ManifestParser.h:

2017-07-07  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS DnD] For cross-app drags, 'drop' event handlers are never invoked if dataTransfer.dropEffect is not set while dragging
        https://bugs.webkit.org/show_bug.cgi?id=174219
        <rdar://problem/32083177>

        Reviewed by Ryosuke Niwa.

        Currently, in DragController.cpp, defaultOperationForDrag maps a drag source operation mask of
        DragOperationGeneric to DragOperationMove across all platforms. However, on iOS, where cross-app drag moves do
        not trigger a drop, this means drop handlers won't fire unless the dropEffect is explicitly set to copy.

        To fix this, we introduce DragController::platformGenericDragOperation(), which returns DragOperationCopy on iOS
        and DragOperationMove (the existing behavior) elsewhere. defaultOperationForDrag then maps a drag source
        operation mask of DragOperationGeneric to platformGenericDragOperation().

        Tests:  DataInteractionTests.ExternalSourceHTMLToUploadArea
                DataInteractionTests.ExternalSourceImageAndHTMLToUploadArea
                DataInteractionTests.ExternalSourceMoveOperationNotAllowed

        * page/DragController.cpp:
        (WebCore::DragController::platformGenericDragOperation):
        (WebCore::defaultOperationForDrag):
        * page/DragController.h:
        * page/mac/DragControllerMac.mm:
        (WebCore::DragController::platformGenericDragOperation):

2017-07-07  Devin Rousso  <drousso@apple.com>

        Web Inspector: Show all elements currently using a given CSS Canvas
        https://bugs.webkit.org/show_bug.cgi?id=173965

        Reviewed by Joseph Pecoraro.

        Test: inspector/canvas/css-canvas-clients.html

        * css/CSSImageGeneratorValue.cpp:
        (WebCore::CSSImageGeneratorValue::addClient):
        (WebCore::CSSImageGeneratorValue::removeClient):
        * css/CSSImageGeneratorValue.h:
        (WebCore::CSSImageGeneratorValue::clients):
        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::addObserver):
        (WebCore::HTMLCanvasElement::removeObserver):
        (WebCore::HTMLCanvasElement::cssCanvasClients):
        Each time an observer is added/removed for a given HTMLCanvasElement, send an event to the
        inspector frontend that the CSS canvas client nodes have changed. Additionally, anytime a
        client/use is added/removed from one of the observing CSSCanvasValue, fire the same event.

        * css/CSSCanvasValue.h:
        (isType):
        * html/HTMLCanvasElement.h:
        (WebCore::CanvasObserver::isCSSCanvasValueObserver):
        Allows type traits to distinguish CanvasObserver from CSSCanvasValue::CanvasObserverProxy.

        * inspector/InspectorCanvasAgent.h:
        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
        (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
        Notify the frontend that the list of client nodes has changed for the given canvas. Let the
        frontend request the actual list of node IDs when it needs, possibly at a later time.

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

        AVPlayer can continue to be active after released by MediaPlayerPrivateAVFoundationObjC.
        https://bugs.webkit.org/show_bug.cgi?id=174264

        Reviewed by Eric Carlson.

        If the AVPlayer is retained (by an autorelease pool, or internally by other objects in
        AVFoundation), releasing the AVPlayer is not enough to cancel loading or playback. So before
        releasing the AVPlayer, make sure to disassociate the current AVPlayerItem, which should
        cancel all activity in the AVPlayer.

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

2017-07-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Remove data url handler for async load
        https://bugs.webkit.org/show_bug.cgi?id=174263

        data url is handled by ResourceLoader. No need for specific handling
        in platform dependent layer.

        Reviewed by Alex Christensen.

        * platform/network/curl/ResourceHandleManager.cpp:
        (WebCore::ResourceHandleManager::startJob):

2017-07-07  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219257.

        The test added in the revision was still extreamly flaky on
        all testers.

        Reverted changeset:

        "[SVG] Leak in SVGAnimatedListPropertyTearOff"
        https://bugs.webkit.org/show_bug.cgi?id=172545
        http://trac.webkit.org/changeset/219257

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

        Unreviewed, rolling out r219238, r219239, and r219241.
        https://bugs.webkit.org/show_bug.cgi?id=174265

        "fast/workers/dedicated-worker-lifecycle.html is flaky"
        (Requested by yusukesuzuki on #webkit).

        Reverted changesets:

        "[WTF] Implement WTF::ThreadGroup"
        https://bugs.webkit.org/show_bug.cgi?id=174081
        http://trac.webkit.org/changeset/219238

        "Unreviewed, build fix after r219238"
        https://bugs.webkit.org/show_bug.cgi?id=174081
        http://trac.webkit.org/changeset/219239

        "Unreviewed, CLoop build fix after r219238"
        https://bugs.webkit.org/show_bug.cgi?id=174081
        http://trac.webkit.org/changeset/219241

2017-05-24  Sergio Villar Senin  <svillar@igalia.com>

        [SVG] Leak in SVGAnimatedListPropertyTearOff
        https://bugs.webkit.org/show_bug.cgi?id=172545

        Reviewed by Said Abou-Hallawa.

        SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
        SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
        reference to SVGAnimatedProperty.

        When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
        SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
        SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
        is going to be added to. This effectively creates a reference cycle between the
        SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.

        We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.

        * svg/properties/SVGAnimatedListPropertyTearOff.h:

2017-07-07  Charlie Turner  <cturner@igalia.com>

        [GStreamer] vid.me videos do not play
        https://bugs.webkit.org/show_bug.cgi?id=172240

        Reviewed by Xabier Rodriguez-Calvar.

        In r142251, code to hide the WK HTTP source elements from elsewhere in
        the pipeline was removed. This has the nasty side-effect of
        auto-plugging the WK HTTP source into things it really should not be
        used in, especially the adaptive streaming demuxers. The reasons this
        is bad are documented in several places on Bugzilla, see the parent
        bug report for more details. The high-level issue is that the WK HTTP
        source and its use of WebCore is not thread-safe. Although work has
        been recently done to improve this situation, it's still not perfect.

        Another issue is the interface hlsdemux expects its HTTP source to
        implement, specifically seeking in READY.

        This does rely on HTTP context sharing being available in GStreamer,
        upstream bug is here:
        https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case
        can be demonstrated with
        https://github.com/thiagoss/adaptive-test-server but manual testing on
        popular video hosting sites, including vid.me, shows that this doesn't
        bite us at the moment, just something else to fix in the future.

        There are some QoS issues with the adaptive streaming code in
        GStreamer, but it seems much better to offer a below par QoS in lieu
        of crashing/livelocking when playing certain streams, and issues can be
        raised upstream when they arise.

        This patch does take us further away from the future goal of having all
        networking operations go through the network process, but in return it
        solves some nasty crashes and livelocks that have been irritating
        users for some time. With the pressure off on this issue, work can be
        planned to consider how to make the WK HTTP source a better citizen
        inside the GStreamer pipeline when we migrate the netcode to go
        through the network process.

        A new test is added to check that the single file HLS playlists
        (new in version 4) can be played, which was the primary cause of
        this bug report.

        Test: http/tests/media/hls/range-request.html

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform
        some trickery to make sure that we only ever fetch URLs handed to
        us by WebCore. Any further URLs discovered inside the pipeline
        will not get WKWS auto-plugged, since they'll be plain https?
        schemas.
        (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the
        setPlaybinURL helper method.
        (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
        the setPlaybinURL helper method.
        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (webKitWebSrcGetProtocols): Only advertise webkit+https?, this
        ensures we won't get auto-plugged by pipeline elements asking for
        an element to fetch https? resources (like adaptive demuxers).
        (convertPlaybinURI): Undo the trick when another element asks us
        for our URI.

2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Implement WTF::ThreadGroup
        https://bugs.webkit.org/show_bug.cgi?id=174081

        Reviewed by Mark Lam.

        * page/ResourceUsageThread.h:

2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
        https://bugs.webkit.org/show_bug.cgi?id=174150

        Reviewed by Mark Lam.

        * Modules/mediacontrols/MediaControlsHost.cpp:
        (WebCore::MediaControlsHost::captionDisplayMode):
        * Modules/mediastream/RTCDataChannel.cpp:
        (WebCore::RTCDataChannel::binaryType):
        * accessibility/AXObjectCache.cpp:
        (WebCore::createFromRenderer):
        * accessibility/AccessibilityMediaControls.cpp:
        (WebCore::AccessibilityMediaControl::controlTypeName):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::language):
        (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
        (WebCore::AccessibilityObject::actionVerb):
        (WebCore::AccessibilityObject::getAttribute):
        (WebCore::AccessibilityObject::placeholderValue):
        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityObject::accessKey):
        (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::accessKey):
        (WebCore::AccessibilityRenderObject::actionVerb):
        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::constructElementWithFallback):
        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::JSCustomElementRegistry::define):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateDefaultValue):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
        * css/CSSPageRule.cpp:
        (WebCore::CSSPageRule::selectorText):
        * css/CSSPrimitiveValue.cpp:
        (WebCore::valueName):
        * css/CSSSelector.cpp:
        (WebCore::simpleSelectorSpecificityInternal):
        (WebCore::CSSSelector::specificityForPage):
        (WebCore::CSSSelector::RareData::RareData):
        * css/CSSSelector.h:
        (WebCore::CSSSelector::argument):
        * css/CSSSelectorList.cpp:
        (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
        * css/PageRuleCollector.cpp:
        (WebCore::checkPageSelectorComponents):
        * css/RuleSet.cpp:
        (WebCore::computeMatchBasedOnRuleHash):
        (WebCore::RuleSet::addRule):
        * css/SelectorChecker.cpp:
        (WebCore::tagMatches):
        * css/SelectorFilter.cpp:
        (WebCore::collectDescendantSelectorIdentifierHashes):
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertStringOrAuto):
        (WebCore::StyleBuilderConverter::convertStringOrNone):
        * css/StyleBuilderCustom.h:
        (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
        (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
        (WebCore::StyleBuilderCustom::applyValueContent):
        (WebCore::StyleBuilderCustom::applyValueAlt):
        * css/StyleSheetContents.cpp:
        (WebCore::StyleSheetContents::StyleSheetContents):
        (WebCore::StyleSheetContents::namespaceURIFromPrefix):
        * css/makeprop.pl:
        * css/parser/CSSParserImpl.cpp:
        (WebCore::CSSParserImpl::parsePageSelector):
        * css/parser/CSSSelectorParser.cpp:
        (WebCore::CSSSelectorParser::consumeCompoundSelector):
        (WebCore::CSSSelectorParser::consumeName):
        (WebCore::CSSSelectorParser::consumeAttribute):
        (WebCore::CSSSelectorParser::defaultNamespace):
        (WebCore::CSSSelectorParser::determineNamespace):
        (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
        (WebCore::SelectorCompiler::equalTagNames):
        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
        * dom/Attr.cpp:
        (WebCore::Attr::setPrefix):
        (WebCore::Attr::attachToElement):
        * dom/Attribute.h:
        (WebCore::Attribute::nameMatchesFilter):
        * dom/ConstantPropertyMap.cpp:
        (WebCore::ConstantPropertyMap::nameForProperty):
        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::getElementsByTagName):
        (WebCore::ContainerNode::getElementsByTagNameNS):
        * dom/CustomElementReactionQueue.cpp:
        (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
        * dom/DatasetDOMStringMap.cpp:
        (WebCore::convertPropertyNameToAttributeName):
        * dom/Document.cpp:
        (WebCore::createUpgradeCandidateElement):
        (WebCore::Document::createElementForBindings):
        (WebCore::Document::importNode):
        (WebCore::Document::hasValidNamespaceForElements):
        (WebCore::Document::processBaseElement):
        (WebCore::Document::dir):
        (WebCore::Document::bgColor):
        (WebCore::Document::fgColor):
        (WebCore::Document::alinkColor):
        (WebCore::Document::linkColorForBindings):
        (WebCore::Document::vlinkColor):
        * dom/Document.h:
        * dom/Element.cpp:
        (WebCore::Element::setBooleanAttribute):
        (WebCore::Element::synchronizeAttribute):
        (WebCore::Element::getAttribute):
        (WebCore::Element::getAttributeNS):
        (WebCore::Element::setAttribute):
        (WebCore::Element::parserSetAttributes):
        (WebCore::Element::didMoveToNewDocument):
        (WebCore::Element::setPrefix):
        (WebCore::Element::insertedInto):
        (WebCore::Element::removedFrom):
        (WebCore::Element::removeAttributeInternal):
        (WebCore::Element::addAttributeInternal):
        (WebCore::Element::removeAttributeNS):
        (WebCore::Element::getAttributeNodeNS):
        (WebCore::Element::hasAttributeNS):
        (WebCore::Element::computeInheritedLanguage):
        (WebCore::Element::updateNameForDocument):
        (WebCore::Element::updateIdForDocument):
        (WebCore::Element::didAddAttribute):
        (WebCore::Element::didRemoveAttribute):
        (WebCore::Element::cloneAttributesFromElement):
        * dom/Element.h:
        (WebCore::Element::attributeWithoutSynchronization):
        (WebCore::Element::idForStyleResolution):
        (WebCore::Element::getIdAttribute):
        (WebCore::Element::getNameAttribute):
        * dom/EventTarget.cpp:
        (WebCore::legacyType):
        * dom/MutationRecord.h:
        (WebCore::MutationRecord::attributeName):
        (WebCore::MutationRecord::attributeNamespace):
        * dom/NamedNodeMap.cpp:
        (WebCore::NamedNodeMap::removeNamedItemNS):
        * dom/Node.cpp:
        (WebCore::Node::prefix):
        (WebCore::Node::localName):
        (WebCore::Node::namespaceURI):
        (WebCore::Node::checkSetPrefix):
        (WebCore::locateDefaultNamespace):
        (WebCore::Node::isDefaultNamespace):
        (WebCore::Node::lookupNamespaceURI):
        (WebCore::locateNamespacePrefix):
        (WebCore::Node::lookupPrefix):
        * dom/NodeRareData.h:
        (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
        (WebCore::NodeListsNodeData::addCachedCollection):
        (WebCore::NodeListsNodeData::cachedCollection):
        (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
        (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
        (WebCore::NodeListsNodeData::removeCachedCollection):
        * dom/PseudoElement.cpp:
        (WebCore::pseudoElementTagName):
        * dom/QualifiedName.cpp:
        (WebCore::QualifiedName::init):
        (WebCore::nullQName):
        (WebCore::createQualifiedName):
        * dom/QualifiedName.h:
        (WebCore::QualifiedName::hasPrefix):
        * dom/SelectorQuery.cpp:
        (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
        * dom/SlotAssignment.cpp:
        (WebCore::slotNameFromAttributeValue):
        * dom/SlotAssignment.h:
        (WebCore::SlotAssignment::defaultSlotName):
        (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
        (WebCore::ShadowRoot::didChangeDefaultSlot):
        * dom/TagCollection.cpp:
        (WebCore::TagCollection::TagCollection):
        (WebCore::HTMLTagCollection::HTMLTagCollection):
        * dom/TagCollection.h:
        (WebCore::TagCollectionNS::elementMatches):
        * dom/make_names.pl:
        (printNamesCppFile):
        (printDefinitions):
        (printFactoryCppFile):
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::removeNodeAttribute):
        * editing/Editing.cpp:
        (WebCore::createHTMLElement):
        * editing/MarkupAccumulator.cpp:
        (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
        (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
        (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
        (WebCore::MarkupAccumulator::appendNamespace):
        (WebCore::MarkupAccumulator::appendOpenTag):
        (WebCore::MarkupAccumulator::appendAttribute):
        * editing/gtk/EditorGtk.cpp:
        (WebCore::elementURL):
        * editing/markup.cpp:
        (WebCore::AttributeChange::AttributeChange):
        * html/Autocapitalize.cpp:
        (WebCore::stringForAutocapitalizeType):
        * html/Autofill.cpp:
        (WebCore::AutofillData::createFromHTMLFormControlElement):
        * html/DOMTokenList.h:
        (WebCore::DOMTokenList::item):
        * html/FormAssociatedElement.cpp:
        (WebCore::FormAssociatedElement::name):
        * html/HTMLButtonElement.cpp:
        (WebCore::HTMLButtonElement::formControlType):
        * html/HTMLDetailsElement.cpp:
        (WebCore::HTMLDetailsElement::toggleOpen):
        * html/HTMLDocument.cpp:
        (WebCore::HTMLDocument::isCaseSensitiveAttribute):
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
        (WebCore::toValidDirValue):
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::name):
        (WebCore::HTMLInputElement::updateType):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::doesHaveAttribute):
        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::createForJSConstructor):
        * html/HTMLParamElement.cpp:
        (WebCore::HTMLParamElement::name):
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::setMultiple):
        * html/HTMLTableCellElement.cpp:
        (WebCore::HTMLTableCellElement::scope):
        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
        * html/LabelableElement.cpp:
        (WebCore::LabelableElement::labels):
        * html/LabelsNodeList.cpp:
        (WebCore::LabelsNodeList::~LabelsNodeList):
        * html/MediaController.cpp:
        (MediaController::playbackState):
        (eventNameForReadyState):
        * html/MediaDocument.cpp:
        (WebCore::MediaDocumentParser::createDocumentStructure):
        * html/parser/AtomicHTMLToken.h:
        (WebCore::AtomicHTMLToken::initializeAttributes):
        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::HTMLConstructionSite::createElement):
        (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
        * html/parser/HTMLParserIdioms.cpp:
        (WebCore::stripLeadingAndTrailingHTMLSpaces):
        (WebCore::parseHTMLHashNameReference):
        * html/parser/HTMLTreeBuilder.cpp:
        (WebCore::createForeignAttributesMap):
        * html/track/InbandTextTrack.cpp:
        (WebCore::InbandTextTrack::InbandTextTrack):
        * html/track/LoadableTextTrack.cpp:
        (WebCore::LoadableTextTrack::id):
        * html/track/TextTrack.cpp:
        (WebCore::TextTrack::captionMenuOffItem):
        (WebCore::TextTrack::captionMenuAutomaticItem):
        * html/track/TrackBase.cpp:
        (WebCore::MediaTrackBase::setKindInternal):
        * html/track/VTTRegion.cpp:
        (WebCore::VTTRegion::scroll):
        * html/track/WebVTTElement.cpp:
        (WebCore::nodeTypeToTagName):
        * html/track/WebVTTElement.h:
        * html/track/WebVTTToken.h:
        (WebCore::WebVTTToken::StartTag):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::clear):
        * loader/FrameLoader.h:
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::clearFailedLoadURL):
        * loader/NavigationAction.h:
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNavigationPolicy):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::showModalDialog):
        * page/EventHandler.cpp:
        (WebCore::eventNameForTouchPointState):
        * page/FrameTree.cpp:
        (WebCore::FrameTree::setName):
        (WebCore::FrameTree::clearName):
        * page/Page.cpp:
        (WebCore::Page::groupName):
        * platform/graphics/ComplexTextController.cpp:
        (WebCore::ComplexTextController::offsetForPosition):
        * platform/graphics/FontCache.cpp:
        (WebCore::FontCache::alternateFamilyName):
        * platform/graphics/FontDescription.h:
        (WebCore::FontCascadeDescription::initialLocale):
        * platform/graphics/FontGenericFamilies.cpp:
        (WebCore::genericFontFamilyForScript):
        * platform/graphics/InbandTextTrackPrivate.h:
        (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
        * platform/graphics/TrackPrivateBase.h:
        (WebCore::TrackPrivateBase::id):
        (WebCore::TrackPrivateBase::label):
        (WebCore::TrackPrivateBase::language):
        * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
        (WebCore::AVTrackPrivateAVFObjCImpl::id):
        (WebCore::AVTrackPrivateAVFObjCImpl::label):
        (WebCore::AVTrackPrivateAVFObjCImpl::language):
        * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
        (WebCore::InbandTextTrackPrivateAVCF::label):
        (WebCore::InbandTextTrackPrivateAVCF::language):
        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
        (WebCore::InbandTextTrackPrivateLegacyAVCF::label):
        (WebCore::InbandTextTrackPrivateLegacyAVCF::language):
        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
        (WebCore::InbandTextTrackPrivateAVFObjC::label):
        (WebCore::InbandTextTrackPrivateAVFObjC::language):
        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
        (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
        (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::metadataType):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::FontCache::platformAlternateFamilyName):
        * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
        (WebCore::FontCascadeDescription::effectiveFamilyAt):
        * platform/graphics/freetype/FontCacheFreeType.cpp:
        (WebCore::FontCache::platformAlternateFamilyName):
        * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
        (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
        * platform/graphics/win/FontCacheWin.cpp:
        (WebCore::FontCache::platformAlternateFamilyName):
        * platform/mediastream/AudioTrackPrivateMediaStream.h:
        * platform/mediastream/RealtimeMediaSourceSettings.cpp:
        (WebCore::RealtimeMediaSourceSettings::facingMode):
        * platform/mediastream/VideoTrackPrivateMediaStream.h:
        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::linkSuggestedFilename):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paint):
        * rendering/RenderListItem.cpp:
        (WebCore::RenderListItem::markerText):
        * rendering/RenderText.cpp:
        (WebCore::RenderText::previousOffset):
        (WebCore::RenderText::nextOffset):
        * rendering/RenderTreeAsText.cpp:
        (WebCore::RenderTreeAsText::writeRenderObject):
        * rendering/TextPainter.cpp:
        (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::textEmphasisMarkString):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::initialHyphenationString):
        (WebCore::RenderStyle::initialTextEmphasisCustomMark):
        (WebCore::RenderStyle::initialContentAltText):
        (WebCore::RenderStyle::initialLineGrid):
        (WebCore::RenderStyle::initialFlowThread):
        (WebCore::RenderStyle::initialRegionThread):
        * style/StyleScope.cpp:
        (WebCore::Style::Scope::collectActiveStyleSheets):
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::getPresentationAttribute):
        * svg/SVGElement.h:
        (WebCore::SVGAttributeHashTranslator::hash):
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::constructAttributeName):
        * testing/MockCDMFactory.cpp:
        (WebCore::MockCDMInstance::requestLicense):
        * xml/XMLErrors.cpp:
        (WebCore::createXHTMLParserErrorHeader):
        * xml/XPathStep.cpp:
        (WebCore::XPath::nodeMatchesBasicTest):
        (WebCore::XPath::Step::nodesInAxis):
        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::XMLDocumentParser::XMLDocumentParser):
        (WebCore::handleNamespaceAttributes):
        (WebCore::handleElementAttributes):

2017-07-06  Chris Dumez  <cdumez@apple.com>

        Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver
        https://bugs.webkit.org/show_bug.cgi?id=174234

        Reviewed by Brent Fulgham.

        Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver. It is
        always 0 since this member is only initialized later on, in the UIProcess.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::logFrameNavigation):
        (WebCore::ResourceLoadObserver::logSubresourceLoading):
        (WebCore::ResourceLoadObserver::logWebSocketLoading):

2017-07-06  Yoav Weiss  <yoav@yoav.ws>

        [preload] Avoid reflecting "video" and "audio" when they are not supported `as` value
        https://bugs.webkit.org/show_bug.cgi?id=174199

        Reviewed by Youenn Fablet.

        No new tests as video/audio is supported in tests. I tested this manually.

        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::as): Make sure "video" and "audio" will not be reflected when they are not supported.

2017-07-06  Chris Dumez  <cdumez@apple.com>

        Drop unused ResourceLoadStatistics members
        https://bugs.webkit.org/show_bug.cgi?id=174226

        Reviewed by Brent Fulgham.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::logFrameNavigation):
        (WebCore::ResourceLoadObserver::logSubresourceLoading):
        (WebCore::ResourceLoadObserver::logWebSocketLoading):
        (WebCore::ResourceLoadObserver::isPrevalentResource): Deleted.
        * loader/ResourceLoadObserver.h:
        * loader/ResourceLoadStatistics.cpp:
        (WebCore::ResourceLoadStatistics::encode):
        (WebCore::ResourceLoadStatistics::decode):
        (WebCore::ResourceLoadStatistics::toString):
        (WebCore::ResourceLoadStatistics::merge):
        * loader/ResourceLoadStatistics.h:

2017-07-06  Youenn Fablet  <youenn@apple.com>

        Rendering of WebRTC audio in AudioSampleDataSource may trigger crackles
        https://bugs.webkit.org/show_bug.cgi?id=174223

        Reviewed by Eric Carlson.

        We try reading too quickly and need to back off a little bit if we do not enough data.
        This only affects real audio and not web audio, hence validated through manual testing only.

        * platform/audio/mac/AudioSampleDataSource.mm:
        (WebCore::AudioSampleDataSource::pullSamplesInternal):

2017-07-06  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove custom bindings for WebGL code dealing with WebGL extensions
        https://bugs.webkit.org/show_bug.cgi?id=174186

        Reviewed by Alex Christensen.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        Update files. Categorize some of the remaining custom bindings into groups.

        * bindings/IDLTypes.h:
        Add a IDLWebGLExtension type, to model the special WebGLExtension type. In
        the future, WebGLExtension can probably be replaced by a Variant.
        
        * bindings/js/JSDOMConvertWebGL.cpp: Added.
        Move WebGLAny's convertToJSValue and add a convertToJSValue for WebGLExtension.

        * bindings/js/JSDOMConvertWebGL.h:
        (WebCore::convertToJSValue):
        Since WebGLExtension is a wrapper type, we need both a pointer and reference variant
        of the conversion.

        (WebCore::JSConverter<IDLWebGLExtension>::convert):
        Added.

        * bindings/js/JSWebGL2RenderingContextCustom.cpp:
        (WebCore::toJS): Deleted.
        (WebCore::JSWebGL2RenderingContext::getExtension): Deleted.
        Remove custom operation and converter.

        * bindings/js/JSWebGLRenderingContextCustom.cpp:
        (WebCore::toJS): Deleted.
        (WebCore::JSWebGLRenderingContext::getExtension): Deleted.
        Remove custom operation and converter.

        * bindings/scripts/CodeGeneratorJS.pm:
        (AddToIncludesForIDLType):
        (NativeToJSValueDOMConvertNeedsState):
        (NativeToJSValueDOMConvertNeedsGlobalObject):
        Add support for IDLWebGLExtension.

        * html/canvas/WebGLAny.cpp: Removed.
        * html/canvas/WebGLAny.h:
        Moved convertToJSValue to the bindings where it belongs.

        * html/canvas/WebGLRenderingContextBase.idl:
        Annotate getExtension with [OverrideIDLType=IDLWebGLExtension].

2017-07-06  Joseph Pecoraro  <pecoraro@apple.com>

        [Cocoa] CTParagraphStyle leak under WebCore::LinkImageLayout::LinkImageLayout
        https://bugs.webkit.org/show_bug.cgi?id=174228

        Reviewed by Andreas Kling.

        * platform/mac/DragImageMac.mm:
        (WebCore::LinkImageLayout::LinkImageLayout):

2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Improve performance of font lookups
        https://bugs.webkit.org/show_bug.cgi?id=173960
        <rdar://problem/31996891>

        Reviewed by Darin Adler.

        Looking up kCTFontPostScriptNameAttribute is faster than kCTFontNameAttribute.

        No new tests because there is no behavior change.

        * platform/spi/cocoa/CoreTextSPI.h:
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::FontDatabase::fontForPostScriptName):

2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>

        REGRESSION(r216944): Font loads can cause Chinese characters to draw as .notdef
        https://bugs.webkit.org/show_bug.cgi?id=173962
        <rdar://problem/32925318>

        Reviewed by Simon Fraser.

        Previously, there was no signalling between our font loading code
        which determined whether or not a font should be invisible (because
        its in the middle of loading) and our system fallback code which
        created fonts when we fall off the end of the fallback list. Because
        of this, we were doing two things wrong:

        1. When we started downloading a font, we would try to use a fallback
        font. However, if the fallback font didn't suppor the character we're
        trying to render, we would just bail and draw .notdef
        2. Even if we continued down the fallback list, and fell of the end,
        we wouldn't realize that the system fallback font should also be drawn
        as invisible.

        This patch solves these two problems by:
        1. Performing a search to find the best (local) fallback font with
        which to fall systemFallbackFontForCharacter(). This way, if you say
        "font-family: 'RemoteFont', 'Helvetica'" we will use Helvetica as
        the lookup to ask the system to search for.
        2. Give the Font class an accessor which can create a duplicate, but
        invisible font. Give FontCascadeFonts::glyphDataForVariant() the
        correct tracking to know when to use this invisible duplicate.

        Tests: fast/text/font-loading-system-fallback.html
               http/tests/webfont/font-loading-system-fallback-visibility.html

        * platform/graphics/Font.cpp:
        (WebCore::Font::invisibleFont):
        * platform/graphics/Font.h:
        * platform/graphics/FontCascadeFonts.cpp:
        (WebCore::findBestFallbackFont):
        (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
        (WebCore::FontCascadeFonts::glyphDataForVariant):
        * platform/graphics/FontCascadeFonts.h:

2017-07-06  Chris Dumez  <cdumez@apple.com>

        FileMonitor should not be ref counted
        https://bugs.webkit.org/show_bug.cgi?id=174166

        Reviewed by Brent Fulgham.

        Update FileMonitor to no longer be refcounted. It was previously easy to leak it
        because the object would ref itself in various lambdas. The client would have to
        explicitely call FileMonitor::stopMonitoring() which was fragile.

        This patch also simplifies the code and API a bit since no longer actually
        requires startMonitoring() / stopMonitoring() API.

        No new tests, covered by API tests.

        * platform/FileMonitor.cpp:
        (WebCore::FileMonitor::FileMonitor):
        (WebCore::FileMonitor::~FileMonitor):
        (WebCore::FileMonitor::create): Deleted.
        (WebCore::FileMonitor::startMonitoring): Deleted.
        (WebCore::FileMonitor::stopMonitoring): Deleted.
        * platform/FileMonitor.h:
        * platform/cocoa/FileMonitorCocoa.mm:
        (WebCore::FileMonitor::FileMonitor):
        (WebCore::FileMonitor::~FileMonitor):
        (WebCore::FileMonitor::startMonitoring): Deleted.
        (WebCore::FileMonitor::stopMonitoring): Deleted.

2017-07-06  Matt Rajca  <mrajca@apple.com>

        Fix build with VIDEO support disabled.
        https://bugs.webkit.org/show_bug.cgi?id=174217

        Unreviewed build fix.

        * page/Page.cpp:

2017-07-06  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219193.

        The tests added with this revision were extreamly flaky on all
        platforms.

        Reverted changeset:

        "[SVG] Leak in SVGAnimatedListPropertyTearOff"
        https://bugs.webkit.org/show_bug.cgi?id=172545
        http://trac.webkit.org/changeset/219193

2017-07-06  Zalan Bujtas  <zalan@apple.com>

        Use WTFLogAlways for debug logging so that it shows up in device system logs
        https://bugs.webkit.org/show_bug.cgi?id=173450

        Reviewed by Simon Fraser.

        If you want to showRenderTree() on-device, the result doesn't show in system log so you can't see it.
        Switch to WTFLogAlways to fix this, for showRenderTree and its dependencies.
        
        * platform/text/TextStream.cpp:
        (WebCore::writeIndent):
        * rendering/InlineBox.cpp:
        (WebCore::InlineBox::showLineTreeAndMark):
        (WebCore::InlineBox::showLineBox):
        * rendering/InlineBox.h:
        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::showLineTreeAndMark):
        * rendering/InlineFlowBox.h:
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::showLineBox):
        * rendering/InlineTextBox.h:
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::showLineTreeAndMark):
        * rendering/RenderBlockFlow.h:
        * rendering/RenderObject.cpp:
        (WebCore::showRenderTreeLegend):
        (WebCore::RenderObject::showRenderTreeForThis):
        (WebCore::RenderObject::showLineTreeForThis):
        (WebCore::RenderObject::showRegionsInformation):
        (WebCore::RenderObject::showRenderObject):
        (WebCore::RenderObject::showRenderSubTreeAndMark):
        * rendering/RenderObject.h:
        * rendering/SimpleLineLayoutFunctions.cpp:
        (WebCore::SimpleLineLayout::printPrefix):
        (WebCore::SimpleLineLayout::showLineLayoutForFlow):
        * rendering/SimpleLineLayoutFunctions.h:

2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>

        Unify FontCascadeFonts::glyphDataForVariant() and FontCascadeFonts::glyphDataForNormalVariant()
        https://bugs.webkit.org/show_bug.cgi?id=174213

        Reviewed by Zalan Bujtas.

        They have almost identical code. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=173962

        No new tests because there is no behavior change.

        * platform/graphics/FontCascadeFonts.cpp:
        (WebCore::FontCascadeFonts::glyphDataForVariant):
        (WebCore::FontCascadeFonts::glyphDataForCharacter):
        (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Deleted.
        * platform/graphics/FontCascadeFonts.h:

2017-07-06  Don Olmstead  <don.olmstead@sony.com>

        [PAL] Move KillRing into PAL
        https://bugs.webkit.org/show_bug.cgi?id=173900

        Reviewed by Myles C. Maxfield.

        No new tests. No change in functionality.

        * Configurations/WebCore.xcconfig:
        * PlatformGTK.cmake:
        * PlatformMac.cmake:
        * PlatformWPE.cmake:
        * PlatformWin.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * editing/Editor.cpp:
        (WebCore::Editor::Editor):
        * editing/Editor.h:
        (WebCore::Editor::killRing):
        * editing/EditorCommand.cpp:

2017-07-06  Devin Rousso  <drousso@apple.com>

        Web Inspector: Support getting the content of WebGL/WebGL2 contexts
        https://bugs.webkit.org/show_bug.cgi?id=173569
        <rdar://problem/33112420>

        Reviewed by Joseph Pecoraro.

        Tests: inspector/canvas/requestContent-2d.html
               inspector/canvas/requestContent-webgl.html
               inspector/canvas/requestContent-webgl2.html

        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::clearIfComposited):
        * html/canvas/WebGLRenderingContextBase.h:
        (WebCore::WebGLRenderingContextBase::preventBufferClearForInspector):
        (WebCore::WebGLRenderingContextBase::setPreventBufferClearForInspector):
        Add a flag that will prevent the context buffer from being cleared, allowing it to be copied
        within a toDataURL call. This is currently only used by InspectorCanvasAgent::requestContent.

        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::requestContent):
        Since toDataURL attempts to force the canvas to redraw, we can preserve the buffer after it
        finishes drawing so that it can be copied, instead of it normally being swapped out.

2017-07-06  Chris Dumez  <cdumez@apple.com>

        Move ResourceLoadObserver notification throttling logic from WebProcess class to ResourceLoadObserver
        https://bugs.webkit.org/show_bug.cgi?id=174194

        Reviewed by Brent Fulgham.

        Move ResourceLoadObserver notification throttling logic from WebProcess class to
        ResourceLoadObserver. This makes more sense and decreases the complexity of the
        WebProcess class.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::setNotificationCallback):
        (WebCore::ResourceLoadObserver::ResourceLoadObserver):
        (WebCore::ResourceLoadObserver::logFrameNavigation):
        (WebCore::ResourceLoadObserver::logSubresourceLoading):
        (WebCore::ResourceLoadObserver::logWebSocketLoading):
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
        (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
        (WebCore::ResourceLoadObserver::notificationTimerFired):
        * loader/ResourceLoadObserver.h:

2017-07-06  Said Abou-Hallawa  <sabouhallawa@apple.com>

        REGRESSION(r208511): RenderImageResourceStyleImage should not assume image() won't return null if its m_cachedImage is valid
        https://bugs.webkit.org/show_bug.cgi?id=174168

        Reviewed by Simon Fraser.

        RenderImageResourceStyleImage::image() may return a null pointer even if
        its m_cachedImage is not null. The revision r208511, changed the function
        RenderImageResourceStyleImage::shutdown() so it calls Image::stopAnimation().
        But this change assumes that if m_cachedImage is not null then image() will
        return a valid pointer. This is not true because StyleCachedImage::isPending()
        can return true and hence, RenderImageResourceStyleImage::image() will return
        a null pointer.

        * rendering/RenderImageResourceStyleImage.cpp:
        (WebCore::RenderImageResourceStyleImage::image): Like what RenderImageResource
        does, return Image::nullImage() if m_styleImage->isPending().

2017-07-06  Commit Queue  <commit-queue@webkit.org>

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

        "Causes crashes on Release builds and API tests" (Requested by
        ddkilzer on #webkit).

        Reverted changeset:

        "Add release assert to explore crash for
        <rdar://problem/32908525>"
        http://trac.webkit.org/changeset/219201

2017-07-06  Commit Queue  <commit-queue@webkit.org>

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

        it broke some layout tests (Requested by clopez on #webkit).

        Reverted changeset:

        "[GStreamer] vid.me videos do not play"
        https://bugs.webkit.org/show_bug.cgi?id=172240
        http://trac.webkit.org/changeset/219194

2017-07-06  David Kilzer  <ddkilzer@apple.com>

        Add release assert to explore crash for <rdar://problem/32908525>

        Reviewed by Brady Eidson.

        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase): Add
        release assert to catch cases when the IDBBackingStore is not
        deleted before the UniqueIDBDatabase is destroyed.  The
        IDBBackingStore should always be released on the database
        thread.

2017-07-06  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219178.

        This caused a consistent failure with the API test
        StringBuilderTest.ToAtomicStringOnEmpty on all Debug testers.

        Reverted changeset:

        "[WTF] Clean up StringStatics.cpp by using
        LazyNeverDestroyed<> for Atoms"
        https://bugs.webkit.org/show_bug.cgi?id=174150
        http://trac.webkit.org/changeset/219178

2017-07-06  Charlie Turner  <cturner@igalia.com>

        [GStreamer] vid.me videos do not play
        https://bugs.webkit.org/show_bug.cgi?id=172240

        Reviewed by Xabier Rodriguez-Calvar.

        In r142251, code to hide the WK HTTP source elements from elsewhere in
        the pipeline was removed. This has the nasty side-effect of
        auto-plugging the WK HTTP source into things it really should not be
        used in, especially the adaptive streaming demuxers. The reasons this
        is bad are documented in several places on Bugzilla, see the parent
        bug report for more details. The high-level issue is that the WK HTTP
        source and its use of WebCore is not thread-safe. Although work has
        been recently done to improve this situation, it's still not perfect.

        Another issue is the interface hlsdemux expects its HTTP source to
        implement, specifically seeking in READY.

        This does rely on HTTP context sharing being available in GStreamer,
        upstream bug is here:
        https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case
        can be demonstrated with
        https://github.com/thiagoss/adaptive-test-server but manual testing on
        popular video hosting sites, including vid.me, shows that this doesn't
        bite us at the moment, just something else to fix in the future.

        There are some QoS issues with the adaptive streaming code in
        GStreamer, but it seems much better to offer a below par QoS in lieu
        of crashing/livelocking when playing certain streams, and issues can be
        raised upstream when they arise.

        This patch does take us further away from the future goal of having all
        networking operations go through the network process, but in return it
        solves some nasty crashes and livelocks that have been irritating
        users for some time. With the pressure off on this issue, work can be
        planned to consider how to make the WK HTTP source a better citizen
        inside the GStreamer pipeline when we migrate the netcode to go
        through the network process.

        A new test is added to check that the single file HLS playlists
        (new in version 4) can be played, which was the primary cause of
        this bug report.

        Test: http/tests/media/hls/range-request.html

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform
        some trickery to make sure that we only ever fetch URLs handed to
        us by WebCore. Any further URLs discovered inside the pipeline
        will not get WKWS auto-plugged, since they'll be plain https?
        schemas.
        (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the
        setPlaybinURL helper method.
        (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
        the setPlaybinURL helper method.
        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (webKitWebSrcGetProtocols): Only advertise webkit+https?, this
        ensures we won't get auto-plugged by pipeline elements asking for
        an element to fetch https? resources (like adaptive demuxers).
        (convertPlaybinURI): Undo the trick when another element asks us
        for our URI.

2017-05-24  Sergio Villar Senin  <svillar@igalia.com>

        [SVG] Leak in SVGAnimatedListPropertyTearOff
        https://bugs.webkit.org/show_bug.cgi?id=172545

        Reviewed by Said Abou-Hallawa.

        SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
        SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
        reference to SVGAnimatedProperty.

        When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
        SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
        SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
        is going to be added to. This effectively creates a reference cycle between the
        SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.

        We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.

        * svg/properties/SVGAnimatedListPropertyTearOff.h:

2017-07-05  Don Olmstead  <don.olmstead@sony.com>

        [WTF] Move SoftLinking.h into WTF
        https://bugs.webkit.org/show_bug.cgi?id=174000

        Reviewed by Alex Christensen.

        No new tests. No change in functionality

        * Modules/applepay/PaymentRequest.cpp:
        * Modules/applepay/cocoa/PaymentContactCocoa.mm:
        * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
        * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
        * WebCore.xcodeproj/project.pbxproj:
        * editing/cocoa/EditorCocoa.mm:
        * editing/cocoa/HTMLConverter.mm:
        * editing/ios/EditorIOS.mm:
        * page/CaptionUserPreferencesMediaAF.cpp:
        * page/cocoa/SettingsCocoa.mm:
        * page/ios/UserAgentIOS.mm:
        * page/mac/ServicesOverlayController.mm:
        * platform/audio/ios/AudioDestinationIOS.cpp:
        * platform/audio/ios/AudioFileReaderIOS.cpp:
        * platform/audio/ios/AudioSessionIOS.mm:
        * platform/audio/ios/MediaSessionManagerIOS.mm:
        * platform/cf/CoreMediaSoftLink.cpp:
        * platform/cf/CoreMediaSoftLink.h:
        * platform/cf/MediaAccessibilitySoftLink.cpp:
        * platform/cf/MediaAccessibilitySoftLink.h:
        * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
        * platform/cocoa/CoreVideoSoftLink.cpp:
        * platform/cocoa/CoreVideoSoftLink.h:
        * platform/cocoa/DataDetectorsCoreSoftLink.h:
        * platform/cocoa/NetworkExtensionContentFilter.mm:
        * platform/cocoa/ParentalControlsContentFilter.mm:
        * platform/cocoa/TelephoneNumberDetectorCocoa.cpp:
        * platform/cocoa/VideoToolboxSoftLink.cpp:
        * platform/cocoa/VideoToolboxSoftLink.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
        * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
        * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
        * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
        * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h:
        * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
        * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
        * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
        * platform/graphics/cocoa/FontCascadeCocoa.mm:
        * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
        * platform/graphics/cv/PixelBufferConformerCV.cpp:
        * platform/graphics/ios/FontCacheIOS.mm:
        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
        * platform/graphics/mac/FontCacheMac.mm:
        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        * platform/graphics/mac/MediaTimeQTKit.mm:
        * platform/graphics/mac/PDFDocumentImageMac.mm:
        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
        * platform/ios/DragImageIOS.mm:
        * platform/ios/PlatformPasteboardIOS.mm:
        * platform/ios/PlatformScreenIOS.mm:
        * platform/ios/PlatformSpeechSynthesizerIOS.mm:
        * platform/ios/QuickLookSoftLink.h:
        * platform/ios/QuickLookSoftLink.mm:
        * platform/ios/RemoteCommandListenerIOS.mm:
        * platform/ios/ThemeIOS.mm:
        * platform/ios/ValidationBubbleIOS.mm:
        * platform/ios/WebCoreMotionManager.mm:
        * platform/ios/WebItemProviderPasteboard.mm:
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        * platform/mac/DragImageMac.mm:
        * platform/mac/MediaRemoteSoftLink.cpp:
        * platform/mac/MediaRemoteSoftLink.h:
        * platform/mac/SerializedPlatformRepresentationMac.mm:
        * platform/mac/WebPlaybackControlsManager.mm:
        * platform/mac/WebVideoFullscreenController.mm:
        * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
        * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
        * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
        * platform/network/cf/CookieJarCFNet.cpp:
        * platform/network/ios/NetworkStateNotifierIOS.mm:
        * platform/network/ios/PreviewConverter.mm:
        * platform/network/mac/BlobDataFileReferenceMac.mm:
        * platform/spi/cocoa/AVKitSPI.h:
        (-[AVTouchBarPlaybackControlsControlling NS_ENUM]): Deleted.
        * platform/spi/cocoa/NSAttributedStringSPI.h:
        * platform/spi/ios/DataDetectorsUISPI.h:
        * platform/spi/mac/AVFoundationSPI.h:
        * platform/spi/mac/DataDetectorsSPI.h:
        * platform/spi/mac/LookupSPI.h:
        * platform/spi/mac/TUCallSPI.h:
        * platform/win/ScrollbarThemeWin.cpp:
        * rendering/RenderThemeCocoa.mm:
        * rendering/RenderThemeIOS.mm:
        * rendering/RenderThemeWin.cpp:
        * testing/Internals.mm:
        * xml/XSLStyleSheetLibxslt.cpp:
        * xml/XSLTExtensions.cpp:
        * xml/XSLTProcessorLibxslt.cpp:
        * xml/XSLTUnicodeSort.cpp:

2017-07-05  Zalan Bujtas  <zalan@apple.com>

        REGRESSION: Stack overflow in RenderBlockFlow::layoutBlock after increasing the font size to max in some RTL vertical books.
        https://bugs.webkit.org/show_bug.cgi?id=174144
        <rdar://problem/32781038>

        Reviewed by Simon Fraser.

        We set the start/end margin on the ruby renderer to support overhanging content. The margins ensure that
        adjacent boxes on the line are placed properly respecting the overhanging content.
        The line breaking algorithm also takes this value into account as it affects the line's available width.
        We need to reset this value before laying out the lines, otherwise we might end up using this value on the line twice;
        first as the renderer's margins (as the result of the previous layout) and second as the renderer's overhanging value.
        Since this is not strictly part of the renderer's layout context (i.e. we set them during the line layout and not at
        RenderRubyRun::layout) we can't rely on the ruby's layout logic to reset them.

        Test: fast/ruby/ruby-overhang-margin-crash.html

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

2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>

        Upgrade GCC baseline
        https://bugs.webkit.org/show_bug.cgi?id=174155

        Reviewed by Michael Catanzaro.

        Remove workaround for old GCC.

        * CMakeLists.txt:

2017-07-05  Chris Dumez  <cdumez@apple.com>

        Unreviewed attempt to fix iOS build after r219177.

        * page/ios/UserAgentIOS.mm:
        * platform/spi/ios/UIKitSPI.h:

2017-07-05  Chris Dumez  <cdumez@apple.com>

        Unreviewed attempt to fix iOS build after r219177.

        * page/ios/UserAgentIOS.mm:
        * platform/spi/ios/UIKitSPI.h:

2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>

        Use std::lock_guard instead of std::unique_lock if move semantics and try_lock is not necessary
        https://bugs.webkit.org/show_bug.cgi?id=174148

        Reviewed by Mark Lam.

        * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
        (WebCore::AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC):

2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
        https://bugs.webkit.org/show_bug.cgi?id=174150

        Reviewed by Mark Lam.

        * Modules/mediacontrols/MediaControlsHost.cpp:
        (WebCore::MediaControlsHost::captionDisplayMode):
        * Modules/mediastream/RTCDataChannel.cpp:
        (WebCore::RTCDataChannel::binaryType):
        * accessibility/AXObjectCache.cpp:
        (WebCore::createFromRenderer):
        * accessibility/AccessibilityMediaControls.cpp:
        (WebCore::AccessibilityMediaControl::controlTypeName):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::language):
        (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
        (WebCore::AccessibilityObject::actionVerb):
        (WebCore::AccessibilityObject::getAttribute):
        (WebCore::AccessibilityObject::placeholderValue):
        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityObject::accessKey):
        (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::accessKey):
        (WebCore::AccessibilityRenderObject::actionVerb):
        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::constructElementWithFallback):
        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::JSCustomElementRegistry::define):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateDefaultValue):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
        * css/CSSPageRule.cpp:
        (WebCore::CSSPageRule::selectorText):
        * css/CSSPrimitiveValue.cpp:
        (WebCore::valueName):
        * css/CSSSelector.cpp:
        (WebCore::simpleSelectorSpecificityInternal):
        (WebCore::CSSSelector::specificityForPage):
        (WebCore::CSSSelector::RareData::RareData):
        * css/CSSSelector.h:
        (WebCore::CSSSelector::argument):
        * css/CSSSelectorList.cpp:
        (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
        * css/PageRuleCollector.cpp:
        (WebCore::checkPageSelectorComponents):
        * css/RuleSet.cpp:
        (WebCore::computeMatchBasedOnRuleHash):
        (WebCore::RuleSet::addRule):
        * css/SelectorChecker.cpp:
        (WebCore::tagMatches):
        * css/SelectorFilter.cpp:
        (WebCore::collectDescendantSelectorIdentifierHashes):
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertStringOrAuto):
        (WebCore::StyleBuilderConverter::convertStringOrNone):
        * css/StyleBuilderCustom.h:
        (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
        (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
        (WebCore::StyleBuilderCustom::applyValueContent):
        (WebCore::StyleBuilderCustom::applyValueAlt):
        * css/StyleSheetContents.cpp:
        (WebCore::StyleSheetContents::StyleSheetContents):
        (WebCore::StyleSheetContents::namespaceURIFromPrefix):
        * css/makeprop.pl:
        * css/parser/CSSParserImpl.cpp:
        (WebCore::CSSParserImpl::parsePageSelector):
        * css/parser/CSSSelectorParser.cpp:
        (WebCore::CSSSelectorParser::consumeCompoundSelector):
        (WebCore::CSSSelectorParser::consumeName):
        (WebCore::CSSSelectorParser::consumeAttribute):
        (WebCore::CSSSelectorParser::defaultNamespace):
        (WebCore::CSSSelectorParser::determineNamespace):
        (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
        (WebCore::SelectorCompiler::equalTagNames):
        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
        * dom/Attr.cpp:
        (WebCore::Attr::setPrefix):
        (WebCore::Attr::attachToElement):
        * dom/Attribute.h:
        (WebCore::Attribute::nameMatchesFilter):
        * dom/ConstantPropertyMap.cpp:
        (WebCore::ConstantPropertyMap::nameForProperty):
        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::getElementsByTagName):
        (WebCore::ContainerNode::getElementsByTagNameNS):
        * dom/CustomElementReactionQueue.cpp:
        (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
        * dom/DatasetDOMStringMap.cpp:
        (WebCore::convertPropertyNameToAttributeName):
        * dom/Document.cpp:
        (WebCore::createUpgradeCandidateElement):
        (WebCore::Document::createElementForBindings):
        (WebCore::Document::importNode):
        (WebCore::Document::hasValidNamespaceForElements):
        (WebCore::Document::processBaseElement):
        (WebCore::Document::dir):
        (WebCore::Document::bgColor):
        (WebCore::Document::fgColor):
        (WebCore::Document::alinkColor):
        (WebCore::Document::linkColorForBindings):
        (WebCore::Document::vlinkColor):
        * dom/Document.h:
        * dom/Element.cpp:
        (WebCore::Element::setBooleanAttribute):
        (WebCore::Element::synchronizeAttribute):
        (WebCore::Element::getAttribute):
        (WebCore::Element::getAttributeNS):
        (WebCore::Element::setAttribute):
        (WebCore::Element::parserSetAttributes):
        (WebCore::Element::didMoveToNewDocument):
        (WebCore::Element::setPrefix):
        (WebCore::Element::insertedInto):
        (WebCore::Element::removedFrom):
        (WebCore::Element::removeAttributeInternal):
        (WebCore::Element::addAttributeInternal):
        (WebCore::Element::removeAttributeNS):
        (WebCore::Element::getAttributeNodeNS):
        (WebCore::Element::hasAttributeNS):
        (WebCore::Element::computeInheritedLanguage):
        (WebCore::Element::updateNameForDocument):
        (WebCore::Element::updateIdForDocument):
        (WebCore::Element::didAddAttribute):
        (WebCore::Element::didRemoveAttribute):
        (WebCore::Element::cloneAttributesFromElement):
        * dom/Element.h:
        (WebCore::Element::attributeWithoutSynchronization):
        (WebCore::Element::idForStyleResolution):
        (WebCore::Element::getIdAttribute):
        (WebCore::Element::getNameAttribute):
        * dom/EventTarget.cpp:
        (WebCore::legacyType):
        * dom/MutationRecord.h:
        (WebCore::MutationRecord::attributeName):
        (WebCore::MutationRecord::attributeNamespace):
        * dom/NamedNodeMap.cpp:
        (WebCore::NamedNodeMap::removeNamedItemNS):
        * dom/Node.cpp:
        (WebCore::Node::prefix):
        (WebCore::Node::localName):
        (WebCore::Node::namespaceURI):
        (WebCore::Node::checkSetPrefix):
        (WebCore::locateDefaultNamespace):
        (WebCore::Node::isDefaultNamespace):
        (WebCore::Node::lookupNamespaceURI):
        (WebCore::locateNamespacePrefix):
        (WebCore::Node::lookupPrefix):
        * dom/NodeRareData.h:
        (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
        (WebCore::NodeListsNodeData::addCachedCollection):
        (WebCore::NodeListsNodeData::cachedCollection):
        (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
        (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
        (WebCore::NodeListsNodeData::removeCachedCollection):
        * dom/PseudoElement.cpp:
        (WebCore::pseudoElementTagName):
        * dom/QualifiedName.cpp:
        (WebCore::QualifiedName::init):
        (WebCore::nullQName):
        (WebCore::createQualifiedName):
        * dom/QualifiedName.h:
        (WebCore::QualifiedName::hasPrefix):
        * dom/SelectorQuery.cpp:
        (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
        * dom/SlotAssignment.cpp:
        (WebCore::slotNameFromAttributeValue):
        * dom/SlotAssignment.h:
        (WebCore::SlotAssignment::defaultSlotName):
        (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
        (WebCore::ShadowRoot::didChangeDefaultSlot):
        * dom/TagCollection.cpp:
        (WebCore::TagCollection::TagCollection):
        (WebCore::HTMLTagCollection::HTMLTagCollection):
        * dom/TagCollection.h:
        (WebCore::TagCollectionNS::elementMatches):
        * dom/make_names.pl:
        (printNamesCppFile):
        (printDefinitions):
        (printFactoryCppFile):
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::removeNodeAttribute):
        * editing/Editing.cpp:
        (WebCore::createHTMLElement):
        * editing/MarkupAccumulator.cpp:
        (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
        (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
        (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
        (WebCore::MarkupAccumulator::appendNamespace):
        (WebCore::MarkupAccumulator::appendOpenTag):
        (WebCore::MarkupAccumulator::appendAttribute):
        * editing/gtk/EditorGtk.cpp:
        (WebCore::elementURL):
        * editing/markup.cpp:
        (WebCore::AttributeChange::AttributeChange):
        * html/Autocapitalize.cpp:
        (WebCore::stringForAutocapitalizeType):
        * html/Autofill.cpp:
        (WebCore::AutofillData::createFromHTMLFormControlElement):
        * html/DOMTokenList.h:
        (WebCore::DOMTokenList::item):
        * html/FormAssociatedElement.cpp:
        (WebCore::FormAssociatedElement::name):
        * html/HTMLButtonElement.cpp:
        (WebCore::HTMLButtonElement::formControlType):
        * html/HTMLDetailsElement.cpp:
        (WebCore::HTMLDetailsElement::toggleOpen):
        * html/HTMLDocument.cpp:
        (WebCore::HTMLDocument::isCaseSensitiveAttribute):
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
        (WebCore::toValidDirValue):
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::name):
        (WebCore::HTMLInputElement::updateType):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::doesHaveAttribute):
        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::createForJSConstructor):
        * html/HTMLParamElement.cpp:
        (WebCore::HTMLParamElement::name):
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::setMultiple):
        * html/HTMLTableCellElement.cpp:
        (WebCore::HTMLTableCellElement::scope):
        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
        * html/LabelableElement.cpp:
        (WebCore::LabelableElement::labels):
        * html/LabelsNodeList.cpp:
        (WebCore::LabelsNodeList::~LabelsNodeList):
        * html/MediaController.cpp:
        (MediaController::playbackState):
        (eventNameForReadyState):
        * html/MediaDocument.cpp:
        (WebCore::MediaDocumentParser::createDocumentStructure):
        * html/parser/AtomicHTMLToken.h:
        (WebCore::AtomicHTMLToken::initializeAttributes):
        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::HTMLConstructionSite::createElement):
        (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
        * html/parser/HTMLParserIdioms.cpp:
        (WebCore::stripLeadingAndTrailingHTMLSpaces):
        (WebCore::parseHTMLHashNameReference):
        * html/parser/HTMLTreeBuilder.cpp:
        (WebCore::createForeignAttributesMap):
        * html/track/InbandTextTrack.cpp:
        (WebCore::InbandTextTrack::InbandTextTrack):
        * html/track/LoadableTextTrack.cpp:
        (WebCore::LoadableTextTrack::id):
        * html/track/TextTrack.cpp:
        (WebCore::TextTrack::captionMenuOffItem):
        (WebCore::TextTrack::captionMenuAutomaticItem):
        * html/track/TrackBase.cpp:
        (WebCore::MediaTrackBase::setKindInternal):
        * html/track/VTTRegion.cpp:
        (WebCore::VTTRegion::scroll):
        * html/track/WebVTTElement.cpp:
        (WebCore::nodeTypeToTagName):
        * html/track/WebVTTElement.h:
        * html/track/WebVTTToken.h:
        (WebCore::WebVTTToken::StartTag):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::clear):
        * loader/FrameLoader.h:
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::clearFailedLoadURL):
        * loader/NavigationAction.h:
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNavigationPolicy):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::showModalDialog):
        * page/EventHandler.cpp:
        (WebCore::eventNameForTouchPointState):
        * page/FrameTree.cpp:
        (WebCore::FrameTree::setName):
        (WebCore::FrameTree::clearName):
        * page/Page.cpp:
        (WebCore::Page::groupName):
        * platform/graphics/ComplexTextController.cpp:
        (WebCore::ComplexTextController::offsetForPosition):
        * platform/graphics/FontCache.cpp:
        (WebCore::FontCache::alternateFamilyName):
        * platform/graphics/FontDescription.h:
        (WebCore::FontCascadeDescription::initialLocale):
        * platform/graphics/FontGenericFamilies.cpp:
        (WebCore::genericFontFamilyForScript):
        * platform/graphics/InbandTextTrackPrivate.h:
        (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
        * platform/graphics/TrackPrivateBase.h:
        (WebCore::TrackPrivateBase::id):
        (WebCore::TrackPrivateBase::label):
        (WebCore::TrackPrivateBase::language):
        * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
        (WebCore::AVTrackPrivateAVFObjCImpl::id):
        (WebCore::AVTrackPrivateAVFObjCImpl::label):
        (WebCore::AVTrackPrivateAVFObjCImpl::language):
        * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
        (WebCore::InbandTextTrackPrivateAVCF::label):
        (WebCore::InbandTextTrackPrivateAVCF::language):
        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
        (WebCore::InbandTextTrackPrivateLegacyAVCF::label):
        (WebCore::InbandTextTrackPrivateLegacyAVCF::language):
        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
        (WebCore::InbandTextTrackPrivateAVFObjC::label):
        (WebCore::InbandTextTrackPrivateAVFObjC::language):
        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
        (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
        (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::metadataType):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::FontCache::platformAlternateFamilyName):
        * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
        (WebCore::FontCascadeDescription::effectiveFamilyAt):
        * platform/graphics/freetype/FontCacheFreeType.cpp:
        (WebCore::FontCache::platformAlternateFamilyName):
        * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
        (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
        * platform/graphics/win/FontCacheWin.cpp:
        (WebCore::FontCache::platformAlternateFamilyName):
        * platform/mediastream/AudioTrackPrivateMediaStream.h:
        * platform/mediastream/RealtimeMediaSourceSettings.cpp:
        (WebCore::RealtimeMediaSourceSettings::facingMode):
        * platform/mediastream/VideoTrackPrivateMediaStream.h:
        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::linkSuggestedFilename):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paint):
        * rendering/RenderListItem.cpp:
        (WebCore::RenderListItem::markerText):
        * rendering/RenderText.cpp:
        (WebCore::RenderText::previousOffset):
        (WebCore::RenderText::nextOffset):
        * rendering/RenderTreeAsText.cpp:
        (WebCore::RenderTreeAsText::writeRenderObject):
        * rendering/TextPainter.cpp:
        (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::textEmphasisMarkString):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::initialHyphenationString):
        (WebCore::RenderStyle::initialTextEmphasisCustomMark):
        (WebCore::RenderStyle::initialContentAltText):
        (WebCore::RenderStyle::initialLineGrid):
        (WebCore::RenderStyle::initialFlowThread):
        (WebCore::RenderStyle::initialRegionThread):
        * style/StyleScope.cpp:
        (WebCore::Style::Scope::collectActiveStyleSheets):
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::getPresentationAttribute):
        * svg/SVGElement.h:
        (WebCore::SVGAttributeHashTranslator::hash):
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::constructAttributeName):
        * testing/MockCDMFactory.cpp:
        (WebCore::MockCDMInstance::requestLicense):
        * xml/XMLErrors.cpp:
        (WebCore::createXHTMLParserErrorHeader):
        * xml/XPathStep.cpp:
        (WebCore::XPath::nodeMatchesBasicTest):
        (WebCore::XPath::Step::nodesInAxis):
        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::XMLDocumentParser::XMLDocumentParser):
        (WebCore::handleNamespaceAttributes):
        (WebCore::handleElementAttributes):

2017-07-05  Chris Dumez  <cdumez@apple.com>

        [iOS] User agent string incorrectly says "iPhone" instead of "iPad" on newer iPads
        https://bugs.webkit.org/show_bug.cgi?id=174182
        <rdar://problem/32868369>

        Reviewed by Tim Horton.

        In deviceNameForUserAgent() on iOS, we were forcefully returning "iPhone" if
        [UIApplication _isClassic] returns true. Update check to return "iPad" if
        [UIApplication _isClassic] returns true but [UIApplication _classMode] returns
        UIApplicationSceneClassicModeOriginalPad.

        * page/ios/UserAgentIOS.mm:
        (WebCore::isClassicPad):
        (WebCore::isClassicPhone):
        (WebCore::osNameForUserAgent):
        (WebCore::deviceNameForUserAgent):
        * platform/spi/ios/UIKitSPI.h:

2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>

        WTF::Thread should have the threads stack bounds.
        https://bugs.webkit.org/show_bug.cgi?id=173975

        Reviewed by Keith Miller.

        When creating WebThread, we first allocate WebCore::ThreadGlobalData in UI thread
        and share it with WebThread.
        The problem is that WebCore::ThreadGlobalData has CachedResourceRequestInitiators.
        It allocates AtomicString, which requires WTFThreadData.

        Before this patch, it was OK because WTFThreadData does not touch threading related
        things except for ThreadSpecific<>. However, after this patch, it touches
        WTF::Thread::current() which requires WTF::initializeThreading().

        In this patch, we call WTF::initializeThreading() before allocating WebCore::ThreadGlobalData.
        And we also call AtomicString::init() before calling WebCore::ThreadGlobalData since
        WebCore::ThreadGlobalData allocates AtomicString.

        This fixes crashes in the iOS web threading environment (UIWebView).

        * platform/ios/wak/WebCoreThread.mm:
        (StartWebThread):

2017-07-05  Myles C. Maxfield  <mmaxfield@apple.com>

        CSSFontStyleValue::isItalic seems a bit bogus.
        https://bugs.webkit.org/show_bug.cgi?id=174149

        Reviewed by Tim Horton.

        Simple typo.

        Test: editing/execCommand/italicizeByCharacter-normal.html

        * css/CSSFontStyleValue.h:

2017-07-05  Brady Eidson  <beidson@apple.com>

        Allow navigations in subframes to get a ShouldOpenExternalURLsPolicy of "ShouldAllow".
        <rdar://problem/22485589> and https://bugs.webkit.org/show_bug.cgi?id=174178

        Reviewed by Alex Christensen.

        Test: loader/navigation-policy/should-open-external-urls/subframe-navigated-programatically-by-main-frame.html

        This patch introduces a new flag to FrameLoadRequest to track when it is known with certainty that a 
        FrameLoadRequest originates from the main frame.
        
        Later, when calculating the final ShouldOpenExternalURLsPolicy, main frames navigating iframes get to propagate
        their permissions to the iframe.
        
        * bindings/js/CommonVM.cpp:
        (WebCore::lexicalFrameFromCommonVM): Helper to grab the current frame associated with the current JS callstack.
        * bindings/js/CommonVM.h:

        * inspector/InspectorFrontendClientLocal.cpp:
        (WebCore::InspectorFrontendClientLocal::openInNewTab):

        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::navigate):

        Add the new flag to FrameLoadRequest (and force almost everybody to explicitly include the flag):
        * loader/FrameLoadRequest.cpp:
        (WebCore::FrameLoadRequest::FrameLoadRequest):
        * loader/FrameLoadRequest.h:
        (WebCore::FrameLoadRequest::FrameLoadRequest):
        (WebCore::FrameLoadRequest::navigationInitiatedByMainFrame):

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::urlSelected):
        (WebCore::FrameLoader::loadURLIntoChildFrame):
        (WebCore::shouldOpenExternalURLsPolicyToApply): Helper that takes the new flag into account when deciding
          what the final ShouldOpenExternalURLsPolicy will be.
        (WebCore::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
        (WebCore::FrameLoader::loadURL):
        (WebCore::FrameLoader::load):
        (WebCore::FrameLoader::loadWithNavigationAction):
        (WebCore::FrameLoader::reloadWithOverrideEncoding):
        (WebCore::FrameLoader::reload):
        (WebCore::FrameLoader::loadPostRequest):
        (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
        (WebCore::FrameLoader::loadDifferentDocumentItem):
        (WebCore::createWindow):
        (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader): Deleted.
        * loader/FrameLoader.h:

        * loader/FrameLoaderTypes.h:

        * loader/NavigationAction.h:
        (WebCore::NavigationAction::navigationInitiatedByMainFrame):
        * loader/NavigationScheduler.cpp:
        (WebCore::ScheduledNavigation::ScheduledNavigation): Grab the "initiating frame" at the time the 
          ScheduledNavigation is created, as it dictates the policy we decide later.
        (WebCore::ScheduledNavigation::navigationInitiatedByMainFrame):
        (WebCore::NavigationScheduler::scheduleLocationChange):

        * page/ContextMenuController.cpp:
        (WebCore::openNewWindow):
        (WebCore::ContextMenuController::contextMenuItemSelected):

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::createWindow):

2017-07-05  Simon Fraser  <simon.fraser@apple.com>

        Another build fix, for Mac.

        * platform/graphics/cocoa/IOSurface.mm:
        (WebCore::IOSurface::surfaceID):

2017-07-05  Simon Fraser  <simon.fraser@apple.com>

        Further attempts to fix the iOS public SDK build.

        * platform/graphics/cocoa/IOSurface.mm:
        (WebCore::IOSurface::surfaceID):
        * platform/spi/cocoa/IOSurfaceSPI.h:

2017-07-05  Don Olmstead  <don.olmstead@sony.com>

        [WinCairo] Consolidate CMake code related to CURL
        https://bugs.webkit.org/show_bug.cgi?id=170860

        Reviewed by Alex Christensen.

        No new tests. No change in functionality.

        * PlatformWinCairo.cmake:
        * platform/Curl.cmake: Added.

2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>

        Remove copy of ICU headers from WebKit
        https://bugs.webkit.org/show_bug.cgi?id=116407

        Reviewed by Alex Christensen.

        Use WTF's copy of ICU headers.

        No new tests because there is no behavior change.

        * Configurations/WebCore.xcconfig:
        * icu/unicode/bytestream.h: Removed.
        * icu/unicode/localpointer.h: Removed.
        * icu/unicode/parseerr.h: Removed.
        * icu/unicode/platform.h: Removed.
        * icu/unicode/ptypes.h: Removed.
        * icu/unicode/putil.h: Removed.
        * icu/unicode/rep.h: Removed.
        * icu/unicode/std_string.h: Removed.
        * icu/unicode/strenum.h: Removed.
        * icu/unicode/stringpiece.h: Removed.
        * icu/unicode/ubrk.h: Removed.
        * icu/unicode/uchar.h: Removed.
        * icu/unicode/ucnv.h: Removed.
        * icu/unicode/ucnv_err.h: Removed.
        * icu/unicode/ucol.h: Removed.
        * icu/unicode/uconfig.h: Removed.
        * icu/unicode/ucurr.h: Removed.
        * icu/unicode/uenum.h: Removed.
        * icu/unicode/uiter.h: Removed.
        * icu/unicode/uloc.h: Removed.
        * icu/unicode/umachine.h: Removed.
        * icu/unicode/unistr.h: Removed.
        * icu/unicode/unorm.h: Removed.
        * icu/unicode/unorm2.h: Removed.
        * icu/unicode/uobject.h: Removed.
        * icu/unicode/urename.h: Removed.
        * icu/unicode/uscript.h: Removed.
        * icu/unicode/uset.h: Removed.
        * icu/unicode/ustring.h: Removed.
        * icu/unicode/utext.h: Removed.
        * icu/unicode/utf.h: Removed.
        * icu/unicode/utf16.h: Removed.
        * icu/unicode/utf8.h: Removed.
        * icu/unicode/utf_old.h: Removed.
        * icu/unicode/utypes.h: Removed.
        * icu/unicode/uvernum.h: Removed.
        * icu/unicode/uversion.h: Removed.
        * platform/graphics/FontCache.h:
        (WebCore::FontDescriptionKey::makeFlagsKey):

2017-07-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        When dragging a selection, clearing the selection in dragstart should not crash the web process
        https://bugs.webkit.org/show_bug.cgi?id=174142
        <rdar://problem/33067501>

        Reviewed by Tim Horton.

        Currenly, if the page clears the current selection after dragging starts on selected content, the web process
        will crash while attempting to write pasteboard data for a nonexistent selection. This patch adds a trivial
        check for this case, bailing if no DHTML dragging data was specified by the page during a selection drag and the
        selection has been cleared.

        Also removes some unused code for estimating the bounds of the current selection. On iOS, dragging was actually
        crashing earlier, in this codepath. However, this information isn't even used anymore, since the drag anchor
        point is no longer necessary on iOS.

        Test: DataInteractionTests.DoNotCrashWhenSelectionIsClearedInDragStart

        * page/DragController.cpp:
        (WebCore::DragController::startDrag):

2017-07-05  Simon Fraser  <simon.fraser@apple.com>

        Try to fix iOS 10.3 public SDK builds.

        * platform/spi/cocoa/IOSurfaceSPI.h:

2017-07-05  Zalan Bujtas  <zalan@apple.com>

        REGRESSION (r217522): "Show My Relationship" link in familysearch.org does not work.
        https://bugs.webkit.org/show_bug.cgi?id=174070
        <rdar://problem/32940653>

        Reviewed by Simon Fraser.

        Decouple in- and out-of-flow computed position values. Now we match blink's implementation on
        in-flow values.
        This also fixes the flickering content while scrolling on hbr.org.  

        Covered by existing test cases.

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::positionOffsetValue):

2017-07-05  Devin Rousso  <drousso@apple.com>

        Web Inspector: Allow users to log any tracked canvas context
        https://bugs.webkit.org/show_bug.cgi?id=173397
        <rdar://problem/33111581>

        Reviewed by Joseph Pecoraro.

        Tests: inspector/canvas/resolveCanvasContext-2d.html
               inspector/canvas/resolveCanvasContext-webgl.html
               inspector/canvas/resolveCanvasContext-webgl2.html
               inspector/canvas/resolveCanvasContext-webgpu.html

        * inspector/InspectorCanvasAgent.h:
        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
        (WebCore::contextAsScriptValue):
        (WebCore::InspectorCanvasAgent::resolveCanvasContext):

2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>

        Style sharing check for fullscreen element seems bogus.
        https://bugs.webkit.org/show_bug.cgi?id=160196

        Reviewed by Antti Koivisto.

        No new tests (no easy way to test this reliably).

        * style/StyleSharingResolver.cpp:
        (WebCore::Style::SharingResolver::canShareStyleWithElement):

2017-07-05  Simon Fraser  <simon.fraser@apple.com>

        Add a logging channel for IOSurface allocations
        https://bugs.webkit.org/show_bug.cgi?id=174167

        Reviewed by Tim Horton.

        Add an "IOSurface" log channel, make IOSurface TextStream-loggable, and log cached
        and new IOSurface allocations. Do some namespace-related cleanup.

        * platform/Logging.h:
        * platform/graphics/cocoa/IOSurface.h:
        * platform/graphics/cocoa/IOSurface.mm:
        (WebCore::WebCore::IOSurface::create):
        (WebCore::WebCore::IOSurface::surfaceID):
        (WebCore::operator<<):

2017-07-05  Antti Koivisto  <antti@apple.com>

        Low memory notification shouldn't cause style recalc
        https://bugs.webkit.org/show_bug.cgi?id=173574
        <rdar://problem/32616997>

        Reviewed by Andreas Kling.

        Patch mostly by Myles.

        When we receive a low memory warning, we clear the style resolver. Previously, we were using
        this as an opportunity to also purge the CSSFontSelector. However, purging the font selector
        is wasteful, since the exact same set of CSSFontFace objects will be recreated as soon as the
        CSSFontSelector is recreated. It's also harmful because this purge operation causes fonts to
        be removed from the document's working set, and therefore triggers a relayout. Instead, this
        call should be softened to only delete any transitory caches the CSSFontSelector owns.

        We can simply delay the rebuild of the CSSFontSelector to
        StyleResolver::appendAuthorStyleSheets(), when it's really needed. This way, we can sidestep
        this whole problem.

        There's also an added benefit: Now, buildStarted() doesn't have to be idempotent, so we can
        enforce a stricter calling sequence with ASSERT()s.

        * css/CSSFontFaceSet.cpp:
        (WebCore::CSSFontFaceSet::emptyCaches):
        * css/CSSFontFaceSet.h:
        * css/CSSFontSelector.cpp:
        (WebCore::CSSFontSelector::emptyCaches):

            Add a separate function to clear font selector caches.

        (WebCore::CSSFontSelector::buildStarted):
        (WebCore::CSSFontSelector::buildCompleted):
        (WebCore::CSSFontSelector::addFontFaceRule):
        (WebCore::CSSFontSelector::fontModified):

            No need to invalidate while building.

        (WebCore::CSSFontSelector::fontRangesForFamily):
        * css/CSSFontSelector.h:
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::StyleResolver):
        (WebCore::StyleResolver::addCurrentSVGFontFaceRules):

            Factor into a function from the constructor.

        (WebCore::StyleResolver::appendAuthorStyleSheets):

            Font selector build is now started and finished by StyleScope.

        * css/StyleResolver.h:
        * dom/Document.cpp:
        (WebCore::Document::resolveStyle):

            Call FrameView::styleDidChange() to update any custom scrollbars.
            This bug was hidden by spurious style recalcs, tested by fast/css/scrollbar-dynamic-style-change.html

        (WebCore::Document::userAgentShadowTreeStyleResolver):
        (WebCore::Document::didClearStyleResolver):

            Don't start the font selector rebuild after clearing the resolver. It would cause style recalc trashing.
            Instead the build starts when the new resolver is constructed.

        * page/MemoryRelease.cpp:
        (WebCore::releaseCriticalMemory):

            Release font selector caches.

        * style/StyleScope.cpp:
        (WebCore::Style::Scope::resolver):

2017-07-05  Brent Fulgham  <bfulgham@apple.com>

        [WK2] Prevent ResourceLoadStatistics from triggering a cascade of read/write events
        https://bugs.webkit.org/show_bug.cgi?id=174062\
        <rdar://problem/33086744>

        Reviewed by Chris Dumez.

        Treat DISPATCH_VNODE_DELETE, DISPATCH_VNODE_RENAME, and DISPATCH_VNODE_REVOKE as equivalent
        "file is unavailable" events, and act as though the file was deleted. Don't listen for
        DISPATCH_VNODE_EXTEND, since we always get a DISPATCH_VNODE_WRITE as well, and we only
        want to read once.

        Finally, add some logging to support future investigations.

        * platform/FileMonitor.h:
        (WebCore::FileMonitor::platformMonitor): Expose dispatch_source_t for logging purposes.
        * platform/cocoa/FileMonitorCocoa.mm:
        (WebCore::FileMonitor::startMonitoring): Add logging.
        (WebCore::FileMonitor::stopMonitoring): Ditto.

2017-07-05  Jonathan Bedard  <jbedard@apple.com>

        Add WebKitPrivateFrameworkStubs for iOS 11
        https://bugs.webkit.org/show_bug.cgi?id=173988

        Reviewed by David Kilzer.

        * Configurations/WebCore.xcconfig: iphoneos and iphonesimulator should use the
        same directory for private framework stubs.

2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>

        Don't resolve an extra computed style for getComputedStyle in a display: none subtree.
        https://bugs.webkit.org/show_bug.cgi?id=174145

        Before this, we were also resolving the first ancestor's style as
        inheriting from itself, which felt pretty wrong (though I think it's
        not observable).

        Reviewed by Antti Koivisto.

        No new tests (non-observable behavior).

        * dom/Element.cpp:
        (WebCore::Element::resolveComputedStyle):

2017-07-05  Frederic Wang  <fwang@igalia.com>

        Move ScrolledContentsLayer property to ScrollingStateScrollingNode
        https://bugs.webkit.org/show_bug.cgi?id=174134

        Reviewed by Simon Fraser.

        ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode both use a
        ScrolledContentsLayer property for the same purpose. This commit moves that property into
        their parent class ScrollingStateScrollingNode, so that more code is shared between the two
        classes. This will also help the refactoring in bug 174130.

        No new tests, only dumped tree may change a bit.

        * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Remove scrolled contents layer.
        (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
        (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
        (WebCore::ScrollingStateFrameScrollingNode::setScrolledContentsLayer): Deleted.
        * page/scrolling/ScrollingStateFrameScrollingNode.h: Ditto.
        * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: Ditto.
        (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
        (WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
        (WebCore::ScrollingStateOverflowScrollingNode::setScrolledContentsLayer): Deleted.
        * page/scrolling/ScrollingStateOverflowScrollingNode.h: Ditto.
        (): Deleted.
        (WebCore::ScrollingStateOverflowScrollingNode::scrolledContentsLayer): Deleted.
        * page/scrolling/ScrollingStateScrollingNode.cpp: Add scrolled contents layer.
        (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
        (WebCore::ScrollingStateScrollingNode::setScrolledContentsLayer):
        (WebCore::ScrollingStateScrollingNode::dumpProperties): Use the label from the overflow class
        which is different from the frame class. The dumping order may change a bit too.
        * page/scrolling/ScrollingStateScrollingNode.h: Add ScrolledContentsLayer to the enum and
        scrolled contents layer.
        (WebCore::ScrollingStateScrollingNode::scrolledContentsLayer):
        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
        (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren): Adjust enum value
        to use ScrollingStateScrollingNode::ScrolledContentsLayer.

2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>

        ProcessingInstruction::clearExistingCachedSheet doesn't really exist.
        https://bugs.webkit.org/show_bug.cgi?id=174146

        Reviewed by Chris Dumez.

        No new tests (no functionality change).

        * dom/ProcessingInstruction.h: Remove dead declaration.

2017-07-05  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219128.

        Spoke with engineer who originally submitted, Patch for APi
        test to follow.

        Reverted changeset:

        "Unreviewed, rolling out r219070."
        https://bugs.webkit.org/show_bug.cgi?id=174082
        http://trac.webkit.org/changeset/219128

2017-07-05  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219070.

        This revision caused consistent failures of the API test
        UIPasteboardTests.DoNotPastePlainTextAsURL on iOS.

        Reverted changeset:

        "Pasting single words copied to UIPasteboard inserts URLs in
        editable areas"
        https://bugs.webkit.org/show_bug.cgi?id=174082
        http://trac.webkit.org/changeset/219070

2017-07-05  Youenn Fablet  <youenn@apple.com>

        Receiving tracks should be ended when peer connection is being closed
        https://bugs.webkit.org/show_bug.cgi?id=174109

        Reviewed by Eric Carlson.

        Test: webrtc/peer-connection-track-end.html

        As per https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close, tracks should be ended when peer connection is closed.
        Also updating transceiver stopped state.

        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::doClose):
        * Modules/mediastream/RTCRtpReceiver.cpp:
        (WebCore::RTCRtpReceiver::stop):
        * Modules/mediastream/RTCRtpReceiver.h:

2017-07-04  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Unreviewed, review follow-up after r218961

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::updateFromSettings):

2017-07-04  Antti Koivisto  <antti@apple.com>

        RenderThemeCocoa::mediaControlsFormattedStringForDuration is leaking NSDateComponentsFormatters
        https://bugs.webkit.org/show_bug.cgi?id=174138

        Reviewed by Ryosuke Niwa.

        Saw a random spin here during media playback. Looks like we are leaking.

        * rendering/RenderThemeCocoa.h:
        * rendering/RenderThemeCocoa.mm:
        (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):

            Reuse NSDateComponentsFormatter.

2017-07-04  Antti Koivisto  <antti@apple.com>

        FrameView should not set RenderView::logicalWidth directly for printing
        https://bugs.webkit.org/show_bug.cgi?id=174135

        Reviewed by Zalan Bujtas.

        Renderer logicalWidth should be set by layout. Direct override by RenderView when printing means
        that we don't layout children in all cases when the width changes. This is currently mostly hidden
        by spurious layouts but causes problems when trying to fix other things that reduces those.

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

            Instead of calling setLogicalWidth directly call the new setPageLogicalSize that sets both the width
            and the height uniformly.

        * rendering/RenderView.cpp:
        (WebCore::RenderView::updateLogicalWidth):

            Use pageLogicalSize->width() in printing state instead of skipping the logical width update entirely.
            This ensures that the layout will progress to children when the page logical width changes.

        (WebCore::RenderView::initializeLayoutState):
        (WebCore::RenderView::layout):
        (WebCore::RenderView::pageOrViewLogicalHeight):
        (WebCore::RenderView::setPageLogicalSize):
        * rendering/RenderView.h:

            Replace the existing m_pageLogicalHeight with std::optional m_pageLogicalSize.

2017-07-04  Xabier Rodriguez Calvar  <calvaris@igalia.com>

        [EME] Solve a couple of compiler warnings
        https://bugs.webkit.org/show_bug.cgi?id=174020

        Reviewed by Michael Catanzaro.

        * Modules/encryptedmedia/CDM.cpp:
        (WebCore::CDM::isPersistentType): Added default return and
        assertion.
        * Modules/encryptedmedia/MediaKeySession.cpp:
        (WebCore::MediaKeySession::updateKeyStatuses): This warning was
        already solved but I think adding an assertion for the default
        case can help catch errors in the future.

2017-07-04  Joseph Pecoraro  <pecoraro@apple.com>

        Cleanup some StringBuilder use
        https://bugs.webkit.org/show_bug.cgi?id=174118

        Reviewed by Andreas Kling.

        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::filterICECandidate):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        * contentextensions/ContentExtension.cpp:
        (WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
        * css/CSSFontStyleRangeValue.cpp:
        (WebCore::CSSFontStyleRangeValue::customCSSText):
        * css/CSSFontStyleValue.cpp:
        (WebCore::CSSFontStyleValue::customCSSText):
        * css/CSSGridAutoRepeatValue.cpp:
        (WebCore::CSSGridAutoRepeatValue::customCSSText):
        * css/parser/CSSParser.cpp:
        (WebCore::CSSParser::parseFontFaceDescriptor):
        * dom/Attr.cpp:
        * html/canvas/WebGPURenderingContext.cpp:
        * html/parser/HTMLParserIdioms.cpp:
        * platform/network/ParsedContentType.cpp:
        * platform/network/cocoa/CookieCocoa.mm:
        * platform/text/mac/LocaleMac.mm:
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::getAllResponseHeaders):

2017-07-03  Andreas Kling  <akling@apple.com>

        Null RenderLayer* deref in FrameView::adjustTiledBackingCoverage()
        https://bugs.webkit.org/show_bug.cgi?id=174106
        <rdar://problem/33085838>

        Reviewed by Tim Horton.

        I haven't been able to reproduce this crash locally, but I have seen
        video of someone who can, so here's a null check for the RenderView::layer()
        which could be null if we're called between RenderView construction
        and the first callback to RenderLayerModelObject::styleDidChange().

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

2017-07-03  Matt Rajca  <mrajca@apple.com>

        Add/remove appropriate media element behavior restrictions when updateWebsitePolicies is called
        https://bugs.webkit.org/show_bug.cgi?id=174103

        Reviewed by Alex Christensen.

        Test: Added API test.

        Added support for updating rate change behavior restrictions on media elements that have already
        been created.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::updateRateChangeRestrictions):
        * html/HTMLMediaElement.h:
        * page/Page.cpp:
        (WebCore::Page::updateMediaElementRateChangeRestrictions):
        * page/Page.h:

2017-07-03  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219103.

        Caused multiple build failures.

        Reverted changeset:

        "Remove copy of ICU headers from WebKit"
        https://bugs.webkit.org/show_bug.cgi?id=116407
        http://trac.webkit.org/changeset/219103

2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>

        Remove copy of ICU headers from WebKit
        https://bugs.webkit.org/show_bug.cgi?id=116407

        Reviewed by Alex Christensen.

        Use WTF's copy of ICU headers.

        No new tests because there is no behavior change.

        * Configurations/WebCore.xcconfig:
        * icu/unicode/bytestream.h: Removed.
        * icu/unicode/localpointer.h: Removed.
        * icu/unicode/parseerr.h: Removed.
        * icu/unicode/platform.h: Removed.
        * icu/unicode/ptypes.h: Removed.
        * icu/unicode/putil.h: Removed.
        * icu/unicode/rep.h: Removed.
        * icu/unicode/std_string.h: Removed.
        * icu/unicode/strenum.h: Removed.
        * icu/unicode/stringpiece.h: Removed.
        * icu/unicode/ubrk.h: Removed.
        * icu/unicode/uchar.h: Removed.
        * icu/unicode/ucnv.h: Removed.
        * icu/unicode/ucnv_err.h: Removed.
        * icu/unicode/ucol.h: Removed.
        * icu/unicode/uconfig.h: Removed.
        * icu/unicode/ucurr.h: Removed.
        * icu/unicode/uenum.h: Removed.
        * icu/unicode/uiter.h: Removed.
        * icu/unicode/uloc.h: Removed.
        * icu/unicode/umachine.h: Removed.
        * icu/unicode/unistr.h: Removed.
        * icu/unicode/unorm.h: Removed.
        * icu/unicode/unorm2.h: Removed.
        * icu/unicode/uobject.h: Removed.
        * icu/unicode/urename.h: Removed.
        * icu/unicode/uscript.h: Removed.
        * icu/unicode/uset.h: Removed.
        * icu/unicode/ustring.h: Removed.
        * icu/unicode/utext.h: Removed.
        * icu/unicode/utf.h: Removed.
        * icu/unicode/utf16.h: Removed.
        * icu/unicode/utf8.h: Removed.
        * icu/unicode/utf_old.h: Removed.
        * icu/unicode/utypes.h: Removed.
        * icu/unicode/uvernum.h: Removed.
        * icu/unicode/uversion.h: Removed.

2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>

        REGRESSION(Variation Fonts): Specifying Skia by PostScript name does not yield the expected result
        https://bugs.webkit.org/show_bug.cgi?id=174079
        <rdar://problem/33040854>

        Reviewed by Alex Christensen.

        Because Skia is a variation font, its PostScript name contains values to apply to its variation
        axes. However, WebKit's variation code was overwriting these intrinsive values with ones specified
        by CSS. Therefore, the intrinsic ones were being ignored. The solution is just to pass a flag from
        the lookup code to the variations code describing if the font was created via a PostScript name,
        and to not apply the CSS properties to it if it was.

        Test: fast/text/variations/skia-postscript-name.html

        * platform/graphics/FontCache.h:
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::preparePlatformFont):
        (WebCore::platformFontLookupWithFamily):
        (WebCore::fontWithFamily):

2017-07-03  Brady Eidson  <beidson@apple.com>

        Switch all WebKit API related to favicons from WebIconDatabase over to new WebCore::IconLoader mechanism.
        https://bugs.webkit.org/show_bug.cgi?id=174073

        Reviewed by Andy Estes.

        Covered by existing API test.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::startIconLoading):
        * loader/EmptyClients.cpp:
        * loader/FrameLoaderClient.h:

2017-07-03  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove more unnecessary uses of the preprocessor in idl files
        https://bugs.webkit.org/show_bug.cgi?id=174083

        Reviewed by Alex Christensen.

        Purge as much preprocessor use as possible.

        * Configurations/FeatureDefines.xcconfig:
        Add ENABLE_NAVIGATOR_STANDALONE.

        * animation/Animatable.idl:
        Remove unnecessary check for LANGUAGE_OBJECTIVE_C. We no longer generate those bindings.

        * html/MediaError.idl:
        Use [Conditional] rather than the preprocessor.

        * page/Navigator.idl:
        Use [Conditional] rather than the preprocessor with the new ENABLE_NAVIGATOR_STANDALONE.

        * testing/Internals.cpp:
        * testing/Internals.h:
        Expose setQuickLookPassword on all platforms, as it doesn't hurt since it is only for testing,
        but make the implementation do nothing.

        * testing/Internals.idl:
        Use [Conditional] rather than the preprocessor.

2017-07-03  Daewoong Jang  <daewoong.jang@navercorp.com>

        [Curl] Fix compilation errors
        https://bugs.webkit.org/show_bug.cgi?id=174085

        Reviewed by Alex Christensen.

        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlContext::initCookieSession):
        * platform/network/curl/CurlContext.h:

2017-07-03  Youenn Fablet  <youenn@apple.com>

        WebAudioSourceProviderAVFObjC should not reconfigure for each data call
        https://bugs.webkit.org/show_bug.cgi?id=174101

        Reviewed by Eric Carlson.

        Covered by manual testing, in particular
        https://webrtc.github.io/samples/src/content/peerconnection/webaudio-output/
        and https://webrtc.github.io/samples/src/content/getusermedia/volume/.
        Also improved LayoutTests web audio peer connection tests to make them more robust.

        Before the patch, reconfiguration of the web audio provider was happening for every audioSamplesAvailable call.
        It is now happening only when the format of the audio samples is changing.
        Changed some member fields from uinque_ptr to optional as a minor improvement.

        * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
        * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
        (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
        (WebCore::WebAudioSourceProviderAVFObjC::prepare):
        (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
        (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):

2017-06-30  Alex Christensen  <achristensen@webkit.org>

        Stop using dispatch_async in ResourceHandleCFURLConnectionDelegateWithOperationQueue
        https://bugs.webkit.org/show_bug.cgi?id=174059

        Reviewed by Andy Estes.

        Use dispatch_async_f and callOnMainThread instead.
        No change in behavior.
        This will allow me to use this code on Windows.

        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):

2017-07-03  Andy Estes  <aestes@apple.com>

        [Xcode] Add an experimental setting to build with ccache
        https://bugs.webkit.org/show_bug.cgi?id=173875

        Reviewed by Tim Horton.

        * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.

2017-07-02  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r218910): Crash inside textMarkerDataForFirstPositionInTextControl
        https://bugs.webkit.org/show_bug.cgi?id=174077
        <rdar://problem/33083972>

        Reviewed by Chris Fleizach.

        The bug was caused by textMarkerDataForFirstPositionInTextControl assuming that
        there is always a root editable element (a.k.a. editing host) in the text control.
        When the text control is readonly or disabled, this is not the case.

        Fixed the bug by adding an early exit when there is no editing host.

        Test: accessibility/mac/input-type-change-crash.html

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

2017-07-03  Devin Rousso  <drousso@apple.com>

        Web Inspector: Support listing WebGL2 and WebGPU contexts
        https://bugs.webkit.org/show_bug.cgi?id=173396

        Reviewed by Joseph Pecoraro.

        Tests: inspector/canvas/create-context-2d.html
               inspector/canvas/create-context-webgl.html
               inspector/canvas/create-context-webgl2.html
               inspector/canvas/create-context-webgpu.html

        Split "inspector/canvas/create-canvas-contexts.html" into a test for each context type.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::getContextWebGPU):
        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::buildObjectForCanvas):

2017-07-03  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r215096) Queries of URLs with non-special schemes should not percent-encode single quotes
        https://bugs.webkit.org/show_bug.cgi?id=174051

        Reviewed by Tim Horton.

        In r215096 I added ' to the set of characters to be percent-encoded in queries,
        but for interoperability and compatibility we need to do this only for special schemes, like http.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::isC0Control):
        (WebCore::shouldPercentEncodeQueryByte):
        (WebCore::URLParser::utf8QueryEncode):
        (WebCore::URLParser::encodeQuery):

2017-07-03  Chris Fleizach  <cfleizach@apple.com>

        AX: role="none" (or presentation) does not work on iframes
        https://bugs.webkit.org/show_bug.cgi?id=173930
        <rdar://problem/33034347>

        Reviewed by Ryosuke Niwa.

        Support setting a presentational role on an iframe so that the AXWebArea disappears from the hierarchy.
        Accomplish this by adding children for attachment and scroll view elements the way other children are added.
        That is, only add the non-ignored children directly (which means move the addChild logic into AccessibilityObject.)

        Test: accessibility/presentation-role-iframe.html

        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
        (WebCore::AccessibilityNodeObject::insertChild): Deleted.
        (WebCore::AccessibilityNodeObject::addChild): Deleted.
        * accessibility/AccessibilityNodeObject.h:
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::AccessibilityObject):
        (WebCore::AccessibilityObject::insertChild):
        (WebCore::AccessibilityObject::addChild):
        (WebCore::nodeHasPresentationRole):
        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityObject::addChild): Deleted.
        (WebCore::AccessibilityObject::insertChild): Deleted.
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::webAreaIsPresentational):
        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
        (WebCore::AccessibilityRenderObject::addAttachmentChildren):
        * accessibility/AccessibilityScrollView.cpp:
        (WebCore::AccessibilityScrollView::addChildren):

2017-07-03  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r219024.

        This patch cause 3 didferent test to fail.

        Reverted changeset:

        "REGRESSION(r215096) Queries of URLs with non-special schemes
        should not percent-encode single quotes"
        https://bugs.webkit.org/show_bug.cgi?id=174051
        http://trac.webkit.org/changeset/219024

2017-07-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Pasting single words copied to UIPasteboard inserts URLs in editable areas
        https://bugs.webkit.org/show_bug.cgi?id=174082
        <rdar://problem/33046992>

        Reviewed by Tim Horton.

        Currently, our heuristics for coercing plain text to URLs when reading URLs off of the UIPasteboard allows URLs
        to be created as long as -[UIPasteboard valuesForPasteboardType:inItemSet:] returns a non-null NSURL. However,
        UIPasteboard automatically coerces any NSString into an NSURL if it initializes an NSURL via +URLWithString:.
        Thus, single-word strings such as "hello" that are written to the pasteboard as "public.utf8-plain-text" can
        be read back as NSURLs for "public.url". This currently causes bugs in shipping software: e.g. copying and
        pasting a single word from an editable input or textarea and pasting into a rich contenteditable area using
        WebKit1 inserts a link. However, when combined with another change in WebKit that attempts to read "public.url"
        before "public.text" when reading plain text from the pasteboard, this now also affects pasting in plain text
        areas, where pasted plain-text strings that are not URLs will paste as URL-encoded strings anyways (for
        instance, replacing "[hello]" with "%5Bhello%5D").

        To fix this, and existing issues with pasting single words in contenteditables, we make
        PlatformPasteboard::readString and PlatformPasteboard::readURL only accept a coerced NSURL as an URL if it also
        parses as a valid URL in WebKit (otherwise, we return an empty string).

        Tests:
            UIPasteboardTests.DoNotPastePlainTextAsURL
            UIPasteboardTests.PastePlainTextAsURL
            UIPasteboardTests.PasteURLWithPlainTextAsURL

        * platform/PlatformPasteboard.h:
        * platform/ios/AbstractPasteboard.h:
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::allowReadingURLAtIndex):

        Allow an URL to be read if either (1) an URL was explicitly specified in the UIPasteboard, or (2) the "proposed"
        URL returned from -valuesForPasteboardType: is valid.

        (WebCore::PlatformPasteboard::readString):
        (WebCore::PlatformPasteboard::readURL):

        Consult allowReadingURLAtIndex here (in the case of ::readString, only if the given pasteboard type is
        "public.url").

        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard itemProviders]):
        (-[WebItemProviderPasteboard setItemProviders:]):

2017-07-03  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement CryptoKeyEC SPKI exports
        https://bugs.webkit.org/show_bug.cgi?id=173646

        Reviewed by Jiewen Tan.

        No new tests -- affected tests are now passing and are unskipped.

        Implement libgcrypt-based support for SPKI exports of EC keys.

        Initially, the ECParameters structure is created so that it will be later embedded
        into the SubjectPublicKeyInfo structure. First the root element of this structure
        is written into, specifying namedCurve as the chosen member (even if other choices
        are not really available). We then write out the object identifier into this
        namedCurve member that properly represents this key's curve type.

        The SubjectPublicKeyInfo structure is created next. We write out id-ecPublicKey
        identifier as the chosen algorithm identifier. Web Crypto specification demands
        that the id-ecDH identifier is used in case of ECDH keys, but no existing test in
        the W3C test suite expects this, so this should be revisited later. Data of the
        previously-constructed ECParameters structure is written out into the
        AlgorithmIdentifier's parameters member.

        The `q` MPI data is then retrieved. Its size is validated, as well as the first
        byte of data in order to ensure the MPI represents an uncompressed EC point.
        The data is then written into the subjectPublicKey member.

        Finally the encoded SubjectPublicKeyInfo structure data is extracted and returned
        from the platformExportSpki() function, completion the export operation.

        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        (WebCore::curveIdentifier):
        (WebCore::CryptoKeyEC::platformExportSpki):

2017-07-02  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove special casing for RegExp which is no longer required by the spec
        https://bugs.webkit.org/show_bug.cgi?id=174025

        Reviewed by Chris Dumez.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateDictionaryImplementationContent):
        (GenerateOverloadDispatcher):
        Remove special casing.

        * bindings/scripts/IDLParser.pm:
        (parseNonAnyType):
        Remove parsing of RegExp.

        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
        Update test results.

2017-07-02  Youenn Fablet  <youenn@apple.com>

        RealtimeOutgoingVideoSource should pass frame timestamp
        https://bugs.webkit.org/show_bug.cgi?id=174055

        Reviewed by Eric Carlson.

        Covered by manual testing since this only affects video encoding quality.

        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::sendFrame):

2017-07-01  Dan Bernstein  <mitz@apple.com>

        <rdar://problem/33096441> r219055 broke non-iOS builds.

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

2017-07-01  Dan Bernstein  <mitz@apple.com>

        [iOS] Remove code only needed when building for iOS 9.x
        https://bugs.webkit.org/show_bug.cgi?id=174068

        Reviewed by Tim Horton.

        * Configurations/FeatureDefines.xcconfig:
        * editing/cocoa/DataDetection.mm:
        (WebCore::DataDetection::isDataDetectorLink):
        (WebCore::DataDetection::shouldCancelDefaultAction):
        (WebCore::constructURLStringForResult):
        (WebCore::DataDetection::detectContentInRange):
        * page/cocoa/ResourceUsageThreadCocoa.mm:
        (WebCore::vmPageSize):
        * platform/cocoa/DataDetectorsCoreSoftLink.h:
        * platform/cocoa/DataDetectorsCoreSoftLink.mm:
        * platform/graphics/FontPlatformData.cpp:
        * platform/graphics/FontPlatformData.h:
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        (layerContentsFormat):
        (PlatformCALayerCocoa::updateContentsFormat):
        (PlatformCALayerCocoa::backingStoreBytesPerPixel):
        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::extendedSRGBColorSpaceRef):
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::drawPDFPage):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::lookupFallbackFont):
        * platform/graphics/cocoa/FontCocoa.mm:
        (WebCore::Font::variantCapsSupportsCharacterForSynthesis):
        (WebCore::Font::platformWidthForGlyph):
        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
        (WebCore::FontPlatformData::FontPlatformData):
        (WebCore::FontPlatformData::ctFont):
        * platform/graphics/cocoa/IOSurface.mm:
        (WebCore::IOSurface::sinkIntoImage):
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::setTimebase):
        * platform/graphics/ios/FontCacheIOS.mm:
        (WebCore::systemFontModificationAttributes):
        (WebCore::systemFontDescriptor):
        * platform/graphics/mac/FontCustomPlatformData.cpp:
        (WebCore::FontCustomPlatformData::supportsFormat):
        * platform/ios/LegacyTileGridTile.mm:
        (WebCore::LegacyTileGridTile::LegacyTileGridTile):
        * platform/ios/PlatformScreenIOS.mm:
        (WebCore::screenSupportsExtendedColor):
        * platform/ios/RemoteCommandListenerIOS.mm:
        (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
        (WebCore::RemoteCommandListenerIOS::~RemoteCommandListenerIOS):
        (WebCore::RemoteCommandListenerIOS::updateSupportedCommands):
        * platform/spi/cf/CFNetworkSPI.h:
        * platform/spi/cg/CoreGraphicsSPI.h:
        * platform/spi/cocoa/DataDetectorsCoreSPI.h:
        * platform/spi/cocoa/QuartzCoreSPI.h:
        * platform/spi/mac/AVFoundationSPI.h:

2017-07-01  Myles C. Maxfield  <mmaxfield@apple.com>

        REGRESSION(r218371): Reeder's default font is Times instead of San Francisco
        https://bugs.webkit.org/show_bug.cgi?id=173617
        <rdar://problem/32969819>

        Reviewed by Simon Fraser.

        On systems where USE_PLATFORM_SYSTEM_FALLBACK_LIST is set to true, the code in
        platformFontWithFamilySpecialCase() is still used when @font-face blocks specify
        src:local(system-ui), which made the assertion erroneously fire.

        Unfortunately, our architecture is such that an @font-face block represents a
        single entry in the font-family fallback list, which means it would be quite
        difficult to make local(system-ui) in an @font-face block expand at the level
        of the font cascade. So, this patch simply reverts to the previous behavior for
        local(system-ui) (which doesn't include the entire Core Text cascade list).
        This means that "font-family: system-ui" and "src: local(system-ui)" have
        different behavior, which is undesirable, but architecturally difficult to
        solve. I've added some FIXMEs to the code in the relevant places and filed
        https://bugs.webkit.org/show_bug.cgi?id=174023.

        Test: fast/text/font-face-local-system.html

        * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
        (WebCore::FontCascadeDescription::effectiveFamilyAt):
        * platform/graphics/ios/FontCacheIOS.mm:
        (WebCore::systemFontDescriptor):
        (WebCore::platformFontWithFamilySpecialCase):
        * platform/graphics/mac/FontCacheMac.mm:
        (WebCore::platformFontWithFamilySpecialCase):

2017-07-01  Ryosuke Niwa  <rniwa@webkit.org>

        Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
        https://bugs.webkit.org/show_bug.cgi?id=174004

        Reviewed by Simon Fraser.

        Made FrameLoader and NavigationScheduler UniqueRef in Frame so that we can forward declare them,
        and forward declared IntPoint and IntRect to avoid including FrameLoader.h, IntRect.h,
        and NavigationScheduler.h in Frame.h

        * Modules/mediastream/MediaStream.cpp:
        * Modules/webaudio/AudioContext.cpp:
        * Modules/websockets/WebSocket.cpp:
        (WebCore::WebSocket::connect): Avoid calling loader().mixedContentChecker().canRunInsecureContent(~)
        on a nullptr even though this used to work because we weren't de-referencing it.
        * bindings/js/ScriptController.cpp:
        * dom/Document.cpp:
        * dom/EventDispatcher.cpp:
        * editing/Editor.cpp:
        * editing/cocoa/EditorCocoa.mm:
        * editing/ios/EditorIOS.mm:
        * editing/mac/EditorMac.mm:
        * history/CachedPage.cpp:
        * html/HTMLObjectElement.cpp:
        * html/parser/HTMLDocumentParser.cpp:
        (WebCore::DocumentLoader::~DocumentLoader): Check !isLoading() before accessing frameLoader to avoid
        accessing m_frame->loader() inside ~FrameLoader.
        * html/parser/XSSAuditor.cpp:
        * html/parser/XSSAuditorDelegate.cpp:
        * inspector/InspectorInstrumentation.h:
        * loader/CrossOriginPreflightChecker.cpp:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::setOpener): Avoid accessing this FrameLoader via m_opener->loader() when it's
        this FrameLoader inside ~FrameLoader since UniqueRef<FrameLoader> is clears itself before calling
        the destructor of FrameLoader.
        * loader/ImageLoader.cpp:
        * loader/LinkLoader.cpp:
        * loader/SubframeLoader.cpp:
        * loader/appcache/ApplicationCacheGroup.cpp:
        * loader/appcache/DOMApplicationCache.cpp:
        * mathml/MathMLElement.cpp:
        * page/DOMWindow.cpp:
        * page/Frame.cpp:
        (WebCore::Frame::Frame):
        (WebCore::Frame::init): Moved here from Frame.h
        (WebCore::Frame::setDocument):
        * page/Frame.h:
        (WebCore::Frame::loader):
        (WebCore::Frame::navigationScheduler):
        * page/History.cpp:
        * page/Location.cpp:
        * page/PerformanceLogging.cpp:
        * page/PerformanceNavigation.cpp:
        * page/UserContentProvider.cpp:
        * page/ios/FrameIOS.mm:
        (WebCore::Frame::initWithSimpleHTMLDocument):
        * plugins/PluginInfoProvider.cpp:
        * replay/ReplayInputCreationMethods.cpp:
        * replay/UserInputBridge.cpp:
        * xml/XSLTProcessorLibxslt.cpp:
        * xml/parser/XMLDocumentParserLibxml2.cpp:

2017-07-01  Dan Bernstein  <mitz@apple.com>

        [macOS] Remove code only needed when building for OS X Yosemite
        https://bugs.webkit.org/show_bug.cgi?id=174067

        Reviewed by Tim Horton.

        * Configurations/Base.xcconfig:
        * Configurations/DebugRelease.xcconfig:
        * Configurations/FeatureDefines.xcconfig:
        * Configurations/Version.xcconfig:
        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::setEnhancedUserInterfaceAccessibility):
        * html/HTMLCanvasElement.cpp:
        * page/WheelEventDeltaFilter.cpp:
        (WebCore::WheelEventDeltaFilter::create):
        * page/mac/WheelEventDeltaFilterMac.h:
        * page/mac/WheelEventDeltaFilterMac.mm:
        * page/scrolling/ScrollingMomentumCalculator.cpp:
        * page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
        * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
        * platform/cocoa/NetworkExtensionContentFilter.mm:
        (replacementDataFromDecisionInfo):
        (WebCore::NetworkExtensionContentFilter::initialize):
        (WebCore::NetworkExtensionContentFilter::willSendRequest):
        (WebCore::NetworkExtensionContentFilter::responseReceived):
        (WebCore::NetworkExtensionContentFilter::addData):
        (WebCore::NetworkExtensionContentFilter::finishedAddingData):
        (WebCore::NetworkExtensionContentFilter::unblockHandler):
        * platform/graphics/ComplexTextController.h:
        * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
        (PlatformCAAnimationCocoa::setTimingFunction):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::FontCache::platformAlternateFamilyName):
        * platform/graphics/cocoa/FontCocoa.mm:
        (WebCore::Font::platformInit):
        * platform/graphics/cocoa/IOSurface.mm:
        (WebCore::IOSurface::sinkIntoImage):
        * platform/graphics/cocoa/WebGPULayer.mm:
        (-[WebGPULayer initWithGPUDevice:]):
        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
        (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
        * platform/graphics/mac/WebGLLayer.mm:
        (-[WebGLLayer initWithGraphicsContext3D:]):
        * platform/mac/BlacklistUpdater.mm:
        * platform/mac/PlatformScreenMac.mm:
        (WebCore::screenSupportsExtendedColor):
        * platform/mac/ValidationBubbleMac.mm:
        (WebCore::ValidationBubble::ValidationBubble):
        * platform/mac/WebGLBlacklist.mm:
        (WebCore::WebGLBlacklist::create):
        * platform/network/cocoa/WebCoreNSURLSession.h:
        * platform/network/cocoa/WebCoreNSURLSession.mm:
        * platform/network/mac/CertificateInfoMac.mm:
        (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
        * platform/network/mac/CookieJarMac.mm:
        (WebCore::setCookiesFromDOM):
        * platform/spi/cf/CFNetworkSPI.h:
        * platform/spi/cg/CoreGraphicsSPI.h:
        * platform/spi/cocoa/NEFilterSourceSPI.h:
        * platform/spi/cocoa/NSURLConnectionSPI.h:
        * platform/spi/cocoa/QuartzCoreSPI.h:
        * platform/spi/mac/NSScrollingInputFilterSPI.h:
        * platform/spi/mac/NSScrollingMomentumCalculatorSPI.h:
        * platform/spi/mac/TUCallSPI.h:
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::levelIndicatorFor):
        * svg/SVGToOTFFontConversion.cpp:
        (WebCore::SVGToOTFFontConverter::appendKERNTable):
        (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):

2017-06-30  Said Abou-Hallawa  <sabouhallawa@apple.com>

        If an image appears more than once on a page, decoding for painting one instance repaints them all
        https://bugs.webkit.org/show_bug.cgi?id=169944

        Reviewed by Simon Fraser.

        Make the Image::draw*() and GraphicsContext::draw*() functions return an
        ImageDrawResult which indicates whether the image is drawn or has requested
        an asynchronous image decoding.

        If the image requested an asynchronous image decoding, the issuer of the
        Image::draw(), which is of type CachedImageClient, will add itself to a
        set of m_pendingImageDrawingClients, which owned by CachedImage.

        When receiving the imageFrameAvailable() notification for a lrage image 
        from the decoding thread, CachedImage will loop through the clients that
        are only in m_pendingImageDrawingClients to ask them to repaint their
        rectangles.

        Test: fast/images/async-image-multiple-clients-repaint.html

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::didRemoveClient):
        (WebCore::CachedImage::addPendingImageDrawingClient):
        (WebCore::CachedImage::allClientsRemoved):
        (WebCore::CachedImage::clear):
        (WebCore::CachedImage::imageFrameAvailable):
        * loader/cache/CachedImage.h:
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::draw):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/CrossfadeGeneratedImage.cpp:
        (WebCore::CrossfadeGeneratedImage::draw):
        * platform/graphics/CrossfadeGeneratedImage.h:
        * platform/graphics/GeneratedImage.h:
        * platform/graphics/GradientImage.cpp:
        (WebCore::GradientImage::draw):
        * platform/graphics/GradientImage.h:
        * platform/graphics/GraphicsContext.cpp:
        (WebCore::GraphicsContext::drawImage):
        (WebCore::GraphicsContext::drawTiledImage):
        * platform/graphics/GraphicsContext.h:
        * platform/graphics/Image.cpp:
        (WebCore::Image::drawTiled):
        * platform/graphics/Image.h:
        * platform/graphics/ImageTypes.h:
        * platform/graphics/NamedImageGeneratedImage.cpp:
        (WebCore::NamedImageGeneratedImage::draw):
        * platform/graphics/NamedImageGeneratedImage.h:
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::draw):
        * platform/graphics/cg/PDFDocumentImage.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintIntoRect):
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::drawForContainer):
        (WebCore::SVGImage::draw):
        * svg/graphics/SVGImage.h:
        * svg/graphics/SVGImageForContainer.cpp:
        (WebCore::SVGImageForContainer::draw):
        * svg/graphics/SVGImageForContainer.h:

2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r214194): Safari leaves a popup window open opened during before unload
        https://bugs.webkit.org/show_bug.cgi?id=174016

        Reviewed by Chris Dumez.

        Address Dan's review comments.

        * loader/NavigationDisabler.h:
        (WebCore::NavigationDisabler::NavigationDisabler):
        (WebCore::NavigationDisabler::~NavigationDisabler):

2017-06-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS DnD] Text indicators for dragged links should always be legible if the link is legible
        https://bugs.webkit.org/show_bug.cgi?id=173860
        <rdar://problem/32974385>

        Reviewed by Tim Horton.

        Currently, TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges ensures that links backed by a
        RenderReplaced element don't render blank text indicators by additionally forcing the
        TextIndicatorOptionPaintAllContent option in order to capture the RenderReplaced content. If estimated
        background color is requested, this patch adds an additional path for "upgrading" the text indicator to paint
        all content: if the text color is not legible against the estimated background color, then it is likely that the
        background color estimate failed or the link itself was not legible in the first place; in the former case, to
        ensure that the link is still legible, we upgrade the given TextIndicatorOptions to paint all contents in the
        range.

        There is currently no way to test this, and also no simple way to introduce infrastructure to test text
        indicators.

        * page/TextIndicator.cpp:
        (WebCore::estimatedTextColorsForRange):

        Estimates all text colors that appear in a range by iterating over the text node renderers and consulting their
        render styles.

        (WebCore::adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary):

        If foreground text color is deemed not legible, force TextIndicatorOptionPaintAllContent instead of
        TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges.

        (WebCore::initializeIndicator):
        * rendering/TextPaintStyle.cpp:
        (WebCore::textColorIsLegibleAgainstBackgroundColor):
        (WebCore::adjustColorForVisibilityOnBackground):

        Allow other parts of WebCore to check the legibility of text against a background color.

        * rendering/TextPaintStyle.h:

2017-06-30  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r215096) Queries of URLs with non-special schemes should not percent-encode single quotes
        https://bugs.webkit.org/show_bug.cgi?id=174051
        <rdar://problem/33002846>

        Reviewed by Tim Horton.

        In r215096 I added ' to the set of characters to be percent-encoded in queries,
        but for interoperability and compatibility we need to do this only for special schemes, like http.

        Covered by new API tests.

        * platform/URLParser.cpp:
        (WebCore::isC0Control):
        (WebCore::shouldPercentEncodeQueryByte):
        (WebCore::URLParser::utf8QueryEncode):
        (WebCore::URLParser::encodeQuery):

2017-06-30  Daniel Bates  <dabates@apple.com>

        Attempt to fix the build following <https://trac.webkit.org/changeset/219019>
        (https://bugs.webkit.org/show_bug.cgi?id=165160)

        Export the FrameLoadRequest move constructor and move operator so that they
        can be used from WebKit.

        * loader/FrameLoadRequest.h:

2017-06-30  Don Olmstead  <don.olmstead@sony.com>

        [WebCore] Update AXObjectCache for !HAVE(ACCESSIBILITY)
        https://bugs.webkit.org/show_bug.cgi?id=174045

        Reviewed by Konstantin Tokarev.

        No new tests. No change in behavior.

        * accessibility/AXObjectCache.h:
        (WebCore::AXObjectCache::checkedStateChanged):
        (WebCore::AXObjectCache::childrenChanged):
        (WebCore::AXObjectCache::deferRecomputeIsIgnored):
        (WebCore::AXObjectCache::deferTextChangedIfNeeded):
        (WebCore::AXObjectCache::focusAriaModalNodeTimerFired):
        (WebCore::AXObjectCache::handleAriaExpandedChange):
        (WebCore::AXObjectCache::handleAriaRoleChanged):
        (WebCore::AXObjectCache::handleAttributeChanged):
        (WebCore::AXObjectCache::handleScrollbarUpdate):
        (WebCore::AXObjectCache::liveRegionChangedNotificationPostTimerFired):
        (WebCore::AXObjectCache::notificationPostTimerFired):
        (WebCore::AXObjectCache::passwordNotificationPostTimerFired):
        (WebCore::AXObjectCache::performDeferredCacheUpdate):
        (WebCore::AXObjectCache::postNotification):
        (WebCore::AXObjectCache::postPlatformNotification):
        (WebCore::AXObjectCache::postTextReplacementNotification):
        (WebCore::AXObjectCache::postTextReplacementNotificationForTextControl):
        (WebCore::AXObjectCache::postTextStateChangeNotification):
        (WebCore::AXObjectCache::recomputeIsIgnored):
        (WebCore::AXObjectCache::textChanged):
        (WebCore::AXObjectCache::updateCacheAfterNodeIsAttached):
        (WebCore::AXObjectCache::focusAriaModalNode): Deleted.

2017-06-30  Daniel Bates  <dabates@apple.com>

        Attempt to fix the Apple Windows build following <https://trac.webkit.org/changeset/219013>
        (https://bugs.webkit.org/show_bug.cgi?id=165160)

        Make FrameLoadRequest move constructor and move operator out-of-line so that callers
        do not need to include header SecurityOrigin.h.

        * loader/FrameLoadRequest.cpp:
        * loader/FrameLoadRequest.h:

2017-06-30  Alex Christensen  <achristensen@webkit.org>

        Stop soft linking with CFNetwork
        https://bugs.webkit.org/show_bug.cgi?id=174029

        Reviewed by Jer Noble.

        We link directly with CFNetwork.  There's no reason to soft link, 
        and it is causing a problem with linking when doing interesting things with CFNetwork.

        * platform/spi/cf/CFNetworkSPI.h:

2017-06-30  Daniel Bates  <dabates@apple.com>

        API::FrameInfo should know the web page that contains the frame; add API property webView to WKFrameInfo
        https://bugs.webkit.org/show_bug.cgi?id=165160
        <rdar://problem/29451999>

        Reviewed by Brady Eidson.

        Pass the document that is requesting the load to the loader.

        * inspector/InspectorFrontendClientLocal.cpp:
        (WebCore::InspectorFrontendClientLocal::openInNewTab): Pass the document when instantiating the FrameLoadRequest.
        Also use C++11 brace initialization to instantiate ResourceRequest.
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::navigate): Pass the document when instantiating the FrameLoadRequest.
        * loader/FrameLoadRequest.cpp:
        (WebCore::FrameLoadRequest::FrameLoadRequest): Moved from FrameLoadRequest.h.
        (WebCore::FrameLoadRequest::requester): Added.
        (WebCore::FrameLoadRequest::requesterSecurityOrigin): Added.
        * loader/FrameLoadRequest.h:
        (WebCore::FrameLoadRequest::FrameLoadRequest): Marked as WEBCORE_EXPORT and modified to take
        the document that requested the load.
        (WebCore::FrameLoadRequest::requester): Deleted; made out-of-line/moved to FrameLoadRequest.cpp.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::urlSelected): Pass the document when instantiating the FrameLoadRequest. Also use C++11
        brace initialization to instantiate ResourceRequest.
        (WebCore::FrameLoader::loadURLIntoChildFrame): Pass the document when instantiating the FrameLoadRequest.
        (WebCore::FrameLoader::loadFrameRequest): Substitute FrameLoadRequest::requesterSecurityOrigin() for
        FrameLoadRequest::requester() as the former replaces the latter.
        (WebCore::FrameLoader::loadURL): Pass the document when instantiating the NavigationAction.
        (WebCore::FrameLoader::load): Ditto.
        (WebCore::FrameLoader::loadWithDocumentLoader): Pass the document when instantiating the NavigationAction.
        Also use C++11 brace initialization syntax to instantiate the NavigationAction.
        (WebCore::FrameLoader::reload): Ditto.
        (WebCore::FrameLoader::loadPostRequest): Ditto.
        (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Pass the document when instantiating the NavigationAction.
        (WebCore::FrameLoader::loadDifferentDocumentItem): Pass the document when instantiating the NavigationAction.
        Also use C++11 brace initialization syntax to instantiate the NavigationAction.
        (WebCore::createWindow): Pass the document when instantiating the NavigationAction.
        * loader/NavigationAction.cpp:
        (WebCore::NavigationAction::NavigationAction): Modified to take the source document.
        * loader/NavigationAction.h:
        (WebCore::NavigationAction::isEmpty): Consider a NavigationAction empty if does not have a source document
        or the associated ResourceRequest has an empty URL.
        (WebCore::NavigationAction::sourceDocument): Added.
        (WebCore::NavigationAction::NavigationAction): Deleted; made out-of-line/moved to NavigationAction.cpp to
        avoid the need to include the header Document.h.
        * loader/NavigationScheduler.cpp:
        (WebCore::ScheduledURLNavigation::ScheduledURLNavigation): Store the document that scheduled the navigation.
        Also use C++11 brace initialization to instantiate in the member initialization list.
        (WebCore::ScheduledURLNavigation::initiatingDocument): Added. Retrieves the document that scheduled the navigation.
        (WebCore::NavigationScheduler::scheduleLocationChange): Pass the document when instantiating the FrameLoadRequest.
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNavigationPolicy): Pass the document when instantiating the NavigationAction.
        Also use C++11 brace initialization syntax to instantiate the NavigationAction.
        * page/ContextMenuController.cpp:
        (WebCore::openNewWindow):
        (WebCore::ContextMenuController::contextMenuItemSelected): Pass the document when instantiating the FrameLoadRequest.
        Also use C++11 brace initialization syntax to instantiate the FrameLoadRequest.
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::createWindow): Pass the document when instantiating the FrameLoadRequest.

2017-06-29  Jer Noble  <jer.noble@apple.com>

        Make Legacy EME API controlled by RuntimeEnabled setting.
        https://bugs.webkit.org/show_bug.cgi?id=173994

        Reviewed by Sam Weinig.

        Add a new RuntimeEnabledFeatures setting to control the availability of the WebKit prefixed EME APIs.

        * Configurations/FeatureDefines.xcconfig:
        * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl:
        * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl:
        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl:
        * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl:
        * dom/Element.idl:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
        (WebCore::HTMLMediaElement::webkitSetMediaKeys):
        (WebCore::HTMLMediaElement::keyAdded):
        * html/HTMLMediaElement.idl:
        * html/WebKitMediaKeyError.idl:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setLegacyEncryptedMediaAPIEnabled):
        (WebCore::RuntimeEnabledFeatures::legacyEncryptedMediaAPIEnabled):

2017-06-30  Chris Dumez  <cdumez@apple.com>

        Move ResourceLoadStatisticsStore to WebKit2/UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=174033

        Reviewed by Brent Fulgham.

        Move ResourceLoadStatisticsStore to WebKit2/UIProcess since it is only
        used in the WebKit2 UIProcess.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * loader/ResourceLoadObserver.cpp:
        (WebCore::primaryDomain):
        * loader/ResourceLoadStatistics.cpp:
        (WebCore::ResourceLoadStatistics::primaryDomain):
        * loader/ResourceLoadStatistics.h:

2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>

        Ran sort-Xcode-project-file.

        * WebCore.xcodeproj/project.pbxproj:

2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r214194): Safari leaves a popup window open opened during before unload
        https://bugs.webkit.org/show_bug.cgi?id=174016

        Reviewed by Chris Dumez.

        The bug was caused by WebKit allowing the opening of a new window via window.open but disallowing
        the initial navigation within the newly opened window while a beforeunload event is being dispatched.

        Because some websites which opens a window during a beforeunload event relies on the opened page
        to communicate back in order to close it. This resulted in a newly opened popup window with about:blank
        being left out on those websites.

        Fixed the bug by allowing the navigation of a new window as well as an existing another window.
        More concretely, we disallow navigations within the same frame tree as the one in which a beforeunload
        event is being dispatched, and allow navigations elsewhere (i.e. different window / page).
        During the destruction of a frame-less document, disallow all the navigations.

        Tests: fast/events/before-unload-navigate-different-window.html
               fast/events/before-unload-open-window.html
               fast/events/before-unload-sibling-frame.html

        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::Document::prepareForDestruction):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::isNavigationAllowed):
        (WebCore::FrameLoader::shouldClose):
        * loader/NavigationDisabler.h: Added. Extracted from NavigationScheduler.h
        (WebCore::NavigationDisabler::NavigationDisabler): Increment the newly added counter on MainFrame unless
        the frame is null (during the destruction of a frameless document) in which case we increment the global
        disable count.
        (WebCore::NavigationDisabler::~NavigationDisabler): Ditto for decrementation.
        (WebCore::NavigationDisabler::isNavigationAllowed): Only allow the navigation when there is no frameless
        document in destruction, and none of the frame in the same frame tree as the one given is currently in
        the process of dispatching a beforeunload event.
        * loader/NavigationScheduler.cpp:
        (WebCore::NavigationScheduler::shouldScheduleNavigation):
        * loader/NavigationScheduler.h:
        (WebCore::NavigationDisabler): Moved to NavigationDisabler.h.
        * page/MainFrame.h:
        (WebCore::MainFrame): Added s_globalNavigationDisableCount.

2017-06-30  Sam Weinig  <sam@webkit.org>

        [WebIDL] Add support for conditionally read-write attributes
        https://bugs.webkit.org/show_bug.cgi?id=173993

        Reviewed by Alex Christensen.

        The MEDIA_SOURCE feature/conditional requires changing a few readonly
        attributes into read-write attributes. In the past we handled this with
        custom bindings. This patch adds a new extended attribute, ConditionallyReadWrite
        which achieves the same result.

        * WebCore.xcodeproj/project.pbxproj:
        Move a few custom binding to the "GC / Wrapping Only" group.

        * bindings/js/JSAudioTrackCustom.cpp:
        (WebCore::JSAudioTrack::setKind): Deleted.
        (WebCore::JSAudioTrack::setLanguage): Deleted.
        * bindings/js/JSTextTrackCustom.cpp:
        (WebCore::JSTextTrack::setLanguage): Deleted.
        * bindings/js/JSVideoTrackCustom.cpp:
        (WebCore::JSVideoTrack::setKind): Deleted.
        (WebCore::JSVideoTrack::setLanguage): Deleted.
        Remove no longer needed custom bindings.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GeneratePropertiesHashTable):
        (GenerateImplementation):
        (GenerateAttributeSetterDefinition):
        (GenerateCallbackImplementationContent):
        (GenerateHashTableValueArray):
        (GenerateHashTable):
        Pipe ConditionallyReadWrite through the generator.

        * bindings/scripts/IDLAttributes.json:
        Add ConditionallyReadWrite.

        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/TestObj.idl:
        Add tests for ConditionallyReadWrite.

        * html/track/AudioTrack.idl:
        * html/track/TextTrack.idl:
        * html/track/VideoTrack.idl:
        Replace [Custom] with [ConditionallyReadWrite].

2017-06-30  Chris Dumez  <cdumez@apple.com>

        ResourceLoadObserver does not need a ResourceLoadStatisticsStore
        https://bugs.webkit.org/show_bug.cgi?id=174013

        Reviewed by Brent Fulgham.

        ResourceLoadObserver does not need a ResourceLoadStatisticsStore. ResourceLoadStatisticsStore is too complicated for its needs.
        ResourceLoadStatisticsStore can then be moved to WebKit2/UIProcess in a follow-up.

        * Modules/websockets/WebSocket.cpp:
        (WebCore::WebSocket::connect):
        * dom/UserGestureIndicator.cpp:
        (WebCore::UserGestureIndicator::UserGestureIndicator):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::willSendRequest):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadResourceSynchronously):
        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::shared):
        (WebCore::ResourceLoadObserver::setNotificationCallback):
        (WebCore::ResourceLoadObserver::shouldLog):
        (WebCore::ResourceLoadObserver::logFrameNavigation):
        (WebCore::ResourceLoadObserver::logSubresourceLoading):
        (WebCore::ResourceLoadObserver::logWebSocketLoading):
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
        (WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain):
        (WebCore::ResourceLoadObserver::takeResourceStatisticsForPrimaryDomain):
        (WebCore::ResourceLoadObserver::isPrevalentResource):
        (WebCore::ResourceLoadObserver::statisticsForOrigin):
        (WebCore::ResourceLoadObserver::takeStatistics):
        * loader/ResourceLoadObserver.h:
        * loader/ResourceLoadStatisticsStore.cpp:
        * loader/ResourceLoadStatisticsStore.h:
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::willSendRequestInternal):
        * testing/Internals.cpp:
        (WebCore::Internals::resourceLoadStatisticsForOrigin):

2017-06-30  Fujii Hironori  <Hironori.Fujii@sony.com>

        ASSERTION FAILED: !canAnimate() && !m_currentFrame
        https://bugs.webkit.org/show_bug.cgi?id=173089

        Reviewed by Said Abou-Hallawa.

        WebCore::BitmapImage::draw() has an assertion which ensures
        m_currentFrame is zero in case of async decoding. But, this
        assertion failed if an GIF animation image which have finished its
        animation was repainted. In that time, m_currentFrame was the last
        frame index of the image.

        Test: fast/images/animated-gif-paint-after-animation.html

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::draw): Assert m_currentFrame is zero or the animation finished.
        Call requestFrameAsyncDecodingAtIndex with m_currentFrame instead of zero.

2017-06-30  Ross Kirsling  <ross.kirsling@sony.com>

        [PAL] Move Sound into PAL
        https://bugs.webkit.org/show_bug.cgi?id=173999

        Reviewed by Alex Christensen.

        * Configurations/WebCore.xcconfig:
        * PlatformGTK.cmake:
        * PlatformMac.cmake:
        * PlatformWPE.cmake:
        * PlatformWin.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * editing/Editor.cpp:
        (WebCore::Editor::cut):
        (WebCore::Editor::copy):
        (WebCore::Editor::performDelete):
        * editing/EditorCommand.cpp:
        (WebCore::executeSelectToMark):
        (WebCore::executeSwapWithMark):
        * editing/mac/EditorMac.mm:
        (WebCore::Editor::takeFindStringFromSelection):
        * inspector/InspectorFrontendHost.cpp:
        (WebCore::InspectorFrontendHost::beep):
        * platform/Sound.h: Removed.

2017-06-30  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS DnD] Drag caret rect is incorrectly computed when dropping in editable content in iframes
        https://bugs.webkit.org/show_bug.cgi?id=174017
        <rdar://problem/32959782>

        Reviewed by Simon Fraser.

        We're currenly computing the drag caret rect (for the purposes of presentation at the client layers)
        incorrectly, in per-frame document coordinates instead of root view coordinates in the mainframe. This means
        drag caret geometry from embedded iframes in the document will show up in the content view with a rect in the
        coordinate space of the iframe.

        To fix this, we need to convert the drag caret rect to root view coordinates. This patch teaches
        DragCaretController to do this, and tweaks WebKit/WebKit2 to use caretRectInRootViewCoordinates.

        Test: DataInteractionTests.ExternalSourcePlainTextToIFrame

        * editing/FrameSelection.cpp:
        (WebCore::DragCaretController::caretRectInRootViewCoordinates):
        * editing/FrameSelection.h:

2017-06-30  Sam Weinig  <sam@webkit.org>

        [WebIDL] Replace use of __is_polymorphic with standard std::is_polymorphic<>::value
        https://bugs.webkit.org/show_bug.cgi?id=174012

        Reviewed by Alex Christensen.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):
        Replace __is_polymorphic with standard std::is_polymorphic<>::value. Remove clang
        specific guard now that we are using something other compilers support.

        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        * bindings/scripts/test/JS/JSMapLike.cpp:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        * bindings/scripts/test/JS/JSTestException.cpp:
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
        * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
        * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        * bindings/scripts/test/JS/JSTestStringifier.cpp:
        * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
        * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
        * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
        * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
        * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
        * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        Update test results.

2017-06-30  Youenn Fablet  <youenn@apple.com>

       Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
       https://bugs.webkit.org/show_bug.cgi?id=169389

       Reviewed by Alex Christensen.

       Covered by manual testing (appr.tc and https://youennf.github.io/webrtc-tests/src/content/peerconnection/trickle-ice/).
       Updated test is showing some more failing but this is due to the fact that we are no longer totally lying on the configuration of the
        underlying libwebrtc backend.

        Previously, we were creating a libwebrtc peer connection and then setting its configuration.
        libwebrtc does not like the configuration to be changed and may refuse to set the configuration.
        Instead of doing that, we are now creating the libwebrtc peer connection with the provided configuration.

        ICE candidate pool size is disabled as it is creating issues with running tests on bots.

        * Modules/mediastream/MediaEndpointPeerConnection.cpp:
        (WebCore::MediaEndpointPeerConnection::setConfiguration):
        * Modules/mediastream/MediaEndpointPeerConnection.h:
        * Modules/mediastream/PeerConnectionBackend.h:
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::initializeWith):
        (WebCore::iceServersFromConfiguration):
        (WebCore::RTCPeerConnection::initializeConfiguration):
        (WebCore::RTCPeerConnection::setConfiguration):
        * Modules/mediastream/RTCPeerConnection.h:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
        (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
        (WebCore::LibWebRTCMediaEndpoint::stop):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::configurationFromMediaEndpointConfiguration):
        (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::createActualPeerConnection):
        (WebCore::LibWebRTCProvider::createPeerConnection):
        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:


2017-06-30  Antoine Quint  <graouts@apple.com>

        Top controls bars should invert with right-to-left user interface layout direction locale
        https://bugs.webkit.org/show_bug.cgi?id=173989
        <rdar://problem/32863552>

        Reviewed by Dean Jackson.

        When the user interface layout direction is set by the locale to be right-to-left, we now:

            - invert the two top controls bars
            - invert the layout order for the fullscreen / PiP controls bar
            - orient the volume button the opposite direction when presented in a top controls bar

        Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl.html

        * Modules/modern-media-controls/controls/icon-service.js: Add new RTL variants for the mute and unmute icons.
        * Modules/modern-media-controls/controls/inline-media-controls.css: Invert the position of the two top controls
        bars when we switch user interface layout direction.
        (.media-controls.inline.uses-ltr-user-interface-layout-direction > .controls-bar.top-left,):
        (.media-controls.inline.uses-ltr-user-interface-layout-direction > .controls-bar.top-right,):
        (.media-controls.inline > .controls-bar.top-left): Deleted.
        (.media-controls.inline > .controls-bar.top-right): Deleted.
        * Modules/modern-media-controls/controls/inline-media-controls.js:
        (InlineMediaControls.prototype.layout): Default to using the LTR variant for the mute button icon since
        it should only use the RTL variant in case the locale requires it *and* we display the mute button in a
        top controls bar rather than the bottom controls bar (ie. when width becomes constrained).
        (InlineMediaControls.prototype._topLeftContainerButtons): Invert the order of the fullscreen and PiP
        buttons based on the user interface layout direction.
        (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
        (InlineMediaControls):
        * Modules/modern-media-controls/controls/media-controls.js:
        (MediaControls.prototype.set usesLTRUserInterfaceLayoutDirection): Schedule a layout when the user interface
        layout direction changes.
        * Modules/modern-media-controls/controls/mute-button.js: Add a new "usesRTLIconVariant" property, false by
        default, to indicate we want to use the RTL variant of the button's icon.
        (MuteButton):
        (MuteButton.prototype.get muted):
        (MuteButton.prototype.set muted):
        (MuteButton.prototype.set usesRTLIconVariant):
        (MuteButton.prototype.layout):
        * Modules/modern-media-controls/images/iOS/Mute-RTL.svg: Added.
        * Modules/modern-media-controls/images/iOS/VolumeHi-RTL.svg: Added.
        * Modules/modern-media-controls/images/macOS/Mute-RTL.svg: Added.
        * Modules/modern-media-controls/images/macOS/VolumeHi-RTL.svg: Added.
        * Modules/modern-media-controls/media/media-controller.js: Use an ivar to track when it's worth notifying the
        media controls that the user interface layout direction has changed. This means we won't need to schedule a
        layout in case it's set to the current value.
        (MediaController):
        (MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):

2017-06-29  Zalan Bujtas  <zalan@apple.com>

        BreakingContext::handleReplaced() should use replacedBox instead of m_current.renderer().
        https://bugs.webkit.org/show_bug.cgi?id=174011

        Reviewed by Simon Fraser.

        No change in functionality.

        * rendering/line/BreakingContext.h:
        (WebCore::BreakingContext::handleReplaced):
        * rendering/line/LineWidth.cpp:
        (WebCore::LineWidth::applyOverhang):
        * rendering/line/LineWidth.h:

2017-06-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS DnD] Web content process crashes when the selection is moved far offscreen in dragstart
        https://bugs.webkit.org/show_bug.cgi?id=174010
        <rdar://problem/32597802>

        Reviewed by Tim Horton.

        The TextIndicator snapshot generated in createDragImageForSelection is not guaranteed to succeed; this patch
        adds a null check following TextIndicator::createWithSelectionInFrame and bails early if the snapshot was not
        successful.

        Test: DataInteractionTests.DoNotCrashWhenSelectionMovesOffscreenAfterDragStart

        * platform/ios/DragImageIOS.mm:
        (WebCore::createDragImageForSelection):

2017-06-29  Chris Fleizach  <cfleizach@apple.com>

        AX: Cannot call setValue() on contenteditable or ARIA text controls
        https://bugs.webkit.org/show_bug.cgi?id=173520

        Reviewed by Ryosuke Niwa.

        Add support for changing the value of a contenteditable and any other aria text control in setValue().
 
        Test: accessibility/mac/set-value-editable-types.html

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::setValue):

2017-06-28  Simon Fraser  <simon.fraser@apple.com>

        getBoundingClientRect returns wrong value for combination of page zoom and scroll
        https://bugs.webkit.org/show_bug.cgi?id=173841
        rdar://problem/32983841

        Reviewed by Dean Jackson.

        The layout viewport returned by FrameView::layoutViewportRect() is affected by page (Command-+) zooming,
        since it's computed using scroll positions, so when we use its origin to convert into client coordinates
        (which are zoom-agnostic), we need to account for page zoom, so fix FrameView::documentToClientOffset()
        to do this.

        Callers of documentToClientOffset() were checked, revealing that event client coordinates were also
        wrong with page zoom and are fixed in the same way. It was found that SimulatedClick was using an
        entirely wrong rect to compute its location: Element::clientRect() is NOT in client coordinates,
        so change this code to use getBoundingClientRect() instead.

        Minor refactoring in MouseRelatedEvent to make getting to the FrameView cleaner.

        Some geometry types enhanced to have non-mutating scale functions.

        Tests: fast/events/simulated-click-zoomed.html
               fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html

        * dom/MouseRelatedEvent.cpp:
        (WebCore::MouseRelatedEvent::init):
        (WebCore::MouseRelatedEvent::initCoordinates):
        (WebCore::MouseRelatedEvent::frameView):
        (WebCore::MouseRelatedEvent::documentToAbsoluteScaleFactor):
        (WebCore::MouseRelatedEvent::computePageLocation):
        (WebCore::MouseRelatedEvent::computeRelativePosition):
        (WebCore::pageZoomFactor): Deleted.
        (WebCore::frameScaleFactor): Deleted.
        * dom/MouseRelatedEvent.h:
        (WebCore::MouseRelatedEvent::absoluteLocation):
        (WebCore::MouseRelatedEvent::setAbsoluteLocation): Deleted.
        * dom/SimulatedClick.cpp:
        * page/FrameView.cpp:
        (WebCore::FrameView::layoutViewportRect): baseLayoutViewportSize() is the same as the old code.
        (WebCore::FrameView::documentToAbsoluteScaleFactor):
        (WebCore::FrameView::absoluteToDocumentScaleFactor):
        (WebCore::FrameView::absoluteToDocumentPoint):
        (WebCore::FrameView::documentToClientOffset):
        * page/FrameView.h:
        * platform/graphics/FloatPoint.h:
        (WebCore::FloatPoint::scale):
        (WebCore::FloatPoint::scaled):
        * platform/graphics/FloatSize.h:
        (WebCore::FloatSize::scaled):
        * platform/graphics/LayoutPoint.h:
        (WebCore::LayoutPoint::scaled):

2017-06-29  Megan Gardner  <megan_gardner@apple.com>

        Unreviewed, fixing Window's build after r218976

        * rendering/ScrollAlignment.cpp:
        (WebCore::operator<<):

2017-06-29  Megan Gardner  <megan_gardner@apple.com>

        Add TextStream operators for Range, VisiblePosition, VisibleSelection, and ScrollAlignment
        https://bugs.webkit.org/show_bug.cgi?id=173997

        Reviewed by Simon Fraser.

        Adding logging that can be used with TextStream-based LOG_WITH_STREAM.

        * dom/Range.cpp:
        (WebCore::operator<<):
        * dom/Range.h:
        * editing/VisiblePosition.h:
        * editing/VisibleSelection.cpp:
        (WebCore::operator<<):
        * editing/VisibleSelection.h:
        * rendering/ScrollAlignment.cpp:
        (WebCore::operator<<):
        * rendering/ScrollAlignment.h:

2017-06-29  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r218903.

        This patch and its fix cause immediate flakiness on all WK2
        testers

        Reverted changeset:

        "Support PeerConnectionStates::BundlePolicy::MaxBundle when
        setting rtc configuration"
        https://bugs.webkit.org/show_bug.cgi?id=169389
        http://trac.webkit.org/changeset/218903

2017-06-29  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r218963.

        This patch and its fix cause immediate flakiness on all WK2
        testers

        Reverted changeset:

        "Support PeerConnectionStates::BundlePolicy::MaxBundle when
        setting rtc configuration"
        https://bugs.webkit.org/show_bug.cgi?id=169389
        http://trac.webkit.org/changeset/218963

2017-06-29  Chris Dumez  <cdumez@apple.com>

        Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess
        https://bugs.webkit.org/show_bug.cgi?id=173990

        Reviewed by Brent Fulgham.

        Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess.
        They really have different API and there is therefore close to no code duplication.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::primaryDomain):
        (WebCore::ResourceLoadObserver::setStatisticsQueue):
        (WebCore::ResourceLoadObserver::shouldLog):
        * loader/ResourceLoadObserver.h:
        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::ResourceLoadStatisticsStore::primaryDomain):
        * loader/ResourceLoadStatisticsStore.h:
        * platform/URL.h:

2017-06-29  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove custom binding for UserMessageHandlersNamespace
        https://bugs.webkit.org/show_bug.cgi?id=173956

        Reviewed by Darin Adler.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSUserMessageHandlersNamespaceCustom.cpp: Removed.
        Remove JSUserMessageHandlersNamespaceCustom.cpp

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateNamedGetterLambda):
        Add support for calling named getters with additional arguments from [CallWith].

        (GenerateAttributeGetterBodyDefinition):
        (GenerateAttributeSetterBodyDefinition):
        (GenerateCallWithUsingReferences):
        (GenerateCallWithUsingPointers):
        (GenerateConstructorCallWithUsingPointers):
        (GenerateCallWith):
        (GenerateParametersCheck):
        Update arguments to GenerateCallWith(Using...) to no longer pass an operation,
        which was only needed for the no longer used ScriptArguments, pass a thisObject
        reference, and optionally pass an indentation.

        * bindings/scripts/IDLAttributes.json:
        Remove no longer used ScriptArguments and CallStack, add World.

        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttributeGetter): Deleted.
        (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute): Deleted.
        (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttributeSetter): Deleted.
        (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute): Deleted.
        (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStackBody): Deleted.
        (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack): Deleted.
        * bindings/scripts/test/TestObj.idl:
        Remove tests of ScriptArguments and CallStack.

        * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: Added.
        * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: Added.
        * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: Added.
        * bindings/scripts/test/TestNamedGetterCallWith.idl: Added.
        * bindings/scripts/test/TestNamedGetterNoIdentifier.idl: Added.
        * bindings/scripts/test/TestNamedGetterWithIdentifier.idl: Added.
        Add basic named getter tests and a specific test of named getters using CallWith.

        * page/UserMessageHandlersNamespace.cpp:
        (WebCore::UserMessageHandlersNamespace::supportedPropertyNames):
        (WebCore::UserMessageHandlersNamespace::namedItem):
        (WebCore::UserMessageHandlersNamespace::handler): Deleted.
        * page/UserMessageHandlersNamespace.h:
        Rename handler to namedItem, matching convention and the expectations of the
        bindings generator and swap the order of the arguments for the same reason.

        * page/UserMessageHandlersNamespace.idl:
        Remove CustomGetOwnPropertySlotAndDescriptor, and add the anonymous named getter.

2017-06-29  Chris Dumez  <cdumez@apple.com>

        Avoid copying ResourceLoadStatistics objects
        https://bugs.webkit.org/show_bug.cgi?id=173972

        Reviewed by Brent Fulgham.

        Avoid copying ResourceLoadStatistics objects given that they are big. Make the type move-only
        to avoid such mistakes in the future.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::logFrameNavigation):
        * loader/ResourceLoadStatistics.h:
        (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):

2017-06-29  John Wilander  <wilander@apple.com>

        Fix for intermittent Layout Test fail http/tests/loading/resourceLoadStatistics/telemetry-generation.html
        https://bugs.webkit.org/show_bug.cgi?id=173940
        <rdar://problem/33018125>

        Reviewed by Brent Fulgham.

        No new tests. This change enables the exiting test to pass.

        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
            Added an assert.

2017-06-29  Youenn Fablet  <youenn@apple.com>

        Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
        https://bugs.webkit.org/show_bug.cgi?id=169389

        Unreviewed.

        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::configurationFromMediaEndpointConfiguration): Reactivating CPU overuse detection as it might be the cause of the bots regressions.

2017-06-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] ResourceHandleManager violate the class responsibility of ResourceHandle
        https://bugs.webkit.org/show_bug.cgi?id=173630

        Reviewed by Alex Christensen.

        * platform/network/ResourceHandle.h:
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        (WebCore::calculateWebTimingInformations):
        (WebCore::handleLocalReceiveResponse):
        (WebCore::writeCallback):
        (WebCore::isHttpInfo):
        (WebCore::isHttpRedirect):
        (WebCore::isHttpAuthentication):
        (WebCore::isHttpNotModified):
        (WebCore::isAppendableHeader):
        (WebCore::removeLeadingAndTrailingQuotes):
        (WebCore::getProtectionSpace):
        (WebCore::headerCallback):
        (WebCore::readCallback):
        (WebCore::getFormElementsCount):
        (WebCore::setupFormData):
        (WebCore::ResourceHandle::setupPUT):
        (WebCore::ResourceHandle::setupPOST):
        (WebCore::ResourceHandle::handleDataURL):
        (WebCore::ResourceHandle::dispatchSynchronousJob):
        (WebCore::ResourceHandle::applyAuthentication):
        (WebCore::ResourceHandle::initialize):
        (WebCore::ResourceHandle::handleCurlMsg):
        * platform/network/curl/ResourceHandleManager.cpp:
        (WebCore::ResourceHandleManager::downloadTimerCallback):
        (WebCore::ResourceHandleManager::startJob):
        (WebCore::calculateWebTimingInformations): Deleted.
        (WebCore::isHttpInfo): Deleted.
        (WebCore::isHttpRedirect): Deleted.
        (WebCore::isHttpAuthentication): Deleted.
        (WebCore::isHttpNotModified): Deleted.
        (WebCore::handleLocalReceiveResponse): Deleted.
        (WebCore::writeCallback): Deleted.
        (WebCore::isAppendableHeader): Deleted.
        (WebCore::removeLeadingAndTrailingQuotes): Deleted.
        (WebCore::getProtectionSpace): Deleted.
        (WebCore::headerCallback): Deleted.
        (WebCore::readCallback): Deleted.
        (WebCore::getFormElementsCount): Deleted.
        (WebCore::setupFormData): Deleted.
        (WebCore::ResourceHandleManager::setupPUT): Deleted.
        (WebCore::ResourceHandleManager::setupPOST): Deleted.
        (WebCore::handleDataURL): Deleted.
        (WebCore::ResourceHandleManager::dispatchSynchronousJob): Deleted.
        (WebCore::ResourceHandleManager::applyAuthenticationToRequest): Deleted.
        (WebCore::ResourceHandleManager::initializeHandle): Deleted.
        * platform/network/curl/ResourceHandleManager.h:

2017-06-29  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Async image decoding should be disabled for iBooks on tvOS
        https://bugs.webkit.org/show_bug.cgi?id=173945

        Reviewed by Simon Fraser.

        The iBooks on tvOS is an AppStore application. We need to disable async
        image decoding for iBooks on tvOS permanently through WebKit.

        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
        (WebCore::IOSApplication::isIBooks):
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::updateFromSettings):

2017-06-29  Sam Weinig  <sam@webkit.org>

        [WebIDL] Add a new extended attribute to model the forced return value optimization used on Node and Crypto
        https://bugs.webkit.org/show_bug.cgi?id=173961

        Reviewed by Darin Adler.

        Node and Crypto were both using custom bindings to implement an optimization
        for operations that always returned one one of the arguments passed in. The
        optimization directly returns the JSValue argument, avoiding wrapping and 
        unwrapping, and all the cache lookups that might entail. This allows that 
        optimization to work without custom bindings by adding a new extended attribute
        [ReturnValue] that can annotate an argument. When used, the implementation
        function is expected to return either void or ExceptionOr<void>.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSCryptoCustom.cpp: Removed.
        Remove JSCryptoCustom.cpp.

        * bindings/js/JSNodeCustom.cpp:
        (WebCore::JSNode::insertBefore): Deleted.
        (WebCore::JSNode::replaceChild): Deleted.
        (WebCore::JSNode::removeChild): Deleted.
        (WebCore::JSNode::appendChild): Deleted.
        Remove custom functions.

        * bindings/scripts/CodeGeneratorJS.pm:
        (OperationHasForcedReturnValue):
        Add helper to determine if an operation has [ReturnValue] on any argument.

        (NeedsExplicitPropagateExceptionCall):
        We must treat operations with a [ReturnValue] argument like we do operations
        returning void, and explicitly check for exceptions.

        (GenerateParametersCheck):
        Pull out the argument in a variable called 'returnValue' if it is annotated
        with [ReturnValue].

        (GenerateImplementationFunctionCall):
        Special case operations with a [ReturnValue] argument to return the previously
        set aside 'returnValue' variable.

        * bindings/scripts/IDLAttributes.json:
        Add [ReturnValue].

        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationBody):
        (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimization):
        (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithExceptionBody):
        (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithException):
        * bindings/scripts/test/TestObj.idl:
        Add tests for [ReturnValue].

        * dom/Node.idl:
        * page/Crypto.idl:
        Add [ReturnValue] annotations and remove [Custom] annotations.

2017-06-29  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r218944.

        Optimization is incorrect

        Reverted changeset:

        "Avoid copying ResourceLoadStatistics objects"
        https://bugs.webkit.org/show_bug.cgi?id=173972
        http://trac.webkit.org/changeset/218944

2017-06-29  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r218896): ASSERT in WebPageProxy::dataCallback
        https://bugs.webkit.org/show_bug.cgi?id=173968

        Reviewed by Michael Catanzaro.

        The problem is that WebPageProxy::getLoadDecisionForIcon() sends 0 as callback ID when the decision is to not
        load the icon. Since r218896 we always notify the client even when the decision is to not load the icon, in
        which case the UI doesn't really expect a callback. When WebPageProxy::dataCallback is called with a 0 callback ID,
        CallbackMap::take() crashes in RELEASE_ASSERT(callbackID).

        Fixes several GTK+ unit tests that are crashing.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::didGetLoadDecisionForIcon): Return earlier if decision is false or frame is nullptr.
        (WebCore::DocumentLoader::finishedLoadingIcon): Move RELEASE_ASSERT to notifyFinishedLoadingIcon().
        (WebCore::DocumentLoader::notifyFinishedLoadingIcon): Assert if callbackIdentifier is 0 or m_frame is nullptr,
        since it's no longer expected to happen.

2017-06-29  Chris Dumez  <cdumez@apple.com>

        statistics.mostRecentUserInteraction should be of type WallTime
        https://bugs.webkit.org/show_bug.cgi?id=173974

        Reviewed by Brent Fulgham.

        statistics.mostRecentUserInteraction should be of type WallTime for clarity.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
        (WebCore::ResourceLoadObserver::logUserInteraction):
        (WebCore::ResourceLoadObserver::clearUserInteraction):
        * loader/ResourceLoadStatistics.cpp:
        (WebCore::ResourceLoadStatistics::encode):
        (WebCore::ResourceLoadStatistics::decode):
        (WebCore::ResourceLoadStatistics::toString):
        (WebCore::ResourceLoadStatistics::merge):
        * loader/ResourceLoadStatistics.h:
        (WebCore::ResourceLoadStatistics::mostRecentUserInteractionTime): Deleted.
        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::shouldPartitionCookies):
        (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
        (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):

2017-06-29  JF Bastien  <jfbastien@apple.com>

        WebAssembly: disable some APIs under CSP
        https://bugs.webkit.org/show_bug.cgi?id=173892
        <rdar://problem/32914613>

        Reviewed by Daniel Bates.

        This does the basic separation of eval-blocked and
        WebAssembly-blocked, but currently only blocks neither or both. I
        think we'll eventually consider allowing one to be blocked but not
        the other, so this separation makes sense and means that when we
        want to do the change it'll be tiny. At a minimum we want a
        different error message, which this patch provides (a lot of the
        code ties blocking to the error message).

        Tests: http/tests/security/contentSecurityPolicy/WebAssembly-allowed.html
               http/tests/security/contentSecurityPolicy/WebAssembly-blocked-in-about-blank-iframe.html
               http/tests/security/contentSecurityPolicy/WebAssembly-blocked-in-external-script.html
               http/tests/security/contentSecurityPolicy/WebAssembly-blocked-in-subframe.html
               http/tests/security/contentSecurityPolicy/WebAssembly-blocked.html

        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::enableWebAssembly):
        (WebCore::ScriptController::disableWebAssembly):
        * bindings/js/ScriptController.h:
        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::disableWebAssembly):
        * bindings/js/WorkerScriptController.h:
        * dom/Document.cpp:
        (WebCore::Document::disableWebAssembly):
        * dom/Document.h:
        * dom/ScriptExecutionContext.h:
        * page/csp/ContentSecurityPolicy.cpp:
        (WebCore::ContentSecurityPolicy::didCreateWindowProxy):
        (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext):
        * page/csp/ContentSecurityPolicy.h:
        * page/csp/ContentSecurityPolicyDirectiveList.cpp:
        (WebCore::ContentSecurityPolicyDirectiveList::create):
        * page/csp/ContentSecurityPolicyDirectiveList.h:
        (WebCore::ContentSecurityPolicyDirectiveList::webAssemblyDisabledErrorMessage):
        (WebCore::ContentSecurityPolicyDirectiveList::setWebAssemblyDisabledErrorMessage):
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::disableWebAssembly):
        * workers/WorkerGlobalScope.h:

2017-06-29  Zalan Bujtas  <zalan@apple.com>

        Make InlineBox::m_topLeft and m_logicalWidth protected.
        https://bugs.webkit.org/show_bug.cgi?id=173973

        Reviewed by Simon Fraser.

        I don't think this reasoning from 10 years ago is valid anymore -> 
          "FIXME: Would like to make this protected, but methods are accessing these members over in the part."
        (comment was conveniently removed in a later commit).

        No change in functionality.

        * rendering/InlineBox.h:
        (WebCore::InlineBox::InlineBox):

2017-06-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS DnD] Adopt +objectWithItemProviderData: for serializing NSItemProviderReading-conformant objects
        https://bugs.webkit.org/show_bug.cgi?id=173971
        <rdar://problem/33006605>

        Reviewed by Tim Horton.

        Moves off of a very-recently-deprecated API, in favor of its replacement. Guarded by a runtime check and staging
        declarations. No change in behavior.

        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):

2017-06-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Separate global curl settings from ResourceHandleManager as CurlContext class
        https://bugs.webkit.org/show_bug.cgi?id=173629

        Reviewed by Alex Christensen.

        * PlatformWinCairo.cmake:
        * platform/network/curl/CookieJarCurl.cpp:
        (WebCore::setCookiesFromDOM):
        (WebCore::cookiesForSession):
        * platform/network/curl/CurlContext.cpp: Added.
        (WebCore::certificatePath):
        (WebCore::cookieJarPath):
        (WebCore::CurlContext::CurlContext):
        (WebCore::CurlContext::~CurlContext):
        (WebCore::CurlContext::initCookieSession):
        (WebCore::CurlContext::ProxyInfo::url):
        (WebCore::CurlContext::setProxyInfo):
        (WebCore::CurlContext::getEffectiveURL):
        (WebCore::CurlContext::createMultiHandle):
        (WebCore::CurlContext::mutexFor):
        (WebCore::CurlContext::lock):
        (WebCore::CurlContext::unlock):
        * platform/network/curl/CurlContext.h: Added.
        (WebCore::CurlContext::singleton):
        (WebCore::CurlContext::curlShareHandle):
        (WebCore::CurlContext::getCookieJarFileName):
        (WebCore::CurlContext::setCookieJarFileName):
        (WebCore::CurlContext::getCertificatePath):
        (WebCore::CurlContext::shouldIgnoreSSLErrors):
        (WebCore::CurlContext::proxyInfo):
        (WebCore::CurlContext::setProxyInfo):
        (WebCore::CurlContext::getLogFile):
        (WebCore::CurlContext::isVerbose):
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::init):
        (WebCore::CurlDownload::start):
        (WebCore::CurlDownload::cancel):
        (WebCore::CurlDownload::didReceiveHeader):
        * platform/network/curl/CurlDownload.h:
        * platform/network/curl/CurlJobManager.cpp: Renamed from Source/WebCore/platform/network/curl/CurlManager.cpp.
        (WebCore::CurlJobManager::CurlJobManager):
        (WebCore::CurlJobManager::~CurlJobManager):
        (WebCore::CurlJobManager::add):
        (WebCore::CurlJobManager::remove):
        (WebCore::CurlJobManager::getActiveCount):
        (WebCore::CurlJobManager::getPendingCount):
        (WebCore::CurlJobManager::startThreadIfNeeded):
        (WebCore::CurlJobManager::stopThread):
        (WebCore::CurlJobManager::stopThreadIfIdle):
        (WebCore::CurlJobManager::updateHandleList):
        (WebCore::CurlJobManager::addToCurl):
        (WebCore::CurlJobManager::removeFromCurl):
        (WebCore::CurlJobManager::workerThread):
        * platform/network/curl/CurlJobManager.h: Renamed from Source/WebCore/platform/network/curl/CurlManager.h.
        (WebCore::CurlJobManager::singleton):
        * platform/network/curl/ResourceHandleManager.cpp:
        (WebCore::ResourceHandleManager::ResourceHandleManager):
        (WebCore::ResourceHandleManager::~ResourceHandleManager):
        (WebCore::handleLocalReceiveResponse):
        (WebCore::getProtectionSpace):
        (WebCore::headerCallback):
        (WebCore::ResourceHandleManager::downloadTimerCallback):
        (WebCore::ResourceHandleManager::initializeHandle):
        (WebCore::certificatePath): Deleted.
        (WebCore::cookieJarPath): Deleted.
        (WebCore::ResourceHandleManager::setCookieJarFileName): Deleted.
        (WebCore::ResourceHandleManager::getCookieJarFileName): Deleted.
        (WebCore::ResourceHandleManager::setProxyInfo): Deleted.
        (WebCore::ResourceHandleManager::initCookieSession): Deleted.
        * platform/network/curl/ResourceHandleManager.h:
        (): Deleted.

2017-06-29  Chris Dumez  <cdumez@apple.com>

        Avoid copying ResourceLoadStatistics objects
        https://bugs.webkit.org/show_bug.cgi?id=173972

        Reviewed by Geoffrey Garen.

        Avoid copying ResourceLoadStatistics objects given that they are big. Make the type move-only
        to avoid such mistakes in the future.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::logFrameNavigation):
        * loader/ResourceLoadStatistics.h:
        (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):

2017-06-29  Antoine Quint  <graouts@apple.com>

        Full stop shows to the right of the picture-in-picture localised string in Hebrew
        https://bugs.webkit.org/show_bug.cgi?id=173966
        <rdar://problem/32847376>

        Reviewed by Dean Jackson.

        We manually set the CSS "direction" property to "rtl" when we're not using an LTR language for a placard.

        Test: media/modern-media-controls/placard/placard-ltr.html

        * Modules/modern-media-controls/controls/placard.css:
        (.media-controls:not(.uses-ltr-user-interface-layout-direction) .placard):

2017-06-29  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed Apple CMake build after r218901

        I did not add 'cocoa/FileMonitorCocoa.mm' to the PlatformMac.cmake file as part of r218901.):

        * PlatformMac.cmake:

2017-06-29  Frederic Wang  <fwang@igalia.com>

        Small improvement of calls to RenderLayerBacking members
        https://bugs.webkit.org/show_bug.cgi?id=173969

        Reviewed by Simon Fraser.

        No new tests, behavior unchanged.

        * page/FrameView.cpp:
        (WebCore::FrameView::tiledBacking): Access the member with RenderLayerBacking::tiledBacking.
        (WebCore::FrameView::updateTilesForExtendedBackgroundMode): Ditto.
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::usesCompositedScrolling): Use RenderLayerBacking::hasScrollingLayer as
        it better matches the intention of the check here.

2017-06-29  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Fix ReadableStream "strategy" argument handling
        https://bugs.webkit.org/show_bug.cgi?id=172716

        Reviewed by Xabier Rodriguez-Calvar.

        Aligned default strategy parameter with spec, as defined in [1].
        
        [1] https://streams.spec.whatwg.org/#rs-constructor

        Added new tests and updated some existing ones based on the newly
        expected behavior. Also updated expectations for WPT streams tests.

        * Modules/streams/ReadableStream.js:
        (initializeReadableStream): Fixed initialization of strategy.

2017-06-29  Antti Koivisto  <antti@apple.com>

        REGRESSION(r215347): NAS4Free Pop-down menus fail to appear
        https://bugs.webkit.org/show_bug.cgi?id=173967
        <rdar://problem/32690114>

        Reviewed by Andreas Kling.

        Menus on this configuration page operate by mutating visibility. We fail to trigger required
        compositing updates when visibility changes on non-composited layer. Visibility of a non-composited
        descendant may affect geometry of the composited ancestor layer.

        Test: compositing/backing/non-composited-visibility-change.html

        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::layerStyleChanged):
        (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer): Added.

            Trigger compositing update for non-composited layers on visibility change.
            Factor tests into function.

        * rendering/RenderLayerCompositor.h:

2017-06-28  Frederic Wang  <fwang@igalia.com>

        Align Document::canNavigate on the HTM5 specification
        https://bugs.webkit.org/show_bug.cgi?id=173162

        Reviewed by Chris Dumez.

        Currently when a frame A with a sandboxed navigation flag tries and navigates another frame B
        then Document::canNavigate verifies the cases where we try to navigate A's top frame (in
        that case the allow-top-navigation flag is needed) or not (in that case, B must be a
        descendant of A). This patch refines that a bit to check the case where B is a popup (in that
        case navigation is permitted if A is the opener of B). This change aligns on the HTML5
        specification and allows to pass more W3C Web Platform tests.
        See https://html.spec.whatwg.org/multipage/browsers.html#allowed-to-navigate

        Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html
               imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html

        * dom/Document.cpp:
        (WebCore::Document::canNavigate): This refines the case where the document's frame has the
        sandbox navigation flag set in order to handle popup navigation. New comments referring to
        the HTML5 specification are also added.

2017-06-28  Myles C. Maxfield  <mmaxfield@apple.com>

        Only apply font features for the particular type of font they are being applied to
        https://bugs.webkit.org/show_bug.cgi?id=172661
        <rdar://problem/31534119>
        <rdar://problem/32799624>

        Reviewed by Simon Fraser.

        There are two types of font formats which support features: AAT and OTF. Each of them has
        a different idea about what the identity of a feature is. We were specifying both types
        of feature identities to Core Text; however, this is causing Core Text to get confused.
        Instead, we should only apply AAT features to AAT fonts and OTF features to OTF fonts.

        Test: Un-marking these tests as failure on High Sierra:
              css3/font-variant-petite-caps-synthesis-coverage.html
              css3/font-variant-small-caps-synthesis-coverage.html

        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::FontType::FontType):
        (WebCore::preparePlatformFont):
        (WebCore::variationCapabilitiesForFontDescriptor):
        (WebCore::isGXVariableFont): Deleted.

2017-06-28  Chris Dumez  <cdumez@apple.com>

        [ResourceLoadStatistics] Simplify PrevalentResourceTelemetry struct
        https://bugs.webkit.org/show_bug.cgi?id=173953

        Reviewed by Sam Weinig.

        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
        * loader/ResourceLoadStatisticsStore.h:
        (WebCore::PrevalentResourceTelemetry::PrevalentResourceTelemetry): Deleted.

2017-06-28  Ryosuke Niwa  <rniwa@webkit.org>

        Crash in WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange
        https://bugs.webkit.org/show_bug.cgi?id=173958

        Reviewed by Simon Fraser.

        The crashed is most likely caused by updateLayersAfterAncestorChange calling [CALayer setPosition]
        with a CGPoint which contains the x coordinate or the y coordinate of NaN.

        Simon and I inpected the code but we couldn't figure out how we get there. Detect this case and bail out.
        Also log the relevant values and debug assert when this condition is hit to help identifying the root cause.

        * page/scrolling/mac/ScrollingTreeFixedNode.mm:
        (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):

2017-06-28  Chris Dumez  <cdumez@apple.com>

        ResourceLoadObserver clean up
        https://bugs.webkit.org/show_bug.cgi?id=173955

        Reviewed by Sam Weinig and Brent Fulgham.

        ResourceLoadObserver clean up: Modernize code a bit and get rid of unused variables.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::clearInMemoryStore):
        (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
        (WebCore::ResourceLoadObserver::shouldLog):
        (WebCore::ResourceLoadObserver::logFrameNavigation):
        (WebCore::ResourceLoadObserver::logSubresourceLoading):
        (WebCore::ResourceLoadObserver::logWebSocketLoading):
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
        (WebCore::ResourceLoadObserver::logUserInteraction):
        (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
        (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
        (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
        (WebCore::ResourceLoadObserver::fireDataModificationHandler):
        (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
        (WebCore::ResourceLoadObserver::primaryDomain):
        (WebCore::ResourceLoadObserver::statisticsForOrigin):

2017-06-28  Zalan Bujtas  <zalan@apple.com>

        Move RenderEmbeddedObject::isReplacementObscured to HTMLPlugInElement
        https://bugs.webkit.org/show_bug.cgi?id=173802
        <rdar://problem/32884389>

        Reviewed by Simon Fraser.

        Hittesting could potentially destroy "this" renderer so calling it inside RenderEmbeddedObject
        could leave the caller with a stale pointer.
        This patch protects the plugin element from getting destroyed and checks if the renderer got
        deleted during the hittest to avoid nullptr dereference.

        Speculative fix.

        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::isReplacementObscured):
        * html/HTMLPlugInElement.h:
        * rendering/RenderEmbeddedObject.cpp:
        (WebCore::RenderEmbeddedObject::isReplacementObscured): Deleted.
        * rendering/RenderEmbeddedObject.h:
        * testing/Internals.cpp:
        (WebCore::Internals::isPluginUnavailabilityIndicatorObscured):

2017-06-28  Chris Dumez  <cdumez@apple.com>

        Avoid copying statistics in ResourceLoadStatisticsStore::readDataFromDecoder()
        https://bugs.webkit.org/show_bug.cgi?id=173951

        Reviewed by Ryosuke Niwa.

        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):

2017-06-28  Ryosuke Niwa  <rniwa@webkit.org>

        Safari's Speedometer score massively regresses when accessibility is enabled
        https://bugs.webkit.org/show_bug.cgi?id=173912

        Reviewed by Chris Fleizach.

        The bug was caused by HTMLTextFormControlElement::setInnerTextValue triggering a synchronous layout
        via constructing VisiblePosition when the accessibility tree is present.

        Added AXObjectCache::postTextReplacementNotificationForTextControl which avoids the construction of
        VisiblePosition and other means of triggering a synchronous layout. This patch also fixes a subtle bug
        that HTMLTextFormControlElement was creating TextMarkerData with axID set to that of the text control
        element instead of the root editable element inside its shadow tree even though the typing command uses
        axID of the root editable element. While I couldn't find any user-visible behavioral change from this
        code change, new code is more self-consistent.

        Also added LayoutDisallowedScope which asserts that no synchronous layout happens in setInnerTextValue
        so that we don't introduce a new performance regression like this in the future.

        No new tests. Existing tests in accessibility directory covers this.

        * CMakeLists.txt: Added LayoutDisallowedScope.cpp.
        * WebCore.xcodeproj/project.pbxproj: Ditto.

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::postTextReplacementNotificationForTextControl): Added.
        (WebCore::AXObjectCache::textMarkerDataForVisiblePosition): Modernized. Returns optional<TextMarkerData>
        instead of taking TextMarkerData as an out-argument, and returning with axID of 0.
        (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl): Added. This specialized version
        constructs TextMarkerData for the first position inside the editable region in a text control without
        triggering a synchronous layout.

        * accessibility/AXObjectCache.h:
        (WebCore::TextMarkerData): Initialize each member automatically.
        (WebCore::AXObjectCache::postTextReplacementNotificationForTextControl):

        * accessibility/ios/AXObjectCacheIOS.mm:
        (WebCore::AXObjectCache::postTextReplacementPlatformNotificationForTextControl): Added.

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (+[WebAccessibilityTextMarker textMarkerWithVisiblePosition:cache:]):

        * accessibility/mac/AXObjectCacheMac.mm:
        (WebCore::addTextMarkerFor): Extracted from textReplacementChangeDictionary. Added a new variant which
        takes a text form control instead.
        (WebCore::textReplacementChangeDictionary): Templatized this function to either take VisiblePosition
        and call textMarkerForVisiblePosition or take HTMLTextFormControlElement and call
        textMarkerForFirstPositionInTextControl.
        (WebCore::postUserInfoForChanges): Extracted from postTextReplacementPlatformNotification.
        (WebCore::AXObjectCache::postTextReplacementPlatformNotification): 
        (WebCore::AXObjectCache::postTextReplacementPlatformNotificationForTextControl): Added.

        * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
        * accessibility/mac/WebAccessibilityObjectWrapperMac.h:

        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (textMarkerForVisiblePosition):
        (-[WebAccessibilityObjectWrapper textMarkerForFirstPositionInTextControl:]): Added.

        * dom/Document.cpp:
        (WebCore::Document::updateLayout): Assert that LayoutDisallowedScope is not in the stack frame.

        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::setInnerTextValue): Call postTextReplacementNotificationForTextControl
        to avoid triggering a synchronous layout. Also create LayoutDisallowedScope to avoid a similar performance
        regression from being introduced in the future in this function. Finally, made innerText a RefPtr for extra
        safety since we're using it after updating the DOM tree.

        * rendering/LayoutDisallowedScope.cpp: Added.
        * rendering/LayoutDisallowedScope.h: Added.
        (WebCore::LayoutDisallowedScope::LayoutDisallowedScope):
        (WebCore::LayoutDisallowedScope::~LayoutDisallowedScope):
        (WebCore::LayoutDisallowedScope::isLayoutAllowed):

2017-06-27  Myles C. Maxfield  <mmaxfield@apple.com>

        [iOS] Cannot italicize or bold text rendered with text styles
        https://bugs.webkit.org/show_bug.cgi?id=173634

        Reviewed by Darin Adler.

        r218616 enabled the new cascade list codepath for "system-ui," but didn't do it for the named
        text styles (like "font: -apple-system-tall-body;"). This new codepath is better because it
        correctly specifies weights and italics (using kCTFontWeightTrait and kCTFontSlantTrait) instead
        of using symbolic traits, and because it correctly handles fonts in the Core Text fallback chain.
        This patch migrates the named text styles to this new codepath.

        Test: fast/text/ipad/bold-tall-body-text-style.html

        * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::hash):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::equal):
        (WebCore::SystemFontDatabase::systemFontCascadeList):
        (WebCore::convertArray):
        (WebCore::convertArray):
        (WebCore::makeNeverDestroyed):
        (WebCore::isUIFontTextStyle):
        (WebCore::systemFontParameters):
        (WebCore::FontCascadeDescription::effectiveFamilyCount):
        (WebCore::FontCascadeDescription::effectiveFamilyAt):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash): Deleted.
        (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal): Deleted.
        * platform/graphics/ios/FontCacheIOS.mm:
        (WebCore::platformFontWithFamilySpecialCase):

2017-06-28  Devin Rousso  <drousso@apple.com>

        Web Inspector: Instrument active pixel memory used by canvases
        https://bugs.webkit.org/show_bug.cgi?id=173087
        <rdar://problem/32719261>

        Reviewed by Joseph Pecoraro.

        Test: inspector/canvas/memory.html

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::setImageBuffer):
        * inspector/InspectorCanvasAgent.h:
        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
        (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
        * inspector/InspectorInstrumentation.h:
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didChangeCanvasMemory):
        (WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl):

2017-06-28  Alex Christensen  <achristensen@webkit.org>

        Prevent displaying URLs with small capital letters
        https://bugs.webkit.org/show_bug.cgi?id=173949
        <rdar://problem/32952058>

        Reviewed by Brent Fulgham.

        Covered by new API tests.

        * platform/mac/WebCoreNSURLExtras.mm:
        (WebCore::isLookalikeCharacter):

2017-06-28  Youenn Fablet  <youenn@apple.com>

        Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
        https://bugs.webkit.org/show_bug.cgi?id=169389

        Reviewed by Alex Christensen.

        Covered by manual testing (appr.tc and https://youennf.github.io/webrtc-tests/src/content/peerconnection/trickle-ice/).
        Previously, we were creating a libwebrtc peer connection and then setting its configuration.
        libwebrtc does not like the configuration to be changed and may refuse to set the configuration.
        Instead of doing that, we are now creating the libwebrtc peer connection with the provided configuration.

        * Modules/mediastream/MediaEndpointPeerConnection.cpp:
        (WebCore::MediaEndpointPeerConnection::setConfiguration):
        * Modules/mediastream/MediaEndpointPeerConnection.h:
        * Modules/mediastream/PeerConnectionBackend.h:
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::initializeWith):
        (WebCore::iceServersFromConfiguration):
        (WebCore::RTCPeerConnection::initializeConfiguration):
        (WebCore::RTCPeerConnection::setConfiguration):
        * Modules/mediastream/RTCPeerConnection.h:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
        (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
        (WebCore::LibWebRTCMediaEndpoint::stop):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::configurationFromMediaEndpointConfiguration):
        (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::createActualPeerConnection):
        (WebCore::LibWebRTCProvider::createPeerConnection):
        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:

2017-06-28  Brent Fulgham  <bfulgham@apple.com>

        Teach ResourceLoadStatistics to recognize changes in the file system
        https://bugs.webkit.org/show_bug.cgi?id=173800
        <rdar://problem/32937842>

        Reviewed by Chris Dumez.

        We want to support the case where multiple UI processes choose to share the same
        statistics file. To support this, update the ResourceLoadStatistics logic to be aware
        that the statistics data file might change underneath it, and to take appropriate
        action when it does.

        * WebCore.xcodeproj/project.pbxproj: Update for new sources.
        * WebCore/CMakeLists.txt: Update for new FileMonitor source file.
        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): Use the new deletion
        handler for the data file instead of writing out an empty file.
        (WebCore::ResourceLoadStatisticsStore::setDeletePersistentStoreCallback): Added.
        * loader/ResourceLoadStatisticsStore.h:
        * platform/FileMonitor.cpp: Added.
        (WebCore::FileMonitor::create):
        (WebCore::FileMonitor::FileMonitor): Register handlers and begin monitoring file.
        (WebCore::FileMonitor::~FileMonitor): Stop any active file monitoring.
        (WebCore::FileMonitor::startMonitoringPath): Stub implementation.
        (WebCore::FileMonitor::stopMonitoring): Ditto.
        * platform/FileMonitor.h: Added.
        * platform/FileSystem.h: Export files needed by WebKit2. Add support for O_EVTONLY
        Darwin file handles.
        * platform/Logging.h: Add 'ResourceLoadStatistics' category.
        * platform/cocoa/FileMonitorCocoa.mm: Added.
        (WebCore::FileMonitor::startMonitoringPath): Create a new VNODE type dispatch_source
        to receive notifications when the specified file changes.
        (WebCore::FileMonitor::stopMonitoring): Cancel the dispatch_source when we are done
        monitoring the file.
        * platform/posix/FileSystemPOSIX.cpp: Update 'openFile' to understand the O_EVTONLY
        mode of file handles (Darwin-only). 

2017-06-28  Brady Eidson  <beidson@apple.com>

        DocumentLoader should always notify the client if there are pending icon loads when the load is stopped.
        https://bugs.webkit.org/show_bug.cgi?id=173874

        Reviewed by Alex Christensen.

        Covered by API tests.

        Patch started by Carlos Garcia Campos, finished by me.
        
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::stopLoading): Make all of the callbacks for cancelled IconLoaders.
        (WebCore::DocumentLoader::didGetLoadDecisionForIcon): Make the callback even if there's no IconLoader.
        (WebCore::DocumentLoader::finishedLoadingIcon):
        (WebCore::DocumentLoader::notifyFinishedLoadingIcon):
        * loader/DocumentLoader.h:

2017-06-28  Antoine Quint  <graouts@apple.com>

        Volume controls should be hidden when AirPlay is active
        https://bugs.webkit.org/show_bug.cgi?id=173933
        <rdar://problem/33011931>

        Reviewed by Dean Jackson.

        Ensure we don't show any volume controls during AirPlay. We set the mute button's enabled state to "false"
        when AirPlay is active and key off this enabled stated to control the display of all volume-related controls
        throughout the UI.

        Tests: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-controls-hidden-when-mute-button-disabled.html
               media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-top-right-controls-bar-hidden-when-mute-button-disabled.html

        * Modules/modern-media-controls/controls/inline-media-controls.js:
        (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
        (InlineMediaControls):
        * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
        (MacOSFullscreenMediaControls.prototype.layout):
        * Modules/modern-media-controls/media/airplay-support.js:
        (AirplaySupport.prototype.syncControl):
        (AirplaySupport):

2017-06-28  Konstantin Tokarev  <annulen@yandex.ru>

        Remove excessive includes from WebCore/css sources
        https://bugs.webkit.org/show_bug.cgi?id=173919

        Reviewed by Simon Fraser.

        No new tests needed.

        * css/CSSCanvasValue.cpp:
        * css/CSSComputedStyleDeclaration.cpp:
        * css/CSSContentDistributionValue.cpp:
        * css/CSSCrossfadeValue.cpp:
        * css/CSSCursorImageValue.cpp:
        * css/CSSCustomPropertyValue.cpp:
        * css/CSSDefaultStyleSheets.cpp:
        * css/CSSFilterImageValue.cpp:
        * css/CSSFontFace.cpp:
        * css/CSSFontFaceSet.cpp:
        * css/CSSFontFaceSource.cpp:
        * css/CSSFontFaceSrcValue.cpp:
        * css/CSSFontFeatureValue.cpp:
        * css/CSSFontSelector.cpp:
        * css/CSSFontValue.cpp:
        * css/CSSImageGeneratorValue.cpp:
        * css/CSSImageSetValue.cpp:
        * css/CSSImageValue.cpp:
        * css/CSSImportRule.cpp:
        * css/CSSKeyframesRule.cpp:
        * css/CSSMediaRule.cpp:
        * css/CSSNamedImageValue.cpp:
        * css/CSSPrimitiveValue.cpp:
        * css/CSSProperty.cpp:
        * css/CSSPropertySourceData.cpp:
        * css/CSSReflectValue.cpp:
        * css/CSSRuleList.cpp:
        * css/CSSSegmentedFontFace.cpp:
        * css/CSSSelector.cpp:
        * css/CSSStyleRule.cpp:
        * css/CSSStyleSheet.cpp:
        * css/CSSSupportsRule.cpp:
        * css/CSSToStyleMap.cpp:
        * css/CSSValueList.cpp:
        * css/CSSValuePool.cpp:
        * css/CSSVariableData.cpp:
        * css/ElementRuleCollector.cpp:
        * css/InspectorCSSOMWrappers.cpp:
        * css/MediaList.cpp:
        * css/MediaQueryEvaluator.cpp:
        * css/MediaQueryExpression.cpp:
        * css/PropertySetCSSStyleDeclaration.cpp:
        * css/RGBColor.cpp:
        * css/SelectorChecker.cpp:
        * css/StyleProperties.cpp:
        * css/StyleResolver.cpp:
        * css/StyleRule.cpp:
        * css/StyleSheetContents.cpp:
        * css/TransformFunctions.cpp:
        * css/ViewportStyleResolver.cpp:
        * css/WebKitCSSRegionRule.cpp:
        * css/parser/CSSParser.cpp:
        * css/parser/CSSParserFastPaths.cpp:
        * css/parser/CSSParserIdioms.cpp:
        * css/parser/CSSParserSelector.cpp:
        * css/parser/CSSParserToken.cpp:
        * css/parser/CSSPropertyParser.cpp:
        * css/parser/CSSSelectorParser.cpp:
        * css/parser/MediaQueryParser.cpp:

2017-06-28  Alex Christensen  <achristensen@webkit.org>

        Fix CMake build.

        * PlatformMac.cmake:

2017-06-28  Antoine Quint  <graouts@apple.com>

        Remove unnecessary `const double` method arguments
        https://bugs.webkit.org/show_bug.cgi?id=173925

        Reviewed by Dean Jackson.

        Addressing post-landing feedback from webkit.org/b/173858.

        * Modules/mediacontrols/MediaControlsHost.cpp:
        (WebCore::MediaControlsHost::formattedStringForDuration):
        * Modules/mediacontrols/MediaControlsHost.h:
        * rendering/RenderTheme.h:
        (WebCore::RenderTheme::mediaControlsFormattedStringForDuration):
        * rendering/RenderThemeCocoa.h:

2017-06-28  Zalan Bujtas  <zalan@apple.com>

        Unreviewed, rolling out r218373.

        Output is not right

        Reverted changeset:

        "Use WTFLogAlways for debug logging so that it shows up in
        device system logs"
        https://bugs.webkit.org/show_bug.cgi?id=173450
        http://trac.webkit.org/changeset/218373

2017-06-28  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Some web pages disappear immediately after rendering
        https://bugs.webkit.org/show_bug.cgi?id=173768

        Reviewed by Xabier Rodriguez-Calvar.

        This is happening with websites having a "hidden" class in HTML tag when a media element is added. In the GTK+
        port the media controls CSS contains the following code:

        .hidden {
            display: none !important;
        }

        That causes the whole HTML document to become display: none. That's why we just render a white page, and also
        the reason why it only happens with the GTK+ port and only with some specific websites. We should limit the
        scope of the hidden class to the media control elements.

        * css/mediaControlsGtk.css:
        (audio::-webkit-media-controls-panel.hidden,):
        (audio::-webkit-media-controls-panel div.mute-box.hidden,):
        (audio::-webkit-media-controls-current-time-display.hidden,):
        (audio::-webkit-media-controls-timeline.hidden,):
        (audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button):
        (audio::-webkit-media-controls-toggle-closed-captions-button.hidden,):
        (video::-webkit-media-controls-closed-captions-container.hidden):
        (audio::-webkit-media-controls-fullscreen-button.hidden,):
        (.hidden): Deleted.

2017-06-28  Antoine Quint  <graouts@apple.com>

        Media controls volume glyph does not have the correct material
        https://bugs.webkit.org/show_bug.cgi?id=173918
        <rdar://problem/33012697>

        Reviewed by Eric Carlson.

        Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-mute-button-in-bottom-or-top-right-controls-bar.html

        All buttons were hosted in a ControlsBar save for the MuteButton, so we now host it in a controls bar as well
        to ensure compositing is similar to all other buttons.

        * Modules/modern-media-controls/controls/inline-media-controls.css:
        (.media-controls.inline > .controls-bar.top-right):
        (.media-controls.inline > button.mute): Deleted.
        * Modules/modern-media-controls/controls/inline-media-controls.js:
        (InlineMediaControls):
        (InlineMediaControls.prototype.layout):
        (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
        * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
        (MacOSInlineMediaControls.prototype.handleEvent):

2017-06-28  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r218799): [GTK][WPE] Critical warning at exit
        https://bugs.webkit.org/show_bug.cgi?id=173907

        Reviewed by Konstantin Tokarev.

        GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

        This is now always happening when closing the MeiniBrowser and it's causing a lot of unit tests to fail. In
        r218799, GRefPtrGtk.h include was removed from PasteboardHelper.h that contains a GRefPtr<GtkTargetList>. The
        targets are destroyed at exit, but now trying to use g_object_unref instead of gtk_target_list_unref(). I've
        found two more cases like this in r218799, that removes GUniquePtrSoup.h from ResourceHandleInternal.h and
        ResourceRequest.h that have GUniquePtr<SoupBuffer> and GUniquePtr<SoupURI>.

        Fixes several GTK+ and WPE unit tests.

        * platform/gtk/PasteboardHelper.h: Bring back GRefPtrGtk.h.
        * platform/network/ResourceHandleInternal.h: Bring back GUniquePtrSoup.h.
        * platform/network/soup/ResourceRequest.h: Ditto.

2017-06-27  Chris Dumez  <cdumez@apple.com>

        [ResourceLoadStatistics] Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute
        https://bugs.webkit.org/show_bug.cgi?id=173895
        <rdar://problem/32984366>

        Reviewed by Brent Fulgham.

        Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute to save battery.
        Also port code to modern time types.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::reduceTimeResolution):
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
        (WebCore::ResourceLoadObserver::setTimeToLiveUserInteraction):
        (WebCore::ResourceLoadObserver::setTimeToLiveCookiePartitionFree):
        (WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval):
        (WebCore::ResourceLoadObserver::setReducedTimestampResolution):
        (WebCore::ResourceLoadObserver::setGrandfatheringTime):
        * loader/ResourceLoadObserver.h:
        * loader/ResourceLoadStatistics.h:
        (WebCore::ResourceLoadStatistics::mostRecentUserInteractionTime):
        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::ResourceLoadStatisticsStore::createEncoderFromData):
        (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
        (WebCore::shouldPartitionCookies):
        (WebCore::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
        (WebCore::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
        (WebCore::ResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval):
        (WebCore::ResourceLoadStatisticsStore::setGrandfatheringTime):
        (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
        (WebCore::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
        (WebCore::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
        (WebCore::ResourceLoadStatisticsStore::shouldRemoveDataRecords):
        (WebCore::ResourceLoadStatisticsStore::dataRecordsBeingRemoved):
        * loader/ResourceLoadStatisticsStore.h:

2017-06-27  Chris Dumez  <cdumez@apple.com>

        Port HysteresisActivity to Seconds type
        https://bugs.webkit.org/show_bug.cgi?id=173902

        Reviewed by Simon Fraser.

        * platform/HysteresisActivity.h:
        (WebCore::HysteresisActivity::HysteresisActivity):
        (WebCore::HysteresisActivity::stop):
        * platform/ios/WebSQLiteDatabaseTrackerClient.mm:

2017-06-27  Jeremy Jones  <jeremyj@apple.com>

        MediaPlayerPrivate m_private may not yet be created when setPrivateBrowsingMode is called.
        https://bugs.webkit.org/show_bug.cgi?id=173893
        rdar://problem/32986872
        
        Reviewed by Ryosuke Niwa.

        No new tests because no reproducable case.

        setPrivateBrowsingMode can be called on MediaPlayer before the MediaPlayerPrivate is created.
        The value should only be pushed down the m_private if it has been created.

        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::setPrivateBrowsingMode):

2017-06-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS DnD] Support dragging out of contenteditable areas without a prior selection
        https://bugs.webkit.org/show_bug.cgi?id=173854
        <rdar://problem/32236827>

        Reviewed by Ryosuke Niwa and Tim Horton.

        Allows elements to be dragged from contenteditable areas for both WebKit1 and WebKit2 iOS. There are two main
        changes in WebCore: move the touch point adjustment code into EventHandler::tryToBeginDataInteractionAtPoint, so
        that the clientPosition specified will be adjusted to an appropriate clickable node if needed. This is necessary
        because UIWebDocumentView and WKContentView no longer send adjusted points to WebCore when requesting drag
        start. See <https://bugs.webkit.org/show_bug.cgi?id=173855> for a followup regarding the globalPosition and
        clientPositions passed in to the MouseEvents when performing a drag or synthetic click.

        Secondly, image elements in Mail's contenteditable area are not draggable unless the heuristic in
        DragController::draggableElement is tweaked to not reject image dragging across the board if the
        loadsImagesAutomatically setting is turned off. Instead, even if images are not automatically loaded, allow the
        image drag to commence if the image renderer already has a cached image.

        Test: DataInteractionTests.DragImageFromContentEditable

        * page/DragController.cpp:
        (WebCore::imageElementIsDraggable):
        (WebCore::DragController::draggableElement):
        * page/ios/EventHandlerIOS.mm:
        (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):

2017-06-27  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] Accessibility labels should be formatted using NSDateComponentsFormatter
        https://bugs.webkit.org/show_bug.cgi?id=173858
        <rdar://problem/32643171>

        Reviewed by Dean Jackson.

        We shouldn't be manually trying to create a formatted string for media controls and instead rely
        on NSDateComponentsFormatter to perform this task for us. So we remove the ad-hoc code in the JS
        media controls code and instead add a new MediaControlsHost method to format durations which calls
        into RenderTheme to provide a formatted duration string relevant to the current platform and locale.

        * English.lproj/modern-media-controls-localized-strings.js:
        * Modules/mediacontrols/MediaControlsHost.cpp:
        (WebCore::MediaControlsHost::formattedStringForDuration):
        * Modules/mediacontrols/MediaControlsHost.h:
        * Modules/mediacontrols/MediaControlsHost.idl:
        * Modules/modern-media-controls/controls/slider.js:
        (Slider.prototype.set inputAccessibleLabel):
        * Modules/modern-media-controls/controls/time-label.js:
        (TimeLabel.prototype.commitProperty):
        * Modules/modern-media-controls/main.js:
        (createControls):
        (formattedStringForDuration):
        (formatTimeToString): Deleted.
        * rendering/RenderTheme.h:
        (WebCore::RenderTheme::mediaControlsFormattedStringForDuration):
        * rendering/RenderThemeCocoa.h:
        * rendering/RenderThemeCocoa.mm:
        (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):

2017-06-27  Eric Carlson  <eric.carlson@apple.com>

        r218647 causes getUserMedia to fail on some machines
        https://bugs.webkit.org/show_bug.cgi?id=173894

        Reviewed by Youenn Fablet.

        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::isFrameRateSupported): Change frame rate epsilon from 0.00001
        to 0.001.

2017-06-27  Antoine Quint  <graouts@apple.com>

        Placard icons act like buttons (can get keyboard focus and shows up in VoiceOver)
        https://bugs.webkit.org/show_bug.cgi?id=173891
        <rdar://problem/33011855>

        Reviewed by Dean Jackson.

        Ensure that we disable buttons inside placards as they're only decorative and should
        not be interactive.

        * Modules/modern-media-controls/controls/placard.js:
        (Placard.):

2017-06-27  Jeremy Jones  <jeremyj@apple.com>

        Disable m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause
        https://bugs.webkit.org/show_bug.cgi?id=173843
        rdar://problem/32982431

        Reviewed by Eric Carlson.

        Test: media/media-fullscreen-pause-inline.html

        Some pages may not have a fullscreen button, so disabled m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause.

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

2017-06-27  Chris Dumez  <cdumez@apple.com>

        [iOS] Avoid taking / releasing process assertions too quickly due to database activity
        https://bugs.webkit.org/show_bug.cgi?id=173879
        <rdar://problem/32412701>

        Reviewed by Antti Koivisto.

        Add HysteresisActivity to WebSQLiteDatabaseTrackerClient to avoid taking / releasing
        process assertion too quickly due to database activity.

        * platform/ios/WebSQLiteDatabaseTrackerClient.h:
        * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
        (WebCore::WebSQLiteDatabaseTrackerClient::WebSQLiteDatabaseTrackerClient):
        (WebCore::WebSQLiteDatabaseTrackerClient::willBeginFirstTransaction):
        (WebCore::WebSQLiteDatabaseTrackerClient::didFinishLastTransaction):
        (WebCore::WebSQLiteDatabaseTrackerClient::hysteresisUpdated):

2017-06-27  Youenn Fablet  <youenn@apple.com>

        Using public logging for WebRTC release logging
        https://bugs.webkit.org/show_bug.cgi?id=173881

        Reviewed by Eric Carlson.

        No change of behavior.

        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::createOfferSucceeded):
        (WebCore::PeerConnectionBackend::createOfferFailed):
        (WebCore::PeerConnectionBackend::createAnswerSucceeded):
        (WebCore::PeerConnectionBackend::createAnswerFailed):
        (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
        (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
        (WebCore::PeerConnectionBackend::addIceCandidateFailed):
        (WebCore::PeerConnectionBackend::newICECandidate):
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::queuedSetLocalDescription):
        (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
        (WebCore::RTCPeerConnection::queuedAddIceCandidate):
        (WebCore::RTCPeerConnection::updateIceGatheringState):
        (WebCore::RTCPeerConnection::updateIceConnectionState):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):

2017-06-27  Don Olmstead  <don.olmstead@sony.com>

        [PAL] Add symbol export macros for PAL
        https://bugs.webkit.org/show_bug.cgi?id=171519

        Reviewed by Konstantin Tokarev.

        No new tests. No change in behavior.

        * CMakeLists.txt:
        * config.h:
        * platform/PlatformExportMacros.h:

2017-06-27  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Add telemetry
        https://bugs.webkit.org/show_bug.cgi?id=173499
        <rdar://problem/32826094>

        Reviewed by Brent Fulgham.

        Test: http/tests/loading/resourceLoadStatistics/telemetry-generation.html

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::fireTelemetryHandler):
            Test infrastructure.
        * loader/ResourceLoadObserver.h:
        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::ResourceLoadStatisticsStore::setFireTelemetryCallback):
        (WebCore::ResourceLoadStatisticsStore::fireTelemetryHandler):
            Test infrastructure.
        (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
            Convenience function for telemetry.
        * loader/ResourceLoadStatisticsStore.h:
            Added struct WebCore::PrevalentResourceTelemetry.
        * page/DiagnosticLoggingKeys.cpp:
        (WebCore::DiagnosticLoggingKeys::resourceLoadStatisticsTelemetryKey):
            Added.
        * page/DiagnosticLoggingKeys.h:

2017-06-27  Ting-Wei Lan  <lantw44@gmail.com>

        Add missing includes to fix compilation error on FreeBSD
        https://bugs.webkit.org/show_bug.cgi?id=172919

        Reviewed by Mark Lam.

        No new tests needed.

        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        * platform/audio/ReverbAccumulationBuffer.cpp:

2017-06-27  Zalan Bujtas  <zalan@apple.com>

        Add RenderEmbeddedObject::getReplacementTextGeometry helper.
        https://bugs.webkit.org/show_bug.cgi?id=173847

        Reviewed by Simon Fraser.

        ...and remove getReplacementTextGeometry's redundant return value. 

        No change in functionality.

        * rendering/RenderEmbeddedObject.cpp:
        (WebCore::RenderEmbeddedObject::paintReplaced):
        (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
        (WebCore::RenderEmbeddedObject::unavailablePluginIndicatorBounds):
        (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
        * rendering/RenderEmbeddedObject.h:

2017-06-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        Refactor drag start codepaths to plumb a DragItem to client layers
        https://bugs.webkit.org/show_bug.cgi?id=173832
        Work towards <rdar://problem/32236827>

        Reviewed by Ryosuke Niwa and Tim Horton.

        Refactor drag start logic in WebCore to set up a DragItem and propagate it to WebDragClient. No change in behavior.

        * loader/EmptyClients.cpp:
        * page/DragClient.h:
        * page/DragController.cpp:
        (WebCore::DragController::startDrag):
        (WebCore::DragController::doImageDrag):
        (WebCore::DragController::doSystemDrag):

        Refactor to pass along a DragItem. Also, remove unused drag image anchor computation.

        * page/DragController.h:
        * platform/DragImage.h:
        * platform/DragItem.h:

        Add additional information needed to begin a drag on iOS.

        (WebCore::DragItem::encode):
        (WebCore::DragItem::decode):

        Add IPC serialization/deserialization support for DragItem.

        * platform/PasteboardWriterData.cpp:
        (WebCore::PasteboardWriterData::isEmpty):
        * platform/PasteboardWriterData.h:

2017-06-27  Frederic Wang  <fwang@igalia.com>

        Some tests to verify forbidden frame navigation time out
        https://bugs.webkit.org/show_bug.cgi?id=173657

        Reviewed by Chris Dumez.

        Currently some tests try and perform a forbidden frame navigation and verify the
        corresponding console error. However, WebKit does not raise any exception for such error so
        the tests have to wait until the timeout limit to complete, which makes execution slow.
        This patch modifies the setters of window.location for which such error may happen in order
        to raise an exception so the tests behave as expected.

        No new tests, already covered by existing tests.

        * page/Location.cpp: Adjust Location::setLocation to return a security exception and pass it
        to the callers.
        (WebCore::Location::setHref): Adjust function to possibly return an exception.
        (WebCore::Location::setProtocol): Ditto.
        (WebCore::Location::setHost): Ditto.
        (WebCore::Location::setHostname): Ditto.
        (WebCore::Location::setPort): Ditto.
        (WebCore::Location::setPathname): Ditto.
        (WebCore::Location::setSearch): Ditto.
        (WebCore::Location::setHash): Ditto.
        (WebCore::Location::assign): Ditto.
        (WebCore::Location::setLocation): FrameLoader::findFrameForNavigation is really only used
        to verify whether navigating m_frame is permitted so it is more simple and clearer to do it
        directly. When navigation is not permitted, this function now raises a security exception.
        * page/Location.h: Modify some setters to return an ExceptionOr<void>.
        * page/Location.idl: Allow some setters to raise an exception.

2017-06-26  Fujii Hironori  <Hironori.Fujii@sony.com>

        [GTK] Layout Test webrtc/video.html issues "stack smashing detected"
        https://bugs.webkit.org/show_bug.cgi?id=173862

        Reviewed by Carlos Garcia Campos.

        Tests: webrtc/video.html

        Passing a bool variable to g_object_get causes out-of-bound write.
        gboolean should be used, which is 4 bytes while bool is one byte.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::muted): Use gboolean instead of bool.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
        (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): Ditto.

2017-06-26  Chris Dumez  <cdumez@apple.com>

        WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() is inefficient
        https://bugs.webkit.org/show_bug.cgi?id=173850

        Reviewed by Ryosuke Niwa.

        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
        * loader/ResourceLoadStatisticsStore.h:

2017-06-26  Antti Koivisto  <antti@apple.com>

        REGRESSION (AsyncImageDecoding): A tab with the WWDC keynote paused is killed for using excessive power (Image thrashing)
        https://bugs.webkit.org/show_bug.cgi?id=173804
        <rdar://problem/32623745>

        Reviewed by Simon Fraser.

        When under memory pressure MemoryCache::singleton().pruneLiveResources(true) is called inFrameView::didPaintContents()
        after top level paint. We end up decoding and pruning bitmaps repeatedly for each tile, which is not great.

        Situation gets worse with async decoding. Painting now doesn’t actually decode the image, it just starts the decoding.
        When it completes we trigger another paint to get the bits to the tiles. The paint for the first tile then calls
        pruneLiveResources and loses the bitmap and the second tile triggers another round of async decoding. We have code
        that prevents pruning of visible images but non-visible images in tiling area can hit this bug easily.

        Test: fast/images/low-memory-decode.html

        * page/FrameView.cpp:
        (WebCore::FrameView::willPaintContents):
        (WebCore::FrameView::didPaintContents):

            Eliminate synchronous pruning during painting. This is an obsolete mechanism from early iOS times.

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::imageFrameAvailableAtIndex):
        (WebCore::BitmapImage::decodeCountForTesting):

            Testing support.

        * platform/graphics/BitmapImage.h:
        * testing/Internals.cpp:
        (WebCore::Internals::imageDecodeCount):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-06-26  Chris Dumez  <cdumez@apple.com>

        ImageFrameCache::startAsyncDecodingQueue() unsafely passes Strings across threads
        https://bugs.webkit.org/show_bug.cgi?id=173842

        Reviewed by Simon Fraser.

        The URL string was passed across thread without isolated copy.

        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::startAsyncDecodingQueue):

2017-06-26  Jonathan Bedard  <jbedard@apple.com>

        Unreviewed, rolling out r218783.

        Causing accessibility/mac/setting-attributes-is-
        asynchronous.html to crash consistently on mac-wk2 Debug

        Reverted changeset:

        "AX: Cannot call setValue() on contenteditable or ARIA text
        controls"
        https://bugs.webkit.org/show_bug.cgi?id=173520
        http://trac.webkit.org/changeset/218783

2017-06-26  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Drop Thread::create(obsolete things) API since we can use lambda
        https://bugs.webkit.org/show_bug.cgi?id=173825

        Reviewed by Saam Barati.

        No behavior change.

        * Modules/indexeddb/server/IDBServer.cpp:
        (WebCore::IDBServer::IDBServer::IDBServer):
        (WebCore::IDBServer::IDBServer::databaseThreadEntry): Deleted.
        * Modules/indexeddb/server/IDBServer.h:
        * Modules/webaudio/AsyncAudioDecoder.cpp:
        (WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
        (WebCore::AsyncAudioDecoder::threadEntry): Deleted.
        * Modules/webaudio/AsyncAudioDecoder.h:
        * Modules/webaudio/OfflineAudioDestinationNode.cpp:
        (WebCore::OfflineAudioDestinationNode::startRendering):
        (WebCore::OfflineAudioDestinationNode::offlineRenderEntry): Deleted.
        * Modules/webaudio/OfflineAudioDestinationNode.h:
        * Modules/webdatabase/DatabaseThread.cpp:
        (WebCore::DatabaseThread::start):
        (WebCore::DatabaseThread::databaseThreadStart): Deleted.
        * Modules/webdatabase/DatabaseThread.h:
        * bindings/js/GCController.cpp:
        (WebCore::collect):
        (WebCore::GCController::gcTimerFired):
        (WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
        * loader/icon/IconDatabase.cpp:
        (WebCore::IconDatabase::open):
        (WebCore::IconDatabase::iconDatabaseSyncThreadStart): Deleted.
        * loader/icon/IconDatabase.h:
        * page/ResourceUsageThread.cpp:
        (WebCore::ResourceUsageThread::createThreadIfNeeded):
        (WebCore::ResourceUsageThread::threadCallback): Deleted.
        * page/ResourceUsageThread.h:
        * page/scrolling/ScrollingThread.cpp:
        (WebCore::ScrollingThread::createThreadIfNeeded):
        (WebCore::ScrollingThread::threadCallback): Deleted.
        (WebCore::ScrollingThread::threadBody): Deleted.
        * page/scrolling/ScrollingThread.h:
        * platform/audio/HRTFDatabaseLoader.cpp:
        (WebCore::HRTFDatabaseLoader::loadAsynchronously):
        (WebCore::databaseLoaderEntry): Deleted.
        * platform/audio/HRTFDatabaseLoader.h:
        * platform/audio/ReverbConvolver.cpp:
        (WebCore::ReverbConvolver::ReverbConvolver):
        (WebCore::backgroundThreadEntry): Deleted.
        * platform/audio/ReverbConvolver.h:
        (WebCore::ReverbConvolver::useBackgroundThreads):
        * platform/network/cf/LoaderRunLoopCF.cpp:
        (WebCore::loaderRunLoop):
        (WebCore::runLoaderThread): Deleted.
        * platform/network/curl/CurlManager.cpp:
        (WebCore::CurlManager::startThreadIfNeeded):
        (WebCore::CurlManager::workerThread):
        * platform/network/curl/CurlManager.h:
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::start):
        (WebCore::WorkerThread::workerThreadStart): Deleted.
        * workers/WorkerThread.h:

2017-06-26  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] Add support for aria-details and aria-errormessage
        https://bugs.webkit.org/show_bug.cgi?id=172588

        Reviewed by Chris Fleizach.

        Add methods to retrieve elements referenced by or referencing the new
        aria-details and aria-errormessage attributes. Include aria-details and
        aria-errormessage in AccessibilityObject::supportsARIAAttributes() to ensure
        elements with these attributes will be included in the accessibility tree.

        New test cases added to accessibility/gtk/relation-types.html.

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::supportsARIAAttributes):
        (WebCore::AccessibilityObject::ariaDetailsElements):
        (WebCore::AccessibilityObject::ariaDetailsReferencingElements):
        (WebCore::AccessibilityObject::ariaErrorMessageElements):
        (WebCore::AccessibilityObject::ariaErrorMessageReferencingElements):
        * accessibility/AccessibilityObject.h:
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (setAtkRelationSetFromCoreObject):
        * html/HTMLAttributeNames.in:

2017-06-26  Konstantin Tokarev  <annulen@yandex.ru>

        Remove excessive headers from WebCore/{Modules,animation,crypto,domjit}
        https://bugs.webkit.org/show_bug.cgi?id=173824

        Reviewed by Darin Adler.

        No new tests needed.

        * Modules/credentials/CredentialCreationOptions.h:
        * Modules/credentials/PasswordCredential.h:
        * Modules/fetch/FetchBody.h:
        * Modules/fetch/FetchBodyOwner.h:
        * Modules/gamepad/GamepadManager.h:
        * Modules/geolocation/Coordinates.h:
        * Modules/geolocation/Geoposition.h:
        * Modules/indexeddb/IDBActiveDOMObject.h:
        * Modules/indexeddb/IDBCursor.h:
        * Modules/indexeddb/IDBDatabase.h:
        * Modules/indexeddb/IDBDatabaseIdentifier.h:
        * Modules/indexeddb/IDBObjectStore.cpp:
        * Modules/indexeddb/IDBObjectStore.h:
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        * Modules/indexeddb/server/UniqueIDBDatabase.h:
        * Modules/indexeddb/shared/InProcessIDBServer.h:
        * Modules/indexeddb/shared/IndexKey.h:
        * Modules/mediacontrols/MediaControlsHost.h:
        * Modules/mediasession/WebMediaSessionManager.h:
        * Modules/mediasource/SourceBufferList.h:
        * Modules/mediasource/VideoPlaybackQuality.h:
        * Modules/notifications/Notification.h:
        * Modules/quota/WorkerNavigatorStorageQuota.h:
        * Modules/webaudio/AudioBasicProcessorNode.h:
        * Modules/webaudio/AudioContext.h:
        * Modules/webaudio/AudioDestinationNode.h:
        * Modules/webaudio/AudioParamTimeline.h:
        * Modules/webaudio/ConvolverNode.cpp:
        * Modules/webaudio/MediaStreamAudioSource.h:
        * Modules/webaudio/MediaStreamAudioSourceNode.h:
        * Modules/webaudio/PannerNode.h:
        * Modules/webaudio/PeriodicWave.h:
        * Modules/webaudio/ScriptProcessorNode.h:
        * Modules/webdatabase/DatabaseManager.h:
        * Modules/webdatabase/DatabaseTask.h:
        * Modules/webdatabase/SQLTransaction.h:
        * Modules/webdatabase/SQLTransactionBackend.h:
        * Modules/webdatabase/SQLTransactionStateMachine.h:
        * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
        * Modules/websockets/WebSocketDeflater.h:
        * Modules/websockets/WorkerThreadableWebSocketChannel.h:
        * animation/AnimationEffect.h:
        * crypto/CryptoKeyPair.h:
        * crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h:
        * dom/ScriptExecutionContext.h:
        * domjit/DOMJITHelpers.h:
        * domjit/DOMJITIDLConvert.h:
        * domjit/DOMJITIDLType.h:

2017-06-26  Konstantin Tokarev  <annulen@yandex.ru>

        [GTK] Unreviewed, added missing includes to fix debug build

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:

2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>

        Remove excessive headers from WebCore/platform
        https://bugs.webkit.org/show_bug.cgi?id=173822

        Reviewed by Tim Horton.

        No new tests needed.

        * html/ColorInputType.h:
        * html/MediaElementSession.h:
        * page/SecurityOriginData.cpp:
        * platform/CalculationValue.cpp:
        * platform/CalculationValue.h:
        * platform/ColorChooserClient.h:
        * platform/ContentType.h:
        * platform/LogMacros.h:
        * platform/PODRedBlackTree.h:
        * platform/PasteboardStrategy.h:
        * platform/PlatformPasteboard.h:
        * platform/PopupMenuStyle.h:
        * platform/ScrollAnimator.h:
        * platform/Theme.h:
        * platform/ThreadGlobalData.h:
        * platform/animation/AnimationList.h:
        * platform/audio/AudioArray.h:
        * platform/audio/AudioChannel.h:
        * platform/audio/DynamicsCompressor.h:
        * platform/audio/DynamicsCompressorKernel.h:
        * platform/audio/FFTFrame.h:
        * platform/audio/HRTFDatabaseLoader.cpp:
        * platform/audio/HRTFDatabaseLoader.h:
        * platform/audio/HRTFElevation.h:
        * platform/audio/MultiChannelResampler.h:
        * platform/audio/PlatformMediaSession.h:
        * platform/audio/ReverbConvolver.h:
        * platform/audio/ReverbConvolverStage.cpp:
        * platform/graphics/ANGLEWebKitBridge.h:
        * platform/graphics/BitmapImage.h:
        * platform/graphics/CrossfadeGeneratedImage.h:
        * platform/graphics/FloatPolygon.h:
        * platform/graphics/FloatSizeHash.h:
        * platform/graphics/Font.h:
        * platform/graphics/FontMetrics.h:
        * platform/graphics/FontPlatformData.h:
        * platform/graphics/FontRanges.h:
        * platform/graphics/FontTaggedSettings.h:
        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/GraphicsContext3DPrivate.h:
        * platform/graphics/GraphicsLayerClient.h:
        * platform/graphics/Image.cpp:
        * platform/graphics/ImageFrame.h:
        * platform/graphics/ImageFrameCache.h:
        * platform/graphics/ImageSource.h:
        * platform/graphics/IntRectHash.h:
        * platform/graphics/IntSizeHash.h:
        * platform/graphics/MediaPlaybackTargetClient.h:
        * platform/graphics/Pattern.h:
        * platform/graphics/PlatformTimeRanges.h:
        * platform/graphics/TextRun.h:
        * platform/graphics/TiledBacking.h:
        * platform/graphics/cairo/FontCustomPlatformData.h:
        * platform/graphics/filters/FEConvolveMatrix.h:
        * platform/graphics/filters/FELighting.h:
        * platform/graphics/filters/SourceAlpha.h:
        * platform/graphics/gstreamer/GStreamerUtilities.h:
        * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
        * platform/graphics/harfbuzz/HarfBuzzShaper.h:
        * platform/graphics/opengl/Extensions3DOpenGL.h:
        * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
        * platform/graphics/texmap/TextureMapperBackingStore.h:
        * platform/graphics/texmap/TextureMapperGL.cpp:
        * platform/graphics/texmap/TextureMapperGL.h:
        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
        * platform/graphics/texmap/TextureMapperTile.h:
        * platform/graphics/texmap/coordinated/Tile.h:
        * platform/graphics/texmap/coordinated/TiledBackingStore.h:
        * platform/graphics/transforms/TransformState.h:
        * platform/gtk/PasteboardHelper.h:
        * platform/gtk/ScrollbarThemeGtk.h:
        * platform/image-decoders/ImageDecoder.h:
        * platform/network/BlobData.h:
        * platform/network/BlobDataFileReference.h:
        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleInternal.h:
        * platform/network/SocketStreamHandleClient.h:
        * platform/network/soup/ResourceRequest.h:
        * platform/network/soup/SocketStreamHandleImpl.h:
        * platform/network/soup/SoupNetworkSession.h:
        * platform/sql/SQLiteFileSystem.h:
        * platform/text/LocaleICU.h:

2017-06-25  Youenn Fablet  <youenn@apple.com>

        Remove use of mock webrtc backend factory at injected bundle reset time
        https://bugs.webkit.org/show_bug.cgi?id=173817

        Reviewed by Darin Adler.

        * testing/Internals.cpp:
        (WebCore::Internals::resetToConsistentState): Resetting the peer connection backend.
        * testing/MockLibWebRTCPeerConnection.cpp: Doing some clean-up
        (WebCore::useRealRTCPeerConnectionFactory):
        (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):
        (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
        (WebCore::MockLibWebRTCPeerConnectionFactory::CreateVideoTrack):
        (WebCore::MockLibWebRTCPeerConnectionFactory::CreateAudioTrack):
        * testing/MockLibWebRTCPeerConnection.h:

2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>

        Remove excessive headers from JavaScriptCore
        https://bugs.webkit.org/show_bug.cgi?id=173812

        Reviewed by Darin Adler.

        No new tests needed.

        * Modules/indexeddb/IDBObjectStore.cpp:
        * bindings/js/JSDOMPromiseDeferred.h:
        * bindings/js/JSLazyEventListener.cpp:
        * bindings/js/JSMainThreadExecState.h:
        * bindings/js/ReadableStreamDefaultController.cpp:
        * bindings/js/ScriptGlobalObject.cpp:
        * bindings/js/SerializedScriptValue.cpp:
        * bridge/NP_jsobject.cpp:
        * dom/ScriptExecutionContext.cpp:
        * html/HTMLPlugInImageElement.cpp:

2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>

        Remove excessive headers from WebCore/{rendering,style,svg}
        https://bugs.webkit.org/show_bug.cgi?id=173773

        Reviewed by Darin Adler.

        No new tests needed.

        * css/StyleBuilderConverter.h:
        * editing/TextIterator.cpp:
        * rendering/CounterNode.h:
        * rendering/FlexibleBoxAlgorithm.h:
        * rendering/HitTestLocation.h:
        * rendering/HitTestResult.h:
        * rendering/HitTestingTransformState.h:
        * rendering/OrderIterator.h:
        * rendering/RenderButton.h:
        * rendering/RenderCombineText.h:
        * rendering/RenderFlowThread.h:
        * rendering/RenderFullScreen.h:
        * rendering/RenderGeometryMap.h:
        * rendering/RenderListItem.h:
        * rendering/RenderMediaControlElements.cpp:
        * rendering/RenderMediaControlElements.h:
        * rendering/RenderMediaControls.h:
        * rendering/RenderMeter.h:
        * rendering/RenderMultiColumnSet.cpp:
        * rendering/RenderObject.h:
        * rendering/RenderRegion.h:
        * rendering/RenderRegionSet.cpp:
        * rendering/RenderRegionSet.h:
        * rendering/RenderTheme.h:
        * rendering/RenderVTTCue.cpp:
        * rendering/RenderVTTCue.h:
        * rendering/SimpleLineLayoutFunctions.h:
        * rendering/SimpleLineLayoutResolver.h:
        * rendering/line/BreakingContext.h:
        * rendering/line/LineBreaker.h:
        * rendering/mathml/MathMLStyle.h:
        * rendering/mathml/RenderMathMLOperator.h:
        * rendering/mathml/RenderMathMLRoot.h:
        * rendering/shapes/RectangleShape.h:
        * rendering/style/BasicShapes.h:
        * rendering/style/BorderData.h:
        * rendering/style/CounterDirectives.h:
        * rendering/style/GridArea.h:
        * rendering/style/KeyframeList.h:
        * rendering/style/RenderStyle.h:
        * rendering/style/SVGRenderStyle.h:
        * rendering/style/ShapeValue.h:
        * rendering/style/StyleCachedImage.h:
        * rendering/style/StyleMultiColData.h:
        * rendering/style/StyleRareNonInheritedData.h:
        * rendering/style/WillChangeData.h:
        * rendering/svg/RenderSVGBlock.h:
        * rendering/svg/RenderSVGRect.h:
        * rendering/svg/RenderSVGResource.h:
        * rendering/svg/RenderSVGResourceContainer.h:
        * rendering/svg/RenderSVGResourceMarker.h:
        * rendering/svg/RenderSVGResourceMasker.h:
        * rendering/svg/RenderSVGResourcePattern.h:
        * rendering/svg/SVGInlineFlowBox.cpp:
        * rendering/svg/SVGInlineTextBox.h:
        * rendering/svg/SVGRootInlineBox.h:
        * rendering/svg/SVGTextChunk.cpp:
        * rendering/svg/SVGTextChunk.h:
        * rendering/svg/SVGTextChunkBuilder.cpp:
        * rendering/svg/SVGTextLayoutEngine.cpp:
        * rendering/svg/SVGTextLayoutEngineSpacing.h:
        * style/RenderTreePosition.cpp:
        * style/RenderTreePosition.h:
        * style/RenderTreeUpdater.h:
        * style/StyleFontSizeFunctions.h:
        * style/StyleInvalidator.h:
        * style/StyleResolveForDocument.h:
        * style/StyleScope.h:
        * style/StyleTreeResolver.cpp:
        * style/StyleTreeResolver.h:
        * style/StyleUpdate.h:
        * svg/SVGAnimationElement.h:
        * svg/SVGFEBlendElement.cpp:
        * svg/SVGFEBlendElement.h:
        * svg/SVGFEComponentTransferElement.h:
        * svg/SVGFEFloodElement.cpp:
        * svg/SVGFEFloodElement.h:
        * svg/SVGFEImageElement.h:
        * svg/SVGFEMergeElement.cpp:
        * svg/SVGFEMergeElement.h:
        * svg/SVGFEOffsetElement.cpp:
        * svg/SVGFEOffsetElement.h:
        * svg/SVGFETileElement.cpp:
        * svg/SVGFETileElement.h:
        * svg/SVGParserUtilities.h:
        * svg/SVGPathByteStream.h:
        * svg/SVGPathElement.cpp:
        * svg/SVGPolyElement.cpp:
        * svg/SVGSVGElement.cpp:
        * svg/SVGTRefElement.cpp:
        * svg/SVGTextPathElement.cpp:
        * svg/SVGUseElement.cpp:
        * svg/animation/SMILTimeContainer.h:
        * svg/graphics/SVGImageCache.h:
        * svg/graphics/filters/SVGFilter.h:

2017-06-25  Antoine Quint  <graouts@apple.com>

        Remove rAf suspension logging
        https://bugs.webkit.org/show_bug.cgi?id=173821

        Reviewed by Tim Horton.

        Now that webkit.org/b/173628 is fixed, we can remove the logging code we added.

        * dom/Document.cpp:
        (WebCore::Document::requestAnimationFrame):
        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::suspend):
        (WebCore::ScriptedAnimationController::resume):
        * page/Page.cpp:
        (WebCore::Page::suspendScriptedAnimations):
        (WebCore::Page::resumeScriptedAnimations):
        (WebCore::Page::setIsVisibleInternal):
        * platform/RuntimeApplicationChecks.h:
        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
        (WebCore::MacApplication::isDumpRenderTree): Deleted.

2017-06-24  Sam Weinig  <sam@webkit.org>

        [WebIDL] Add complete support for stringifier
        https://bugs.webkit.org/show_bug.cgi?id=173724

        Reviewed by Darin Adler.

        * bindings/scripts/CodeGeneratorJS.pm:
        (AddStringifierOperationIfNeeded):
        Update AddStringifierOperationIfNeeded to support stringifier on operations and be more
        strict about the allowed types. Also copies over all extended attributes to the synthetic
        operation.

        * bindings/scripts/IDLParser.pm:
        (parseInterfaceMember):
        (parseOperationOrReadWriteAttributeOrMaplike):
        (parseReadOnlyMember):
        (parseStringifier):
        (parseStaticMember):
        (parseAttributeOrOperationForStringifierOrStatic):
        (parseReadWriteAttribute):
        (parseAttributeRest):
        (parseOperation):
        (parseSpecialOperation):
        (parseMapLikeProperties):
        (parseOperationRest):
        (parseAttributeOrOperationOrIterator): Deleted.
        (parseQualifier): Deleted.
        (parseAttributeOrOperationRest): Deleted.
        (parseAttribute): Deleted.
        (parseOperationOrIterator): Deleted.
        - Update parser to more closely resemble the WebIDL grammar, splitting out parseStringifier and
          parseStaticMember into their own subroutines. 
        - Move those and parseSerializer, parseStringifier, parseStaticMember, parseIterableRest and a split out
          parseReadOnlyMembers up into parseInterfaceMember to make it clearer that they are top level members
          and match the grammar.
        - Rename parseAttributeOrOperationOrIterator to parseOperationOrReadWriteAttributeOrMaplike to match the
          grammar language and make it clear what it does.
        - Add parseAttributeOrOperationForStringifierOrStatic which contains most of the logic for parsing stringifiers
          and static members, which have almost identical grammars.
        - Remove creator special which no longer exists in the spec.

        * css/DOMMatrixReadOnly.idl:
        * css/WebKitCSSMatrix.idl:
        * dom/Range.idl:
        * html/URLSearchParams.idl:
        Fix FIXMEs by switching to use stringifier.

        * bindings/scripts/test/JS/JSTestStringifier.cpp: Added.
        * bindings/scripts/test/JS/JSTestStringifier.h: Added.
        * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: Added.
        * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h: Added.
        * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: Added.
        * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h: Added.
        * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: Added.
        * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h: Added.
        * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: Added.
        * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h: Added.
        * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: Added.
        * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h: Added.
        * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: Added.
        * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h: Added.
        * bindings/scripts/test/TestStringifier.idl: Added.
        * bindings/scripts/test/TestStringifierAnonymousOperation.idl: Added.
        * bindings/scripts/test/TestStringifierNamedOperation.idl: Added.
        * bindings/scripts/test/TestStringifierOperationImplementedAs.idl: Added.
        * bindings/scripts/test/TestStringifierOperationNamedToString.idl: Added.
        * bindings/scripts/test/TestStringifierReadOnlyAttribute.idl: Added.
        * bindings/scripts/test/TestStringifierReadWriteAttribute.idl: Added.
        Add new tests.

2017-06-24  Chris Fleizach  <cfleizach@apple.com>

        AX: Cannot call setValue() on contenteditable or ARIA text controls
        https://bugs.webkit.org/show_bug.cgi?id=173520

        Reviewed by Ryosuke Niwa.

        Add support for changing the value of a contenteditable and any other aria text control in setValue().
 
        Test: accessibility/mac/set-value-editable-types.html

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::setValue):

2017-06-23  Simon Fraser  <simon.fraser@apple.com>

        Attempt to fix an internal build after r218755.

        * bindings/js/JSMainThreadExecStateInstrumentation.h:

2017-06-23  Chris Dumez  <cdumez@apple.com>

        Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon()
        https://bugs.webkit.org/show_bug.cgi?id=173792

        Reviewed by Ryosuke Niwa.

        Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon()
        as this could cause HashTable corruption on WebPageProxy side.

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

2017-06-23  Youenn Fablet  <youenn@apple.com>

        webrtc::WebRtcSession is not handling correctly its state when setLocalDescription fails and is called again
        https://bugs.webkit.org/show_bug.cgi?id=173783

        Reviewed by Alex Christensen.

        Test: webrtc/libwebrtc/setLocalDescriptionCrash.html

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription): Fail early if there is no pending remote description and description is for an answer.

2017-06-23  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream macOS] enumerateDevices should only return valid audio capture devices
        https://bugs.webkit.org/show_bug.cgi?id=173790
        <rdar://problem/32260334>

        Reviewed by Youenn Fablet.

        * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
        (WebCore::isValidCaptureDevice): A valid device has a name and is not an aggregate device
        created by VPIO.
        (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):

2017-06-23  Jer Noble  <jer.noble@apple.com>

        [WK2] Support -[WebAVPlayerController setMuted:]
        https://bugs.webkit.org/show_bug.cgi?id=173777

        Reviewed by Eric Carlson.

        Have -[WebAVPlayerController setMuted:] pass the request to its delegate (the model)
        rather than just storing the value.

        * platform/cocoa/WebPlaybackSessionModel.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        (WebCore::WebPlaybackSessionModelMediaElement::toggleMuted):
        (WebCore::WebPlaybackSessionModelMediaElement::setMuted):
        * platform/ios/WebAVPlayerController.h:
        * platform/ios/WebAVPlayerController.mm:
        (-[WebAVPlayerController isMuted]):
        (-[WebAVPlayerController setMuted:]):
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        (WebVideoFullscreenControllerContext::setMuted):

2017-06-23  Frederic Wang  <fwang@igalia.com>

        Make RenderLayer::handleTouchEvent use usesAcceleratedScrolling()
        https://bugs.webkit.org/show_bug.cgi?id=173763

        Reviewed by Simon Fraser.

        No new tests, behavior is unchanged.

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::handleTouchEvent): Call usesAcceleratedScrolling() instead of
        hasTouchScrollableOverflow() for clarity.

2017-06-23  Konstantin Tokarev  <annulen@yandex.ru>

        Remove excessive headers from WebCore/{bindings,css,dom}
        https://bugs.webkit.org/show_bug.cgi?id=173766

        Reviewed by Simon Fraser.

        No new tests needed.

        * ForwardingHeaders/runtime/ThrowScope.h: Added.
        * Modules/plugins/QuickTimePluginReplacement.mm:
        * bindings/js/CachedScriptSourceProvider.h:
        * bindings/js/JSCommandLineAPIHostCustom.cpp:
        * bindings/js/JSCustomXPathNSResolver.cpp:
        * bindings/js/JSDOMConstructorNotConstructable.h:
        * bindings/js/JSDOMConvertBase.h:
        * bindings/js/JSDOMConvertBufferSource.h:
        * bindings/js/JSDOMConvertInterface.h:
        * bindings/js/JSDOMConvertStrings.h:
        * bindings/js/JSDOMConvertUnion.h:
        * bindings/js/JSDOMConvertVariadic.h:
        * bindings/js/JSDOMConvertWebGL.h:
        * bindings/js/JSDOMExceptionHandling.h:
        * bindings/js/JSDOMIterator.h:
        * bindings/js/JSDOMMapLike.h:
        * bindings/js/JSDOMWindowBase.cpp:
        * bindings/js/JSDOMWindowCustom.cpp:
        * bindings/js/JSDOMWindowCustom.h:
        * bindings/js/JSDOMWindowProperties.h:
        * bindings/js/JSDOMWrapperCache.h:
        * bindings/js/JSLazyEventListener.cpp:
        * bindings/js/JSMainThreadExecStateInstrumentation.h:
        * bindings/js/JSMediaListCustom.h:
        * bindings/js/JSNodeCustom.h:
        * bindings/js/JSNodeListCustom.h:
        * bindings/js/JSVideoTrackListCustom.cpp:
        * bindings/js/ScheduledAction.h:
        * bindings/js/ScriptSourceCode.h:
        * bindings/js/SerializedScriptValue.h:
        * bindings/js/WebCoreJSClientData.h:
        * css/CSSFontFeatureValue.h:
        * css/CSSPrimitiveValue.h:
        * css/CSSStyleSheet.h:
        * css/CSSValue.h:
        * css/StyleBuilderCustom.h:
        * dom/ContainerNodeAlgorithms.h:
        * dom/DataTransfer.h:
        * dom/Node.h:
        * dom/NodeRareData.h:
        * dom/Position.h:
        * dom/RenderedDocumentMarker.h:

2017-06-23  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        Fix broken WinCairo build

        [Curl] Extract CurlDownloadManager as shared background task handler
        https://bugs.webkit.org/show_bug.cgi?id=173557

        Reviewed by Joseph Pecoraro.

        * platform/network/curl/CurlManager.h:

2017-06-23  Chris Dumez  <cdumez@apple.com>

        [iOS] Potential crash under WebCore::notifyLowPowerModeChanged(WebCore::LowPowerModeNotifier*, bool)
        https://bugs.webkit.org/show_bug.cgi?id=173755
        <rdar://problem/32940942>

        Reviewed by Mark Lam.

        The crash was happening because the WebLowPowerModeObserver would dispatch
        a lambda to the main thread but the LowPowerModeNotifier object could be
        dead by the time we get to the main thread.

        To address the issue, keep a strong ref to the WebLowPowerModeObserver in
        the lambda we dispatch to the main thread to make sure it stays alive until
        we execute the lambda. In the LowPowerModeNotifier destructor, we now reset
        the WebLowPowerModeObserver's notifier pointer to nil and I added a null
        check for this notifier in the lambda.

        * platform/LowPowerModeNotifier.cpp:
        (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
        * platform/LowPowerModeNotifier.h:
        * platform/ios/LowPowerModeNotifierIOS.mm:
        (-[WebLowPowerModeObserver initWithNotifier:]):
        (-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
        (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
        (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
        (WebCore::notifyLowPowerModeChanged):

2017-06-23  Alex Christensen  <achristensen@webkit.org>

        Add SPI to WKURLSchemeTask for redirection
        https://bugs.webkit.org/show_bug.cgi?id=173730

        Reviewed by Brady Eidson.

        * platform/network/CacheValidation.cpp:
        (WebCore::computeFreshnessLifetimeForHTTPFamily):
        Asserting that redirects are always http/https URLs is no longer valid.
        If there's a custom scheme redirect, give it no freshness lifetime in the cache.

2017-06-23  Konstantin Tokarev  <annulen@yandex.ru>

        Remove excessive headers from WebCore/{editing,fileapi,history,html,loader,page}
        https://bugs.webkit.org/show_bug.cgi?id=173769

        Reviewed by Simon Fraser.

        No new tests needed.

        * css/CSSFontFaceSource.cpp:
        * editing/DictationCommand.cpp:
        * editing/Editor.h:
        * editing/VisiblePosition.h:
        * editing/VisibleUnits.h:
        * fileapi/BlobBuilder.h:
        * history/PageCache.h:
        * html/DOMURL.h:
        * html/HTMLCollection.h:
        * html/HTMLMediaElement.cpp:
        * html/HTMLMediaElement.h:
        * html/HTMLPlugInImageElement.cpp:
        * html/StepRange.h:
        * html/canvas/CanvasRenderingContext.h:
        * html/canvas/CanvasRenderingContext2D.h:
        * html/parser/HTMLDocumentParser.cpp:
        * html/parser/HTMLElementStack.h:
        * html/parser/HTMLInputStream.h:
        * html/shadow/MediaControlElements.cpp:
        * html/shadow/MediaControls.cpp:
        * html/shadow/MediaControls.h:
        * html/track/TrackListBase.h:
        * html/track/VTTCue.h:
        * html/track/WebVTTParser.cpp:
        * html/track/WebVTTParser.h:
        * loader/CrossOriginPreflightChecker.cpp:
        * loader/DocumentThreadableLoader.cpp:
        * loader/FrameLoaderClient.h:
        * loader/LinkPreloadResourceClients.h:
        * loader/LoadTiming.h:
        * loader/ThreadableLoaderClientWrapper.h:
        * loader/WorkerThreadableLoader.h:
        * loader/cache/CachedResourceLoader.h:
        * loader/cache/CachedResourceRequest.h:
        * loader/cache/CachedSVGDocument.h:
        * loader/cache/CachedTextTrack.h:
        * loader/icon/IconLoader.cpp:
        * page/AlternativeTextClient.h:
        * page/CaptionUserPreferences.cpp:
        * page/CaptionUserPreferences.h:
        * page/ContextMenuClient.h:
        * page/MainFrame.h:
        * page/Page.h:
        * page/PageGroup.h:
        * page/PerformanceEntry.h:
        * page/PerformanceResourceTiming.h:
        * page/ResourceUsageOverlay.cpp:
        * page/ResourceUsageOverlay.h:
        * page/UserContentController.h:
        * page/UserContentProvider.h:
        * page/animation/AnimationBase.h:
        * page/animation/CSSPropertyAnimation.h:
        * page/animation/CompositeAnimation.h:
        * page/scrolling/ScrollingCoordinator.h:
        * xml/XSLTProcessorLibxslt.cpp:
        * xml/parser/XMLDocumentParserLibxml2.cpp:

2017-06-23  Chris Dumez  <cdumez@apple.com>

        [mac-wk1] requestAnimationFrame callbacks may not get serviced
        https://bugs.webkit.org/show_bug.cgi?id=173628

        Reviewed by Simon Fraser.

        Page::setIsVisibleInternal() was firing the 'visibilitychange' event
        synchronously while in the middle of updating its visibility/activity
        state. This allowed the JavaScript to re-enter the method by calling
        testRunner.setPageVisibility() / resetPageVisiblity() and we would
        end up in an inconsistent state.

        No new tests, extended existing test.

        * dom/Document.cpp:
        (WebCore::Document::visibilityStateChanged):
        Do no fire the visibilitychange event synchronously as we are in the
        middle of updating the page's activity state. Instead fire the
        event asynchronously.

        * page/Page.cpp:
        (WebCore::Page::setIsVisibleInternal):
        Move the calling of Document::visibilityStateChanged() until after we're
        done updating the page's visibility state.

        * testing/Internals.cpp:
        (WebCore::Internals::scriptedAnimationsAreSuspended):
        * testing/Internals.h:
        * testing/Internals.idl:
        Add test infrastructure to check if scripted animations are suspended.

2017-06-23  Eric Carlson  <eric.carlson@apple.com>

        [iOS] Respond to AudioSession interruption and resume
        https://bugs.webkit.org/show_bug.cgi?id=173718
        <rdar://problem/32925263>

        Reviewed by Youenn Fablet.

        Tested manually.

        * WebCore.xcodeproj/project.pbxproj: Add CoreAudioCaptureSourceIOS.mm/.h

        * platform/mediastream/RealtimeMediaSource.h: Make createWeakPtr protected so derived classes
        can use it.

        * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h: Added.
        * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: Added.
        (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
        (-[WebCoreAudioCaptureSourceIOSListener invalidate]):
        (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
        (-[WebCoreAudioCaptureSourceIOSListener sessionMediaServicesWereReset:]):
        (WebCore::CoreAudioCaptureSourceIOS::CoreAudioCaptureSourceIOS):
        (WebCore::CoreAudioCaptureSourceIOS::~CoreAudioCaptureSourceIOS):

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioSharedUnit::suspended): 
        (WebCore::CoreAudioSharedUnit::setupAudioUnit): Clear m_suspended.
        (WebCore::CoreAudioSharedUnit::suspend): Don't clear sources or uninitialize the audio unit,
        suspend is temporary. Set m_suspended.
        (WebCore::CoreAudioSharedUnit::resume): New, restart the audio unit.
        (WebCore::CoreAudioCaptureSource::create): Create the correct object.
        (WebCore::CoreAudioCaptureSource::scheduleReconfiguration): Dispatch to main thread if necessary.
        (WebCore::CoreAudioCaptureSource::beginInterruption): New, suspend from main thread.
        (WebCore::CoreAudioCaptureSource::endInterruption): New, resume/reconfigure from main thread.
        (WebCore::CoreAudioCaptureSource::interrupted):
        * platform/mediastream/mac/CoreAudioCaptureSource.h:

2017-06-23  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Drop the AES-CFB support
        https://bugs.webkit.org/show_bug.cgi?id=173547

        Reviewed by Jiewen Tan.

        No new tests -- relevant test baselines are updated.

        Stop registering the AES-CFB algorithm as something that's supported by
        the libgcrypt implementation. This algorithm was previously included in
        the Web Crypto API specification, but has since been dropped from it.

        Conveniently, libgcrypt only recently gained support for the CFB8 AES
        cipher mode that's required by the specification, meaning we could only
        support this algorithm with future releases of the libgcrypt library.

        * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
        (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):

2017-06-23  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE] Enable PUBLIC_SUFFIX_LIST
        https://bugs.webkit.org/show_bug.cgi?id=173758

        Reviewed by Žan Doberšek.

        * PlatformWPE.cmake: Add PublicSuffixSoup.cpp to the build.

2017-06-22  Antti Koivisto  <antti@apple.com>

        REGRESSION(r217695): Offscreen/overflowed items not being rendered while translating in-frame
        https://bugs.webkit.org/show_bug.cgi?id=173732

        Reviewed by Simon Fraser.

        If an accelerated animation starts completely outside the view we fail to create backing for it
        when it moves into view.

        Fix by computing the full extent rect of the animation when it starts and doing the viewport overlap
        testing with that.

        Test: compositing/backing/transform-transition-from-outside-view.html

        * platform/graphics/GraphicsLayer.h:
        (WebCore::GraphicsLayer::animationExtent):
        (WebCore::GraphicsLayer::setAnimationExtent):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect):

            Return the current animation transformation matrix so we can use it elsewhere without recomputing.

        (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):

            If we have animation extent use it instead of bounds for visibility testing.

        (WebCore::GraphicsLayerCA::recursiveCommitChanges):

            Track if theres is a visible ancestor layer with a transition animation.

        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
        (WebCore::GraphicsLayerCA::updateCoverage):

            For simplicity create backing for all sublayers of a visible transform animated layer.

        * platform/graphics/ca/GraphicsLayerCA.h:
        (WebCore::GraphicsLayerCA::VisibleAndCoverageRects::VisibleAndCoverageRects): Deleted.
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateGeometry):

            Pass the animation extent (including descendants) to GraphicsLayer.

2017-06-22  Chris Dumez  <cdumez@apple.com>

        ResourceLoadStatisticsStore should be ThreadSafeRefCounted
        https://bugs.webkit.org/show_bug.cgi?id=173753
        <rdar://problem/32939326>

        Reviewed by Andreas Kling.

        ResourceLoadStatisticsStore should be ThreadSafeRefCounted as it is ref'd/deref'd
        from different threads.

        * loader/ResourceLoadStatisticsStore.h:

2017-06-22  Myles C. Maxfield  <mmaxfield@apple.com>

        @font-face rules with invalid primary fonts never download their secondary fonts
        https://bugs.webkit.org/show_bug.cgi?id=173138
        <rdar://problem/32554450>

        Reviewed by Simon Fraser.

        We have logic in CSSFontAccessor::font() which disallows downloading a CSSFontFace if that CSSFontFace
        is already in the Succeeded state. However, it was possible for a succeeded CSSFontFace to still fail
        to create a font. In this situation, we wouldn't be able to use the downloaded font, and we wouldn't
        try to download the next item in the src: list because the CSSFontFace is succeeded.

        This patch strengthens the meaning of the Succeeded state. Previously, it just meant that the bytes
        in the file were downloaded successfully. This patch extends this to also mean that the bytes in the
        file can be successfully interpreted as a font. This way, the CSSFontFace in the example above won't be
        set to the Succeeded state, so we will continue follow the src: list and download the secondary fonts.

        This has an added benefit that the CSS Font Loading API's promises will be called more appropriately.
        The transition to the Succeeded state will trigger a resolve of the promise. Now, these promises will
        only be resolved if the fonts are actually parsed and understood by our text system.

        Test: fast/text/font-fallback-invalid-load.html

        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::fontLoaded): Move to the failed state if we can't understand the font
        data. This is the crux of this patch.
        (WebCore::CSSFontFaceSource::font): This function should only be called if we are in the Succeeded
        state, which means now we know we should always be able to understand the bytes of the file. Therefore,
        we can change some if statements into ASSERT()s.
        * loader/cache/CachedSVGFont.cpp:
        (WebCore::CachedSVGFont::createFont): Ditto.
        (WebCore::CachedSVGFont::ensureCustomFontData): Similarly to CSSFontFaceSource::fontLoaded(), this
        adds another check to our criteria for transitioning into the Succeeded state, which will guarantee that
        later we will always be able to create the font object.

2017-06-22  Andreas Kling  <akling@apple.com>

        Rename MemoryPressureHandler::setTabCount to setPageCount
        https://bugs.webkit.org/show_bug.cgi?id=173750

        Reviewed by Daniel Bates.

        * page/Page.cpp:
        (WebCore::Page::~Page):

2017-06-22  Antoine Quint  <graouts@apple.com>

        Modern media controls localised strings are out of sync with used strings in code
        https://bugs.webkit.org/show_bug.cgi?id=173752

        Reviewed by Dean Jackson.

        Remove strings we no longer use and add strings we use but failed to add previously.

        * English.lproj/modern-media-controls-localized-strings.js:

2017-06-22  Antoine Quint  <graouts@apple.com>

        Log when scripted animations get suspended and resumed
        https://bugs.webkit.org/show_bug.cgi?id=173751

        Reviewed by Dean Jackson.

        More work toward understanding why rAF callbacks are not serviced on bots (webkit.org/b/173628).

        * dom/Document.cpp:
        (WebCore::Document::requestAnimationFrame):
        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::suspend):
        (WebCore::ScriptedAnimationController::resume):
        (WebCore::ScriptedAnimationController::logSuspendCount): Deleted.
        * dom/ScriptedAnimationController.h:
        * page/Page.cpp:
        (WebCore::Page::suspendScriptedAnimations):
        (WebCore::Page::resumeScriptedAnimations):
        (WebCore::Page::setIsVisibleInternal):

2017-06-22  Zalan Bujtas  <zalan@apple.com>

        REGRESSION(r214712): Infinite recursion in RenderTable::layout in paginated mode
        https://bugs.webkit.org/show_bug.cgi?id=173731
        <rdar://problem/32237775>

        Reviewed by Antti Koivisto.

        We should just skip bottom captions to check if section is moved, since they don't affect
        the section position (bottom <caption> is preceded by <tfoot>).

        Test: fast/table/caption-bottom-with-pagination.html

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

2017-06-22  Dean Jackson  <dino@apple.com>

        REGRESSION (r215809): 50% regression 14E305 -> 15A293a in MotionMark Suits test
        https://bugs.webkit.org/show_bug.cgi?id=173728
        <rdar://problem/32526744>

        Reviewed by Tim Horton.

        It turns out that CGGradientCreateWithColors is much slower than
        CGGradientCreateWithColorComponents, even without colorspace variations.
        Update the gradient creation code to only use this slower path
        when it has extended colors.

        * platform/graphics/Color.h: Add a FIXME about renaming some methods.
        * platform/graphics/cg/GradientCG.cpp: Use CGGradientCreateWithColorComponents
        if we have stops that are not extended colors.
        (WebCore::Gradient::platformGradient):

2017-06-22  Youenn Fablet  <youenn@apple.com>

        Fix memory leak in LibWebRTCMediaEndpoint
        https://bugs.webkit.org/show_bug.cgi?id=173717

        Reviewed by Eric Carlson.

        No chnage of behavior.
        Making sure SessionDescription pointer get properly released.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * testing/MockLibWebRTCPeerConnection.cpp: Allocating description.

2017-06-22  Daniel Bates  <dabates@apple.com>

        Make FrameLoadRequest a move-only type
        https://bugs.webkit.org/show_bug.cgi?id=173682

        Reviewed by Alex Christensen and Darin Adler.

        A FrameLoadRequest groups together the information to perform a load into a single object
        that is more manageable to pass around than its constituent parts. Code that receives a
        FrameLoadRequest is expected to extract out the information it needs to complete its task.
        And it does not make sense to re-use the same FrameLoadRequest object for more than one
        load. Therefore, it is sufficient to make FrameLoadRequest a move-only type.

        * inspector/InspectorFrontendClientLocal.cpp:
        (WebCore::InspectorFrontendClientLocal::openInNewTab):
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::navigate):
        * loader/FrameLoadRequest.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::changeLocation):
        (WebCore::FrameLoader::urlSelected):
        (WebCore::FrameLoader::loadURLIntoChildFrame):
        (WebCore::FrameLoader::loadFrameRequest):
        (WebCore::FrameLoader::loadURL):
        (WebCore::FrameLoader::load):
        (WebCore::FrameLoader::loadPostRequest):
        (WebCore::createWindow):
        * loader/FrameLoader.h:
        * loader/NavigationScheduler.cpp:
        (WebCore::NavigationScheduler::scheduleLocationChange):
        * page/ContextMenuController.cpp:
        (WebCore::openNewWindow):
        (WebCore::ContextMenuController::contextMenuItemSelected):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::createWindow):
        * replay/UserInputBridge.cpp:
        (WebCore::UserInputBridge::loadRequest):
        * replay/UserInputBridge.h:

2017-06-22  Jer Noble  <jer.noble@apple.com>

        REGRESSION (r217223): [iOS] Video keeps playing after application is backgrounded
        https://bugs.webkit.org/show_bug.cgi?id=173727

        Reviewed by Eric Carlson.

        Only override media element visibility if it is in picture-in-picture mode (not fullscreen generally).

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

2017-06-22  Joseph Pecoraro  <pecoraro@apple.com>

        Follow-up to r218662. Only log backtraces for DumpRenderTree.

        Rubber-stamped by Antoine Quint.

        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::logSuspendCount):

2017-06-22  Charlie Turner  <cturner@igalia.com>

        [GTK] Spreaker live shows won't play
        https://bugs.webkit.org/show_bug.cgi?id=173306

        Reviewed by Xabier Rodriguez-Calvar.

        This was due to removing the code that negotiated caps for Icecast
        streams based on the response headers in r191947. The problem is that
        the typefind element can sometimes squint hard enough and see an MP3
        stream and attempt to play it, resulting in garbled audio playback. More
        commonly typefind fails to recognize the Icecast stream and bails,
        resulting in no playback at all.

        r191947 also removed the emission of metadata into the pipeline. This
        patch also leaves that out since we have no use for it within WebKit.

        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (StreamingClient::handleResponseReceived):

2017-06-22  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r218633.

        The test is failing frequently on Sierra Debug and Windows

        Reverted changeset:

        "AX: Cannot call setValue() on contenteditable or ARIA text
        controls"
        https://bugs.webkit.org/show_bug.cgi?id=173520
        http://trac.webkit.org/changeset/218633

2017-06-22  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Implement ReadableStreamBYOBReader read()
        https://bugs.webkit.org/show_bug.cgi?id=172714

        Reviewed by Youenn Fablet.

        Implemented read() method of ReadableStreamBYOBReader [1]. Also added code related 
        to BYOB features that were previously described as FIXMEs and that now become reachable.

        In addition, WPT tests that involve read() have allowed to identify 2 bugs not directly 
        related to read() (172716 and 172717). They will be fixed distinctly. Once done, all WPT
        tests should pass.

        [1] https://streams.spec.whatwg.org/#byob-reader-read

        WPT tests (web-platform-tests/streams/readable-byte-streams/general.js) already cover
        most cases for read() usage. Corresponding expectations have been updated. In addition,
        1 test has been added to WebKit tests (in streams/readable-stream-byob-reader.js) to 
        check that read() can only be applied to a ReadableStreamBYOBReader.

        * Modules/streams/ReadableByteStreamInternals.js:
        (readableByteStreamControllerClearPendingPullIntos): Implemented.
        (readableByteStreamControllerEnqueue): Updated with support for BYOBReader.
        (readableByteStreamControllerPullInto): Added.
        (readableStreamAddReadIntoRequest): Added.
        * Modules/streams/ReadableStreamBYOBReader.js:
        (read): Added.

2017-06-22  Youenn Fablet  <youenn@apple.com>

        [WebRTC] Prevent capturing at unconventional resolutions when using the SW encoder on Mac
        https://bugs.webkit.org/show_bug.cgi?id=172602
        <rdar://problem/32407693>

        Reviewed by Eric Carlson.

        Test: platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html

        Add internal API to switch on/off hardware H264 encoder.
        Add checks for standard size. If using a software encoder and frame size is not standard,
        the session is destroyed and no frame is sent at all.

        Added tests based on captureStream.
        Fixed the case of capturing a canvas which size is changing.

        * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
        (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
        * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.h:
        * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
        (WebCore::H264VideoToolboxEncoder::setHardwareEncoderForWebRTCAllowed):
        (WebCore::H264VideoToolboxEncoder::hardwareEncoderForWebRTCAllowed):
        (WebCore::isUsingSoftwareEncoder):
        (WebCore::H264VideoToolboxEncoder::CreateCompressionSession):
        (isStandardFrameSize): Added.
        (isUsingSoftwareEncoder): Added.
        * testing/Internals.cpp:
        (WebCore::Internals::setH264HardwareEncoderAllowed):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-06-21  Youenn Fablet  <youenn@apple.com>

        [Fetch API] TypeError when called with body === {}
        https://bugs.webkit.org/show_bug.cgi?id=173295
        <rdar://problem/32746733>

        Reviewed by Sam Weinig.

        Test: fetch/body-init.html

        Handling body of Request and Response using binding generator to correctly handle unions.
        The biggest change is that any value that is not a specific type in the union will match a String.
        This is matching WebIDL spec and Firefox behavior.

        Handling of ReadableStream bodies remains in JS builtin for Response.
        This allows easier handling cloning and consumption of body.
        Adding setBodyAsReadableStream since this is no longer handled by extractBody.

        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::extract): Using Variant instead of JSC::JSValue.
        (WebCore::FetchBody::readableStreamBody): Introduced to handle the
        case of readable stream bodies.
        * Modules/fetch/FetchBody.h:
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::extractBody):
        * Modules/fetch/FetchBodyOwner.h:
        (WebCore::FetchBodyOwner::setBody):
        * Modules/fetch/FetchRequest.cpp:
        (WebCore::FetchRequest::setBody): Splitting setBody for ease of readability.
        (WebCore::FetchRequest::setBodyFromInputRequest):
        * Modules/fetch/FetchRequest.h:
        * Modules/fetch/FetchRequest.idl:
        * Modules/fetch/FetchRequest.js:
        (initializeFetchRequest):
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::initializeWith):
        (WebCore::FetchResponse::setBodyAsReadableStream):
        * Modules/fetch/FetchResponse.h:
        * Modules/fetch/FetchResponse.idl:
        * Modules/fetch/FetchResponse.js:
        (initializeFetchResponse):
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/WebCoreBuiltinNames.h:

2017-06-21  Simon Fraser  <simon.fraser@apple.com>

        Add z-index to compositing logging output
        https://bugs.webkit.org/show_bug.cgi?id=173684

        Reviewed by Zalan Bujtas.

        Show z-index, which is often useful to find negative z-index items.

        Log "+foreground" rather than "foreground" to indicate that this layer has an
        additional foreground/background layer, and fix spacing.

        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::logLayerInfo):

2017-06-21  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix Window Debug build after r218660.

        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::canUseForWithReason):

2017-06-21  Andreas Kling  <akling@apple.com>

        Increase memory kill limits for WebContent processes that manage multiple tabs.
        https://bugs.webkit.org/show_bug.cgi?id=173674

        Reviewed by Geoffrey Garen.

        Plumb the non-utility Page count down to WTF::MemoryPressureHandler.

        * page/Page.cpp:
        (WebCore::Page::Page):
        (WebCore::Page::~Page):

2017-06-21  Jiewen Tan  <jiewen_tan@apple.com>

        [WebCrypto] Restore ordering of CryptoAlgorithmIdentifier in SerializedScriptValue
        https://bugs.webkit.org/show_bug.cgi?id=173678
        <rdar://problem/32879314>

        Reviewed by Sam Weinig.

        r218030 reorders the ordering of CryptoAlgorithmIdentifier in SerializedScriptValue,
        which introduces backward compatibility issues with CryptoKey objects stored in the
        IndexedDB. Hence, we should restore it back.

        No tests.

        * bindings/js/SerializedScriptValue.cpp:

2017-06-21  Daniel Bates  <dabates@apple.com>

        Change FrameLoadRequest from a struct to a class

        FrameLoadRequest is underutilizing the purpose of a struct - default visibility of
        members is public, as FrameLoadRequest explicitly groups its members under public:
        or private: sections. Maybe in the future we can make FrameLoadRequest a struct
        with only public members. For now, we should consider FrameLoadRequest a class.

        * loader/FormSubmission.h:
        * loader/FrameLoadRequest.h:
        * loader/FrameLoader.h:
        * page/Chrome.h:
        * page/ChromeClient.h:
        * replay/UserInputBridge.h:

2017-06-21  Daewoong Jang  <daewoong.jang@navercorp.com>

        Compiler error while building with !HAVE(ACCESSIBILITY)
        https://bugs.webkit.org/show_bug.cgi?id=173670

        Reviewed by Chris Fleizach.

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

2017-06-21  Antoine Quint  <graouts@apple.com>

        Build fix.

        Reviewed by Tim "Mr. T" Horton.

        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::logSuspendCount):
        * page/Page.cpp:
        (WebCore::Page::suspendScriptedAnimations):
        (WebCore::Page::resumeScriptedAnimations):

2017-06-21  Antoine Quint  <graouts@apple.com>

        Ensure DRT always logs rAF suspension debugging code
        https://bugs.webkit.org/show_bug.cgi?id=173681

        Reviewed by Tim "Mr. T" Horton.

        Instead of using a setting to check whether we should log information related to rAF
        callbacks being suspended with WK1, we now check whether we're using in DRT to avoid
        any potential issue with settings being in the incorrect state when a test is run.

        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::logSuspendCount):
        * page/Page.cpp:
        (WebCore::Page::suspendScriptedAnimations):
        (WebCore::Page::resumeScriptedAnimations):
        * page/Settings.in:
        * platform/RuntimeApplicationChecks.h:
        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
        (WebCore::MacApplication::isDumpRenderTree):

2017-06-21  Chris Dumez  <cdumez@apple.com>

        Allow constructing a WTF:Function from a function pointer
        https://bugs.webkit.org/show_bug.cgi?id=173660

        Reviewed by Alex Christensen.

        Construct WTF:Function directly from a function pointer when possible
        instead of constructing a lambda to do so.

        * Modules/encryptedmedia/InitDataRegistry.cpp:
        (WebCore::InitDataRegistry::InitDataRegistry):
        * page/Page.cpp:
        * page/mac/PageMac.mm:
        (WebCore::Page::platformInitialize):
        * platform/cf/MainThreadSharedTimerCF.cpp:
        (WebCore::setupPowerObserver):
        * platform/mac/WebCoreNSURLExtras.mm:
        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::canUseForWithReason):
        * workers/Worker.cpp:
        (WebCore::Worker::Worker):

2017-06-21  Antoine Quint  <graouts@apple.com>

        CSS text properties affect <video> shadow root
        https://bugs.webkit.org/show_bug.cgi?id=173664
        <rdar://problem/32904328>

        Reviewed by Dean Jackson.

        Ensure that we reset all inheritable styles back to their initial value for media shadow roots.

        Test: media/modern-media-controls/time-label/time-label-inherited-text-indent.html

        * Modules/modern-media-controls/controls/media-controls.css:
        (.media-controls-container):

2017-06-20  Simon Fraser  <simon.fraser@apple.com>

        Remove WILL_REVEAL_EDGE_EVENTS code
        https://bugs.webkit.org/show_bug.cgi?id=173632

        Reviewed by Sam Weinig, Beth Dakin.

        Remove will-reveal-edge events, which never took off.

        * dom/Document.cpp:
        (WebCore::Document::clearScriptedAnimationController):
        (WebCore::Document::sendWillRevealEdgeEventsIfNeeded): Deleted.
        * dom/Document.h:
        * dom/GlobalEventHandlers.idl:
        * html/HTMLBodyElement.idl:
        * html/HTMLFrameSetElement.idl:
        * page/FrameView.cpp:
        (WebCore::FrameView::scrollPositionChanged):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::scrollTo):

2017-06-21  Daniel Bates  <dabates@apple.com>

        Cleanup FrameLoadRequest
        https://bugs.webkit.org/show_bug.cgi?id=173564
        <rdar://problem/32903570>

        Reviewed by Brent Fulgham.

        FrameLoadRequest has too many constructors. Use default values to reduce the number of
        constructors. Have FrameLoadRequest hold a Ref<SecurityOrigin> instead of a RefPtr<SecurityOrigin>
        as FrameLoadRequest must always hold a valid SecurityOrigin, the security origin of the
        document that initiated the request.

        * inspector/InspectorFrontendClientLocal.cpp:
        (WebCore::InspectorFrontendClientLocal::openInNewTab): Explicitly pass the null-string for
        the target frame name as we do not have one. Use C++11 brace initialization syntax and ASCIILiteral().
        Rename local variable from request to frameLoadRequest to better describe its purpose. Fix up
        FIXME comment added in r105600 to better describe the issue we should fix as the code as
        changed since the FIXME was added.
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::navigate): No need to pass ShouldReplaceDocumentIfJavaScriptURL::ReplaceDocumentIfJavaScriptURL
        now that the FrameLoadRequests constructor uses this policy by default. Use C++11 brace
        initialization syntax and ASCIILiteral(). Rename local variable from frameRequest to frameLoadRequest
        to better describe its purpose.
        * loader/FrameLoadRequest.cpp:
        (WebCore::FrameLoadRequest::FrameLoadRequest): Use C++11 brace initialization syntax.
        * loader/FrameLoadRequest.h: Remove many constructor overloads. Changed m_requester from
        RefPtr<SecurityOrigin> to Ref<SecurityOrigin> as we can never be instantiated with a null
        SecurityOrigin. Moved m_shouldCheckNewWindowPolicy to be under ShouldOpenExternalURLsPolicy
        to reduce the size of the class by 8 bytes.
        * loader/FrameLoadRequest.h:
        (WebCore::FrameLoadRequest::FrameLoadRequest): Added copy constructor as we must use Ref::copyRef()
        to copy the Ref<SecurityOrigin>.
        (WebCore::FrameLoadRequest::requester): Return a const SecurityOrigin& instead of a const SecurityOrigin*.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::urlSelected): Update now that the order of the ShouldReplaceDocumentIfJavaScriptURL
        and ShouldOpenExternalURLsPolicy arguments in the FrameLoadRequest constructor has changed.
        (WebCore::FrameLoader::loadURLIntoChildFrame): Ditto. Also use C++11 brace initialization syntax
        and ASCIILiteral().
        (WebCore::FrameLoader::loadFrameRequest): Update code now that FrameLoadRequest::requester() returns a
        SecurityOrigin& instead of a SecurityOrigin*. Use C++11 brace initialization syntax.
        * loader/NavigationScheduler.cpp:
        (WebCore::NavigationScheduler::scheduleLocationChange): Use C++11 brace initialization syntax.
        Rename local variable from frameRequest to frameLoadRequest to better describe its purpose.
        * page/ContextMenuController.cpp:
        (WebCore::openNewWindow):
        (WebCore::ContextMenuController::contextMenuItemSelected): ove FrameLoadRequest instantiation
        into a local variable and use C++11 brace initialization syntax to make it easier to identify
        the arguments passed to FrameLoader::loadFrameRequest().
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::createWindow): Update now that the order of the ShouldReplaceDocumentIfJavaScriptURL
        and ShouldOpenExternalURLsPolicy arguments in the FrameLoadRequest constructor has changed.
        Use C++11 brace initialization syntax and ASCIILiteral(). Rename some local variables to better
        describe their purpose.

2017-06-20  Simon Fraser  <simon.fraser@apple.com>

        svgPath.getTotalLength() freezes webkit
        https://bugs.webkit.org/show_bug.cgi?id=173566
        <rdar://problem/32866731>

        Reviewed by Dean Jackson.

        Ensure that curveLength() progresses by making split() return a bool indicating
        whether either of the resulting curves are the same as the original. This can happen
        when midPoint() on two close points returns a point that is the same as one of the
        arguments because of floating-point precision limitations.

        Test: svg/custom/path-getTotalLength-hang.html

        * platform/graphics/PathTraversalState.cpp:
        (WebCore::QuadraticBezier::operator ==):
        (WebCore::QuadraticBezier::split):
        (WebCore::CubicBezier::operator ==):
        (WebCore::CubicBezier::split):
        (WebCore::curveLength):

2017-06-21  Youenn Fablet  <youenn@apple.com>

        Fix AVVideoCaptureSource frameRate setter and getter
        https://bugs.webkit.org/show_bug.cgi?id=173637

        Reviewed by Eric Carlson.

        Covered by manual testing.

        Using activeVideoMaxFrameDuration to get the frame rate.
        Setting the frame rate according the given vale if in the allowed range.

        * platform/mediastream/mac/AVVideoCaptureSource.h:
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::updateSettings):
        (WebCore::AVVideoCaptureSource::applyFrameRate):
        (WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
        (WebCore::AVVideoCaptureSource::shutdownCaptureSession):
        (WebCore::AVVideoCaptureSource::processNewFrame):
        (WebCore::AVVideoCaptureSource::updateFramerate): Deleted.

2017-06-21  Youenn Fablet  <youenn@apple.com>

        Refresh libwebrtc code up to a87675d4a160e2c49c3e754cd9ca291d6c8f36ae
        https://bugs.webkit.org/show_bug.cgi?id=173602

        Reviewed by Eric Carlson.

        No feature change.

        Updated according small libwebrtc API changes.

        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::configurationFromMediaEndpointConfiguration):
        * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
        (WebCore::RealtimeIncomingVideoSource::pixelBufferFromVideoFrame):
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
        (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):

2017-06-21  Sam Weinig  <sam@webkit.org>

        Add support for structured serialization of CSS Geometry types
        https://bugs.webkit.org/show_bug.cgi?id=173631

        Reviewed by Simon Fraser.

        Tests: imported/w3c/web-platform-tests/css/geometry-1/structured-serialization.html

        Adds support for serializing the new geometry types as specified by:
        https://drafts.fxtf.org/geometry-1/#structured-serialization

        * WebCore.xcodeproj/project.pbxproj:
        Move a few custom bindings into the "GC / Wrapping Only" since they have no more custom operations or attributes.

        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneSerializer::dumpDOMPoint):
        (WebCore::CloneSerializer::dumpDOMRect):
        (WebCore::CloneSerializer::dumpDOMMatrix):
        (WebCore::CloneSerializer::dumpDOMQuad):
        (WebCore::CloneSerializer::dumpIfTerminal):
        (WebCore::CloneDeserializer::getJSValue):
        (WebCore::CloneDeserializer::readDOMPoint):
        (WebCore::CloneDeserializer::readDOMMatrix):
        (WebCore::CloneDeserializer::readDOMRect):
        (WebCore::CloneDeserializer::readDOMPointInit):
        (WebCore::CloneDeserializer::readDOMQuad):
        (WebCore::CloneDeserializer::readTerminal):
        Add serialization/deserialization of the geometry types.

        * css/DOMMatrix.cpp:
        (WebCore::DOMMatrix::DOMMatrix):
        * css/DOMMatrix.h:
        (WebCore::DOMMatrix::create):
        * css/DOMMatrixReadOnly.cpp:
        (WebCore::DOMMatrixReadOnly::DOMMatrixReadOnly):
        * css/DOMMatrixReadOnly.h:
        (WebCore::DOMMatrixReadOnly::create):
        Add create functions and constructors that take a TransformationMatrix by r-value reference
        so they can be moved into the DOM type.

2017-06-21  Andreas Kling  <akling@apple.com>

        [iOS] Ensure that GraphicsServices is initialized before calling GSFontPurgeFontCache().
        https://bugs.webkit.org/show_bug.cgi?id=173616
        <rdar://problem/30780050>

        Reviewed by Chris Dumez.

        Fix for crash in GSFontPurgeFontCache() seen in apps embedding WebKit.
        Ensure GSFontInitialize() has been called first, since the former depends on state
        set up by this function.

        * page/cocoa/MemoryReleaseCocoa.mm:
        (WebCore::platformReleaseMemory):
        * platform/spi/ios/GraphicsServicesSPI.h:

2017-06-21  Antoine Quint  <graouts@apple.com>

        Add logging to identify when the Page suspends scripted animations
        https://bugs.webkit.org/show_bug.cgi?id=173626

        Reviewed by Tim Horton.

        We have a longstanding issue that some media/modern-media-controls tests time out due to
        requestAnimationFrame callbacks not being serviced, which is tracked by webkit.org/b/173628.
        We added some logging to identify when ScriptedAnimationController would get suspended in
        webkit.org/b/173326. This logging points to the fact that the reason rAF callbacks aren't
        serviced is because Document::requestAnimationFrame() suspends rAF when the page reports
        that scripted animations ought to be suspended, which is true when m_scriptedAnimationsSuspended
        is true. This patch adds logging that tracks when this flag is set, provided a new setting
        shouldLogScriptedAnimationControllerSuspensionChange is true.

        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::logSuspendCount):
        * page/Page.cpp:
        (WebCore::Page::suspendScriptedAnimations):
        (WebCore::Page::resumeScriptedAnimations):
        * page/Settings.in:

2017-06-21  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Extract CurlDownloadManager as shared background task handler
        https://bugs.webkit.org/show_bug.cgi?id=173557

        Curl resource handling should be shared by other part of Curl
        network stack. CurlDownloadManager is extracted as stand alone
        CurlManager singleton class to be ready for others
        (i.e. ResourceHandle).

        Reviewed by Alex Christensen.

        * PlatformWinCairo.cmake:
        * platform/network/curl/CookieJarCurl.cpp:
        (WebCore::setCookiesFromDOM):
        (WebCore::cookiesForSession):
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::init):
        (WebCore::CurlDownload::start):
        (WebCore::CurlDownload::cancel):
        (WebCore::CurlDownload::didReceiveHeader):
        (WebCore::CurlDownload::handleCurlMsg):
        (WebCore::CurlDownloadManager::CurlDownloadManager): Deleted.
        (WebCore::CurlDownloadManager::~CurlDownloadManager): Deleted.
        (WebCore::CurlDownloadManager::add): Deleted.
        (WebCore::CurlDownloadManager::remove): Deleted.
        (WebCore::CurlDownloadManager::getActiveDownloadCount): Deleted.
        (WebCore::CurlDownloadManager::getPendingDownloadCount): Deleted.
        (WebCore::CurlDownloadManager::startThreadIfNeeded): Deleted.
        (WebCore::CurlDownloadManager::stopThread): Deleted.
        (WebCore::CurlDownloadManager::stopThreadIfIdle): Deleted.
        (WebCore::CurlDownloadManager::updateHandleList): Deleted.
        (WebCore::CurlDownloadManager::addToCurl): Deleted.
        (WebCore::CurlDownloadManager::removeFromCurl): Deleted.
        (WebCore::CurlDownloadManager::downloadThread): Deleted.
        * platform/network/curl/CurlDownload.h:
        (WebCore::CurlDownloadManager::getMultiHandle): Deleted.
        (WebCore::CurlDownloadManager::runThread): Deleted.
        (WebCore::CurlDownloadManager::setRunThread): Deleted.
        * platform/network/curl/CurlManager.cpp: Added.
        (WebCore::CurlManager::CurlManager):
        (WebCore::CurlManager::~CurlManager):
        (WebCore::CurlManager::add):
        (WebCore::CurlManager::remove):
        (WebCore::CurlManager::getActiveCount):
        (WebCore::CurlManager::getPendingCount):
        (WebCore::CurlManager::startThreadIfNeeded):
        (WebCore::CurlManager::stopThread):
        (WebCore::CurlManager::stopThreadIfIdle):
        (WebCore::CurlManager::updateHandleList):
        (WebCore::CurlManager::addToCurl):
        (WebCore::CurlManager::removeFromCurl):
        (WebCore::CurlManager::workerThread):
        (WebCore::CurlUtils::getEffectiveURL):
        (WebCore::CurlSharedResources::mutexFor):
        (WebCore::CurlSharedResources::lock):
        (WebCore::CurlSharedResources::unlock):
        * platform/network/curl/CurlManager.h: Added.
        (WebCore::CurlManager::singleton):
        (WebCore::CurlManager::getCurlShareHandle):
        (WebCore::CurlManager::getMultiHandle):
        (WebCore::CurlManager::runThread):
        (WebCore::CurlManager::setRunThread):
        * platform/network/curl/ResourceHandleManager.cpp:
        (WebCore::ResourceHandleManager::ResourceHandleManager):
        (WebCore::ResourceHandleManager::~ResourceHandleManager):
        (WebCore::handleLocalReceiveResponse):
        (WebCore::getProtectionSpace):
        (WebCore::headerCallback):
        (WebCore::ResourceHandleManager::downloadTimerCallback):
        (WebCore::getCurlEffectiveURL): Deleted.
        (WebCore::sharedResourceMutex): Deleted.
        (WebCore::curl_lock_callback): Deleted.
        (WebCore::curl_unlock_callback): Deleted.
        (WebCore::ResourceHandleManager::getCurlShareHandle): Deleted.
        * platform/network/curl/ResourceHandleManager.h:

2017-06-21  Jeremy Jones  <jeremyj@apple.com>

        Include audio/vnd.wave as a valid mime-type for wav files.
        https://bugs.webkit.org/show_bug.cgi?id=173635
        rdar://problem/32656568

        Reviewed by Eric Carlson.

        audio/vnd.wave is a valid mime-type for wav files per https://tools.ietf.org/html/rfc2361

        Updated test and test results:
        LayoutTests/media/media-can-play-wav-audio.html

        * platform/MIMETypeRegistry.cpp:
        (WebCore::initializeSupportedImageMIMETypes):
        (WebCore::mimeTypeAssociationMap):
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::mimeTypeSet):

2017-06-21  Chris Fleizach  <cfleizach@apple.com>

        AX: Cannot call setValue() on contenteditable or ARIA text controls
        https://bugs.webkit.org/show_bug.cgi?id=173520

        Reviewed by Ryosuke Niwa.

        Add support for changing the value of a contenteditable and any other aria text control in setValue().
 
        Test: accessibility/set-value-editable-types.html

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::setValue):

2017-06-20  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement CryptoKeyEC SPKI imports
        https://bugs.webkit.org/show_bug.cgi?id=172927

        Reviewed by Jiewen Tan, Michael Catanzaro and Carlos Garcia Campos.

        No new tests -- affected tests are now passing and are unskipped.

        Implement libgcrypt-based support for SPKI imports of EC keys.

        Using libtasn1 through the utility functions and wrappers, the given key data
        is decoded against the SubjectPublicKeyInfo ASN.1 definition. The algorithm
        member is then properly validated, making sure that the key algorithm idenfitier
        is supported and that the algorithm parameters specify the correct EC curve.

        The public key bit string is then retrieved and validated, ensuring it represents
        an uncompressed EC point that is of valid size for the specified EC curve. The
        point is then tested through an EC context to make sure it's positioned on the
        specified EC curve.

        Finally, the curve name and uncompressed point data are embedded into a
        `public-key` s-expression that will be used through the libgcrypt API. This is
        then used, along with other information, to create a valid CryptoKeyEC object.

        * PlatformGTK.cmake: Use LIBTASN1_INCLUDE_DIRECTORIES and LIBTASN1_LIBRARIES.
        * PlatformWPE.cmake: Ditto.
        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        (WebCore::supportedAlgorithmIdentifier):
        (WebCore::curveForIdentifier):
        (WebCore::CryptoKeyEC::platformImportSpki):

2017-06-20  Devin Rousso  <drousso@apple.com>

        WebGPU contexts should have a back reference to the canvas element
        https://bugs.webkit.org/show_bug.cgi?id=173633

        Reviewed by Jon Lee.

        No tests added, as this is already implemented within other canvas types.

        * html/canvas/WebGPURenderingContext.idl:

2017-06-20  Youenn Fablet  <youenn@apple.com>

        WebAudioSourceProvider should be thread safe ref counted
        https://bugs.webkit.org/show_bug.cgi?id=173623

        Reviewed by Eric Carlson.

        No observable change of behavior.

        * platform/mediastream/WebAudioSourceProvider.h:

2017-06-20  Yoav Weiss  <yoav@yoav.ws>

        [preload] Turn on preload's feature flag by default.
        https://bugs.webkit.org/show_bug.cgi?id=173139

        Reviewed by Youenn Fablet.

        Turn on the runtime enabled feature flag for link preload by default.

        No new tests as this just turns on a feature that was already on-by-default for tests.

        * page/RuntimeEnabledFeatures.h:

2017-06-20  Myles C. Maxfield  <mmaxfield@apple.com>

        Disable font variations on macOS Sierra and iOS 10
        https://bugs.webkit.org/show_bug.cgi?id=173618
        <rdar://problem/32879164>

        Reviewed by Jon Lee.

        On macOS Sierra and iOS 10, there are some platform problems involved with font variations. They
        were previously enabled on those OSes just as a preview development tool. These platform bugs have
        been fixed in macOS High Sierra and iOS 11, so we should align our feature flags with the eventual
        configurations.

        * Configurations/FeatureDefines.xcconfig:
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::defaultVariationValues):
        (WebCore::preparePlatformFont):

2017-06-20  Devin Rousso  <drousso@apple.com>

        Web Inspector: Send context attributes for tracked canvases
        https://bugs.webkit.org/show_bug.cgi?id=173327

        Reviewed by Joseph Pecoraro.

        Test: inspector/canvas/context-attributes.html

        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::buildObjectForCanvas):

2017-06-20  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] The system Japanese font cannot be italicized
        https://bugs.webkit.org/show_bug.cgi?id=173300
        <rdar://problem/31805407>

        Reviewed by Ryosuke Niwa.

        Items in the system font cascade list may lie about whether or not they support italics.
        In order to get the truth, we need to use the physical font underlying the font in question,
        because this one won't lie. Then, we can interrogate this physical font about its traits
        in order to synthesize italics correctly.

        Test: fast/text/system-font-japanese-synthetic-italic.html

        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::lookupFallbackFont):
        * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
        (WebCore::FontFamilySpecificationCoreText::fontRanges):

2017-06-20  Chris Dumez  <cdumez@apple.com>

        Use WTF::Function instead of std::function in more places in WebCore/
        https://bugs.webkit.org/show_bug.cgi?id=173583

        Reviewed by Darin Adler.

        Use WTF::Function instead of std::function in more places in WebCore/ to
        reduce copying.

        * page/Page.cpp:
        * platform/HysteresisActivity.h:
        (WebCore::HysteresisActivity::HysteresisActivity):
        * platform/Logging.cpp:
        (WebCore::registerNotifyCallback):
        * platform/Logging.h:
        * platform/MainThreadSharedTimer.cpp:
        (WebCore::MainThreadSharedTimer::setFiredFunction):
        * platform/MainThreadSharedTimer.h:
        * platform/PlatformPasteboard.h:
        * platform/ScopeGuard.h:
        (WebCore::ScopeGuard::ScopeGuard):
        (WebCore::ScopeGuard::enable):
        * platform/ScrollAnimationSmooth.cpp:
        (WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth):
        * platform/ScrollAnimationSmooth.h:
        * platform/SharedTimer.h:
        * platform/audio/PlatformMediaSessionManager.cpp:
        (WebCore::PlatformMediaSessionManager::currentSessionsMatching):
        * platform/audio/PlatformMediaSessionManager.h:
        * platform/cf/MainThreadSharedTimerCF.cpp:
        (WebCore::setupPowerObserver):
        * platform/cf/RunLoopObserver.h:
        (WebCore::RunLoopObserver::RunLoopObserver):
        * platform/graphics/GraphicsContext.h:
        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::GraphicsLayer::traverse):
        * platform/graphics/GraphicsLayer.h:
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::addMediaEngine):
        * platform/graphics/MediaPlayer.h:
        * platform/graphics/Path.h:
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted):
        (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
        (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
        (WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification):
        (WebCore::MediaPlayerPrivateAVFoundation::Notification::function):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::runWithoutAnimations):
        * platform/graphics/cocoa/IOSurface.h:
        * platform/graphics/cocoa/IOSurface.mm:
        (WebCore::IOSurface::convertToFormat):
        * platform/graphics/gstreamer/MainThreadNotifier.h:
        * platform/graphics/gstreamer/MediaPlayerRequestInstallMissingPluginsCallback.h:
        (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::create):
        (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::MediaPlayerRequestInstallMissingPluginsCallback):
        * platform/graphics/win/GraphicsContextDirect2D.cpp:
        (WebCore::GraphicsContext::drawWithoutShadow):
        (WebCore::GraphicsContext::drawWithShadow):
        * platform/gtk/PasteboardHelper.cpp:
        (WebCore::ClipboardSetData::ClipboardSetData):
        (WebCore::PasteboardHelper::writeClipboardContents):
        * platform/gtk/PasteboardHelper.h:
        * platform/gtk/PlatformPasteboardGtk.cpp:
        (WebCore::PlatformPasteboard::writeToClipboard):
        * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
        (WebVideoFullscreenInterfaceAVKit::fullscreenMayReturnToInline):
        * platform/mac/PowerObserverMac.cpp:
        (WebCore::PowerObserver::PowerObserver):
        * platform/mac/PowerObserverMac.h:
        * platform/mac/WebCoreNSURLExtras.mm:
        (WebCore::isSecondLevelDomainNameAllowedByTLDRules):
        * platform/mediastream/CaptureDeviceManager.cpp:
        (CaptureDeviceManager::addCaptureDeviceChangedObserver):
        * platform/mediastream/CaptureDeviceManager.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::scheduleDeferredTask):
        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
        (-[WebAVAudioSessionAvailableInputsListener initWithCallback:]):
        * platform/mediastream/mac/CoreAudioCaptureSource.h:
        * platform/mock/ScrollAnimatorMock.cpp:
        (WebCore::ScrollAnimatorMock::ScrollAnimatorMock):
        * platform/mock/ScrollAnimatorMock.h:
        * platform/network/CookieStorage.h:
        * platform/network/NetworkStateNotifier.cpp:
        (WebCore::NetworkStateNotifier::addNetworkStateChangeListener):
        * platform/network/NetworkStateNotifier.h:
        * platform/network/NetworkStorageSession.cpp:
        (WebCore::NetworkStorageSession::forEach):
        * platform/network/NetworkStorageSession.h:
        * platform/network/cf/CookieStorageCFNet.cpp:
        (WebCore::cookieChangeCallbackMap):
        (WebCore::startObservingCookieChanges):
        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
        (WebCore::callOnMainThreadAndWait):
        * platform/network/mac/CookieStorageMac.mm:
        (-[WebCookieStorageObjCAdapter startListeningForCookieChangeNotificationsWithCallback:]):
        (WebCore::startObservingCookieChanges):
        * platform/network/soup/CookieStorageSoup.cpp:
        (WebCore::startObservingCookieChanges):
        * platform/network/soup/SoupNetworkSession.cpp:
        (WebCore::SoupNetworkSession::checkTLSErrors):
        * platform/network/soup/SoupNetworkSession.h:
        * platform/sql/SQLiteDatabase.cpp:
        (WebCore::destroyCollationFunction):
        (WebCore::callCollationFunction):
        (WebCore::SQLiteDatabase::setCollationFunction):
        * platform/sql/SQLiteDatabase.h:
        * rendering/RenderLayerBacking.cpp:
        (WebCore::traverseVisibleNonCompositedDescendantLayers):
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::paintItem):
        * rendering/RenderListBox.h:
        * rendering/line/BreakingContext.h:
        (WebCore::BreakingContext::InlineIteratorHistory::push):
        (WebCore::BreakingContext::InlineIteratorHistory::update):
        * workers/Worker.cpp:
        (WebCore::Worker::Worker):
        * workers/WorkerRunLoop.cpp:

2017-06-20  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r218524.

        This change broke internal builds.

        Reverted changeset:

        "[Cocoa] The system Japanese font cannot be italicized"
        https://bugs.webkit.org/show_bug.cgi?id=173300
        http://trac.webkit.org/changeset/218524

2017-06-20  Daniel Bates  <dabates@apple.com>

        Have FrameLoadRequest takes a Frame& instead of a Frame*
        https://bugs.webkit.org/show_bug.cgi?id=173614
        <rdar://problem/32884890>

        Reviewed by Brent Fulgham.

        * loader/ContentFilter.cpp:
        (WebCore::ContentFilter::handleProvisionalLoadFailure):
        * loader/FrameLoadRequest.cpp:
        (WebCore::FrameLoadRequest::FrameLoadRequest):
        * loader/FrameLoadRequest.h:
        * page/DragController.cpp:
        (WebCore::DragController::performDragOperation):

2017-06-20  Daniel Bates  <dabates@apple.com>

        Skip Content Security Policy check for a media request using standard schemes initiated from
        an element in user agent shadow tree
        https://bugs.webkit.org/show_bug.cgi?id=155505
        <rdar://problem/25169452>

        Reviewed by Brent Fulgham.

        This change makes the following tests pass on iOS 11:
            http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-video.html
            http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-audio.html

        * loader/MediaResourceLoader.cpp:
        (WebCore::MediaResourceLoader::requestResource):
        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
        (WebCore::WebCoreAVFResourceLoader::startLoading):

2017-06-20  Andreas Kling  <akling@apple.com>

        Remove no-op calls to purge SQLite caches on memory pressure.
        <https://webkit.org/b/173604>

        Reviewed by Chris Dumez.

        The implementation of _sqlite3_purgeEligiblePagerCacheMemory() is empty
        since a few releases ago, so there's no point in calling it.

        * page/MemoryRelease.cpp:
        (WebCore::registerMemoryReleaseNotifyCallbacks):
        (WebCore::registerSQLiteMemoryPressureHandler): Deleted.
        * page/MemoryRelease.h:
        * page/cocoa/MemoryReleaseCocoa.mm:
        (WebCore::platformReleaseMemory):
        (WebCore::registerSQLiteMemoryPressureHandler): Deleted.
        * platform/sql/SQLiteDatabase.cpp:
        (WebCore::initializeSQLiteIfNecessary):

2017-06-20  Devin Rousso  <drousso@apple.com>

        Web Inspector: add console messages for WebGL shader compile and program link errors/warnings
        https://bugs.webkit.org/show_bug.cgi?id=143236
        <rdar://problem/20352149>

        Reviewed by Dean Jackson.

        Test: fast/canvas/webgl/shader-compile-logging.html

        * html/canvas/WebGLRenderingContextBase.h:
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::checkFramebufferStatus):
        (WebCore::WebGLRenderingContextBase::compileShader):
        (WebCore::WebGLRenderingContextBase::recycleContext):
        (WebCore::WebGLRenderingContextBase::checkTextureCompleteness):
        (WebCore::WebGLRenderingContextBase::printToConsole):
        (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
        (WebCore::WebGLRenderingContextBase::synthesizeGLError):
        (WebCore::WebGLRenderingContextBase::printGLErrorToConsole): Deleted.
        (WebCore::WebGLRenderingContextBase::printWarningToConsole): Deleted.
        (WebCore::WebGLRenderingContextBase::printGLWarningToConsole): Deleted.
        Unify console logging helper functions to all follow the same path. Additionally, errors
        now generate stack traces. Shader compilation errors are now logged as well.

        * dom/Document.h:
        * dom/Document.cpp:
        (WebCore::Document::addConsoleMessage):
        * dom/ScriptExecutionContext.h:
        (WebCore::ScriptExecutionContext::AddConsoleMessageTask::AddConsoleMessageTask):
        * page/PageConsoleClient.h:
        * page/PageConsoleClient.cpp:
        (WebCore::PageConsoleClient::addMessage):
        * workers/WorkerGlobalScope.h:
        Add new path for logging to the console that accepts a ConsoleMessage.

2017-06-20  Saam Barati  <sbarati@apple.com>

        Unreviewed. Try to fix the build after r218594.

        * dom/Document.h:

2017-06-20  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r218530.

        This revision caused multiple media stream test crashes on
        Debug builds.

        Reverted changeset:

        "Merge MediaDevicesRequest and MediaDevicesEnumerationRequest
        to tighten up code and object lifetime"
        https://bugs.webkit.org/show_bug.cgi?id=173527
        http://trac.webkit.org/changeset/218530

2017-06-19  Antoine Quint  <graouts@apple.com>

        Media document experience with long-loading files is poor
        https://bugs.webkit.org/show_bug.cgi?id=173575
        <rdar://problem/32178119>

        Reviewed by Dean Jackson.

        In order to avoid showing media controls at a different size than that of the video when we've
        received enough information to determine whether it's audio or video and what the video frame size
        is, we do not show any UI until we have enough information to show the controls in their correct
        initial state. This works well with local files and fast-loading files, but does not work well with
        invalid files, which never load and fail to ever show any UI, and files that load slowly where there
        is no visible feedback that content will be visible.

        Instead, we now default to showing audio controls in their loading state, which provides a seamless
        transition if we will be loading an audio file since the controls are initially in the correct state,
        and at least provide feedback that data is loading even if we eventually transition to a video layout.

        Additionally, we remove the invalid placard background in case the media is invalid, showing only the
        crossed-out play icon in the center of the page in that state.

        Tests: media/modern-media-controls/media-documents/media-document-invalid.html
               media/modern-media-controls/media-documents/media-document-video-with-initial-audio-layout.html

        * Modules/modern-media-controls/controls/media-document.css:
        (:host(.media-document)): Remove "visibility: hidden" since we want the media controls to be visible
        at all times.
        (:host(.media-document.audio)): Add a little padding on the x-axis to ensure audio controls never snap
        directly to the edges of the window.
        (:host(.media-document.audio.iphone)): Remove the iPhone-specific styling since we moved it to the
        general case.
        (:host(.media-document.video.invalid) .placard): Remove the background from the invalid placard when
        showing invalid media.
        (:host(.media-document.ready)): Deleted.
        * Modules/modern-media-controls/media/audio-support.js:
        (AudioSupport.prototype.syncControl): Make sure we invalidate the media document layout when a media
        document's media type changes.
        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController): Instantiate the controls prior to creating the MediaDocumentController since the
        MediaDocumentController will need to access the controls.
        * Modules/modern-media-controls/media/media-document-controller.js:
        (MediaDocumentController): Set the default layout for media controls for a media document to be audio
        and in the waiting state.
        (MediaDocumentController.prototype.layout): Toggle the "invalid", "audio" and "video" CSS classes for
        the next possible commit to the DOM, provided we have established the media document's media type.
        (MediaDocumentController.prototype.handleEvent): Deal with the "play" and "error" events to trigger
        a layout.
        (MediaDocumentController.prototype._mediaDocumentHasMetadata): Deleted.
        (MediaDocumentController.prototype._mediaDocumentHasSize): Deleted.

2017-06-20  Daniel Bates  <dabates@apple.com>

        NavigationAction has too many constructors
        https://bugs.webkit.org/show_bug.cgi?id=173484

        Reviewed by Brady Eidson.

        A NavigationAction object is an immutable object that represents the details of a
        navigation, including the type of a navigation (e.g. link click), what triggered
        the navigation, and the external URL policy to use for the navigation. Over time
        the number of NavigationAction constructor overloads (not including copy/move
        constructors) has grown to 12 to support different combinations of details.
        We can use default values to reduce the number of constructors to 2 (not including
        copy/move constructors).

        No behavior changed. So, no new tests.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Pass NavigationType::Other when
        instantiating NavigationAction.
        (WebCore::FrameLoader::loadDifferentDocumentItem): Fix order of arguments now that
        the constructor overload that takes a NavigationType takes the Event* as the fourth argument,
        not the third. Also, use C++11 brace initialization syntax when instantiating a NavigationAction.
        (WebCore::createWindow):
        * loader/NavigationAction.cpp: Remove unnecessary #include of header ScriptController.h.
        Include header Event.h.
        (WebCore::NavigationAction::NavigationAction):
        * loader/NavigationAction.h: Forward declare class Event and remove #include of header Event.h.
        Make copy constructor, copy assignment operator, move constructor, and move assignment operator
        out-of-line to avoid the need to include header Event.h. Export the copy constructor so that it
        can be used from WebKit on the Apple Windows port. Move ShouldOpenExternalURLsPolicy to be after
        NavigationType to reduce the size of the class by 8 bytes.
        (WebCore::NavigationAction::NavigationAction):
        * loader/PolicyChecker.cpp: Include header Event.h.
        * page/Performance.cpp: Ditto.
        * replay/ReplayController.cpp: Ditto.

2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>

        Rename OrientationNotifer.h to OrientationNotifier.h
        https://bugs.webkit.org/show_bug.cgi?id=173600

        Reviewed by Youenn Fablet.

        No new tests needed.

        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.h:
        * platform/OrientationNotifier.h: Renamed from Source/WebCore/platform/OrientationNotifer.h.
        * platform/mediastream/mac/AVVideoCaptureSource.h:
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
        * testing/Internals.h:

2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>

        Remove excessive include directives from WTF
        https://bugs.webkit.org/show_bug.cgi?id=173553

        Reviewed by Saam Barati.

        No new tests needed.

        * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h:
        Added missing include directive.

2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>

        Remove excessive include directives from WebCore/dom
        https://bugs.webkit.org/show_bug.cgi?id=173591

        Reviewed by Darin Adler.

        No new tests needed.

        * bindings/js/JSCustomElementRegistryCustom.cpp:
        * dom/Attr.h:
        * dom/ChildListMutationScope.h:
        * dom/ContainerNodeAlgorithms.cpp:
        * dom/ContainerNodeAlgorithms.h:
        * dom/CustomElementRegistry.h:
        * dom/DOMRect.h:
        * dom/DocumentMarkerController.h:
        * dom/ElementIteratorAssertions.h:
        * dom/ElementRareData.h:
        * dom/EventContext.h:
        * dom/EventDispatcher.h:
        * dom/ExtensionStyleSheets.h:
        * dom/GenericEventQueue.h:
        * dom/LiveNodeList.h:
        * dom/LoadableClassicScript.h:
        * dom/LoadableScript.h:
        * dom/MutationCallback.h:
        * dom/NativeNodeFilter.h:
        * dom/NodeRareData.h:
        * dom/PromiseRejectionEvent.h:
        * dom/PseudoElement.h:
        * dom/Range.h:
        * dom/RegisteredEventListener.h:
        * dom/RejectedPromiseTracker.cpp:
        * dom/ScopedEventQueue.h:
        * dom/ScriptElement.h:
        * dom/ScriptExecutionContext.h:
        * dom/ScriptedAnimationController.cpp:
        * dom/ScriptedAnimationController.h:
        * dom/SelectorQuery.h:
        * dom/StaticNodeList.h:
        * dom/StaticRange.h:
        * dom/default/PlatformMessagePortChannel.h:
        * testing/Internals.cpp:
        * workers/WorkerGlobalScope.h:

2017-06-20  Konstantin Tokarev  <annulen@yandex.ru>

        Remove excessive include directives from WebCore/css
        https://bugs.webkit.org/show_bug.cgi?id=173554

        Reviewed by Alex Christensen.

        No new tests needed.

        * css/CSSComputedStyleDeclaration.h:
        * css/CSSContentDistributionValue.h:
        * css/CSSCursorImageValue.h:
        * css/CSSFilterImageValue.h:
        * css/CSSFontFace.h:
        * css/CSSFontFeatureValue.h:
        * css/CSSFontStyleRangeValue.h:
        * css/CSSFontVariationValue.h:
        * css/CSSImageGeneratorValue.h:
        * css/CSSImageSetValue.h:
        * css/CSSInheritedValue.h:
        * css/CSSInitialValue.h:
        * css/CSSKeyframeRule.cpp:
        * css/CSSKeyframeRule.h:
        * css/CSSLineBoxContainValue.h:
        * css/CSSPrimitiveValue.h:
        * css/CSSPrimitiveValueMappings.h:
        * css/CSSPropertySourceData.h:
        * css/CSSReflectValue.h:
        * css/CSSRevertValue.h:
        * css/CSSSelector.h:
        * css/CSSStyleSheet.h:
        * css/CSSToLengthConversionData.h:
        * css/CSSUnsetValue.h:
        * css/CSSValue.h:
        * css/CSSValuePool.h:
        * css/CSSVariableData.h:
        * css/DeprecatedCSSOMCounter.h:
        * css/DeprecatedCSSOMRGBColor.h:
        * css/DeprecatedCSSOMRect.h:
        * css/DeprecatedCSSOMValue.h:
        * css/RuleSet.h:
        * css/SelectorChecker.h:
        * css/StyleBuilderConverter.h:
        * css/StyleBuilderCustom.h:
        * css/StyleProperties.h:
        * css/StyleResolver.cpp:
        * css/StyleResolver.h:
        * css/StyleSheet.h:
        * css/StyleSheetContents.h:
        * css/ViewportStyleResolver.h:
        * css/parser/CSSDeferredParser.h:
        * css/parser/CSSParserIdioms.h:
        * css/parser/CSSParserImpl.cpp:
        * css/parser/CSSParserImpl.h:
        * css/parser/CSSParserObserver.h:
        * css/parser/CSSParserSelector.h:
        * css/parser/CSSPropertyParserHelpers.h:
        * css/parser/MediaQueryParser.cpp:
        * css/parser/MediaQueryParser.h:
        * css/parser/SizesAttributeParser.cpp:
        * css/parser/SizesAttributeParser.h:
        * html/BaseCheckableInputType.cpp:
        * html/MediaController.cpp:
        * html/track/TextTrack.cpp:
        * html/track/TextTrackCue.cpp:
        * html/track/VideoTrack.cpp:
        * loader/TextTrackLoader.cpp:

2017-06-20  Miguel Gomez  <magomez@igalia.com>

        [GTK] Layout Test fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html makes the subsequent test case flaky crash.
        https://bugs.webkit.org/show_bug.cgi?id=173459

        Reviewed by Carlos Garcia Campos.

        When destructing the VideoTextureCopierGStreamer, ensure that there's a previous gl context before trying
        to make it current again. There are situations where no previous context may exist, which can trigger a crash.
        Also, add DefaultImageOrientation to the switch that handles the video frame possible orientations, as it's the
        value used when no rotation needs to be performed, and it's currently triggering an assertion.

        Covered by existent tests.

        * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
        (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
        (WebCore::VideoTextureCopierGStreamer::updateTextureSpaceMatrix):

2017-06-19  Devin Rousso  <drousso@apple.com>

        Web Inspector: create canvas content view and details sidebar panel
        https://bugs.webkit.org/show_bug.cgi?id=138941
        <rdar://problem/19051672>

        Reviewed by Joseph Pecoraro.

        Tests: inspector/canvas/requestContent.html
               inspector/canvas/requestNode.html

        * inspector/InspectorCanvasAgent.h:
        * inspector/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::requestNode):
        Gets the node id of the backing canvas element.

        (WebCore::InspectorCanvasAgent::requestContent):
        Gets the current image content of the canvas.

        (WebCore::InspectorCanvasAgent::frameNavigated):
        (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
        Minor fixes from r218376 <https://webkit.org/b/172623>.

        (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
        Optionally send the `nodeId` of the backing canvas element if it is available.

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didCommitLoadImpl):

2017-06-19  Frederic Wang  <fwang@igalia.com>

        [iOS] Always include frames in the scrolling tree when async frame scrolling is enabled
        https://bugs.webkit.org/show_bug.cgi?id=173405

        Reviewed by Simon Fraser.

        Currently "async frame scrolling" is ignored on iOS. This commit changes that behavior to
        align on macOS and is a preliminary step to implement iframe scrolling on iOS (bug 149264).

        Test: compositing/iframes/compositing-for-scrollable-iframe.html
              fast/scrolling/scrolling-tree-includes-frame.html

        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): Do not require
        compositing when "async frame scrolling" is enabled on iOS.

2017-06-19  Frederic Wang  <fwang@igalia.com>

        [Mac] Add an experimental feature setting for async frame scrolling
        https://bugs.webkit.org/show_bug.cgi?id=173359

        Reviewed by Simon Fraser.

        The necessary work to use compositing for frames and include them in the scrolling tree on
        macOS was performed in r217726 and r217730. ScrollingTreeIncludesFrames was used to
        determine when this behavior should be enabled. However, this does not work well on iOS where
        ScrollingTreeIncludesFrames defaults to true and really means "include the frames in the
        scrolling tree when necessary". Hence we instead introduce a new "async frame scrolling"
        switch to enable the behavior on macOS, which will also be used in a follow-up commit on iOS.
        This new setting is also made an "experimental feature", so that it will be more convenient
        for developer to try it.

        Test: compositing/iframes/compositing-for-scrollable-iframe.html
              fast/scrolling/scrolling-tree-includes-frame.html

        * page/Settings.in: Declare new setting for async frame scrolling.
        * page/scrolling/ScrollingCoordinator.cpp:
        (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView): Also include frames in
        scrolling tree when async frame scrolling is enabled.
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): Rely on async frame
        scrolling to decide when compositing is needed.

2017-06-19  Zalan Bujtas  <zalan@apple.com>

        AX: Remove redundant AXObjectCache::textChanged(RenderObject*).
        https://bugs.webkit.org/show_bug.cgi?id=173579
        <rdar://problem/32865367>

        Reviewed by Antti Koivisto.

        All calls go through textChanged(Node*) method.

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

2017-06-19  Darin Adler  <darin@apple.com>

        Merge MediaDevicesRequest and MediaDevicesEnumerationRequest to tighten up code and object lifetime
        https://bugs.webkit.org/show_bug.cgi?id=173527

        Reviewed by Sam Weinig.

        * CMakeLists.txt: Removed MediaDevicesRequest.cpp.

        * Modules/mediastream/MediaDeviceInfo.cpp:
        (WebCore::MediaDeviceInfo::MediaDeviceInfo): Removed unneeded ScriptExecutionContext.
        (WebCore::MediaDeviceInfo::create): Ditto.
        * Modules/mediastream/MediaDeviceInfo.h: Removed unnecessary derivation from
        ContextDestructionObserver and ScriptExecutionContext arguments. Also removed
        unused MediaDeviceInfoVector typedef.
        * Modules/mediastream/MediaDeviceInfo.idl: Added ImplementationLacksVTable.

        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::MediaDevices::enumerateDevices): Call MediaDevicesEnumerationRequest
        directly here instead of going through MediaDevicesRequest.

        * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Moved code from
        MediaDevicesRequest in here. Put the typical counts at the top of the file.
        (WebCore::MediaDevicesEnumerationRequest::MediaDevicesEnumerationRequest):
        Marked inline and changed to take a DOM promise directly rather than having
        a separate class do the mapping to DOM promises.
        (WebCore::MediaDevicesEnumerationRequest::start): Replaced the create function
        with this. The caller doesn't actually keep a reference to the object.
        Added a FIXME about the behavior, not new, where we neither resolve nor reject
        the promise if there is no page object present. Updated to use the new version
        of UserMediaController::from.
        (WebCore::MediaDevicesEnumerationRequest::~MediaDevicesEnumerationRequest):
        Added a FIXME about the issue that we don't resolve or reject the promise if
        the client drops the last reference to the request without calling setDeviceInfo.
        (WebCore::MediaDevicesEnumerationRequest::document): Added. Private helper.
        Returns nullptr if the request is no longer active.
        (WebCore::MediaDevicesEnumerationRequest::frame): Added. For use by a caller
        that was getting to the frame. Uses the document function so it will return
        nullptr if the request is no longer active.
        (WebCore::MediaDevicesEnumerationRequest::userMediaDocumentOrigin): Changed
        to do the work using the document function.
        (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin): Ditto.
        (WebCore::MediaDevicesEnumerationRequest::contextDestroyed): Simplified. We
        now can simply set a boolean when the context is destroyed, so there are no
        side effects and the code is simpler.
        (WebCore::removeAtypicalDevices): Renamed and tightened up the code a bit.
        (WebCore::MediaDevicesEnumerationRequest::setDeviceInfo): Moved the code
        here from MediaDevicesEnumerationRequest to pass the devices along.

        * Modules/mediastream/MediaDevicesEnumerationRequest.h: Made the
        ContextDestructionObserver use private inheritance. Cut down the includes
        and removed various unneeded functions.

        * Modules/mediastream/MediaDevicesRequest.cpp: Removed.
        * Modules/mediastream/MediaDevicesRequest.h: Removed.

        * Modules/mediastream/UserMediaController.cpp:
        (WebCore::UserMediaController::UserMediaController): Use reference rather
        than pointer for the client.
        (WebCore::UserMediaController::~UserMediaController): Ditto.
        (WebCore::provideUserMediaTo): Ditto.

        * Modules/mediastream/UserMediaController.h:
        Changed constructor to take a refeference, removed client function, and
        changed data member to be a reference rather than a pointer.
        (WebCore::UserMediaController::from): Take and return a reference rather
        than taking a pointer that is checked for null.
        (WebCore::UserMediaController::requestUserMediaAccess): Use reference.
        (WebCore::UserMediaController::cancelUserMediaAccessRequest): Ditto.
        (WebCore::UserMediaController::enumerateMediaDevices): Ditto.
        (WebCore::UserMediaController::cancelMediaDevicesEnumerationRequest): Ditto.

        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::start): Updated to use the new version
        of UserMediaController::from.

        * WebCore.xcodeproj/project.pbxproj: Updated for file removals.

        * testing/Internals.cpp: Removed unneeded include of UserMediaController.h.

2017-06-19  Sam Weinig  <sam@webkit.org>

        [WebIDL] Move Touch related bindings in Document to their own IDL file
        https://bugs.webkit.org/show_bug.cgi?id=173521

        Reviewed by Alex Christensen.

        Rather than #including in the middle of an IDL file, this moves the touch related
        bindings in Document.idl to a new partial interface for Document in DocumentTouch.idl.
        While here, remove the custom binding for createTouchList.

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

        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::JSDocument::createTouchList): Deleted.
        Remove createTouchList. It can be generated now.

        * dom/Document.cpp:
        (WebCore::Document::createTouch): Deleted.
        * dom/Document.h:
        Move touch related bindings code to DocumentTouch.h/cpp.
        Remove DocumentIOSForward as it is no longer needed.

        * dom/Document.idl:
        Move touch related bindings to DocumentTouch.idl
        
        * dom/DocumentTouch.h: Added.
        * dom/DocumentTouch.cpp: Added.
        (WebCore::DocumentTouch::createTouch):
        Moved from Document.

        (WebCore::DocumentTouch::createTouchList):
        Added to aid generated binding.

        * dom/DocumentTouch.idl: Added.
        Moved operations from Document.h

        * dom/TouchList.h:
        (WebCore::TouchList::create):
        (WebCore::TouchList::TouchList):
        Added create that works with the bindings.

        * dom/ios/TouchEvents.cpp:
        Add DocumentTouchIOS.h and sort.

2017-06-19  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] The system Japanese font cannot be italicized
        https://bugs.webkit.org/show_bug.cgi?id=173300
        <rdar://problem/31805407>

        Reviewed by Ryosuke Niwa.

        Items in the system font cascade list may lie about whether or not they support italics.
        In order to get the truth, we need to use the physical font underlying the font in question,
        because this one won't lie. Then, we can interrogate this physical font about its traits
        in order to synthesize italics correctly.

        Test: fast/text/system-font-japanese-synthetic-italic.html

        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::lookupFallbackFont):
        * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
        (WebCore::FontFamilySpecificationCoreText::fontRanges):

2017-06-19  Daewoong Jang  <daewoong.jang@navercorp.com>

        [cURL] Move file scope static variables into function scopes
        https://bugs.webkit.org/show_bug.cgi?id=173567

        Reviewed by Alex Christensen.

        * platform/network/curl/SSLHandle.cpp:
        (WebCore::allowedHosts):
        (WebCore::allowedClientHosts):
        (WebCore::allowsAnyHTTPSCertificateHosts):
        (WebCore::addAllowedClientCertificate):
        (WebCore::setSSLClientCertificate):
        (WebCore::sslIgnoreHTTPSCertificate):
        (WebCore::certVerifyCallback):

2017-06-19  Darin Adler  <darin@apple.com>

        [Cocoa] implement URLSession:task:needNewBodyStream: delegate method
        https://bugs.webkit.org/show_bug.cgi?id=173551
        rdar://problem/32250512

        Reviewed by Alex Christensen.

        Covered by http/tests/misc/form-blob-challenge.html

        * WebCore.xcodeproj/project.pbxproj: Removed NSURLRequestSPI.h.

        * platform/network/cf/FormDataStreamCFNet.cpp:
        (WebCore::createHTTPBodyCFReadStream): Factored this out from setHTTPBody.
        (WebCore::setHTTPBody): Factored out the function above.
        * platform/network/cf/FormDataStreamCFNet.h: Added createHTTPBodyCFReadStream.

        * platform/network/cocoa/ResourceRequestCocoa.mm: Use CFNetworkSPI.h.
        * platform/network/ios/ResourceRequestIOS.mm: Ditto.

        * platform/network/mac/FormDataStreamMac.h: Added createHTTPBodyNSInputStream.
        * platform/network/mac/FormDataStreamMac.mm:
        (WebCore::createHTTPBodyNSInputStream): Added/

        * platform/network/mac/ResourceHandleMac.mm: Use CFNetworkSPI.h.
        * platform/network/mac/ResourceRequestMac.mm: Ditto.
        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Ditto.
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: Ditto.

        * platform/network/mac/WebCoreURLResponse.h: Moved SPI declarations from
        here into CFNetworkSPI.h.

        * platform/spi/cf/CFNetworkSPI.h: Use #pragma once, consolidated SPI that was
        defined in scattered locations.

        * platform/spi/cocoa/NSURLRequestSPI.h: Removed. Superceded by CFNetworkSPI.h.

2017-06-19  Brady Eidson  <beidson@apple.com>

        Various IndexedDB crashes as an after effect of previous test.
        <rdar://problem/31418761> and https://bugs.webkit.org/show_bug.cgi?id=170436

        Reviewed by Chris Dumez.

        No new test (No consistent test possible, in practice covered by all existing IDB tests)

        This is timing related, where a UniqueIDBDatabase can be destroyed on the main thread while
        it still has one task left to try to execute on the IDBServer thread.
        
        The background thread tasks don't Ref<> the UniqueIDBDatabase, so even though task execution
        took a Ref<> protector, there was still a small window for a race.
        
        Should be closed up by making the background thread tasks themselves protect this.
        
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
        (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
        (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
        (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
        * Modules/indexeddb/server/UniqueIDBDatabase.h:

2017-06-19  Sam Weinig  <sam@webkit.org>

        [WebIDL] Add support for serializers that have members that are themselves serializers (or inherit being a serializer from a parent)
        https://bugs.webkit.org/show_bug.cgi?id=173395

        Reviewed by Simon Fraser.

        Test: fast/css/DOMQuad-serialization.html

        * bindings/scripts/CodeGenerator.pm:
        (InheritsSerializable):
        Helper to determine if an interface inherits from any interfaces
        that are serializable. This is necessary because an attribute is
        serializable even if its interface is not marked as serializable. 

        (IsSerializableAttribute):
        Check ancestor interfaces as well to determine serializability.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateSerializerDefinition):
        Specialize attributes that are serializable interfaces to call its interfaces
        serialize function, thus allowing nested objects to be serialized.

        * dom/DOMQuad.idl:
        Add serializer.

        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: Added.
        * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h: Added.
        * bindings/scripts/test/TestSerialization.idl:
        * bindings/scripts/test/TestSerializationIndirectInheritance.idl: Added.
        Add and update tests.

2017-06-19  Commit Queue  <commit-queue@webkit.org>

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

        "It would break internal builds" (Requested by youenn on
        #webkit).

        Reverted changeset:

        "[WebRTC] Prevent capturing at unconventional resolutions when
        using the SW encoder on Mac"
        https://bugs.webkit.org/show_bug.cgi?id=172602
        http://trac.webkit.org/changeset/218505

2017-06-19  Zalan Bujtas  <zalan@apple.com>

        Opening certain mails brings up a mail that grows indefinitely.
        https://bugs.webkit.org/show_bug.cgi?id=173562
        <rdar://problem/32766579>

        Reviewed by Tim Horton.

        This reverts the logic where m_autoSizeContentSize always reflects the final layout's.
        When the ICB's height is 100%, it causes infinite recursion.
        See also webkit.org/b/173561.

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

2017-06-19  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS DnD] Support .zip archives for file uploads via drag and drop
        https://bugs.webkit.org/show_bug.cgi?id=173511
        <rdar://problem/32521025>

        Reviewed by Tim Horton.

        Allows dropped .zip archives to be uploaded as files by accepting types conforming to either
        "public.zip-archive" or "public.content" as potential file types. Initially, I opted to accept the more general
        "public.data" type; however, this includes UTIs such as "public.url" that should not be represented as files, so
        this is a more targeted fix that allows us to very easily add additional content types in the future by adding
        more types to supportedFileUploadPasteboardTypes.

        Tests:
        DataInteractionTests.ExternalSourceZIPArchiveToUploadArea
        DataInteractionTests.ExternalSourceZIPArchiveAndURLToSingleFileInput

        * page/mac/DragControllerMac.mm:
        (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod):
        * platform/Pasteboard.h:
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::read):
        (WebCore::Pasteboard::supportedWebContentPasteboardTypes):
        (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):

        Rename supportedPasteboardTypes to supportedWebContentPasteboardTypes, and also introduce
        supportedFileUploadPasteboardTypes which returns an list of types, such that if a type conforms to any type in
        this array, that type may be represented as a file. So far, this list contains "public.content" and
        "public.zip-archive".

        (WebCore::Pasteboard::types):
        (WebCore::Pasteboard::supportedPasteboardTypes): Deleted.
        * platform/ios/WebItemProviderPasteboard.mm:
        (typeConformsToTypes):

        Remove -typeIsAppropriateForSupportedTypes: and replace it with typeConformsToTypes. Use this both when
        determining the number of files on the pasteboard, and when determining preferred UTIs to load when dropping.

        (-[WebItemProviderPasteboard numberOfFiles]):
        (-[WebItemProviderPasteboard typeIdentifierToLoadForRegisteredTypeIdentfiers:]):
        (-[WebItemProviderPasteboard typeIsAppropriateForSupportedTypes:]): Deleted.
        * platform/mac/DragDataMac.mm:
        (WebCore::DragData::containsFiles):
        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::supportedFileUploadPasteboardTypes):

2017-06-19  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove custom binding for Document.getCSSCanvasContext()
        https://bugs.webkit.org/show_bug.cgi?id=173516

        Reviewed by Chris Dumez.

        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::JSDocument::visitAdditionalChildren):
        (WebCore::JSDocument::getCSSCanvasContext): Deleted.
        * dom/Document.cpp:
        (WebCore::Document::getCSSCanvasContext):
        * dom/Document.h:
        * dom/Document.idl:
        Use a Variant to pass the context and type to the bindings.

2017-06-19  Youenn Fablet  <youenn@apple.com>

        [WebRTC] Prevent capturing at unconventional resolutions when using the SW encoder on Mac
        https://bugs.webkit.org/show_bug.cgi?id=172602
        <rdar://problem/32407693>

        Reviewed by Eric Carlson.

        Test: platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html

        Add internal API to switch on/off hardware H264 encoder.
        Add checks for standard size. If using a software encoder and frame size is not standard,
        the session is destroyed and no frame is sent at all.

        Added tests based on captureStream.
        Fixed the case of capturing a canvas which size is changing.

        * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
        (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
        * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.h:
        * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
        (WebCore::H264VideoToolboxEncoder::setHardwareEncoderForWebRTCAllowed):
        (WebCore::H264VideoToolboxEncoder::hardwareEncoderForWebRTCAllowed):
        (WebCore::isUsingSoftwareEncoder):
        (WebCore::H264VideoToolboxEncoder::CreateCompressionSession):
        (isStandardFrameSize): Added.
        (isUsingSoftwareEncoder): Added.
        * testing/Internals.cpp:
        (WebCore::Internals::setH264HardwareEncoderAllowed):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-06-19  Brady Eidson  <beidson@apple.com>

        Cleanup IconLoader stuff when a DocumentLoader detaches from its frame.
        <rdar://problem/31418761> and https://bugs.webkit.org/show_bug.cgi?id=173473

        Reviewed by Alex Christensen.

        No new tests (No known change in behavior)

        I discovered the need to make these changes here due to a transient bug
        introduced in r218015 but already explicitly fixed in r218409.
        
        This change adds an assert to guard against a detached DocumentLoader having active IconLoaders.

        It also clears out all pending IconLoader and icon load decisions when stopLoading() is called, 
        as even attempting to start an icon load after detachment is a waste of cycles.
        
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::stopLoading): Also explicitly clear all IconLoaders and icons pending
          load decision.
        (WebCore::DocumentLoader::finishedLoadingIcon): Assert that this DocumentLoader is not detached.

2017-06-19  Chris Dumez  <cdumez@apple.com>

        Use WTF::Function instead of std::function in more places in WebCore/
        https://bugs.webkit.org/show_bug.cgi?id=173535

        Reviewed by Antti Koivisto.

        Use WTF::Function instead of std::function in more places in WebCore/ to avoid copying.

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::matchedParent):
        * accessibility/AccessibilityObject.h:
        * animation/DocumentAnimation.cpp:
        (WebCore::DocumentAnimation::getAnimations):
        * animation/DocumentAnimation.h:
        (WebCore::DocumentAnimation::getAnimations):
        * contentextensions/CombinedURLFilters.cpp:
        (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
        * contentextensions/CombinedURLFilters.h:
        * contentextensions/DFACombiner.cpp:
        (WebCore::ContentExtensions::DFACombiner::combineDFAs):
        * contentextensions/DFACombiner.h:
        * css/CSSCrossfadeValue.cpp:
        (WebCore::CSSCrossfadeValue::traverseSubresources):
        * css/CSSCrossfadeValue.h:
        * css/CSSFilterImageValue.cpp:
        (WebCore::CSSFilterImageValue::traverseSubresources):
        * css/CSSFilterImageValue.h:
        * css/CSSFontFaceSrcValue.cpp:
        (WebCore::CSSFontFaceSrcValue::traverseSubresources):
        * css/CSSFontFaceSrcValue.h:
        * css/CSSImageSetValue.cpp:
        (WebCore::CSSImageSetValue::traverseSubresources):
        * css/CSSImageSetValue.h:
        * css/CSSImageValue.cpp:
        (WebCore::CSSImageValue::traverseSubresources):
        * css/CSSImageValue.h:
        * css/CSSValue.cpp:
        (WebCore::CSSValue::traverseSubresources):
        * css/CSSValue.h:
        * css/CSSValueList.cpp:
        (WebCore::CSSValueList::traverseSubresources):
        * css/CSSValueList.h:
        * css/StyleProperties.cpp:
        (WebCore::StyleProperties::traverseSubresources):
        * css/StyleProperties.h:
        * css/StyleSheetContents.cpp:
        (WebCore::traverseSubresourcesInRules):
        (WebCore::StyleSheetContents::traverseSubresources):
        * css/StyleSheetContents.h:
        * dom/Element.cpp:
        (WebCore::Element::getAnimations):
        * editing/TextIterator.cpp:
        (WebCore::findPlainTextMatches):
        (WebCore::findClosestPlainText):
        (WebCore::findPlainText):
        * editing/mac/DictionaryLookup.h:
        * editing/mac/DictionaryLookup.mm:
        (WebCore::showPopupOrCreateAnimationController):
        (WebCore::DictionaryLookup::showPopup):
        (WebCore::DictionaryLookup::animationControllerForPopup):
        * fileapi/AsyncFileStream.cpp:
        (WebCore::AsyncFileStream::perform):
        (WebCore::AsyncFileStream::getSize):
        (WebCore::AsyncFileStream::openForRead):
        (WebCore::AsyncFileStream::read):
        * fileapi/AsyncFileStream.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::waitForPreparedForInlineThen):
        (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
        * html/HTMLMediaElement.h:
        (WebCore::HTMLMediaElement::waitForPreparedForInlineThen):
        (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
        * loader/EmptyClients.cpp:
        (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
        (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        (WebCore::EmptyFrameLoaderClient::dispatchWillSubmitForm):
        * loader/FrameLoaderClient.h:
        * loader/archive/cf/LegacyWebArchive.cpp:
        (WebCore::LegacyWebArchive::create):
        * loader/archive/cf/LegacyWebArchive.h:
        * loader/cache/MemoryCache.cpp:
        (WebCore::MemoryCache::forEachResource):
        (WebCore::MemoryCache::forEachSessionResource):
        * loader/cache/MemoryCache.h:
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::createWindow):
        (WebCore::DOMWindow::showModalDialog):
        * page/DOMWindow.h:
        * page/FrameView.cpp:
        (WebCore::FrameView::applyRecursivelyWithVisibleRect):
        * page/FrameView.h:
        * page/Page.cpp:
        (WebCore::Page::forEachPage):
        (WebCore::Page::decrementNestedRunLoopCount):
        (WebCore::Page::whenUnnested):
        * page/Page.h:
        * page/WheelEventTestTrigger.cpp:
        (WebCore::WheelEventTestTrigger::clearAllTestDeferrals):
        (WebCore::WheelEventTestTrigger::setTestCallbackAndStartNotificationTimer):
        (WebCore::WheelEventTestTrigger::triggerTestTimerFired):
        * page/WheelEventTestTrigger.h:
        * page/WindowFeatures.cpp:
        (WebCore::processFeaturesString):
        * page/WindowFeatures.h:
        * page/cocoa/ResourceUsageOverlayCocoa.mm:
        (WebCore::RingBuffer::forEach):
        * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
        (WebCore::WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
        (WebCore::WebVideoFullscreenModelVideoElement::waitForPreparedForInlineThen):
        * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
        (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
        (WebVideoFullscreenModelVideoElement::waitForPreparedForInlineThen):
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::setVideoFullscreenLayer):
        * platform/graphics/MediaPlayer.h:
        (WebCore::MediaPlayer::setVideoFullscreenLayer):
        * platform/graphics/MediaPlayerPrivate.h:
        (WebCore::MediaPlayerPrivateInterface::setVideoFullscreenLayer):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
        * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h:
        * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
        (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):

2017-06-19  Chris Dumez  <cdumez@apple.com>

        Use WTF::Function instead of std::function in WebCore/Modules
        https://bugs.webkit.org/show_bug.cgi?id=173534

        Reviewed by Alex Christensen.

        Use WTF::Function instead of std::function in WebCore/Modules to avoid
        copying.

        * Modules/applepay/PaymentCoordinatorClient.h:
        * Modules/encryptedmedia/CDM.h:
        * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
        (WebCore::CDMFactory::CDMFactory):
        (WebCore::CDM::registerCDMFactory):
        * Modules/encryptedmedia/legacy/LegacyCDM.h:
        * Modules/mediasession/MediaSession.cpp:
        (WebCore::MediaSession::changeActiveMediaElements):
        (WebCore::MediaSession::safelyIterateActiveMediaElements):
        * Modules/mediasession/MediaSession.h:
        * Modules/mediastream/MediaEndpointPeerConnection.cpp:
        (WebCore::matchTransceiver):
        * Modules/mediastream/MediaStreamRegistry.cpp:
        (WebCore::MediaStreamRegistry::forEach):
        * Modules/mediastream/MediaStreamRegistry.h:

2017-06-19  Youenn Fablet  <youenn@apple.com>

        A cloned MediaStreamTrack should mute independently other tracks using the same source
        https://bugs.webkit.org/show_bug.cgi?id=172831
        <rdar://problem/32518527>

        Reviewed by Eric Carlson.

        Test: webrtc/clone-audio-track.html

        Move enabled handling in MediaStreamTrackPrivate instead of RealtimeMediaSource.
        Move WebRTC and WebAudio customers of RealtimeMediaSource to MediaStreamTrackPrivate.
        Move creation of WebAudio provider to MediaStreamTrackPrivate.

        This allows changing some parameters of tracks having the same source independently.
        Using this for enabled track attribute.

        We no longer stop generating frames in case track is disabled.
        This should be added back as an optimization in a follow-up.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::addTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
        * Modules/webaudio/MediaStreamAudioSource.cpp:
        * Modules/webaudio/MediaStreamAudioSource.h:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/MediaStreamTrackPrivate.cpp:
        (WebCore::MediaStreamTrackPrivate::create):
        (WebCore::MediaStreamTrackPrivate::~MediaStreamTrackPrivate):
        (WebCore::MediaStreamTrackPrivate::setEnabled):
        (WebCore::MediaStreamTrackPrivate::audioSourceProvider):
        (WebCore::MediaStreamTrackPrivate::videoSampleAvailable):
        (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
        * platform/mediastream/MediaStreamTrackPrivate.h:
        (WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::removeObserver):
        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/mac/AVMediaCaptureSource.h:
        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::startProducingData):
        (WebCore::CoreAudioCaptureSource::stopProducingData):
        * platform/mediastream/mac/CoreAudioCaptureSource.h:
        * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
        * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
        (WebCore::MockRealtimeAudioSourceMac::render):
        * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
        (WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
        (WebCore::RealtimeIncomingAudioSource::OnData):
        * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
        * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
        (WebCore::RealtimeIncomingVideoSource::pixelBufferFromVideoFrame):
        * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
        (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
        (WebCore::RealtimeOutgoingAudioSource::setSource):
        * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
        (WebCore::RealtimeOutgoingVideoSource::setSource):
        (WebCore::RealtimeOutgoingVideoSource::initializeFromSource):
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
        * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
        * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
        (WebCore::WebAudioSourceProviderAVFObjC::create):
        (WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC):
        (WebCore::WebAudioSourceProviderAVFObjC::setClient):
        (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::generateFrame):
        * platform/spi/cocoa/PassKitSPI.h:

2017-06-19  Sam Weinig  <sam@webkit.org>

        [WebIDL] Properly model buffer source / typed arrays as their own IDL types
        https://bugs.webkit.org/show_bug.cgi?id=173513

        Reviewed by Alex Christensen.

        - Adds IDL type hierarchy for buffer source types.
        - Includes a special type, IDLArrayBufferView, which WebIDL defines as the union
          of DataView and all the typed array types, but we model as shared base class.
          This should not be observable, and allows us to avoid using a Variant for ArrayBufferView
          and instead use the existing base class.
        - Add builtin typedefs for BufferSource and DOMTimeStamp as defined in WebIDL. As noted
          above, rather than define a typedef of ArrayBufferView that maps to a union, we treat
          it as a special type.

        * bindings/IDLTypes.h:
        Add type hierarchy for buffer source types.
        - IDLBufferSource is the root
        - IDLArrayBuffer, IDLArrayBufferView, IDLDataView, IDLTypedArray derive from it.
        - And then the specific typed array types derive from IDLTypedArray, and are defined
          in JSDOMConvertBufferSource so we don't have to include a ton of typed array includes
          in this file, as they cannot be forward declared.

        * bindings/js/JSDOMConvertBufferSource.h:
        (WebCore::Detail::BufferSourceConverter::convert):
        (WebCore::Converter<IDLArrayBuffer>::convert):
        (WebCore::JSConverter<IDLArrayBuffer>::convert):
        (WebCore::Converter<IDLDataView>::convert):
        (WebCore::JSConverter<IDLDataView>::convert):
        (WebCore::Converter<IDLInt8Array>::convert):
        (WebCore::JSConverter<IDLInt8Array>::convert):
        (WebCore::Converter<IDLInt16Array>::convert):
        (WebCore::JSConverter<IDLInt16Array>::convert):
        (WebCore::Converter<IDLInt32Array>::convert):
        (WebCore::JSConverter<IDLInt32Array>::convert):
        (WebCore::Converter<IDLUint8Array>::convert):
        (WebCore::JSConverter<IDLUint8Array>::convert):
        (WebCore::Converter<IDLUint16Array>::convert):
        (WebCore::JSConverter<IDLUint16Array>::convert):
        (WebCore::Converter<IDLUint32Array>::convert):
        (WebCore::JSConverter<IDLUint32Array>::convert):
        (WebCore::Converter<IDLUint8ClampedArray>::convert):
        (WebCore::JSConverter<IDLUint8ClampedArray>::convert):
        (WebCore::Converter<IDLFloat32Array>::convert):
        (WebCore::JSConverter<IDLFloat32Array>::convert):
        (WebCore::Converter<IDLFloat64Array>::convert):
        (WebCore::JSConverter<IDLFloat64Array>::convert):
        (WebCore::Converter<IDLArrayBufferView>::convert):
        (WebCore::JSConverter<IDLArrayBufferView>::convert):
        Add native and javascript conversion for all the new types.

        * bindings/js/JSDOMConvertUnion.h:
        Add support for steps 7, 8, and 9 of the union conversion algorithm now that
        buffer source types are properly modeled.

        * bindings/js/JSSubtleCryptoCustom.cpp:
        * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
        Replace use of now repurposed IDLBufferSource, with its definition, IDLUnion<IDLArrayBufferView, IDLArrayBuffer>.

        * bindings/scripts/CodeGenerator.pm:
        (IsBufferSourceType):
        Renamed from IsTypedArrayType.

        (IsNonPointerType): Deleted.
        Was only used by DumpRenderTree and WebKitTestRunner generators. They have 
        been switched to the equivalent IsPrimitiveType.

        (IsTypedArrayType): Deleted.
        Renamed to IsBufferSourceType.

        (IsRefPtrType): Deleted. Unused.

        * bindings/scripts/CodeGeneratorJS.pm:
        (AddToIncludesForIDLType):
        (AddClassForwardIfNeeded):
        (GetArgumentExceptionFunction):
        (GetAttributeExceptionFunction):
        (PassArgumentExpression):
        (GenerateDefaultValue):
        (GenerateOverloadDispatcher):
        (ShouldPassArgumentByReference):
        (NativeToJSValueDOMConvertNeedsState):
        (NativeToJSValueDOMConvertNeedsGlobalObject):
        Update for rename of IsTypedArrayType -> IsBufferSourceType and remove specialized BufferSource
        condition.

        (GetBaseIDLType):
        Add mappings for new buffer source types.

        * bindings/scripts/IDLParser.pm:
        (Parse):
        Insert builtin typedefs to the typedef map before parsing.

        (addBuiltinTypedefs):
        Generate typedefs for BufferSource and DOMTimeStamp as specified by WebIDL.

        (applyTypedefs):
        Add support for applying typedefs to iterable and maplike, necessary now because BufferSource
        is used as the key to iterable in MediaKeyStatusMap.idl

        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.h:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
        * bindings/scripts/test/JS/JSTestVoidCallbackFunction.h:
        Update test results.

        * bindings/scripts/test/TestTypedefs.idl:
        Add tests for builtin typedefs.

        * Modules/geolocation/Geoposition.idl:
        * dom/Event.idl:
        * fileapi/Blob.idl:
        * fileapi/File.idl:
        * page/FrameView.h:
        * xml/XMLHttpRequest.idl:
        Remove typedef for DOMTimeStamp and BufferSource which are now automatically included.

2017-06-19  Adrian Perez de Castro  <aperez@igalia.com>

        Missing <functional> includes make builds fail with GCC 7.x
        https://bugs.webkit.org/show_bug.cgi?id=173544

        Unreviewed gardening.

        Fix compilation with GCC 7.

        * Modules/mediastream/MediaStreamRegistry.h:
        * animation/DocumentAnimation.h:
        * page/WheelEventTestTrigger.h:
        * page/csp/ContentSecurityPolicy.h:
        * platform/Timer.h:
        * platform/graphics/gstreamer/MainThreadNotifier.h:
        * platform/network/NetworkStorageSession.h:

2017-06-19  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed build fix after r218484.

        Properly access the GCryptCipherOperation type (now CipherOperation)
        in the PAL::GCrypt namespace. This somehow worked in local builds.

        * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
        (WebCore::callOperation):
        (WebCore::gcryptAES_CTR):

2017-06-19  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] AES_CTR support
        https://bugs.webkit.org/show_bug.cgi?id=171420

        Reviewed by Michael Catanzaro.

        Implement AES_CTR support for build configurations that use libgcrypt.

        Both encryption and decryption operations are handled in a single gcryptAES_CTR() function,
        with the specific operation being passed as the first argument. The appropriate AES
        algorithm is picked, and a gcry_cipher_hd_t object is created and has the given key set.
        This key will remain the same throughout the gcry_cipher_hd_t lifetime, even after
        gcry_cipher_reset() calls.

        The encrypt/decrypt operation is wrapped into a helper lambda functor that accepts the
        given counter and input data. It resets the cipher object, sets the counter data, and
        performs the specified operation, returning the output data.

        libgcrypt doesn't support setting counter data on a gcry_cipher_hd_t object with only
        part of that data being used as the actual counter, with the rest acting as a nonce, like
        the Web Crypto specification allows. We have to implement the support for that on our own.

        We compute the number of blocks we'll be processing and the upper exclusive limit for the
        given counter length. We immediately bail if the counter limit is less than the computed
        block count, since that would mean that the counter values would be repeated.

        We short-cut to a direct operation call if the counter length matches size of the counter
        data -- we don't have to adjust the counter data in any way if that's the case.

        Otherwise we move counter data into the MPI format. The nonce and the actual counter MPIs
        can split out of the counter data MPI with the modulus operation and the counter limit MPI.

        We take another shortcut straight to the operation call if we're able to determine that the
        'counter leeway' value, i.e. the difference between the initial counter MPI and the counter
        limit MPI, is larger or equal to the predicted block size -- if that's the case, the counter
        won't wrap around and change the nonce data.

        In worst-case scenario the counter data will wrap around and we have to address that. The
        current implementation takes the slowest possible path for the moment, encrypting/decrypting
        each block separately. For each step the counter is combined with the nonce, the resulting
        MPI data retrieved and passed to the operation function, and the returned block output
        appended to the final output vector. The counter MPI is then incremented and ran through the
        modulus operation, limiting the MPI value to the previously-computed counter limit.

        No new tests -- relevant tests are passing and are unskipped.

        * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
        (WebCore::callOperation):
        (WebCore::gcryptAES_CTR):
        (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):

2017-05-14 Frederic Wang  <fwang@igalia.com>

        Add heuristic to avoid flattening "fullscreen" iframes
        https://bugs.webkit.org/show_bug.cgi?id=171914

        Reviewed by Simon Fraser.

        Some authors implement fullscreen popups as out-of-flow iframes with size set to full viewport (using vw/vh CSS units).
        When iframe flattening is enabled, such iframes may unexpectedly become larger than the viewport.
        This commit adds a simple heuristic to avoid frame flattening in that case.
        It is experimented by introducing a "enable for non-fullscreen iframes" state for the frame
        flattening setting.
        The default frame flattening is still either disabled or (fully) enabled on all platforms.
        InternalSettings is also adjusted so that the tests can still set the frame flattening setting.

        Test: fast/frames/flattening/iframe-flattening-fullscreen.html

        * page/FrameView.cpp:
        (WebCore::FrameView::frameFlatteningEnabled): Use the frame flattening enum setting.
        * page/Settings.h: Define a frame flattening enum that includes a "enable for non-fullscreen
        iframes" state.
        * page/Settings.in: Redefine frame flattening using that enum.
        * rendering/RenderFrameSet.cpp:
        (WebCore::RenderFrameSet::flattenFrameSet): Use the frame flattening enum setting.
        * rendering/RenderIFrame.cpp:
        (WebCore::RenderIFrame::isFullScreenIFrame): Add a heuristic when partial frame flattening
        is enabled setting is enabled.
        There is not a strict comparison against the viewport size since authors may not exactly use
        100vw/100vh.
        Anyway, it is hard to do such comparison using the resolved width & height on RenderStyle.
        (WebCore::RenderIFrame::flattenFrame): Add a comment for the existing "zero size" heuristic.
        Use isFullScreenIFrame heuristic.
        * rendering/RenderView.cpp:
        (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): Use the frame flattening enum setting.
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::Backup::Backup): Add backup for frame flattening.
        (WebCore::InternalSettings::Backup::restoreTo): Ditto.
        (WebCore::internalSettingsToWebCoreValue): Helper function to cast the frame flattening values.
        (WebCore::InternalSettings::setFrameFlattening): Redefine setFrameFlattening to accept an enum.
        * testing/InternalSettings.h: Define new enum & setter for frame flattening as well as a backup value.
        * testing/InternalSettings.idl: Define new enum & setter for frame flattening.

2017-06-18  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r218253): Infinite animated gifs no longer loop
        https://bugs.webkit.org/show_bug.cgi?id=173464

        Reviewed by Carlos Alberto Lopez Perez.

        After the first loop iteration we keep rendering the same frame all the time, so it looks like if the animation
        stopped. This is because in r218253 we changed to use SharedBuffer instead of a Vector in ImageBackingStore, but
        we are not correctly copying the data in the copy constructor. We are using SharedBuffer::copy() that doesn't
        actually copy the data of the segments.

        * platform/graphics/ImageBackingStore.h:
        (WebCore::ImageBackingStore::ImageBackingStore): Copy the data of the other SharedBuffer.

2017-06-18  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GStreamer] MainThreadNotifier ASSERTION FAILED: m_boundThread == currentThread() in _WebKitWebSrcPrivate::~_WebKitWebSrcPrivate
        https://bugs.webkit.org/show_bug.cgi?id=152043

        Reviewed by Xabier Rodriguez-Calvar.

        Stop using a WeakPtr in MainThreadNotifier, because it's not thread safe, which causes a crash in debug builds when
        the notifier is destroyed in a different thread. Make MainThreadNotifier thread safe refcounted instead, and add
        an invalidate() method to mark it as invalid.

        * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
        (WebCore::InbandTextTrackPrivateGStreamer::handleSample):
        (WebCore::InbandTextTrackPrivateGStreamer::streamChanged):
        * platform/graphics/gstreamer/MainThreadNotifier.h:
        (WebCore::MainThreadNotifier::MainThreadNotifier): Deleted.
        (WebCore::MainThreadNotifier::notify): Deleted.
        (WebCore::MainThreadNotifier::cancelPendingNotifications): Deleted.
        (WebCore::MainThreadNotifier::addPendingNotification): Deleted.
        (WebCore::MainThreadNotifier::removePendingNotification): Deleted.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback):
        (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback):
        (WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback):
        (WebCore::MediaPlayerPrivateGStreamer::textChangedCallback):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
        (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
        (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
        (WebCore::MediaPlayerPrivateGStreamerBase::muteChangedCallback):
        (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
        (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer):
        (WebCore::TrackPrivateBaseGStreamer::~TrackPrivateBaseGStreamer):
        (WebCore::TrackPrivateBaseGStreamer::disconnect):
        (WebCore::TrackPrivateBaseGStreamer::activeChangedCallback):
        (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
        * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (webkit_web_src_init):
        (webKitWebSrcDispose):
        (webKitWebSrcStop):
        (webKitWebSrcStart):
        (webKitWebSrcNeedData):
        (webKitWebSrcEnoughData):
        (webKitWebSrcSeek):

2017-06-18  Ryosuke Niwa  <rniwa@webkit.org>

        Meter element doesn't respect the writing direction
        https://bugs.webkit.org/show_bug.cgi?id=173507

        Reviewed by Sam Weinig.

        The bug was caused by NSLevelIndicatorCell no longer using the value of baseWritingDirection
        to determine the direction of rendering in macOS Sierra and later. It instead relies on
        the value of userInterfaceLayoutDirection.

        Fixed the bug by setting both values. Once we dropped the support for macOS El Capitan
        and earlier, we can remove the code to set baseWritingDirection.

        Test: fast/dom/HTMLMeterElement/meter-rtl.html

        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::levelIndicatorFor):

2017-06-18  Dewei Zhu  <dewei_zhu@apple.com>

        Remove 'EditCommand::isEditCommandComposition'.
        https://bugs.webkit.org/show_bug.cgi?id=173525

        Reviewed by Wenson Hsieh.

        Should remove 'isEditCommandComposition' from 'EditCommand' for:
            1. 'EditCommandComposition' is no longer a subclass of EditCommand.
            2. 'isEditCommandComposition' is not used at all.

        * editing/EditCommand.h:
        (WebCore::EditCommand::isCompositeEditCommand):
        (WebCore::EditCommand::isEditCommandComposition): Deleted.

2017-06-18  Chris Dumez  <cdumez@apple.com>

        Crash when re-entering MediaDevicesEnumerationRequest::cancel()
        https://bugs.webkit.org/show_bug.cgi?id=173522
        <rdar://problem/31185739>

        Reviewed by Darin Adler.

        When a MediaDevicesRequest is started, it creates a MediaDevicesEnumerationRequest
        object and passes a completion handler to that MediaDevicesEnumerationRequest
        object. The completion handler holds a reference to the MediaDevicesRequest object
        so that its stays alive until the MediaDevicesEnumerationRequest either completes
        or is canceled. MediaDevicesRequest also holds a reference to the
        MediaDevicesEnumerationRequest object via its m_enumerationRequest data member.

        When the document is destroyed, both MediaDevicesRequest::contextDestroyed() and
        MediaDevicesEnumerationRequest::contextDestroyed() gets called and the other is not
        pre-determined. If MediaDevicesEnumerationRequest::contextDestroyed() gets called
        first then it calls MediaDevicesEnumerationRequest::cancel(). Calling cancel() ends
        up destroying the completion handler. Destroying the completion handler ends up
        dereferencing and destroying the MediaDevicesRequest object. The MediaDevicesRequest
        destructor would call MediaDevicesEnumerationRequest::cancel() again, causing us to
        re-enter it and assign nullptr to the completion callback again. Re-entering
        std::function's operator=(nullptr_t) is not safe because of the way it is implemented
        as we end up trying to destroy the lambda twice and crashing. Using a WTF::Function
        instead fixes this particular issue because re-entering WTF::Function's operator=(nullptr_t)
        is safe.

        However, this fix is not sufficient. Calling the MediaDevicesRequest destructor also
        dereferencing and destroys the MediaDevicesEnumerationRequest object. As a result,
        when MediaDevicesEnumerationRequest::contextDestroyed() returns from its call to cancel
        |this| is already dead when we call ContextDestructionObserver::contextDestroyed().
        To address this issue, we now protect |this| in MediaDevicesEnumerationRequest::contextDestroyed().

        Test: fast/mediastream/destroy-document-while-enumerating-devices.html

        * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
        (WebCore::MediaDevicesEnumerationRequest::contextDestroyed):
        Protect |this| as the call to cancel() may destroy |this| before calling
        ContextDestructionObserver::contextDestroyed() otherwise.

        * Modules/mediastream/MediaDevicesEnumerationRequest.h:
        Use WTF::Function instead of std::function for the completion handler as
        it is safer (in terms of re-entrency) and avoids unnecessary copying.

        * Modules/mediastream/MediaDevicesRequest.cpp:
        (WebCore::MediaDevicesRequest::~MediaDevicesRequest):
        Stop calling MediaDevicesEnumerationRequest::cancel(). When the destructor
        is called, the MediaDevicesEnumerationRequest has either completed or been
        canceled so there is no need to cancel again. I added an assertion to
        make sure it is the case. This avoids re-entering
        MediaDevicesEnumerationRequest::cancel() is some cases, which was risky.

        (WebCore::MediaDevicesRequest::start):
        Add comment for clarity and capture a Ref<> instead of a RefPtr<> now that
        we can since we use WTF::Function.

2017-06-18  Chris Dumez  <cdumez@apple.com>

        Use WTF::Function instead of std::function in WTF/
        https://bugs.webkit.org/show_bug.cgi?id=173519

        Reviewed by Sam Weinig.

        Replace a few uses of std::function with WTF::Function in WebCore/
        as well. It was either this or including <functional> and I decided
        it made more sense to port the code.

        * platform/graphics/FontSelectionAlgorithm.h:
        (WebCore::FontSelectionAlgorithm::iterateActiveCapabilitiesWithReturn):
        * platform/mediastream/MediaConstraints.cpp:
        (WebCore::StringConstraint::find):
        (WebCore::MediaTrackConstraintSetMap::forEach):
        (WebCore::MediaTrackConstraintSetMap::filter):
        (WebCore::MediaConstraints::isConstraintSet):
        * platform/mediastream/MediaConstraints.h:
        (WebCore::NumericConstraint::find):
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::applyConstraint):

2017-06-18  Jer Noble  <jer.noble@apple.com>

        [MSE] Seeking or entering fullscreen can cause extreme CPU usage
        https://bugs.webkit.org/show_bug.cgi?id=173505

        Reviewed by Tim Horton.

        When support for painting MSE to WebGL was added in r217185, the implementation of
        SourceBufferPrivateAVFObjC::isReadyForMoreSamples() was modified to support asking
        the decompression session if it was ready. That change, however, caused an extreme
        performance regression in the normal playback path, where WebKit will effectively
        append samples endlessly to the AVSampleBufferDisplayLayer, which admirably enqueued
        each of them for decoding. Eventually, the cost of iterating over the CMBufferQueue
        overwhelmed the cost of decoding, and caused the extreme lag seen when seeking.

        Make sure to property query the AVSampleBufferDisplayLayer for isReadyForMoreMediaData
        before enqueuing.

        A previous version of this patch exposed some errors which caused failing tests:

        In sourceBufferPrivateDidReceiveSample(), we were using local versions of
        presentationTimestamp and decodeTimestamp as keys to the decodeQueue; those local versions
        were floating point values (because MediaTime + float = float), but the sample itself uses
        non-floating point MediaTimes. This causes samples to be left in the queue when they should
        be removed.

        In didBecomeReadyForMoreSamples(), we were getting spurious assertions when a
        AVSampleBufferDisplayLayer or a AVSampleBufferAudioRenderer would fire a callback from
        -requestMediaDataWhenReadyOnQueue:usingBlock: even after it had been told to
        -stopRequestingMediaData. Apparently it's expected behavior and so an ASSERT_NOT_REACHED is
        inappropriate here.

        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):
        (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):


2017-06-17  Zalan Bujtas  <zalan@apple.com>

        Addressing post-review comment after r218456.
        https://bugs.webkit.org/show_bug.cgi?id=173509

        Reviewed by Darin Adler.

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

2017-06-17  Chris Dumez  <cdumez@apple.com>

        DOMQuad::getBounds() should return a Ref<>
        https://bugs.webkit.org/show_bug.cgi?id=173517

        Reviewed by Simon Fraser.

        DOMQuad::getBounds() should return a Ref<> as it cannot return
        null.

        * dom/DOMQuad.cpp:
        (WebCore::DOMQuad::getBounds):
        * dom/DOMQuad.h:

2017-06-17  Simon Fraser  <simon.fraser@apple.com>

        Implement DOMQuad
        https://bugs.webkit.org/show_bug.cgi?id=163534

        Reviewed by Sam Weinig.

        Implement DOMQuad per https://drafts.fxtf.org/geometry/#DOMQuad, other than serialization
        which requires some bindings changes.

        web-platform-tests/css/geometry-1/DOMRect-001.html tests against an older version of the spec,
        so has some failures. DOMQuad-002.html passes, other than a NaN propagation issue that requires
        spec clarification.

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMQuadCustom.cpp: Added.
        (WebCore::JSDOMQuad::getBounds):
        * bindings/scripts/CodeGenerator.pm:
        (IsSerializableDOMType):
        (IsSerializableAttribute):
        * dom/DOMPoint.h:
        * dom/DOMQuad.cpp: Added.
        (WebCore::DOMQuad::DOMQuad):
        (WebCore::DOMQuad::getBounds):
        * dom/DOMQuad.h: Added.
        (WebCore::DOMQuad::create):
        (WebCore::DOMQuad::fromRect):
        (WebCore::DOMQuad::fromQuad):
        (WebCore::DOMQuad::p1):
        (WebCore::DOMQuad::p2):
        (WebCore::DOMQuad::p3):
        (WebCore::DOMQuad::p4):
        * dom/DOMQuad.idl: Added.
        * dom/DOMQuadInit.h: Added.
        * dom/DOMQuadInit.idl: Added.

2017-06-17  Chris Dumez  <cdumez@apple.com>

        Use WTF::Function instead of std::function in WebKit2/
        https://bugs.webkit.org/show_bug.cgi?id=173504

        Reviewed by Darin Adler.

        Use WTF::Function instead of std::function in WebKit2/ to avoid
        unnecessary copying.

        * Modules/applepay/PaymentCoordinator.cpp:
        (WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
        (WebCore::PaymentCoordinator::openPaymentSetup):
        * Modules/applepay/PaymentCoordinator.h:
        * Modules/applepay/PaymentCoordinatorClient.h:
        * loader/EmptyClients.cpp:
        * loader/NetscapePlugInStreamLoader.cpp:
        (WebCore::NetscapePlugInStreamLoader::willSendRequest):
        * loader/NetscapePlugInStreamLoader.h:
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::willSendRequest):
        * loader/ResourceLoader.h:

2017-06-17  Zalan Bujtas  <zalan@apple.com>

        Demote the "we have navigated away" check to an assertion.
        https://bugs.webkit.org/show_bug.cgi?id=173509

        Reviewed by Simon Fraser.

        Now that the expected behavior is that the render tree can't get to the page cache, it's ok to assert.
        TODO: We should also have view() check removed at some point.

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

2017-06-17  Alex Christensen  <achristensen@webkit.org>

        Fix CMake build

        * PlatformMac.cmake:
        * bindings/js/ScriptGlobalObject.cpp:

2017-06-17  Commit Queue  <commit-queue@webkit.org>

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

        Caused imported/w3c/web-platform-tests/media-
        source/mediasource* tests to fail (Requested by smfr on
        #webkit).

        Reverted changeset:

        "[MSE] Seeking or entering fullscreen can cause extreme CPU
        usage"
        https://bugs.webkit.org/show_bug.cgi?id=173505
        http://trac.webkit.org/changeset/218438

2017-06-17  Antti Koivisto  <antti@apple.com>

        Crash due to infinite recursion via FrameSelection::updateAppearanceAfterLayout
        https://bugs.webkit.org/show_bug.cgi?id=173468

        Reviewed by Ryosuke Niwa.

        Test: editing/selection/updateAppearanceAfterLayout-recursion.html

        Calling FrameSelection::updateAppearanceAfterLayout() from Document::resolveStyle is unsafe
        because it may cause another call to resolveStyle. We have some cases where the style
        is still unclean when updateAppearanceAfterLayout() is called. This can lead to infinite
        recursion.

        The test case is not the common stack seen in CrashTracer (couldn't quit replicate it) but
        the updateAppearanceAfterLayout/resolveStyle recursion is the same.

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

            Normally selection appearance update is done in post-layout but not all style resolutions schedule a layout.
            Invoke it asynchronously in that case instead of the previous synchronous call.

        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::FrameSelection):
        (WebCore::FrameSelection::updateAppearanceAfterLayout):
        (WebCore::FrameSelection::scheduleAppearanceUpdateAfterStyleChange):
        (WebCore::FrameSelection::appearanceUpdateTimerFired):
        (WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange):
        * editing/FrameSelection.h:

2017-06-17  Alex Christensen  <achristensen@webkit.org>

        Fix Mac CMake build.

        * PlatformMac.cmake:

2017-06-17  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r209495): materiauxlaverdure.com fails to load
        https://bugs.webkit.org/show_bug.cgi?id=173301
        <rdar://problem/32624850>

        Reviewed by Antti Koivisto.

        The bug was caused by WebKit wrapping CSS string values with single quotation marks instead of
        double quotation marks as spec'ed in https://drafts.csswg.org/cssom/#serialize-a-string and
        implemented in Firefox and Chrome.

        The website eval's the computed value of the `content` CSS property with the value `'{name: "flat"}'`
        after stripping single quotation marks from both ends. Prior to r209495, WebKit serialized this CSS value
        in single quotations without escaping double quotations. After r209495, double quotations are escaped
        with backslashes as `'{name: \"flat\"}'`. As a result, `eval` is invoked with `{name: \"flat\"}`
        after stripping single quotations from both ends, which resulted in an exception.

        Chrome and Firefox don't encounter this exception despite of the fact they escape double quotations
        as well because serialize with double quotations as `"{name: \"flat\"}"`. Because there is no code
        to strip double quotations, eval is invoked with the same string, resulting in the entire value as
        being parsed as string, instead of an object with a single key "name" with the value of "flat" as
        was the case in WebKit prior to r209495. While this behavior was most certainly not the intent of
        the website author, Chrome and Firefox don't encounter an exception and the website continues to work.

        This patch aligns WebKit's behavior to that of the CSS OM specification, Firefox, and Chrome by
        serializing CSS string values using double quotation marks instead of single quotation marks.

        Note: inline change log comments are added below for every call site of serializeString for clarity.

        Test: fast/css/getPropertyValue-serialization-with-double-quotes.html

        * css/CSSBasicShapes.cpp:
        (WebCore::buildPathString): Use double quotation marks in path(~) of shapes.
        * css/CSSMarkup.cpp:
        (WebCore::serializeString):
        (WebCore::serializeURL): Use double quotation marks to serialize URLs.
        (WebCore::serializeAsStringOrCustomIdent): Use double quotation marks to serialize strings. We still avoid
        using wrapping the value with double quotations when the value can be an identifier. See r209495.
        (WebCore::serializeFontFamily): Ditto for font-family names such as "San Francisco".
        * css/CSSMarkup.h:
        * css/CSSNamespaceRule.cpp:
        (WebCore::CSSNamespaceRule::cssText): Use double quotation marks to serialize namespace URIs.
        * css/CSSPrimitiveValue.cpp:
        (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Use double quotation marks to serialize
        the separators; e.g. counter(sectionNumber, ".") to produce "1.".
        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::selectorText): Use double quotation marks to serialize attribute values.
        * css/parser/CSSParserToken.cpp:
        (WebCore::CSSParserToken::serialize): Use double quotation marks to serialize strings in @support.
        * editing/EditingStyle.cpp:
        (WebCore::StyleChange::extractTextStyles): Updated to strip double quotation marks in font family names to
        maintain the compatibility with old versions of Microsoft Outlook.
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::mapLanguageAttributeToLocale): Use double quotations marks to serialize the value
        of the lang content attribute. It doesn't matter which one is used here because it's only a temporary value
        only fed into the CSS parser to set the equivalent CSS value from the content attribute.

2017-06-16  Matt Baker  <mattbaker@apple.com>

        Web Inspector: Instrument 2D/WebGL canvas contexts in the backend
        https://bugs.webkit.org/show_bug.cgi?id=172623
        <rdar://problem/32415986>

        Reviewed by Devin Rousso and Joseph Pecoraro.

        Test: inspector/canvas/create-canvas-contexts.html

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

        * dom/Document.cpp:
        (WebCore::Document::getCSSCanvasElement):
        Instrument creation of CSS canvases. This merely registers the canvas
        element with InspectorCanvasAgent and stores the name (identifier passed
        to getCSSCanvasContext) for later use. It isn't until the context is
        actually created that the frontend receives a notification.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::getContext2d):
        (WebCore::HTMLCanvasElement::getContextWebGL):
        Instrument creation of 2D and WebGL canvas contexts.

        * inspector/InspectorAllInOne.cpp:

        * inspector/InspectorCanvasAgent.cpp: Added.
        New backend agent for canvas inspection. Canvas creation and destruction
        are continuously monitored by the agent, regardless of the presence of
        a frontend. This is necessary since there is no way to retrieve the
        rendering contexts for with a given frame once they've been created.

        (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
        (WebCore::InspectorCanvasAgent::didCreateFrontendAndBackend):
        (WebCore::InspectorCanvasAgent::willDestroyFrontendAndBackend):
        (WebCore::InspectorCanvasAgent::discardAgent):
        Unregister canvas observers to prevent dangling agent pointer.
        (WebCore::InspectorCanvasAgent::enable):
        Dispatch events for existing canvases, now that the frontend exists.
        (WebCore::InspectorCanvasAgent::disable):
        (WebCore::InspectorCanvasAgent::frameNavigated):
        (WebCore::InspectorCanvasAgent::didCreateCSSCanvas):
        Register the name/identifier associated with the CSS canvas, so that it
        can be retrieved and associated with the rendering context later.

        (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
        (WebCore::InspectorCanvasAgent::canvasDestroyed):
        Removes the canvas from the agent, and queues it for notifying the
        frontend during the next event loop.

        (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
        (WebCore::InspectorCanvasAgent::clearCanvasData):
        (WebCore::InspectorCanvasAgent::getCanvasEntry):
        (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
        * inspector/InspectorCanvasAgent.h: Added.

        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::InspectorController):

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didCommitLoadImpl):
        (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
        (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):

        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didCreateCSSCanvas):
        (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
        These instrumentation points should not fast return when no frontend
        is attached.

        * inspector/InstrumentingAgents.cpp:
        (WebCore::InstrumentingAgents::reset):

        * inspector/InstrumentingAgents.h:
        (WebCore::InstrumentingAgents::inspectorCanvasAgent):
        (WebCore::InstrumentingAgents::setInspectorCanvasAgent):
        Plumbing for the new agent.

2017-06-16  Antoine Quint  <graouts@apple.com>

        Add a WebKit2 setting to control whether media documents should automatically enter fullscreen
        https://bugs.webkit.org/show_bug.cgi?id=173503

        Reviewed by Tim Horton.

        New WebCore setting to specify whether a media document should automatically enter fullscreen.

        * page/Settings.in:

2017-06-16  Jer Noble  <jer.noble@apple.com>

        [MSE] Seeking or entering fullscreen can cause extreme CPU usage
        https://bugs.webkit.org/show_bug.cgi?id=173505

        Reviewed by Tim Horton.

        When support for painting MSE to WebGL was added in r217185, the implementation of
        SourceBufferPrivateAVFObjC::isReadyForMoreSamples() was modified to support asking
        the decompression session if it was ready. That change, however, caused an extreme
        performance regression in the normal playback path, where WebKit will effectively
        append samples endlessly to the AVSampleBufferDisplayLayer, which admirably enqueued
        each of them for decoding. Eventually, the cost of iterating over the CMBufferQueue
        overwhelmed the cost of decoding, and caused the extreme lag seen when seeking.

        Make sure to property query the AVSampleBufferDisplayLayer for isReadyForMoreMediaData
        before enqueuing.

        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples):

2017-06-16  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove custom bindings for HTMLDocument
        https://bugs.webkit.org/show_bug.cgi?id=173444

        Reviewed by Darin Adler.

        * bindings/js/JSDOMBindingSecurity.cpp:
        (WebCore::canAccessDocument):
        (WebCore::BindingSecurity::shouldAllowAccessToFrame):
        (WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::showModalDialog):
        Pass ExecState by reference to window accessors.

        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::incumbentDOMWindow):
        (WebCore::activeDOMWindow):
        (WebCore::firstDOMWindow):
        (WebCore::callerDocument):
        * bindings/js/JSDOMWindowBase.h:
        Pass ExecState by reference to window accessors and add callerDocument.
    
        * bindings/js/JSHTMLDocumentCustom.cpp:
        (WebCore::JSHTMLDocument::getOwnPropertySlot): Deleted.
        (WebCore::JSHTMLDocument::all): Deleted.
        (WebCore::JSHTMLDocument::setAll): Deleted.
        (WebCore::findCallingDocument): Deleted.
        (WebCore::JSHTMLDocument::open): Deleted.
        (WebCore::documentWrite): Deleted.
        (WebCore::JSHTMLDocument::write): Deleted.
        Remove custom bindings.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateCallWith):
        Add support CallWith=CallerDocument

        * bindings/scripts/IDLAttributes.json:
        Remove CallerWindow, which has not been supported for a while. CallerDocument, despite 
        having it's support removed in the past, was still listed, so keep it.

        * bindings/scripts/test/JS/JSTestObj.cpp:
        Update test results.

        * dom/DOMImplementation.cpp:
        (WebCore::DOMImplementation::createHTMLDocument):
        Update for new signature of Document.write().

        * dom/Document.h:
        * dom/Document.idl:
        * dom/Document.cpp:
        (WebCore::Document::open):
        Add DOMWindow returning overload that calls through to the DOMWindow.
        Add return value and currently not utilized parameters to the Document returning overload.
        Update to return exceptions as specified.

        (WebCore::Document::close):
        Update to return exceptions as specified.

        (WebCore::Document::write):
        (WebCore::Document::writeln):
        Update to take a Vector<String> argument and the caller Document first
        as per convention and return exceptions as specified.

        (WebCore::Document::bgColor):
        (WebCore::Document::setBgColor):
        (WebCore::Document::fgColor):
        (WebCore::Document::setFgColor):
        (WebCore::Document::alinkColor):
        (WebCore::Document::setAlinkColor):
        (WebCore::Document::linkColorForBindings):
        (WebCore::Document::setLinkColorForBindings):
        (WebCore::Document::vlinkColor):
        (WebCore::Document::setVlinkColor):
        (WebCore::Document::clear):
        (WebCore::Document::captureEvents):
        (WebCore::Document::releaseEvents):
        Move from HTMLDocument.

        * html/HTMLDocument.cpp:
        (WebCore::HTMLDocument::bgColor): Deleted.
        (WebCore::HTMLDocument::setBgColor): Deleted.
        (WebCore::HTMLDocument::fgColor): Deleted.
        (WebCore::HTMLDocument::setFgColor): Deleted.
        (WebCore::HTMLDocument::alinkColor): Deleted.
        (WebCore::HTMLDocument::setAlinkColor): Deleted.
        (WebCore::HTMLDocument::linkColor): Deleted.
        (WebCore::HTMLDocument::setLinkColor): Deleted.
        (WebCore::HTMLDocument::vlinkColor): Deleted.
        (WebCore::HTMLDocument::setVlinkColor): Deleted.
        (WebCore::HTMLDocument::clear): Deleted.
        (WebCore::HTMLDocument::captureEvents): Deleted.
        (WebCore::HTMLDocument::releaseEvents): Deleted.
        * html/HTMLDocument.h:
        * html/HTMLDocument.idl:
        Moved operations and attributes to Document.

        * inspector/DOMPatchSupport.cpp:
        (WebCore::DOMPatchSupport::patchDocument):
        Update for new signature of Document.write().

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::postMessage):
        (WebCore::DOMWindow::focus):
        * page/DOMWindow.h:
        Use the term incumbentWindow, matching IDL, and so not to be confused
        with the callerWindow, which is slightly different.

2017-06-16  Daniel Bates  <dabates@apple.com>

        Remove header OptionSet.h from FrameLoaderTypes.h
        https://bugs.webkit.org/show_bug.cgi?id=173489

        Reviewed by Joseph Pecoraro.

        Although the header FrameLoaderTypes.h defines exactly one enum class, ReloadOption, whose
        enumerators conform the power of two prerequisite for parameterizing an OptionSet for it
        FrameLoaderTypes.h does not actually make use of the functionality provided by header
        OptionSet.h. And not all source files that include FrameLoaderTypes.h need to use an OptionSet.

        * loader/DocumentLoader.h: Include <wtf/OptionSet.h>.
        * loader/FrameLoader.h: Ditto.
        * loader/FrameLoaderTypes.h: Remove header <wtf/OptionSet.h>.
        * replay/UserInputBridge.h: Include <wtf/Forward.h>.

2017-06-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS DnD] Upstream iOS drag and drop implementation into OpenSource WebKit
        https://bugs.webkit.org/show_bug.cgi?id=173366
        <rdar://problem/32767014>

        Reviewed by Tim Horton.

        Moves all drag and drop logic previously hidden behind WebKitAdditions into the open source repository, along
        with unit test pages in TestWebKitAPI. Also removes all #includes and #imports of dragging-related files in
        WebKitAdditions from the open source repository.

        This initial upstreaming phase is only concerned with moving code out of WebKitAdditions, and attempts to
        preserve the code as-is, with the exception of trivial style changes so that the open source linter passes.
        Future patches will remove the DATA_INTERACTION feature flag altogether and unobscure all variable and function
        names referencing "data interaction".

        No change in behavior from the internal build.

        * Configurations/FeatureDefines.xcconfig:
        * page/ios/EventHandlerIOS.mm:
        (WebCore::EventHandler::createDraggingDataTransfer):
        (WebCore::EventHandler::eventLoopHandleMouseDragged):
        (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
        * platform/ios/DragImageIOS.mm:
        (WebCore::dragImageSize):
        (WebCore::scaleDragImage):
        (WebCore::createDragImageFromImage):
        (WebCore::deleteDragImage):
        (WebCore::createDragImageForLink):
        (WebCore::createDragImageIconForCachedImageFilename):
        (WebCore::platformAdjustDragImageForDeviceScaleFactor):
        (WebCore::createDragImageForSelection):
        (WebCore::dissolveDragImageToFraction):
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::Pasteboard):
        (WebCore::Pasteboard::setDragImage):
        (WebCore::Pasteboard::createForDragAndDrop):
        * platform/mac/DragDataMac.mm:
        (WebCore::rtfPasteboardType):
        (WebCore::rtfdPasteboardType):
        (WebCore::stringPasteboardType):
        (WebCore::urlPasteboardType):
        (WebCore::htmlPasteboardType):
        (WebCore::colorPasteboardType):
        (WebCore::pdfPasteboardType):
        (WebCore::tiffPasteboardType):
        (WebCore::DragData::asFilenames):
        (WebCore::DragData::containsURL):
        (rtfPasteboardType): Deleted.
        (rtfdPasteboardType): Deleted.
        (stringPasteboardType): Deleted.
        (urlPasteboardType): Deleted.
        (htmlPasteboardType): Deleted.
        (colorPasteboardType): Deleted.
        (pdfPasteboardType): Deleted.
        (tiffPasteboardType): Deleted.

2017-06-16  Youenn Fablet  <youenn@apple.com>

        addTransceiver should trigger mid generation in the SDP
        https://bugs.webkit.org/show_bug.cgi?id=173452

        Reviewed by Alex Christensen.

        Test: webrtc/video-addTransceiver.html

        Adding support for recvonly SDP based on call to addTransceiver.
        Using offer_to_receive options of libwebrtc for that purpose.

        Making sure that addTransceiver and using a real track afterwards is working too.

        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::enqueueReplaceTrackTask): notify the backend that a track is added in case the sender has no track.
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio): Detect whether some audio mid should be recvonly.
        (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo): Detect whether some video mid should be recvonly.
        (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

2017-06-16  Youenn Fablet  <youenn@apple.com>

        WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging is crashing
        https://bugs.webkit.org/show_bug.cgi?id=173493

        Reviewed by Eric Carlson.

        Speculative preventive fix.

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

2017-06-16  Alex Christensen  <achristensen@webkit.org>

        Show punycode to user if a URL has dotless i or j followed by diacritic dot
        https://bugs.webkit.org/show_bug.cgi?id=173431

        Reviewed by Darin Adler.

        Covered by new API tests.

        * platform/mac/WebCoreNSURLExtras.mm:
        (WebCore::isLookalikeCharacter):
        (WebCore::allCharactersInIDNScriptWhiteList):
        (WebCore::createStringWithEscapedUnsafeCharacters):

2017-06-16  Youenn Fablet  <youenn@apple.com>

        [iOS] Switching cameras in a WebRTC call makes black frames being sent
        https://bugs.webkit.org/show_bug.cgi?id=173486

        Reviewed by Eric Carlson.

        Test: webrtc/video-replace-muted-track.html

        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::updateBlackFramesSending):
        Ensuring the timer is stopped if needed.
        (WebCore::RealtimeOutgoingVideoSource::initializeFromSource):
        Calling updateBlackFramesSending to stop sending frame if needed.

2017-06-16  Youenn Fablet  <youenn@apple.com>

        Remove replaceTrack restriction about video resolution
        https://bugs.webkit.org/show_bug.cgi?id=173490

        Reviewed by Eric Carlson.

        Covered by updated tests.

        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::setSource):

2017-06-16  Jeremy Jones  <jeremyj@apple.com>

        Handle timeout of prepareForPictureInPictureStopWithCompletionHandler.
        https://bugs.webkit.org/show_bug.cgi?id=173462
        rdar://problem/32128170

        Reviewed by Jer Noble.

        No new tests because no effect on the DOM.

        If WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler doesn't respond fast enough,
        the caller will timeout and call will/didStopPictureInPicture.

        This is getting fullscreen state confused.

        This change keeps state consistent by handling will/didStopPictureInPicture possibly being called before
        prepareForPictureInPictureStopWithCompletionHandler calls its callback.

        * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture):
        (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture):
        (WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
        (WebVideoFullscreenInterfaceAVKit::watchdogTimerFired):

2017-06-16  Myles C. Maxfield  <mmaxfield@apple.com>

        Make builds faster after r218371
        https://bugs.webkit.org/show_bug.cgi?id=173453

        Reviewed by Tim Horton.

        Remove #includes from .h files.

        No new tests because there is no behavior change.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj: Add new .cpp file, and sort the project file
        * platform/graphics/FontFamilySpecificationNull.cpp: Copied from Source/WebCore/platform/graphics/FontFamilySpecificationNull.h.
        (WebCore::FontFamilySpecificationNull::fontRanges):
        * platform/graphics/FontFamilySpecificationNull.h:
        (WebCore::FontFamilySpecificationNull::fontRanges): Deleted.
        * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
        (WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText):
        (WebCore::FontFamilySpecificationCoreText::~FontFamilySpecificationCoreText):
        * platform/graphics/cocoa/FontFamilySpecificationCoreText.h:
        (WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText): Deleted.

2017-06-16  Chris Dumez  <cdumez@apple.com>

        [WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies
        https://bugs.webkit.org/show_bug.cgi?id=173472
        <rdar://problem/28858817>

        Reviewed by Brady Eidson.

        Add PluginLoadClientPolicyMaximum value to PluginLoadClientPolicy enumeration
        to facilitate input value validation on API side.

        * plugins/PluginData.h:

2017-06-16  Jer Noble  <jer.noble@apple.com>

        [iOS] Do not pause playing video when application resigns active state.
        https://bugs.webkit.org/show_bug.cgi?id=173474

        Reviewed by Tim Horton.

        Test: media/video-inactive-playback.html

        Separate out the concept of "inactive" playback from "process background" playback.
        Move the implementation of applicationDidEnterBackground() from MediaSessionManagerIOS
        into it's superclass, PlatformMediaSessionManager, and add a new set of restrictions
        for "InactiveProcessPlaybackRestricted" and "SuspendedUnderLockPlaybackRestricted".
        Leave the default restriction set for iOS as "BackgroundProcessPlaybackRestricted" and
        "SuspendedUnderLockPlaybackRestricted", to preserve the existing behavior of suspending
        playback when switching apps or when locking the device.

        * platform/audio/PlatformMediaSession.cpp:
        (WebCore::interruptionName):
        * platform/audio/PlatformMediaSession.h:
        * platform/audio/PlatformMediaSessionManager.cpp:
        (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive):
        (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive):
        (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground):
        (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground):
        (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground): Deleted.
        (WebCore::PlatformMediaSessionManager::applicationDidEnterForeground): Deleted.
        * platform/audio/PlatformMediaSessionManager.h:
        * platform/audio/ios/MediaSessionManagerIOS.h:
        * platform/audio/ios/MediaSessionManagerIOS.mm:
        (WebCore::MediaSessionManageriOS::resetRestrictions):
        (-[WebMediaSessionHelper applicationDidBecomeActive:]):
        (-[WebMediaSessionHelper applicationWillResignActive:]):
        (WebCore::MediaSessionManageriOS::applicationDidEnterBackground): Deleted.
        (WebCore::MediaSessionManageriOS::applicationWillEnterForeground): Deleted.
        * testing/Internals.cpp:
        (WebCore::Internals::applicationWillBecomeInactive):
        (WebCore::Internals::applicationDidBecomeActive):
        (WebCore::Internals::applicationWillEnterForeground):
        (WebCore::Internals::applicationDidEnterBackground):
        (WebCore::Internals::setMediaSessionRestrictions):
        (WebCore::Internals::applicationDidEnterForeground): Deleted.
        (WebCore::Internals::applicationWillEnterBackground): Deleted.
        * testing/Internals.h:
        * testing/Internals.idl:

2017-06-16  Alex Christensen  <achristensen@webkit.org>

        REGRESSION (r213126): Sync XHR needs partition for cache and credentials
        https://bugs.webkit.org/show_bug.cgi?id=173496
        <rdar://problem/31943596>

        Reviewed by Darin Adler.

        Test: http/tests/security/sync-xhr-partition.html

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

2017-06-16  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r218402 and r218404.
        https://bugs.webkit.org/show_bug.cgi?id=173494

        Seems to have mysteriously broken the build in bizarre ways
        (Requested by thorton on #webkit).

        Reverted changesets:

        "Include a few widespread WTF headers in WebCorePrefix.h"
        https://bugs.webkit.org/show_bug.cgi?id=173481
        http://trac.webkit.org/changeset/218402

        "Fix the Windows build after r218402"
        http://trac.webkit.org/changeset/218404

2017-06-16  Brady Eidson  <beidson@apple.com>

        REGRESSION (r218015) IconLoaders for already-cached resources expect to be asynchronous, no longer are.
        <rdar://problem/32817519> and https://bugs.webkit.org/show_bug.cgi?id=173478

        Reviewed by Daniel Bates.

        Covered by API test.

        Being synchronous is actually better as it's resolved another issue or two.
        But only if we can actually deliver the data without crashing first.
        So let's do that.
        
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::didGetLoadDecisionForIcon): Put the IconLoader in the set of active icon loaders
          before actually starting the icon loading.

2017-06-16  Jeremy Jones  <jeremyj@apple.com>

        Don't use WebCore Timer from code that runs in the UI process.
        https://bugs.webkit.org/show_bug.cgi?id=173460
        rdar://problem/32750731

        Reviewed by Jer Noble.

        If a WebCore Timer is fired from the WebKit2 UI process, it will
        create a web thread, which can cause a crash in this instance.

        It was also causing the timer to be called back on the wrong thread.

        * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit):

2017-06-16  Timothy Horton  <timothy_horton@apple.com>

        Fix the Windows build after r218402

        * WebCorePrefix.h:
        I typed #import instead of #include on auto-pilot, and ... it mostly worked!
        Except Windows.

2017-06-16  Jeremy Jones  <jeremyj@apple.com>

        Hide inline captions in fullscreen. Remove fullscreen captions when no longer needed.
        https://bugs.webkit.org/show_bug.cgi?id=173482

        Reviewed by Eric Carlson.

        Hide the inline captions while they are presenting to fullscreen.
        Remove the text track representation as soon as it is no longer needed.
        This allows the text track to render properly when returning to inline.

        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):

2017-06-16  Tim Horton  <timothy_horton@apple.com>

        Include a few widespread WTF headers in WebCorePrefix.h
        https://bugs.webkit.org/show_bug.cgi?id=173481

        Reviewed by Alex Christensen.

        * WebCorePrefix.h:
        These are four of the headers that contribute the most pre-processed
        source to the WebCore build. They (and their dependents) change infrequently
        enough that a world rebuild of WebCore when they change seems like an
        acceptable tradeoff for the ~9% reduction in WebCore build time that I
        measure from this change.

2017-06-16  Antoine Quint  <graouts@apple.com>

        REGRESSION: AirPlay placard is not shown when in fullscreen
        https://bugs.webkit.org/show_bug.cgi?id=173447
        <rdar://problem/32803773>

        Reviewed by Jon Lee.

        We only allowed a placard to be set on inline controls, but that was an oversight: placards
        should be displayed in fullscreen as well. As such, we move the "placard" property up from
        InlineMediaControls to MediaControls, and update the layout() logic in MacOSFullscreenMediaControls
        to display a placard.

        Test: media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html

        * Modules/modern-media-controls/controls/inline-media-controls.js:
        (InlineMediaControls):
        (InlineMediaControls.prototype.layout):
        (InlineMediaControls.prototype.get placard): Deleted.
        (InlineMediaControls.prototype.set placard): Deleted.
        * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
        (MacOSFullscreenMediaControls.prototype.layout):
        * Modules/modern-media-controls/controls/media-controls.js:
        (MediaControls.prototype.get placard):
        (MediaControls.prototype.set placard):
        (MediaControls.prototype.placardPreventsControlsBarDisplay):
        (MediaControls.prototype.layout):
        * Modules/modern-media-controls/media/placard-support.js:
        (PlacardSupport.prototype._updatePlacard):
        (PlacardSupport):

2017-06-16  Jer Noble  <jer.noble@apple.com>

        [WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKit clients
        https://bugs.webkit.org/show_bug.cgi?id=173398
        <rdar://problem/32592961>

        Reviewed by Eric Carlson.

        API Test: Tests/WebKit2/MediaStreamTrackDetached.mm

        Move the definition of a MediaStream as a MediaProducer from the stream itself to its constituent
        MediaStreamTracks. This ensures that, even if a MediaStreamTrack is removed from its stream, the
        document (and thus the clients) are notified that media capture is still occurring.

        Though MediaStream is no longer a MediaProducer, it still uses the MediaProducer's state concept
        to determine when to fire events. However it's mediaState() implementation will be moved into
        MediaStreamTrack, and will instead simply bitwise-or together each of it's track's mediaState().

        The MediaStream notifies the document that its state has changed asynchronously, so do the same
        for MediaStreamTrack (which reduces the number of calls to the client when changes all occur
        during a single run loop).

        Because the MediaStreamTrackPrivate may be started externally (not by the MediaStreamTrack directly),
        add a new client method that notifies observers when the track has been started, and the
        MediaStreamTrack will use this notification to update the document with it's new mediaState().

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::MediaStream):
        (WebCore::MediaStream::~MediaStream):
        (WebCore::MediaStream::mediaState):
        (WebCore::MediaStream::statusDidChange):
        (WebCore::MediaStream::characteristicsChanged):
        (WebCore::MediaStream::pageMutedStateDidChange): Deleted.
        * Modules/mediastream/MediaStream.h:
        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::MediaStreamTrack):
        (WebCore::MediaStreamTrack::~MediaStreamTrack):
        (WebCore::MediaStreamTrack::pageMutedStateDidChange):
        (WebCore::MediaStreamTrack::mediaState):
        (WebCore::MediaStreamTrack::trackStarted):
        (WebCore::MediaStreamTrack::configureTrackRendering):
        (WebCore::MediaStreamTrack::stop):
        (WebCore::MediaStreamTrack::document):
        * Modules/mediastream/MediaStreamTrack.h:
        (WebCore::MediaStreamTrack::source):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
        * platform/mediastream/MediaStreamPrivate.cpp:
        (WebCore::MediaStreamPrivate::trackStarted):
        * platform/mediastream/MediaStreamPrivate.h:
        * platform/mediastream/MediaStreamTrackPrivate.cpp:
        (WebCore::MediaStreamTrackPrivate::sourceStarted):
        * platform/mediastream/MediaStreamTrackPrivate.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::start):
        * platform/mediastream/RealtimeMediaSource.h:

2017-06-16  Antoine Quint  <graouts@apple.com>

        Backdrop blur missing in media controls bar on Sierra
        https://bugs.webkit.org/show_bug.cgi?id=173451

        Reviewed by Simon Fraser.

        On Sierra, we need to enforce a stacking context on controls bars to guarantee that
        the backdrop filters on the BackgroundTint are applied correctly.

        Test: media/modern-media-controls/controls-bar/controls-bar-stacking-context.html

        * Modules/modern-media-controls/controls/controls-bar.css:
        (.controls-bar):

2017-06-16  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r218375.

        The API test MediaStreamTrackDetached is still timing out
        after the patch

        Reverted changeset:

        "[WebRTC] Removing a MediaStreamTrack from a MediaStream
        reports no recording to WebKit clients"
        https://bugs.webkit.org/show_bug.cgi?id=173398
        http://trac.webkit.org/changeset/218375

2017-06-15  Simon Fraser  <simon.fraser@apple.com>

        REGRESSION: Media control glyphs appear to invert colors when video is dragged
        https://bugs.webkit.org/show_bug.cgi?id=173455
        rdar://problem/32726887

        Reviewed by Tim Horton.

        Masks on composited layers were not correctly painted in drag images, because RenderLayer::paintLayerContents()
        failed to pass the PaintBehaviorFlattenCompositingLayers flag down through the mask drawing code, causing
        RenderBox::paintMaskImages() to fall into the composited mask code path.

        Fix by making a local copy of PaintBehavior, and setting the PaintBehaviorFlattenCompositingLayers and PaintBehaviorSnapshotting
        bits on it as appropriate, and passing it into paintMaskForFragments() and paintChildClippingMaskForFragments(). This is similar
        to code above.

        Can't test drag images.

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paintLayerContents):
        (WebCore::RenderLayer::paintMaskForFragments):
        (WebCore::RenderLayer::paintChildClippingMaskForFragments):
        * rendering/RenderLayer.h:

2017-06-16  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r218376.

        The patch cause multiple Layout Test Crashes.

        Reverted changeset:

        "Web Inspector: Instrument 2D/WebGL canvas contexts in the
        backend"
        https://bugs.webkit.org/show_bug.cgi?id=172623
        http://trac.webkit.org/changeset/218376

2017-06-16  Daniel Bates  <dabates@apple.com>

        Use the term icon instead of favicon
        https://bugs.webkit.org/show_bug.cgi?id=173400

        Reviewed by Alex Christensen.

        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::cachedResourceContent):
        (WebCore::InspectorPageAgent::cachedResourceType):
        * loader/LinkLoader.cpp:
        (WebCore::createLinkPreloadResourceClient):
        * loader/ResourceLoadInfo.cpp:
        (WebCore::toResourceType):
        * loader/SubresourceLoader.cpp:
        (WebCore::logResourceLoaded):
        * loader/cache/CachedRawResource.cpp:
        (WebCore::CachedRawResource::CachedRawResource):
        * loader/cache/CachedRawResource.h:
        (isType):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::defaultPriorityForResourceType):
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource):
        (WebCore::CachedResource::ignoreForRequestCount):
        (WebCore::CachedResource::isMainOrMediaOrFaviconOrRawResource): Deleted.
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::createResource):
        (WebCore::CachedResourceLoader::requestIcon):
        (WebCore::contentTypeFromResourceType):
        (WebCore::CachedResourceLoader::checkInsecureContent):
        (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
        (WebCore::CachedResourceLoader::determineRevalidationPolicy):
        (WebCore::CachedResourceLoader::requestFavicon): Deleted.
        * loader/cache/CachedResourceLoader.h:
        * loader/icon/IconLoader.cpp:
        (WebCore::IconLoader::startLoading):

2017-06-16  Per Arne Vollan  <pvollan@apple.com>

        WebKit does not honor closed caption stroke width.
        https://bugs.webkit.org/show_bug.cgi?id=173402

        Reviewed by Eric Carlson.

        WebKit currently has an upper limit on the stroke width returned from MACaptionAppearanceCopyFontDescriptorWithStrokeForStyle.
        Since only half the stroke is visible because the stroke is drawn before the fill, double the stroke width from
        MediaAccessibility to get the correct visual stroke width. Also, the stroke width returned from this function should not be
        interpreted as CSS points, but as CSS pixels.

        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
        * page/CaptionUserPreferencesMediaAF.cpp:
        (WebCore::CaptionUserPreferencesMediaAF::captionStrokeWidthForFont):

2017-06-16  Per Arne Vollan  <pvollan@apple.com>

        [Win] WebKit renders scrollbar wrong at 125% scale.
        https://bugs.webkit.org/show_bug.cgi?id=173363

        Reviewed by Darin Adler.

        Scrollbars are drawn with the GDI function DrawThemeBackground. Sometimes, the GDI clip
        rectangle will be too small since we clamp a FloatRect to integer values when setting the
        GDI clip rectangle.

        * platform/graphics/win/GraphicsContextWin.cpp:
        (WebCore::GraphicsContextPlatformPrivate::clip):

2017-06-15  Mark Lam  <mark.lam@apple.com>

        Add a JSRunLoopTimer registry in VM.
        https://bugs.webkit.org/show_bug.cgi?id=173429
        <rdar://problem/31287961>

        Reviewed by Filip Pizlo.

        No new tests needed because:
        1. it's already covered: it was also originally discovered by our API tests while
           running on the iOS simulator. The test was intermittently failing on a debug
           build.
        2. the issue is racy (it depends on a JSRunLoopTimer firing at the right time).
           Hence, it's non trivial to write a better test than the one we already have.

        * bindings/js/CommonVM.cpp:
        (WebCore::commonVMSlow):

2017-06-15  Antoine Quint  <graouts@apple.com>

        REGRESSION: AirPlay button is incorrectly highlighted in inline and fullscreen
        https://bugs.webkit.org/show_bug.cgi?id=173446

        Reviewed by Dean Jackson.

        A button's color should be applied to its <picture> element, not the containing
        <button> element.

        * Modules/modern-media-controls/controls/airplay-button.css:
        (button.airplay.on > picture):
        (button.airplay.on): Deleted.

2017-06-15  Matt Baker  <mattbaker@apple.com>

        Web Inspector: Instrument 2D/WebGL canvas contexts in the backend
        https://bugs.webkit.org/show_bug.cgi?id=172623
        <rdar://problem/32415986>

        Reviewed by Devin Rousso.

        Test: inspector/canvas/create-canvas-contexts.html

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

        * dom/Document.cpp:
        (WebCore::Document::getCSSCanvasElement):
        Instrument creation of CSS canvases. This merely registers the canvas
        element with InspectorCanvasAgent and stores the name (identifier passed
        to getCSSCanvasContext) for later use. It isn't until the context is
        actually created that the frontend receives a notification.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::getContext2d):
        (WebCore::HTMLCanvasElement::getContextWebGL):
        Instrument creation of 2D and WebGL canvas contexts.

        * inspector/InspectorAllInOne.cpp:

        * inspector/InspectorCanvasAgent.cpp: Added.
        New backend agent for canvas inspection. Canvas creation and destruction
        are continuously monitored by the agent, regardless of the presence of
        a frontend. This is necessary since there is no way to retrieve the
        rendering contexts for with a given frame once they've been created.

        (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
        (WebCore::InspectorCanvasAgent::didCreateFrontendAndBackend):
        (WebCore::InspectorCanvasAgent::willDestroyFrontendAndBackend):
        (WebCore::InspectorCanvasAgent::discardAgent):
        Unregister canvas observers to prevent dangling agent pointer.
        (WebCore::InspectorCanvasAgent::enable):
        Dispatch events for existing canvases, now that the frontend exists.
        (WebCore::InspectorCanvasAgent::disable):
        (WebCore::InspectorCanvasAgent::frameNavigated):
        (WebCore::InspectorCanvasAgent::didCreateCSSCanvas):
        Register the name/identifier associated with the CSS canvas, so that it
        can be retrieved and associated with the rendering context later.

        (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
        (WebCore::InspectorCanvasAgent::canvasDestroyed):
        Removes the canvas from the agent, and queues it for notifying the
        frontend during the next event loop.

        (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
        (WebCore::InspectorCanvasAgent::clearCanvasData):
        (WebCore::InspectorCanvasAgent::getCanvasEntry):
        (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
        * inspector/InspectorCanvasAgent.h: Added.

        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::InspectorController):

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didCommitLoadImpl):
        (WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl):
        (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):

        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::didCreateCSSCanvas):
        (WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
        These instrumentation points should not fast return when no frontend
        is attached.

        * inspector/InstrumentingAgents.cpp:
        (WebCore::InstrumentingAgents::reset):

        * inspector/InstrumentingAgents.h:
        (WebCore::InstrumentingAgents::inspectorCanvasAgent):
        (WebCore::InstrumentingAgents::setInspectorCanvasAgent):
        Plumbing for the new agent.

2017-06-15  Jer Noble  <jer.noble@apple.com>

        [WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKit clients
        https://bugs.webkit.org/show_bug.cgi?id=173398
        <rdar://problem/32592961>

        Reviewed by Eric Carlson.

        API Test: Tests/WebKit2/MediaStreamTrackDetached.mm

        Move the definition of a MediaStream as a MediaProducer from the stream itself to its constituent
        MediaStreamTracks. This ensures that, even if a MediaStreamTrack is removed from its stream, the
        document (and thus the clients) are notified that media capture is still occurring.

        Though MediaStream is no longer a MediaProducer, it still uses the MediaProducer's state concept
        to determine when to fire events. However it's mediaState() implementation will be moved into
        MediaStreamTrack, and will instead simply bitwise-or together each of it's track's mediaState().

        The MediaStream notifies the document that its state has changed asynchronously, so do the same
        for MediaStreamTrack (which reduces the number of calls to the client when changes all occur
        during a single run loop).

        Because the MediaStreamTrackPrivate may be started externally (not by the MediaStreamTrack directly),
        add a new client method that notifies observers when the track has been started, and the
        MediaStreamTrack will use this notification to update the document with it's new mediaState().

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::MediaStream):
        (WebCore::MediaStream::~MediaStream):
        (WebCore::MediaStream::mediaState):
        (WebCore::MediaStream::statusDidChange):
        (WebCore::MediaStream::characteristicsChanged):
        (WebCore::MediaStream::pageMutedStateDidChange): Deleted.
        * Modules/mediastream/MediaStream.h:
        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::MediaStreamTrack):
        (WebCore::MediaStreamTrack::~MediaStreamTrack):
        (WebCore::MediaStreamTrack::pageMutedStateDidChange):
        (WebCore::MediaStreamTrack::mediaState):
        (WebCore::MediaStreamTrack::trackStarted):
        (WebCore::MediaStreamTrack::configureTrackRendering):
        (WebCore::MediaStreamTrack::stop):
        (WebCore::MediaStreamTrack::document):
        * Modules/mediastream/MediaStreamTrack.h:
        (WebCore::MediaStreamTrack::source):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
        * platform/mediastream/MediaStreamPrivate.cpp:
        (WebCore::MediaStreamPrivate::trackStarted):
        * platform/mediastream/MediaStreamPrivate.h:
        * platform/mediastream/MediaStreamTrackPrivate.cpp:
        (WebCore::MediaStreamTrackPrivate::sourceStarted):
        * platform/mediastream/MediaStreamTrackPrivate.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::start):
        * platform/mediastream/RealtimeMediaSource.h:

2017-06-15  Simon Fraser  <simon.fraser@apple.com>

        Use WTFLogAlways for debug logging so that it shows up in device system logs
        https://bugs.webkit.org/show_bug.cgi?id=173450

        Reviewed by Tim Horton.

        If you want to showRenderTree() on-device, the result doesn't show in system log so you can't see it
        Switch to WTFLogAlways to fix this, for all the debug logging in WebCore.
        
        Also WKError () -> WKError() in the old WAK code, to allow for easier searching pending cleanup.

        * Modules/webaudio/AudioContext.cpp:
        (WebCore::AudioContext::~AudioContext):
        * Modules/webaudio/AudioNode.cpp:
        (WebCore::AudioNode::~AudioNode):
        (WebCore::AudioNode::ref):
        (WebCore::AudioNode::finishDeref):
        (WebCore::AudioNode::printNodeCounts):
        * bridge/objc/objc_instance.mm:
        (ObjcInstance::invokeObjcMethod):
        * bridge/objc/objc_utility.mm:
        (JSC::Bindings::convertObjcValueToValue):
        * css/StyleProperties.cpp:
        (WebCore::StyleProperties::showStyle):
        * dom/DocumentMarkerController.cpp:
        (DocumentMarkerController::showMarkers):
        * dom/Node.cpp:
        (WebCore::Node::showNode):
        (WebCore::Node::showNodePathForThis):
        (WebCore::traverseTreeAndMark):
        * dom/Position.cpp:
        (WebCore::Position::debugPosition):
        (WebCore::Position::showAnchorTypeAndOffset):
        * dom/Range.cpp:
        (showTree):
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::debugRenderer):
        * editing/VisiblePosition.cpp:
        (WebCore::VisiblePosition::debugPosition):
        * editing/VisibleSelection.cpp:
        (WebCore::VisibleSelection::debugPosition):
        * history/HistoryItem.cpp:
        (WebCore::HistoryItem::showTreeWithIndent):
        * html/parser/HTMLFormattingElementList.cpp:
        (WebCore::HTMLFormattingElementList::show):
        * inspector/DOMPatchSupport.cpp:
        (WebCore::DOMPatchSupport::dumpMap):
        * page/scrolling/ScrollingStateTree.cpp:
        (showScrollingStateTree):
        * platform/audio/ios/AudioDestinationIOS.cpp:
        (WebCore::AudioDestinationIOS::frameSizeChangedProc):
        * platform/graphics/GraphicsLayer.cpp:
        (showGraphicsLayerTree):
        * platform/graphics/displaylists/DisplayList.cpp:
        (WebCore::DisplayList::DisplayList::dump):
        * platform/ios/wak/WAKView.mm:
        (+[WAKView _wrapperForViewRef:]):
        (-[WAKView displayRect:]):
        (-[WAKView displayRectIgnoringOpacity:inContext:]):
        * platform/ios/wak/WKUtilities.c:
        (WKRelease):
        * platform/ios/wak/WKView.mm:
        (_WKViewSetViewContext):
        (WKViewGetBounds):
        (WKViewGetFrame):
        (_WKViewRecursivelyInvalidateGState):
        (WKViewSetFrameOrigin):
        (WKViewSetFrameSize):
        (WKViewGetWindow):
        (WKViewGetSubviews):
        (WKViewAddSubview):
        (WKViewRemoveFromSuperview):
        (WKViewFirstChild):
        (WKViewNextSibling):
        (WKViewTraverseNext):
        (WKViewGetVisibleRect):
        (WKViewConvertRectToSuperview):
        (WKViewConvertRectToBase):
        (WKViewConvertPointToSuperview):
        (WKViewConvertPointFromSuperview):
        (WKViewConvertPointToBase):
        (_WKViewGetAncestorViewsIncludingView):
        (WKViewConvertPointFromBase):
        (WKViewConvertRectFromSuperview):
        (WKViewConvertRectFromBase):
        (WKViewGetAutoresizingMask):
        (WKViewSetAutoresizingMask):
        * platform/text/TextEncodingRegistry.cpp:
        (WebCore::dumpTextEncodingNameMap):
        * rendering/CounterNode.cpp:
        (WebCore::showTreeAndMark):
        * rendering/InlineBox.cpp:
        (WebCore::InlineBox::showLineBox):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::showLineBox):
        * rendering/RenderCounter.cpp:
        (showCounterRendererTree):
        * rendering/RenderLayer.cpp:
        (WebCore::showLayerTree):
        * rendering/RenderObject.cpp:
        (WebCore::showRenderTreeLegend):
        (WebCore::RenderObject::showRegionsInformation):
        (WebCore::RenderObject::showRenderObject):
        (WebCore::printRenderTreeForLiveDocuments):
        (WebCore::printLayerTreeForLiveDocuments):
        * rendering/SimpleLineLayoutFunctions.cpp:
        (WebCore::SimpleLineLayout::printPrefix):
        (WebCore::SimpleLineLayout::showLineLayoutForFlow):
        * rendering/svg/SVGResources.cpp:
        (WebCore::SVGResources::dump):
        * rendering/svg/SVGResourcesCycleSolver.cpp:
        (WebCore::SVGResourcesCycleSolver::resolveCycles):
        * rendering/svg/SVGTextLayoutAttributes.cpp:
        (WebCore::dumpSVGCharacterDataMapValue):
        (WebCore::SVGTextLayoutAttributes::dump):
        * rendering/svg/SVGTextLayoutEngine.cpp:
        (WebCore::dumpTextBoxes):
        (WebCore::SVGTextLayoutEngine::finishLayout):

2017-06-15  Myles C. Maxfield  <mmaxfield@apple.com>

        Removing stray whitespace after r218371
        https://bugs.webkit.org/show_bug.cgi?id=173043

        Unreviewed.

        No new tests because there is no behavior change.

        * platform/graphics/FontCascadeFonts.cpp:
        (WebCore::shouldIgnoreRotation):
        (WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
        * platform/graphics/FontDescription.cpp:
        * platform/graphics/FontDescription.h:
        * platform/graphics/FontFamilySpecificationNull.h:
        * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
        (WebCore::SystemFontDatabase::systemFontCascadeList):
        (WebCore::systemFontParameters):
        * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
        (WebCore::FontFamilySpecificationCoreText::fontRanges):
        * platform/graphics/cocoa/FontFamilySpecificationCoreText.h:

2017-06-15  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Expand system-ui to include every item in the Core Text cascade list
        https://bugs.webkit.org/show_bug.cgi?id=173043
        <rdar://problem/21125708>

        Reviewed by Simon Fraser.

        The concept of the system font on Cocoa platforms represents the entire Core Text cascade list.
        However, previously, WebKit only represented system-ui by pulling out the first item in the Core
        Text cascade list. Instead, we should make all text rendered with "system-ui" match what the
        platform would natively render.

        Previously, we walked through the strings in the font-family property and looked them up one by
        one. However, now we want to abstract this idea of a font family to possibly hold a
        CTFontDescriptorRef instead of a string. This way, we expand a font-family list of ["fontA",
        "system-ui", "fontB"] to ["fontA", ... a bunch of CTFontDescriptorRefs ..., "FontB"]. We can
        then modify the consumer of this object to have two codepaths: the old string-based codepath,
        and a new, platform-specific codepath which simply embeds the CTFontDesriptorRefs inside a Font
        object.

        We don't want to simply pull out the family name from each item in the Core Text fallback list
        because that is a lossy translation. There is more information in these font descriptors which
        cannot be represented by CSS. Therefore, we must keep the descriptors alive and add the new
        codepath for them.

        We also don't want to run the CSS font matching algorithm on each member of the Core Text
        fallback list because it may yield different results from Core Text's font matching algorithm.
        Our goal is to draw text as closely as possible to the system APIs. If we ran it, we may find
        a font which is closer to the requested traits, but it would look out of place on the system.

        This new codepath is only enabled on macOS High Sierra and iOS 11, because enabling it on all
        operating systems would make fixing https://bugs.webkit.org/show_bug.cgi?id=173300 impossible.

        Tests: fast/text/system-font-fallback-emoji.html
               fast/text/system-font-fallback.html
               fast/text/system-font-zero-size.html

        * WebCore.xcodeproj/project.pbxproj:
        * page/MemoryRelease.cpp:
        (WebCore::releaseNoncriticalMemory):
        * platform/graphics/FontCascadeFonts.cpp:
        (WebCore::realizeNextFallback): The consumer of our new data type. Now uses WTF::visit().
        (WebCore::FontCascadeFonts::realizeFallbackRangesAt): Now that the number of items to test
        against the current character is larger than the number of strings in the font-family list,
        we need to update the existing code to use the correct value.
        * platform/graphics/FontDescription.cpp: Default implementation for non-Cocoa ports.
        (WebCore::FontDescription::invalidateCaches):
        (WebCore::FontCascadeDescription::effectiveFamilyCount):
        (WebCore::FontCascadeDescription::effectiveFamilyAt):
        * platform/graphics/FontDescription.h: Our new data type is a Variant of AtomicString and a
        platform-specific class. Cocoa uses a class that holds a CTFontDescriptorRef and other ports
        use an empty non-constructable class.
        * platform/graphics/FontFamilySpecificationNull.h: Added. The empty non-constructable
        class.
        (WebCore::FontFamilySpecificationNull::fontRanges):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::fontCacheRegisteredFontsChangedNotificationCallback):
        (WebCore::FontCache::platformInit): Changing the system language will change the system font
        fallback list, so we need to listen to this notification. This also matters for
        FontCache::systemFallbackForCharacters(), so we should build off the same callback we are
        already using for font installation.
        (WebCore::invalidateFontCache):
        * platform/graphics/cocoa/FontDescriptionCocoa.cpp: Added. The platform-specific creation of
        our CTFontDescriptorRefs. We hold them cached in a SystemFontDatabase.
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
        (WebCore::SystemFontDatabase::singleton):
        (WebCore::SystemFontDatabase::systemFontCascadeList):
        (WebCore::SystemFontDatabase::clear):
        (WebCore::SystemFontDatabase::SystemFontDatabase):
        (WebCore::SystemFontDatabase::applyWeightAndItalics):
        (WebCore::SystemFontDatabase::removeCascadeList):
        (WebCore::SystemFontDatabase::computeCascadeList):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal):
        (WebCore::isSystemFontString):
        (WebCore::systemFontParameters):
        (WebCore::FontDescription::invalidateCaches):
        (WebCore::FontCascadeDescription::effectiveFamilyCount): We don't store the result of this
        because it would probably be a bad idea to increase the size of every single FontCascade just
        in case it might ask for the system font. Most fonts never mention system-ui. Because it's so
        rare, we can just recalculate the result of this as necessary. This shouldn't be slow because
        the results are cached.
        (WebCore::FontCascadeDescription::effectiveFamilyAt):
        * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: Added.
        (WebCore::FontFamilySpecificationCoreText::fontRanges): Create a FontRanges from a
        CTFontDescriptorRef.
        * platform/graphics/cocoa/FontFamilySpecificationCoreText.h: Added.
        (WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText):
        * platform/graphics/ios/FontCacheIOS.mm:
        (WebCore::platformFontWithFamilySpecialCase):
        * platform/graphics/mac/FontCacheMac.mm:
        (WebCore::platformFontWithFamilySpecialCase):

2017-06-15  David Kilzer  <ddkilzer@apple.com>

        Revert: [iOS] Generate a simulated crash when the WebThread starts in MobileSafari
        <https://webkit.org/b/173386>
        <rdar://problem/32776426>

        Revert r218347 and r218339 since we're going to take a different
        approach to investigating a crash on the WebThread.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/ios/CrashReporterSupportSoftLink.h: Remove.
        * platform/ios/CrashReporterSupportSoftLink.mm: Remove.
        * platform/ios/wak/WebCoreThread.mm:
        (WebThreadEnable):
        * platform/spi/ios/CrashReporterSupportSPI.h: Remove.

2017-06-15  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r218365.

        The revision caused API timeouts on all builds.

        Reverted changeset:

        "[WebRTC] Removing a MediaStreamTrack from a MediaStream
        reports no recording to WebKit clients"
        https://bugs.webkit.org/show_bug.cgi?id=173398
        http://trac.webkit.org/changeset/218365

2017-06-15  Simon Fraser  <simon.fraser@apple.com>

        Allow use of Layout* TextStream operators in WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=173440

        Reviewed by Zalan Bujtas.

        Export TextStream& operator<< for LayoutPoint, LayoutSize and LayoutRect so that
        WebKit2 can log them.

        Use #pragma once in these geometry headers.

        * 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/LayoutPoint.h:
        * platform/graphics/LayoutRect.h:
        * platform/graphics/LayoutSize.h:

2017-06-15  Antoine Quint  <graouts@apple.com>

        Modern media controls tests error in Button.js
        https://bugs.webkit.org/show_bug.cgi?id=173439

        Reviewed by Dean Jackson.

        Tests would sometime yield an error when commit() would be called and the _imageSource
        ivar hadn't been set. To more safely commit the mask image when it's loaded, we now use
        a markDirtyProperty() call and a commitProperty() override to ensure that we cover the
        case where we want to commit the mask image, and for other commits not to have to worry
        about the mask image being defined.

        * Modules/modern-media-controls/controls/button.js:
        (Button.prototype.commitProperty):
        (Button.prototype._updateImage):
        (Button.prototype.commit): Deleted.

2017-06-15  Jer Noble  <jer.noble@apple.com>

        [WebRTC] Removing a MediaStreamTrack from a MediaStream reports no recording to WebKit clients
        https://bugs.webkit.org/show_bug.cgi?id=173398
        <rdar://problem/32592961>

        Reviewed by Eric Carlson.

        API Test: Tests/WebKit2/MediaStreamTrackDetached.mm

        Move the definition of a MediaStream as a MediaProducer from the stream itself to its constituent
        MediaStreamTracks. This ensures that, even if a MediaStreamTrack is removed from its stream, the
        document (and thus the clients) are notified that media capture is still occurring.

        Though MediaStream is no longer a MediaProducer, it still uses the MediaProducer's state concept
        to determine when to fire events. However it's mediaState() implementation will be moved into
        MediaStreamTrack, and will instead simply bitwise-or together each of it's track's mediaState().

        The MediaStream notifies the document that its state has changed asynchronously, so do the same
        for MediaStreamTrack (which reduces the number of calls to the client when changes all occur
        during a single run loop).

        Because the MediaStreamTrackPrivate may be started externally (not by the MediaStreamTrack directly),
        add a new client method that notifies observers when the track has been started, and the
        MediaStreamTrack will use this notification to update the document with it's new mediaState().

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::MediaStream):
        (WebCore::MediaStream::~MediaStream):
        (WebCore::MediaStream::mediaState):
        (WebCore::MediaStream::statusDidChange):
        (WebCore::MediaStream::characteristicsChanged):
        (WebCore::MediaStream::pageMutedStateDidChange): Deleted.
        * Modules/mediastream/MediaStream.h:
        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::MediaStreamTrack):
        (WebCore::MediaStreamTrack::~MediaStreamTrack):
        (WebCore::MediaStreamTrack::pageMutedStateDidChange):
        (WebCore::MediaStreamTrack::mediaState):
        (WebCore::MediaStreamTrack::trackStarted):
        (WebCore::MediaStreamTrack::configureTrackRendering):
        (WebCore::MediaStreamTrack::stop):
        (WebCore::MediaStreamTrack::document):
        * Modules/mediastream/MediaStreamTrack.h:
        (WebCore::MediaStreamTrack::source):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
        * platform/mediastream/MediaStreamPrivate.cpp:
        (WebCore::MediaStreamPrivate::trackStarted):
        * platform/mediastream/MediaStreamPrivate.h:
        * platform/mediastream/MediaStreamTrackPrivate.cpp:
        (WebCore::MediaStreamTrackPrivate::sourceStarted):
        * platform/mediastream/MediaStreamTrackPrivate.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::start):
        * platform/mediastream/RealtimeMediaSource.h:

2017-06-15  Jonathan Bedard  <jbedard@apple.com>

        Unreviewed build fix after r218336

        * platform/spi/cocoa/PassKitSPI.h: Add missing #ifdefs for Internal builds.

2017-06-15  Antoine Quint  <graouts@apple.com>

        Ensure we only log changes to the ScriptedAnimationController suspended state in debug builds
        https://bugs.webkit.org/show_bug.cgi?id=173423

        Reviewed by Tim Horton.

        We added logging for when the suspended state of the scripted animation controller would change in
        webkit.org/b/173326. It was meant to only be enabled in debug builds and we actually did the wrong
        thing and enabled it in non-debug builds.

        We also added a setting that wasn't used and that we are removing here.

        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::logSuspendCount):
        * page/Settings.in:
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::resetToConsistentState):
        (WebCore::InternalSettings::shouldLogScritedAnimationControllerSuspensionChange): Deleted.
        (WebCore::InternalSettings::setShouldLogScritedAnimationControllerSuspensionChange): Deleted.
        * testing/InternalSettings.h:
        * testing/InternalSettings.idl:

2017-06-15  David Kilzer  <ddkilzer@apple.com>

        Build fix: [iOS] Generate a simulated crash when the WebThread starts in MobileSafari
        <https://webkit.org/b/173386>
        <rdar://problem/32776426>

        * platform/ios/CrashReporterSupportSoftLink.h:
        * platform/ios/CrashReporterSupportSoftLink.mm:
        * platform/ios/wak/WebCoreThread.mm:
        (WebThreadEnable): Log to the console on iOS Simulator.
        * platform/spi/ios/CrashReporterSupportSPI.h:
        - CrashReporterSupport.h is not available on iOS Simulator, so
          restrict to iOS hardware only.

2017-06-15  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r218318.

        Seems to have caused an 11% PLT regression. Rolling out to
        confirm.

        Reverted changeset:

        "Don't always recalc the style of display: contents elements."
        https://bugs.webkit.org/show_bug.cgi?id=172753
        http://trac.webkit.org/changeset/218318

2017-06-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        Using -[WebItemProviderPasteboard setItemProviders:] to swap out item providers before a drop breaks item provider loading
        https://bugs.webkit.org/show_bug.cgi?id=173338
        <rdar://problem/32777720>

        Reviewed by Tim Horton.

        Currently, replacing the list of UIItemProviders right before a drop is handled results in
        WebItemProviderPasteboard failing to load non-"public.content"-conformant items. This is because DragController
        computes and sends to the UI process a list of UTIs to load (preferredTypeIdentifiers: one type identifier for
        each item provider in WebItemProviderPasteboard). However, if the list of item providers changes immediately
        before a drop is performed, WebItemProviderPasteboard will get into an inconsistent state where it has a
        different number of preferred type identifiers to load than available item providers. This causes
        WebItemProviderPasteboard to fail when choosing what type identifiers to load from each item provider.

        To fix this, we instead have the web process propagate a list of supported type identifiers to the UI process,
        which is a property of only the drop destination rather than both the destination and item providers. When
        performing a drop, we then use the current item providers on WebItemProviderPasteboard to consult this list of
        supported type identifiers to resolve our list of preferred type identifiers to load.

        Globally renames updatePreferredTypeIdentifiers to updateSupportedTypeIdentifiers.

        Tests:
        DataInteractionTests.ExternalSourceOverrideDropFileUpload
        DataInteractionTests.ExternalSourceOverrideDropInsertURL

        * page/DragController.cpp:
        (WebCore::DragController::dragEnteredOrUpdated):
        (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod):
        (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod): Deleted.
        * page/DragController.h:
        * page/mac/DragControllerMac.mm:
        (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod):
        (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod): Deleted.
        * platform/DragData.h:
        * platform/PasteboardStrategy.h:
        * platform/PlatformPasteboard.h:
        * platform/ios/AbstractPasteboard.h:
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::updateSupportedTypeIdentifiers):
        (WebCore::PlatformPasteboard::updatePreferredTypeIdentifiers): Deleted.
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard init]):
        (-[WebItemProviderPasteboard updateSupportedTypeIdentifiers:]):
        (-[WebItemProviderPasteboard setItemProviders:]):
        (-[WebItemProviderPasteboard typeIsAppropriateForSupportedTypes:]):
        (-[WebItemProviderPasteboard typeIdentifierToLoadForRegisteredTypeIdentfiers:]):

        Add logic to resolve preferred type identifiers from an item providers list of registered type identifiers.
        This formerly existed on DragData.

        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
        (-[WebItemProviderPasteboard updatePreferredTypeIdentifiers:]): Deleted.
        * platform/mac/DragDataMac.mm:

        Remove preferred type identifier resolution logic from DragData.

        (WebCore::typeIsAppropriateForSupportedTypes): Deleted.
        (WebCore::DragData::updatePreferredTypeIdentifiers): Deleted.

2017-06-15  Sam Weinig  <sam@webkit.org>

        [WebIDL] Replace general inclusion of JSDOMConvert.h with inclusion of individual converter files to reduce unnecessary inclusion
        https://bugs.webkit.org/show_bug.cgi?id=173392

        Reviewed by Tim Horton.

        Stop including the umbrella header JSDOMConvert.h in every generated bindings and 
        instead only include the specific converter needed. Then, go around and add all the
        now missing includes that used to be obtained transitively.

        * Modules/indexeddb/IDBRequest.cpp:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        * Modules/plugins/QuickTimePluginReplacement.mm:
        * bindings/js/IDBBindingUtilities.cpp:
        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
        * bindings/js/JSCryptoAlgorithmDictionary.cpp:
        * bindings/js/JSCustomElementInterface.cpp:
        * bindings/js/JSCustomElementRegistryCustom.cpp:
        * bindings/js/JSDOMConvertBase.h:
        * bindings/js/JSDOMConvertInterface.h:
        * bindings/js/JSDOMConvertRecord.h:
        * bindings/js/JSDOMConvertSequences.h:
        * bindings/js/JSDOMConvertUnion.h:
        * bindings/js/JSDOMGlobalObject.h:
        * bindings/js/JSDOMWindowCustom.cpp:
        * bindings/js/JSDOMWindowProperties.cpp:
        * bindings/js/JSDocumentCustom.cpp:
        * bindings/js/JSErrorHandler.cpp:
        * bindings/js/JSEventListener.cpp:
        * bindings/js/JSHTMLCanvasElementCustom.cpp:
        * bindings/js/JSHTMLDocumentCustom.cpp:
        * bindings/js/JSHistoryCustom.cpp:
        * bindings/js/JSMessageEventCustom.cpp:
        (WebCore::JSMessageEvent::data):
        * bindings/js/JSMockContentFilterSettingsCustom.cpp:
        * bindings/js/JSMutationCallback.cpp:
        * bindings/js/JSXMLHttpRequestCustom.cpp:
        (WebCore::JSXMLHttpRequest::retrieveResponse):
        * bindings/js/ScriptGlobalObject.cpp:
        * bindings/js/SerializedScriptValue.cpp:
        * bindings/scripts/CodeGeneratorJS.pm:
        (AddToIncludesForIDLType):
        (GetJSCAttributesForAttribute):
        (GenerateEnumerationHeader):
        (GenerateEnumerationImplementation):
        (GenerateEnumerationImplementationContent):
        (GenerateEnumerationsImplementationContent):
        (GenerateEnumerationHeaderContent):
        (GenerateEnumerationsHeaderContent):
        (GenerateDictionaryHeaderContent):
        (GenerateDictionariesHeaderContent):
        (GenerateDictionaryImplementationContent):
        (GenerateDictionariesImplementationContent):
        (GenerateHeader):
        (GeneratePropertiesHashTable):
        (GenerateOverloadDispatcher):
        (GenerateImplementation):
        (GenerateAttributeGetterDefinition):
        (GenerateSerializerDefinition):
        (GenerateDictionaryHeader):
        (JSValueToNative):
        (NativeToJSValueUsingReferences):
        (NativeToJSValueUsingPointers):
        (IsValidContextForNativeToJSValue):
        (NativeToJSValue):
        (GenerateConstructorDefinition):
        (ComputeFunctionSpecial):
        * bindings/scripts/test/JS/JSMapLike.cpp:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.h:
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        * bindings/scripts/test/JS/JSTestEventConstructor.h:
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        * bindings/scripts/test/JS/JSTestException.cpp:
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestNode.h:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestObj.h:
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h:
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerialization.h:
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInherit.h:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
        * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
        * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
        * dom/MouseEvent.cpp:
        * html/HTMLPlugInImageElement.cpp:

2017-06-14  David Kilzer  <ddkilzer@apple.com>

        [iOS] Generate a simulated crash when the WebThread starts in MobileSafari
        <https://webkit.org/b/173386>
        <rdar://problem/32776426>

        Reviewed by Andy Estes.

        * WebCore.xcodeproj/project.pbxproj: Add new files to project.
        * platform/ios/CrashReporterSupportSoftLink.h: Add.  The using
        statement is so that we don't have to write
        WebCore::SimulateCrash() in WebCoreThread.mm since it's
        functions are not defined inside a WebCore namespace.  I also
        kept the 'pid' argument despite the style checker warning
        because it matches the internal method definition.
        * platform/ios/CrashReporterSupportSoftLink.mm: Add.
        * platform/ios/wak/WebCoreThread.mm: Sort headers.  Soft link to
        CrashReporterSupport.framework.
        (WebThreadEnable): Generate a simulated crash log if the
        WebThread ever starts in MobileSafari.
        * platform/spi/ios/CrashReporterSupportSPI.h: Add.  The header
        isn't safe to include in C++ source, so wrap the import in
        extern "C" macros.

2017-06-15  Jonathan Bedard  <jbedard@apple.com>

        Build WebKit with High Sierra (Seed 1)
        https://bugs.webkit.org/show_bug.cgi?id=173371

        Reviewed by Andy Estes.

        * crypto/CommonCryptoUtilities.h: Added ccRSAPSSPadding to CCAsymmetricPading enum.
        * platform/spi/cocoa/AVKitSPI.h: Declare AVKit SPI used by WebKit in High Sierra.
        (-[AVTouchBarPlaybackControlsControlling NS_ENUM]): Added AVTouchBarMediaSelectionOptionType
        SPI used in WebPlaybackControlManager in High Sierra.
        * platform/spi/cocoa/PassKitSPI.h: Declare PassKit SPI used by WebKit in High Sierra.
        (NS_ERROR_ENUM): Added PKPaymentErrorCode used in WebPayment in High Sierra.

2017-06-15  Youenn Fablet  <youenn@apple.com>

        RTCPeerConnection returns RTCSessionDescription where RTCSessionDescriptionInit would be appropriate
        https://bugs.webkit.org/show_bug.cgi?id=173118
        <rdar://problem/32746761>

        Reviewed by Eric Carlson.

        Test: webrtc/createOfferAnswer.html

        Making the promise return a RTCSessionDescription::Init instead of a RTCSessionDescription.
        This aligns with the spec and is more optimal.

        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::createOfferSucceeded):
        (WebCore::PeerConnectionBackend::createAnswerSucceeded):
        * Modules/mediastream/PeerConnectionBackend.h:
        * Modules/mediastream/RTCSessionDescription.idl:

2017-06-15 Emilio Cobos Álvarez  <ecobos@igalia.com>

        Don't always recalc the style of display: contents elements.
        https://bugs.webkit.org/show_bug.cgi?id=172753

        Reviewed by Antti Koivisto.

        No new tests (no functionality change). This only removes an
        inefficiency.

        * dom/Element.cpp:
        (WebCore::Element::existingComputedStyle):
        * dom/Element.h:
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateRenderTree):
        (WebCore::RenderTreeUpdater::updateElementRenderer):
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::resolveElement):
        (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
        (WebCore::Style::shouldResolveElement):
        (WebCore::Style::TreeResolver::resolveComposedTree):

2017-06-14  Antoine Quint  <graouts@apple.com>

        Rebaseline media/modern-media-controls/media-documents
        https://bugs.webkit.org/show_bug.cgi?id=173394

        Reviewed by Dean Jackson.

        We found two issues related to media documents while rebaselining the dedicated tests.

        First, we needed to expose the --inline-controls-bar-height CSS variable to <video>
        elements in media documents that are actually showing an audio UI. Previously we would
        only expose the variable to <audio> elements.

        Also, due to webkit.org/b/173387, we would fail to identify certain media documents as
        video because the videoTracks weren't set yet when the "loadedmetadata" event would be
        triggered. So now we also look at the videoWidth and videoHeight properties, which should
        provide accurate information in the "loadedmetadata" event handler.

        * Modules/modern-media-controls/controls/media-controls.css:
        (:host(audio), :host(video.media-document.audio), *):
        (:host(audio), *): Deleted.
        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController.prototype.get isAudio):

2017-06-14  Zalan Bujtas  <zalan@apple.com>

        animations-paused-in-background-page.html and animated-svg-image-removed-from-document-paused.html fail after r218284
        https://bugs.webkit.org/show_bug.cgi?id=173393

        Reviewed by Simon Fraser.

        Testing cares really about whether the animation has initiated.  

        * platform/graphics/Image.h:
        (WebCore::Image::animationPending):
        * testing/Internals.cpp:
        (WebCore::Internals::isImageAnimating):

2017-06-14  Dean Jackson  <dino@apple.com>

        Restrict filtered painting across cross-origin boundaries with transforms
        https://bugs.webkit.org/show_bug.cgi?id=173388
        <rdar://problem/27362159>

        Reviewed by Simon Fraser.

        Make sure all cases of LayerPaintingInfo maintain the security
        flag. In this case there was only one new place, and since
        everything is scalar, there was no need for a real copy constructor.

        Test: http/tests/css/filters-on-iframes-transform.html

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paintLayerByApplyingTransform): Make sure the cross
        origin flag is used in the call to paint the layer children.
        * rendering/RenderLayer.h: Fix some typos.

2017-06-14  Commit Queue  <commit-queue@webkit.org>

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

        API test fails on iOS (Requested by alexchristensen on
        #webkit).

        Reverted changeset:

        "Add SPI for immediate injection of user scripts"
        https://bugs.webkit.org/show_bug.cgi?id=173342
        http://trac.webkit.org/changeset/218285

2017-06-14  Jer Noble  <jer.noble@apple.com>

        Video flashes black when switching back to a tab https://www.apple.com/homepod/
        https://bugs.webkit.org/show_bug.cgi?id=173377

        Reviewed by Eric Carlson.

        Previously, we had set the background color of the video layer to black in order to make the rect
        occupied by the HTMLMediaElement fully opaque. This worked around a graphics corruption bug. Since
        then, the code in RenderVideo::foregroundIsKnownToBeOpaqueInRect(...) has been fixed to fully account
        for whether the HTMLMediaElement has a valid frame to display, making the black layer background
        unnecessary.

        Remove all the instances where we were setting the background color of the video layer to black.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
        * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
        (WebCore::VideoFullscreenLayerManager::setVideoLayer):
        (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):

2017-06-14  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r218161.

        Introduced bot API test failures and Layout Test Failures.

        Reverted changeset:

        "[Cocoa] Expand system-ui to include every item in the Core
        Text cascade list"
        https://bugs.webkit.org/show_bug.cgi?id=173043
        http://trac.webkit.org/changeset/218161

2017-06-14  Alex Christensen  <achristensen@webkit.org>

        Add SPI for immediate injection of user scripts
        https://bugs.webkit.org/show_bug.cgi?id=173342
        <rdar://problem/29202285>

        Reviewed by Brady Eidson.

        The new SPI is WKUserContentController._addUserScriptImmediately.
        It is covered by new API tests.

        * page/Frame.cpp:
        (WebCore::Frame::injectUserScripts):
        (WebCore::Frame::injectUserScriptImmediately):
        Move injection functionality to allow us to call it directly from the new SPI.
        * page/Frame.h:
        * page/Page.cpp:
        (WebCore::Page::forEachPage):
        * page/Page.h:

2017-06-14  Zalan Bujtas  <zalan@apple.com>

        Crash in WebCore::RenderStyle::colorIncludingFallback.
        https://bugs.webkit.org/show_bug.cgi?id=173347
        <rdar://problem/32675317>

        Reviewed by Chris Dumez.

        Starting an SVG image animation synchronously might trigger recursive style recalc.
        We should kick off the animation on a zero timer to reduce callstack complexity. 

        Test: svg/as-image/svg-css-animation.html

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::didAddClient):
        * platform/graphics/Image.cpp:
        (WebCore::Image::Image):
        (WebCore::Image::startAnimationAsynchronously):
        * platform/graphics/Image.h:

2017-06-14  Brady Eidson  <beidson@apple.com>

        WKIconLoadingDelegate never gets asked about the default favicon if touch/touch-precomposed icons are in the <head>
        <rdar://problem/32614328> and https://bugs.webkit.org/show_bug.cgi?id=173376

        Reviewed by Alex Christensen.

        Covered by new API test

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::startIconLoading): Previously we applied the default favicon if the set of LinkIcons was empty.
          Now, apply the default favicon if the set of LinkIcons contains no explicit favicon.

2017-06-14  Jer Noble  <jer.noble@apple.com>

        Flaky Test: media/media-source/media-source-unnecessary-seek-seeked.html
        https://bugs.webkit.org/show_bug.cgi?id=173344

        Reviewed by Eric Carlson.

        Separate the concept of "the page has asked us to seek" from "we have asked the
        media player to seek". When the media engine tells us its ready state has changed
        after the page has requested a seek, but before the media element has asked its
        player to perform the seek, we were previously firing a seeked event. Now we'll
        check this new ivar and see that we aren't expecting a seek to finish yet.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::HTMLMediaElement):
        (WebCore::HTMLMediaElement::setReadyState):
        (WebCore::HTMLMediaElement::finishSeek):
        (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
        * html/HTMLMediaElement.h:

2017-06-14  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r218157.

        This patch caused multiple API failures on iOS Simulator.

        Reverted changeset:

        "@font-face rules with invalid primary fonts never download
        their secondary fonts"
        https://bugs.webkit.org/show_bug.cgi?id=173138
        http://trac.webkit.org/changeset/218157

2017-06-14  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r217997): mint.com header renders incorrectly when initially loaded
        https://bugs.webkit.org/show_bug.cgi?id=173302
        <rdar://problem/32731747>

        Reviewed by Darin Adler.

        r217997 updated ImplicitAnimation::reset() to not call updateStateMachine(AnimationStateInput::RestartAnimation)
        if the compositeAnimation is suspended. If the compositeAnimation is suspended, we would call
        updateStateMachine(AnimationStateInput::AnimationStateInput::PlayStatePaused), which was expected to be a no-op.
        This was needed because otherwise, changing the style of the animated element would restart the animation
        even though it was supposed to be suspended. One thing I did not realize is that calling
        updateStateMachine(AnimationStateInput::AnimationStateInput::PlayStatePaused) on an animation that is already
        in PausedNew state, will cause it to move to PausedWaitResponse state. This is an issue because upon resuming
        we would call AnimationBase::updatePlayState(AnimPlayStatePlaying) which would return early because
        AnimationBase::paused() would return false. To address the issue, we no longer call updateStateMachine(PlayStatePaused)
        in ImplicitAnimation::reset() when the compositeAnimation is suspended, so that the animation stays in
        PausedNew state until we resume. When we resume, AnimationBase::paused() returns false and we actually resume
        the animation.

        Tests:
        fast/animation/css-animation-resuming-when-visible-with-style-change.html
        fast/animation/css-animation-resuming-when-visible-with-style-change2.html

        * page/animation/ImplicitAnimation.cpp:
        (WebCore::ImplicitAnimation::reset):

2017-06-14  Miguel Gomez  <magomez@igalia.com>

        REGRESSION(r216901): ImageDecoders: rendering of large images is broken since r216901
        https://bugs.webkit.org/show_bug.cgi?id=172502

        Reviewed by Carlos Garcia Campos.

        When using GTK and WPE image decoders, the decoded frames are stored inside a Vector of
        ImageFrames inside the decoders. These ImageFrames have and ImageBackingStore with the
        pixels. When a NativeImagePtr is requested, a cairo surface is created from the data
        in those ImageBackingStores, but the data keeps being owned by the backing stores. Due
        to this, if the decoder that created the image gets destroyed, the backing stores for
        the decoded frames get destroyed as well, causing the cairo surfaces that were using
        that data to contain garbage (and potentially cause a crash).

        To fix this, we change ImageBackingStore so the pixels are stored in a SharedBuffer. The
        buffer will be reffed everytime a cairo surface is created with it, and the cairo surfaces
        will unref the buffer when they are destroyed. This way, the pixel data won't be freed
        while there are cairo surfaces using it.

        No new tests, no behaviour change.

        * platform/graphics/ImageBackingStore.h:
        (WebCore::ImageBackingStore::setSize):
        (WebCore::ImageBackingStore::ImageBackingStore):
        * platform/image-decoders/cairo/ImageBackingStoreCairo.cpp:
        (WebCore::ImageBackingStore::image):

2017-06-14  Zan Dobersek  <zdobersek@igalia.com>

        [GStreamer] Align GstBus signal watch priorities with RunLoop dispatches
        https://bugs.webkit.org/show_bug.cgi?id=173348

        Reviewed by Carlos Garcia Campos.

        When adding GstBus signal watches, use the gst_bus_add_signal_watch_full()
        function to also specify the GLib priority that's used for the underlying
        GSource object.

        RunLoopSourcePriority::RunLoopDispatcher should be a good priority value
        to use here, matching the RunLoop::dispatch() priority that's e.g. used
        in the MainThreadNotifier class.

        * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
        (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::AppendPipeline::AppendPipeline):

2017-06-14  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream iOS] Back camera view rendered upside down when in portrait mode
        https://bugs.webkit.org/show_bug.cgi?id=173346
        <rdar://problem/32713675>

        Reviewed by Youenn Fablet.

        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::computeSampleRotation): Use different rotations for front and
        back cameras when device is in portrait orientation.

2017-06-13  Chris Dumez  <cdumez@apple.com>

        Event handlers should not be called in frameless documents
        https://bugs.webkit.org/show_bug.cgi?id=173233

        Reviewed by Sam Weinig.

        As per the HTML specification [1], for event handlers on elements, we should use the
        element's document to check if scripting is disabled [2]. Scripting is considered to
        be disabled if the document has no browsing context (i.e. a frame in WebKit terms).

        In JSLazyEventListener::initializeJSFunction(), instead of using the element's
        document to do the checks, we would use the script execution context. In most cases,
        a node's document and its script execution context are the same so this is not an
        issue. However, if the node's document is a document created via JS, its nodes'
        script execution context will be the document's context document (i.e the one that
        created the document, see implementation of Node::scriptExecutionContext()). In those
        cases, using the wrong document is an issue because the document's context document
        (aka script execution context) may allow scripting but we still do not want to call
        the event handler because its document is frameless.

        This impacts documents created by JS, using the following APIs:
        - DOMParser.parseFromHTML
        - new Document()
        - DOMImplementation.createDocument / createHTMLDocument
        - XHRs whose responseType is Document.

        [1] https://html.spec.whatwg.org/multipage/webappapis.html#getting-the-current-value-of-the-event-handler (step 1.1.)
        [2] https://html.spec.whatwg.org/multipage/webappapis.html#concept-n-noscript

        Tests: fast/events/event-handler-detached-document-dispatchEvent.html
               fast/events/event-handler-detached-document.html

        * bindings/js/JSLazyEventListener.cpp:
        (WebCore::JSLazyEventListener::initializeJSFunction):

2017-06-13  Antoine Quint  <graouts@apple.com>

        Rebaseline media/modern-media-controls/placard-support
        https://bugs.webkit.org/show_bug.cgi?id=173340

        Reviewed by Dean Jackson.

        We make a source change to use a "placard" getter/setter to show or hide a placard, making it
        more convenient to test whether a placard has been set.

        * Modules/modern-media-controls/controls/inline-media-controls.js:
        (InlineMediaControls.prototype.get placard):
        (InlineMediaControls.prototype.set placard):
        (InlineMediaControls.prototype.showPlacard): Deleted.
        (InlineMediaControls.prototype.hidePlacard): Deleted.
        * Modules/modern-media-controls/media/placard-support.js:
        (PlacardSupport.prototype._updatePlacard):
        (PlacardSupport):

2017-06-11  Antoine Quint  <graouts@apple.com>

        Rebaseline media/modern-media-controls/fullscreen-support
        https://bugs.webkit.org/show_bug.cgi?id=173199

        Reviewed by Simon Fraser.

        Test: media/modern-media-controls/fullscreen-support/fullscreen-support-press.html

        We no longer need to track the "error" event for FullscreenSupport since we don't actually
        enable or disable the fullscreen button when an error happens, instead the media controls
        code will simply not present it since we'll be showing a placard instead.

        * Modules/modern-media-controls/media/fullscreen-support.js:
        (FullscreenSupport.prototype.get mediaEvents):

2017-06-13  Matt Rajca  <mrajca@apple.com>

        WebsitePolicies: let clients select specific autoplay quirks
        https://bugs.webkit.org/show_bug.cgi?id=173343

        Reviewed by Alex Christensen.

        Tests: Updated API tests accordingly to use new values.

        Replace the 'allowsAutoplayQuirks' bool with an OptionSet so clients can selectively
        pick auto-play quirks.

        * dom/Document.cpp:
        (WebCore::Document::processingUserGestureForMedia):
        * html/HTMLMediaElement.cpp:
        (WebCore::needsAutoplayPlayPauseEventsQuirk):
        * loader/DocumentLoader.h:
        (WebCore::DocumentLoader::allowedAutoplayQuirks):
        (WebCore::DocumentLoader::setAllowedAutoplayQuirks):
        (WebCore::DocumentLoader::allowsAutoplayQuirks): Deleted.
        (WebCore::DocumentLoader::setAllowsAutoplayQuirks): Deleted.

2017-06-13  Zalan Bujtas  <zalan@apple.com>

        Synchronous media query callbacks on nested frames could produced a detached FrameView.
        https://bugs.webkit.org/show_bug.cgi?id=173330

        Reviewed by Simon Fraser.

        This patch fixes the crash when the nested frame's media query callback triggers navigation on the mainframe.
        webkit.org/b/173329 is to track whether we should allow synchronous callback firing from FrameView::layout(). 

        Covered by show-modal-dialog-during-execCommand.html.

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

2017-06-13  Chris Fleizach  <cfleizach@apple.com>

        AX[macOS]: Expose Inline property as an accessibility attribute
        https://bugs.webkit.org/show_bug.cgi?id=173131
        <rdar://problem/32667686>

        Reviewed by Joanmarie Diggs.

        Expose whether a renderer is inline so that VoiceOver can make better use of that data when deciding what to output.

        Test: accessibility/mac/inline-text-attribute.html

        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

2017-06-13  Jon Davis  <jond@apple.com>

        Update Subresource Integrity status to Supported In Preview
        https://bugs.webkit.org/show_bug.cgi?id=173324

        Reviewed by Sam Weinig.

        * features.json:

2017-06-13  Antoine Quint  <graouts@apple.com>

        Add logging for layout tests when rAF callbacks get suspended and resumed
        https://bugs.webkit.org/show_bug.cgi?id=173326

        Reviewed by Simon Fraser.

        In order to help diagnose webkit.org/b/168409 we log the ScriptedAnimationController
        suspend count when it changes and log the backtrace so that we may understand why it
        fails to be set back to 0 when some modern-media-controls tests run.

        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::suspend):
        (WebCore::ScriptedAnimationController::resume):
        (WebCore::ScriptedAnimationController::logSuspendCount):
        * dom/ScriptedAnimationController.h:
        * page/Settings.in:
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::resetToConsistentState):
        (WebCore::InternalSettings::shouldLogScritedAnimationControllerSuspensionChange):
        (WebCore::InternalSettings::setShouldLogScritedAnimationControllerSuspensionChange):
        * testing/InternalSettings.h:
        * testing/InternalSettings.idl:

2017-06-13  Jer Noble  <jer.noble@apple.com>

        Crash when MSE backed media element changes src/srcObject during PiP
        https://bugs.webkit.org/show_bug.cgi?id=173288

        Reviewed by Alex Christensen.

        Tear down the MediaPlayerPrivateMediaSourceAVFObjC's layers fully whe the player
        is destroyed, which includes removing the player's AVSampleBufferDisplayLayer from
        the HTMLMediaElement's fullscreen layer.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):

2017-06-13  Daniel Bates  <dabates@apple.com>

        Implement W3C Secure Contexts Draft Specification
        https://bugs.webkit.org/show_bug.cgi?id=158121
        <rdar://problem/26012994>

        Reviewed by Brent Fulgham.

        Part 4

        Adds runtime enabled feature flag, isSecureContextAttributeEnabled, to toggle exposing
        the global object property isSecureContext (defaults: true - expose the property).

        Test: security/isSecureContext-disabled.html

        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setIsSecureContextAttributeEnabled):
        (WebCore::RuntimeEnabledFeatures::isSecureContextAttributeEnabled):
        * page/WindowOrWorkerGlobalScope.idl:

2017-06-13  Jer Noble  <jer.noble@apple.com>

        Protect lifetime of media element during HTMLMediaElement::notifyAboutPlaying()
        https://bugs.webkit.org/show_bug.cgi?id=173320
        <rdar://problem/32590276>

        Reviewed by Brent Fulgham.

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

2017-06-13  Youenn Fablet  <youenn@apple.com>

        getReceivers() should return transceivers that have only an active receiver
        https://bugs.webkit.org/show_bug.cgi?id=173313

        Reviewed by Alex Christensen.

        Test: webrtc/video-receivers.html

        Creating transceivers for receivers created from an offer.
        Setting these as recvonly.

        * Modules/mediastream/RTCRtpTransceiver.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):

2017-06-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unable to paste text that was copied from a page into the universal search field
        https://bugs.webkit.org/show_bug.cgi?id=173293
        <rdar://problem/32440918>

        Reviewed by Ryosuke Niwa.

        Vend "public.utf8-plain-text" and "public.utf16-plain-text" as additional representations on the pasteboard when
        copying both rich and plain web content in PlatformPasteboardIOS.mm. This is because UITextView no longer
        supports pasting "public.text" as text in iOS 11.

        Tests:
        UIPasteboardTests.CopyPlainTextWritesConcreteTypes
        UIPasteboardTests.CopyRichTextWritesConcreteTypes

        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::writePlainText):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::write):

2017-06-13  Sam Weinig  <sam@webkit.org>

        Rename JSDOMWindowShell to JSDOMWindowProxy to match the HTML5 spec.
        https://bugs.webkit.org/show_bug.cgi?id=80733

        Reviewed by Chris Dumez.

        Goodbye dear shell.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/DOMWrapperWorld.cpp:
        (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
        (WebCore::DOMWrapperWorld::clearWrappers):
        * bindings/js/DOMWrapperWorld.h:
        (WebCore::DOMWrapperWorld::didCreateWindowProxy):
        (WebCore::DOMWrapperWorld::didDestroyWindowProxy):
        (WebCore::DOMWrapperWorld::didCreateWindowShell): Deleted.
        (WebCore::DOMWrapperWorld::didDestroyWindowShell): Deleted.
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::JSDOMWindowBase):
        (WebCore::JSDOMWindowBase::finishCreation):
        (WebCore::JSDOMWindowBase::willRemoveFromWindowProxy):
        (WebCore::JSDOMWindowBase::proxy):
        (WebCore::toJSDOMWindow):
        (WebCore::JSDOMWindowBase::willRemoveFromWindowShell): Deleted.
        (WebCore::JSDOMWindowBase::shell): Deleted.
        * bindings/js/JSDOMWindowBase.h:
        (WebCore::toJS):
        (WebCore::toJSDOMWindow):
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::toWrapped):
        * bindings/js/JSDOMWindowCustom.h:
        * bindings/js/JSDOMWindowProperties.h:
        (WebCore::JSDOMWindowProperties::JSDOMWindowProperties):
        * bindings/js/JSDOMWindowProxy.cpp: Copied from WebCore/bindings/js/JSDOMWindowShell.cpp.
        (WebCore::JSDOMWindowProxy::JSDOMWindowProxy):
        (WebCore::JSDOMWindowProxy::finishCreation):
        (WebCore::JSDOMWindowProxy::destroy):
        (WebCore::JSDOMWindowProxy::setWindow):
        (WebCore::JSDOMWindowProxy::wrapped):
        (WebCore::JSDOMWindowProxy::toWrapped):
        (WebCore::toJS):
        (WebCore::toJSDOMWindowProxy):
        (WebCore::JSDOMWindowShell::JSDOMWindowShell): Deleted.
        (WebCore::JSDOMWindowShell::finishCreation): Deleted.
        (WebCore::JSDOMWindowShell::destroy): Deleted.
        (WebCore::JSDOMWindowShell::setWindow): Deleted.
        (WebCore::JSDOMWindowShell::wrapped): Deleted.
        (WebCore::JSDOMWindowShell::toWrapped): Deleted.
        (WebCore::toJSDOMWindowShell): Deleted.
        * bindings/js/JSDOMWindowProxy.h: Copied from WebCore/bindings/js/JSDOMWindowShell.h.
        (WebCore::JSDOMWindowProxy::create):
        (WebCore::toJSDOMWindowProxy):
        (WebCore::JSDOMWindowShell::window): Deleted.
        (WebCore::JSDOMWindowShell::create): Deleted.
        (WebCore::JSDOMWindowShell::createStructure): Deleted.
        (WebCore::JSDOMWindowShell::world): Deleted.
        (WebCore::toJSDOMWindowShell): Deleted.
        * bindings/js/JSDOMWindowShell.cpp: Removed.
        * bindings/js/JSDOMWindowShell.h: Removed.
        * bindings/js/JSEventTargetCustom.cpp:
        (WebCore::JSEventTarget::toWrapped):
        * bindings/js/JSHTMLDocumentCustom.cpp:
        (WebCore::JSHTMLDocument::open):
        * bindings/js/ScheduledAction.cpp:
        (WebCore::ScheduledAction::execute):
        * bindings/js/ScriptCachedFrameData.cpp:
        (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
        (WebCore::ScriptCachedFrameData::restore):
        * bindings/js/ScriptController.cpp:
        (WebCore::collectGarbageAfterWindowProxyDestruction):
        (WebCore::ScriptController::~ScriptController):
        (WebCore::ScriptController::destroyWindowProxy):
        (WebCore::ScriptController::createWindowProxy):
        (WebCore::ScriptController::evaluateInWorld):
        (WebCore::ScriptController::loadModuleScriptInWorld):
        (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
        (WebCore::ScriptController::evaluateModule):
        (WebCore::ScriptController::windowProxies):
        (WebCore::ScriptController::clearWindowProxiesNotMatchingDOMWindow):
        (WebCore::ScriptController::setDOMWindowForWindowProxy):
        (WebCore::ScriptController::initScript):
        (WebCore::ScriptController::setupModuleScriptHandlers):
        (WebCore::ScriptController::eventHandlerPosition):
        (WebCore::ScriptController::enableEval):
        (WebCore::ScriptController::disableEval):
        (WebCore::ScriptController::canAccessFromCurrentOrigin):
        (WebCore::ScriptController::attachDebugger):
        (WebCore::ScriptController::updateDocument):
        (WebCore::ScriptController::cacheableBindingRootObject):
        (WebCore::ScriptController::bindingRootObject):
        (WebCore::ScriptController::createRootObject):
        (WebCore::ScriptController::collectIsolatedContexts):
        (WebCore::ScriptController::windowScriptNPObject):
        (WebCore::ScriptController::jsObjectForPluginElement):
        (WebCore::ScriptController::cleanupScriptObjectsForPlugin):
        (WebCore::ScriptController::clearScriptObjects):
        (WebCore::ScriptController::executeIfJavaScriptURL):
        (WebCore::collectGarbageAfterWindowShellDestruction): Deleted.
        (WebCore::ScriptController::destroyWindowShell): Deleted.
        (WebCore::ScriptController::createWindowShell): Deleted.
        (WebCore::ScriptController::windowShells): Deleted.
        (WebCore::ScriptController::clearWindowShellsNotMatchingDOMWindow): Deleted.
        (WebCore::ScriptController::setDOMWindowForWindowShell): Deleted.
        * bindings/js/ScriptController.h:
        (WebCore::ScriptController::windowProxy):
        (WebCore::ScriptController::existingWindowProxy):
        (WebCore::ScriptController::globalObject):
        (WebCore::ScriptController::windowShell): Deleted.
        (WebCore::ScriptController::existingWindowShell): Deleted.
        * bindings/js/ScriptControllerMac.mm:
        (WebCore::ScriptController::windowScriptObject):
        * bindings/js/ScriptState.cpp:
        (WebCore::mainWorldExecState):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        (GenerateOverloadDispatcher):
        (GenerateImplementation):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::clear):
        (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
        * page/Frame.cpp:
        * page/csp/ContentSecurityPolicy.cpp:
        (WebCore::ContentSecurityPolicy::didCreateWindowProxy):
        (WebCore::ContentSecurityPolicy::didCreateWindowShell): Deleted.
        * page/csp/ContentSecurityPolicy.h:

2017-06-13  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix typo in variable introduced in r218108.

        * page/cocoa/MemoryReleaseCocoa.mm:
        (WebCore::platformReleaseMemory):
        (WebCore::registerSQLiteMemoryPressureHandler):

2017-06-13  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: [ATK] Implement missing AtkRelation types
        https://bugs.webkit.org/show_bug.cgi?id=155494

        Reviewed by Darin Adler.

        Add methods for getting the element(s) which reference a particular element via an
        ARIA attribute. Then use those methods to identify and expose the expected reverse/
        reciprocal AtkRelationType and targets. Also add ATK support for aria-owns.

        Use SpaceSplitString in AccessibilityObject::elementsFromAttribute() so that unexpected
        whitespace characters in an attribute's list of ids does not prevent the desired element
        from being found.

        Lastly, change the return type of AccessibilityObject::identifierAttribute() from a String
        to a const AtomicString& for better efficiency.

        Tests: accessibility/aria-owns.html
               accessibility/gtk/relation-types.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::identifierAttribute):
        (WebCore::AccessibilityObject::elementsFromAttribute):
        (WebCore::AccessibilityObject::ariaElementsReferencedByAttribute):
        (WebCore::AccessibilityObject::ariaControlsReferencingElements):
        (WebCore::AccessibilityObject::ariaDescribedByReferencingElements):
        (WebCore::AccessibilityObject::ariaFlowToReferencingElements):
        (WebCore::AccessibilityObject::ariaLabelledByReferencingElements):
        (WebCore::AccessibilityObject::ariaOwnsReferencingElements):
        * accessibility/AccessibilityObject.h:
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (setAtkRelationSetFromCoreObject):

2017-06-13  Gwang Yoon Hwang  <yoon@igalia.com>

        [GStreamerGL] Release GstVideoFrame when there is a flush event from the pipeline
        https://bugs.webkit.org/show_bug.cgi?id=172427

        Reviewed by Žan Doberšek.

        Without GStreamerGL MediaPlayerPrivateGStreamer copies the video frame from
        the decoder's buffer to the texture to display a video. So it makes possible
        to release the GstSample when it got a flush start event to free the decoder's
        buffer to the decoder without side-effects.

        Unlike the traditional way to render video, GStreamer GL does not copy a
        texture from the decoder to the texture mapper's buffer to draw video frame.
        It uses same GstMemory with the gst pipeline to manage the texture to prevent
        copy operations. So without releasing a layer buffer, there is no way to
        return GstMemory to the buffer pool.

        This patch releases current GstSample when the player got the flush start
        event.  It destructs the platform layer buffer any time there is a flush start
        event.

        However, it is not enough to release the GstMemory. The platform layer proxy
        should copy current buffer to show it to the compositor instead of a blank
        frame. It prevents flickerings until getting a new frame after handling flush
        events.

        No new tests, there shouldn't be behavior changes

        * platform/graphics/cairo/ImageBufferCairo.cpp:
        (WebCore::ImageBufferData::swapBuffersIfNeeded):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
        (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
        (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Adds
        handler for the flush event.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        * platform/graphics/texmap/BitmapTextureGL.cpp:
        (WebCore::BitmapTextureGL::BitmapTextureGL):
        (WebCore::BitmapTextureGL::copyFromExternalTexture): Copies
        a external texture to the managed texture.
        * platform/graphics/texmap/BitmapTextureGL.h:
        (WebCore::BitmapTextureGL::create):
        To create the managed texture with specific format, this patch adds a
        optional parameter for a texture format.
        * platform/graphics/texmap/TextureMapper.h:
        * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
        (WebCore::TextureMapperGC3DPlatformLayer::swapBuffersIfNeeded):
        * platform/graphics/texmap/TextureMapperGL.cpp:
        (WebCore::TextureMapperGL::createTexture):
        * platform/graphics/texmap/TextureMapperGL.h:
        * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
        (WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer):
        (WebCore::TextureMapperPlatformLayerBuffer::clone):
        * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
        (WebCore::TextureMapperPlatformLayerProxy::appendToUnusedBuffers): Added
        to schedule releasing unused buffers in main thread.
        (WebCore::TextureMapperPlatformLayerProxy::swapBuffer):
        (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:

2017-06-13  Youenn Fablet  <youenn@apple.com>

        Filter SDP from ICE candidates in case of local ICE candidate filtering
        https://bugs.webkit.org/show_bug.cgi?id=173120

        Reviewed by Eric Carlson.

        Covered by updated test.

        Adding filtering of local description in getters and createOffer promise.

        * Modules/mediastream/MediaEndpointSessionDescription.cpp:
        (WebCore::MediaEndpointSessionDescription::toRTCSessionDescription):
        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::createOfferSucceeded):
        (WebCore::filterICECandidate):
        (WebCore::PeerConnectionBackend::filterSDP):
        * Modules/mediastream/PeerConnectionBackend.h:
        * Modules/mediastream/RTCSessionDescription.h:
        (WebCore::RTCSessionDescription::setSdp):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::currentLocalDescription):
        (WebCore::LibWebRTCPeerConnectionBackend::pendingLocalDescription):
        (WebCore::LibWebRTCPeerConnectionBackend::localDescription):

2017-06-12  Myles C. Maxfield  <mmaxfield@apple.com>

        [iOS] [macOS] Stop soft-linking Core Text function in iOS 11 and macOS High Sierra
        https://bugs.webkit.org/show_bug.cgi?id=173289

        Reviewed by Lucas Forschler.

        No new tests because there is no behavior change.

        * platform/graphics/ios/FontCacheIOS.mm:
        (WebCore::platformFontWithFamilySpecialCase):
        * platform/graphics/mac/FontCacheMac.mm:
        (WebCore::platformFontWithFamilySpecialCase):

2017-06-12  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Expand system-ui to include every item in the Core Text cascade list
        https://bugs.webkit.org/show_bug.cgi?id=173043
        <rdar://problem/21125708>

        Reviewed by Simon Fraser.

        The concept of the system font on Cocoa platforms represents the entire Core Text cascade list.
        However, previously, WebKit only represented system-ui by pulling out the first item in the Core
        Text cascade list. Instead, we should make all text rendered with "system-ui" match what the
        platform would natively render.

        Previously, we walked through the strings in the font-family property and looked them up one by
        one. However, now we want to abstract this idea of a font family to possibly hold a
        CTFontDescriptorRef instead of a string. This way, we expand a font-family list of ["fontA",
        "system-ui", "fontB"] to ["fontA", ... a bunch of CTFontDescriptorRefs ..., "FontB"]. We can
        then modify the consumer of this object to have two codepaths: the old string-based codepath,
        and a new, platform-specific codepath which simply embeds the CTFontDesriptorRefs inside a Font
        object.

        We don't want to simply pull out the family name from each item in the Core Text fallback list
        because that is a lossy translation. There is more information in these font descriptors which
        cannot be represented by CSS. Therefore, we must keep the descriptors alive and add the new
        codepath for them.

        We also don't want to run the CSS font matching algorithm on each member of the Core Text
        fallback list because it may yield different results from Core Text's font matching algorithm.
        Our goal is to draw text as closely as possible to the system APIs. If we ran it, we may find
        a font which is closer to the requested traits, but it would look out of place on the system.

        Tests: fast/text/system-font-fallback-emoji.html
               fast/text/system-font-fallback.html

        * WebCore.xcodeproj/project.pbxproj:
        * page/MemoryRelease.cpp:
        (WebCore::releaseNoncriticalMemory):
        * platform/graphics/FontCascadeFonts.cpp:
        (WebCore::realizeNextFallback): The consumer of our new data type. Now uses WTF::visit().
        (WebCore::FontCascadeFonts::realizeFallbackRangesAt): Now that the number of items to test
        against the current character is larger than the number of strings in the font-family list,
        we need to update the existing code to use the correct value.
        * platform/graphics/FontDescription.cpp: Default implementation for non-Cocoa ports.
        (WebCore::FontDescription::invalidateCaches):
        (WebCore::FontCascadeDescription::effectiveFamilyCount):
        (WebCore::FontCascadeDescription::effectiveFamilyAt):
        * platform/graphics/FontDescription.h: Our new data type is a Variant of AtomicString and a
        platform-specific class. Cocoa uses a class that holds a CTFontDescriptorRef and other ports
        use an empty non-constructable class.
        * platform/graphics/FontFamilySpecificationNull.h: Added. The empty non-constructable
        class.
        (WebCore::FontFamilySpecificationNull::fontRanges):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::FontCache::platformInit): Changing the system language will change the system font
        fallback list, so we need to listen to this notification. This also matters for
        FontCache::systemFallbackForCharacters(), so we should build off the same callback we are
        already using for font installation.
        (WebCore::invalidateFontCache):
        * platform/graphics/cocoa/FontDescriptionCocoa.cpp: Added. The platform-specific creation of
        our CTFontDescriptorRefs. We hold them cached in a SystemFontDatabase.
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
        (WebCore::SystemFontDatabase::singleton):
        (WebCore::SystemFontDatabase::systemFontCascadeList):
        (WebCore::SystemFontDatabase::clear):
        (WebCore::SystemFontDatabase::SystemFontDatabase):
        (WebCore::SystemFontDatabase::applyWeightAndItalics):
        (WebCore::SystemFontDatabase::removeCascadeList):
        (WebCore::SystemFontDatabase::computeCascadeList):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal):
        (WebCore::isSystemFontString):
        (WebCore::systemFontParameters):
        (WebCore::FontDescription::invalidateCaches):
        (WebCore::FontCascadeDescription::effectiveFamilyCount): We don't store the result of this
        because it would probably be a bad idea to increase the size of every single FontCascade just
        in case it might ask for the system font. Most fonts never mention system-ui. Because it's so
        rare, we can just recalculate the result of this as necessary. This shouldn't be slow because
        the results are cached.
        (WebCore::FontCascadeDescription::effectiveFamilyAt):
        * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: Added.
        (WebCore::FontFamilySpecificationCoreText::fontRanges): Create a FontRanges from a
        CTFontDescriptorRef.
        * platform/graphics/cocoa/FontFamilySpecificationCoreText.h: Added.
        (WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText):
        * platform/graphics/ios/FontCacheIOS.mm: Delete the old handling for system-ui.
        (WebCore::platformFontWithFamilySpecialCase):
        (WebCore::baseSystemFontDescriptor): Deleted.
        (WebCore::systemFontModificationAttributes): Deleted.
        (WebCore::systemFontDescriptor): Deleted.
        * platform/graphics/mac/FontCacheMac.mm: Ditto.
        (WebCore::platformFontWithFamilySpecialCase):
        (WebCore::toNSFontWeight): Deleted.

2017-06-12  Daewoong Jang  <daewoong.jang@navercorp.com>

        Remove WebCore::unloadModule and related data types
        https://bugs.webkit.org/show_bug.cgi?id=173231

        Reviewed by Darin Adler.

        * platform/FileSystem.h:
        (WebCore::PlatformModuleVersion::PlatformModuleVersion): Deleted.
        * platform/glib/FileSystemGlib.cpp:
        (WebCore::unloadModule): Deleted.
        * platform/win/FileSystemWin.cpp:
        (WebCore::unloadModule): Deleted.

2017-06-12  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix; fix a misspelling in CoreMediaSoftLink.{h,cpp}.

        * platform/cf/CoreMediaSoftLink.cpp:
        * platform/cf/CoreMediaSoftLink.h:

2017-06-12  Myles C. Maxfield  <mmaxfield@apple.com>

        @font-face rules with invalid primary fonts never download their secondary fonts
        https://bugs.webkit.org/show_bug.cgi?id=173138
        <rdar://problem/32554450>

        Reviewed by Simon Fraser.

        We have logic in CSSFontAccessor::font() which disallows downloading a CSSFontFace if that CSSFontFace
        is already in the Succeeded state. However, it was possible for a succeeded CSSFontFace to still fail
        to create a font. In this situation, we wouldn't be able to use the downloaded font, and we wouldn't
        try to download the next item in the src: list because the CSSFontFace is succeeded.

        This patch strengthens the meaning of the Succeeded state. Previously, it just meant that the bytes
        in the file were downloaded successfully. This patch extends this to also mean that the bytes in the
        file can be successfully interpreted as a font. This way, the CSSFontFace in the example above won't be
        set to the Succeeded state, so we will continue follow the src: list and download the secondary fonts.

        This has an added benefit that the CSS Font Loading API's promises will be called more appropriately.
        The transition to the Succeeded state will trigger a resolve of the promise. Now, these promises will
        only be resolved if the fonts are actually parsed and understood by our text system.

        Test: fast/text/font-fallback-invalid-load.html

        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::fontLoaded): Move to the failed state if we can't understand the font
        data. This is the crux of this patch.
        (WebCore::CSSFontFaceSource::font): This function should only be called if we are in the Succeeded
        state, which means now we know we should always be able to understand the bytes of the file. Therefore,
        we can change some if statements into ASSERT()s.
        * loader/cache/CachedSVGFont.cpp:
        (WebCore::CachedSVGFont::createFont): Ditto.
        (WebCore::CachedSVGFont::platformDataFromCustomData): Similarly to CSSFontFaceSource::fontLoaded(), this
        adds another check to our criteria for transitioning into the Succeeded state, which will guarantee that
        later we will always be able to create the font object.

2017-06-12  Chris Dumez  <cdumez@apple.com>

        Add Arabic Kasra to list of blacklisted characters when puny-decoding URL
        https://bugs.webkit.org/show_bug.cgi?id=173283
        <rdar://problem/32725659>

        Reviewed by Brent Fulgham.

        Add Arabic Kasra to list of blacklisted characters when puny-decoding URL as
        it is almost invisible in the URL bar.

        Test: fast/url/user-visible/arabic_kasra.html

        * platform/mac/WebCoreNSURLExtras.mm:
        (WebCore::isLookalikeCharacter):

2017-06-12  Jer Noble  <jer.noble@apple.com>

        Screen sleeps while doing WebRTC video
        https://bugs.webkit.org/show_bug.cgi?id=173278

        Reviewed by Eric Carlson.

        HTMLMediaElement triggers changing the sleep disabler token when the media engine
        says that its rate has changed; the MediaPlayerPrivateMediaStreamAVFObjC needs to
        notify its client (the HTMLMediaElement) that the rate has changed when the stream
        is played or paused.

        Drive-by fix: Don't set a sleep disabler token (i.e., allow the system and display
        to sleep) if the stream is strictly local-capture.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::shouldDisableSleep):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause):

2017-06-12  Jer Noble  <jer.noble@apple.com>

        Seeking an MSE video will begin playing audio long before rendering video
        https://bugs.webkit.org/show_bug.cgi?id=173269

        Reviewed by Eric Carlson.

        Add a notification listener which will be messaged when a to-be-displayed sample
        is decoded to signal that the 'seeked' event should fire. Consolidate all the various
        flush methods to funnel into a single flushVideo().

        * platform/cf/CoreMediaSoftLink.cpp:
        * platform/cf/CoreMediaSoftLink.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (-[WebBufferConsumedContext initWithParent:buffer:]):
        (-[WebBufferConsumedContext dealloc]):
        (-[WebBufferConsumedContext parent]):
        (-[WebBufferConsumedContext buffer]):
        (WebCore::bufferWasConsumedCallback):
        (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
        (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
        (WebCore::SourceBufferPrivateAVFObjC::flush):
        (WebCore::SourceBufferPrivateAVFObjC::flushVideo):
        (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
        (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
        (WebCore::SourceBufferPrivateAVFObjC::willSeek):

2017-06-12  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream iOS] Set audio session mode and options when capturing
        https://bugs.webkit.org/show_bug.cgi?id=173276
        <rdar://problem/32059254>

        Reviewed by Jer Noble.

        * platform/audio/ios/AudioSessionIOS.mm:
        (WebCore::AudioSession::setCategory): Set mode and options so the default output is to the speaker,
        and so audio will be routed to bluetooth when appropriate.

2017-06-12  Jeremy Jones  <jeremyj@apple.com>

        Remove watchdog timer from WebVideoFullscreenInterfaceAVKit
        https://bugs.webkit.org/show_bug.cgi?id=173272
        rdar://problem/32260378

        Reviewed by Jer Noble.

        No new tests because no effect on DOM.

        WebVideoFullscreenInterfaceAVKit's watchdog attempts to clean-up fullscreen if the page becomes unresponsive.
        However, it is just calling exitfullscreen(), which initiates the animation, but leaves the fullscreen window
        in place and doesn't initiate cleanup. This leaves the browser in an unusable state since all events will still
        be captured by the fullscren window.

        This change uses the same method of hiding fullscreen window as switching tabs does. This will
        hide the fullscreen winodw and controller, leaving the browser available for interaction, and the page
        can take its time to properly cleanup the fullscreen window while hidden.

        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebVideoFullscreenInterfaceAVKit::watchdogTimerFired):

2017-06-12  Alex Christensen  <achristensen@webkit.org>

        Modernize UserScript.h
        https://bugs.webkit.org/show_bug.cgi?id=173273

        Reviewed by Tim Horton.

        No change in behavior. Moved encoders to UserScript.h. Use more Rvalues.

        * page/UserScript.h:
        (WebCore::UserScript::UserScript):
        (WebCore::UserScript::encode):
        (WebCore::UserScript::decode):

2017-06-12  Aaron Chu  <aaron_chu@apple.com>

        AX: Video/Audio Player Controls missing group container.
        https://bugs.webkit.org/show_bug.cgi?id=171790
        <rdar://problem/32008994>

        Reviewed by Antoine Quint.

        Added aria-label to group controls in media controls.

        * English.lproj/modern-media-controls-localized-strings.js:
        * Modules/modern-media-controls/controls/controls-bar.js:
        * Modules/modern-media-controls/controls/inline-media-controls.js:
        (InlineMediaControls):
        (InlineMediaControls.prototype.set shouldUseAudioLayout):
        (InlineMediaControls.prototype._updateBottomControlsBarLabel):

2017-06-12  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Use SynchronousLoaderClient for platformLoadResourceSynchronously on WinCairo
        https://bugs.webkit.org/show_bug.cgi?id=173195

        Reviewed by Alex Christensen.

        * PlatformWinCairo.cmake:
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/curl/SynchronousLoaderClientCurl.cpp: Added.
        (WebCore::SynchronousLoaderClient::didReceiveAuthenticationChallenge):
        (WebCore::SynchronousLoaderClient::platformBadResponseError):

2017-06-12  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream iOS] If a capturing tab is muted while it is in the background, it can not be unmuted
        https://bugs.webkit.org/show_bug.cgi?id=173268
        <rdar://problem/32259809>

        Reviewed by Jer Noble.

        No new tests, tested manually.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::startProducingData): Mute the private stream if page capture is muted.
        (WebCore::MediaStream::mediaState): Set new interrupted state.

        * dom/Document.cpp:
        (WebCore::Document::notifyMediaCaptureOfVisibilityChanged): Don't track "muted for visibility"
        state, let the source center deal with it.
        * dom/Document.h:

        * page/MediaProducer.h: Add bits for interrupted audio and video capture.

        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::RealtimeMediaSource): Drive-by fix: delete m_suppressNotifications,
        it isn't used.
        (WebCore::RealtimeMediaSource::setInterrupted): New. Mute capture when an interruption begins,
        and unmute when it ends in an unmuted page.
        (WebCore::RealtimeMediaSource::setMuted): Do not unmute if interrupted.
        (WebCore::RealtimeMediaSource::settingsDidChange): Don't check m_suppressNotifications, it is
        never set.
        * platform/mediastream/RealtimeMediaSource.h:

        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::setVideoCapturePageState): Renamed from 
        setVideoCaptureMutedForPageVisibility.
        (WebCore::RealtimeMediaSourceCenter::setVideoCaptureMutedForPageVisibility): Deleted.
        * platform/mediastream/RealtimeMediaSourceCenter.h:

        * platform/mediastream/mac/AVMediaCaptureSource.h:
        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        (WebCore::AVMediaCaptureSource::stopProducingData): Clear m_interruption because the session
        has been deleted, so we will never get an "end interruption" notification.
        (WebCore::AVMediaCaptureSource::captureSessionIsRunningDidChange): Don't return early if
        the muted state needs to be updated.
        (WebCore::AVMediaCaptureSource::captureSessionEndInterruption): Return early if the session
        has been cleared.
        (WebCore::AVMediaCaptureSource::interrupted): New.

        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSourceFactory::setVideoCapturePageState): Renamed from 
        setVideoCaptureMutedForPageVisibility.
        (WebCore::AVVideoCaptureSourceFactory::setVideoCaptureMutedForPageVisibility): Deleted.

        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState): Ditto.
        (WebCore::MockRealtimeVideoSourceFactory::setVideoCaptureMutedForPageVisibility): Deleted.

2017-06-12  Jiewen Tan  <jiewen_tan@apple.com>

        [WebCrypto] Remove experimental feature flag of SubtleCrypto
        https://bugs.webkit.org/show_bug.cgi?id=173197
        <rdar://problem/32688148>

        Reviewed by Brent Fulgham.

        The SubtleCrypto implementation is no longer experimental and is ready for production use. We are therefore removing the runtime flag.

        No tests.

        * page/Crypto.idl:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setSubtleCryptoEnabled): Deleted.
        (WebCore::RuntimeEnabledFeatures::subtleCryptoEnabled): Deleted.

2017-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS DnD] Allow the injected bundle to add client data when writing an image to the pasteboard
        https://bugs.webkit.org/show_bug.cgi?id=173238
        <rdar://problem/31943370>

        Reviewed by Ryosuke Niwa and Tim Horton.

        Add clientTypes and clientData to PasteboardImage, and call out to the injected bundle using
        getClientPasteboardDataForRange when writing a PasteboardImage. When generating item providers for dragging in
        the UI process in PlatformPasteboard, add any available client data as representations to the initialization
        list used to set the WebItemProviderPasteboard.

        Test: DataInteraction.InjectedBundleImageElementData

        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::writeImageToPasteboard):
        * platform/Pasteboard.h:
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::writeObjectRepresentations):

2017-06-12  Sam Weinig  <sam@webkit.org>

        [WebIDL] Re-implement GetOwnPropertySlot[ByIndex] generation to more closely follow WebIDL
        https://bugs.webkit.org/show_bug.cgi?id=173229

        Reviewed by Chris Dumez.

        * WebCore.xcodeproj/project.pbxproj:
        * CMakeLists.txt:
        * bindings/js/JSBindingsAllInOne.cpp:
        Remove JSHTMLFrameSetElementCustom.cpp which is no longer needed.

        * bindings/js/JSDOMAbstractOperations.h:
        (WebCore::isVisibleNamedProperty):
        Add OverrideBuiltins enum as requested by a previous review (and I forgot address) and adopt it
        in isVisibleNamedProperty, switch to VMInquiry as we use elsewhere and add a missing FIXME.

        (WebCore::accessVisibleNamedProperty):
        Add variation of isVisibleNamedProperty that takes a functor and returns either the value the
        functor returns, or std::nullopt. This allows getOwnPropertySlot to avoid doing two lookups for
        property, once in the named property visibility algorithm and again when it needs the value.

        * bindings/js/JSDOMWindowBase.cpp:
        * bindings/js/JSDOMWindowBase.h:
        * bindings/js/JSDOMWindowShell.cpp:
        * bindings/js/JSDOMWindowShell.h:
        Standardize toJS functions to match generated code (have one that takes a reference, and does the
        cast, and one that takes a pointer, does a null check and calls the one that takes a reference).
        
        * bindings/js/JSHTMLDocumentCustom.cpp:
        (WebCore::JSHTMLDocument::getOwnPropertySlot):.
        Update to use the implementation namedItem (which is also used by the generated getOwnPropertySlotByIndex)
        and match the updated bindings rules. This cannot yet be generated due to the odd case of the 'open'
        property requiring custom treatment. I tried removing this, but it cause tests to fail in a way that indicated
        that accessing the lexical global object in the open implementation was not working correctly.

        * bindings/js/JSHTMLFrameSetElementCustom.cpp: Removed.
        Now generated.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateIndexedGetter):
        Add description from the spec and change to return the computed values rather than
        print them to the output array. This will be useful for some clients going forward,
        who only want the attributes.

        (GenerateNamedGetter):
        Add description from the spec and change to return the computed values rather than
        print them to the output array. This will be useful for some clients going forward,
        who only want the attributes. Also greatly simplifies things as [CustomNamedGetter]s
        are no longer needed/supported and the exception / null value checks are performed
        elsewhere.

        (GenerateNamedGetterLambda):
        This generates a lambda functor for use in accessVisibleNamedProperty(...). It
        handles calling the named getter implementation, and transforming the result into
        an one that can be reasoned about by accessVisibleNamedProperty, specifically,
        converting it from using IDL's notion of nullability to std::optional. 

        (GenerateGetOwnPropertySlot):
        (GenerateGetOwnPropertySlotByIndex):
        Add spec annotations and use helper functions. 

        (GenerateGetOwnPropertyNames):
        Add FIXME about supporting non-contiguous indices (should that ever come up)
        and use JSObject explicitly, rather than base, to get the default getOwnPropertyNames
        implementation.

        (GeneratePut):
        Use JSObject explicitly, rather than base, to get the default put implementation.

        (GeneratePutByIndex):
        Use JSObject explicitly, rather than base, to get the default putByIndex implementation.

        (GenerateDefineOwnProperty):
        Use JSObject explicitly, rather than base, to get the default getOwnPropertySlot/defineOwnProperty
        implementations.

        (GenerateDeletePropertyCommon):
        Adopt new OverrideBuiltins enum.

        (GenerateDeletePropertyDefinition):
        Use JSObject explicitly, rather than base, to get the default deleteProperty implementation.

        (GenerateDeletePropertyByIndexDefinition):
        Use JSObject explicitly, rather than base, to get the default deletePropertyByIndex implementation.

        (InstanceOverridesGetOwnPropertySlot):
        Remove [CustomNamedGetter] use.
 
        (GenerateHeader):
        Remove [CustomNamedGetter] use and merge InstanceOverridesGetOwnPropertySlotByIndex into
        InstanceOverridesGetOwnPropertySlot. Specifying either [CustomGetOwnPropertySlot] or
        [CustomGetOwnPropertySlotByIndex] will now declare both hooks.
        
        (GenerateImplementation):
        Rename GenerateGetOwnPropertySlotBody/GenerateGetOwnPropertySlotByIndexBody to remove the 'Body',
        and predicate their generation purely on InstanceOverridesGetOwnPropertySlot as noted for the 
        reasons above.

        (GenerateGetOwnPropertySlotBody): Deleted.
        (GenerateGetOwnPropertySlotBodyByIndex): Deleted.
        (InstanceOverridesGetOwnPropertySlotByIndex): Deleted.

        * bindings/scripts/IDLAttributes.json:
        Remove [CustomNamedGetter].

        * dom/ExceptionOr.h:
        (WebCore::ExceptionOr<ReturnType>::returnValue):
        Add a function to peek at the return value

        * html/HTMLDocument.h:
        * html/HTMLDocument.cpp:
        (WebCore::HTMLDocument::clear):
        (WebCore::HTMLDocument::captureEvents):
        (WebCore::HTMLDocument::releaseEvents):
        Move clear up to be with the other obsolete no-op functions. Add spec annotations
        to clear up any confusion about why they are no-ops.

        (WebCore::HTMLDocument::namedItem):
        Add implementation of namedItem based on the one that was in JSDOMHTMLDocumentCustom.cpp.

        (WebCore::HTMLDocument::supportedPropertyNames):
        Add stub version of supportedPropertyNames with the algorithm we need to implement.
        I don't want to change behavior in this patch, and since we have not enumerated the
        properties of document in the past, I left this unimplemented for now.

        * html/HTMLDocument.idl:
        Remove [CustomNamedGetter] and add named getter.

        * html/HTMLFrameSetElement.h:
        * html/HTMLFrameSetElement.cpp:
        (WebCore::HTMLFrameSetElement::namedItem):
        Add named getter based on the implementation in JSHTMLFrameSetElementCustom.cpp.

        (WebCore::HTMLFrameSetElement::supportedPropertyNames):
        As noted above, I don't want to change behavior with this change, so I have left this unimplemented
        for now. However, we may not want to implement it at all, as this named getter is not specified and
        at least Firefox does not support it.

        * html/HTMLFrameSetElement.idl:
        Remove [CustomNamedGetter] and add named getter.

        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        Update test results.

        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Removed.
        * bindings/scripts/test/JS/JSTestCustomNamedGetter.h: Removed.
        * bindings/scripts/test/TestCustomNamedGetter.idl: Removed.
        Remove test of [CustomNamedGetter] which no longer exists. 

2017-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        WebItemProviderPasteboard should call its completion block immediately after a synchronous load
        https://bugs.webkit.org/show_bug.cgi?id=173225
        <rdar://problem/32713144>

        Reviewed by Tim Horton.

        Ensures that a completion block passed to doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout: will be
        invoked immediately, if a synchronous timeout is specified and loading finishes before the synchronous timeout
        is reached. To do this, we first factor out the completion logic into a new block. If the synchronous timeout
        exists and dispatch_group_wait returns 0 (indicating that the dispatch group finished without hitting the
        wait timeout) we simply invoke the block and return early; otherwise, we will register the completion block
        using dispatch_group_notify.

        Test: DataInteractionTests.WebItemProviderPasteboardLoading

        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):

2017-06-12  Jeremy Jones  <jeremyj@apple.com>

        WebAVPlayerController minTime and maxTime should be calculated properties to provide correct values when streaming.
        https://bugs.webkit.org/show_bug.cgi?id=173193
        rdar://problem/32684807

        Reviewed by Jer Noble.

        No new tests because no affect on the DOM. This only affects properties consumed to AVKit.

        -minTime and -maxTime should be calculated properties so they supply the exptected values to AVKit while streaming.

        * platform/ios/WebAVPlayerController.h:
        * platform/ios/WebAVPlayerController.mm:
        (-[WebAVPlayerController maxTime]):
        (+[WebAVPlayerController keyPathsForValuesAffectingMaxTime]):
        (-[WebAVPlayerController minTime]):
        (+[WebAVPlayerController keyPathsForValuesAffectingMinTime]):
        (-[WebAVPlayerController resetMediaState]):
        * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
        (WebCore::WebPlaybackSessionInterfaceAVKit::durationChanged):

2017-06-12  Chris Dumez  <cdumez@apple.com>

        Call _sqlite3_purgeEligiblePagerCacheMemory() on memory pressure only if sqlite is initialized
        https://bugs.webkit.org/show_bug.cgi?id=173264

        Reviewed by Ryosuke Niwa.

        Call _sqlite3_purgeEligiblePagerCacheMemory() on memory pressure only if sqlite is initialized.
        Otherwise, not only is it no needed, it is also potentially unsafe.

        * page/MemoryRelease.cpp:
        (WebCore::registerSQLiteMemoryPressureHandler):
        * page/MemoryRelease.h:
        * page/cocoa/MemoryReleaseCocoa.mm:
        (WebCore::platformReleaseMemory):
        (WebCore::registerSQLiteMemoryPressureHandler):
        * platform/sql/SQLiteDatabase.cpp:
        (WebCore::initializeSQLiteIfNecessary):

2017-06-12  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Use utility functions in CryptoKeyEC, CryptoKeyRSA
        https://bugs.webkit.org/show_bug.cgi?id=173253

        Reviewed by Michael Catanzaro.

        Use the utility functions from the GCryptUtilities.h header instead
        of writing the same code in both CryptoKeyEC and CryptoKeyRSA
        implementations. The switches are straightforward, the only difference
        is that the GCryptUtilities functions return a std::optional<> object,
        meaning we have to address possibly invalid return value.

        The mpiData() function is overloaded, making it possible to pass to it
        either a gcry_sexp_t or gcry_mpi_t object. Additionally, mpiLength()
        function is added, overloading again for gcry_sexp_t and gcry_mpi_t.
        This function is used from mpiData() as well as in CryptoKeyRSA when
        retrieving the RSA modulus length.

        No new tests -- no changes in behavior.

        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        (WebCore::CryptoKeyEC::platformExportRaw):
        (WebCore::CryptoKeyEC::platformAddFieldElements):
        (WebCore::extractMPIData): Deleted.
        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
        (WebCore::getRSAModulusLength):
        (WebCore::getRSAKeyParameter):
        (WebCore::CryptoKeyRSA::exportData):
        (WebCore::getParameterMPIData): Deleted.
        * crypto/gcrypt/GCryptUtilities.h:
        (WebCore::mpiLength):
        (WebCore::mpiData):

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

        didMoveToNewDocument doesn't get called on an Attr inside a shadow tree
        https://bugs.webkit.org/show_bug.cgi?id=173133

        Reviewed by Antti Koivisto.

        The bug was caused by moveShadowTreeToNewDocument never calling didMoveToNewDocument on Attr nodes.
        Fixed the bug by using the same traversal code as moveTreeToNewScope in moveShadowTreeToNewDocument
        by extracting the traversal code as a templatized traverseSubtreeToUpdateTreeScope.

        Also removed the code to increment the DOM tree version in moveTreeToNewScope. This code was there
        to invalidate the HTML collection caches which used to clear the cache whenever the DOM tree version
        changed before r122621 (five years ago! by me). Since we now eagerly invalidate each node list and
        HTML collection's caches via NodeListsNodeData::adoptTreeScope and NodeListsNodeData::adoptDocument.

        Test: fast/dom/adopt-attr-with-shadow-tree.html

        * dom/Node.cpp:
        (WebCore::moveNodeToNewDocument): Assert that the node had been adopted to a new document.
        (WebCore::traverseSubtreeToUpdateTreeScope): Extracted from moveTreeToNewScope.
        (WebCore::moveShadowTreeToNewDocument): Use traverseSubtreeToUpdateTreeScope to adopt each node
        to the new document.
        (WebCore::Node::moveTreeToNewScope): See above.
        * testing/Internals.cpp:
        (WebCore::Internals::referencingNodeCount): Added. Used in the newly added regression test.
        * testing/Internals.h:
        * testing/Internals.idl:

2017-06-11  Dan Bernstein  <mitz@apple.com>

        [Mac] Unaligned pointers in static CMBufferCallbacks structs defined in WebCoreDecompressionSession.mm
        https://bugs.webkit.org/show_bug.cgi?id=173245

        Reviewed by Sam Weinig.

        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::enqueueSample): Prepend 4 bytes of padding to the
          structs so that the pointers are properly aligned.

2017-06-11  Tim Horton  <timothy_horton@apple.com>

        REGRESSION (r217870): Null deref under PageOverlayController::uninstallPageOverlay using find in page
        https://bugs.webkit.org/show_bug.cgi?id=173196
        <rdar://problem/32686871>

        Reviewed by Simon Fraser.

        * page/TextIndicator.cpp:
        (WebCore::initializeIndicator):
        * page/TextIndicator.h:
        The change in r217870 had an expected but not thought-through side-effect
        that you cannot create a TextIndicator for far-off-screen elements. This
        is a problem for find-in-page, which uses TextIndicator to paint the yellow
        highlight before scrolling it into view.

        Bring back TextIndicatorOptionDoNotClipToVisibleRect and revert to it for
        find in page, since it needs different behavior than something like
        drag and drop, which always operates on content near the visible viewport.

2017-06-10  Dan Bernstein  <mitz@apple.com>

        Reverted r218056 because it made the IDE reindex constantly.

        * Configurations/DebugRelease.xcconfig:

2017-06-10  Dan Bernstein  <mitz@apple.com>

        [Xcode] With Xcode 9 developer beta, everything rebuilds when switching between command-line and IDE
        https://bugs.webkit.org/show_bug.cgi?id=173223

        Reviewed by Sam Weinig.

        The rebuilds were happening due to a difference in the compiler options that the IDE and
        xcodebuild were specifying. Only the IDE was passing the -index-store-path option. To make
        xcodebuild pass that option, too, set CLANG_INDEX_STORE_ENABLE to YES if it is unset, and
        specify an appropriate path in CLANG_INDEX_STORE_PATH.

        * Configurations/DebugRelease.xcconfig:

2017-06-10  Dan Bernstein  <mitz@apple.com>

        [macOS] REGRESSION: Link drag images blend into the background in Sierra and earlier
        https://bugs.webkit.org/show_bug.cgi?id=172933
        <rdar://problem/32580649>

        Reviewed by Tim Horton.

        * platform/mac/DragImageMac.mm:
        (WebCore::createDragImageForLink): When targeting macOS Sierra and earlier, give the link
          drag image a drop shadow that resembles the one that macOS High Sierra applies to drag
          image layers.

2017-06-10  Andy Estes  <aestes@apple.com>

        [QuickLook] PreviewLoader needs to check if its ResourceLoader has reached the terminal state before calling didReceiveResponse() and friends
        https://bugs.webkit.org/show_bug.cgi?id=173190
        <rdar://problem/31360659>

        Reviewed by Brady Eidson.

        WebPreviewLoader's SubresourceLoader can reach a terminal state while data is loading from
        QLPreviewConverter (the user can cancel, for instance). We can't call functions like
        didReceiveResponse() in this state, because the loader no longer points to a CachedResource,
        leading to null pointer dereferences.

        Fix this in WebPreviewLoader by checking if the SubresourceLoader is in a terminal state
        before calling didReceiveResponse(), didReceiveData(), didFinishLoading(), and didFail().

        Fixes web process crashes in the QuickLook.CancelNavigationAfterResponse API test.

        * loader/ios/PreviewLoader.mm:
        (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
        (-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
        (-[WebPreviewLoader connectionDidFinishLoading:]):
        (-[WebPreviewLoader connection:didFailWithError:]):

2017-06-09  Chris Dumez  <cdumez@apple.com>

        Use WTF::Function instead of std::function in indexeddb code
        https://bugs.webkit.org/show_bug.cgi?id=173198

        Reviewed by Sam Weinig.

        Use WTF::Function instead of std::function in indexeddb code to avoid copying.

        * Modules/indexeddb/IDBFactory.cpp:
        (WebCore::IDBFactory::getAllDatabaseNames):
        * Modules/indexeddb/IDBFactory.h:
        * Modules/indexeddb/client/IDBConnectionProxy.cpp:
        (WebCore::IDBClient::IDBConnectionProxy::getAllDatabaseNames):
        * Modules/indexeddb/client/IDBConnectionProxy.h:
        * Modules/indexeddb/client/IDBConnectionToServer.cpp:
        (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
        * Modules/indexeddb/client/IDBConnectionToServer.h:
        * Modules/indexeddb/client/TransactionOperation.h:
        (WebCore::IDBClient::TransactionOperation::doComplete):
        * Modules/indexeddb/server/IDBServer.cpp:
        (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
        (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
        * Modules/indexeddb/server/IDBServer.h:
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
        (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
        (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
        (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
        (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
        (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
        (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
        (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
        (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
        (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
        (WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
        (WebCore::IDBServer::UniqueIDBDatabase::getCount):
        (WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
        (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
        (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
        (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
        (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
        (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
        * Modules/indexeddb/server/UniqueIDBDatabase.h:

2017-06-09  Dan Bernstein  <mitz@apple.com>

        Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.

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

2017-06-09  Yoav Weiss  <yoav@yoav.ws>

        [preload] Fix builds with ENABLE_VIDEO_TRACK set to false
        https://bugs.webkit.org/show_bug.cgi?id=173221

        Reviewed by Chris Dumez.

        https://bugs.webkit.org/show_bug.cgi?id=173047 introduced a build error for builds with video track support disabled.
        This fixes that build issue.

        No new tests since there's no functional change.

        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::as):

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

        IsInShadowTreeFlag does not get updated for a non-container node
        https://bugs.webkit.org/show_bug.cgi?id=173084

        Address Darin's review comment.

        * dom/ContainerNodeAlgorithms.cpp:
        (WebCore::notifyNodeInsertedIntoDocument):
        (WebCore::notifyNodeInsertedIntoTree):
        (WebCore::notifyNodeRemovedFromDocument):

2017-06-09  Dan Bernstein  <mitz@apple.com>

        Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.

        * platform/spi/mac/AVFoundationSPI.h:

2017-06-09  Brady Eidson  <beidson@apple.com>

        Crash when IndexedDB's getAll is used inside a Web Worker.
        https://bugs.webkit.org/show_bug.cgi?id=172434

        Reviewed by Andy Estes.

        Test: storage/indexeddb/modern/worker-getall.html

        * Modules/indexeddb/IDBGetAllResult.cpp:
        (WebCore::IDBGetAllResult::IDBGetAllResult): Add an isolated-copying constructor.
        (WebCore::IDBGetAllResult::isolatedCopy):
        * Modules/indexeddb/IDBGetAllResult.h:
        
        * Modules/indexeddb/shared/IDBResultData.cpp:
        (WebCore::IDBResultData::isolatedCopy): Actually copy the IDBGetAllResult.

2017-06-09  Chris Dumez  <cdumez@apple.com>

        Unreviewed attempt to fix Mac build after r218039.

        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::loadDataURL):
        * platform/network/DataURLDecoder.h:

2017-06-09  Chris Dumez  <cdumez@apple.com>

        Use WTF::Function instead of std::function in DataURLDecoder
        https://bugs.webkit.org/show_bug.cgi?id=173194

        Reviewed by Sam Weinig.

        Use WTF::Function instead of std::function in DataURLDecoder to avoid copying.

        * platform/network/DataURLDecoder.cpp:
        (WebCore::DataURLDecoder::DecodeTask::DecodeTask):
        (WebCore::DataURLDecoder::createDecodeTask):
        * platform/network/DataURLDecoder.h:

2017-06-09  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Image should clear its ImageObserver* when CachedImage releases the last reference to its RefCounted<ImageObserver>
        https://bugs.webkit.org/show_bug.cgi?id=173077

        Reviewed by Simon Fraser.

        Before dereferencing ImageObserver, CachedImage::clearImage() should check
        whether it is the only object that holds a reference to this ImageObserver.
        And if this is true, m_image have to clear its raw pointer to the deleted
        ImageObserver by calling m_image->setImageObserver(nullptr).

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::setBodyDataFrom):
        (WebCore::CachedImage::CachedImageObserver::CachedImageObserver):
        (WebCore::CachedImage::clearImage):
        * loader/cache/CachedImage.h:

2017-06-09  Daniel Bates  <dabates@apple.com>

        Attempt to fix layout test failures following <https://trac.webkit.org/changeset/218028/webkit>
        (https://bugs.webkit.org/show_bug.cgi?id=158121)
        <rdar://problem/26012994>

        For now, if we do not have a frame then consider the document a secure context. One way this can happen
        is the page accesses a frame that was removed from the document as demonstrated by the test:
        fast/dom/Window/property-access-on-cached-window-after-frame-removed.html. Treating a frameless
        document as a secure context also matches Blink's implementation:
        <https://chromium.googlesource.com/chromium/src/+/fc202b2b1174f5732f7b9e63a6c46fd01ac2be02/third_party/WebKit/Source/core/dom/Document.cpp#4079>.

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

2017-06-09  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r218003.

        This change caused assertion failures in existing LayoutTests.

        Reverted changeset:

        "Image should clear its ImageObserver* when CachedImage
        releases the last reference to its RefCounted<ImageObserver>"
        https://bugs.webkit.org/show_bug.cgi?id=173077
        http://trac.webkit.org/changeset/218003

2017-06-09  Jiewen Tan  <jiewen_tan@apple.com>

        [WebCrypto] Remove unsupported CryptoAlgorithmIdentifier
        https://bugs.webkit.org/show_bug.cgi?id=173128
        <rdar://problem/32666826>

        Reviewed by Brent Fulgham.

        This patch remove AES_CMAC, DH and CONCAT as they are not implemented and not recommended
        by the spec. Hence there is no plan to support them in short term.

        No change of behaviour.

        * bindings/js/JSCryptoAlgorithmDictionary.cpp:
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForSign):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveKey):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveBits):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey):
        * bindings/js/JSSubtleCryptoCustom.cpp:
        (WebCore::normalizeCryptoAlgorithmParameters):
        (WebCore::supportExportKeyThrow):
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneSerializer::write):
        (WebCore::CloneDeserializer::read):
        * crypto/CryptoAlgorithmIdentifier.h:
        * crypto/keys/CryptoKeyAES.cpp:
        (WebCore::CryptoKeyAES::isValidAESAlgorithm):

2017-06-09  Daniel Bates  <dabates@apple.com>

        Implement W3C Secure Contexts Draft Specification
        https://bugs.webkit.org/show_bug.cgi?id=158121
        <rdar://problem/26012994>

        Reviewed by Alex Christensen.

        Part 2

        Implements the Secure Contexts spec., <https://w3c.github.io/webappsec-secure-contexts/> (Editor's
        Draft, 17 November 2016) except for the allow-secure-context sandbox flag and restrictions on window.opener
        as the former is at risk of being dropped from the specification and the latter is being discussed in
        <https://github.com/w3c/webappsec-secure-contexts/issues/42>. We are not making use of the Secure
        Contexts functionality at the moment. We will make use of it in a subsequent commit.

        * dom/Document.cpp:
        (WebCore::Document::isSecureContext): Added,
        * dom/Document.h:
        * dom/ScriptExecutionContext.h:
        (WebCore::ScriptExecutionContext::isSecureContext): Deleted; moved to class SecurityContext.
        * dom/SecurityContext.h:
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::isSecureContext): Added.
        * page/DOMWindow.h:
        * page/SecurityOrigin.cpp:
        (WebCore::isLoopbackIPAddress): Convenience function to determine whether the host portion
        of the specified URL is a valid loopback address.
        (WebCore::shouldTreatAsPotentionallyTrustworthy): Implements the "Is origin potentially trustworthy?"
        algorithm from the Secure Context specification.
        (WebCore::SecurityOrigin::SecurityOrigin): Compute whether this origin is potentially trustworthy.
        Also, use C++ brace initialization syntax in member initialization list.
        * page/SecurityOrigin.h:
        (WebCore::SecurityOrigin::isPotentionallyTrustworthy): Added.
        * page/WindowOrWorkerGlobalScope.idl: Expose attribute isSecureContext. Fix style nit; remove
        period from a comment that is not meant to be a complete sentence.
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::isSecureContext): Added.
        * workers/WorkerGlobalScope.h:

2017-06-09  Daniel Bates  <dabates@apple.com>

        Implement W3C Secure Contexts Draft Specification
        https://bugs.webkit.org/show_bug.cgi?id=158121
        <rdar://problem/26012994>

        Reviewed by Chris Dumez.

        Part 1

        Teach the bindings code generator to generate a runtime check for an interface, attribute or
        function annotated with the extended attribute [SecureContext]. For now, the runtime check
        (ScriptExecutionContext::isSecureContext()) always returns true. We will flesh out the
        implementation of this runtime check in a subsequent commit.

        * bindings/scripts/CodeGeneratorJS.pm:
        (NeedsRuntimeCheck):
        (GenerateRuntimeEnableConditionalString):
        Generate a runtime check for an interface, attribute, or function that is annotated with
        the extended attribute [SecureContext].

        * bindings/scripts/IDLAttributes.json: Update JSON now that we support SecureContext.
        * bindings/scripts/preprocess-idls.pl:
        (GenerateConstructorAttributes): Add the SecureContext extended attribute to a constructor,
        if applicable.

        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
        (WebCore::IDLAttribute<JSTestGenerateIsReachable>::cast):
        (WebCore::jsTestGenerateIsReachableASecretAttributeGetter):
        (WebCore::jsTestGenerateIsReachableASecretAttribute):
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        (WebCore::JSTestGlobalObject::finishCreation):
        (WebCore::jsTestGlobalObjectInstanceFunctionCalculateSecretResultBody):
        (WebCore::jsTestGlobalObjectInstanceFunctionCalculateSecretResult):
        (WebCore::jsTestGlobalObjectInstanceFunctionGetSecretBooleanBody):
        (WebCore::jsTestGlobalObjectInstanceFunctionGetSecretBoolean):
        (WebCore::jsTestGlobalObjectInstanceFunctionTestFeatureGetSecretBooleanBody):
        (WebCore::jsTestGlobalObjectInstanceFunctionTestFeatureGetSecretBoolean):
        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::JSTestNodePrototype::finishCreation):
        (WebCore::jsTestNodePrototypeFunctionCalculateSecretResultBody):
        (WebCore::jsTestNodePrototypeFunctionCalculateSecretResult):
        (WebCore::jsTestNodePrototypeFunctionGetSecretBooleanBody):
        (WebCore::jsTestNodePrototypeFunctionGetSecretBoolean):
        (WebCore::jsTestNodePrototypeFunctionTestFeatureGetSecretBooleanBody):
        (WebCore::jsTestNodePrototypeFunctionTestFeatureGetSecretBoolean):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::JSTestObjPrototype::finishCreation):
        (WebCore::jsTestObjPrototypeFunctionCalculateSecretResultBody):
        (WebCore::jsTestObjPrototypeFunctionCalculateSecretResult):
        (WebCore::jsTestObjPrototypeFunctionGetSecretBooleanBody):
        (WebCore::jsTestObjPrototypeFunctionGetSecretBoolean):
        (WebCore::jsTestObjPrototypeFunctionTestFeatureGetSecretBooleanBody):
        (WebCore::jsTestObjPrototypeFunctionTestFeatureGetSecretBoolean):
        Update expected results.

        * bindings/scripts/test/TestGenerateIsReachable.idl:
        * bindings/scripts/test/TestGlobalObject.idl:
        * bindings/scripts/test/TestNode.idl:
        * bindings/scripts/test/TestObj.idl:
        Add test cases.

        * dom/ScriptExecutionContext.h:
        (WebCore::ScriptExecutionContext::isSecureContext): Added. For now, always returns true.
        We will implement this function in a subsequent commit.

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

        Media elements are allowed to continue to load media data after navigation
        https://bugs.webkit.org/show_bug.cgi?id=173179

        Reviewed by Eric Carlson.

        Deny media sessions the ability to load media data when suspended.  

        * Modules/webaudio/AudioContext.cpp:
        (WebCore::AudioContext::isSuspended):
        * Modules/webaudio/AudioContext.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::isSuspended):
        * html/HTMLMediaElement.h:
        * platform/audio/PlatformMediaSession.cpp:
        (WebCore::PlatformMediaSession::isSuspended):
        * platform/audio/PlatformMediaSession.h:
        (WebCore::PlatformMediaSessionClient::isSuspended):
        * platform/audio/PlatformMediaSessionManager.cpp:
        (WebCore::PlatformMediaSessionManager::sessionCanLoadMedia):

2017-06-09  Daniel Bates  <dabates@apple.com>

        CSP: Apply img-src directive to favicon loads
        https://bugs.webkit.org/show_bug.cgi?id=172733
        <rdar://problem/32082654>

        Reviewed by Brady Eidson.

        Differentiate favicon requests from raw resources requests so that we can apply the Content
        Security Policy to favicon requests.

        Tests: http/tests/security/contentSecurityPolicy/allow-favicon.html
               http/tests/security/contentSecurityPolicy/block-favicon.html

        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::cachedResourceContent): Keep our current behavior and treat a
        favicon resource analogous to a raw resource.
        (WebCore::InspectorPageAgent::cachedResourceType): Ditto.
        * loader/LinkLoader.cpp:
        (WebCore::createLinkPreloadResourceClient): Now that we differentiate between a favicon
        and a raw resource we add favicons to the list of unsupported <link as="..."> types. This
        makes the list of handled request destination types more closely match the list of valid types
        documented in <https://fetch.spec.whatwg.org/#concept-request-destination> (24 May 2017).
        * loader/ResourceLoadInfo.cpp:
        (WebCore::toResourceType): Keep our current behavior and treat a favicon resource analogous
        to a raw resource.
        * loader/SubresourceLoader.cpp:
        (WebCore::logResourceLoaded): Ditto.
        * loader/cache/CachedRawResource.cpp:
        (WebCore::CachedRawResource::CachedRawResource): Update for renaming.
        * loader/cache/CachedRawResource.h:
        (isType): Ditto.
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::defaultPriorityForResourceType): Keep our current behavior and treat
        a favicon resource analogous to a raw resource.
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::isMainOrMediaOrFaviconOrRawResource): Renamed; formerly named isMainOrMediaOrRawResource.
        Also return true if the this resource is a favicon.
        (WebCore::CachedResource::ignoreForRequestCount): Keep our current behavior and treat a
        favicon resource analogous to a raw resource.
        (WebCore::CachedResource::isMainOrMediaOrRawResource): Deleted; renamed to isMainOrMediaOrFaviconOrRawResource.
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::createResource): Keep our current behavior and treat a favicon resource analogous
        to a raw resource.
        (WebCore::CachedResourceLoader::requestFavicon): Added.
        (WebCore::contentTypeFromResourceType): Keep our current behavior and treat a favicon
        resource analogous to a raw resource.
        (WebCore::CachedResourceLoader::checkInsecureContent): Ditto.
        (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy): Check if the favicon is
        allowed by the CSP of the page.
        (WebCore::CachedResourceLoader::determineRevalidationPolicy): Update for renaming.
        * loader/cache/CachedResourceLoader.h:
        * loader/icon/IconLoader.cpp:
        (WebCore::IconLoader::startLoading): Substitute call CachedResourceLoader::requestFavicon() for CachedResourceLoader::requestRawResource()
        and remove comment about ContentSecurityPolicyImposition::DoPolicyCheck being a placeholder. This is no longer the
        case. This resource request option is now meaningful as we want to apply the CSP of the page with respect to the
        request for the favicon.

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

        [iOS DnD] Add a hook to perform two-step drops in editable content
        https://bugs.webkit.org/show_bug.cgi?id=172992
        <rdar://problem/32590174>

        Reviewed by Tim Horton.

        Adds hooks in DragController::concludeEditDrag to give the client layer a chance to perform custom handling when
        dropping in editable content.
        Tests:  DataInteractionTests.InjectedBundleOverridePerformTwoStepDrop
                DataInteractionTests.InjectedBundleAllowPerformTwoStepDrop

        * loader/EmptyClients.cpp:
        * page/DragController.cpp:
        (WebCore::DragController::concludeEditDrag):
        * page/EditorClient.h:

2017-06-09  Matthew Hanson  <matthew_hanson@apple.com>

        Revert r217955. rdar://problem/21125708

2017-06-06 Konstantin Tokarev  <annulen@yandex.ru>

        [MediaFoundation] Volume controls of different media elements should be independent
        https://bugs.webkit.org/show_bug.cgi?id=172967

        Based on patch by Vitaly Slobodin <vitaliy.slobodin@gmail.com>
        Reviewed by Alex Christensen.

        IMFSimpleAudioVolume interface controls master volume of the
        application. We should use IMFAudioStreamVolume interface instead.

        No new tests needed.

        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
        (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
        (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes):
        (WebCore::MediaPlayerPrivateMediaFoundation::setVolume):
        (WebCore::MediaPlayerPrivateMediaFoundation::setMuted):
        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

2017-06-09  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Image should clear its ImageObserver* when CachedImage releases the last reference to its RefCounted<ImageObserver>
        https://bugs.webkit.org/show_bug.cgi?id=173077

        Reviewed by Simon Fraser.

        Before dereferencing ImageObserver, CachedImage::clearImage() should check
        whether it is the only object that holds a reference to this ImageObserver.
        And if this is true, m_image have to clear its raw pointer to the deleted
        ImageObserver by calling m_image->setImageObserver(nullptr).

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::setBodyDataFrom):
        (WebCore::CachedImage::CachedImageObserver::CachedImageObserver):
        (WebCore::CachedImage::clearImage):
        * loader/cache/CachedImage.h:

2017-06-09  Frederic Wang  <fwang@igalia.com>

        Add flag allow-popups-to-escape-sandbox to iframe sandbox
        https://bugs.webkit.org/show_bug.cgi?id=158875

        Reviewed by Chris Dumez.

        This patch adds support for the iframe@allow-popups-to-escape-sandbox attribute.
        This allows to pass more W3C Web Platform tests.

        Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html
               imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html

        * dom/SecurityContext.cpp: Add allow-popups-to-escape-sandbox flag.
        (WebCore::SecurityContext::isSupportedSandboxPolicy):
        (WebCore::SecurityContext::parseSandboxPolicy):
        * dom/SecurityContext.h: Ditto.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Do not force sandbox flags when we have allow-popups-to-escape-sandbox.
        (WebCore::createWindow): Ditto.

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

        [iOS] Video occasionally mixes with other system audio instead of interrupting
        https://bugs.webkit.org/show_bug.cgi?id=173127

        Reviewed by Eric Carlson.

        Tests: platform/mac/audio-session-category-video-track-change.html

        When an HTMLMediaElement's tracks change their enabled state, make sure to update
        the PlatformMediaElement, for canProduceAudio() may have changed. 

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
        * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
        (PlatformMediaSessionManager::updateSessionState):

        The rest of the changes in this revision are to allow the above to be testable.

        * page/Settings.cpp:
        * page/Settings.h:
        * platform/audio/AudioSession.h:
        * platform/audio/mac/AudioSessionMac.cpp:
        (WebCore::AudioSession::category):
        (WebCore::AudioSession::setCategory):
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::Backup::Backup):
        (WebCore::InternalSettings::Backup::restoreTo):
        (WebCore::InternalSettings::setShouldManageAudioSessionCategory):
        * testing/InternalSettings.h:
        * testing/InternalSettings.idl:
        * testing/Internals.cpp:
        (WebCore::Internals::audioSessionCategory):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-06-09  Chris Dumez  <cdumez@apple.com>

        CSS transitions added while page is not visible do not start when the page becomes visible
        https://bugs.webkit.org/show_bug.cgi?id=173166
        <rdar://problem/32250351>

        Reviewed by Darin Adler.

        CSS transitions added while page is not visible would not start when the page becomes
        visible. The issue was that when CompositeAnimation::updateTransitions() was called
        while the page is hidden (and animations are therefore suspended), it would not
        populate m_transations with ImplicitAnimation objects. We would therefore have later
        no transitions to resume when the page becomes visible later on. This patch updates
        CompositeAnimation::updateTransitions() to properly populate m_transitions and instead
        pause the ImplicitAnimation it creates if animations are currently suspended. This
        behavior is more consistent with the one of CompositeAnimation::updateKeyframeAnimations().

        I also needed to update ImplicitAnimation::animate() to not restart a paused animation
        if the animation is currently paused. This is similar to what is done in
        KeyframeAnimation::animate(). Without this, the paused ImplicitAnimation we add to
        m_transition would incorrectly get unpaused while the page is still hidden and the
        animations are still supposed to be suspended. This issue was showing when running the
        test I am adding in this patch.

        Test: fast/animation/css-animation-resuming-when-visible.html

        * page/animation/CompositeAnimation.cpp:
        (WebCore::CompositeAnimation::updateTransitions):
        * page/animation/ImplicitAnimation.cpp:
        (WebCore::ImplicitAnimation::animate):
        (WebCore::ImplicitAnimation::reset):
        * page/animation/ImplicitAnimation.h:

2017-06-09  Yusuke Suzuki  <utatane.tea@gmail.com>

        Unreviewed, Use FALLTHROUGH

        * loader/LinkLoader.cpp:
        (WebCore::createLinkPreloadResourceClient):

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

        fast/mediastream/MediaStream-page-muted.html times out and asserts
        https://bugs.webkit.org/show_bug.cgi?id=170355
        <rdar://problem/31376041>

        MediaStream and MediaStreamTrack need to prevent JS wrapper collection while it is possible
        to fire an event or event listeners won't be notified.

        Reviewed by Chris Dumez.

        Test: fast/mediastream/media-stream-wrapper-collected.html

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::MediaStream): Initialize ActiveDOMObject.
        (WebCore::MediaStream::stop): New.
        (WebCore::MediaStream::activeDOMObjectName): Ditto.
        (WebCore::MediaStream::canSuspendForDocumentSuspension): Ditto.
        (WebCore::MediaStream::hasPendingActivity): Ditto, prevent collection if there
        are registered event listeners.
        (WebCore::MediaStream::contextDestroyed): Deleted.
        * Modules/mediastream/MediaStream.h:
        * Modules/mediastream/MediaStream.idl:

        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::hasPendingActivity): Prevent collection if there
        are registered event listeners.
        * Modules/mediastream/MediaStreamTrack.h:

        * testing/Internals.cpp:
        (WebCore::Internals::removeMediaStreamTrack): stream.removeTrack doesn't generate a 'removetrack'
        event, so call private method that does.
        * testing/Internals.h:
        * testing/Internals.idl:

2017-06-09  Daewoong Jang  <daewoong.jang@navercorp.com>

        [cURL] Remove a call to Windows API
        https://bugs.webkit.org/show_bug.cgi?id=172079

        Reviewed by Yusuke Suzuki.

        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownload::moveFileToDestination):
        * platform/win/FileSystemWin.cpp:
        (WebCore::moveFile):

2017-06-09  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE] Fix alpha premultiplying when using cairo to draw the video frames
        https://bugs.webkit.org/show_bug.cgi?id=173097

        Reviewed by Carlos Garcia Campos.

        We need to premultiply alpha when creating a cairo surface from a GStreamer video frame, if the frame
        has an alpha component. Currently this is wrongly done in VideoSinkGStreamer, as it assumes that every
        frame is going to be rendered with cairo, which is not the case when using accelerated compositing.
        The premultiply must happen inside ImageGStreamerCairo, which is where we know that the frame is
        going to be rendered with cairo, and where the premultiply can be performed when gstreamer-gl is
        enabled as well.

        Covered by existent tests.

        * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
        (ImageGStreamer::ImageGStreamer):
        * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
        (webkitVideoSinkRequestRender):

2017-06-09  Zan Dobersek  <zdobersek@igalia.com>

        [WPE] Enable ENCRYPTED_MEDIA for build-webkit builds
        https://bugs.webkit.org/show_bug.cgi?id=173103

        Reviewed by Xabier Rodriguez-Calvar.

        * Modules/encryptedmedia/CDM.cpp:
        (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
        Pass the ParsedContentType's mime type string to the explicit ContentType
        constructor and assign that to the MediaEngineSupportParameters' type
        member.

2017-06-08  Ryosuke Niwa  <rniwa@webkit.org>

        Move TreeScope::adoptIfNeeded to Node and rename it to setTreeScopeRecursively
        https://bugs.webkit.org/show_bug.cgi?id=173129

        Reviewed by Antti Koivisto.

        Renamed TreeScope::adoptIfNeeded to setTreeScopeRecursively and moved to Node.

        The old name was really confusing because due to the existence of Document::adoptNode, a DOM API,
        which removes the adopted node from its parent if there was one before adopting the node.
        Most confusingly, this function called TreeScope::adoptIfNeeded.

        Also inlined the tree scope check to avoid calling to moveTreeToNewScope when there is nothing to do.

        This patch effectively reverts r104528.

        No new tests. Existing tests cover this.

        * dom/Attr.cpp:
        (WebCore::Attr::detachFromElementWithValue):
        (WebCore::Attr::attachToElement):
        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::takeAllChildrenFrom):
        (WebCore::ContainerNode::insertBefore):
        (WebCore::ContainerNode::replaceChild):
        (WebCore::ContainerNode::removeBetween):
        (WebCore::ContainerNode::replaceAllChildren):
        (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
        (WebCore::ContainerNode::parserAppendChild):
        * dom/ContainerNodeAlgorithms.cpp:
        (WebCore::addChildNodesToDeletionQueue):
        * dom/Document.cpp:
        (WebCore::Document::adoptNode):
        * dom/Element.cpp:
        (WebCore::Element::ensureAttr):
        * dom/Node.cpp:
        (WebCore::DidMoveToNewDocumentAssertionScope): Added. The old assertion wasn't sufficient when
        HTMLTemplateElement made a recursive call to setTreeScopeRecursively.
        (WebCore::DidMoveToNewDocumentAssertionScope::DidMoveToNewDocumentAssertionScope):
        (WebCore::DidMoveToNewDocumentAssertionScope::~DidMoveToNewDocumentAssertionScope):
        (WebCore::DidMoveToNewDocumentAssertionScope::didRecieveCall):
        (WebCore::moveNodeToNewDocument): Moved from TreeScope. Calls to incrementReferencingNodeCount
        and decrementReferencingNodeCount to Node::didMoveToNewDocument. This function is now eliminated
        in a release build.
        (WebCore::moveShadowTreeToNewDocument): Moved from TreeScope.
        (WebCore::Node::moveTreeToNewScope): Ditto.
        (WebCore::Node::didMoveToNewDocument): See the description for moveNodeToNewDocument above.
        * dom/Node.h:
        (WebCore::Node::isParsingChildrenFinished): Moved to avoid having its own protected section.
        (WebCore::Node::setIsParsingChildrenFinished): Ditto.
        (WebCore::Node::clearIsParsingChildrenFinished): Ditto.
        (WebCore::Node::setTreeScopeRecursively): Moved from TreeScope::adoptIfNeeded.
        * dom/ShadowRoot.cpp:
        (WebCore::ShadowRoot::~ShadowRoot):
        * dom/TreeScope.cpp:
        (WebCore::TreeScope::adoptIfNeeded): Deleted.
        (WebCore::TreeScope::moveTreeToNewScope): Deleted.
        (WebCore::TreeScope::ensureDidMoveToNewDocumentWasCalled): Deleted.
        (WebCore::TreeScope::moveNodeToNewDocument): Deleted.
        (WebCore::TreeScope::moveShadowTreeToNewDocument): Deleted.
        * dom/TreeScope.h:
        * html/HTMLTemplateElement.cpp:
        (WebCore::HTMLTemplateElement::didMoveToNewDocument):

2017-06-09  Adrien Plazas  <aplazas@igalia.com>

        [GTK] Add kinetic scrolling
        https://bugs.webkit.org/show_bug.cgi?id=155750

        Reviewed by Carlos Garcia Campos.

        Patch by Adrien Plazas and Yusuke Suzuki.

        Add the ScrollAnimationKinetic scrolling animation allowing to perform momentum scrolling; it is based on GTK+'s
        GtkKineticScrolling type.

        Add the notion of phase, momentum phase and swipe velocity to PlatformWheelEvent.

        Depending on whether the scrolling ended normally or triggered a swipe, the scroll animator will either compute
        the swipe velocity from the previous scrolling events or use the one from the swipe gesture to initiate the
        momentum scrolling.

        * PlatformGTK.cmake:
        * platform/PlatformWheelEvent.h:
        (WebCore::PlatformWheelEvent::setHasPreciseScrollingDeltas):
        (WebCore::PlatformWheelEvent::phase):
        (WebCore::PlatformWheelEvent::momentumPhase):
        (WebCore::PlatformWheelEvent::isTransitioningToMomentumScroll):
        * platform/ScrollAnimation.h:
        (WebCore::ScrollAnimation::scroll):
        (WebCore::ScrollAnimation::updateVisibleLengths):
        (WebCore::ScrollAnimation::setCurrentPosition):
        * platform/ScrollAnimationKinetic.cpp: Added.
        (WebCore::ScrollAnimationKinetic::PerAxisData::PerAxisData):
        (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
        (WebCore::ScrollAnimationKinetic::ScrollAnimationKinetic):
        (WebCore::ScrollAnimationKinetic::~ScrollAnimationKinetic):
        (WebCore::ScrollAnimationKinetic::stop):
        (WebCore::ScrollAnimationKinetic::start):
        (WebCore::ScrollAnimationKinetic::animationTimerFired):
        * platform/ScrollAnimationKinetic.h: Copied from Source/WebCore/platform/ScrollAnimation.h.
        * platform/gtk/PlatformWheelEventGtk.cpp:
        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
        (WebCore::PlatformWheelEvent::swipeVelocity):
        * platform/gtk/ScrollAnimatorGtk.cpp:
        (WebCore::ScrollAnimatorGtk::ScrollAnimatorGtk):
        (WebCore::ScrollAnimatorGtk::ensureSmoothScrollingAnimation):
        (WebCore::ScrollAnimatorGtk::scroll):
        (WebCore::ScrollAnimatorGtk::scrollToOffsetWithoutAnimation):
        (WebCore::ScrollAnimatorGtk::computeVelocity):
        (WebCore::ScrollAnimatorGtk::handleWheelEvent):
        (WebCore::ScrollAnimatorGtk::willEndLiveResize):
        (WebCore::ScrollAnimatorGtk::updatePosition):
        (WebCore::ScrollAnimatorGtk::didAddVerticalScrollbar):
        (WebCore::ScrollAnimatorGtk::didAddHorizontalScrollbar):
        * platform/gtk/ScrollAnimatorGtk.h:

2017-06-09  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] ECDSA signing results can be smaller than the EC key size
        https://bugs.webkit.org/show_bug.cgi?id=171535

        Reviewed by Jiewen Tan.

        The libgcrypt-based implementation of the ECDSA signing operation does not
        properly address the resulting `r` and `s` integers that do not potentially
        match the EC key in terms of size.

        To address that, the retrieved MPI data for both integers is handled depending
        on the size of said data. Strictly requiring an amount of bytes that matches
        the key data size N, we simply take the last N bytes if the MPI data is equal
        or larger than N in size. If smaller, we first append enough zero bytes to the
        output Vector object before attaching the MPI data in whole so that the amount
        of appended bytes matches N.

        No new tests -- covers an implementation detail that is not trivial to test,
        but can rely sufficiently on existing tests.

        * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
        (WebCore::extractECDSASignatureInteger):
        (WebCore::gcryptSign):

2017-06-09  Daewoong Jang  <daewoong.jang@navercorp.com>

        Reduce compiler warnings
        https://bugs.webkit.org/show_bug.cgi?id=172078

        Reviewed by Yusuke Suzuki.

        * platform/network/curl/CookieJarCurl.cpp:
        (WebCore::addMatchingCurlCookie):
        (WebCore::getHostnamesWithCookies):
        (WebCore::deleteCookiesForHostnames):
        (WebCore::deleteCookiesForHostname): Deleted.
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownloadManager::downloadThread):
        (WebCore::CurlDownload::didReceiveHeader):
        * platform/network/curl/CurlDownload.h:
        (WebCore::CurlDownloadListener::didReceiveDataOfLength):
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/curl/SocketStreamHandleImplCurl.cpp:
        (WebCore::createCopy):
        (WebCore::SocketStreamHandleImpl::readData):

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

        [GStreamer][EME] Remove the legacy code that was not even official and is deprecated
        https://bugs.webkit.org/show_bug.cgi?id=173096

        Reviewed by Žan Doberšek.

        We are removing the LEGACY_ENCRYPTED_MEDIA code that we was not
        official, is deprecated and we are not planning to support it
        anymore in any way.

        This also helps implementing current ENCRYPTED_MEDIA in a cleaner
        way.

        * platform/GStreamer.cmake:
        * platform/graphics/gstreamer/GStreamerUtilities.cpp:
        * platform/graphics/gstreamer/GStreamerUtilities.h:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::registerWebKitGStreamerElements):
        (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
        (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
        (WebCore::extractEventsAndSystemsFromMessage): Deleted.
        (WebCore::MediaPlayerPrivateGStreamerBase::needKey): Deleted.
        (WebCore::MediaPlayerPrivateGStreamerBase::setCDMSession): Deleted.
        (WebCore::MediaPlayerPrivateGStreamerBase::keyAdded): Deleted.
        (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent): Deleted.
        (WebCore::MediaPlayerPrivateGStreamerBase::receivedGenerateKeyRequest): Deleted.
        (WebCore::keySystemIdToUuid): Deleted.
        (WebCore::MediaPlayerPrivateGStreamerBase::createSession): Deleted.
        (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey): Deleted.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
        * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h:
        * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
        * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::AppendPipeline::AppendPipeline):
        (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
        (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
        (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
        (WebCore::appendPipelineElementMessageCallback): Deleted.
        (WebCore::AppendPipeline::dispatchPendingDecryptionKey): Deleted.
        (WebCore::AppendPipeline::dispatchDecryptionKey): Deleted.
        (WebCore::AppendPipeline::handleElementMessage): Deleted.
        * platform/graphics/gstreamer/mse/AppendPipeline.h:
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
        (WebCore::MediaPlayerPrivateGStreamerMSE::dispatchDecryptionKey): Deleted.
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:

2017-06-09  Aaron Chu  <aaron_chu@apple.com>

        AX: Media Controls: Missing labels for the Time Labels.
        https://bugs.webkit.org/show_bug.cgi?id=171715
        <rdar://problem/32009214>

        Reviewed by Antoine Quint.

        Added aria-label to describe time labels in media controls.

        * Modules/modern-media-controls/controls/slider.js:
        (Slider.prototype.set inputAccessibleLabel):
        (Slider.prototype._formatTime): Deleted.
        * Modules/modern-media-controls/controls/time-label.js:
        (TimeLabel.prototype.commitProperty):
        * Modules/modern-media-controls/main.js:
        (formatTimeToString):

2017-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix unused parameter warning after r217955.

        * platform/graphics/FontFamilySpecificationNull.h:
        (WebCore::FontFamilySpecificationNull::fontRanges):

2017-06-08  Yoav Weiss  <yoav@yoav.ws>

        [preload] Mandatory `as` value and related spec alignments
        https://bugs.webkit.org/show_bug.cgi?id=173047

        Reviewed by Dean Jackson.

        Align preload's implementation according to latest spec changes: `as` is mandatory and "fetch" replaces the previous empty `as` value,
        onerror no longer fires for invalid `as` values, and the IDL for `as` reflects only valid values, to enable feature detection.

        Related standard discussions:
        https://github.com/w3c/preload/issues/80
        https://github.com/whatwg/fetch/pull/547
        https://github.com/whatwg/fetch/pull/549
        https://github.com/whatwg/html/pull/2588

        No new tests but modified existing ones as well as their expectations.

        * html/HTMLLinkElement.cpp: Add "enumerated attribute" reflection methods to `as`.
        (WebCore::HTMLLinkElement::setAs):
        (WebCore::HTMLLinkElement::as):
        * html/HTMLLinkElement.h:
        * html/HTMLLinkElement.idl:
        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::loadLinksFromHeader): preloadIfNeeded signature change.
        (WebCore::LinkLoader::resourceTypeFromAsAttribute): Replace the empty value by "fetch".
        (WebCore::LinkLoader::preloadIfNeeded): Change the signature, as a LinkLoaderClient is no longer needed, since we don't fire error
        events from inside the function.
        (WebCore::LinkLoader::loadLink): preloadIfNeeded signature change.
        * loader/LinkLoader.h: preloadIfNeeded signature change.

2017-06-08  Chris Dumez  <cdumez@apple.com>

        [iOS] LowPowerModeNotifier notifies client on non-main thread
        https://bugs.webkit.org/show_bug.cgi?id=173115
        <rdar://problem/32644703>

        Reviewed by Ryosuke Niwa.

        Update iOS's implementation of the LowPowerModeNotifier to make sure
        we notify the client of low power mode changes on the main thread.

        * platform/ios/LowPowerModeNotifierIOS.mm:
        (-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):

2017-06-08  Ryosuke Niwa  <rniwa@webkit.org>

        Crash inside InsertNodeBeforeCommand via InsertParagraphSeparatorCommand
        https://bugs.webkit.org/show_bug.cgi?id=173085
        <rdar://problem/32575059>

        Reviewed by Wenson Hsieh.

        The crash was caused by the condition to check for special cases failing when visiblePos is null.
        Exit early in these extreme cases.

        Also replaced the use of deprecatedNode and deprecatedEditingOffset to modern idioms.

        Test: editing/inserting/insert-horizontal-rule-in-empty-document-crash.html

        * editing/InsertParagraphSeparatorCommand.cpp:
        (WebCore::InsertParagraphSeparatorCommand::doApply):

2017-06-08  Ryosuke Niwa  <rniwa@webkit.org>

        The tree scope of an Attr node inside a shadow tree does not updated upon detach.
        https://bugs.webkit.org/show_bug.cgi?id=173122

        Reviewed by Chris Dumez.

        The crash was caused by the tree scope of an Attr detached from an element inside a shadow root
        not getting updated.

        Test: fast/dom/detaching-attr-node-in-shadow-tree-crash.html

        * dom/Attr.cpp:
        (WebCore::Attr::~Attr): Added assertions.
        (WebCore::Attr::detachFromElementWithValue): Fixed the bug by adopting Attr to Document.
        (WebCore::Attr::attachToElement): Moved the adoptIfNeeded call here from attachAttributeNodeIfNeeded.
        * dom/Element.cpp:
        (WebCore::Element::attachAttributeNodeIfNeeded):

2017-06-08  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Expand system-ui to include every item in the Core Text cascade list
        https://bugs.webkit.org/show_bug.cgi?id=173043
        <rdar://problem/21125708>

        Reviewed by Simon Fraser.

        The concept of the system font on Cocoa platforms represents the entire Core Text cascade list.
        However, previously, WebKit only represented system-ui by pulling out the first item in the Core
        Text cascade list. Instead, we should make all text rendered with "system-ui" match what the
        platform would natively render.

        Previously, we walked through the strings in the font-family property and looked them up one by
        one. However, now we want to abstract this idea of a font family to possibly hold a
        CTFontDescriptorRef instead of a string. This way, we expand a font-family list of ["fontA",
        "system-ui", "fontB"] to ["fontA", ... a bunch of CTFontDescriptorRefs ..., "FontB"]. We can
        then modify the consumer of this object to have two codepaths: the old string-based codepath,
        and a new, platform-specific codepath which simply embeds the CTFontDesriptorRefs inside a Font
        object.

        We don't want to simply pull out the family name from each item in the Core Text fallback list
        because that is a lossy translation. There is more information in these font descriptors which
        cannot be represented by CSS. Therefore, we must keep the descriptors alive and add the new
        codepath for them.

        We also don't want to run the CSS font matching algorithm on each member of the Core Text
        fallback list because it may yield different results from Core Text's font matching algorithm.
        Our goal is to draw text as closely as possible to the system APIs. If we ran it, we may find
        a font which is closer to the requested traits, but it would look out of place on the system.

        Tests: fast/text/system-font-fallback-emoji.html
               fast/text/system-font-fallback.html

        * WebCore.xcodeproj/project.pbxproj:
        * page/MemoryRelease.cpp:
        (WebCore::releaseNoncriticalMemory):
        * platform/graphics/FontCascadeFonts.cpp:
        (WebCore::realizeNextFallback): The consumer of our new data type. Now uses WTF::visit().
        (WebCore::FontCascadeFonts::realizeFallbackRangesAt): Now that the number of items to test
        against the current character is larger than the number of strings in the font-family list,
        we need to update the existing code to use the correct value.
        * platform/graphics/FontDescription.cpp: Default implementation for non-Cocoa ports.
        (WebCore::FontDescription::invalidateCaches):
        (WebCore::FontCascadeDescription::effectiveFamilyCount):
        (WebCore::FontCascadeDescription::effectiveFamilyAt):
        * platform/graphics/FontDescription.h: Our new data type is a Variant of AtomicString and a
        platform-specific class. Cocoa uses a class that holds a CTFontDescriptorRef and other ports
        use an empty non-constructable class.
        * platform/graphics/FontFamilySpecificationNull.h: Added. The empty non-constructable
        class.
        (WebCore::FontFamilySpecificationNull::fontRanges):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::FontCache::platformInit): Changing the system language will change the system font
        fallback list, so we need to listen to this notification. This also matters for
        FontCache::systemFallbackForCharacters(), so we should build off the same callback we are
        already using for font installation.
        (WebCore::invalidateFontCache):
        * platform/graphics/cocoa/FontDescriptionCocoa.cpp: Added. The platform-specific creation of
        our CTFontDescriptorRefs. We hold them cached in a SystemFontDatabase.
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
        (WebCore::SystemFontDatabase::singleton):
        (WebCore::SystemFontDatabase::systemFontCascadeList):
        (WebCore::SystemFontDatabase::clear):
        (WebCore::SystemFontDatabase::SystemFontDatabase):
        (WebCore::SystemFontDatabase::applyWeightAndItalics):
        (WebCore::SystemFontDatabase::computeCascadeList):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash):
        (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal):
        (WebCore::isSystemFontString):
        (WebCore::systemFontParameters):
        (WebCore::FontDescription::invalidateCaches):
        (WebCore::FontCascadeDescription::effectiveFamilyCount): We don't store the result of this
        because it would probably be a bad idea to increase the size of every single FontCascade just
        in case it might ask for the system font. Most fonts never mention system-ui. Because it's so
        rare, we can just recalculate the result of this as necessary. This shouldn't be slow because
        the results are cached.
        (WebCore::FontCascadeDescription::effectiveFamilyAt):
        * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp: Added.
        (WebCore::FontFamilySpecificationCoreText::fontRanges): Create a FontRanges from a
        CTFontDescriptorRef.
        * platform/graphics/cocoa/FontFamilySpecificationCoreText.h: Added.
        (WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText):
        * platform/graphics/ios/FontCacheIOS.mm: Delete the old handling for system-ui.
        (WebCore::platformFontWithFamilySpecialCase):
        (WebCore::baseSystemFontDescriptor): Deleted.
        (WebCore::systemFontModificationAttributes): Deleted.
        (WebCore::systemFontDescriptor): Deleted.
        * platform/graphics/mac/FontCacheMac.mm: Ditto.
        (WebCore::platformFontWithFamilySpecialCase):
        (WebCore::toNSFontWeight): Deleted.

2017-06-08  Chris Dumez  <cdumez@apple.com>

        Update Timer to take a WTF::Function instead of a std::function
        https://bugs.webkit.org/show_bug.cgi?id=173113

        Reviewed by Brady Eidson.

        Update Timer to take a WTF::Function instead of a std::function as we prefer
        to use WTF::Function in WebKit.

        * platform/GenericTaskQueue.cpp:
        (WebCore::TaskDispatcher<Timer>::sharedTimer):
        * platform/Timer.h:
        (WebCore::Timer::Timer):
        (WebCore::DeferrableOneShotTimer::DeferrableOneShotTimer):

2017-06-08  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [WebRTC] enableMockMediaEndpoint() is only used for the OpenWebRTC backend.
        https://bugs.webkit.org/show_bug.cgi?id=173108

        Reviewed by Eric Carlson.

        Covered by existing tests.

        * testing/Internals.cpp:
        (WebCore::Internals::Internals):
        (WebCore::Internals::enableMockMediaEndpoint):
        * testing/Internals.h:

2017-06-08  Antoine Quint  <graouts@apple.com>

        [iOS] Buttons in top-left and bottom media controls bar are positioned too high
        https://bugs.webkit.org/show_bug.cgi?id=173111
        <rdar://problem/32650615>

        Reviewed by Jon Lee.

        Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-button-padding.html

        Since we use flex box to vertically center buttons in a buttons container, there is no
        need to offset the button due to padding in the y-axis.

        * Modules/modern-media-controls/controls/buttons-container.css:
        (.ios .buttons-container button):

2017-06-08  Jeremy Jones  <jeremyj@apple.com>

        Implement additional AVPlayerController interfaces for minTime and maxTime.
        https://bugs.webkit.org/show_bug.cgi?id=172396
        rdar://problem/30737452

        Reviewed by Jer Noble.

        No new tests because no change to DOM.

        Add support for new HLS UI in AVKit.

        This adds new properties (seekableTimeRangesLastModifiedTime, liveUpdateInterval, minTiming, maxTiming) to WebAVPlayerController.
        Plumb these properties from AVPlayer up to AVKit.

        Switch WebPlaybackSessionModelMediaElement from updating seekableRangesChanged using timeupdate event to using progress event.

        Enable progress events on iOS.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::HTMLMediaElement):
        (WebCore::HTMLMediaElement::loadResource):
        (WebCore::HTMLMediaElement::seekableTimeRangesLastModifiedTime):
        (WebCore::HTMLMediaElement::liveUpdateInterval):
        * html/HTMLMediaElement.h:
        * platform/cf/CoreMediaSoftLink.cpp:
        * platform/cf/CoreMediaSoftLink.h:
        * platform/cocoa/WebPlaybackSessionModel.h:
        (WebCore::WebPlaybackSessionModelClient::seekableRangesChanged):
        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
        (WebCore::WebPlaybackSessionModelMediaElement::observedEventNames):
        (WebCore::WebPlaybackSessionModelMediaElement::seekableTimeRangesLastModifiedTime):
        (WebCore::WebPlaybackSessionModelMediaElement::liveUpdateInterval):
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::seekableTimeRangesLastModifiedTime):
        (WebCore::MediaPlayer::liveUpdateInterval):
        * platform/graphics/MediaPlayer.h:
        * platform/graphics/MediaPlayerPrivate.h:
        (WebCore::MediaPlayerPrivateInterface::seekableTimeRangesLastModifiedTime):
        (WebCore::MediaPlayerPrivateInterface::liveUpdateInterval):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesLastModifiedTime):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::liveUpdateInterval):
        * platform/ios/WebAVPlayerController.h:
        * platform/ios/WebAVPlayerController.mm:
        (-[WebAVPlayerController init]):
        (-[WebAVPlayerController dealloc]):
        (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]):
        (-[WebAVPlayerController updateMinMaxTiming]):
        (-[WebAVPlayerController hasSeekableLiveStreamingContent]):
        (+[WebAVPlayerController keyPathsForValuesAffectingHasSeekableLiveStreamingContent]):
        (-[WebAVPlayerController resetMediaState]):
        * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
        * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
        (WebCore::WebPlaybackSessionInterfaceAVKit::WebPlaybackSessionInterfaceAVKit):
        (WebCore::WebPlaybackSessionInterfaceAVKit::resetMediaState):
        (WebCore::WebPlaybackSessionInterfaceAVKit::seekableRangesChanged):
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        (WebVideoFullscreenControllerContext::seekableRangesChanged):
        (WebVideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime):
        (WebVideoFullscreenControllerContext::liveUpdateInterval):
        * platform/mac/WebPlaybackSessionInterfaceMac.h:
        * platform/mac/WebPlaybackSessionInterfaceMac.mm:
        (WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
        * platform/spi/cocoa/AVKitSPI.h:
        * platform/spi/mac/AVFoundationSPI.h:

2017-06-07  Dave Hyatt  <hyatt@apple.com>

        Laili restaurant menu page does not display full menu
        https://bugs.webkit.org/show_bug.cgi?id=173062
        rdar://problem/32436486

        Reviewed by Simon Fraser.

        Percentage heights inside auto containing blocks were handled correctly by
        hasReplacedLogicalHeight, which checked hasAutoHeightOrContainingBlockWithAutoHeight
        properly. min-max-height were not handled properly though and need to do the same check.
        
        There is also now a quirk for iBooks to preserve the old behavior, since they depend
        on the old behavior to constrain the height of images to a page.

        Test: fast/replaced/max-height-percent-inside-auto-block.html

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::replacedMinMaxLogicalHeightComputesAsNone):
        Add a new helper that resolves min and max logical height values to none for
        replaced elements with percentage min/max heights inside auto containing blocks.

        (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
        Change the min/max-height constraint function for replaced elements to call the
        new helper function.

        * rendering/RenderBox.h:
        * rendering/RenderBoxModelObject.h:
        Move a function from private to protected so that RenderBox can access it.

2017-06-08  Tim Horton  <timothy_horton@apple.com>

        Add a borderless mode to <attachment>, and make it respect its layout size
        https://bugs.webkit.org/show_bug.cgi?id=173079
        <rdar://problem/32491584>

        Reviewed by Simon Fraser.

        Tests: fast/attachment/attachment-borderless.html
               fast/attachment/attachment-respects-css-size.html

        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        * css/CSSValueKeywords.in:
        * platform/ThemeTypes.h:
        * rendering/RenderAttachment.cpp:
        (WebCore::RenderAttachment::shouldDrawBorder):
        * rendering/RenderAttachment.h:
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::adjustStyle):
        (WebCore::RenderTheme::paint):
        Add "-webkit-appearance: borderless-attachment;" in addition to "attachment",
        so clients can specify the borderless appearance. This isn't specified as a
        CSS border because it's a very custom appearance that isn't achievable that way.

        * rendering/RenderThemeIOS.mm:
        (WebCore::AttachmentInfo::AttachmentInfo):
        Use the layout size of the attachment, not the fixed size; we use the fixed
        size as our intrinsic size, so most attachments will still be that size,
        but if a client specifies a different size, we'll lay out correctly.

2017-06-08  Jer Noble  <jer.noble@apple.com>

        YouTube audio stutters when page changes visibility.
        https://bugs.webkit.org/show_bug.cgi?id=173102

        Reviewed by Eric Carlson.

        Don't change renderers when the visibility changes; only use the decompression session
        when we were explicitly asked to paint into an accelerated surface.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged):

2017-06-08  Jer Noble  <jer.noble@apple.com>

        Clients of the WK2 C-API don't have their mediaContentTypesRequiringHardwareSupport setting initialized correctly.
        https://bugs.webkit.org/show_bug.cgi?id=173091

        Reviewed by Eric Carlson.

        Add a new default setting value, defined separately in Settings and SettingsCocoa.

        * page/Settings.cpp:
        (WebCore::Settings::defaultMediaContentTypesRequiringHardwareSupport):
        * page/Settings.h:
        * page/cocoa/SettingsCocoa.mm:
        (WebCore::Settings::defaultMediaContentTypesRequiringHardwareSupport):

2017-06-08  Jer Noble  <jer.noble@apple.com>

        Take the mediaContentTypesRequiringHardwareSupport Setting into account when answering HTMLMediaElement::canPlayType()
        https://bugs.webkit.org/show_bug.cgi?id=173092

        Reviewed by Eric Carlson.

        Pass the value of mediaContentTypesRequiringHardwareSupport into the MediaPlayer when querying canPlayType().
        Then, use the existing code in AVAssetTrackUtilities to know whether to bail out early from the codec check.

        Drive-by fix: FourCC was converting String -> FourCC in reverse.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::canPlayType):
        * platform/graphics/FourCC.cpp:
        (WebCore::FourCC::fromString):
        * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h:
        * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
        (WebCore::contentTypesToCodecs):
        (WebCore::codecsMeetHardwareDecodeRequirements):
        (WebCore::contentTypeMeetsHardwareDecodeRequirements):
        (WebCore::assetTrackMeetsHardwareDecodeRequirements):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):

2017-06-08  Chris Dumez  <cdumez@apple.com>

        ASSERTION FAILED: !m_isolatedWorld->isNormal() || m_wrapper || !m_jsFunction on webrtc/ephemeral-certificates-and-cnames.html
        https://bugs.webkit.org/show_bug.cgi?id=173039
        <rdar://problem/32600412>

        Reviewed by Youenn Fablet.

        RTCPeerConnection was an ActiveDOMObject but failed to override ActiveDOMObject::hasPendingActivity()
        to make sure its JS wrapper stays alive as long as it needs to. In this patch, we override
        ActiveDOMObject::hasPendingActivity() and have it return true if !m_isStopped. I believe this is
        the right thing to do to keep the wrapper alive as long as the connection is not closed.
        RTCPeerConnection::close() closes the connection and then posts a task to call
        RTCPeerConnection::doStop(), setting m_isStopped to true.

        No new tests, already covered by webrtc/ephemeral-certificates-and-cnames.html which
        was a flaky crash.

        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension):
        (WebCore::RTCPeerConnection::hasPendingActivity):
        * Modules/mediastream/RTCPeerConnection.h:

2017-06-08  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE][GSTREAMER_GL] Change the colorspace used by the video frames provided by GStreamer
        https://bugs.webkit.org/show_bug.cgi?id=173050

        Reviewed by Žan Doberšek.

        We are currently requesting RGBA as the color format of the video frames to gstreamer. This is a problem
        because when those frames are rendered with the CPU, the R and B components are swapped as cairo expects
        ARGB and GStreamer delivers ABGR.

        In order to fix this without performing color conversions on the CPU, what we do is change the format
        used by GStreamer for the video frames. We do that taking into account the endianness used. So with
        little endian we will use BGRx or BGRA and with big endian xRGB or ARGB. Thanks to this, when downloading
        the frames to the CPU they will automatically be turned into the ARGB expected by cairo. Also, when
        rendering the frames using OpenGL, we indicate that the color space needs to be converted to the RGBA
        expected by the destination texture (but this color conversion is performed by the GPU so there's no
        penalty).

        Covered by existent tests.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
        (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
        (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
        (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
        * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
        (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
        (WebCore::VideoTextureCopierGStreamer::updateColorConversionMatrix):
        (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
        * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
        * platform/graphics/texmap/TextureMapperGL.cpp:
        (WebCore::colorSpaceMatrixForFlags):
        * platform/graphics/texmap/TextureMapperGL.h:

2017-06-07  Ryosuke Niwa  <rniwa@webkit.org>

        IsInShadowTreeFlag does not get updated for a non-container node
        https://bugs.webkit.org/show_bug.cgi?id=173084

        Reviewed by Antti Koivisto.

        insertedInto and removedFrom were only called on ContainerNode nodes when they're not connected to a document.
        As a result IsInShadowTreeFlag could have gotten out-of-date when a node was inserted or removed from a shadow root
        which is not connected to a document.

        Fixed this inconsistency by always falling insertedInto and removedFrom on all nodes.

        * dom/ContainerNodeAlgorithms.cpp:
        (WebCore::notifyNodeInsertedIntoDocument): Merged notifyDescendantInsertedIntoDocument. Now takes a Node instead
        of a ContainerNode.
        (WebCore::notifyNodeInsertedIntoTree): Merged notifyDescendantInsertedIntoTree. Now takes a Node instead of
        a ContainerNode.
        (WebCore::notifyChildNodeInserted): Always call notifyNodeInsertedIntoTree on an inserted node.
        (WebCore::notifyNodeRemovedFromDocument): Now takes a Node instead of a ContainerNode.
        (WebCore::notifyNodeRemovedFromTree): Ditto.
        (WebCore::notifyChildNodeRemoved): Always call notifyNodeRemovedFromTree on an inserted node.
        (WebCore::addChildNodesToDeletionQueue): Directly call adoptIfNeeded on document() since onwerDocument() only returns
        nullptr on a Document node but this function is never called on a root node and Document can only be a root node.
        Also assert that a node not put into the deletion queue is no longer in a document or a shadow tree.

        * dom/Node.cpp:
        (WebCore::Node::insertedInto): Removed the assertion that's no longer true.
        (WebCore::Node::removedFrom): Ditto.

2017-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE] Enable resource usage
        https://bugs.webkit.org/show_bug.cgi?id=173054

        Reviewed by Žan Doberšek.

        Add resource usage linux files to the compilation.

        * PlatformWPE.cmake:

2017-06-07  Jer Noble  <jer.noble@apple.com>

        [Web Audio] createScriptProcessor throws IndexSizeError for valid arguments
        https://bugs.webkit.org/show_bug.cgi?id=173022

        Reviewed by Sam Weinig.

        Updated test: webaudio/javascriptaudionode.html

        The Web Audio spec (<https://webaudio.github.io/web-audio-api/>, 06 June 2017) defines a default behavior when
        clients pass in a value of 0 for bufferSize to the createScriptProcessor() method.

        * Modules/webaudio/AudioContext.cpp:
        (WebCore::AudioContext::createScriptProcessor):
        * Modules/webaudio/AudioContext.idl:
        * Modules/webaudio/ScriptProcessorNode.cpp:
        (WebCore::ScriptProcessorNode::create):
        * Modules/webaudio/ScriptProcessorNode.h:

2017-06-07  Chris Dumez  <cdumez@apple.com>

        CSSStyleRule.style / CSSPageRule.style / CSSKeyframeRule.style should be settable
        https://bugs.webkit.org/show_bug.cgi?id=164537
        <rdar://problem/29181773>

        Reviewed by Sam Weinig.

        CSSStyleRule.style / CSSPageRule.style / CSSKeyframeRule.style should be settable
        as per:
        - https://drafts.csswg.org/cssom/#the-cssstylerule-interface
        - https://drafts.csswg.org/cssom/#the-csspagerule-interface
        - https://drafts.csswg.org/css-animations/#interface-csskeyframerule

        Tests:
        http/wpt/cssom/CSSPageRule.html
        imported/w3c/web-platform-tests/cssom/CSSKeyframeRule.html
        imported/w3c/web-platform-tests/cssom/CSSStyleRule.html
        imported/w3c/web-platform-tests/cssom/interfaces.html

        * css/CSSKeyframeRule.idl:
        * css/CSSPageRule.idl:
        * css/CSSStyleRule.idl:

2017-06-07  Sam Weinig  <sam@webkit.org>

        [WebIDL] Split up attribute generation to match operation generation
        https://bugs.webkit.org/show_bug.cgi?id=173072

        Reviewed by Chris Dumez.

        * bindings/js/JSDOMAttribute.h:
        (WebCore::IDLAttribute::setStatic):
        (WebCore::IDLAttribute::getStatic):
        Add static variants of get/set matching the one in IDLOperation.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GetFullyQualifiedImplementationCallName):
        Factor out duplicate code to compute the qualified name for a function call.

        (AddAdditionalArgumentsForImplementationCall):
        Factor out duplicate code to compute the some standard arguments for a function
        call. We may want to merge this with GenerateCallWith.

        (GenerateHeader):
        Update for new signature of HasCustom... subroutines.
        
        (GenerateImplementation):
        Pass @implContent to more helper generators to continue propagating the idiom.

        (GenerateAttributeGetterBodyDefinition):
        (GenerateAttributeGetterTrampolineDefinition):
        (GenerateAttributeGetterDefinition):
        (GenerateAttributeSetterBodyDefinition):
        (GenerateAttributeSetterTrampolineDefinition):
        (GenerateAttributeSetterDefinition):
        Split attribute getter and setter generation up by having separate subroutines 
        to generate the trampoline and body. Also, make all attributes, even static ones
        use a trampoline to simplify the code. Static attributes got through a no-op 
        trampoline, that gets compiled away. Also adopt GetFullyQualifiedImplementationCallName
        and AddAdditionalArgumentsForImplementationCall to reduce duplication.

        (GenerateOperationBodyDefinition):
        (GenerateOperationDefinition):
        Adopt $outputArray idiom and adopt GetFullyQualifiedImplementationCallName
        and AddAdditionalArgumentsForImplementationCall to reduce duplication

        (GenerateParametersCheck):
        Adopt GetFullyQualifiedImplementationCallName and AddAdditionalArgumentsForImplementationCall 
        to reduce duplication.

        (HasCustomGetter):
        (HasCustomSetter):
        (HasCustomMethod):
        Convert HasCustom... subroutines to take an IDLAttribute rather than the extended
        attributes, matching other predicates

        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        Update test results.

2017-06-07  Youenn Fablet  <youenn@apple.com>

        RTCTrackEvent.track should be found in RTCTrackEvent.streams[0]
        https://bugs.webkit.org/show_bug.cgi?id=173074

        Reviewed by Eric Carlson.

        Covered by updated test.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::addTrackFromPlatform):

2017-06-07  Devin Rousso  <drousso@apple.com>

        Web Inspector: Add ContextMenu item to log WebSocket object to console
        https://bugs.webkit.org/show_bug.cgi?id=172878

        Reviewed by Joseph Pecoraro.

        Test: http/tests/websocket/tests/hybi/inspector/resolveWebSocket.html

        * inspector/InspectorNetworkAgent.h:
        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::InspectorNetworkAgent):
        (WebCore::InspectorNetworkAgent::webSocketForRequestId):
        (WebCore::webSocketAsScriptValue):
        (WebCore::InspectorNetworkAgent::resolveWebSocket):
        Loops over the static allActiveWebSockets to find one with the given requestId. If found, it
        will create a RemoteObject wrapper for it and send it back to the inspector.

2017-06-07  Devin Rousso  <drousso@apple.com>

        Web Inspector: Allow user to choose stylesheet when creating new rules
        https://bugs.webkit.org/show_bug.cgi?id=172487

        Reviewed by Joseph Pecoraro.

        New test: inspector/css/add-rule.html

        * inspector/InspectorStyleSheet.cpp:
        (WebCore::InspectorStyleSheet::addRule):
        Reparse the content when a new rule is added to a non-inspector origin stylesheet.

2017-06-07  Youenn Fablet  <youenn@apple.com>

        getUserMedia is prompting too often
        https://bugs.webkit.org/show_bug.cgi?id=172859
        <rdar://problem/32589950>

        Reviewed by Eric Carlson.

        Tests: fast/mediastream/getUserMedia-grant-persistency-reload.html
               fast/mediastream/getUserMedia-grant-persistency.html

        * loader/FrameLoaderClient.h:
        * page/Frame.cpp:
        (WebCore::Frame::setDocument): Allows notifying of change of main frame document.
        UIProcess will use that to remove unneeded previously granted gum permission.

2017-06-07  Chris Dumez  <cdumez@apple.com>

        Align <col span>/<colgroup span> limits with the latest HTML specification
        https://bugs.webkit.org/show_bug.cgi?id=173049

        Reviewed by Daniel Bates.

        Align <col span>/<colgroup span> limits with the latest HTML specification after:
        - https://github.com/whatwg/html/issues/2705
        - https://github.com/whatwg/html/pull/2734

        In particular, col / colspan's span attribute is now clamped to the [1, 1000] range.

        Test: imported/w3c/web-platform-tests/html/semantics/tabular-data/processing-model-1/col-span-limits.html

        [1] https://html.spec.whatwg.org/#dom-colgroup-span
        [2] https://html.spec.whatwg.org/#clamped-to-the-range
        [3] https://github.com/whatwg/html/pull/2734/files

        * html/HTMLTableColElement.cpp:
        (WebCore::HTMLTableColElement::parseAttribute):
        As per [1][2], the span attribute should be clamped to the range [1, 1000] with a default value of 1 (on getting).

        (WebCore::HTMLTableColElement::setSpan):
        As per [2], on setting, we should behave the same as setting a regular reflected unsigned integer when an attribute
        is clamped to a range. Therefore, we now call limitToOnlyHTMLNonNegative() instead of
        limitToOnlyHTMLNonNegativeNumbersGreaterThanZero(). We used to call limitToOnlyHTMLNonNegativeNumbersGreaterThanZero()
        because the value used to be limited to only non-negative numbers greater than zero with fallback before [3]. Without
        this change, "col.span = 0" would set the content attribute to 1 instead of 0, which would be wrong.

2017-06-07  Jer Noble  <jer.noble@apple.com>

        Exempt exclusively wall-powered devices from hardware codec requirement
        https://bugs.webkit.org/show_bug.cgi?id=173009

        Reviewed by Eric Carlson.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
        (WebCore::systemHasBattery):
        (WebCore::assetTrackMeetsHardwareDecodeRequirements):
        * platform/spi/cocoa/IOPSLibSPI.h: Added.

2017-06-07  Jer Noble  <jer.noble@apple.com>

        Refactoring: MediaEngineSupportParameters should take a ContentType rather than separate type & codecs strings
        https://bugs.webkit.org/show_bug.cgi?id=173038

        Reviewed by Eric Carlson.

        * Modules/encryptedmedia/CDM.cpp:
        (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::addSourceBuffer):
        (WebCore::MediaSource::isTypeSupported):
        * dom/DOMImplementation.cpp:
        (WebCore::DOMImplementation::createDocument):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::canPlayType):
        (WebCore::HTMLMediaElement::selectNextSourceChild):
        * platform/ContentType.cpp:
        (WebCore::ContentType::codecsParameter):
        (WebCore::ContentType::profilesParameter):
        (WebCore::ContentType::containerType):
        (WebCore::simplifyWhitespace):
        (WebCore::ContentType::codecs):
        (WebCore::ContentType::profiles):
        (WebCore::ContentType::type): Deleted.
        * platform/ContentType.h:
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::bestMediaEngineForSupportParameters):
        (WebCore::MediaPlayer::load):
        (WebCore::MediaPlayer::nextBestMediaEngine):
        (WebCore::MediaPlayer::loadWithNextMediaEngine):
        (WebCore::MediaPlayer::supportsType):
        (WebCore::MediaPlayer::networkStateChanged):
        (WebCore::codecs): Deleted.
        * platform/graphics/MediaPlayer.h:
        (WebCore::MediaPlayer::contentMIMEType):
        (WebCore::MediaPlayer::contentTypeCodecs):
        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
        (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType):
        (WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType):
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
        (WebCore::MediaPlayerPrivateAVFoundationCF::supportsType):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
        (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::supportsType):
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
        (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::MediaPlayerPrivateQTKit::supportsType):
        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
        (WebCore::MediaPlayerPrivateMediaFoundation::supportsType):
        * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
        (WebCore::MockMediaPlayerMediaSource::supportsType):
        * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
        (WebCore::MockMediaSourcePrivate::addSourceBuffer):

2017-06-07  Ryosuke Niwa  <rniwa@webkit.org>

        Use a dedicated node flag to identify a Document node
        https://bugs.webkit.org/show_bug.cgi?id=173037

        Reviewed by Chris Dumez.

        Address Antti's review comment. We don't need a new Node flg.

        * dom/Node.h:
        (WebCore::Node::isDocumentNode):

2017-06-07  Jon Davis  <jond@apple.com>

        Update feature status for features Supported In Preview
        https://bugs.webkit.org/show_bug.cgi?id=173071

        Reviewed by Darin Adler.

        Updated WebAssembly.

        * features.json:

2017-06-07  Sam Weinig  <sam@webkit.org>

        [WebIDL] PutForwards is not implemented to spec as illustrated by the WPT WebIDL/ecmascript-binding/put-forwards.html
        https://bugs.webkit.org/show_bug.cgi?id=172956

        Reviewed by Chris Dumez.

        Implements step 3.5.9 of https://heycam.github.io/webidl/#dfn-attribute-setter.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateAttributeSetterDefinition):
        Implement [PutForwards] to spec, which involves using JSC get/set rather than calling
        directly into the implementation.

        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        Update test results.

2017-06-07  Jer Noble  <jer.noble@apple.com>

        Clean-up: RenderElement.h includes headers it doesn't use
        https://bugs.webkit.org/show_bug.cgi?id=173046

        Reviewed by Andy Estes.

        Remove a couple of unneeded includes from RenderElement.h, and then clean up all the
        follow-on compile errors that causes. Mostly, these errors are fixed by including the
        correct headers at the point of use; otherwise, they're solved by forward-declaring types
        and in one case by moving default constructors implementation to the cpp file from the header.

        * css/parser/SizesAttributeParser.cpp:
        * editing/cocoa/EditorCocoa.mm:
        * platform/mac/PasteboardMac.mm:
        * rendering/InlineIterator.h:
        (WebCore::embedCharFromDirection):
        * rendering/RenderBoxModelObject.h:
        * rendering/RenderElement.cpp:
        * rendering/RenderElement.h:
        * rendering/RenderIterator.h:
        * rendering/RenderLineBreak.cpp:
        * rendering/RenderQuote.cpp:
        * rendering/RenderText.h:
        * rendering/SimpleLineLayoutPagination.cpp:
        * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
        * rendering/TextAutoSizing.cpp:
        * rendering/style/RenderStyle.cpp:
        * rendering/style/RenderStyle.h:
        * style/RenderTreeUpdater.cpp:
        * style/StyleResolveForDocument.cpp:
        * style/StyleTreeResolver.cpp:

2017-06-07  Youenn Fablet  <youenn@apple.com>

        Add WebRTC stats logging
        https://bugs.webkit.org/show_bug.cgi?id=173045

        Reviewed by Eric Carlson.

        No change of behavior.

        Do release logging of WebRTC stats once remote description is set.
        Do logging every second for the first 30 seconds.
        After 30 seconds, do release logging of these stats every 5 seconds.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
        (WebCore::LibWebRTCMediaEndpoint::stop):
        (WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
        (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
        (WebCore::LibWebRTCMediaEndpoint::startLoggingStats):
        (WebCore::LibWebRTCMediaEndpoint::stopLoggingStats):
        (WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):

2017-06-07  Per Arne Vollan  <pvollan@apple.com>

        Support removal of authentication data through the Website data store API.
        https://bugs.webkit.org/show_bug.cgi?id=171217

        Reviewed by Brady Eidson.

        Add support to remove and fetch credential data through the Website data store API.

        Test: http/tests/loading/basic-auth-remove-credentials.html

        * platform/network/CredentialStorage.h:
        (WebCore::CredentialStorage::originsWithCredentials):

2017-06-07  Per Arne Vollan  <pvollan@apple.com>

        AudioSourceProviderAVFObjC::m_tap member access is not thread safe.
        https://bugs.webkit.org/show_bug.cgi?id=172263

        Reviewed by Darin Adler.

        It it possible that the main thread will modify the m_tap member by calling
        AudioSourceProviderAVFObjC::destroyMix(), while m_tap is being read on a secondary
        thread under AudioSourceProviderAVFObjC::processCallback(). Instead of accessing
        the m_tap member on the secondary thread, we can use the same MTAudioProcessingTapRef
        provided by MediaToolbox in the callback. We assume the tap ref is retained by
        MediaToolbox, so it should be safe to use even if the the m_tap member is set to null.

        Covered by existing tests.

        * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
        * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
        (WebCore::AudioSourceProviderAVFObjC::processCallback):
        (WebCore::AudioSourceProviderAVFObjC::process):

2017-06-07  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] RSA-PSS support
        https://bugs.webkit.org/show_bug.cgi?id=172856

        Reviewed by Jiewen Tan.

        Implement RSA-PSS support for Web Crypto API in ports that use libgcrypt.

        For the signing operation, the digest algorithm is determined and used to
        compute the hash of the passed-in data. The given salt length and hash results
        are embedded into a data s-expression, specifying PSS as the preferred type of
        padding. This s-expression and the provided key are then passed to the
        gcry_pk_sign() call which computes the signature. The MPI data of this signature
        is retrieved and its size validated before being passed to the success callback.

        For the verification operation, the hash of the passed-in data is computed as
        before, embedding it into a data s-expression along with the specified salt
        length. The passed-in signature data is embedded into a sig-val s-expression.
        The two s-expressions are passed to the gcry_pk_verify() call along with the
        key. If the returned error code for this operation is GPG_ERR_NO_ERROR the
        verification is deemed successful, while in case of any other error code (which
        might indicate a verification failure or an operation error) we simply signal
        that the verification step failed (and not that it possibly errored out).

        No new tests -- covered by existing tests.

        * PlatformGTK.cmake: Add the new build targets.
        * PlatformWPE.cmake: Ditto.
        * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp: Added.
        (WebCore::gcryptSign):
        (WebCore::gcryptVerify):
        (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
        (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
        * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
        (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Register the RSA-PSS algorithm.

2017-06-07  Ryosuke Niwa  <rniwa@webkit.org>

        Merge TreeScopeAdopter into TreeScope
        https://bugs.webkit.org/show_bug.cgi?id=173040

        Reviewed by Antti Koivisto.

        Merged TreeScopeAdopter into TreeScope since it's used by TreeScope::adoptIfNeeded.

        Most of code changes are for didMoveToNewDocument taking the new document as an argument,
        which is used by ShadowRoot::didMoveToNewDocument to update its document scope.

        No new tests since there should be no behavioral change.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/Element.cpp:
        (WebCore::Element::didMoveToNewDocument):
        * dom/Element.h:
        * dom/Node.cpp:
        (WebCore::Node::didMoveToNewDocument): Moved the code to moves the node lists and node iterators here
        from TreeScopeAdopter::moveNodeToNewDocument.
        * dom/Node.h:
        * dom/ShadowRoot.cpp:
        (WebCore::ShadowRoot::didMoveToNewDocument): Moved the code to update the document scope here
        from TreeScopeAdopter::moveNodeToNewDocument.
        * dom/ShadowRoot.h:
        * dom/TreeScope.cpp:
        (WebCore::TreeScope::adoptIfNeeded):
        (WebCore::TreeScope::moveTreeToNewScope): Moved from TreeScopeAdopter. Now takes the old tree scope and
        the new tree scope as arguments (they used to be members of TreeScopeAdopter). Also merged updateTreeScope
        into this function.
        (WebCore::TreeScope::ensureDidMoveToNewDocumentWasCalled): Moved from TreeScopeAdopter.
        (WebCore::TreeScope::moveNodeToNewDocument): Ditto. The code to adopt node lists and node iterators have
        been moved to Node::didMoveToNewDocument.
        (WebCore::TreeScope::moveShadowTreeToNewDocument): Moved from TreeScopeAdopter.
        * dom/TreeScope.h:
        (WebCore::TreeScope::ensureDidMoveToNewDocumentWasCalled):
        * dom/TreeScopeAdopter.cpp: Removed.
        * dom/TreeScopeAdopter.h: Removed.
        * html/HTMLFieldSetElement.cpp:
        (WebCore::HTMLFieldSetElement::didMoveToNewDocument):
        * html/HTMLFieldSetElement.h:
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::didMoveToNewDocument):
        * html/HTMLFormControlElement.h:
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::didMoveToNewDocument):
        * html/HTMLFormElement.h:
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::didMoveToNewDocument):
        * html/HTMLImageElement.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::didMoveToNewDocument): Grouped related function calls on new/old documents.
        * html/HTMLInputElement.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::didMoveToNewDocument):
        * html/HTMLMediaElement.h:
        * html/HTMLObjectElement.cpp:
        (WebCore::HTMLObjectElement::didMoveToNewDocument):
        * html/HTMLObjectElement.h:
        * html/HTMLPictureElement.cpp:
        (WebCore::HTMLPictureElement::didMoveToNewDocument):
        * html/HTMLPictureElement.h:
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::didMoveToNewDocument):
        * html/HTMLPlugInImageElement.h:
        * html/HTMLTemplateElement.cpp:
        (WebCore::HTMLTemplateElement::didMoveToNewDocument):
        * html/HTMLTemplateElement.h:
        * html/HTMLVideoElement.cpp:
        (WebCore::HTMLVideoElement::didMoveToNewDocument):
        * html/HTMLVideoElement.h:
        * html/ImageDocument.cpp:
        (WebCore::ImageDocumentElement::didMoveToNewDocument):
        * svg/SVGImageElement.cpp:
        (WebCore::SVGImageElement::didMoveToNewDocument):
        * svg/SVGImageElement.h:
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::didMoveToNewDocument):
        * svg/SVGSVGElement.h:

2017-06-06  Ryosuke Niwa  <rniwa@webkit.org>

        Use a dedicated node flag to identify a Document node
        https://bugs.webkit.org/show_bug.cgi?id=173037

        Reviewed by Chris Dumez.

        Use a Node flag to identify a Document node instead of checking this == document() which loads TreeScope.

        * dom/Document.h:
        (WebCore::Node::isDocumentNode): Deleted.
        * dom/Node.h:
        (WebCore::Node::isDocumentNode):

2017-06-06  Dan Bernstein  <mitz@apple.com>

        Fixed building with the macOS 10.13 Apple Internal SDK when targeting macOS 10.12.

        * platform/spi/cocoa/PassKitSPI.h:

2017-06-06  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r214974.

        Causes some tabs to start using a huge amount of CPU after 8
        minutes in the background

        Reverted changeset:

        "Make inactive web processes behave as though under memory
        pressure."
        https://bugs.webkit.org/show_bug.cgi?id=170042
        http://trac.webkit.org/changeset/214974

2017-06-06  Tim Horton  <timothy_horton@apple.com>

        Crash trying to drag the entire text of a long book out of Mail compose view
        https://bugs.webkit.org/show_bug.cgi?id=173042
        <rdar://problem/32382059>

        Reviewed by Simon Fraser.

        Creating a TextIndicator that is hundreds of thousands of pixels tall
        is not a good idea. We introduced TextIndicatorOptionDoNotClipToVisibleRect
        so that (for example) an image that overhangs the edge of the page would
        contain the entire image, instead of just the visible fragment.
        Instead, rename this option to ExpandClipBeyondVisibleRect, and make it
        not unclip *entirely*, but expand the clip significantly (50% in each direction)
        beyond the bounds of the current visible rect. Also, make use of exposed
        area information for this clipping; otherwise, clients with very large views
        inside scrollable areas (like Mail) would still try to create large TextIndicators.

        * page/TextIndicator.cpp:
        (WebCore::initializeIndicator):
        * page/TextIndicator.h:

2017-06-06  Chris Dumez  <cdumez@apple.com>

        RELEASE_ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values)) hit in convertEnumerationToJS<WebCore::History::ScrollRestoration>()
        https://bugs.webkit.org/show_bug.cgi?id=173033
        <rdar://problem/32591099>

        Reviewed by Simon Fraser.

        History::scrollRestoration() was returning a bad value because HistoryItem::m_shouldRestoreScrollPosition
        was initialized from FrameState::shouldRestoreScrollPosition member, which was not initialized when
        restored from the legacy session restore API.

        Tests: WebKit2.RestoreSessionStateContainingScrollRestoration* API tests.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateEnumerationImplementationContent):
        Drop the RELEASE_ASSERT that was added to debug this and use the regular debug ASSERT.

        * history/HistoryItem.cpp:
        (WebCore::HistoryItem::setShouldRestoreScrollPosition):
        Make sure we notify that the HistoryItem has changed when setShouldRestoreScrollPosition()
        is called.

2017-06-06  Darin Adler  <darin@apple.com>

        Update to slightly stricter rules for custom element names from more recent standard draft
        https://bugs.webkit.org/show_bug.cgi?id=173019

        Reviewed by Ryosuke Niwa.

        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::validateCustomElementNameAndThrowIfNeeded): Add more error strings for various error cases.

        * dom/Document.cpp:
        (WebCore::isPotentialCustomElementNameCharacter): Added. Implements the PCENChar production
        from the standard by listing all the ranges exactly as they appear in the standard.
        (WebCore::Document::validateCustomElementName): Added a check that the first character is
        a lowercase ASCII letter. Added a check that all characters are potential custom element
        name characters.

        * dom/Document.h: Update the CustomElementNameValidationStatus with new values for
        the various new error cases.  Not sure that validateCustomElementName really belongs
        in the Document class in the first place. Also seems that the error strings could be
        in validateCustomElementName rather than in a separate bindings function, obviating
        the need for the enum.

2017-06-06  Yoav Weiss  <yoav@yoav.ws>

        [preload] Conditional support for media preloading and align media `as` values.
        https://bugs.webkit.org/show_bug.cgi?id=172501

        Reviewed by Dean Jackson.

        As discussed at https://bugs.webkit.org/show_bug.cgi?id=171720#c11 media preloading may not work
        since the backend may not reuse such resources properly.
        This patch makes support for media preloading conditional on a setting, in order to avoid double downloads in these cases.
        It also aligns the media `as` values to the spec, and splitting them into "video" and "audio".

        No new tests but related tests were modified to remove media preloading tests as the setting is off by default.

        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::resourceTypeFromAsAttribute): Make handling of MediaResource conditional on setting. Align `as` values to spec.
        (WebCore::createLinkPreloadResourceClient): Make handling of MediaResource conditional on setting.
        (WebCore::LinkLoader::isSupportedType): Make handling of MediaResource conditional on setting.
        * page/RuntimeEnabledFeatures.h: Added a media preloading preference.
        (WebCore::RuntimeEnabledFeatures::setMediaPreloadingEnabled):
        (WebCore::RuntimeEnabledFeatures::mediaPreloadingEnabled):
        * page/Settings.in: Added a media preloading preference.

2017-06-06  Don Olmstead  <don.olmstead@am.sony.com>

        [WebCore] Enable REQUEST_ANIMATION_FRAME_TIMER for all ports
        https://bugs.webkit.org/show_bug.cgi?id=172780

        Reviewed by Alex Christensen.

        No new tests. No change in behavior.

        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::ScriptedAnimationController):
        (WebCore::ScriptedAnimationController::addThrottlingReason):
        (WebCore::ScriptedAnimationController::removeThrottlingReason):
        (WebCore::ScriptedAnimationController::isThrottled):
        (WebCore::ScriptedAnimationController::interval):
        (WebCore::ScriptedAnimationController::scheduleAnimation):
        (WebCore::ScriptedAnimationController::displayRefreshFired):
        * dom/ScriptedAnimationController.h:
        * loader/EmptyClients.h:
        * page/Chrome.cpp:
        (WebCore::Chrome::scheduleAnimation): Deleted.
        * page/Chrome.h:
        * page/ChromeClient.h:
        * platform/Curl.cmake: Added.
        * platform/ScrollAnimationSmooth.cpp:
        (WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth):
        (WebCore::ScrollAnimationSmooth::stop):
        (WebCore::ScrollAnimationSmooth::animationTimerFired):
        (WebCore::ScrollAnimationSmooth::startNextTimer):
        (WebCore::ScrollAnimationSmooth::animationTimerActive):
        (WebCore::ScrollAnimationSmooth::serviceAnimation): Deleted.
        * platform/ScrollAnimationSmooth.h:

2017-06-06  Darin Adler  <darin@apple.com>

        Cut down use of WTF_ARRAY_LENGTH
        https://bugs.webkit.org/show_bug.cgi?id=172997

        Reviewed by Chris Dumez.

        * contentextensions/NFAToDFA.cpp: Remove unused SetTransitions class.

        * dom/Document.cpp:
        (WebCore::Document::~Document): Use modern for loop instead of WTF_ARRAY_LENGTH.
        * dom/make_names.pl:
        (printDefinitions): Ditto.
        (printFactoryCppFile): Ditto.
        (printWrapperFactoryCppFile): Ditto.

        * platform/URL.cpp:
        (WebCore::portAllowed): Use std::is_sorted, std::begin, and std::end
        in sort assertion to greatly streamline it and eliminate use of WTF_ARRAY_LENGTH.
        Also allow the sort assertion to run every time; slightly optimizing debug builds
        was not worth having the code be messy.

        * platform/URLParser.cpp:
        (WebCore::URLParser::appendNumberToASCIIBuffer): Use std::end instead of
        WTF_ARRAY_LENGTH.

        * platform/graphics/FontCascade.cpp: Make fontFamiliesWithInvalidCharWidth be
        a constant array rather than a non-constant array to constant strings.
        (WebCore::FontCascade::hasValidAverageCharWidth): Streamline the hash table
        initialization to avoid heap allocation and use a modern for loop instead of
        WTF_ARRAY_LENGTH.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::disableComponentsOnce): Use a modern for loop instead of WTF_ARRAY_LENGTH.
        * platform/network/CacheValidation.cpp:
        (WebCore::shouldUpdateHeaderAfterRevalidation): Ditto. Also use the
        startsWithIgnoringASCIICase function rather than the version that folds
        arbitrary Unicode case.

        * platform/text/TextEncodingRegistry.cpp:
        (WebCore::pruneBlacklistedCodecs): Use modern for loops to make the code considerably
        easier to read and avoid WTF_ARRAY_LENGTH.

        * platform/text/mac/LocaleMac.mm:
        (WebCore::LocaleMac::monthLabels): Use modern for loop instead of WTF_ARRAY_LENGTH.
        (WebCore::LocaleMac::shortMonthLabels): Ditto.
        * rendering/RenderCombineText.cpp:
        (WebCore::RenderCombineText::combineText): Ditto.

2017-06-06  Isaac Devine  <isaac@devinesystems.co.nz>

        Allow FileReader to open files multiple times

        If multiple file readers open files they are prevented by default due to
        Windows' file locking.

        Allow FileReader to open multiple files for reading at the same time on wincairo
        https://bugs.webkit.org/show_bug.cgi?id=172632

        Reviewed by Darin Adler.

        * platform/win/FileSystemWin.cpp:
        (WebCore::openFile): Use the appropriate sharing options to allow multiple opens

2017-06-06  Beth Dakin  <bdakin@apple.com>

        Netflix seeking quirk should also apply to Now Playing, and should always use the 
        livestream UI
        https://bugs.webkit.org/show_bug.cgi?id=173030
        -and corresponding-
        rdar://problem/32228660

        Reviewed by Darin Adler.

        This patch rolls out much of https://trac.webkit.org/changeset/217791/webkit in 
        favor of an approach that can be used to apply the quirk to Now Playing in 
        addition to Touch Bar. This patch also changes the UI in both Touch Bar and Now 
        Playing to match live stream UI, which means there is no playhead. This hopefully 
        makes it less confusing that taps on the timeline will have no effect. 

        supportsSeeking() should return false for Netflix. That function needs to be 
        public now.
        * html/HTMLMediaElement.cpp:
        (WebCore::needsSeekingSupportQuirk):
        (WebCore::HTMLMediaElement::supportsSeeking):
        * html/HTMLMediaElement.h:

        Here is where we get the desired result in Now Playing. Make sure the 
        currentSession supportsSeeking() before relying on the time and duration info for 
        the sake of Now Playing. 
        * platform/audio/mac/MediaSessionManagerMac.mm:
        (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):

        We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
        * platform/cocoa/WebPlaybackSessionModel.h:
        (WebCore::WebPlaybackSessionModelClient::mutedChanged):
        (WebCore::WebPlaybackSessionModelClient::allowsTouchBarScrubbingChanged): Deleted.
        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):

        And here is where we get the desired result for Touch Bar. Make sure the the media 
        element supportsSeeking() before relying on the duration. 
        (WebCore::WebPlaybackSessionModelMediaElement::duration):

        We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
        (WebCore::WebPlaybackSessionModelMediaElement::allowsTouchBarScrubbing): Deleted.
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        * platform/mac/WebPlaybackControlsManager.h:

        Currently the Touch Bar live stream UI lets you seek, which results in broken 
        behavior on real live streams and on Netflix. Prevent that by preventing scrubbing 
        for NaN and infinite durations.
        * platform/mac/WebPlaybackControlsManager.mm:
        (-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):

        We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
        * platform/mac/WebPlaybackSessionInterfaceMac.h:
        * platform/mac/WebPlaybackSessionInterfaceMac.mm:
        (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
        (WebCore::WebPlaybackSessionInterfaceMac::allowsTouchBarScrubbingChanged): Deleted.

2017-06-06  Konstantin Tokarev  <annulen@yandex.ru>

        Add missing <functional> includes
        https://bugs.webkit.org/show_bug.cgi?id=173017

        Patch by Thiago Macieira <thiago.macieira@intel.com>
        Reviewed by Yusuke Suzuki.

        This patch fixes compilation with GCC 7.

        No new tests needed.

        * css/CSSValue.h:
        * css/StyleSheetContents.h:
        * loader/NetscapePlugInStreamLoader.h:
        * loader/ResourceLoader.h:

2017-06-06  Konstantin Tokarev  <annulen@yandex.ru>

        Fix compilation with !ENABLE(SVG_FONTS)
        https://bugs.webkit.org/show_bug.cgi?id=172731

        Reviewed by Darin Adler.

        No new tests needed.

        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::load):

2017-06-06  Zalan Bujtas  <zalan@apple.com>

        Safari doesn't load newest The Order of the Stick comic.
        https://bugs.webkit.org/show_bug.cgi?id=172949
        <rdar://problem/32389730>

        Reviewed by Antti Koivisto.

        As part of the table layout, RenderTableSection::layoutRows calls the RenderTableCell's layout() directly
        (skipping the RenderTableRow parent). If during this call the RenderTableCell (or any of its descendant) marks the ancestor
        chain dirty, this dirty flag on the RenderTableRows will never be cleared and we'll end up early returning from RenderTableSection::paint.
        For certain type of float objects, we need to invalidate the line layout path during layout (and we mark the ancestors dirty).
        This patch takes a conservative approach and marks the ancestors dirty only when the renderer is not dirty yet, but
        as part of webkit.org/b/172947 we should revisit and validate whether the setNeedsLayout() is required at all.

        Test: fast/table/floating-table-sibling-is-invisible.html

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::invalidateLineLayoutPath):

2017-06-06  Emilio Cobos Álvarez  <ecobos@igalia.com>

        [css-conditional] The one-string version of CSS.supports should be wrapped in implied parentheses.
        https://bugs.webkit.org/show_bug.cgi?id=172906

        Reviewed by Darin Adler.

        From https://drafts.csswg.org/css-conditional/#the-css-interface:

        > When invoked with a single conditionText argument, it must return
        > true if conditionText, when either parsed and evaluated as a
        > supports_condition or parsed as a declaration, wrapped in implied
        > parentheses, and evaluated as a supports_condition, would return
        > true.

        Note the "wrapped in implied parentheses" bit.

        Gecko is fixing it in https://bugzil.la/1338486, and Blink in
        https://crbug.com/729403.

        Tests: css3/supports-dom-api.html
               imported/w3c/web-platform-tests/cssom/CSS.html

        * css/parser/CSSParser.cpp:
        (WebCore::CSSParser::parseSupportsCondition):
        * css/parser/CSSParserImpl.cpp:
        (WebCore::CSSParserImpl::consumeSupportsRule):
        * css/parser/CSSSupportsParser.cpp:
        (WebCore::CSSSupportsParser::supportsCondition):
        * css/parser/CSSSupportsParser.h:

2017-06-06  Joseph Pecoraro  <pecoraro@apple.com>

        Move Resource Timing / User Timing from experimental features into main preferences
        https://bugs.webkit.org/show_bug.cgi?id=172950

        Reviewed by Darin Adler.

        * features.json:
        Graduate some features from In Development to Supported.

2017-06-06  Adrian Perez de Castro  <aperez@igalia.com>

        [GTK][Wayland] Do not pass value of $DISPLAY to wl_display_connect()
        https://bugs.webkit.org/show_bug.cgi?id=172993

        Reviewed by Žan Doberšek.

        No new tests needed.

        * platform/graphics/wayland/PlatformDisplayWayland.cpp:
        (WebCore::PlatformDisplayWayland::create): Instead of using the "DISPLAY" environment variable (meant for X11),
        pass a null pointer to "wl_display_connect()". This function checks the value of the "WAYLAND_DISPLAY" environment
        variable itself and therefore we do not need to pass it ourselves.

2017-06-06  Antoine Quint  <graouts@apple.com>

        Rebaseline and enable media/modern-media-controls/airplay-support
        https://bugs.webkit.org/show_bug.cgi?id=172980

        Reviewed by Eric Carlson.

        Fixing a small issue in the modern media controls code which would yield
        an error when manually creating a MediaController without a MediaControlsHost.

        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController.prototype.get isAudio):

2017-06-06  Antoine Quint  <graouts@apple.com>

        Update modern media controls testing utilities
        https://bugs.webkit.org/show_bug.cgi?id=172976
        <rdar://problem/32588432>

        Reviewed by Eric Carlson.

        Stop logging an error when we're not able to load UI Strings since UI strings
        are not defined in the majority of modern-media-controls tests as we load the
        code directly from the modern-media-controls module and can't reach into the
        English.lproj directory, nor is it necessary.

        * Modules/modern-media-controls/main.js:
        (UIString):

2017-06-06  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GStreamer] Use the same draw timer and mutex when AC disabled or building without OpenGL
        https://bugs.webkit.org/show_bug.cgi?id=172923

        Reviewed by Michael Catanzaro.

        We have two different paths to do the same. When building without OpenGL, the VideoRenderRequestScheduler has
        its own timer and we need to add ifdefs to handle that. But when building with OpenGL we still support
        non-accelerated rendering that does the same than the VideoRenderRequestScheduler timer, but using the media
        player timer instead. We can simplify the code and remove more ifdefs by using the media player timer and mutex
        in all cases for non-accelerated rendering.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
        (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
        (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
        (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
        (VideoRenderRequestScheduler::start):
        (VideoRenderRequestScheduler::stop):
        (VideoRenderRequestScheduler::requestRender):
        (VideoRenderRequestScheduler::VideoRenderRequestScheduler): Deleted.
        (VideoRenderRequestScheduler::render): Deleted.

2017-06-05  Antoine Quint  <graouts@apple.com>

        Update media controls to match latest design specs
        https://bugs.webkit.org/show_bug.cgi?id=172932

        Reviewed by Dean Jackson.

        The media controls specs have changed and we now implement them. The main controls bar now
        appears to be floating, with a rounded corners and a margin around it. Some of the controls
        it used to contain now may appear outside of it. Specifically, the fullscreen and
        picture-in-picture buttons now are displayed in a dedicated controls bar in the top-left
        corner and the mute button, on iOS (where we don't support changing the volume when inline),
        is displayed in the top right corner.

        Another small UI improvement is that we display an activity indicator when we are waiting
        for data to initiate or resume playback instead of showing the elapsed time label. We also
        make displaying the scrubber more important than displaying other controls, except for the
        play/pause button, when width becomes scarce. Finally, we no longer use a speci layer type
        for the controls bar backgrounds, we now use the same "backdrop-filter" and tint overlay
        on both macOS and iOS.

        Since this work had previously been done through WebKitAdditions, we remove the specific
        build phase code that we added for this purpose and are now only ever looking for media
        controls code in the WebCore source tree.

        * Modules/modern-media-controls/controls/activity-indicator.css: Added.
        (.activity-indicator):
        (.activity-indicator > div):
        (.activity-indicator > .ne):
        (.activity-indicator > .e):
        (.activity-indicator > .se):
        (.activity-indicator > .s):
        (.activity-indicator > .sw):
        (.activity-indicator > .w):
        (.activity-indicator > .nw):
        (@keyframes activity-indicator-pulse):
        (to):
        * Modules/modern-media-controls/controls/airplay-button.js:
        * Modules/modern-media-controls/controls/auto-hide-controller.js: Added.
        (AutoHideController):
        (AutoHideController.prototype.get fadesWhileIdle):
        (AutoHideController.prototype.set fadesWhileIdle):
        (AutoHideController.prototype.handleEvent):
        (AutoHideController.prototype.gestureRecognizerStateDidChange):
        (AutoHideController.prototype.mediaControlsFadedStateDidChange):
        (AutoHideController.prototype.mediaControlsBecameInvisible):
        (AutoHideController.prototype._cancelNonEnforcedAutoHideTimer):
        (AutoHideController.prototype._cancelAutoHideTimer):
        (AutoHideController.prototype._resetAutoHideTimer):
        (AutoHideController.prototype._autoHideTimerFired):
        * Modules/modern-media-controls/controls/background-click-delegate-notifier.js: Added.
        (BackgroundClickDelegateNotifier):
        (BackgroundClickDelegateNotifier.prototype.handleEvent):
        * Modules/modern-media-controls/controls/background-tint.css:
        (.background-tint,):
        (.background-tint > .blur):
        (.background-tint > .tint):
        * Modules/modern-media-controls/controls/button.css:
        (button):
        (button > picture):
        (button.skip-back > picture,):
        (button.on > picture):
        (button:active > picture):
        (button.corner):
        (button.center,):
        (button.center):
        (button.small-center):
        (button.center > .background-tint,):
        (button.center > picture,):
        (button.center:active > picture,):
        * Modules/modern-media-controls/controls/button.js:
        (Button.prototype.get iconName):
        (Button.prototype.set iconName):
        (Button.prototype.get on):
        (Button.prototype.set on):
        (Button.prototype.get style):
        (Button.prototype.set style):
        (Button.prototype.get scaleFactor):
        (Button.prototype.set scaleFactor):
        (Button.prototype.handleEvent):
        (Button.prototype.commit):
        (Button.prototype._loadImage):
        (Button.prototype._imageSourceDidLoad):
        (Button.prototype._updateImage):
        (Button.prototype._updateImageMetrics):
        (Button):
        * Modules/modern-media-controls/controls/buttons-container.css:
        (.buttons-container):
        (.ios .buttons-container button):
        * Modules/modern-media-controls/controls/buttons-container.js:
        * Modules/modern-media-controls/controls/controls-bar.css:
        (.controls-bar):
        (.controls-bar.faded): Deleted.
        * Modules/modern-media-controls/controls/controls-bar.js:
        (ControlsBar.prototype.get children):
        (ControlsBar.prototype.set children):
        (ControlsBar.prototype.commitProperty):
        (ControlsBar.prototype.get userInteractionEnabled): Deleted.
        (ControlsBar.prototype.set userInteractionEnabled): Deleted.
        (ControlsBar.prototype.get fadesWhileIdle): Deleted.
        (ControlsBar.prototype.set fadesWhileIdle): Deleted.
        (ControlsBar.prototype.get visible): Deleted.
        (ControlsBar.prototype.set visible): Deleted.
        (ControlsBar.prototype.get faded): Deleted.
        (ControlsBar.prototype.set faded): Deleted.
        (ControlsBar.prototype.handleEvent): Deleted.
        (ControlsBar.prototype.gestureRecognizerStateDidChange): Deleted.
        (ControlsBar.prototype._cancelNonEnforcedAutoHideTimer): Deleted.
        (ControlsBar.prototype._cancelAutoHideTimer): Deleted.
        (ControlsBar.prototype._resetAutoHideTimer): Deleted.
        (ControlsBar.prototype._autoHideTimerFired): Deleted.
        * Modules/modern-media-controls/controls/fullscreen-button.js:
        * Modules/modern-media-controls/controls/icon-button.css: Removed.
        * Modules/modern-media-controls/controls/icon-button.js: Removed.
        * Modules/modern-media-controls/controls/icon-service.js:
        (const.iconService.new.IconService.prototype.imageForIconAndLayoutTraits):
        (const.iconService.new.IconService.prototype._fileNameAndPlatformForIconAndLayoutTraits):
        (const.iconService.new.IconService):
        (const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits): Deleted.
        (const.iconService.new.IconService.prototype._fileNameAndPlatformForIconNameAndLayoutTraits): Deleted.
        * Modules/modern-media-controls/controls/inline-layout-support.js: Removed.
        * Modules/modern-media-controls/controls/inline-media-controls.css: Added.
        (.media-controls.inline > .controls-bar):
        (.media-controls.inline > .controls-bar.top-left):
        (.media-controls.inline.audio > .controls-bar):
        (.media-controls.inline > .controls-bar > *):
        (.media-controls.inline > button.mute):
        (.media-controls.inline > button.play-pause.corner):
        (.media-controls.inline.audio > button.play-pause.corner):
        (.media-controls.inline > .controls-bar button):
        (.media-controls.inline button.start.center > picture,):
        (.media-controls.inline button.start.small-center > picture,):
        (.media-controls.inline .time-control,):
        * Modules/modern-media-controls/controls/inline-media-controls.js: Added.
        (InlineMediaControls):
        (InlineMediaControls.prototype.set shouldUseAudioLayout):
        (InlineMediaControls.prototype.set shouldUseSingleBarLayout):
        (InlineMediaControls.prototype.get showsStartButton):
        (InlineMediaControls.prototype.set showsStartButton):
        (InlineMediaControls.prototype.showPlacard):
        (InlineMediaControls.prototype.hidePlacard):
        (InlineMediaControls.prototype.layout):
        (InlineMediaControls.prototype.commitProperty):
        (InlineMediaControls.prototype.get preferredMuteButtonStyle):
        (InlineMediaControls.prototype._topLeftContainerButtons):
        (InlineMediaControls.prototype._leftContainerButtons):
        (InlineMediaControls.prototype._rightContainerButtons):
        (InlineMediaControls.prototype._droppableButtons):
        * Modules/modern-media-controls/controls/ios-inline-media-controls.css: Removed.
        * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
        (IOSInlineMediaControls.prototype.get showsStartButton):
        (IOSInlineMediaControls.prototype.set showsStartButton):
        (IOSInlineMediaControls.prototype.gestureRecognizerStateDidChange):
        (IOSInlineMediaControls.prototype._pinchGestureRecognizerStateDidChange):
        (IOSInlineMediaControls.prototype._tapGestureRecognizerStateDidChange):
        (IOSInlineMediaControls):
        (IOSInlineMediaControls.prototype.layout): Deleted.
        (IOSInlineMediaControls.prototype.layoutTraitsDidChange): Deleted.
        * Modules/modern-media-controls/controls/layout-item.js:
        * Modules/modern-media-controls/controls/layout-node.js:
        (LayoutNode.prototype.commitProperty):
        * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css: Removed.
        * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
        (.media-controls.mac.fullscreen .buttons-container.left):
        (.media-controls.mac.fullscreen .buttons-container.center):
        (.media-controls.mac.fullscreen .time-control):
        (.media-controls.mac.fullscreen > .controls-bar .status-label):
        (.media-controls.mac.fullscreen > .controls-bar > .background-tint > div): Deleted.
        (.media-controls.mac.fullscreen .volume.slider): Deleted.
        (.media-controls.mac.fullscreen button.volume-down): Deleted.
        (.media-controls.mac.fullscreen button.volume-up): Deleted.
        (.media-controls.mac.fullscreen button.rewind): Deleted.
        (.media-controls.mac.fullscreen button.play-pause): Deleted.
        (.media-controls.mac.fullscreen button.forward): Deleted.
        (.media-controls.mac.fullscreen .time-label): Deleted.
        (.media-controls.mac.fullscreen .scrubber): Deleted.
        * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
        (MacOSFullscreenMediaControls.prototype.handleEvent):
        (MacOSFullscreenMediaControls.prototype.layout):
        (MacOSFullscreenMediaControls.prototype._handleMousedown):
        (MacOSFullscreenMediaControls.prototype._handleMousemove):
        * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
        (.media-controls.mac.inline .volume-slider-container):
        (.media-controls.mac.inline.audio .volume-slider-container):
        (.media-controls.mac.inline .volume-slider-container > .background-tint):
        (.media-controls.mac.inline .volume-slider-container > .background-tint > div):
        (.media-controls.mac.inline .volume-slider-container > .slider):
        (.media-controls.mac.inline > .controls-bar): Deleted.
        (.media-controls.mac.inline > .controls-bar > *): Deleted.
        (.media-controls.mac.inline > button.start > div): Deleted.
        (.media-controls.mac.inline > .controls-bar button): Deleted.
        (.media-controls.mac.inline button.play-pause): Deleted.
        (.media-controls.mac.inline button.skip-back): Deleted.
        (.media-controls.mac.inline .scrubber.slider): Deleted.
        (.media-controls.mac.inline button.mute): Deleted.
        (.media-controls.mac.inline button.airplay): Deleted.
        (.media-controls.mac.inline button.pip): Deleted.
        (.media-controls.mac.inline button.tracks): Deleted.
        (.media-controls.mac.inline button.fullscreen): Deleted.
        (.media-controls.mac.inline .time-label,): Deleted.
        (.media-controls.mac.inline .volume.slider): Deleted.
        * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
        (MacOSInlineMediaControls.prototype.layout):
        (MacOSInlineMediaControls.prototype.get preferredMuteButtonStyle):
        (MacOSInlineMediaControls.prototype.handleEvent):
        (MacOSInlineMediaControls.prototype.layoutTraitsDidChange): Deleted.
        * Modules/modern-media-controls/controls/macos-media-controls.js: Removed.
        * Modules/modern-media-controls/controls/media-controls.css:
        (:host(audio)):
        (*):
        (:host(audio), *):
        (.media-controls-container):
        (.media-controls):
        (.media-controls > *):
        (.media-controls.shows-tracks-panel > .controls-bar,):
        (.media-controls.faded > *:not(.placard)):
        (.media-controls .time-label,):
        * Modules/modern-media-controls/controls/media-controls.js:
        (MediaControls.prototype.get visible):
        (MediaControls.prototype.set visible):
        (MediaControls.prototype.get faded):
        (MediaControls.prototype.set faded):
        (MediaControls.prototype.showTracksPanel):
        (MediaControls.prototype.hideTracksPanel):
        (MediaControls.prototype.isPointInControls):
        (MediaControls.prototype.handleEvent):
        (MediaControls.prototype.commitProperty):
        (MediaControls.prototype.get layoutTraits): Deleted.
        (MediaControls.prototype.set layoutTraits): Deleted.
        (MediaControls.prototype.get showsStartButton): Deleted.
        (MediaControls.prototype.set showsStartButton): Deleted.
        (MediaControls.prototype.get placard): Deleted.
        (MediaControls.prototype.get showsPlacard): Deleted.
        (MediaControls.prototype.showPlacard): Deleted.
        (MediaControls.prototype.hidePlacard): Deleted.
        (MediaControls.prototype.controlsBarVisibilityDidChange): Deleted.
        (MediaControls.prototype.controlsBarFadedStateDidChange): Deleted.
        (MediaControls.prototype.layoutTraitsDidChange): Deleted.
        (MediaControls.prototype.layout): Deleted.
        (MediaControls.prototype._invalidateChildren): Deleted.
        * Modules/modern-media-controls/controls/media-document.css:
        (:host(.media-document)):
        (:host(.media-document.audio.mac)):
        * Modules/modern-media-controls/controls/mute-button.js:
        * Modules/modern-media-controls/controls/pip-button.js:
        * Modules/modern-media-controls/controls/placard.css:
        (.placard):
        (.placard .container):
        (.placard button):
        (.placard button > picture):
        (.placard .icon): Deleted.
        * Modules/modern-media-controls/controls/placard.js:
        (Placard.):
        (Placard.prototype.layout):
        * Modules/modern-media-controls/controls/play-pause-button.js:
        (PlayPauseButton):
        (PlayPauseButton.prototype.commit):
        * Modules/modern-media-controls/controls/scheduler.js:
        (const.scheduler.new.prototype.scheduleLayout):
        (const.scheduler.new.prototype.unscheduleLayout):
        (const.scheduler.new.prototype._requestFrameIfNeeded):
        (const.scheduler.new.prototype._frameDidFire):
        (const.scheduler.new.prototype._layout):
        * Modules/modern-media-controls/controls/scrubber.js: Removed.
        * Modules/modern-media-controls/controls/seek-button.js:
        * Modules/modern-media-controls/controls/skip-back-button.js:
        * Modules/modern-media-controls/controls/skip-forward-button.js: Added.
        (SkipForwardButton):
        * Modules/modern-media-controls/controls/slider.css:
        (.slider):
        (.slider > .custom-slider,):
        (.slider > .custom-slider):
        (.slider > .custom-slider > *):
        (.slider > .custom-slider > .fill):
        (.slider > .custom-slider > .track):
        (.slider > .custom-slider > .primary):
        (.slider > .custom-slider > .secondary):
        (.slider > .custom-slider > .knob):
        (.slider > input):
        (.slider > input::-webkit-slider-thumb):
        (.slider.disabled > input,):
        (.ios .slider > input):
        (.ios .slider > input::-webkit-slider-runnable-track):
        (.ios .slider > input::-webkit-slider-thumb):
        (.slider > canvas,): Deleted.
        (.slider > canvas): Deleted.
        * Modules/modern-media-controls/controls/slider.js:
        (Slider.prototype.set inputAccessibleLabel):
        (Slider.prototype.get disabled):
        (Slider.prototype.set disabled):
        (Slider.prototype.get secondaryValue):
        (Slider.prototype.set secondaryValue):
        (Slider.prototype._formatTime):
        (Slider.prototype.commitProperty):
        (Slider.prototype.commit):
        (Slider.prototype.draw): Deleted.
        (addRoundedRect): Deleted.
        * Modules/modern-media-controls/controls/start-button.css: Removed.
        * Modules/modern-media-controls/controls/start-button.js: Removed.
        * Modules/modern-media-controls/controls/status-label.css:
        (.status-label):
        * Modules/modern-media-controls/controls/status-label.js:
        (StatusLabel.prototype.get enabled):
        (StatusLabel.prototype.set enabled): Deleted.
        * Modules/modern-media-controls/controls/text-tracks.css:
        (video::-webkit-media-text-track-container):
        (video::-webkit-media-text-track-container.visible-controls-bar):
        (video::-webkit-media-text-track-container.visible-controls-bar.compact-controls-bar): Deleted.
        * Modules/modern-media-controls/controls/time-control.js:
        (TimeControl.prototype.set duration):
        (TimeControl.prototype.set currentTime):
        (TimeControl.prototype.get loading):
        (TimeControl.prototype.set loading):
        (TimeControl.prototype.get minimumWidth):
        (TimeControl.prototype.get idealMinimumWidth):
        (TimeControl.prototype.layout):
        (TimeControl.prototype._performIdealLayout):
        (TimeControl.prototype.get useSixDigitsForTimeLabels): Deleted.
        (TimeControl.prototype.set useSixDigitsForTimeLabels): Deleted.
        (TimeControl.prototype.get isSufficientlyWide): Deleted.
        * Modules/modern-media-controls/controls/time-label.css:
        (.time-label):
        * Modules/modern-media-controls/controls/time-label.js:
        (TimeLabel.prototype.setValueWithNumberOfDigits):
        (TimeLabel.prototype.commitProperty):
        (TimeLabel.prototype._formattedTime):
        (doubleDigits):
        (TimeLabel.prototype.set value): Deleted.
        * Modules/modern-media-controls/controls/tracks-button.js:
        * Modules/modern-media-controls/controls/tracks-panel.css:
        (.tracks-panel > .scrollable-container):
        (.tracks-panel section):
        (.tracks-panel section > h3):
        (.tracks-panel > .background-tint > div,): Deleted.
        * Modules/modern-media-controls/controls/volume-down-button.js:
        * Modules/modern-media-controls/controls/volume-slider.css: Removed.
        * Modules/modern-media-controls/controls/volume-slider.js: Removed.
        * Modules/modern-media-controls/controls/volume-up-button.js:
        * Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
        (GestureRecognizer.prototype.gestureBegan):
        (GestureRecognizer.prototype._removeTrackingListeners):
        * Modules/modern-media-controls/gesture-recognizers/tap.js:
        (TapGestureRecognizer.prototype.touchesMoved):
        * Modules/modern-media-controls/images/iOS/Airplay.svg: Added.
        * Modules/modern-media-controls/images/iOS/EnterFullscreen.svg: Added.
        * Modules/modern-media-controls/images/iOS/MediaSelector.svg: Added.
        * Modules/modern-media-controls/images/iOS/MiniPipIn.svg: Added.
        * Modules/modern-media-controls/images/iOS/Mute.svg: Added.
        * Modules/modern-media-controls/images/iOS/Pause.svg: Added.
        * Modules/modern-media-controls/images/iOS/PipIn.svg: Added.
        * Modules/modern-media-controls/images/iOS/Play.svg: Added.
        * Modules/modern-media-controls/images/iOS/SkipBack15.svg: Added.
        * Modules/modern-media-controls/images/iOS/SkipForward15.svg: Added.
        * Modules/modern-media-controls/images/iOS/VolumeHi.svg: Added.
        * Modules/modern-media-controls/images/iOS/airplay@1x.png: Removed.
        * Modules/modern-media-controls/images/iOS/airplay@2x.png: Removed.
        * Modules/modern-media-controls/images/iOS/enter-fullscreen@1x.png: Removed.
        * Modules/modern-media-controls/images/iOS/enter-fullscreen@2x.png: Removed.
        * Modules/modern-media-controls/images/iOS/enter-fullscreen@3x.png: Removed.
        * Modules/modern-media-controls/images/iOS/interval-skip-back@1x.png: Removed.
        * Modules/modern-media-controls/images/iOS/interval-skip-back@2x.png: Removed.
        * Modules/modern-media-controls/images/iOS/interval-skip-back@3x.png: Removed.
        * Modules/modern-media-controls/images/iOS/pause@1x.png: Removed.
        * Modules/modern-media-controls/images/iOS/pause@2x.png: Removed.
        * Modules/modern-media-controls/images/iOS/pause@3x.png: Removed.
        * Modules/modern-media-controls/images/iOS/pip-in@1x.png: Removed.
        * Modules/modern-media-controls/images/iOS/pip-in@2x.png: Removed.
        * Modules/modern-media-controls/images/iOS/pip-in@3x.png: Removed.
        * Modules/modern-media-controls/images/iOS/play@1x.png: Removed.
        * Modules/modern-media-controls/images/iOS/play@2x.png: Removed.
        * Modules/modern-media-controls/images/iOS/play@3x.png: Removed.
        * Modules/modern-media-controls/images/iOS/slider-thumb@2x.png: Removed.
        * Modules/modern-media-controls/images/iOS/start@1x.png: Removed.
        * Modules/modern-media-controls/images/iOS/start@2x.png: Removed.
        * Modules/modern-media-controls/images/iOS/start@3x.png: Removed.
        * Modules/modern-media-controls/images/macOS/Airplay-fullscreen.svg: Added.
        * Modules/modern-media-controls/images/macOS/Airplay.svg: Added.
        * Modules/modern-media-controls/images/macOS/EnterFullscreen.svg: Added.
        * Modules/modern-media-controls/images/macOS/ExitFullscreen.svg: Added.
        * Modules/modern-media-controls/images/macOS/Forward.svg: Added.
        * Modules/modern-media-controls/images/macOS/MediaSelector-fullscreen.svg: Added.
        * Modules/modern-media-controls/images/macOS/MediaSelector.svg: Added.
        * Modules/modern-media-controls/images/macOS/Mute.svg: Added.
        * Modules/modern-media-controls/images/macOS/Pause.svg: Added.
        * Modules/modern-media-controls/images/macOS/PipIn-fullscreen.svg: Added.
        * Modules/modern-media-controls/images/macOS/PipIn.svg: Added.
        * Modules/modern-media-controls/images/macOS/Play.svg: Added.
        * Modules/modern-media-controls/images/macOS/Rewind.svg: Added.
        * Modules/modern-media-controls/images/macOS/SkipBack15.svg: Added.
        * Modules/modern-media-controls/images/macOS/SkipForward15.svg: Added.
        * Modules/modern-media-controls/images/macOS/VolumeHi.svg: Added.
        * Modules/modern-media-controls/images/macOS/VolumeLo.svg: Added.
        * Modules/modern-media-controls/images/macOS/airplay-compact@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/airplay-compact@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/airplay-fullscreen@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/airplay-fullscreen@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/airplay@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/airplay@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/enter-fullscreen@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/enter-fullscreen@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/exit-fullscreen@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/exit-fullscreen@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/forward@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/forward@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/interval-skip-back-compact@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/interval-skip-back-compact@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/interval-skip-back@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/interval-skip-back@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/media-selection-compact@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/media-selection-compact@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/media-selection-fullscreen@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/media-selection-fullscreen@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/media-selection@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/media-selection@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/pause-compact@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/pause-compact@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/pause@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/pause@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/pip-in-compact@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/pip-in-compact@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/pip-in@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/pip-in@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/play-compact@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/play-compact@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/play-fullscreen@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/play-fullscreen@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/play@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/play@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/rewind@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/rewind@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/scale-to-fill@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/scale-to-fill@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/scale-to-fit@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/scale-to-fit@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/start@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/start@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/volume-compact@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/volume-compact@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/volume-down-fullscreen@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/volume-down-fullscreen@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/volume-mute-compact@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/volume-mute-compact@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/volume-mute@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/volume-mute@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/volume-up-fullscreen@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/volume-up-fullscreen@2x.png: Removed.
        * Modules/modern-media-controls/images/macOS/volume@1x.png: Removed.
        * Modules/modern-media-controls/images/macOS/volume@2x.png: Removed.
        * Modules/modern-media-controls/js-files:
        * Modules/modern-media-controls/main.js:
        (UIString):
        (formatTimeByUnit):
        * Modules/modern-media-controls/media/audio-support.js: Added.
        (AudioSupport.prototype.get control):
        (AudioSupport.prototype.get mediaEvents):
        (AudioSupport.prototype.get tracksToMonitor):
        (AudioSupport.prototype.syncControl):
        (AudioSupport):
        * Modules/modern-media-controls/media/controls-visibility-support.js:
        (ControlsVisibilitySupport.prototype._updateControls):
        (ControlsVisibilitySupport):
        * Modules/modern-media-controls/media/fullscreen-support.js:
        (FullscreenSupport.prototype.buttonWasPressed):
        (FullscreenSupport.prototype.syncControl):
        (FullscreenSupport):
        (FullscreenSupport.prototype.iOSInlineMediaControlsRecognizedPinchInGesture): Deleted.
        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController):
        (MediaController.prototype.get isAudio):
        (MediaController.prototype.get isYouTubeEmbedWithTitle):
        (MediaController.prototype.get isFullscreen):
        (MediaController.prototype.get layoutTraits):
        (MediaController.prototype.iOSInlineMediaControlsRecognizedTapGesture):
        (MediaController.prototype.iOSInlineMediaControlsRecognizedPinchInGesture):
        (MediaController.prototype._updateControlsIfNeeded):
        (MediaController.prototype._updateTextTracksClassList):
        (MediaController.prototype.controlsBarFadedStateDidChange): Deleted.
        * Modules/modern-media-controls/media/media-document-controller.js:
        (MediaDocumentController.prototype._mediaDocumentHasMetadata):
        * Modules/modern-media-controls/media/placard-support.js:
        (PlacardSupport.prototype._updatePlacard):
        (PlacardSupport):
        * Modules/modern-media-controls/media/scrubbing-support.js:
        (ScrubbingSupport.prototype.get mediaEvents):
        (ScrubbingSupport.prototype.syncControl):
        (ScrubbingSupport):
        * Modules/modern-media-controls/media/skip-back-support.js:
        * Modules/modern-media-controls/media/skip-forward-support.js: Added.
        (SkipForwardSupport.prototype.get control):
        (SkipForwardSupport.prototype.get mediaEvents):
        (SkipForwardSupport.prototype.buttonWasPressed):
        (SkipForwardSupport.prototype.syncControl):
        (SkipForwardSupport):
        * Modules/modern-media-controls/media/start-support.js:
        (StartSupport):
        (StartSupport.prototype.handleEvent):
        (StartSupport.prototype._shouldShowStartButton):
        (StartSupport.prototype.get control): Deleted.
        (StartSupport.prototype.syncControl): Deleted.
        * Modules/modern-media-controls/media/status-support.js:
        (StatusSupport.prototype.get mediaEvents):
        (StatusSupport.prototype.syncControl):
        (StatusSupport):
        * Modules/modern-media-controls/media/time-control-support.js: Renamed from Source/WebCore/Modules/modern-media-controls/media/time-labels-support.js.
        (TimeControlSupport.prototype.syncControl):
        (TimeControlSupport):
        * Modules/modern-media-controls/media/tracks-support.js:
        (TracksSupport.prototype.syncControl):
        * WebCore.xcodeproj/project.pbxproj:

2017-06-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        Refactor -[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:] to check readable types
        https://bugs.webkit.org/show_bug.cgi?id=172891
        <rdar://problem/32204540>

        Reviewed by Darin Adler.

        Tweaks some logic in PlatformPasteboardIOS and WebItemProviderPasteboard to correctly construct objects in
        -valuesForPasteboardType:inItemSet:. Previously, we have a hard-coded map of UTI type to Class in the form of
        static helpers titled is{RichText, String, URL, Image, Color}Type in WebItemProviderPasteboard. We would use
        these functions to determine whether an NSAttributedString, NSString, NSURL, UIImage or UIColor should be
        constructed using the loaded item provider data. This is incorrect for some UTIs, such as public.html, which
        cannot actually be used to construct an NSAttributedString -- this caused -valuesForPasteboardType:inItemSet: to
        always return nil when attempting to create an object corresponding to public.html.

        To fix this, we refactor -valuesForPasteboardType:inItemSet: to instead iterate through UIItemProviderReading-
        conformant classes in search for a class that can be created for the given UTI type. If no such class exists, we
        then fall back to custom WebKit handling of the dropped UTI type, which so far only includes reading an NSString
        with public.plain-text if the UTI is public.html (i.e. reading the HTML source from loaded item provider data).

        Covered by 2 new API tests:
        DataInteractionTests.ExternalSourceHTMLToContentEditable
        DataInteractionTests.ExternalSourceAttributedStringToContentEditable

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

        In some cases, -[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:] may now return an
        NSAttributedString when an NSString was previously created. This adjusts for that possibility by returning just
        the plain text, -[NSAttributedString string], if the read object was an NSAttributedString.

        * platform/ios/WebItemProviderPasteboard.mm:
        (allLoadableClasses):
        (classForTypeIdentifier):
        (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):

        See description above for more details.

        (isRichTextType): Deleted.
        (isStringType): Deleted.
        (isURLType): Deleted.
        (isColorType): Deleted.
        (isImageType): Deleted.

        Removes these heuristics that attempt to "guess" the best UIItemProviderReading class to try and load for a
        given UTI type.

        * rendering/RenderText.cpp:
        (WebCore::RenderText::draggedContentRangesBetweenOffsets):

        Adds a nil check to fix a debug assertion hit when running DataInteractionTests.

2017-06-05  Dan Bernstein  <mitz@apple.com>

        Build fix for macOS 10.12

        * platform/spi/cocoa/AVKitSPI.h:

2017-06-05  Dan Bernstein  <mitz@apple.com>

        Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.

        * platform/mac/WebPlaybackControlsManager.h:
        * platform/mac/WebPlaybackControlsManager.mm:
        (-[WebPlaybackControlsManager togglePictureInPicture]):

2017-06-05  Dan Bernstein  <mitz@apple.com>

        Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.

        * platform/spi/cocoa/AVKitSPI.h:

2017-06-05  Konstantin Tokarev  <annulen@yandex.ru>

        Unreviewed, fix missing semicolon in r217795

        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
        (WebCore::calculateNaturalSize):

2017-06-05  Jer Noble  <jer.noble@apple.com>

        Allow clients to specify a list of codecs which should require hardware decode support.
        https://bugs.webkit.org/show_bug.cgi?id=172787

        Reviewed by Alex Christensen.

        Add a new setting, checked by HTMLMediaElement, which allows MediaPlayerPrivate implementation
        to require that the specified codecs have hardware support. This requirement will be supported
        in the normal media loading path and the MSE path on Cocoa ports.

        * WebCore.xcodeproj/project.pbxproj:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::mediaCodecsRequiringHardwareSupport):
        * html/HTMLMediaElement.h:
        * page/Settings.cpp:
        (WebCore::Settings::setMediaCodecsRequiringHardwareSupport):
        * page/Settings.h:
        (WebCore::Settings::mediaCodecsRequiringHardwareSupport):
        * platform/cocoa/VideoToolboxSoftLink.cpp:
        * platform/cocoa/VideoToolboxSoftLink.h:
        * platform/graphics/MediaPlayer.h:
        (WebCore::MediaPlayerClient::mediaCodecsRequiringHardwareSupport):
        * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.h: Added.
        * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm: Added.
        (WebCore::assetTrackMeetsHardwareDecodeRequirements):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus):
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):

2017-06-05  Dan Bernstein  <mitz@apple.com>

        Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.

        * platform/mac/WebPlaybackControlsManager.mm:
        (-[WebPlaybackControlsManager togglePictureInPicture]):

2017-06-05  Dan Bernstein  <mitz@apple.com>

        Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.

        * platform/spi/mac/AVFoundationSPI.h:

2017-06-05  Dan Bernstein  <mitz@apple.com>

        Tried to fix the build when targrting macOS 10.12 using the macOS 10.13 developer beta SDK.

        * platform/spi/cocoa/IOSurfaceSPI.h:

2017-06-05  Konstantin Tokarev  <annulen@yandex.ru>

        Fix MediaPlayerPrivateMediaFoundation::naturalSize
        https://bugs.webkit.org/show_bug.cgi?id=172908

        Reviewed by Alex Christensen.

        MediaPlayerPrivateMediaFoundation::naturalSize should return size of
        video frame corrected by PAR, not size of video element.

        No new tests needed.

        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
        (WebCore::MediaPlayerPrivateMediaFoundation::load):
        (WebCore::MediaPlayerPrivateMediaFoundation::naturalSize):
        (WebCore::MediaPlayerPrivateMediaFoundation::setNaturalSize):
        (WebCore::calculateNaturalSize):
        (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::setMediaType):
        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

2017-06-05  Zalan Bujtas  <zalan@apple.com>

        Destroy the associated renderer subtree when display: contents node is deleted.
        https://bugs.webkit.org/show_bug.cgi?id=172920
        <rdar://problem/32446045>

        Reviewed by Antti Koivisto.

        Since display: contents node does not create a renderer, we need to explicitly check
        and distinguish it from the display: none case.

        Covered by existing tests.

        * dom/ContainerNode.cpp:
        (WebCore::destroyRenderTreeIfNeeded):
        * dom/Node.cpp:
        (WebCore::Node::~Node): Promote ASSERT(!renderer()) to ASSERT_WITH_SECURITY_IMPLICATION.
        * dom/Text.cpp:
        (WebCore::Text::~Text): Redundant assert. Text is a Node.

2017-06-05  Beth Dakin  <bdakin@apple.com>

        Modify Netflix controlsManager quirk to prevent only scrubbing
        https://bugs.webkit.org/show_bug.cgi?id=172881
        -and corresponding-
        rdar://problem/32228660

        Reviewed by Andy Estes.

        Instead of preventing Netflix from getting a controlsManager at all, this patch 
        ONLY prevents touch bar scrubbing from working. This means that Netflix will now 
        get controls in the TouchBar, it means that the play/pause and PiP buttons will be 
        functional, and it means that the timeline will accurately represent the current 
        time, BUT users will not be able to use the timeline to scrub the video. This also 
        allows Netflix to work with other MediaRemote clients such as AirPods.

        Remove the quirk code from here, since this is no longer the right place to test 
        if the MediaElement is hosted at Netflix.
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager):
        (WebCore::needsPlaybackControlsManagerQuirk): Deleted.

        Pass around a new bool allowsTouchBarScrubbing.
        * platform/cocoa/WebPlaybackSessionModel.h:
        (WebCore::WebPlaybackSessionModelClient::allowsTouchBarScrubbingChanged):
        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:

        Here’s where we check if we need quirky behavior.
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
        (WebCore::WebPlaybackSessionModelMediaElement::allowsTouchBarScrubbing):

        Return the bool we have plumbed through tracking whether the current site 
        allowsTouchBarScrubbing from the existing delegate method 
        canBeginTouchBarScrubbing. We will always return NO for video elements on Netflix, 
        and this will prevent users from be able to scrub with the TouchBar on Netflix.
        * platform/mac/WebPlaybackControlsManager.h:
        * platform/mac/WebPlaybackControlsManager.mm:
        (-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):

        More plumbing.
        * platform/mac/WebPlaybackSessionInterfaceMac.h:
        * platform/mac/WebPlaybackSessionInterfaceMac.mm:
        (WebCore::WebPlaybackSessionInterfaceMac::allowsTouchBarScrubbingChanged):
        (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):

2017-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GStreamer] Deadlock in MediaPlayerPrivateGStreamer::changePipelineState, web process often locks up on seeking in a youtube video that has already fully buffered
        https://bugs.webkit.org/show_bug.cgi?id=170003

        Reviewed by Michael Catanzaro.

        When video sink is requested to render a frame, the GstBaseSink preroll mutex is taken. Then WebKit media player
        schedules a repaint in the main thread, taking the draw mutex and waiting on draw condition. It can happen that
        before the repaint is done in the main thread, a pause is requested in the main thread, causing a change state
        from PLAYING to PAUSE. When the change state reaches the video sink gst_base_sink_change_state() tries to get
        the preroll mutex. This causes a deadlock because the main thread is waiting to get the preroll mutex, but the
        other thread is waiting for the main thread to do the repaint. GStreamer handles this case by calling unlock()
        on the video sink before trying to get the preroll mutex, but the media player doesn't cancel the pending
        repaint when using coordinated graphics. This patch adds a new signal to WebKitVideoSink "repaint-cancelled" to
        notify the media player to cancel the pending prepaint.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint): Release the draw mutex and notify the condition.
        (WebCore::MediaPlayerPrivateGStreamerBase::repaintCancelledCallback): Call cancelRepaint().
        (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Connect to WebKitVideoSink::repaint-cancelled.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
        (webkitVideoSinkRepaintCancelled): Emit WebKitVideoSink::repaint-cancelled.
        (webkitVideoSinkUnlock): Call webkitVideoSinkRepaintCancelled().
        (webkitVideoSinkStop): Ditto.
        (webkit_video_sink_class_init): Add WebKitVideoSink::repaint-cancelled signal.

2017-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GStreamer] Cleanup ifdefs in MediaPlayerPrivateGStreamerBase
        https://bugs.webkit.org/show_bug.cgi?id=172918

        Reviewed by Michael Catanzaro.

        The code in MediaPlayerPrivateGStreamerBase is quite difficult to follow with all the ifdefs for the
        possibilities when rendering. Some of them are even dead code now that all ports using GStreamer are using also
        coordinated graphics.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
        (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
        (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
        (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
        (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
        (VideoRenderRequestScheduler::VideoRenderRequestScheduler):
        (VideoRenderRequestScheduler::stop):
        (VideoRenderRequestScheduler::requestRender):
        (webkitVideoSinkRequestRender):

2017-06-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix compile warning when building GTK+ port without OpenGL.

        * platform/graphics/texmap/BitmapTexturePool.cpp:
        (WebCore::BitmapTexturePool::createTexture):

2017-06-05  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE] Do not force video sample's buffer release when the platformLayerProxy is inactive
        https://bugs.webkit.org/show_bug.cgi?id=172916

        Reviewed by Carlos Garcia Campos.

        When MediaPlayerPrivateGStreamerBase's plarformLayerProxy was inactive, a copy of the video sample
        was being done (without the buffer) and set, causing the sample's buffer to get freed. This was done
        to avoid stalling the gstreamer pipeline in situations where the video was set to display:none, as the
        platformLayerProxy would keep all the available buffers. But this can't happen nowadays as setting
        the video to display:none invalidates the proxy, causing it to release the references to the
        gstreamer buffers it's using. Also, the current code is causing a crash when using gstreamer-gl and
        the video is hidden but its contents are being painted through webgl or an accelerated canvas. So,
        remove this sample copy as it's not necessary anymore.

        Covered by existent tests.

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

2017-06-05  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE] Fix the condition to decide whether the MediaPlayer can be rendered accelerated
        https://bugs.webkit.org/show_bug.cgi?id=172852

        Reviewed by Michael Catanzaro.

        Before this change, in order to determine whether the MediaPlayer rendering could be accelerated we
        needed the player to have a renderer or it would return false. The renderer was needed in order to
        access the RenderLayerCompositor and check whether the chrome would be overwriting the accelerated
        compositing setting. But we don't have that option in WebKitGTK+ or WPE, so we can just check the
        accelerated compositing setting directly.

        Another problems with the approach before this change is that accelerated rendering was being disabled
        when the video element was not visible, as there's no video renderer. Due to this, cases where the video
        is painted through an accelerated canvas or webgl would not be using hardware accelerated copies.

        Covered by existent tests.

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

2017-06-04  Simon Fraser  <simon.fraser@apple.com>

        Percentages are calculated wrong in SVG transform CSS property
        https://bugs.webkit.org/show_bug.cgi?id=172901

        Reviewed by Zalan Bujtas.
        
        The code added in r217236 was just fetching viewBox(), but that can be empty.
        SVGLengthContext::determineViewport() does the correct thing to get
        the appropriate viewport.

        Test: svg/transforms/percent-transform-values-viewbox.html

        * svg/SVGGraphicsElement.cpp:
        (WebCore::SVGGraphicsElement::animatedLocalTransform):

2017-06-04  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Page capture state not reported correctly
        https://bugs.webkit.org/show_bug.cgi?id=172897
        <rdar://problem/32493318>

        Reviewed by Youenn Fablet.

        Test: fast/mediastream/media-stream-track-muted.html

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::mediaState): Test for audio and video mute on the tracks.
        (WebCore::MediaStream::characteristicsChanged): Call statusDidChange when m_mediaState
        changes instead of m_muted, so the page is informed when just audio or video mute state
        changes.
        * Modules/mediastream/MediaStream.h:

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

2017-06-03  Darin Adler  <darin@apple.com>

        Streamline handling of attributes, using references as much as possible
        https://bugs.webkit.org/show_bug.cgi?id=172899

        Reviewed by Chris Dumez.

        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::valueForRange): Use reference to value of
        attribute instead of copy to avoid reference count churn.
        (WebCore::AccessibilityNodeObject::maxValueForRange): Ditto.
        (WebCore::AccessibilityNodeObject::minValueForRange): Ditto.
        * accessibility/AccessibilitySVGElement.cpp:
        (WebCore::AccessibilitySVGElement::childElementWithMatchingLanguage): Ditto.
        (WebCore::AccessibilitySVGElement::accessibilityDescription): Ditto.
        * css/PropertySetCSSStyleDeclaration.cpp:
        (WebCore::StyleAttributeMutationScope::StyleAttributeMutationScope): Ditto.

        * editing/cocoa/DataDetection.mm:
        (WebCore::DataDetection::shouldCancelDefaultAction): Use the
        equalLettersIgnoringASCIICase function instead of using
        both equalIgnoringASCIICase and convertToASCIILowercase.

        * html/HTMLAudioElement.cpp:
        (WebCore::HTMLAudioElement::HTMLAudioElement): Marked this inline since we
        want it inlined the one place it's used.
        (WebCore::HTMLAudioElement::create): Use auto and named the local variable
        just element.
        (WebCore::HTMLAudioElement::createForJSConstructor): Call create rather than
        repeating the code from create. Use setAttributeWithoutSynchronization directly
        rather than calling helper functions. Removed unneeded null check;
        setAttributeWithoutSynchronization handles null by removing the attribute.
        * html/HTMLAudioElement.h: Changed src argument of createForJSConstructor to
        take AtomicString since that is what we need for an attribute value.
        * html/HTMLAudioElement.idl: Use [AtomicString] for src argument.

        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::directionality): Use reference to value of
        attribute instead of copy to avoid reference count churn.
        (WebCore::HTMLElement::shouldAutocorrect): Ditto.

        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Call the new
        parsedMediaAttribute instead of the old mediaQuerySet function. Other than the
        name, the only change is that the result is now a const pointer.

        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::updateType): Removed unnecessary local variable,
        resulting in code that is slightly cleaner and possibly eliminating reference
        count chrun.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::setSrc): Deleted.
        (WebCore::HTMLMediaElement::selectNextSourceChild): Use parsedMediaAttribute and
        removed rendudant direct check of whether mediaAttr is present. Changed logging to
        get the media attribute directly rather than with a helper function. Changed type
        to get the type attribute directly rather than with a helper function.
        (WebCore::HTMLMediaElement::sourceWasAdded): Take a reference rather than a pointer.
        (WebCore::HTMLMediaElement::sourceWasRemoved): Ditto.
        (WebCore::HTMLMediaElement::doesHaveAttribute): Use reference to value of
        attribute instead of copy to avoid reference count churn.
        * html/HTMLMediaElement.h: Updated for the above.

        * html/HTMLSourceElement.cpp:
        (WebCore::HTMLSourceElement::insertedInto): Pass reference instead of pointer.
        (WebCore::HTMLSourceElement::removedFrom): Ditto.
        (WebCore::HTMLSourceElement::setSrc): Deleted.
        (WebCore::HTMLSourceElement::media): Deleted.
        (WebCore::HTMLSourceElement::setMedia): Deleted.
        (WebCore::HTMLSourceElement::type): Deleted.
        (WebCore::HTMLSourceElement::setType): Deleted.
        (WebCore::HTMLSourceElement::parseAttribute): Clear out m_cachedParsedMediaAttribute.
        This makes the parsing be lazy. The old code would parse the attribute value to make
        a MediaQuerySet here, but we do it in parsedMediaAttribute now.
        (WebCore::HTMLSourceElement::parsedMediaAttribute): Added. Creates a MediaQuerySet
        if needed, and returns it or null.
        * html/HTMLSourceElement.h: Removed include of MediaList.h. Removed unneeded media,
        type, setSrc, setMedia, and setType functions. Replaced the mediaQuerySet function
        with the parsedMediaAttribute, which returns a const pointer rather than non-const,
        and is also non-inline because it lazily creates the MediaQuerySet as needed. Replaced
        m_mediaQuerySet with m_cachedParsedMediaAttribute.
        * html/HTMLSourceElement.idl: Use [Reflect] for both type and media.

        * html/MediaDocument.cpp: Modernize the MediaDocumentParser constructor.
        (WebCore::MediaDocumentParser::createDocumentStructure): Instead of setSrc, use
        setAttributeWithoutSynchronization for the src attribute just as we do for all the
        other attributes of the newly created video element.

        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled): Use reference to
        value of attribute instead of copy to avoid reference count churn.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::defaultSubstituteDataForURL): Ditto.
        * rendering/RenderThemeIOS.mm:
        (WebCore::getAttachmentProgress): Ditto.
        * rendering/RenderThemeMac.mm:
        (WebCore::AttachmentLayout::layOutSubtitle): Ditto.
        (WebCore::RenderThemeMac::paintAttachment): Ditto.
        * svg/SVGHKernElement.cpp:
        (WebCore::SVGHKernElement::buildHorizontalKerningPair): Ditto.
        * svg/SVGVKernElement.cpp:
        (WebCore::SVGVKernElement::buildVerticalKerningPair): Ditto.
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::buildPendingResource): Ditto. Also use parentElement
        instead of writing out code that does exactly what it does.

2017-06-03  Sam Weinig  <sam@webkit.org>

        Can't use Object.defineProperty() to add an item to a DOMStringMap or Storage
        https://bugs.webkit.org/show_bug.cgi?id=172687

        Reviewed by Darin Adler.

        - Adds support for generating the defineOwnProperty ClassInfo method table hook
          to add support for Object.defineProperty(). The implementation follows WebIDL
          section 3.9.3 [[DefineOwnProperty]].
          (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
        - Adds support for generating named setters in addition to the already supported
          indexed setters as much of the required work was needed to make defineOwnProperty
          work for those properties. This patch does not aim to follow WebIDL faithfully,
          but rather to generate as close to the custom code as possible. A follow up 
          change will attempt to match WebIDL more closely (which will also require changes
          to [[GetOwnPropertySlot]]).
        - Removes the need for custom bindings in DOMStringMap, HTMLOptionsCollection and
          HTMLSelectElement. Gets us one function away from supporting Storage.
        - Tidies up generated headers a bit by grouping all the ClassInfo method table hooks
          together.
        - Removes support for CustomIndexedSetter, which is no longer used.

        Test: js/dom/legacy-platform-object-defineOwnProperty.html

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        Removed now unneeded custom bindings.

        * bindings/js/JSDOMStringMapCustom.cpp: Removed.
        * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Removed.
        * bindings/js/JSHTMLSelectElementCustom.cpp: Removed.
        * bindings/js/JSHTMLSelectElementCustom.h: Removed.
        * bindings/js/JSStorageCustom.cpp:
        (WebCore::JSStorage::putDelegate): Deleted.
        Remove more code that is now generated.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateIndexedGetter):
        - Add missing check for indexed setter operation when determining if the property should be ReadOnly.
        - Add support for custom implementation name, matching GenerateNamedGetter.
        - Convert to taking an outputArray and indent to allow more flexibility going forward.

        (GenerateNamedGetter):
        - Add missing check for named setter operation when determining if the property should be ReadOnly.
        - Convert to taking an outputArray and indent to allow more flexibility going forward.

        (GenerateGetOwnPropertySlotBody):
        - Convert to taking an outputArray and indent to allow more flexibility going forward.
        - Take over responsibility for checking and bailing if CustomGetOwnPropertySlot is set.

        (GenerateGetOwnPropertySlotBodyByIndex):
        - Convert to taking an outputArray and indent to allow more flexibility going forward.
        - Take over responsibility for checking and bailing if CustomGetOwnPropertySlotByIndex is set.

        (GenerateGetOwnPropertyNames):
        - Convert to taking an outputArray and indent to allow more flexibility going forward.
        - Take over responsibility for checking and bailing if CustomEnumerateProperty is set.

        (GenerateInvokeIndexedPropertySetter):
        Added. Implements the 'invoke an indexed property setter' algorithm (https://heycam.github.io/webidl/#invoke-indexed-setter)

        (GenerateInvokeNamedPropertySetter):
        Added. Implements the 'invoke a named property setter' algorithm (https://heycam.github.io/webidl/#invoke-named-setter)

        (GeneratePut):
        (GeneratePutByIndex):
        - Convert to taking an outputArray and indent to allow more flexibility going forward.
        - Take over responsibility for checking and bailing if CustomPut is set.
        - Adds support for CEReactions.
        - Adopts GenerateInvokeIndexedPropertySetter and GenerateInvokeNamedPropertySetter to
          simplify code.
        - Removes support for CustomIndexedSetter, which is no longer used.
        - Replaces use direct checking of OverrideBuiltins with check if any interface it inherits
          has it, which is how it is specified to work.

        (GenerateIsUnforgeablePropertyName):
        Added. Helper subroutine to generate a function that compares a property name
        agains all the property names defined as Unforgeable on the interface. Used by
        GenerateDefineOwnProperty.

        (GenerateDefineOwnProperty):
        Added. Implements section 3.9.3 [[DefineOwnProperty]] (https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty)
        Adds support for CEReactions.

        (GenerateDeletePropertyCommon):
        Switch from getting OverrideBuiltins directly off the interface to using InheritsExtendedAttribute.

        (GenerateNamedDeleterDefinition):
        Switch signature to match peer generators.

        (InstanceOverridesGetOwnPropertySlot):
        Update for rename of JSCustomGetOwnPropertySlotAndDescriptor to CustomGetOwnPropertySlotAndDescriptor.

        (InstanceOverridesGetOwnPropertySlotByIndex):
        Added. Like InstanceOverridesGetOwnPropertySlot, but checks for the new CustomGetOwnPropertySlotByIndex 
        rather than CustomGetOwnPropertySlot.

        (InstanceOverridesGetOwnPropertyNames):
        Added. Moves complex predicate out of line.

        (InstanceOverridesPut):
        Removes now unused CustomIndexedSetter, and adds CustomPutFunction, which used to be checked separately.

        (InstanceOverridesDefineOwnProperty):
        Added.

        (GenerateHeader):
        - Moves more structure flags together.
        - Simplifies predicates and moves the ClassInfo method table hooks together.

        (GenerateImplementation):
        - Moves the ClassInfo method table hooks together
        - Adds call to GenerateDefineOwnProperty.

        (GenerateLegacyCallerDefinitions):
        Simplify bail condition to match other generators.

        (GeneratePrototypeDeclaration):
        Update for new extended attribute names.

        (InstanceOverridesCall): 
        Renamed from IsCallable for consistency.
        
        (HasComplexGetOwnProperty): 
        Deleted. Unused.
        
        (InstanceOverridesPutImplementation): 
        Deleted. Unused.
        
        (InstanceOverridesPutDeclaration): 
        Deleted. Unused.
        
        (IsCallable): 
        Renamed, for consistency, to InstanceOverridesCall .

        * bindings/scripts/IDLAttributes.json:
        Renames a few of the extended attributes to remove the JS prefix. This time
        around I only did the ones in the area I was working, but we should probably
        remove most of the rest.
    
        * css/CSSStyleDeclaration.idl:
        Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.

        * dom/DOMStringMap.idl:
        Remove CustomNamedSetter and add uncomment out the setter.

        * dom/DatasetDOMStringMap.cpp:
        (WebCore::DatasetDOMStringMap::setNamedItem):
        (WebCore::DatasetDOMStringMap::setItem): Deleted.
        * dom/DatasetDOMStringMap.h:
        Rename setItem to setNamedItem, which is what the generator expects.

        * dom/Node.idl:
        Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.

        * html/HTMLAppletElement.idl:
        * html/HTMLEmbedElement.idl:
        * html/HTMLObjectElement.idl:
        Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.

        * html/HTMLCollection.cpp:
        (WebCore::HTMLCollection::isSupportedPropertyName):
        * html/HTMLCollection.h:
        Add isSupportedPropertyName function which is used by the bindings and is now needed.

        * html/HTMLElement.idl:
        Update for JSCustomPushEventHandlerScope -> CustomPushEventHandlerScope rename.

        * html/HTMLOptionsCollection.h:
        (WebCore::HTMLOptionsCollection::setItem):
        Add setItem() implementation which just forwards to the select element. Also, add 
        a type alias to make the implementations of item and namedItem less verbose.

        * html/HTMLOptionsCollection.idl:
        Remove CustomIndexedSetter and uncomment the setter.

        * html/HTMLSelectElement.idl:
        Remove CustomIndexedSetter and uncomment the setter. Also, reformat
        to match the WHATWG spec.

        * page/DOMWindow.idl:
        Update for JSCustomDefineOwnProperty -> CustomDefineOwnProperty rename. Add 
        CustomGetOwnPropertySlotByIndex which is now needed to remove some unsound
        assumptions the generator was making.

        * page/Location.idl:
        Update for removal of JS prefix from a bunch of extended attributes.

        * page/UserMessageHandlersNamespace.idl:
        Update for JSCustomGetOwnPropertySlotAndDescriptor -> CustomGetOwnPropertySlotAndDescriptor rename.

        * storage/Storage.idl:
        Remove CustomNamedSetter and uncomment the setter.

        * bindings/scripts/test/JS/JSInterfaceName.h:
        * bindings/scripts/test/JS/JSTestEventTarget.h:
        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: Added.
        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: Added.
        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: Added.
        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: Added.
        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: Added.
        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: Added.
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: Added.
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: Added.
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: Added.
        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: Added.
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestObj.h:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
        * bindings/scripts/test/TestIndexedSetterNoIdentifier.idl: Added.
        * bindings/scripts/test/TestIndexedSetterThrowingException.idl: Added.
        * bindings/scripts/test/TestIndexedSetterWithIdentifier.idl: Added.
        * bindings/scripts/test/TestNamedAndIndexedSetterNoIdentifier.idl: Added.
        * bindings/scripts/test/TestNamedAndIndexedSetterThrowingException.idl: Added.
        * bindings/scripts/test/TestNamedAndIndexedSetterWithIdentifier.idl: Added.
        * bindings/scripts/test/TestNamedDeleterWithIdentifier.idl:
        * bindings/scripts/test/TestNamedSetterNoIdentifier.idl: Added.
        * bindings/scripts/test/TestNamedSetterThrowingException.idl: Added.
        * bindings/scripts/test/TestNamedSetterWithIdentifier.idl: Added.
        * bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: Added.
        * bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: Added.
        * bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: Added.
        Added new tests and updated some results.

2017-06-04  Simon Fraser  <simon.fraser@apple.com>

        Object bounding box wrong for some paths
        https://bugs.webkit.org/show_bug.cgi?id=172866

        Reviewed by Tim Horton.
        
        RenderSVGShape::calculateObjectBoundingBox() should use boundingRect()
        rather than fastBoundingRect(), because the latter includes control points.

        Covered by existing tests.

        * rendering/svg/RenderSVGShape.cpp:
        (WebCore::RenderSVGShape::calculateObjectBoundingBox):

2017-06-04  Konstantin Tokarev  <annulen@yandex.ru>

        Fix build of Windows-specific code with ICU 59.1
        https://bugs.webkit.org/show_bug.cgi?id=172729

        Reviewed by Darin Adler.

        Fix conversions from WTF::String to wchar_t* and vice versa.
        No new tests needed.

        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
        (WebCore::mimeTypeCache):
        (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):

2017-06-04  Chris Dumez  <cdumez@apple.com>

        Implement DOMMatrixReadOnly.transformPoint()
        https://bugs.webkit.org/show_bug.cgi?id=172900

        Reviewed by Simon Fraser.

        Implement DOMMatrixReadOnly.transformPoint():
        - https://drafts.fxtf.org/geometry/#dommatrixreadonly
        - https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-transformpoint

        Test: imported/blink/fast/dom/geometry-interfaces-dom-matrix-transformPoint.html

        * css/DOMMatrixReadOnly.cpp:
        (WebCore::DOMMatrixReadOnly::transformPoint):
        * css/DOMMatrixReadOnly.h:
        * css/DOMMatrixReadOnly.idl:

2017-06-04  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Improve comments in AES, PBKDF2, RSA-SSA algorithm implementations
        https://bugs.webkit.org/show_bug.cgi?id=172894

        Reviewed by Michael Catanzaro.

        Add or improve code comments in libgcrypt implementations for the AES_CBC,
        AES_GCM, AES_KW, PBKDF2 and RSA-SSA algorithms.

        * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Add generic comments that
        describe each operation that's performed.
        (WebCore::gcryptEncrypt):
        (WebCore::gcryptDecrypt):
        * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Ditto.
        (WebCore::gcryptEncrypt):
        (WebCore::gcryptDecrypt):
        * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Ditto.
        (WebCore::gcryptWrapKey):
        (WebCore::gcryptUnwrapKey):
        * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Ditto.
        (WebCore::gcryptDeriveBits):
        * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
        (WebCore::gcryptVerify): Align the verification results comment with the
        one that's used in the ECDSA implementation.

2017-06-03  Chris Dumez  <cdumez@apple.com>

        Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
        https://bugs.webkit.org/show_bug.cgi?id=172898

        Reviewed by Sam Weinig.

        Implement DOMMatrix's fromFloat32Array / fromFloat64Array & toFloat32Array / toFloat64Array
        as per:
        - https://drafts.fxtf.org/geometry/#dommatrixreadonly

        Test: http/wpt/geometry/DOMMatrix-from-to-typed-arrays.html

        * css/DOMMatrix.cpp:
        (WebCore::DOMMatrix::fromFloat32Array):
        (WebCore::DOMMatrix::fromFloat64Array):
        * css/DOMMatrix.h:
        * css/DOMMatrix.idl:
        * css/DOMMatrixReadOnly.cpp:
        (WebCore::DOMMatrixReadOnly::fromFloat32Array):
        (WebCore::DOMMatrixReadOnly::fromFloat64Array):
        (WebCore::DOMMatrixReadOnly::toFloat32Array):
        (WebCore::DOMMatrixReadOnly::toFloat64Array):
        * css/DOMMatrixReadOnly.h:
        * css/DOMMatrixReadOnly.idl:

2017-06-03  Simon Fraser  <simon.fraser@apple.com>

        Implement DOMPointReadOnly.matrixTransform()
        https://bugs.webkit.org/show_bug.cgi?id=172896

        Reviewed by Chris Dumez.

        DOMPointReadOnly.matrixTransform() creates the matrix or throws, then uses
        a new function in TransformationMatrix to map x,y,z,w through the matrix.

        Test: http/wpt/geometry/DOMPoint-003.html

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/DOMMatrixReadOnly.h:
        (WebCore::DOMMatrixReadOnly::transformationMatrix):
        * dom/DOMPointReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.idl.
        (WebCore::DOMPointReadOnly::matrixTransform):
        * dom/DOMPointReadOnly.h:
        * dom/DOMPointReadOnly.idl:
        * platform/graphics/transforms/TransformationMatrix.cpp:
        (WebCore::TransformationMatrix::map4ComponentPoint):
        * platform/graphics/transforms/TransformationMatrix.h:

2017-06-03  Myles C. Maxfield  <mmaxfield@apple.com>

        Cleanup arguments to preparePlatformFont() and fontWithFamily() in FontCacheCoreText.cpp
        https://bugs.webkit.org/show_bug.cgi?id=172886

        Reviewed by Simon Fraser.

        The number of arguments is getting out of control.

        No new tests because there is no behavior change.

        * platform/graphics/FontCache.h:
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::preparePlatformFont):
        (WebCore::fontWithFamily):
        (WebCore::FontCache::createFontPlatformData):
        (WebCore::FontCache::systemFallbackForCharacters):
        * platform/graphics/mac/FontCacheMac.mm:
        (WebCore::platformFontWithFamilySpecialCase):
        * platform/graphics/mac/FontCustomPlatformData.cpp:
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/spi/cocoa/CoreTextSPI.h:

2017-06-03  Yusuke Suzuki  <utatane.tea@gmail.com>

        Script modules should be able to import data urls
        https://bugs.webkit.org/show_bug.cgi?id=171594

        Reviewed by Youenn Fablet.

        Tests: js/dom/classic-script-with-data-url.html
               js/dom/modules/module-script-with-data-url.html

        Script tag resources should have SameOriginDataURLFlag::Set to load data URLs
        since script tags should treat data URLs as same origin.

        * bindings/js/CachedScriptFetcher.cpp:
        (WebCore::CachedScriptFetcher::requestScriptWithCache):

2017-06-03  Simon Fraser  <simon.fraser@apple.com>

        Sort the project file.

        * WebCore.xcodeproj/project.pbxproj:

2017-06-03  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Gather SUBTLE_CRYPTO utility functions in a single header
        https://bugs.webkit.org/show_bug.cgi?id=172870

        Reviewed by Jiewen Tan.

        Gather the helper functions used across different source files
        for libgcrypt-backed SUBTLE_CRYPTO implementations in a single
        header file.

        * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
        (WebCore::hashCryptoDigestAlgorithm): Deleted.
        (WebCore::hashAlgorithmName): Deleted.
        (WebCore::mpiData): Deleted.
        * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
        (WebCore::gcryptDeriveBits):
        (WebCore::macAlgorithmForHashFunction): Deleted.
        * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
        (WebCore::gcryptDeriveBits):
        * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
        (WebCore::mpiData): Deleted.
        * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
        (WebCore::hashCryptoDigestAlgorithm): Deleted.
        (WebCore::hashAlgorithmName): Deleted.
        (WebCore::mpiData): Deleted.
        * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
        (WebCore::hashAlgorithmName): Deleted.
        (WebCore::mpiData): Deleted.
        * crypto/gcrypt/GCryptUtilities.h: Added.
        (WebCore::hashAlgorithmName):
        (WebCore::hmacAlgorithm):
        (WebCore::digestAlgorithm):
        (WebCore::hashCryptoDigestAlgorithm):
        (WebCore::mpiData):

2017-06-03  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Fix PK verification for ECDSA
        https://bugs.webkit.org/show_bug.cgi?id=172857

        Reviewed by Michael Catanzaro.

        No new tests -- covered by existing tests.

        * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
        (WebCore::gcryptVerify): Return `true` if the verification succeeded or `false`
        in any other case, avoiding spilling information about the exact cause of
        verification failure.

2017-06-02  Zalan Bujtas  <zalan@apple.com>

        Cleanup FrameView::autoSizeIfEnabled.
        https://bugs.webkit.org/show_bug.cgi?id=172889
        <rdar://problem/32550783>

        Reviewed by Tim Horton.

        This patch ensures that we always have a clean tree (and a valid and current document size) when
        setting m_autoSizeContentSize. 

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

2017-06-02  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION(r216212): RenderReplaced::paint() should not save and restore the context unless it has to
        https://bugs.webkit.org/show_bug.cgi?id=172883
        <rdar://problem/32548614>

        Reviewed by Tim Horton.

        After implementing dragged content fading, RenderReplace::paint is now always guarded by unnecessary calls to
        GraphicsContext::save and GraphicsContext::restore, even when there is no dragged content being rendered. To
        address this, we initialize our GraphicsContextStateSaver with saveAndRestore = false, indicating that we don't
        want to immediately try and save the context.

        If we are in a dragged content range, we will then call GraphicsContextStateSaver::save, which saves the
        graphics context and also causes the GraphicsContextStateSaver to eventually try and restore() when it is
        destroyed. Otherwise, in the common codepath where the renderer is not in a dragged content range, the
        constructor and destructor of GraphicsContextStateSaver will be no-ops with respect to saving and restoring the
        graphics context.

        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::paint):

2017-06-02  Myles C. Maxfield  <mmaxfield@apple.com>

        REGRESSION(r213464): [iOS] Fonts get too bold when the "Bold Text" accessibility setting is enabled
        https://bugs.webkit.org/show_bug.cgi?id=172737

        Reviewed by Simon Fraser.

        Revert the part of r213464 which changed how we calculate the weights of system fonts.

        Add an InternalSetting to trigger our mock of the accessbility "Bold Text" setting. We can't
        use the real setting, so instead we just ask for bold fonts instead of regular fonts when this
        setting is true.

        Tests: fast/text/accessibility-bold-system-font.html
               fast/text/accessibility-bold-system-font-2.html

        * platform/graphics/FontCache.h:
        (WebCore::FontCache::shouldMockBoldSystemFontForAccessibility):
        (WebCore::FontCache::setShouldMockBoldSystemFontForAccessibility):
        * platform/graphics/ios/FontCacheIOS.mm:
        (WebCore::platformFontWithFamilySpecialCase):
        * rendering/RenderTheme.h:
        (WebCore::RenderTheme::shouldMockBoldSystemFontForAccessibility):
        (WebCore::RenderTheme::setShouldMockBoldSystemFontForAccessibility):
        * rendering/RenderThemeIOS.h:
        * rendering/RenderThemeIOS.mm:
        (WebCore::cssWeightOfSystemFont):
        (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::Backup::Backup):
        (WebCore::InternalSettings::Backup::restoreTo):
        (WebCore::InternalSettings::setShouldMockBoldSystemFontForAccessibility):
        * testing/InternalSettings.h:
        * testing/InternalSettings.idl:

2017-06-02  Brady Eidson  <beidson@apple.com>

        Prevent scheme handlers from handling all built-in URL schemes.
        <rdar://problem/32404790> and https://bugs.webkit.org/show_bug.cgi?id=172869

        Reviewed by Andy Estes.

        Covered by API test.

        This patch refactors SchemeRegistry to keep a base, constant set of each of the special
        URL schemes that WebKit knows about by default.
        
        It then exposes that list through a new method to support WK2 API.

        * platform/SchemeRegistry.cpp:
        (WebCore::allBuiltinSchemes):
        (WebCore::builtinLocalURLSchemes):
        (WebCore::localURLSchemes):
        (WebCore::builtinSecureSchemes):
        (WebCore::secureSchemes):
        (WebCore::builtinSchemesWithUniqueOrigins):
        (WebCore::schemesWithUniqueOrigins):
        (WebCore::builtinEmptyDocumentSchemes):
        (WebCore::emptyDocumentSchemes):
        (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
        (WebCore::canDisplayOnlyIfCanRequestSchemes):
        (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
        (WebCore::builtinCORSEnabledSchemes):
        (WebCore::CORSEnabledSchemes):
        (WebCore::SchemeRegistry::isBuiltinScheme):
        * platform/SchemeRegistry.h:

2017-06-02  Simon Fraser  <simon.fraser@apple.com>

        All scroll peformance logging should happen in the UI process
        https://bugs.webkit.org/show_bug.cgi?id=172874
        rdar://problem/24474830

        Reviewed by Tim Horton.

        Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds,
        so we have to log from the UI process.

        Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to
        WebPageProxy, which prints them with the same format they had before. Some plumbing through
        PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers
        through to something that can get to Page.

        * WebCore.xcodeproj/project.pbxproj:
        * page/Page.cpp:
        (WebCore::Page::Page):
        (WebCore::Page::~Page):
        * page/Page.h:
        (WebCore::Page::performanceLoggingClient):
        * page/PageConfiguration.cpp:
        * page/PageConfiguration.h:
        * page/PerformanceLoggingClient.cpp: Added.
        (WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString):
        * page/PerformanceLoggingClient.h: Added.
        (WebCore::PerformanceLoggingClient::~PerformanceLoggingClient):
        * page/scrolling/AsyncScrollingCoordinator.cpp:
        (WebCore::AsyncScrollingCoordinator::reportExposedUnfilledArea):
        (WebCore::AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged):
        * page/scrolling/AsyncScrollingCoordinator.h:
        * page/scrolling/ScrollingTree.h:
        (WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged):
        (WebCore::ScrollingTree::reportExposedUnfilledArea):
        * page/scrolling/ThreadedScrollingTree.cpp:
        (WebCore::ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged):
        (WebCore::ThreadedScrollingTree::reportExposedUnfilledArea):
        * page/scrolling/ThreadedScrollingTree.h:
        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
        (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
        (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea):
        (WebCore::ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea): Deleted.
        (WebCore::logThreadedScrollingMode): Deleted.
        * platform/graphics/GraphicsLayerClient.h:
        (WebCore::GraphicsLayerClient::logFilledVisibleFreshTile):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::platformCALayerLogFilledVisibleFreshTile):
        * platform/graphics/ca/GraphicsLayerCA.h:
        * platform/graphics/ca/PlatformCALayerClient.h:
        (WebCore::PlatformCALayerClient::platformCALayerLogFilledVisibleFreshTile):
        * platform/graphics/ca/TileController.cpp:
        (WebCore::TileController::logFilledVisibleFreshTile):
        * platform/graphics/ca/TileController.h:
        * platform/graphics/ca/TileGrid.cpp:
        (WebCore::TileGrid::platformCALayerPaintContents):
        * platform/graphics/ca/TileGrid.h:
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
        * rendering/RenderLayerBacking.h:

2017-06-02  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream iOS] Cleanup video muting/unmuting when tab visibility changes
        https://bugs.webkit.org/show_bug.cgi?id=172858

        Reviewed by Youenn Fablet.

        Test: platform/ios/mediastream/video-muted-in-background-tab.html

        * dom/Document.cpp:
        (WebCore::Document::visibilityStateChanged): Call notifyMediaCaptureOfVisibilityChanged.
        (WebCore::Document::notifyMediaCaptureOfVisibilityChanged): Renamed from notifyVisibilityChangedToMediaCapture.
        Set m_videoCaptureMutedForVisibilityChange when capture is muted because the document is hidden,
        and clear it when visibility changes when capture is disabled. Don't unmute when the document
        becomes visible unless this m_videoCaptureMutedForVisibilityChange is still true.
        (WebCore::Document::notifyVisibilityChangedToMediaCapture): Deleted.
        * dom/Document.h:

        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::setVideoCaptureMutedForPageVisibility): Renamed from
        setVisibility.
        (WebCore::RealtimeMediaSourceCenter::setVisibility): Deleted.
        * platform/mediastream/RealtimeMediaSourceCenter.h:

        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSourceFactory::setVideoCaptureMutedForPageVisibility): Ditto.
        (WebCore::AVVideoCaptureSourceFactory::setVisibility): Deleted.

        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSourceFactory::setVideoCaptureMutedForPageVisibility): Ditto.
        (WebCore::MockRealtimeVideoSourceFactory::setVisibility): Deleted.

2017-06-02  Frederic Wang  <fwang@igalia.com>

        [Mac] Include frames in the scrolling tree when ScrollingTreeIncludesFrames=true
        https://bugs.webkit.org/show_bug.cgi?id=172825

        Reviewed by Simon Fraser.

        This commit generalizes RenderLayerCompositor/ScrollingCoordinator so that it handles the
        case of non-main frames. When ScrollingTreeIncludesFrames=true, all the frames will appear
        in the scrolling tree on Mac WK2.

        Test: fast/scrolling/scrolling-tree-includes-frame.html

        * page/scrolling/ScrollingCoordinator.cpp:
        (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView): Do not to restrict to the
        main frame.
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateBacking): Do not to restrict to the main frame.
        (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer): Make this function a class
        member so it can call hasCoordinatedScrolling and no longer needs a RenderView parameter.
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Do not to restrict to the
        main frame.
        * rendering/RenderLayerCompositor.h: Introduce useCoordinatedScrollingForLayer.

2017-06-02  Don Olmstead  <don.olmstead@am.sony.com>

        [WebCore] DragImageRef should correspond to USE(CAIRO)
        https://bugs.webkit.org/show_bug.cgi?id=172863

        Reviewed by Carlos Alberto Lopez Perez.

        No new tests. No change in behavior.

        * platform/DragImage.h:

2017-06-02  Frederic Wang  <fwang@igalia.com>

        [Mac] Use compositing for frames when ScrollingTreeIncludesFrames=true
        https://bugs.webkit.org/show_bug.cgi?id=172851

        Reviewed by Simon Fraser.

        When fast frame scrolling is supported on mac (bug 171667), scrollable frames will require
        special composited layer. This commit enables that on mac but only when
        ScrollingTreeIncludesFrames=true, so that the default behavior is unchanged.

        Test: compositing/iframes/compositing-for-scrollable-iframe.html

        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame): Do not enable frame
        compositing when ScrollingTreeIncludesFrames=false.
        Rename ScrollableInnerFrameTrigger to ScrollableNonMainFrameTrigger.
        * page/ChromeClient.h: Rename ScrollableInnerFrameTrigger.

2017-06-02  Simon Fraser  <simon.fraser@apple.com>

        Get <chrono> out of StdLibExtras.h
        https://bugs.webkit.org/show_bug.cgi?id=172744

        Reviewed by Zalan Bujtas.

        Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.

        * fileapi/FileReader.cpp:
        * inspector/InspectorOverlay.cpp:
        * loader/CrossOriginPreflightResultCache.cpp:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::freshnessLifetime):
        * page/ResourceUsageThread.cpp:
        (WebCore::ResourceUsageThread::threadBody):
        * page/cocoa/MemoryReleaseCocoa.mm:
        (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
        * platform/network/CacheValidation.cpp:
        (WebCore::computeFreshnessLifetimeForHTTPFamily):
        * platform/network/CacheValidation.h:

2017-06-02  Andy Estes  <aestes@apple.com>

        [Cocoa] Add a "supportedCountries" property to ApplePayPaymentRequest
        https://bugs.webkit.org/show_bug.cgi?id=172832
        <rdar://problem/30735544>

        Reviewed by Alex Christensen.

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

        * Modules/applepay/ApplePayPaymentRequest.h:
        * Modules/applepay/ApplePayPaymentRequest.idl:
        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::convertAndValidate):
        * Modules/applepay/PaymentRequest.h:
        (WebCore::PaymentRequest::supportedCountries):
        (WebCore::PaymentRequest::setSupportedCountries):
        * Modules/applepay/PaymentRequestValidator.cpp:
        (WebCore::PaymentRequestValidator::validate):
        * platform/spi/cocoa/PassKitSPI.h:

2017-06-02  Devin Rousso  <drousso@apple.com>

        Web Inspector: Should see active Web Sockets when opening Web Inspector
        https://bugs.webkit.org/show_bug.cgi?id=172312

        Reviewed by Joseph Pecoraro.

        Test: http/tests/websocket/tests/hybi/inspector/before-load.html

        * Modules/websockets/WebSocket.h:
        * Modules/websockets/WebSocket.cpp:
        (WebCore::WebSocket::WebSocket):
        (WebCore::WebSocket::~WebSocket):
        (WebCore::WebSocket::allActiveWebSockets):
        (WebCore::WebSocket::allActiveWebSocketsMutex):
        (WebCore::WebSocket::channel):
        (WebCore::WebSocket::eventTargetInterface):
        Add a static set of all WebSocket objects and provide getters to access web socket metadata.

        * Modules/websockets/ThreadableWebSocketChannel.h:
        (WebCore::ThreadableWebSocketChannel::isWebSocketChannel):
        * Modules/websockets/WebSocketChannel.h:
        * Modules/websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::isWebSocketChannel):
        (WebCore::WebSocketChannel::identifier):
        (WebCore::WebSocketChannel::clientHandshakeRequest):
        (WebCore::WebSocketChannel::serverHandshakeResponse):
        (WebCore::WebSocketChannel::handshakeMode):
        (WebCore::WebSocketChannel::isType):
        Provide getters to access web socket metadata.

        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::enable):
        Loops over the static set of all WebSocket objects and sends events for each to the frontend.

2017-06-02  Chris Dumez  <cdumez@apple.com>

        Unreviewed, fix linking errors on iOS after r217712.

        * platform/OrientationNotifer.h:
        (WebCore::OrientationNotifier::Observer::setNotifier):

2017-06-02  Chris Dumez  <cdumez@apple.com>

        Crash under OrientationNotifier::Observer::setNotifier()
        https://bugs.webkit.org/show_bug.cgi?id=172847
        <rdar://problem/32519127>

        Reviewed by Youenn Fablet.

        Update OrientationNotifier::Observer::setNotifier() to unregister itself from
        its current notifier if it already has one. This is needed because
        Internals::setCameraMediaStreamTrackOrientation() may be used to override the
        notifier of an observer. If we override the notifier without unregistering
        the observer from its previous notifier, then the previous notifier will not
        get notified when the observer gets destroyed.

        No new tests, already covered by webrtc/video-rotation.html that is currently
        failing on some bots.

        * platform/OrientationNotifer.h:
        (WebCore::OrientationNotifier::Observer::setNotifier):

2017-06-02  Javier Fernandez  <jfernandez@igalia.com>

        [css-grid] Logical margin incorrectly applied during the tracks sizing algorithm of auto tracks
        https://bugs.webkit.org/show_bug.cgi?id=172836

        Reviewed by Manuel Rego Casasnovas.

        When computing min-content and max-content of the content-sized tracks
        we are using the marginIntrinsicLogicalWidthForChild function, which
        uses the grid's writing-mode to determine wether to use the child's
        margin width or height. This is not correct when the grid item is
        orthogonal.

        This patch changes how we compute the tracks width so we use always
        the item's marginLogicalWidth, which depends only on its own writing
        mode.

        Test: fast/css-grid-layout/grid-track-sizing-with-margins-and-orthogonal-flows.html

        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
        (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):

2017-06-02  Emilio Cobos Álvarez  <ecobos@igalia.com>

        Invalidate the shadow subtree style when slotted pseudo rules are present.
        https://bugs.webkit.org/show_bug.cgi?id=172822

        Reviewed by Antti Koivisto.

        No new tests, this is tested by
        fast/shadow-dom/css-scoping-slot-with-id.html, once we don't force an
        Inherit style change for slots. I could add some more tests for stuff
        with descendant combinators and similar I guess, though.

        * style/AttributeChangeInvalidation.cpp:
        (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
        * style/ClassChangeInvalidation.cpp:
        (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
        * style/IdChangeInvalidation.cpp:
        (WebCore::Style::IdChangeInvalidation::invalidateStyle):

2017-06-02  Miguel Gomez  <magomez@igalia.com>

        [GTK+][WPE] Allow TextureMapperShaderProgram to perform colorspace conversions with the source texture pixels
        https://bugs.webkit.org/show_bug.cgi?id=172749

        Reviewed by Žan Doberšek.

        Currently TextureMapperGL is only able to paint properly textures that are in RGBA format. There are
        situations where we will want it to be able to handle other formats (for example BGRA for gstreamer-gl).
        To make this possible without having to perform the color conversion in the CPU, we add a new color
        conversion matrix to TextureMapperShaderProgram. This matrix will perform the color space conversion
        in the GPU, just after sampling the source texture.

        Also, add a new flag to TextureMapperGL to indicate that a color conversion is required to handle a
        texture. This flag will be set to the TextureMapperPlatformLayerBuffers as required, and TextureMapperGL
        will set the appropriate color space matrix to the shader. Initially only the flag for BGRA->RGBA conversion
        is defined, but support for new transformations can be added as needed.

        VideoTextureCopierGStreamer also uses the TextureMapperShaderProgram to perform texture sampling, but for
        the moment it just sets an identity matrix because when using gstreamer-gl, the format of the video frames
        is RGBA. This will be changed soon to use BGRA.

        No new tests.

        * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
        (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
        * platform/graphics/texmap/TextureMapperGL.cpp:
        (WebCore::colorSpaceMatrixForFlags):
        (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
        * platform/graphics/texmap/TextureMapperGL.h:
        * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
        * platform/graphics/texmap/TextureMapperShaderProgram.h:

2017-06-02  Javier Fernandez  <jfernandez@igalia.com>

        [css-grid] Margin wrong applied when stretching an orthogonal item in fixed size track
        https://bugs.webkit.org/show_bug.cgi?id=172590

        Reviewed by Sergio Villar Senin.

        We need to consider orthogonality when using the item's logical margin to
        compute the available space for stretching.

        The issue this patch fixes is only reproducible when the grid layout logic
        is executed several times, since probably the item doesn't need to be
        laid out again. In such cases, we just get the cached logical margins
        but we were not taking orthogonality into account.

        Test: fast/css-grid-layout/grid-item-stretching-must-not-depend-on-previous-layouts.html

        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::layoutBlock):
        (WebCore::RenderGrid::marginLogicalSizeForChild):
        (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
        * rendering/RenderGrid.h:

2017-06-01  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Cache RenderThemeGadget hierarchies for rendering themed elements with GTK+ 3.20+
        https://bugs.webkit.org/show_bug.cgi?id=162673

        Reviewed by Michael Catanzaro.

        Because of the way the new theming system works in GTK+ >= 3.20 we are currently creating a gadget hierarchy
        every time we need to render a styled element or get layout information about it. That's happening on every
        repaint, and it's specially problematic for overlay scrollbar indicators that fade in/out when shown/hidden. We
        need to cache the gadgets and simply apply the state before every paint or layout query. When using GtkWidgetPath,
        calling gtk_style_context_save() breaks the gadget hierarchy, and style classes need to be set when building the
        GtkWidgetPath. That means we can't cache RenderThemeGadgets, call save, apply style classes and state, and then
        call restore. We need to cache gadget hierarchies with fixed style classes. Fortunately, setting the state does
        work, so we don't need to also cache a different hierarchy for every possible state. For example, for the
        particular case of scrollbars we would cache VerticalScrollbarRight, VerticalScrollbarLeft, HorizontalScrollbar,
        VerticalScrollIndicatorRight, VerticalScrollIndicatorLeft and HorizontalScrollIndicator. In practice, we will
        only have 4 of those at the same time in the cache.
        This patch adds RenderThemeWidget to represent a hierarchy of gadgets with fixed style classes that can be
        cached and reused to render or query style of those "widgets". It also simplifies the RenderThemeGtk and
        ScrollbarThemeGtk code by removing a lot of duplicated code to build the gadget hierarchies.

        * PlatformGTK.cmake:
        * platform/gtk/RenderThemeGadget.cpp:
        (WebCore::createStyleContext):
        (WebCore::appendElementToPath):
        (WebCore::RenderThemeGadget::state):
        (WebCore::RenderThemeGadget::setState):
        * platform/gtk/RenderThemeGadget.h:
        * platform/gtk/RenderThemeWidget.cpp: Added.
        (WebCore::widgetMap):
        (WebCore::RenderThemeWidget::getOrCreate):
        (WebCore::RenderThemeWidget::clearCache):
        (WebCore::RenderThemeWidget::~RenderThemeWidget):
        (WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
        (WebCore::RenderThemeScrollbar::stepper):
        (WebCore::RenderThemeToggleButton::RenderThemeToggleButton):
        (WebCore::RenderThemeButton::RenderThemeButton):
        (WebCore::RenderThemeComboBox::RenderThemeComboBox):
        (WebCore::RenderThemeEntry::RenderThemeEntry):
        (WebCore::RenderThemeSearchEntry::RenderThemeSearchEntry):
        (WebCore::RenderThemeSpinButton::RenderThemeSpinButton):
        (WebCore::RenderThemeSlider::RenderThemeSlider):
        (WebCore::RenderThemeProgressBar::RenderThemeProgressBar):
        (WebCore::RenderThemeListView::RenderThemeListView):
        (WebCore::RenderThemeIcon::RenderThemeIcon):
        * platform/gtk/RenderThemeWidget.h: Added.
        (WebCore::RenderThemeEntry::entry):
        (WebCore::RenderThemeEntry::selection):
        * platform/gtk/ScrollbarThemeGtk.cpp:
        (WebCore::ScrollbarThemeGtk::themeChanged):
        (WebCore::ScrollbarThemeGtk::updateThemeProperties):
        (WebCore::widgetTypeForScrollbar):
        (WebCore::contentsRectangle):
        (WebCore::ScrollbarThemeGtk::trackRect):
        (WebCore::ScrollbarThemeGtk::backButtonRect):
        (WebCore::ScrollbarThemeGtk::forwardButtonRect):
        (WebCore::ScrollbarThemeGtk::paint):
        (WebCore::ScrollbarThemeGtk::scrollbarThickness):
        (WebCore::ScrollbarThemeGtk::minimumThumbLength):
        * rendering/RenderThemeGtk.cpp:
        (WebCore::createStyleContext):
        (WebCore::setToggleSize):
        (WebCore::paintToggle):
        (WebCore::RenderThemeGtk::paintButton):
        (WebCore::menuListColor):
        (WebCore::RenderThemeGtk::popupInternalPaddingBox):
        (WebCore::RenderThemeGtk::paintMenuList):
        (WebCore::RenderThemeGtk::adjustTextFieldStyle):
        (WebCore::RenderThemeGtk::paintTextField):
        (WebCore::adjustSearchFieldIconStyle):
        (WebCore::paintSearchFieldIcon):
        (WebCore::RenderThemeGtk::paintSliderTrack):
        (WebCore::RenderThemeGtk::adjustSliderThumbSize):
        (WebCore::RenderThemeGtk::paintSliderThumb):
        (WebCore::RenderThemeGtk::progressBarRectForBounds):
        (WebCore::RenderThemeGtk::paintProgressBar):
        (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
        (WebCore::RenderThemeGtk::paintInnerSpinButton):
        (WebCore::styleColor):
        (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor):
        (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor):
        (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor):
        (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor):
        (WebCore::RenderThemeGtk::paintMediaButton):

2017-06-01  Andreas Kling  <akling@apple.com>

        [Mac] Remove backing store for layers that are outside the viewport
        https://bugs.webkit.org/show_bug.cgi?id=170082
        <rdar://problem/31245009>

        Reviewed by Simon Fraser.

        Implement the backingStoreAttached flag in PlatformCALayerCocoa. This means that
        compositing layers outside the tiling coverage rect will no longer have backing
        stores, saving large amounts of memory.

        Also added a canDetachBackingStore flag that is set to false for scroll control
        layers, to avoid complicating coverage rect computations.

        Test: compositing/backing-store-attachment-1.html

        * page/Frame.h:
        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::GraphicsLayer::GraphicsLayer):
        (WebCore::GraphicsLayer::dumpProperties):
        * platform/graphics/GraphicsLayer.h:
        (WebCore::GraphicsLayer::backingStoreAttached):
        (WebCore::GraphicsLayer::setCanDetachBackingStore):
        (WebCore::GraphicsLayer::canDetachBackingStore):
        * platform/graphics/GraphicsLayerClient.h:
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::backingStoreAttached):
        (WebCore::GraphicsLayerCA::setNeedsDisplay):
        (WebCore::GraphicsLayerCA::updateCoverage):
        * platform/graphics/ca/GraphicsLayerCA.h:
        * platform/graphics/ca/PlatformCALayer.h:
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        (PlatformCALayerCocoa::setBackingStoreAttached):
        (PlatformCALayerCocoa::backingStoreAttached):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateOverflowControlsLayers):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::layerTreeAsText):
        (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
        * testing/Internals.cpp:
        (WebCore::toLayerTreeFlags):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-06-01  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r217691.

        This change broke the Windows build.

        Reverted changeset:

        "Web Inspector: Should see active Web Sockets when opening Web
        Inspector"
        https://bugs.webkit.org/show_bug.cgi?id=172312
        http://trac.webkit.org/changeset/217691

2017-06-01  Joseph Pecoraro  <pecoraro@apple.com>

        Unreviewed Windows build fix after r217691.

        * Modules/websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::sendFrame):
        * Modules/websockets/WebSocketChannel.h:
        Disambiguate the Function being used.

2017-06-01  Youenn Fablet  <youenn@apple.com>

        LibWebRTC might crash with frames having a null width or height
        https://bugs.webkit.org/show_bug.cgi?id=172842
        <rdar://problem/32514813>

        Reviewed by Jon Lee.

        Do not send black frames in case the video width or height is zero.
        Also ensure that even if a null buffer is returned by the pool, no crash might actually happen.

        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
        (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):

2017-06-01  Devin Rousso  <drousso@apple.com>

        Web Inspector: Should see active Web Sockets when opening Web Inspector
        https://bugs.webkit.org/show_bug.cgi?id=172312

        Reviewed by Joseph Pecoraro.

        Test: http/tests/websocket/tests/hybi/inspector/before-load.html

        * Modules/websockets/WebSocket.h:
        * Modules/websockets/WebSocket.cpp:
        (WebCore::WebSocket::WebSocket):
        (WebCore::WebSocket::~WebSocket):
        (WebCore::WebSocket::allActiveWebSockets):
        (WebCore::WebSocket::allActiveWebSocketsMutex):
        (WebCore::WebSocket::channel):
        (WebCore::WebSocket::eventTargetInterface):
        Add a static set of all WebSocket objects and provide getters to access web socket metadata.

        * Modules/websockets/ThreadableWebSocketChannel.h:
        (WebCore::ThreadableWebSocketChannel::isWebSocketChannel):
        * Modules/websockets/WebSocketChannel.h:
        * Modules/websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::isWebSocketChannel):
        (WebCore::WebSocketChannel::identifier):
        (WebCore::WebSocketChannel::clientHandshakeRequest):
        (WebCore::WebSocketChannel::serverHandshakeResponse):
        (WebCore::WebSocketChannel::handshakeMode):
        (WebCore::WebSocketChannel::isType):
        Provide getters to access web socket metadata.

        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::enable):
        Loops over the static set of all WebSocket objects and sends events for each to the frontend.

2017-06-01  Simon Fraser  <simon.fraser@apple.com>

        REGRESSION (r217296): Dragging a video only shows controls during drag event
        https://bugs.webkit.org/show_bug.cgi?id=172837
        rdar://problem/32434661

        Reviewed by Zalan Bujtas.

        r217296 changed RenderVideo::paintReplaced() from checking paintBehavior() flags on the FrameView
        to paintInfo.paintBehavior flags. However, RenderLayer was stripping the PaintBehaviorFlattenCompositingLayers
        flag from the paintInfo.paintBehavior flags, so fix that.

        Not easily testable.

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

2017-06-01  Simon Fraser  <simon.fraser@apple.com>

        Remove the redundant selectionOnly argument from RenderLayer::paintForegroundForFragments()
        https://bugs.webkit.org/show_bug.cgi?id=172835

        Reviewed by Zalan Bujtas.

        The 'selectionOnly' state is already encoded in localPaintingInfo.paintBehavior so there's
        no need to pass it separately.

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paintLayerContents):
        (WebCore::RenderLayer::paintForegroundForFragments):
        * rendering/RenderLayer.h:

2017-06-01  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        Fix compilation errors in LocalizedStrings.cpp on platform not USE(CF) nor USE(GLIB)
        https://bugs.webkit.org/show_bug.cgi?id=172796

        Reviewed by Alex Christensen.

        No new tests needed. Fixing compilation errors.

        * platform/LocalizedStrings.cpp:
        (WebCore::contextMenuItemTagLookUpInDictionary):
        (WebCore::imageTitle):
        (WebCore::validationMessageRangeUnderflowText):
        (WebCore::validationMessageRangeOverflowText):

2017-06-01  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r217647.

        No longer needed after r217682

        Reverted changeset:

        "Avoid iterator invalidation bug in
        WebCore::defaultPortForProtocol"
        https://bugs.webkit.org/show_bug.cgi?id=172786
        http://trac.webkit.org/changeset/217647

2017-06-01  Chris Dumez  <cdumez@apple.com>

        Make WebCore::defaultPortForProtocol() thread-safe
        https://bugs.webkit.org/show_bug.cgi?id=172797

        Reviewed by Brent Fulgham.

        Make WebCore::defaultPortForProtocol() thread-safe since it is called from the SecurityOrigin
        constructor and SecurityOrigin objects are constructed from various threads.

        This should not regress the non-testing code paths since we only pay locking costs if
        a default port override has been set by the tests.

        * platform/URL.cpp:
        (WebCore::defaultPortForProtocolMapLock):
        (WebCore::defaultPortForProtocolMapForTesting):
        (WebCore::ensureDefaultPortForProtocolMapForTesting):
        (WebCore::registerDefaultPortForProtocolForTesting):
        (WebCore::clearDefaultPortForProtocolMapForTesting):
        (WebCore::defaultPortForProtocol):

2017-06-01  Andy Estes  <aestes@apple.com>

        REGRESSION (r217626): ENABLE_APPLE_PAY_SESSION_V3 was disabled by mistake
        https://bugs.webkit.org/show_bug.cgi?id=172828

        Reviewed by Beth Dakin.

        * Configurations/FeatureDefines.xcconfig:

2017-06-01  Frederic Wang  <fwang@igalia.com>

        ScrollingCoordinator::updateSynchronousScrollingReasons should consider non-main frames
        https://bugs.webkit.org/show_bug.cgi?id=172806

        Reviewed by Simon Fraser.

        Currently, the scrolling coordinator does not manage scrolling of frames other than the main
        one (bugs 171667 and 149264) and so ScrollingCoordinator::updateSynchronousScrollingReasons
        is only relevant for the main frame. This commit refactors a bit ScrollingCoordinator so that
        updateSynchronousScrollingReasons is considered for all the frames whose scrolling is
        coordinated by the ScrollingCoordinator so non-main frames will be considered in the future.

        No new tests, behavior is unchanged for now.

        * page/scrolling/ScrollingCoordinator.cpp:
        (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons): Add an ASSERT to ensure
        that this function is only called for frame whose scrolling is coordinated by this class.
        (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasonsForAllFrames): Introduce a
        new function to update synchronous scrolling for subframes whose scrolling is coordinated by
        this class.
        (WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates): Update
        synchronous scrolling reason for non-main frames too.
        (WebCore::ScrollingCoordinator::replaySessionStateDidChange): Update synchronous scrolling
        reason for non-main frames too.
        * page/scrolling/ScrollingCoordinator.h: Define updateSynchronousScrollingReasonsForAllFrames

2017-06-01  Andy Estes  <aestes@apple.com>

        [Cocoa] Upstream support for JCB as a supported payment network
        https://bugs.webkit.org/show_bug.cgi?id=172819

        Reviewed by Tim Horton.

        * Modules/applepay/PaymentRequest.cpp:
        (WebCore::PaymentRequest::isValidSupportedNetwork):
        (WebCore::isAdditionalValidSupportedNetwork): Deleted.

2017-06-01  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r217660.

        This should not have landed given that the new assertion is
        hit on debug EWS bots

        Reverted changeset:

        "Make sure we don't access WebCore::defaultPortForProtocol
        from non-main thread"
        https://bugs.webkit.org/show_bug.cgi?id=172797
        http://trac.webkit.org/changeset/217660

2017-06-01  Brent Fulgham  <bfulgham@apple.com>

        Make sure we don't access WebCore::defaultPortForProtocol from non-main thread
        https://bugs.webkit.org/show_bug.cgi?id=172797

        Reviewed by Alex Christensen.

        * platform/URL.cpp:
        (WebCore::defaultPortForProtocol): Add an assertion to make sure we don't access the
        DefaultPortForProtocolMapForTesting from multiple threads.

2017-06-01  Konstantin Tokarev  <annulen@yandex.ru>

        Get rid of more HIGH_DPI_CANVAS leftovers
        https://bugs.webkit.org/show_bug.cgi?id=172751

        Reviewed by Simon Fraser.

        Get rid of HTMLCanvasElement::convertLogicalToDevice() and
        HTMLCanvasElement::convertDeviceToLogical() that are no longer needed,
        as canvas doesn't use device scale factor anymore.

        No new tests needed.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::createImageBuffer): Use integer width()
        and height() instead of floating-point temporary deviceSize variable.
        (WebCore::HTMLCanvasElement::baseTransform): Return unmodified
        baseTransform of underlying ImageBuffer.
        * html/HTMLCanvasElement.h: Removed declarations of unused methods.

2017-05-31  Brent Fulgham  <bfulgham@apple.com>

        Avoid iterator invalidation bug in WebCore::defaultPortForProtocol
        https://bugs.webkit.org/show_bug.cgi?id=172786
        <rdar://problem/32499586>

        Reviewed by Chris Dumez.

        Create the SecurityOrigin objects on the main thread (rather than the worker queues)
        since defaultPortForProtocol is not threadsafe.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::logFrameNavigation):
        (WebCore::ResourceLoadObserver::logSubresourceLoading):
        (WebCore::ResourceLoadObserver::logWebSocketLoading):

2017-05-31  Mark Lam  <mark.lam@apple.com>

        Remove overrides of visitChildren() that do not add any functionality.
        https://bugs.webkit.org/show_bug.cgi?id=172789
        <rdar://problem/32500865>

        Reviewed by Andreas Kling.

        No new tests needed.  Just deleting unneeded code.

        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::visitChildren): Deleted.
        * bindings/js/JSDOMWindowBase.h:

2017-05-31  Don Olmstead  <don.olmstead@am.sony.com>

        [WebCore] Update AXObjectCache::startOrEndCharacterOffsetForRange signature for !HAVE(ACCESSIBILITY)
        https://bugs.webkit.org/show_bug.cgi?id=172769

        Reviewed by Yusuke Suzuki.

        No new tests. No change in behavior.

        * accessibility/AXObjectCache.h:
        (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
        * platform/Curl.cmake: Added.

2017-05-31  Mark Lam  <mark.lam@apple.com>

        CodeGeneratorJS's InstanceNeedsVisitChildren should not return true just because a class is / extends EventTarget.
        https://bugs.webkit.org/show_bug.cgi?id=172782
        <rdar://problem/32498266>

        Reviewed by Chris Dumez.

        No new tests needed.  This change is covered by existing binding tests.

        InstanceNeedsVisitChildren should also not check the IsJSBuiltinConstructor
        condition, which is not used to emit any additional code in the visitChildren
        override.

        The other conditions for generating visitChildren() are adequate if the class
        needs to override visitChildren.  Currently, we're generating some visitChildren()
        methods that only call its Base::visitChildren().  Removing the "is / extends
        EventTarget" conditions removes those unneeded visitChildren overrides.

        * bindings/scripts/CodeGeneratorJS.pm:
        (InstanceNeedsVisitChildren):
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        (WebCore::JSTestClassWithJSBuiltinConstructor::visitChildren): Deleted.
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        (WebCore::JSTestDOMJIT::visitChildren): Deleted.
        * bindings/scripts/test/JS/JSTestDOMJIT.h:
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        (WebCore::JSTestEventTarget::visitChildren): Deleted.
        * bindings/scripts/test/JS/JSTestEventTarget.h:
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        (WebCore::JSTestJSBuiltinConstructor::visitChildren): Deleted.
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::JSTestNode::visitChildren): Deleted.
        * bindings/scripts/test/JS/JSTestNode.h:

2017-05-31  Chris Dumez  <cdumez@apple.com>

        Make QualifiedName cache per thread
        https://bugs.webkit.org/show_bug.cgi?id=172778
        <rdar://problem/32490942>

        Reviewed by Geoffrey Garen.

        Make QualifiedName cache per thread since it is currently used from multiple threads,
        in an unsafe fashion. We started using QualifiedName objects in background threads
        after r190602 which started using a CSSSelectorParser in the ContentExtensionParser.

        * WebCore.xcodeproj/project.pbxproj:
        * dom/QualifiedName.cpp:
        (WebCore::QualifiedName::QualifiedName):
        (WebCore::QualifiedName::QualifiedNameImpl::~QualifiedNameImpl):
        * dom/QualifiedNameCache.cpp: Added.
        (WebCore::QNameComponentsTranslator::hash):
        (WebCore::QNameComponentsTranslator::equal):
        (WebCore::QNameComponentsTranslator::translate):
        (WebCore::QualifiedNameCache::getOrCreate):
        (WebCore::QualifiedNameCache::remove):
        * dom/QualifiedNameCache.h: Added.
        * platform/ThreadGlobalData.cpp:
        (WebCore::ThreadGlobalData::ThreadGlobalData):
        (WebCore::ThreadGlobalData::destroy):
        * platform/ThreadGlobalData.h:
        (WebCore::ThreadGlobalData::qualifiedNameCache):

2017-05-31  Andy Estes  <aestes@apple.com>

        Rename ENABLE_APPLE_PAY_DELEGATE to ENABLE_APPLE_PAY_SESSION_V3 and bump the supported version number
        https://bugs.webkit.org/show_bug.cgi?id=172366

        Reviewed by Daniel Bates.

        * Configurations/FeatureDefines.xcconfig:
        * Modules/applepay/ApplePayError.idl:
        * Modules/applepay/ApplePayPaymentAuthorizationResult.idl:
        * Modules/applepay/ApplePayPaymentMethodUpdate.idl:
        * Modules/applepay/ApplePaySession.idl:
        * Modules/applepay/ApplePayShippingContactUpdate.idl:
        * Modules/applepay/ApplePayShippingMethodUpdate.idl:

2017-05-31  Youenn Fablet  <youenn@apple.com>

        PeerConnection should respect tracks that are muted at the time they are added
        https://bugs.webkit.org/show_bug.cgi?id=172771

        Reviewed by Eric Carlson.

        Tests: webrtc/peer-connection-audio-unmute.html
               webrtc/video-unmute.html

        Making sure that muted/enabled state of sources are correctly handled at creation time of the outgoing webrtc sources.
        This should trigger silent audio and black frames.

        * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
        (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
        (WebCore::RealtimeOutgoingAudioSource::setSource):
        (WebCore::RealtimeOutgoingAudioSource::initializeConverter):
        * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
        (WebCore::RealtimeOutgoingVideoSource::setSource):
        (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
        (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
        (WebCore::RealtimeOutgoingVideoSource::initializeFromSource):
        (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
        (WebCore::RealtimeOutgoingVideoSource::RemoveSink):
        (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
        (WebCore::RealtimeOutgoingVideoSource::setSizeFromSource): Deleted.
        (WebCore::RealtimeOutgoingVideoSource::sendBlackFrames): Deleted.
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:

2017-05-31  Antti Koivisto  <antti@apple.com>

        CrashTracer: Regression : com.apple.WebKit.WebContent at STP responsible :: com.apple.WebCore: WebCore::SharedBuffer::data const + 11
        https://bugs.webkit.org/show_bug.cgi?id=172747
        <rdar://problem/32275314>

        Reviewed by Andreas Kling.

        Test: http/tests/subresource-integrity/empty-stylesheet-integrity-crash.html

        * loader/SubresourceIntegrity.cpp:
        (WebCore::matchIntegrityMetadata):

            If the resource body is empty CachedResource::resourceBuffer() may be null.

2017-05-31  Frederic Wang  <fwang@igalia.com>

        ScrollingStateScrollingNode::ChangedProperty::NumScrollingStateNodeBits is wrongly set
        https://bugs.webkit.org/show_bug.cgi?id=172349

        Reviewed by Simon Fraser.

        ScrollingStateScrollingNode::ChangedProperty::NumScrollingStateNodeBits was introduced in
        r133022 so that ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode
        know the number of bits use for properties in their parent class.

        In r172649, r210560, r185762 and r183702 new properties were added to
        ScrollingStateScrollingNode but NumScrollingStateNodeBits was not increased accordingly. This
        means that there are potential conflicts between these new properties and those of derived
        classes ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode. It is not
        clear how to write a test case reproducing such conflict, though.

        No new tests, this is a coding mistake but its effect is unclear.

        * page/scrolling/ScrollingStateNode.cpp:
        (WebCore::ScrollingStateNode::setPropertyChanged): Use hasChangedProperty and cast to
        64-bits integer before shifting.
        * page/scrolling/ScrollingStateNode.h: Add a comment to make clear NumStateNodeBits must
        remain at the last position. Ensure we have enough bits available.
        (WebCore::ScrollingStateNode::hasChangedProperty): Cast to 64-bits integer before shifting.
        * page/scrolling/ScrollingStateScrollingNode.h: Fix position of NumScrollingStateNodeBits and
        also add a similar comment.

2017-05-31  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r217603.

        This patch broke the internal builds.

        Reverted changeset:

        "Get <chrono> out of StdLibExtras.h"
        https://bugs.webkit.org/show_bug.cgi?id=172744
        http://trac.webkit.org/changeset/217603

2017-05-31  Simon Fraser  <simon.fraser@apple.com>

        Get <chrono> out of StdLibExtras.h
        https://bugs.webkit.org/show_bug.cgi?id=172744

        Reviewed by Saam Barati.

        Only bring in <chrono> and namespace std::literals::chrono_literals when necessary.

        * fileapi/FileReader.cpp:
        * inspector/InspectorOverlay.cpp:
        * loader/CrossOriginPreflightResultCache.cpp:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::freshnessLifetime):
        * page/ResourceUsageThread.cpp:
        (WebCore::ResourceUsageThread::threadBody):
        * page/cocoa/MemoryReleaseCocoa.mm:
        (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
        * platform/network/CacheValidation.cpp:
        (WebCore::computeFreshnessLifetimeForHTTPFamily):
        * platform/network/CacheValidation.h:

2017-05-31  Emilio Cobos Álvarez  <ecobos@igalia.com>

        Use the rare data's RenderStyle for display: contents.
        https://bugs.webkit.org/show_bug.cgi?id=172721

        Reviewed by Antti Koivisto.

        No new tests, no behavior change.

        * dom/Element.cpp:
        (WebCore::Element::hasDisplayContents):
        (WebCore::Element::storeDisplayContentsStyle):
        * dom/Element.h:
        * dom/ElementRareData.h:
        (WebCore::ElementRareData::ElementRareData):
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateElementRenderer):
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::resolveComposedTree):

2017-05-31  Per Arne Vollan  <pvollan@apple.com>

        LayoutTest media/video-orientation.html is failing
        https://bugs.webkit.org/show_bug.cgi?id=172648
        <rdar://problem/31322425>

        Reviewed by Eric Carlson.

        For videos with rotation tag set, the transform AVAssetTrack.preferredTransform applied to
        AVAssetTrack.naturalSize might return a CGSize instance with negative width or height.

        Covered by existing tests.

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

2017-05-30  Frederic Wang  <fwang@igalia.com>

        Include ScrollingTreeScrollingNode properties in ScrollingTreeFrameScrollingNode::dumpProperties
        https://bugs.webkit.org/show_bug.cgi?id=172287

        Reviewed by Simon Fraser.

        No new tests, only changes in dumped tree.

        * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
        (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties): Print properties of the parent class.

2017-05-30  Sam Weinig  <sam@webkit.org>

        Update test result after r217585.

        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
        (WebCore::JSTestNamedDeleterWithIndexedGetter::deleteProperty):
        (WebCore::JSTestNamedDeleterWithIndexedGetter::deletePropertyByIndex):

2017-05-30  Dan Bernstein  <mitz@apple.com>

        Fixed the build after r217588.

        * page/FrameView.h: Stopped exporting a function defined inline.

2017-05-30  Zalan Bujtas  <zalan@apple.com>

        ASSERTION FAILED: m_layoutPhase == InPostLayerPositionsUpdatedAfterLayout || m_layoutPhase == OutsideLayout
        https://bugs.webkit.org/show_bug.cgi?id=171501
        <rdar://problem/31977453>

        Reviewed by Simon Fraser.

        We should be able to paint as long as the tree is clean and we are in paintable state.

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

2017-05-30  Sam Weinig  <sam@webkit.org>

        Revert accidentally checked in change.

        * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
        * crypto/mac/CryptoDigestAlgorithm.h:

2017-05-30  Sam Weinig  <sam@webkit.org>

        [WebIDL] Generate named property deleters
        https://bugs.webkit.org/show_bug.cgi?id=172688

        Reviewed by Chris Dumez.

        Test: js/dom/named-property-deleter.html

        * WebCore.xcodeproj/project.pbxproj:
        Add new file, JSDOMAbstractOperations.h

        * bindings/js/JSDOMAbstractOperations.h: Added.
        (WebCore::isVisibleNamedProperty):
        Add an implementation of the abstract operation WebIDL calls the 'named property visibility algorithm'.
        It is used by many WebIDL algorithms, but currently I am only using this implementation for deleters.
        In the future, we should try and move the other property access generators to use it as well.

        * bindings/js/JSDOMStringMapCustom.cpp:
        (WebCore::JSDOMStringMap::deleteProperty): Deleted.
        (WebCore::JSDOMStringMap::deletePropertyByIndex): Deleted.
        * bindings/js/JSStorageCustom.cpp:
        (WebCore::JSStorage::deleteProperty): Deleted.
        (WebCore::JSStorage::deletePropertyByIndex): Deleted.
        Remove now generated deleteProperty and deletePropertyByIndex implementations.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateDeletePropertyCommon):
        (GenerateDeletePropertyDefinition):
        (GenerateDeletePropertyByIndexDefinition):
        (GenerateNamedDeleterDefinition):
        Added generation for named deleters. We generate both deleteProperty and deletePropertyByIndex.

        (InstanceOverridesDelete):
        Add predicate for whether the header should declare deleteProperty and deletePropertyByIndex.

        (GenerateHeader):
        Move property access hook declarations closer to each other. Use new InstanceOverridesDelete
        predicate for deleteProperty and deletePropertyByIndex.
 
        (GenerateImplementation):
        Add call to generate named deleter if one exists.

        (GenerateConstructorHelperMethods):
        Remove an old FIXME that that was no longer true, there are no more interfaces that inherit from
        an interface with [NoInterfaceObject].

        * dom/DOMStringMap.idl:
        Removes CustomDeleteProperty and sorts extended attributes.

        * dom/DatasetDOMStringMap.h:
        * dom/DatasetDOMStringMap.cpp:
        (WebCore::DatasetDOMStringMap::isSupportedPropertyName):
        Added. This is a bindings support function (much like supportedPropertyNames()) that is
        used JSDOMAbstractOperations.h's isVisibleNamedProperty.

        (WebCore::DatasetDOMStringMap::supportedPropertyNames):
        Convert to an early return.

        (WebCore::DatasetDOMStringMap::deleteNamedProperty):
        (WebCore::DatasetDOMStringMap::deleteItem): Deleted.
        Renamed deleteItem to deleteNamedProperty, which is the name the bindings use for deleter
        operations without an identifier.

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::sessionStorage):
        Fix incorrect indentation that bothered me.

        * storage/Storage.cpp:
        * storage/Storage.h:
        - Remove isDisabledByPrivateBrowsing(), which had no definition.
        - Add isSupportedPropertyName(), which the deleter code (via the isVisibleNamedProperty algorithm)
          needs.
        
        * storage/Storage.idl:
        Removes CustomDeleteProperty, sorts the extended attributes, adds 'deleter' special 
        to the removeItem operation and adds a commented out 'setter' special to the 'setItem'
        operation.

        * bindings/scripts/test/JS/JSTestObj.h:
        Update result for declarations moving around.

        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h: Added.
        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h: Added.
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h: Added.
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: Added.
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h: Added.
        * bindings/scripts/test/TestNamedDeleterNoIdentifier.idl: Added.
        * bindings/scripts/test/TestNamedDeleterThrowingException.idl: Added.
        * bindings/scripts/test/TestNamedDeleterWithIdentifier.idl: Added.
        * bindings/scripts/test/TestNamedDeleterWithIndexedGetter.idl: Added.
        Add new tests for named deleters.

2017-05-30  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: images dragged from Inspector to Desktop are named "Unknown.png"
        https://bugs.webkit.org/show_bug.cgi?id=141515
        <rdar://problem/9251308>

        Reviewed by Wenson Hsieh.

        * html/HTMLAttributeNames.in:

2017-05-30  Youenn Fablet  <youenn@apple.com>

        Add support for Certificate and IceCandidatePair stats
        https://bugs.webkit.org/show_bug.cgi?id=172734

        Reviewed by Geoff Garen.

        Covered by updated test.

        Adding support for these two stats in the IDL and in the libwebrtc binding code.

        * Modules/mediastream/RTCStatsReport.h:
        (WebCore::RTCStatsReport::IceCandidatePairStats::IceCandidatePairStats):
        (WebCore::RTCStatsReport::CertificateStats::CertificateStats):
        * Modules/mediastream/RTCStatsReport.idl:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::iceCandidatePairState):
        (WebCore::fillRTCIceCandidatePairStats):
        (WebCore::fillRTCCertificateStats):
        (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):

2017-05-30  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, add some comments to HKDF/PBKDF2 Mac implementations

        * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
        (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
        * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
        (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):

2017-05-30  Jeremy Jones  <jeremyj@apple.com>

        m_resourceSelectionTaskQueue tasks should be cleared when player is destroyed to prevent invalid state.
        https://bugs.webkit.org/show_bug.cgi?id=172726
        rdar://problem/30867764

        Reviewed by Eric Carlson.

        I haven't found a reproducible way to make a test case for this race condition.

        If m_player is cleared while there is an outstanding task in m_resourceSelectionTaskQueue,
        that task may assume m_player is not null and crash. It is better to cancel that task than
        to perform it part way with null checks.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::~HTMLMediaElement):
        (WebCore::HTMLMediaElement::clearMediaPlayer):

2017-05-30  Ryosuke Niwa  <rniwa@webkit.org>

        Only include DataDetectorsUI headers in iOS
        https://bugs.webkit.org/show_bug.cgi?id=172633

        Reviewed by David Kilzer.

        Enable data detectors only on iOS and not other variants of iOS.

        * editing/cocoa/DataDetection.h:
        * editing/cocoa/DataDetection.mm:
        * page/DragController.cpp:
        (WebCore::isDraggableLink):
        * platform/cocoa/DataDetectorsCoreSoftLink.h:
        * platform/cocoa/DataDetectorsCoreSoftLink.mm:
        * platform/spi/cocoa/DataDetectorsCoreSPI.h:
        * platform/spi/ios/DataDetectorsUISPI.h:
        * platform/spi/mac/DataDetectorsSPI.h:

2017-05-30  Chris Dumez  <cdumez@apple.com>

        REGRESSION(r215946): Can't reference a table cell in Google spreadsheet
        https://bugs.webkit.org/show_bug.cgi?id=172703
        <rdar://problem/32458086>

        Reviewed by Ryosuke Niwa.

        We updated getClientRects() to return an array of DOMRect objects instead of
        a ClientRectList type, to match the latest specification. As it turns out, this
        is not Web-compatible as some content (as Google Spreadsheet) relies on the
        return type having an item() operation.

        This patch re-introduces a DOMRectList type, with an item() operation. The
        DOMRectList name is currently not exposed to the Web as we do not know what's
        going to get specified yet (https://github.com/w3c/csswg-drafts/issues/1479).

        No new tests, updated existing tests.

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/DOMRect.h:
        * dom/DOMRectList.cpp: Copied from Source/WebCore/dom/DOMRect.cpp.
        (WebCore::DOMRectList::DOMRectList):
        (WebCore::DOMRectList::~DOMRectList):
        * dom/DOMRectList.h: Copied from Source/WebCore/dom/DOMRect.cpp.
        (WebCore::DOMRectList::create):
        (WebCore::DOMRectList::length):
        (WebCore::DOMRectList::item):
        * dom/DOMRectList.idl: Renamed from Source/WebCore/dom/DOMRect.cpp.
        * dom/Element.cpp:
        (WebCore::Element::getClientRects):
        * dom/Element.h:
        * dom/Element.idl:
        * dom/Range.cpp:
        (WebCore::Range::getClientRects):
        * dom/Range.h:
        * dom/Range.idl:
        * page/Page.cpp:
        (WebCore::Page::nonFastScrollableRects):
        (WebCore::Page::touchEventRectsForEvent):
        (WebCore::Page::passiveTouchEventListenerRects):
        * page/Page.h:
        * testing/Internals.cpp:
        (WebCore::Internals::inspectorHighlightRects):
        (WebCore::Internals::touchEventRectsForEvent):
        (WebCore::Internals::passiveTouchEventListenerRects):
        (WebCore::Internals::nonFastScrollableRects):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-05-30  Ali Juma  <ajuma@chromium.org>

        [CredentialManagement] Incorporate IDL updates from latest spec
        https://bugs.webkit.org/show_bug.cgi?id=172011

        Reviewed by Daniel Bates.

        This patch adds IDL definitions for the CredentialsContainer, CredentialsUserData and
        FederatedCredentials interfaces, the NavigatorCredentials partial interface, and the
        CredentialCreationOptions, CredentialRequestOptions, FederatedCredentialRequestOptions,
        and PasswordCredentialData dictionaries. It also deletes IDL definitions for the
        SiteBoundCredential interface and the SiteBoundCredentialData dictionary.

        Test: credentials/idlharness.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/credentials/BasicCredential.idl:
        * Modules/credentials/CredentialCreationOptions.h: Copied from Source/WebCore/Modules/credentials/PasswordCredential.cpp.
        * Modules/credentials/CredentialCreationOptions.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
        * Modules/credentials/CredentialRequestOptions.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
        * Modules/credentials/CredentialRequestOptions.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
        * Modules/credentials/CredentialUserData.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
        (WebCore::CredentialUserData::~CredentialUserData):
        * Modules/credentials/CredentialUserData.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredential.idl.
        * Modules/credentials/CredentialsContainer.cpp: Copied from Source/WebCore/Modules/credentials/PasswordCredential.cpp.
        (WebCore::CredentialsContainer::get):
        (WebCore::CredentialsContainer::store):
        (WebCore::CredentialsContainer::isCreate):
        (WebCore::CredentialsContainer::preventSilentAccess):
        * Modules/credentials/CredentialsContainer.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredential.h.
        (WebCore::CredentialsContainer::create):
        (WebCore::CredentialsContainer::CredentialsContainer):
        * Modules/credentials/CredentialsContainer.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredential.idl.
        * Modules/credentials/FederatedCredential.cpp: Copied from Source/WebCore/Modules/credentials/SiteBoundCredential.cpp.
        (WebCore::FederatedCredential::FederatedCredential):
        (WebCore::FederatedCredential::~FederatedCredential):
        * Modules/credentials/FederatedCredential.h: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredential.h.
        (WebCore::FederatedCredential::create):
        (WebCore::FederatedCredential::provider):
        (WebCore::FederatedCredential::protocol):
        * Modules/credentials/FederatedCredential.idl: Copied from Source/WebCore/Modules/credentials/BasicCredential.idl.
        * Modules/credentials/FederatedCredentialInit.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
        * Modules/credentials/FederatedCredentialInit.idl: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.idl.
        * Modules/credentials/FederatedCredentialRequestOptions.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
        * Modules/credentials/FederatedCredentialRequestOptions.idl: Added.
        * Modules/credentials/NavigatorCredentials.cpp: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredential.cpp.
        (WebCore::NavigatorCredentials::NavigatorCredentials):
        (WebCore::NavigatorCredentials::~NavigatorCredentials):
        (WebCore::NavigatorCredentials::supplementName):
        (WebCore::NavigatorCredentials::credentials):
        (WebCore::NavigatorCredentials::from):
        * Modules/credentials/NavigatorCredentials.h: Copied from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
        * Modules/credentials/NavigatorCredentials.idl: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredential.idl.
        * Modules/credentials/PasswordCredential.cpp:
        (WebCore::PasswordCredential::PasswordCredential):
        (WebCore::PasswordCredential::~PasswordCredential):
        * Modules/credentials/PasswordCredential.h:
        (WebCore::PasswordCredential::create):
        (WebCore::PasswordCredential::password):
        (WebCore::PasswordCredential::setIdName): Deleted.
        (WebCore::PasswordCredential::idName): Deleted.
        (WebCore::PasswordCredential::setPasswordName): Deleted.
        (WebCore::PasswordCredential::passwordName): Deleted.
        (WebCore::PasswordCredential::setAdditionalData): Deleted.
        (WebCore::PasswordCredential::additionalData): Deleted.
        * Modules/credentials/PasswordCredential.idl:
        * Modules/credentials/PasswordCredentialData.h: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredentialData.h.
        * Modules/credentials/PasswordCredentialData.idl: Renamed from Source/WebCore/Modules/credentials/SiteBoundCredentialData.idl.
        * WebCore.xcodeproj/project.pbxproj:

2017-05-30  Alex Christensen  <achristensen@webkit.org>

        Update libwebrtc configuration
        https://bugs.webkit.org/show_bug.cgi?id=172727

        Reviewed by Geoffrey Garen.

        * Configurations/FeatureDefines.xcconfig:

2017-05-30  Mark Lam  <mark.lam@apple.com>

        convertEnumerationToJS() should not stash ASCIILiteral strings in NeverDestroyed arrays.
        https://bugs.webkit.org/show_bug.cgi?id=172724
        <rdar://problem/31193201>

        Reviewed by Chris Dumez.

        Use MAKE_STATIC_STRING_IMPL instead, which is guaranteed to be thread-safe and
        satisfies the promise of immortality promised by NeverDestroyed (while ASCIILiteral
        does not always satisfy this promise).

        Also converted the ASSERT in convertEnumerationToJS() to a RELEASE_ASSERT as a
        debugging aid to check if it is ever passed an invalid enumerationValue.

        No new tests because this is a speculative fix for an issue observed in the wild
        whose root cause is not known yet.  This patch also adds a release assert to
        gather more info about the nature of the issue.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateEnumerationImplementationContent):

        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        (WebCore::convertEnumerationToJS):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::convertEnumerationToJS):
        * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
        (WebCore::convertEnumerationToJS):
        * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
        (WebCore::convertEnumerationToJS):
        - re-baselined these test results.

2017-05-30  Said Abou-Hallawa  <sabouhallawa@apple.com>

        REGRESSION(r216882): No image decoding is needed if the BitmapImage is created with a NativeImage
        https://bugs.webkit.org/show_bug.cgi?id=172670

        Reviewed by Tim Horton.

        Test: fast/images/large-image-webkit-canvas.html

        Check whether the BitmapImage has created an ImageDecoder before trying 
        to decode its image frame.

        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::shouldUseAsyncDecoding):

2017-05-30  Youenn Fablet  <youenn@apple.com>

        RealtimeOutgoingVideoSource should not rotate muted frames
        https://bugs.webkit.org/show_bug.cgi?id=172659

        Reviewed by Eric Carlson.

        Test: webrtc/video-rotation.html

        When sending black frames, it is unnecessary to rotate frames.
        Instead, it is better to create frame with the expected width and height.
        Making sure libwebrtc rotated images are not null, as only YUV rotation is supported.

        Adding internals API to test part of that code path.
        Full coverage should be added when mock source is producing YUV images.

        * Modules/mediastream/PeerConnectionBackend.h:
        (WebCore::PeerConnectionBackend::applyRotationForOutgoingVideoSources):
        * Modules/mediastream/RTCPeerConnection.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::sendBlackFrames):
        (WebCore::RealtimeOutgoingVideoSource::sendFrame):
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
        * testing/Internals.cpp:
        (WebCore::Internals::Internals):
        (WebCore::Internals::applyRotationForOutgoingVideoSources):
        (WebCore::Internals::setCameraMediaStreamTrackOrientation):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-05-30  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed typo correction.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::logFrameNavigation): I used an extra colon in my comment.

2017-05-30  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r217515): Correct iterator invalidation bug (AGAIN)
        https://bugs.webkit.org/show_bug.cgi?id=172722
        <rdar://problem/32462876>

        Reviewed by Zalan Bujtas.

        Over-enthusiastic clean-up during r217515 re-introduced a bug caused by holding a reference
        to an iterator that gets invalidated while handling the frame navigation. This patch returns
        to the copy/set behavior used prior to r217515. 

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::logFrameNavigation): Make a copy of the returned value, since
        the iterator will be invalidated during the function call. Then set the copy back in the data
        store with the updated counts.

2017-05-30  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] TestWebKitAPI: SHOULD NEVER BE REACHED in WebCore::cairoSurfaceSize
        https://bugs.webkit.org/show_bug.cgi?id=172699

        Reviewed by Brent Fulgham.

        Tests: WebCore.BitmapImageEmptyFrameTest in TestWebKitAPI

        * platform/graphics/cairo/CairoUtilities.cpp:
        (WebCore::cairoSurfaceSize): Added a case for win32 surface type.

2017-05-30  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE][GSTREAMER_GL] Do not use cairo to copy video textures to an accelerated canvas
        https://bugs.webkit.org/show_bug.cgi?id=172542

        Reviewed by Žan Doberšek.

        When drawing gstreamer-gl video frames into an accelerated canvas, we are currently using cairo to copy
        the video textures into a new texture that will be painted into de destination canvas. While this eases
        the code, it doesn't allow us to control the copy process. This is a problem because in order to use
        gstreamer-gl properly, we will need to perform colorspace transformations during the copy. So, remove
        this cairo copy and use VideoTextureCopierGStreamer instead.

        The usage of VideoTextureCopierGStreamer is pretty much the same than in the webgl case, except that
        no destination texture is provided. For that case, add a custom texture to hold the result that can
        be requested after the copy.

        Covered by existent tests.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
        (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
        (WebCore::MediaPlayerPrivateGStreamerBase::prepareContextForCairoPaint): Deleted.
        (WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface): Deleted.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        (WebCore::MediaPlayerPrivateGStreamerBase::gstGLDisplay):
        * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
        (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
        (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
        (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
        * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
        (WebCore::VideoTextureCopierGStreamer::resultTexture):

2017-05-29  Antti Koivisto  <antti@apple.com>

        Crash on display-contents-replaced-001.html
        https://bugs.webkit.org/show_bug.cgi?id=172596

        Reviewed by Andreas Kling.

        This is crashing because some code can't handle display:contents on form controls. Turns
        out the draft specification tell us to disable it for them in any case.

        See https://drafts.csswg.org/css-display-3/#unbox

        * css/StyleResolver.cpp:
        (WebCore::hasEffectiveDisplayNoneForDisplayContents):

            For certain HTML elements (replaced elements, form controls) display:contents should
            behave like display:none.
            Also disable it for SVG and MathML elements.

        (WebCore::StyleResolver::adjustRenderStyle):

            Also compute to display:none when there is no associated element (pseudos etc).

2017-05-30  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] RSA-OAEP support
        https://bugs.webkit.org/show_bug.cgi?id=171222

        Reviewed by Michael Catanzaro.

        Add RSA-OAEP support for configurations that use libgcrypt.

        The encryption operation embeds the plain-text data into a data s-expression,
        specifying OAEP as the padding method of choice and also adding information
        about the hash algorithm and any label data. This is then passed to the
        gcry_pk_encrypt() call together with the provided key, returning the enc-val
        s-expression containing the resulting cipher text. That's retrieved from the
        relevant MPI and returned to the caller.

        The decryption operation embeds the cipher-text data into an enc-val
        s-expression, again specifying the hash algorithm and also filling in any
        label data. This is then passed, along with the key, to the gcry_pk_decrypt()
        call. The returned data s-expression contains the decrypted plain-text data
        inside the 'value' MPI, from which this data is extracted and returned to the
        caller.

        No new tests -- the revelant tests are passing and are unskipped, apart from
        the ones using PKSC#8 and SPKI formats.

        * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
        (WebCore::hashAlgorithmName):
        (WebCore::mpiData):
        (WebCore::gcryptEncrypt):
        (WebCore::gcryptDecrypt):
        (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
        (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):

2017-05-30  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed follow-up to r217546. Address some review comments that I forgot about.

        * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
        (WebCore::gcryptEncrypt): Use quotations when referencing s-expression names in
        comments to avoid confusion.
        (WebCore::gcryptDecrypt): Ditto.

2017-05-30  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] RSAES-PKCS1-v1_5 support
        https://bugs.webkit.org/show_bug.cgi?id=171219

        Reviewed by Michael Catanzaro.

        Add RSAES-PKCS1-v1_5 support for configurations that use libgcrypt.

        The encryption operation embeds the plain-text data into a data s-expression,
        specifying PKCS#1 as the padding method of choice. That's passed to the
        gcry_pk_encrypt() call together with the specified key. The returned enc-val
        expression contains the 'a' MPI from which the data is extracted and returned.

        The decryption operation goes in reverse -- the cipher-text data is embedded
        into an enc-val s-expression that again also specifies PKCS#1 as the padding
        method. The s-expression is passed to gcry_pk_decrypt() together with the
        specified key. The returned data s-expression contains the decrypted text
        inside the 'value' parameter, so the data is extracted from that and returned
        to the caller.

        No new tests -- the revelant tests are passing and are unskipped, apart from
        the ones using PKCS#8 and SPKI formats.

        * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
        (WebCore::mpiData):
        (WebCore::gcryptEncrypt):
        (WebCore::gcryptDecrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt):

2017-05-30  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] RSASSA-PKCS1-v1_5 support
        https://bugs.webkit.org/show_bug.cgi?id=171220

        Reviewed by Michael Catanzaro.

        Add RSASSA-PKSC1-V_15 support for configurations that use libgcrypt.

        The signing operation first digests data with the specified hash algorithm.
        That's then embedded in the data s-expression. That's then passed to the
        gcry_pk_sign() call together with the specified key, returning a sig-val
        s-expression containing the signature. The signature data is then retrieved
        from the relevant MPI and returned to the caller.

        The verification operation first digests data with the specified hash
        algorithm. That's then embedded in the data s-expression. A sig-val
        s-expression is constructed, embedding the signature data. The data and
        sig-val s-expressions are passed to the gcry_sexp_verify() call which returns
        the resulting error code. The verification succeeds if the returned value is
        GPG_ERR_NO_ERROR, fails if it's GPG_ERR_BAD_SIGNATURE, or errors out with an
        OperationError otherwise.

        No new tests -- the revelant tests are passing and are unskipped, apart from
        the ones using PKCS#8 and SPKI formats.

        * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
        (WebCore::hashCryptoDigestAlgorithm):
        (WebCore::hashAlgorithmName):
        (WebCore::mpiData):
        (WebCore::gcryptSign):
        (WebCore::gcryptVerify):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify):

2017-05-29  Emilio Cobos Álvarez  <ecobos@igalia.com>

        Use the parent box style to adjust RenderStyle for alignment.
        https://bugs.webkit.org/show_bug.cgi?id=172215

        Reviewed by Antti Koivisto.

        The css-flexbox spec defined align-self in terms of the parent
        element, which is what this code did.

        The css-align spec defines these properties in terms of the style of
        the containing box instead, which means display: contents styles
        should not be used for this adjustment, but the parent box style
        instead.

        For example, align-items is defined as:

        > This property specifies the default align-self for all of the boxes
        > (including anonymous boxes) participating in this box’s formatting
        > context.

        Note that the css-align spec was recently updated to align (no pun
        intended) with Gecko, and make the |auto| value compute to itself.
        This patch puts us in a more recent spec than before, but not totally
        up-to-date.

        Tests: imported/w3c/web-platform-tests/css/css-display-3/display-contents-alignment-001.html
               imported/w3c/web-platform-tests/css/css-display-3/display-contents-alignment-002.html

        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::adjustRenderStyle):
        (WebCore::StyleResolver::adjustStyleForAlignment):

2017-05-28  Dan Bernstein  <mitz@apple.com>

        [Xcode] ALWAYS_SEARCH_USER_PATHS is set to YES
        https://bugs.webkit.org/show_bug.cgi?id=172691

        Reviewed by Tim Horton.

        * Configurations/Base.xcconfig: Set ALWAYS_SEARCH_USER_PATHS to NO.
        * WebCore.xcodeproj/project.pbxproj: Added DateTimeChooser.h, DateTimeChooserClient.h,
          PerformanceMark.h, PerformanceMeasure.h, SVGUnknownElement.h, and MathMLUnknownElement.h
          to the WebCore target.

2017-05-28  Sam Weinig  <sam@webkit.org>

        [WebIDL] @@iterator should only be accessed once when disambiguating a union type
        https://bugs.webkit.org/show_bug.cgi?id=172684

        Reviewed by Yusuke Suzuki.

        WebIDL specifies that when determining if the value you are converting to a union
        is a sequence, you must get the @@iterator property and, should it exist, use it
        to iterate the sequence. While we correctly accessing the property to make the 
        determination, we were not passing it into the sequence conversion code, and thus
        the sequence conversion code re-accessed it, which is observable and wrong.

        This patch pipes the @@iterator method through the sequence conversion code to avoid
        this.

        Test: js/dom/sequence-in-union-iterator-access.html

        * bindings/js/JSDOMConvertSequences.h:
        (WebCore::Detail::GenericSequenceConverter::convert):
        (WebCore::Detail::NumericSequenceConverter::convertArray):
        (WebCore::Detail::NumericSequenceConverter::convert):
        (WebCore::Detail::SequenceConverter::convertArray):
        (WebCore::Detail::SequenceConverter::convert):
        (WebCore::Detail::SequenceConverter<IDLLong>::convert):
        (WebCore::Detail::SequenceConverter<IDLFloat>::convert):
        (WebCore::Detail::SequenceConverter<IDLUnrestrictedFloat>::convert):
        (WebCore::Detail::SequenceConverter<IDLDouble>::convert):
        (WebCore::Detail::SequenceConverter<IDLUnrestrictedDouble>::convert):
        (WebCore::Converter<IDLSequence<T>>::convert):
        (WebCore::Converter<IDLFrozenArray<T>>::convert):
        Add variants of convert that take a JSObject* (sequence) / JSValue (iterator method)
        rather than just the JSValue (sequence). To avoid too much duplication, split some
        parts of SequenceConverter and NumericSequenceConverter up so they could be reused.

        * bindings/js/JSDOMConvertUnion.h:
        - Fix incorrect step 3 (WebIDL got updated at some point and we didn't notice) to remove
          records.
        - Update sequence and FrozenArray checking/conversion to get the iterator method and pass
          it along, using the new ConditionalSequenceConverter helper which forwards to the new
          sequence converters that accept the iterator method.

2017-05-27  Chris Dumez  <cdumez@apple.com>

        imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form_attribute.html is crashing
        https://bugs.webkit.org/show_bug.cgi?id=172472
        <rdar://problem/32334831>

        Reviewed by Ryosuke Niwa.

        Fix assertion hit when running imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form_attribute.html.

        When the form was removed from the document, A descendant would try to find a new form owner in the document. If the descendant had 
        a form content attribute and there was another form in the document with this ID, then we would erroneously associate the descendant with
        that other form, even though that descendant is being disconnected. This is because when the form with the given id is removed, we
        notify the IdTargetObservers of the change. In this case, the form control is an IdTargetObserver and gets notified after
        removedFrom() has been called on the form but *before* removedFrom() has been called on its descendant form control. As a result, the
        form control still thinks it is in the tree (i.e. isConnected() wrongly returns true) and we make the wrong decision and try to
        associate it with another form in the document.

        To address the problem, we leverage the fact that when a form element is being removed, it already notifies its associated form
        controls that it is being removed. When it does, we make sure to clear the control's id observer if the form is its ancestor.
        The ID observer is no longer needed beyond this point since the control is now disconnected from the document, and the ID observer
        callback would erroneously associate it with another form element in the document of the same ID because isConnected() still returns
        true at that point.
        As a result, the control's form owner is kept unchanged, which is the right thing to do here, since it is its ancestor, even
        though both are detached.

        Test: fast/dom/HTMLFormElement/form-removal-duplicate-id-crash.html

        * dom/ContainerNode.h:
        (WebCore::Node::rootNode):
        Inline rootNode to avoid an extra function call in the fast path case. For the slow path, we now
        call traverseToRootNode() to avoid duolicating logic.

        * dom/Node.cpp:
        (WebCore::Node::traverseToRootNode):
        Add a traverseToRootNode() method which gets the root node by traversing the ancestors. This logic was duplicated in 3 places:
        - Slow path in Node::rootNode()
        - computeRootNode() in FormAssociatedElement.cpp
        - findRoot() in HTMLFormElement.cpp
        They are now consolidated in a single place to avoid duplication.

        * dom/Node.h:
        * html/FormAssociatedElement.cpp:
        (WebCore::FormAssociatedElement::removedFrom):
        Just simplify the logic a bit:
        - Clear the id observer (i.e. m_formAttributeTargetObserver) no matter what. Since the element is no longer part of the document,
          it is no longer needed. We would previously have checks that would basically avoid resetting m_formAttributeTargetObserver to
          null if it is already null. Settign m_formAttributeTargetObserver to null is cheap so there is no reason for those checks. Those
          checks were also confusing because they made it look like we would sometimes keep on id observer after being removed from the
          document.
        - Use new traverseToRootNode() utility function (no behavior change)
        - Drop unnecessary |element| local variable

        (WebCore::FormAssociatedElement::formOwnerRemovedFromTree):
        - Rename to formOwnerRemovedFromTree() to make it clear that it is the element's form owner that is removed, and not just any form.
        - As we traverse the tree up to find the root, also check if we find the form owner. If we do, clear the id observer since we are
          effectively detached from the document and return early since there is no need to reset our form owner in this case.

        * html/FormAssociatedElement.h:
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::removedFrom):
        - Use new traverseToRootNode() utility function (no behavior change)

2017-05-27  Yusuke Suzuki  <utatane.tea@gmail.com>

        [DOMJIT] Move DOMJIT patchpoint infrastructure out of domjit
        https://bugs.webkit.org/show_bug.cgi?id=172260

        Reviewed by Filip Pizlo.

        * ForwardingHeaders/jit/Snippet.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpoint.h.
        * ForwardingHeaders/jit/SnippetParams.h: Renamed from Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpointParams.h.
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        (GenerateImplementation):
        * bindings/scripts/test/JS/JSTestDOMJIT.h:
        * domjit/DOMJITCheckDOM.h:
        (WebCore::DOMJIT::checkDOM):
        * domjit/DOMJITHelpers.h:
        (WebCore::DOMJIT::toWrapper):
        * domjit/JSDocumentDOMJIT.cpp:
        (WebCore::checkSubClassSnippetForJSDocument):
        (WebCore::DocumentDocumentElementDOMJIT::callDOMGetter):
        (WebCore::DocumentBodyDOMJIT::callDOMGetter):
        (WebCore::checkSubClassPatchpointForJSDocument): Deleted.
        * domjit/JSDocumentFragmentDOMJIT.cpp:
        (WebCore::checkSubClassSnippetForJSDocumentFragment):
        (WebCore::checkSubClassPatchpointForJSDocumentFragment): Deleted.
        * domjit/JSElementDOMJIT.cpp:
        (WebCore::checkSubClassSnippetForJSElement):
        (WebCore::checkSubClassPatchpointForJSElement): Deleted.
        * domjit/JSEventDOMJIT.cpp:
        (WebCore::checkSubClassSnippetForJSEvent):
        (WebCore::checkSubClassPatchpointForJSEvent): Deleted.
        * domjit/JSNodeDOMJIT.cpp:
        (WebCore::checkSubClassSnippetForJSNode):
        (WebCore::createCallDOMGetterForOffsetAccess):
        (WebCore::NodeFirstChildDOMJIT::callDOMGetter):
        (WebCore::NodeLastChildDOMJIT::callDOMGetter):
        (WebCore::NodeNextSiblingDOMJIT::callDOMGetter):
        (WebCore::NodePreviousSiblingDOMJIT::callDOMGetter):
        (WebCore::NodeParentNodeDOMJIT::callDOMGetter):
        (WebCore::NodeNodeTypeDOMJIT::callDOMGetter):
        (WebCore::NodeOwnerDocumentDOMJIT::callDOMGetter):
        (WebCore::checkSubClassPatchpointForJSNode): Deleted.

2017-05-26  Simon Fraser  <simon.fraser@apple.com>

        getComputedStyle returns percentage values for left / right / top / bottom
        https://bugs.webkit.org/show_bug.cgi?id=29084

        Reviewed by Zalan Bujtas.
        
        Fix getComputedStyle() to return pixel values for left / right / top / bottom, per spec.

        This is mostly a merge of https://codereview.chromium.org/13871003/.

        Behavior now matches Chrome and Firefox.

        Test: fast/css/getComputedStyle/getComputedStyle-offsets.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::getOffsetComputedLength):
        (WebCore::getOffsetUsedStyleRelative):
        (WebCore::getOffsetUsedStyleAbsolute):
        (WebCore::positionOffsetValue):
        (WebCore::positionOffsetValueIsRendererDependent):
        (WebCore::isNonReplacedInline):
        (WebCore::isLayoutDependent):
        (WebCore::ComputedStyleExtractor::propertyValue):

2017-05-27  Zalan Bujtas  <zalan@apple.com>

        enclosingIntRect returns a rect with -1 width/height when the input FloatRect overflows integer.
        https://bugs.webkit.org/show_bug.cgi?id=172676

        Reviewed by Simon Fraser.

        Clamp integer values soon after the enclosing rectangle is resolved.

        * platform/graphics/FloatRect.cpp:
        (WebCore::enclosingIntRect):

2017-05-26  Joseph Pecoraro  <pecoraro@apple.com>

        Simply some NSNumber usage
        https://bugs.webkit.org/show_bug.cgi?id=172677

        Reviewed by Sam Weinig.

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper _addAccessibilityObject:toTextMarkerArray:]):
        (AXAttributeStringSetFont):
        (AXAttributeStringSetStyle):
        * accessibility/mac/AXObjectCacheMac.mm:
        (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (AXAttributeStringSetStyle):
        (AXAttributeStringSetSpelling):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
        * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::levelIndicatorFor):

2017-05-26  Youenn Fablet  <youenn@apple.com>

        WebRTC stats should be in milliseconds
        https://bugs.webkit.org/show_bug.cgi?id=172644

        Reviewed by Eric Carlson.

        Covered by updated tests.

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

2017-05-26  Sam Weinig  <sam@webkit.org>

        [WebIDL] Overloaded functions should throw this object check exception before argument check exception
        https://bugs.webkit.org/show_bug.cgi?id=172480

        Reviewed by Chris Dumez.

        - Codifies naming for both parts of the operation/attribute function implementation:
          - The 'trampoline' which is the actual host function and simply calls IDLOperation,
            IDLOperationReturningPromise or IDLAttribute.
          - The 'body' which is where argument checking and calling into the implementation
            takes place.
        - Made it so all operations, including static ones, use the trampoline / body model,
          simplifying code generation. The one exception is for overloaded operations, which
          now have a trampoline and body for the dispatcher, and only bodies for all the 
          overloads. This is what fixes the bug, since now that the dispatcher has a trampoline,
          it can do the correct this object checking via IDLOperation / IDLOperationReturningPromise.
        - Split out code generation for trampoline and body into separate subroutines and 
          simplified their implementations.
        - Changed GenerateOverloadDispatcher to only generate the body of the function, leaving it
          up to the caller to generate the signature, braces and conditionals if needed.
        - Made more subroutines take an output array and indent, in support of future endeavors
          that will need that support.
        - Remove unnecessary #includes of <runtime/Error.h>, which gets included already by virtue
          of JSDOMExceptionHandling.h

        Test: js/dom/overloaded-operation-exception-order.html

        * bindings/js/JSDOMOperation.h:
        * bindings/js/JSDOMOperationReturningPromise.h:
        Add no-op static versions of the bouncer functions.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateOverloadDispatcher):
        (GenerateOperationTrampolineDefinition):
        (GenerateOperationBodyDefinition):
        (GenerateOperationDefinition):
        (GenerateSerializerDefinition):
        (GenerateLegacyCallerDefinitions):
        (GenerateLegacyCallerDefinition):
        (GenerateArgumentsCountCheck):
        (GenerateParametersCheck):
        (GenerateImplementationFunctionCall):
        (GenerateImplementationCustomFunctionCall):
        (GenerateConstructorDefinitions):
        (GenerateConstructorDefinition):

        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        * bindings/scripts/test/JS/JSMapLike.cpp:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        * bindings/scripts/test/JS/JSTestException.cpp:
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestObj.h:
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        Update test results.

2017-05-26  Brent Fulgham  <bfulgham@apple.com>

        [WK2] Address thread safety issues with ResourceLoadStatistics
        https://bugs.webkit.org/show_bug.cgi?id=172519
        <rdar://problem/31707642>

        Reviewed by Chris Dumez.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::setStatisticsQueue): Added.
        (WebCore::ResourceLoadObserver::clearInMemoryStore): Only interact with the HashTable on the statistics queue.
        (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore): Ditto.
        (WebCore::ResourceLoadObserver::logFrameNavigation): Ditto.
        (WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
        (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
        (WebCore::ResourceLoadObserver::logUserInteraction): Ditto.
        (WebCore::ResourceLoadObserver::clearUserInteraction): Protect HashTable while reading.
        (WebCore::ResourceLoadObserver::hasHadUserInteraction): Ditto.
        (WebCore::ResourceLoadObserver::setPrevalentResource): Ditto.
        (WebCore::ResourceLoadObserver::isPrevalentResource): Ditto.
        (WebCore::ResourceLoadObserver::clearPrevalentResource): Ditto.
        (WebCore::ResourceLoadObserver::setGrandfathered): Ditto.
        (WebCore::ResourceLoadObserver::isGrandfathered): Ditto.
        (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin): Only interact with the HashTable on the statistics queue.
        (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin): Ditto.
        (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo): Ditto.
        (WebCore::ResourceLoadObserver::fireDataModificationHandler): ASSERT this is only called from the main thread, since this is
        only meant to be used as part of the testing harness.
        (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler): Ditto.
        (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler): Ditto.
        * loader/ResourceLoadObserver.h:
        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::ResourceLoadStatisticsStore::isPrevalentResource): Protect HashTable while using it.
        (WebCore::ResourceLoadStatisticsStore::ensureResourceStatisticsForPrimaryDomain): Ditto.
        (WebCore::ResourceLoadStatisticsStore::setResourceStatisticsForPrimaryDomain): Ditto.
        (WebCore::ResourceLoadStatisticsStore::createEncoderFromData): ASSERT this isn't being done on the main thread, and
        protect HashTable while using it.
        (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder): Ditto.
        (WebCore::ResourceLoadStatisticsStore::clearInMemory): Ditto.
        (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): Ditto.
        (WebCore::ResourceLoadStatisticsStore::statisticsForOrigin): Protect HashTable while using it.
        (WebCore::ResourceLoadStatisticsStore::takeStatistics): Ditto.
        (WebCore::ResourceLoadStatisticsStore::mergeStatistics): Ditto.
        (WebCore::ResourceLoadStatisticsStore::setNotificationCallback): Use WTF::Function.
        (WebCore::ResourceLoadStatisticsStore::setShouldPartitionCookiesCallback): Ditto.
        (WebCore::ResourceLoadStatisticsStore::setWritePersistentStoreCallback): Ditto.
        (WebCore::ResourceLoadStatisticsStore::setGrandfatherExistingWebsiteDataCallback): Ditto.
        (WebCore::ResourceLoadStatisticsStore::fireDataModificationHandler): ASSERT this is not called on the main thread,
        but dispatch the registered handler on the main thread.
        (WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler): Ditto.
        (WebCore::ResourceLoadStatisticsStore::processStatistics): ASSERT this isn't being done on the main thread, and
        protect the HashTable while using it. Also switch to WTF::Function.
        (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction): Make const correct.
        (WebCore::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor): Protect HashTable while using it.
        (WebCore::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords): Ditto.
        (WebCore::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore): Ditto.
        (WebCore::ResourceLoadStatisticsStore::shouldRemoveDataRecords): Make const correct. ASSERT this is not being called
        on the main thread.
        (WebCore::ResourceLoadStatisticsStore::dataRecordsBeingRemoved): ASSERT this is not being called on the main thread.
        (WebCore::ResourceLoadStatisticsStore::dataRecordsWereRemoved): Ditto.
        (WebCore::ResourceLoadStatisticsStore::statisticsLock): Added.
        * loader/ResourceLoadStatisticsStore.h:

2017-05-26  Joseph Pecoraro  <pecoraro@apple.com>

        JSContext Inspector: Improve the reliability of automatically pausing in auto-attach
        https://bugs.webkit.org/show_bug.cgi?id=172664
        <rdar://problem/32362933>

        Reviewed by Matt Baker.

        * inspector/InspectorController.h:
        * page/PageDebuggable.cpp:
        (WebCore::PageDebuggable::connect):
        * page/PageDebuggable.h:
        Pass an immediatelyPause boolean on to the controller.

        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::connectFrontend):
        (WebCore::InspectorController::disconnectFrontend):
        (WebCore::InspectorController::disconnectAllFrontends):
        Manage should immediately pause state.

        (WebCore::InspectorController::frontendInitialized):
        When initialized, trigger a pause if requested.

2017-05-26  Don Olmstead  <don.olmstead@am.sony.com>

        [CMake] Consolidate CMake code related to FreeType
        https://bugs.webkit.org/show_bug.cgi?id=172656

        Reviewed by Michael Catanzaro.

        No new tests. No change in behavior.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * platform/FreeType.cmake: Added.

2017-05-26  Sam Weinig  <sam@webkit.org>

        [WebIDL] Another bindings cleanup pass, this time focusing on attributes
        https://bugs.webkit.org/show_bug.cgi?id=172619

        Reviewed by Chris Dumez.

        - Moved attribute getter / setter generation into their own subroutines.
        - As was done for operations, moved trampoline functions for attributes
          below their implementation functions to avoid unseemly forward declaration.
        - Changed to place the getter and setter for an attribute next to each other,
          rather than having all the getters and then all the setters.
        - Moved JSFoo::getConstructor and JSFoo::getNamedConstructor up to be with other
          member functions.
        - Fix an issue where we were generating a setJSFooConstructor function and not
          installing it anywhere. Now we always generate either both the getter and setter
          or neither for the constructor property. Also moved their definition to just above
          all the attributes, rather than the odd placements of between the getters and
          setters which is where they had been.
        - Made InstanceNeedsVisitChildren a complete answer, rather than relying on some
          loop of the attributes to update needsVisitChildren bit.
        - Move use of passing conditionals when adding headers.

        * bindings/scripts/CodeGeneratorJS.pm:
        (InstanceNeedsVisitChildren):
        (GenerateHeader):
        (GenerateImplementation):
        (GenerateAttributeGetterDefinition):
        (GenerateAttributeSetterDefinition):
        (NeedsConstructorProperty):

        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        * bindings/scripts/test/JS/JSMapLike.cpp:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        * bindings/scripts/test/JS/JSTestException.cpp:
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestObj.h:
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        Update test results.

2017-05-26  Don Olmstead  <don.olmstead@am.sony.com>

        [CMake] Wrap CODE_GENERATOR_PREPROCESSOR_EXECUTABLE on Windows hosts
        https://bugs.webkit.org/show_bug.cgi?id=172553

        Reviewed by Brent Fulgham.

        No new tests. No change in behavior.

        * bindings/scripts/preprocessor.pm:
        (applyPreprocessor): Use shellwords() instead of splitting
        preprocessor command by space. Combine it back in open3() call on
        Windows to work around Cygwin-specific issue.

2017-05-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the build using the latest SDK

        Add deprecation guards around newly introduced (and deprecated) SPI.

        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]):

2017-05-26  Beth Dakin  <bdakin@apple.com>

        Media documents inside iframes should not get controls in the TouchBar unless the 
        video is playing
        https://bugs.webkit.org/show_bug.cgi?id=172620
        -and corresponding-
        rdar://problem/32165477

        Reviewed by Jon Lee.

        Media documents get to return early with true, but that should only apply to 
        mainframe media documents. 
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::canShowControlsManager):

2017-05-26  Youenn Fablet  <youenn@apple.com>

        Minor clean-up related to DocumentThreadableLoader redirections
        https://bugs.webkit.org/show_bug.cgi?id=172647

        Reviewed by Chris Dumez.

        No change of behavior.

        Decrementing m_options redirect count directly instead of using an
        additional counter.

        To compare whether two URLs are same-origin, use scheme+host+port check
        as per the spec.
        This is fine as only the initial origin may have specific rules and we
        are using the scheme+host+port checks when already being gone to
        another origin.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::redirectReceived):
        * loader/DocumentThreadableLoader.h:
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):

2017-05-26  Youenn Fablet  <youenn@apple.com>

        Fix memory leaks in MediaSampleAVFObjC::create
        https://bugs.webkit.org/show_bug.cgi?id=172600

        Reviewed by Eric Carlson.

        No change of behavior.

        * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
        (WebCore::MediaSampleAVFObjC::createImageSample):

2017-05-26  Manuel Rego Casasnovas  <rego@igalia.com>

        [css-grid] Add support for orthogonal positioned grid items
        https://bugs.webkit.org/show_bug.cgi?id=172591

        Reviewed by Sergio Villar Senin.

        This patch adds support for positioned grid items with orthogonal flows.
        Basically it just needs to check if the item is orthogonal to use
        the column or row offset as logical left or top depending on the case.

        Tests: imported/w3c/web-platform-tests/css/css-grid-1/abspos/orthogonal-positioned-grid-items-***.html

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

2017-05-25  Emilio Cobos Álvarez  <ecobos@igalia.com>

        Don't reset m_hasDisplayContents on ElementRareData::resetComputedStyle.
        https://bugs.webkit.org/show_bug.cgi?id=172503

        Reviewed by Antti Koivisto.

        We use that bit of information to determine whether we need to tear
        down the renderers of a display: contents subtree, so better for it to
        not change until the render tree is updated.

        In practice, we may want to remove that bit and use ElementRareData's
        RenderStyle instead (keeping it around as appropriate), to ensure they
        don't go out of sync, but that's out of scope of this patch for now.

        Tests: imported/w3c/web-platform-tests/css/css-display-3

        * dom/ElementRareData.h:
        (WebCore::ElementRareData::resetComputedStyle):

2017-05-25  Sam Weinig  <sam@webkit.org>

        Fix MediaDeviceInfo's extended attributes so they make sense
        https://bugs.webkit.org/show_bug.cgi?id=172629

        Reviewed by Daniel Bates.

        MediaDeviceInfo.idl had both a Constructor and NoInterfaceObject, which
        doesn't really make sense. Either way, the spec says it should have 
        neither, so remove both. And, while were there, add missing serializer.

        Test: fast/mediastream/media-device-info.html

        * Modules/mediastream/MediaDeviceInfo.idl:

2017-05-25  Chris Dumez  <cdumez@apple.com>

        imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form_owner_and_table_2.html is crashing
        https://bugs.webkit.org/show_bug.cgi?id=172628
        <rdar://problem/32418707>

        Reviewed by Sam Weinig.

        In the event where a form is removed synchronously by a script during parsing,
        FormAssociatedElement::m_formSetByParser may end up referring to a form that
        is no longer in the document. As a result, we should make sure m_formSetByParser
        is still connected in FormAssociatedElement::insertedInto() before we call
        FormAssociatedElement::setForm(m_formSetByParser).

        Test: fast/dom/HTMLFormElement/form-removed-during-parsing-crash.html

        * html/FormAssociatedElement.cpp:
        (WebCore::FormAssociatedElement::insertedInto):

2017-05-25  Zalan Bujtas  <zalan@apple.com>

        Frame's composited content is visible when the frame has visibility: hidden.
        https://bugs.webkit.org/show_bug.cgi?id=125565
        <rdar://problem/32196849>

        Reviewed by Simon Fraser.

        Do not construct composited layers for hidden RenderWidgets (frameset, iframe, object).
        Note that we still construct layers for the associated renderers as usual. 

        Tests: compositing/visibility/frameset-visibility-hidden.html
               compositing/visibility/iframe-visibility-hidden.html
               compositing/visibility/object-visibility-hidden.html

        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::requiresCompositingForPlugin):
        (WebCore::RenderLayerCompositor::requiresCompositingForFrame):

2017-05-25  Yusuke Suzuki  <utatane.tea@gmail.com>

        Unreviewed, build fix in GTK and WPE ports
        https://bugs.webkit.org/show_bug.cgi?id=172580

        Missing RenderSVGResourceMode declaration in SVGInlineTextBox.h.

        * rendering/svg/SVGInlineTextBox.h:

2017-05-25  Simon Fraser  <simon.fraser@apple.com>

        Use a typedef for SVG resource mode flags union
        https://bugs.webkit.org/show_bug.cgi?id=172580

        Reviewed by Sam Weinig.

        Use an OptionSet<> for RenderSVGResourceModes flags, and use it in render
        SVG resource classes.

        * rendering/svg/RenderSVGResource.cpp:
        (WebCore::requestPaintingResource):
        (WebCore::RenderSVGResource::fillPaintingResource):
        (WebCore::RenderSVGResource::strokePaintingResource):
        * rendering/svg/RenderSVGResource.h:
        (WebCore::RenderSVGResource::postApplyResource):
        * rendering/svg/RenderSVGResourceClipper.cpp:
        (WebCore::RenderSVGResourceClipper::applyResource):
        * rendering/svg/RenderSVGResourceClipper.h:
        * rendering/svg/RenderSVGResourceFilter.cpp:
        (WebCore::RenderSVGResourceFilter::applyResource):
        (WebCore::RenderSVGResourceFilter::postApplyResource):
        * rendering/svg/RenderSVGResourceFilter.h:
        * rendering/svg/RenderSVGResourceGradient.cpp:
        (WebCore::RenderSVGResourceGradient::applyResource):
        * rendering/svg/RenderSVGResourceGradient.h:
        * rendering/svg/RenderSVGResourceMarker.h:
        * rendering/svg/RenderSVGResourceMasker.cpp:
        (WebCore::RenderSVGResourceMasker::applyResource):
        * rendering/svg/RenderSVGResourceMasker.h:
        * rendering/svg/RenderSVGResourcePattern.cpp:
        (WebCore::RenderSVGResourcePattern::buildPattern):
        (WebCore::RenderSVGResourcePattern::applyResource):
        (WebCore::RenderSVGResourcePattern::postApplyResource):
        * rendering/svg/RenderSVGResourcePattern.h:
        * rendering/svg/RenderSVGResourceSolidColor.cpp:
        (WebCore::RenderSVGResourceSolidColor::applyResource):
        (WebCore::RenderSVGResourceSolidColor::postApplyResource):
        * rendering/svg/RenderSVGResourceSolidColor.h:
        * rendering/svg/RenderSVGShape.cpp:
        (WebCore::RenderSVGShape::fillShape):
        (WebCore::RenderSVGShape::strokeShape):
        * rendering/svg/SVGInlineTextBox.cpp:
        (WebCore::SVGInlineTextBox::SVGInlineTextBox):
        (WebCore::SVGInlineTextBox::paintSelectionBackground):
        (WebCore::SVGInlineTextBox::paint):
        (WebCore::SVGInlineTextBox::acquirePaintingResource):
        (WebCore::SVGInlineTextBox::releasePaintingResource):
        (WebCore::SVGInlineTextBox::paintDecoration):
        (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
        * rendering/svg/SVGInlineTextBox.h:
        * rendering/svg/SVGRenderingContext.cpp:
        (WebCore::SVGRenderingContext::~SVGRenderingContext):
        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
        (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): Avoid needless IntPoint -> LayoutPoint
        conversion.

2017-05-25  Chris Dumez  <cdumez@apple.com>

        Regression(r215686): Videos sometimes do not load in iBooks
        https://bugs.webkit.org/show_bug.cgi?id=172604
        <rdar://problem/32003717>

        Reviewed by Geoffrey Garen.

        Before r215686, the loop would have a check at the beginning to check if the
        dataRequest's currentOffset was greater than the buffer length and would
        cause the function to return early.

        This check was dropped in r215686, which caused us in some cases to call
        finishLoading / stopLoading() after the loop, even though we did not have
        enough data in the buffer to satisfy the data request.

        To address the issue, we now return early after the loop if remainingLength
        is greater than 0, meaning that we could not satisfy the request. This makes
        sure we do not call finishLoading / stopLoading() prematurely.

        Note that before r215686, the condition of the while loop was 
        "while (remainingLength)" so the only way to get out of the loop was to:
        1. Get remainingLength to 0, in which case we would fall through and
           potentially call finishLoading / stopLoading() after the loop.
        2. Fail the "(data->size() <= [dataRequest currentOffset] - responseOffset)"
           check at the beginning of the loop, meaning that we ran out of data in
           the buffer. This would cause us to return from the function, not fall
           through, so we would not call finishLoading / stopLoading().

        No new tests, I do not know how to write a test for this.

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

2017-05-25  Sam Weinig  <sam@webkit.org>

        [WebIDL] Use the term 'operation' more consistently
        https://bugs.webkit.org/show_bug.cgi?id=172601

        Reviewed by Chris Dumez.

        We were using the term 'operation', a WebIDL term for function-like
        constructs, inconsistently in the code generator. Now, when we use
        'operation' when referring to the IDL concept (usually the object the
        parser produces) and 'function' when referring to code being generated.

        * bindings/scripts/CodeGenerator.pm:
        * bindings/scripts/IDLParser.pm:
        * bindings/scripts/generate-bindings.pl:

2017-05-25  Jer Noble  <jer.noble@apple.com>

        System sleeps while playing to wireless target, ending stream.
        https://bugs.webkit.org/show_bug.cgi?id=172541

        Reviewed by Eric Carlson.

        API test: Tests/mac/MediaPlaybackSleepAssertion.mm

        Keep the system from sleeping (but allow the display to sleep) while playing media to a wireless target.

        Give the SleepDisabler a Type, either System or Display, which indicates what kind of sleep to disable.
        Update HTMLMediaElement::shouldDisableSleep() to differentiate between a video which is playing locally,
        one that is playing but not visible, and one that is playing remotely.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
        (WebCore::HTMLMediaElement::updateSleepDisabling):
        (WebCore::HTMLMediaElement::shouldDisableSleep):
        * html/HTMLMediaElement.h:
        * platform/SleepDisabler.cpp:
        (WebCore::SleepDisabler::create):
        (WebCore::SleepDisabler::SleepDisabler):
        * platform/SleepDisabler.h:
        (WebCore::SleepDisabler::type):
        * platform/cocoa/SleepDisablerCocoa.cpp:
        (WebCore::SleepDisabler::create):
        (WebCore::SleepDisablerCocoa::SleepDisablerCocoa):
        (WebCore::SleepDisablerCocoa::~SleepDisablerCocoa):
        * platform/cocoa/SleepDisablerCocoa.h:
        * platform/mac/WebVideoFullscreenController.mm:
        (-[WebVideoFullscreenController updatePowerAssertions]):
        * platform/spi/cocoa/IOPMLibSPI.h:

2017-05-25  Chris Dumez  <cdumez@apple.com>

        DocumentThreadableLoader::redirectReceived() should not rely on the resource's loader
        https://bugs.webkit.org/show_bug.cgi?id=172578
        <rdar://problem/30754582>

        Reviewed by Youenn Fablet.

        DocumentThreadableLoader::redirectReceived() should not rely on the resource's loader. The rest of the methods do not.
        It is unsafe for it to rely on the resource's loader because it gets cleared when the load completes. A CachedRawresource
        may be reused from the memory cache once its load has completed.

        This would cause crashes in CachedRawResource::didAddClient() when replaying the redirects because it would call
        DocumentThreadableLoader::redirectReceived() and potentially not have a loader anymore. To hit this exact code path,
        you would need to make repeated XHR to a cacheable simple cross-origin resource that has cacheable redirect.

        Test: http/tests/xmlhttprequest/cacheable-cross-origin-redirect-crash.html

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::redirectReceived):
        * loader/DocumentThreadableLoader.h:

2017-05-25  Zalan Bujtas  <zalan@apple.com>

        ASSERTION FAILED: !needsStyleRecalc() || !document().childNeedsStyleRecalc()
        https://bugs.webkit.org/show_bug.cgi?id=172576
        <rdar://problem/32181979>

        Reviewed by Brent Fulgham.

        Ensure that we clean the subframe's document before start searching for a focusable element.

        Covered by existing test.

        * page/FocusController.cpp:
        (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):

2017-05-24  Jiewen Tan  <jiewen_tan@apple.com>

        Crash on WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance + 1195
        https://bugs.webkit.org/show_bug.cgi?id=172555
        <rdar://problem/32004724>

        Reviewed by Ryosuke Niwa.

        setSelectionWithoutUpdatingAppearance could dispatch a synchronous focusin event,
        which could invoke an event handler that deteles the frame. Therefore, add a
        protector before the call.

        Test: editing/selection/select-iframe-focusin-document-crash.html

        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::setSelection):

2017-05-25  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Ensure ImageFrameCache does not access its BitmapImage after it is deleted
        https://bugs.webkit.org/show_bug.cgi?id=172563

        Reviewed by Simon Fraser.

        A crash may happen if the BitmapImage is deleted while the decoding thread
        is still active. Once the current frame finishes decoding, the decoding
        thread will make a callOnMainThread() which will access the deleted BitmapImage.

        We need to ensure if BitmapImage is deleted, the raw pointer which references
        it in ImageFrameCache is cleared. If this is done, nothing else is needed.
        All all the accesses to container BitmapImage in ImageFrameCache are guarded
        by checking m_image is not null.

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::~BitmapImage): Make sure the decoding thread will
        not have access to the deleted BitmapImage when it finishes decoding and
        make its callOnMainThread().
        (WebCore::BitmapImage::destroyDecodedData): Use the function new name.
        (WebCore::BitmapImage::internalStartAnimation): Ditto.
        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::startAsyncDecodingQueue): Protect the sourceURL
        for the decoding thread. ImageFrameCache::sourceURL() checks for the value
        of m_image which now may change from the main thread.
        * platform/graphics/ImageFrameCache.h:
        (WebCore::ImageFrameCache::clearImage): Add a new function to clear the 
        raw pointer m_image when its is deleted.
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::resetData): Rename clear() to resetData() for better
        code readability. This function deletes the ImageDecoder and creates a new
        one if data is not null. The purpose is to delete the decoder raster data.
        (WebCore::ImageSource::clear): Deleted.
        * platform/graphics/ImageSource.h:
        (WebCore::ImageSource::clearImage): Wrapper for the ImageFrameCache function.

2017-05-25  youenn fablet  <youenn@apple.com>

        Add some release logging for media elements
        https://bugs.webkit.org/show_bug.cgi?id=172581

        Reviewed by Eric Carlson.

        No change of behavior.

         Adding logging for getUserMedia, video autoplay and incoming/outgoing webrtc video tracks.

        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::allow):
        (WebCore::UserMediaRequest::deny):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::playbackPermitted):
        * platform/Logging.h:
        * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
        (WebCore::RealtimeIncomingVideoSource::OnFrame):
        * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
        (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:

2017-05-25  Sam Weinig  <sam@webkit.org>

        [WebIDL] Do a pass of cleanup in the bindings generator
        https://bugs.webkit.org/show_bug.cgi?id=172566

        Reviewed by Chris Dumez.

        - Split JSDOMBindingCaller.h into four new files to allow for less 
          header inclusion (one includes a bunch of promise stuff that usually
          isn't needed): 
            - JSDOMCastedThisErrorBehavior (with shared casting enum)
            - JSDOMAttribute (for attribute getting / setting)
            - JSDOMOperation (for normal operations)
            - JSDOMOperationReturningPromise (for operations returning promises, obviously).

          In addition to separating the files, rename to be more consistent with modern
          bindings conventions (new classes are IDLAttribute, IDLOperation, and 
          IDLOperationReturningPromise) and simplify function names
            - 'callOperation' becomes 'call'
            - 'attribute' becomes 'get'
            - 'setAttribute' becomes 'set'

        - Remove extra generated trampoline function for operations returning promises
          by making JSDOMOperationReturningPromise handle all the promise related overhead.

        - Make [Custom] operations returning promises go through the normal IDLOperationReturningPromise
          code path (simplifying JSReadableStreamSource and JSSubtleCrypto). Added [ReturnsOwnPromise]
          extended attribute to allow some functions that want to retain specialized behavior to do so

        - Swap order of trampoline and implementation of operation, to avoid the need for
          a forward declaration and make reading more straightforward.

        * WebCore.xcodeproj/project.pbxproj:
        Add / remove files.

        * bindings/js/JSDOMBindingCaller.h: Removed.

        * bindings/js/JSDOMCastedThisErrorBehavior.h: Added.
        Shared header for enum needed by JSDOMAttribute, JSDOMOperation and JSDOMOperationReturningPromise.

        * bindings/js/JSDOMAttribute.h: Added.
        * bindings/js/JSDOMOperation.h: Added.
        * bindings/js/JSDOMOperationReturningPromise.h: Added.
        Split out JSDOMBindingCaller implementations into own classes / files. Simplify
        naming.
    
        * bindings/js/JSDOMPromiseDeferred.h:
        (WebCore::callPromiseFunction):
        Add a variant of callPromiseFunction that takes a lambda.

        * bindings/js/JSEventTargetCustom.h:
        (WebCore::IDLOperation<JSEventTarget>::call):
        Update operation specialization to use new class.

        * bindings/js/JSReadableStreamSourceCustom.cpp:
        * bindings/js/JSSubtleCryptoCustom.cpp:
        Simplify now that the callPromiseFunction is called for us.

        * crypto/WebKitSubtleCrypto.idl:
        * css/FontFace.idl:
        * dom/CustomElementRegistry.idl:
        Add [ReturnsOwnPromise] to retain custom promise behavior.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        Update header generation to account for custom functions that return promises now
        having a Ref<DeferredPromise>&& parameter.

        (GenerateImplementation):
        - Update for new naming of cast functions.
        - Use AddToImplIncludes (and pass in conditional) rather than using $implIncludes
          directly, #includes to be grouped correctly.
        - Remove dead $inAppleCopyright code (it was moved to GenerateOperationDefinition 
          earlier).

        (GenerateOperationDefinition):
        - Use $codeGenerator->IsPromiseType() rather than directly comparing to "Promise" string.
        - Restructure code to allow trampoline (the code that calls IDLOperation) to come after
          the main operation implementation (the part that calls into the impl).
        - Support custom functions returning promises (and the [ReturnsOwnPromise] variant).

        (GenerateImplementationIterableFunctions):
        Update for name change to IDLOperation.

        * bindings/scripts/IDLAttributes.json:
        Add [ReturnsOwnPromise].

        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        * bindings/scripts/test/JS/JSMapLike.cpp:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        * bindings/scripts/test/JS/JSTestException.cpp:
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestObj.h:
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        Update test results.

        * bindings/scripts/test/TestObj.idl:
        Add additional test cases for operations returning promises.

2017-05-25  Simon Fraser  <simon.fraser@apple.com>

        Some <chrono> and ProgressTracker cleanup
        https://bugs.webkit.org/show_bug.cgi?id=172582

        Reviewed by Sam Weinig.

        Remove some unnecessary <chrono> includes.
        Convert some std::chrono to use MonotonicTime/Seconds.
        Clean up ProgressTracker.
        Some #pragma once.

        * dom/Document.h:
        * loader/ProgressTracker.cpp:
        (WebCore::ProgressTracker::ProgressTracker):
        (WebCore::ProgressTracker::reset):
        (WebCore::ProgressTracker::progressStarted):
        (WebCore::ProgressTracker::finalProgressComplete):
        (WebCore::ProgressTracker::incrementProgress):
        * loader/ProgressTracker.h:
        * page/Settings.h:
        * platform/SearchPopupMenu.h:
        * platform/Timer.h:
        * platform/graphics/cg/IOSurfacePool.cpp:
        (WebCore::IOSurfacePool::markOlderSurfacesPurgeable):
        * platform/graphics/cg/IOSurfacePool.h:
        (WebCore::IOSurfacePool::CachedSurfaceDetails::resetLastUseTime):
        * platform/network/PlatformCookieJar.h:

2017-05-25  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] Expose doc-footnote ARIA role with ATK_ROLE_FOOTNOTE
        https://bugs.webkit.org/show_bug.cgi?id=172355

        Reviewed by Chris Fleizach.

        Add a new FootnoteRole accessibility role to WebCore and map it to
        ATK_ROLE_FOOTNOTE for WebKitGtk and NSAccessibilityGroupRole with
        a subrole of AXApplicationGroup for the Mac port.

        No new tests because we already have coverage for this role.
        The existing test expectations were updated to reflect the
        new mapping of doc-footnote to ATK_ROLE_FOOTNOTE.

        * accessibility/AccessibilityObject.cpp:
        (WebCore::initializeRoleMap):
        (WebCore::AccessibilityObject::computedRoleString):
        * accessibility/AccessibilityObject.h:
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (atkRole):
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (createAccessibilityRoleMap):
        (-[WebAccessibilityObjectWrapper subrole]):

2017-05-25  youenn fablet  <youenn@apple.com>

        [macOS WK2 Debug] Layout Test webrtc/video.html is crashing.
        https://bugs.webkit.org/show_bug.cgi?id=172560
        <rdar://problem/32392611>

        Reviewed by Eric Carlson.

        webrtc/multiple-video.html is no longer crashing.

        Allow autoplay only from going to not capture to capture, and not the reverse.
        Renamed HTMLMediaElement::mediaStreamCaptureStateChanged to mediaStreamCaptureStarted.

        * dom/Document.cpp:
        (WebCore::Document::mediaStreamCaptureStateChanged):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::mediaStreamCaptureStateChanged): Deleted.
        * html/HTMLMediaElement.h:
        (WebCore::HTMLMediaElement::mediaStreamCaptureStarted):

2017-05-25  Dave Hyatt  <hyatt@apple.com>

        Baseline of number inputs not right.
        https://bugs.webkit.org/show_bug.cgi?id=172237

        Reviewed by Dean Jackson.

        Added fast/forms/baseline-of-number-inputs.html

        * css/html.css:
        (input::-webkit-inner-spin-button):
        * rendering/RenderSearchField.cpp:
        (WebCore::RenderSearchField::computeLogicalHeightLimit): Deleted.
        (WebCore::RenderSearchField::centerContainerIfNeeded): Deleted.
        * rendering/RenderSearchField.h:
        * rendering/RenderTextControlSingleLine.cpp:
        (WebCore::RenderTextControlSingleLine::centerRenderer):
        (WebCore::RenderTextControlSingleLine::layout):
        (WebCore::RenderTextControlSingleLine::computeLogicalHeightLimit): Deleted.
        * rendering/RenderTextControlSingleLine.h:
        (WebCore::RenderTextControlSingleLine::centerContainerIfNeeded): Deleted.

2017-05-25  Manuel Rego Casasnovas  <rego@igalia.com>

        [css-grid] Fix behavior of positioned items without specific dimensions
        https://bugs.webkit.org/show_bug.cgi?id=172117

        Reviewed by Sergio Villar Senin.

        Currently positioned items that doesn't have specific dimensions
        are not properly sized. This patch fixes the issues with them.

        The patch removes the extraInline|BlockOffsets from RenderBox,
        so now RenderGrid is responsible of setting the location of the positioned item.
        This will be useful to add alignment support for positioned items later.
        It also removes grid specific logic from RenderBox.

        RenderBox::computeInlineStaticDistance() was modified too.
        The problem here was that the containing block of the positioned gird items
        is the grid area (and not the grid container). The method didn't know
        anything about grid, so it was using the grid container causing wrong values
        when resolving "auto" in both left and right offset properties.

        Note that after this patch we match Chrome and Firefox behavior on these cases.

        Test: fast/css-grid-layout/positioned-grid-items-sizing.html

        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::willBeDestroyed):
        (WebCore::computeInlineStaticDistance):
        (WebCore::RenderBox::computePositionedLogicalWidth):
        (WebCore::RenderBox::computePositionedLogicalHeight):
        * rendering/RenderBox.h:
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::layoutPositionedObject):
        (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):

2017-05-25  Claudio Saavedra  <csaavedra@igalia.com>

        [WPE] Build fix after r217404

        Unreviewed

        * PlatformWPE.cmake: Include missing cairo cmake file.

2017-05-24  Chris Dumez  <cdumez@apple.com>

        ResourceResponses for data URLs have their Source marked as Unknown
        https://bugs.webkit.org/show_bug.cgi?id=172573
        <rdar://problem/31786198>

        Reviewed by Geoffrey Garen.

        ResourceResponses for data URLs have their Source marked as Unknown.

        Now set their source to Network to maintain previous behavior when
        we used to decode those data URLs on Network process side.

        Test: fast/url/data-url-source.html

        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::loadDataURL):

2017-05-24  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win] An assertion fails if the custom cursor image isn't loaded yet
        https://bugs.webkit.org/show_bug.cgi?id=172209

        Reviewed by Said Abou-Hallawa.

        Test: fast/css/crash-on-custom-cursor-when-loading.html

        A custom cursor image can be zero dimension if it is loading or
        decoding. Cursor::ensurePlatformCursor of Windows port should
        handle such case properly.

        * platform/win/CursorWin.cpp:
        (WebCore::Cursor::ensurePlatformCursor): Load a stock cursor if
        the custom cursor image has zero dimension. Do not do null-check
        of the return value of createSharedCursor() because it never
        returns null.

2017-05-24  Don Olmstead  <don.olmstead@am.sony.com>

        [CMake] Consolidate CMake code related to Cairo
        https://bugs.webkit.org/show_bug.cgi?id=172568

        Reviewed by Alex Christensen.

        No new tests. No change in behavior.

        * PlatformGTK.cmake:
        * PlatformWPE.cmake:
        * PlatformWinCairo.cmake:
        * config.h:
        * platform/Cairo.cmake: Added.
        * platform/GStreamer.cmake:
        * platform/ImageDecoders.cmake:

2017-05-24  Said Abou-Hallawa  <sabouhallawa@apple.com>

        REGRESSION (r206481): Don't assume frameCount() is larger than or equal to the size of the image frame cache
        https://bugs.webkit.org/show_bug.cgi?id=172552

        Reviewed by Geoffrey Garen.

        If an image with many cached ImageFrames is cached but its encoded data is
        freed, then the same image is reused, the encoded data will be fetched.
        But the initial frameCount() might be less than the current size of the
        ImageFrames cache.

        This was causing an assertion in the debug build and crash in the release
        build. Vector::grow() does not handle the case where the new size is smaller
        than the current size safely.

        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::growFrames):

2017-05-24  Sergey Shekyan  <shekyan@gmail.com>

        navigator.webdriver should return false if the page is not controlled by automation
        https://bugs.webkit.org/show_bug.cgi?id=171997

        Reviewed by Chris Dumez.

        Per WebDriver Specification at https://www.w3.org/TR/webdriver/#interface

        Test: js/dom/navigator-webdriver.html
        Rebaseled fast/dom/navigator-detached-no-crash.html

        * Modules/webdriver/NavigatorWebDriver.cpp:
        (WebCore::NavigatorWebDriver::NavigatorWebDriver):
        (WebCore::NavigatorWebDriver::isControlledByAutomation):
        (WebCore::NavigatorWebDriver::from):
        (WebCore::NavigatorWebDriver::webdriver):
        (WebCore::JSNavigator::webdriver): Deleted.
        * Modules/webdriver/NavigatorWebDriver.h:
        * Modules/webdriver/NavigatorWebDriver.idl:

2017-05-24  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, suppress deprecation warnings to fix the build.

        * platform/graphics/mac/GraphicsContextMac.mm:
        (WebCore::linearRGBColorSpaceRef):

2017-05-24  Wenson Hsieh  <wenson_hsieh@apple.com>

        Plumb additional image metadata to item providers when beginning data interaction on an image
        https://bugs.webkit.org/show_bug.cgi?id=172536
        <rdar://problem/32371300>

        Reviewed by Beth Dakin.

        Plumb suggestedName (the last path component of the image's source URL) and size (the actual size of the image)
        to item providers when beginning data interaction on an image.

        Augments existing unit tests to cover these changes -- see DataInteractionTests.

        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::writeImageToPasteboard):
        * platform/Pasteboard.h:
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::writeObjectRepresentations):
        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderRegistrationInfoList init]):
        (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]):
        (temporaryFileURLForDataInteractionContent):

2017-05-24  Eric Carlson  <eric.carlson@apple.com>

        CoreAudioCaptureSource is ducking system sound
        https://bugs.webkit.org/show_bug.cgi?id=172512

        Reviewed by Youenn Fablet.

        Manual testing.

        * Configurations/WebCore.xcconfig: Adding CoreAudio as framework for iOS.
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioSharedUnit::setupAudioUnit):
        (WebCore::CoreAudioSharedUnit::defaultOutputDevice):
        * platform/spi/cf/CoreAudioSPI.h: Added.

2017-05-24  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Change grandfathering default to one hour
        https://bugs.webkit.org/show_bug.cgi?id=172524
        <rdar://problem/32360462>

        Reviewed by Brent Fulgham.

        Covered by existing test.

        * loader/ResourceLoadStatisticsStore.cpp:

2017-05-24  Jer Noble  <jer.noble@apple.com>

        Rename DisplaySleepDisabler -> SleepDisabler
        https://bugs.webkit.org/show_bug.cgi?id=172478

        Reviewed by Sam Weinig.

        Rename DisplaySleepDisabler to SleepDisabler so that different (i.e., non-Display) sleep types can be
        added in a future change.

        * WebCore.xcodeproj/project.pbxproj:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::updateSleepDisabling):
        * html/HTMLMediaElement.h:
        * platform/SleepDisabler.cpp: Renamed from Source/WebCore/platform/DisplaySleepDisabler.cpp.
        (WebCore::SleepDisabler::create):
        (WebCore::SleepDisabler::SleepDisabler):
        (WebCore::SleepDisabler::~SleepDisabler):
        * platform/SleepDisabler.h: Renamed from Source/WebCore/platform/DisplaySleepDisabler.h.
        * platform/cocoa/SleepDisablerCocoa.cpp: Renamed from Source/WebCore/platform/cocoa/DisplaySleepDisablerCocoa.cpp.
        (WebCore::SleepDisabler::create):
        (WebCore::SleepDisablerCocoa::SleepDisablerCocoa):
        (WebCore::SleepDisablerCocoa::~SleepDisablerCocoa):
        * platform/cocoa/SleepDisablerCocoa.h: Renamed from Source/WebCore/platform/cocoa/DisplaySleepDisablerCocoa.h.
        * platform/mac/WebVideoFullscreenController.h:
        * platform/mac/WebVideoFullscreenController.mm:
        (-[WebVideoFullscreenController updatePowerAssertions]):
        * CMakeLists.txt:
        * PlatformMac.cmake:
        * WebCore.order:

2017-05-24  Per Arne Vollan  <pvollan@apple.com>

        [Win] Create unique network storage session for each DRT.
        https://bugs.webkit.org/show_bug.cgi?id=172540

        Reviewed by Brent Fulgham.

        During layout testing, each DRT instance should have its own network storage session.

        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::switchToNewTestingSession):

2017-05-24  Sam Weinig  <sam@webkit.org>

        [WebIDL] Overloaded functions unnecessarily duplicate argument checks
        https://bugs.webkit.org/show_bug.cgi?id=172481

        Reviewed by Chris Dumez.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        (GeneratePropertiesHashTable):
        Update for rename of GetConditionalForFunctionConsideringOverloads.

        (AreTypesDistinguishableForOverloadResolution):
        Remove unnecessary subroutine isDictionary that can be replaced by
        a direct call to $codeGenerator->IsDictionaryType().

        (GetConditionalForFunctionConsideringOverloads):
        Renamed from getConditionalForFunctionConsideringOverloads.

        (GenerateOverloadDispatcher):
        Renamed from GenerateOverloadedFunctionOrConstructor. Moved Constructor/Operation/LegacyCaller
        specific code out, and into parameters.

        (GenerateImplementation):
        Moved operation generation out into its own subroutine.

        (GenerateOperationDefinition): Added.
        Moved from GenerateImplementation.

        (GenerateLegacyCallerDefinitions):
        Pass function name and signature to GenerateOverloadDispatcher.

        (GenerateArgumentsCountCheck):
        Don't generate an argument check if this is an overloaded function. The argument
        checks happen in the overload dispatcher.

        (NeedsExplicitPropagateExceptionCall):
        (GenerateParametersCheck):
        (GenerateImplementationFunctionCall):
        Replace IsReturningPromise with more direct check.

        (GenerateConstructorDefinitions):
        Pass function name and signature to GenerateOverloadDispatcher.

        (getConditionalForFunctionConsideringOverloads): Renamed to GetConditionalForFunctionConsideringOverloads.
        (GenerateOverloadedFunctionOrConstructor): Renamed to GenerateOverloadDispatcher.
        (IsReturningPromise): Deleted.

        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/TestInterface.idl:
        Update test results.

2017-05-24  Commit Queue  <commit-queue@webkit.org>

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

        This patch broke iOS Simulator Debug build (Requested by fredw
        on #webkit).

        Reverted changeset:

        "CoreAudioCaptureSource is ducking system sound"
        https://bugs.webkit.org/show_bug.cgi?id=172512
        http://trac.webkit.org/changeset/217319

2017-05-24  Antoine Quint  <graouts@apple.com>

        [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
        https://bugs.webkit.org/show_bug.cgi?id=168409

        Unreviewed.

        Remove temporary logging which prevents performance bots from reporting useful data.

        * page/Page.cpp:
        (WebCore::Page::suspendScriptedAnimations):

2017-05-24  Javier Fernandez  <jfernandez@igalia.com>

        [css-grid] Ignore collapsed tracks on content-distribution alignment
        https://bugs.webkit.org/show_bug.cgi?id=172493

        Reviewed by Manuel Rego Casasnovas.

        The CSS Box Alignment spec states that we should ignore the collapsed
        tracks when computing the Distribution Alignment space to assign to the
        different grid tracks.

        No new tests, just unskipping the web-platform-tests imported to verify this use case.

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

2017-05-24  Wenson Hsieh  <wenson_hsieh@apple.com>

        Respect image UTIs when writing to item providers when beginning data interaction on an image
        https://bugs.webkit.org/show_bug.cgi?id=172436
        <rdar://problem/31786569>

        Reviewed by Beth Dakin.

        Previously, when beginning writing images to the WebItemProviderPasteboard, we would create a new UIImage and
        use standard UIImage UIItemProviderWriting utilities to register the image to the pasteboard. This is lossy for
        gifs, since UIImage doesn't inherently know how to represent gifs. Instead, register the raw image data directly
        to the UTI type corresponding to the MIME type of the image, and use UIImage's item provider writing capability
        as a fallback when the raw resourceData is unavailable.

        Augments existing unit tests, and also adds a new unit test:
        DataInteractionTests.ImageDoesNotUseElementSizeAsEstimatedSize

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

2017-05-23  Eric Carlson  <eric.carlson@apple.com>

        CoreAudioCaptureSource is ducking system sound
        https://bugs.webkit.org/show_bug.cgi?id=172512

        Reviewed by Youenn Fablet.

        Manual testing.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioSharedUnit::setupAudioUnit):
        (WebCore::CoreAudioSharedUnit::defaultOutputDevice):

2017-05-23  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [iOS] Speculative fix for a PLT regression
        <rdar://problem/32361890>

        Unreviewed.

        Make sure CGImageSourceGetTypeWithData() is called with a buffer which is
        32 bytes or more.

        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::ImageDecoder::ImageDecoder):

2017-05-22  Jiewen Tan  <jiewen_tan@apple.com>

        [WebCrypto] Support RSA-PSS
        https://bugs.webkit.org/show_bug.cgi?id=170869
        <rdar://problem/31640672>

        Reviewed by Brent Fulgham.

        This patch implements RSA-PSS according to the spec: https://www.w3.org/TR/WebCryptoAPI/#rsa-pss.
        Supported operations include sign, verify, generateKey, importKey and exportKey.

        Tests: crypto/subtle/rsa-pss-generate-export-key-jwk-sha1.html
               crypto/subtle/rsa-pss-generate-export-key-jwk-sha224.html
               crypto/subtle/rsa-pss-generate-export-key-jwk-sha256.html
               crypto/subtle/rsa-pss-generate-export-key-jwk-sha384.html
               crypto/subtle/rsa-pss-generate-export-key-jwk-sha512.html
               crypto/subtle/rsa-pss-generate-export-key-pkcs8.html
               crypto/subtle/rsa-pss-generate-export-key-spki.html
               crypto/subtle/rsa-pss-generate-key.html
               crypto/subtle/rsa-pss-import-jwk-private-key.html
               crypto/subtle/rsa-pss-import-jwk-public-key-empty-usages.html
               crypto/subtle/rsa-pss-import-jwk-public-key-sha1.html
               crypto/subtle/rsa-pss-import-jwk-public-key-sha224.html
               crypto/subtle/rsa-pss-import-jwk-public-key-sha256.html
               crypto/subtle/rsa-pss-import-jwk-public-key-sha384.html
               crypto/subtle/rsa-pss-import-jwk-public-key-sha512.html
               crypto/subtle/rsa-pss-import-key-sign-large-salt.html
               crypto/subtle/rsa-pss-import-key-sign.html
               crypto/subtle/rsa-pss-import-key-verify.html
               crypto/subtle/rsa-pss-import-pkcs8-key.html
               crypto/subtle/rsa-pss-import-spki-key-empty-usages.html
               crypto/subtle/rsa-pss-import-spki-key.html
               crypto/workers/subtle/rsa-pss-import-key-sign.html
               crypto/workers/subtle/rsa-pss-import-key-verify.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * PlatformGTK.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSSubtleCryptoCustom.cpp:
        (WebCore::normalizeCryptoAlgorithmParameters):
        * crypto/CryptoAlgorithmParameters.h:
        * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp: Added.
        (WebCore::CryptoAlgorithmRSA_PSS::create):
        (WebCore::CryptoAlgorithmRSA_PSS::identifier):
        (WebCore::CryptoAlgorithmRSA_PSS::sign):
        (WebCore::CryptoAlgorithmRSA_PSS::verify):
        (WebCore::CryptoAlgorithmRSA_PSS::generateKey):
        (WebCore::CryptoAlgorithmRSA_PSS::importKey):
        (WebCore::CryptoAlgorithmRSA_PSS::exportKey):
        * crypto/algorithms/CryptoAlgorithmRSA_PSS.h: Added.
        * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
        (WebCore::cryptoDigestAlgorithm): Deleted.
        Extract function cryptoDigestAlgorithm to a separate file.
        * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
        (WebCore::cryptoDigestAlgorithm): Deleted.
        Extract function cryptoDigestAlgorithm to a separate file.
        * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp: Added.
        (WebCore::signRSA_PSS):
        (WebCore::verifyRSA_PSS):
        (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
        (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
        * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
        (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
        * crypto/mac/CryptoDigestAlgorithm.h: Added.
        (WebCore::cryptoDigestAlgorithm):
        Have cryptoDigestAlgorithm in a separate file.
        * crypto/parameters/CryptoAlgorithmRsaPssParams.h: Added.
        * crypto/parameters/RsaPssParams.idl: Added.

2017-05-23  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Allow transition from autoplay to play when a capture stream begins.
        https://bugs.webkit.org/show_bug.cgi?id=172391
        <rdar://problem/32304934>

        Reviewed by Youenn Fablet.

        Manual testing. Regression testing to be added as a follow-up.

        * dom/Document.cpp:
        (WebCore::Document::updateIsPlayingMedia): Call mediaStreamCaptureStateChanged when capture
        state changes.
        (WebCore::Document::registerForMediaStreamStateChangeCallbacks):
        (WebCore::Document::unregisterForMediaStreamStateChangeCallbacks):
        (WebCore::Document::mediaStreamCaptureStateChanged): Call all registered elements.
        * dom/Document.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::registerWithDocument): Register for capture state changes.
        (WebCore::HTMLMediaElement::unregisterWithDocument): Unregister for capture state changes.
        (WebCore::HTMLMediaElement::mediaStreamCaptureStateChanged): Attempt autoplay as necessary.
        * html/HTMLMediaElement.h:

2017-05-15  Matt Rajca  <mrajca@apple.com>

        Replace autoplay events that fire at navigation with a DidAutoplayMediaPastThreshold event.
        https://bugs.webkit.org/show_bug.cgi?id=172138

        Reviewed by Alex Christensen.

        The current autoplay signals that are fired at navigation may not get delivered to the UIProcess if the WebPage is close()'ed around
        this time. This patch simplifies this and just notifies clients if a media element has played past a threshold.

        Updated API tests.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::playbackProgressTimerFired):
        (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
        (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
        (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay):
        * page/AutoplayEvent.h:

2017-05-23  Dean Jackson  <dino@apple.com>

        checkGPUStatus needs to exercise instancing calls
        https://bugs.webkit.org/show_bug.cgi?id=172520
        <rdar://problem/23118395>

        Reviewed by Brent Fulgham.

        The checkGPUStatus method (formerly checkGPUStatusIfNecessary) was
        not being called after the drawArrays/Elements instancing calls.

        I also added a test case to exercise the recovery logic.

        Test: fast/canvas/webgl/lose-context-on-status-failure.html

        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::setFailNextGPUStatusCheck): Force
        the next checkGPUStatus on the GC3D to fail.
        * html/canvas/WebGLRenderingContextBase.h:
        * platform/graphics/GraphicsContext3D.h: Rename a function, and make
        the number of calls we wait before checking per instance, rather than
        static (which might have meant we're only ever checking after one canvas on
        a page with multiple contexts).
        (WebCore::GraphicsContext3D::setFailNextGPUStatusCheck):
        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
        (WebCore::GraphicsContext3D::checkGPUStatus): Renamed.
        (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Deleted.
        * platform/graphics/mac/GraphicsContext3DMac.mm:
        (WebCore::GraphicsContext3D::checkGPUStatus): Improve the logic.
        (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Deleted.
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::clear):
        (WebCore::GraphicsContext3D::drawArrays):
        (WebCore::GraphicsContext3D::drawElements):
        (WebCore::GraphicsContext3D::drawArraysInstanced): Add a call to checkGPUStatus.
        (WebCore::GraphicsContext3D::drawElementsInstanced): Ditto.
        * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
        (WebCore::GraphicsContext3D::checkGPUStatus):
        (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Deleted.
        * testing/Internals.cpp: Implement the internal call to cause the next
        check to fail.
        (WebCore::Internals::failNextGPUStatusCheck):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-05-23  Sam Weinig  <sam@webkit.org>

        [WebIDL] Further cleanup enumeration handling
        https://bugs.webkit.org/show_bug.cgi?id=172516

        Reviewed by Chris Dumez.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GeneratePut):
        (GeneratePutByIndex):
        (GenerateDictionaryImplementationContent):
        (GenerateParametersCheck):
        (GenerateCallbackImplementationContent):
        Update now that JSValueToNative doesn't have a second return value.

        (GenerateImplementation):
        Add enumeration special casing to attribute setting code, where it is special
        cased in the standard

        (PassArgumentExpression):
        Stop special casing enumerations.
        
        (IsValidContextForJSValueToNative):
        Assert that enums are never passed to JSValueToNative in an attribute context.

        (JSValueToNative):
        Remove enumeration special case and second return value (which was always 1).

        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::setJSTestObjEnumAttrFunction):
        (WebCore::setJSTestObjImplementationEnumAttrFunction):
        (WebCore::setJSTestObjAttributeWithReservedEnumTypeFunction):
        Update results.

2017-05-22  Simon Fraser  <simon.fraser@apple.com>

        Snapshotting via -renderInContext: should do synchronous image decodes
        https://bugs.webkit.org/show_bug.cgi?id=172485
        rdar://problem/32276146

        Reviewed by Tim Horton.

        When UIWebView clients snapshot the view via -renderInContext: on the UIView's layer,
        WebKit should do synchronous image decodes so that the images show in the snapshot.

        Fix by plumbing through a "snapshotting" paint behavior flag from two source locations:
        WebSimpleLayer, used by compositing layers, and LegacyTileLayer, used for the WK1 tile cache.
        On WebSimpleLayer the flag propagates through PlatformCALayer to GraphicsLayer, and on LegacyTileLayer
        it sets some state on the WAKWindow, which is detected by -[WebFrame _paintBehaviorForDestinationContext:].
        In both cases, the flag becomes PaintBehaviorSnapshotting which is passed down through painting
        in PaintInfo.paintBehavior.

        Fix code that was checking paintBehavior on the FrameView to just looking at PaintInfo.paintBehavior,
        which required passing PaintInfo along in RenderImage::paintIntoRect().

        We can't just use the PaintBehaviorFlattenCompositingLayers flag, because that triggers
        a flattening paint of compositing layers, and we don't want that behavior for -renderInContext:,
        since CoreAnimation calls -renderInContext: on each of our layers and we need to avoid double-painting.
        So PaintBehaviorSnapshotting is now added to the call sites that also set PaintBehaviorFlattenCompositingLayers
        in most cases.

        Tested by SnapshotViaRenderInContext API test.

        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
        * page/FrameView.cpp:
        (WebCore::FrameView::willPaintContents):
        (WebCore::FrameView::paintContentsForSnapshot):
        * page/PageOverlayController.cpp:
        (WebCore::PageOverlayController::paintContents):
        * page/PageOverlayController.h:
        * page/mac/ServicesOverlayController.h:
        * page/mac/ServicesOverlayController.mm:
        (WebCore::ServicesOverlayController::Highlight::paintContents):
        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::GraphicsLayer::paintGraphicsLayerContents):
        * platform/graphics/GraphicsLayer.h:
        * platform/graphics/GraphicsLayerClient.h:
        (WebCore::GraphicsLayerClient::paintContents):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::recursiveCommitChanges):
        (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
        * platform/graphics/ca/GraphicsLayerCA.h:
        * platform/graphics/ca/PlatformCALayer.h:
        * platform/graphics/ca/PlatformCALayerClient.h:
        * platform/graphics/ca/TileCoverageMap.cpp:
        (WebCore::TileCoverageMap::platformCALayerPaintContents):
        * platform/graphics/ca/TileCoverageMap.h:
        * platform/graphics/ca/TileGrid.cpp:
        (WebCore::TileGrid::platformCALayerPaintContents):
        * platform/graphics/ca/TileGrid.h:
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        (PlatformCALayer::drawLayerContents):
        * platform/graphics/mac/WebLayer.mm:
        (-[WebLayer drawInContext:]):
        (-[WebSimpleLayer renderInContext:]):
        (-[WebSimpleLayer drawInContext:]):
        * platform/ios/LegacyTileCache.h: Use initializers.
        * platform/ios/LegacyTileCache.mm:
        (WebCore::LegacyTileCache::LegacyTileCache):
        (WebCore::LegacyTileCache::drawWindowContent):
        (WebCore::LegacyTileCache::drawLayer):
        * platform/ios/LegacyTileLayer.h:
        * platform/ios/LegacyTileLayer.mm:
        (-[LegacyTileHostLayer renderInContext:]):
        (-[LegacyTileLayer renderInContext:]):
        (-[LegacyTileLayer drawInContext:]):
        (+[LegacyTileLayer layerBeingPainted]): Deleted. There were no callers.
        * platform/ios/wak/WAKView.mm:
        (-[WAKView _drawRect:context:lockFocus:]): bool -> BOOL
        * platform/ios/wak/WAKWindow.h:
        * platform/ios/wak/WAKWindow.mm:
        (-[WAKWindow setIsInSnapshottingPaint:]):
        (-[WAKWindow isInSnapshottingPaint]):
        * rendering/PaintPhase.h:
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::paintMaskImages):
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintReplaced):
        (WebCore::RenderImage::paintIntoRect):
        * rendering/RenderImage.h:
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paintLayerContents):
        (WebCore::RenderLayer::paintForegroundForFragments):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::paintContents):
        * rendering/RenderLayerBacking.h:
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::paintContents):
        * rendering/RenderLayerCompositor.h:
        * rendering/RenderVideo.cpp:
        (WebCore::RenderVideo::paintReplaced):

2017-05-23  Myles C. Maxfield  <mmaxfield@apple.com>

        Remove dead ENABLE(FONT_LOAD_EVENTS) code
        https://bugs.webkit.org/show_bug.cgi?id=172517

        Rubber-stamped by Simon Fraser.

        No new tests because there is no behavior change.

        * CMakeLists.txt:
        * Configurations/FeatureDefines.xcconfig:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSAllInOne.cpp:
        * css/CSSFontFaceLoadEvent.cpp: Removed.
        * css/CSSFontFaceLoadEvent.h: Removed.
        * css/CSSFontFaceLoadEvent.idl: Removed.
        * dom/EventNames.in:
        * page/FrameView.cpp:
        (WebCore::FrameView::performPostLayoutTasks):
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setFontLoadEventsEnabled): Deleted.
        (WebCore::RuntimeEnabledFeatures::fontLoadEventsEnabled): Deleted.

2017-05-23  Chris Dumez  <cdumez@apple.com>

        Unreviewed, roll out r215229

        It caused CachedScripts in MemoryCache to be reused with different encodings
        even though CachedScript potentially has already decoded data or cached hash
        with a previous encoding.

        * loader/TextResourceDecoder.cpp:
        (WebCore::TextResourceDecoder::setEncoding):
        * loader/TextResourceDecoder.h:
        (WebCore::TextResourceDecoder::sawError):
        (WebCore::TextResourceDecoder::encodingSet): Deleted.
        * loader/cache/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::setEncoding):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::CachedResource):
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::hasUnknownEncoding):
        (WebCore::CachedResource::setHasUnknownEncoding):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::determineRevalidationPolicy):

2017-05-23  Zalan Bujtas  <zalan@apple.com>

        ASSERTION FAILED: !renderer().view().needsLayout() while running media/video-main-content-autoplay.html
        https://bugs.webkit.org/show_bug.cgi?id=172476

        Reviewed by Simon Fraser.

        This patch decouples the layout call logic from the post layout task timer setup.
        Just because we are switching over to asynchronous performPostLayoutTasks() it should not stop us from
        running layout on a dirty tree (we could encounter a forced layout (which sets m_postLayoutTasksTimer active)
        and a subsequent tree mutation during performPostLayoutTasks()). 

        There are a few different ways to end up here:
        root layout is done -> call performPostLayoutTasks() synchronously -> 
        1. tree stays clean -> no action needed.
        2. tree gets dirty -> setup performPostLayoutTasks timer -> run nested layout -> since m_postLayoutTasksTimer is active()
        we don't try to run performPostLayoutTasks() while in the nested layout and we return with a clean tree.         

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

2017-05-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        Multiple links should be inserted separately when performing data interaction
        https://bugs.webkit.org/show_bug.cgi?id=172489
        <rdar://problem/31510832>

        Reviewed by Dan Bernstein.

        In WebContentReader, URLs are currently always inserted inline. When inserting multiple items, this causes
        adjacent links to be inserted on a single line with no break, which is undesirable. To address this, when
        appending links from additional items to the existing document fragment in WebContentReader, insert a new space
        prior to inserting the anchor element.

        New unit test: DataInteractionTests.ExternalSourceMultipleURLsToContentEditable

        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::WebContentReader::addFragment):

        Tweak to add all children of the new fragment, rather than just the first child.

        (WebCore::Editor::WebContentReader::readURL):

2017-05-23  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove some unnecessary specialization for enum types
        https://bugs.webkit.org/show_bug.cgi?id=172482

        Reviewed by Chris Dumez.

        - Removes convertEnumeration template function and generated specialization.
          convert<IDLEnumeration<T>> now does the entire check, and can have specialized
          exceptions.
        - Treats enums more like all other types, removing enum specific code in the
          generator.

        Also fixes some order of exception bugs as the convertEnumeration<T> implementations
        were not correctly catching exceptions thrown in parseEnumeration<T>.

        * bindings/js/JSDOMConvertEnumeration.h:
        (WebCore::Converter<IDLEnumeration<T>>::convert):
        Remove convertEnumeration and move implementation to convert. Add ExceptionThrower
        parameter to retain argument conversion exception specialization and allow future
        specialization for other contexts.

        * bindings/js/JSSubtleCryptoCustom.cpp:
        (WebCore::jsSubtleCryptoFunctionImportKeyPromise):
        (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
        (WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
        (WebCore::jsSubtleCryptoFunctionUnwrapKeyPromise):
        Switch from convertEnumeration<T> to convert<IDLEnumeration<T>>.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GetArgumentExceptionFunction):
        Add (really move from GenerateParametersCheck) enum specific argument conversion exception.

        (PassArgumentExpression):
        Allow the enum specific code for attributes to remain by explicitly checking the context.
        Attribute setters use parseEnumeration<T> explicitly, as WebIDL mandates slightly different
        behavior, specially that they don't throw.

        (GenerateEnumerationImplementationContent):
        (GenerateEnumerationHeaderContent):
        Remove convertEnumeration<T>.

        (GenerateParametersCheck):
        Remove entire branch devoted to enums. The main parameter check is now mature enough
        to handle them.

        (JSValueToNative):
        Like in PassArgumentExpression, we need to retain the specialize behavior for attributes.
        Before, JSValueToNative was only called for enums with a context of IDLAttribute or IDLDictionaryMember,
        but now that we use if IDLArguments as well, it makes more sense to make this check in terms
        of the odd man out, IDLAttribute.

        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.h:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestObj.h:
        * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
        * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
        * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
        * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
        Update test results.

2017-05-23  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Align respondInClosedState with spec
        https://bugs.webkit.org/show_bug.cgi?id=172288

        Reviewed by Chris Dumez.

        Two changes are implemented in this patch:
        - Change #1: An issue was reported to GH [1] while working on respondInClosedState 
        implementation. This issue has now been fixed, and this patch aligns implementation 
        with spec [2].
        - Change #2: In addition, this patch also fixes a bug that went unnoticed as code 
        is not yet reachable (usage of controller.@reader is not valid and is therefore 
        replaced by controller.@controlledReadableStream.@reader).

        [1] https://github.com/whatwg/streams/issues/686
        [2] https://streams.spec.whatwg.org/#readable-byte-stream-controller-respond-in-closed-state

        No added test as:
        - Change #1 does not change behavior;
        - Change #2 is not testable as the code is not yet reachable.

        * Modules/streams/ReadableByteStreamInternals.js:
        (readableByteStreamControllerRespondInClosedState): Aligned with spec.

2017-05-22 Emilio Cobos Álvarez  <ecobos@igalia.com>

        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
        https://bugs.webkit.org/show_bug.cgi?id=171984

        Reviewed by Antti Koivisto.

        The "defaulted to false" is not only because there are spec issues,
        but because I ran the WPT suite, and there was a fair amount of
        crashes and messed render trees.

        Tests: imported/w3c/web-platform-tests/innerText/getter.html

        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::adjustRenderStyle):
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setDisplayContentsEnabled):
        (WebCore::RuntimeEnabledFeatures::displayContentsEnabled):

2017-05-22  Myles C. Maxfield  <mmaxfield@apple.com>

        Update font-style's implementation in the font selection algorithm
        https://bugs.webkit.org/show_bug.cgi?id=169453

        Reviewed by Simon Fraser.

        Previously, we were treating "font-style: oblique" exactly the same as "font-style: italic".
        These values were parsed to the same internal data type. However, variation fonts may have two
        distinct axes: 'slnt' and 'ital'. Therefore, we need to keep a bool of state which represents
        which of these two axes we should be setting when we apply font variations. We can do this by
        making the "font-style" parser a "custom" parser. The implementation of these custom functions
        will set both the italic value on the FontDescription as well as this extra bool.

        We don't, however, want to treat these values as distinct for the purposese of font selection.
        The fact that we treat oblique fonts the same as italic fonts is a feature, not a bug. Therefore,
        the font selection algorithm is not made aware of this distinction. This is why we don't want to
        package up the bool and FontSelectionValue into a class: font selection only cares about the
        FontSelectionValue, so conceptually they shouldn't be joined. (The FontSelectionValue already
        exists within a collection of all the things font selection needs to know about.)

        Now that there is this extra bit of state on the FontDescription, we can do a little better when
        computing the result of getComputedStyle(). Previously, we were always returning "italic" even
        when "oblique" was specified. Now, we can return the correct one. However, this extra bit of
        state is not kept on the CSSFontFace (because it doesn't need to be), which means we can only
        improve the computed style of an element, rather than the cssText of an @font-face rule.

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

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
        (WebCore::fontStyleFromStyle):
        (WebCore::fontShorthandValueForSelectionProperties):
        * css/CSSComputedStyleDeclaration.h:
        * css/CSSFontFaceSet.h:
        * css/CSSProperties.json:
        * css/FontFace.cpp:
        (WebCore::FontFace::style):
        * css/FontSelectionValueInlines.h:
        (WebCore::fontStyleKeyword):
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertFontStyle): Deleted.
        * css/StyleBuilderCustom.h:
        (WebCore::StyleBuilderCustom::applyInitialFontStyle):
        (WebCore::StyleBuilderCustom::applyInheritFontStyle):
        (WebCore::StyleBuilderCustom::applyValueFontStyle):
        * platform/graphics/FontCache.h:
        (WebCore::FontDescriptionKey::makeFlagsKey):
        * platform/graphics/FontDescription.cpp:
        (WebCore::FontDescription::FontDescription):
        * platform/graphics/FontDescription.h:
        (WebCore::FontDescription::shouldUseItalicVariationAxis):
        (WebCore::FontDescription::setShouldUseItalicVariationAxis):
        (WebCore::FontDescription::operator==):
        (WebCore::FontCascadeDescription::initialShouldUseItalicVariationAxis):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::preparePlatformFont):
        (WebCore::fontWithFamily):
        (WebCore::FontCache::createFontPlatformData):
        (WebCore::FontCache::systemFallbackForCharacters):
        * platform/graphics/mac/FontCustomPlatformData.cpp:
        (WebCore::FontCustomPlatformData::fontPlatformData):

2017-05-22  Myles C. Maxfield  <mmaxfield@apple.com>

        Support calc() in font-variation-settings and font-feature-settings
        https://bugs.webkit.org/show_bug.cgi?id=171032

        Reviewed by David Hyatt.

        Tests: css3/font-feature-settings-calc.html
               fast/text/variations/calc.html

        We can use the convenience functions in CSSPropertyParserHelpers.cpp.

        * css/parser/CSSPropertyParser.cpp:
        (WebCore::consumeFontFeatureTag):
        (WebCore::consumeFontVariationTag):

2017-05-22  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, attempt to fix test runner by removing Unicode character from stderr output
        https://bugs.webkit.org/show_bug.cgi?id=168409

        * page/Page.cpp:
        (WebCore::Page::suspendScriptedAnimations):

2017-05-22  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Avoid moving to the second frame of an animated image before the first frame has finished decoding
        https://bugs.webkit.org/show_bug.cgi?id=172461

        Reviewed by Simon Fraser.

        Sometimes the frameCount of an animated image gets changed when more data
        is received. The problem is we may start decoding the image as if it were
        a static large image and the decoding of this first frame finishes after 
        the image starts animating.

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::draw):
        (WebCore::BitmapImage::imageFrameAvailableAtIndex):

2017-05-20  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r215686): O(n^2) algorithm in CachedRawResource::addDataBuffer
        https://bugs.webkit.org/show_bug.cgi?id=172406
        <rdar://32109532>

        Reviewed by Brady Eidson.

        CachedRawResource::calculateIncrementalDataChunk was calling SharedBuffer::data each time the data
        was appended to the SharedBuffer. This causes the data to be copied from two segments to one segment,
        which causes the O(n^2) behavior I was worried about in r215686. These append/data/append/data calls
        used to cause O(1) copies per byte which was amortized because of the exponential growth of the buffer.
        After this change, there should be 0 copies per byte here, and instead a O(log(n)) binary search in the
        call to std::upper_bound to find the next segment of data with a given starting location in the SharedBuffer.
        We need to store the additional information of the offsets of the beginnings of the segments in a
        SharedBuffer. This doesn't asymptotically increase our memory usage, but it does allow us to asymptotically
        decrease the amount of time it takes to find data at a given offset in a SharedBuffer from O(n) to O(log(n)).

        This allows us to complete http://speedtest.xfinity.com and new functionality in SharedBuffer is covered by API tests.

        * loader/TextTrackLoader.cpp:
        (WebCore::TextTrackLoader::processNewCueData):
        * loader/cache/CachedRawResource.cpp:
        (WebCore::CachedRawResource::calculateIncrementalDataChunk):
        (WebCore::CachedRawResource::addDataBuffer):
        (WebCore::CachedRawResource::finishLoading):
        * loader/cache/CachedRawResource.h:
        * platform/SharedBuffer.cpp:
        (WebCore::SharedBuffer::SharedBuffer):
        (WebCore::SharedBuffer::combineIntoOneSegment):
        (WebCore::SharedBuffer::data):
        (WebCore::SharedBuffer::getSomeData):
        (WebCore::SharedBuffer::tryCreateArrayBuffer):
        (WebCore::SharedBuffer::append):
        (WebCore::SharedBuffer::clear):
        (WebCore::SharedBuffer::copy):
        (WebCore::SharedBuffer::internallyConsistent):
        (WebCore::SharedBuffer::hintMemoryNotNeededSoon):
        (WebCore::SharedBufferDataView::SharedBufferDataView):
        (WebCore::SharedBufferDataView::size):
        (WebCore::SharedBufferDataView::data):
        * platform/SharedBuffer.h:
        * platform/cf/SharedBufferCF.cpp:
        (WebCore::SharedBuffer::createCFData):
        (WebCore::SharedBuffer::hintMemoryNotNeededSoon):
        (WebCore::SharedBuffer::append):
        * platform/cocoa/SharedBufferCocoa.mm:
        (WebCore::SharedBuffer::createNSData):
        (WebCore::SharedBuffer::createCFData):
        (WebCore::SharedBuffer::createNSDataArray):

2017-05-22  Chris Dumez  <cdumez@apple.com>

        Resources in cached parsed stylesheets may bypass content blockers
        https://bugs.webkit.org/show_bug.cgi?id=172468
        <rdar://problem/31972693>

        Reviewed by Geoffrey Garen.

        Resources in cached parsed stylesheets could bypass content blockers when they were in the memory cache and
        they did not need revalidation.

        To address the issue, I made StyleSheetContents::subresourcesAllowReuse() to check content blockers.
        If a subresource in the cached stylesheet is blocked, then we return false in subresourcesAllowReuse() and
        the cached parsed stylesheet will not be used.

        No new tests, not currently testable.

        * css/StyleSheetContents.cpp:
        (WebCore::StyleSheetContents::subresourcesAllowReuse):
        * css/StyleSheetContents.h:
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::setCSSStyleSheet):
        * loader/cache/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
        * loader/cache/CachedCSSStyleSheet.h:

2017-05-22  Chris Dumez  <cdumez@apple.com>

        ASSERTION FAILED: tokens.find(item) == notFound in WebCore::DOMTokenList::replace
        https://bugs.webkit.org/show_bug.cgi?id=172473

        Reviewed by Ryosuke Niwa.

        Fix bad assertion in DOMTokenList::replace(). If item == replacement, then the
        assertion was wrong.

        No new tests, unskipped existing test.

        * html/DOMTokenList.cpp:
        (WebCore::DOMTokenList::replace):

2017-05-22  Youenn Fablet  <youenn@apple.com>

        Remove AVAudioCaptureSource
        https://bugs.webkit.org/show_bug.cgi?id=172360

        Reviewed by Sam Weinig.

        No change of behavior, this class is no longer used by default as it does not support echo cancellation.

        * WebCore.xcodeproj/project.pbxproj:
        * page/Settings.cpp:
        (WebCore::Settings::setMediaCaptureRequiresSecureConnection):
        (WebCore::Settings::useAVFoundationAudioCapture): Deleted.
        (WebCore::Settings::setUseAVFoundationAudioCapture): Deleted.
        * page/Settings.h:
        * platform/mediastream/mac/AVAudioCaptureSource.h: Removed.
        * platform/mediastream/mac/AVAudioCaptureSource.mm: Removed.
        * platform/mediastream/mac/AVCaptureDeviceManager.h:
        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
        (WebCore::RealtimeMediaSourceCenterMac::defaultAudioCaptureDeviceManager):
        (WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture): Deleted.
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:

2017-05-22  Brian Burg  <bburg@apple.com>

        Web Inspector: webkit reload policy should match default behavior
        https://bugs.webkit.org/show_bug.cgi?id=171385
        <rdar://problem/31871515>

        Reviewed by Joseph Pecoraro.

        Add an option to PageAgent.reload that tells the backend to use the old
        behavior that revalidates unexpired cached subresources. This used by tests.

        Covered by existing network/memory/disk cache tests.

        * inspector/InspectorPageAgent.h:
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::reload):

2017-05-22  Yoav Weiss  <yoav@yoav.ws>

        [preload] Add media and type attribute support.
        https://bugs.webkit.org/show_bug.cgi?id=171720

        Reviewed by Youenn Fablet.

        Tests: http/wpt/preload/media-attribute.html
               http/wpt/preload/type-attribute.html
               http/tests/preload/viewport/meta-viewport-link-headers.php

        * css/MediaQueryEvaluator.cpp: Move the mediaAttributeMatches code from HTMLResourcePreloader to a central location.
        (WebCore::MediaQueryEvaluator::mediaAttributeMatches):
        * css/MediaQueryEvaluator.h:
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Use isSupportedImageOrSVGMIMEType() instead of checking SVG MIME type specifically.
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::process): Call loadLink() with the media and type attributes.
        * html/parser/HTMLDocumentParser.cpp:
        (WebCore::HTMLDocumentParser::pumpTokenizer): Trigger Link header based preload for links that have the media attribute.
        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): Avoid preloading link resources with non-matching type.
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Collect the type attribute for link resources.
        * html/parser/HTMLResourcePreloader.cpp:
        (WebCore::HTMLResourcePreloader::preload): Use MediaQueryEvaluator::mediaAttributeMatches instead of the local one.
        (WebCore::mediaAttributeMatches): Deleted.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::receivedFirstData): Indicate that only link preloads with no media attribute should be loaded here.
        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::loadLinksFromHeader): Load only links with or without media attributes, according to mode. Also send media and
        type attributes to preloadIfNeeded().
        (WebCore::LinkLoader::isSupportedType): Check if the MIME type is supported for the CachedResource::Type.
        (WebCore::LinkLoader::preloadIfNeeded): Get the media and type attributes and only trigger a preload if media matches and type is supported.
        (WebCore::LinkLoader::loadLink): Pass along the media and type attributes.
        * loader/LinkLoader.h:
        * platform/MIMETypeRegistry.cpp:
        (WebCore::MIMETypeRegistry::isSupportedImageOrSVGMIMEType): Check if MIME type is supported for an image, or is an SVG mime type.
        (WebCore::MIMETypeRegistry::isSupportedStyleSheetMIMEType): Check if MIME type is supported for a stylesheet.
        (WebCore::MIMETypeRegistry::isSupportedFontMIMEType): Check if MIME type is supported for a font.
        (WebCore::MIMETypeRegistry::isSupportedTextTrackMIMEType): Check if MIME type is supported for a text track.
        * platform/MIMETypeRegistry.h:

2017-05-22  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [CG] Use the SPI CGImageSourceGetTypeWithData() to get the typeIdentifierHint of an image
        https://bugs.webkit.org/show_bug.cgi?id=172405

        Reviewed by Simon Fraser.

        Use CGImageSourceGetTypeWithData() to get the typeIdentifierHint which will
        be passed to CGImageSourceCreateIncremental(). If data is insufficient to
        guess typeIdentifierHint, that means the image size is still not available.
        In this case, CachedImage::addIncrementalDataBuffer() will call error()
        which will call clear() which will call Image::destroyDecodedData()
        which will delete the current ImageDecoder and creates a new one. So we
        don't need to check the return value insufficientData.

        * platform/graphics/DecodingOptions.h: Fix the header file dependencies.
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::ensureDecoderAvailable): No need for the URL parameter.
        * platform/graphics/ImageTypes.h: Move a typedef from ImageDecoderCG.h to ImageTypes.h.
        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::ImageDecoder::ImageDecoder): Pass the SharedBuffer data to the constructor.
        * platform/graphics/cg/ImageDecoderCG.h:
        (WebCore::ImageDecoder::create): No need for the URL argument.
        * platform/graphics/win/ImageDecoderDirect2D.h:
        (WebCore::ImageDecoder::create): Remove the URL argument from the function signature.
        * platform/image-decoders/ImageDecoder.cpp:
        (WebCore::ImageDecoder::create): Remove the URL argument from the function signature.
        * platform/image-decoders/ImageDecoder.h:
        * platform/spi/cg/ImageIOSPI.h: Add the prototype of CGImageSourceGetTypeWithData().

2017-05-22  Zalan Bujtas  <zalan@apple.com>

        SameSizeAsInlineBox mismatch on ARMV7.
        https://bugs.webkit.org/show_bug.cgi?id=172459

        Reviewed by Simon Fraser.

        Due to the ARMV7/i386 padding behaviour mismatch, forcing m_bitfields to be 32bits does not always
        produce the desired padding.
        Move the bool to the end of the member list and let m_deletionSentinel (4bytes) force
        padding.

        * rendering/InlineBox.cpp:
        * rendering/InlineBox.h:

2017-05-22  Myles C. Maxfield  <mmaxfield@apple.com>

        Enable the woff2-variations @font-face format identifier
        https://bugs.webkit.org/show_bug.cgi?id=172425

        Reviewed by Andreas Kling.

        We support woff2, and woff-variations, but not woff2-variations.
        https://github.com/w3c/csswg-drafts/commit/5c914a8a0382734bd420090a89bc19b32e6c302d

        Test: fast/text/variations/font-face-format-woff2.html

        * platform/graphics/mac/FontCustomPlatformData.cpp:
        (WebCore::FontCustomPlatformData::supportsFormat):

2017-05-22  Antoine Quint  <graouts@apple.com>

        [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
        https://bugs.webkit.org/show_bug.cgi?id=168409

        Reviewed by Simon Fraser.

        Remove all the custom logging code we wrote to diagnose why this specific test failed and instead
        log the backtrace when the ScriptedAnimationController gets suspended, which should allow us to
        identify which test actually leads to suspension and affects this particular test.

        * Modules/modern-media-controls/controls/scheduler.js:
        (const.scheduler.new.prototype.scheduleLayout):
        (const.scheduler.new.prototype.unscheduleLayout):
        (const.scheduler.new.prototype._requestFrameIfNeeded):
        (const.scheduler.new.prototype._frameDidFire):
        (const.scheduler.new.prototype._layout):
        * dom/Document.cpp:
        (WebCore::Document::requestAnimationFrame):
        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::suspend):
        (WebCore::ScriptedAnimationController::resume):
        (WebCore::ScriptedAnimationController::addThrottlingReason):
        (WebCore::ScriptedAnimationController::removeThrottlingReason):
        (WebCore::ScriptedAnimationController::registerCallback):
        (WebCore::ScriptedAnimationController::cancelCallback):
        (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
        (WebCore::ScriptedAnimationController::scheduleAnimation):
        (WebCore::ScriptedAnimationController::dispatchLoggingEventIfRequired): Deleted.
        * dom/ScriptedAnimationController.h:
        * page/Page.cpp:
        (WebCore::Page::suspendScriptedAnimations):
        * page/Settings.in:
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::resetToConsistentState):
        (WebCore::InternalSettings::shouldDispatchRequestAnimationFrameEvents): Deleted.
        (WebCore::InternalSettings::setShouldDispatchRequestAnimationFrameEvents): Deleted.
        * testing/InternalSettings.h:
        * testing/InternalSettings.idl:

2017-05-22  Emilio Cobos Álvarez  <ecobos@igalia.com>

        Don't unconditionally reset TextIterator::m_handledChildren for display: contents nodes.
        https://bugs.webkit.org/show_bug.cgi?id=172443

        This avoids an infinite hang when enabling display: contents in bug 171984.

        Reviewed by Antti Koivisto.

        No new tests. Relanding bug 171984 will add test coverage for this.

        * editing/TextIterator.cpp:
        (WebCore::hasDisplayContents):
        (WebCore::fullyClipsContents):
        (WebCore::TextIterator::advance):

2017-05-22  Sam Weinig  <sam@webkit.org>

        [WebIDL] Support callbacks with arbitrary return types
        https://bugs.webkit.org/show_bug.cgi?id=172407

        Reviewed by Chris Dumez.

        - Adds and adopts CallbackResult<> template class that encapsulates a return value
          and status from a javascript callback.
        - Updates NodeIterator/TreeWalker to explicitly propagate exceptions thrown from
          a JSNodeFilter, rather than relying on the JSNodeFilter to catch them (seemingly
          accidentally).

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        Update file lists.

        * Modules/geolocation/PositionCallback.h:
        * Modules/geolocation/PositionErrorCallback.h:
        * Modules/notifications/NotificationPermissionCallback.h:
        * Modules/webaudio/AudioBufferCallback.h:
        * Modules/webdatabase/DatabaseCallback.h:
        * dom/RequestAnimationFrameCallback.h:
        * dom/StringCallback.h:
        * dom/Traversal.cpp:
        * fileapi/BlobCallback.h:
        * html/VoidCallback.h:
        * page/IntersectionObserverCallback.h:
        * page/PerformanceObserverCallback.h:
        * css/MediaQueryListListener.h:
        * Modules/webdatabase/SQLStatement.h:
        * Modules/webdatabase/SQLStatementCallback.h:
        * Modules/webdatabase/SQLStatementErrorCallback.h:
        * Modules/webdatabase/SQLTransaction.cpp:
        * Modules/webdatabase/SQLTransactionCallback.h:
        * Modules/webdatabase/SQLTransactionErrorCallback.h:
        * inspector/InspectorDatabaseAgent.cpp:
        Adopt CallbackResult.

        * Modules/webdatabase/SQLStatementErrorCallback.idl:
        Remove Custom extended attribute annotation.

        * Modules/webdatabase/SQLStatement.cpp:
        (WebCore::SQLStatement::performCallback):
        Adopt CallbackResult, migrating logic from JSSQLStatementErrorCallbackCustom
        into the implementation, by way of the status enum.

        * bindings/IDLTypes.h:
        Add IDLVoid type.

        * bindings/js/JSNodeFilterCustom.cpp: Removed.
        * bindings/js/JSSQLStatementErrorCallbackCustom.cpp: Removed.
        Remove now unneeded custom bindings.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateIndexedGetter):
        (GenerateNamedGetter):
        (GenerateImplementation):
        (GenerateImplementationFunctionCall):
        Update for new NativeToJSValue arguments.

        (GenerateCallbackHeaderContent):
        (GenerateCallbackImplementationContent):
        Remove requirement of only void return types and update return type to use CallbackFunction.
        Also adds necessary conversion of return value.

        (GetBaseIDLType):
        Add void IDL type mapping.

        (IsValidContextForJSValueToNative):
        Add operation as valid context, as that is what the callback return type's context is.

        (NativeToJSValueUsingReferences):
        (NativeToJSValueUsingPointers):
        (NativeToJSValue):
        Rework NativeToJSValueUsingReferences/NativeToJSValueUsingPointers to take a global object reference
        accessor rather than a thisObject accessor, as a thisObject is not always available, and what the function
        actually wants is the global object.

        * bindings/scripts/IDLAttributes.json:
        Add new RethrowException attribute to instruct the callback function to re-throw, rather than
        just report, exceptions thrown in the callback and SkipCallbackInvokeCheck which instructs the
        callback function to not check canInvokeCallback() before calling. These will both be needed to retain
        the behavior of NodeFilter, and should be investigated further.

        * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunction.h:
        * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp: Added.
        * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h: Added.
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.h:
        * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp: Added.
        * bindings/scripts/test/JS/JSTestVoidCallbackFunction.h: Added.
        * bindings/scripts/test/TestCallbackFunction.idl:
        * bindings/scripts/test/TestCallbackInterface.idl:
        * bindings/scripts/test/TestVoidCallbackFunction.idl: Copied from Source/WebCore/bindings/scripts/test/TestCallbackFunction.idl.
        Update test results and add some additional test cases for callback functions and callback interface functions that return
        non-void and use the RethrowExceptions.

        * dom/CallbackResult.h: Added.
        (WebCore::CallbackResult<ReturnType>::CallbackResult):
        (WebCore::CallbackResult<ReturnType>::type):
        (WebCore::CallbackResult<void>::CallbackResult):
        (WebCore::CallbackResult<void>::type):
        New class to encapsulate the return value and status of a callback function. Modeled loosely on
        ExceptionOr, but is simpler since it does not need to handle complex exception objects.

        * dom/NativeNodeFilter.cpp:
        * dom/NativeNodeFilter.h:
        Adopt CallbackResult, matching other NodeFiltering code by using
        unsigned short rather than short, remove unused functions, and convert 
        condition member to a Ref, allowing us to get rid of the branch acceptNode.

        * dom/NodeFilter.h:
        Adopt CallbackResult.

        * dom/NodeFilter.idl:
        Replace Custom extended attribute with SkipCallbackInvokeCheck and RethrowException.

        * dom/NodeFilterCondition.cpp:
        * dom/NodeFilterCondition.h:
        Modernize to take a Node reference and match other filtering code
        by returning an unsigned short.

        * dom/Traversal.cpp:
        * dom/Traversal.h:
        Adopt CallbackResult and match other node filtering code by using unsigned short 
        rather than short.

        * dom/NodeIterator.cpp:
        * dom/NodeIterator.h:
        * dom/NodeIterator.idl:
        * dom/TreeWalker.cpp:
        * dom/TreeWalker.h:
        * dom/TreeWalker.idl:
        Change functions that callout to javascript via the NodeFilter to 
        return ExceptionOr<Node>. Check the result of CallbackResult for a
        thrown exception, and bail, returning Exception { ExistingExceptionError }
        which acts as an indicator to the bindings that an exception was thrown.
        (In actuality, the specific exception code does not matter. All that matters
        is that an ExceptionOr<> is returned, which triggers, via overload, a path
        in toJS() that calls propagateException(), which in turn, checks to see if
        an exception is on the stack. But, having an explicit code here helps debugging).

2017-05-22  Simon Fraser  <simon.fraser@apple.com>

        Support transform-box to switch sizing box in SVG
        https://bugs.webkit.org/show_bug.cgi?id=145783

        Reviewed by Dean Jackson.

        Add support for the CSS "transform-box" property, as described at
        <https://drafts.csswg.org/css-transforms/#transform-box>.
        
        This changes the behavior of percentage values in transform-origin in SVG.
        When these were added in r110532, percentage values in transform-origin were made
        relative to the bounding box, but absolute values relative to the view box.
        <https://github.com/w3c/csswg-drafts/issues/895> has concluded that this behavior
        is confusing. The new behavior is that, for SVG elements, both absolute and
        percentage values are relative to the reference box, which is specified by the
        new transform-box property.

        The initial value for transform-box is border-box, with the svg.css UA stylesheet
        supplying a default of view-box for the relevant SVG elements per
        <https://www.w3.org/TR/SVG2/styling.html#UAStyleSheet>.

        For non-SVG elements, the used value is always border-box, so there is no change
        in behavior.

        Tests: fast/css/transform-box-parsing.html
               svg/transforms/svg-transform-box.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::propertyValue):
        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator TransformBox):
        * css/CSSProperties.json:
        * css/CSSValueKeywords.in:
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::CSSPropertyParser::parseSingleValue):
        * css/svg.css:
        (*:not(svg),):
        (*): Deleted.
        (html|* > svg): Deleted.
        * page/animation/AnimationBase.cpp:
        (WebCore::AnimationBase::computeTransformedExtentViaTransformList):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::applyTransform): The transformOriginX().isPercent() tests
        were added to support the weird "% values are relative to bounding box" in SVG. Now
        it's up to the caller to pass a non-zero origin when that matters, and
        SVGGraphicsElement::animatedLocalTransform() is the only caller that does so.
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::hasTransform):
        (WebCore::RenderStyle::transformBox):
        (WebCore::RenderStyle::setTransformBox):
        (WebCore::RenderStyle::initialTransformBox):
        * rendering/style/RenderStyleConstants.h:
        * rendering/style/StyleTransformData.cpp:
        (WebCore::StyleTransformData::StyleTransformData):
        (WebCore::StyleTransformData::operator==):
        * rendering/style/StyleTransformData.h:
        * svg/SVGGraphicsElement.cpp:
        (WebCore::SVGGraphicsElement::animatedLocalTransform): Consult the transform-box
        style to compute the reference box as the bounding box, or the view box.

2017-05-22  Chris Dumez  <cdumez@apple.com>

        Add support for [LegacyWindowAlias] IDL extended attribute
        https://bugs.webkit.org/show_bug.cgi?id=172451

        Reviewed by Sam Weinig.

        Add support for [LegacyWindowAlias] IDL extended attribute as per:
        - https://heycam.github.io/webidl/#LegacyWindowAlias

        Use it for our legacy window aliases, such as webKitURL.

        No new tests, there should be no Web-exposed behavior change.

        * bindings/scripts/IDLAttributes.json:
        * bindings/scripts/preprocess-idls.pl:
        (GenerateConstructorAttributes):
        * css/DOMMatrix.idl:
        * dom/MutationObserver.idl:
        * dom/XMLDocument.idl:
        * html/DOMURL.idl:
        * page/DOMWindow.idl:

2017-05-22  Jer Noble  <jer.noble@apple.com>

        ASSERTION FAILED: m_boundThread == currentThread() in WTF::WeakReference<WebCore::WebCoreDecompressionSession>::clear()
        https://bugs.webkit.org/show_bug.cgi?id=172457
        <rdar://problem/32329436>

        Reviewed by Eric Carlson.

        Remove vestigal WeakPtrFactory that was entirely unused.

        * platform/graphics/cocoa/WebCoreDecompressionSession.h:
        (WebCore::WebCoreDecompressionSession::createWeakPtr): Deleted.
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::WebCoreDecompressionSession):

2017-05-22  Antti Koivisto  <antti@apple.com>

        Crash in WebCore::StyleRuleKeyframes::findKeyframeIndex
        https://bugs.webkit.org/show_bug.cgi?id=170756
        <rdar://problem/31573157>

        Reviewed by Andreas Kling.

        Using a malformed key with CSSKeyframesRule.findRule crashes because
        CSSParser::parseKeyframeKeyList returns null which is then dereferenced.

        * css/CSSKeyframesRule.cpp:
        (WebCore::StyleRuleKeyframes::findKeyframeIndex): Null test.

2017-05-22  Wenson Hsieh  <wenson_hsieh@apple.com>

        Remove unused documentIsHandlingNonDefaultDrag plumbing for WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=172453

        Reviewed by Tim Horton.

        Removes unused plumbing that was originally added to support file uploads. No new tests, since there is no
        change in behavior.

        * page/DragController.h:
        (WebCore::DragController::documentIsHandlingNonDefaultDrag): Deleted.

2017-05-22  Jer Noble  <jer.noble@apple.com>

        Media element thinks its hidden when in PiP mode and tab is backgrounded.
        https://bugs.webkit.org/show_bug.cgi?id=172221

        Reviewed by Eric Carlson.

        The element should not be considered hidden when in legacy fullscreen mode or PiP mode.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::visibilityStateChanged):
        (WebCore::HTMLMediaElement::fullscreenModeChanged):

2017-05-22  Zan Dobersek  <zdobersek@igalia.com>

        NavigatorEME: null RefPtr<> dereference due to different calling conventions
        https://bugs.webkit.org/show_bug.cgi?id=172352

        Reviewed by Carlos Garcia Campos.

        * Modules/encryptedmedia/NavigatorEME.cpp:
        (WebCore::tryNextSupportedConfiguration): Avoid crashes when constructing
        the MediaKeySystemAccess::create() arguments that can occur for targets with
        calling conventions that might release the implementation RefPtr<> before it's
        dereferenced to retrieve the key system string. Simply acquire the reference
        to the key system String object before the MediaKeySystem::create() call
        expression that releases the problematic RefPtr<>.

2017-05-22  Gwang Yoon Hwang  <yoon@igalia.com>

        [CoordinatedGraphics] Clear UpdateAtlases for each tests
        https://bugs.webkit.org/show_bug.cgi?id=172119

        Reviewed by Carlos Garcia Campos.

        * loader/EmptyClients.h:
        * page/ChromeClient.h:
        * testing/Internals.cpp:
        (WebCore::Internals::resetToConsistentState): Clears update atlases
        while resetting states of the test runner.

2017-05-22  Gwang Yoon Hwang  <yoon@igalia.com>

        [CoordinatedGraphics] BitmapTexturePool does not release textures properly
        https://bugs.webkit.org/show_bug.cgi?id=172428

        Reviewed by Žan Doberšek.

        No new tests because no behavior change.

        * platform/graphics/texmap/BitmapTexturePool.cpp:
        (WebCore::BitmapTexturePool::BitmapTexturePool):
        Use the RunLoopTimer instead of Timer, because BitmapTexturePool would
        run on the compositing thread in Coordinated Graphics case.
        (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
        We should check not only the last used time but also the refcounts of the
        texture when selecting textures to remove.
        * platform/graphics/texmap/BitmapTexturePool.h:
        (WebCore::BitmapTexturePool::Entry::canBeReleased): Added.

2017-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE] Use surfaceless context for sharing and offscreen context if available
        https://bugs.webkit.org/show_bug.cgi?id=172268

        Reviewed by Žan Doberšek.

        Like GTK+ port does, WPE should use surfaceless contexts when possible, and only create a native offscreen
        context as a fallback. We don't need to do anything special in WPE port, just to make it consistent with the
        Wayland and X11 implementations. We should also avoid including EGL.h in headers, we added
        GLContextEGLWayland.cpp and GLContextEGLX11.cpp to avoid that. PlatformDisplayWPE::EGLOffscreenTarget is quite
        simple and only used by GLContextEGLWPE, so we could move it there like we do for Wayland and X11.

        * platform/graphics/GLContext.h: Remove EGL header includes.
        * platform/graphics/egl/GLContextEGL.cpp:
        (WebCore::GLContextEGL::createWindowContext): Use createWindowSurfaceWPE() in WPE.
        (WebCore::GLContextEGL::createContext): Use createWPEContext in WPE.
        (WebCore::GLContextEGL::createSharingContext): Move the WPE code below to ensure we try
        createSurfacelessContext() first.
        * platform/graphics/egl/GLContextEGL.h:
        * platform/graphics/egl/GLContextEGLWPE.cpp:
        (WebCore::GLContextEGL::GLContextEGL): Add constructor for WPE that receives a struct wpe_renderer_backend_egl_offscreen_target*
        (WebCore::GLContextEGL::createWindowSurfaceWPE): Added implementation here because eglCreateWindowSurface needs
        the platform specific EGL includes and definitions.
        (WebCore::GLContextEGL::createWPEContext): Create a GLContext using WPE backend API directly here.
        (WebCore::GLContextEGL::destroyWPETarget): Add null check.
        * platform/graphics/wpe/PlatformDisplayWPE.cpp: Remove EGLOffscreenTarget.
        * platform/graphics/wpe/PlatformDisplayWPE.h:

2017-05-21  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Remove Firefox user agent quirk for Google domains
        https://bugs.webkit.org/show_bug.cgi?id=171941

        Reviewed by Carlos Garcia Campos.

        * platform/UserAgentQuirks.cpp:
        (WebCore::UserAgentQuirks::quirksForURL):
        (WebCore::UserAgentQuirks::stringForQuirk):
        (WebCore::urlRequiresFirefoxBrowser): Deleted.
        (WebCore::UserAgentQuirks::firefoxRevisionString): Deleted.
        * platform/UserAgentQuirks.h:
        * platform/gtk/UserAgentGtk.cpp:
        (WebCore::buildUserAgentString):

2017-05-21  Antti Koivisto  <antti@apple.com>

        matchMedia('print').addListener() fires in WK1 but never in WK2 when printing (breaks printing Google maps, QuickLooks)
        https://bugs.webkit.org/show_bug.cgi?id=172361
        <rdar://problem/28777408>

        Reviewed by Sam Weinig.

        Test: fast/media/matchMedia-print.html

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

            Evaluate matchMedia queries unconditionally. No idea why it wasn't like that.

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

            Add testing support. The existing ways to do printing testing were unable to hit this bug as
            they had too much additional gunk.

        * testing/Internals.h:
        * testing/Internals.idl:

2017-05-21  Zalan Bujtas  <zalan@apple.com>

        Remove redundant FrameView ref in FrameView::performPostLayoutTasks
        https://bugs.webkit.org/show_bug.cgi?id=172422

        Reviewed by Antti Koivisto.

        This was added to protect FrameView from getting destroyed in updateEmbeddedObjects(), but r169475 changed
        the embedded object update to be asynchronous.  

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

2017-05-20  Chris Dumez  <cdumez@apple.com>

        Drop [NoInterfaceObject] from RTCDTMFSender and RTCStatsReport
        https://bugs.webkit.org/show_bug.cgi?id=172418

        Reviewed by Youenn Fablet.

        Drop [NoInterfaceObject] from RTCDTMFSender and RTCStatsReport to match the specification:
        - https://www.w3.org/TR/webrtc/#rtcdtmfsender
        - https://www.w3.org/TR/webrtc/#rtcstatsreport-object

        Firefox exposes both RTCDTMFSender and RTCStatsReport. Chrome exposes RTCStatsReport only.
        RTCDTMFSender seems to be currently disabled at build time currently so the change to
        its interface does not currently impact Web-exposed behavior, only the change to the
        RTCStatsReport interface currently does.

        No new tests, rebaselined existing test.

        * Modules/mediastream/RTCDTMFSender.idl:
        * Modules/mediastream/RTCStatsReport.idl:
        Drop [NoInterfaceObject].

        * Modules/mediastream/RTCIceCandidateEvent.cpp: Removed.
        * Modules/mediastream/RTCIceCandidateEvent.h: Removed.
        * Modules/mediastream/RTCIceCandidateEvent.idl: Removed.
        Drop class and IDL that are no longer used. They were not even part of any project files.
        RTCIceCandidateEvent has been renamed to RTCPeerConnectionIceEvent, which we support.

2017-05-20  Chris Dumez  <cdumez@apple.com>

        Value for iterator property is wrong for maplike interfaces
        https://bugs.webkit.org/show_bug.cgi?id=172410

        Reviewed by Sam Weinig.

        Value for iterator property was wrong for maplike interfaces. The iterator property is
        supposed to have the same value as the 'entries' property but we were using the value
        of the 'values' property.

        Specification:
        - https://heycam.github.io/webidl/#es-map-entries
        - https://heycam.github.io/webidl/#es-iterator

        This impacts the iterator of the RTCStatsReport interface.

        No new tests, updated existing test.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):
        * bindings/scripts/test/JS/JSMapLike.cpp:
        (WebCore::JSMapLikePrototype::finishCreation):
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        (WebCore::JSReadOnlyMapLikePrototype::finishCreation):

2017-05-20  Chris Dumez  <cdumez@apple.com>

        Drop superfluous iterator property setting in addValueIterableMethods()
        https://bugs.webkit.org/show_bug.cgi?id=172409

        Reviewed by Youenn Fablet.

        Drop superfluous iterator setting in addValueIterableMethods(). The bindings already take care of
        adding the iterator property before calling addValueIterableMethods().

        No new tests, no Web-facing behavior change.

        * bindings/js/JSDOMIterator.cpp:
        (WebCore::addValueIterableMethods):

2017-05-20  Jer Noble  <jer.noble@apple.com>

        [MSE][Mac] Support painting MSE video-element to canvas
        https://bugs.webkit.org/show_bug.cgi?id=125157
        <rdar://problem/23062016>

        Reviewed by Eric Carlson.

        Test: media/media-source/media-source-paint-to-canvas.html

        In order to have access to decoded video data for painting, decode the encoded samples manually
        instead of adding them to the AVSampleBufferDisplayLayer. To facilitate doing so, add a new
        utility class WebCoreDecompressionSession, which can decode samples and store them.

        For the purposes of this patch, to avoid double-decoding of video data and to avoid severe complication
        of our sample delivery pipeline, we will only support painting of decoded video samples when the video is
        not displayed in the DOM.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::seekToTime): Always send waitForSeekCompleted() to give private a chance to delay seek completion.
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples): Added.
        * Modules/mediasource/SourceBuffer.h:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/cf/CoreMediaSoftLink.cpp: Added new soft link macros.
        * platform/cf/CoreMediaSoftLink.h: Ditto.
        * platform/cocoa/CoreVideoSoftLink.cpp: Ditto.
        * platform/cocoa/CoreVideoSoftLink.h: Ditto.
        * platform/graphics/SourceBufferPrivateClient.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sampleBufferDisplayLayer): Simple accessor.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::decompressionSession): Ditto.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Update whether we should be displaying in a layer or decompression session..
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible): Ditto.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted): m_seeking is now an enum.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seeking): Ditto.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted): Ditto. If waiting for a video frame, delay completing seek.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::nativeImageForCurrentTime): Call updateLastImage() and return result.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastImage): Fetch the image for the current time.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint): Pass to paintCurrentFrameInCanvas.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext): Get a native image, and render it.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged): Create or destroy a layer or decompression session as appropriate.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer): Creates a layer.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer): Destroys a layer.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureDecompressionSession): Creates a decompression session.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyDecompressionSession): Destroys a decompression session.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame): If seek completion delayed, complete now. Ditto for ready state change.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState): If waiting for a video frame, delay ready state change.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Deleted.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer): Deleted.
        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
        (WebCore::MediaSourcePrivateAVFObjC::hasVideo): Promote to a class function.
        (WebCore::MediaSourcePrivateAVFObjC::hasSelectedVideo): Return whether any of the active source buffers have video and are selected.
        (WebCore::MediaSourcePrivateAVFObjC::hasSelectedVideoChanged): Call setSourceBufferWithSelectedVideo().
        (WebCore::MediaSourcePrivateAVFObjC::setVideoLayer): Set (or clear) the layer on the selected buffer.
        (WebCore::MediaSourcePrivateAVFObjC::setDecompressionSession): Ditto for decompression session.
        (WebCore::MediaSourcePrivateAVFObjC::setSourceBufferWithSelectedVideo): Remove the layer and decompression session from the unselected

                buffer and add the decompression session or layer to the newly selected buffer.
        (WebCore::MediaSourcePrivateAVFObjCHasVideo): Deleted.
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers): Clear the videoLayer and decompressionSession.
        (WebCore::SourceBufferPrivateAVFObjC::hasSelectedVideo): Return whether the buffer has a selected video track.
        (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): The media player now manages the video layer and decompression session lifetimes.
        (WebCore::SourceBufferPrivateAVFObjC::flush): Flush the decompression session, if it exists.
        (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Enqueue to the decompression session, if it exists.
        (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): As the decompression session, if it exists.
        (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): Tell the decompression session to stop requesting data, if it exists.
        (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): Request media data from the decompression session, if it exists.
        (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer): Added.
        (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): Added.
        * platform/graphics/cocoa/WebCoreDecompressionSession.h: Added.
        (WebCore::WebCoreDecompressionSession::create):
        (WebCore::WebCoreDecompressionSession::isInvalidated):
        (WebCore::WebCoreDecompressionSession::createWeakPtr):
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm: Added.
        (WebCore::WebCoreDecompressionSession::WebCoreDecompressionSession): Register for media data requests.
        (WebCore::WebCoreDecompressionSession::invalidate):  Unregister for same.
        (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaDataCallback): Pass to maybeBecomeReadyForMoreMediaData.
        (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaData): Check in-flight decodes, and decoded frame counts.
        (WebCore::WebCoreDecompressionSession::enqueueSample): Pass the sample to be decoded on a background queue.
        (WebCore::WebCoreDecompressionSession::decodeSample): Decode the sample.
        (WebCore::WebCoreDecompressionSession::decompressionOutputCallback): Call handleDecompressionOutput.
        (WebCore::WebCoreDecompressionSession::handleDecompressionOutput): Pass decoded sample to be enqueued on the main thread.
        (WebCore::WebCoreDecompressionSession::getFirstVideoFrame):
        (WebCore::WebCoreDecompressionSession::enqueueDecodedSample): Enqueue the frame (if it's a displayed frame).
        (WebCore::WebCoreDecompressionSession::isReadyForMoreMediaData): Return whether we've hit our high water sample count.
        (WebCore::WebCoreDecompressionSession::requestMediaDataWhenReady):
        (WebCore::WebCoreDecompressionSession::stopRequestingMediaData): Unset the same.
        (WebCore::WebCoreDecompressionSession::notifyWhenHasAvailableVideoFrame): Set a callback to notify when a decoded frame has been enqueued.
        (WebCore::WebCoreDecompressionSession::imageForTime): Successively dequeue images until reaching one at or beyond the requested time.
        (WebCore::WebCoreDecompressionSession::flush): Synchronously empty the producer and consumer queues.
        (WebCore::WebCoreDecompressionSession::getDecodeTime): Utility method.
        (WebCore::WebCoreDecompressionSession::getPresentationTime): Ditto.
        (WebCore::WebCoreDecompressionSession::getDuration): Ditto.
        (WebCore::WebCoreDecompressionSession::compareBuffers): Ditto.
        * platform/cocoa/VideoToolboxSoftLink.cpp: Added.
        * platform/cocoa/VideoToolboxSoftLink.h: Added.

2017-05-19  Joseph Pecoraro  <pecoraro@apple.com>

        WebAVStreamDataParserListener String leak
        https://bugs.webkit.org/show_bug.cgi?id=172395

        Reviewed by Chris Dumez.

        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]):
        (-[WebAVStreamDataParserListener streamDataParser:didReachEndOfTrackWithTrackID:mediaType:]):
        Use an isolated String in a lambda used across threads.

2017-05-19  Chris Dumez  <cdumez@apple.com>

        Consider not exposing webkitURL in workers
        https://bugs.webkit.org/show_bug.cgi?id=172166

        Reviewed by Geoffrey Garen.

        Drop webkitURL alias for URL in workers, to match other browsers. The risk should
        be low given that this only impacts workers, we expose URL to workers and Blink
        does not have this alias. We still support the webkitURL alias for URL on Window.

        No new tests, rebaselined existing test.

        * workers/WorkerGlobalScope.idl:

2017-05-19  Youenn Fablet  <youenn@apple.com>

        Add RTCPeerConnection connection state change logging
        https://bugs.webkit.org/show_bug.cgi?id=172314

        Reviewed by Eric Carlson.

        No change of behavior.
        Adding some release logging of connection state changes.

        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::rtcIceGatheringStateToString):
        (WebCore::RTCPeerConnection::updateIceGatheringState):
        (WebCore::rtcIceConnectionStateToString):
        (WebCore::RTCPeerConnection::updateIceConnectionState):

2017-05-19  Jeremy Jones  <jeremyj@apple.com>

        webkitSupportsFullscreen and webkitSupportsPresentationMode('fullscreen') disagree.
        https://bugs.webkit.org/show_bug.cgi?id=172329
        rdar://problem/32260891

        Reviewed by Darin Adler.

        Updated tests:
        * media/media-fullscreen-inline-expected.txt:
        * media/media-fullscreen-not-in-document-expected.txt:
        * media/media-fullscreen.js:

        webkitSupportsPresentationMode('fullscreen') should delegate to webkitSupportsFullscreen.
        The additional mediaSession().fullscreenPermitted() check causes it to return false when
        not handling a user gesture, which isn't helpful to deciding to show a button in controls
        or not.

        * html/HTMLVideoElement.cpp:
        (WebCore::HTMLVideoElement::webkitSupportsPresentationMode):

2017-05-19  Jeremy Jones  <jeremyj@apple.com>

        Prevent javascript interface from activating picture-in-picture for video elements that are showing capture camera on ios.
        https://bugs.webkit.org/show_bug.cgi?id=172328

        Reviewed by Eric Carlson.

        This change allows MediaPlayers to decide if they support pictureInPicture.
        And check this from supportsFullscreen().

        In MediaPlayerPrivateMediaStreamAVFObjC disable pip if there is a capture video track.
        Elsewhere, leave it enabled.

        * html/HTMLVideoElement.cpp:
        (WebCore::HTMLVideoElement::supportsFullscreen): Added Check.
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::supportsPictureInPicture): Added.
        * platform/graphics/MediaPlayer.h:
        * platform/graphics/MediaPlayerPrivate.h:
        (WebCore::MediaPlayerPrivateInterface::supportsPictureInPicture): Added.
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsPictureInPicture): Added
        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::MediaPlayerPrivateQTKit::supportsFullscreen): Deleted. Moved inline.

2017-05-19  Chris Dumez  <cdumez@apple.com>

        Do not fire load event for SVGElements that are detached or in frameless documents
        https://bugs.webkit.org/show_bug.cgi?id=172289
        <rdar://problem/32275689>

        Reviewed by Ryosuke Niwa.

        We should not fire load event for SVGElements that are detached or in frameless
        documents.

        Test: svg/load-event-detached.html

        * svg/SVGElement.cpp:
        (WebCore::SVGElement::sendSVGLoadEventIfPossible):

2017-05-19  Chris Dumez  <cdumez@apple.com>

        Option() named constructor is not per spec
        https://bugs.webkit.org/show_bug.cgi?id=172185

        Reviewed by Sam Weinig.

        Align the behavior of the Option() named constructor with the HTML specification:
        - https://html.spec.whatwg.org/#dom-option

        In particular, we no longer create an empty Text child node if the input text is the empty string.
        This also aligns our behavior with Firefox.

        Test: imported/w3c/web-platform-tests/html/semantics/forms/the-option-element/option-element-constructor.html

        * html/HTMLOptionElement.cpp:
        (WebCore::HTMLOptionElement::createForJSConstructor):
        * html/HTMLOptionElement.h:
        * html/HTMLOptionElement.idl:

2017-05-19  Chris Dumez  <cdumez@apple.com>

        URLSearchParams / Headers objects @@iterator is not as per Web IDL spec
        https://bugs.webkit.org/show_bug.cgi?id=172218

        Reviewed by Youenn Fablet.

        Both URLSearchParams and Headers interfaces are iterable as per their
        respective specification, and they both have a pair iterator:
        - https://url.spec.whatwg.org/#interface-urlsearchparams
        - https://fetch.spec.whatwg.org/#headers-class

        As per the WebIDL specification for 'entries'[1], "If the interface has a pair
        iterator, then the Function object is the value of the @@iterator property",
        the value of @@iterator being defined at [2]. In WebKit, we were using
        different values/functions for 'entries' and @@iterator, although those
        functions were doing the same thing (and the right thing).

        Also, as per [2], the name of the @@iterator function should be "entries",
        which I also implemented in this patch. Previously, we were using
        "[Symbol.Iterator]" as function name.

        [1] https://heycam.github.io/webidl/#es-iterable-entries
        [2] https://heycam.github.io/webidl/#es-iterator

        No new tests, rebaselined existing tests.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):
        (GenerateImplementationIterableFunctions):
        * bindings/scripts/test/JS/JSMapLike.cpp:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        (WebCore::JSTestIterablePrototype::finishCreation):
        (WebCore::jsTestIterablePrototypeFunctionEntriesCaller):
        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::JSTestNodePrototype::finishCreation):
        (WebCore::jsTestNodePrototypeFunctionEntriesCaller):

2017-05-19  Zalan Bujtas  <zalan@apple.com>

        Redundant ellipsis box triggers ASSERT_WITH_SECURITY_IMPLICATION in InlineBox::parent().
        https://bugs.webkit.org/show_bug.cgi?id=172309
        <rdar://problem/32262357>

        Reviewed by Simon Fraser.

        This patch stops the redundant ellipsis box trigger ASSERT_WITH_SECURITY_IMPLICATION.

        In RootInlineBox::placeEllipsis we construct an ellipsis box and append it to a static HashMap which
        keeps track of the ellipsis boxes on each line. However when the line already has an ellipsis, we
        re-use the existing one and this newly constructed (but redundant) box gets destroyed as we return from this function.
        In InlineBox's d'tor, we let the parent know that now it has a dangling child and we assert on it
        later, while accessing the children list. However this redundant ellipsis box was never added to the line,
        so the assertion hits incorrectly.

        Test: fast/inline/redundant-ellipsis-triggers-assert-incorrectly.html

        * rendering/EllipsisBox.cpp:
        (WebCore::EllipsisBox::EllipsisBox):
        * rendering/InlineBox.cpp: This needs 32bits padding.
        (WebCore::InlineBox::invalidateParentChildList):
        * rendering/InlineBox.h:
        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::placeEllipsis):

2017-05-19  Matt Rajca  <mrajca@apple.com>

        Inherit media user gestures from the top document when autoplay quirks are allowed.
        https://bugs.webkit.org/show_bug.cgi?id=172375

        Reviewed by Eric Carlson.

        Added API test.

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

2017-05-19  Youenn Fablet  <youenn@apple.com>

        Align MockRealtimeMediaSourceCenter with RealtimeMediaSourceCenter
        https://bugs.webkit.org/show_bug.cgi?id=172324

        Reviewed by Eric Carlson.

        No change of behavior.
        Remove most of MockRealtimeMediaSourceCenter implementation.
        Next step should be to remove it entirely and use the factory setters instead.

        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::RealtimeMediaSourceCenter):
        (WebCore::RealtimeMediaSourceCenter::createMediaStream):
        (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
        (WebCore::RealtimeMediaSourceCenter::setDeviceEnabled):
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        (WebCore::RealtimeMediaSourceCenter::supportedConstraints):
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac):
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
        (WebCore::MockRealtimeMediaSourceCenter::MockCaptureDeviceManager::captureDevices):
        * platform/mock/MockRealtimeMediaSourceCenter.h:

2017-05-19  Zalan Bujtas  <zalan@apple.com>

        Update SameSizeAsInlineBox with the correct InlineBoxBitfields bits.
        https://bugs.webkit.org/show_bug.cgi?id=172377

        Reviewed by Tim Horton.

        * rendering/InlineBox.cpp:

2017-05-19  Daniel Bates  <dabates@apple.com>

        Bindings: Support runtime-enabled features in specific worlds
        https://bugs.webkit.org/show_bug.cgi?id=172235

        Reviewed by Chris Dumez.

        Currently a function, attribute, or interface can be annotated with either EnabledAtRuntime
        or EnabledForWorld (not both) to expose/conceal it depending on the state of a runtime
        feature flag or the DOM world associated with the running JavaScript code, respectively.
        Even though we do not have any functions, attributes, or interfaces that are annotated
        with both EnabledAtRuntime and EnabledForWorld at the time of writing, it seems reasonable
        to support such a combination of annotations. This also has the benefit of making it
        straightforward to support the extended attribute SecureContext by generalizing the logic
        that generates the code to expose/conceal a function, attribute, or interface.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateRuntimeEnableConditionalString): Use an array to build up all the conjuncts in
        the conditional expression.
        (GenerateImplementation): Substitute GenerateRuntimeEnableConditionalString() and $runtimeEnableConditionalString
        for GetRuntimeEnableFunctionName() and $enable_function_result, respectively.
        (GetRuntimeEnableFunctionName): Deleted.

        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
         (WebCore::JSTestGlobalObject::finishCreation):
         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabled):
         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabledCaller):
         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeaturesEnabled):
         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldWhenRuntimeFeaturesEnabledCaller):
         Update expected results.

         * bindings/scripts/test/JS/JSTestObj.cpp:
         (WebCore::JSTestObjPrototype::finishCreation):
         (WebCore::jsTestObjPrototypeFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabled):
         (WebCore::jsTestObjPrototypeFunctionEnabledInSpecificWorldWhenRuntimeFeatureEnabledCaller):
         Ditto.

         * bindings/scripts/test/TestGlobalObject.idl: Added test cases.
         * bindings/scripts/test/TestObj.idl: Added test case.

2017-05-19  Jeremy Jones  <jeremyj@apple.com>

        Fix macos build after r217143
        https://bugs.webkit.org/show_bug.cgi?id=172380

        unreviewed.

        Remove reference to WebVideoFullscreenInterface for mac build.

        * html/HTMLMediaElement.cpp:
        * platform/mac/WebVideoFullscreenInterfaceMac.h:

2017-05-19  Jeremy Jones  <jeremyj@apple.com>

        Remove defunct WebVideoFullscreenInterface
        https://bugs.webkit.org/show_bug.cgi?id=172254

        Reviewed by Jon Lee.

        No new tests because no behavior change.

        WebVideoFullscreenInterface has long since been replaced by WebVideoFullscreenModelClient.

        * WebCore.xcodeproj/project.pbxproj:
        * html/HTMLMediaElement.cpp:
        * html/HTMLVideoElement.cpp:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        * platform/cocoa/WebVideoFullscreenInterface.h: Removed.
        * platform/cocoa/WebVideoFullscreenModel.h:
        * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
        * platform/mac/WebVideoFullscreenInterfaceMac.h:

2017-05-19  Jeremy Jones  <jeremyj@apple.com>

        HTMLVideoElement::webkitSupportsPresentationMode allowsPictureInPicture() check is redundant.
        https://bugs.webkit.org/show_bug.cgi?id=172330
        rdar://problem/32285443

        Reviewed by Eric Carlson.

        No new tests because no behavior change.

        This removes a redundant call to allowsPictureInPicture() to make it
        more clear that webkitSupportsPresentationMode gives the same result as 
        webkitSupportsFullscreen(pipMode)

        * html/HTMLVideoElement.cpp:
        (WebCore::HTMLVideoElement::webkitSupportsPresentationMode):

2017-05-19  Jeremy Jones  <jeremyj@apple.com>

        [WebRTC] Remove PiP support for video elements that are showing camera capture
        https://bugs.webkit.org/show_bug.cgi?id=172336

        Reviewed by Eric Carlson.

        No new tests because no effect on the DOM. This just changes a value sent to the platform interface layer.

        Ask video element if it supports picture-in-picture instead of asking the mediaSession directly.
        This allows the video element to give a more robust answer.

        * html/HTMLVideoElement.h:
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        (WebVideoFullscreenControllerContext::setUpFullscreen):

2017-05-18  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove the need for the generator to know about native type mapping
        https://bugs.webkit.org/show_bug.cgi?id=172310

        Reviewed by Darin Adler.

        Replace the use of explicit typename to native type mappings in CodeGeneratorJS.pm
        with use of IDLTypes and Converter, which already need the mapping. This allows us
        to have the information in only one spot.

        Also, callback generation to account for nullability and update the IDLs to correctly
        annotate only the types that need to be nullable. 

        * Modules/geolocation/GeoNotifier.cpp:
        * Modules/geolocation/GeoNotifier.h:
        * Modules/geolocation/Geolocation.cpp:
        * Modules/geolocation/Geolocation.h:
        * Modules/geolocation/PositionCallback.idl:
        * Modules/geolocation/PositionErrorCallback.h:
        Use references where possible in the Geolocation code. It was almost possible
        to make PositionCallback take a non-nullable position, but some odd logic in
        Geolocation::makeCachedPositionCallbacks() implies that there is a path where
        passing null is possible, though it would assert. Added FIXME's to return to
        this in a follow up.

        * Modules/webaudio/AudioBufferCallback.idl:
        Add nullable annotation and FIXME explaining that the latest spec splits the callback
        into two separate ones.

        * Modules/webdatabase/Database.cpp:
        (WebCore::Database::runTransaction):
        * Modules/webdatabase/DatabaseCallback.h:
        * Modules/webdatabase/DatabaseManager.cpp:
        (WebCore::DatabaseManager::openDatabase):
        * Modules/webdatabase/SQLStatement.cpp:
        (WebCore::SQLStatement::performCallback):
        * Modules/webdatabase/SQLStatementCallback.h:
        * Modules/webdatabase/SQLStatementErrorCallback.h:
        * Modules/webdatabase/SQLTransaction.cpp:
        (WebCore::SQLTransaction::deliverTransactionCallback):
        (WebCore::SQLTransaction::deliverTransactionErrorCallback):
        * Modules/webdatabase/SQLTransactionCallback.h:
        * Modules/webdatabase/SQLTransactionErrorCallback.h:
        * inspector/InspectorDatabaseAgent.cpp:
        * bindings/js/JSSQLStatementErrorCallbackCustom.cpp:
        (WebCore::JSSQLStatementErrorCallback::handleEvent):
        Update to pass callback parameters as references, since they are never null.

        * bindings/IDLTypes.h:
        Add NullableParameterType to allow customization of nullable parameters (in much
        the same way we allow customization of the nullable implementation type).

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateDefaultValue):
        Use Converter<>::ReturnType{ } for default values rather than ${GetNativeType..}().

        (GenerateHeader):
        Remove use of GetNativeType for toWrapped by using the impl type, since this will never
        be a complex type.

        (GenerateImplementation):
        Simplify DOMJIT UnsafeToNative by merging two identical paths and using auto.

        (GenerateParametersCheck):
        Rework parameter checks to use more specific variable names, make branches more clear,
        and use Converter<>::ReturnType rather than GetNativeType.

        (GenerateCallbackHeaderContent):
        (GenerateCallbackImplementationContent):
        Switch to using typename ${IDLType}::ParameterType as the parameters for callback functions. Also
        add final and override to make sure the generated function matches the user provided base class.
        (GetNativeType): Deleted.
        (GetNativeInnerType): Deleted.
        (GetNativeTypeForCallbacks): Deleted.
        Remove native type mappings.

        * css/MediaQueryListListener.h:
        * css/MediaQueryListListener.idl:
        * css/MediaQueryMatcher.cpp:
        Update MediaQueryListListener to take a non-nullable MediaQueryList.
        
        * dom/NativeNodeFilter.cpp:
        * dom/NativeNodeFilter.h:
        * dom/NodeFilter.h:
        * dom/NodeFilter.idl:
        * dom/NodeIterator.cpp:
        * dom/Traversal.cpp:
        * dom/Traversal.h:
        * dom/TreeWalker.cpp:
        * bindings/js/JSNodeFilterCustom.cpp:
        Update acceptNode to be non-nullable and pass the Node by reference.

        * dom/StringCallback.cpp:
        * dom/StringCallback.h:
        Pass the ScriptExecutionContext by reference.

        * page/IntersectionObserverCallback.h:
        Update to match new parameter types and pass IntersectionObserver by reference.

        * page/PerformanceObserver.cpp:
        * page/PerformanceObserverCallback.h:
        Update to pass PerformanceObserverEntryList and PerformanceObserver by reference.

        * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunction.h:
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
        * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.h:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        Update test results.

        * bindings/scripts/test/TestCallbackInterface.idl:
        Update test to refer to actual interfaces as we now do lookup on these parameter 
        types rather than blindly assuming they are interfaces.

2017-05-19  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r217098, r217111, r217113, and
        r217114.
        https://bugs.webkit.org/show_bug.cgi?id=172367

        These changes broke the Windows build and introduced
        LayoutTest failures (Requested by ryanhaddad on #webkit).

        Reverted changesets:

        "[MSE][Mac] Support painting MSE video-element to canvas"
        https://bugs.webkit.org/show_bug.cgi?id=125157
        http://trac.webkit.org/changeset/217098

        "[MSE][Mac] Support painting MSE video-element to canvas"
        https://bugs.webkit.org/show_bug.cgi?id=125157
        http://trac.webkit.org/changeset/217111

        "Unreviewed build fix; add undefined functions and constants
        to the CoreMediaSoftLink.h, and use the"
        http://trac.webkit.org/changeset/217113

        "[MSE][Mac] Support painting MSE video-element to canvas"
        https://bugs.webkit.org/show_bug.cgi?id=125157
        http://trac.webkit.org/changeset/217114

2017-05-19  Andy Estes  <aestes@apple.com>

        REGRESSION (r217078): window.ApplePaySession is undefined on macOS Sierra
        https://bugs.webkit.org/show_bug.cgi?id=172344

        Reviewed by Tim Horton.

        r213673 mistakenly changed the ApplePaySession interface from being conditional on
        APPLE_PAY to being conditional on APPLE_PAY_DELEGATE, so when r217078 disabled
        APPLE_PAY_DELEGATE on Sierra and earlier it disabled ApplePaySession.

        Fix this by reverting ApplePaySession to being conditional on APPLE_PAY.

        Fixes http/tests/ssl/applepay/ApplePaySession.html

        * Modules/applepay/ApplePaySession.idl:

2017-05-19  Chris Dumez  <cdumez@apple.com>

        CSSOM insertRule() index argument is optional with default 0
        https://bugs.webkit.org/show_bug.cgi?id=172219

        Reviewed by Sam Weinig.

        Index parameter to CSSSupportsRule.insertRule() and CSSStyleSheet.insertRule() should
        be optional with a default value of 0, as per the latest specification:
        - https://github.com/w3c/csswg-drafts/commit/7949d41a2d86107f8ad4624c055b4b0c9c28ad0d
        - https://www.w3.org/Bugs/Public/show_bug.cgi?id=27384

        Tests: imported/w3c/web-platform-tests/cssom/insertRule-charset-no-index.html
               imported/w3c/web-platform-tests/cssom/insertRule-import-no-index.html
               imported/w3c/web-platform-tests/cssom/insertRule-namespace-no-index.html
               imported/w3c/web-platform-tests/cssom/insertRule-no-index.html

        * css/CSSStyleSheet.cpp:
        * css/CSSStyleSheet.h:
        * css/CSSStyleSheet.idl:
        * css/CSSSupportsRule.idl:

2017-05-19  Carlos Garcia Campos  <cgarcia@igalia.com>

        [Threaded Compositor] Remove platform ifdefs from threaded compositor implementation
        https://bugs.webkit.org/show_bug.cgi?id=172265

        Reviewed by Žan Doberšek.

        Remove PlatformDisplayWPE::EGLTarget.

        * platform/graphics/wpe/PlatformDisplayWPE.cpp:
        * platform/graphics/wpe/PlatformDisplayWPE.h:

2017-05-19  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix; add undefined functions and constants to the CoreMediaSoftLink.h, and use the
        correct (and previously soft-linked) method in WebCoreDecompressionSession.

        * platform/cf/CoreMediaSoftLink.cpp:
        * platform/cf/CoreMediaSoftLink.h:
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::imageForTime):

2017-05-19  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass
        https://bugs.webkit.org/show_bug.cgi?id=172098

        Reviewed by Saam Barati.

        Add DOMJIT interface IDL attribute. Which allows us to define checkSubClassPatchpointFor${className}
        function for that ClassInfo. And we move CheckSubClass patchpoint implementation to ClassInfo's member

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMGlobalObject.cpp:
        * bindings/js/JSDOMWindowBase.cpp:
        * bindings/js/JSDOMWindowProperties.cpp:
        * bindings/js/JSDOMWindowShell.cpp:
        * bindings/js/JSReadableStreamPrivateConstructors.cpp:
        * bindings/js/JSWorkerGlobalScopeBase.cpp:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        (GenerateImplementation):
        (GenerateImplementationIterableFunctions):
        (GenerateConstructorHelperMethods):
        * bindings/scripts/IDLAttributes.json:
        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        * bindings/scripts/test/JS/JSMapLike.cpp:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        * bindings/scripts/test/JS/JSTestDOMJIT.h:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        * bindings/scripts/test/JS/JSTestException.cpp:
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        * bridge/c/CRuntimeObject.cpp:
        * bridge/c/c_instance.cpp:
        * bridge/objc/ObjCRuntimeObject.mm:
        * bridge/objc/objc_instance.mm:
        * bridge/objc/objc_runtime.mm:
        * bridge/runtime_array.cpp:
        * bridge/runtime_method.cpp:
        * bridge/runtime_object.cpp:
        * dom/Document.idl:
        * dom/DocumentFragment.idl:
        * dom/Element.idl:
        * dom/Event.idl:
        * dom/Node.idl:
        * domjit/JSDocumentDOMJIT.cpp:
        (WebCore::checkSubClassPatchpointForJSDocument):
        (WebCore::DocumentDocumentElementDOMJIT::checkDOM): Deleted.
        (WebCore::DocumentBodyDOMJIT::checkDOM): Deleted.
        * domjit/JSDocumentFragmentDOMJIT.cpp: Copied from Source/JavaScriptCore/runtime/JSMap.cpp.
        (WebCore::checkSubClassPatchpointForJSDocumentFragment):
        * domjit/JSElementDOMJIT.cpp: Copied from Source/JavaScriptCore/tools/JSDollarVM.cpp.
        (WebCore::checkSubClassPatchpointForJSElement):
        * domjit/JSEventDOMJIT.cpp: Copied from Source/JavaScriptCore/tools/JSDollarVM.cpp.
        (WebCore::checkSubClassPatchpointForJSEvent):
        * domjit/JSNodeDOMJIT.cpp:
        (WebCore::checkSubClassPatchpointForJSNode):
        (WebCore::NodeFirstChildDOMJIT::checkDOM): Deleted.
        (WebCore::NodeLastChildDOMJIT::checkDOM): Deleted.
        (WebCore::NodeNextSiblingDOMJIT::checkDOM): Deleted.
        (WebCore::NodePreviousSiblingDOMJIT::checkDOM): Deleted.
        (WebCore::NodeParentNodeDOMJIT::checkDOM): Deleted.
        (WebCore::NodeNodeTypeDOMJIT::checkDOM): Deleted.
        (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): Deleted.

2017-05-18  Jer Noble  <jer.noble@apple.com>

        [MSE][Mac] Support painting MSE video-element to canvas
        https://bugs.webkit.org/show_bug.cgi?id=125157
        <rdar://problem/23062016>

        Reviewed by Eric Carlson.

        Test: media/media-source/media-source-paint-to-canvas.html

        In order to have access to decoded video data for painting, decode the encoded samples manually
        instead of adding them to the AVSampleBufferDisplayLayer. To facilitate doing so, add a new
        utility class WebCoreDecompressionSession, which can decode samples and store them.

        For the purposes of this patch, to avoid double-decoding of video data and to avoid severe complication
        of our sample delivery pipeline, we will only support painting of decoded video samples when the video is
        not displayed in the DOM.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::seekToTime): Always send waitForSeekCompleted() to give private a chance to delay seek completion.
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples): Added.
        * Modules/mediasource/SourceBuffer.h:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/cf/CoreMediaSoftLink.cpp: Added new soft link macros.
        * platform/cf/CoreMediaSoftLink.h: Ditto.
        * platform/cocoa/CoreVideoSoftLink.cpp: Ditto.
        * platform/cocoa/CoreVideoSoftLink.h: Ditto.
        * platform/graphics/SourceBufferPrivateClient.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sampleBufferDisplayLayer): Simple accessor.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::decompressionSession): Ditto.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Update whether we should be displaying in a layer or decompression session..
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible): Ditto.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted): m_seeking is now an enum.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seeking): Ditto.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted): Ditto. If waiting for a video frame, delay completing seek.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::nativeImageForCurrentTime): Call updateLastImage() and return result.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastImage): Fetch the image for the current time.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint): Pass to paintCurrentFrameInCanvas.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext): Get a native image, and render it.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged): Create or destroy a layer or decompression session as appropriate.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer): Creates a layer.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer): Destroys a layer.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureDecompressionSession): Creates a decompression session.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyDecompressionSession): Destroys a decompression session.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame): If seek completion delayed, complete now. Ditto for ready state change.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState): If waiting for a video frame, delay ready state change.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Deleted.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer): Deleted.
        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
        (WebCore::MediaSourcePrivateAVFObjC::hasVideo): Promote to a class function.
        (WebCore::MediaSourcePrivateAVFObjC::hasSelectedVideo): Return whether any of the active source buffers have video and are selected.
        (WebCore::MediaSourcePrivateAVFObjC::hasSelectedVideoChanged): Call setSourceBufferWithSelectedVideo().
        (WebCore::MediaSourcePrivateAVFObjC::setVideoLayer): Set (or clear) the layer on the selected buffer.
        (WebCore::MediaSourcePrivateAVFObjC::setDecompressionSession): Ditto for decompression session.
        (WebCore::MediaSourcePrivateAVFObjC::setSourceBufferWithSelectedVideo): Remove the layer and decompression session from the unselected

                buffer and add the decompression session or layer to the newly selected buffer.
        (WebCore::MediaSourcePrivateAVFObjCHasVideo): Deleted.
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers): Clear the videoLayer and decompressionSession.
        (WebCore::SourceBufferPrivateAVFObjC::hasSelectedVideo): Return whether the buffer has a selected video track.
        (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): The media player now manages the video layer and decompression session lifetimes.
        (WebCore::SourceBufferPrivateAVFObjC::flush): Flush the decompression session, if it exists.
        (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Enqueue to the decompression session, if it exists.
        (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): As the decompression session, if it exists.
        (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): Tell the decompression session to stop requesting data, if it exists.
        (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): Request media data from the decompression session, if it exists.
        (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer): Added.
        (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession): Added.
        * platform/graphics/cocoa/WebCoreDecompressionSession.h: Added.
        (WebCore::WebCoreDecompressionSession::create):
        (WebCore::WebCoreDecompressionSession::isInvalidated):
        (WebCore::WebCoreDecompressionSession::createWeakPtr):
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm: Added.
        (WebCore::WebCoreDecompressionSession::WebCoreDecompressionSession): Register for media data requests.
        (WebCore::WebCoreDecompressionSession::invalidate):  Unregister for same.
        (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaDataCallback): Pass to maybeBecomeReadyForMoreMediaData.
        (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaData): Check in-flight decodes, and decoded frame counts.
        (WebCore::WebCoreDecompressionSession::enqueueSample): Pass the sample to be decoded on a background queue.
        (WebCore::WebCoreDecompressionSession::decodeSample): Decode the sample.
        (WebCore::WebCoreDecompressionSession::decompressionOutputCallback): Call handleDecompressionOutput.
        (WebCore::WebCoreDecompressionSession::handleDecompressionOutput): Pass decoded sample to be enqueued on the main thread.
        (WebCore::WebCoreDecompressionSession::getFirstVideoFrame):
        (WebCore::WebCoreDecompressionSession::enqueueDecodedSample): Enqueue the frame (if it's a displayed frame).
        (WebCore::WebCoreDecompressionSession::isReadyForMoreMediaData): Return whether we've hit our high water sample count.
        (WebCore::WebCoreDecompressionSession::requestMediaDataWhenReady):
        (WebCore::WebCoreDecompressionSession::stopRequestingMediaData): Unset the same.
        (WebCore::WebCoreDecompressionSession::notifyWhenHasAvailableVideoFrame): Set a callback to notify when a decoded frame has been enqueued.
        (WebCore::WebCoreDecompressionSession::imageForTime): Successively dequeue images until reaching one at or beyond the requested time.
        (WebCore::WebCoreDecompressionSession::flush): Synchronously empty the producer and consumer queues.
        (WebCore::WebCoreDecompressionSession::getDecodeTime): Utility method.
        (WebCore::WebCoreDecompressionSession::getPresentationTime): Ditto.
        (WebCore::WebCoreDecompressionSession::getDuration): Ditto.
        (WebCore::WebCoreDecompressionSession::compareBuffers): Ditto.
        * platform/cocoa/VideoToolboxSoftLink.cpp: Added.
        * platform/cocoa/VideoToolboxSoftLink.h: Added.

2017-05-18  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [REGRESSION](r216901): Delete ImageDecoder if BitmapImage::destroyDecodedData() was called to destroy all the decoded frames
        https://bugs.webkit.org/show_bug.cgi?id=172325

        Reviewed by Simon Fraser.

        When calling BitmapImage::destroyDecodedData() with destroyAll = true, the
        current ImageDecoder has to be deleted regardless the current frame needs
        to be cached or not. This is true except when the image is animating.
        Creating a new ImageDecoder for the animated image will lead to decoding
        all the frames from frame-zero till the current frame.

        Deleting the current ImageDecoder has the benefit of releasing its raster
        data. We also must delete the current ImageDecoder when the CachedImage
        switched its data SharedBuffer.

        The fix is return the condition in BitmapImage::destroyDecodedData() to 
        be as it was before r216901.

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::destroyDecodedData):

2017-05-18  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r217079.

        This change broke internal builds.

        Reverted changeset:

        "Redundant ellipsis box triggers
        ASSERT_WITH_SECURITY_IMPLICATION in InlineBox::parent()."
        https://bugs.webkit.org/show_bug.cgi?id=172309
        http://trac.webkit.org/changeset/217079

2017-05-18  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Release InjectedScripts when frontends close
        https://bugs.webkit.org/show_bug.cgi?id=172313

        Reviewed by Andreas Kling.

        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::disconnectFrontend):
        Release inspector resources together, including discarding injected
        scripts so that they may be collected.

        (WebCore::InspectorController::inspectedPageDestroyed):
        (WebCore::InspectorController::disconnectAllFrontends):
        Move the disconnect call inside of disconnectAllFrontends to establish
        a pattern of releasing web inspector resources together.

2017-05-18  Simon Fraser  <simon.fraser@apple.com>

        Add a newline after the URL in showLayerTree output.

        Reviewed by Zalan Bujtas.

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

2017-05-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        Attachment drag preview should not have the attachment outline
        https://bugs.webkit.org/show_bug.cgi?id=172327
        <rdar://problem/32282831>

        Reviewed by Tim Horton.

        When creating a drag image for an attachment element, don't include borders around the attachment.

        * page/DragController.cpp:
        (WebCore::DragController::startDrag):
        * rendering/RenderAttachment.h:
        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::paintAttachment):

2017-05-18  Youenn Fablet  <youenn@apple.com>

        Make WebRTC logging happen in Release
        https://bugs.webkit.org/show_bug.cgi?id=172307

        Reviewed by Eric Carlson.

        No change of behavior.
        Move from LOG(WebRTC...) to RELEASE_LOG(WebRTC...).

        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::createOfferSucceeded):
        (WebCore::PeerConnectionBackend::createOfferFailed):
        (WebCore::PeerConnectionBackend::createAnswerSucceeded):
        (WebCore::PeerConnectionBackend::createAnswerFailed):
        (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
        (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
        (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
        (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
        (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
        (WebCore::PeerConnectionBackend::addIceCandidateFailed):
        (WebCore::PeerConnectionBackend::newICECandidate):
        (WebCore::PeerConnectionBackend::doneGatheringCandidates):
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::queuedCreateOffer):
        (WebCore::RTCPeerConnection::queuedCreateAnswer):
        (WebCore::RTCPeerConnection::queuedSetLocalDescription):
        (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
        (WebCore::RTCPeerConnection::queuedAddIceCandidate):

2017-05-18  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] do not cache gUM permissions
        https://bugs.webkit.org/show_bug.cgi?id=172245

        Reviewed by Youenn Fablet.

        No new tests, updated fast/mediastream/MediaDevices-getUserMedia.html.

        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Add salt parameter.
        * platform/mediastream/RealtimeMediaSourceCenter.h:

2017-05-18  Zalan Bujtas  <zalan@apple.com>

        Redundant ellipsis box triggers ASSERT_WITH_SECURITY_IMPLICATION in InlineBox::parent().
        https://bugs.webkit.org/show_bug.cgi?id=172309
        <rdar://problem/32262357>

        Reviewed by Simon Fraser.

        This patch stops the redundant ellipsis box trigger ASSERT_WITH_SECURITY_IMPLICATION.

        In RootInlineBox::placeEllipsis we construct an ellipsis box and append it to a static HashMap which
        keeps track of the ellipsis boxes on each line. However when the line already has an ellipsis, we
        re-use the existing one and this newly constructed (but redundant) box gets destroyed as we return from this function.
        In InlineBox's d'tor, we let the parent know that now it has a dangling child and we assert on it
        later, while accessing the children list. However this redundant ellipsis box was never added to the line,
        so the assertion hits incorrectly.

        Test: fast/inline/redundant-ellipsis-triggers-assert-incorrectly.html

        * rendering/EllipsisBox.cpp:
        (WebCore::EllipsisBox::EllipsisBox):
        * rendering/InlineBox.cpp:
        (WebCore::InlineBox::invalidateParentChildList):
        * rendering/InlineBox.h:
        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::placeEllipsis): Use the newly created ellipsis box instead.

2017-05-18  Andy Estes  <aestes@apple.com>

        ENABLE(APPLE_PAY_DELEGATE) should be NO on macOS Sierra and earlier
        https://bugs.webkit.org/show_bug.cgi?id=172305

        Reviewed by Anders Carlsson.

        * Configurations/FeatureDefines.xcconfig:

2017-05-18  Dean Jackson  <dino@apple.com>

        Transform misplaces element 50% of the time
        https://bugs.webkit.org/show_bug.cgi?id=172300

        Reviewed by Simon Fraser.

        A hardware-accelerated animation of the transform property
        requires layout to happen if it contains a translate operation
        using percentages, otherwise it may create an incorrect
        animation. The "50% of the time" comes in to play because
        the layout timer may sometimes fire before the animation
        timer. The test case contains a example that is much more
        likely to fail without this fix.

        Test: animations/needs-layout.html

        * page/animation/CSSAnimationController.cpp:
        (WebCore::CSSAnimationControllerPrivate::animationTimerFired): If
        we've been told that we need a layout, and we have one pending, then
        force it before doing the rest of the animation logic.
        (WebCore::CSSAnimationController::updateAnimations): Check if the
        CompositeAnimation depends on layout, and tell the private controller
        that it should check for the necessity of a layout as the animation
        timer fires.

        * page/animation/CompositeAnimation.cpp:
        (WebCore::CompositeAnimation::animate): Ask the keyframes if this
        animation depends on layout.

        * page/animation/CompositeAnimation.h:
        (WebCore::CompositeAnimation::hasAnimationThatDependsOnLayout):
        * page/animation/KeyframeAnimation.cpp:
        (WebCore::KeyframeAnimation::KeyframeAnimation):
        (WebCore::KeyframeAnimation::computeLayoutDependency): Look at all
        the keyframe properties for something that is a translation using
        percentages.

        * page/animation/KeyframeAnimation.h:

2017-05-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        Selection around attachment elements should not persist when beginning a drag
        https://bugs.webkit.org/show_bug.cgi?id=172319
        <rdar://problem/32283008>

        Reviewed by Tim Horton.

        When beginning to drag an attachment element, save and restore the visible selection when calling out to the
        injected bundle for additional data, and when creating the drag image.

        Augmented an existing API test: DataInteractionTests.AttachmentElementItemProviders.

        * page/DragController.cpp:
        (WebCore::DragController::startDrag):

2017-05-18  Daniel Bates  <dabates@apple.com>

        Cleanup: Remove unused functions from RuntimeEnabledFeatures
        https://bugs.webkit.org/show_bug.cgi?id=172315

        Reviewed by Jer Noble.

        * page/RuntimeEnabledFeatures.cpp:
        (WebCore::RuntimeEnabledFeatures::htmlMediaElementEnabled): Deleted.
        (WebCore::RuntimeEnabledFeatures::htmlVideoElementEnabled): Deleted.
        (WebCore::RuntimeEnabledFeatures::htmlSourceElementEnabled): Deleted.
        (WebCore::RuntimeEnabledFeatures::mediaControllerEnabled): Deleted.
        (WebCore::RuntimeEnabledFeatures::mediaErrorEnabled): Deleted.
        (WebCore::RuntimeEnabledFeatures::timeRangesEnabled): Deleted.
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setDOMIteratorEnabled): Deleted.
        (WebCore::RuntimeEnabledFeatures::domIteratorEnabled): Deleted.
        (WebCore::RuntimeEnabledFeatures::setGeolocationEnabled): Deleted.
        (WebCore::RuntimeEnabledFeatures::geolocationEnabled): Deleted.

2017-05-18  Daniel Bates  <dabates@apple.com>

        Improve error message for Access-Control-Allow-Origin violation due to misconfigured server
        https://bugs.webkit.org/show_bug.cgi?id=162819
        <rdar://problem/28575938>

        Reviewed by Joseph Pecoraro.

        Inspired by Blink change:
        <https://src.chromium.org/viewvc/blink?view=revision&revision=163406>

        At most one Access-Control-Allow-Origin header may be in an HTTP response. Improve the
        error message emitted on a CORS failure when Access-Control-Allow-Origin contains more
        than one origin, indicated by the presence of a ',', as a way to help web developers/server
        administrators differentiate between a misconfigured Access-Control-Allow-Origin header
        and a misconfigured server.

        * loader/CrossOriginAccessControl.cpp:
        (WebCore::passesAccessControlCheck): Defined a local variable to hold the value of securityOrigin.toString()
        and referenced this variable throughout the code to avoid computing the stringified security
        origin more than once. Switched to using makeString() to concatenate error message when the
        origin of the page does not match the value of the Access-Control-Allow-Origin header.

2017-05-18  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Grandfather domains for existing data records
        https://bugs.webkit.org/show_bug.cgi?id=172155
        <rdar://problem/24913532>

        Reviewed by Alex Christensen.

        Test: http/tests/loading/resourceLoadStatistics/grandfathering.html

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::setGrandfathered):
        (WebCore::ResourceLoadObserver::isGrandfathered):
        (WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval):
        (WebCore::ResourceLoadObserver::setGrandfatheringTime):
            Functions for testing and configuration.
            ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval() changed as a result of moving
            WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval() here.
        * loader/ResourceLoadObserver.h:
        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::ResourceLoadStatisticsStore::createEncoderFromData):
        (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
            Now contains endOfGrandfatheringTimestamp.
        (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent):
            Now makes a call to m_grandfatherExistingWebsiteDataHandler().
        (WebCore::ResourceLoadStatisticsStore::setGrandfatherExistingWebsiteDataCallback):
        (WebCore::ResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval):
            Changed as a result of moving
            WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval() here.
        (WebCore::ResourceLoadStatisticsStore::setGrandfatheringTime):
        (WebCore::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
            Renamed since it now also takes grandfathering into account.
        (WebCore::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
            Fixed typo in local variable name.
        (WebCore::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
        (WebCore::ResourceLoadStatisticsStore::shouldRemoveDataRecords):
            Convenience function added.
        (WebCore::ResourceLoadStatisticsStore::dataRecordsBeingRemoved):
            Convenience function added.
        (WebCore::ResourceLoadStatisticsStore::dataRecordsWereRemoved):
            Convenience function added.
        (WebCore::ResourceLoadStatisticsStore::prevalentResourceDomainsWithoutUserInteraction): Deleted.
            Replaced by ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor().
        * loader/ResourceLoadStatisticsStore.h:

2017-05-18  Daniel Bates  <dabates@apple.com>

        Bindings: Require value for extended attributes EnabledAtRuntime and EnabledForWorld
        https://bugs.webkit.org/show_bug.cgi?id=172252

        Reviewed by Sam Weinig.

        According to Sam Weinig it is an anti-feature that EnabledAtRuntime can be specified
        without a value. We should make it require a value for the name of the RuntimeEnabledFeatures
        function to use in the generated code. For similar reasons we should also require
        a value for the extended attribute EnabledForWorld.

        * Modules/websockets/WebSocket.idl: Substitute EnabledAtRuntime=WebSocket for EnabledAtRuntime.
        * bindings/scripts/CodeGeneratorJS.pm:
        (GetRuntimeEnableFunctionName):
        * html/HTMLAudioElement.idl: Substitute EnabledAtRuntime=Audio for EnabledAtRuntime.
        * page/RuntimeEnabledFeatures.cpp:
        (WebCore::RuntimeEnabledFeatures::audioEnabled):
        (WebCore::RuntimeEnabledFeatures::htmlAudioElementEnabled): Deleted. This function duplicated
        the functionality of RuntimeEnabledFeatures::audioEnabled(). Instead we explicitly
        write EnabledAtRuntime=Audio in HTMLAudioElement.idl to use RuntimeEnabledFeatures::audioEnabled()
        to determine whether to expose/conceal the HTMLAudioElement global constructor at runtime.
        * page/RuntimeEnabledFeatures.h:

2017-05-18  Jer Noble  <jer.noble@apple.com>

        Allow nested timers to propagate user gestures so long as the total nested interval is less than 1s.
        https://bugs.webkit.org/show_bug.cgi?id=172173

        Reviewed by Andy Estes.

        Test: media/restricted-audio-playback-with-multiple-settimeouts.html

        Store the current nested timer interval in DOMTimerFireState, and use that value to propagate the
        nested interval through multiple invocations of setTimeout().

        Drive-by fix: instead of manually resetting the nesting level in DOMTimer::fired(), add the
        nesting level to the DOMTimerFireState, and reset the nesting level on the state's destruction.
        This fixes one place in DOMTimer::fire() where an early return lead to the timer's nesting level
        not being reset.

        * page/DOMTimer.cpp:
        (WebCore::DOMTimerFireState::DOMTimerFireState):
        (WebCore::DOMTimerFireState::~DOMTimerFireState):
        (WebCore::DOMTimerFireState::nestedTimerInterval):
        (WebCore::shouldForwardUserGesture):
        (WebCore::userGestureTokenToForward):
        (WebCore::currentNestedTimerInterval):
        (WebCore::DOMTimer::DOMTimer):
        (WebCore::DOMTimer::fired):
        * page/DOMTimer.h:

2017-05-18  Youenn Fablet  <youenn@apple.com>

        RealtimeOutgoingAudioSource should use the source sample rate
        https://bugs.webkit.org/show_bug.cgi?id=172297

        Reviewed by Eric Carlson.

        Covered by manual tests.

        * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
        (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable): Using the audio source sample rate so that the converter does the right conversion.

2017-05-18  Andy Estes  <aestes@apple.com>

        Add "countryCode" to ApplePayErrorContactField
        https://bugs.webkit.org/show_bug.cgi?id=172264
        <rdar://problem/32004909>

        Reviewed by Anders Carlsson.

        Added ApplePayError tests to http/tests/ssl/applepay/ApplePaySession.html

        * Modules/applepay/ApplePayError.idl:
        * Modules/applepay/PaymentRequest.h:

2017-05-18  Daniel Bates  <dabates@apple.com>

        Cleanup: Remove unnecessary call to AddToImplIncludes("RuntimeEnabledFeatures.h") in GenerateImplementation()
        https://bugs.webkit.org/show_bug.cgi?id=172236

        Reviewed by Chris Dumez.

        It is unnecessary for GenerateImplementation() to explicitly call AddToImplIncludes("RuntimeEnabledFeatures.h")
        to add the header RuntimeEnabledFeatures.h to the list of headers in the generated implementation
        as this header is added when GetRuntimeEnableFunctionName() is called. And GenerateImplementation()
        calls GetRuntimeEnableFunctionName().

        No functionality changed. So, no new tests.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):

2017-05-18  Daniel Bates  <dabates@apple.com>

        REGRESSION (r209608): Cross-origin plugin document opened in child window blocked by parent
        window CSP when object-src 'none' is set
        https://bugs.webkit.org/show_bug.cgi?id=172038
        <rdar://problem/32258262>

        Reviewed by Andy Estes.

        Fixes an issue where a cross-origin plugin document opened in a child window would inherit
        the Content Security Policy (CSP) of its opener. In particular, a cross-origin plugin
        document opened in a child window would be blocked when the CSP of its opener disallows
        plugins (e.g. object-source 'none').

        Prior to r209608 a document opened in a child window never inherited the CSP from its opener
        and a plugin document loaded in a subframe would unconditionally inherit the CSP from its
        parent frame. So, a plugin document opened in a child window would be allowed to load
        regardless of whether its opener had a CSP that prevented plugins. Following r209608 a
        document opened in a child window would inherit its CSP from its opener if and only if it
        would inherit the security origin from its opener (e.g. about:blank) or was a plugin
        document. The latter condition makes plugin documents opened in a child window unconditionally
        inherit the CSP from their opener and is the cause of this bug. It seems reasonable to exempt
        cross-origin plugin documents opened in a child window from the CSP inheritance rule because
        such documents cannot compromise the origin of their opener. Same-origin plugin documents
        opened in a child window will continue to inherit the CSP from their opener because such
        documents can compromise the origin of their opener.

        Tests: http/tests/security/contentSecurityPolicy/cross-origin-plugin-document-allowed-in-child-window.html
               http/tests/security/contentSecurityPolicy/plugin-blocked-in-about-blank-window.html
               http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window.html

        * dom/Document.cpp:
        (WebCore::Document::shouldInheritContentSecurityPolicyFromOwner): Added.
        (WebCore::Document::initContentSecurityPolicy):
        * dom/Document.h:

2017-05-18  Keith Miller  <keith_miller@apple.com>

        WebAssembly API: test with neutered inputs
        https://bugs.webkit.org/show_bug.cgi?id=163899

        Reviewed by JF Bastien.

        Make it not possible to transfer an ArrayBuffer that is backed by a
        wasm memory.

        Test: workers/wasm-mem-post-message.html

        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::SerializedScriptValue::create):

2017-05-18  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r217031, r217032, and r217037.
        https://bugs.webkit.org/show_bug.cgi?id=172293

        cause linking errors in Windows (Requested by yusukesuzuki on
        #webkit).

        Reverted changesets:

        "[JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass"
        https://bugs.webkit.org/show_bug.cgi?id=172098
        http://trac.webkit.org/changeset/217031

        "Unreviewed, rebaseline for newly added ClassInfo"
        https://bugs.webkit.org/show_bug.cgi?id=172098
        http://trac.webkit.org/changeset/217032

        "Unreviewed, fix debug and non-JIT build"
        https://bugs.webkit.org/show_bug.cgi?id=172098
        http://trac.webkit.org/changeset/217037

2017-05-18  Per Arne Vollan  <pvollan@apple.com>

        Protect MediaDeviceRequest instance during context destruction.
        https://bugs.webkit.org/show_bug.cgi?id=172285
        <rdar://problem/30369017>

        Reviewed by Brent Fulgham.

        In MediaDevicesRequest::contextDestroyed(), the call to m_enumerationRequest->cancel() might
        end up deleting itself (MediaDevicesRequest). The std::function member m_completionHandler
        in MediaDevicesEnumerationRequest contains a captured variable of type
        RefPtr<MediaDevicesRequest>. When m_completionHandler is set to null in the cancel() method,
        the MediaDevicesRequest object will be deleted if the m_completionHandler member is holding
        the last reference.

        No new tests, since I am unable to reproduce.

        * Modules/mediastream/MediaDevicesRequest.cpp:
        (WebCore::MediaDevicesRequest::contextDestroyed):

2017-05-18  Antti Koivisto  <antti@apple.com>

        Design mode should not affect UA shadow trees
        https://bugs.webkit.org/show_bug.cgi?id=171854
        <rdar://problem/32071037>

        Reviewed by Zalan Bujtas.

        Test: editing/deleting/search-shadow-tree-delete.html

        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::editabilityFromContentEditableAttr):

            Ignore design mode for UA shadow trees.

        * html/SearchInputType.cpp:
        (WebCore::SearchInputType::~SearchInputType):
        (WebCore::SearchInputType::createShadowSubtree):
        (WebCore::SearchInputType::resultsButtonElement):
        (WebCore::SearchInputType::cancelButtonElement):
        * html/SearchInputType.h:

            Use RefPtr.

2017-05-18  Vanessa Chipirrás Navalón  <vchipirras@igalia.com>

        [GTK][GStreamer][MSE] Crash on youtube when MSE is enabled but gstreamer cant find the decoder element.
        https://bugs.webkit.org/show_bug.cgi?id=167120

        Reviewed by Žan Doberšek.

        This is because supportCodecs() doesn't check in runtime which plugins the player has.
        So, a static function which returns a map with the plugins has been created. That map is later
        used in the supportsCodecs() method to check if the requested codec matches any of the map.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements):
        The declaration is moved into this class.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::isAvailable): This function calls the implementation of
        initializeGstreamerAndRegisterWebKitElements function.
        (WebCore::MediaPlayerPrivateGStreamer::load): Ditto
        (WebCore::mimeTypeSet): Ditto
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: It is static type to expose
        initializeGStreamerAndRegisterWebKitElements() function to be called from internal function
        "which runs before MediaPlayerPrivateGStreamerBase initialization but needs to have GStreamer initialized".
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
        (WebCore::codecSet): It returns a map with the plugins has been created.
        (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodecs): To check if the requested codec
        matches any of the map from codecSet().

2017-05-18  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Align getDesiredSize with spec
        https://bugs.webkit.org/show_bug.cgi?id=172220

        Reviewed by Chris Dumez.

        Aligned implementation of getDesiredSize operation for both controllers:
        - https://streams.spec.whatwg.org/#readable-stream-default-controller-get-desired-size
        - https://streams.spec.whatwg.org/#readable-byte-stream-controller-get-desired-size

        Implementation slightly differs from spec as queueTotalSize refactoring is not
        yet implemented, but behavior is now similar.

        No new tests (already covered by WPT tests, corresponding expectations have been updated).

        * Modules/streams/ReadableByteStreamInternals.js:
        (readableByteStreamControllerGetDesiredSize): Updated.
        * Modules/streams/ReadableStreamInternals.js:
        (readableStreamDefaultControllerGetDesiredSize): Updated.

2017-05-18  Tim Horton  <timothy_horton@apple.com>

        More WebKit2 header cleanup
        https://bugs.webkit.org/show_bug.cgi?id=172214

        Reviewed by Simon Fraser.

        * Modules/mediastream/UserMediaController.cpp:
        * Modules/mediastream/UserMediaController.h:

2017-05-16  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC][DFG][DOMJIT] Extend CheckDOM to CheckSubClass
        https://bugs.webkit.org/show_bug.cgi?id=172098

        Reviewed by Saam Barati.

        Add DOMJIT interface IDL attribute. Which allows us to define checkSubClassPatchpoint function
        for that ClassInfo. And we move CheckSubClass patchpoint implementation to ClassInfo's member.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMGlobalObject.cpp:
        * bindings/js/JSDOMWindowBase.cpp:
        * bindings/js/JSDOMWindowProperties.cpp:
        * bindings/js/JSDOMWindowShell.cpp:
        * bindings/js/JSReadableStreamPrivateConstructors.cpp:
        * bindings/js/JSWorkerGlobalScopeBase.cpp:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        (GenerateImplementation):
        (GenerateImplementationIterableFunctions):
        (GenerateConstructorHelperMethods):
        * bindings/scripts/IDLAttributes.json:
        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        * bindings/scripts/test/JS/JSMapLike.cpp:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        * bindings/scripts/test/JS/JSTestDOMJIT.h:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        * bindings/scripts/test/JS/JSTestException.cpp:
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        * bridge/c/CRuntimeObject.cpp:
        * bridge/c/c_instance.cpp:
        * bridge/objc/ObjCRuntimeObject.mm:
        * bridge/objc/objc_instance.mm:
        * bridge/objc/objc_runtime.mm:
        * bridge/runtime_array.cpp:
        * bridge/runtime_method.cpp:
        * bridge/runtime_object.cpp:
        * dom/Document.idl:
        * dom/DocumentFragment.idl:
        * dom/Element.idl:
        * dom/Event.idl:
        * dom/Node.idl:
        * domjit/JSDocumentDOMJIT.cpp:
        (WebCore::JSDocument::checkSubClassPatchpoint):
        (WebCore::DocumentDocumentElementDOMJIT::checkDOM): Deleted.
        (WebCore::DocumentBodyDOMJIT::checkDOM): Deleted.
        * domjit/JSDocumentFragmentDOMJIT.cpp: Copied from Source/JavaScriptCore/runtime/JSMap.cpp.
        (WebCore::JSDocumentFragment::checkSubClassPatchpoint):
        * domjit/JSElementDOMJIT.cpp: Copied from Source/JavaScriptCore/tools/JSDollarVM.cpp.
        (WebCore::JSElement::checkSubClassPatchpoint):
        * domjit/JSEventDOMJIT.cpp: Copied from Source/JavaScriptCore/tools/JSDollarVM.cpp.
        (WebCore::JSEvent::checkSubClassPatchpoint):
        * domjit/JSNodeDOMJIT.cpp:
        (WebCore::JSNode::checkSubClassPatchpoint):
        (WebCore::NodeFirstChildDOMJIT::checkDOM): Deleted.
        (WebCore::NodeLastChildDOMJIT::checkDOM): Deleted.
        (WebCore::NodeNextSiblingDOMJIT::checkDOM): Deleted.
        (WebCore::NodePreviousSiblingDOMJIT::checkDOM): Deleted.
        (WebCore::NodeParentNodeDOMJIT::checkDOM): Deleted.
        (WebCore::NodeNodeTypeDOMJIT::checkDOM): Deleted.
        (WebCore::NodeOwnerDocumentDOMJIT::checkDOM): Deleted.

2017-05-17  Youenn Fablet  <youenn@apple.com>

        r216999 broke win build
        https://bugs.webkit.org/show_bug.cgi?id=172257

        Unreviewed.

        * testing/Internals.cpp:
        (WebCore::Internals::setPageVisibility): Moving setPageVisibility out of MEDIA_STREAM compilation flag.

2017-05-17  Andy Estes  <aestes@apple.com>

        [Cocoa] errors are not propagated to PassKit when calling ApplePaySession.completePayment()
        https://bugs.webkit.org/show_bug.cgi?id=172253
        <rdar://problem/32258020>

        Reviewed by Dan Bernstein.

        In ApplePaySession::completePayment(), releaseReturnValue() was being called twice on the
        same convertedResult. Since the first call moved the errors vector out of convertedResult,
        the vector is empty in the second call. It's the second call that sends the result to the
        UI process, so we end up with an empty arary when we call PassKit's delegate completion
        handler.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::ApplePaySession::completePayment):

2017-05-17  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r217014.

        This change caused mac-wk2 LayoutTests to exit early due to
        crashes.

        Reverted changeset:

        "Resource Load Statistics: Grandfather domains for existing
        data records"
        https://bugs.webkit.org/show_bug.cgi?id=172155
        http://trac.webkit.org/changeset/217014

2017-05-17  Zalan Bujtas  <zalan@apple.com>

        Tighten TextIterator::handleTextNode run-renderer mapping logic.
        https://bugs.webkit.org/show_bug.cgi?id=172174

        Reviewed by Antti Koivisto.

        This patch ensure that when runs and renderers are getting out of sync
        we don't run into problems like webkit.org/b/172113 (where we end up
        using incorrect content start/end positions).

        * editing/TextIterator.cpp:
        (WebCore::TextIterator::handleTextNode):

2017-05-17  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Grandfather domains for existing data records
        https://bugs.webkit.org/show_bug.cgi?id=172155
        <rdar://problem/24913532>

        Reviewed by Alex Christensen.

        Test: http/tests/loading/resourceLoadStatistics/grandfathering.html

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::setGrandfathered):
        (WebCore::ResourceLoadObserver::isGrandfathered):
        (WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval):
        (WebCore::ResourceLoadObserver::setGrandfatheringTime):
            Functions for testing and configuration.
            ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval() changed as a result of moving
            WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval() here.
        * loader/ResourceLoadObserver.h:
        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::ResourceLoadStatisticsStore::createEncoderFromData):
        (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
            Now contains endOfGrandfatheringTimestamp.
        (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent):
            Now makes a call to m_grandfatherExistingWebsiteDataHandler().
        (WebCore::ResourceLoadStatisticsStore::setGrandfatherExistingWebsiteDataCallback):
        (WebCore::ResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval):
            Changed as a result of moving
            WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval() here.
        (WebCore::ResourceLoadStatisticsStore::setGrandfatheringTime):
        (WebCore::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
            Renamed since it now also takes grandfathering into account.
        (WebCore::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
            Fixed typo in local variable name.
        (WebCore::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
        (WebCore::ResourceLoadStatisticsStore::shouldRemoveDataRecords):
            Convenience function added.
        (WebCore::ResourceLoadStatisticsStore::dataRecordsBeingRemoved):
            Convenience function added.
        (WebCore::ResourceLoadStatisticsStore::dataRecordsWereRemoved):
            Convenience function added.
        (WebCore::ResourceLoadStatisticsStore::prevalentResourceDomainsWithoutUserInteraction): Deleted.
            Replaced by ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor().
        * loader/ResourceLoadStatisticsStore.h:

2017-05-17  Zalan Bujtas  <zalan@apple.com>

        Debug ASSERT: WebCore::RenderImageResource::shutdown
        https://bugs.webkit.org/show_bug.cgi?id=172238
        <rdar://problem/30064601>

        Reviewed by Simon Fraser.

        While constructing new renderers, as part of the render tree update, we check if the insertion point is valid for them. 
        When this newly constructed child renderer can't be injected to a specific place, we destroy it right away.
        This assert was added with the assumption that the image resource object gets initialized
        (through RenderObject::initializeStyle) even when the renderer turns out to be invalid.

        Test: fast/images/assert-when-insertion-point-is-incorrect.html

        * rendering/RenderImageResource.cpp:
        (WebCore::RenderImageResource::RenderImageResource):
        (WebCore::RenderImageResource::shutdown):
        * rendering/RenderImageResource.h:

2017-05-17  Per Arne Vollan  <pvollan@apple.com>

        Crash under WebCore::AudioSourceProviderAVFObjC::process().
        https://bugs.webkit.org/show_bug.cgi?id=172101
        rdar://problem/27446589

        Reviewed by Jer Noble.

        Calling the function MTAudioProcessingTapGetSourceAudio when the value of the
        MTAudioProcessingTapRef parameter is null, will lead to a null dereference.
        This can for example happen if MediaPlayerPrivateAVFoundationObjC::cancelLoad()
        is called on the main thread while MediaToolbox is calling the
        WebCore::AudioSourceProviderAVFObjC::processCallback function on a secondary
        thread. MediaPlayerPrivateAVFoundationObjC::cancelLoad() will then call
        AudioSourceProviderAVFObjC::setPlayerItem(nullptr), which will call
        AudioSourceProviderAVFObjC::destroyMix(), which will set m_tap to null. When
        AudioSourceProviderAVFObjC::process is called on the secondary thread, using
        the m_tap member in the call to MTAudioProcessingTapGetSourceAudio, the process
        will crash.

        No new tests since I am not able to reproduce.

        * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
        (WebCore::AudioSourceProviderAVFObjC::initCallback):
        (WebCore::AudioSourceProviderAVFObjC::process):

2017-05-17  Chris Dumez  <cdumez@apple.com>

        Setting URL.search to '' results in a stringified URL ending in '?'
        https://bugs.webkit.org/show_bug.cgi?id=162345
        <rdar://problem/31800441>

        Reviewed by Alex Christensen.

        As per the specification for the URL.search setter [1], if the given value is
        the empty string, then we should set the URL's query to null. We would
        previously set the URL's query to the empty string in this case. This aligns
        our behavior with Firefox and Chrome.

        [1] https://url.spec.whatwg.org/#dom-url-search

        No new tests, updated existing tests.

        * html/URLUtils.h:
        (WebCore::URLUtils<T>::setSearch):

2017-05-17  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] videoWidth and videoHeight should be set when 'loadedmetadata' event fires
        https://bugs.webkit.org/show_bug.cgi?id=172223
        <rdar://problem/31899755>

        Reviewed by Jer Noble.

        Test: fast/mediastream/get-user-media-on-loadedmetadata.html

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): If a stream has
        a video track, return HaveNothing until we have a sample.
       
        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mock/MockRealtimeAudioSource.cpp:
        (WebCore::MockRealtimeAudioSource::tick): Optionally delay the next sample.
        (WebCore::MockRealtimeAudioSource::delaySamples):
        * platform/mock/MockRealtimeAudioSource.h:

        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::delaySamples):
        (WebCore::MockRealtimeVideoSource::generateFrame): Optionally delay the next sample.
        * platform/mock/MockRealtimeVideoSource.h:

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

2017-05-17  Youenn Fablet  <youenn@apple.com>

        iOS WebRTC Media Capture should not allow camera capture from background tab
        https://bugs.webkit.org/show_bug.cgi?id=172200

        Reviewed by Eric Carlson.

        Test: platform/ios/mediastream/getUserMedia-disabled-in-background-tabs.html and manual tests.

        Making Video Capture Factory aware of Document visibility changes.
        On iOS, muting/unmuting the current video source according Document visibility.
        Not using Document visibility change observer as factories are platform and cannot implement
        the visibility observer interface without moving the visibility observer interface.

        Introducing internals API to switch on/off the page visibility.

        * dom/Document.cpp:
        (WebCore::Document::visibilityStateChanged):
        (WebCore::Document::notifyVisibilityChangedToMediaCapture):
        * dom/Document.h:
        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::setVisibility):
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSourceFactory::setVisibility):
        * testing/Internals.cpp:
        (WebCore::Internals::setPageVisibility):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-05-17  Said Abou-Hallawa  <sabouhallawa@apple.com>

        When the image decoding thread makes a callOnMainThread(), ensure all the objects it needs are protected
        https://bugs.webkit.org/show_bug.cgi?id=171614

        Reviewed by David Kilzer.

        The asynchronous image decoding was designed to not block the main thread if
        the image is deleted. To achieve that we allow decoding the current frame
        even if it is not going to be used after closing the decoding queue. We 
        protect all the objects which the decoding thread uses. But when a frame
        finishes decoding the native image frame is cached on the main thread. Not
        all of the objects are protected when the callOnMainThread() is dispatched.
        The ImageFrameCache and the ImageDecoder objects are not protected.

        This might lead to two kinds of crashes:
        1. A segfault inside the ImageDecoder trying to access one of its member
        2. A segfault inside the ImageFrameCache trying to access one of its frames

        The fix is to protect the ImageFrameCache and the ImageDecoder when the
        decoding thread makes a callOnMainThread(). Also switch all the pointers
        the decoding threads protect to be ThreadSafeRefCounted.

        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::startAsyncDecodingQueue):
        * platform/graphics/ImageFrameCache.h:
        * platform/graphics/cg/ImageDecoderCG.h:
        * platform/graphics/win/ImageDecoderDirect2D.h:
        * platform/image-decoders/ImageDecoder.h:

2017-05-17  Wenson Hsieh  <wenson_hsieh@apple.com>

        A URL type is vended for a non-URL plain text string when starting data interaction
        https://bugs.webkit.org/show_bug.cgi?id=172228
        <rdar://problem/32166729>

        Reviewed by Andy Estes.

        Previously, when writing a plain text string to WebItemProviderPasteboard, we would write an NSString directly
        to the item provider by using built-in functionality in NSString+UIItemProvider. However, this causes plain
        strings such as "apple" to be considered URLs, since -[NSURL URLWithString:] creates a non-null NSURL. To fix
        this, we instead write the string as UTF8 data, for the UTI kUTTypeUTF8PlainText, if the plain text is not a
        URL. If the plain text is clearly a URL (determined by constructing a new WebCore URL with no base URL and the
        plaintext string as the absolute URL) then we additionally write an NSURL to the pasteboard.

        2 new API tests:
        DataInteractionTests.SinglePlainTextWordTypeIdentifiers
        DataInteractionTests.SinglePlainTextURLTypeIdentifiers

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::addRepresentationsForPlainText):
        (WebCore::PlatformPasteboard::writeObjectRepresentations):

2017-05-15  Jiewen Tan  <jiewen_tan@apple.com>

        Replace CryptoOperationData with BufferSource for WebKitSubtleCrypto
        https://bugs.webkit.org/show_bug.cgi?id=172146
        <rdar://problem/32122256>

        Reviewed by Brent Fulgham.

        In this patch, we replaces CryptoOperationData with BufferSource for WebKitSubtleCrypto in
        the custom binding codes.

        Test: crypto/webkitSubtle/import-export-raw-key-leak.html

        * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
        (WebCore::JSWebKitSubtleCrypto::encrypt):
        (WebCore::JSWebKitSubtleCrypto::decrypt):
        (WebCore::JSWebKitSubtleCrypto::sign):
        (WebCore::JSWebKitSubtleCrypto::verify):
        (WebCore::JSWebKitSubtleCrypto::digest):
        (WebCore::JSWebKitSubtleCrypto::importKey):
        (WebCore::JSWebKitSubtleCrypto::unwrapKey):
        * crypto/WebKitSubtleCrypto.idl:

2017-05-17  Youenn Fablet  <youenn@apple.com>

        Move-related refactoring on UserMediaPermissionRequestProxy
        https://bugs.webkit.org/show_bug.cgi?id=172195

        Reviewed by Alex Christensen.

        No behavioral change.

        * platform/mediastream/RealtimeMediaSourceCenter.h: Cleaning the function definition.

2017-05-17  David Kilzer  <ddkilzer@apple.com>

        BlobDataFileReference::generateReplacementFile() should use mkstemp()
        <https://webkit.org/b/172192>

        Reviewed by Brent Fulgham.

        * platform/network/mac/BlobDataFileReferenceMac.mm:
        (WebCore::BlobDataFileReference::generateReplacementFile): Use
        mkstemp().

2017-05-17  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r216974.

        Revision caused consistent timeouts on all platforms.

        Reverted changeset:

        "Add a RuntimeEnabledFeature for display: contents, defaulted
        to false."
        https://bugs.webkit.org/show_bug.cgi?id=171984
        http://trac.webkit.org/changeset/216974

2017-05-17  Nan Wang  <n_wang@apple.com>

        ASSERTION FAILED in WebCore::AccessibilityNodeObject::insertChild()
        https://bugs.webkit.org/show_bug.cgi?id=171927
        <rdar://problem/32109781>

        Reviewed by Chris Fleizach.

        The nextSibling() logic might include the continuation sibling that's not
        the child of the current renderer. Make sure we only insert the valid child.

        Test: accessibility/insert-children-assert.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::setIsIgnoredFromParentDataForChild):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::nextSibling):

2017-05-17  Ryosuke Niwa  <rniwa@webkit.org>

        getElementById can return a wrong elemnt when a matching element is removed during beforeload event
        https://bugs.webkit.org/show_bug.cgi?id=171374

        Reviewed by Brent Fulgham.

        The bug was caused by HTMLLinkElement firing beforeload event inside insertedInto before the tree state is updated.
        Delay the event dispatch to the post insertion callback.

        Test: fast/html/link-element-removal-during-beforeload.html

        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::insertedInto):
        (WebCore::HTMLLinkElement::finishedInsertingSubtree):
        * html/HTMLLinkElement.h:

2017-05-17  Alex Christensen  <achristensen@webkit.org>

        Interacting with WKHTTPCookieStores before creating WKWebViews and WKProcessPools should affect cookies used
        https://bugs.webkit.org/show_bug.cgi?id=171987

        Reviewed by Brady Eidson.

        Covered by new API tests.

        * CMakeLists.txt:
        * platform/Cookie.h:
        (WebCore::Cookie::Cookie):
        (WebCore::Cookie::isNull):
        (WebCore::CookieHash::hash):
        (WebCore::CookieHash::equal):
        (WTF::HashTraits<WebCore::Cookie>::emptyValue):
        (WTF::HashTraits<WebCore::Cookie>::constructDeletedValue):
        (WTF::HashTraits<WebCore::Cookie>::isDeletedValue):
        * platform/network/Cookie.cpp: Added.
        (WebCore::Cookie::operator==):
        (WebCore::Cookie::hash):
        * platform/network/cocoa/CookieCocoa.mm:
        (WebCore::Cookie::operator NSHTTPCookie *):
        (WebCore::Cookie::operator==):
        (WebCore::Cookie::hash):
        * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
        (WebCore::NetworkStorageSession::setCookies):
        Use NSHTTPCookie's hash and equality comparison to more closely match the NSHTTPCookie behavior.

2017-05-17  Emilio Cobos Álvarez  <ecobos@igalia.com>

        Add a RuntimeEnabledFeature for display: contents, defaulted to false.
        https://bugs.webkit.org/show_bug.cgi?id=171984

        Reviewed by Antti Koivisto.

        The "defaulted to false" is not only because there are spec issues,
        but because I ran the WPT suite, and there was a fair amount of
        crashes and messed render trees.

        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::adjustRenderStyle):
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setDisplayContentsEnabled):
        (WebCore::RuntimeEnabledFeatures::displayContentsEnabled):

2017-05-17  Antti Koivisto  <antti@apple.com>

        Regression (198943): <marquee> shouldn't wrap text
        https://bugs.webkit.org/show_bug.cgi?id=172217

        Reviewed by Andreas Kling.

        RenderMarquee::updateMarqueeStyle mutated the style and then expected it to inherit to children.
        This doesn't work anymore because render tree construction is now separated from style resolution
        where inheritance happens.

        Test: fast/html/marquee-child-wrap.html

        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::adjustRenderStyle):

            Implement marquee hacks in adjustRenderStyle instead. This can't do the childrenInline check
            the previous code had but it wasn't working anyway (there are no children when updateMarqueeStyle
            gets called).

        * rendering/RenderMarquee.cpp:
        (WebCore::RenderMarquee::updateMarqueeStyle):

            This no longer needs mutable style.

2017-05-16  David Kilzer  <ddkilzer@apple.com>

        Remove C-style casts by using xmlDocPtr instead of void*
        <https://webkit.org/b/172189>

        Reviewed by Alex Christensen.

        * dom/TransformSource.h: Fix whitespace indentation.
        (typedef PlatformTransformSource): Use xmlDocPtr not void*.
        * dom/TransformSourceLibxslt.cpp:
        (WebCore::TransformSource::~TransformSource): Remove cast.
        * xml/XSLStyleSheetLibxslt.cpp:
        (WebCore::XSLStyleSheet::document): Remove cast.
        * xml/XSLTProcessorLibxslt.cpp:
        (WebCore::xmlDocPtrFromNode): Remove casts.
        * xml/parser/XMLDocumentParser.h:
        (WebCore::xmlDocPtrForString): Update declaration to return
        xmlDocPtr not void*.
        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::XMLDocumentParser::doEnd): Change type of local
        variable from void* to xmlDocPtr.
        (WebCore::xmlDocPtrForString): Update to return xmlDocPtr
        not void*.

2017-05-16  Sam Weinig  <sam@webkit.org>

        Bring Notification.idl up to spec
        https://bugs.webkit.org/show_bug.cgi?id=172156

        Reviewed by Chris Dumez.

        Test: http/tests/notifications/notification.html

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

        * Modules/notifications/Notification.cpp:
        (WebCore::Notification::create):
        (WebCore::Notification::Notification):
        (WebCore::Notification::show):
        (WebCore::directionString): Deleted.
        (WebCore::Notification::permission): Deleted.
        (WebCore::Notification::permissionString): Deleted.
        * Modules/notifications/Notification.h:
        * Modules/notifications/Notification.idl:
        * Modules/notifications/NotificationClient.h:
        * Modules/notifications/NotificationDirection.h: Added.
        * Modules/notifications/NotificationPermission.h: Added.
        * Modules/notifications/NotificationPermission.idl: Added.
        * Modules/notifications/NotificationPermissionCallback.h:
        * Modules/notifications/NotificationPermissionCallback.idl:
        Bring up to spec, replacing DOMStrings with enums where appropriate and adding
        additional readonly properties to Notification to mirror options provided
        in construction.

2017-05-16  Zalan Bujtas  <zalan@apple.com>

        Do not skip <slot> children when collecting content for innerText.
        https://bugs.webkit.org/show_bug.cgi?id=172113
        <rdar://problem/30362324>

        Reviewed by Ryosuke Niwa and Brent Fulgham.

        "display: contents" elements do not generate renderers but their children might.
        This patch ensure that we don't skip them while collecting text content.  

        Test: fast/text/inner-text-should-include-slot-subtree.html

        * editing/TextIterator.cpp:
        (WebCore::TextIterator::advance):

2017-05-16  Filip Pizlo  <fpizlo@apple.com>

        GCController::garbageCollectNowIfNotDoneRecently should request Async Full GCs
        https://bugs.webkit.org/show_bug.cgi?id=172204

        Reviewed by Saam Barati.

        No new tests because existing tests will tell us if there is a problem.
        
        The goal of this change is to reduce the likelihood that we block for a GC. We want it to be
        benchmark-neutral.
        
        It's a 0.14% speed-up on JetStream with 24% probability.
        
        It's a 0.12% slow-down on PLT3 with 43% probability.
        
        So it's neutral on my machine.

        * bindings/js/GCController.cpp:
        (WebCore::GCController::garbageCollectNowIfNotDoneRecently):

2017-05-16  Tim Horton  <timothy_horton@apple.com>

        [macOS] REGRESSION: Drag images for links with right-to-left titles are incorrect (172006)
        https://bugs.webkit.org/show_bug.cgi?id=172006
        <rdar://problem/32165137>

        Reviewed by Dean Jackson.

        * platform/mac/DragImageMac.mm:
        (WebCore::LinkImageLayout::LinkImageLayout):
        (WebCore::createDragImageForLink):
        (WebCore::LinkImageLayout::addLine): Deleted.
        * platform/spi/cocoa/CoreTextSPI.h:
        Set and paint the entire frame as a single unit, making use of the
        CTFrameMaximumNumberOfLines attribute to limit the number of lines.
        This gives CoreText power over text alignment and makes RTL text lay
        out correctly.

2017-05-16  Chris Dumez  <cdumez@apple.com>

        Implement DOMMatrix / DOMMatrixReadOnly
        https://bugs.webkit.org/show_bug.cgi?id=110001

        Reviewed by Sam Weinig and Simon Fraser.

        Implement DOMMatrix / DOMMatrixReadOnly as per:
        - https://drafts.fxtf.org/geometry/#DOMMatrix

        For now, these new types co-exist with WebKitCSSMatrix / SVGMatrix. However, in the future,
        WebKitCSSMatrix / SVGMatrix are supposed to become aliases to DOMMatrix.

        Most of it has been implemented. What remaining to be implemented is:
        - Make WebKitCSSMatrix / SVGMatrix aliases to DOMMatrix
        - DOMMatrix.fromFloat32Array() / fromFloat64Array()
        - DOMMatrixReadOnly.fromFloat32Array() / fromFloat64Array() / toFloat32Array() / toFloat64Array()
        - DOMMatrixReadOnly.transformPoint().

        Tests: imported/w3c/web-platform-tests/css/geometry-1/*

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

        * bindings/scripts/CodeGeneratorJS.pm:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        Fix a bug in the bindings generator causing the generator code for
        "Constructor(optional (DOMString or sequence<unrestricted double>) init)" to be wrong
        and not build.

        * css/DOMMatrix.cpp: Added.
        (WebCore::DOMMatrix::DOMMatrix):
        (WebCore::DOMMatrix::fromMatrix):
        (WebCore::DOMMatrix::multiplySelf):
        (WebCore::DOMMatrix::preMultiplySelf):
        (WebCore::DOMMatrix::translateSelf):
        (WebCore::DOMMatrix::scaleSelf):
        (WebCore::DOMMatrix::scale3dSelf):
        (WebCore::DOMMatrix::rotateSelf):
        (WebCore::DOMMatrix::rotateFromVectorSelf):
        (WebCore::DOMMatrix::rotateAxisAngleSelf):
        (WebCore::DOMMatrix::skewXSelf):
        (WebCore::DOMMatrix::skewYSelf):
        (WebCore::DOMMatrix::invertSelf):
        (WebCore::DOMMatrix::setMatrixValueForBindings):
        * css/DOMMatrix.h: Added.
        (WebCore::DOMMatrix::create):
        (WebCore::DOMMatrix::setA):
        (WebCore::DOMMatrix::setB):
        (WebCore::DOMMatrix::setC):
        (WebCore::DOMMatrix::setD):
        (WebCore::DOMMatrix::setE):
        (WebCore::DOMMatrix::setF):
        (WebCore::DOMMatrix::setM11):
        (WebCore::DOMMatrix::setM12):
        (WebCore::DOMMatrix::setM13):
        (WebCore::DOMMatrix::setM14):
        (WebCore::DOMMatrix::setM21):
        (WebCore::DOMMatrix::setM22):
        (WebCore::DOMMatrix::setM23):
        (WebCore::DOMMatrix::setM24):
        (WebCore::DOMMatrix::setM31):
        (WebCore::DOMMatrix::setM32):
        (WebCore::DOMMatrix::setM33):
        (WebCore::DOMMatrix::setM34):
        (WebCore::DOMMatrix::setM41):
        (WebCore::DOMMatrix::setM42):
        (WebCore::DOMMatrix::setM43):
        (WebCore::DOMMatrix::setM44):
        * css/DOMMatrix.idl: Added.
        * css/DOMMatrixInit.h: Added.
        * css/DOMMatrixInit.idl: Added.
        * css/DOMMatrixReadOnly.cpp: Added.
        (WebCore::DOMMatrixReadOnly::DOMMatrixReadOnly):
        (WebCore::DOMMatrixReadOnly::validateAndFixup):
        (WebCore::DOMMatrixReadOnly::fromMatrix):
        (WebCore::DOMMatrixReadOnly::isIdentity):
        (WebCore::DOMMatrixReadOnly::setMatrixValue):
        (WebCore::DOMMatrixReadOnly::translate):
        (WebCore::DOMMatrixReadOnly::flipX):
        (WebCore::DOMMatrixReadOnly::flipY):
        (WebCore::DOMMatrixReadOnly::multiply):
        (WebCore::DOMMatrixReadOnly::scale):
        (WebCore::DOMMatrixReadOnly::scale3d):
        (WebCore::DOMMatrixReadOnly::rotate):
        (WebCore::DOMMatrixReadOnly::rotateFromVector):
        (WebCore::DOMMatrixReadOnly::rotateAxisAngle):
        (WebCore::DOMMatrixReadOnly::skewX):
        (WebCore::DOMMatrixReadOnly::skewY):
        (WebCore::DOMMatrixReadOnly::inverse):
        (WebCore::DOMMatrixReadOnly::toString):
        * css/DOMMatrixReadOnly.h: Added.
        (WebCore::DOMMatrixReadOnly::create):
        (WebCore::DOMMatrixReadOnly::a):
        (WebCore::DOMMatrixReadOnly::b):
        (WebCore::DOMMatrixReadOnly::c):
        (WebCore::DOMMatrixReadOnly::d):
        (WebCore::DOMMatrixReadOnly::e):
        (WebCore::DOMMatrixReadOnly::f):
        (WebCore::DOMMatrixReadOnly::m11):
        (WebCore::DOMMatrixReadOnly::m12):
        (WebCore::DOMMatrixReadOnly::m13):
        (WebCore::DOMMatrixReadOnly::m14):
        (WebCore::DOMMatrixReadOnly::m21):
        (WebCore::DOMMatrixReadOnly::m22):
        (WebCore::DOMMatrixReadOnly::m23):
        (WebCore::DOMMatrixReadOnly::m24):
        (WebCore::DOMMatrixReadOnly::m31):
        (WebCore::DOMMatrixReadOnly::m32):
        (WebCore::DOMMatrixReadOnly::m33):
        (WebCore::DOMMatrixReadOnly::m34):
        (WebCore::DOMMatrixReadOnly::m41):
        (WebCore::DOMMatrixReadOnly::m42):
        (WebCore::DOMMatrixReadOnly::m43):
        (WebCore::DOMMatrixReadOnly::m44):
        (WebCore::DOMMatrixReadOnly::is2D):
        (WebCore::DOMMatrixReadOnly::fromMatrixHelper):
        * css/DOMMatrixReadOnly.idl: Added.
        * css/WebKitCSSMatrix.h:
        * css/WebKitCSSMatrix.idl:
        * svg/SVGMatrix.h:
        * svg/SVGMatrix.idl:

2017-05-16  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] AudioSampleBufferList::zeroABL takes byte count, not sample count
        https://bugs.webkit.org/show_bug.cgi?id=172194
        <rdar://problem/32233799>

        Reviewed by Jer Noble.

        * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
        (WebCore::AudioTrackPrivateMediaStreamCocoa::render): Pass number of bytes to zero,
        not number of samples.

2017-05-16  Mark Lam  <mark.lam@apple.com>

        WorkerRunLoop::Task::performTask() needs to null check context->script() before use.
        https://bugs.webkit.org/show_bug.cgi?id=172193
        <rdar://problem/32225346>

        Reviewed by Filip Pizlo.

        According to https://build-safari.apple.com/results/Trunk%20Fuji%20GuardMalloc%20Production%20WK2%20Tests/r216929_459760e0918316187c8e52c6585a3a9ba9181204%20(12066)/results.html,
        we see a crash with this crash trace:

        Thread 13 Crashed:: WebCore: Worker
        0 com.apple.WebCore        0x00000001099607b2 WebCore::WorkerScriptController::isTerminatingExecution() const + 18
        1 com.apple.WebCore        0x000000010995ebbf WebCore::WorkerRunLoop::runCleanupTasks(WebCore::WorkerGlobalScope*) + 143
        2 com.apple.WebCore        0x000000010995e80f WebCore::WorkerRunLoop::run(WebCore::WorkerGlobalScope*) + 111
        3 com.apple.WebCore        0x00000001099621b6 WebCore::WorkerThread::workerThread() + 742
        4 com.apple.JavaScriptCore 0x000000010a964b92 WTF::threadEntryPoint(void*) + 178
        5 com.apple.JavaScriptCore 0x000000010a964a69 WTF::wtfThreadEntryPoint(void*) + 121
        6 libsystem_pthread.dylib  0x00007fffbdb5caab _pthread_body + 180
        7 libsystem_pthread.dylib  0x00007fffbdb5c9f7 _pthread_start + 286
        8 libsystem_pthread.dylib  0x00007fffbdb5c1fd thread_start + 13

        ... and the crashing address is:

        Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000022

        0x0000000000000022 is the offset of m_scheduledTerminationMutex in the
        WorkerScriptController.  This means that WorkerScriptController::isTerminatingExecution()
        is passed a NULL this pointer.  This means that it's possible to have a race
        where a WorkerRunLoop::Task gets enqueued beyond the Cleanup task that deletes the
        context->script().  As a result, WorkerRunLoop::Task::performTask() (called by
        runCleanupTasks()) may see a null context->script().

        Hence, WorkerRunLoop::Task::performTask() should null check context->script()
        before invoking the isTerminatingExecution() query on it.

        No new tests because this is already covered by existing tests.

        * workers/WorkerRunLoop.cpp:
        (WebCore::WorkerRunLoop::Task::performTask):

2017-05-16  Youenn Fablet  <youenn@apple.com>

        Modernize WebKit2 getUserMedia passing of parameters
        https://bugs.webkit.org/show_bug.cgi?id=172161

        Reviewed by Eric Carlson.

        No change of behavior.

        * platform/mediastream/RealtimeMediaSourceCenter.h: Using WTF::Function to enable capture Ref<>.

2017-05-16  Jeremy Jones  <jeremyj@apple.com>

        Captions and subtitles not showing up in picture-in-picture for MSE content.
        https://bugs.webkit.org/show_bug.cgi?id=172145

        Reviewed by Eric Carlson.

        No new tests as this has no affect on the DOM.

        Add TextTrackRepresentation code from MediaPlayerPrivateAVFoundationObj to MediaPlayerPrivateMediaSourceAVFObjc.
        This moves the TextTrackRepresentation platfrom layer into the fullscreen container layer when going into
        pip for fullscreen, allowing the captions to be visible.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenFrame):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::requiresTextTrackRepresentation):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::syncTextTrackBounds):
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation):

2017-05-16  David Kilzer  <ddkilzer@apple.com>

        WebCore::leakCGColor() needs CF_RETURNS_RETAINED annotation
        <https://webkit.org/b/172190>

        Reviewed by Simon Fraser.

        * platform/graphics/cg/ColorCG.cpp:
        (WebCore::leakCGColor): Annotate with CF_RETURNS_RETAINED since
        it does not follow the CF naming convention, which means the
        expected behavior can't be inferred by the clang static
        analyzer.

2017-05-16  Youenn Fablet  <youenn@apple.com>

        RealtimeOutgoingVideoSource should support sinkWants for rotation
        https://bugs.webkit.org/show_bug.cgi?id=172123
        <rdar://problem/32200017>

        Reviewed by Eric Carlson.

        Covered by manual testing.

        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink): Triggering pixel rotation based on sink.
        (WebCore::RealtimeOutgoingVideoSource::sendFrame): Doing the rotation using libwebrtc API.
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:

2017-05-16  Myles C. Maxfield  <mmaxfield@apple.com>

        REGRESSION(r212513): LastResort is platform-dependent, so its semantics should not be required to perform font loading correctly.
        https://bugs.webkit.org/show_bug.cgi?id=168487

        Reviewed by Antti Koivisto.

        There are three ways a Web author can chain multiple font files together:
        1. Multiple entries in the "src" descriptor in an @font-face rule
        2. Multiple @font-face rules with the same "font-family" descriptor
        3. Multiple entries in the "font-family" property on an element

        Before r212513, the code which iterated across #2 and #3 above could have
        triggered each item in the chain to download. r212513 tried to solve this
        by using LastResort as the interstitial font used during downloads, because
        LastResort supports every character and therefore solves #3 above. However,
        this change had a few problems:

        1. Previously, our code would try to avoid using the interstitial font for
        layout or rendering whenever possible (because one of the chains above may
        have named a local font which would be better to use). In order to use the
        benefits of LastResort, I had to remove this avoidance logic and make
        WebKit try to use the interstitial font as often as possible. However, due
        to the large metrics of LastResort, this means that offsetWidth queries
        during font loading would be wildly inaccurate, causing Google Docs to break.
        2. It also means that canvas drawing during font loading would actually draw
        LastResort, causing Bing maps to break.
        3. LastResort is platform-specific, so only platforms which have it would
        actually be able to load fonts correctly.

        Instead, we should keep the older logic about avoiding using the
        interstitial font so that loading has a better experience for the user.
        We solve the unnecessary download problem by giving our loading code a
        downloading policy enum, which has two values: allow downloads or forbid
        downloads. Whenever our loading code returns the interstitial font, we
        continue our search, but we change the policy to forbid downloads.

        There is one piece of subtlety, though: It is more common for web authors
        to put good fallbacks in the "font-family" property than in the "src"
        descriptor inside @font-face. This means that we shouldn't exhaustively
        search through the @font-face src list first. Instead, we should look
        through the src list until we hit a non-local font, and then immediately
        start looking through the other other chains.

        Tests: fast/text/font-download-font-face-src-list.html
               fast/text/font-download-font-family-property.html
               fast/text/font-download-remote-fallback-all.html
               fast/text/font-interstitial-invisible-width-while-loading.html
               fast/text/font-weight-download-3.html
               fast/text/web-font-load-fallback-during-loading-2.html
               fast/text/web-font-load-invisible-during-loading.html

        * css/CSSFontFace.cpp:
        (WebCore::CSSFontFace::fontLoadEventOccurred): Implement support for
        the font download policy.
        (WebCore::CSSFontFace::setStatus): After 3 seconds of loading, we
        will start drawing the fallback font. However, for testing, we have an
        internal setting to make this switch happen immediately. This patch now
        requires that this internal switch happen synchronously.
        (WebCore::CSSFontFace::pump): Implement support for the font download
        policy.
        (WebCore::CSSFontFace::load): Ditto.
        (WebCore::CSSFontFace::font): Ditto.
        * css/CSSFontFace.h: Ditto.
        * css/CSSFontSelector.cpp:
        (WebCore::CSSFontSelector::beginLoadingFontSoon): Implement support for
        synchronous font download timeouts.
        * css/CSSSegmentedFontFace.cpp:
        (WebCore::CSSSegmentedFontFace::fontRanges): Implement support for the
        font download policy.
        * platform/graphics/Font.cpp: Add new flag which represents if the
        interstitial font was created after the 3 second timeout or before.
        Previously, we would distinguish between these two cases by knowing
        that one font was LastResort and the other font was a fallback. Now that
        we're using fallback fonts on both sides of the 3 second timeout, we
        now no longer know which one should be invisible. This new enum solves
        this problem.
        (WebCore::Font::Font):
        (WebCore::Font::verticalRightOrientationFont):
        (WebCore::Font::uprightOrientationFont):
        * platform/graphics/Font.h: Ditto.
        (WebCore::Font::create):
        (WebCore::Font::origin):
        (WebCore::Font::visibility):
        * platform/graphics/FontCache.h:
        * platform/graphics/FontCascade.cpp: We try to fall back to a local() font
        during downloads, but there might not be one that we can use. Therefore, we
        can't use the presence of the interstitial font to detect if we should paint
        invisibly. Instead, we can move this logic into the font-specific part of
        painting, and consult with the specific font to know if it was created from
        a timed-out @font-face rule or not.
        (WebCore::FontCascade::drawText):
        (WebCore::shouldDrawIfLoading):
        (WebCore::FontCascade::drawGlyphBuffer):
        (WebCore::FontCascade::drawEmphasisMarks):
        * platform/graphics/FontCascade.h:
        * platform/graphics/FontCascadeFonts.cpp:
        (WebCore::FontCascadeFonts::glyphDataForVariant): Implement the logic
        described above where we switch the policy if we encounter the intestitial
        font.
        (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Ditto.
        (WebCore::glyphPageFromFontRanges): Ditto.
        * platform/graphics/FontRanges.cpp: Implement support for the font download
        policy.
        (WebCore::FontRanges::Range::font):
        (WebCore::FontRanges::glyphDataForCharacter):
        (WebCore::FontRanges::fontForCharacter):
        (WebCore::FontRanges::fontForFirstRange):
        * platform/graphics/FontRanges.h:
        * platform/graphics/FontSelector.h:
        * platform/graphics/freetype/FontCacheFreeType.cpp:
        (WebCore::FontCache::lastResortFallbackFontForEveryCharacter): Deleted.
        * platform/graphics/mac/FontCacheMac.mm:
        (WebCore::FontCache::lastResortFallbackFontForEveryCharacter): Deleted.
        * platform/graphics/win/FontCacheWin.cpp:
        (WebCore::FontCache::lastResortFallbackFontForEveryCharacter): Deleted.

2017-05-16  Zalan Bujtas  <zalan@apple.com>

        Simple line layout: Move setCollapedWhitespaceWidth call to updateLineConstrains.
        https://bugs.webkit.org/show_bug.cgi?id=172178

        Reviewed by Antti Koivisto.

        No change in functionality.

        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::updateLineConstrains):
        (WebCore::SimpleLineLayout::createLineRuns):

2017-05-16  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Return default device list until user gives permission to capture
        https://bugs.webkit.org/show_bug.cgi?id=172168
        <rdar://problem/31816884>

        Reviewed by Youenn Fablet.

        Test: fast/mediastream/media-devices-enumerate-devices.html

        * Modules/mediastream/MediaDevicesRequest.cpp:
        (WebCore::MediaDevicesRequest::filterDeviceList): Remove all but the "default" number of
        devices of each type.
        (WebCore::MediaDevicesRequest::start): Call filterDeviceList.
        * Modules/mediastream/MediaDevicesRequest.h:

2017-05-16  Claudio Saavedra  <csaavedra@igalia.com>

        Silent a few warnings about unused parameters
        https://bugs.webkit.org/show_bug.cgi?id=172169

        Reviewed by Sam Weinig.

        * page/Page.cpp:
        (WebCore::Page::mainFrameLoadStarted):
        * platform/graphics/cairo/ImageBufferCairo.cpp:
        (WebCore::ImageBuffer::toData):
        * platform/network/ResourceRequestBase.cpp:
        (WebCore::ResourceRequestBase::partitionName):

2017-05-16  Wenson Hsieh  <wenson_hsieh@apple.com>

        WebItemProviderPasteboard should be robust when temporary files are missing path extensions
        https://bugs.webkit.org/show_bug.cgi?id=172170

        Reviewed by Tim Horton.

        Makes a slight adjustment to the temporary file URLs are handled when using WebItemProviderPasteboard to load
        data off of item providers. Previously, we would bail early and not load any data if the temporary URL is
        missing an extension. Since the switch to NSItemProviders from UIItemProviders, some types of temporary files
        generated by item providers are missing extensions, so this extra check is meaningless.

        Covered by existing data interaction unit tests.

        * platform/ios/WebItemProviderPasteboard.mm:
        (temporaryFileURLForDataInteractionContent):
        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):

2017-05-16  Zan Dobersek  <zdobersek@igalia.com>

        [WPE] GLContextEGL::createWPEContext() should fall back to pbuffer-based contexts when offscreen target provides no native window
        https://bugs.webkit.org/show_bug.cgi?id=172162

        Reviewed by Carlos Garcia Campos.

        When creating an offscreen GLContext, the underlying implementation might
        provide a mock native window that's to be used as the window target upon
        which a window-based GLContext should be created. But we should also support
        falling back to pbuffer-based GLContexts when the underlying implementation
        can't provide such mock targets.

        * platform/graphics/egl/GLContextEGLWPE.cpp:
        (WebCore::GLContextEGL::createWPEContext):

2017-05-16  Zan Dobersek  <zdobersek@igalia.com>

        [GLib] Name more GSource-based RunLoop::Timers
        https://bugs.webkit.org/show_bug.cgi?id=172158

        Reviewed by Carlos Garcia Campos.

        * platform/glib/MainThreadSharedTimerGLib.cpp:
        (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
        Specify 'MainThreadSharedTimer' as the name of this GSource-based RunLoop::Timer.

2017-05-16  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Implement ReadableStreamBYOBReader releaseLock()
        https://bugs.webkit.org/show_bug.cgi?id=172111

        Reviewed by Chris Dumez.

        Implemented ReadableStreamBYOBReader releaseLock():
        - https://streams.spec.whatwg.org/#byob-reader-release-lock;
        - https://streams.spec.whatwg.org/#readable-stream-reader-generic-release.

        Added tests to check releaseLock behavior.

        * Modules/streams/ReadableStreamBYOBReader.js:
        (releaseLock): Implemented.
        * Modules/streams/ReadableStreamInternals.js:
        (readableStreamReaderGenericRelease): Aligned with spec.

2017-05-16  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Try to fix GTK+ build with MEDIA_STREAM enabled after r216918.

        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
        (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):

2017-05-16  Youenn Fablet  <youenn@apple.com>

        Remove MediaConstraintsData and MediaConstraintsImpl
        https://bugs.webkit.org/show_bug.cgi?id=172132

        Reviewed by Eric Carlson.

        No observable change of behavior.

        Removing MediaConstraintsData and MediaConstraintsImpl allows simplifying the code.
        Further simplified the code by making MediaConstraints no longer ref counted and now a struct.
        Simplified some RealtimeMediaSource subclasses by removing unused MediaConstraints class members.

        * CMakeLists.txt: Removing MediaConstraintsImpl.cpp.
        * Modules/mediastream/MediaConstraintsImpl.cpp: Removed.
        * Modules/mediastream/MediaConstraintsImpl.h: Removed.
        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::createMediaConstraints):
        (WebCore::MediaDevices::getUserMedia):
        (WebCore::createMediaConstraintsImpl): Deleted.
        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::createMediaConstraints):
        (WebCore::MediaStreamTrack::applyConstraints):
        (WebCore::createMediaConstraintsImpl): Deleted.
        * Modules/mediastream/MediaTrackConstraints.cpp:
        (WebCore::createMediaConstraints):
        (WebCore::createMediaConstraintsImpl): Deleted.
        * Modules/mediastream/MediaTrackConstraints.h:
        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::start):
        (WebCore::UserMediaRequest::UserMediaRequest):
        (WebCore::UserMediaRequest::allow):
        * Modules/mediastream/UserMediaRequest.h:
        (WebCore::UserMediaRequest::audioConstraints):
        (WebCore::UserMediaRequest::videoConstraints):
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/MediaConstraints.cpp:
        (WebCore::addDefaultVideoConstraints):
        (WebCore::MediaConstraints::isConstraintSet):
        (WebCore::MediaConstraints::setDefaultVideoConstraints):
        * platform/mediastream/MediaConstraints.h:
        (WebCore::MediaConstraints::~MediaConstraints): Deleted.
        (WebCore::MediaConstraints::MediaConstraints): Deleted.
        * platform/mediastream/MediaStreamConstraintsValidationClient.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::selectSettings):
        (WebCore::RealtimeMediaSource::supportsConstraints):
        (WebCore::RealtimeMediaSource::applyConstraints):
        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
        (WebCore::RealtimeIncomingAudioSource::supportedConstraints): Deleted.
        * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
        * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
        (WebCore::RealtimeIncomingVideoSource::supportedConstraints): Deleted.
        * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
        * platform/mock/MockRealtimeMediaSource.h:
        (WebCore::MockRealtimeMediaSource::constraints): Deleted.

2017-05-16  Andy Estes  <aestes@apple.com>

        [Cocoa] Tell NEFilterSource about the presenting app's PID
        https://bugs.webkit.org/show_bug.cgi?id=172152
        <rdar://problem/32197740>

        Reviewed by Dan Bernstein.

        * platform/cocoa/NetworkExtensionContentFilter.mm:
        (WebCore::NetworkExtensionContentFilter::initialize):
        * platform/spi/cocoa/NEFilterSourceSPI.h:

2017-05-16  Manuel Rego Casasnovas  <rego@igalia.com>

        [css-grid] Fix static position of positioned grid items
        https://bugs.webkit.org/show_bug.cgi?id=172108

        Reviewed by Sergio Villar Senin.

        This patch makes us follow the text on the spec
        (https://drafts.csswg.org/css-grid/#static-position):
        "The static position of an absolutely-positioned child
         of a grid container is determined as if it were the sole grid item
         in a grid area whose edges coincide with the padding edges
         of the grid container."

        Test: fast/css-grid-layout/absolute-positioning-grid-container-parent.html

        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::prepareChildForPositionedLayout): Modified to avoid
        including padding to match the spec behavior.

2017-05-16  Per Arne Vollan  <pvollan@apple.com>

        Compile error, include file is not found.
        https://bugs.webkit.org/show_bug.cgi?id=172105

        Reviewed by Brent Fulgham.

        Use __has_include to detect if include file exists.

        * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:

2017-05-15  Andy Estes  <aestes@apple.com>

        Make the application PID available to WebCore
        https://bugs.webkit.org/show_bug.cgi?id=172133

        Reviewed by Andreas Kling.

        * CMakeLists.txt:
        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/RuntimeApplicationChecks.cpp: Added.
        (WebCore::presentingApplicationPIDOverride):
        (WebCore::presentingApplicationPID): Returns the override PID if set, or getCurrentProcessID()
        otherwise.
        (WebCore::setPresentingApplicationPID):
        * platform/RuntimeApplicationChecks.h:
        * platform/cocoa/RuntimeApplicationChecksCocoa.mm: Renamed from Source/WebCore/platform/RuntimeApplicationChecks.mm.

2017-05-15  Antti Koivisto  <antti@apple.com>

        RenderTheme does not need to be per-page
        https://bugs.webkit.org/show_bug.cgi?id=172116
        <rdar://problem/30426457>

        Reviewed by Zalan Bujtas.

        There are no implementations of RenderTheme::themeForPage that actually care about the page.
        It can be replaced with a singleton, simplifying a bunch of code.

        * Modules/mediacontrols/MediaControlsHost.cpp:
        (WebCore::MediaControlsHost::shadowRootCSSText):
        (WebCore::MediaControlsHost::base64StringForIconNameAndType):
        * css/CSSDefaultStyleSheets.cpp:
        (WebCore::CSSDefaultStyleSheets::loadFullDefaultStyle):
        (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):

            Fix a potential crash if we get here when page is null (though it doesn't appear to repro on trunk).

        * css/StyleColor.cpp:
        (WebCore::StyleColor::colorFromKeyword):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::adjustRenderStyle):
        * css/parser/CSSParser.cpp:
        (WebCore::CSSParser::parseSystemColor):
        * css/parser/CSSParser.h:
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::CSSPropertyParser::consumeSystemFont):
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::updateAppearance):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
        * html/HTMLMeterElement.cpp:
        (WebCore::HTMLMeterElement::createElementRenderer):
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::usesMenuList):
        (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
        (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle):
        * html/InputType.cpp:
        (WebCore::InputType::themeSupportsDataListUI):
        * html/TextFieldInputType.cpp:
        (WebCore::TextFieldInputType::shouldHaveSpinButton):
        (WebCore::TextFieldInputType::shouldHaveCapsLockIndicator):
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::setStrokeColor):
        (WebCore::CanvasRenderingContext2D::setFillColor):
        * html/canvas/CanvasStyle.cpp:
        (WebCore::parseColor):
        (WebCore::parseColorOrCurrentColor):
        (WebCore::CanvasStyle::createFromString):
        * html/canvas/CanvasStyle.h:
        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlPanelElement::startTimer):
        (WebCore::MediaControlPanelElement::makeOpaque):
        (WebCore::MediaControlPanelElement::makeTransparent):
        * html/shadow/MediaControls.cpp:
        (WebCore::MediaControls::reset):
        (WebCore::MediaControls::reportedError):
        (WebCore::MediaControls::updateCurrentTimeDisplay):
        * html/shadow/mac/ImageControlsButtonElementMac.cpp:
        (WebCore::ImageControlsButtonElementMac::tryCreate):
        * page/MemoryRelease.cpp:
        (WebCore::releaseNoncriticalMemory):
        * page/Page.cpp:
        (WebCore::Page::Page):
        * page/Page.h:
        (WebCore::Page::theme): Deleted.
        * platform/wpe/RenderThemeWPE.cpp:
        (WebCore::RenderTheme::singleton):
        (WebCore::RenderTheme::themeForPage): Deleted.
        * rendering/RenderEmbeddedObject.cpp:
        (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::theme):
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::focusRingColor):
        * rendering/RenderTheme.h:
        (WebCore::RenderTheme::defaultTheme): Deleted.
        * rendering/RenderThemeGtk.cpp:
        (WebCore::RenderTheme::singleton):
        (WebCore::RenderTheme::themeForPage): Deleted.
        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderTheme::singleton):
        (WebCore::RenderTheme::themeForPage): Deleted.
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderTheme::singleton):
        (WebCore::RenderTheme::themeForPage): Deleted.
        * rendering/RenderThemeWin.cpp:
        (WebCore::RenderTheme::singleton):
        (WebCore::RenderTheme::themeForPage): Deleted.
        * rendering/TextPaintStyle.cpp:
        (WebCore::computeTextPaintStyle):

2017-05-15  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Do not delete asynchronously decoded frames for large images if their clients are in the viewport
        https://bugs.webkit.org/show_bug.cgi?id=170640

        Reviewed by Simon Fraser.

        The image flickering problem happens when a large image is visible in the
        view port and for some reason, the decoded frame gets destroyed. When this
        image is repainted, BitmapImage::draw() does not find a valid decoded frame
        for that image. It then requests an async decoding for the image and just
        draws nothing in the image rectangle. Drawing no content between two drawing
        phases in which the image is drawn causes the unwanted flickering.

        To fix this issue we need to protect the decoded frames of all the images
        in the view port from being destroyed. When BitmapImage::destroyDecodedData()
        is called, it is going to check, through the ImageObserver, whether any
        of its clients is visible. And if so, the current decoded frame won't be
        destroyed.

        Tests: Modifying existing tests.

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::CachedImageObserver::decodedSizeChanged):
        (WebCore::CachedImage::CachedImageObserver::didDraw):
        (WebCore::CachedImage::CachedImageObserver::canDestroyDecodedData):
        (WebCore::CachedImage::CachedImageObserver::imageFrameAvailable):
        (WebCore::CachedImage::CachedImageObserver::changedInRect):
        (WebCore::CachedImage::decodedSizeChanged):
        (WebCore::CachedImage::didDraw):
        (WebCore::CachedImage::canDestroyDecodedData): Finds out whether it's okay
        to discard the image decoded data or not.
        (WebCore::CachedImage::imageFrameAvailable):
        (WebCore::CachedImage::changedInRect):
        * loader/cache/CachedImage.h:
        * loader/cache/CachedImageClient.h:
        (WebCore::CachedImageClient::canDestroyDecodedData):
        * loader/cache/MemoryCache.cpp:
        (WebCore::MemoryCache::destroyDecodedDataForAllImages): This function is
        currently not used. Use in the internal destroyDecodedDataForAllImages()
        but unlike what CachedImage::destroyDecodedData() does, make it destroy
        the decoded frames without deleting the image itself.
        * loader/cache/MemoryCache.h:
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::destroyDecodedData):
        (WebCore::BitmapImage::draw):
        (WebCore::BitmapImage::canDestroyCurrentFrameDecodedData): 
        (WebCore::BitmapImage::advanceAnimation):
        (WebCore::BitmapImage::internalAdvanceAnimation):
        (WebCore::BitmapImage::imageFrameAvailableAtIndex):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/GraphicsContext3D.cpp:
        (WebCore::GraphicsContext3D::packImageData):
        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::decodedSizeChanged):
        (ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): The assertion in this
        function is wrong. frameIsCompleteAtIndex() can be false when the an image
        decoding is requested but can be true when the decoding finishes.
        * platform/graphics/ImageObserver.h:
        * platform/graphics/cairo/ImageCairo.cpp:
        (WebCore::Image::drawPattern):
        * platform/graphics/cg/ImageCG.cpp:
        (WebCore::Image::drawPattern):
        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::ImageDecoder::frameIsCompleteAtIndex):
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::decodedSizeChanged):
        (WebCore::PDFDocumentImage::draw):
        * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
        (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
        * platform/graphics/win/ImageDirect2D.cpp:
        (WebCore::Image::drawPattern):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::isVisibleInDocumentRect):
        (WebCore::RenderElement::isVisibleInViewport):
        (WebCore::RenderElement::imageFrameAvailable):
        (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
        (WebCore::RenderElement::shouldRepaintInVisibleRect): Deleted. Function
        is renamed to isVisibleInViewport() for better readability.
        * rendering/RenderElement.h:
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::draw):
        * svg/graphics/SVGImageClients.h:
        * testing/Internals.cpp:
        (WebCore::Internals::destroyDecodedDataForAllImages):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-05-15  Youenn Fablet  <youenn@apple.com>

        Simplify RealtimeMediaSource data production and state
        https://bugs.webkit.org/show_bug.cgi?id=171999

        Reviewed by Eric Carlson.

        RealtimeMediaSource takes 3 booleans:
        - m_isProducingData tells whether data is produced or not. In the case of capturing, it tells whether capture
          happens.
        - m_muted/m_enabled allows JS or WebKit level to start/stop the source.

        Changed MediaStream capture state computation so that capture is reported as follows:
        - m_isProducing is true, capture is happenning and is active
        - m_muted is true, capture is happening but is inactive.

        Except in the case of WebRTC incoming sources, for which sources may be created as muted as per the spec,
        all sources are unmuted, enabled and not producing data when created.

        RealtimeMediaSource is now activable either by calling start/stop or by calling setMuted/setEnabled.
        This in turns will set the boolean values accordingly and will call the underlying
        startProducingData/stopProducingData methods doing the actual stuff.

        Removing from all RealtimeMediaSource subclasses the handling of producing data.
        Making more methods non-virtual/member fields private to simplify the model.

        * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
        (WebCore::CanvasCaptureMediaStreamTrack::Source::create):
        (WebCore::CanvasCaptureMediaStreamTrack::Source::startProducingData):
        (WebCore::CanvasCaptureMediaStreamTrack::Source::stopProducingData):
        (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasDestroyed):
        (WebCore::CanvasCaptureMediaStreamTrack::Source::captureCanvas):
        * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::mediaState):
        * platform/mediastream/MediaStreamTrackPrivate.h:
        (WebCore::MediaStreamTrackPrivate::startProducingData):
        (WebCore::MediaStreamTrackPrivate::stopProducingData):
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::setMuted):
        (WebCore::RealtimeMediaSource::notifyMutedChange):
        (WebCore::RealtimeMediaSource::setEnabled):
        (WebCore::RealtimeMediaSource::start):
        (WebCore::RealtimeMediaSource::stop):
        (WebCore::RealtimeMediaSource::requestStop):
        (WebCore::RealtimeMediaSource::reset): Deleted.
        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/mac/AVMediaCaptureSource.h:
        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        (WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
        (WebCore::AVMediaCaptureSource::captureSessionIsRunningDidChange):
        (WebCore::AVMediaCaptureSource::reset): Deleted.
        (WebCore::AVMediaCaptureSource::isProducingData): Deleted.
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
        (WebCore::CoreAudioCaptureSource::startProducingData):
        (WebCore::CoreAudioCaptureSource::stopProducingData):
        (WebCore::CoreAudioCaptureSource::audioSourceProvider):
        * platform/mediastream/mac/CoreAudioCaptureSource.h:
        * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
        (WebCore::MockRealtimeAudioSourceMac::render):
        (WebCore::MockRealtimeAudioSource::createMuted): Deleted.
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
        (WebCore::MockRealtimeVideoSource::createMuted): Deleted.
        * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
        (WebCore::RealtimeIncomingAudioSource::create):
        (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
        (WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
        (WebCore::RealtimeIncomingAudioSource::startProducingData):
        (WebCore::RealtimeIncomingAudioSource::stopProducingData):
        (WebCore::RealtimeIncomingAudioSource::setSourceTrack):
        * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
        * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
        (WebCore::RealtimeIncomingVideoSource::create):
        (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
        (WebCore::RealtimeIncomingVideoSource::startProducingData):
        (WebCore::RealtimeIncomingVideoSource::setSourceTrack):
        (WebCore::RealtimeIncomingVideoSource::stopProducingData):
        (WebCore::RealtimeIncomingVideoSource::OnFrame):
        * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
        * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
        (WebCore::WebAudioSourceProviderAVFObjC::setClient):
        * platform/mock/MockMediaEndpoint.cpp:
        (WebCore::MockMediaEndpoint::createMutedRemoteSource):
        (WebCore::MockMediaEndpoint::unmuteTimerFired):
        * platform/mock/MockRealtimeAudioSource.cpp:
        (WebCore::MockRealtimeAudioSource::createMuted):
        (WebCore::MockRealtimeAudioSource::startProducingData):
        (WebCore::MockRealtimeAudioSource::stopProducingData):
        * platform/mock/MockRealtimeAudioSource.h:
        * platform/mock/MockRealtimeMediaSource.cpp:
        (WebCore::MockRealtimeMediaSource::startProducingData): Deleted.
        (WebCore::MockRealtimeMediaSource::stopProducingData): Deleted.
        * platform/mock/MockRealtimeMediaSource.h:
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::createMuted):
        (WebCore::MockRealtimeVideoSource::startProducingData):
        (WebCore::MockRealtimeVideoSource::stopProducingData):
        (WebCore::MockRealtimeVideoSource::generateFrame):
        * platform/mock/MockRealtimeVideoSource.h:

2017-05-15  Myles C. Maxfield  <mmaxfield@apple.com>

        Migrate Font constructor from bools to enums
        https://bugs.webkit.org/show_bug.cgi?id=172140

        Reviewed by Tim Horton.

        In https://bugs.webkit.org/show_bug.cgi?id=168487, I'm adding a new flag to Font. We can't
        keep having just a pile of bools in this class. Instead, we should be using enums.

        No new tests because there is no behavior change.

        * css/CSSFontFace.cpp:
        (WebCore::CSSFontFace::font):
        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::font):
        * css/CSSSegmentedFontFace.cpp:
        * loader/cache/CachedFont.cpp:
        (WebCore::CachedFont::createFont):
        * platform/graphics/Font.cpp:
        (WebCore::Font::Font):
        (WebCore::Font::verticalRightOrientationFont):
        (WebCore::Font::uprightOrientationFont):
        (WebCore::Font::brokenIdeographFont):
        (WebCore::Font::description):
        (WebCore::Font::mathData):
        * platform/graphics/Font.h:
        (WebCore::Font::create):
        (WebCore::Font::origin):
        (WebCore::Font::isInterstitial):
        (WebCore::Font::widthForGlyph):
        (WebCore::Font::isCustomFont): Deleted.
        (WebCore::Font::isLoading): Deleted.
        * platform/graphics/FontRanges.cpp:
        * platform/graphics/cocoa/FontCocoa.mm:
        (WebCore::Font::platformInit):
        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
        (WebCore::Font::platformCreateScaledFont):
        * platform/graphics/win/SimpleFontDataCGWin.cpp:
        (WebCore::Font::platformInit):
        * platform/graphics/win/SimpleFontDataDirect2D.cpp:
        (WebCore::Font::platformInit):
        * platform/graphics/win/SimpleFontDataWin.cpp:
        (WebCore::Font::platformCreateScaledFont):
        (WebCore::Font::determinePitch):
        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::canUseForFontAndText):

2017-05-15  Youenn Fablet  <youenn@apple.com>

        WebRTC outgoing muted video sources should send black frames
        https://bugs.webkit.org/show_bug.cgi?id=170627
        <rdar://problem/31513869>

        Reviewed by Eric Carlson.

        Covered by updated test.

        Instead of sending one black frame and then another one asynchronously,
        we use the timer to send a black frame every second when outgoing source is muted.

        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
        (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
        (WebCore::RealtimeOutgoingVideoSource::sendBlackFrames):
        (WebCore::RealtimeOutgoingVideoSource::sendBlackFrame): Deleted.
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
        * testing/Internals.cpp:
        (WebCore::Internals::videoSampleAvailable):

2017-05-15  David Kilzer  <ddkilzer@apple.com>

        Crash in libxml2.2.dylib: xmlDictReference
        <https://webkit.org/b/172086>
        <rdar://problem/23643436>

        Reviewed by Daniel Bates.

        Speculative fix and code clean-up based on source code
        inspection.  The fix for the crash is in two parts that change
        XSLStyleSheet::parseString():
        1. Always set m_stylesheetDoc to nullptr after freeing it via
           XSLStyleSheet::clearXSLStylesheetDocument().
        2. Add nullptr check before using m_stylesheetDoc from parent.

        Broadly speaking, the changes are:
        - Extract code to reset m_stylesheetDoc into new private
          XSLStyleSheet::clearXSLStylesheetDocument() method.  There is
          a special contract between m_stylesheetDoc and
          m_stylesheetDocTaken that wasn't being followed every time.
          See comment in XSLStyleSheet::compileStyleSheet().
        - XSLStyleSheet::clearDocuments() now calls new
          clearXSLStylesheetDocument() method.  Previously, it was not
          checking or resetting m_stylesheetDocTaken, and it might have
          leaked an xmlDocPtr if m_stylesheetDoc was set and
          m_stylesheetDocTaken was false.
        - XSLStyleSheet::parseString() now calls new
          clearXSLStylesheetDocument() method.  Previously, it did not
          clear m_stylesheetDoc after freeing it, and it could return
          early due to a failure in xmlCreateMemoryParserCtxt().
        - In XSLStyleSheet::parseString() use checked arithmetic when
          calculating 'size' for xmlCreateMemoryParserCtxt() and
          xmlCtxtReadMemory().  This code used to do an implicit
          unsigned -> signed integer conversion that could overflow.
        - Always iterate m_children using an 'auto& import' variable.

        * xml/XSLStyleSheet.h:
        (WebCore::XSLStyleSheet::clearXSLStylesheetDocument): Add declaration.
        (WebCore::XSLStyleSheet::m_disabled): Add default initializer.
        (WebCore::XSLStyleSheet::m_stylesheetDoc): Ditto.
        (WebCore::XSLStyleSheet::m_stylesheetDocTaken): Ditto.
        (WebCore::XSLStyleSheet::m_parentStyleSheet): Ditto.

        * xml/XSLStyleSheetLibxslt.cpp:
        (WebCore::XSLStyleSheet::XSLStyleSheet): Get rid of redundant
        initializers.  Set m_parentStyleSheet if needed.
        (WebCore::XSLStyleSheet::~XSLStyleSheet): Call
        clearXSLStylesheetDocument() instead of custom code.  Switch
        m_children fast iteration to use 'auto& import' variable.
        (WebCore::XSLStyleSheet::isLoading): Switch m_children fast
        iteration to use 'auto& import' variable.
        (WebCore::XSLStyleSheet::clearDocuments): Call
        clearXSLStylesheetDocument() instead of setting m_stylesheetDoc
        to nullptr.  This might fix an occasional xmlDocPtr leak.
        (WebCore::XSLStyleSheet::clearXSLStylesheetDocument): Add.  This
        method always sets m_stylesheetDoc to nullptr (after freeing it
        if necessary) and sets m_stylesheetDocTaken to false.
        (WebCore::XSLStyleSheet::parseString): Call
        clearXSLStylesheetDocument().  Prior to this, m_stylesheetDoc
        might be left pointing to a freed value, and this method could
        return early if xmlCreateMemoryParserCtxt() failed.  Switch to
        using Checked<> to compute required buffer size to parse XSL
        stylesheet, and return early on overflow.  Clean up existing
        return statements to use boolean expressions.  Add nullptr check
        for m_parentStyleSheet->m_stylesheetDoc before using it.
        (WebCore::XSLStyleSheet::loadChildSheet): Get rid of local
        variable by calling loadSheet() from last array element.
        (WebCore::XSLStyleSheet::compileStyleSheet): Add debug assert
        that m_stylesheetDoc is not nullptr.

2017-05-15  Jer Noble  <jer.noble@apple.com>

        Add experimental setting to allow document gesture interaction to fulfill media playback gesture requirement
        https://bugs.webkit.org/show_bug.cgi?id=172131

        Reviewed by Eric Carlson.

        Test: media/restricted-audio-playback-with-document-gesture.html

        Move all calls to ScriptController::processingUserGestureForMedia() to the new Document equivalent. In Document,
        if the new setting is enabled, return true from processingUserGestureForMedia() if the top-level document has had
        a user gesture interaction.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::processingUserGestureForMedia):
        * Modules/mediastream/MediaStream.h:
        * Modules/webaudio/AudioContext.cpp:
        (WebCore::AudioContext::processingUserGestureForMedia):
        (WebCore::AudioContext::willBeginPlayback):
        (WebCore::AudioContext::willPausePlayback):
        * Modules/webaudio/AudioContext.h:
        * dom/Document.cpp:
        (WebCore::Document::processingUserGestureForMedia):
        * dom/Document.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::load):
        (WebCore::HTMLMediaElement::audioTrackEnabledChanged):
        (WebCore::HTMLMediaElement::seekWithTolerance):
        (WebCore::HTMLMediaElement::play):
        (WebCore::HTMLMediaElement::playInternal):
        (WebCore::HTMLMediaElement::pause):
        (WebCore::HTMLMediaElement::pauseInternal):
        (WebCore::HTMLMediaElement::setMuted):
        (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker):
        (WebCore::HTMLMediaElement::processingUserGestureForMedia):
        * html/HTMLMediaElement.h:
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::playbackPermitted):
        (WebCore::MediaElementSession::dataLoadingPermitted):
        (WebCore::MediaElementSession::fullscreenPermitted):
        (WebCore::MediaElementSession::canShowControlsManager):
        (WebCore::MediaElementSession::showPlaybackTargetPicker):
        * page/Settings.in:
        * platform/audio/PlatformMediaSession.h:

2017-05-15  Jer Noble  <jer.noble@apple.com>

        Only ever initialize LibWebRTCProvider's staticFactoryAndThreads() factories once.
        https://bugs.webkit.org/show_bug.cgi?id=172047

        Reviewed by Youenn Fablet.

        Wrap the initilization of the factories contained in staticFactoryAndThreads() in a call_once to ensure
        new factories aren't created every time it's called.

        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::staticFactoryAndThreads):

2017-05-15  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: CRASH seen with DOM.setOuterHTML when there is no documentElement
        https://bugs.webkit.org/show_bug.cgi?id=172135
        <rdar://problem/32175860>

        Reviewed by Brian Burg.

        Test: inspector/dom/setOuterHTML-no-document-element.html

        * inspector/DOMPatchSupport.cpp:
        (WebCore::DOMPatchSupport::patchDocument):
        Null check the document element which might not exist.

2017-05-15  Said Abou-Hallawa  <sabouhallawa@apple.com>

        REGRESSION (216471): Infinite repaint-drawing loop when asynchronously decoding incomplete image frames
        https://bugs.webkit.org/show_bug.cgi?id=171900

        Reviewed by Tim Horton.

        -- Don't destroy incomplete decoded image frames for large images. This
        is to avoid flickering while decoding another image frame with the new
        data. The old incomplete image frame will be destroyed once the newer one
        finishes decoding.

        -- Extend the enum ImageFrame::DecodingStatus by adding a new value called
        'Decoding'. This new value will never be cached in the ImageFrame::
        m_decodingStatus. Add a member m_currentFrameDecodingStatus to BitmapImage.
        The purpose of this member is to invalidate the current frame, without
        deleting it, when new encoded data is received.

        -- Don't wait until the native image is decoded to cache the ImageFrame
        decodingStatus. There is a big chance that more data arrives between
        starting the decoding and finishing it such that the decoding changes
        from Partial to Complete. We need to prevent keeping incomplete ImageFrames
        cached because we mistakenly assume they are complete. To fix this issue
        we need to know the ImageFrame decodingStatus when the decoding is requested.

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::destroyDecodedData):
        (WebCore::BitmapImage::dataChanged):
        (WebCore::BitmapImage::draw):
        (WebCore::BitmapImage::internalStartAnimation): At the beginning of this 
        function we check whether the next frame is being decoded or not and we 
        return DecodingActive if it is. Let's handle the second check here also 
        before requesting the decoding of nextFrame. We need to check whether the
        nextFrame has a native image with decoded with the native size or not.
        (WebCore::BitmapImage::internalAdvanceAnimation):
        (WebCore::BitmapImage::imageFrameAvailableAtIndex):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/ImageFrame.cpp:
        (WebCore::ImageFrame::operator=):
        (WebCore::ImageFrame::setDecodingStatus):
        (WebCore::ImageFrame::decodingStatus):
        * platform/graphics/ImageFrame.h:
        (WebCore::ImageFrame::isInvalid):
        (WebCore::ImageFrame::isPartial):
        (WebCore::ImageFrame::isComplete):
        (WebCore::ImageFrame::setDecoding): Deleted.
        (WebCore::ImageFrame::decoding): Deleted.
        (WebCore::ImageFrame::isEmpty): Deleted.
        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::setNativeImage):
        (WebCore::ImageFrameCache::cacheMetadataAtIndex):
        (WebCore::ImageFrameCache::cacheNativeImageAtIndex):
        (WebCore::ImageFrameCache::cacheNativeImageAtIndexAsync):
        (WebCore::ImageFrameCache::startAsyncDecodingQueue):
        (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
        (WebCore::ImageFrameCache::stopAsyncDecodingQueue):
        (WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded):
        (WebCore::ImageFrameCache::frameDecodingStatusAtIndex):
        (WebCore::ImageFrameCache::cacheFrameMetadataAtIndex): Deleted.
        (WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Deleted.
        (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Deleted.
        (WebCore::ImageFrameCache::frameIsCompleteAtIndex): Deleted.
        * platform/graphics/ImageFrameCache.h:
        (WebCore::ImageFrameCache::ImageFrameRequest::operator==):
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::dataChanged):
        * platform/graphics/ImageSource.h:
        (WebCore::ImageSource::destroyIncompleteDecodedData):
        (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex): Let the caller
        decide whether another request for the same image frame is allowed or not.
        (WebCore::ImageSource::frameDecodingStatusAtIndex):
        (WebCore::ImageSource::frameIsCompleteAtIndex): Deleted.
        * platform/image-decoders/ImageDecoder.cpp:
        (WebCore::ImageDecoder::frameDurationAtIndex):
        (WebCore::ImageDecoder::createFrameImageAtIndex):
        * platform/image-decoders/bmp/BMPImageReader.cpp:
        (WebCore::BMPImageReader::decodeBMP):
        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::clearFrameBufferCache):
        (WebCore::GIFImageDecoder::haveDecodedRow):
        (WebCore::GIFImageDecoder::frameComplete):
        (WebCore::GIFImageDecoder::initFrameBuffer):
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageDecoder::outputScanlines):
        (WebCore::JPEGImageDecoder::jpegComplete):
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::rowAvailable):
        (WebCore::PNGImageDecoder::pngComplete):
        (WebCore::PNGImageDecoder::clearFrameBufferCache):
        (WebCore::PNGImageDecoder::frameComplete):
        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::decode):

2017-05-15  Chris Dumez  <cdumez@apple.com>

        Align WebKitCSSMatrix stringifier with spec for DOMMatrix
        https://bugs.webkit.org/show_bug.cgi?id=172114

        Reviewed by Simon Fraser.

        Align WebKitCSSMatrix stringifier with spec for DOMMatrix after:
        - https://github.com/w3c/fxtf-drafts/pull/148

        The following changes were made:
        - Use EcmaScript's ToString() to convert floating point values to string
        - Throw an invalid state error if the matrix contains non-finite values
        - Made WebKitCSSMatrix.toString enumerable as per [1].

        [1] https://heycam.github.io/webidl/#es-stringifier

        Test: fast/css/matrix-stringifier.html

        * css/WebKitCSSMatrix.cpp:
        (WebCore::WebKitCSSMatrix::toString):
        * css/WebKitCSSMatrix.h:
        * css/WebKitCSSMatrix.idl:
        * platform/graphics/transforms/TransformationMatrix.cpp:
        (WebCore::TransformationMatrix::containsOnlyFiniteValues):
        * platform/graphics/transforms/TransformationMatrix.h:

2017-05-15  Mark Lam  <mark.lam@apple.com>

        WorkerRunLoop::Task::performTask() should check !scriptController->isTerminatingExecution().
        https://bugs.webkit.org/show_bug.cgi?id=171775
        <rdar://problem/30975761>

        Reviewed by Filip Pizlo.

        Currently, WorkerThread::stop() calls scheduleExecutionTermination() to terminate
        JS execution first, followed by posting a cleanup task to the worker, and lastly,
        it invokes terminate() on the WorkerRunLoop.

        As a result, before the run loop is terminated, the worker thread may observe the
        TerminatedExecutionException in JS code, bail out, see another JS task to run,
        re-enters the VM to run said JS code, and fails with an assertion due to the
        TerminatedExecutionException still being pending on VM entry.

        WorkerRunLoop::Task::performTask() already has a check to only allow a task to
        run if and only if !runLoop.terminated() and the task is not a clean up task.
        We'll fix the above race by changing WorkerRunLoop::Task::performTask() to check
        !context->script()->isTerminatingExecution() instead of !runLoop.terminated().
        Since WorkerThread::stop() always scheduleExecutionTermination() before it
        terminates the run loop, !context->script()->isTerminatingExecution() implies
        !runLoop.terminated().

        The only time that runLoop is terminated without scheduleExecutionTermination()
        being called is when WorkerThread::stop() is called before the WorkerThread has
        finished creating its WorkerGlobalScope.  In this scenario, WorkerThread::stop()
        will still terminate the run loop.  Hence, after the WorkerGlobalScope is created
        (in WorkerThread::workerThread()), we will check if the run loop has been
        terminated (i.e. stop() was called).  If so, we'll scheduleExecutionTermination()
        there, and guarantee that if runloop.terminated() is true, then
        context->script()->isTerminatingExecution() is also true.

        Solutions that were considered but did not work (recorded for future reference):

        1. In WorkerThread::stop(), call scheduleExecutionTermination() only after it
           posts the cleanup task and terminate the run loop.

           This did not work because this creates a race where the worker thread may run
           the cleanup task before WorkerThread::stop() finishes.  As a result, the
           scriptController may be deleted before we get to invoke scheduleExecutionTermination()
           on it, thereby resulting in a use after free.

           To make this work, we would have to change the life cycle management strategy
           of the WorkerScriptController.  This is a more risky change that we would
           want to take on at this time, and may also not be worth the gain.

        2. Break scheduleExecutionTermination() up into 2 parts i.e. WorkerThread::stop()
           will:
           1. set the scriptControllers m_isTerminatingExecution flag before
              posting the cleanup task and terminating the run loop, and
           2. invoke VM::notifyNeedsTermination() after posting the cleanup task and
              terminating the run loop.

           This requires that we protect the liveness of the VM until we can invoke
           notifyNeedsTermination() on it.

           This did not work because:
           1. We may end up destructing the VM in WorkerThread::stop() i.e. in the main
              web frame, but only the worker thread holds the JS lock for the VM.

              We can make the WorkerThread::stop() acquire the JS lock just before it
              releases the protected VM's RefPtr, but that would mean the main thread
              may be stuck waiting a bit for the worker thread to release its JSLock.
              This is not desirable.

           2. In practice, changing the liveness period of the Worker VM relative to its
              WorkerScriptController and WorkerGlobalScope also has unexpected
              ramifications.  We observed many worker tests failing with assertion
              failures and crashes due to this change.

           Hence, this approach is also a more risky change than it appears on the
           surface, and is not worth exploring at this time.

        In the end, changing WorkerRunLoop::Task::performTask() to check for
        !scriptController->isTerminatingExecution() is the most straight forward solution
        that is easy to prove correct.

        Also fixed a race in WorkerThread::workerThread() where it can delete the
        WorkerGlobalScope while WorkerThread::stop() is in the midst of accessing it.
        We now guard the the nullifying of m_workerGlobalScope with the
        m_threadCreationAndWorkerGlobalScopeMutex as well.

        UPDATE: the only new thing in this patch for re-landing (vs one previously landed)
        is that instead of nullifying m_workerGlobalScope directly (thereby deleting the
        WorkerGlobalScope context), we'll swap it out and delete it only after we've
        unlocked the m_threadCreationAndWorkerGlobalScopeMutex.  This is needed because
        the destruction of the WorkerGlobalScope will cause the main thread to race against
        the worker thread to delete the WorkerThread object, and the WorkerThread object
        owns the mutex that we need to unlock after nullifying the m_workerGlobalScope
        field.

        This issue is covered by an existing test that I just unskipped in TestExpectations.

        * bindings/js/JSDOMPromiseDeferred.cpp:
        (WebCore::DeferredPromise::callFunction):

        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::scheduleExecutionTermination):
        - Added a check to do nothing and return early if the scriptController is already
          terminating execution.

        * workers/WorkerRunLoop.cpp:
        (WebCore::WorkerRunLoop::runInMode):
        (WebCore::WorkerRunLoop::runCleanupTasks):
        (WebCore::WorkerRunLoop::Task::performTask):

        * workers/WorkerRunLoop.h:
        - Made Task::performTask() private and make Task befriend the WorkerRunLoop class.
          This ensures that only the WorkerRunLoop may call performTask().
          Note: this change only formalizes and hardens a relationship that was already
          in place before this.

        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::start):
        (WebCore::WorkerThread::workerThread):
        (WebCore::WorkerThread::stop):
        * workers/WorkerThread.h:
        - Renamed m_threadCreationMutex to m_threadCreationAndWorkerGlobalScopeMutex so
          that it more accurately describes what it guards.

2017-05-15  Myles C. Maxfield  <mmaxfield@apple.com>

        Unicode characters which can't be rendered in any font are invisible
        https://bugs.webkit.org/show_bug.cgi?id=171942
        <rdar://problem/32054234>

        Reviewed by Tim Horton.

        There are some Unicode characters which don't have any font on the system which can render them.
        These characters should be drawn as the .notdef "tofu." This is for security and usability, as
        well as what Firefox and Chrome do. However, we still shouldn't draw characters with the
        Default_Ignorable_Code_Point property, because this is what CoreText does.

        This behavior is also what the Unicode spec recommends: In UTR #36 Unicode Security Considerations:
        http://www.unicode.org/reports/tr36/#Recommendations_General
        "If there is no available glyph for a character, never show a simple "?" or omit the character."

        Also relevant is the Unicode Standard section 5.3 Unknown and MIssing Characters, starting at page
        marked 203 in the following: http://www.unicode.org/versions/Unicode9.0.0/ch05.pdf

        Tests: fast/text/default-ignorable.html
               fast/text/unknown-char-notdef.html

        * platform/graphics/WidthIterator.cpp:
        (WebCore::characterMustDrawSomething):

2017-05-15  Timothy Horton  <timothy_horton@apple.com>

        Null deref under WebContentReader::readURL when interacting with a file URL
        https://bugs.webkit.org/show_bug.cgi?id=172045
        <rdar://problem/25880647>

        Reviewed by Wenson Hsieh.

        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::WebContentReader::readURL):
        The AppSupport soft link was wrong, as there is no such framework in /System/Library/Frameworks.
        Thus, any time we hit this codepath, the soft linked function would be null, and calling it would crash.
        Instead of just fixing the soft link, remove the code, because it does not seem necessary to
        special-case fileURLs to images in the media directory.

2017-05-15  Eric Carlson  <eric.carlson@apple.com>

        ASSERTION FAILED: wasRemoved in WebCore::RealtimeMediaSourceCenter::removeDevicesChangedObserver(DevicesChangedObserverToken)
        https://bugs.webkit.org/show_bug.cgi?id=171529
        <rdar://problem/31945791>

        Reviewed by Jer Noble.

        No new tests, fixes a crash in existing tests.

        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::MediaDevices::MediaDevices): Use a weak ptr.

        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::observerMap):  Use a static hash map for observers because the
        source center can change at runtime.
        (WebCore::RealtimeMediaSourceCenter::addDevicesChangedObserver):
        (WebCore::RealtimeMediaSourceCenter::removeDevicesChangedObserver):
        (WebCore::RealtimeMediaSourceCenter::captureDevicesChanged):

2017-05-15  Brent Fulgham  <bfulgham@apple.com>

        [iOS WK1] Do not try to dispatch messages to subframes if their documents have not been constructed yet.
        https://bugs.webkit.org/show_bug.cgi?id=172059
        <rdar://problem/31963192>

        Reviewed by Zalan Bujtas.

        On iOS WK1 we can end up in an inconsistent state, where
        1. The web thread is inside a newly-injected iframe's document's constructor and
        2. waiting on a delegate callback on the main thread
        while the main thread
        (a) Evaluates arbitrary JavaScript that modifies storage which
        (b) Triggers an event dispatch.
 
        * storage/StorageEventDispatcher.cpp:
        (WebCore::StorageEventDispatcher::dispatchSessionStorageEvents): If the sub-frame's document
        is in an inconsistent state, skip it.
        (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents): Ditto.
        (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames): Ditto.
        (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Ditto.

2017-05-15  Zalan Bujtas  <zalan@apple.com>

        Simple line layout: Leading whitespace followed by a <br> produces an extra linebreak.
        https://bugs.webkit.org/show_bug.cgi?id=172076

        Reviewed by Antti Koivisto.

        When the collapsed whitespace does not fit the line, we need to push it to the next line
        so that we can decide whether any soft/hard linebreak should be skipped (to avoid double line breaks) or not.

        Test: fast/text/simple-line-layout-leading-whitespace-with-soft-hard-linebreak.html

        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::consumeLineBreakIfNeeded): special handling <br>
        (WebCore::SimpleLineLayout::firstFragment): Now we need to deal with leading collapsed whitespace.
        (WebCore::SimpleLineLayout::createLineRuns): We need to push even the collapsed whitespace to the next line.

2017-05-15  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>

        Invalid MediaSource duration value should throw TyperError instead of InvalidStateError
        https://bugs.webkit.org/show_bug.cgi?id=171653

        Reviewed by Chris Dumez.

        Modify MediaSource::setDuration to throw a TypeError when duration value is invalid as per MSE specification
        (https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-duration).

        Update expectations of corresponding WPT test.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::setDuration):
        (WebCore::MediaSource::setDurationInternal):

2017-05-15  Gwang Yoon Hwang  <yoon@igalia.com>

        [CAIRO] Painting an image mask with a matrix above Pixman's limit breaks internal states of Cairo
        https://bugs.webkit.org/show_bug.cgi?id=169094

        Reviewed by Žan Doberšek.

        It is the same problem which addressed in r212431.
        In HiDPI situation, it happens easily due to the size of coordinates.
        Also, if this bug happens, it will break the rendering continuously
        since we are reusing graphics contexts to render webpages in same
        webview.

        Test: fast/hidpi/hidpi-long-page-with-inset-element.html

        * platform/graphics/cairo/PlatformContextCairo.cpp:
        (WebCore::PlatformContextCairo::pushImageMask):
        We can avoid the limit of the Pixman by reducing the source surface's
        size, and it will create a minimal pattern matrix.

2017-05-14  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed build fix with newer Perl versions.

        * bindings/scripts/CodeGeneratorJS.pm:
        (AddLegacyCallerOperationIfNeeded): Support for experimental push on scalar (and
        other auto-dereferencing) was removed in Perl 5.24. Instead, the LegacyCallers array
        has to be dereferenced when pushing new values to it.

2017-05-14  Sam Weinig  <sam@webkit.org>

        [WebIDL/DOM] Remove need for custom bindings for HTMLAllCollection and bring up to spec
        https://bugs.webkit.org/show_bug.cgi?id=172095

        Reviewed by Darin Adler.

        - Adds support for the legacycaller WebIDL special annotation.
        - Updates implementation of HTMLAllCollection to match the current HTML spec.

        Test: fast/dom/document-all.html

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSHTMLAllCollectionCustom.cpp: Removed.
        Removed JSHTMLAllCollectionCustom.cpp

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateInterface):
        (AddLegacyCallerOperationIfNeeded):
        Before code generation, clone all the legacycaller operations and put them
        in their own set, so they can form an overload set.
        
        (AddStringifierOperationIfNeeded):
        Use IDLParser::cloneType as the FIXME suggested.

        (GenerateHeader):
        Group call related functionality together and use new IsCallable predicate.

        (GenerateOverloadedFunctionOrConstructor):
        Generalize a little bit to allow the function being overloaded to be an overloaded legacycaller.

        (GenerateImplementation):
        Add call to generate the legacycaller code.

        (GenerateLegacyCallerDefinitions):
        (GenerateLegacyCallerDefinition):
        Generate the legacycaller definition, using GenerateArgumentsCountCheck, GenerateParametersCheck
        and GenerateImplementationFunctionCall to do all the heavy lifting.

        (IsCallable):
        Add helper predicate for both custom calls and legacycaller.

        * bindings/scripts/IDLParser.pm:
        (cloneType):.
        (cloneArgument):.
        (cloneOperation):
        Add cloning functions for IDLArgument and IDLOperation, and make IDLType's
        clone feasible for calling outside the package by removing the unneeded 
        self parameter.

        * bindings/scripts/test/JS/JSTestObj.cpp
        * bindings/scripts/test/JS/JSTestObj.h
        * bindings/scripts/test/TestObj.idl:
        Add testing of legacycaller overloading.

        * dom/Document.cpp:
        (WebCore::Document::allFilteredByName):
        * dom/Document.h:
        Add new collection access for the HTMLAllNamedSubCollection.

        * html/CachedHTMLCollection.h:
        (WebCore::nameShouldBeVisibleInDocumentAll):
        Update list of tags to match the current spec.

        * html/CollectionType.h:
        Add new type for HTMLAllNamedSubCollection.

        * html/GenericCachedHTMLCollection.cpp:
        (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches):
        Specify that DocumentAllNamedItems does not want
        the default elementMatches.
 
        * html/HTMLAllCollection.cpp:
        (WebCore::HTMLAllCollection::namedOrIndexedItemOrItems):
        (WebCore::HTMLAllCollection::namedItemOrItems):
        (WebCore::HTMLAllNamedSubCollection::~HTMLAllNamedSubCollection):
        (WebCore::HTMLAllNamedSubCollection::elementMatches):
        * html/HTMLAllCollection.h:
        Move implementations from the custom binding, and re-implement to
        match the spec. Alternate names to item/namedItem were needed to not
        shadow the existing ones in HTMLCollection. HTMLAllNamedSubCollection
        is a simple HTMLCollection that matches on a name, following the rules
        of document.all about which tags can have name attributes.

        * html/HTMLAllCollection.idl:
        Remove custom annotations and add legacycaller which is now supported.

        * html/HTMLCollection.cpp:
        (WebCore::invalidationTypeExcludingIdAndNameAttributes):
        (WebCore::HTMLCollection::~HTMLCollection):
        Add DocumentAllNamedItems.

2017-05-14  Zalan Bujtas  <zalan@apple.com>

        Remove unused lambda in TextFragmentIterator::TextFragment::split() and cleanup dependencies.
        https://bugs.webkit.org/show_bug.cgi?id=172089

        Reviewed by David Kilzer.

        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::splitFragmentToFitLine):
        * rendering/SimpleLineLayoutTextFragmentIterator.h:
        (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split):
        (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen):

2017-05-13  David Kilzer  <ddkilzer@apple.com>

        Unused lambda in JSWebKitSubtleCrypto::wrapKey()
        <https://webkit.org/b/172087>

        Reviewed by Chris Dumez.

        Fixes the following warning with newer clang:

            Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp:594:35: error: lambda capture 'keyFormat' is not used [-Werror,-Wunused-lambda-capture]
                auto exportSuccessCallback = [keyFormat, algorithm, parameters, wrappingKey, wrapper](const Vector<uint8_t>& exportedKeyData) mutable {
                                              ^

        * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
        (WebCore::JSWebKitSubtleCrypto::wrapKey): Remove unused lambda.

2017-05-13  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] deviceId constraint doesn't work with getUserMedia
        https://bugs.webkit.org/show_bug.cgi?id=171877
        <rdar://problem/31899730>

        Reviewed by Jer Noble.

        Test: fast/mediastream/get-user-media-device-id.html

        * Modules/mediastream/MediaConstraintsImpl.h:
        (WebCore::MediaConstraintsData::MediaConstraintsData): Add a constructor that 
        takes a const MediaConstraints&.

        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::MediaDevices::~MediaDevices): m_deviceChangedToken is a std::optional<>.
        * Modules/mediastream/MediaDevices.h:

        * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
        (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin): Don't return
        NULL for the main frame so the origin matches that returned for a UserMediaRequest.

        * Modules/mediastream/UserMediaController.h:
        (WebCore::UserMediaController::setDeviceIDHashSalt): Deleted, not used.
        (WebCore::UserMediaController::deviceIDHashSalt): Deleted, not used.

        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::allow): Add device ID hash salt parameter, set it on
        constraints.
        * Modules/mediastream/UserMediaRequest.h:

        * platform/mediastream/MediaConstraints.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::fitnessDistance): ASSERT if called for DeviceId.
        (WebCore::RealtimeMediaSource::selectSettings): Special case DeviceId because it
        we have to hash the device ID before comparing, and because the DeviceId can't be
        changed so it should never be added to the flattened constraints.
        (WebCore::RealtimeMediaSource::supportsConstraints):
        (WebCore::RealtimeMediaSource::applyConstraints):
        * platform/mediastream/RealtimeMediaSource.h:

        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Implement.
        * platform/mediastream/RealtimeMediaSourceCenter.h:

        * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
        (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint): Deleted, unused.
        (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName): Deleted, unused.
        * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:

        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints): Pass device
        id, not empty string.
        (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): Deleted.
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:

        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
        (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Deleted.
        * platform/mock/MockRealtimeMediaSourceCenter.h:

2017-05-13  Chris Dumez  <cdumez@apple.com>

        Stop using RefPtr::release()
        https://bugs.webkit.org/show_bug.cgi?id=172074

        Reviewed by Geoffrey Garen.

        * css/parser/CSSPropertyParser.cpp:
        (WebCore::FontVariantLigaturesParser::finalizeValue):
        (WebCore::FontVariantNumericParser::finalizeValue):
        * css/parser/CSSPropertyParserHelpers.cpp:
        (WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue):
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::create):
        * loader/archive/mhtml/MHTMLArchive.cpp:
        (WebCore::MHTMLArchive::generateMHTMLData):
        * loader/archive/mhtml/MHTMLArchive.h:
        * loader/archive/mhtml/MHTMLParser.cpp:
        (WebCore::MHTMLParser::parseArchiveWithHeader):
        * platform/audio/ios/AudioFileReaderIOS.cpp:
        (WebCore::AudioFileReader::createBus):
        * platform/glib/SharedBufferGlib.cpp:
        (WebCore::SharedBuffer::createFromReadingFile):
        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
        (WebCore::CACFLayerTreeHost::create):
        * platform/graphics/cairo/CairoUtilities.cpp:
        (WebCore::copyCairoImageSurface):
        * platform/graphics/cairo/ImageBufferCairo.cpp:
        (WebCore::getImageData):
        * platform/graphics/gtk/IconGtk.cpp:
        (WebCore::Icon::createIconForFiles):
        * platform/graphics/win/FontCacheWin.cpp:
        (WebCore::FontCache::systemFallbackForCharacters):
        * platform/win/SharedBufferWin.cpp:
        (WebCore::SharedBuffer::createFromReadingFile):

2017-05-13  Javier Fernandez  <jfernandez@igalia.com>

        [css-align] Implement the place-self shorthand
        https://bugs.webkit.org/show_bug.cgi?id=168846

        Reviewed by Zalan Bujtas.

        The CSS Box Alignment specification defines a new shorthand to set the
        Content Alignment properties (align-self and justify-self) at the
        same time.

        This patch provides the implementation of the CSS parsing logic and the
        required regression tests.

        Test: css3/parse-place-self.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::propertyValue):
        * css/CSSProperties.json:
        * css/StyleProperties.cpp:
        (WebCore::StyleProperties::getPropertyValue):
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::CSSPropertyParser::consumePlaceSelfShorthand):
        (WebCore::CSSPropertyParser::parseShorthand):
        * css/parser/CSSPropertyParser.h:

2017-05-13  Commit Queue  <commit-queue@webkit.org>

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

        Many memory corruption crashes on worker threads (Requested by
        ap on #webkit).

        Reverted changeset:

        "WorkerRunLoop::Task::performTask() should check
        !scriptController->isTerminatingExecution()."
        https://bugs.webkit.org/show_bug.cgi?id=171775
        http://trac.webkit.org/changeset/216801

2017-05-13  Zalan Bujtas  <zalan@apple.com>

        AccessibilityRenderObject::textUnderElement needs to assert on unclean tree.
        https://bugs.webkit.org/show_bug.cgi?id=172065

        Reviewed by Simon Fraser.

        r192103 changed the assert logic incorrectly. If the tree is dirty, regardless of the renderer's type,
        TextIterator will end up forcing style update/layout on the render tree.
        The original assert would have hit with bug 171546 prior to r216726.

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::textUnderElement):

2017-05-12  Simon Fraser  <simon.fraser@apple.com>

        event.clientX/clientY should be in layout viewport coordinates
        https://bugs.webkit.org/show_bug.cgi?id=172018

        Reviewed by Zalan Bujtas.

        Fix clientX and clientY on mouse events to be relative to the layout viewport, to match
        getBoundingClientRect(), getClientRects() and fixed-position objects.

        Also minor cleanup of MouseRelatedEvent to use initializers.

        Test: fast/visual-viewport/client-coordinates-relative-to-layout-viewport.html

        * dom/MouseRelatedEvent.cpp:
        (WebCore::MouseRelatedEvent::MouseRelatedEvent):
        (WebCore::MouseRelatedEvent::init):
        (WebCore::MouseRelatedEvent::initCoordinates):
        (WebCore::contentsScrollOffset): Deleted.
        * dom/MouseRelatedEvent.h:

2017-05-12  Sam Weinig  <sam@webkit.org>

        [WebIDL] Remove need for custom binding for Worker constructor
        https://bugs.webkit.org/show_bug.cgi?id=172050

        Reviewed by Chris Dumez.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSWorkerCustom.cpp: Removed.
        Remove JSWorkerCustom.cpp

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateCallWith):
        * bindings/scripts/IDLAttributes.json:
        Add RuntimeFlags as a new option for the ConstructorCallWith extended attribute.

        * workers/Worker.cpp:
        (WebCore::Worker::create):
        * workers/Worker.h:
        Update order of arguments to appease the generator.

        * workers/Worker.idl:
        Add extended attributes for the constructor.

2017-05-12  Simon Fraser  <simon.fraser@apple.com>

        The rects returned by Element/Range.getClientRects() should not be rounded
        https://bugs.webkit.org/show_bug.cgi?id=172057

        Reviewed by Chris Dumez.

        Fix createDOMRectVector() to not expand the rects to integer boundaries (which
        quad.enclosingBoundingBox() does), but to return rects with floating point
        values. This matches Chrome and Firefox, and matches getBoundingClientRect(),
        which does not integral snap.

        * dom/DOMRect.cpp:
        (WebCore::createDOMRectVector):

2017-05-12  Jiewen Tan  <jiewen_tan@apple.com>

        Elements should be inserted into a template element as its content's last child
        https://bugs.webkit.org/show_bug.cgi?id=171373
        <rdar://problem/31862949>

        Reviewed by Ryosuke Niwa.

        Before this change, our HTML parser obeys the following premises:
        1) A fostering child whose parent is a table should be inserted before its parent and under its grandparent.
        2) When inserting into a template element, an element should be inserted into its content.

        Let's walk through the example:
        a) Before eventhandler takes place
        template
        table
            svg <- parser
        b) After eventhandler takes place
        template
            table
                svg <- parser
        c) after parsing svg
        template
            content
                svg
                (table)
            table

        Finally, in the example, the svg element will be inserted into the content of the template element while
        having its next sibling point to the table element. However, the table element is actually under the
        template element not its content.

        This messy tree is constructed because the second premise is incompleted. It should be: When inserting into
        a template element, an element should be inserted into its content as its last child.
        Quoted from Step 3 of https://html.spec.whatwg.org/multipage/syntax.html#appropriate-place-for-inserting-a-node
        A correct tree will then looks like:
        template
            content
                svg
            table

        Tests: fast/dom/HTMLTemplateElement/insert-fostering-child-crash.html
               fast/dom/HTMLTemplateElement/insert-fostering-child.html

        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::insert):
        By nullifying task.nextChild, it will force the parser to append the element as task.parent's last child.

2017-05-12  Alex Christensen  <achristensen@webkit.org>

        Rename WKContentExtension to WKContentRuleList
        https://bugs.webkit.org/show_bug.cgi?id=172053
        <rdar://problem/32141005>

        Reviewed by Geoffrey Garen.

        Covered by existing API tests.

        * English.lproj/Localizable.strings:

2017-05-12  Timothy Horton  <timothy_horton@apple.com>

        Don't use LinkPresentation URL shortening if it's not available
        https://bugs.webkit.org/show_bug.cgi?id=172064
        <rdar://problem/32169232>

        Rubber-stamped by Wenson Hsieh.

        * platform/mac/DragImageMac.mm:
        (WebCore::LinkImageLayout::LinkImageLayout):
        * platform/spi/cocoa/LinkPresentationSPI.h:

2017-05-11  Simon Fraser  <simon.fraser@apple.com>

        Incorrect position when dragging jQuery Draggable elements with position fixed after pinch zoom
        https://bugs.webkit.org/show_bug.cgi?id=171113
        rdar://problem/31746516

        Reviewed by Tim Horton.

        Make getBoundingClientRect() and getClientRects() return rects which are relative to the layout
        viewport, rather than the visual viewport. This goes part of the way to fixing webkit.org/b/170981,
        which aims to make pinch-zoom invisible to web pages ("inert visual viewport"). It fixes issues on various
        sites like Facebook when zoomed.

        Factor coordinate conversion code into functions on FrameView, which now documents
        the various coordinate systems in a big comment. Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale()
        and Document::adjustFloatRectForScrollAndAbsoluteZoomAndFrameScale() are renamed and factored
        to use these helpers.

        There are two behavior changes here:

        1. FrameView::documentToClientOffset() now uses the origin of the layout viewport in the "document to client"
           coordinate mapping.
           
        2. The two document functions would apply the scale and offset in the wrong order. We need
           to first undo the effects of CSS zoom, page zoom and page scale, and then map from document
           to client coordinates.

        Tests: fast/visual-viewport/client-rects-relative-to-layout-viewport.html
               fast/zooming/client-rects-with-css-and-page-zoom.html

        * dom/Document.cpp:
        (WebCore::Document::convertAbsoluteToClientQuads):
        (WebCore::Document::convertAbsoluteToClientRect):
        (WebCore::Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale): Deleted.
        (WebCore::Document::adjustFloatRectForScrollAndAbsoluteZoomAndFrameScale): Deleted.
        * dom/Document.h:
        * dom/Element.cpp:
        (WebCore::Element::getClientRects):
        (WebCore::Element::getBoundingClientRect):
        * dom/Range.cpp:
        (WebCore::Range::borderAndTextQuads):
        * page/FrameView.cpp:
        (WebCore::FrameView::absoluteToDocumentScaleFactor):
        (WebCore::FrameView::absoluteToDocumentRect):
        (WebCore::FrameView::absoluteToDocumentPoint):
        (WebCore::FrameView::documentToClientOffset):
        (WebCore::FrameView::documentToClientRect):
        (WebCore::FrameView::documentToClientPoint):
        * page/FrameView.h:
        * platform/ScrollableArea.h: #pragma once
        * platform/Scrollbar.h: #pragma once
        * platform/Widget.h: #pragma once

2017-05-12  Mark Lam  <mark.lam@apple.com>

        WorkerRunLoop::Task::performTask() should check !scriptController->isTerminatingExecution().
        https://bugs.webkit.org/show_bug.cgi?id=171775
        <rdar://problem/30975761>

        Reviewed by Saam Barati.

        Currently, WorkerThread::stop() calls scheduleExecutionTermination() to terminate
        JS execution first, followed by posting a cleanup task to the worker, and lastly,
        it invokes terminate() on the WorkerRunLoop.

        As a result, before the run loop is terminated, the worker thread may observe the
        TerminatedExecutionException in JS code, bail out, see another JS task to run,
        re-enters the VM to run said JS code, and fails with an assertion due to the
        TerminatedExecutionException still being pending on VM entry.

        WorkerRunLoop::Task::performTask() already has a check to only allow a task to
        run if and only if !runLoop.terminated() and the task is not a clean up task.
        We'll fix the above race by changing WorkerRunLoop::Task::performTask() to check
        !context->script()->isTerminatingExecution() instead of !runLoop.terminated().
        Since WorkerThread::stop() always scheduleExecutionTermination() before it
        terminates the run loop, !context->script()->isTerminatingExecution() implies
        !runLoop.terminated().

        The only time that runLoop is terminated without scheduleExecutionTermination()
        being called is when WorkerThread::stop() is called before the WorkerThread has
        finished creating its WorkerGlobalScope.  In this scenario, WorkerThread::stop()
        will still terminate the run loop.  Hence, after the WorkerGlobalScope is created
        (in WorkerThread::workerThread()), we will check if the run loop has been
        terminated (i.e. stop() was called).  If so, we'll scheduleExecutionTermination()
        there, and guarantee that if runloop.terminated() is true, then
        context->script()->isTerminatingExecution() is also true.

        Solutions that were considered but did not work (recorded for future reference):

        1. In WorkerThread::stop(), call scheduleExecutionTermination() only after it
           posts the cleanup task and terminate the run loop.

           This did not work because this creates a race where the worker thread may run
           the cleanup task before WorkerThread::stop() finishes.  As a result, the
           scriptController may be deleted before we get to invoke scheduleExecutionTermination()
           on it, thereby resulting in a use after free.

           To make this work, we would have to change the life cycle management strategy
           of the WorkerScriptController.  This is a more risky change that we would
           want to take on at this time, and may also not be worth the gain.

        2. Break scheduleExecutionTermination() up into 2 parts i.e. WorkerThread::stop()
           will:
           1. set the scriptControllers m_isTerminatingExecution flag before
              posting the cleanup task and terminating the run loop, and
           2. invoke VM::notifyNeedsTermination() after posting the cleanup task and
              terminating the run loop.

           This requires that we protect the liveness of the VM until we can invoke
           notifyNeedsTermination() on it.

           This did not work because:
           1. We may end up destructing the VM in WorkerThread::stop() i.e. in the main
              web frame, but only the worker thread holds the JS lock for the VM.

              We can make the WorkerThread::stop() acquire the JS lock just before it
              releases the protected VM's RefPtr, but that would mean the main thread
              may be stuck waiting a bit for the worker thread to release its JSLock.
              This is not desirable.

           2. In practice, changing the liveness period of the Worker VM relative to its
              WorkerScriptController and WorkerGlobalScope also has unexpected
              ramifications.  We observed many worker tests failing with assertion
              failures and crashes due to this change.

           Hence, this approach is also a more risky change than it appears on the
           surface, and is not worth exploring at this time.

        In the end, changing WorkerRunLoop::Task::performTask() to check for
        !scriptController->isTerminatingExecution() is the most straight forward solution
        that is easy to prove correct.

        Also fixed a race in WorkerThread::workerThread() where it can delete the
        WorkerGlobalScope while WorkerThread::stop() is in the midst of accessing it.
        We now guard the the nullifying of m_workerGlobalScope with the
        m_threadCreationAndWorkerGlobalScopeMutex as well.

        This issue is covered by an existing test that I just unskipped in TestExpectations.

        * bindings/js/JSDOMPromiseDeferred.cpp:
        (WebCore::DeferredPromise::callFunction):

        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::scheduleExecutionTermination):
        - Added a check to do nothing and return early if the scriptController is already
          terminating execution.

        * workers/WorkerRunLoop.cpp:
        (WebCore::WorkerRunLoop::runInMode):
        (WebCore::WorkerRunLoop::runCleanupTasks):
        (WebCore::WorkerRunLoop::Task::performTask):

        * workers/WorkerRunLoop.h:
        - Made Task::performTask() private and make Task befriend the WorkerRunLoop class.
          This ensures that only the WorkerRunLoop may call performTask().
          Note: this change only formalizes and hardens a relationship that was already
          in place before this.

        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::start):
        (WebCore::WorkerThread::workerThread):
        (WebCore::WorkerThread::stop):
        * workers/WorkerThread.h:
        - Renamed m_threadCreationMutex to m_threadCreationAndWorkerGlobalScopeMutex so
          that it more accurately describes what it guards.

2017-05-12  Zalan Bujtas  <zalan@apple.com>

        [iOS WK1] Do not try to layout a subframe if its document has not been constructed yet.
        https://bugs.webkit.org/show_bug.cgi?id=172042
        <rdar://problem/32084098>

        Reviewed by Antti Koivisto.

        On iOS WK1 we can end up in an inconsistent state, where 
        1. the web thread is inside a newly injected iframe's document's c'tor and 
        2. waiting on a delegate callback on the main thread
        while the main thread
        1. executes a pending didLayout() task
        2. triggers layout on the newly injected iframe.

        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::updateWidgetPosition):

2017-05-11  Jiewen Tan  <jiewen_tan@apple.com>

        Check existence of a page before accessing its plugins
        https://bugs.webkit.org/show_bug.cgi?id=171712
        <rdar://problem/32007806>

        Reviewed by Brent Fulgham.

        Test: plugins/navigator-plugin-crash.html

        * plugins/DOMPlugin.cpp:
        (WebCore::DOMPlugin::item):
        (WebCore::DOMPlugin::namedItem):

2017-05-12  Simon Fraser  <simon.fraser@apple.com>

        Add some logging for layer tree commits, and resize and orientation change events
        https://bugs.webkit.org/show_bug.cgi?id=172041

        Reviewed by Tim Horton.

        Add some logging that's useful during rotation investigations.

        * dom/Document.cpp:
        (WebCore::Document::orientationChanged):
        * page/FrameView.cpp:
        (WebCore::FrameView::sendResizeEventIfNeeded):

2017-05-12  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Add ReadableStreamBYOBReader closed getter
        https://bugs.webkit.org/show_bug.cgi?id=172024

        Reviewed by Youenn Fablet.

        Added tests to check closed getter behaviour.

        * Modules/streams/ReadableStreamBYOBReader.js:
        (closed): Implemented.

2017-05-12  Andreas Kling  <akling@apple.com>

        MediaResourceLoader shouldn't keep its HTMLMediaElement alive.
        https://bugs.webkit.org/show_bug.cgi?id=172032
        <rdar://problem/30816144>

        Reviewed by Joseph Pecoraro.

        Use a WeakPtr<HTMLMediaElement> in MediaResourceLoader instead, since the loader
        is retained by a NSURLSession object we hand over to AVFoundation.

        This prevents AVFoundation from keeping entire documents alive outside our control.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::HTMLMediaElement):
        * html/HTMLMediaElement.h:
        (WebCore::HTMLMediaElement::createWeakPtr):
        * loader/MediaResourceLoader.cpp:
        (WebCore::MediaResourceLoader::MediaResourceLoader):
        (WebCore::MediaResourceLoader::requestResource):
        * loader/MediaResourceLoader.h:

2017-05-12  Andreas Kling  <akling@apple.com>

        Memory pressure response should only do sync bmalloc scavenge in sync mode.
        https://bugs.webkit.org/show_bug.cgi?id=172035

        Reviewed by Michael Saboff.

        Only call WTF::releaseFastMallocFreeMemory() and his threading-related friends
        when releaseMemory() is invoked with Synchronous::Yes, or if it's a critical
        pressure response (maintaining the behavior added in r215775.)

        * page/MemoryRelease.cpp:
        (WebCore::releaseMemory):

2017-05-12  Daniel Bates  <dabates@apple.com>

        Cleanup: Use Ref instead of RefPtr to hold DOMWrapperWorld
        https://bugs.webkit.org/show_bug.cgi?id=171988

        Reviewed by Chris Dumez.

        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::JSCustomElementInterface::JSCustomElementInterface):
        (WebCore::JSCustomElementInterface::upgradeElement):
        (WebCore::JSCustomElementInterface::invokeCallback):
        * bindings/js/JSCustomElementInterface.h:
        * bindings/js/JSMutationCallback.cpp:
        (WebCore::JSMutationCallback::JSMutationCallback):
        (WebCore::JSMutationCallback::call):
        * bindings/js/JSMutationCallback.h:
        * bindings/js/ScheduledAction.cpp:
        (WebCore::ScheduledAction::ScheduledAction):
        (WebCore::ScheduledAction::execute):
        * bindings/js/ScheduledAction.h:
        (WebCore::ScheduledAction::ScheduledAction):
        * page/DOMWindowExtension.cpp:
        (WebCore::DOMWindowExtension::DOMWindowExtension):
        * page/DOMWindowExtension.h:
        (WebCore::DOMWindowExtension::world):

2017-05-12  Daniel Bates  <dabates@apple.com>

        Cleanup: Make QueueTaskToEventLoopFunctionPtr take JSGlobalObject&
        https://bugs.webkit.org/show_bug.cgi?id=172021

        Reviewed by Mark Lam.

        * bindings/js/JSDOMGlobalObjectTask.cpp: Include header JSDOMGlobalObject.h.
        (WebCore::JSGlobalObjectTask::JSGlobalObjectTask): Change type of first argument from JSDOMGlobalObject*
        to JSDOMGlobalObject& and update code as necessary. Also, use C++11 brace initialization syntax
        for member initializer list.
        * bindings/js/JSDOMGlobalObjectTask.h: Remove header JSDOMGlobalObject.h and forward declare
        JSDOMGlobalObject and JSC::Microtask.
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowMicrotaskCallback::create):
        (WebCore::JSDOMWindowMicrotaskCallback::JSDOMWindowMicrotaskCallback): Change type of first argument
        from JSDOMWindowBase* to JSDOMWindowBase& and update code as necessary. Also, use C++11 brace
        initialization syntax for member initializer list.
        (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
        * bindings/js/JSDOMWindowBase.h:
        * bindings/js/JSWorkerGlobalScopeBase.cpp:
        (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
        * bindings/js/JSWorkerGlobalScopeBase.h:

2017-05-12  Jer Noble  <jer.noble@apple.com>

        [MediaStream] Streams while play while page is in background can get "stuck" when page is forgrounded.
        https://bugs.webkit.org/show_bug.cgi?id=172022

        Reviewed by Youenn Fablet.

        When an AVSampleBufferDisplayLayer is disconnected from the CA renderer, none of its samples will be decoded
        and enqueued for rendering. Once the layer is attached to a renderer again, it's stuffed full of samples which
        will never be decoded as their decode time has long passed.

        Pass the visibility state of the element through to the MediaPlayer so that MediaPlayerPrivateMediaStreamAVFObjC
        can flush its renderers when going from not visible -> visible.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::visibilityStateChanged):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVisible):
        * rendering/RenderVideo.cpp:
        (WebCore::RenderVideo::updatePlayer):

2017-05-12  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed Windows build fix.

        * bindings/js/JSWebGLRenderingContextCustom.cpp:

2017-05-12  Antti Koivisto  <antti@apple.com>

        Updating class name of a shadow host does not update the style applied by descendants of :host()
        https://bugs.webkit.org/show_bug.cgi?id=170762
        <rdar://problem/31572668>

        Reviewed by Ryosuke Niwa.

        We need to invalidate shadow tree style when host classes or attributes change if it may be
        affected by host rules.

        Test: fast/shadow-dom/css-scoping-host-class-and-attribute-mutation.html

        * css/RuleSet.cpp:
        (WebCore::isHostSelectorMatchingInShadowTree):
        (WebCore::RuleSet::addRule):

            Check if we have :host selectors that affect shadow tree.

        * css/RuleSet.h:
        (WebCore::RuleSet::hasHostPseudoClassRulesMatchingInShadowTree):
        * style/AttributeChangeInvalidation.cpp:
        (WebCore::Style::mayBeAffectedByHostRules):
        (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):

            Invalidate the whole subtree if there is a class change that may affect shadow tree style.

        * style/ClassChangeInvalidation.cpp:
        (WebCore::Style::mayBeAffectedByHostRules):
        (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
        * style/IdChangeInvalidation.cpp:
        (WebCore::Style::mayBeAffectedByHostRules):
        (WebCore::Style::IdChangeInvalidation::invalidateStyle):

            Same for classes and ids.
            This should be refactored at some point to reduce copy-code.

2017-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] ASSERTION FAILED: !m_flushingLayers
        https://bugs.webkit.org/show_bug.cgi?id=172025

        Reviewed by Žan Doberšek.

        The problem is that syncImageBacking() is calling didChangeLayerState(). All sync methods are called by
        flushCompositingStateForThisLayerOnly() while flushing layers, so none of them should call didChange method that
        will schedule a new flush while flushing.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::syncImageBacking):

2017-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] GIF images are not properly loaded the first time
        https://bugs.webkit.org/show_bug.cgi?id=170432

        Reviewed by Carlos Alberto Lopez Perez.

        When the GIF image is loaded for the first time, it's always read from the network, and the decoder is usually
        fetched with chunks of data. Then the data is cached in disk by the network process, so that when loaded from
        the cache, the whole encoded data is available to fetch the encoder. The problem is that we are failing to
        decode the image when giving chunks of data, that's why it only happens the first time loaded. If the first
        chunk of data provided is enough to get some metadata, including the size, but not frame contents, the load fails
        in CachedImage::addIncrementalDataBuffer() because the EncodedDataStatus reported is SizeAvailable but
        Image::isNull() returns true. An Image is considered to be Null when its size is empty, and the size is
        calculated always using the first frame in ImageFrameCache. Since we still don't have frames, the image is
        always Null in this case. It is not expected that EncodedDataStatus returns SizeAvailable and the image is Null,
        that's why it's considered an error and the load finishes with a decode error. However, the non CG ImageDecoder
        has a m_size member to handle this particular case, and it's when m_size is set when EncodedDataStatus changes
        to SizeAvailable. We should return the ImageEncoder size as the ImageSize when we have a decoder but
        not frames yet.

        Test: http/tests/images/gif-progressive-load.html

        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::size): Return ImageDecoder::size() without caching it, if frame list is empty.

2017-05-12  Per Arne Vollan  <pvollan@apple.com>

        The iBooks application is not able to get current position.
        https://bugs.webkit.org/show_bug.cgi?id=171982
        rdar://problem/29318409

        Reviewed by Brent Fulgham.

        Geolocation requests from iBooks are currently blocked. Make an exemption from the policy for iBooks.

        No new tests since we currently can't mock the iBooks application bundle ID.

        * Modules/geolocation/Geolocation.cpp:
        (WebCore::isRequestFromIBooks):
        (WebCore::Geolocation::shouldBlockGeolocationRequests):

2017-05-11  Per Arne Vollan  <pvollan@apple.com>

        Geolocation requests should not be blocked when the security origin is local.
        https://bugs.webkit.org/show_bug.cgi?id=171857
        rdar://problem/29318409

        Reviewed by Brent Fulgham.

        Geolocation requests from security origins where the url scheme is registered as local,
        should not be blocked. This applies to the file url scheme, but also to other local url
        schemes.

        Test: fast/misc/geolocation-local-security-origin.html

        * Modules/geolocation/Geolocation.cpp:
        (WebCore::Geolocation::shouldBlockGeolocationRequests):

2017-05-11  Chris Dumez  <cdumez@apple.com>

        Drop remaining uses of PassRefPtr in WebCore
        https://bugs.webkit.org/show_bug.cgi?id=172013

        Reviewed by Yusuke Suzuki.

        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::createRootObject):
        * bindings/js/ScriptController.h:
        * bindings/js/ScriptControllerMac.mm:
        * bridge/objc/WebScriptObject.mm:
        (WebCore::createJSWrapper):
        (-[WebScriptObject _setImp:originRootObject:rootObject:]):
        (-[WebScriptObject _setOriginRootObject:andRootObject:]):
        (-[WebScriptObject _initWithJSObject:originRootObject:rootObject:]):
        * bridge/objc/WebScriptObjectPrivate.h:

2017-05-11  Zalan Bujtas  <zalan@apple.com>

        RenderImageResource::hasImage is redundant and RenderImageResourceStyleImage's override is incorrect.
        https://bugs.webkit.org/show_bug.cgi?id=172010
        <rdar://problem/31086735>

        Reviewed by Simon Fraser.

        RenderImageResourceStyleImage::hasImage() always returns true even when ::cachedImage()
        returns nullptr (e.g. image is pending).
        Remove it and use cachedImage() instead.

        Test: fast/images/missing-content-image-crash.html

        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::didAttachRenderers):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::updateIntrinsicSizeIfNeeded):
        (WebCore::RenderImage::isShowingMissingOrImageError):
        (WebCore::RenderImage::hasNonBitmapImage):
        (WebCore::RenderImage::paintReplaced):
        (WebCore::RenderImage::paintIntoRect):
        (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
        * rendering/RenderImageResource.h:
        (WebCore::RenderImageResource::cachedImage):
        (WebCore::RenderImageResource::hasImage): Deleted.
        * rendering/RenderImageResourceStyleImage.h:
        * rendering/svg/RenderSVGImage.cpp:
        (WebCore::RenderSVGImage::paint):
        * svg/SVGImageElement.cpp:
        (WebCore::SVGImageElement::hasSingleSecurityOrigin):
        (WebCore::SVGImageElement::didAttachRenderers):

2017-05-11  Zalan Bujtas  <zalan@apple.com>

        AX: Defer text changes until after the tree is clean if needed.
        https://bugs.webkit.org/show_bug.cgi?id=171546
        <rdar://problem/31934942>

        Reviewed by Simon Fraser.

        While updating an accessibility object state, we might
        trigger unintentional style updates. This style update could
        end up destroying renderes that are still referenced by functions
        on the callstack.
        To avoid that, defer such changes and let AXObjectCache operate on a clean tree.         

        Test: accessibility/crash-when-render-tree-is-not-clean.html

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::remove):
        (WebCore::AXObjectCache::handleAttributeChanged):
        (WebCore::AXObjectCache::labelChanged):
        (WebCore::AXObjectCache::performDeferredCacheUpdate):
        (WebCore::AXObjectCache::deferRecomputeIsIgnored):
        (WebCore::AXObjectCache::deferTextChangedIfNeeded):
        (WebCore::AXObjectCache::recomputeDeferredIsIgnored): Deleted.
        (WebCore::AXObjectCache::deferTextChanged): Deleted.
        * accessibility/AXObjectCache.h: Decouple different type of changes.
        (WebCore::AXObjectCache::deferRecomputeIsIgnored):
        (WebCore::AXObjectCache::deferTextChangedIfNeeded):
        (WebCore::AXObjectCache::recomputeDeferredIsIgnored): Deleted.
        (WebCore::AXObjectCache::deferTextChanged): Deleted.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::deleteLines):
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::RenderBlockFlow::createAndAppendRootInlineBox):
        * rendering/RenderText.cpp:
        (WebCore::RenderText::setText):

2017-05-11  Chris Dumez  <cdumez@apple.com>

        Drop remaining uses of PassRefPtr under platform/
        https://bugs.webkit.org/show_bug.cgi?id=172007

        Reviewed by Geoffrey Garen.

        * platform/graphics/wpe/ImageWPE.cpp:
        (WebCore::Image::loadPlatformResource):
        * platform/ios/LegacyTileGrid.h:
        * platform/ios/LegacyTileGrid.mm:
        (WebCore::LegacyTileGrid::tileForIndex):
        (WebCore::LegacyTileGrid::tileForPoint):
        * platform/ios/LegacyTileGridTile.h:
        (WebCore::LegacyTileGridTile::create):
        * platform/mediastream/RTCIceCandidateDescriptor.cpp:
        (WebCore::RTCIceCandidateDescriptor::create):
        * platform/mediastream/RTCIceCandidateDescriptor.h:
        * platform/mediastream/RTCPeerConnectionHandlerClient.h:
        * platform/mediastream/RTCSessionDescriptionDescriptor.cpp:
        (WebCore::RTCSessionDescriptionDescriptor::create):
        * platform/mediastream/RTCSessionDescriptionDescriptor.h:
        * platform/mediastream/RTCSessionDescriptionRequest.h:
        (WebCore::RTCSessionDescriptionRequest::extraData):
        (WebCore::RTCSessionDescriptionRequest::setExtraData):
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
        (WebCore::RealtimeMediaSourceCenterOwr::firstSource):
        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
        * platform/mock/DeviceOrientationClientMock.cpp:
        (WebCore::DeviceOrientationClientMock::setOrientation):
        * platform/mock/DeviceOrientationClientMock.h:
        * platform/mock/GeolocationClientMock.cpp:
        (WebCore::GeolocationClientMock::setPosition):
        * platform/mock/GeolocationClientMock.h:
        * platform/mock/RTCNotifiersMock.cpp:
        (WebCore::SessionRequestNotifier::SessionRequestNotifier):
        (WebCore::SessionRequestNotifier::fire):
        (WebCore::VoidRequestNotifier::VoidRequestNotifier):
        * platform/mock/RTCNotifiersMock.h:
        * platform/mock/TimerEventBasedMock.h:
        (WebCore::TimerEventBasedMock::removeEvent):
        (WebCore::TimerEvent::TimerEvent):
        (WebCore::TimerEvent::timerFired):
        * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
        (WebCore::MockSourceBufferPrivateHasAudio):
        (WebCore::MockSourceBufferPrivateHasVideo):
        * platform/wpe/RenderThemeWPE.h:

2017-05-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [WPE] Stop using PassRefPtr in platform/graphics/wpe
        https://bugs.webkit.org/show_bug.cgi?id=171977

        Unreviewed build fix after r216702.

        * platform/graphics/wpe/ImageWPE.cpp:
        (WebCore::Image::loadPlatformResource):

2017-05-11  Youenn Fablet  <youenn@apple.com>

        [iOS] Unset active media capture source when stopped capturing
        https://bugs.webkit.org/show_bug.cgi?id=171815
        <rdar://problem/32117885>

        Reviewed by Eric Carlson.

        Test: platform/ios/mediastream/getUserMedia-single-capture.html

        Introducing SingleSourceFactory template class to be used by capture factories for iOS.
        This class ensures that only one source is active at a time.
        Update all capture sources accordingly.
        Ensure sources are no longer considered as active sources when being destroyed.
        Add support for mock sources and introducing m_isProducingData for them as well.

        Update WebRTC outgoing source classes to handle the case of replaced track and resetting the enabled/mute
        state according the new source.

        Update the way we handle timestamps for audio data. We now consider that we read/write as a flow.
        This allows smooth audio track replacing.

        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/mac/AVAudioCaptureSource.mm:
        (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource):
        (WebCore::AVAudioCaptureSourceFactory::setActiveSource): Deleted.
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
        (WebCore::AVVideoCaptureSourceFactory::setActiveSource): Deleted.
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
        (WebCore::CoreAudioCaptureSource::stopProducingData):
        (WebCore::CoreAudioCaptureSourceFactory::setActiveSource): Deleted.
        * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
        (WebCore::RealtimeOutgoingAudioSource::setSource):
        (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
        (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
        * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::setSource):
        (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
        (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
        * platform/mock/MockRealtimeAudioSource.cpp:
        (WebCore::mockAudioCaptureSourceFactory):
        (WebCore::MockRealtimeAudioSource::factory):
        (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
        (WebCore::MockRealtimeAudioSource::startProducingData):
        (WebCore::MockRealtimeAudioSource::stopProducingData):
        * platform/mock/MockRealtimeAudioSource.h:
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::mockVideoCaptureSourceFactory):
        (WebCore::MockRealtimeVideoSource::factory):
        (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource):
        (WebCore::MockRealtimeVideoSource::startProducingData):
        (WebCore::MockRealtimeVideoSource::stopProducingData):
        * platform/mock/MockRealtimeVideoSource.h:
        (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted.

2017-05-11  Timothy Horton  <timothy_horton@apple.com>

        Fix the iOS build

        * platform/spi/mac/NSSpellCheckerSPI.h:

2017-05-11  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r216677.

        Patch caused layout test crashes.

        Reverted changeset:

        "WorkerThread::stop() should call
        scheduleExecutionTermination() last."
        https://bugs.webkit.org/show_bug.cgi?id=171775
        http://trac.webkit.org/changeset/216677

2017-05-11  Don Olmstead  <don.olmstead@am.sony.com>

        [CMake] Add HAVE check for regex.h
        https://bugs.webkit.org/show_bug.cgi?id=171950

        Reviewed by Michael Catanzaro.

        No new tests. No change in behavior.

        * WebCorePrefix.h:
        * testing/js/WebCoreTestSupportPrefix.h:

2017-05-11  Tim Horton  <timothy_horton@apple.com>

        Mail spins launching spell checker when typing
        https://bugs.webkit.org/show_bug.cgi?id=171986
        <rdar://problem/26305327>

        Reviewed by Beth Dakin.

        * platform/spi/mac/NSSpellCheckerSPI.h:

2017-05-11  Chris Dumez  <cdumez@apple.com>

        Stop using PassRefPtr in platform/graphics
        https://bugs.webkit.org/show_bug.cgi?id=171977

        Reviewed by Alex Christensen.

        Stop using PassRefPtr in platform/graphics.

        * css/CSSCrossfadeValue.cpp:
        (WebCore::CSSCrossfadeValue::image):
        * css/CSSFilterImageValue.cpp:
        (WebCore::CSSFilterImageValue::image):
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::brokenImage):
        (WebCore::CachedImage::image):
        (WebCore::CachedImage::imageForRenderer):
        * page/PageSerializer.cpp:
        (WebCore::PageSerializer::addImageToResources):
        * platform/ScrollView.cpp:
        (WebCore::ScrollView::paintPanScrollIcon):
        * platform/graphics/CrossfadeGeneratedImage.cpp:
        (WebCore::CrossfadeGeneratedImage::drawCrossfade):
        * platform/graphics/FontPlatformData.h:
        * platform/graphics/GraphicsContext.h:
        * platform/graphics/Image.cpp:
        (WebCore::Image::nullImage):
        * platform/graphics/Image.h:
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::createResourceLoader):
        * platform/graphics/MediaPlayer.h:
        * platform/graphics/Pattern.cpp:
        (WebCore::Pattern::create):
        (WebCore::Pattern::Pattern):
        * platform/graphics/Pattern.h:
        * platform/graphics/PlatformTextTrack.h:
        (WebCore::PlatformTextTrack::create):
        (WebCore::PlatformTextTrack::createOutOfBand):
        (WebCore::PlatformTextTrack::captionMenuOffItem):
        (WebCore::PlatformTextTrack::captionMenuAutomaticItem):
        * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
        (WebCore::InbandMetadataTextTrackPrivateAVF::create):
        (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
        * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
        (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
        * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
        * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
        (WebCore::MediaSelectionOptionAVFObjC::create):
        (WebCore::MediaSelectionGroupAVFObjC::create):
        (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.h:
        (WebCore::InbandTextTrackPrivateAVCF::create):
        * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h:
        (WebCore::InbandTextTrackPrivateLegacyAVCF::create):
        * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
        (WebCore::WebCoreAVCFResourceLoader::create):
        * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.h:
        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
        (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
        (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h:
        (WebCore::InbandTextTrackPrivateAVFObjC::create):
        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.h:
        (WebCore::InbandTextTrackPrivateLegacyAVFObjC::create):
        * platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h:
        (WebCore::OutOfBandTextTrackPrivateAVF::create):
        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
        (WebCore::WebCoreAVFResourceLoader::create):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::createPlatformCALayer):
        (WebCore::GraphicsLayerCA::createPlatformCAAnimation):
        (WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
        (WebCore::GraphicsLayerCA::replicatedLayerRoot):
        (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
        (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
        (WebCore::GraphicsLayerCA::createBasicAnimation):
        (WebCore::GraphicsLayerCA::createKeyframeAnimation):
        (WebCore::GraphicsLayerCA::createSpringAnimation):
        * platform/graphics/ca/GraphicsLayerCA.h:
        (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
        * platform/graphics/ca/PlatformCAAnimation.h:
        * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h:
        * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
        (PlatformCAAnimationCocoa::create):
        (PlatformCAAnimationCocoa::copy):
        * platform/graphics/ca/win/AbstractCACFLayerTreeHost.h:
        * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
        (WebCore::CACFLayerTreeHost::create):
        (WebCore::CACFLayerTreeHost::addPendingAnimatedLayer):
        * platform/graphics/ca/win/CACFLayerTreeHost.h:
        * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
        (PlatformCAAnimationWin::create):
        (PlatformCAAnimationWin::copy):
        * platform/graphics/ca/win/PlatformCAAnimationWin.h:
        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
        (PlatformCALayerWin::addAnimationForKey):
        * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
        (WebCore::WKCACFViewLayerTreeHost::create):
        * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
        * platform/graphics/cairo/PatternCairo.cpp:
        (WebCore::Pattern::createPlatformPattern):
        * platform/graphics/cairo/PlatformContextCairo.cpp:
        (WebCore::PlatformContextCairo::clipForPatternFilling):
        * platform/graphics/cg/PDFDocumentImage.h:
        * platform/graphics/cg/PatternCG.cpp:
        (WebCore::Pattern::createPlatformPattern):
        * platform/graphics/filters/FEDiffuseLighting.cpp:
        (WebCore::FEDiffuseLighting::FEDiffuseLighting):
        (WebCore::FEDiffuseLighting::create):
        (WebCore::FEDiffuseLighting::lightSource):
        * platform/graphics/filters/FEDiffuseLighting.h:
        * platform/graphics/filters/FELighting.cpp:
        (WebCore::FELighting::FELighting):
        (WebCore::FELighting::drawLighting):
        * platform/graphics/filters/FELighting.h:
        * platform/graphics/filters/FESpecularLighting.cpp:
        (WebCore::FESpecularLighting::FESpecularLighting):
        (WebCore::FESpecularLighting::create):
        (WebCore::FESpecularLighting::lightSource):
        * platform/graphics/filters/FESpecularLighting.h:
        * platform/graphics/filters/FETile.cpp:
        (WebCore::FETile::platformApplySoftware):
        * platform/graphics/filters/FilterEffect.cpp:
        (WebCore::FilterEffect::asUnmultipliedImage):
        (WebCore::FilterEffect::asPremultipliedImage):
        * platform/graphics/filters/FilterEffect.h:
        * platform/graphics/filters/FilterOperation.cpp:
        (WebCore::ReferenceFilterOperation::setFilterEffect):
        (WebCore::BasicColorMatrixFilterOperation::blend):
        (WebCore::BasicComponentTransferFilterOperation::blend):
        (WebCore::BlurFilterOperation::blend):
        (WebCore::DropShadowFilterOperation::blend):
        * platform/graphics/filters/FilterOperation.h:
        (WebCore::FilterOperation::blend):
        (WebCore::PassthroughFilterOperation::create):
        (WebCore::ReferenceFilterOperation::create):
        * platform/graphics/gpu/Texture.cpp:
        (WebCore::Texture::create):
        * platform/graphics/gpu/Texture.h:
        * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
        * platform/graphics/gstreamer/ImageGStreamer.h:
        (WebCore::ImageGStreamer::createImage):
        (WebCore::ImageGStreamer::image):
        * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
        (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
        (WebCore::InbandMetadataTextTrackPrivateGStreamer::addGenericCue):
        * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
        (WebCore::InbandTextTrackPrivateGStreamer::create):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::paint):
        * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
        * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
        (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
        * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
        * platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp:
        * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
        (WebCore::PlaybackPipeline::enqueueSample):
        * platform/graphics/gstreamer/mse/PlaybackPipeline.h:
        * platform/graphics/gtk/ImageGtk.cpp:
        (WebCore::loadImageFromGResource):
        (WebCore::loadResourceSharedBuffer):
        (WebCore::loadMissingImageIconFromTheme):
        (WebCore::Image::loadPlatformResource):
        * platform/graphics/harfbuzz/HarfBuzzFace.cpp:
        (WebCore::FaceCacheEntry::create):
        * platform/graphics/harfbuzz/HarfBuzzFace.h:
        (WebCore::HarfBuzzFace::create):
        * platform/graphics/mac/ImageMac.mm:
        (WebCore::Image::loadPlatformResource):
        * platform/graphics/opentype/OpenTypeMathData.h:
        (WebCore::OpenTypeMathData::create):
        * platform/graphics/texmap/BitmapTexture.h:
        (WebCore::BitmapTexture::applyFilters):
        * platform/graphics/texmap/BitmapTextureGL.cpp:
        (WebCore::BitmapTextureGL::applyFilters):
        * platform/graphics/texmap/BitmapTextureGL.h:
        (WebCore::BitmapTextureGL::FilterInfo::FilterInfo):
        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
        (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
        * platform/graphics/texmap/TextureMapper.cpp:
        (WebCore::TextureMapper::acquireTextureFromPool):
        * platform/graphics/texmap/TextureMapper.h:
        * platform/graphics/texmap/TextureMapperGL.cpp:
        (WebCore::TextureMapperGL::createTexture):
        * platform/graphics/texmap/TextureMapperGL.h:
        * platform/graphics/texmap/TextureMapperLayer.cpp:
        (WebCore::TextureMapperLayer::paintIntoSurface):
        (WebCore::commitSurface):
        (WebCore::TextureMapperLayer::paintWithIntermediateSurface):
        (WebCore::TextureMapperLayer::setBackingStore):
        * platform/graphics/texmap/TextureMapperLayer.h:
        * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
        (WebCore::TextureMapperTiledBackingStore::create):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::syncImageBacking):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
        (WebCore::CoordinatedImageBacking::create):
        (WebCore::CoordinatedImageBacking::CoordinatedImageBacking):
        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
        * platform/graphics/win/ImageWin.cpp:
        (WebCore::Image::loadPlatformResource):
        * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
        (WebCore::MediaPlayerPrivateFullscreenWindow::setRootChildLayer):
        * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h:
        * platform/graphics/win/PatternDirect2D.cpp:
        (WebCore::Pattern::createPlatformPattern):
        * platform/graphics/win/SharedGDIObject.h:
        (WebCore::SharedGDIObject::create):
        * rendering/FilterEffectRenderer.cpp:
        (WebCore::FilterEffectRenderer::build):
        * rendering/RenderImageResource.cpp:
        (WebCore::RenderImageResource::image):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::drawPlatformResizerImage):
        * rendering/svg/RenderSVGResourcePattern.cpp:
        (WebCore::RenderSVGResourcePattern::buildPattern):
        * svg/SVGFEDiffuseLightingElement.cpp:
        (WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute):
        (WebCore::SVGFEDiffuseLightingElement::build):
        * svg/SVGFESpecularLightingElement.cpp:
        (WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute):
        (WebCore::SVGFESpecularLightingElement::build):
        * svg/graphics/SVGImageCache.cpp:
        (WebCore::SVGImageCache::imageForRenderer):

2017-05-11  Joseph Pecoraro  <pecoraro@apple.com>

        Remove Vibration API
        https://bugs.webkit.org/show_bug.cgi?id=171766

        Rubber-stamped by Alexey Proskuryakov.

        * features.json:
        Mark the Vibration API as removed.

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * Modules/vibration/NavigatorVibration.cpp: Removed.
        * Modules/vibration/NavigatorVibration.h: Removed.
        * Modules/vibration/NavigatorVibration.idl: Removed.
        * Modules/vibration/Vibration.cpp: Removed.
        * Modules/vibration/Vibration.h: Removed.
        * Modules/vibration/VibrationClient.h: Removed.
        * testing/Internals.cpp:
        (WebCore::Internals::isVibrating): Deleted.
        * testing/Internals.h:
        * testing/Internals.idl:

2017-05-11  Dean Jackson  <dino@apple.com>

        WebGLRenderingContext should implement WebGLRenderingContextBase
        https://bugs.webkit.org/show_bug.cgi?id=171961
        <rdar://problem/32124920>

        Reviewed by Sam Weinig.

        WebGLRenderingContext and WebGL2RenderingContext are both
        defined to "implement" WebGLRenderingContextBase. However, we
        were doing it via inheritance, which meant that some things
        were not visible on the WebGLRenderingContext prototype.

        Test: fast/canvas/webgl/constants-on-interface.html

        * WebCore.xcodeproj/project.pbxproj: Move the Custom.cpp files
        out of the GC-only area now they have real content.

        * bindings/js/JSDocumentCustom.cpp: Handle the fact that we
        don't use the base class from the bindings, so we need to
        translate WebGL1 and WebGL2 contexts into the right JS classes.
        (WebCore::JSDocument::getCSSCanvasContext):
        * bindings/js/JSHTMLCanvasElementCustom.cpp:
        (WebCore::JSHTMLCanvasElement::getContext):

        * bindings/js/JSWebGL2RenderingContextCustom.cpp: Implement the
        custom methods. In this case, we don't yet expose any
        extensions for WebGL 2.
        (WebCore::toJS):
        (WebCore::JSWebGL2RenderingContext::getExtension):

        * bindings/js/JSWebGLRenderingContextBaseCustom.cpp: Removed.

        * bindings/js/JSWebGLRenderingContextCustom.cpp:
        (WebCore::toJS):
        (WebCore::JSWebGLRenderingContext::getExtension):

        * html/canvas/WebGL2RenderingContext.h: Make some things public.
        * html/canvas/WebGLRenderingContext.h: Ditto.

        * html/canvas/WebGL2RenderingContext.idl: Use implements.
        * html/canvas/WebGLRenderingContext.idl: Ditto.

        * testing/Internals.cpp: This now takes a WebGLRenderingContext.
        (WebCore::Internals::simulateWebGLContextChanged):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-05-11  Andy Estes  <aestes@apple.com>

        Fix a spelling mistake in ApplePayErrorCode
        https://bugs.webkit.org/show_bug.cgi?id=171981
        <rdar://problem/32136567>

        Reviewed by Beth Dakin.

        * Modules/applepay/ApplePayError.idl:
        * Modules/applepay/PaymentRequest.h:

2017-05-11  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Enable configuration through preferences
        https://bugs.webkit.org/show_bug.cgi?id=171949
        <rdar://problem/31894518>

        Reviewed by Alex Christensen.

        No new tests. Just an added setter.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::setReducedTimestampResolution):

2017-05-11  Frederic Wang  <fwang@igalia.com>

        Unify hasTouchScrollableOverflow/needsCompositedScrolling concepts
        https://bugs.webkit.org/show_bug.cgi?id=171974

        Reviewed by Simon Fraser.

        This commit moves the following pattern in a single RenderLayer::usesAcceleratedScrolling function:
        #if PLATFORM(IOS)
        ...hasTouchScrollableOverflow()...
        #else
        ...needsCompositedScrolling()...
        #endif

        No new tests, behavior unchanged.

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::usesAcceleratedScrolling): Introduce helper function.
        * rendering/RenderLayer.h: Declare the function.
        * rendering/RenderLayerBacking.cpp:
        (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling): Use the new function.
        (WebCore::RenderLayerBacking::updateConfiguration): Ditto.
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::useCoordinatedScrollingForLayer): Ditto.

2017-05-11  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Implement ReadableStreamBYOBReader cancel()
        https://bugs.webkit.org/show_bug.cgi?id=171919

        Reviewed by Youenn Fablet.

        Implemented ReadableStreamBYOBReader cancel() method.

        Added tests checking cancel().

        * Modules/streams/ReadableStreamBYOBReader.js:
        (cancel): Implemented.
        * Modules/streams/ReadableStreamInternals.js:
        (readableStreamError): Updated to support ReadableStreamBYOBReader case.

2017-05-11  Chris Dumez  <cdumez@apple.com>

        Stop using PassRefPtr in WebGPU code
        https://bugs.webkit.org/show_bug.cgi?id=171965

        Reviewed by Alex Christensen.

        Stop using PassRefPtr in WebGPU code.

        * html/canvas/WebGPUDrawable.cpp:
        (WebCore::WebGPUDrawable::WebGPUDrawable):
        * html/canvas/WebGPURenderingContext.cpp:
        (WebCore::WebGPURenderingContext::create):
        (WebCore::WebGPURenderingContext::WebGPURenderingContext):
        * html/canvas/WebGPURenderingContext.h:
        * html/canvas/WebGPUTexture.cpp:
        (WebCore::WebGPUTexture::createFromDrawableTexture):
        (WebCore::WebGPUTexture::WebGPUTexture):
        * html/canvas/WebGPUTexture.h:

2017-05-11  Youenn Fablet  <youenn@apple.com>

        Name WebRTC Threads
        https://bugs.webkit.org/show_bug.cgi?id=171975

        Reviewed by Eric Carlson.

        No change of behavior.

        * platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
        (WebCore::LibWebRTCAudioModule::LibWebRTCAudioModule): Setting audio module thread name.
        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::initializePeerConnectionFactoryAndThreads): Setting signaling and networking thread names.

2017-05-11  Chris Dumez  <cdumez@apple.com>

        Stop using PassRefPtr in platform/audio
        https://bugs.webkit.org/show_bug.cgi?id=171966

        Reviewed by Ryosuke Niwa.

        Stop using PassRefPtr in platform/audio.

        * platform/audio/AudioBus.h:
        (WebCore::AudioBus::AudioBus):
        * platform/audio/AudioFileReader.h:
        * platform/audio/HRTFDatabaseLoader.cpp:
        (WebCore::HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary):
        * platform/audio/HRTFDatabaseLoader.h:
        * platform/audio/HRTFKernel.cpp:
        (WebCore::HRTFKernel::createInterpolatedKernel):
        * platform/audio/HRTFKernel.h:
        (WebCore::HRTFKernel::create):
        * platform/audio/glib/AudioBusGLib.cpp:
        (WebCore::AudioBus::loadPlatformResource):
        * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
        (WebCore::AudioFileReader::createBus):
        (WebCore::createBusFromAudioFile):
        (WebCore::createBusFromInMemoryAudioFile):
        * platform/audio/ios/AudioFileReaderIOS.cpp:
        (WebCore::AudioFileReader::createBus):
        (WebCore::createBusFromAudioFile):
        (WebCore::createBusFromInMemoryAudioFile):
        * platform/audio/ios/AudioFileReaderIOS.h:
        * platform/audio/mac/AudioBusMac.mm:
        (WebCore::AudioBus::loadPlatformResource):
        * platform/audio/mac/AudioFileReaderMac.cpp:
        (WebCore::AudioFileReader::createBus):
        (WebCore::createBusFromAudioFile):
        (WebCore::createBusFromInMemoryAudioFile):
        * platform/audio/mac/AudioFileReaderMac.h:

2017-05-11  Mark Lam  <mark.lam@apple.com>

        WorkerThread::stop() should call scheduleExecutionTermination() last.
        https://bugs.webkit.org/show_bug.cgi?id=171775
        <rdar://problem/30975761>

        Reviewed by Geoffrey Garen.

        Currently, WorkerThread::stop() calls scheduleExecutionTermination() to terminate
        JS execution first, followed by posting a cleanup task to the worker, and lastly,
        it invokes terminate() on the WorkerRunLoop.

        As a result, before run loop is terminate, the worker thread may observe the
        TerminatedExecutionException in JS code, bail out, see another JS task to run,
        re-enters the VM to run said JS code, and fails with an assertion due to the
        TerminatedExecutionException still being pending on VM entry.

        WorkerRunLoop::Task::performTask() already has a check to only allow a task to
        run if and only if !runLoop.terminated() and the task is not a clean up task.
        We'll fix the above race by ensuring that having WorkerThread::stop() terminate
        the run loop before it scheduleExecutionTermination() which throws the
        TerminatedExecutionException.  This way, by the time JS code unwinds out of the
        VM due to the TerminatedExecutionException, runLoop.terminated() is guaranteed
        to be true and thereby prevents re-entry into the VM.

        This issue is covered by an existing test that I just unskipped in TestExpectations.

        * bindings/js/JSDOMPromiseDeferred.cpp:
        (WebCore::DeferredPromise::callFunction):
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::stop):

2017-05-11  Chris Dumez  <cdumez@apple.com>

        Drop custom bindings code for HTMLFormControlsCollection's named property getter
        https://bugs.webkit.org/show_bug.cgi?id=171964

        Reviewed by Sam Weinig.

        Drop custom bindings code for HTMLFormControlsCollection's named property getter as
        we are able to generate it.

        No new tests, no expected Web-facing behavior change.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSHTMLFormControlsCollectionCustom.cpp: Removed.
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateNamedGetter):
        * html/HTMLFormControlsCollection.cpp:
        (WebCore::HTMLFormControlsCollection::namedItemOrItems):
        * html/HTMLFormControlsCollection.h:
        * html/HTMLFormControlsCollection.idl:

2017-05-10  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] CoreAudioCaptureSource claims to never be muted
        https://bugs.webkit.org/show_bug.cgi?id=171946
        <rdar://problem/32111991>

        Reviewed by Jer Noble.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::stopProducingData): Set m_muted to true.

2017-05-10  Jer Noble  <jer.noble@apple.com>

        RELEASE_ASSERT at WebAudioSourceProviderAVFObjC::provideInput()
        https://bugs.webkit.org/show_bug.cgi?id=171711

        Reviewed by Youenn Fablet.

        Before iterating over the channels in either the WebAudioBufferList or the AudioBus, ensure
        we don't walk over the end of either by only iterating over the minimum length of either.
        Also, when the internal format of WebAudioSourceProviderAVFObjC changes, notify the
        MediaStreamAudioSourceNode that the number of channels and sample rate have changed.

        * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
        (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
        (WebCore::WebAudioSourceProviderAVFObjC::prepare):

2017-05-10  Andy Estes  <aestes@apple.com>

        REGRESSION (r167845): ASSERT(!m_renderView.needsLayout()) in svg/custom/bug79798.html
        https://bugs.webkit.org/show_bug.cgi?id=132297

        Reviewed by Simon Fraser.

        We don't know why m_renderView needs layout in this case, but we know that we don't need to
        assert if the client hasn't set the ScrollableInnerFrameTrigger compositing trigger.

        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame):

2017-05-10  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r216630.

        This change caused assertion failures with webrtc LayoutTests.

        Reverted changeset:

        "RELEASE_ASSERT at
        WebAudioSourceProviderAVFObjC::provideInput()"
        https://bugs.webkit.org/show_bug.cgi?id=171711
        http://trac.webkit.org/changeset/216630

2017-05-09  Sam Weinig  <sam@webkit.org>

        Remove support for legacy Notifications
        https://bugs.webkit.org/show_bug.cgi?id=171487

        Reviewed by Jon Lee.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        Remove files.

        * Configurations/FeatureDefines.xcconfig:
        Remove definition of ENABLE_LEGACY_NOTIFICATIONS.

        * DerivedSources.make:
        Remove IDL files.

        * Modules/notifications/DOMWindowNotifications.cpp: Removed.
        * Modules/notifications/DOMWindowNotifications.h: Removed.
        * Modules/notifications/DOMWindowNotifications.idl: Removed.
        * Modules/notifications/NotificationCenter.cpp: Removed.
        * Modules/notifications/NotificationCenter.h: Removed.
        * Modules/notifications/NotificationCenter.idl: Removed.
        * Modules/notifications/NotificationClient.h:
        * Modules/notifications/NotificationController.cpp:
        * Modules/notifications/NotificationController.h:
        * Modules/notifications/WorkerGlobalScopeNotifications.cpp: Removed.
        * Modules/notifications/WorkerGlobalScopeNotifications.h: Removed.
        * Modules/notifications/WorkerGlobalScopeNotifications.idl: Removed.
        * Modules/notifications/Notification.idl:
        * Modules/notifications/Notification.cpp:
        * Modules/notifications/Notification.h:
        * dom/EventTargetFactory.in:
        * page/DOMWindow.cpp:
        * workers/WorkerThread.h:
        Remove code legacy Notification code. Replace use of NotificationCenter with direct
        calls to the NotificationClient.

2017-05-10  Commit Queue  <commit-queue@webkit.org>

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

        "Some worker tests are failing". (Requested by mlam on #webkit).

        Reverted changeset:

        "WorkerThread::stop() should call
        scheduleExecutionTermination() last."
        https://bugs.webkit.org/show_bug.cgi?id=171775
        http://trac.webkit.org/changeset/216635

2017-05-10  Mark Lam  <mark.lam@apple.com>

        WorkerThread::stop() should call scheduleExecutionTermination() last.
        https://bugs.webkit.org/show_bug.cgi?id=171775
        <rdar://problem/30975761>

        Reviewed by Geoffrey Garen.

        Currently, WorkerThread::stop() calls scheduleExecutionTermination() to terminate
        JS execution first, followed by posting a cleanup task to the worker, and lastly,
        it invokes terminate() on the WorkerRunLoop.

        As a result, before run loop is terminate, the worker thread may observe the
        TerminatedExecutionException in JS code, bail out, see another JS task to run,
        re-enters the VM to run said JS code, and fails with an assertion due to the
        TerminatedExecutionException still being pending on VM entry.

        WorkerRunLoop::Task::performTask() already has a check to only allow a task to
        run if and only if !runLoop.terminated() and the task is not a clean up task.
        We'll fix the above race by ensuring that having WorkerThread::stop() terminate
        the run loop before it scheduleExecutionTermination() which throws the
        TerminatedExecutionException.  This way, by the time JS code unwinds out of the
        VM due to the TerminatedExecutionException, runLoop.terminated() is guaranteed
        to be true and thereby prevents re-entry into the VM.

        This issue is covered by an existing test that I just unskipped in TestExpectations.

        * bindings/js/JSDOMPromiseDeferred.cpp:
        (WebCore::DeferredPromise::callFunction):
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::stop):

2017-05-10  Tim Horton  <timothy_horton@apple.com>

        Add an experimental feature flag for viewport-fit
        https://bugs.webkit.org/show_bug.cgi?id=171948
        <rdar://problem/31995518>

        Reviewed by Simon Fraser.

        * dom/ViewportArguments.cpp:
        (WebCore::setViewportFeature):
        * page/Settings.in:
        Disable parsing of viewport-fit if the experimental feature is disabled.

2017-05-10  Chris Dumez  <cdumez@apple.com>

        Simplify relationship between Attr and Element now that Attr is childless
        https://bugs.webkit.org/show_bug.cgi?id=171909

        Reviewed by Ryosuke Niwa.

        Simplify relationship between Attr and Element now that Attr is childless
        after r216259.

        No new tests, no Web facing behavior change.

        * dom/Attr.cpp:
        (WebCore::Attr::setValue):
        Attr::setValue() was only called by Element::setAttributeInternal() to make sure
        we updated the Attr node's Text child. However, now that Attr has no Text child,
        Element no longer needs to update the Attr node's value.
        Attr::setValueForBindings() was thus renamed to setValue(). Its implementation
        was also simplified by calling Element::setAttribute() on its ownerElement, if
        it has one, instead of duplicating a bunch of code from Element::setAttributeInternal().

        (WebCore::Attr::setNodeValue):
        Call setValue() instead of setValueForBindings() now that it has been renamed.

        * dom/Attr.h:
        * dom/Attr.idl:
        Rename valueForBindings / setValueForBindings to value / setValue.

        * dom/Document.h:
        Split shouldInvalidateNodeListAndCollectionCaches() into 2 methods, one taking an Attr name
        and another that does not. There are now 2 calls sites instead of one, so we no longer need
        to branch in this function.

        * dom/Element.cpp:
        (WebCore::Element::setAttributeInternal):
        Drop code calling Attr::setValue() on the Attr node since Attr::setValue() was only
        duplicating logic from Element::setAttributeInternal() after r216259. There is nothing
        on Attr that needs updating when an element attribute gets updated.

        (WebCore::Element::attributeChanged):
        Call the new invalidateNodeListAndCollectionCachesInAncestorsForAttribute(). This
        is the only call site that passes an attribute name.

        * dom/Node.cpp:
        (WebCore::Document::shouldInvalidateNodeListAndCollectionCaches):
        (WebCore::Document::shouldInvalidateNodeListAndCollectionCachesForAttribute):
        Split into 2 to avoid branching, as explained above.

        (WebCore::Node::invalidateNodeListAndCollectionCachesInAncestors):
        (WebCore::Node::invalidateNodeListAndCollectionCachesInAncestorsForAttribute):
        - invalidateNodeListAndCollectionCachesInAncestors() used to invalidate childNodeLists
          if the Node was an attribute node. Drop this as this is no longer needed as of r216259.
        - After the change to Attr::setValue(), call sites for
          invalidateNodeListAndCollectionCachesInAncestors() either had no parameters, or both
          parameters present and non-null. There is therefore no longer any need to handle
          having an attrName but no attributeOwnerElement. To make this obvious, I split this
          into 2 methods: invalidateNodeListAndCollectionCachesInAncestors() and
          invalidateNodeListAndCollectionCachesInAncestorsForAttribute(attrName). We no longer
          need the attributeOwnerElement parameter as it was only used to exit early.

        * dom/Node.h:

2017-05-10  Antti Koivisto  <antti@apple.com>

        REGRESSION (r207372) Visibility property is not inherited when used in an animation
        https://bugs.webkit.org/show_bug.cgi?id=171883
        <rdar://problem/32086550>

        Reviewed by Simon Fraser.

        The problem here is that our animation code is tied to renderers. We don't have renderers during
        the initial style resolution so animations are not applied yet. When constructing renderers we set
        their style to the initial animated style but this step can't implement inheritance.

        Normally this is invisible as the first animation frame will immediately inherit the style correctly.
        However in this case the animation is discrete and the first frame is the same as the initial state.
        With r207372 we optimize the descendant style change away.

        This patch fixes the problem by tracking that the renderer has initial animated style and inheriting
        it to descendants during next style resolution even if it doesn't change.

        Test: animations/animation-initial-inheritance.html

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::RenderElement):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::hasInitialAnimatedStyle):
        (WebCore::RenderElement::setHasInitialAnimatedStyle):
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::createRenderer):

            Set a bit on renderer indicating it has initial animated style.

        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::createAnimatedElementUpdate):

            Return at least 'Inherit' for style change when updating renderer with initial animated style.

2017-05-10  Jer Noble  <jer.noble@apple.com>

        RELEASE_ASSERT at WebAudioSourceProviderAVFObjC::provideInput()
        https://bugs.webkit.org/show_bug.cgi?id=171711

        Reviewed by Youenn Fablet.

        Before iterating over the channels in either the WebAudioBufferList or the AudioBus, ensure
        we don't walk over the end of either by only iterating over the minimum length of either.
        Also, when the internal format of WebAudioSourceProviderAVFObjC changes, notify the
        MediaStreamAudioSourceNode that the number of channels and sample rate have changed.

        * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
        (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
        (WebCore::WebAudioSourceProviderAVFObjC::prepare):

2017-05-04  Filip Pizlo  <fpizlo@apple.com>

        GCController.cpp's collect() should be Async
        https://bugs.webkit.org/show_bug.cgi?id=171708

        Reviewed by Saam Barati and Geoffrey Garen.

        No new tests because no change in behavior.
        
        This is one step towards not requesting sync GCs in WebCore. I'm landing this incrementally to
        make bisecting super easy.
        
        This is a ~7% JetStream iOS "regression", because JetStream has a bug where it allows trunk
        to sneakily hide GC work between when JetStream measures time. After this change, we are no
        longer trying to be sneaky.

        * bindings/js/GCController.cpp:
        (WebCore::collect):

2017-05-10  Jer Noble  <jer.noble@apple.com>

        CoreAudioCaptureSource reports 3 or 5 channel audio output; actually only mono
        https://bugs.webkit.org/show_bug.cgi?id=171940

        Reviewed by Eric Carlson.

        Asking for the Input VPIO stream format will return the internal mic format, before processing. Instead
        ask for the input bus's output format, which is post processing, which will return the correct number
        of channels (one).

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioSharedUnit::configureMicrophoneProc):

2017-05-10  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r216591.

        This change broke an internal build.

        Reverted changeset:

        "REGRESSION (r207372) Visibility property is not inherited
        when used in an animation"
        https://bugs.webkit.org/show_bug.cgi?id=171883
        http://trac.webkit.org/changeset/216591

2017-05-10  Chris Dumez  <cdumez@apple.com>

        Drop custom bindings code now window.open()
        https://bugs.webkit.org/show_bug.cgi?id=171933

        Reviewed by Geoffrey Garen.

        Drop custom bindings code now window.open() as it is not doing anything special.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::open): Deleted.
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::open):
        * page/DOMWindow.h:
        * page/DOMWindow.idl:
        * testing/Internals.cpp:
        (WebCore::Internals::openDummyInspectorFrontend):

2017-05-10  Tim Horton  <timothy_horton@apple.com>

        Add an experimental feature flag for constant properties
        https://bugs.webkit.org/show_bug.cgi?id=171913
        <rdar://problem/31995518>

        Reviewed by Ryosuke Niwa.

        * css/parser/CSSParser.cpp:
        (WebCore::CSSParserContext::CSSParserContext):
        (WebCore::operator==):
        * css/parser/CSSParserImpl.cpp:
        (WebCore::CSSParserImpl::consumeCustomPropertyValue):
        * css/parser/CSSParserMode.h:
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::CSSPropertyParser::parseValueStart):
        * css/parser/CSSVariableParser.cpp:
        (WebCore::classifyBlock):
        (WebCore::isValidVariableReference):
        (WebCore::isValidConstantReference):
        (WebCore::classifyVariableRange):
        (WebCore::CSSVariableParser::containsValidVariableReferences):
        (WebCore::CSSVariableParser::parseDeclarationValue):
        * css/parser/CSSVariableParser.h:
        Plumb the experimental feature flag down into CSSVariableParser by way
        of CSSParserContext.

        * page/Settings.in:

2017-05-10  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r206960): Possible null pointer dereference under DOMSelection::getRangeAt()
        https://bugs.webkit.org/show_bug.cgi?id=171925
        <rdar://problem/29931223>

        Reviewed by Wenson Hsieh.

        We have evidence that selection().firstRange() can return null in DOMSelection::getRangeAt().
        When this happens, we now throw an INDEX_SIZE_ERR instead of dereferencing it.

        I believe this can happen if the VisibleSelection is orphaned but not none, because
        rangeCount() only checks for isNone() but VisibleSelection::firstRange() can return null
        if isNoneOrOrphaned().

        No new tests, I do not know how to reproduce.

        * page/DOMSelection.cpp:
        (WebCore::DOMSelection::getRangeAt):

2017-05-10  Matt Rajca  <mrajca@apple.com>

        DumpRenderTree crashed in com.apple.WebCore: std::optional<WTF::MediaTime>::operator-> + 71 :: CRASHING TEST: fullscreen/video-controls-timeline.html
        https://bugs.webkit.org/show_bug.cgi?id=171932

        Reviewed by Eric Carlson.

        Explicitly initialize m_playbackWithoutUserGesture to "None".

        * html/HTMLMediaElement.h:

2017-05-10  Andy Estes  <aestes@apple.com>

        Keyboard input suppression should extend to subframes
        https://bugs.webkit.org/show_bug.cgi?id=171880
        <rdar://problem/31201793>

        Reviewed by Ryosuke Niwa.

        Test: http/tests/navigation/keyboard-events-during-provisional-subframe-navigation.html

        * dom/EventDispatcher.cpp:
        (WebCore::shouldSuppressEventDispatchInDOM): Changed to call shouldSuppressKeyboardInput()
        on the main frame's loader.
        * editing/Editor.cpp:
        (WebCore::Editor::shouldInsertText): Ditto.

2017-05-10  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r216563.

        Revision caused 2 api failures

        Reverted changeset:

        "[MediaStream] deviceId constraint doesn't work with
        getUserMedia"
        https://bugs.webkit.org/show_bug.cgi?id=171877
        http://trac.webkit.org/changeset/216563

2017-05-10  Frederic Wang  <fwang@igalia.com>

        Refactor ScrollingCoordinator::setSynchronousScrollingReasons to accept a FrameView
        https://bugs.webkit.org/show_bug.cgi?id=171923

        Reviewed by Simon Fraser.

        Currently ScrollingCoordinator::setSynchronousScrollingReasons implementations assumes
        SynchronousScrollingReasons apply to the main frame. This commit allows to specify
        a FrameView in order to prepare support for fast scrolling of frames.

        No new tests, no behavior changes.

        * page/scrolling/AsyncScrollingCoordinator.cpp:
        (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons): Use the FrameView to
        find the state node.
        (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition): Rename this function
        updateMainFrameScrollLayerPosition and use the specified FrameView.
        * page/scrolling/AsyncScrollingCoordinator.h: Add FrameView parameter.
        * page/scrolling/ScrollingCoordinator.cpp:
        (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons): Remove the const since
        AsyncScrollingCoordinator uses scrollLayerForFrameView. Pass the frameView to
        setSynchronousScrollingReasons.
        * page/scrolling/ScrollingCoordinator.h:
        (WebCore::ScrollingCoordinator::setSynchronousScrollingReasons): Add FrameView parameter.

2017-05-10  Antti Koivisto  <antti@apple.com>

        REGRESSION (r207372) Visibility property is not inherited when used in an animation
        https://bugs.webkit.org/show_bug.cgi?id=171883
        <rdar://problem/32086550>

        Reviewed by Simon Fraser.

        The problem here is that our animation code is tied to renderers. We don't have renderers during
        the initial style resolution so animations are not applied yet. When constructing renderers we set
        their style to the initial animated style but this step can't implement inheritance.

        Normally this is invisible as the first animation frame will immediately inherit the style correctly.
        However in this case the animation is discrete and the first frame is the same as the initial state.
        With r207372 we optimize the descendant style change away.

        This patch fixes the problem by tracking that the renderer has initial animated style and inheriting
        it to descendants during next style resolution even if it doesn't change.

        Test: animations/animation-initial-inheritance.html

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::RenderElement):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::hasInitialAnimatedStyle):
        (WebCore::RenderElement::setHasInitialAnimatedStyle):
        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::createRenderer):

            Set a bit on renderer indicating it has initial animated style.

        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::createAnimatedElementUpdate):

            Return at least 'Inherit' for style change when updating renderer with initial animated style.

2017-05-10  Myles C. Maxfield  <mmaxfield@apple.com>

        Tiny cleanup in Font::DerivedFonts
        https://bugs.webkit.org/show_bug.cgi?id=171893

        Reviewed by Jon Lee.

        This variable was written to but never read.

        No new tests because there is no behavior change.

        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::font):
        * platform/graphics/Font.cpp:
        (WebCore::Font::verticalRightOrientationFont):
        (WebCore::Font::uprightOrientationFont):
        (WebCore::Font::smallCapsFont):
        (WebCore::Font::noSynthesizableFeaturesFont):
        (WebCore::Font::emphasisMarkFont):
        (WebCore::Font::brokenIdeographFont):
        (WebCore::Font::DerivedFonts::~DerivedFonts): Deleted.
        * platform/graphics/Font.h:
        (WebCore::Font::DerivedFonts::DerivedFonts): Deleted.

2017-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>

        Remove user agent quirk for Slack
        https://bugs.webkit.org/show_bug.cgi?id=171869

        Reviewed by Carlos Garcia Campos.

        The user agent quirk for Slack does not seem to be necessary anymore. I am able to use Slack
        without difficulty using our default user agent.

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

2017-05-10  Hyungwook Lee  <hyungwook.lee@navercorp.com>

        [GTK] Fix compile warnings in CryptoKeyECGCrypt.cpp
        https://bugs.webkit.org/show_bug.cgi?id=171851

        Reviewed by Alex Christensen.

        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        (WebCore::curveSize):
        (WebCore::curveName):
        (WebCore::uncompressedPointSizeForCurve):
        (WebCore::uncompressedFieldElementSizeForCurve):

2017-05-08  Sergio Villar Senin  <svillar@igalia.com>

        [css-grid] Remove Blink-specific code for handling orthogonal grid items
        https://bugs.webkit.org/show_bug.cgi?id=171807

        Reviewed by Darin Adler.

        This code was added in r203252 as part of a patch improving the handling of
        {min|max}-content with orthogonal flows. The original code came from Blink which performs a
        pre-layout of orthogonal boxes in FrameView. That is not true in the case of WebKit so we do
        not need this code at all. Actually it was causing incorrect renderings in some tests.

        I'm also removing an invalid return statement just after another return.

        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
        (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):

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

        Unreviewed build fix.

        * platform/wpe/WidgetWPE.cpp:
        (WebCore::Widget::paint): Add the missing SecurityOriginPaintPolicy parameter.

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

        [MediaStream] deviceId constraint doesn't work with getUserMedia
        https://bugs.webkit.org/show_bug.cgi?id=171877
        <rdar://problem/31899730>

        Reviewed by Jer Noble.

        Test: fast/mediastream/get-user-media-device-id.html

        * Modules/mediastream/MediaConstraintsImpl.h:
        (WebCore::MediaConstraintsData::MediaConstraintsData): Add a constructor that 
        takes a const MediaConstraints&.

        * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
        (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin): Don't return
        NULL for the main frame so the origin matches that returned for a UserMediaRequest.

        * Modules/mediastream/UserMediaController.h:
        (WebCore::UserMediaController::setDeviceIDHashSalt): Deleted, not used.
        (WebCore::UserMediaController::deviceIDHashSalt): Deleted, not used.

        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::allow): Add device ID hash salt parameter, set it on
        constraints.
        * Modules/mediastream/UserMediaRequest.h:

        * platform/mediastream/MediaConstraints.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::fitnessDistance): ASSERT if called for DeviceId.
        (WebCore::RealtimeMediaSource::selectSettings): Special case DeviceId because it
        we have to hash the device ID before comparing, and because the DeviceId can't be
        changed so it should never be added to the flattened constraints.

        * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
        (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint): Deleted, unused.
        (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName): Deleted, unused.
        * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:

        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints): Pass device
        id, not empty string.

2017-05-09  Jeremy Jones  <jeremyj@apple.com>

        Video fullscreen window level should be below status bar.
        https://bugs.webkit.org/show_bug.cgi?id=171892
        rdar://problem/31771707

        Reviewed by Jer Noble.

        No new tests because it only affects platform window level.

        Move the fullscreen window below the status bar, but above the input field window level.

        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebVideoFullscreenInterfaceAVKit::setupFullscreen):

2017-05-09  Sam Weinig  <sam@webkit.org>

        Implement Subresource Integrity (SRI) [Part 2 - Fetch]
        https://bugs.webkit.org/show_bug.cgi?id=148363
        <rdar://problem/18945879>

        Reviewed by Youenn Fablet.

        Tests: http/tests/subresource-integrity/sri-fetch-worker.html
               http/tests/subresource-integrity/sri-fetch.html

        * loader/FetchOptions.h:
        * loader/ThreadableLoader.cpp:
        (WebCore::ThreadableLoaderOptions::isolatedCopy):
        * loader/ThreadableLoader.h:
        * loader/WorkerThreadableLoader.cpp:
        (WebCore::LoaderTaskOptions::LoaderTaskOptions):
        Add integrity metadata to the fetch options, and fix the implementation of
        ThreadableLoaderOptions::isolatedCopy to work correctly (it was missing isolated
        copy derivedCachedDataTypesToRetrieve).

        * Modules/fetch/FetchRequest.cpp:
        (WebCore::buildOptions):
        (WebCore::FetchRequest::initializeOptions):
        * Modules/fetch/FetchRequest.h:
        Switch to using the integrity metadata on the fetchOptions, removing the need to
        store them directly on the internal request.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
        (WebCore::DocumentThreadableLoader::didReceiveResponse):
        (WebCore::DocumentThreadableLoader::didReceiveData):
        (WebCore::DocumentThreadableLoader::didFinishLoading):
        (WebCore::DocumentThreadableLoader::loadRequest):
        (WebCore::DocumentThreadableLoader::reportIntegrityMetadataError):
        * loader/DocumentThreadableLoader.h:
        Add a new flag, m_delayCallbacksForIntegrityCheck, which is used when integrity metadata
        is present, so we can implement the 'wait' concept from the fetch spec, and delay informing
        the clients until we have validated the integrity metadata.

2017-05-09  Commit Queue  <commit-queue@webkit.org>

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

        Caused a test failure (Requested by eric_carlson on #webkit).

        Reverted changeset:

        "[MediaStream] deviceId constraint doesn't work with
        getUserMedia"
        https://bugs.webkit.org/show_bug.cgi?id=171877
        http://trac.webkit.org/changeset/216545

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

        resetFlowThreadContainingBlockAndChildInfoIncludingDescendants should not ignore RenderElement subtrees.
        https://bugs.webkit.org/show_bug.cgi?id=171873
        <rdar://problem/32004954>

        Reviewed by Simon Fraser.

        Normally a RenderBlock's parent is another RenderBlock, but In some cases (e.g. tables) a RenderBlock can
        have a non-RenderBlock(RenderBox) ancestor.
        While updating the flow thread state on a subtree, we should descent into subtrees with RenderElement
        roots and not just RenderBlocks so that we clear the state on the entire subtree.

        Test: fast/multicol/crash-when-column-inside-table.html

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::resetFlowThreadContainingBlockAndChildInfoIncludingDescendants):
        * rendering/RenderBlock.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::resetFlowThreadContainingBlockAndChildInfoIncludingDescendants):
        * rendering/RenderElement.h:

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

        [MediaStream] deviceId constraint doesn't work with getUserMedia
        https://bugs.webkit.org/show_bug.cgi?id=171877
        <rdar://problem/31899730>

        Reviewed by Jer Noble.

        Test: fast/mediastream/get-user-media-device-id.html

        * Modules/mediastream/MediaConstraintsImpl.h:
        (WebCore::MediaConstraintsData::MediaConstraintsData): Add a constructor that 
        takes a const MediaConstraints&.

        * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
        (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin): Don't return
        NULL for the main frame so the origin matches that returned for a UserMediaRequest.

        * Modules/mediastream/UserMediaController.h:
        (WebCore::UserMediaController::setDeviceIDHashSalt): Deleted, not used.
        (WebCore::UserMediaController::deviceIDHashSalt): Deleted, not used.

        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::allow): Add device ID hash salt parameter, set it on
        constraints.
        * Modules/mediastream/UserMediaRequest.h:

        * platform/mediastream/MediaConstraints.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::fitnessDistance): ASSERT if called for DeviceId.
        (WebCore::RealtimeMediaSource::selectSettings): Special case DeviceId because it
        we have to hash the device ID before comparing, and because the DeviceId can't be
        changed so it should never be added to the flattened constraints.

        * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
        (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint): Deleted, unused.
        (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName): Deleted, unused.
        * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:

        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints): Pass device
        id, not empty string.

2017-05-09  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] Localized strings aren't loaded
        https://bugs.webkit.org/show_bug.cgi?id=171884

        Reviewed by Dean Jackson.

        Remove the extraneous file extension in the file name.

        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::mediaControlsScript):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::mediaControlsScript):

2017-05-09  Chris Dumez  <cdumez@apple.com>

        Introduce DocumentAndElementEventHandlers IDL interface
        https://bugs.webkit.org/show_bug.cgi?id=171879

        Reviewed by Simon Fraser and Ryosuke Niwa.

        Introduce DocumentAndElementEventHandlers IDL interface:
        - https://html.spec.whatwg.org/#documentandelementeventhandlers

        This avoids duplication between Document.idl and Element.idl.

        Also mark oncopy / oncut / onpaste EventHandlers as enumerable to match
        the specification.

        Test: fast/events/DocumentAndElementEventHandlers.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.idl:
        * dom/DocumentAndElementEventHandlers.idl: Added.
        * dom/Element.idl:

2017-05-10  Dean Jackson  <dino@apple.com>

        Restrict SVG filters to accessible security origins
        https://bugs.webkit.org/show_bug.cgi?id=118689
        <rdar://problem/27362159>

        Reviewed by Brent Fulgham.

        Certain SVG filters should only be allowed to operate
        on content that is has SecurityOrigin access to. Implement
        this by including a flag in PaintInfo and LayerPaintingInfo,
        and have RenderWidget make sure the documents have acceptable
        SecurityOrigins as it goes to paint.

        This could be used as the first step in a "safe painting"
        strategy, allowing some content to be rendered into a 
        canvas or via the element() CSS function... but it is only
        a small first step.

        Test: http/tests/css/filters-on-iframes.html

        * page/FrameView.cpp:
        (WebCore::FrameView::paintContents):
        * page/FrameView.h:
        * platform/ScrollView.cpp:
        (WebCore::ScrollView::paint):
        * platform/ScrollView.h:
        * platform/Scrollbar.cpp:
        (WebCore::Scrollbar::paint):
        * platform/Scrollbar.h:
        * platform/Widget.h:
        * platform/graphics/filters/FilterOperation.h:
        (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin):
        * platform/graphics/filters/FilterOperations.cpp:
        (WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin):
        * platform/graphics/filters/FilterOperations.h:
        * platform/mac/WidgetMac.mm:
        (WebCore::Widget::paint):
        * rendering/FilterEffectRenderer.cpp:
        (WebCore::FilterEffectRenderer::build):
        * rendering/FilterEffectRenderer.h:
        * rendering/PaintInfo.h:
        (WebCore::PaintInfo::PaintInfo):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paint):
        (WebCore::RenderLayer::setupFilters):
        (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
        * rendering/RenderLayer.h:
        * rendering/RenderScrollbar.cpp:
        (WebCore::RenderScrollbar::paint):
        * rendering/RenderScrollbar.h:
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::paintContents):

2017-05-09  Chris Dumez  <cdumez@apple.com>

        Move onanimation* EventHandlers to GlobalEventHandlers
        https://bugs.webkit.org/show_bug.cgi?id=171874

        Reviewed by Simon Fraser.

        Move onanimation* EventHandlers to GlobalEventHandlers to match the specification:
        - https://drafts.csswg.org/css-animations/#interface-globaleventhandlers-idl

        We previously have those on Window and Element only. Firefox complies with the
        specification.

        Test: fast/css/onanimation-eventhandlers.html

        * dom/Element.idl:
        * dom/GlobalEventHandlers.idl:
        * page/DOMWindow.idl:

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

        Refresh webrtc WPT tests
        https://bugs.webkit.org/show_bug.cgi?id=171878

        Reviewed by Eric Carlson.

        Tests: imported/w3c/web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize.html
               imported/w3c/web-platform-tests/webrtc/RTCDataChannel-id.html
               imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html
               imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor.html
               imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html
               imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html
               imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl.html
               imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html
               imported/w3c/web-platform-tests/webrtc/datachannel-idlharness.html
               imported/w3c/web-platform-tests/webrtc/getstats.html
               imported/w3c/web-platform-tests/webrtc/interfaces.html

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::createDataChannel): exiting early if libwebrtc is not creating a data channel.

2017-05-09  Javier Fernandez  <jfernandez@igalia.com>

        space-evenly misbehaves with flexbox
        https://bugs.webkit.org/show_bug.cgi?id=170445

        Reviewed by David Hyatt.

        The CSS Box Alignment specification defines the <content-distribution>
        set as some of the allowed values for the Content Distribution
        properties, align-content and justify-content. The 'space-evenly' value
        is not among the ones allowed for these properties according to the CSS
        Flexible Box specification.

        The CSS Flexbible box specification states that it must follow the CSS
        Box Alignment specification, so this new value must be considered as
        part of an upgraded level of the spec, which should be implemented
        eventually.

        Since we have already shipped an implementation of the new CSS Box
        Alignment values for CSS Grid Layout, we need to implement it for
        Flexbox as well.

        No new tests, but several new test cases added.

        * rendering/RenderFlexibleBox.cpp:
        (WebCore::initialJustifyContentOffset):
        (WebCore::justifyContentSpaceBetweenChildren):
        (WebCore::initialAlignContentOffset):
        (WebCore::alignContentSpaceBetweenChildren):

2017-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>

        Avoid -Wformat warnings in RenderLayerCompositor.cpp and RenderLayerBacking.cpp
        https://bugs.webkit.org/show_bug.cgi?id=171875

        Reviewed by Simon Fraser.

        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::logLayerInfo):
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

2017-05-09  Chris Dumez  <cdumez@apple.com>

        Drop custom bindings code for Window.location setter
        https://bugs.webkit.org/show_bug.cgi?id=171846

        Reviewed by Sam Weinig.

        Drop custom bindings code for Window.location setter as the custom code was merely needed
        to address a very old Mac widget that has long been fixed (rdar://problem/5695330).

        No new tests, no Web-facing behavior change.

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::setLocation): Deleted.
        Drop custom code.

        * page/DOMWindow.idl:
        Align Window.location with https://html.spec.whatwg.org/#the-window-object:
        - Mark property as readonly.
        - Add [PutsForward=href] IDL extended attribute.
        Also, we need to mark the atribute as nullable as this reflects our current implementation.
        We currently return null if the associated Window does not have a frame. This does not match
        the specification and we should update our implementation in the future to never return null.

2017-05-09  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r216508.

        The layout test enabled in this change is failing on Sierra.

        Reverted changeset:

        "Invalid MediaSource duration value should throw TyperError
        instead of InvalidStateError"
        https://bugs.webkit.org/show_bug.cgi?id=171653
        http://trac.webkit.org/changeset/216508

2017-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>

        Update Chrome and Firefox versions in user agent quirks
        https://bugs.webkit.org/show_bug.cgi?id=171823

        Reviewed by Carlos Alberto Lopez Perez.

        * platform/UserAgentQuirks.cpp:
        (WebCore::UserAgentQuirks::stringForQuirk):
        (WebCore::UserAgentQuirks::firefoxRevisionString):

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

        RealtimeOutgoingAudioSource is crashing when given data with more than two channels
        https://bugs.webkit.org/show_bug.cgi?id=171868

        Reviewed by Eric Carlson.

        Manual testing.

        * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
        (WebCore::libwebrtcAudioFormat): Capping the number of channels to 2.
        (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):

2017-05-09  Myles C. Maxfield  <mmaxfield@apple.com>

        font-stretch: normal selects expanded fonts instead of condensed fonts
        https://bugs.webkit.org/show_bug.cgi?id=171838
        <rdar://problem/31005481>

        Reviewed by Jon Lee.

        CSS Fonts level 3 says: "If the value of ‘font-stretch’ is ‘normal’ or one of the condensed
        values, narrower width values are checked first, then wider values."

        CSS Fonts level 4 erroneously was incompatible with this, but was updated in
        https://github.com/w3c/csswg-drafts/commit/4559389d183bbaaf3321af5ba1c924caa7c488bb
        to be consistent with this.

        Now, CSS Fonts level 4 states: "If the desired stretch value is less than or equal to100,
        stretch values below the desired stretch value are checked in descending order followed by
        stretch values above the desired stretch value in ascending order"

        Test: fast/text/font-width-100.html

        * platform/graphics/FontSelectionAlgorithm.cpp:

2017-05-09  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Enable creation of ReadableStreamBYOBReader
        https://bugs.webkit.org/show_bug.cgi?id=171665

        Reviewed by Youenn Fablet.

        Enabled the creation of ReadableStreamBYOBReader.

        Test: streams/readable-stream-byob-reader.html

        * CMakeLists.txt: Updated to support ReadableStreamBYOBReader.
        * DerivedSources.cpp: Updated to support ReadableStreamBYOBReader.
        * DerivedSources.make: Updated to support ReadableStreamBYOBReader.
        * Modules/streams/ReadableByteStreamInternals.js: Updated to support ReadableStreamBYOBReader.
        (privateInitializeReadableStreamBYOBReader):
        (isReadableStreamBYOBReader):
        * Modules/streams/ReadableStream.js: Updated to support ReadableStreamBYOBReader.
        (getReader):
        * Modules/streams/ReadableStreamBYOBReader.idl: Added.
        * Modules/streams/ReadableStreamBYOBReader.js: Added.
        (cancel): To be implemented.
        (read): To be implemented.
        (releaseLock): To be implemented.
        (closed): To be implemented.
        * WebCore.xcodeproj/project.pbxproj: Updated to support ReadableStreamBYOBReader.
        * bindings/js/JSDOMGlobalObject.cpp: Updated to support ReadableStreamBYOBReader.
        (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
        * bindings/js/JSReadableStreamPrivateConstructors.cpp: Updated to support ReadableStreamBYOBReader.
        (WebCore::constructJSReadableStreamReaderGeneric):
        (WebCore::constructJSReadableStreamDefaultReader):
        (WebCore::constructJSReadableStreamBYOBReader):
        (WebCore::JSBuiltinReadableStreamBYOBReaderPrivateConstructor::initializeExecutable):
        (WebCore::createReadableStreamBYOBReaderPrivateConstructor):
        * bindings/js/JSReadableStreamPrivateConstructors.h: Updated to support ReadableStreamBYOBReader.
        * bindings/js/WebCoreBuiltinNames.h: Updated to support ReadableStreamBYOBReader.

2017-05-09  Frederic Wang  <fwang@igalia.com>

        Print more properties in the output of scrolling trees
        https://bugs.webkit.org/show_bug.cgi?id=171858

        Reviewed by Simon Fraser.

        No new tests, no behavior changes.

        * page/scrolling/ScrollingCoordinator.cpp: Implement << operator to print ScrollableAreaParameters.
        (WebCore::operator<<):
        * page/scrolling/ScrollingCoordinator.h: Declare new << operator.
        * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Print new properties.
        (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
        * page/scrolling/ScrollingStateScrollingNode.cpp: ditto.
        (WebCore::ScrollingStateScrollingNode::dumpProperties):
        * page/scrolling/ScrollingTreeScrollingNode.cpp: ditto.
        (WebCore::ScrollingTreeScrollingNode::dumpProperties):

2017-05-09  Chris Dumez  <cdumez@apple.com>

        ontransitionend eventHandler should be in GlobalEventHandlers
        https://bugs.webkit.org/show_bug.cgi?id=171836

        Reviewed by Ryosuke Niwa.

        ontransitionend eventHandler should be in GlobalEventHandlers:
        - https://drafts.csswg.org/css-transitions/#interface-globaleventhandlers-idl

        WebKit currently has in on Window and Element only. Firefox matches the specification.

        Test: fast/css/ontransitionend-eventhandler.html

        * dom/Element.idl:
        * dom/GlobalEventHandlers.idl:
        * page/DOMWindow.idl:

2017-05-09  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>

        MediaSource.readyState should use an IDL enum
        https://bugs.webkit.org/show_bug.cgi?id=171672

        Reviewed by Eric Carlson and Chris Dumez.

        MediaSource.readyState should use an IDL enum as per specification
        (https://www.w3.org/TR/2016/CR-media-source-20160503/#idl-def-ReadyState).

        No new tests required since no behavior change.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::toString):
        (WebCore::MediaSource::MediaSource):
        (WebCore::MediaSource::setPrivateAndOpen):
        (WebCore::MediaSource::buffered):
        (WebCore::MediaSource::setReadyState):
        (WebCore::MediaSource::streamEndedWithError):
        (WebCore::MediaSource::isOpen):
        (WebCore::MediaSource::isClosed):
        (WebCore::MediaSource::isEnded):
        (WebCore::MediaSource::detachFromElement):
        (WebCore::MediaSource::openIfInEndedState):
        (WebCore::MediaSource::stop):
        (WebCore::MediaSource::onReadyStateChange):
        * Modules/mediasource/MediaSource.h:
        * Modules/mediasource/MediaSource.idl:

2017-05-09  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>

        Invalid MediaSource duration value should throw TyperError instead of InvalidStateError
        https://bugs.webkit.org/show_bug.cgi?id=171653

        Reviewed by Youenn Fablet.

        Modify MediaSource::setDuration to throw a TypeError when duration value is invalid as per MSE specification
        (https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-duration).

        Update expectation of corresponding WPT test.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::setDuration):
        (WebCore::MediaSource::setDurationInternal):

2017-05-09  Yusuke Suzuki  <utatane.tea@gmail.com>

        Unreviewed, update binding-tests results
        https://bugs.webkit.org/show_bug.cgi?id=166752

        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:

2017-05-09  Chris Dumez  <cdumez@apple.com>

        Update DocumentOrShadowRoot.idl to match specifications
        https://bugs.webkit.org/show_bug.cgi?id=171845

        Reviewed by Ryosuke Niwa.

        Update DocumentOrShadowRoot.idl to match specifications:
        - https://dom.spec.whatwg.org/#mixin-documentorshadowroot
        - https://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin
        - https://w3c.github.io/pointerlock/#extensions-to-the-documentorshadowroot-mixin

        No Web-facing behavior change. Things that do not match the specification were merely
        annotated with FIXME comments.

        * dom/Document.idl:
        * dom/DocumentOrShadowRoot.idl:

2017-05-09  Yusuke Suzuki  <utatane.tea@gmail.com>

        Unreviewed, attempt to fix macOS ports using ApplePay
        https://bugs.webkit.org/show_bug.cgi?id=166752

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):

2017-05-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>

        [Coordinated Graphics] Debug Visuals don't hide
        https://bugs.webkit.org/show_bug.cgi?id=162704

        Reviewed by Žan Doberšek.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::setShowDebugBorder):
        (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
        (WebCore::CoordinatedGraphicsLayer::syncLayerState):
        (WebCore::CoordinatedGraphicsLayer::setDebugBorder):
        showDebugBorders() and showRepaintCounter() of CoordinatedGraphicsLayer should reflect
        the "show" argument to the layer state.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
        (WebCore::DebugVisuals::DebugVisuals):
        (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
        To set the debug visuals of a layer, the visibility flags of the borders and the repaint
        counters as well as the border width and color are needed. Thus a new bundle struct
        DebugVisuals and its change flag debugVisualsChanged have been introduced in order to
        send the information at once.

2017-05-09  Yusuke Suzuki  <utatane.tea@gmail.com>

        Handle IDLPromise<> properly
        https://bugs.webkit.org/show_bug.cgi?id=166752

        Reviewed by Youenn Fablet.

        This patch implements WebIDL Promise type conversion. According to the spec,
        Promise takes a value and convert it to Promise by using Promise.resolve function.
        We implement JSPromise::resolve in JSC and use it in JSDOMConvertPromise.

        In conversion phase, we just convert the value to JSC::JSPromise* and hold it in
        PromiseRejectionEvent. On the other hand, In this patch, we newly introduce a new
        type DOMPromise and use it in RejectedPromiseTracker. And we also rename the previous
        DOMPromise to DOMPromiseDeferred since it is corresponding to JSPromiseDeferred.
        DOMPromise is DOMGuarded object. So it is strongly referenced from ScriptExecutionContext
        and it is weakly referenced from the object itself. This is important since Strong<JSPromise>
        reference in C++ object that has a wrapper (in this case, PromiseRejectionEvent) easily causes
        cyclic reference. We hold it as DOMPromise instead of Strong<JSPromise> in RejectedPromiseTracker
        to break the cyclic reference edge with weak reference.

        In the meantime, we still use JSC::Strong<> in PromiseRejectionEvent. It leaks memory if promise
        refers the wrapper object of PromiseRejectionEvent. CustomEvent also has the same problem.
        This is a general problem that `attribute any` can create cyclic reference. And they should be
        fixed in a different patch.

        Currently, we do not take the following approach. e.g. There is C++ object that represents Promise.
        And its wrapper object is JSPromise thing. When exposing the C++ object, it will be converted to a
        wrapper object. We do not take this approach because PromiseRejectionEvent can take user-provided promise.
        For example, users can create PromiseRejectionEvent in a form
        `new PromiseRejectionEvent("...", { promise: promise })`. In this case, `event.promise === promise`
        is required. And this is not suitable for the above C++ object model.

        Large part of this patch is mechanical one to replace DOMPromise with DOMPromiseDeferred.

        * CMakeLists.txt:
        * Modules/applepay/ApplePaySession.cpp:
        * Modules/encryptedmedia/MediaKeySession.h:
        * Modules/encryptedmedia/MediaKeySystemAccess.h:
        * Modules/encryptedmedia/MediaKeys.h:
        * Modules/encryptedmedia/NavigatorEME.h:
        * Modules/fetch/DOMWindowFetch.h:
        * Modules/fetch/FetchBody.h:
        * Modules/fetch/FetchBodyConsumer.h:
        * Modules/fetch/FetchResponse.h:
        * Modules/fetch/WorkerGlobalScopeFetch.h:
        * Modules/mediastream/MediaDevices.h:
        * Modules/mediastream/MediaEndpointPeerConnection.cpp:
        (WebCore::MediaEndpointPeerConnection::replaceTrack):
        (WebCore::MediaEndpointPeerConnection::replaceTrackTask):
        * Modules/mediastream/MediaEndpointPeerConnection.h:
        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::applyConstraints):
        * Modules/mediastream/MediaStreamTrack.h:
        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::setLocalDescription):
        (WebCore::PeerConnectionBackend::setRemoteDescription):
        (WebCore::PeerConnectionBackend::addIceCandidate):
        * Modules/mediastream/PeerConnectionBackend.h:
        (WebCore::PeerConnectionBackend::endOfIceCandidates):
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::queuedSetLocalDescription):
        (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
        (WebCore::RTCPeerConnection::queuedAddIceCandidate):
        (WebCore::RTCPeerConnection::enqueueReplaceTrackTask):
        (WebCore::RTCPeerConnection::replaceTrack):
        * Modules/mediastream/RTCPeerConnection.h:
        * Modules/mediastream/RTCRtpSender.cpp:
        (WebCore::RTCRtpSender::replaceTrack):
        * Modules/mediastream/RTCRtpSender.h:
        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::start):
        (WebCore::UserMediaRequest::UserMediaRequest):
        * Modules/mediastream/UserMediaRequest.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * Modules/streams/ReadableStreamSource.h:
        (WebCore::ReadableStreamSource::start):
        (WebCore::ReadableStreamSource::pull):
        * Modules/webaudio/AudioContext.cpp:
        (WebCore::AudioContext::addReaction):
        (WebCore::AudioContext::setState):
        (WebCore::AudioContext::suspend):
        (WebCore::AudioContext::resume):
        (WebCore::AudioContext::close):
        * Modules/webaudio/AudioContext.h:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/IDLTypes.h:
        * bindings/js/CachedModuleScriptLoaderClient.h:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSCustomElementRegistryCustom.cpp:
        * bindings/js/JSDOMConvertPromise.h:
        (WebCore::Converter<IDLPromise<T>>::convert):
        (WebCore::JSConverter<IDLPromise<T>>::convert):
        * bindings/js/JSDOMExceptionHandling.cpp:
        * bindings/js/JSDOMGlobalObject.cpp:
        * bindings/js/JSDOMGuardedObject.h:
        * bindings/js/JSDOMPromise.h:
        (WebCore::DOMPromise::create):
        (WebCore::DOMPromise::promise):
        (WebCore::DOMPromise::DOMPromise):
        (WebCore::DeferredPromise::create): Deleted.
        (WebCore::DeferredPromise::resolve): Deleted.
        (WebCore::DeferredPromise::resolveWithNewlyCreated): Deleted.
        (WebCore::DeferredPromise::reject): Deleted.
        (WebCore::DeferredPromise::resolveWithCallback): Deleted.
        (WebCore::DeferredPromise::rejectWithCallback): Deleted.
        (WebCore::DeferredPromise::DeferredPromise): Deleted.
        (WebCore::DeferredPromise::deferred): Deleted.
        (WebCore::DOMPromiseBase::DOMPromiseBase): Deleted.
        (WebCore::DOMPromiseBase::operator=): Deleted.
        (WebCore::DOMPromiseBase::reject): Deleted.
        (WebCore::DOMPromiseBase::rejectType): Deleted.
        (WebCore::DOMPromiseBase::promise): Deleted.
        (WebCore::DOMPromise::resolve): Deleted.
        (WebCore::DOMPromise<void>::resolve): Deleted.
        (WebCore::callPromiseFunction): Deleted.
        (WebCore::bindingPromiseFunctionAdapter): Deleted.
        * bindings/js/JSDOMPromiseDeferred.cpp: Renamed from Source/WebCore/bindings/js/JSDOMPromise.cpp.
        (WebCore::DeferredPromise::promise):
        (WebCore::DeferredPromise::callFunction):
        (WebCore::DeferredPromise::reject):
        (WebCore::rejectPromiseWithExceptionIfAny):
        (WebCore::createDeferredPromise):
        (WebCore::createRejectedPromiseWithTypeError):
        (WebCore::parseAsJSON):
        (WebCore::fulfillPromiseWithJSON):
        (WebCore::fulfillPromiseWithArrayBuffer):
        * bindings/js/JSDOMPromiseDeferred.h: Copied from Source/WebCore/bindings/js/JSDOMPromise.h.
        (WebCore::DeferredPromise::create):
        (WebCore::DeferredPromise::resolve):
        (WebCore::DeferredPromise::resolveWithNewlyCreated):
        (WebCore::DeferredPromise::reject):
        (WebCore::DeferredPromise::resolveWithCallback):
        (WebCore::DeferredPromise::rejectWithCallback):
        (WebCore::DeferredPromise::DeferredPromise):
        (WebCore::DeferredPromise::deferred):
        (WebCore::DOMPromiseDeferredBase::DOMPromiseDeferredBase):
        (WebCore::DOMPromiseDeferredBase::operator=):
        (WebCore::DOMPromiseDeferredBase::reject):
        (WebCore::DOMPromiseDeferredBase::rejectType):
        (WebCore::DOMPromiseDeferredBase::promise):
        (WebCore::DOMPromiseDeferred::resolve):
        (WebCore::DOMPromiseDeferred<void>::resolve):
        (WebCore::callPromiseFunction):
        (WebCore::bindingPromiseFunctionAdapter):
        * bindings/js/JSSubtleCryptoCustom.cpp:
        * bindings/js/JSWebGPUCommandBufferCustom.cpp:
        * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: Added.
        (WebCore::convertDictionary<TestPromiseRejectionEvent::Init>):
        (WebCore::JSTestPromiseRejectionEventPrototype::create):
        (WebCore::JSTestPromiseRejectionEventPrototype::createStructure):
        (WebCore::JSTestPromiseRejectionEventPrototype::JSTestPromiseRejectionEventPrototype):
        (WebCore::JSTestPromiseRejectionEventConstructor::construct):
        (WebCore::JSTestPromiseRejectionEventConstructor::prototypeForStructure):
        (WebCore::JSTestPromiseRejectionEventConstructor::initializeProperties):
        (WebCore::JSTestPromiseRejectionEventPrototype::finishCreation):
        (WebCore::JSTestPromiseRejectionEvent::JSTestPromiseRejectionEvent):
        (WebCore::JSTestPromiseRejectionEvent::finishCreation):
        (WebCore::JSTestPromiseRejectionEvent::createPrototype):
        (WebCore::JSTestPromiseRejectionEvent::prototype):
        (WebCore::BindingCaller<JSTestPromiseRejectionEvent>::castForAttribute):
        (WebCore::jsTestPromiseRejectionEventPromise):
        (WebCore::jsTestPromiseRejectionEventPromiseGetter):
        (WebCore::jsTestPromiseRejectionEventReason):
        (WebCore::jsTestPromiseRejectionEventReasonGetter):
        (WebCore::jsTestPromiseRejectionEventConstructor):
        (WebCore::setJSTestPromiseRejectionEventConstructor):
        (WebCore::JSTestPromiseRejectionEvent::getConstructor):
        (WebCore::toJSNewlyCreated):
        (WebCore::toJS):
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h: Added.
        (WebCore::JSTestPromiseRejectionEvent::create):
        (WebCore::JSTestPromiseRejectionEvent::createStructure):
        (WebCore::JSTestPromiseRejectionEvent::wrapped):
        (WebCore::toJS):
        (WebCore::toJSNewlyCreated):
        * bindings/scripts/test/TestPromiseRejectionEvent.idl: Copied from Source/WebCore/bindings/js/CachedModuleScriptLoaderClient.h.
        * css/FontFace.h:
        * css/FontFaceSet.h:
        * dom/CustomElementRegistry.h:
        * dom/PromiseRejectionEvent.h:
        * dom/RejectedPromiseTracker.cpp:
        (WebCore::UnhandledPromise::UnhandledPromise):
        (WebCore::UnhandledPromise::callStack):
        (WebCore::UnhandledPromise::promise):
        (WebCore::RejectedPromiseTracker::promiseRejected):
        (WebCore::RejectedPromiseTracker::promiseHandled):
        (WebCore::RejectedPromiseTracker::reportUnhandledRejections):
        (WebCore::RejectedPromiseTracker::reportRejectionHandled):
        (WebCore::RejectedPromise::RejectedPromise): Deleted.
        (WebCore::RejectedPromise::globalObject): Deleted.
        (WebCore::RejectedPromise::promise): Deleted.
        * dom/RejectedPromiseTracker.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::rejectPendingPlayPromises):
        (WebCore::HTMLMediaElement::resolvePendingPlayPromises):
        (WebCore::HTMLMediaElement::play):
        * html/HTMLMediaElement.h:
        * platform/graphics/gpu/GPUCommandBuffer.h:
        * testing/Internals.h:

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

        Upstream the WPE port
        https://bugs.webkit.org/show_bug.cgi?id=171110

        Reviewed by Alex Christensen.

        webkit-dev thread:
        https://lists.webkit.org/pipermail/webkit-dev/2017-April/028923.html

        Existing files mostly changed to properly use PLATFORM(WPE) build guards.
        In-file changes removed from this ChangeLog entry for brevity.

        * CMakeLists.txt:
        * PlatformWPE.cmake: Added.
        * accessibility/AccessibilityObject.h:
        * accessibility/wpe/AXObjectCacheWPE.cpp: Added.
        * accessibility/wpe/AccessibilityObjectWPE.cpp: Copied from Source/WebCore/platform/audio/glib/AudioBusGLib.cpp.
        * config.h:
        * crypto/keys/CryptoKeyEC.h:
        * crypto/keys/CryptoKeyRSA.h:
        * editing/Editor.cpp:
        * editing/Editor.h:
        * editing/wpe/EditorWPE.cpp: Added.
        * page/EventHandler.cpp:
        * page/wpe/EventHandlerWPE.cpp: Added.
        * platform/Cursor.h:
        * platform/DragData.h:
        * platform/DragImage.h:
        * platform/FileSystem.h:
        * platform/MainThreadSharedTimer.cpp:
        * platform/MainThreadSharedTimer.h:
        * platform/Pasteboard.h:
        * platform/PasteboardStrategy.h:
        * platform/PlatformPasteboard.h:
        * platform/SchemeRegistry.cpp:
        * platform/Widget.h:
        * platform/audio/glib/AudioBusGLib.cpp:
        * platform/glib/FileSystemGlib.cpp:
        * platform/graphics/ANGLEWebKitBridge.h:
        * platform/graphics/GLContext.cpp:
        * platform/graphics/GLContext.h:
        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/OpenGLESShims.h:
        * platform/graphics/PlatformDisplay.cpp:
        * platform/graphics/PlatformDisplay.h:
        * platform/graphics/egl/GLContextEGL.cpp:
        * platform/graphics/egl/GLContextEGL.h:
        * platform/graphics/egl/GLContextEGLWPE.cpp: Copied from Source/WebCore/platform/audio/glib/AudioBusGLib.cpp.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        * platform/graphics/wpe/IconWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
        * platform/graphics/wpe/ImageWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
        * platform/graphics/wpe/PlatformDisplayWPE.cpp: Added.
        * platform/graphics/wpe/PlatformDisplayWPE.h: Added.
        * platform/wpe/CursorWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
        * platform/wpe/LocalizedStringsWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
        * platform/wpe/PasteboardWPE.cpp: Added.
        * platform/wpe/PlatformKeyboardEventWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
        * platform/wpe/PlatformPasteboardWPE.cpp: Added.
        * platform/wpe/PlatformScreenWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
        * platform/wpe/RenderThemeWPE.cpp: Copied from Source/WebKit2/Shared/NativeWebWheelEvent.h.
        * platform/wpe/RenderThemeWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
        * platform/wpe/ScrollbarThemeWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
        * platform/wpe/ScrollbarThemeWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
        * platform/wpe/SoundWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
        * platform/wpe/ThemeWPE.cpp: Added.
        * platform/wpe/ThemeWPE.h: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.
        * platform/wpe/WidgetWPE.cpp: Copied from Source/WebKit2/Shared/DrawingAreaInfo.h.

2017-05-09  Frederic Wang  <fwang@igalia.com>

        Fix property names in ScrollingTreeScrollingNode::dumpProperties
        https://bugs.webkit.org/show_bug.cgi?id=171848

        Reviewed by Gyuyoung Kim.

        No new tests, this function is only used for debugging purpose.

        * page/scrolling/ScrollingTreeScrollingNode.cpp:
        (WebCore::ScrollingTreeScrollingNode::dumpProperties):

2017-05-09  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Building Webkit2Gtk without OpenGL fails.
        https://bugs.webkit.org/show_bug.cgi?id=170959

        Reviewed by Žan Doberšek.

        * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
        * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
        * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:

2017-05-09  Fujii Hironori  <Hironori.Fujii@sony.com>

        [AppleWin] CaptureDeviceManager.cpp: error C2813: #import is not supported with /MP
        https://bugs.webkit.org/show_bug.cgi?id=171849

        Reviewed by Per Arne Vollan.

        * platform/mediastream/CaptureDeviceManager.cpp: Replaced #import with #include.

2017-05-08  Chris Dumez  <cdumez@apple.com>

        Refactor / Clean up DOMWindow.idl
        https://bugs.webkit.org/show_bug.cgi?id=171843

        Reviewed by Ryosuke Niwa.

        Refactor / Clean up DOMWindow.idl to match the specification more closely:
        - https://html.spec.whatwg.org/#the-window-object

        No expected Web-facing change. Things that do not match the specification
        have been annotated with FIXME comments.

        * page/DOMWindow.idl:

2017-05-08  Frederic Wang  <fwang@igalia.com>

        Simplify ScrollingStateNode::scrollingStateTreeAsText
        https://bugs.webkit.org/show_bug.cgi?id=171802

        Reviewed by Simon Fraser.

        The following simplifications are performed:
        - Rely on TextStream's internal value to manage indentation.
        - Use TextStream::dumpProperty and << to print simple properties.
        - Try and use TextStream::GroupScope for groups.

        No new tests, only minor format changes in the dumped tree.

        * page/scrolling/ScrollingStateFixedNode.cpp:
        (WebCore::ScrollingStateFixedNode::dumpProperties):
        * page/scrolling/ScrollingStateFixedNode.h:
        * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
        (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
        * page/scrolling/ScrollingStateFrameScrollingNode.h:
        * page/scrolling/ScrollingStateNode.cpp:
        (WebCore::ScrollingStateNode::dumpProperties):
        (WebCore::ScrollingStateNode::dump):
        (WebCore::ScrollingStateNode::scrollingStateTreeAsText):
        * page/scrolling/ScrollingStateNode.h:
        * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
        (WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
        * page/scrolling/ScrollingStateOverflowScrollingNode.h:
        * page/scrolling/ScrollingStateScrollingNode.cpp:
        (WebCore::ScrollingStateScrollingNode::dumpProperties):
        * page/scrolling/ScrollingStateScrollingNode.h:
        * page/scrolling/ScrollingStateStickyNode.cpp:
        (WebCore::ScrollingStateStickyNode::dumpProperties):
        * page/scrolling/ScrollingStateStickyNode.h:

2017-05-08  Youenn Fablet  <youenn@apple.com>

        Follow-up to bug 171710: use more references and reject if either audio or video source creation is failing
        https://bugs.webkit.org/show_bug.cgi?id=171824

        Reviewed by Alex Christensen.

        Refactoring to use more references.
        Only behavioral change is the rejection of the getUserMedia promise if either audio or video source creation is
        failing. Previously, if audio source creation was failing, the promise would still resolve if video source was
        sucessfully created.

        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::audioFactory):
        (WebCore::RealtimeMediaSourceCenter::videoFactory):
        (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager):
        (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager):
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        (WebCore::RealtimeMediaSourceCenter::defaultAudioFactory): Deleted.
        (WebCore::RealtimeMediaSourceCenter::defaultVideoFactory): Deleted.
        (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureDeviceManager): Deleted.
        (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureDeviceManager): Deleted.
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
        (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamDevices):
        (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints):
        (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
        (WebCore::RealtimeMediaSourceCenterMac::defaultVideoFactory):
        (WebCore::RealtimeMediaSourceCenterMac::defaultAudioCaptureDeviceManager):
        (WebCore::RealtimeMediaSourceCenterMac::defaultVideoCaptureDeviceManager):
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
        (WebCore::MockRealtimeMediaSourceCenter::defaultAudioFactory):
        (WebCore::MockRealtimeMediaSourceCenter::defaultVideoFactory):
        (WebCore::MockRealtimeMediaSourceCenter::defaultAudioCaptureDeviceManager):
        (WebCore::MockRealtimeMediaSourceCenter::defaultVideoCaptureDeviceManager):
        * platform/mock/MockRealtimeMediaSourceCenter.h:

2017-05-08  Chris Dumez  <cdumez@apple.com>

        Drop [CEReactions] from CharacterData operations
        https://bugs.webkit.org/show_bug.cgi?id=171813

        Reviewed by Ryosuke Niwa.

        Drop [CEReactions] from CharacterData operations to match the DOM specification:
        - https://dom.spec.whatwg.org/#interface-characterdata

        I believe WebKit had this because Attr used to have Text child nodes. Therefore, modifying
        those Text child nodes via the CharacterData API could modify the value of an attribute,
        requiring us to run attributeChangedCallback for Custom Elements. However, as of
        <https://trac.webkit.org/r216259>, Attr can no longer have Text child nodes.

        I have also verified that Blink does not have [CEReactions] for those methods.

        No new tests, no expected Web-facing behavior change.

        * dom/CharacterData.idl:

2017-05-08  Jeremy Jones  <jeremyj@apple.com>

        Remove black background from video layer while in fullscreen.
        https://bugs.webkit.org/show_bug.cgi?id=171816

        Reviewed by Eric Carlson.

        No new tests because no new behavior in DOM.

        This changes the background of the video layer to clear when it goes into fullscreen
        and back to black when it returns to inline to better facilitate fullsceen animations.

        * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
        (WebCore::VideoFullscreenLayerManager::setVideoLayer):
        (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):

2017-05-08  Said Abou-Hallawa  <sabouhallawa@apple.com>

        The Incomplete asynchronously decoded image frame should be decoded every time it's drawn
        https://bugs.webkit.org/show_bug.cgi?id=170836

        Reviewed by Tim Horton.

        The asynchronously decoded image frames has to be cached to prevent flickering,
        but we have to keep requesting new decoding for the incomplete frame every time
        it's drawn. This is to avoid drawing an incomplete image frame even after all
        its encoded data is received.

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::draw):
        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex):
        (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):

2017-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        Guard DragController::cleanupAfterSystemDrag to only clear drag state on Mac
        https://bugs.webkit.org/show_bug.cgi?id=171771
        <rdar://problem/32019149>

        Reviewed by Tim Horton.

        The call to dragEnded here seems to have been added because a client could override Mac WK1
        WebUIDelegate methods to cause this cleanup to never be performed. Since this limitation only
        applies to Mac, guard it as such.

        * page/mac/DragControllerMac.mm:
        (WebCore::DragController::cleanupAfterSystemDrag):

2017-05-08  Commit Queue  <commit-queue@webkit.org>

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

        "It regressed JetStream on iOS by 7%" (Requested by saamyjoon
        on #webkit).

        Reverted changeset:

        "GCController.cpp's collect() should be Async"
        https://bugs.webkit.org/show_bug.cgi?id=171708
        http://trac.webkit.org/changeset/216262

2017-05-08  Chris Dumez  <cdumez@apple.com>

        Move offsetParent / offsetLeft / offsetTop / offsetWidth / offsetHeight from Element to HTMLElement
        https://bugs.webkit.org/show_bug.cgi?id=171829

        Reviewed by Simon Fraser.

        Move offsetParent / offsetLeft / offsetTop / offsetWidth / offsetHeight from Element to HTMLElement,
        as per the specification:
        - https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface

        Both Firefox and Chrome match the specification and also do not have the corresponding API on
        SVGElement.

        Bug tracking the similar move in Blink (completed over 1 year ago):
        - https://bugs.chromium.org/p/chromium/issues/detail?id=463116

        Note that for the inner SVG elements like <rect> and <circle> these attributes were returning 0,
        because those aren't part of the CSS box model. They did return correct values for the <svg>
        element itself, however.

        Test: fast/css/htmlelement-offset-properties.html

        * dom/Element.idl:
        - Drop offset* attributes, now that they are on HTMLElement.

        * html/HTMLElement.idl:
        - Resync HTMLElement.idl with the specification: https://html.spec.whatwg.org/#htmlelement
          No behavior change besides what's indicated in the Changelog above. Things that do not match
          the spec have been annotated with FIXME comments.
        - Add offset* attributes that used to be on Element.

2017-05-08  Youenn Fablet  <youenn@apple.com>

        Add support for reading and writing settings from UIProcess audio capture
        https://bugs.webkit.org/show_bug.cgi?id=171633

        Reviewed by Eric Carlson.

        Covered by manual testing and existing test sets.

        Moving success/failure callbacks for applyConstraints.
        Making main RealtimeMediaSource::applyConstraints virtual so that WebProcess source proxies can implement it by
        doing an IPC call directly. Doing so for UIProcess CoreAudioCaptureSource.

        Adding support for volume to CoreAudioCaptureSource by applying gain post-capturing.
        Adding support for toggling echo cancellation in CoreAudioCaptureSource.
        Adding support to change echo cancellation and sample rate by scheduling a reconfiguration of the audio unit.
        To do so, we stop producing data, delete the audio unit and restart producing data.
        Removing CoreAudioCaptureSource::supportedConstraints as it is redundant with
        RealtimeMediaSourceSettings::supportedConstraints.

        Setting sample rate only to the following values: 8000, 16000, 32000, 44100, 48000.

        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::applyConstraints):
        * platform/mediastream/MediaStreamTrackPrivate.cpp:
        (WebCore::MediaStreamTrackPrivate::applyConstraints):
        * platform/mediastream/MediaStreamTrackPrivate.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::applyConstraints):
        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/RealtimeMediaSourceSettings.h:
        (WebCore::RealtimeMediaSourceSettings::supportedConstraints):
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
        (WebCore::CoreAudioCaptureSource::processMicrophoneSamples):
        (WebCore::CoreAudioCaptureSource::cleanupAudioUnit):
        (WebCore::CoreAudioCaptureSource::createAudioUnit):
        (WebCore::CoreAudioCaptureSource::configureAudioUnit):
        (WebCore::CoreAudioCaptureSource::startProducingData):
        (WebCore::CoreAudioCaptureSource::capabilities):
        (WebCore::CoreAudioCaptureSource::settings):
        (WebCore::CoreAudioCaptureSource::applySampleRate):
        (WebCore::CoreAudioCaptureSource::applyEchoCancellation):
        (WebCore::CoreAudioCaptureSource::scheduleReconfiguration):
        (WebCore::CoreAudioCaptureSource::cleanupAudioUnits): Deleted.
        (WebCore::CoreAudioCaptureSource::setupAudioUnits): Deleted.
        * platform/mediastream/mac/CoreAudioCaptureSource.h:

2017-05-08  Chris Dumez  <cdumez@apple.com>

        Drop non-standard document.implementation.createCSSStyleSheet() API
        https://bugs.webkit.org/show_bug.cgi?id=171825

        Reviewed by Simon Fraser.

        Drop non-standard document.implementation.createCSSStyleSheet() API.

        This was never-implemented by Firefox and they actually rejected implementing it:
        - Drop non-standard document.implementation.createCSSStyleSheet() API

        Blink dropped this API back in 2014 after getting UseCounter data showing this was not used:
        - https://bugs.chromium.org/p/chromium/issues/detail?id=363561
        - https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/uDjkuGA9gQs/zytnzJ6WryYJ

        The API is not useful in its current state because even though
        document.implementation.createCSSStyleSheet() allows you to create a stylesheet, there is
        currently no way to associate it with the document.

        Test: fast/css/DOMImplementation.createCSSStyleSheet-obsolete.html

        * dom/DOMImplementation.idl:

2017-05-08  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: don't expose empty roledescription
        https://bugs.webkit.org/show_bug.cgi?id=163647

        Reviewed by Chris Fleizach.

        If the value of aria-roledescription is empty or contains only whitespace
        characters, ignore the value. Also strip out leading or trailing whitespace
        characters in the value.

        No new tests: We already had coverage for an empty aria-roledescription value.
        That test was updated to reflect the new behavior. New test cases were added
        to cover a value that contains only whitespace characters, and a value with
        leading and trailing whitespace characters.

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::roleDescription):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper roleDescription]):

2017-05-08  Chris Dumez  <cdumez@apple.com>

        Drop non-standard Element.scrollByLines() / scrollByPages()
        https://bugs.webkit.org/show_bug.cgi?id=171820

        Reviewed by Simon Fraser.

        Drop non-standard Element.scrollByLines() / scrollByPages().

        Those were added a very long time ago (https://trac.webkit.org/changeset/7901/webkit)
        for Safari RSS but does not seem to be used anymore.

        Blink has already dropped it without issue back in 2014:
        - https://bugs.chromium.org/p/chromium/issues/detail?id=398356

        Their UseCounter data showed no usage:
        - https://www.chromestatus.com/metrics/feature/timeline/popularity/390

        Test: fast/css/element-scrollByLines-scrollByPages-obsolete.html

        * dom/Element.idl:

2017-05-08  Youenn Fablet  <youenn@apple.com>

        CoreAudioSharedUnit should own its configuration parameters
        https://bugs.webkit.org/show_bug.cgi?id=171812

        Reviewed by Eric Carlson.

        Covered by manual tests.

        Add sampleRate, volume and echoCancellation parameters to the shared audio unit.
        Set default values when creating the shared audio unit and use those for the creation of new sources.
        Add support for volume.
        Add support for disabling echo cancellation.
        Check valid sample rates when trying to apply a sample rate.

        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioSharedUnit::volume):
        (WebCore::CoreAudioSharedUnit::sampleRate):
        (WebCore::CoreAudioSharedUnit::enableEchoCancellation):
        (WebCore::CoreAudioSharedUnit::setVolume):
        (WebCore::CoreAudioSharedUnit::setSampleRate):
        (WebCore::CoreAudioSharedUnit::setEnableEchoCancellation):
        (WebCore::CoreAudioSharedUnit::CoreAudioSharedUnit):
        (WebCore::CoreAudioSharedUnit::setupAudioUnits):
        (WebCore::CoreAudioSharedUnit::configureMicrophoneProc):
        (WebCore::CoreAudioSharedUnit::configureSpeakerProc):
        (WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
        (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
        (WebCore::CoreAudioCaptureSource::applySampleRate):
        (WebCore::CoreAudioCaptureSource::applyEchoCancellation):
        * platform/mediastream/mac/CoreAudioCaptureSource.h:

2017-05-08  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: Setting aria-orientation="horizontal" on a listbox is being overridden on the Mac
        https://bugs.webkit.org/show_bug.cgi?id=171821

        Reviewed by Chris Fleizach.

        The Mac's AccessibilityObject wrapper was unconditionally returning vertical
        as the orientation of listbox. Removing this override causes the author-specified
        value to be exposed, with the default/implicit orientation continuing to be vertical.

        No new tests. We already have coverage for the default/implicit orientation on a
        listbox. A new test case was added to aria-orientation.html so that we would have
        coverage for aria-orientation="horizontal" on a listbox.

        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

2017-05-08  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [CG] To decode an image frame asynchronously, pass the native size of the image to CGImageSourceCreateThumbnailAtIndex() if it's smaller than the sizeForDrawing
        https://bugs.webkit.org/show_bug.cgi?id=170864
 
        Reviewed by Simon Fraser.

        Tests: Existing tests were modified to test this patch.
 
        The maxPixelSize was omitted when calling CGImageSourceCreateThumbnailAtIndex()
        for the nativeSize image or when areaOf(nativeSize) < areaOf(sizeForDrawing).
        The assumption was if we don't pass maxPixelSize, CG will create an image with the
        nativeSize regardless how big this size is. It turns out this is wrong. CG has an
        optimization to return a scaled down image if areaOf(nativeSize) is greater than
        some maximum value.
 
        This is not what we want for asynchronously image decoding. We want the decoded
        frame to have the size we ask for, not some scaled down frame. The fix is to pass
        always maxPixelSize to CGImageSourceCreateThumbnailAtIndex(). maxPixelSize will be
        equal to maxDimension(sizeForDrawing) if sizeForDrawing is valid it is less than
        maxDimension(nativeSize). Otherwise it will be equal to maxDimension(nativeSize).

        * platform/graphics/DecodingOptions.h:
        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::appendImageSourceOption):
        (WebCore::appendImageSourceOptions):
        (WebCore::imageSourceAsyncOptions):
        (WebCore::ImageDecoder::createFrameImageAtIndex):

2017-05-08  Beth Dakin  <bdakin@apple.com>

        WebKit should default to using sRGB with NSColor conversion instead of device 
        color space
        https://bugs.webkit.org/show_bug.cgi?id=171745
        -and corresponding-
        rdar://problem/28314183

        Reviewed by Tim Horton.

        * platform/graphics/mac/ColorMac.mm:
        (WebCore::makeRGBAFromNSColor):
        (WebCore::nsColor):

2017-05-08  Alex Christensen  <achristensen@webkit.org>

        Reduce PassRefPtr use
        https://bugs.webkit.org/show_bug.cgi?id=171809

        Reviewed by Chris Dumez.

        * platform/graphics/ca/PlatformCALayer.cpp:
        (WebCore::PlatformCALayer::createCompatibleLayerOrTakeFromPool):
        * platform/graphics/ca/PlatformCALayer.h:
        * platform/graphics/ca/TileCoverageMap.cpp:
        (WebCore::TileCoverageMap::TileCoverageMap):
        * platform/graphics/ca/TileGrid.cpp:
        (WebCore::TileGrid::TileGrid):
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        (PlatformCALayerCocoa::create):
        (PlatformCALayerCocoa::clone):
        (PlatformCALayerCocoa::animationForKey):
        (PlatformCALayerCocoa::createCompatibleLayer):

2017-05-08  Jer Noble  <jer.noble@apple.com>

        [Mac] Audio capture fails when shouldCaptureAudioInUIProcess is set.
        https://bugs.webkit.org/show_bug.cgi?id=171710

        Reviewed by Eric Carlson.

        Both the shouldCaptureAudioInUIProcess setting and useAVFoundationAudioCapture setting were trying to set
        the audio factory for RealtimeMediaSourceCenter, and were stomping on each others' changes. Change the way
        the useAVFoundationAudioCapture works so that it only affects the defaultAudioFactory, allowing that default
        to be overridden by the shuoldCaptureAudioInUIProcess setting when it calls setAudioFactory().

        * page/Settings.cpp:
        (WebCore::Settings::setUseAVFoundationAudioCapture):
        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::audioFactory):
        (WebCore::RealtimeMediaSourceCenter::videoFactory):
        (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager):
        (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager):
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        (WebCore::RealtimeMediaSourceCenter::audioFactory): Deleted.
        (WebCore::RealtimeMediaSourceCenter::videoFactory): Deleted.
        (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager): Deleted.
        (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager): Deleted.
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture):
        (WebCore::RealtimeMediaSourceCenterMac::singleton):
        (WebCore::RealtimeMediaSourceCenter::platformCenter):
        (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
        (WebCore::RealtimeMediaSourceCenterMac::defaultAudioCaptureDeviceManager):
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:

2017-05-04  Jiewen Tan  <jiewen_tan@apple.com>

        Search events should not fire synchronously for search type input elements with incremental attribute set
        https://bugs.webkit.org/show_bug.cgi?id=171376
        <rdar://problem/31863296>

        Reviewed by Chris Dumez.

        For some reasons, we fire search events immediately for search type input elements with incremental
        attribute set only when the length of the input equals to zero. This behaviour should be prevented
        as event listeners in the middle might perform unexpectedly.

        Test: fast/forms/search/search-incremental-crash.html

        * html/SearchInputType.cpp:
        (WebCore::SearchInputType::startSearchEventTimer):

2017-05-08  Zalan Bujtas  <zalan@apple.com>

        Text overlaps on http://www.duden.de/rechtschreibung/Acre
        https://bugs.webkit.org/show_bug.cgi?id=171796
        <rdar://problem/31036028>

        Reviewed by Simon Fraser.

        Simple line layout pre-measures space using the primary font,
        even if the space glyph requires a fallback font (and even if the string does not have a space in it at all).
        When this width gets cached (see WidthCache) we might end up using it later during normal line layout and
        it could produce incorrect layout.
        This patch removes the space width caching from Simple line layout, since Font already caches it.

        Test: fast/text/simple-line-layout-fallback-space-glyph.html

        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::createLineRuns):
        * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
        (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
        (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
        (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
        * rendering/SimpleLineLayoutTextFragmentIterator.h:

2017-05-08  Chris Dumez  <cdumez@apple.com>

        Refactor ImageInputType::width() / height() for clarity
        https://bugs.webkit.org/show_bug.cgi?id=171810

        Reviewed by Zalan Bujtas.

        Refactor ImageInputType::width() / height() for clarity.

        * html/ImageInputType.cpp:
        (WebCore::ImageInputType::height):
        (WebCore::ImageInputType::width):

2017-05-08  Zalan Bujtas  <zalan@apple.com>

        Bail out of simple line layout when hyphen needs a fallback font.
        https://bugs.webkit.org/show_bug.cgi?id=171811

        Reviewed by Antti Koivisto.

        With hyphen: auto is set, we don't know if the hypen string is going to be used, until
        after we started laying out the content and figured that the text overflows the line.
        However it's too late to bail out of simple line layout at this point, so let's just
        pre-check if the hyphen string needs a fallback font.

        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::canUseForStyle):

2017-05-08  Youenn Fablet  <youenn@apple.com>

        TURNS gathering is not working properly
        https://bugs.webkit.org/show_bug.cgi?id=171747

        Reviewed by Eric Carlson.

        Covered by manual tests.

        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::configurationFromMediaEndpointConfiguration): Reveting TURNS ice server skipping.

2017-05-08  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, rolling out r216419.

        Broke 70 layout tests on GTK bot

        Reverted changeset:

        "Ensure clean tree before AX cache update."
        https://bugs.webkit.org/show_bug.cgi?id=171546
        http://trac.webkit.org/changeset/216419

2017-05-08  Youenn Fablet  <youenn@apple.com>

        CoreAudioCaptureSource should not modify its shared unit if already started/stopped
        https://bugs.webkit.org/show_bug.cgi?id=171804

        Reviewed by Jer Noble.

        Manual testing only since CoreAudioSharedUnit is not mocked.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::startProducingData): Exit early if source is already started.
        (WebCore::CoreAudioCaptureSource::stopProducingData): Exit early if source is already stopped.

2017-05-08  Antti Koivisto  <antti@apple.com>

        ComposedTreeIterator does not traverse all slotted children if the traversal root is a slot element.
        https://bugs.webkit.org/show_bug.cgi?id=171375
        <rdar://problem/31863184>

        Reviewed by Zalan Bujtas.

        We were hitting an assert when using details element with a flow thread. The root cause for this turned
        out to be that we only traversed the first slotted child if the traversal root was a slot element.

        Test: fast/html/details-flow-thread.html

        * dom/ComposedTreeIterator.cpp:
        (WebCore::ComposedTreeIterator::traverseNextLeavingContext):

            Try to traverse to the next slotted child before testing if we at the end of the current context.

2017-05-08  Mark Lam  <mark.lam@apple.com>

        Introduce ExceptionScope::assertNoException() and releaseAssertNoException().
        https://bugs.webkit.org/show_bug.cgi?id=171776

        Reviewed by Keith Miller.

        No new tests because there's no behavior change in functionality.  We're only
        refactoring the code to use the new assertion utility function.

        * Modules/plugins/QuickTimePluginReplacement.mm:
        (WebCore::QuickTimePluginReplacement::installReplacement):
        * bindings/js/JSCryptoKeySerializationJWK.cpp:
        (WebCore::getJSArrayFromJSON):
        (WebCore::getStringFromJSON):
        (WebCore::getBooleanFromJSON):
        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::JSCustomElementRegistry::whenDefined):
        * bindings/js/JSDOMExceptionHandling.cpp:
        (WebCore::propagateExceptionSlowPath):
        (WebCore::throwNotSupportedError):
        (WebCore::throwInvalidStateError):
        (WebCore::throwSecurityError):
        (WebCore::throwDOMSyntaxError):
        (WebCore::throwDataCloneError):
        (WebCore::throwIndexSizeError):
        (WebCore::throwTypeMismatchError):
        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::makeThisTypeErrorForBuiltins):
        (WebCore::makeGetterTypeErrorForBuiltins):
        * bindings/js/JSDOMGlobalObjectTask.cpp:
        * bindings/js/JSDOMPromise.h:
        (WebCore::callPromiseFunction):
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowMicrotaskCallback::call):
        * bindings/js/JSMainThreadExecState.h:
        (WebCore::JSMainThreadExecState::~JSMainThreadExecState):
        * bindings/js/ReadableStreamDefaultController.cpp:
        (WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked):
        * bindings/js/ReadableStreamDefaultController.h:
        (WebCore::ReadableStreamDefaultController::enqueue):
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneDeserializer::readTerminal):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateSerializerFunction):
        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::JSTestNode::serialize):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::JSTestObj::serialize):
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        (WebCore::JSTestSerialization::serialize):
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        (WebCore::JSTestSerializationInherit::serialize):
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        (WebCore::JSTestSerializationInheritFinal::serialize):
        * contentextensions/ContentExtensionParser.cpp:
        (WebCore::ContentExtensions::getTypeFlags):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
        (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
        (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):

2017-05-08  Chris Dumez  <cdumez@apple.com>

        Move 'style' from Element to HTMLElement / SVGElement and make it settable
        https://bugs.webkit.org/show_bug.cgi?id=171795

        Reviewed by Alex Christensen.

        Move 'style' from Element to HTMLElement / SVGElement and make it settable
        as per:
        - https://drafts.csswg.org/cssom/#the-elementcssinlinestyle-interface

        Both Firefox and Chrome already match the specification (both for the
        property location and having it settable).

        Test: fast/css/Element-style.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * css/ElementCSSInlineStyle.idl: Added.
        * css/PropertySetCSSStyleDeclaration.h:
        * css/StyleProperties.cpp:
        (WebCore::MutableStyleProperties::ensureCSSStyleDeclaration):
        (WebCore::MutableStyleProperties::ensureInlineCSSStyleDeclaration):
        * css/StyleProperties.h:
        * dom/Attr.cpp:
        (WebCore::Attr::style):
        * dom/Document.cpp:
        (WebCore::Document::createCSSStyleDeclaration):
        * dom/Element.cpp:
        * dom/Element.h:
        * dom/Element.idl:
        * dom/StyledElement.cpp:
        (WebCore::StyledElement::cssomStyle):
        * dom/StyledElement.h:
        * editing/Editor.cpp:
        (WebCore::Editor::applyEditingStyleToElement):
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
        * html/HTMLElement.idl:

        * html/ImageInputType.cpp:
        (WebCore::ImageInputType::height):
        (WebCore::ImageInputType::width):
        Fix bug that was found by fast/forms/input-width-height-attributes-without-renderer-loaded-image.html.
        That test relied on setting HTMLElement.style which did not work until now. Call updateLayout()
        *before* doing the renderer check.

        * inspector/InspectorCSSAgent.cpp:
        (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
        (WebCore::InspectorCSSAgent::getInlineStylesForNode):
        (WebCore::InspectorCSSAgent::getComputedStyleForNode):
        (WebCore::InspectorCSSAgent::asInspectorStyleSheet):
        (WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
        * inspector/InspectorCSSAgent.h:
        * inspector/InspectorStyleSheet.cpp:
        (WebCore::InspectorStyle::create):
        (WebCore::InspectorStyle::InspectorStyle):
        (WebCore::InspectorStyle::extractSourceData):
        (WebCore::InspectorStyle::setText):
        (WebCore::InspectorStyleSheet::inspectorStyleForId):
        (WebCore::InspectorStyleSheetForInlineStyle::create):
        (WebCore::InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle):
        (WebCore::InspectorStyleSheetForInlineStyle::didModifyElementAttribute):
        (WebCore::InspectorStyleSheetForInlineStyle::setStyleText):
        (WebCore::InspectorStyleSheetForInlineStyle::ensureParsedDataReady):
        (WebCore::InspectorStyleSheetForInlineStyle::inlineStyle):
        * inspector/InspectorStyleSheet.h:
        * svg/SVGElement.idl:

2017-05-08  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: Propagate aria-readonly to grid descendants
        https://bugs.webkit.org/show_bug.cgi?id=171189

        Reviewed by Chris Fleizach.

        Propagate aria-readonly to grid descendants if the property is not
        explicitly set on the descendant.

        Test: accessibility/gtk/aria-readonly-propagated.html
              Additional test cases also added to accessibility/aria-readonly.html

        * accessibility/AccessibilityARIAGridCell.cpp:
        (WebCore::AccessibilityARIAGridCell::ariaReadOnlyValue):
        * accessibility/AccessibilityARIAGridCell.h:
        * accessibility/AccessibilityObject.h:

2017-05-06  Zalan Bujtas  <zalan@apple.com>

        Ensure clean tree before AX cache update.
        https://bugs.webkit.org/show_bug.cgi?id=171546
        <rdar://problem/31934942>

        While updating an accessibility object state, we might
        perform unintentional style updates. This style update could
        end up destroying renderes that are still referenced by function calls 
        on the callstack.
        To avoid that, AXObjectCache should operate on a clean tree only. 

        Reviewed by Chris Fleizach.

        Test: accessibility/crash-when-render-tree-is-not-clean.html

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::checkedStateChanged):
        (WebCore::AXObjectCache::selectedChildrenChanged):
        (WebCore::AXObjectCache::handleAriaExpandedChange):
        (WebCore::AXObjectCache::handleActiveDescendantChanged):
        (WebCore::AXObjectCache::handleAriaRoleChanged):
        (WebCore::AXObjectCache::handleAttributeChanged):
        (WebCore::AXObjectCache::handleAriaModalChange):
        (WebCore::AXObjectCache::labelChanged):
        * accessibility/AXObjectCache.h:
        (WebCore::AXObjectCache::checkedStateChanged):
        (WebCore::AXObjectCache::handleActiveDescendantChanged):
        (WebCore::AXObjectCache::handleAriaExpandedChange):
        (WebCore::AXObjectCache::handleAriaRoleChanged):
        (WebCore::AXObjectCache::handleAriaModalChange):
        (WebCore::AXObjectCache::handleAttributeChanged):
        (WebCore::AXObjectCache::selectedChildrenChanged):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):
        * dom/Element.cpp:
        (WebCore::Element::attributeChanged):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::setChecked):

2017-05-08  Myles C. Maxfield  <mmaxfield@apple.com>

        Unprefix unicode-bidi CSS values
        https://bugs.webkit.org/show_bug.cgi?id=171761

        Reviewed by Simon Fraser.

        Create new values which parse to the same internal state as the
        prefixed values.

        Tests: fast/text/bidi-unprefix.html
               imported/w3c/i18n/bidi/bidi-embed-001.html
               imported/w3c/i18n/bidi/bidi-embed-002.html
               imported/w3c/i18n/bidi/bidi-embed-003.html
               imported/w3c/i18n/bidi/bidi-embed-004.html
               imported/w3c/i18n/bidi/bidi-embed-005.html
               imported/w3c/i18n/bidi/bidi-embed-006.html
               imported/w3c/i18n/bidi/bidi-embed-007.html
               imported/w3c/i18n/bidi/bidi-embed-008.html
               imported/w3c/i18n/bidi/bidi-embed-009.html
               imported/w3c/i18n/bidi/bidi-embed-010.html
               imported/w3c/i18n/bidi/bidi-embed-011.html
               imported/w3c/i18n/bidi/bidi-isolate-001.html
               imported/w3c/i18n/bidi/bidi-isolate-002.html
               imported/w3c/i18n/bidi/bidi-isolate-003.html
               imported/w3c/i18n/bidi/bidi-isolate-004.html
               imported/w3c/i18n/bidi/bidi-isolate-005.html
               imported/w3c/i18n/bidi/bidi-isolate-006.html
               imported/w3c/i18n/bidi/bidi-isolate-007.html
               imported/w3c/i18n/bidi/bidi-isolate-008.html
               imported/w3c/i18n/bidi/bidi-isolate-009.html
               imported/w3c/i18n/bidi/bidi-isolate-010.html
               imported/w3c/i18n/bidi/bidi-isolate-011.html
               imported/w3c/i18n/bidi/bidi-isolate-override-001.html
               imported/w3c/i18n/bidi/bidi-isolate-override-002.html
               imported/w3c/i18n/bidi/bidi-isolate-override-003.html
               imported/w3c/i18n/bidi/bidi-isolate-override-004.html
               imported/w3c/i18n/bidi/bidi-isolate-override-005.html
               imported/w3c/i18n/bidi/bidi-isolate-override-006.html
               imported/w3c/i18n/bidi/bidi-isolate-override-007.html
               imported/w3c/i18n/bidi/bidi-isolate-override-008.html
               imported/w3c/i18n/bidi/bidi-isolate-override-009.html
               imported/w3c/i18n/bidi/bidi-isolate-override-010.html
               imported/w3c/i18n/bidi/bidi-isolate-override-011.html
               imported/w3c/i18n/bidi/bidi-isolate-override-012.html
               imported/w3c/i18n/bidi/bidi-normal-001.html
               imported/w3c/i18n/bidi/bidi-normal-002.html
               imported/w3c/i18n/bidi/bidi-normal-003.html
               imported/w3c/i18n/bidi/bidi-normal-004.html
               imported/w3c/i18n/bidi/bidi-normal-005.html
               imported/w3c/i18n/bidi/bidi-normal-006.html
               imported/w3c/i18n/bidi/bidi-normal-007.html
               imported/w3c/i18n/bidi/bidi-normal-008.html
               imported/w3c/i18n/bidi/bidi-normal-009.html
               imported/w3c/i18n/bidi/bidi-normal-010.html
               imported/w3c/i18n/bidi/bidi-normal-011.html
               imported/w3c/i18n/bidi/bidi-override-001.html
               imported/w3c/i18n/bidi/bidi-override-002.html
               imported/w3c/i18n/bidi/bidi-override-003.html
               imported/w3c/i18n/bidi/bidi-override-004.html
               imported/w3c/i18n/bidi/bidi-override-005.html
               imported/w3c/i18n/bidi/bidi-override-006.html
               imported/w3c/i18n/bidi/bidi-override-007.html
               imported/w3c/i18n/bidi/bidi-override-008.html
               imported/w3c/i18n/bidi/bidi-override-009.html
               imported/w3c/i18n/bidi/bidi-override-010.html
               imported/w3c/i18n/bidi/bidi-override-011.html
               imported/w3c/i18n/bidi/bidi-override-012.html
               imported/w3c/i18n/bidi/bidi-plaintext-001.html
               imported/w3c/i18n/bidi/bidi-plaintext-003.html
               imported/w3c/i18n/bidi/bidi-plaintext-005.html
               imported/w3c/i18n/bidi/bidi-plaintext-006.html
               imported/w3c/i18n/bidi/bidi-plaintext-007.html
               imported/w3c/i18n/bidi/bidi-plaintext-008.html
               imported/w3c/i18n/bidi/bidi-plaintext-009.html
               imported/w3c/i18n/bidi/bidi-plaintext-010.html
               imported/w3c/i18n/bidi/bidi-plaintext-011.html
               imported/w3c/i18n/bidi/bidi-table-001.html
               imported/w3c/i18n/bidi/bidi-unset-001.html
               imported/w3c/i18n/bidi/bidi-unset-002.html
               imported/w3c/i18n/bidi/bidi-unset-003.html
               imported/w3c/i18n/bidi/bidi-unset-004.html
               imported/w3c/i18n/bidi/bidi-unset-005.html
               imported/w3c/i18n/bidi/bidi-unset-006.html
               imported/w3c/i18n/bidi/bidi-unset-007.html
               imported/w3c/i18n/bidi/bidi-unset-008.html
               imported/w3c/i18n/bidi/bidi-unset-009.html
               imported/w3c/i18n/bidi/bidi-unset-010.html
               imported/w3c/i18n/bidi/block-embed-001.html
               imported/w3c/i18n/bidi/block-embed-002.html
               imported/w3c/i18n/bidi/block-embed-003.html
               imported/w3c/i18n/bidi/block-override-001.html
               imported/w3c/i18n/bidi/block-override-002.html
               imported/w3c/i18n/bidi/block-override-003.html
               imported/w3c/i18n/bidi/block-override-004.html
               imported/w3c/i18n/bidi/block-override-isolate-001.html
               imported/w3c/i18n/bidi/block-override-isolate-002.html
               imported/w3c/i18n/bidi/block-override-isolate-003.html
               imported/w3c/i18n/bidi/block-override-isolate-004.html
               imported/w3c/i18n/bidi/block-plaintext-001.html
               imported/w3c/i18n/bidi/block-plaintext-002.html
               imported/w3c/i18n/bidi/block-plaintext-003.html
               imported/w3c/i18n/bidi/block-plaintext-004.html
               imported/w3c/i18n/bidi/block-plaintext-005.html
               imported/w3c/i18n/bidi/block-plaintext-006.html

        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator EUnicodeBidi):
        * css/CSSProperties.json:
        * css/CSSValueKeywords.in:
        * css/html.css:
        (bdi, output):
        * css/parser/CSSParserFastPaths.cpp:
        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
        * html/HTMLElement.cpp:
        (WebCore::unicodeBidiAttributeForDirAuto):
        * html/track/TextTrackCueGeneric.cpp:
        (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
        * html/track/VTTCue.cpp:
        (WebCore::VTTCueBox::applyCSSProperties):

2017-05-07  Ben Kelly  <ben@wanderview.com>

        Set the Response.blob() type based on the content-type header value.
        https://bugs.webkit.org/show_bug.cgi?id=170849

        Reviewed by Youenn Fablet.

        There are two problems to fix here:

        1.  Currently the FetchResponse class only called updateContentType()
        when first created even though all the headers were not available.  This
        patch calls updateContentType() again after the headers are populated.

        2.  The fetch design requires propagating the normalized blob
        type to FetchBodyConsumer as well.  Currently this is only done if
        Response.blob() is called after the body is completely loaded.  If
        we hit the consumeOnceLoadingFinished() path, then the type is not
        passed.  This is similar to what was happening in bug 171489 with
        ReadableStream bodies.  This patch sets the type on the
        FetchBodyConsumer in consumeOnceLoadingFinished() as well.

        Theses changes allow WebKit to pass the "Consume response's body: from
        fetch to blob" case in the WPT response-consume.html test.

        Test: http://w3c-test.org/fetch/api/response/response-consume.html

        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Modified to
        call FetchBodyOwner::updateContentType() after filling m_headers.
        (WebCore::FetchBody::consumeOnceLoadingFinished): Call
        FetchBodyConsumer::setContentType() when being consumed as
        a blob.
        * Modules/fetch/FetchBody.h: Modify consumeOnceLoadingFinished()
        to take the content type string.
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::consumeOnceLoadingFinished): Pass
        the content type string down to FetchBody so it can be
        propagated to the FetchBodyConsumer.

2017-05-07  Simon Fraser  <simon.fraser@apple.com>

        [iOS] REGRESSION (r209409): getBoundingClientRect is wrong for fixed-position elements in resize/orientationchange
        https://bugs.webkit.org/show_bug.cgi?id=171140

        Reviewed by Sam Weinig.

        WebPage::dynamicViewportSizeUpdate() is called during rotation, and does a layout which needs to have
        an up-to-date layout viewport, since the layout viewport state is detectable in orientationchange and
        resize events via fetching the client rect of fixed elements. Normally we send in the layout viewport
        from the UI process, but in this case we need to compute one in the web process. So factor code
        into FrameView to do the computation, called from both places.

        Tests: fast/events/ios/rotation/layout-viewport-during-rotation.html
               fast/events/ios/rotation/layout-viewport-during-safari-type-rotation.html

        * page/FrameView.cpp:
        (WebCore::FrameView::computeUpdatedLayoutViewportRect):
        * page/FrameView.h:

2017-05-07  Chris Dumez  <cdumez@apple.com>

        Drop remaining uses of PassRefPtr in editing code
        https://bugs.webkit.org/show_bug.cgi?id=171787

        Reviewed by Darin Adler.

        Drop remaining uses of PassRefPtr in editing code.

        * editing/AlternativeTextController.cpp:
        (WebCore::AlternativeTextController::timerFired):
        * editing/ApplyStyleCommand.cpp:
        (WebCore::toIdentifier):
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::didApplyCommand):
        (WebCore::CompositeEditCommand::moveParagraphs):
        * editing/CompositeEditCommand.h:
        * editing/Editor.cpp:
        (WebCore::Editor::shouldInsertFragment):
        (WebCore::Editor::replaceSelectionWithFragment):
        (WebCore::Editor::appliedEditing):
        (WebCore::Editor::performCutOrCopy):
        (WebCore::Editor::willWriteSelectionToPasteboard):
        (WebCore::Editor::advanceToNextMisspelling):
        (WebCore::Editor::isSelectionUngrammatical):
        (WebCore::Editor::guessesForMisspelledOrUngrammatical):
        (WebCore::Editor::markMisspellingsOrBadGrammar):
        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
        (WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
        (WebCore::Editor::markAndReplaceFor):
        (WebCore::Editor::changeBackToReplacedString):
        * editing/Editor.h:
        * editing/EditorCommand.cpp:
        (WebCore::executeInsertFragment):
        (WebCore::Editor::command):
        (WebCore::Editor::Command::Command):
        * editing/FormatBlockCommand.cpp:
        (WebCore::FormatBlockCommand::formatRange):
        * editing/IndentOutdentCommand.cpp:
        (WebCore::IndentOutdentCommand::indentIntoBlockquote):
        (WebCore::IndentOutdentCommand::outdentParagraph):
        * editing/InsertListCommand.cpp:
        (WebCore::InsertListCommand::fixOrphanedListChild):
        (WebCore::InsertListCommand::mergeWithNeighboringLists):
        (WebCore::InsertListCommand::doApplyForSingleParagraph):
        (WebCore::InsertListCommand::unlistifyParagraph):
        (WebCore::InsertListCommand::listifyParagraph):
        * editing/InsertListCommand.h:
        * editing/InsertParagraphSeparatorCommand.cpp:
        (WebCore::InsertParagraphSeparatorCommand::doApply):
        * editing/InsertTextCommand.cpp:
        (WebCore::InsertTextCommand::InsertTextCommand):
        * editing/InsertTextCommand.h:
        (WebCore::InsertTextCommand::createWithMarkerSupplier):
        * editing/MoveSelectionCommand.cpp:
        (WebCore::MoveSelectionCommand::MoveSelectionCommand):
        * editing/MoveSelectionCommand.h:
        (WebCore::MoveSelectionCommand::create):
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplacementFragment::removeNodePreservingChildren):
        (WebCore::ReplacementFragment::removeNode):
        (WebCore::ReplacementFragment::insertNodeBefore):
        (WebCore::ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment):
        (WebCore::ReplacementFragment::removeUnrenderedNodes):
        (WebCore::ReplacementFragment::removeInterchangeNodes):
        (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
        (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
        (WebCore::removeHeadContents):
        (WebCore::ReplaceSelectionCommand::doApply):
        (WebCore::ReplaceSelectionCommand::insertAsListItems):
        * editing/ReplaceSelectionCommand.h:
        * editing/SpellChecker.cpp:
        (WebCore::SpellCheckRequest::SpellCheckRequest):
        (WebCore::SpellCheckRequest::create):
        (WebCore::SpellChecker::canCheckAsynchronously):
        (WebCore::SpellChecker::isCheckable):
        (WebCore::SpellChecker::requestCheckingFor):
        (WebCore::SpellChecker::invokeRequest):
        (WebCore::SpellChecker::enqueueRequest):
        (WebCore::SpellChecker::didCheck):
        * editing/SpellChecker.h:
        (WebCore::SpellCheckRequest::checkingRange):
        (WebCore::SpellCheckRequest::paragraphRange):
        * editing/TextCheckingHelper.cpp:
        (WebCore::expandToParagraphBoundary):
        (WebCore::TextCheckingParagraph::TextCheckingParagraph):
        (WebCore::TextCheckingParagraph::expandRangeToNextEnd):
        (WebCore::TextCheckingParagraph::rangeLength):
        (WebCore::TextCheckingParagraph::paragraphRange):
        (WebCore::TextCheckingParagraph::subrange):
        (WebCore::TextCheckingParagraph::offsetTo):
        (WebCore::TextCheckingParagraph::offsetAsRange):
        (WebCore::TextCheckingParagraph::text):
        (WebCore::TextCheckingParagraph::checkingStart):
        (WebCore::TextCheckingParagraph::checkingEnd):
        (WebCore::TextCheckingParagraph::checkingLength):
        (WebCore::TextCheckingHelper::TextCheckingHelper):
        (WebCore::TextCheckingHelper::findFirstMisspelling):
        (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
        (WebCore::TextCheckingHelper::findFirstGrammarDetail):
        (WebCore::TextCheckingHelper::findFirstBadGrammar):
        (WebCore::TextCheckingHelper::isUngrammatical):
        (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
        (WebCore::TextCheckingHelper::unifiedTextCheckerEnabled):
        * editing/TextCheckingHelper.h:
        * editing/TypingCommand.cpp:
        (WebCore::TypingCommand::typingAddedToOpenCommand):
        * editing/cocoa/EditorCocoa.mm:
        (WebCore::Editor::replaceSelectionWithAttributedString):
        * editing/gtk/EditorGtk.cpp:
        (WebCore::Editor::pasteWithPasteboard):
        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::pasteWithPasteboard):
        * editing/mac/EditorMac.mm:
        (WebCore::Editor::pasteWithPasteboard):
        (WebCore::Editor::replaceNodeFromPasteboard):
        * editing/win/EditorWin.cpp:
        (WebCore::Editor::pasteWithPasteboard):
        (WebCore::createFragmentFromPlatformData):
        * page/DragController.cpp:
        (WebCore::DragController::concludeEditDrag):
        (WebCore::DragController::startDrag):

2017-05-07  Youenn Fablet  <youenn@apple.com>

        [MediaStream] r216197 caused some webrtc tests to fail
        https://bugs.webkit.org/show_bug.cgi?id=171728

        Reviewed by Eric Carlson.

        Covered by existing tests.

        Rename MediaStream::endStream to MediaStream::endCaptureTracks and only stopping capture tracks.
        Using it when Document is asked to stop media capture.

        Adding the ability to have only one active capture source at a time in a WebProcess.
        This is done by keeping in its related factory the active capture source.
        When a new source is created and started, it replaces the active capture source which becomes muted.
        Using that mechanism for iOS.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::endCaptureTracks):
        (WebCore::MediaStream::endStream): Deleted.
        * Modules/mediastream/MediaStream.h:
        * Modules/mediastream/MediaStreamTrack.h:
        (WebCore::MediaStreamTrack::isCaptureTrack):
        * dom/Document.cpp:
        (WebCore::Document::stopMediaCapture):
        * platform/mediastream/mac/AVAudioCaptureSource.mm:
        (WebCore::AVAudioCaptureSourceFactory::setActiveSource):
        (WebCore::AVAudioCaptureSource::setupCaptureSession):
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSourceFactory::setActiveSource):
        (WebCore::AVVideoCaptureSource::setupCaptureSession):
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSourceFactory::setActiveSource):
        (WebCore::CoreAudioSharedUnit::startProducingData):

2017-05-07  Tim Horton  <timothy_horton@apple.com>

        Clean up some WebProcessProxy, WebPage, and message handler includes
        https://bugs.webkit.org/show_bug.cgi?id=171791

        Reviewed by Sam Weinig.

        * WebCore.xcodeproj/project.pbxproj:
        * editing/CompositionUnderline.h: Added.
        (WebCore::CompositionUnderline::CompositionUnderline):
        * editing/Editor.h:
        (WebCore::CompositionUnderline::CompositionUnderline): Deleted.
        Move CompositionUnderline out of Editor.h, so that other files can
        include that without Editor.h (which is quite large). Also, modernize it slightly.

2017-05-07  Sam Weinig  <sam@webkit.org>

        Implement Subresource Integrity (SRI)
        https://bugs.webkit.org/show_bug.cgi?id=148363
        <rdar://problem/18945879>

        Reviewed by Daniel Bates.

        Tests: http/tests/subresource-integrity/sri-disabled-with-setting.html
               http/tests/subresource-integrity/sri-enabled-with-setting.html
               http/tests/subresource-integrity/sri-script-cors.html
               http/tests/subresource-integrity/sri-style-cors.html

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        Add new files.

        * dom/LoadableClassicScript.cpp:
        (WebCore::LoadableClassicScript::create):
        (WebCore::LoadableClassicScript::notifyFinished):
        * dom/LoadableClassicScript.h:
        * dom/LoadableScript.h:
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::requestClassicScript):
        Store integrity metadata in the script fetcher so it can be passed to
        the checked when script load finishes.

        * html/HTMLAttributeNames.in:
        Add 'integrity'.

        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::process):
        When requesting a stylesheet, cache the integrity metadata so it can
        be used when the load completes (accessing the attribute at load completion
        time is incorrect, as a script might have changed the attributes value since
        the request was made).

        (WebCore::HTMLLinkElement::setCSSStyleSheet):
        Add an integrity check using the cached integrity metadata when a load
        finishes.

        * html/HTMLLinkElement.h:
        Add cached integrity metadata member.

        * html/HTMLLinkElement.idl:
        * html/HTMLScriptElement.idl:
        Add integrity property.

        * html/parser/HTMLParserIdioms.h:
        (WebCore::isNotHTMLSpace):
        Templatize isNotHTMLSpace so it can work for both UChar and LChar.

        * loader/ResourceCryptographicDigest.cpp:
        (WebCore::parseCryptographicDigestImpl):
        (WebCore::parseEncodedCryptographicDigestImpl):
        (WebCore::parseEncodedCryptographicDigest):
        (WebCore::decodeEncodedResourceCryptographicDigest):
        * loader/ResourceCryptographicDigest.h:
        Add concept of an encoded digest to more closely model the spec so that hashes
        that match the grammar but are invalid (say, mixing base64 and base64URL) make
        it through the algorithm longer, and don't cause us to load something that should
        be blocked.

        * loader/SubresourceIntegrity.cpp: Added.
        * loader/SubresourceIntegrity.h: Added.
        Add implementation of Subresource Integrity metadata validation allowing
        for a CachedResource and integrity metadata to be passed for validation.

        * page/Settings.in:
        Add setting for Subresource Integrity, defaulted to enabled.

2017-05-07  Michael Catanzaro  <mcatanzaro@igalia.com>

        [GTK] Cannot sign in with new Google sign-in page
        https://bugs.webkit.org/show_bug.cgi?id=171770

        Reviewed by Carlos Garcia Campos.

        Google's new authentication page does not work with the Firefox user
        agent that's required to make various Google websites work. Special-case
        accounts.google.com so that it receives our standard user agent.

        * platform/UserAgentQuirks.cpp:
        (WebCore::isGoogle):
        (WebCore::urlRequiresFirefoxBrowser):

2017-05-06  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
        https://bugs.webkit.org/show_bug.cgi?id=171636
        <rdar://problem/30811218>

        Reviewed by Dean Jackson.

        LastResort is the only name which needs to be looked up case-sensitively. We can handle
        this in our existing function which handles special font names (like -apple-system) to
        make sure that we always do the right thing.

        Test: fast/text/lastResort.html

        * platform/graphics/ios/FontCacheIOS.mm:
        (WebCore::platformFontWithFamilySpecialCase):
        * platform/graphics/mac/FontCacheMac.mm:
        (WebCore::platformFontWithFamilySpecialCase):
        * platform/spi/cocoa/CoreTextSPI.h:

2017-05-06  Chris Dumez  <cdumez@apple.com>

        Implement the concept of cookie-averse document
        https://bugs.webkit.org/show_bug.cgi?id=171746
        <rdar://problem/32004466>

        Reviewed by Sam Weinig.

        Implement the concept of cookie-averse document:
        - https://html.spec.whatwg.org/#cookie-averse-document-object

        Test: fast/cookies/cookie-averse-document.html

        * dom/Document.cpp:
        (WebCore::Document::isCookieAverse):
        (WebCore::Document::cookie):
        (WebCore::Document::setCookie):
        * dom/Document.h:

2017-05-06  Chris Dumez  <cdumez@apple.com>

        Unreviewed build fix after r216339.

        * dom/Document.h:
        (WebCore::Document::readyState):

2017-05-06  Chris Dumez  <cdumez@apple.com>

        Align our IDL files with the latest DOM specification
        https://bugs.webkit.org/show_bug.cgi?id=171777

        Reviewed by Sam Weinig.

        Align our IDL files with the latest DOM specification:
        - https://dom.spec.whatwg.org

        No Web-facing behavior change. Things that do not match the specification
        have been annotated with FIXME comments.

        * dom/CharacterData.idl:
        * dom/Comment.idl:
        * dom/CustomEvent.idl:
        * dom/DOMImplementation.idl:
        * dom/Document.cpp:
        * dom/Document.h:
        (WebCore::Document::readyState):
        * dom/Document.idl:
        * dom/MutationObserver.idl:
        * dom/NamedNodeMap.idl:
        * dom/NodeFilter.idl:
        * dom/NodeIterator.idl:
        * dom/NodeList.idl:
        * dom/NonDocumentTypeChildNode.idl:
        * dom/ParentNode.idl:
        * dom/ProcessingInstruction.idl:
        * dom/Range.idl:
        * dom/ShadowRoot.idl:
        * dom/Text.idl:
        * dom/TreeWalker.idl:
        * html/DOMTokenList.idl:

2017-05-06  Tim Horton  <timothy_horton@apple.com>

        Reduce the number of includes in WebPage.h and WebProcess.h
        https://bugs.webkit.org/show_bug.cgi?id=171779

        Reviewed by Sam Weinig.

        * page/TextIndicator.h:

2017-05-06  Alexey Proskuryakov  <ap@apple.com>

        REGRESSION (r216294): The new test fails on WebKit1
        https://bugs.webkit.org/show_bug.cgi?id=171780

        Rolling back https://trac.webkit.org/r216294, https://trac.webkit.org/r216296,
        https://trac.webkit.org/216299, https://trac.webkit.org/216330

        * page/FrameView.cpp:
        (WebCore::FrameView::paintContents):
        * page/FrameView.h:
        * platform/ScrollView.cpp:
        (WebCore::ScrollView::paint):
        * platform/ScrollView.h:
        * platform/Scrollbar.cpp:
        (WebCore::Scrollbar::paint):
        * platform/Scrollbar.h:
        * platform/Widget.h:
        * platform/graphics/filters/FilterOperation.h:
        (WebCore::FilterOperation::movesPixels):
        (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin): Deleted.
        * platform/graphics/filters/FilterOperations.cpp:
        (WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin): Deleted.
        * platform/graphics/filters/FilterOperations.h:
        * platform/gtk/WidgetGtk.cpp:
        (WebCore::Widget::paint):
        * platform/ios/WidgetIOS.mm:
        (WebCore::Widget::paint):
        * platform/mac/WidgetMac.mm:
        (WebCore::Widget::paint):
        * platform/win/WidgetWin.cpp:
        (WebCore::Widget::paint):
        * rendering/FilterEffectRenderer.cpp:
        (WebCore::FilterEffectRenderer::build):
        * rendering/FilterEffectRenderer.h:
        * rendering/PaintInfo.h:
        (WebCore::PaintInfo::PaintInfo):
        (): Deleted.
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paint):
        (WebCore::RenderLayer::setupFilters):
        (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
        * rendering/RenderLayer.h:
        * rendering/RenderScrollbar.cpp:
        (WebCore::RenderScrollbar::paint):
        * rendering/RenderScrollbar.h:
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::paintContents):

2017-05-06  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r216333.

        Caused layout test failures

        Reverted changeset:

        "Implement the concept of cookie-averse document"
        https://bugs.webkit.org/show_bug.cgi?id=171746
        http://trac.webkit.org/changeset/216333

2017-05-06  Chris Dumez  <cdumez@apple.com>

        Implement the concept of cookie-averse document
        https://bugs.webkit.org/show_bug.cgi?id=171746
        <rdar://problem/32004466>

        Reviewed by Sam Weinig.

        Implement the concept of cookie-averse document:
        - https://html.spec.whatwg.org/#cookie-averse-document-object

        Test: fast/cookies/cookie-averse-document.html

        * dom/Document.cpp:
        (WebCore::Document::isCookieAverse):
        (WebCore::Document::cookie):
        (WebCore::Document::setCookie):
        * dom/Document.h:

2017-05-06  Myles C. Maxfield  <mmaxfield@apple.com>

        REGERSSION(r213499): Emoji with Fitzpatrick modifiers are drawn as two separate glyphs
        https://bugs.webkit.org/show_bug.cgi?id=171750
        <rdar://problem/31122612>

        Reviewed by Zalan Bujtas.

        Emoji with Fitzpatrick modifiers need to take our complex text codepath. When looking through
        the string to determine which code path to use, we ask if a particular codepoint is an emoji
        group candidate. r213499 expanded the set of these candidates to include Fitzpatrick modifiers,
        which means the next "if" statement would never be hit. Instead, we should check that "if"
        statement first (because order is not important here). The next checks do not intersect with
        any emoji group candidates.

        Test: fast/text/fitzpatrick-combination.html

        * platform/graphics/FontCascade.cpp:
        (WebCore::FontCascade::characterRangeCodePath):

2017-05-06  Youenn Fablet  <youenn@apple.com>

        RealtimeMediaSourceCenter callbacks should be passed as r-values
        https://bugs.webkit.org/show_bug.cgi?id=171407

        Reviewed by Eric Carlson.

        No change of behavior, this is mostly style here.

        * platform/mediastream/RealtimeMediaSourceCenter.h:
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
        (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
        (WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
        (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
        (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
        * platform/mock/MockRealtimeMediaSourceCenter.h:

2017-05-05  Zalan Bujtas  <zalan@apple.com>

        Renderers being destroyed should not be added to AX's deferred list.
        https://bugs.webkit.org/show_bug.cgi?id=171768
        <rdar://problem/31955660>

        Reviewed by Simon Fraser.

        In certain cases, when custom scrollbars are present, while destroying the scrollbars' block parent, we
          - first remove the block from the AX's deferred list (AXObjectCache::remove)
          - destroy the render layer that owns the custom scrollbars (RenderLayer::destroyLayer) 
          - detach the scrollbars from the parent (block) (RenderObject::removeFromParent)
            - clean up the block's lines (RenderBlock::deleteLines)
              - push the block back to the AX's deferred list (AXObjectCache::recomputeDeferredIsIgnored)
        At this point no one will remove the current block from AX's deferred list.

        Test: accessibility/crash-when-renderers-are-added-back-to-deferred-list.html

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::recomputeDeferredIsIgnored):
        (WebCore::AXObjectCache::deferTextChanged):

2017-05-05  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Crash in ImageFrameCache::decodedSizeChanged() after image load cancellation
        https://bugs.webkit.org/show_bug.cgi?id=171736

        Reviewed by Tim Horton.

        Tests: Covered by run-webkit-tests fast/images/image-formats-support.html
        --guard-malloc.

        Because an image format is not supported, the ImageObserver of the Image
        is deleted then the Image itself is deleted. In BitmapImage destructor,
        we make a call which ends up accessing the deleted ImageObserver.

        To fix this, we need to change the BitImage destructor to avoid calling 
        ImageFrameCache::decodedSizeChanged() since it is not really needed.

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::~BitmapImage):

2017-05-05  Timothy Horton  <timothy_horton@apple.com>

        [Mac] Adjust cursor position for dragged link (and stop it from moving based on how fast you are dragging)
        https://bugs.webkit.org/show_bug.cgi?id=171764
        <rdar://problem/32005865>

        Reviewed by Simon Fraser.

        * page/DragController.cpp:
        (WebCore::DragController::startDrag):
        Compute dragImageAnchorPoint only if it is needed.
        Don't compute a random unused imageRect.
        Factor link drag image offset computation out into DragImage functions
        for platforms to override.

        Pass dragOrigin (the mouseDown point), not mouseDraggedPoint, to
        doSystemDrag, just like all the other drag types. This plus the
        WebKit2 change makes the link stable vs. the cursor, instead of
        positioned based on how fast you move after the mouse down.

        * page/DragController.h:
        * page/gtk/DragControllerGtk.cpp:
        * page/mac/DragControllerMac.mm:
        * page/win/DragControllerWin.cpp:
        Move LinkDragBorderInset into DragImage, and share between the non-Mac platforms.

        * platform/DragImage.cpp:
        (WebCore::dragOffsetForLinkDragImage):
        (WebCore::anchorPointForLinkDragImage):
        * platform/DragImage.h:
        As previously mentioned, move the computation of drag image offset here.

        * platform/mac/DragImageMac.mm:
        (WebCore::dragOffsetForLinkDragImage):
        (WebCore::anchorPointForLinkDragImage):
        Put the new drag image to the bottom right of the cursor.

2017-05-05  Dean Jackson  <dino@apple.com>

        ...and now the GTK and Windows builds.

        * platform/gtk/WidgetGtk.cpp:
        (WebCore::Widget::paint):
        * platform/win/WidgetWin.cpp:
        (WebCore::Widget::paint):

2017-05-05  Brady Eidson  <beidson@apple.com>

        API test WebKit2.WebsiteDataStoreCustomPaths is failing on ios-simulator.
        <rdar://problem/31977294> and https://bugs.webkit.org/show_bug.cgi?id=171513

        Reviewed by Andy Estes.

        Covered by API test.

        * platform/spi/cf/CFNetworkSPI.h:

2017-05-05  Dean Jackson  <dino@apple.com>

        Try to fix iOS build.

        * platform/ios/WidgetIOS.mm:
        (WebCore::Widget::paint):

2017-05-05  Dean Jackson  <dino@apple.com>

        Restrict SVG filters to accessible security origins
        https://bugs.webkit.org/show_bug.cgi?id=118689
        <rdar://problem/27362159>

        Reviewed by Brent Fulgham.

        Certain SVG filters should only be allowed to operate
        on content that is has SecurityOrigin access to. Implement
        this by including a flag in PaintInfo and LayerPaintingInfo,
        and have RenderWidget make sure the documents have acceptable
        SecurityOrigins as it goes to paint.

        This could be used as the first step in a "safe painting"
        strategy, allowing some content to be rendered into a 
        canvas or via the element() CSS function... but it is only
        a small first step.

        Test: http/tests/css/filters-on-iframes.html

        * page/FrameView.cpp:
        (WebCore::FrameView::paintContents):
        * page/FrameView.h:
        * platform/ScrollView.cpp:
        (WebCore::ScrollView::paint):
        * platform/ScrollView.h:
        * platform/Scrollbar.cpp:
        (WebCore::Scrollbar::paint):
        * platform/Scrollbar.h:
        * platform/Widget.h:
        * platform/graphics/filters/FilterOperation.h:
        (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin):
        * platform/graphics/filters/FilterOperations.cpp:
        (WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin):
        * platform/graphics/filters/FilterOperations.h:
        * platform/mac/WidgetMac.mm:
        (WebCore::Widget::paint):
        * rendering/FilterEffectRenderer.cpp:
        (WebCore::FilterEffectRenderer::build):
        * rendering/FilterEffectRenderer.h:
        * rendering/PaintInfo.h:
        (WebCore::PaintInfo::PaintInfo):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paint):
        (WebCore::RenderLayer::setupFilters):
        (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
        * rendering/RenderLayer.h:
        * rendering/RenderScrollbar.cpp:
        (WebCore::RenderScrollbar::paint):
        * rendering/RenderScrollbar.h:
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::paintContents):

2017-05-05  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r216273.

        This change caused an assertion failure on WK1.

        Reverted changeset:

        "Crash in ImageFrameCache::decodedSizeChanged() after image
        load cancellation"
        https://bugs.webkit.org/show_bug.cgi?id=171736
        http://trac.webkit.org/changeset/216273

2017-05-05  Brian Burg  <bburg@apple.com>

        [Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as session cookies
        https://bugs.webkit.org/show_bug.cgi?id=171748
        <rdar://problem/32027327>

        Reviewed by Michael Catanzaro.

        The function that we use to convert from WebCore::Cookie to NSHTTPCookie was
        also misusing the NSHTTPCookieDiscard property. If any value is provided for
        this key, even @NO, CFNetwork interprets that to mean that the cookie has the
        "session" flag.

        This is known to affect cookies set via WebCookieManager, WKHTTPCookieStore,
        and WebAutomationSession.

        This is covered by existing test WebKit2.WKHTTPCookieStore.

        * platform/network/cocoa/CookieCocoa.mm:
        (WebCore::Cookie::operator NSHTTPCookie *):
        Don't include the property if the cookie is not a session cookie.

2017-05-05  Youenn Fablet  <youenn@apple.com>

        TURNS gathering is not working properly
        https://bugs.webkit.org/show_bug.cgi?id=171747

        Reviewed by Eric Carlson.

        Did manual testing on real TURNS servers.

        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::configurationFromMediaEndpointConfiguration): Disabling TURNS servers gathering.

2017-05-05  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r216275.

        This change broke internal builds.

        Reverted changeset:

        "[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not
        case insensitive"
        https://bugs.webkit.org/show_bug.cgi?id=171636
        http://trac.webkit.org/changeset/216275

2017-05-05  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
        https://bugs.webkit.org/show_bug.cgi?id=171636
        <rdar://problem/30811218>

        Reviewed by Dean Jackson.

        LastResort is the only name which needs to be looked up case-sensitively. We can handle
        this in our existing function which handles special font names (like -apple-system) to
        make sure that we always do the right thing.

        Test: fast/text/lastResort.html

        * platform/spi/cocoa/CoreTextSPI.h:
        * platform/graphics/ios/FontCacheIOS.mm:
        (WebCore::platformFontWithFamilySpecialCase):
        * platform/graphics/mac/FontCacheMac.mm:
        (WebCore::platformFontWithFamilySpecialCase):

2017-05-05  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Crash in ImageFrameCache::decodedSizeChanged() after image load cancellation
        https://bugs.webkit.org/show_bug.cgi?id=171736

        Reviewed by Tim Horton.

        Tests: Covered by run-webkit-tests fast/images/image-formats-support.html
        --guard-malloc.

        Because an image format is not supported, the ImageObserver of the Image
        is deleted then the Image itself is deleted. In BitmapImage destructor,
        we make a call which ends up accessing the deleted ImageObserver.

        To fix this, we need to setImageObsever of the Image to-be-deleted to 
        nullptr. So the Image can avoid accessing its ImageObserver, while it is
        being deleted. Also we can change the BitImage destructor to avoid calling 
        ImageFrameCache::decodedSizeChanged() since it is not really needed.

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::clearImage):
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::~BitmapImage):

2017-05-05  Brian Burg  <bburg@apple.com>

        CrashTracer: [USER] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::commonVMSlow + 57
        https://bugs.webkit.org/show_bug.cgi?id=171669
        <rdar://problem/31967684>

        Reviewed by Mark Lam.

        * bindings/js/CommonVM.h:
        (WebCore::commonVMOrNull):
        Add an inline accessor function to expose the global variable.

2017-05-05  Filip Pizlo  <fpizlo@apple.com>

        GCController.cpp's collect() should be Async
        https://bugs.webkit.org/show_bug.cgi?id=171708

        Reviewed by Saam Barati.

        No new tests because no change in behavior.
        
        This is one step towards not requesting sync GCs in WebCore. I'm landing this incrementally to
        make bisecting super easy.

        * bindings/js/GCController.cpp:
        (WebCore::collect):

2017-05-05  Chris Dumez  <cdumez@apple.com>

        Attr Nodes should not have children
        https://bugs.webkit.org/show_bug.cgi?id=171688
        <rdar://problem/31998412>

        Reviewed by Andreas Kling.

        Attr Nodes should not have children as per the latest DOM specification:
        - https://dom.spec.whatwg.org/#interface-attr
        - https://dom.spec.whatwg.org/#dom-attr-value
        - https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity (Step 1)

        Firefox and Chrome both have been matching the DOM specification for a while so I think
        we should do the same. This aligns us with other browsers, simplifies the code, is
        more efficient and the code being removed has been prone to security bugs.

        Test: fast/dom/Attr/cannot-have-children.html

        * dom/Attr.cpp:
        (WebCore::Attr::Attr):
        (WebCore::Attr::create):
        (WebCore::Attr::setValue):
        (WebCore::Attr::cloneNodeInternal):
        * dom/Attr.h:
        - Have Attr subclass Node instead of ContainerNode as it can no longer have children.
        - Drop logic to dealing with children / creating a Text child.

        * dom/CharacterData.cpp:
        (WebCore::CharacterData::notifyParentAfterChange):
        Drop useless check found by the compiler. parentNode() can no longer be an Attr node.

        * dom/Node.cpp:
        (WebCore::appendTextContent):
        appendTextContent() is called by Node.TextContent(). For Attr Nodes, we should no longer traverse
        its subtree to gather Text Nodes. Instead, we now return Attr.value, as per the specification:
        - https://dom.spec.whatwg.org/#dom-node-textcontent

        * dom/Range.cpp:
        (WebCore::lengthOfContentsInNode):
        As per https://dom.spec.whatwg.org/#concept-node-length, we should return the number of children
        for Attr Nodes, which will always be 0.

        * xml/XPathUtil.cpp:
        (WebCore::XPath::isValidContextNode):
        Always return true for TEXT_NODE as the !(node->parentNode() && node->parentNode()->isAttributeNode())
        check will also with true now. This is because a parentNode() cannot be an Attribute Node.

2017-05-05  Brian Burg  <bburg@apple.com>

        [Cocoa] Converting from WebCore::Cookie to NSHTTPCookie always marks cookies as secure
        https://bugs.webkit.org/show_bug.cgi?id=171700
        <rdar://problem/32017975>

        Reviewed by Brady Eidson.

        The function that we use to convert from WebCore::Cookie to NSHTTPCookie was
        misusing the NSHTTPCookieSecure property. If any value is provided for this key,
        even @NO, CFNetwork interprets that to mean that the cookie has the "secure" flag.
        Thus, in some cases we would store an "insecure" cookie on a site that uses the
        http:// protocol, and be unable to later retrieve the cookie. This is known to
        affect cookies set via WebCookieManager, WKHTTPCookieStore, and WebAutomationSession.

        This is covered by existing test WebKit2.WKHTTPCookieStore.
        The test had a bug that masked this problem.

        * platform/network/cocoa/CookieCocoa.mm:
        (WebCore::Cookie::operator NSHTTPCookie *):
        Don't include the property if the cookie is not secure.

2017-05-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        Add SPI to WebItemProviderPasteboard to synchronously load data with a given timeout
        https://bugs.webkit.org/show_bug.cgi?id=171725
        <rdar://problem/32014052>

        Reviewed by Beth Dakin.

        Adds a synchronousTimeout: argument to doAfterLoadingProvidedContentIntoFileURLs:. If a positive timeout
        interval is specified by the client, then we will block the main thread for at most that amount of time after
        beginning to load from the item providers.

        To do this, we introduce another `dispatch_group_t` in parallel to the `fileLoadingGroup` that is entered and
        left in the same places. However, instead of attaching a handler block, we simply perform a synchronous wait for
        either the time limit to be reached, or the item providers to finish loading.

        No new tests -- no change in behavior yet.

        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):
        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):

2017-05-05  Chris Dumez  <cdumez@apple.com>

        Clean up Attr.idl
        https://bugs.webkit.org/show_bug.cgi?id=171691

        Reviewed by Andreas Kling.

        Clean up Attr.idl to match the spec:
        - https://dom.spec.whatwg.org/#interface-attr

        No Web-facing behavior change except for Attr properties being enumerated
        in a slightly different order.

        * dom/Attr.idl:

2017-05-05  Antti Koivisto  <antti@apple.com>

        ASSERTION FAILED: !frame().document()->inRenderTreeUpdate() in WebCore::FrameView::layout(bool)
        https://bugs.webkit.org/show_bug.cgi?id=171717

        Reviewed by Brent Fulgham.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::checkCompleted):

            Don't allow frame load to complete in the middle of a render tree update. Instead delay the check.

2017-05-05  Chris Dumez  <cdumez@apple.com>

        Refactor / Clean up Element.idl
        https://bugs.webkit.org/show_bug.cgi?id=171734

        Reviewed by Sam Weinig.

        Refactor / Clean up Element.idl to match the latest specification:
        - https://dom.spec.whatwg.org/#interface-element

        There is no Web-facing behavior change in this patch besides the Element properties
        being enumerated in a slightly different order. Things that do not match the
        specification have merely been annotated with FIXME comments for now. This makes
        it much more obvious what's standard, what's not and what needs fixing.

        * dom/Element.idl:

2017-05-05  Tim Horton  <timothy_horton@apple.com>

        Link drag images for apple.com front page links have a lot of spurious whitespace
        https://bugs.webkit.org/show_bug.cgi?id=171719
        <rdar://problem/32010854>

        Reviewed by Wenson Hsieh.

        * page/DragController.cpp:
        (WebCore::DragController::startDrag):
        Use the white-space-simplified string that we put on the pasteboard
        for the drag image, too!

2017-05-04  Mark Lam  <mark.lam@apple.com>

        DRT's setAudioResultCallback() and IDBRequest::setResult() need to acquire the JSLock.
        https://bugs.webkit.org/show_bug.cgi?id=171716
        <rdar://problem/30878027>

        Reviewed by Saam Barati.

        No new tests.  This issue was caught by existing tests.

        IDBRequest::setResult() needs to acquire the JSLock before calling toJS() (which
        does JS conversion and therefore, potentially JS allocations).

        * Modules/indexeddb/IDBRequest.cpp:
        (WebCore::IDBRequest::setResult):
        (WebCore::IDBRequest::setResultToStructuredClone):

2017-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GStreamer] Do not report more errors after the first one
        https://bugs.webkit.org/show_bug.cgi?id=171722

        Reviewed by Xabier Rodriguez-Calvar.

        We can receive several error messages for the same error from different elements. That's not expected by the
        media source selection algorithm implementation. I don't know if didn't happen with previous versions of GST,
        but since the upgrade to 1.10.4 several tests are failing because of this.

        Fixes: media/video-error-does-not-exist.html
               media/video-load-networkState.html
               media/video-source-error.html
               media/video-source-none-supported.html
               media/video-source-moved.html

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Return early also when an error already occured.

2017-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GStreamer] Fix handling of gst errors in MediaPlayerPrivateGStreamer::handleMessage
        https://bugs.webkit.org/show_bug.cgi?id=171721

        Reviewed by Xabier Rodriguez-Calvar.

        We are checking the GError only comparing the code, and ignoring the domain in some cases. Use g_error_matches()
        in those cases instead of only checking the code.

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

2017-05-04  Commit Queue  <commit-queue@webkit.org>

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

        Multiple LayoutTests crashing in Document::page() (Requested
        by ap on #webkit).

        Reverted changeset:

        "Remove support for legacy Notifications"
        https://bugs.webkit.org/show_bug.cgi?id=171487
        http://trac.webkit.org/changeset/216206

2017-05-04  Chris Dumez  <cdumez@apple.com>

        Drop remaining uses of PassRefPtr from CompositeEditCommand
        https://bugs.webkit.org/show_bug.cgi?id=171645

        Reviewed by Darin Adler.

        Drop remaining uses of PassRefPtr from CompositeEditCommand.

        * editing/ApplyBlockElementCommand.cpp:
        (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
        (WebCore::ApplyBlockElementCommand::endOfNextParagraphSplittingTextNodesIfNeeded):
        * editing/ApplyStyleCommand.cpp:
        (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
        (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
        (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
        (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
        (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
        (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
        (WebCore::ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes):
        (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
        (WebCore::ApplyStyleCommand::removeCSSStyle):
        (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
        (WebCore::ApplyStyleCommand::splitTextAtStart):
        (WebCore::ApplyStyleCommand::splitTextAtEnd):
        (WebCore::ApplyStyleCommand::splitTextElementAtStart):
        (WebCore::ApplyStyleCommand::splitTextElementAtEnd):
        (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
        (WebCore::ApplyStyleCommand::addBlockStyle):
        (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
        (WebCore::ApplyStyleCommand::applyInlineStyleChange):
        (WebCore::ApplyStyleCommand::joinChildTextNodes):
        * editing/BreakBlockquoteCommand.cpp:
        (WebCore::BreakBlockquoteCommand::doApply):
        * editing/CompositeEditCommand.cpp:
        (WebCore::applyCommand):
        (WebCore::CompositeEditCommand::insertNodeAt):
        (WebCore::CompositeEditCommand::removeChildrenInRange):
        (WebCore::CompositeEditCommand::removeNode):
        (WebCore::CompositeEditCommand::removeNodePreservingChildren):
        (WebCore::CompositeEditCommand::removeNodeAndPruneAncestors):
        (WebCore::CompositeEditCommand::moveRemainingSiblingsToNewParent):
        (WebCore::CompositeEditCommand::replaceElementWithSpanPreservingChildrenAndAttributes):
        (WebCore::CompositeEditCommand::prune):
        (WebCore::CompositeEditCommand::splitTextNode):
        (WebCore::CompositeEditCommand::splitElement):
        (WebCore::CompositeEditCommand::mergeIdenticalElements):
        (WebCore::CompositeEditCommand::splitTextNodeContainingElement):
        (WebCore::CompositeEditCommand::positionOutsideTabSpan):
        (WebCore::CompositeEditCommand::removeNodeAttribute):
        (WebCore::CompositeEditCommand::setNodeAttribute):
        (WebCore::CompositeEditCommand::deleteInsignificantText):
        (WebCore::CompositeEditCommand::removePlaceholderAt):
        (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
        (WebCore::CompositeEditCommand::pushAnchorElementDown):
        (WebCore::CompositeEditCommand::cleanupAfterDeletion):
        (WebCore::CompositeEditCommand::moveParagraphs):
        * editing/CompositeEditCommand.h:
        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):
        (WebCore::DeleteSelectionCommand::removeNodeUpdatingStates):
        (WebCore::DeleteSelectionCommand::removeNode):
        (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
        (WebCore::DeleteSelectionCommand::handleGeneralDelete):
        (WebCore::DeleteSelectionCommand::mergeParagraphs):
        (WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows):
        (WebCore::DeleteSelectionCommand::removeRedundantBlocks):
        * editing/DeleteSelectionCommand.h:
        * editing/Editor.cpp:
        (WebCore::ClearTextCommand::CreateAndApply):
        (WebCore::Editor::replaceSelectionWithFragment):
        (WebCore::Editor::handleAcceptedCandidate):
        * editing/EditorCommand.cpp:
        (WebCore::executeFormatBlock):
        * editing/IndentOutdentCommand.cpp:
        (WebCore::IndentOutdentCommand::outdentParagraph):
        * editing/InsertLineBreakCommand.cpp:
        (WebCore::InsertLineBreakCommand::doApply):
        * editing/InsertListCommand.cpp:
        (WebCore::InsertListCommand::fixOrphanedListChild):
        (WebCore::InsertListCommand::doApplyForSingleParagraph):
        (WebCore::InsertListCommand::unlistifyParagraph):
        * editing/InsertParagraphSeparatorCommand.cpp:
        (WebCore::InsertParagraphSeparatorCommand::doApply):
        * editing/InsertTextCommand.cpp:
        (WebCore::InsertTextCommand::insertTab):
        * editing/ModifySelectionListLevel.cpp:
        (WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeBefore):
        (WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeAfter):
        (WebCore::ModifySelectionListLevelCommand::appendSiblingNodeRange):
        (WebCore::DecreaseSelectionListLevelCommand::doApply):
        * editing/RemoveNodePreservingChildrenCommand.cpp:
        (WebCore::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
        (WebCore::RemoveNodePreservingChildrenCommand::doApply):
        * editing/RemoveNodePreservingChildrenCommand.h:
        (WebCore::RemoveNodePreservingChildrenCommand::create):
        * editing/ReplaceNodeWithSpanCommand.cpp:
        (WebCore::ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand):
        (WebCore::ReplaceNodeWithSpanCommand::doApply):
        (WebCore::ReplaceNodeWithSpanCommand::doUnapply):
        (WebCore::ReplaceNodeWithSpanCommand::getNodesInCommand):
        * editing/ReplaceNodeWithSpanCommand.h:
        (WebCore::ReplaceNodeWithSpanCommand::create):
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplacementFragment::removeNodePreservingChildren):
        (WebCore::ReplacementFragment::removeInterchangeNodes):
        (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
        (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
        (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
        (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
        (WebCore::handleStyleSpansBeforeInsertion):
        (WebCore::ReplaceSelectionCommand::handleStyleSpans):
        (WebCore::ReplaceSelectionCommand::doApply):
        (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
        (WebCore::ReplaceSelectionCommand::insertAsListItems):
        (WebCore::ReplaceSelectionCommand::performTrivialReplace):
        * editing/SetNodeAttributeCommand.cpp:
        (WebCore::SetNodeAttributeCommand::SetNodeAttributeCommand):
        (WebCore::SetNodeAttributeCommand::getNodesInCommand):
        * editing/SetNodeAttributeCommand.h:
        (WebCore::SetNodeAttributeCommand::create):
        * editing/SimplifyMarkupCommand.cpp:
        (WebCore::SimplifyMarkupCommand::doApply):
        (WebCore::SimplifyMarkupCommand::pruneSubsequentAncestorsToRemove):
        * editing/SimplifyMarkupCommand.h:
        * editing/SplitElementCommand.cpp:
        (WebCore::SplitElementCommand::SplitElementCommand):
        (WebCore::SplitElementCommand::executeApply):
        (WebCore::SplitElementCommand::getNodesInCommand):
        * editing/SplitElementCommand.h:
        (WebCore::SplitElementCommand::create):
        * editing/SplitTextNodeCommand.cpp:
        (WebCore::SplitTextNodeCommand::SplitTextNodeCommand):
        (WebCore::SplitTextNodeCommand::doApply):
        (WebCore::SplitTextNodeCommand::doUnapply):
        (WebCore::SplitTextNodeCommand::doReapply):
        (WebCore::SplitTextNodeCommand::insertText1AndTrimText2):
        * editing/SplitTextNodeCommand.h:
        (WebCore::SplitTextNodeCommand::create):
        * editing/SplitTextNodeContainingElementCommand.cpp:
        (WebCore::SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand):
        (WebCore::SplitTextNodeContainingElementCommand::doApply):
        * editing/SplitTextNodeContainingElementCommand.h:
        (WebCore::SplitTextNodeContainingElementCommand::create):
        * editing/TextInsertionBaseCommand.cpp:
        (WebCore::TextInsertionBaseCommand::applyTextInsertionCommand):
        * editing/TypingCommand.cpp:
        (WebCore::TypingCommand::makeEditableRootEmpty):
        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::contextMenuItemSelected):

2017-05-04  Daniel Bates  <dabates@apple.com>

        Fix misspelled word "interrupt" as pointed out by Darin Adler
        in <https://bugs.webkit.org/show_bug.cgi?id=171577>.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::transitionToCommitted):

2017-05-04  Jeremy Jones  <jeremyj@apple.com>

        UIColor +whiteColor and +clearColor are ambiguous and need to be casted when soft linked.
        https://bugs.webkit.org/show_bug.cgi?id=171704

        Reviewed by Jer Noble.

        No new tests because no behavior change.

        Fix build by casting result of +clearColor to UIColor.

        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (clearUIColor):
        (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
        (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
        (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture):

2017-05-04  Chris Dumez  <cdumez@apple.com>

        Element.slot should be marked as [Unscopable]
        https://bugs.webkit.org/show_bug.cgi?id=171683

        Reviewed by Darin Adler.

        Element.slot should be marked as [Unscopable]:
        - https://dom.spec.whatwg.org/#interface-element
        - https://heycam.github.io/webidl/#Unscopable

        Test: fast/shadow-dom/Element-slot-unscopable.html

        * dom/Element.idl:

2017-05-04  Don Olmstead  <don.olmstead@am.sony.com>

        [Win] Remove redundant macros that are set in the CMake config
        https://bugs.webkit.org/show_bug.cgi?id=171571

        Reviewed by Brent Fulgham.

        No new tests. No change in behavior.

        * WebCorePrefix.h:
        * config.h:
        * platform/win/COMPtr.h:
        * platform/win/WindowsTouch.h:
        * testing/js/WebCoreTestSupportPrefix.h:

2017-05-04  Tim Horton  <timothy_horton@apple.com>

        [Mac] Modernize image for dragged link
        https://bugs.webkit.org/show_bug.cgi?id=171701
        <rdar://problem/31978818>

        Reviewed by Simon Fraser.

        * WebCore.xcodeproj/project.pbxproj:
        * page/mac/DragControllerMac.mm:
        * platform/mac/DragImageMac.mm:
        (WebCore::dragImageSize):
        (WebCore::scaleDragImage):
        (WebCore::dissolveDragImageToFraction):
        (WebCore::createDragImageFromImage):
        (WebCore::LinkImageLayout::LinkImageLayout):
        (WebCore::LinkImageLayout::layOutText):
        (WebCore::LinkImageLayout::addLine):
        (WebCore::createDragImageForLink):
        (WebCore::fontFromNSFont): Deleted.
        (WebCore::canUseFastRenderer): Deleted.
        (WebCore::widthWithFont): Deleted.
        (WebCore::drawAtPoint): Deleted.
        (WebCore::drawDoubledAtPoint): Deleted.
        * platform/spi/cocoa/LinkPresentationSPI.h: Added.
        Improve the design of URL drag images.
        The margins are increased, the background is now white, the text is
        not drawn doubled-up, the title will now wrap to two lines, and the
        domain name will appear simplified and de-punycoded.

        Much of the implementation of text painting is borrowed from
        <attachment> for now, but we should figure out how to generalize
        it for UI-like parts of WebKit in the future.

2017-05-04  Commit Queue  <commit-queue@webkit.org>

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

        not quite ready (Requested by thorton on #webkit).

        Reverted changeset:

        "[Mac] Modernize image for dragged link"
        https://bugs.webkit.org/show_bug.cgi?id=171701
        http://trac.webkit.org/changeset/216223

2017-05-04  Tim Horton  <timothy_horton@apple.com>

        [Mac] Modernize image for dragged link
        https://bugs.webkit.org/show_bug.cgi?id=171701
        <rdar://problem/31978818>

        Reviewed by Simon Fraser.

        * page/mac/DragControllerMac.mm:
        * platform/mac/DragImageMac.mm:
        (WebCore::dragImageSize):
        (WebCore::scaleDragImage):
        (WebCore::dissolveDragImageToFraction):
        (WebCore::createDragImageFromImage):
        (WebCore::LinkImageLayout::LinkImageLayout):
        (WebCore::LinkImageLayout::addLine):
        (WebCore::createDragImageForLink):
        (WebCore::fontFromNSFont): Deleted.
        (WebCore::canUseFastRenderer): Deleted.
        (WebCore::widthWithFont): Deleted.
        (WebCore::drawAtPoint): Deleted.
        (WebCore::drawDoubledAtPoint): Deleted.
        Improve the design of URL drag images.
        The margins are increased, the background is now white, the text is
        not drawn doubled-up, the title will now wrap to two lines, and the
        domain name will appear simplified and de-punycoded.

        Much of the implementation of text painting is borrowed from
        <attachment> for now, but we should figure out how to generalize
        it for UI-like parts of WebKit in the future.

2017-05-04  Jeremy Jones  <jeremyj@apple.com>

        Use if instead of return early for 13 places in WebAVPlayerController
        https://bugs.webkit.org/show_bug.cgi?id=171692

        Reviewed by Jer Noble.

        No new tests because no behavior change.

        * platform/ios/WebAVPlayerController.mm:
        (-[WebAVPlayerController play:]):
        (-[WebAVPlayerController pause:]):
        (-[WebAVPlayerController togglePlayback:]):
        (-[WebAVPlayerController beginScrubbing:]):
        (-[WebAVPlayerController endScrubbing:]):
        (-[WebAVPlayerController seekToTime:]):
        (-[WebAVPlayerController beginScanningForward:]):
        (-[WebAVPlayerController endScanningForward:]):
        (-[WebAVPlayerController beginScanningBackward:]):
        (-[WebAVPlayerController endScanningBackward:]):
        (-[WebAVPlayerController seekToBeginning:]):
        (-[WebAVPlayerController seekToEnd:]):
        (-[WebAVPlayerController toggleMuted:]):

2017-05-04  Filip Pizlo  <fpizlo@apple.com>

        JSC::Heap should expose a richer API for requesting GCs
        https://bugs.webkit.org/show_bug.cgi?id=171690

        Reviewed by Geoffrey Garen.

        No new tests because this is just a refactoring.
        
        Change some function calls now that some JSC::Heap APIs got renamed.

        * bindings/js/GCController.cpp:
        (WebCore::collect):
        (WebCore::GCController::garbageCollectNow):
        (WebCore::GCController::garbageCollectNowIfNotDoneRecently):

2017-05-04  Mark Lam  <mark.lam@apple.com>

        NeverDestroyed<String>(ASCIILiteral(...)) is not thread safe.
        https://bugs.webkit.org/show_bug.cgi?id=171586
        <rdar://problem/31873190>

        Reviewed by Yusuke Suzuki.

        No new tests because we're just converting uses of ASCIILiteral (in the
        instantiation of NeverDestroyed<String> and NeverDestroyed<const String>) to
        MAKE_STATIC_STRING_IMPL.

        The correctness of using MAKE_STATIC_STRING_IMPL is tested in the newly added
        API test in this patch.

        Also changed "static NeverDestroyed<ASCIILiteral>" instances in
        SQLiteIDBBackingStore.cpp to "static const char* const" because they are only
        ever used to get the underlying const char*.

        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
        (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
        * Modules/mediastream/MediaEndpointSessionDescription.cpp:
        * Modules/mediastream/RTCRtpTransceiver.cpp:
        * Modules/mediastream/SDPProcessor.cpp:
        * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
        (WebCore::customHandlersStateString):
        (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
        * Modules/speech/SpeechSynthesis.cpp:
        (WebCore::SpeechSynthesis::boundaryEventOccurred):
        * accessibility/AccessibilityMediaControls.cpp:
        (WebCore::AccessibilityMediaControl::controlTypeName):
        (WebCore::AccessibilityMediaControl::title):
        (WebCore::AccessibilityMediaControlsContainer::elementTypeName):
        (WebCore::AccessibilityMediaTimeline::helpText):
        (WebCore::AccessibilityMediaTimeDisplay::accessibilityDescription):
        * bindings/js/JSLazyEventListener.cpp:
        (WebCore::eventParameterName):
        * contentextensions/ContentExtensionsBackend.cpp:
        (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
        * css/CSSDefaultStyleSheets.cpp:
        (WebCore::screenEval):
        (WebCore::printEval):
        * css/MediaList.cpp:
        (WebCore::addResolutionWarningMessageToConsole):
        * css/StyleSheetContents.cpp:
        (WebCore::StyleSheetContents::parseAuthorStyleSheet):
        * dom/Document.cpp:
        (WebCore::Document::readyState):
        * dom/LoadableClassicScript.cpp:
        (WebCore::LoadableClassicScript::notifyFinished):
        * dom/PseudoElement.cpp:
        (WebCore::PseudoElement::pseudoElementNameForEvents):
        * editing/MarkupAccumulator.cpp:
        (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
        * editing/cocoa/DataDetection.mm:
        (WebCore::DataDetection::dataDetectorURLProtocol):
        * editing/markup.cpp:
        (WebCore::StyledMarkupAccumulator::styleNodeCloseTag):
        (WebCore::createMarkupInternal):
        * html/FormController.cpp:
        (WebCore::formStateSignature):
        * html/ImageInputType.cpp:
        (WebCore::ImageInputType::appendFormData):
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::realizeSaves):
        (WebCore::CanvasRenderingContext2D::getImageData):
        * html/parser/XSSAuditor.cpp:
        (WebCore::XSSAuditor::init):
        (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected):
        * html/track/VTTCue.cpp:
        (WebCore::startKeyword):
        (WebCore::middleKeyword):
        (WebCore::endKeyword):
        (WebCore::leftKeyword):
        (WebCore::rightKeyword):
        (WebCore::verticalGrowingLeftKeyword):
        (WebCore::verticalGrowingRightKeyword):
        (WebCore::VTTCue::determineTextDirection):
        (WebCore::VTTCue::markFutureAndPastNodes):
        * inspector/InspectorCSSAgent.cpp:
        (WebCore::computePseudoClassMask):
        * inspector/InspectorIndexedDBAgent.cpp:
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::sourceMapURLForResource):
        * inspector/PageDebuggerAgent.cpp:
        (WebCore::PageDebuggerAgent::sourceMapURLForScript):
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::notifyFinished):
        * loader/TextTrackLoader.cpp:
        (WebCore::TextTrackLoader::corsPolicyPreventedLoad):
        * loader/icon/IconDatabase.cpp:
        (WebCore::IconDatabase::defaultDatabaseFilename):
        * page/CaptionUserPreferencesMediaAF.cpp:
        (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS):
        * page/SecurityOrigin.cpp:
        (WebCore::SecurityOrigin::urlWithUniqueSecurityOrigin):
        * page/UserContentURLPattern.cpp:
        (WebCore::UserContentURLPattern::parse):
        * platform/MIMETypeRegistry.cpp:
        (WebCore::defaultMIMEType):
        * platform/animation/Animation.cpp:
        (WebCore::Animation::initialName):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::engineDescription):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::engineDescription):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::FontCache::similarFont):
        * platform/gtk/UserAgentGtk.cpp:
        (WebCore::platformVersionForUAString):
        * platform/mock/mediasource/MockBox.cpp:
        (WebCore::MockTrackBox::type):
        (WebCore::MockInitializationBox::type):
        (WebCore::MockSampleBox::type):
        * platform/network/HTTPHeaderValues.cpp:
        (WebCore::HTTPHeaderValues::textPlainContentType):
        (WebCore::HTTPHeaderValues::formURLEncodedContentType):
        (WebCore::HTTPHeaderValues::noCache):
        (WebCore::HTTPHeaderValues::maxAge0):
        * platform/network/HTTPParsers.cpp:
        (WebCore::parseXSSProtectionHeader):
        * replay/MemoizedDOMResult.cpp:
        (JSC::InputTraits<MemoizedDOMResultBase>::type):
        * svg/SVGTransformValue.cpp:
        (WebCore::SVGTransformValue::transformTypePrefixForParsing):

2017-05-04  Jeremy Jones  <jeremyj@apple.com>

        Add muted to WebPlaybackSessionModel.
        https://bugs.webkit.org/show_bug.cgi?id=171592
        rdar://problem/31814074

        Reviewed by Jer Noble.

        No behavior change. This just adds the ability for UI to mute.

        * platform/cocoa/WebPlaybackSessionModel.h:
        (WebCore::WebPlaybackSessionModelClient::mutedChanged):
        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
        (WebCore::WebPlaybackSessionModelMediaElement::toggleMuted):
        (WebCore::WebPlaybackSessionModelMediaElement::observedEventNames):
        (WebCore::WebPlaybackSessionModelMediaElement::isMuted):
        * platform/ios/WebAVPlayerController.h:
        * platform/ios/WebAVPlayerController.mm:
        (-[WebAVPlayerController toggleMuted:]):
        * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
        * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
        (WebCore::WebPlaybackSessionInterfaceAVKit::mutedChanged):
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        (WebVideoFullscreenControllerContext::mutedChanged):
        (WebVideoFullscreenControllerContext::isMuted):
        (WebVideoFullscreenControllerContext::toggleMuted):
        * platform/spi/ios/MediaPlayerSPI.h:

2017-05-04  Joseph Pecoraro  <pecoraro@apple.com>

        REGRESSION(r216138): Web Inspector: ASSERT(!content.isNull()) when checking for source map url opening inspector
        https://bugs.webkit.org/show_bug.cgi?id=171697
        <rdar://problem/31999512>

        Reviewed by Matt Baker.

        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::cachedResourceContent):
        Always set base64Encoded when returning true. Return the empty
        string instead of a null string matching previous behavior.

2017-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WK2] Add support for keeping the selection in a focused editable element when dragging begins
        https://bugs.webkit.org/show_bug.cgi?id=171585
        <rdar://problem/31544320>

        Reviewed by Beth Dakin and Zalan Bujtas.

        Covered by 4 API tests.

        * dom/DocumentMarker.h:

        Introduces the DraggedContent DocumentMarker type, which applies to the Range in the DOM that is being used as
        a drag source. Also adds DraggedContentData, which contains nodes found by the TextIterator in the process of
        finding Ranges to mark.

        (WebCore::DocumentMarker::AllMarkers::AllMarkers):
        * dom/DocumentMarkerController.cpp:
        (WebCore::DocumentMarkerController::addDraggedContentMarker):
        (WebCore::shouldInsertAsSeparateMarker):
        (WebCore::DocumentMarkerController::addMarker):

        When adding DocumentMarkers of type DraggedContent, keep adjacent RenderReplaced elements separate, rather than
        merging them into existing RenderedDocumentMarkers. This is because the data for each of these (i.e. the target
        node) needs to be preserved.

        (WebCore::DocumentMarkerController::markersFor):

        Bail and return an empty list if the map of document markers cannot possibly contain a dragged content marker.

        * dom/DocumentMarkerController.h:
        * page/DragController.h:
        * page/DragState.h:

        Add draggedContentRange to DragState. This tracks the Range that is being dragged; it is created when the drag
        session has begun, and ends when drag session finishes (either via WebPage::dragEnded or WebPage::dragCancelled).

        * page/EventHandler.cpp:
        (WebCore::repaintContentsOfRange):
        (WebCore::EventHandler::dragCancelled):

        Called when a drag is cancelled in the UI process without a session ever getting a chance to begin. We use this
        as a hook to remove all DraggedContent document markers from the document of the dragged content range.

        (WebCore::EventHandler::didStartDrag):

        Called when a drag session has begun in the UI process. We use this as a hook to set up document markers for the
        Range of content being dragged.

        (WebCore::EventHandler::dragSourceEndedAt):

        Called when a drag session ends. We use this as a hook to remove all DraggedContent document markers from the
        document of the dragged content range.

        (WebCore::EventHandler::draggedElement):
        * page/EventHandler.h:
        * page/FocusController.cpp:
        (WebCore::shouldClearSelectionWhenChangingFocusedElement):

        Prevent the selection from clearing when the previously focused element is editable and also contains the drag
        source element. Ideally, we should experiment with clearing out the selection whenever the element is blurred
        (and not have additional restrictions on editability and containing the drag source), but this change is much
        riskier.

        (WebCore::FocusController::setFocusedElement):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paint):

        Use RenderText::draggedContentStartEnd to find the range of text (if any) that is dragged content, and paint
        these ranges of text at a lower alpha using TextPainter::paintTextInRange.

        * rendering/RenderReplaced.cpp:
        (WebCore::draggedContentContainsReplacedElement):

        Determines whether or not the element being rendered is contained within a dragged content range. Assuming that
        the DraggedContent type flag is set in DocumentMarkerController, we first look to see whether or not the
        container node is in the document marker map. If so, instead of consulting node offset ranges (since this is, in
        the worst-case, linear in the number of sibling nodes per RenderReplaced) we simply check the DraggedContentData
        to see if the current element being rendered matches one of the target nodes.

        (WebCore::RenderReplaced::paint):

        If the element rendered by this RenderReplaced is dragged content, then render it at a low alpha.

        * rendering/RenderText.cpp:
        (WebCore::RenderText::draggedContentRangesBetweenOffsets):

        Determines what range of text, if any, contains dragged content by consulting the Document's DocumentMarkers.

        * rendering/RenderText.h:
        * rendering/TextPainter.cpp:
        (WebCore::TextPainter::paintTextInRange):

        Teach TextPainter to only paint a given range in a TextRun.

        * rendering/TextPainter.h:

        Add TextPainter support for specifying special text offset ranges when rendering a TextRun, such that each
        special range in text is rendered after applying some modification to the GraphicsContext.

2017-05-04  Jeremy Jones  <jeremyj@apple.com>

        Crash when pointer lock element is removed before pointer lock allowed arrives.
        https://bugs.webkit.org/show_bug.cgi?id=171642

        Reviewed by Jer Noble.

        Make sure there a pending lock before attempting to complete pointer lock.

        * page/PointerLockController.cpp:
        (WebCore::PointerLockController::didAcquirePointerLock):

2017-05-04  Chris Dumez  <cdumez@apple.com>

        Reformat / Clean up Node.idl to match the specification
        https://bugs.webkit.org/show_bug.cgi?id=171686

        Reviewed by Sam Weinig.

        Reformat / Clean up Node.idl to match the specification:
        - https://dom.spec.whatwg.org/#node

        There should be no Web-facing behavior change, except for Node properties
        being enumerated in a slightly different order.

        * dom/Node.idl:

2017-05-04  Sam Weinig  <sam@webkit.org>

        Remove support for legacy Notifications
        https://bugs.webkit.org/show_bug.cgi?id=171487

        Reviewed by Jon Lee.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        Remove files.

        * Configurations/FeatureDefines.xcconfig:
        Remove definition of ENABLE_LEGACY_NOTIFICATIONS.

        * DerivedSources.make:
        Remove IDL files.

        * Modules/notifications/DOMWindowNotifications.cpp: Removed.
        * Modules/notifications/DOMWindowNotifications.h: Removed.
        * Modules/notifications/DOMWindowNotifications.idl: Removed.
        * Modules/notifications/NotificationCenter.cpp: Removed.
        * Modules/notifications/NotificationCenter.h: Removed.
        * Modules/notifications/NotificationCenter.idl: Removed.
        * Modules/notifications/NotificationClient.h:
        * Modules/notifications/NotificationController.cpp:
        * Modules/notifications/NotificationController.h:
        * Modules/notifications/WorkerGlobalScopeNotifications.cpp: Removed.
        * Modules/notifications/WorkerGlobalScopeNotifications.h: Removed.
        * Modules/notifications/WorkerGlobalScopeNotifications.idl: Removed.
        * Modules/notifications/Notification.idl:
        * Modules/notifications/Notification.cpp:
        * Modules/notifications/Notification.h:
        * dom/EventTargetFactory.in:
        * page/DOMWindow.cpp:
        * workers/WorkerThread.h:
        Remove code legacy Notification code. Replace use of NotificationCenter with direct
        calls to the NotificationClient.

2017-05-04  Antti Koivisto  <antti@apple.com>

        REGRESSION (Safari 10.1): When 'transition' contains -ms-transform, transform-origin is also transitioned
        https://bugs.webkit.org/show_bug.cgi?id=171250
        <rdar://problem/31827243>

        Reviewed by Geoffrey Garen.

        We were mapping unknown properties to 'all' animation. With this patch we ignore them instead.
        The patch also implements roundtripping of unknown properties via CSSOM, matching Blink and Gecko.

        Test: transitions/transition-unknown-property-ignore.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::createTransitionPropertyValue):

            Return the correct name for unknown properties.

        * css/CSSToStyleMap.cpp:
        (WebCore::CSSToStyleMap::mapAnimationProperty):

            Map any unknown property to AnimateUnknownProperty mode instead of falling back to the default of AnimateAll.
            Save the unknown property name so we can roundtrip it properly.

        * page/animation/CompositeAnimation.cpp:
        (WebCore::CompositeAnimation::updateTransitions):

            Ignore AnimateUnknownProperty like AnimateNone.

        * platform/animation/Animation.h:
        (WebCore::Animation::unknownProperty):
        (WebCore::Animation::setUnknownProperty):

2017-05-04  Chris Dumez  <cdumez@apple.com>

        Clean up MutationRecord.idl
        https://bugs.webkit.org/show_bug.cgi?id=171685

        Reviewed by Sam Weinig.

        Clean up MutationRecord.idl to match the specification:
        - https://dom.spec.whatwg.org/#mutationrecord

        There is no Web-facing behavior change.

        * dom/MutationRecord.idl:

2017-05-04  Chris Dumez  <cdumez@apple.com>

        Reformat / clean up Event.idl
        https://bugs.webkit.org/show_bug.cgi?id=171675

        Reviewed by Sam Weinig.

        Reformat / clean up Event.idl to match the latest spec more closely:
        - https://dom.spec.whatwg.org/#interface-event

        There is no web-facing behavior change, except for properties being
        enumerated in a slightly different order.

        * dom/Event.idl:

2017-05-04  Daniel Bates  <dabates@apple.com>

        Cleanup: Extract CachedScript::mimeTypeAllowedByNosniff() into a common function
        https://bugs.webkit.org/show_bug.cgi?id=171678

        Reviewed by Andy Estes.

        Extract CachedScript::mimeTypeAllowedByNosniff() into a common function that can
        be shared by LoadableClassicScript and WorkerScriptLoader.

        No functionality was changed. So, no new tests.

        * dom/LoadableClassicScript.cpp:
        (WebCore::LoadableClassicScript::notifyFinished): Modified to use WebCore::isScriptAllowedByNosniff().
        * loader/cache/CachedScript.cpp:
        (WebCore::CachedScript::mimeType): Deleted; incorporated into WebCore::isScriptAllowedByNosniff().
        (WebCore::CachedScript::mimeTypeAllowedByNosniff): Deleted; incorporated into WebCore::isScriptAllowedByNosniff().
        * loader/cache/CachedScript.h:
        * platform/network/ResourceResponseBase.cpp:
        (WebCore::isScriptAllowedByNosniff): Added. Note that it is sufficient to extract the MIME type
        as-is and query the MIME type registry because the MIME type registry performs look ups case-insensitively.
        * platform/network/ResourceResponseBase.h:
        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::didReceiveResponse): Modified to use WebCore::isScriptAllowedByNosniff().
        (WebCore::mimeTypeAllowedByNosniff): Deleted.

2017-05-04  Sam Weinig  <sam@webkit.org>

        Make the [EnabledBySetting] extended attribute work for any attribute or operation on a prototype
        https://bugs.webkit.org/show_bug.cgi?id=171588

        Reviewed by Dean Jackson.

        * bindings/js/JSDOMIterator.h:
        (WebCore::JSDOMIterator::createPrototype):
        * bindings/js/JSDOMWindowShell.cpp:
        (WebCore::JSDOMWindowShell::setWindow):
        * bindings/js/JSDOMWrapperCache.h:
        (WebCore::getDOMStructure):
        (WebCore::getDOMPrototype):
        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::initScript):
        Update to account for createPrototype and prototype taking the global object by reference.
        
        * bindings/scripts/CodeGeneratorJS.pm:
        (NeedsSettingsCheckForPrototypeProperty):
        Add predicate to determine if an interface has any settings enabled properties on the prototype,
        needed to determine if we should pass the global object to finishCreation.

        (GenerateHeader):
        Update signature of both createPrototype and prototype to take JSDOMGlobalObject& rather than
        a JSC::JSGlobalObject*, this allows us to pass the more specific type to the prototype constructor,
        and access the ScriptExecutionContext for the Settings.

        (GeneratePropertiesHashTable):
        Update to return, via out parameter, arrays with the attributes and operations that specify EnabledBySetting. This
        mimics the model used for RuntimeEnabledFeatures.

        (GenerateImplementation):
        In {Class}Prototype::finishCreation, add code to check settings to see if an attribute or operation should be enabled,
        and if it shouldn't remove it from the object. This, again, is modeled on RuntimeEnabledFeatures.

        (GeneratePrototypeDeclaration):
        Update signatures to take JSDOMGlobalObject& and specialize finishCreation to take one if there are any properties
        that require settings to enable.

        (GenerateConstructorHelperMethods):
        Update for new signature of prototype(...).

        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        * bindings/scripts/test/JS/JSInterfaceName.h:
        * bindings/scripts/test/JS/JSMapLike.cpp:
        * bindings/scripts/test/JS/JSMapLike.h:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.h:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestCEReactions.h:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.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/JSTestDOMJIT.cpp:
        * bindings/scripts/test/JS/JSTestDOMJIT.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.h:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestInterface.h:
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        * bindings/scripts/test/JS/JSTestIterable.h:
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.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/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/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerialization.h:
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInherit.h:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.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:
        Update test results for new test values and changes in signatures to pass JSDOMGlobalObject.

        * bindings/scripts/test/TestObj.idl:
        Add tests for [EnableBySetting] for attributes and operations.

        * bridge/objc/objc_runtime.h:
        * bridge/runtime_array.h:
        * bridge/runtime_method.h:
        * bridge/runtime_object.h:
        * inspector/CommandLineAPIHost.cpp:
        Update createPrototype function to take the global object by reference.

2017-05-04  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Allow host application to enable/disable media capture
        https://bugs.webkit.org/show_bug.cgi?id=171292
        <rdar://problem/31821492>

        Reviewed by Jer Noble.

        No new layout tests, added an API test instead.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::endStream): New, stop all tracks.
        * Modules/mediastream/MediaStream.h:

        * Modules/mediastream/MediaStreamRegistry.cpp:
        (WebCore::MediaStreamRegistry::unregisterStream): Minor cleanup.
        (WebCore::MediaStreamRegistry::forEach): New, call the lambda with each stream.
        (WebCore::MediaStreamRegistry::MediaStreamRegistry): Deleted, unused.
        * Modules/mediastream/MediaStreamRegistry.h:

        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::stopTrack): Add parameter so caller can specify if an 'ended' 
        event should be sent or not.
        (WebCore::MediaStreamTrack::trackMutedChanged): Don't post an event if the track has ended.
        * Modules/mediastream/MediaStreamTrack.h:

        * dom/Document.cpp:
        (WebCore::Document::stopMediaCapture): Stop all streams in the document.
        * dom/Document.h:

        * page/Page.cpp:
        (WebCore::Page::stopMediaCapture): Stop all streams.
        * page/Page.h:

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Display a black frame
        when the stream ends.
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Signal a characteristics
        change to HTMLMediaElement refresh state.
        * platform/mediastream/MediaStreamPrivate.h:

        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        (WebCore::AVMediaCaptureSource::stopProducingData): Don't return early if the session isn't 
        running, we always need to clear m_session on iOS.

2017-05-04  Zalan Bujtas  <zalan@apple.com>

        Should never hit layout while updating the render tree.
        https://bugs.webkit.org/show_bug.cgi?id=171643

        Reviewed by Antti Koivisto.

        Laying out a half-baked render tree is not a great idea. Especially considering
        that layout (sadly) can mutate the render tree.  

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

2017-05-04  Daniel Bates  <dabates@apple.com>

        importScripts() should respect X-Content-Type-Options: nosniff
        https://bugs.webkit.org/show_bug.cgi?id=171248
        <rdar://problem/31819023>

        Reviewed by Andy Estes.

        Do not load a worker script if it has the HTTP response header "X-Content-Type-Options: nosniff"
        and its Content-type header is not an allowed JavaScript script mime type. This behavior follows
        from <https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-worker-imported-script> (3 May 2017),
        <https://fetch.spec.whatwg.org/#concept-fetch> (2 May 2017), and <https://fetch.spec.whatwg.org/#concept-main-fetch>.

        * workers/WorkerScriptLoader.cpp:
        (WebCore::mimeTypeAllowedByNosniff): Added.
        (WebCore::WorkerScriptLoader::didReceiveResponse): Mark the load as failed if the response
        is not allowed by X-Content-Type-Options: nosniff.

2017-05-04  Dave Hyatt  <hyatt@apple.com>

        REGRESSION(STP): rgb() with calc() containing variables doesn't work
        https://bugs.webkit.org/show_bug.cgi?id=169939

        Reviewed by Zalan Bujtas.

        Added new test in fast/css/variables.

        * css/CSSCalculationValue.cpp:
        (WebCore::CSSCalcExpressionNodeParser::parseValue):
        Treat floats in calcs as integers when we can.

2017-05-04  Commit Queue  <commit-queue@webkit.org>

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

        FTBFS for iOS due to missing WebPageProxy::stopMediaCapture()
        implementation. (Requested by ddkilzer on #webkit).

        Reverted changeset:

        "[MediaStream] Allow host application to enable/disable media
        capture"
        https://bugs.webkit.org/show_bug.cgi?id=171292
        http://trac.webkit.org/changeset/216172

2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r215686): Incremental reads from SharedBuffer are wrong after r215686
        https://bugs.webkit.org/show_bug.cgi?id=171602

        Reviewed by Michael Catanzaro.

        In TextTrackLoader::processNewCueData() and PNGImageReader::decode() we changed the patter to read data from a
        SharedBuffer at a given offset. The new pattern is not correct, because it assumes the whole segment is always
        read, and the new offset is not correct when that's not the case. This has broken the rendering of png images in
        the GTK+ port, only the first bytes are correctly decoded and drawn, but not the rest of the image.

        Fixes: editing/pasteboard/paste-image-using-image-data.html

        * loader/TextTrackLoader.cpp:
        (WebCore::TextTrackLoader::processNewCueData):
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageReader::decode):

2017-05-03  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Allow host application to enable/disable media capture
        https://bugs.webkit.org/show_bug.cgi?id=171292
        <rdar://problem/31821492>

        Reviewed by Jer Noble.

        No new layout tests, added an API test instead.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::endStream): New, stop all tracks.
        * Modules/mediastream/MediaStream.h:

        * Modules/mediastream/MediaStreamRegistry.cpp:
        (WebCore::MediaStreamRegistry::unregisterStream): Minor cleanup.
        (WebCore::MediaStreamRegistry::forEach): New, call the lambda with each stream.
        (WebCore::MediaStreamRegistry::MediaStreamRegistry): Deleted, unused.
        * Modules/mediastream/MediaStreamRegistry.h:

        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::stopTrack): Add parameter so caller can specify if an 'ended' 
        event should be sent or not.
        (WebCore::MediaStreamTrack::trackMutedChanged): Don't post an event if the track has ended.
        * Modules/mediastream/MediaStreamTrack.h:

        * dom/Document.cpp:
        (WebCore::Document::stopMediaCapture): Stop all streams in the document.
        * dom/Document.h:

        * page/Page.cpp:
        (WebCore::Page::stopMediaCapture): Stop all streams.
        * page/Page.h:

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Display a black frame
        when the stream ends.
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Signal a characteristics
        change to HTMLMediaElement refresh state.
        * platform/mediastream/MediaStreamPrivate.h:

        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        (WebCore::AVMediaCaptureSource::stopProducingData): Don't return early if the session isn't 
        running, we always need to clear m_session on iOS.

2017-05-03  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Remove all statistics for modifiedSince website data removals
        https://bugs.webkit.org/show_bug.cgi?id=171584
        <rdar://problem/24702576>

        Reviewed by Brent Fulgham.

        Test: http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
            Now clears all regardless of the modifiedSince parameter's value.

2017-05-03  Andy Estes  <aestes@apple.com>

        Try to fix the macOS Public SDK build
        https://bugs.webkit.org/show_bug.cgi?id=171635
        <rdar://problem/31812751>

        Unreviewed because the commit queue told me to say this.

        * platform/spi/cocoa/AVKitSPI.h:

2017-05-03  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: aria-rowspan value should be ignored if td/th rowspan value is provided
        https://bugs.webkit.org/show_bug.cgi?id=171214

        Reviewed by Chris Fleizach.

        Return -1 in AccessibilityTableCell::ariaColumnSpan() and ariaRowSpan() if the
        cell element has an explicit value for the native host language's span attribute.
        Add checks to AccessibilityTableCell::columnIndexRange() and rowIndexRange() so
        that we prefer an author-provided ARIA span value over an implicit host-language
        span value. Similarly, add checks to AccessibilityARIAGridCell::columnIndexRange()
        and rowIndexRange() so that we fall back on implicit host-language span values
        when there is no author-provided ARIA span value and the ARIA cell is associated
        with a cell element.

        Test: accessibility/aria-cellspans-with-native-cellspans.html

        * accessibility/AccessibilityARIAGridCell.cpp:
        (WebCore::AccessibilityARIAGridCell::ariaRowSpanWithRowIndex):
        (WebCore::AccessibilityARIAGridCell::columnIndexRange):
        * accessibility/AccessibilityTableCell.cpp:
        (WebCore::AccessibilityTableCell::rowIndexRange):
        (WebCore::AccessibilityTableCell::columnIndexRange):
        (WebCore::AccessibilityTableCell::ariaColumnSpan):
        (WebCore::AccessibilityTableCell::ariaRowSpan):

2017-05-03  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r216160 and r216161.
        https://bugs.webkit.org/show_bug.cgi?id=171640

        These changes broke the iOS build. (Requested by mlewis13 on
        #webkit).

        Reverted changesets:

        "[MediaStream] Allow host application to enable/disable media
        capture"
        https://bugs.webkit.org/show_bug.cgi?id=171292
        http://trac.webkit.org/changeset/216160

        "[MediaStream] Allow host application to enable/disable media
        capture"
        https://bugs.webkit.org/show_bug.cgi?id=171292
        http://trac.webkit.org/changeset/216161

2017-05-03  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Allow host application to enable/disable media capture
        https://bugs.webkit.org/show_bug.cgi?id=171292
        <rdar://problem/31821492>

        Reviewed by Jer Noble.

        No new layout tests, added an API test instead.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::endStream): New, stop all tracks.
        * Modules/mediastream/MediaStream.h:

        * Modules/mediastream/MediaStreamRegistry.cpp:
        (WebCore::MediaStreamRegistry::unregisterStream): Minor cleanup.
        (WebCore::MediaStreamRegistry::forEach): New, call the lambda with each stream.
        (WebCore::MediaStreamRegistry::MediaStreamRegistry): Deleted, unused.
        * Modules/mediastream/MediaStreamRegistry.h:

        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::stopTrack): Add parameter so caller can specify if an 'ended' 
        event should be sent or not.
        (WebCore::MediaStreamTrack::trackMutedChanged): Don't post an event if the track has ended.
        * Modules/mediastream/MediaStreamTrack.h:

        * dom/Document.cpp:
        (WebCore::Document::stopMediaCapture): Stop all streams in the document.
        * dom/Document.h:

        * page/Page.cpp:
        (WebCore::Page::stopMediaCapture): Stop all streams.
        * page/Page.h:

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Display a black frame
        when the stream ends.
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Signal a characteristics
        change to HTMLMediaElement refresh state.
        * platform/mediastream/MediaStreamPrivate.h:

        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        (WebCore::AVMediaCaptureSource::stopProducingData): Don't return early if the session isn't 
        running, we always need to clear m_session on iOS.

2017-05-03  Zalan Bujtas  <zalan@apple.com>

        SearchInputType could end up with a mismatched renderer.
        https://bugs.webkit.org/show_bug.cgi?id=171547
        <rdar://problem/31935047>

        Reviewed by Antti Koivisto.

        Normally we've got the correct renderer by the time we call into SearchInputType.
        However, since HTMLInputElement::updateType() eagerly updates the type while the associated renderers are done lazily
        (so we don't get them updated until after the next tree update), we could actually end up
        with a mismatched renderer (e.g. through form submission).

        Test: fast/forms/change-input-type-and-submit-form-crash.html

        * html/SearchInputType.cpp:
        (WebCore::SearchInputType::addSearchResult):
        (WebCore::SearchInputType::didSetValueByUserEdit):

2017-05-03  Jer Noble  <jer.noble@apple.com>

        Make the VPIO audio unit a singleton, shared between multiple CaptureSources
        https://bugs.webkit.org/show_bug.cgi?id=171622

        Reviewed by Eric Carlson.

        Move the implemnetation of CoreAudioCaptureSource into a shared singleton class, CoreAudioSharedUnit,
        which will send audio to each of it's client CoreAudioCaptureSources. The first registered client will
        define the settings used by the shared unit.

        Drive-by fixes: Fix up setUseAVFoundationAudioCapture() to always accept the first value set.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioSharedUnit::isProducingData):
        (WebCore::CoreAudioSharedUnit::microphoneFormat):
        (WebCore::CoreAudioSharedUnit::singleton):
        (WebCore::CoreAudioSharedUnit::addClient):
        (WebCore::CoreAudioSharedUnit::removeClient):
        (WebCore::CoreAudioSharedUnit::addEchoCancellationSource):
        (WebCore::CoreAudioSharedUnit::removeEchoCancellationSource):
        (WebCore::CoreAudioSharedUnit::preferredIOBufferSize):
        (WebCore::CoreAudioSharedUnit::setupAudioUnits):
        (WebCore::CoreAudioSharedUnit::configureMicrophoneProc):
        (WebCore::CoreAudioSharedUnit::configureSpeakerProc):
        (WebCore::CoreAudioSharedUnit::checkTimestamps):
        (WebCore::CoreAudioSharedUnit::provideSpeakerData):
        (WebCore::CoreAudioSharedUnit::speakerCallback):
        (WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
        (WebCore::CoreAudioSharedUnit::microphoneCallback):
        (WebCore::CoreAudioSharedUnit::cleanupAudioUnits):
        (WebCore::CoreAudioSharedUnit::startProducingData):
        (WebCore::CoreAudioSharedUnit::stopProducingData):
        (WebCore::CoreAudioSharedUnit::suspend):
        (WebCore::CoreAudioSharedUnit::defaultInputDevice):
        (WebCore::CoreAudioCaptureSource::create):
        (WebCore::CoreAudioCaptureSource::factory):
        (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
        (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
        (WebCore::CoreAudioCaptureSource::addEchoCancellationSource):
        (WebCore::CoreAudioCaptureSource::removeEchoCancellationSource):
        (WebCore::CoreAudioCaptureSource::startProducingData):
        (WebCore::CoreAudioCaptureSource::stopProducingData):
        (WebCore::CoreAudioCaptureSource::audioSourceProvider):
        (WebCore::CoreAudioCaptureSource::preferredSampleRate): Deleted.
        (WebCore::CoreAudioCaptureSource::preferredIOBufferSize): Deleted.
        (WebCore::CoreAudioCaptureSource::configureMicrophoneProc): Deleted.
        (WebCore::CoreAudioCaptureSource::configureSpeakerProc): Deleted.
        (WebCore::CoreAudioCaptureSource::checkTimestamps): Deleted.
        (WebCore::CoreAudioCaptureSource::provideSpeakerData): Deleted.
        (WebCore::CoreAudioCaptureSource::speakerCallback): Deleted.
        (WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Deleted.
        (WebCore::CoreAudioCaptureSource::microphoneCallback): Deleted.
        (WebCore::CoreAudioCaptureSource::cleanupAudioUnits): Deleted.
        (WebCore::CoreAudioCaptureSource::defaultInputDevice): Deleted.
        (WebCore::CoreAudioCaptureSource::setupAudioUnits): Deleted.
        (WebCore::CoreAudioCaptureSource::suspend): Deleted.
        (WebCore::CoreAudioCaptureSource::resume): Deleted.
        * platform/mediastream/mac/CoreAudioCaptureSource.h:
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture):

2017-05-03  Jer Noble  <jer.noble@apple.com>

        getUserMedia() fails because devices list is empty / inactive
        https://bugs.webkit.org/show_bug.cgi?id=171626

        Reviewed by Eric Carlson.

        When creating a AVAudioSessionCaptureDevice, set the device's enabled state to true if the port description
        has any items in its dataSources property (which is the best analogue to "isActive" we have in AVAudioSession).

        Also, when creating the generic list of CaptureDevices, use the copy constructor to ensure the enabled state
        gets copied to the new generic device.

        * platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:
        (WebCore::AVAudioSessionCaptureDevice::create):
        * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
        (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):

2017-05-03  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Implement the imageready event to reliably test the async image decoding
        https://bugs.webkit.org/show_bug.cgi?id=171016

        Reviewed by Simon Fraser.

        The event will be fired for each client of the image. Firing the event
        will happen after finishing the decoding and repainting the client.

        Existing tests will be modified in a separate patch to use this event.

        * dom/Element.cpp:
        (WebCore::Element::dispatchWebKitImageReadyEventForTesting):
        * dom/Element.h:
        * page/Settings.in:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::imageFrameAvailable):

2017-05-03  Tim Horton  <timothy_horton@apple.com>

        Maintain interaction information URL as a URL, not a string
        https://bugs.webkit.org/show_bug.cgi?id=171623

        Reviewed by Simon Fraser.

        No new tests, not a behavior change.

        * platform/URL.h:

2017-05-03  Yoav Weiss  <yoav@yoav.ws>

        Link preload HTMLPreloadScanner support
        https://bugs.webkit.org/show_bug.cgi?id=170747

        Reviewed by Youenn Fablet.

        Test: http/tests/preload/preloadscanner_download_resources.html

        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): Initialize link preload flag.
        (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): Create a request only if the type is known (so ignore
        preloads with unknown type).
        (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Add handling for link preload and the `as` attribute.
        (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet): Get LinkRelAttribute as input.
        (WebCore::TokenPreloadScanner::StartTagScanner::resourceType): Return an std::optional, in case the preload type is unknown.
        (WebCore::TokenPreloadScanner::StartTagScanner::shouldPreload): Return true for the link preload case.
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::preload): Return the resource rather than a nullptr if it's already in m_preloads.

2017-05-03  Michael Catanzaro  <mcatanzaro@igalia.com>

        YouTube user agent quirk breaks new YouTube
        https://bugs.webkit.org/show_bug.cgi?id=171603

        Reviewed by Carlos Garcia Campos.

        Our user agent quirk to make YouTube 360 work breaks the new YouTube UI, causing it to
        attempt to use the obsolete custom elements v0 API. WebKit only supports the v1 API. We
        have to remove this quirk.

        Note this does not affect Safari as Apple ports don't use our user agent quirks.

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

2017-05-03  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: 404 Image Load does not appear as a failure in Web Inspector
        https://bugs.webkit.org/show_bug.cgi?id=171587
        <rdar://problem/13222846>

        Reviewed by Matt Baker.

        * inspector/InspectorPageAgent.h:
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::cachedResourceContent):
        (WebCore::prepareCachedResourceBuffer): Deleted.
        Inline the function to make this less confusing.

        (WebCore::InspectorPageAgent::buildObjectForFrameTree):
        Treat a DecodeError as a failure.

2017-05-03  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Async image decoding should be disabled for snapshots, printing and preview
        https://bugs.webkit.org/show_bug.cgi?id=171467
 
        Reviewed by Simon Fraser.
 
        Asynchronous image decoding should only be used for window display where
        RenderElements can be repainted and painted. For cases where there is only
        one chance to draw the image, synchronous decoding should be used. 

        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintIntoRect):

2017-05-03  Nan Wang  <n_wang@apple.com>

        AX: VO skips cells after cell with aria-colspan
        https://bugs.webkit.org/show_bug.cgi?id=171579

        Reviewed by Chris Fleizach.

        We should consider the previous cells' column span value when
        calculating the column index.

        Test: accessibility/mac/aria-grid-column-span.html

        * accessibility/AccessibilityARIAGridCell.cpp:
        (WebCore::AccessibilityARIAGridCell::columnIndexRange):

2017-05-03  Jiewen Tan  <jiewen_tan@apple.com>

        ASSERTION FAILED: m_scriptExecutionContext->isContextThread() seen with LayoutTest crypto/workers/crypto-random-values-limits-worker.html
        https://bugs.webkit.org/show_bug.cgi?id=171462
        <rdar://problem/31906859>

        Reviewed by Brent Fulgham.

        Covered by existing tests.

        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
        Clear Crypto early in destruction since its ContextDestructionObserver
        destruction makes checks about the WorkerThread.

2017-05-03  Zalan Bujtas  <zalan@apple.com>

        RenderSearchField should not use isTextField() in SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT
        https://bugs.webkit.org/show_bug.cgi?id=171608

        Reviewed by Simon Fraser.

        isTextField() is true for any generic single line text control.

        * rendering/RenderObject.h:
        (WebCore::RenderObject::isSearchField):
        * rendering/RenderSearchField.h:

2017-05-03  Frederic Wang  <fwang@igalia.com>

        Remove ScrollingCoordinator::supportsFixedPositionLayers()
        https://bugs.webkit.org/show_bug.cgi?id=171557

        Reviewed by Simon Fraser.

        No new tests, behavior is not changed.

        * page/FrameView.cpp:
        (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
        * page/scrolling/AsyncScrollingCoordinator.cpp:
        (WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode):
        * page/scrolling/AsyncScrollingCoordinator.h:
        * page/scrolling/ScrollingCoordinator.cpp:
        (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
        * page/scrolling/ScrollingCoordinator.h:
        (WebCore::ScrollingCoordinator::supportsFixedPositionLayers): Deleted.
        * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
        (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode):
        * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h:
        (): Deleted.
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

2017-05-03  Chris Dumez  <cdumez@apple.com>

        Use PassRefPtr less in CompositeEditCommand
        https://bugs.webkit.org/show_bug.cgi?id=171590

        Reviewed by Sam Weinig.

        Use PassRefPtr less in CompositeEditCommand.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * editing/ApplyStyleCommand.cpp:
        (WebCore::hasNoAttributeOrOnlyStyleAttribute):
        (WebCore::isStyleSpanOrSpanWithOnlyStyleAttribute):
        (WebCore::isSpanWithoutAttributesOrUnstyledStyleSpan):
        (WebCore::isEmptyFontTag):
        (WebCore::ApplyStyleCommand::doApply):
        (WebCore::ApplyStyleCommand::applyBlockStyle):
        (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
        (WebCore::dummySpanAncestorForNode):
        (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
        (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
        (WebCore::ApplyStyleCommand::applyInlineStyle):
        (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
        (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
        (WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
        (WebCore::ApplyStyleCommand::removeConflictingInlineStyleFromRun):
        (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
        (WebCore::ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes):
        (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
        (WebCore::ApplyStyleCommand::removeCSSStyle):
        (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
        (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
        (WebCore::ApplyStyleCommand::removeInlineStyle):
        (WebCore::ApplyStyleCommand::shouldSplitTextElement):
        (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
        (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
        (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
        (WebCore::ApplyStyleCommand::addBlockStyle):
        (WebCore::ApplyStyleCommand::joinChildTextNodes):
        * editing/ApplyStyleCommand.h:
        (WebCore::ApplyStyleCommand::shouldRemoveInlineStyleFromElement):
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::removeChildrenInRange):
        (WebCore::CompositeEditCommand::mergeIdenticalElements):
        (WebCore::CompositeEditCommand::insertTextIntoNode):
        (WebCore::CompositeEditCommand::deleteTextFromNode):
        (WebCore::CompositeEditCommand::replaceTextInNode):
        (WebCore::CompositeEditCommand::replaceSelectedTextInNode):
        (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
        (WebCore::CompositeEditCommand::removeNodeAttribute):
        (WebCore::CompositeEditCommand::rebalanceWhitespaceAt):
        (WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
        (WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
        (WebCore::CompositeEditCommand::deleteInsignificantText):
        (WebCore::CompositeEditCommand::removePlaceholderAt):
        (WebCore::CompositeEditCommand::cleanupAfterDeletion):
        (WebCore::CompositeEditCommand::moveParagraphs):
        * editing/CompositeEditCommand.h:
        * editing/DeleteFromTextNodeCommand.cpp:
        (WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
        (WebCore::DeleteFromTextNodeCommand::doApply):
        (WebCore::DeleteFromTextNodeCommand::doUnapply):
        (WebCore::DeleteFromTextNodeCommand::getNodesInCommand):
        * editing/DeleteFromTextNodeCommand.h:
        (WebCore::DeleteFromTextNodeCommand::create):
        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::deleteTextFromNode):
        (WebCore::DeleteSelectionCommand::handleGeneralDelete):
        (WebCore::DeleteSelectionCommand::fixupWhitespace):
        * editing/DeleteSelectionCommand.h:
        * editing/EditingAllInOne.cpp:
        * editing/EditingStyle.cpp:
        (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
        (WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl):
        (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
        (WebCore::EditingStyle::wrappingStyleForSerialization):
        (WebCore::styleFromMatchedRulesForElement):
        (WebCore::EditingStyle::mergeStyleFromRules):
        (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
        (WebCore::EditingStyle::removeStyleFromRulesAndContext):
        (WebCore::EditingStyle::removePropertiesInElementDefaultStyle):
        * editing/EditingStyle.h:
        * editing/IndentOutdentCommand.cpp:
        (WebCore::IndentOutdentCommand::tryIndentingAsListItem):
        * editing/InsertIntoTextNodeCommand.cpp:
        (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
        (WebCore::InsertIntoTextNodeCommand::getNodesInCommand):
        * editing/InsertIntoTextNodeCommand.h:
        (WebCore::InsertIntoTextNodeCommand::create):
        * editing/InsertLineBreakCommand.cpp:
        (WebCore::InsertLineBreakCommand::doApply):
        * editing/InsertListCommand.cpp:
        (WebCore::InsertListCommand::mergeWithNeighboringLists):
        (WebCore::InsertListCommand::listifyParagraph):
        * editing/InsertParagraphSeparatorCommand.cpp:
        (WebCore::InsertParagraphSeparatorCommand::doApply):
        * editing/InsertTextCommand.cpp:
        (WebCore::InsertTextCommand::performOverwrite):
        (WebCore::InsertTextCommand::doApply):
        (WebCore::InsertTextCommand::insertTab):
        * editing/MergeIdenticalElementsCommand.cpp:
        (WebCore::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand):
        (WebCore::MergeIdenticalElementsCommand::doApply):
        (WebCore::MergeIdenticalElementsCommand::doUnapply):
        (WebCore::MergeIdenticalElementsCommand::getNodesInCommand):
        * editing/MergeIdenticalElementsCommand.h:
        (WebCore::MergeIdenticalElementsCommand::create):
        * editing/RemoveCSSPropertyCommand.cpp: Removed.
        * editing/RemoveCSSPropertyCommand.h: Removed.
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
        (WebCore::ReplaceSelectionCommand::doApply):
        (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
        (WebCore::ReplaceSelectionCommand::mergeTextNodesAroundPosition):
        * editing/markup.cpp:
        (WebCore::StyledMarkupAccumulator::appendElement):
        (WebCore::styleFromMatchedRulesAndInlineDecl):
        (WebCore::createMarkupInternal):

2017-05-03  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: Treat cells with ARIA table cell properties as cells
        https://bugs.webkit.org/show_bug.cgi?id=171178

        Reviewed by Chris Fleizach.

        Add the following checks to heuristics in AccessibilityTable::isDataTable():
        1. If the author has provided a valid aria-rowcount or aria-colcount value on
           the table element, expose it as a data table.
        2. If the author has provided a valid aria-colindex or aria-rowindex on the
           cell element, expose it as a data table.
        3. If the author has provided a valid aria-rowindex on the row element, expose
           it as a data table.
        4. If the author has provided a value for aria-colspan or aria-rowspan on a cell,
           expose it as a data table (even though we are supposed to ignore the value for
           the purpose of exposing the span via platform accessibility APIs)

        Remove the heuristic that a table with only one cell is "not a good AXTable candidate."
        It prevents us from ever doing the above checks.

        Test: accessibility/minimal-table-with-aria-is-data-table.html

        * accessibility/AccessibilityTable.cpp:
        (WebCore::AccessibilityTable::isDataTable):

2017-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [Cairo] Handle extended colors in gradients
        https://bugs.webkit.org/show_bug.cgi?id=171596

        Reviewed by Michael Catanzaro.

        Check if every gradient color step is an extended color and use asExtended() instead of getRGBA() in such case.

        Fixes: css3/color/gradients.html

        * platform/graphics/cairo/GradientCairo.cpp:
        (WebCore::Gradient::platformGradient):

2017-05-03  Daniel Bates  <dabates@apple.com>

        Abandon the current load once the provisional loader detaches from the frame
        https://bugs.webkit.org/show_bug.cgi?id=171577
        <rdar://problem/31581227>

        Reviewed by Brent Fulgham and Brady Eidson.

        We detach all child frames as part of setting our document loader to the provisional
        document loader when committing a load for a frame. Detaching child frames invokes
        the unload event handler on the child frames that can run arbitrary JavaScript script.
        Among other things, such script can initiate a new load in the frame whose current
        load is being committed. We should stop processing the current load as soon as we
        detect that updating our document loader has started a new provisional load.

        Test: fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash.html

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::transitionToCommitted):

2017-05-03  Daniel Bates  <dabates@apple.com>

        Cleanup: Remove out-of-date comment and null check from DocumentLoader::detachFromFrame()
        https://bugs.webkit.org/show_bug.cgi?id=171604

        Reviewed by Brady Eidson.

        We no longer want to passively allow DocumentLoader::detachFromFrame() to be called twice.
        It does not make sense to be called twice and should never be called twice. A release assert
        in DocumentLoader::cancelPolicyCheckIfNeeded() (added in r187558) called by DocumentLoader::detachFromFrame()
        enforces this invariant. Therefore we can remove the null check of DocumentLoader::m_frame
        and the comment that explains the purpose of this null check from DocumentLoader::detachFromFrame().

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

2017-05-03  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed attempt to fix the Windows build after r216117.
        https://bugs.webkit.org/show_bug.cgi?id=171601

        * css/CSSAllInOne.cpp:

2017-05-03  Antti Koivisto  <antti@apple.com>

        Rename StyleInvalidationAnalysis to Style::Invalidator
        https://bugs.webkit.org/show_bug.cgi?id=171601

        Reviewed by Žan Doberšek.

        Also move it to the 'style' directory.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/StyleInvalidationAnalysis.cpp: Removed.
        * css/StyleInvalidationAnalysis.h: Removed.
        * dom/ExtensionStyleSheets.cpp:
        * style/AttributeChangeInvalidation.cpp:
        (WebCore::Style::AttributeChangeInvalidation::invalidateDescendants):
        * style/ClassChangeInvalidation.cpp:
        (WebCore::Style::ClassChangeInvalidation::invalidateDescendantStyle):
        * style/StyleInvalidator.cpp: Copied from Source/WebCore/css/StyleInvalidationAnalysis.cpp.
        (WebCore::Style::Invalidator::Invalidator):
        (WebCore::Style::Invalidator::invalidateIfNeeded):
        (WebCore::Style::Invalidator::invalidateStyleForTree):
        (WebCore::Style::Invalidator::invalidateStyle):
        (WebCore::shouldDirtyAllStyle): Deleted.
        (WebCore::StyleInvalidationAnalysis::StyleInvalidationAnalysis): Deleted.
        (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded): Deleted.
        (WebCore::StyleInvalidationAnalysis::invalidateStyleForTree): Deleted.
        (WebCore::StyleInvalidationAnalysis::invalidateStyle): Deleted.
        * style/StyleInvalidator.h: Copied from Source/WebCore/css/StyleInvalidationAnalysis.h.
        (WebCore::StyleInvalidationAnalysis::dirtiesAllStyle): Deleted.
        (WebCore::StyleInvalidationAnalysis::hasShadowPseudoElementRulesInAuthorSheet): Deleted.
        * style/StyleScope.cpp:
        (WebCore::Style::Scope::resolver):
        (WebCore::Style::Scope::analyzeStyleSheetChange):

2017-05-02  Andrew Gold  <agold@apple.com>

        Typo in AVAudioSessionCaptureDeviceManager.mm
        https://bugs.webkit.org/show_bug.cgi?id=171572

        Reviewed by Jer Noble.

        We attempt to call +[AVAudioSession sharedSession], but the actual method is 
        called +[AVAudioSession sharedInstance].

        * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
        (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):

2017-05-02  Simon Fraser  <simon.fraser@apple.com>

        Improve scrolling tree logging
        https://bugs.webkit.org/show_bug.cgi?id=171574

        Reviewed by Tim Horton.

        Make a call to showScrollingStateTree() print debugging-related information like node and layer IDs.
        Required fixing scrolling state tree nodes to respect ScrollingStateTreeAsTextBehavior, and fixing
        fixed and sticky nodes to call super.

        Also enhance compositing logging to show layer IDs, and to log for layer scrolling tree registration.

        * page/scrolling/AsyncScrollingCoordinator.cpp:
        (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
        * page/scrolling/AsyncScrollingCoordinator.h:
        * page/scrolling/ScrollingCoordinator.cpp:
        (WebCore::ScrollingCoordinator::scrollingStateTreeAsText):
        * page/scrolling/ScrollingCoordinator.h:
        * page/scrolling/ScrollingStateFixedNode.cpp:
        (WebCore::ScrollingStateFixedNode::dumpProperties):
        * page/scrolling/ScrollingStateNode.cpp:
        (WebCore::ScrollingStateNode::dumpProperties):
        (WebCore::ScrollingStateNode::scrollingStateTreeAsText):
        * page/scrolling/ScrollingStateNode.h:
        * page/scrolling/ScrollingStateScrollingNode.cpp:
        (WebCore::ScrollingStateScrollingNode::dumpProperties):
        * page/scrolling/ScrollingStateStickyNode.cpp:
        (WebCore::ScrollingStateStickyNode::dumpProperties):
        * page/scrolling/ScrollingStateTree.cpp:
        (showScrollingStateTree):
        * page/scrolling/mac/ScrollingCoordinatorMac.mm:
        (WebCore::ScrollingCoordinatorMac::commitTreeState):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::logLayerInfo):
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):

2017-05-02  Daniel Bates  <dabates@apple.com>

        Using StringView.split() instead of String.split() in some places
        https://bugs.webkit.org/show_bug.cgi?id=170925

        Reviewed by Darin Adler and Sam Weinig.

        Replace some uses of String.split() with StringView.split() (added in r211087) as the latter
        avoids the need to allocate an intermediary Vector of substrings. Instead StringView.split()
        returns an iterator for traversing the substrings.

        No functionality changed. So, no new tests.

        * accessibility/AccessibilityObject.cpp: Convert some typedefs to modern C++ using declarations.
        (WebCore::AccessibilityObject::ariaRoleToWebCoreRole): Modified code to use StringView.split().
        (WebCore::AccessibilityObject::elementsFromAttribute): Ditto.
        * dom/TreeScope.cpp:
        (WebCore::TreeScope::getElementById): Added.
        * dom/TreeScope.h:
        * html/LinkRelAttribute.cpp:
        (WebCore::LinkRelAttribute::LinkRelAttribute): Modified code to use StringView.split().
        * html/parser/XSSAuditor.cpp:
        (WebCore::semicolonSeparatedValueContainsJavaScriptURL): Ditto.
        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
        (WebCore::CDMPrivateMediaSourceAVFObjC::createSession): Ditto.
        * platform/network/CacheValidation.cpp:
        (WebCore::collectVaryingRequestHeaders): Simplify code by using the String.split(UChar, Vector<String>&) overload.
        * svg/SVGAnimationElement.cpp:
        (WebCore::parseKeyTimes): Modified code to use StringView.split().
        * svg/SVGToOTFFontConversion.cpp:
        (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Ditto.
        * testing/Internals.cpp:
        (WebCore::Internals::setMediaSessionRestrictions): Ditto.
        (WebCore::Internals::setMediaElementRestrictions): Ditto.
        (WebCore::Internals::setAudioContextRestrictions): Ditto.
        (WebCore::Internals::setPageMuted): Ditto.
        * testing/Internals.h:

2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>

        [GTK] Drop coordinated surfaces from the compositing thread as soon as possible
        https://bugs.webkit.org/show_bug.cgi?id=171544

        Reviewed by Žan Doberšek.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
        Remove atlasesToRemove from the GraphicsState. It is not a commit
        state anymore.

2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>

        [GTK] Recycle textures while handling tiles
        https://bugs.webkit.org/show_bug.cgi?id=171541

        Reviewed by Žan Doberšek.

        * platform/graphics/texmap/TextureMapperTile.h:
        Modified m_texture as a protected member to avoid unnessary
        refcountings from the CoordinatedBackingStore.
        * platform/graphics/texmap/coordinated/CoordinatedSurface.h:
        Use reference instead of RefPtr to pass BitmapTexture

        No new tests since there should be no change in behavior.

2017-05-02  Zalan Bujtas  <zalan@apple.com>

        Defer AX cache update when text content changes until after layout is finished.
        https://bugs.webkit.org/show_bug.cgi?id=171429
        <rdar://problem/31885984>

        Reviewed by Simon Fraser.

        When the content of the RenderText changes (even as the result of a text-transform change)
        instead of updating the AX cache eagerly (and trigger layout on a half-backed render tree)
        we should just defer it until after the subsequent layout is done. 

        Test: accessibility/crash-while-adding-text-child-with-transform.html

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::remove):
        (WebCore::AXObjectCache::performDeferredCacheUpdate):
        (WebCore::AXObjectCache::recomputeDeferredIsIgnored):
        (WebCore::AXObjectCache::deferTextChanged):
        (WebCore::AXObjectCache::performDeferredIsIgnoredChange): Deleted.
        * accessibility/AXObjectCache.h:
        (WebCore::AXObjectCache::deferTextChanged):
        (WebCore::AXObjectCache::performDeferredCacheUpdate):
        (WebCore::AXObjectCache::performDeferredIsIgnoredChange): Deleted.
        * page/FrameView.cpp:
        (WebCore::FrameView::performPostLayoutTasks):
        * rendering/RenderText.cpp:
        (WebCore::RenderText::setText):

2017-05-02  Wenson Hsieh  <wenson_hsieh@apple.com>

        Remove an extraneous call to dispatch_group_async in WebItemProviderPasteboard.mm
        https://bugs.webkit.org/show_bug.cgi?id=171561

        Reviewed by Tim Horton.

        In -[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:], the lifetime of the dispatch group
        `fileLoadingGroup` is already guarded by dispatch_group_enter/leave calls when beginning and concluding an
        item provider load, respectively. As such, the call to dispatch_group_async serves no purpose and should be removed.

        No new tests, since there is no change in behavior.

        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):

2017-05-02  Youenn Fablet  <youenn@apple.com>

        [LibWebRTC] Set explicitly logging level in debug mode
        https://bugs.webkit.org/show_bug.cgi?id=171562

        Reviewed by Eric Carlson.

        No change of behavior.

        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::initializePeerConnectionFactoryAndThreads): Setting explictly LibWebRTC logging to Info level for
        debug builds if WebRTC channel is on.

2017-05-02  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: Update implementation of aria-orientation
        https://bugs.webkit.org/show_bug.cgi?id=171166

        Reviewed by Chris Fleizach.

        Update AccessibilityRenderObject::orientation() to be consistent with what is
        in the ARIA 1.1 spec. Also add an isTreeGrid() convenience method to be consistent
        with what we do for other roles.

        Test: accessibility/aria-orientation.html

        * accessibility/AccessibilityARIAGridRow.cpp:
        (WebCore::AccessibilityARIAGridRow::isARIATreeGridRow):
        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityObject::isTreeGrid):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::orientation):

2017-05-02  Myles C. Maxfield  <mmaxfield@apple.com>

        REGRESSION (r211382): Partial right-to-left text runs are painted at an offset (breaks Find indicators, Look Up, and custom ::selection style)
        https://bugs.webkit.org/show_bug.cgi?id=169517
        <rdar://problem/30652443>

        Reviewed by Dean Jackson.

        FontCascade::getGlyphsAndAdvancesForComplexText() is tasked with calculating paint advances for a
        subrange of RTL text. It does this by creating a ComplexTextController, telling it to iterate to
        the beginning of the subrange (outputting to a GlyphBuffer), then telling it to iterate to the end
        of the subrange (outputting to another GlyphBuffer). Because the text is RTL, the sum of the
        advances gathered so far is the distance from the right edge of the text to the left edge of the
        subrange (because we advance in logical order). Therefore, the x-coordinate we are at now is the
        total width minus the sum of both of the GlyphBuffers. For some reason, when I wrote this code I
        forgot to add in the contribution from the first GlyphBuffer. Unfortunately, this particular
        codepath is rarely hit in practice and completely untested, which made me miss it when I wrote it.

        Test: fast/text/complex-text-selection.html

        * platform/graphics/cocoa/FontCascadeCocoa.mm:
        (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):

2017-05-02  Chris Dumez  <cdumez@apple.com>

        [macOS] Flaky Crash under EventTarget::fireEventListeners on imported/blink/paint/deprecatedpaintlayer/non-self-painting-layer-overrides-visibility.html
        https://bugs.webkit.org/show_bug.cgi?id=171406
        <rdar://problem/30945281>

        Reviewed by Eric Carlson.

        I was unfortunately unable to reproduce the flaky crash locally. However, the crash trace
        indicates that one of the EventTarget::scriptExecutionContext() overrides is returning a
        stale ScriptExecutionContext pointer. Since a GenericEventQueue is involved, the EventTarget
        is likely a media-related object. I therefore audited media classes that override
        EventTarget::scriptExecutionContext() and found several that look unsafe. I am fixing those
        by having them override ContextDestructionObserver, instead of having a raw
        ScriptExecutionContext pointer member. This makes sure the pointer gets nulled out whenever
        the scriptexecutioncontext gets destroyed, ensuring that those classes's
        EventTarget::scriptExecutionContext() overrides can never return a stale pointer.

        * Modules/mediasource/SourceBufferList.cpp:
        (WebCore::SourceBufferList::SourceBufferList):
        * Modules/mediasource/SourceBufferList.h:
        * html/track/TextTrack.cpp:
        (WebCore::TextTrack::TextTrack):
        * html/track/TextTrack.h:
        * html/track/TrackListBase.cpp:
        (TrackListBase::TrackListBase):
        * html/track/TrackListBase.h:

2017-05-02  Antti Koivisto  <antti@apple.com>

        Document style resolvers should share user rulesets
        https://bugs.webkit.org/show_bug.cgi?id=171549

        Reviewed by Andreas Kling.

        Large user stylesheets (like those used by ad blockers) can end up using lots of memory if
        a document uses large number of shadow trees. User style is inherently per-document and
        the resulting rulesets can be shared between the document and the shadow trees.

        * css/DocumentRuleSets.cpp:
        (WebCore::DocumentRuleSets::DocumentRuleSets):
        (WebCore::DocumentRuleSets::userStyle):

            Return per-document user style for shadow trees.

        (WebCore::DocumentRuleSets::collectFeatures):
        * css/DocumentRuleSets.h:
        (WebCore::DocumentRuleSets::setUsesSharedUserStyle):
        (WebCore::DocumentRuleSets::userStyle): Deleted.
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::StyleResolver):
        (WebCore::StyleResolver::initializeUserStyle):

            Separate user style initialization from construction.

        * css/StyleResolver.h:
        * style/StyleScope.cpp:
        (WebCore::Style::Scope::resolver):

            Don't initialize user style for user agents shadow trees.

2017-05-02  Myles C. Maxfield  <mmaxfield@apple.com>

        Font Loading API specifies font is loaded but sizing of font after load reports inconsistent values
        https://bugs.webkit.org/show_bug.cgi?id=168533

        Reviewed by Zalan Bujtas.

        Previously, we were marking all local() fonts as immediately successful,
        regardless of whether or not they were present on the system. Instead, we
        should use the load() function to make this determination and mark the font
        as failed if it doesn't exist. (This is, after all, the whole point of the
        load() function). This brings us in-line with Firefox's and Chrome's
        behavior.

        Test: fast/text/font-loading-local.html

        * css/CSSFontFace.cpp:
        (WebCore::CSSFontFace::pump): Remote loading requires the FontSelector,
        but it isn't available for local fonts. Now that load() is called for both
        local and remote fonts, the ASSERT() should be lowered into the load()
        function and scoped to just the case where we have a remote font.
        (WebCore::CSSFontFace::font): Ditto.
        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::CSSFontFaceSource): Don't immediatley set
        the success/failure state for local fonts.
        (WebCore::CSSFontFaceSource::load): Move loading logic from font() to
        load(). None of this code is new; it just is moved.
        (WebCore::CSSFontFaceSource::font): Delete code moved to load().
        * css/CSSFontFaceSource.h:
        * css/FontFace.cpp:
        (WebCore::FontFace::create):

2017-05-02  Youenn Fablet  <youenn@apple.com>

        Allow media stream based videos with sound to autoplay if the page is already playing sound
        https://bugs.webkit.org/show_bug.cgi?id=171447

        Reviewed by Eric Carlson.

        Test: http/tests/media/autoplay-if-audio-is-playing.html for ensuring non-mediastream based video will not autoplay.
        Manual testing for the autoplay of media stream based videos since such a test should happen without using getUserMedia.

        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::playbackPermitted):

2017-05-02  Chris Dumez  <cdumez@apple.com>

        Use PassRefPtr less in editing code
        https://bugs.webkit.org/show_bug.cgi?id=171534

        Reviewed by Geoffrey Garen.

        Use PassRefPtr less in editing code.

        * editing/AppendNodeCommand.cpp:
        (WebCore::AppendNodeCommand::AppendNodeCommand):
        (WebCore::AppendNodeCommand::getNodesInCommand):
        * editing/AppendNodeCommand.h:
        (WebCore::AppendNodeCommand::create):
        * editing/ApplyStyleCommand.cpp:
        (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
        (WebCore::ApplyStyleCommand::positionToComputeInlineStyleChange):
        * editing/BreakBlockquoteCommand.cpp:
        (WebCore::BreakBlockquoteCommand::doApply):
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::insertNodeBefore):
        (WebCore::CompositeEditCommand::insertNodeAfter):
        (WebCore::CompositeEditCommand::insertNodeAt):
        (WebCore::CompositeEditCommand::appendNode):
        (WebCore::CompositeEditCommand::moveRemainingSiblingsToNewParent):
        (WebCore::CompositeEditCommand::mergeIdenticalElements):
        (WebCore::CompositeEditCommand::insertNodeAtTabSpanPosition):
        (WebCore::CompositeEditCommand::appendBlockPlaceholder):
        (WebCore::CompositeEditCommand::insertBlockPlaceholder):
        (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
        (WebCore::CompositeEditCommand::insertNewDefaultParagraphElementAt):
        (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
        (WebCore::CompositeEditCommand::moveParagraphs):
        * editing/CompositeEditCommand.h:
        * editing/CreateLinkCommand.cpp:
        (WebCore::CreateLinkCommand::doApply):
        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
        (WebCore::DeleteSelectionCommand::mergeParagraphs):
        * editing/FormatBlockCommand.cpp:
        (WebCore::FormatBlockCommand::formatRange):
        * editing/IndentOutdentCommand.cpp:
        (WebCore::IndentOutdentCommand::tryIndentingAsListItem):
        (WebCore::IndentOutdentCommand::indentIntoBlockquote):
        (WebCore::IndentOutdentCommand::outdentParagraph):
        * editing/InsertLineBreakCommand.cpp:
        (WebCore::InsertLineBreakCommand::doApply):
        * editing/InsertLineBreakCommand.h:
        * editing/InsertListCommand.cpp:
        (WebCore::InsertListCommand::fixOrphanedListChild):
        (WebCore::InsertListCommand::doApplyForSingleParagraph):
        (WebCore::InsertListCommand::unlistifyParagraph):
        (WebCore::InsertListCommand::listifyParagraph):
        * editing/InsertListCommand.h:
        * editing/InsertNodeBeforeCommand.cpp:
        (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
        (WebCore::InsertNodeBeforeCommand::doApply):
        (WebCore::InsertNodeBeforeCommand::doUnapply):
        (WebCore::InsertNodeBeforeCommand::getNodesInCommand):
        * editing/InsertNodeBeforeCommand.h:
        (WebCore::InsertNodeBeforeCommand::create):
        * editing/InsertParagraphSeparatorCommand.cpp:
        (WebCore::InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock):
        (WebCore::InsertParagraphSeparatorCommand::doApply):
        * editing/InsertParagraphSeparatorCommand.h:
        * editing/InsertTextCommand.cpp:
        (WebCore::InsertTextCommand::positionInsideTextNode):
        (WebCore::InsertTextCommand::insertTab):
        * editing/ModifySelectionListLevel.cpp:
        (WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeBefore):
        (WebCore::ModifySelectionListLevelCommand::insertSiblingNodeRangeAfter):
        (WebCore::ModifySelectionListLevelCommand::appendSiblingNodeRange):
        (WebCore::IncreaseSelectionListLevelCommand::doApply):
        * editing/RemoveNodePreservingChildrenCommand.cpp:
        (WebCore::RemoveNodePreservingChildrenCommand::doApply):
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
        (WebCore::ReplaceSelectionCommand::mergeEndIfNeeded):
        (WebCore::ReplaceSelectionCommand::doApply):
        (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
        (WebCore::ReplaceSelectionCommand::insertAsListItems):
        * editing/SimplifyMarkupCommand.cpp:
        (WebCore::SimplifyMarkupCommand::pruneSubsequentAncestorsToRemove):

2017-05-02  Ben Kelly <ben@wanderview.com>

        Set Response.blob() type correctly when body is a ReadableStream.
        https://bugs.webkit.org/show_bug.cgi?id=171489

        Reviewed by Youenn Fablet

        The Fetch API specification requires setting the blob contentType
        using the Content-Type header value, if present.  Currently WebKit
        only sets the type on the FetchBodyConsumer when FetchBody::blob()
        is called.  Unfortunately, this is never called if the body is
        actually a ReadableStream.

        This change allows WebKit to pass the "Consume response's body: from
        stream to blob" case in the WPT response-consume.html test.

        Test: http://w3c-test.org/fetch/api/response/response-consume.html

        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::startConsumingStream): Modified to call
        FetchBodyConsumer::setContentType() before processing the stream.

2017-05-02  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r216069.

        This change broke the build.

        Reverted changeset:

        "Document style resolvers should share user rulesets"
        https://bugs.webkit.org/show_bug.cgi?id=171549
        http://trac.webkit.org/changeset/216069

2017-05-02  Antti Koivisto  <antti@apple.com>

        Document style resolvers should share user rulesets
        https://bugs.webkit.org/show_bug.cgi?id=171549

        Reviewed by Andreas Kling.

        Large user stylesheets (like those used by ad blockers) can end up using lots of memory if
        a document uses large number of shadow trees. User style is inherently per-document and
        the resulting rulesets can be shared between the document and the shadow trees.

        * css/DocumentRuleSets.cpp:
        (WebCore::DocumentRuleSets::DocumentRuleSets):
        (WebCore::DocumentRuleSets::userStyle):

            Return per-document user style for shadow trees.

        (WebCore::DocumentRuleSets::collectFeatures):
        * css/DocumentRuleSets.h:
        (WebCore::DocumentRuleSets::setUsesSharedUserStyle):
        (WebCore::DocumentRuleSets::userStyle): Deleted.
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::StyleResolver):
        (WebCore::StyleResolver::initializeUserStyle):

            Separate user style initialization from construction.

        * css/StyleResolver.h:
        * style/StyleScope.cpp:
        (WebCore::Style::Scope::resolver):

            Don't initialize user style for user agents shadow trees.

2017-05-02  Gwang Yoon Hwang  <yoon@igalia.com>

        [GTK] Remove undefined nativeImage method from the ImageBuffer's header
        https://bugs.webkit.org/show_bug.cgi?id=171502

        Unreviewed, remove a dead code accidentally committed in r194630.

        * platform/graphics/ImageBuffer.h: Remove nativeImage method.
        It is accidentally added during a refectorying at r194630, and there is
        no definition for this method.

2017-05-02  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GStreamer] Dailymotion live stream videos don't play
        https://bugs.webkit.org/show_bug.cgi?id=170767

        Reviewed by Sergio Villar Senin.

        The video shows a message saying that an error occurred and nothing is played. There are actually several
        problems with dailymotion. The main issue is that URLs are redirected by the server, and GStreamer needs to
        know the redirected URL. Once GStreamer knows the redirected URL the error message no longer appears, the video
        starts but it always stops after a few seconds. This is because the source receives an early EOS while still
        downloading the fragments. The reason of the early EOS is because dailymotion sends a wrong Content-Length header,
        something that is expected to happen and we correctly handle that case when receiving the data, by updating the
        size accordingly if the bytes received are longer than the expected content length. This particular case
        doesn't work well with GStreamer automatic EOS handling, which is the default. At some point, GStreamer detects
        that the bytes received are at least the expected ones and emits a GST_EVENT_EOS that the GstUriDownloader
        handles finishing the download early. We should always disable automatic EOS, since we know when EOS actually
        happens and we already call gst_app_src_end_of_stream(). This patch also emits a GST_EVENT_CUSTOM_DOWNSTREAM_STICKY
        event to let GStreamer know about the HTTP headers sent and received.

        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (webkit_web_src_init): Disable automatic EOS.
        (webKitWebSrcGetProperty): Return the redirected URL in case of redirection.
        (webKitWebSrcStart): Pass the ResourceRequest to the stream clients.
        (webKitWebSrcQueryWithParent): Set the redirected URL in the query in case of redirection.
        (webKitWebSrcSetUri): Clear also the redirected URL when setting a new URI.
        (StreamingClient::StreamingClient): Use GRefPtr for the source and initialize the request too.
        (StreamingClient::~StreamingClient): Remove explicit unref.
        (StreamingClient::createReadBuffer):
        (StreamingClient::handleResponseReceived): Initialize the redirected URL in case of redirection. Create and push
        the HTTP headers event.
        (StreamingClient::handleDataReceived):
        (StreamingClient::handleNotifyFinished):
        (CachedResourceStreamingClient::CachedResourceStreamingClient):
        (CachedResourceStreamingClient::responseReceived):
        (CachedResourceStreamingClient::accessControlCheckFailed):
        (CachedResourceStreamingClient::loadFailed):
        (ResourceHandleStreamingClient::ResourceHandleStreamingClient):
        (ResourceHandleStreamingClient::didFail):
        (ResourceHandleStreamingClient::wasBlocked):
        (ResourceHandleStreamingClient::cannotShowURL):

2017-05-02  Youenn Fablet  <youenn@apple.com>

        Adding logging to RTCPeerConnection to allow WebRTC application debugging
        https://bugs.webkit.org/show_bug.cgi?id=171531

        Reviewed by Jon Lee.

        No change of behavior.
        This allows easier debugging of webrtc-enabled web pages.

        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::createOfferSucceeded):
        (WebCore::PeerConnectionBackend::createOfferFailed):
        (WebCore::PeerConnectionBackend::createAnswerSucceeded):
        (WebCore::PeerConnectionBackend::createAnswerFailed):
        (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
        (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
        (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
        (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
        (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
        (WebCore::PeerConnectionBackend::addIceCandidateFailed):
        (WebCore::PeerConnectionBackend::newICECandidate):
        (WebCore::PeerConnectionBackend::doneGatheringCandidates):
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::queuedCreateOffer):
        (WebCore::RTCPeerConnection::queuedCreateAnswer):
        (WebCore::RTCPeerConnection::queuedSetLocalDescription):
        (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
        (WebCore::RTCPeerConnection::queuedAddIceCandidate):

2017-04-12  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Crash at WebCore::ResourceHandle::clearClient() when streaming live video from dailymotion
        https://bugs.webkit.org/show_bug.cgi?id=169725

        Reviewed by Michael Catanzaro.

        Make ResourceHandleStreamingClient refcounted and add an invalidate method to do the cleanup in the networking
        thread while keeping a reference.

        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (webKitWebSrcStop): Call invalidate before reseting client pointer.
        (webKitWebSrcStart): Ditto.
        (ResourceHandleStreamingClient::ResourceHandleStreamingClient): Remove all cleanup code after the run loop run call.
        (ResourceHandleStreamingClient::~ResourceHandleStreamingClient): Just detach the thread.
        (ResourceHandleStreamingClient::invalidate): Schedule a task on the networking thread to clean up and fiish the
        run loop, protecting this.
        (ResourceHandleStreamingClient::setDefersLoading): Protect this.
        (ResourceHandleStreamingClient::didReceiveResponse): Do nothing if client was invalidated.
        (ResourceHandleStreamingClient::didReceiveBuffer): Ditto.
        (ResourceHandleStreamingClient::didFinishLoading): Ditto.

2017-05-01  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] ECDSA signing and verification support
        https://bugs.webkit.org/show_bug.cgi?id=171103

        Reviewed by Carlos Garcia Campos.

        Implement WebCrypto ECDSA support for configurations that
        are using libgcrypt.

        For signing, the provided data is first hashed with the specified
        digest algorithm and embedded into a data s-expression. It's then
        passed to gcry_pk_sign() along with the private key, returning a
        sig-val s-expression. The r and s parameters are then retrieved from
        that sig-val and their data extracted and concatenated in the output
        Vector<>.

        For verification, the data is again hashed and embedded into a data
        s-expression. The r and s parameters are extracted from the passed-in
        signature Vector<> and embedded into a sig-val s-expression. The data
        and sig-val s-expressions are then passed to gcry_pk_verify() along
        with the public key. The verification succeeds if no error is returned
        and fails if the returned error code is GPG_ERR_BAD_SIGNATURE.

        * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
        (WebCore::hashCryptoDigestAlgorithm):
        (WebCore::hashAlgorithmName):
        (WebCore::mpiData):
        (WebCore::gcryptSign):
        (WebCore::gcryptVerify):
        (WebCore::CryptoAlgorithmECDSA::platformSign):
        (WebCore::CryptoAlgorithmECDSA::platformVerify):

2017-05-01  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] HKDF bit derivation support
        https://bugs.webkit.org/show_bug.cgi?id=171074

        Reviewed by Michael Catanzaro.

        Implement bit derivation support for the HKDF algorithm for configurations
        that use libgcrypt.

        libgcrypt doesn't provide HKDF support out of the box, so we have to
        implement the two steps manually. In the first one, we retrieve the
        pseudo-random key by using the specified MAC algorithm with the salt data
        as the key and the key data as the input keying material.

        In the expand step, we do the required amount of iterations to derive
        a sufficient amount of data, using the same MAC algorithm with the
        pseudo-random key from the previous step on the data we compose from the
        previous block data, the info data, and the current iteration value. The
        resulting blocks are appended together until they can be clipped to the
        desired output length.

        * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
        (WebCore::macAlgorithmForHashFunction):
        (WebCore::gcryptDeriveBits):
        (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):

2017-05-01  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] ECDH bit derivation support
        https://bugs.webkit.org/show_bug.cgi?id=171070

        Reviewed by Michael Catanzaro.

        Implement bit derivation support for the ECDH algorithm for configurations
        that use libgcrypt.

        This is done by retrieving the private key data and wrapping it in a new
        data s-expression. That's then encrypted with the public key, and the
        returned s-expression contains the shared point data. That data is then
        decoded into an EC point, from which the x-coordinate is retrieved. This
        coordinate data is finally our bit derivation result.

        * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
        (WebCore::gcryptDerive):
        (WebCore::CryptoAlgorithmECDH::platformDeriveBits):

2017-05-01  Youenn Fablet  <youenn@apple.com>

        Ensure RealtimeOutgoingVideoSource sends a black frame when its related source is muted
        https://bugs.webkit.org/show_bug.cgi?id=171497

        Reviewed by Eric Carlson.

        Covered by updated test.

        When the track is being muted or disabled, send a black frame explicitly.
        VideoToolBox sometimes does not output a frame until it receives the other.
        That is why we end up sending two frames, the second asynchronously so that libwebrtc will not skip it.
        Also storing the rotation so that we keep the same rotation for black frames.
        Storing width and height for consistency as well.

        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
        (WebCore::RealtimeOutgoingVideoSource::setSource):
        (WebCore::RealtimeOutgoingVideoSource::stop):
        (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
        (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
        (WebCore::RealtimeOutgoingVideoSource::setSizeFromSource):
        (WebCore::RealtimeOutgoingVideoSource::sendBlackFrame):
        (WebCore::RealtimeOutgoingVideoSource::sendFrame):
        (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:

2017-05-01  Joseph Pecoraro  <pecoraro@apple.com>

        Simplify Resource Timing handling of cached resource
        https://bugs.webkit.org/show_bug.cgi?id=171526

        Reviewed by Youenn Fablet.

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::loadRequest):
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::init):
        (WebCore::SubresourceLoader::reportResourceTiming):
        Use auto in ResourceTiming construction.
        Eliminate an outdated comment.

        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestResource):
        We can avoid the checks around the request.origin. It should already
        be the cases we were checking and asserting because of login in
        CachedResourceLoader::prepareFetch.

2017-05-01  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r216024.

        This change caused ios-simulator LayoutTests to exit early
        with assertion failures.

        Reverted changeset:

        "Add audio device change notifications to AudioSession."
        https://bugs.webkit.org/show_bug.cgi?id=171403
        http://trac.webkit.org/changeset/216024

2017-05-01  Timothy Horton  <timothy_horton@apple.com>

        Expose viewport-fit instead of clip-to-safe-area
        https://bugs.webkit.org/show_bug.cgi?id=171503
        <rdar://problem/31918249>

        Reviewed by Simon Fraser.

        Tests: fast/viewport/ios/viewport-fit-auto.html
               fast/viewport/ios/viewport-fit-contain.html
               fast/viewport/ios/viewport-fit-cover.html

        * dom/ConstantPropertyMap.cpp:
        (WebCore::ConstantPropertyMap::buildValues):
        (WebCore::ConstantPropertyMap::updateConstantsForUnobscuredSafeAreaInsets):
        (WebCore::ConstantPropertyMap::didChangeSafeAreaInsets):
        (WebCore::ConstantPropertyMap::updateConstantsForObscuredInsets): Deleted.
        (WebCore::ConstantPropertyMap::didChangeObscuredInsets): Deleted.
        * dom/ConstantPropertyMap.h:
        Retrieve the safe area insets from page, instead of assuming that we should
        just expose the entire obscured inset. Also, do some renames.

        * dom/ViewportArguments.cpp:
        (WebCore::ViewportArguments::resolve):
        (WebCore::parseViewportFitValue):
        (WebCore::setViewportFeature):
        * dom/ViewportArguments.h:
        (WebCore::ViewportArguments::operator==):
        * page/ChromeClient.h:
        * page/FrameView.cpp:
        (WebCore::FrameView::enableSpeculativeTilingIfNeeded):
        (WebCore::FrameView::calculateExtendedBackgroundMode):
        (WebCore::FrameView::setClipToSafeArea): Deleted.
        * page/FrameView.h:
        * page/ViewportConfiguration.cpp:
        (WebCore::ViewportConfiguration::updateConfiguration):
        (WebCore::operator<<):
        (WebCore::ViewportConfiguration::description):
        (WebCore::ViewportConfiguration::dump):
        * page/ViewportConfiguration.h:
        (WebCore::ViewportConfiguration::avoidsUnsafeArea):
        (WebCore::ViewportConfiguration::Parameters::Parameters):
        (WebCore::ViewportConfiguration::clipToSafeArea): Deleted.
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateRootContentLayerClipping):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::repaintUsingContainer):
        Un-do changes to support clip-to-safe-area, and instead implement
        a new viewport-fit argument in the viewport meta tag, which takes
        "auto", "contain", and "cover". "auto" and "contain" cause web content
        to lay out excluding the safe area inset from the layout size, while
        "cover" causes web content to expand into the unsafe area.

        * page/Page.cpp:
        (WebCore::Page::setUnobscuredSafeAreaInsets):
        (WebCore::Page::setObscuredInsets): Deleted.
        * page/Page.h:
        (WebCore::Page::setObscuredInsets):
        (WebCore::Page::unobscuredSafeAreaInsets):
        Keep safe area and obscured insets separately.

2017-05-01  Chris Dumez  <cdumez@apple.com>

        Documents created using DOMParser.parseFromString should inherit their context document's origin / URL
        https://bugs.webkit.org/show_bug.cgi?id=171499

        Reviewed by Sam Weinig.

        Documents created using DOMParser.parseFromString should inherit their context document's
        origin / URL:
        - https://w3c.github.io/DOM-Parsing/#dom-domparser-parsefromstring

        Test: fast/dom/domparser-parsefromstring-origin.html

        * xml/DOMParser.cpp:
        (WebCore::DOMParser::parseFromString):

2017-05-01  Ross Kirsling  <ross.kirsling@sony.com>

        Web Inspector: ASSERT(!m_startedComposite) fails when recording on non-Cocoa Timeline
        https://bugs.webkit.org/show_bug.cgi?id=171363

        Reviewed by Matt Baker.

        * page/FrameView.cpp:
        (WebCore::FrameView::flushCompositingStateIncludingSubframes): Add PLATFORM(COCOA) guard.

2017-05-01  David Kilzer  <ddkilzer@apple.com>

        Stop using strcpy() in fullyQualifiedInfoTableName() from Database.cpp
        <https://webkit.org/b/171517>

        Reviewed by Brady Eidson.

        * Modules/webdatabase/Database.cpp:
        (WebCore::fullyQualifiedInfoTableName): Switch from strcpy() to
        snprintf().

2017-05-01  Chris Fleizach  <cfleizach@apple.com>

        AX: Support time@datetime for verbosity clarification of dates, times, and durations
        https://bugs.webkit.org/show_bug.cgi?id=171498
        <rdar://problem/12985540>

        Reviewed by Joanmarie Diggs.

        Expose the datetime attribute value.

        Test: accessibility/datetime-attribute.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::datetimeAttributeValue):
        * accessibility/AccessibilityObject.h:
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
        (-[WebAccessibilityObjectWrapper accessibilityDatetimeValue]):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
        (createAccessibilityRoleMap):
        (-[WebAccessibilityObjectWrapper subrole]):
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

2017-05-01  Joseph Pecoraro  <pecoraro@apple.com>

        RejectedPromiseTracker should produce better callstacks and avoid capturing callstacks unless there is a debugger/inspector
        https://bugs.webkit.org/show_bug.cgi?id=171416
        <rdar://problem/31899425>

        Reviewed by Saam Barati and Brian Burg.

        Test: inspector/console/message-stack-trace.html

        * dom/RejectedPromiseTracker.cpp:
        (WebCore::UnhandledPromise::UnhandledPromise):
        (WebCore::UnhandledPromise::callStack):
        Switch to RefPtr to allow not capturing the stack.

        (WebCore::createScriptCallStackFromReason):
        Use the VM's lastException if the value in the exception is the
        rejected promise value. Using the Exception call stack is important
        because uncaught exceptions in promise rejections trigger a built-in
        try/catch and re-enter JavaScript before passing the Error through
        to the RejectionTracker. When possible, we don't want to capture the
        new stack originating from the try/catch. Instead, we want the stack
        from before the try/catch when the error was created.

        * dom/ScriptExecutionContext.h:
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::reportUnhandledPromiseRejection):
        Switch to a pointer since the stack could be empty.

2017-05-01  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix after r216033.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::create):

2017-05-01  Jer Noble  <jer.noble@apple.com>

        Use AVAudioSession to enumerate audio capture devices on iOS
        https://bugs.webkit.org/show_bug.cgi?id=170861
        <rdar://problem/31653658>

        Reviewed by Eric Carlson.

        Hook up the new AVAudioSessionCaptureDeviceManager class to CoreAudioCaptureSource and to the (increasingly ill-named)
        RealtimeMediaSourceCenterMac.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::create):
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture):

2017-05-01  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] Expose values of aria-rowcount, aria-colcount, aria-rowindex, aria-colindex, aria-rowspan, and aria-colspan as object attributes
        https://bugs.webkit.org/show_bug.cgi?id=171496

        Reviewed by Chris Fleizach.

        Expose valid, author-provided values as an object attribute. In order to distinguish
        author-provided values from the default returned by WebCore Accessibility (1), change
        the default return value to -1. We cannot return 0 because the ARIA spec states that
        0 is a valid value for authors to provide to indicate that the cell spans the remaining
        rows in the row group.

        Also removed some legacy code. The "layout-guess" attribute was needed and expected
        as a way for AT-SPI2-based assistive technologies to identify layout tables. WebCore
        Accessibility does not expose tables which are purely for layout as accessible tables,
        and WebKitGtk uses that implementation, thus this attribute is no longer relevant.

        No new tests. Unskipped existing test which is now passing.

        * accessibility/AccessibilityARIAGridCell.cpp:
        (WebCore::AccessibilityARIAGridCell::ariaRowSpanWithRowIndex):
        (WebCore::AccessibilityARIAGridCell::columnIndexRange):
        * accessibility/AccessibilityTableCell.cpp:
        (WebCore::AccessibilityTableCell::ariaColumnSpan):
        (WebCore::AccessibilityTableCell::ariaRowSpan):
        * accessibility/AccessibilityTableCell.h:
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):

2017-05-01  Jer Noble  <jer.noble@apple.com>

        Add audio device change notifications to AudioSession.
        https://bugs.webkit.org/show_bug.cgi?id=171403

        Reviewed by Eric Carlson.

        Add notifications to AudioSession which fire when the current input and output audio devices
        change. Also add a notification when audio services are lost (which will only fire on iOS).
        Take this opportunity to make the existing hardwareMutedStateDidChange() notification be
        platform agnostic, to move the outputDeviceSupportsLowPowerMode() code from AudioHardwareListener,
        and to do a few more clean-ups of the AudioSession code.

        * WebCore.xcodeproj/project.pbxproj:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::HTMLMediaElement):
        (WebCore::HTMLMediaElement::~HTMLMediaElement):
        * html/HTMLMediaElement.h:
        * platform/audio/AudioSession.cpp:
        (WebCore::AudioSession::AudioSession):
        * platform/audio/AudioSession.h:
        (WebCore::AudioSession::Observer::hardwareMutedStateDidChange):
        (WebCore::AudioSession::Observer::audioInputDeviceChanged):
        (WebCore::AudioSession::Observer::audioOutputDeviceChanged):
        (WebCore::AudioSession::Observer::audioServicesLost):
        (WebCore::AudioSession::Observer::audioServicesReset):
        (WebCore::AudioSession::MutedStateObserver::~MutedStateObserver): Deleted.
        * platform/audio/ios/AudioSessionIOS.mm:
        (WebCore::AudioSessionPrivate::AudioSessionPrivate):
        (WebCore::AudioSession::AudioSession):
        (WebCore::AudioSession::setCategoryOverride):
        (WebCore::AudioSession::categoryOverride):
        (WebCore::AudioSession::isMuted):
        (WebCore::AudioSession::outputDeviceSupportsLowPowerMode):
        (WebCore::AudioSession::addObserver):
        (WebCore::AudioSession::removeObserver):
        * platform/audio/mac/AudioSessionMac.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSessionMac.cpp.
        (WebCore::defaultDevice):
        (WebCore::AudioSessionPrivate::AudioSessionPrivate):
        (WebCore::AudioSession::AudioSession):
        (WebCore::AudioSession::~AudioSession):
        (WebCore::AudioSession::category):
        (WebCore::AudioSession::setCategory):
        (WebCore::AudioSession::categoryOverride):
        (WebCore::AudioSession::setCategoryOverride):
        (WebCore::AudioSession::sampleRate):
        (WebCore::AudioSession::bufferSize):
        (WebCore::AudioSession::numberOfOutputChannels):
        (WebCore::AudioSession::tryToSetActive):
        (WebCore::AudioSession::preferredBufferSize):
        (WebCore::AudioSession::setPreferredBufferSize):
        (WebCore::AudioSession::isMuted):
        (WebCore::currentDeviceSupportsLowPowerBufferSize):
        (WebCore::AudioSession::outputDeviceSupportsLowPowerMode):
        (WebCore::AudioSession::addObserver):
        (WebCore::AudioSession::removeObserver):

2017-05-01  Chris Dumez  <cdumez@apple.com>

        Do not dispatch SVG load event in frameless documents
        https://bugs.webkit.org/show_bug.cgi?id=171505
        <rdar://problem/31799776>

        Reviewed by Andreas Kling.

        We should not dispatch SVG load events in frameless documents. <https://trac.webkit.org/changeset/173028/webkit>
        took care of most load events but forgot the SVG load event.

        Test: fast/dom/domparser-parsefromstring-svg-load-event.html

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

2017-05-01  Chris Dumez  <cdumez@apple.com>

        Remove some usage of PassRefPtr in editing code
        https://bugs.webkit.org/show_bug.cgi?id=171490

        Reviewed by Darin Adler.

        Remove some usage of PassRefPtr in editing code.

        * dom/DocumentMarkerController.cpp:
        (WebCore::DocumentMarkerController::markersInRange):
        (DocumentMarkerController::hasMarkers):
        (DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange):
        * dom/DocumentMarkerController.h:
        * editing/AlternativeTextController.cpp:
        (WebCore::AlternativeTextController::isSpellingMarkerAllowed):
        (WebCore::AlternativeTextController::show):
        (WebCore::AlternativeTextController::applyAlternativeTextToRange):
        (WebCore::AlternativeTextController::timerFired):
        (WebCore::AlternativeTextController::handleAlternativeTextUIResult):
        (WebCore::AlternativeTextController::recordAutocorrectionResponse):
        (WebCore::AlternativeTextController::markReversed):
        (WebCore::AlternativeTextController::markCorrection):
        (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection):
        (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
        (WebCore::AlternativeTextController::applyDictationAlternative):
        * editing/AlternativeTextController.h:
        (WebCore::AlternativeTextController::UNLESS_ENABLED):
        * editing/ApplyStyleCommand.cpp:
        (WebCore::createFontElement):
        (WebCore::createStyleSpanElement):
        (WebCore::ApplyStyleCommand::ApplyStyleCommand):
        (WebCore::copyStyleOrCreateEmpty):
        (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
        (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
        (WebCore::ApplyStyleCommand::removeConflictingInlineStyleFromRun):
        (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
        (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
        (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
        (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
        (WebCore::ApplyStyleCommand::removeInlineStyle):
        (WebCore::ApplyStyleCommand::shouldSplitTextElement):
        (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
        (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
        (WebCore::ApplyStyleCommand::positionToComputeInlineStyleChange):
        (WebCore::ApplyStyleCommand::applyInlineStyleChange):
        * editing/ApplyStyleCommand.h:
        (WebCore::ApplyStyleCommand::create):
        (WebCore::ApplyStyleCommand::shouldRemoveInlineStyleFromElement):
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::applyCommandToComposite):
        (WebCore::CompositeEditCommand::applyStyledElement):
        (WebCore::CompositeEditCommand::removeStyledElement):
        (WebCore::CompositeEditCommand::replaceElementWithSpanPreservingChildrenAndAttributes):
        (WebCore::CompositeEditCommand::inputText):
        (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
        (WebCore::CompositeEditCommand::pushAnchorElementDown):
        * editing/CompositeEditCommand.h:
        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::originalStringForAutocorrectionAtBeginningOfSelection):
        * editing/DictationCommand.cpp:
        (WebCore::DictationCommand::insertTextRunWithoutNewlines):
        * editing/EditingStyle.cpp:
        (WebCore::copyEditingProperties):
        (WebCore::copyPropertiesFromComputedStyle):
        (WebCore::extractPropertyValue):
        (WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue):
        (WebCore::HTMLFontSizeEquivalent::attributeValueAsCSSValue):
        (WebCore::EditingStyle::setStyle):
        (WebCore::EditingStyle::copy):
        (WebCore::EditingStyle::extractAndRemoveBlockProperties):
        (WebCore::EditingStyle::extractAndRemoveTextDirection):
        (WebCore::EditingStyle::mergeInlineStyleOfElement):
        (WebCore::extractEditingProperties):
        (WebCore::EditingStyle::styleAtSelectionStart):
        (WebCore::getPropertiesNotIn):
        * editing/EditingStyle.h:
        * editing/Editor.cpp:
        (WebCore::Editor::handleTextEvent):
        (WebCore::Editor::replaceSelectionWithFragment):
        (WebCore::Editor::insertOrderedList):
        (WebCore::Editor::insertUnorderedList):
        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
        (WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
        (WebCore::Editor::markAndReplaceFor):
        (WebCore::Editor::changeBackToReplacedString):
        (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
        (WebCore::Editor::rangeForPoint):
        * editing/Editor.h:
        * editing/ModifySelectionListLevel.cpp:
        (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
        (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered):
        (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered):
        * editing/ModifySelectionListLevel.h:
        * editing/SpellChecker.cpp:
        (WebCore::SpellChecker::requestCheckingFor):
        (WebCore::SpellChecker::didCheckSucceed):
        * editing/SpellChecker.h:
        (WebCore::SpellCheckRequest::checkingRange):
        (WebCore::SpellCheckRequest::paragraphRange):
        (WebCore::SpellCheckRequest::rootEditableElement):
        * editing/SpellingCorrectionCommand.cpp:
        (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
        (WebCore::SpellingCorrectionCommand::willApplyCommand):
        (WebCore::SpellingCorrectionCommand::doApply):
        (WebCore::SpellingCorrectionCommand::targetRanges):
        * editing/SpellingCorrectionCommand.h:
        (WebCore::SpellingCorrectionCommand::create):
        * editing/SurroundingText.h:
        * editing/TextCheckingHelper.cpp:
        (WebCore::TextCheckingParagraph::expandRangeToNextEnd):
        (WebCore::TextCheckingParagraph::rangeLength):
        (WebCore::TextCheckingParagraph::paragraphRange):
        (WebCore::TextCheckingParagraph::subrange):
        (WebCore::TextCheckingParagraph::offsetTo):
        (WebCore::TextCheckingParagraph::offsetAsRange):
        (WebCore::TextCheckingParagraph::text):
        (WebCore::TextCheckingParagraph::checkingStart):
        * editing/TextCheckingHelper.h:
        * editing/TypingCommand.cpp:
        (WebCore::TypingCommand::insertTextRunWithoutNewlines):
        * editing/cocoa/HTMLConverter.mm:
        (HTMLConverterCaches::computedStylePropertyForElement):
        (HTMLConverterCaches::inlineStylePropertyForElement):
        * page/ios/FrameIOS.mm:
        (WebCore::Frame::interpretationsForCurrentRoot):

2017-05-01  Jer Noble  <jer.noble@apple.com>

        Add notifications from CaptureDeviceManager (and subclasses) when device lists change
        https://bugs.webkit.org/show_bug.cgi?id=171442

        Reviewed by Youenn Fablet.

        Add a new callback-based notification to CaptureDeviceManager which fires when the underlying list
        of devices changes. Add support for enumerating AVAudioSession capture devices.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/CaptureDeviceManager.cpp:
        (nextObserverToken):
        (CaptureDeviceManager::addCaptureDeviceChangedObserver):
        (CaptureDeviceManager::removeCaptureDeviceChangedObserver):
        * platform/mediastream/CaptureDeviceManager.h:
        * platform/mediastream/ios/AVAudioSessionCaptureDevice.h: Added.
        * platform/mediastream/ios/AVAudioSessionCaptureDevice.mm: Added.
        (WebCore::AVAudioSessionCaptureDevice::create):
        (WebCore::AVAudioSessionCaptureDevice::AVAudioSessionCaptureDevice):
        * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h: Added.
        * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: Added.
        (-[WebAVAudioSessionAvailableInputsListener initWithCallback:]):
        (-[WebAVAudioSessionAvailableInputsListener invalidate]):
        (-[WebAVAudioSessionAvailableInputsListener observeValueForKeyPath:ofObject:change:context:]):
        (WebCore::AVAudioSessionCaptureDeviceManager::singleton):
        (WebCore::AVAudioSessionCaptureDeviceManager::captureDevices):
        (WebCore::AVAudioSessionCaptureDeviceManager::audioSessionCaptureDevices):
        (WebCore::AVAudioSessionCaptureDeviceManager::audioSessionDeviceWithUID):
        (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
        (WebCore::AVCaptureDeviceManager::deviceConnected):
        (WebCore::AVCaptureDeviceManager::deviceDisconnected):
        * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
        (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
        (WebCore::CoreAudioCaptureDeviceManager::devicesChanged):

2017-05-01  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: AccessibilityTable::ariaRowCount() and ariaColumnCount() should not return -1 unless that is the author-provided value
        https://bugs.webkit.org/show_bug.cgi?id=171475

        Reviewed by Chris Fleizach.

        If the author has provided a valid value, return it. Otherwise, return 0.

        No new tests needed. Update existing test expectations to reflect the change.

        * accessibility/AccessibilityTable.cpp:
        (WebCore::AccessibilityTable::ariaColumnCount):
        (WebCore::AccessibilityTable::ariaRowCount):

2017-05-01  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: Implement support for ARIA "figure" and "term" roles; update AXRoleDescription mapping for "feed" role
        https://bugs.webkit.org/show_bug.cgi?id=171183

        Reviewed by Chris Fleizach.

        Create FeedRole, FigureRole, and TermRole and map them on the Mac and Gtk
        ports. Also rename AccessibilityObject::isFigure() to isFigureElement()
        for clarity as this method is specific to the HTML element and not the role.

        No new tests needed: We have existing tests that cover mappings. Add new test cases
        to roles-exposed.html, xml-roles-exposed.html, and roles-computedRoleString.html.

        * English.lproj/Localizable.strings:
        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::captionForFigure):
        (WebCore::AccessibilityNodeObject::alternativeText):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::initializeRoleMap):
        (WebCore::AccessibilityObject::isFigureElement): Added.
        (WebCore::AccessibilityObject::isFigure): Deleted.
        * accessibility/AccessibilityObject.h:
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::exposesTitleUIElement):
        (WebCore::AccessibilityRenderObject::titleUIElement):
        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (atkRole):
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (createAccessibilityRoleMap):
        (-[WebAccessibilityObjectWrapper subrole]):
        (-[WebAccessibilityObjectWrapper roleDescription]):
        * platform/LocalizedStrings.cpp:
        (WebCore::AXFeedText):
        * platform/LocalizedStrings.h:

2017-04-30  Chris Dumez  <cdumez@apple.com>

        Drop support for legacy ClientRect / ClientRectList
        https://bugs.webkit.org/show_bug.cgi?id=171418

        Reviewed by Sam Weinig.

        Drop support for legacy ClientRect / ClientRectList types now we use
        DOMRect everywhere.

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/ClientRect.cpp: Removed.
        * dom/ClientRect.h: Removed.
        * dom/ClientRect.idl: Removed.
        * dom/ClientRectList.cpp: Removed.
        * dom/ClientRectList.h: Removed.
        * dom/ClientRectList.idl: Removed.
        * dom/DOMAllInOne.cpp:
        * dom/Element.cpp:
        * html/HTMLMediaElement.cpp:
        * html/track/VTTRegion.cpp:
        * page/DragController.cpp:

2017-04-30  Zalan Bujtas  <zalan@apple.com>

        Initialize a new layout state while bailing out of simple line layout only when needed.
        https://bugs.webkit.org/show_bug.cgi?id=171481
        <rdar://problem/31906382>

        '-webkit-border-fit: lines' requires inline box tree.
        We normally bail out of simple line layout early when we see this property. 
        When this property is dynamically set and we already have a simple line layout context,
        RenderBlockFlow::ensureLineBoxes() takes care of the switch by calling layoutLineBoxes().
        This patch makes sure that we create the layout state for this (forced)line layout only when
        we don't yet have one.

        Reviewed by Antti Koivisto.

        Test: fast/multicol/simple-line-layout-switch-to-normal-layout-while-inside-layout.html

        * rendering/RenderBlockFlow.cpp:
        (WebCore::PaginatedLayoutStateMaintainer::PaginatedLayoutStateMaintainer):
        (WebCore::PaginatedLayoutStateMaintainer::~PaginatedLayoutStateMaintainer):
        (WebCore::RenderBlockFlow::ensureLineBoxes):
        * rendering/RenderView.cpp:
        (WebCore::RenderView::pushLayoutStateForPaginationIfNeeded):
        (WebCore::RenderView::pushLayoutStateForPagination): Deleted.
        * rendering/RenderView.h:

2017-04-30  Dan Bernstein  <mitz@apple.com>

        Tried to fix the iOS build after r215992

        * platform/ios/WebVideoFullscreenControllerAVKit.mm:

2017-04-30  Brady Eidson  <beidson@apple.com>

        Fix r215991
        https://bugs.webkit.org/show_bug.cgi?id=171483

        Unreviewed.

        * platform/spi/cf/CFNetworkSPI.h:

2017-04-30  Dan Bernstein  <mitz@apple.com>

        Tried to fix the iOS build after r215992

        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebAVPlayerLayerView_pictureInPicturePlayerLayerView):
        (WebVideoFullscreenInterfaceAVKit::setupFullscreen):

2017-04-30  Dan Bernstein  <mitz@apple.com>

        [Cocoa] Replaces uses of [get…() alloc] with alloc…Instance()
        https://bugs.webkit.org/show_bug.cgi?id=171485

        Reviewed by Geoffrey Garen.

        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
        (WebCore::CDMSessionAVContentKeySession::contentKeySession):
        * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
        (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
        * platform/ios/ValidationBubbleIOS.mm:
        (-[WebValidationBubbleTapRecognizer initWithPopoverController:]):
        (WebCore::ValidationBubble::ValidationBubble):
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        (WebVideoFullscreenControllerContext::setUpFullscreen):
        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebAVPlayerLayerView_pictureInPicturePlayerLayerView):
        (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
        * platform/mac/WebVideoFullscreenInterfaceMac.mm:
        (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
        * platform/network/ios/PreviewConverter.mm:
        (WebCore::PreviewConverter::PreviewConverter):
        * rendering/RenderThemeIOS.mm:
        (WebCore::iconForAttachment):

2017-04-30  Brady Eidson  <beidson@apple.com>

        Updates to _WKWebsiteDataStoreConfiguration cookie storage location SPI.
        <rdar://problem/31906397> and https://bugs.webkit.org/show_bug.cgi?id=171483

        Reviewed by Geoff Garen (and kind of Andy Estes).

        No new tests (Covered by API test).

        * platform/spi/cf/CFNetworkSPI.h:

2017-04-30  Dan Bernstein  <mitz@apple.com>

        <rdar://problem/31906525> WebCore-7604.1.19 has failed to build

        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]): Resolved type ambiguity
          by using allocUIItemProviderInstance() instead of [getUIItemProviderClass() alloc].

2017-04-30  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] Implement support for aria-autocomplete
        https://bugs.webkit.org/show_bug.cgi?id=171167

        Reviewed by Chris Fleizach.

        Expose ATK_STATE_SUPPORTS_AUTOCOMPLETION in the state set, and the value
        of aria-autocomplete as an object attribute, for elements which indicate
        they support autocompletion.

        Test: accessibility/gtk/aria-autocomplete.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::supportsARIAAutoComplete):
        (WebCore::AccessibilityObject::ariaAutoCompleteValue):
        * accessibility/AccessibilityObject.h:
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):
        (setAtkStateSetFromCoreObject):
        * html/HTMLAttributeNames.in:

2017-04-30  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] ARIA treegrid role should be exposed as ATK_ROLE_TREE_TABLE; not ATK_ROLE_TABLE
        https://bugs.webkit.org/show_bug.cgi?id=171170

        Reviewed by Chris Fleizach.

        AccessibilityTable::roleValue() was returning GridRole for both grid and treegrid.
        Change this so that GridRole is returned for grid and TreeGridRole is returned for
        treegrid. Add TreeGridRole to, or call isTable() in, methods where the behavior
        should be the same as GridRole.

        Test: accessibility/gtk/interface-table.html

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::selectedChildren):
        * accessibility/AccessibilityTable.cpp:
        (WebCore::AccessibilityTable::roleValue):
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (atkRole):
        (getInterfaceMaskFromObject):
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
        (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (createAccessibilityRoleMap):

2017-04-30  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] Emit object:state-changed:busy event when aria-busy value changes
        https://bugs.webkit.org/show_bug.cgi?id=171181

        Reviewed by Chris Fleizach.

        Emit object:state-changed:busy for AXElementBusyChanged notifications.

        Test: accessibility/gtk/aria-busy-changed-notification.html

        * accessibility/atk/AXObjectCacheAtk.cpp:
        (WebCore::AXObjectCache::postPlatformNotification):

2017-04-29  Joseph Pecoraro  <pecoraro@apple.com>

        Zero out PerformanceResourceTiming properties for cached cross-origin responses without Timing-Allow-Origin
        https://bugs.webkit.org/show_bug.cgi?id=171394

        Reviewed by Youenn Fablet.

        * loader/ResourceTiming.cpp:
        (WebCore::ResourceTiming::fromCache):
        (WebCore::ResourceTiming::ResourceTiming):
        * loader/ResourceTiming.h:
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestResource):
        Include the timing-allow-origin check for cached responses.
        Also, avoid including an extra entry for an ongoing cached resource
        load, since when that load completes it should be reported.

2017-04-29  Youenn Fablet  <youenn@apple.com>

        Readd assertion removed accidentally in r215955
        https://bugs.webkit.org/show_bug.cgi?id=171466

        Reviewed by Eric Carlson.

        Unreviewed.

        * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
        (WebCore::MockRealtimeVideoSourceMac::orientationChanged): Improved FIXME after review.

2017-04-29  Andy Estes  <aestes@apple.com>

        [macOS] Picture-in-picture should be disabled in WebPlaybackControlsManager during external media playback
        https://bugs.webkit.org/show_bug.cgi?id=171468
        <rdar://problem/31900349>

        Reviewed by Eric Carlson.

        * platform/mac/WebPlaybackControlsManager.h: Declared canTogglePictureInPicture as a
        readwrite property.
        * platform/mac/WebPlaybackControlsManager.mm: Synthesize canTogglePictureInPicture.
        (-[WebPlaybackControlsManager canTogglePictureInPicture]): Deleted.
        * platform/mac/WebPlaybackSessionInterfaceMac.h:
        * platform/mac/WebPlaybackSessionInterfaceMac.mm:
        (WebCore::WebPlaybackSessionInterfaceMac::externalPlaybackChanged): Called
        -[WebPlaybackControlsManager setCanTogglePictureInPicture:].

2017-04-29  Simon Fraser  <simon.fraser@apple.com>

        Fix tests broken by r215964.

        Fix copy-paste error that caused the wrong paint phase to get passed to the fire writeLayerRenderers()
        call, causing extra renderer dumping.

        Also remove unused default arguments.

        * rendering/RenderTreeAsText.cpp:
        (WebCore::writeLayerRenderers):
        (WebCore::writeLayers):

2017-04-28  Zalan Bujtas  <zalan@apple.com>

        iBooks text can overlap, sometimes columns are shifted splitting words.
        https://bugs.webkit.org/show_bug.cgi?id=171472
        <rdar://problem/31096037>

        Reviewed by Antti Koivisto.

        Instead of just checking if the glyph is taller than the line, we need to ensure that both the
        ascent and the descent have enough space (this is for -webkit-line-box-contain: glyph).

        Test: fast/text/simple-line-layout-glyph-overflows-line.html

        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::canUseForText): compute the available space for the ascent/descent
        and check them against the ceil-ed(see FontCascade::floatWidthForSimpleText) glyph min/max y.

2017-04-29  Nan Wang  <n_wang@apple.com>

        AX: Improve performance of addChildren()/childrenChanged()
        https://bugs.webkit.org/show_bug.cgi?id=171443

        Reviewed by Chris Fleizach.

        There's a lot of unnecessary work happening when childrenChanged() is being called.
        Some of the improvements here:
        1. When childrenChanged() is being called on some element, we are marking its parent
           chain dirty. However, in the addChild() method we are then clearing each child of
           that 'dirty' parent, eventually making the entire tree dirty. 
           Added a m_subTreeDirty flag and using the needsToUpdateChildren() check to make sure
           we are only clearing the right chain without updating the unchanged siblings.
        2. In the addChild() method we are calling accessibilityIsIgnored() on each child and that 
           might lead to going up the parent chain again to get necessary information. 
           Since we are already traversing the tree from top to bottom to add children, added a 
           struct to store the information and pass it to the child so to avoid unnecessary traversal.
        3. Reduced the amount work of ARIA text controls perform when updating its parents in childrenChanged() 
           so that we don't update a big portion of the tree while typing.

        No new tests since this didn't change any functionality. 

        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
        (WebCore::AccessibilityNodeObject::childrenChanged):
        (WebCore::AccessibilityNodeObject::insertChild):
        (WebCore::AccessibilityNodeObject::addChildren):
        (WebCore::AccessibilityNodeObject::isDescendantOfBarrenParent):
        * accessibility/AccessibilityNodeObject.h:
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::AccessibilityObject):
        (WebCore::AccessibilityObject::defaultObjectInclusion):
        (WebCore::AccessibilityObject::setIsIgnoredFromParentDataForChild):
        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityIsIgnoredFromParentData::AccessibilityIsIgnoredFromParentData):
        (WebCore::AccessibilityIsIgnoredFromParentData::isNull):
        (WebCore::AccessibilityObject::setNeedsToUpdateSubTree):
        (WebCore::AccessibilityObject::needsToUpdateChildren):
        (WebCore::AccessibilityObject::setIsIgnoredFromParentData):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::updateChildrenIfNecessary):
        (WebCore::AccessibilityRenderObject::addChildren):
        * accessibility/AccessibilityRenderObject.h:
        (WebCore::AccessibilityRenderObject::setRenderObject):
        (WebCore::AccessibilityRenderObject::needsToUpdateChildren): Deleted.

2017-04-29  Yusuke Suzuki  <utatane.tea@gmail.com>

        Move WebCore CPUTime to WTF and implement it in all the platforms
        https://bugs.webkit.org/show_bug.cgi?id=171477

        Reviewed by Chris Dumez.

        Move CPUTime to WTF. And rename getCPUTime to CPUTime::get().

        * CMakeLists.txt:
        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * page/ChromeClient.h:
        * page/PerformanceMonitor.cpp:
        (WebCore::PerformanceMonitor::PerformanceMonitor):
        (WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
        (WebCore::PerformanceMonitor::measurePostBackgroundingCPUUsage):
        (WebCore::PerformanceMonitor::measureCPUUsageInActivityState):
        * page/PerformanceMonitor.h:
        * platform/CPUMonitor.cpp:
        (WebCore::CPUMonitor::setCPULimit):
        (WebCore::CPUMonitor::timerFired):
        * platform/CPUMonitor.h:

2017-04-28  Per Arne Vollan  <pvollan@apple.com>

        Crash under WebCore::AccessibilityRenderObject::handleAriaExpandedChanged().
        https://bugs.webkit.org/show_bug.cgi?id=171427
        rdar://problem/31863417

        Reviewed by Brent Fulgham.

        The AccessibilityRenderObject object might delete itself in handleAriaExpandedChanged() under the call
        to the parentObject() method. This will cause a crash when accessing the object later in this method.
        Protect the current object while executing arbitrary event code.

        Test: accessibility/accessibility-crash-setattribute.html

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):

2017-04-28  Chris Dumez  <cdumez@apple.com>

        Diagnostic logging of navigations is too verbose
        https://bugs.webkit.org/show_bug.cgi?id=171455
        <rdar://problem/31543815>

        Reviewed by Andreas Kling.

        Diagnostic logging of navigation is too verbose. We log things that are not actually user
        navigations (e.g. speculative loads, bookmark icon fetches, ...). To address the issue,
        we now only log *observable* loads. We do so by only logging if the page is visible or
        if it becomes visible.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadWithDocumentLoader):
        (WebCore::logNavigation): Deleted.
        * page/Page.cpp:
        (WebCore::Page::setIsVisibleInternal):
        (WebCore::Page::logNavigation):
        (WebCore::Page::mainFrameLoadStarted):
        * page/Page.h:

2017-04-28  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: ARIA "region" role which lacks an accessible name should not be treated as a landmark
        https://bugs.webkit.org/show_bug.cgi?id=171180

        Reviewed by Chris Fleizach.

        Remove mapping of LandmarkRegionRole for regions which lack an accessible name.
        Doing so had a side effect of causing a number of DPub ARIA roles to stop being
        mapped as ARIA landmarks. This is due to our internal role mappings, namely
        treating the DPub ARIA landmark roles as if they were regions. Because DPub's
        landmarks do not subclass region, and do not have the same name-from-author
        requirement as region, create a new LandmarkDocRegionRole AccessibilityRole and
        map DPub ARIA's generic landmarks to it.

        No new tests because we already have sufficient coverage. Several existing
        tests were given additional test cases to cover named and unnamed regions,
        and test expectations updated accordingly.

        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
        (WebCore::AccessibilityObject::isLandmark):
        (WebCore::initializeRoleMap):
        (WebCore::AccessibilityObject::computedRoleString):
        * accessibility/AccessibilityObject.h:
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (atkRole):
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
        (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
        * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
        (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (createAccessibilityRoleMap):
        (-[WebAccessibilityObjectWrapper subrole]):

2017-04-28  Simon Fraser  <simon.fraser@apple.com>

        Enhance showLayerTree() to show fragments
        https://bugs.webkit.org/show_bug.cgi?id=171469

        Reviewed by Zalan Bujtas.

        Have showLayerTree() dump fragments, like:

             normal flow list(1)
              layer 0x11c1879c0 at (0,0) size 700x1858 backgroundClip at (0,0) size 2120x779 clip at (0,0) size 2120x779
                   fragment 0: bounds in layer at (0,0) size 700x1858 fragment bounds at (0,0) size 700x779
                   fragment 1: bounds in layer at (710,-779) size 700x1858 fragment bounds at (710,0) size 700x779
                   fragment 2: bounds in layer at (1420,-1558) size 700x1858 fragment bounds at (1420,0) size 700x300
                RenderMultiColumnFlowThread 0x11f1f3340 at (0,0) size 700x1858

        We want these to show before the child renderers, so factor that code into writeLayerRenderers().
        
        Overloading of write() for layers doesn't help anyone, so call it writeLayer() for searchability.

        * rendering/RenderLayer.cpp:
        (WebCore::showLayerTree):
        * rendering/RenderLayer.h:
        * rendering/RenderTreeAsText.cpp:
        (WebCore::writeLayer):
        (WebCore::writeLayerRenderers):
        (WebCore::writeLayers):
        * rendering/RenderTreeAsText.h:

2017-04-28  Simon Fraser  <simon.fraser@apple.com>

        Modernize RenderTreeAsText code
        https://bugs.webkit.org/show_bug.cgi?id=171458

        Reviewed by Zalan Bujtas.

        Use modern loops. More references to render objects and layers.

        * rendering/RenderTreeAsText.cpp:
        (WebCore::write):
        (WebCore::writeRenderNamedFlowThreads):
        (WebCore::writeLayers):
        (WebCore::writeSelection):
        (WebCore::externalRepresentation):

2017-04-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        Fix and re-enable data interaction unit tests
        https://bugs.webkit.org/show_bug.cgi?id=171446
        <rdar://problem/31820646>

        Reviewed by Tim Horton.

        Three small tweaks to get all data interaction tests passing again (changes detailed below).
        Fixes a failing unit test: DataInteractionTests.RespectsExternalSourceFidelityRankings.

        * page/mac/DragControllerMac.mm:

        When dropping in a plain text editable area, don't consider kUTTypeText to be a UTI supported by the destination.
        This is because doing so would cause rich text UTIs, such as kUTTypeHTML, to match, so that the plain text area
        would report HTML as a preferred UTI type to load when dropping rich content over it. What we want to check for
        conformance here is really kUTTypePlainText.

        (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod):
        * platform/Pasteboard.h:
        * platform/ios/PasteboardIOS.mm:

        The default Pasteboard constructor no longer makes a sync call to the UI process to get the change count.
        Instead, we introduce a new constructor that takes and sets the change count. This default constructor was used
        from three places: Pasteboard::createForCopyAndPaste, Pasteboard::createPrivate and StaticPasteboard::create.

        The first two call sites have been refactored to first fetch the change count from the UI process and then pass
        it in to the constructor.

        (WebCore::changeCountForPasteboard):
        (WebCore::Pasteboard::Pasteboard):
        (WebCore::Pasteboard::createForCopyAndPaste):
        (WebCore::Pasteboard::createPrivate):
        (WebCore::Pasteboard::readString):
        (WebCore::Pasteboard::types):
        * platform/mac/DragDataMac.mm:
        (WebCore::typeIsAppropriateForSupportedTypes):
        (WebCore::DragData::updatePreferredTypeIdentifiers):

        Remove the two-pass heuristic. Instead, we should follow this policy: "select the highest fidelity UTI that
        conforms to one of the destination's supported types".

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

2017-04-28  Dean Jackson  <dino@apple.com>

        App crashing: Dispatch queue: com.apple.root.user-interactive-qos / vBoxConvolve / WebCore::FEGaussianBlur::platformApplySoftware()
        https://bugs.webkit.org/show_bug.cgi?id=171461
        <rdar://problem/30534722>

        Reviewed by Eric Carlson.

        We're getting reports of crashes in this function, caused by null or empty data being
        passed to vImage. Guard against this, in a way that will ASSERT in debug builds if
        anyone comes across it.

        Test: css3/filters/blur-various-radii.html

        * platform/graphics/filters/FEGaussianBlur.cpp:
        (WebCore::accelerateBoxBlur): Return early if things don't look good.

2017-04-28  Chris Dumez  <cdumez@apple.com>

        Stop using legacy ClientRect / ClientRectList in Internals
        https://bugs.webkit.org/show_bug.cgi?id=171412

        Reviewed by Simon Fraser.

        Stop using legacy ClientRect / ClientRectList in Internals amd use the
        newer DOMRect instead.

        * dom/DOMRect.idl:
        * page/Page.cpp:
        (WebCore::Page::nonFastScrollableRects):
        (WebCore::Page::touchEventRectsForEvent):
        (WebCore::Page::passiveTouchEventListenerRects):
        * page/Page.h:
        * testing/Internals.cpp:
        (WebCore::Internals::absoluteCaretBounds):
        (WebCore::Internals::boundingBox):
        (WebCore::Internals::inspectorHighlightRects):
        (WebCore::Internals::layoutViewportRect):
        (WebCore::Internals::visualViewportRect):
        (WebCore::Internals::touchEventRectsForEvent):
        (WebCore::Internals::passiveTouchEventListenerRects):
        (WebCore::Internals::nonFastScrollableRects):
        (WebCore::Internals::selectionBounds):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-04-28  Youenn Fablet  <youenn@apple.com>

        getUserMedia video streams should follow device orientation
        https://bugs.webkit.org/show_bug.cgi?id=171284

        Reviewed by Eric Carlson.

        Only really affects AVVideoCaptureSource on iOS. Manually testing the following cases:
        - Mac: no change of behavior
        - iOS: page loaded in portrait, video is portrait. page loaded in landscape, video is landscape
        - iOS: changing the device orientation makes the video samples to be moved to landscape/portrait.
        - Same tests as above with peer connection.

        Making Document having an OrientationNotifier that AVVideoCaptureSources get registered to.
        Making AVVideoCaptureSource an OrientationNotifier::Observer so that it can changes width/height if needed.

        Refactoring to specialize CaptureFactory in VideoCaptureFactory and AudioCaptureFactory.
        Refactoring to return a CaptureSourceOrError instead of passing an out parameter plus returning a RefPtr.

        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::allow):
        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::Document::orientationChanged):
        * dom/Document.h:
        * page/Frame.cpp:
        (WebCore::Frame::orientationChanged):
        * platform/OrientationNotifer.h: Copied from Source/WebKit2/UIProcess/Cocoa/UserMediaCaptureManagerProxy.h.
        (WebCore::OrientationNotifier::Observer::setNotifier):
        (WebCore::OrientationNotifier::Observer::~Observer):
        (WebCore::OrientationNotifier::orientationChanged):
        (WebCore::OrientationNotifier::addObserver):
        (WebCore::OrientationNotifier::removeObserver):
        * platform/mediastream/MediaStreamPrivate.cpp:
        (WebCore::MediaStreamPrivate::monitorOrientation):
        * platform/mediastream/MediaStreamPrivate.h:
        * platform/mediastream/RealtimeMediaSource.h:
        (WebCore::CaptureSourceOrError::CaptureSourceOrError):
        (WebCore::CaptureSourceOrError::operator bool):
        (WebCore::CaptureSourceOrError::source):
        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
        (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
        (WebCore::RealtimeMediaSourceCenter::setVideoFactory):
        (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        (WebCore::RealtimeMediaSourceCenter::defaultAudioFactory):
        (WebCore::RealtimeMediaSourceCenter::defaultVideoFactory):
        (WebCore::RealtimeMediaSourceCenter::audioFactory):
        (WebCore::RealtimeMediaSourceCenter::videoFactory):
        * platform/mediastream/mac/AVAudioCaptureSource.h:
        * platform/mediastream/mac/AVAudioCaptureSource.mm:
        (WebCore::AVAudioCaptureSource::create):
        (WebCore::AVAudioCaptureSource::factory):
        * platform/mediastream/mac/AVVideoCaptureSource.h:
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::create):
        (WebCore::AVVideoCaptureSource::factory):
        (WebCore::AVVideoCaptureSource::monitorOrientation):
        (WebCore::AVVideoCaptureSource::orientationChanged):
        (WebCore::AVVideoCaptureSource::processNewFrame):
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::create):
        (WebCore::CoreAudioCaptureSource::factory):
        * platform/mediastream/mac/CoreAudioCaptureSource.h:
        * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
        (WebCore::MockRealtimeAudioSource::create):
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
        (WebCore::MockRealtimeVideoSource::create):
        (WebCore::MockRealtimeVideoSourceMac::orientationChanged):
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
        (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints):
        (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):
        (WebCore::RealtimeMediaSourceCenterMac::defaultVideoFactory):
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
        (WebCore::RealtimeMediaSourceCenterOwr::createMediaStream):
        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
        * platform/mock/MockRealtimeAudioSource.cpp:
        (WebCore::MockRealtimeAudioSource::create):
        (WebCore::MockRealtimeAudioSource::factory):
        * platform/mock/MockRealtimeAudioSource.h:
        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
        (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
        (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
        (WebCore::MockRealtimeMediaSourceCenter::defaultAudioFactory):
        (WebCore::MockRealtimeMediaSourceCenter::defaultVideoFactory):
        * platform/mock/MockRealtimeMediaSourceCenter.h:
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::create):
        (WebCore::MockRealtimeVideoSource::factory):
        * platform/mock/MockRealtimeVideoSource.h:

2017-04-28  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Unify how BitmapImage handles the availability of a decoded for large and animated images
        https://bugs.webkit.org/show_bug.cgi?id=171410

        Reviewed by Simon Fraser.

        Rename some functions which are related to animation frame availability.
        Make BitmapImage call ImageObserver::imageFrameAvailable() whenever a 
        frame is available regardless it is for an animated or for a large image.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::isVisibleInViewport):
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::autoplayPermitted):
        (WebCore::isMainContentForPurposesOfAutoplay):
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::CachedImageObserver::imageFrameAvailable):
        (WebCore::CachedImage::imageFrameAvailable):
        (WebCore::CachedImage::usesImageContainerSize): Deleted.
        (WebCore::CachedImage::imageHasRelativeWidth): Deleted.
        (WebCore::CachedImage::imageHasRelativeHeight): Deleted.
        (WebCore::CachedImage::CachedImageObserver::animationAdvanced): Deleted.
        (WebCore::CachedImage::animationAdvanced): Deleted.
        * loader/cache/CachedImage.h:
        * loader/cache/CachedImageClient.h:
        (WebCore::CachedImageClient::imageFrameAvailable):
        (WebCore::CachedImageClient::newImageAnimationFrameAvailable): Deleted.
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::internalAdvanceAnimation):
        (WebCore::BitmapImage::imageFrameAvailableAtIndex):
        (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Deleted.
        * platform/graphics/BitmapImage.h:
        * platform/graphics/Image.h:
        (WebCore::Image::imageFrameAvailableAtIndex):
        (WebCore::Image::newFrameNativeImageAvailableAtIndex): Deleted.
        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex):
        * platform/graphics/ImageObserver.h:
        * platform/graphics/ImageTypes.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::RenderElement):
        (WebCore::RenderElement::shouldRepaintInVisibleRect):
        (WebCore::RenderElement::imageFrameAvailable):
        (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
        (WebCore::shouldRepaintForImageAnimation): Deleted.
        (WebCore::RenderElement::newImageAnimationFrameAvailable): Deleted.
        * rendering/RenderElement.h:
        * rendering/RenderView.cpp:
        (WebCore::RenderView::updateVisibleViewportRect):
        * svg/graphics/SVGImageClients.h:

2017-04-28  Jeremy Jones  <jeremyj@apple.com>

        ARGUMENT BAD: time, time >= 0
        https://bugs.webkit.org/show_bug.cgi?id=164336
        rdar://problem/29314891

        Reviewed by Eric Carlson.

        Handle invalid duration and current time when calculating remaining time.

        Test media/modern-media-controls/pip-support/pip-support-click.html now works without a workaround
        in media/modern-media-controls/pip-support/pip-support-enabled.html

        * platform/mac/WebVideoFullscreenHUDWindowController.mm:
        (-[WebVideoFullscreenHUDWindowController remainingTimeText]):

2017-04-28  Daniel Bates  <dabates@apple.com>

        Add WebCore::protocolIsJavaScript(StringView)
        https://bugs.webkit.org/show_bug.cgi?id=171396

        Reviewed by Alex Christensen.

        Add an overload of WebCore::protocolIsJavaScript() that takes a StringView to
        avoid the need for a caller to allocate a new String object when converting
        from a StringView to a String. We are not using this functionality at the moment,
        but we will in the patch for <https://bugs.webkit.org/show_bug.cgi?id=170925>.

        No functionality has changed. So, no new tests.

        * platform/URL.cpp: Remove an outdated comment about protocolIs(StringView, const char*).
        This overload was removed in r212508.
        (WebCore::protocolIsInternal): Added.
        (WebCore::protocolIs): Implemented in terms of WebCore::protocolIsInternal().
        (WebCore::URL::protocolIs): Ditto.
        (WebCore::protocolIsJavaScript): Added; overload that takes a StringView.
        (WebCore::mimeTypeFromDataURL): Modified to use WebCore::protocolIsInternal().
        * platform/URL.h:

2017-04-28  Andy Estes  <aestes@apple.com>

        [macOS] WebPlaybackControlsManager needs to know when the selected text or audio track changes
        https://bugs.webkit.org/show_bug.cgi?id=171434
        <rdar://problem/31887922>

        Reviewed by Eric Carlson.

        * dom/GenericEventQueue.cpp:
        (WebCore::GenericEventQueue::hasPendingEventsOfType): Added to check if a pending event
        exists of a certain type.
        * dom/GenericEventQueue.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::setSelectedTextTrack): Even if no track modes change, fire a
        change event when the track to select is off or automatic so that
        WebPlaybackSessionModelMediaElement detects the change.
        * html/track/TrackListBase.cpp:
        (TrackListBase::isChangeEventScheduled): Returns true if m_asyncEventQueue has a pending
        change event.
        * html/track/TrackListBase.h:
        * platform/cocoa/WebPlaybackSessionModel.h:
        (WebCore::WebPlaybackSessionModelClient::audioMediaSelectionIndexChanged):
        (WebCore::WebPlaybackSessionModelClient::legibleMediaSelectionIndexChanged):
        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        (WebCore::WebPlaybackSessionModelMediaElement::setMediaElement): Registered/unregistered for
        the change event on the audio and text tracks.
        (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName): Called
        updateMediaSelectionIndices() when the change event fires.
        (WebCore::WebPlaybackSessionModelMediaElement::updateMediaSelectionOptions): Renamed from
        updateLegibleOptions().
        (WebCore::WebPlaybackSessionModelMediaElement::updateMediaSelectionIndices): Called
        audioMediaSelectionIndexChanged() and legibleMediaSelectionIndexChanged() on m_clients with
        the updated indices.
        (WebCore::WebPlaybackSessionModelMediaElement::legibleMediaSelectedIndex): Fixed a bug
        where selectedIndex would never be set to offIndex if offIndex is 0 (which it usually is).
        (WebCore::WebPlaybackSessionModelMediaElement::updateLegibleOptions): Renamed to
        updateMediaSelectionOptions().
        * platform/mac/WebPlaybackControlsManager.h:
        * platform/mac/WebPlaybackControlsManager.mm:
        (-[WebPlaybackControlsManager setAudioMediaSelectionIndex:]): Set
        _currentAudioTouchBarMediaSelectionOption to the object at selectedIndex and manually
        triggered a KVO notification. We can't call -setCurrentAudioTouchBarMediaSelectionOption:
        here since that will send a message back to the Web process.
        (-[WebPlaybackControlsManager setLegibleMediaSelectionIndex:]): Ditto for
        _currentLegibleTouchBarMediaSelectionOption.
        * platform/mac/WebPlaybackSessionInterfaceMac.h:
        * platform/mac/WebPlaybackSessionInterfaceMac.mm:
        (WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionIndexChanged): Called
        -[WebPlaybackControlsManager setAudioMediaSelectionIndex:].
        (WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionIndexChanged): Called
        -[WebPlaybackControlsManager setLegibleMediaSelectionIndex:].

2017-04-28  Chris Dumez  <cdumez@apple.com>

        Range.getClientRects() / getBoundingClientRect() should return DOMRect types
        https://bugs.webkit.org/show_bug.cgi?id=171393

        Reviewed by Simon Fraser.

        Range.getClientRects() / getBoundingClientRect() should return DOMRect types:
        - https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface

        Test: fast/dom/Range/getBoundingClientRect-getClientRects-return-type.html

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/DOMRect.cpp: Copied from Source/WebCore/dom/DOMRect.h.
        (WebCore::createDOMRectVector):
        * dom/DOMRect.h:
        * dom/Element.cpp:
        (WebCore::Element::getClientRects):
        * dom/Range.cpp:
        (WebCore::Range::getClientRects):
        (WebCore::Range::getBoundingClientRect):
        * dom/Range.h:
        * dom/Range.idl:

2017-04-28  Chris Dumez  <cdumez@apple.com>

        Tweak window.open features argument tokenizer to match HTML standard and Edge
        https://bugs.webkit.org/show_bug.cgi?id=170548

        Reviewed by Geoffrey Garen.

        Update window.open() features argument tokenizer to match HTML standard:
        - https://html.spec.whatwg.org/#concept-window-open-features-tokenize

        Also update window.open() to return null instead of the window when
        the 'noopener' feature is activated, as per:
        - https://html.spec.whatwg.org/#dom-open (Step 10)

        No new tests, rebaselined existing test.

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::createWindow):
        Update window.open() to return null instead of the window when
        the 'noopener' feature is activated, as per:
        - https://html.spec.whatwg.org/#dom-open (Step 10)

        * page/WindowFeatures.cpp:
        (WebCore::isSeparator):
        Treat all ASCII spaces as feature separators, as per:
        - https://html.spec.whatwg.org/#feature-separator
        This has the effect of adding U+000C (FormFeed) as a separator.

        (WebCore::processFeaturesString):
        Align tokenizing code with the specification:
        - https://html.spec.whatwg.org/#concept-window-open-features-tokenize
        In particular, the following changes were made:
        - After the key, skip to first '=', but don't skip past a ',' or a non-separator.
          The "or a non-separator" part is new in the spec (step 3.6.1) and is now implemented.
        - After looking for the '=', only treat what follows as a value if the current character
          is a separator. This is as per step 7 in the spec.
        These changes now cause us to parse 'foo noopener=1' as ('foo', ''), ('noopener', '1').

2017-04-28  Eric Carlson  <eric.carlson@apple.com>

        Implement ondevicechange
        https://bugs.webkit.org/show_bug.cgi?id=169872

        Unreviewed, remove some dead code accidentally committed in r215929.

        * platform/mediastream/CaptureDeviceManager.cpp:

2017-04-28  Chris Dumez  <cdumez@apple.com>

        Update DOMTokenList.replace() to match the latest DOM specification
        https://bugs.webkit.org/show_bug.cgi?id=171388

        Reviewed by Alex Christensen.

        Update DOMTokenList.replace() to match the latest DOM specification after:
        - https://github.com/whatwg/dom/issues/442
        - https://github.com/whatwg/infra/pull/126

        The latest spec text is at:
        - https://dom.spec.whatwg.org/#dom-domtokenlist-replace
        - https://infra.spec.whatwg.org/#set-replace

        The behavior change in this patch causes (a, b, c).replace(a, c) to return
        (c, b) instead of (b, c). This new behavior is aligned with Firefox as well.

        No new tests, updated existing test.

        * html/DOMTokenList.cpp:
        (WebCore::DOMTokenList::replace):

2017-04-28  Brady Eidson  <beidson@apple.com>

        Start of support for multiple WebsiteDataStore/SessionIDs per process
        https://bugs.webkit.org/show_bug.cgi?id=171422

        Reviewed by Geoffrey Garen.

        Covered by API tests.

        * platform/network/NetworkStorageSession.h:
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::ensureSession):
        * platform/spi/cf/CFNetworkSPI.h:

2017-04-28  Chris Dumez  <cdumez@apple.com>

        URLSearchParams should be reflective
        https://bugs.webkit.org/show_bug.cgi?id=171345

        Reviewed by Alex Christensen.

        There was a bug in our implementation of [1] where we would replace
        '+' with 0x20 *after* URL-decoding the string, instead of *before*.
        This was causing us to replace URL-encoded '+' characters with 0x20.

        [1] https://url.spec.whatwg.org/#concept-urlencoded-parser

        No new tests, updated existing test.

        * platform/URLParser.cpp:

2017-04-28  Youenn Fablet  <youenn@apple.com>

        Adding a runtime flag specific to MediaDevices
        https://bugs.webkit.org/show_bug.cgi?id=171433

        Reviewed by Geoffrey Garen.

        Covered by existing tests.

        Adding a preference for MediaDevices.
        Setting media devices runtime flag to false by default.
        Setting peer connection and media stream flags to true by default.
        Activating mediaDevices and getUserMedia Navigator properties based on media devices flag.

        * Modules/mediastream/NavigatorMediaDevices.idl:
        * Modules/mediastream/NavigatorUserMedia.idl:
        * page/RuntimeEnabledFeatures.cpp:
        (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::mediaDevicesEnabled):
        (WebCore::RuntimeEnabledFeatures::setMediaDevicesEnabled):

2017-04-28  Eric Carlson  <eric.carlson@apple.com>

        Implement ondevicechange
        https://bugs.webkit.org/show_bug.cgi?id=169872

        Unreviewed, fix test crash.

        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::addDevicesChangedObserver): "nextToken" must be static.

2017-04-28  Dean Jackson  <dino@apple.com>

        [WebGPU] Label MTLCommandQueues with a prefix for internal telemetry
        https://bugs.webkit.org/show_bug.cgi?id=171441
        <rdar://problem/31826915>

        Reviewed by Tim Horton.

        Prefix any label that is set by the WebGPU API so that
        our telemetry can identify the use. Don't expose that
        prefix to the API though.

        New API Test: GPUCommandQueue

        * platform/graphics/cocoa/GPUCommandQueueMetal.mm:
        (WebCore::GPUCommandQueue::GPUCommandQueue):
        (WebCore::GPUCommandQueue::label):
        (WebCore::GPUCommandQueue::setLabel):

2017-04-28  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] aria-modal="true" should be exposed via ATK_STATE_MODAL
        https://bugs.webkit.org/show_bug.cgi?id=171188

        Reviewed by Chris Fleizach.

        Include ATK_STATE_MODAL in the AtkObject's state set if the accessible
        element's node is the current ARIA modal node.

        Test: accessibility/gtk/aria-modal-state-exposed.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::isAriaModalNode):
        * accessibility/AccessibilityObject.h:
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (setAtkStateSetFromCoreObject):

2017-04-28  Eric Carlson  <eric.carlson@apple.com>

        Implement ondevicechange
        https://bugs.webkit.org/show_bug.cgi?id=169872
        <rdar://problem/28945035>

        Reviewed by Jer Noble.

        Test: fast/mediastream/device-change-event.html

        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::MediaDevices::MediaDevices): Register for devicechange callbacks.
        (WebCore::MediaDevices::~MediaDevices): Unregister.
        (WebCore::MediaDevices::scheduledEventTimerFired):
        * Modules/mediastream/MediaDevices.h:
        * Modules/mediastream/MediaDevices.idl:

        * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
        (WebCore::MediaDevicesEnumerationRequest::setDeviceInfo): Remove unnecessary instance variables.
        * Modules/mediastream/MediaDevicesEnumerationRequest.h:

        * Modules/mediastream/MediaDevicesRequest.cpp:
        (WebCore::MediaDevicesRequest::start): Remove m_idHashSalt, it isn't used. RealtimeMediaSourceCenter
        now has the method to hash ids and group IDs.
        (WebCore::hashString): Deleted.
        (WebCore::MediaDevicesRequest::hashID): Deleted.
        * Modules/mediastream/MediaDevicesRequest.h:

        * dom/Document.h:
        (WebCore::Document::setDeviceIDHashSalt):
        (WebCore::Document::deviceIDHashSalt):

        * dom/EventNames.h: Add devicechange.

        * dom/EventTargetFactory.in: Add MediaDevices.

        * html/HTMLAttributeNames.in: Add ondevicechange.

        * platform/mediastream/CaptureDeviceManager.cpp:
        (WebCore::CaptureDeviceManager::captureDeviceFromPersistentID): Renamed from captureDeviceFromDeviceID
        and changed to return a std::optional<CaptureDevice>.
        (WebCore::CaptureDeviceManager::captureDeviceFromDeviceID): Deleted.

        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::addStringToSHA): New, add string bytes to SHA1. Moved from MediaDevicesRequest
        so we can use for in testing.
        (WebCore::RealtimeMediaSourceCenter::hashStringWithSalt): Generate hash for a string with a
        salt. Moved from MediaDevicesRequest so we can use for in testing.
        (WebCore::RealtimeMediaSourceCenter::captureDeviceWithUniqueID): Find a CaptureDevice given 
        a unique ID and the process hash salt.
        (WebCore::RealtimeMediaSourceCenter::setDeviceEnabled): Enable/disable a device. Used for
        layout tests only.
        (WebCore::RealtimeMediaSourceCenter::addDevicesChangedObserver): Add a devices changed listener.
        (WebCore::RealtimeMediaSourceCenter::removeDevicesChangedObserver): Remove a listener.
        (WebCore::RealtimeMediaSourceCenter::captureDevicesChanged): Notify listeners.
        * platform/mediastream/RealtimeMediaSourceCenter.h:

        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
        (WebCore::AVCaptureDeviceManager::addDevicesChangedObserver): Update for change to captureDeviceFromDeviceID.

        * platform/mock/MockRealtimeMediaSource.cpp:
        (WebCore::MockRealtimeMediaSource::audioDevices): All devices are enabled by default.
        (WebCore::MockRealtimeMediaSource::videoDevices): Ditto.

        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
        (WebCore::MockRealtimeMediaSourceCenter::createMediaStream): Drive-by cleanup: use the vector
        of devices instead of making assumptions about the number.
        (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamDevices): Only include enabled devices.
        (WebCore::MockRealtimeMediaSourceCenter::setDeviceEnabled): Enable or disable a device.
        * platform/mock/MockRealtimeMediaSourceCenter.h:

        * testing/Internals.cpp:
        (WebCore::Internals::setMediaDeviceState): Enable or disable a mock capture device.
        * testing/Internals.h:
        * testing/Internals.idl:

2017-04-28  Alex Christensen  <achristensen@webkit.org>

        Fix memory corruption issue after r215883.
        https://bugs.webkit.org/show_bug.cgi?id=171365

        Reviewed by Brady Eidson.

        This fixes a crash when starting WebKit2.

        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::NetworkStorageSession):
        Initialize m_platformCookieStorage with the default constructor of RetainPtr,
        then call NetworkStorageSession::cookieStorage which checks m_platformCookieStorage
        for null.  It was checking uninitialized memory when we had m_platformCookieStorage
        in the initializer list.

2017-04-28  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: Implement aria-value support for focusable separators
        https://bugs.webkit.org/show_bug.cgi?id=171169

        Reviewed by Chris Fleizach.

        Add SplitterRole to the roles which support range value and are considered a range
        control, as long as the SplitterRole element is focusable. Also replace ATK's role-
        based check with a call to supportsRangeValue() when determining if the AtkValue
        interface should be implemented.

        Test: accessibility/separator-values.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::isRangeControl):
        (WebCore::AccessibilityObject::supportsRangeValue):
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (getInterfaceMaskFromObject):

2017-04-28  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] GridCellRole should implement AtkTableCell (regression?)
        https://bugs.webkit.org/show_bug.cgi?id=171179

        Reviewed by Chris Fleizach.

        Add GridCellRole to the group of roles which should implement AtkTableCell.

        Test: accessibility/gtk/interface-table-cell.html

        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (getInterfaceMaskFromObject):

2017-04-28  Miguel Gomez  <magomez@igalia.com>

        REGRESSION(r215211): [GTK] Several webgl related tests are failing
        https://bugs.webkit.org/show_bug.cgi?id=170730

        Reviewed by Said Abou-Hallawa.

        There is a wrong situation in the image decoders where the complete data has been assigned
        to them but the size of the image hasn't been decoded yet. This is causing rendering
        issues in webgl when decoding the images used as textures. To fix this, we refactor how the
        encoded data status is stored to avoid that situation: the status is handled completely
        by ImageDecoder.h, and it's the one forcing the decode of the size when data gets assigned
        to the decoders.

        Covered by existent tests.

        * platform/image-decoders/ImageDecoder.h:
        (WebCore::ImageDecoder::isAllDataReceived):
        (WebCore::ImageDecoder::setData):
        (WebCore::ImageDecoder::encodedDataStatus):
        (WebCore::ImageDecoder::isSizeAvailable):
        (WebCore::ImageDecoder::setSize):
        (WebCore::ImageDecoder::setFailed):
        (WebCore::ImageDecoder::failed):
        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
        (WebCore::BMPImageDecoder::frameBufferAtIndex):
        (WebCore::BMPImageDecoder::decode):
        (WebCore::BMPImageDecoder::encodedDataStatus): Deleted.
        * platform/image-decoders/bmp/BMPImageDecoder.h:
        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::frameCount):
        (WebCore::GIFImageDecoder::frameBufferAtIndex):
        (WebCore::GIFImageDecoder::decode):
        (WebCore::GIFImageDecoder::encodedDataStatus): Deleted.
        * platform/image-decoders/gif/GIFImageDecoder.h:
        * platform/image-decoders/ico/ICOImageDecoder.cpp:
        (WebCore::ICOImageDecoder::setData):
        (WebCore::ICOImageDecoder::frameCount):
        (WebCore::ICOImageDecoder::frameBufferAtIndex):
        (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
        (WebCore::ICOImageDecoder::decode):
        (WebCore::ICOImageDecoder::decodeAtIndex):
        (WebCore::ICOImageDecoder::encodedDataStatus): Deleted.
        * platform/image-decoders/ico/ICOImageDecoder.h:
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageDecoder::frameBufferAtIndex):
        (WebCore::JPEGImageDecoder::decode):
        (WebCore::JPEGImageDecoder::encodedDataStatus): Deleted.
        * platform/image-decoders/jpeg/JPEGImageDecoder.h:
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::frameBufferAtIndex):
        (WebCore::PNGImageDecoder::decode):
        (WebCore::PNGImageDecoder::encodedDataStatus): Deleted.
        * platform/image-decoders/png/PNGImageDecoder.h:
        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::frameBufferAtIndex):
        (WebCore::WEBPImageDecoder::decode):
        (WebCore::WEBPImageDecoder::encodedDataStatus): Deleted.
        * platform/image-decoders/webp/WEBPImageDecoder.h:

2017-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>

        Move UUID from WebCore/platform to WTF
        https://bugs.webkit.org/show_bug.cgi?id=171372

        Reviewed by Michael Catanzaro.

        UUID only contains createCanonicalUUIDString() that is platform independent and doesn't depend on anything from
        WebCore, only from WTF.

        * CMakeLists.txt:
        * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
        * Modules/mediacontrols/MediaControlsHost.cpp:
        * Modules/mediastream/RTCPeerConnection.cpp:
        * Modules/webaudio/MediaStreamAudioSource.cpp:
        * Modules/webdatabase/DatabaseTracker.cpp:
        * WebCore.order:
        * WebCore.xcodeproj/project.pbxproj:
        * editing/mac/EditorMac.mm:
        * fileapi/BlobURL.cpp:
        * loader/appcache/ApplicationCacheHost.cpp:
        * loader/appcache/ApplicationCacheStorage.cpp:
        * platform/URL.cpp:
        * platform/glib/FileSystemGlib.cpp:
        * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        * platform/mediastream/CaptureDeviceManager.cpp:
        * platform/mediastream/MediaStreamPrivate.h:
        * platform/mediastream/MediaStreamTrackPrivate.cpp:
        * platform/mediastream/RealtimeMediaSource.cpp:
        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
        * platform/mock/MockRealtimeAudioSource.cpp:
        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
        * platform/mock/MockRealtimeVideoSource.cpp:
        * testing/MockCDMFactory.cpp:

2017-04-27  Alex Christensen  <achristensen@webkit.org>

        Make navigation policy checking more robust
        https://bugs.webkit.org/show_bug.cgi?id=171409
        <rdar://problem/31489248>

        Reviewed by Geoffrey Garen.

        No change in behavior.  Just added a protectedThis to a lambda and made the functions non-copyable.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::willSendRequest):
        * loader/PolicyCallback.cpp:
        (WebCore::PolicyCallback::set):
        (WebCore::PolicyCallback::clear): Deleted.
        * loader/PolicyCallback.h:
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::cancelCheck):
        (WebCore::PolicyChecker::stopCheck):
        (WebCore::PolicyChecker::continueAfterNavigationPolicy):
        (WebCore::PolicyChecker::continueAfterNewWindowPolicy):
        (WebCore::PolicyChecker::continueAfterContentPolicy):

2017-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        Data interaction should not load pasteboard content before performing the data operation
        https://bugs.webkit.org/show_bug.cgi?id=171414
        <rdar://problem/31878197>

        Reviewed by Tim Horton.

        When interacting with a link, we should not try to fetch pasteboard contents for the URL UTI type before
        performing the data operation. Teaches DragController to know whether it is allowed to load data from the
        dragging pasteboard, and uses this information in DragController::dragOperation to determine whether to use
        DragData::containsURLTypeIdentifier or DragData::containsURL.

        * page/DragController.cpp:
        (WebCore::DragController::DragController):
        (WebCore::DragController::performDragOperation):
        * page/DragController.h:
        (WebCore::DragController::canLoadDataFromDraggingPasteboard):
        * page/mac/DragControllerMac.mm:
        (WebCore::DragController::dragOperation):
        * platform/DragData.h:
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
        * platform/mac/DragDataMac.mm:
        (WebCore::DragData::containsURLTypeIdentifier):

2017-04-27  Joseph Pecoraro  <pecoraro@apple.com>

        Support for promise rejection events (unhandledrejection)
        https://bugs.webkit.org/show_bug.cgi?id=150358
        <rdar://problem/28441651>

        Reviewed by Saam Barati.

        Patch by Joseph Pecoraro and Yusuke Suzuki.

        Implement support for the `onunhandledrejection` and `rejectionhandled` events.
        They dispatch a new PromiseRejectionEvent using the ES6 HostPromiseRejectionTracker hook:
        https://tc39.github.io/ecma262/#sec-host-promise-rejection-tracker
        https://html.spec.whatwg.org/multipage/webappapis.html#unhandled-promise-rejections

        This is currently implemented only for Documents and not yet Web Workers.

        Tests: js/dom/unhandled-promise-rejection-basic.html
               js/dom/unhandled-promise-rejection-bindings-type-error.html
               js/dom/unhandled-promise-rejection-console-no-report.html
               js/dom/unhandled-promise-rejection-console-report.html
               js/dom/unhandled-promise-rejection-handle-during-event.html
               js/dom/unhandled-promise-rejection-handle-in-handler.html
               js/dom/unhandled-promise-rejection-handle.html
               js/dom/unhandled-promise-rejection-order.html

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * dom/DOMAllInOne.cpp:
        New files.

        * bindings/scripts/CodeGenerator.pm:
        (IsPromiseType):
        * bindings/scripts/CodeGeneratorJS.pm:
        (AddToIncludesForIDLType):
        (GetBaseIDLType):
        Binding support for Promise<T> attributes.

        * bindings/js/JSDOMConvert.h:
        * bindings/js/JSDOMConvertPromise.h: Copied from Source/JavaScriptCore/runtime/JSPromise.h.
        (WebCore::Converter<IDLPromise<T>>::convert):
        (WebCore::JSConverter<IDLPromise<T>>::convert):
        Promise<T> binding conversion is currently unimplemented, which only means
        web developers creating their own PromiseRejectionEvent will not get
        autowrapping of values assigned to `promise` in event initialization.
        Engine generated events will have expected behavior.

        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::promiseRejectionTracker):
        * bindings/js/JSDOMWindowBase.h:
        * bindings/js/JSWorkerGlobalScopeBase.cpp:
        Implement HostPromiseRejectionTracker hook for Document but not Worker.
        Passes through to the ScriptExecutionContext's tracker.

        * bindings/js/JSMainThreadExecState.cpp:
        (WebCore::JSMainThreadExecState::didLeaveScriptContext):
        * bindings/js/JSMainThreadExecState.h:
        (WebCore::JSMainThreadExecState::~JSMainThreadExecState):
        When completing script execution and performing microtasks notify
        about rejected promises. Technically this should go inside of
        performing a microtask checkpoint, except lacking EventLoop
        concepts we use ScriptExecutionState.

        * dom/EventNames.h:
        * dom/EventNames.in:
        * dom/PromiseRejectionEvent.cpp: Added.
        (WebCore::PromiseRejectionEvent::PromiseRejectionEvent):
        (WebCore::PromiseRejectionEvent::~PromiseRejectionEvent):
        * dom/PromiseRejectionEvent.h: Added.
        * dom/PromiseRejectionEvent.idl: Added.
        New PromiseRejectionEvent event interface.

        * dom/GlobalEventHandlers.idl:
        New onunhandledrejection and onrejectionhandled.

        * dom/RejectedPromiseTracker.cpp: Added.
        (WebCore::RejectedPromise::RejectedPromise):
        (WebCore::RejectedPromise::globalObject):
        (WebCore::RejectedPromise::promise):
        (WebCore::UnhandledPromise::UnhandledPromise):
        (WebCore::UnhandledPromise::callStack):
        (WebCore::RejectedPromiseTracker::RejectedPromiseTracker):
        (WebCore::RejectedPromiseTracker::~RejectedPromiseTracker):
        (WebCore::createScriptCallStackFromReason):
        (WebCore::RejectedPromiseTracker::promiseRejected):
        (WebCore::RejectedPromiseTracker::promiseHandled):
        (WebCore::RejectedPromiseTracker::processQueueSoon):
        (WebCore::RejectedPromiseTracker::reportUnhandledRejections):
        (WebCore::RejectedPromiseTracker::reportRejectionHandled):
        * dom/RejectedPromiseTracker.h: Added.
        Track and report rejected promises. The promises are tracked weakly
        allowing them to be collected before they are reported. When reporting
        we dispatch PromiseRejectionEvent events, and if the default is not
        prevented we log a message to the console.

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::reportUnhandledPromiseRejection):
        (WebCore::ScriptExecutionContext::ensureRejectedPromiseTrackerSlow):
        * dom/ScriptExecutionContext.h:
        (WebCore::ScriptExecutionContext::ensureRejectedPromiseTracker):
        Each ScriptExecutionContext can own a rejected promise tracker.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::pauseInternal):
        https://html.spec.whatwg.org/multipage/embedded-content.html#internal-pause-steps
        Internal pause steps say to timeupdate, pause, and rejecting pending play promises
        should all happen in a queued task. Here the first two actions are already scheduled
        on tasks, but rejecting play promises was not being done in a task, so this makes
        that change.

        * Modules/streams/ReadableStream.js:
        (pipeThrough):
        * Modules/streams/ReadableStreamInternals.js:
        (readableStreamReaderGenericInitialize):
        (readableStreamError):
        (readableStreamReaderGenericRelease):
        Satisfy parts of the Streams specification which state to set the
        [[PromiseIsHandled]] internal state of promises created internally
        by the Streams APIs. This prevents some internal promises from
        appearing as unhandled promise rejections.

2017-04-27  Chris Dumez  <cdumez@apple.com>

        Align colspan/rowspan limits with the latest HTML specification
        https://bugs.webkit.org/show_bug.cgi?id=171322

        Reviewed by Darin Adler.

        Align colspan/rowspan limits with the latest HTML specification after:
        - https://github.com/whatwg/html/pull/1993

        The following changes were made:
        - Our rowspan limit was raised from 8190 to 65534
        - A colspan limit of 1000 was introduced. Blink has UseCounter data showing that
          colspans over 1000 are extremely rare and Gecko has data showing that when we
          get a colspan greater than 1000, it is usually a bug. Therefore, this change
          should be fine.
        - The limits are now properly reflected via the IDL attributes instead of lying
          to the Web about the colspan / rowspan we are using internally.

        Test: imported/w3c/web-platform-tests/html/semantics/tabular-data/processing-model-1/span-limits.html

        * html/HTMLTableCellElement.cpp:
        (WebCore::HTMLTableCellElement::colSpan):
        (WebCore::HTMLTableCellElement::rowSpan):
        (WebCore::HTMLTableCellElement::rowSpanForBindings):
        (WebCore::HTMLTableCellElement::setColSpan):
        * html/HTMLTableCellElement.h:
        * html/HTMLTableCellElement.idl:
        * html/parser/HTMLParserIdioms.cpp:
        (WebCore::parseHTMLIntegerInternal):
        (WebCore::parseHTMLInteger):
        (WebCore::parseHTMLNonNegativeInteger):
        (WebCore::parseValidHTMLNonNegativeIntegerInternal):
        (WebCore::parseHTTPRefreshInternal):
        * html/parser/HTMLParserIdioms.h:
        (WebCore::parseHTMLInteger):
        (WebCore::parseHTMLNonNegativeInteger):

        (WebCore::clampHTMLNonNegativeIntegerToRange):
        Add utility function to implement:
        - https://html.spec.whatwg.org/#clamped-to-the-range

2017-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        WKUIDelegatePrivate needs a hook to vend data used to initialize item providers for data interaction
        https://bugs.webkit.org/show_bug.cgi?id=171386
        <rdar://problem/31557237>

        Reviewed by Beth Dakin.

        Teach WebItemProviderPasteboard to remember what WebItemProviderRegistrationInfoList it was initialized with
        when beginning a drag. This information is cleared out the next time the list of item providers is set to
        something different, which happens when the data interaction session concludes.

        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard init]):
        (-[WebItemProviderPasteboard setItemProviders:]):
        (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]):
        (-[WebItemProviderPasteboard registrationInfoAtIndex:]):
        (-[WebItemProviderPasteboard itemProviderAtIndex:]):

2017-04-27  Brady Eidson  <beidson@apple.com>

        Refactor SessionID to support multiple non-ephemeral (persistent) sessions.
        https://bugs.webkit.org/show_bug.cgi?id=171367

        Reviewed by Andy Estes.

        This is also a nice general cleanup of SessionID, including privatizing the "arbitrary number" constructor
        and moving encode/decode into the class.

        No new tests (Refactor, no behavior change yet).

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        
        * page/SessionID.cpp: Added.
        (WebCore::SessionID::generatePersistentSessionID):
        (WebCore::SessionID::generateEphemeralSessionID):
        (WebCore::SessionID::enableGenerationProtection):
        
        * page/SessionID.h:
        (WebCore::SessionID::SessionID):
        (WebCore::SessionID::emptySessionID):
        (WebCore::SessionID::hashTableDeletedValue):
        (WebCore::SessionID::defaultSessionID):
        (WebCore::SessionID::legacyPrivateSessionID):
        (WebCore::SessionID::isValid):
        (WebCore::SessionID::isEphemeral):
        (WebCore::SessionID::encode):
        (WebCore::SessionID::decode):
        (WTF::HashTraits<WebCore::SessionID>::constructDeletedValue):
        (WTF::HashTraits<WebCore::SessionID>::isDeletedValue):

2017-04-27  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Attempt to fix a PLT regression on Mac
        <rdar://problem/31826998>

        Unreviewed.

        Disable passing the TypeIdentifierHint to CGImageSourceCreateIncremental()
        on Mac for now.

        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::ImageDecoder::ImageDecoder):

2017-04-27  Daniel Bates  <dabates@apple.com>

        Rename callerDOMWindow()/CallerDocument to incumbentDOMWindow()/IncumbentDocument
        https://bugs.webkit.org/show_bug.cgi?id=171145

        Reviewed by Saam Barati.

        Standardize on the terminology "incumbent" to refer to "most-recently-entered author
        function or script on the stack, or the author function or script that originally
        scheduled the currently-running callback" (1).

        [1] <https://html.spec.whatwg.org/multipage/webappapis.html#realms-settings-objects-global-objects> (27 April 2017)

        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::incumbentDOMWindow):
        (WebCore::callerDOMWindow): Deleted.
        * bindings/js/JSDOMWindowBase.h:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateCallWith):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionWithCallerDocumentArgumentCaller):
        (WebCore::jsTestObjPrototypeFunctionWithCallerWindowArgumentCaller):
        * bindings/scripts/test/TestObj.idl:
        * page/DOMWindow.idl:

2017-04-27  Youenn Fablet  <youenn@apple.com>

        LayoutTest webrtc/datachannel/datachannel-event.html is a flaky crash
        https://bugs.webkit.org/show_bug.cgi?id=171092
        <rdar://problem/31748066>

        Reviewed by Eric Carlson.

        Covered by manual testing on iterating on the crashing tests.
        With the patch, they appear to no longer crash.

        The current RTCPeerConnection/RTCController was expecting that peer connections would be stopped before the controller.
        This assumption is sometimes wrong.
        Adding clean-up on both sides so that if controller goes away, it notifies its peer connections that they are unregistered.

        * Modules/mediastream/RTCController.cpp:
        (WebCore::RTCController::~RTCController):
        * Modules/mediastream/RTCController.h:
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::create):
        (WebCore::RTCPeerConnection::~RTCPeerConnection):
        (WebCore::RTCPeerConnection::doStop):
        (WebCore::RTCPeerConnection::registerToController):
        (WebCore::RTCPeerConnection::unregisterFromController):
        (WebCore::RTCPeerConnection::rtcController): Deleted.
        * Modules/mediastream/RTCPeerConnection.h:

2017-04-27  Said Abou-Hallawa  <sabouhallawa@apple.com>

        REGRESSION(r213764): Async decoding of animated images is disabled for ImageDocument
        https://bugs.webkit.org/show_bug.cgi?id=170333

        Reviewed by Simon Fraser.

        The way the image drawing settings are transfered from the Settings to
        BitmapImage is problematic. The drawing settings are retrieved from the
        CachedImageObserver which store them in the constructor only if the
        CachedImage as a loader. In the case of ImageDocument, there isn't loader
        set in CachedImage so the settings of ImageDocument are not set. Also
        the CachedImage can be used after loading by another document which may
        have a different drawing settings.

        The fix is to make BitmapImage reads the drawing settings every time it 
        is drawn as a foreground or background image in a RenderElement.

        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::drawImage):
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::CachedImageObserver::CachedImageObserver):
        * loader/cache/CachedImage.h:
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::setDrawingSettings):
        (WebCore::BitmapImage::draw):
        (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): I was
        trying to disable the async image decoding temporarily but this way will
        even prevent testing it until it is enabled. Disable it through WK1 and
        WK2 preferences.
        (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages):
        (WebCore::BitmapImage::advanceAnimation):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/ImageObserver.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintIntoRect):

2017-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        Performing data interaction with plain text into a contenteditable does not insert any content
        https://bugs.webkit.org/show_bug.cgi?id=171381

        Reviewed by Tim Horton.

        Attempt to read plain-text-conformant UTI types as kUTTypePlainText before reading them as kUTTypeText.
        This allows WebItemProviderPasteboard to properly materialize an NSString in -valuesForPasteboardType:
        inItemSet: using a pre-loaded NSData blob.

        This scenario is covered by DataInteractionTests.ExternalSourceUTF8PlainTextOnly, but DataInteractionTests
        are temporarily disabled due to incompatibilities with the current internal SDK.

        * platform/ios/PasteboardIOS.mm:
        (WebCore::readPasteboardWebContentDataForType):

2017-04-27  Chris Dumez  <cdumez@apple.com>

        Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
        https://bugs.webkit.org/show_bug.cgi?id=171226

        Reviewed by Simon Fraser.

        Element.getBoundingClientRect() / getClientRects() should return a DOMRect types
        as per:
        - https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface

        DOMRect is compatible with ClientRect, which we used to return so the risk should
        be low.

        Tests: fast/css/DOMRect-attributes-prototype.html
               fast/css/DOMRect-serialization.html
               fast/dom/Element/getClientRects-return-type.html

        * dom/ClientRectList.cpp:
        (WebCore::ClientRectList::ClientRectList):
        * dom/ClientRectList.h:
        (WebCore::ClientRectList::create):
        * dom/DOMRect.h:
        (WebCore::DOMRect::create):
        * dom/DOMRectReadOnly.h:
        * dom/Element.cpp:
        (WebCore::toDOMRectVector):
        (WebCore::Element::getClientRects):
        (WebCore::Element::getBoundingClientRect):
        * dom/Element.h:
        * dom/Element.idl:
        * html/track/VTTRegion.cpp:
        (WebCore::VTTRegion::displayLastTextTrackCueBox):

2017-04-27  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: Expose elements with the ARIA "feed" role
        https://bugs.webkit.org/show_bug.cgi?id=171184

        Reviewed by Chris Fleizach.

        Map elements with the "feed" role to the internal ApplicationGroupRole
        AccessibilityRole. This prevents them from being unexpectedly pruned from
        the accessibility tree, and causes them to be exposed with ATK_ROLE_PANEL
        in WebKitGtk and AXGroup in Safari.

        No new tests needed. Instead, add the "feed" role to roles-exposed.html,
        xml-roles-exposed.html, and roles-computedRoleString.html.

        * accessibility/AccessibilityObject.cpp:
        (WebCore::initializeRoleMap):

2017-04-27  Brady Eidson  <beidson@apple.com>

        Update NetworkStorageSession to support multiple persistent sessions and explicitly set cookie storages.
        https://bugs.webkit.org/show_bug.cgi?id=171365

        Reviewed by Andy Estes.

        No new tests (No testable behavior change yet).

        * platform/network/NetworkStorageSession.cpp:
        (WebCore::NetworkStorageSession::destroySession):
        * platform/network/NetworkStorageSession.h:
        
        * platform/network/NetworkStorageSessionStub.cpp:
        (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
        (WebCore::NetworkStorageSession::ensureSession):
        
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::createCFStorageSessionForIdentifier):
        (WebCore::NetworkStorageSession::NetworkStorageSession):
        (WebCore::NetworkStorageSession::switchToNewTestingSession):
        (WebCore::NetworkStorageSession::defaultStorageSession):
        (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession):
        (WebCore::NetworkStorageSession::ensureSession):
        (WebCore::NetworkStorageSession::cookieStorage):
        
        * platform/network/soup/NetworkStorageSessionSoup.cpp:
        (WebCore::NetworkStorageSession::ensureSession):
        
        * platform/spi/cf/CFNetworkSPI.h:

2017-04-27  Zalan Bujtas  <zalan@apple.com>

        Use text-shadow to visualize simple line layout coverage.
        https://bugs.webkit.org/show_bug.cgi?id=171379

        Reviewed by Antti Koivisto.

        It's more subtle (for everyday use).

        * rendering/SimpleLineLayoutFunctions.cpp:
        (WebCore::SimpleLineLayout::paintFlow):
        (WebCore::SimpleLineLayout::paintDebugBorders): Deleted.

2017-04-27  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] ARIA alertdialogs should be exposed with ROLE_DIALOG
        https://bugs.webkit.org/show_bug.cgi?id=171187

        Reviewed by Chris Fleizach.

        Map ApplicationAlertDialogRole to ATK_ROLE_DIALOG. While ATK_ROLE_ALERT is
        appropriate as far as ATK is concerned, the Core Accessibility API Mappings
        map ARIA's alertdialog role to ATK_ROLE_DIALOG. We should be consistent
        with the spec. The fact that this is an alert dialog can still be obtained
        via the AtkObject attributes.

        No new tests needed. Update the expectations for roles-exposed.html,
        xml-roles-exposed.html, and aria-mappings.html to reflect the change.

        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (atkRole):

2017-04-27  Antti Koivisto  <antti@apple.com>

        Repeated layouts in Mail due to viewport units being used with auto-sizing
        https://bugs.webkit.org/show_bug.cgi?id=171371
        <rdar://problem/28780084>

        Reviewed by Zalan Bujtas.

        Test: css3/viewport-percentage-lengths/vh-auto-size.html

        Auto-sizing code would adjust the size of the view in the beginning of layout(). This would
        end up invalidating style for elements that use vh units and we would perform main layout
        with unclean style. This would result in endless layout loops and hit assert on debug.

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

            Ensure we heve clean style after resize if we are in pre-layout.

2017-04-27  Alex Christensen  <achristensen@webkit.org>

        Modernize Frame.h
        https://bugs.webkit.org/show_bug.cgi?id=171357

        Reviewed by Andy Estes.

        Frame.h has several std::unique_ptrs that are created in the constructor, never null,
        and destroyed in the destructor.  This is what WTF::UniqueRef is for, and using UniqueRef
        allows us to not check for null values because a UniqueRef can never be null.
        An interesting case was the EventHandler, which we explicitly set to nullptr in the destructor
        of MainFrame, a subclass of Frame.  We added this in r199181 to fix a crash tested by
        fast/events/wheel-event-destroys-frame.html and this improved lifetime also does not crash
        or assert in that test.

        Using UniqueRef also requires const correctness, which this patch adds when necessary.

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::dispatchTouchEvent):
        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
        * editing/Editor.cpp:
        (WebCore::Editor::isSelectTrailingWhitespaceEnabled):
        (WebCore::Editor::computeAndSetTypingStyle):
        * editing/Editor.h:
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::contains):
        (WebCore::FrameSelection::copyTypingStyle):
        * editing/FrameSelection.h:
        (WebCore::FrameSelection::setTypingStyle):
        * loader/EmptyClients.cpp:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::clear):
        * page/EditorClient.h:
        * page/EventHandler.cpp:
        (WebCore::EventHandler::hitTestResultAtPoint):
        * page/EventHandler.h:
        * page/Frame.cpp:
        (WebCore::Frame::Frame):
        (WebCore::Frame::setView):
        (WebCore::Frame::injectUserScripts):
        * page/Frame.h:
        (WebCore::Frame::editor):
        (WebCore::Frame::eventHandler):
        (WebCore::Frame::selection):
        (WebCore::Frame::animation):
        (WebCore::Frame::script):
        (WebCore::Frame::eventHandlerPtr): Deleted.
        * page/MainFrame.cpp:
        (WebCore::MainFrame::~MainFrame):
        * replay/UserInputBridge.cpp:
        (WebCore::UserInputBridge::handleContextMenuEvent):
        * replay/UserInputBridge.h:

2017-04-27  Andy Estes  <aestes@apple.com>

        Fix the macOS build.

        * platform/mac/WebPlaybackControlsManager.h:

2017-04-27  Zalan Bujtas  <zalan@apple.com>

        Text gets cut off when bailing out of simple line layout with widows.
        https://bugs.webkit.org/show_bug.cgi?id=171370
        <rdar://problem/31563414>

        Reviewed by Antti Koivisto.

        Normal line layout requires an extra layout to handle widows. See RenderBlockFlow::relayoutToAvoidWidows. 

        Test: fast/multicol/simple-line-layout-widows-when-switching-over-to-normal-line-layout.html

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::ensureLineBoxes):

2017-04-27  Dean Jackson  <dino@apple.com>

        Use the correct modern-media-controls
        https://bugs.webkit.org/show_bug.cgi?id=171358

        Reviewed by Antoine Quint.

        * WebCore.xcodeproj/project.pbxproj:

2017-04-26  Dan Bernstein  <mitz@apple.com>

        Reverted r215774.

        That change wasn’t doing what it was intended to do and was inappropriate for WebCore.

        * WebCore.xcodeproj/project.pbxproj:

2017-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Attempt to fix a PLT regression.
        <rdar://problem/31826998>

        Unreviewed.

        Disable passing the TypeIdentifierHint to CGImageSourceCreateIncremental()
        on iOS for now.

        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::ImageDecoder::ImageDecoder):

2017-04-26  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] ARIA buttons which have a popup should be ATK_ROLE_PUSH_BUTTON; not ATK_ROLE_COMBO_BOX
        https://bugs.webkit.org/show_bug.cgi?id=171182

        Reviewed by Chris Fleizach.

        Test: accessibility/gtk/button-with-aria-haspopup-is-not-a-combobox.html

        WebCore Accessibility assigns PopUpButtonRole to collapsed select elements,
        which the ATK code correctly maps to ATK_ROLE_COMBO_BOX. It turns out that
        WebCore Accessibility also maps the ARIA button role to PopUpButtonRole if
        it also has aria-haspopup. Add a check to atkRole() so that the latter case
        is mapped to ATK_ROLE_PUSH_BUTTON.

        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (atkRole):

2017-04-26  Tim Horton  <timothy_horton@apple.com>

        Should not drag x-apple-data-detectors links
        https://bugs.webkit.org/show_bug.cgi?id=171352
        <rdar://problem/31309081>

        Reviewed by Beth Dakin.

        Test: fast/events/do-not-drag-and-drop-data-detectors-link.html

        These links are only meaningful in the context of the original document,
        so they should not be draggable.

        * editing/cocoa/DataDetection.h:
        * editing/cocoa/DataDetection.mm:
        (WebCore::DataDetection::dataDetectorURLProtocol):
        (WebCore::DataDetection::isDataDetectorURL):
        * page/DragController.cpp:
        (WebCore::isDraggableLink):
        Disallow dragging of <a href="x-apple-data-detectors://..."> links.

2017-04-26  Tim Horton  <timothy_horton@apple.com>

        Revert accidentally smushed commit.

        * editing/cocoa/DataDetection.h:
        * editing/cocoa/DataDetection.mm:
        (WebCore::DataDetection::dataDetectorURLProtocol): Deleted.
        (WebCore::DataDetection::isDataDetectorURL): Deleted.
        * page/DragController.cpp:
        (WebCore::isDraggableLink):
        * platform/mac/DragImageMac.mm:
        (WebCore::createDragImageForLink):

2017-04-26  Alex Christensen  <achristensen@webkit.org>

        REGRESSION (r215686): ASSERTION FAILED: data seen with webarchive/loading tests
        https://bugs.webkit.org/show_bug.cgi?id=171340

        Reviewed by Brady Eidson.

        This fixes a flaky assertion in webarchive/loading/missing-data.html

        * platform/cf/SharedBufferCF.cpp:
        (WebCore::SharedBuffer::append):
        If there's no CFDataRef, there's no need to append data.
        This happens sometimes.

2017-04-26  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r215814.

        The LayoutTest for this change is failing on ios-simulator and
        is flaky on macOS.

        Reverted changeset:

        "Response.blob() does not set the content-type based on the
        header value."
        https://bugs.webkit.org/show_bug.cgi?id=170849
        http://trac.webkit.org/changeset/215814

2017-04-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        WebItemProviderPasteboard should not synchronously load provided data
        https://bugs.webkit.org/show_bug.cgi?id=171341
        <rdar://problem/31614010>

        Reviewed by Tim Horton.

        Refactors WebItemProviderPasteboard to not require asynchronously loading item provider data. To accomplish this,
        we ensure that before performing data interaction, the UTI type that the data operation target should consume is
        propagated to the UI process prior to the web process receiving the signal from the UI process to begin the
        data operation itself. This information is sent via WebPlatformStrategies::updatePreferredTypeIdentifiers, a new
        pasteboard helper function.

        * page/DragController.cpp:
        (WebCore::DragController::DragController):
        (WebCore::dragIsHandledByDocument):
        (WebCore::DragController::performDragOperation):
        (WebCore::DragController::dragEnteredOrUpdated):
        (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod):
        (WebCore::DragController::tryDocumentDrag):

        Give DragHandlingMethod a richer representation of what type of action will be performed. DragController::
        updatePreferredTypeIdentifiersForDragHandlingMethod uses this to determine what kinds of UTIs are acceptable for
        the current drop session.

        * page/DragController.h:
        (WebCore::DragController::documentIsHandlingNonDefaultDrag):
        * page/mac/DragControllerMac.mm:
        (WebCore::DragController::updatePreferredTypeIdentifiersForDragHandlingMethod):

        Updates the data interaction pasteboard's list of preferred type identifiers it should load upon data operation.

        * platform/DragData.h:
        * platform/PasteboardStrategy.h:
        * platform/PlatformPasteboard.h:
        * platform/ios/AbstractPasteboard.h:
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::updatePreferredTypeIdentifiers):
        * platform/ios/WebItemProviderPasteboard.mm:

        Introduce _preferredTypeIdentifiers, which -doAfterLoadingProvidedContentIntoFileURLs: uses as a hint when
        determining which UTI to load for an item provider. In the absence of preferred type identifiers, the default
        behavior is to use the highest fidelity type adhering to "public.content".

        (-[WebItemProviderPasteboard init]):
        (-[WebItemProviderPasteboard updatePreferredTypeIdentifiers:]):
        (-[WebItemProviderPasteboard setItemProviders:]):
        (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
        (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):

        Remove calls to -createObjectOfClass: and -copyDataRepresentation:. Instead, rely solely on the loaded file URL
        to read and initialize data and objects from the pasteboard.

        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):
        (-[WebItemProviderPasteboard _tryToCreateObjectOfClass:usingProvider:]): Deleted.
        * platform/mac/DragDataMac.mm:
        (WebCore::DragData::updatePreferredTypeIdentifiers):

2017-04-26  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] Elements with a defined, non-false value for aria-current should expose ATK_STATE_ACTIVE
        https://bugs.webkit.org/show_bug.cgi?id=171163

        Reviewed by Chris Fleizach.

        Add ATK_STATE_ACTIVE to the state set of elements which have a valid, non-false
        value for aria-current, expose the value of via the "current" AtkObject attribute,
        and emit state-change notifications when the value of aria-current changes from
        non-false to false, or vice versa.

        Tests: accessibility/gtk/aria-current-changed-notification.html
               accessibility/gtk/aria-current.html

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::handleAttributeChanged):
        * accessibility/AXObjectCache.h:
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::supportsARIACurrent):
        (WebCore::AccessibilityObject::ariaCurrentValue):
        * accessibility/AccessibilityObject.h:
        * accessibility/atk/AXObjectCacheAtk.cpp:
        (WebCore::AXObjectCache::postPlatformNotification):
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):
        (setAtkStateSetFromCoreObject):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Moved code returning
        string value for aria-current into AccessibilityObject:ariaCurrentValue().

2017-04-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        WebItemProviderPasteboard should fetch preloaded assets from disk when possible
        https://bugs.webkit.org/show_bug.cgi?id=171320
        <rdar://problem/31614010>

        Reviewed by Tim Horton.

        Adds a mechanism to WebItemProviderPasteboard to remember the temporary file URLs of assets it has loaded using
        doAfterLoadingProvidedContentIntoFileURLs:. When retrieving data from the pasteboard, we then see if we can
        first fetch serialized data straight from disk instead of having to go through the item provider in both
        -dataForPasteboardType:inItemSet: and -valuesForPasteboardType:inItemSet:.

        See below annotations for more detail.

        * platform/ios/AbstractPasteboard.h:
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::filenamesForDataInteraction):
        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:

        Introduces _typeToFileURLMaps, an array of dictionaries. A dictionary at the ith index of this array represents
        a mapping of UTIs to loaded temo file URLs for the ith UIItemProvider in the _itemProviders array. Before data
        interaction is performed, all entries in this array will be empty.

        (-[WebItemProviderPasteboard init]):
        (-[WebItemProviderPasteboard setItemProviders:]):
        (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
        (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
        (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):

        Consult any loaded assets on disk before hitting UIItemProviders via the new
        -_preLoadedDataConformingToType:forItemProviderAtIndex: helper method.

        (-[WebItemProviderPasteboard _tryToCreateObjectOfClass:usingProvider:]):
        (-[WebItemProviderPasteboard fileURLsForDataInteraction]):

        Traverse _typeToFileURLMaps to collect all file URLs.

        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):

        Refactored to populate and set _typeToFileURLMaps when loading completes, rather than an array of file URLs.

        (-[WebItemProviderPasteboard _tryToCreateAndAppendObjectOfClass:toArray:usingProvider:]): Deleted.
        (-[WebItemProviderPasteboard filenamesForDataInteraction]): Deleted.

        Correct an erroneously named method (replaces filenames with fileURLs).

2017-04-26  Youenn Fablet  <youenn@apple.com>

        LayoutTest webrtc/datachannel/basic.html is a flaky crash
        https://bugs.webkit.org/show_bug.cgi?id=170154
        <rdar://problem/31288423>

        Reviewed by Geoffrey Garen.

        Before the patch, we are setting the channel handler client to null and then unregistering from observer to
        libwebrtc data channel. Since this happens in two different threads, there might be a timing issue.

        Removing this risk by first unregistering (done synchronously on the other thread), before setting client to null.
        Made some clean-up related refactoring.

        * Modules/mediastream/RTCDataChannel.cpp:
        (WebCore::RTCDataChannel::create):
        (WebCore::RTCDataChannel::close):
        * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
        (WebCore::LibWebRTCDataChannelHandler::setClient):
        (WebCore::LibWebRTCDataChannelHandler::close):
        * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
        * platform/mediastream/RTCDataChannelHandler.h:
        * platform/mock/RTCDataChannelHandlerMock.cpp:
        (WebCore::RTCDataChannelHandlerMock::setClient):
        * platform/mock/RTCDataChannelHandlerMock.h:

2017-04-26  Alex Christensen  <achristensen@webkit.org>

        Make user script injection more robust
        https://bugs.webkit.org/show_bug.cgi?id=171339
        <rdar://problem/30643691>

        Reviewed by Geoffrey Garen.

        * loader/EmptyClients.cpp:
        * page/Frame.cpp:
        (WebCore::Frame::injectUserScripts):
        * page/UserContentController.cpp:
        (WebCore::UserContentController::forEachUserScript):
        (WebCore::UserContentController::forEachUserStyleSheet):
        (WebCore::UserContentController::forEachUserMessageHandler):
        * page/UserContentController.h:
        * page/UserContentProvider.h:

2017-04-26  Zalan Bujtas  <zalan@apple.com>

        RTL: recent searches popover is displayed in incorrect location
        https://bugs.webkit.org/show_bug.cgi?id=171338
        <rdar://problem/31377807>

        Reviewed by Dean Jackson.

        Compute the absolute coordinates for the popup the same way we do for the select dropdown.

        * rendering/RenderSearchField.cpp:
        (WebCore::RenderSearchField::showPopup):

2017-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Restrict WebKit image formats to a known whitelist
        https://bugs.webkit.org/show_bug.cgi?id=170700

        Reviewed by Tim Horton.

        If the image format is not supported, the load should be canceled and the
        image is marked a broken image.

        Test: fast/images/image-formats-support.html

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::addIncrementalDataBuffer):
        (WebCore::CachedImage::setImageDataBuffer):
        (WebCore::CachedImage::finishLoading):
        * loader/cache/CachedImage.h:

2017-04-26  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] Implement support for new ARIA 1.1 values of aria-haspopup
        https://bugs.webkit.org/show_bug.cgi?id=171164

        Reviewed by Chris Fleizach.

        In ARIA 1.1, aria-haspopup's value type changed from true/false to a token.
        Values: true, false (default, unless it's a combobox), dialog, grid, listbox
        (default for combobox), menu, and tree. Any value of aria-haspopup that is
        not included in the list of allowed values, including an empty string, must
        be treated as if the value false had been provided.

        Add AccessibilityObject::ariaPopupValue() to validate the value, handle implicit
        values, and give platform assistive technologies a means to access that value.

        If there is a valid, non-false value of aria-haspopup, include ATK_STATE_HAS_POPUP
        in the AtkStateSet. Lastly, expose the value (rather than true/false) via the "haspop"
        AtkObject attribute.

        Test: accessibility/gtk/aria-haspopup.html

        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityObject::ariaPopupValue):
        (WebCore::AccessibilityObject::supportsARIAHasPopup):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::ariaHasPopup):
        * accessibility/AccessibilityRenderObject.h:
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):
        (setAtkStateSetFromCoreObject):

2017-04-26  Alex Christensen  <achristensen@webkit.org>

        Fix CMake build.

        * PlatformMac.cmake:

2017-04-26  Antti Koivisto  <antti@apple.com>

        Enable expired-only reload policy on Mac and iOS
        https://bugs.webkit.org/show_bug.cgi?id=171264
        <rdar://problem/31807637>

        Reviewed by Andreas Kling.

        Limit the behavior to http and data URLs (where we explicitly know about expiration).

        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::setCSSStyleSheet):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::subresourceCachePolicy):

            Pass the URL so we can test for protocol.

        * loader/FrameLoader.h:
        * loader/NavigationAction.cpp:
        (WebCore::navigationType):

            Test for reload navigation type correctly.

        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::determineRevalidationPolicy):
        (WebCore::CachedResourceLoader::cachePolicy):
        * loader/cache/CachedResourceLoader.h:

2017-04-26  WebKit Contributor  <webkitcontrib@gmail.com>

        Response.blob() does not set the content-type based on the header value.
        https://bugs.webkit.org/show_bug.cgi?id=170849

        Reviewed by Alex Christensen.

        The Fetch API specification requires setting the blob contentType
        using the Content-Type header value, if present.  Previously the
        FetchResponse class only called updateContentType() when first
        created even though all the headers were not available.  Call
        updateContentType() again after the headers are populated.

        This change allows WebKit to pass the "Consume response's body: from
        fetch to blob" case in the WPT response-consume.html test.

        Test: http://w3c-test.org/fetch/api/response/response-consume.html

        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Modified to
        call FetchBodyOwner::updateContentType() after filling m_headers.

2017-04-26  Andy Estes  <aestes@apple.com>

        Try to fix the macOS Sierra build.

        * platform/mac/WebVideoFullscreenInterfaceMac.mm:

2017-04-26  Andy Estes  <aestes@apple.com>

        [macOS] Add picture-in-picture support to WebPlaybackControlsManager
        https://bugs.webkit.org/show_bug.cgi?id=171328
        <rdar://problem/29875010>

        Reviewed by Jer Noble.

        * platform/cocoa/WebPlaybackSessionModel.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        (WebCore::WebPlaybackSessionModelMediaElement::togglePictureInPicture): If the media element
        is currently in PiP fullscreen mode, exit fullscreen. Otherwise, enter PiP fullscreen mode.
        * platform/mac/WebPlaybackControlsManager.h:
        * platform/mac/WebPlaybackControlsManager.mm:
        (-[WebPlaybackControlsManager canTogglePictureInPicture]): Added. Returns YES if
        -allowsPictureInPicturePlayback returns YES.
        (-[WebPlaybackControlsManager togglePictureInPicture]): Added. Calls
        WebPlaybackSessionModel::togglePictureInPicture().
        * platform/mac/WebVideoFullscreenInterfaceMac.mm:
        (WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen): Added a call to
        -[WebPlaybackControlsManager setPictureInPictureActive:YES].
        (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen): Added a call to
        -[WebPlaybackControlsManager setPictureInPictureActive:NO].
        (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode): Ditto.
        * platform/spi/cocoa/AVKitSPI.h: Declared new SPI on AVTouchBarPlaybackControlsControlling.

2017-04-25  Dean Jackson  <dino@apple.com>

        [Color] Make gradients work with ExtendedColors
        https://bugs.webkit.org/show_bug.cgi?id=171315
        <rdar://problems/31830177>

        Reviewed by Antoine Quint.

        Allow gradients to hold Color objects, and thus
        handle ExtendedColor. Implement the backend for
        CoreGraphics.

        Test: css3/color/gradients.html

        * platform/graphics/Gradient.cpp:
        (WebCore::Gradient::addColorStop): Just copy the Color now.
        (WebCore::compareStops): Handle rename of stop to offset.
        (WebCore::Gradient::hasAlpha): Use Color's helper.
        * platform/graphics/Gradient.h:
        (WebCore::Gradient::ColorStop::ColorStop): Rename stop
        to offset, and store a Color rather than four floating
        point values.
        * platform/graphics/cairo/GradientCairo.cpp:
        (WebCore::Gradient::platformGradient):
        * platform/graphics/cg/GradientCG.cpp:
        (WebCore::Gradient::platformGradient): Use the CG method
        that can handle CGColorRefs with ColorSpace values, and
        pass the Extended sRGB space which should be no change for
        all existing gradients but also handle ColorSpaces like
        Display P3.
        * platform/graphics/win/GradientDirect2D.cpp:
        (WebCore::Gradient::generateGradient):
        * svg/SVGGradientElement.cpp:
        (WebCore::SVGGradientElement::buildStops):

2017-04-25  Alex Christensen  <achristensen@webkit.org>

        Encoded filename should be decoded for WKContentExtension.identifier
        https://bugs.webkit.org/show_bug.cgi?id=171316

        Reviewed by Andy Estes.

        * platform/FileSystem.h:

2017-04-26  Frederic Wang  <fwang@igalia.com>

        Fix typo in RenderFrameBase
        https://bugs.webkit.org/show_bug.cgi?id=171324

        Reviewed by Zalan Bujtas.

        No new tests, behavior unchanged.

        * rendering/RenderFrameBase.cpp:
        (WebCore::RenderFrameBase::layoutWithFlattening):
        (WebCore::RenderFrameBase::performLayoutWithFlattening):
        (WebCore::RenderFrameBase::peformLayoutWithFlattening): Deleted.
        * rendering/RenderFrameBase.h:

2017-04-26  Zalan Bujtas  <zalan@apple.com>

        Forced page break on :after triggers infinite loop in column balancing
        https://bugs.webkit.org/show_bug.cgi?id=171309
        rdar://problem/26285884

        Reviewed by David Hyatt.

        Stop trying to balance the columns when the forced page breaks >= the number of
        columns even when this number is 1. Content will always overflow to the next page.
        see https://chromium.googlesource.com/chromium/src/+/fbbebf38cefb2712c912581eccb046ef363ec84e%5E%21/#F2 

        Test: fast/multicol/infinite-loop-when-forced-break.html

        * rendering/RenderMultiColumnSet.cpp:
        (WebCore::RenderMultiColumnSet::calculateBalancedHeight):

2017-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Attempt to fix a JetStream regression.
        <rdar://problem/31742414>

        Unreviewed.

        Disable async decoding for large images till the flickering bug wk170640
        is fixed.

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages):

2017-04-26  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r215767.

        The LayoutTest for this change is a flaky failure.

        Reverted changeset:

        "Restrict WebKit image formats to a known whitelist"
        https://bugs.webkit.org/show_bug.cgi?id=170700
        http://trac.webkit.org/changeset/215767

2017-04-26  Dave Hyatt  <hyatt@apple.com>

        Improve wavy underline rendering
        https://bugs.webkit.org/show_bug.cgi?id=171281

        Reviewed by Sam Weinig.

        Change wavy underline rendering to use font size instead of stroke
        thickness as a way to tune it. Cut the extra offset from 2 to 1.
        Change the parameters to make the line flatter and to make the proportion
        of the wave that renders underneath a glyph the same.

        * rendering/TextDecorationPainter.cpp:
        (WebCore::strokeWavyTextDecoration):
        (WebCore::TextDecorationPainter::paintTextDecoration):
        * style/InlineTextBoxStyle.cpp:
        (WebCore::getWavyStrokeParameters):
        (WebCore::visualOverflowForDecorations):
        * style/InlineTextBoxStyle.h:
        (WebCore::wavyOffsetFromDecoration):

2017-04-24  Sergio Villar Senin  <svillar@igalia.com>

        [css-grid] Remove most of the usage of SizingOperation
        https://bugs.webkit.org/show_bug.cgi?id=171225

        Reviewed by Darin Adler.

        SizingOperation was added as a way to modify the behaviour of the track sizing algorithm
        with the specifics for intrinsic size computations. The problem is that although intrinsic
        size computation does imply indefinite sizes, the opposite is not always true. For example,
        a grid container with height:auto would compute the row sizes with an indefinite size but is
        not part of the intrinsic size (preferred widths) computation.

        That's why it was wrongly used in some parts of the current code, in most of the cases is
        more than enough to check whether the available space is indefinite or not. In order to do
        that we have to keep both available sizes (height & width) around all the time to properly
        support orthogonal flows.

        This change does not imply any change in behaviour.

        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::GridTrackSizingAlgorithm::setAvailableSpace):
        (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
        (WebCore::GridTrackSizingAlgorithm::initialBaseSize):
        (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit):
        (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
        (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
        (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
        (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
        (WebCore::GridTrackSizingAlgorithm::gridTrackSize):
        (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction):
        (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
        (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
        (WebCore::GridTrackSizingAlgorithm::setup):
        (WebCore::GridTrackSizingAlgorithm::reset):
        * rendering/GridTrackSizingAlgorithm.h:
        (WebCore::GridTrackSizingAlgorithmStrategy::availableSpace):
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::availableSpaceForGutters):
        (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
        (WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
        (WebCore::RenderGrid::layoutBlock):
        (WebCore::RenderGrid::gridGap):
        (WebCore::RenderGrid::guttersSize):
        (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
        (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
        (WebCore::RenderGrid::computeAutoRepeatTracksCount):
        (WebCore::RenderGrid::placeItemsOnGrid):
        (WebCore::RenderGrid::trackSizesForComputedStyle):
        (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
        (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
        (WebCore::RenderGrid::populateGridPositionsForDirection):
        (WebCore::RenderGrid::columnAxisOffsetForChild):
        (WebCore::RenderGrid::rowAxisOffsetForChild):
        (WebCore::RenderGrid::gridGapForDirection): Deleted.
        * rendering/RenderGrid.h:

2017-04-26  Frederic Wang  <fwang@igalia.com>

        Remove Document::*FrameElementsShouldIgnoreScrolling
        https://bugs.webkit.org/show_bug.cgi?id=171271

        Reviewed by Chris Dumez.

        setFrameElementsShouldIgnoreScrolling and frameElementsShouldIgnoreScrolling were
        introduced bug 23072 in order to work around a bug in the Dictionary application.
        However, this was removed in bug 132095 and hence the functions are no longer necessary.

        No new tests.

        * dom/Document.h:
        (WebCore::Document::setFrameElementsShouldIgnoreScrolling): Deleted.
        (WebCore::Document::frameElementsShouldIgnoreScrolling): Deleted.
        * html/HTMLFrameElementBase.cpp:
        (WebCore::HTMLFrameElementBase::parseAttribute):

2017-04-26  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] CryptoKeyRSA: implement create(), keySizeInBits(), buildAlgorithm(), exportData()
        https://bugs.webkit.org/show_bug.cgi?id=171213

        Reviewed by Michael Catanzaro.

        CryptoKeyRSA::create() validates the specified key type along with the
        provided data. If everything is OK, it then proceeds to build the key
        of the appropriate type through an s-expression that is constructed with
        the necessary data. We don't currently support creating private keys
        with any additional prime information (apart from p and q).

        CryptoKeyRSA::keySizeInBits() calls the helper getRSAModulusLength()
        function that find the modulus MPI in the key s-expression and returns
        the modulus data length in bits.

        CryptoKeyRSA::buildAlgorithm() returns KeyAlgorithm that's constructed
        from the appropriate name, this key's modulus length, and this key's
        public exponent data. It also specifies the hash if there is such a
        restriction for this key.

        CryptoKeyRSA::exportData() returns a properly-constructed
        CryptoKeyDataRSAComponents object. The public modulus and exponent are
        used in case the key is public. If the key is private, the secret
        exponent and the p and q prime numbers are retrieved in MPI format.
        They're then used to calculate the dp, dq and qi parameters that are
        exported in the JWK format. Note that libgcrypt internally switches
        the p and q prime numbers such that p < q, but the Web Crypto
        specification and the dependant RFCs expect that q < p. We address
        this by simply switching the roles of the two primes and follow the
        usual q < p assumption when exporting the primes and computing the
        dependant exponents and coefficients.

        No new tests -- existing ones cover this but don't work yet due to missing
        RSA-related CryptoAlgorithm implementations.

        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
        (WebCore::getRSAModulusLength):
        (WebCore::getParameterMPIData):
        (WebCore::getRSAKeyParameter):
        (WebCore::CryptoKeyRSA::create):
        (WebCore::CryptoKeyRSA::keySizeInBits):
        (WebCore::CryptoKeyRSA::buildAlgorithm):
        (WebCore::CryptoKeyRSA::exportData):

2017-04-25  Jiewen Tan  <jiewen_tan@apple.com>

        [WebCrypto] Enhance ways to convert an ECDSA signature binary into DER format
        https://bugs.webkit.org/show_bug.cgi?id=171287
        <rdar://problem/31735332>

        Reviewed by Brent Fulgham.

        Covered by existing tests.

        * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
        (WebCore::verifyECDSA):

2017-04-25  Brent Fulgham  <bfulgham@apple.com>

        Relax the event firing ASSERT for Attr changes
        https://bugs.webkit.org/show_bug.cgi?id=171236
        <rdar://problem/30516349>

        Reviewed by Dean Jackson.

        The assertions added in Bug 167318 were overly strict, and trigger for valid behavior.
        Relax the assertion preventing event dispatch for the case of Attr elements at the
        end of childrenChanged.

        Test: fast/dom/HTMLLinkElement/event-while-removing-attribute.html

        * dom/Attr.cpp:
        (WebCore::Attr::childrenChanged):

2017-04-25  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Introduce shorter time-to-live for cookie partition whitelisting
        https://bugs.webkit.org/show_bug.cgi?id=171295
        <rdar://problem/31823818>

        Reviewed by Brent Fulgham.

        Test: http/tests/loading/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html

        * loader/ResourceLoadObserver.cpp:
        (WebCore::reduceTimeResolutionToOneDay): Deleted.
        (WebCore::reduceTimeResolution):
            Changed name to no longer lock this to a specific resolution.
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
            Now calls WebCore::reduceTimeResolution().
        (WebCore::ResourceLoadObserver::setTimeToLiveCookiePartitionFree):
            Added for testing purposes.
        (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
            Added for testing purposes.
        * loader/ResourceLoadObserver.h:
        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::shouldPartitionCookies):
            Static inline convenience function.
        (WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
            Now decides whether a domain should get partitioned cookies
            based on timeToLiveCookiePartitionFree.
            Removed clearFirst parameter since it's not needed here
            and it introduced complexity in keeping the store and the
            network process cache in sync.
        (WebCore::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
            Added for testing purposes.
        * loader/ResourceLoadStatisticsStore.h:

2017-04-25  Saam Barati  <sbarati@apple.com>

        JSArray::isArrayPrototypeIteratorProtocolFastAndNonObservable is wrong because it does not do the necessary checks on the base object
        https://bugs.webkit.org/show_bug.cgi?id=171150
        <rdar://problem/31771880>

        Reviewed by Sam Weinig.

        This patch moves the sequence converters to use the now fixed
        JSArray::isArrayPrototypeIteratorProtocolFastAndNonObservable test
        inside JSC.
        
        This patch also fixes a few bugs:
        1. Converting to a sequence of numbers must prove that the JSArray
        is filled only with Int32/Double. If there is a chance the array
        contains objects, the conversion to a numeric IDLType can be observable
        (via valueOf()), and can change the iterator protocol.
        2. There are other conversions that can have side effects a-la valueOf().
        This patch introduces a new static constant in the various Converter
        classes that tell the sequence converter if the conversion operation
        can have JS side effects. If it does have side effects, we fall back to
        the generic conversion that uses the iterator protocol. If not, we can
        do a faster version that iterates over each element of the array,
        reading it directly, and converting it.

        Tests: js/sequence-iterator-protocol-2.html
               js/sequence-iterator-protocol.html

        * bindings/js/JSDOMConvertAny.h: Does not have side effects.
        * bindings/js/JSDOMConvertBase.h: We pessimistically assume inside DefaultConverter that converions have side effects.
        * bindings/js/JSDOMConvertBoolean.h: Does not have side effects.
        * bindings/js/JSDOMConvertCallbacks.h: Does not have side effects.
        * bindings/js/JSDOMConvertObject.h: Does not have side effects.
        * bindings/js/JSDOMConvertSequences.h:
        (WebCore::Detail::NumericSequenceConverter::convert):
        (WebCore::Detail::SequenceConverter::convert):

2017-04-25  Michael Saboff  <msaboff@apple.com>

        Call bmalloc scavenger first when handling a memory pressure event
        https://bugs.webkit.org/show_bug.cgi?id=171289

        Reviewed by Geoffrey Garen.

        Let bmalloc free any pages to the OS that it can before doing anything else.

        * page/MemoryRelease.cpp:
        (WebCore::releaseMemory):

2017-04-25  Dean Jackson  <dino@apple.com>

        Skip WebKitAdditions for Safari Technology Preview media controls
        https://bugs.webkit.org/show_bug.cgi?id=171302
        <rdar://problem/31823256>

        Reviewed by Simon Fraser.

        Safari Technology Preview should use the same controls
        as OpenSource.

        * WebCore.xcodeproj/project.pbxproj:

2017-04-25  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r215730.

        The LayoutTest for this change is a flaky timeout on mac-wk1
        debug.

        Reverted changeset:

        "Enable expired-only reload policy on Mac and iOS"
        https://bugs.webkit.org/show_bug.cgi?id=171264
        http://trac.webkit.org/changeset/215730

2017-04-24  Matt Rajca  <mrajca@apple.com>

        Indicate presence of audio when handling autoplay events.
        https://bugs.webkit.org/show_bug.cgi?id=171227

        Reviewed by Alex Christensen.

        Added API tests.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::handleAutoplayEvent):
        (WebCore::HTMLMediaElement::playInternal):
        (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
        (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
        (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay):
        (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture):
        * html/HTMLMediaElement.h:
        * page/AutoplayEvent.h:
        * page/ChromeClient.h:

2017-04-25  Aakash Jain  <aakash_jain@apple.com>

        WebCore.framework should restrict allowable_clients
        https://bugs.webkit.org/show_bug.cgi?id=171260

        Reviewed by Alexey Proskuryakov.

        * Configurations/WebCore.xcconfig: Adding allowable_client to all platform, in order to restrict WebCore
        from being directly linked on any platform.
        Moved WebKitLegacy and WebCoreTestSupport to OTHER_LDFLAGS_BASE.
        Removed WebKit2 as allowable_client from mac.
        Added iTunesU, Casablanca and Remote to OTHER_LDFLAGS_BASE_ios for iTunes related projects.
        Added WebKit, TVBooks, DumpRenderTree, WebKitTestRunner and TestWebKitAPI to OTHER_LDFLAGS_BASE_ios.

2017-04-25  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Restrict WebKit image formats to a known whitelist
        https://bugs.webkit.org/show_bug.cgi?id=170700

        Reviewed by Tim Horton.

        If the image format is not supported, the load should be canceled and the
        image is marked a broken image.

        Test: fast/images/image-formats-support.html

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::addIncrementalDataBuffer):
        (WebCore::CachedImage::setImageDataBuffer):
        (WebCore::CachedImage::finishLoading):
        * loader/cache/CachedImage.h:

2017-04-25  Youenn Fablet  <youenn@apple.com>

        CoreAudioCaptureSource::suspend is asserting too often
        https://bugs.webkit.org/show_bug.cgi?id=171285

        Reviewed by Eric Carlson.

        No change of behavior.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::suspend): Moving the assertion to where it might be useful.

2017-04-25  Daniel Bates  <dabates@apple.com>

        Use an OptionSet for compositing reasons bitmask
        https://bugs.webkit.org/show_bug.cgi?id=171153

        Reviewed by Simon Fraser.

        We should make use of OptionSet to represent the bitmask of the reasons a layer
        was composited instead of using an integer and bitwise operations.

        * inspector/InspectorLayerTreeAgent.cpp:
        (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::reasonsForCompositing):
        (WebCore::RenderLayerCompositor::logReasonsForCompositing): Also fix code style issues;
        an else-if statement should be written as an if-statement when the prior if-statement
        concludes with a return statement.
        * rendering/RenderLayerCompositor.h:

2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>

        Supplementary Multilingual Plane Complex Scripts Rendered Incorrectly
        https://bugs.webkit.org/show_bug.cgi?id=171272
        <rdar://problem/30966764>

        Reviewed by Zalan Bujtas.

        These scripts need to take the complex text codepath.

        Test: fast/text/kaithi.html

        * platform/graphics/FontCascade.cpp:
        (WebCore::FontCascade::characterRangeCodePath):

2017-04-25  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK] Revert r215745 (especulative build fix) after r215752.
        https://bugs.webkit.org/show_bug.cgi?id=170842

        Unreviewed.

        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
        (WebCore::normalizeCharacters):

2017-04-25  Daniel Bates  <dabates@apple.com>

        [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header
        https://bugs.webkit.org/show_bug.cgi?id=136452
        <rdar://problem/23412620>

        Reviewed by Brent Fulgham.

        Enable support for X-Content-Type-Options: nosniff on Mac, iOS and Windows.

        Additionally, honor X-Content-Type-Options: nosniff header for stylesheets as per
        <https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-nosniff%3F> (30 March 2017).

        Test: http/tests/security/contentTypeOptions/nosniff-dynamic-script-blocked.html

        * Configurations/FeatureDefines.xcconfig:
        * css/StyleSheetContents.cpp:
        (WebCore::StyleSheetContents::parseAuthorStyleSheet): Log an error if the stylesheet
        has the nosniff header and does not have a valid MIME type. Also update code for
        renaming of MIMETypeCheck to MIMETypeCheckHint.
        (WebCore::StyleSheetContents::notifyLoadedSheet): If the stylesheet is blocked by
        nosniff then consider it analogous to a load error so that we dispatch a DOM error
        event at the <style>/<link> element.
        * dom/LoadableClassicScript.cpp:
        (WebCore::LoadableClassicScript::notifyFinished): Modified the wording of the error
        message when a script is disallowed by nosniff so as to more closely match the
        wording used when a stylesheet is disallowed by nonsniff.
        * loader/cache/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::sheetText): Update for renaming of MIMETypeCheck
        to MIMETypeCheckHint.
        (WebCore::CachedCSSStyleSheet::responseMIMEType): Added.
        (WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff): Added.
        (WebCore::CachedCSSStyleSheet::canUseSheet): Modified to check if the X-Content-Type-Options: nosniff
        header is in the HTTP response for the stylesheet. If it is then we can only use the stylesheet
        if its content-type is "text/css". Otherwise, apply the existing criterion for determining whether
        to to use the stylesheet.
        * loader/cache/CachedCSSStyleSheet.h: Rename MIMETypeCheck to MIMETypeCheckHint to better
        describe its purpose as a hint as to whether to enforce MIME type checking for the stylesheet.
        Processing of the HTTP header X-Content-Type-Options takes precedence over this hint.
        * loader/cache/CachedScript.h: Make mimeType() private.

2017-04-25  Daniel Bates  <dabates@apple.com>

        [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header
        https://bugs.webkit.org/show_bug.cgi?id=136452
        <rdar://problem/23412620>

        Reviewed by Brent Fulgham.

        Part 1

        Enable X-Content-Type-Options: nosniff on Mac, iOS and Windows platforms.

        * Configurations/FeatureDefines.xcconfig:

2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>

        [GTK] Build fix after r215737
        https://bugs.webkit.org/show_bug.cgi?id=170842

        Unreviewed.

        No new tests because there is no behavior change.

        * platform/graphics/FontCascade.h:
        (WebCore::FontCascade::treatAsZeroWidthSpace):
        (WebCore::FontCascade::treatAsZeroWidthSpaceInComplexScript):

2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        Remove an unnecessary -respondsToSelector: check after r215724

        Rubber-stamped by Tim Horton.

        Addresses review feedback from <https://bugs.webkit.org/show_bug.cgi?id=171156>. -[NSURL _title]
        will always for builds that need to access it.

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

2017-04-25  Antti Koivisto  <antti@apple.com>

        REGRESSION (r215469): [ios-simulator-wk2] LayoutTest compositing/animation/animation-backing.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=171060
        <rdar://problem/31771174>

        Reviewed by Simon Fraser.

        Accelerated transform animations move underlying layers without invalidating GraphicsLayers.
        To update tile coverage we need to commit such subtrees even if there are not other changes.

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

            Commit subtrees with accelerated transform animations.
            Factor into a function.

        (WebCore::GraphicsLayerCA::recursiveCommitChanges):

            Track if descendants had any accelerated transform animations after commit.

        * platform/graphics/ca/GraphicsLayerCA.h:
        (WebCore::GraphicsLayerCA::hasDescendantsWithRunningTransformAnimations):
        (WebCore::GraphicsLayerCA::setHasDescendantsWithRunningTransformAnimations):

2017-04-25  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream macOS] Unable to apply frameRate constraint
        https://bugs.webkit.org/show_bug.cgi?id=171279

        Reviewed by Youenn Fablet.

        No new tests, this doesn't affect the mock capture devices.

        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate): Cast frame rate
        ranges to int before comparing.

2017-04-25  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [GTK] Build fix after r215737
        https://bugs.webkit.org/show_bug.cgi?id=170842

        Unreviewed.

        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
        (WebCore::normalizeCharacters):

2017-04-25  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Clear network process cache when clearing store
        https://bugs.webkit.org/show_bug.cgi?id=171256
        <rdar://problem/31802347>

        Reviewed by Brent Fulgham.

        Test that covers this code:
        http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::clearInMemoryStore):
            Better name.
        (WebCore::ResourceLoadObserver::logUserInteraction):
            Now passes on the boolean parameter clearFirst to
            ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
        (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
            Now takes and passes on the boolean parameter clearFirst to
            ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
        (WebCore::ResourceLoadObserver::statisticsStore): Deleted.
            This getter violated abstraction. The way it was used
            is now solved through dedicated functions.
        * loader/ResourceLoadObserver.h:
        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
            Now passes on the boolean parameter clearFirst to
            ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
        (WebCore::ResourceLoadStatisticsStore::clearInMemory):
            Better name.
            Now triggers clearing of the associated network process cache.
        (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent):
            Now calls clearInMemory().
        (WebCore::ResourceLoadStatisticsStore::setShouldPartitionCookiesCallback):
            Now expects a handler with the boolean parameter clearFirst.
        (WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
            Now takes and passes on the boolean parameter clearFirst to
            m_shouldPartitionCookiesForDomainsHandler().
        * loader/ResourceLoadStatisticsStore.h:
        (WebCore::ResourceLoadStatisticsStore::clear): Deleted.
        * platform/network/NetworkStorageSession.h:
            NetworkStorageSession::setShouldPartitionCookiesForHosts() now
            takes the boolean parameter clearFirst.
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts):
            Now clears m_topPrivatelyControlledDomainsForCookiePartitioning
            if the boolean parameter clearFirst is true.

2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>

        Add performance test for FontCache::systemFallbackForCharacters()
        https://bugs.webkit.org/show_bug.cgi?id=170842

        Reviewed by Tim Horton.

        No new tests because there is no behavior change.

        * platform/graphics/FontCascade.h:
        (WebCore::FontCascade::treatAsZeroWidthSpace):
        (WebCore::FontCascade::treatAsZeroWidthSpaceInComplexScript): Deleted.
        * platform/graphics/WidthCache.h:
        (WebCore::WidthCache::add):
        (WebCore::WidthCache::addSlowCase):

2017-04-25  Chris Dumez  <cdumez@apple.com>

        Content-Disposition header filename is ignored when 'download' attribute is specified in HTML
        https://bugs.webkit.org/show_bug.cgi?id=171239
        <rdar://problem/31789855>

        Reviewed by Alex Christensen.

        Add isAttachmentWithFilename() utility method to ResourceResponse to implement:
        - https://html.spec.whatwg.org/#as-a-download (Step 2)

        Test: http/tests/download/anchor-download-attribute-content-disposition.html

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

2017-04-25  Antti Koivisto  <antti@apple.com>

        Enable expired-only reload policy on Mac and iOS
        https://bugs.webkit.org/show_bug.cgi?id=171264
        <rdar://problem/31807637>

        Reviewed by Andreas Kling.

        * loader/NavigationAction.cpp:
        (WebCore::navigationType):

        Test for reload navigation type correctly.

2017-04-25  Miguel Gomez  <magomez@igalia.com>

        Image decoders must have private constructors to avoid refcount misuse: ASSERTION FAILED: m_deletionHasBegun when destroying ImageDecoder
        https://bugs.webkit.org/show_bug.cgi?id=171211

        Reviewed by Carlos Garcia Campos.

        Add a create method to each of the decoders and set their constructors as private. Change
        ICOImageDecoder to store its internal PNG decoders as RefPtr and use the new create method, and
        change ImageDecoder to use the create methods as well.

        Covered by existent tests.

        * platform/image-decoders/ImageDecoder.cpp:
        (WebCore::ImageDecoder::create):
        * platform/image-decoders/bmp/BMPImageDecoder.h:
        * platform/image-decoders/gif/GIFImageDecoder.h:
        * platform/image-decoders/ico/ICOImageDecoder.cpp:
        (WebCore::ICOImageDecoder::decodeAtIndex):
        * platform/image-decoders/ico/ICOImageDecoder.h:
        * platform/image-decoders/jpeg/JPEGImageDecoder.h:
        * platform/image-decoders/png/PNGImageDecoder.h:
        * platform/image-decoders/webp/WEBPImageDecoder.h:

2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>

        Build fix

        Unreviewed.

        No new tests because there is no behavior change.

        * crypto/mac/SerializedCryptoKeyWrapMac.mm:
        (WebCore::wrapSerializedCryptoKey):
        (WebCore::unwrapSerializedCryptoKey):

2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        Support reading NSURL titles from the pasteboard when performing data interaction
        https://bugs.webkit.org/show_bug.cgi?id=171156
        <rdar://problem/31356937>

        Reviewed by Tim Horton.

        Support reading link titles from the pasteboard when performing data interaction. To do this, we refactor
        Pasteboard::readURL to take in an additional String& title which is ultimately plumbed to the PlatformPasteboard
        where it is set to the value of -[NSURL _title].

        Test: DataInteractionTests.ExternalSourceTitledNSURL.

        * editing/FrameSelection.h:
        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::WebContentReader::readURL):
        * page/DragController.cpp:
        (WebCore::DragController::performDragOperation):
        (WebCore::DragController::concludeEditDrag):

        Move calls to clearDragCaret() out of concludeEditDrag and into the call site, in performDragOperation after
        attempting to concludeEditDrag. This is done so that if the WebEditorClient queries whether the drag caret is
        in richly editable content for the purposes of generating a document fragment to insert, the answer will not
        always be false as a drop is occurring.

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

2017-04-24  Andy VanWagoner  <thetalecrafter@gmail.com>

        Clean up ICU headers
        https://bugs.webkit.org/show_bug.cgi?id=170997

        Reviewed by JF Bastien.

        Update all icu headers to 55.1

        * icu/LICENSE: Update copyright
        * icu/README: Explain ICU headers for OS X better
        * icu/unicode/localpointer.h:
        (LocalPointer::LocalPointer):
        (LocalPointer::adoptInsteadAndCheckErrorCode):
        * icu/unicode/platform.h:
        * icu/unicode/putil.h:
        * icu/unicode/std_string.h:
        * icu/unicode/ubrk.h:
        * icu/unicode/uchar.h:
        * icu/unicode/ucnv.h:
        * icu/unicode/ucol.h:
        * icu/unicode/ucoleitr.h:
        * icu/unicode/uconfig.h:
        * icu/unicode/ucurr.h:
        * icu/unicode/uidna.h:
        * icu/unicode/uloc.h:
        * icu/unicode/umachine.h:
        * icu/unicode/unistr.h:
        (UnicodeString::getArrayStart):
        (UnicodeString::UnicodeString):
        (UnicodeString::hasShortLength):
        (UnicodeString::getShortLength):
        (UnicodeString::length):
        (UnicodeString::getCapacity):
        (UnicodeString::isBogus):
        (UnicodeString::isWritable):
        (UnicodeString::isBufferWritable):
        (UnicodeString::getBuffer):
        (UnicodeString::isEmpty):
        (UnicodeString::setZeroLength):
        (UnicodeString::setShortLength):
        (UnicodeString::setLength):
        (UnicodeString::setToEmpty):
        (UnicodeString::remove):
        * icu/unicode/urename.h:
        * icu/unicode/uscript.h:
        * icu/unicode/usearch.h:
        * icu/unicode/uset.h:
        * icu/unicode/ustring.h:
        * icu/unicode/utf8.h:
        * icu/unicode/utypes.h:
        * icu/unicode/uvernum.h:

2017-04-24  Jiewen Tan  <jiewen_tan@apple.com>

        LayoutTests crypto/subtle/ecdsa-generate-key-sign-verify-p384.html and crypto/subtle/ecdsa-generate-key-sign-verify-p256.html are flaky failures
        https://bugs.webkit.org/show_bug.cgi?id=171059
        <rdar://problem/31734958>

        Reviewed by Brent Fulgham.

        Covered by existing tests.

        * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
        (WebCore::signECDSA):
        Enhance ways to convert the DER signatures produced from CommonCrypto to r||s.

2017-04-24  Manuel Rego Casasnovas  <rego@igalia.com>

        [selectors4] :focus-within should use the flat tree
        https://bugs.webkit.org/show_bug.cgi?id=170899

        Reviewed by Antti Koivisto.

        This has been discussed in the following CSS WG issue:
        https://github.com/w3c/csswg-drafts/issues/1135

        And the spec has been updated (https://drafts.csswg.org/selectors-4/#the-focus-within-pseudo):
        "An element also matches :focus-within if one of its descendants in the flat tree
         (including non-element nodes, such as text nodes) matches the conditions for matching :focus."

        Test: imported/w3c/web-platform-tests/css/selectors4/focus-within-shadow-006.html

        * dom/Element.cpp:
        (WebCore::Element::setFocus): Use "flat tree" ("composed tree" in WebKit)
        to set focus-within flag.

2017-04-24  Wenson Hsieh  <wenson_hsieh@apple.com>

        Respect fidelity order when reading web content from item providers
        https://bugs.webkit.org/show_bug.cgi?id=171155
        <rdar://problem/31356937>

        Reviewed by Tim Horton.

        Currently, when reading web content from pasteboards, we assume the old UIPasteboard/NSPasteboard model wherein
        the destination must determine which of the items is considered to have the highest fidelity for the purposes of
        inserting into an editable area. This destination-side fidelity ranking is determined solely by the NSArray
        returned from Pasteboard::supportedPasteboardTypes, which lists compatible types in order from highest fidelity
        to lowest fidelity. Pasteboard::read effectively iterates over this list of types in order, attempting to read
        highest fidelity types and bailing when it first successfully reads data.

        However, when our pasteboard is backed by UIItemProviders, we should instead read pasteboard types in order of
        fidelity as specified by the source rather than the destination. To accomplish this, we introduce an alternate
        codepath, Pasteboard::readRespectingUTIFidelities, which we take if Pasteboard::respectsUTIFidelities is true
        (currently, this only applies for the purposes of data interaction). This version follows a different flow:
        for each item in the pasteboard, we ask for just the UTIs for that item, in order of fidelity. For each item,
        we then call readPasteboardWebContentDataForType to try and read data for that type, continuing until either
        all UTIs have been attempted, or reading was successful.

        This patch makes two additional adjustments. First, we introduce Pasteboard::getTypesByFidelityForItemAtIndex,
        which is used by Pasteboard::readRespectingUTIFidelities when querying the list of supported UTIs for each
        pasteboard item, sorted by highest to lowest fidelity.

        Secondly, we refactor logic to write to the item provider pasteboard in PlatformPasteboardIOS. Since we are
        now respecting fidelity rankings on the destination, the source must also register UTI types in the right
        fidelity order. While this was mostly achieved using our existing method of writing a list of object
        representations to the pasteboard and then all of the contents of a NSString => NSData dictionary containing
        private UTI data, this approach has two flaws:
        1.  We are unable to register high-priority custom types, followed by representing objects, followed by more
            lower-priority custom types, since we assume that all custom types follow all representing objects.
        2.  Since we're just iterating over a dictionary of NSString => NSData when registering custom UTI
            representations to the item provider, there cannot inherently be any fidelity ordering for custom types.

        To address both of these issues, we introduce two new objects that encapsulate how we register data to the item
        provider pasteboard. WebItemProviderRegistrationInfo represents some data that can be registered to an item
        provider (either an object conforming to UIItemProviderWriting, or an NSString and NSData).
        WebItemProviderRegistrationInfoList represents a list of WebItemProviderRegistrationInfos in order of highest to
        lowest fidelity. In PlatformPasteboardIOS, we transform PasteboardWebContent, PasteboardImage, and PasteboardURL
        into a WebItemProviderRegistrationInfoList, which we then pass along to the WebItemProviderPasteboard. In
        WebItemProviderPasteboard, we traverse the list of WebItemProviderRegistrationInfos in the list and register
        each WebItemProviderRegistrationInfo's representing object or data to the item provider.

        Test: DataInteractionTests.RespectsExternalSourceFidelityRankings.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/Pasteboard.h:
        * platform/PasteboardStrategy.h:
        * platform/PlatformPasteboard.h:
        * platform/ios/AbstractPasteboard.h:
        * platform/ios/AbstractPasteboard.mm: Removed.

        Moves WebItemProviderData, formerly implemented in AbstractPasteboard.mm, into WebItemProviderPasteboard.mm.
        We can delete AbstractPasteboard.mm as a result.

        * platform/ios/PasteboardIOS.mm:
        (WebCore::readPasteboardWebContentDataForType):

        Pull out common logic for reading data given a UTI type from the pasteboard into the PasteboardWebContentReader.
        This is invoked from both the existing Pasteboard::read codepath, as well as the readRespectingUTIFidelities
        codepath.

        (WebCore::Pasteboard::read):

        Refactored to call the new readPasteboardWebContentDataForType helper. Behavior should not have changed, unless
        the pasteboard supports UTI fidelities.

        (WebCore::Pasteboard::respectsUTIFidelities):
        (WebCore::Pasteboard::readRespectingUTIFidelities):

        An alternative to Pasteboard::read that considers source-side fidelity rankings of UTIs.

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::getTypesByFidelityForItemAtIndex):
        (WebCore::PlatformPasteboard::writeObjectRepresentations):

        Refactored to build a WebItemProviderRegistrationInfoList and pass it to the WebItemProviderPasteboard to
        register items and data.

        (WebCore::PlatformPasteboard::write):
        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderRegistrationInfo initWithRepresentingObject:typeIdentifier:data:]):
        (-[WebItemProviderRegistrationInfo representingObject]):
        (-[WebItemProviderRegistrationInfo typeIdentifier]):
        (-[WebItemProviderRegistrationInfo data]):

        Represents a single calls to register data onto the item provider pasteboard. See
        WebItemProviderPasteboard.h header comments for more info.

        (-[WebItemProviderRegistrationInfoList init]):
        (-[WebItemProviderRegistrationInfoList addData:forType:]):
        (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
        (-[WebItemProviderRegistrationInfoList numberOfItems]):
        (-[WebItemProviderRegistrationInfoList itemAtIndex:]):
        (-[WebItemProviderRegistrationInfoList enumerateItems:]):

        Represents a series of calls to register representations onto the item provider pasteboard. See
        WebItemProviderPasteboard.h header comments for more info.

        (-[WebItemProviderPasteboard pasteboardTypesByFidelityForItemAtIndex:]):
        (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]):
        (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]): Deleted.

2017-04-24  Chris Dumez  <cdumez@apple.com>

        Regression(r204605): support for "cp874" charset alias was inadvertently dropped which may cause issues on certain Thai sites
        https://bugs.webkit.org/show_bug.cgi?id=171128
        <rdar://problem/31526844>

        Reviewed by Alexey Proskuryakov.

        When using Thai as default language on MacOS, defaultTextEncodingNameForSystemLanguage()
        was returning "cp874" encoding with was dropped in r204605 for not being part of the
        encoding specification (https://encoding.spec.whatwg.org/#names-and-labels).

        To address the issue, we map "cp874" encoding to the "dos-874" encoding which is
        properly recognized. Without this, this could lead to issue on WebSites that do not
        specify a charset.

        * platform/text/TextEncodingRegistry.cpp:
        (WebCore::defaultTextEncodingNameForSystemLanguage):

2017-04-24  Said Abou-Hallawa  <sabouhallawa@apple.com>

        [CG] Provide a type identifier hint to the CGImageSource so getting the type identifier is more accurate
        https://bugs.webkit.org/show_bug.cgi?id=171042

        Reviewed by Tim Horton.

        The image URL can be used to get the type identifier hint. Without providing
        this hint, the image type identifier is not accurate for image formats.

        Also add a function to the ImageDecoder class to get the typeIdentifier. Add
        all the pluming from the ImageDecoder till the Image class.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::destroyDecodedData):
        (WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded):
        (WebCore::BitmapImage::draw):
        (WebCore::BitmapImage::internalStartAnimation):
        (WebCore::BitmapImage::advanceAnimation):
        (WebCore::BitmapImage::internalAdvanceAnimation):
        (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/Image.cpp:
        (WebCore::Image::sourceURL):
        * platform/graphics/Image.h: Change the sourceURL() to return a URL so CG can create CFURLRef from it.
        (WebCore::Image::uti):
        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex):
        (WebCore::ImageFrameCache::startAsyncDecodingQueue):
        (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
        (WebCore::ImageFrameCache::stopAsyncDecodingQueue):
        (WebCore::ImageFrameCache::clearMetadata):
        (WebCore::ImageFrameCache::sourceURL):
        (WebCore::ImageFrameCache::encodedDataStatus):
        (WebCore::ImageFrameCache::uti):
        (WebCore::ImageFrameCache::filenameExtension):
        * platform/graphics/ImageFrameCache.h:
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::ensureDecoderAvailable):
        * platform/graphics/ImageSource.h:
        (WebCore::ImageSource::uti):
        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::ImageDecoder::ImageDecoder): Pass the type identifier hint to CGImageSourceCreateIncremental().
        (WebCore::ImageDecoder::uti):
        (WebCore::ImageDecoder::filenameExtension):
        (WebCore::ImageDecoder::frameHasAlphaAtIndex):
        (WebCore::ImageDecoder::createFrameImageAtIndex):
        * platform/graphics/cg/ImageDecoderCG.h:
        (WebCore::ImageDecoder::create):
        * platform/graphics/win/ImageDecoderDirect2D.cpp:
        (WebCore::ImageDecoder::encodedDataStatus):
        * platform/graphics/win/ImageDecoderDirect2D.h:
        (WebCore::ImageDecoder::create): Add an argument of type URL.
        * platform/image-decoders/ImageDecoder.cpp:
        (WebCore::ImageDecoder::create): Add an argument of type URL.
        * platform/image-decoders/ImageDecoder.h:
        (WebCore::ImageDecoder::encodedDataStatus): Make it const.
        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
        (WebCore::BMPImageDecoder::encodedDataStatus):
        * platform/image-decoders/bmp/BMPImageDecoder.h:
        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::encodedDataStatus):
        * platform/image-decoders/gif/GIFImageDecoder.h:
        * platform/image-decoders/ico/ICOImageDecoder.cpp:
        (WebCore::ICOImageDecoder::encodedDataStatus):
        * platform/image-decoders/ico/ICOImageDecoder.h:
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageDecoder::encodedDataStatus):
        * platform/image-decoders/jpeg/JPEGImageDecoder.h:
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::encodedDataStatus):
        * platform/image-decoders/png/PNGImageDecoder.h:
        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::encodedDataStatus):
        * platform/image-decoders/webp/WEBPImageDecoder.h:
        * platform/spi/cg/ImageIOSPI.h: Added.

2017-04-24  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed build fix.

        * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
        (WebCore::encryptAES_GCM):
        (WebCore::decyptAES_GCM):

2017-04-24  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Whitelist supported image MIME types
        https://bugs.webkit.org/show_bug.cgi?id=171077

        Reviewed by Tim Horton.

        Restrict the CG port image formats to a known whitelist. Build this list from image
        UTI's instead of MIME types, since the image UTI's is a superset of the MIME types.
        Use this list to build the list of supported image MIME types.

        * PlatformAppleWin.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/MIMETypeRegistry.cpp:
        (WebCore::initializeSupportedImageMIMETypes):
        * platform/graphics/cg/UTIRegistry.cpp: Added.
        (WebCore::allowedImageUTIs):
        (WebCore::isAllowedImageUTI):
        * platform/graphics/cg/UTIRegistry.h: Added.

2017-04-24  Nan Wang  <n_wang@apple.com>

        AX: Crash at WebCore::AXObjectCache::characterOffsetForIndex(int, WebCore::AccessibilityObject const*) + 703
        https://bugs.webkit.org/show_bug.cgi?id=171247

        Reviewed by Chris Fleizach.

        Crashed because we were passing a nil node into rootAXEditableElement(). Fixed it by
        adding a null check.

        Test: accessibility/mac/input-string-for-range-crash.html

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

2017-04-24  Youenn Fablet  <youenn@apple.com>

        Set defaults video getUserMedia constraints
        https://bugs.webkit.org/show_bug.cgi?id=171127

        Reviewed by Eric Carlson.

        Test: fast/mediastream/getUserMedia-default.html

        Adding default optional constraints for video size and frame rate if none is defined.
        Default is 640x480 30fps.

        Doing some refactoring in MeddiaConstraintsImpl and MeddiaConstraintsData to use more move constructors.

        * Modules/mediastream/MediaConstraintsImpl.cpp:
        (WebCore::defaultVideoConstraints):
        (WebCore::MediaConstraintsData::setDefaultVideoConstraints):
        (WebCore::MediaConstraintsImpl::create): Deleted.
        * Modules/mediastream/MediaConstraintsImpl.h:
        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::MediaDevices::getUserMedia):
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
        (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Fixing crash when setting frameRate.

2017-04-24  Chris Dumez  <cdumez@apple.com>

        createElementNS() should now throw only InvalidCharacterError, not NamespaceError
        https://bugs.webkit.org/show_bug.cgi?id=171052

        Reviewed by Sam Weinig.

        Validating a qualified name should only throw InvalidCharacterError, not NamespaceError,
        after:
        - https://github.com/whatwg/dom/issues/319
        - https://github.com/w3c/web-platform-tests/issues/5161
        - https://github.com/whatwg/dom/issues/423

        Latest spec:
        - https://dom.spec.whatwg.org/#validate

        No new tests, updated web-platform-tests.

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

2017-04-24  Chris Dumez  <cdumez@apple.com>

        REGRESSION (214503): Webkit crash under RenderElement::repaintForPausedImageAnimationsIfNeeded() when scrolling giphy pages
        https://bugs.webkit.org/show_bug.cgi?id=171243
        <rdar://problem/31715572>

        Reviewed by Antti Koivisto.

        After r214503, we would frequently crash when scrolling giphy pages because we were failing to call
        RenderView::removeRendererWithPausedImageAnimations(renderer, cachedImage) in some cases. This would
        cause a RenderElement to still be associated to a CachedImage in RenderView but not in practice.
        If the CachedImage then gets destroyed and the user scrolls, we end up calling
        RenderElement::repaintForPausedImageAnimationsIfNeeded() with a bad CachedImage.

        StyleCachedImage was properly calling RenderView::removeRendererWithPausedImageAnimations() before
        unregistering the renderer as a client to the CachedImage. However, RenderImageResource was failing
        to do the same. To make this less error-prone, I added a didRemoveCachedImageClient(CachedImage&)
        function to the CachedImageClient interface. It is overriden in RenderElement only to call
        RenderView::removeRendererWithPausedImageAnimations().

        Test: fast/images/animated-gif-scrolling-crash.html

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::didRemoveClient):
        * loader/cache/CachedImageClient.h:
        (WebCore::CachedImageClient::didRemoveCachedImageClient):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::didRemoveCachedImageClient):
        * rendering/RenderElement.h:
        * rendering/style/StyleCachedImage.cpp:
        (WebCore::StyleCachedImage::removeClient):

2017-04-24  Andy Estes  <aestes@apple.com>

        [macOS] Fix two minor issues with MediaSelectionOption::Type
        https://bugs.webkit.org/show_bug.cgi?id=171235

        Reviewed by Sam Weinig.

        * platform/MediaSelectionOption.h: Gave type a default value, and added explicit
        constructors to make gcc and msvc happy.
        * platform/mac/WebPlaybackControlsManager.mm:
        (toAVTouchBarMediaSelectionOptionType): Added an ASSERT_NOT_REACHED if none of the switch
        cases match.

2017-04-24  Andy Estes  <aestes@apple.com>

        [macOS] Enable media selection button on AVTouchBarScrubber
        https://bugs.webkit.org/show_bug.cgi?id=171149
        <rdar://problem/29875010>

        Reviewed by Beth Dakin.

        * platform/spi/cocoa/AVKitSPI.h:

2017-04-24  Alex Christensen  <achristensen@webkit.org>

        Reduce copies and allocations in SharedBuffer::append
        https://bugs.webkit.org/show_bug.cgi?id=170956

        Reviewed by Andreas Kling.

        SharedBuffer was a mess of different data structures added over the years.
        SharedBuffer::append would allocate large Vector<char>s and call memcpy, and that
        is inefficient and causes crashes when large allocations fail, and the allocations
        and copies aren't even necessary.  There were also const correctness problems in
        ResourceLoader::addDataOrBuffer, and iterating a SharedBuffer was strange because
        sometimes we don't want to add unnecessary copies.

        These problems are solved by making SharedBuffer a Vector of read-only data segments,
        which can be contained in various ways but we don't care because all we want to do is
        read them.  Appending SharedBuffers is now const correct because we just add to a
        Vector<Ref<DataSegment>> and neither SharedBuffer can write to the data.  Sometimes,
        though, we want all the data to be in continuous memory, and if there are multiple
        segments then the data needs to be copied once to a new segment.  We should audit the
        call sites of SharedBuffer::data and see if this is really necessary.

        No change in functional behavior.  Fewer copies of the data are made when buffering
        data in the NetworkProcess.  No extra memory is allocated for bytes we think we might
        need to append in the future.  Data is now only copied into one buffer lazily as needed,
        which could slightly change when small delays from memcpy happen, but it's an overall
        improvement.  We could have a performance hit if we were to call append() then data()
        then append() then data() etc. but that doesn't happen in WebKit because we call append
        repeatedly when buffering the data then call data() once when reading the data.

        * editing/cocoa/EditorCocoa.mm:
        (WebCore::archivedDataForAttributedString):
        (WebCore::Editor::selectionInWebArchiveFormat):
        (WebCore::Editor::dataInRTFDFormat):
        (WebCore::Editor::dataInRTFFormat):
        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::WebContentReader::readURL):
        * editing/mac/EditorMac.mm:
        (WebCore::Editor::imageInWebArchiveFormat):
        * loader/TextTrackLoader.cpp:
        (WebCore::TextTrackLoader::processNewCueData):
        * loader/archive/cf/LegacyWebArchive.cpp:
        (WebCore::LegacyWebArchive::createResource):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::tryReplaceEncodedData):
        * loader/cocoa/DiskCacheMonitorCocoa.mm:
        (WebCore::DiskCacheMonitor::tryGetFileBackedSharedBufferFromCFURLCachedResponse):
        * platform/SharedBuffer.cpp:
        (WebCore::SharedBuffer::SharedBuffer):
        (WebCore::SharedBuffer::create):
        (WebCore::SharedBuffer::combineToOneSegment):
        (WebCore::SharedBuffer::data):
        (WebCore::SharedBuffer::createArrayBuffer):
        (WebCore::SharedBuffer::append):
        (WebCore::SharedBuffer::clear):
        (WebCore::SharedBuffer::copy):
        (WebCore::SharedBuffer::DataSegment::data):
        (WebCore::SharedBuffer::DataSegment::size):
        (WebCore::segmentIndex): Deleted.
        (WebCore::offsetInSegment): Deleted.
        (WebCore::allocateSegment): Deleted.
        (WebCore::freeSegment): Deleted.
        (WebCore::SharedBuffer::~SharedBuffer): Deleted.
        (WebCore::SharedBuffer::size): Deleted.
        (WebCore::SharedBuffer::duplicateDataBufferIfNecessary): Deleted.
        (WebCore::SharedBuffer::appendToDataBuffer): Deleted.
        (WebCore::SharedBuffer::clearDataBuffer): Deleted.
        (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
        (WebCore::SharedBuffer::buffer): Deleted.
        (WebCore::SharedBuffer::getSomeData): Deleted.
        (WebCore::SharedBuffer::maybeTransferMappedFileData): Deleted.
        (WebCore::SharedBuffer::clearPlatformData): Deleted.
        (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
        (WebCore::SharedBuffer::hasPlatformData): Deleted.
        (WebCore::SharedBuffer::platformData): Deleted.
        (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
        * platform/SharedBuffer.h:
        (WebCore::SharedBuffer::create): Deleted.
        (WebCore::SharedBuffer::isEmpty): Deleted.
        * platform/SharedBufferChunkReader.cpp:
        (WebCore::SharedBufferChunkReader::nextChunk):
        (WebCore::SharedBufferChunkReader::peek):
        * platform/SharedBufferChunkReader.h:
        * platform/URLParser.cpp:
        (WebCore::URLParser::URLParser):
        * platform/cf/KeyedEncoderCF.cpp:
        (WebCore::KeyedEncoderCF::finishEncoding):
        * platform/cf/SharedBufferCF.cpp:
        (WebCore::SharedBuffer::SharedBuffer):
        (WebCore::SharedBuffer::createCFData):
        (WebCore::SharedBuffer::create):
        (WebCore::SharedBuffer::hintMemoryNotNeededSoon):
        (WebCore::SharedBuffer::append):
        (WebCore::SharedBuffer::wrapCFData): Deleted.
        (WebCore::SharedBuffer::hasPlatformData): Deleted.
        (WebCore::SharedBuffer::platformData): Deleted.
        (WebCore::SharedBuffer::platformDataSize): Deleted.
        (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
        (WebCore::SharedBuffer::clearPlatformData): Deleted.
        (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.
        (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
        (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
        (WebCore::SharedBuffer::copySomeDataFromDataArray): Deleted.
        (WebCore::SharedBuffer::singleDataArrayBuffer): Deleted.
        (WebCore::SharedBuffer::maybeAppendDataArray): Deleted.
        * platform/cocoa/NetworkExtensionContentFilter.mm:
        (WebCore::NetworkExtensionContentFilter::replacementData):
        * platform/cocoa/ParentalControlsContentFilter.mm:
        (WebCore::ParentalControlsContentFilter::replacementData):
        * platform/cocoa/SharedBufferCocoa.mm:
        (-[WebCoreSharedBufferData initWithSharedBufferDataSegment:]):
        (-[WebCoreSharedBufferData length]):
        (-[WebCoreSharedBufferData bytes]):
        (WebCore::SharedBuffer::create):
        (WebCore::SharedBuffer::createCFData):
        (WebCore::SharedBuffer::createFromReadingFile):
        (WebCore::SharedBuffer::createNSDataArray):
        (-[WebCoreSharedBufferData initWithSharedBufferDataBuffer:]): Deleted.
        (WebCore::SharedBuffer::wrapNSData): Deleted.
        (WebCore::SharedBuffer::existingCFData): Deleted.
        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
        (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
        (WebCore::FontPlatformData::openTypeTable):
        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (ResourceHandleStreamingClient::didReceiveBuffer):
        * platform/graphics/mac/ImageMac.mm:
        (WebCore::Image::loadPlatformResource):
        * platform/image-decoders/ImageDecoder.cpp:
        (WebCore::ImageDecoder::create):
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageReader::decode):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::readBuffer):
        * platform/mac/PasteboardMac.mm:
        (WebCore::writeFileWrapperAsRTFDAttachment):
        (WebCore::Pasteboard::write):
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::PlatformPasteboard::bufferForType):
        * platform/network/BlobResourceHandle.cpp:
        (WebCore::BlobResourceHandle::notifyReceiveData):
        * platform/network/MIMEHeader.cpp:
        * platform/network/MIMEHeader.h:
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
        * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
        (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData):
        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
        (-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]):
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
        * platform/soup/SharedBufferSoup.cpp:
        (WebCore::SharedBuffer::SharedBuffer):
        (WebCore::SharedBuffer::createSoupBuffer):
        (WebCore::SharedBuffer::clearPlatformData): Deleted.
        (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
        (WebCore::SharedBuffer::hasPlatformData): Deleted.
        (WebCore::SharedBuffer::platformData): Deleted.
        (WebCore::SharedBuffer::platformDataSize): Deleted.
        (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
        (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.

2017-04-24  Dan Bernstein  <mitz@apple.com>

        [Cocoa] Some ivars are needlessly @protected
        https://bugs.webkit.org/show_bug.cgi?id=171208

        Reviewed by Anders Carlsson.

        Made ivars @private where possible.

        * platform/mac/WebCoreFullScreenPlaceholderView.h:
        * platform/mac/WebCoreFullScreenWarningView.h:
        * platform/mac/WebPlaybackControlsManager.h:
        * platform/network/cocoa/WebCoreNSURLSession.h:

2017-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Switch to use ENABLE_REMOTE_INSPECTOR instead of ENABLE_INSPECTOR_SERVER for the remote inspector
        https://bugs.webkit.org/show_bug.cgi?id=166680

        Reviewed by Michael Catanzaro.

        Add PageDebuggable.cpp to the compilation.

        * CMakeLists.txt:

2017-04-23  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r215657 and r215676.
        https://bugs.webkit.org/show_bug.cgi?id=171201

        Broke the build (Requested by ap on #webkit).

        Reverted changesets:

        "[macOS] Enable media selection button on AVTouchBarScrubber"
        https://bugs.webkit.org/show_bug.cgi?id=171149
        http://trac.webkit.org/changeset/215657

        "Build fix after r215657."
        http://trac.webkit.org/changeset/215676

2017-04-23  Andy Estes  <aestes@apple.com>

        [macOS] AVTouchBarMediaSelectionOptions should be created with the correct type
        https://bugs.webkit.org/show_bug.cgi?id=171192
        <rdar://problem/29875010>

        Reviewed by Wenson Hsieh.

        AVTouchBarMediaSelectionOption was always being created with type
        AVTouchBarMediaSelectionOptionTypeRegular, but we know if a TextTrack is really the legible
        off or legible auto track. This change plumbs that information into
        WebPlaybackControlsManager so that AVTouchBarMediaSelectionOptions can be created with the
        right AVTouchBarMediaSelectionOptionType. 

        * WebCore.xcodeproj/project.pbxproj:
        * page/CaptionUserPreferences.cpp:
        (WebCore::CaptionUserPreferences::mediaSelectionOptionForTrack):
        * page/CaptionUserPreferences.h:
        * platform/MediaSelectionOption.h: Added.
        * platform/cocoa/WebPlaybackSessionModel.h:
        (WebCore::WebPlaybackSessionModelClient::audioMediaSelectionOptionsChanged):
        (WebCore::WebPlaybackSessionModelClient::legibleMediaSelectionOptionsChanged):
        * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
        (WebCore::WebPlaybackSessionModelMediaElement::audioMediaSelectionOptions):
        (WebCore::WebPlaybackSessionModelMediaElement::legibleMediaSelectionOptions):
        * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
        * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
        (WebCore::mediaSelectionOptions):
        (WebCore::WebPlaybackSessionInterfaceAVKit::audioMediaSelectionOptionsChanged):
        (WebCore::WebPlaybackSessionInterfaceAVKit::legibleMediaSelectionOptionsChanged):
        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        (WebVideoFullscreenControllerContext::audioMediaSelectionOptionsChanged):
        (WebVideoFullscreenControllerContext::legibleMediaSelectionOptionsChanged):
        (WebVideoFullscreenControllerContext::audioMediaSelectionOptions):
        (WebVideoFullscreenControllerContext::legibleMediaSelectionOptions):
        * platform/mac/WebPlaybackControlsManager.h:
        * platform/mac/WebPlaybackControlsManager.mm:
        (toAVTouchBarMediaSelectionOptionType):
        (mediaSelectionOptions):
        (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
        (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
        (-[WebPlaybackControlsManager webPlaybackSessionInterfaceMac]):
        (-[WebPlaybackControlsManager setWebPlaybackSessionInterfaceMac:]):
        * platform/mac/WebPlaybackSessionInterfaceMac.h:
        * platform/mac/WebPlaybackSessionInterfaceMac.mm:
        (WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
        (WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):

2017-04-22  Wenson Hsieh  <wenson_hsieh@apple.com>

        File inputs only accept UTI types that can be inserted into contenteditable areas when dropping
        https://bugs.webkit.org/show_bug.cgi?id=171177
        <rdar://problem/31765379>

        Reviewed by Andy Estes.

        Currently, DragController::canProcessDrag bails immediately with `false` if the drag data does not contain
        compatible content. However, if we are dragging over a file input, we want the presence of files in the drag
        data to take priority. To fix this, we teach DragData::containsCompatibleContent to take the purpose of the drag
        into account (by default, this is Editing, but when dragging over a file input, this becomes FileUpload). We
        then consider DragData to have compatible content for the purpose of file uploading if it contains any files.

        Test: DataInteractionTests.ExternalSourceJSONToFileInput.

        * page/DragController.cpp:
        (WebCore::DragController::canProcessDrag):
        * platform/DragData.h:
        * platform/gtk/DragDataGtk.cpp:
        (WebCore::DragData::containsCompatibleContent):
        * platform/mac/DragDataMac.mm:
        (WebCore::DragData::containsCompatibleContent):
        * platform/win/DragDataWin.cpp:
        (WebCore::DragData::containsCompatibleContent):

2017-04-22  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Fix regression caused by r215626
        https://bugs.webkit.org/show_bug.cgi?id=171168
        <rdar://problem/31774787>

        Reviewed by Antoine Quint.

        No new tests, fixes fast/mediastream/MediaStream-page-muted.html

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::mediaState): Test muted before m_isProducingData because if both are 
        true we want to report that the stream is muted.

2017-04-21  Zalan Bujtas  <zalan@apple.com>

        Do not measure large chunk of text repeatedly during mid-word breaking.
        https://bugs.webkit.org/show_bug.cgi?id=171065
        <rdar://problem/31630245>

        Reviewed by Antti Koivisto.

        This patch reduces redundant text measuring for mid-word breaking by
        1. Adjusting the range for the binary search when the text fragment is longer than the available width
        2. Preserving the width value for the left side of the split fragment (computed during the binary search) so
        that when the fragment is being split we don't need to re-measure it
        3. Checking if the right side fits the next line and only adjust the width (by re-measuring the text) for
        kerning/ligature if it does (if it does not fit, we'll end up re-measuring some part of it
        during the next split)

        Performance test has already been added.

        * rendering/SimpleLineLayout.cpp:
        (WebCore::SimpleLineLayout::hyphenPositionForFragment):
        (WebCore::SimpleLineLayout::split): binary search with adjusting the range and preserving the width for the left side.
        (WebCore::SimpleLineLayout::splitFragmentToFitLine):
        (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
        (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
        (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
        (WebCore::SimpleLineLayout::FragmentForwardIterator::operator==): Deleted.
        (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
        (WebCore::SimpleLineLayout::begin): Deleted.
        (WebCore::SimpleLineLayout::end): Deleted.
        * rendering/SimpleLineLayoutTextFragmentIterator.h:
        (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split):
        (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen):

2017-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>

        Support writing link titles to the pasteboard when beginning data interaction on a link
        https://bugs.webkit.org/show_bug.cgi?id=171154
        <rdar://problem/31356937>

        Reviewed by Andy Estes.

        Currently, when writing NSURLs to the pasteboard, we only write a String to the pasteboard corresponding to
        kUTTypeURL. This means richer data associated with the link (in this case, the title) are not captured when
        writing to the pasteboard. To address this, we introduce a new codepath for writing links to the pasteboard that
        mirrors the way PasteboardImage and PasteboardWebContent are written to the pasteboard.

        Test: Augmented DataInteractionTests.LinkToInput.

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

        Add plumbing support for writing PasteboardURLs.

        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::write):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::writeObjectRepresentations):

        Teach PlatformPasteboard to also set the _title attribute of the NSURL when creating an NSURL representation
        for registering with the shared WebItemProviderPasteboard.

        (WebCore::PlatformPasteboard::write):
        * platform/ios/WebItemProviderPasteboard.mm:

        Remove deprecation guards and replace deprecated method calls with the latest undeprecated versions.

        (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):

2017-04-21  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, rolling out r215608.

        Hundreds of test failures on GTK bot

        Reverted changeset:

        "Reduce copies and allocations in SharedBuffer::append"
        https://bugs.webkit.org/show_bug.cgi?id=170956
        http://trac.webkit.org/changeset/215608

2017-04-21  Zalan Bujtas  <zalan@apple.com>

        REGRESSION(r205374): <li> content inside <ul> should mid-word wrap when word-break: break-word is present.
        https://bugs.webkit.org/show_bug.cgi?id=171108
        <rdar://problem/30271747>

        Reviewed by Dan Bernstein.

        This patch ensures that we search for mid-word breaks when a zero sized element has been committed on the line
        unless it's an image or some other replaced element with special properties (e.g. list-style: inside).  

        Tests: fast/replaced/ul-li-word-break-break-word.html
               fast/replaced/zero-width-image-force-linebreak.html

        * rendering/line/BreakingContext.h:
        (WebCore::BreakingContext::handleReplaced):
        (WebCore::BreakingContext::handleText): This matches pre-r205374 behaviour, but it's explicit about whether a 
        replaced width has already been committed on the current line.
        * rendering/line/LineWidth.cpp:
        (WebCore::LineWidth::commit):
        * rendering/line/LineWidth.h:
        (WebCore::LineWidth::hasCommittedReplaced):
        (WebCore::LineWidth::addUncommittedReplacedWidth): These 2 last functions were removed with r205374 (and now I am adding them back). 

2017-04-21  Jer Noble  <jer.noble@apple.com>

        [MediaCapture] Improvements to CoreAudioCaptureSource
        https://bugs.webkit.org/show_bug.cgi?id=171146

        Reviewed by Eric Carlson.

        Various interlocking improvements to CoreAudioCaptureSource:

        - Allow the volume, sampleRate, and echoCancellation settings to be applied to the source.
        - Update the values returned via settings() when these values change.
        - Obey the sampleRate and echoCancellation settings when creating the VPIO unit.
        - Because AudioUnitRender() mutates the passed in AudioBufferList, reset it immediately before calling.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::create):
        (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
        (WebCore::CoreAudioCaptureSource::preferredSampleRate):
        (WebCore::CoreAudioCaptureSource::preferredIOBufferSize):
        (WebCore::CoreAudioCaptureSource::configureMicrophoneProc):
        (WebCore::CoreAudioCaptureSource::configureSpeakerProc):
        (WebCore::CoreAudioCaptureSource::processMicrophoneSamples):
        (WebCore::CoreAudioCaptureSource::setupAudioUnits):
        (WebCore::CoreAudioCaptureSource::stopProducingData):
        (WebCore::CoreAudioCaptureSource::settings):
        (WebCore::CoreAudioCaptureSource::settingsDidChange):
        (WebCore::CoreAudioCaptureSource::preferredIOBufferDuration): Deleted.
        * platform/mediastream/mac/CoreAudioCaptureSource.h:

2017-04-21  Youenn Fablet  <youenn@apple.com>

        com.apple.WebCore: non-virtual thunk to WebCore::LibWebRTCDataChannelHandler::OnBufferedAmountChange + 39
        https://bugs.webkit.org/show_bug.cgi?id=171087
        <rdar://problem/31739051>

        Reviewed by Eric Carlson.

        Covered by existing tests.
        No test added as this behavior is really libwebrtc specific and cannot be triggered easily.

        * Modules/mediastream/RTCDataChannel.cpp:
        (WebCore::RTCDataChannel::close): Stopping observing libwebrtc data channel before closing it.
        This ensures we will stop getting notified as soon as there is no more interest.
        * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
        (WebCore::LibWebRTCDataChannelHandler::OnStateChange): libwebrtc can still notify us even though we said we were
        not interested. Ensuring we do not call the client if we are no longer interested.
        (WebCore::LibWebRTCDataChannelHandler::OnMessage): Ditto.
        (WebCore::LibWebRTCDataChannelHandler::OnBufferedAmountChange): Ditto.

2017-04-21  Andy Estes  <aestes@apple.com>

        [macOS] Enable media selection button on AVTouchBarScrubber
        https://bugs.webkit.org/show_bug.cgi?id=171149
        <rdar://problem/29875010>

        Reviewed by Beth Dakin.

        * platform/spi/cocoa/AVKitSPI.h:

2017-04-21  Andy Estes  <aestes@apple.com>

        [macOS] Name WebPlaybackControlsManager delegate methods correctly depending on OS version
        https://bugs.webkit.org/show_bug.cgi?id=171147
        <rdar://problem/29875010>

        Reviewed by Beth Dakin.

        On macOS 10.12, WebPlaybackControlsManager conforms to
        AVFunctionBarPlaybackControlsControlling, but on 10.13 it conforms to
        AVTouchBarPlaybackControlsControlling. These protocols are near-identical, except for
        instances of "FunctionBar" in method names are renamed to "TouchBar". This patch updates to
        the new method names, and generally renames things with "FunctionBar" to "TouchBar".

        * platform/mac/WebPlaybackControlsManager.h:
        * platform/mac/WebPlaybackControlsManager.mm:
        (-[WebPlaybackControlsManager generateTouchBarThumbnailsForTimes:tolerance:size:thumbnailHandler:]):
        (-[WebPlaybackControlsManager generateTouchBarAudioAmplitudeSamples:completionHandler:]):
        (-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):
        (-[WebPlaybackControlsManager beginTouchBarScrubbing]):
        (-[WebPlaybackControlsManager endTouchBarScrubbing]):
        (-[WebPlaybackControlsManager generateFunctionBarThumbnailsForTimes:size:completionHandler:]):
        (-[WebPlaybackControlsManager generateFunctionBarAudioAmplitudeSamples:completionHandler:]):
        (-[WebPlaybackControlsManager canBeginFunctionBarScrubbing]):
        (-[WebPlaybackControlsManager beginFunctionBarScrubbing]):
        (-[WebPlaybackControlsManager endFunctionBarScrubbing]):
        (-[WebPlaybackControlsManager audioTouchBarMediaSelectionOptions]):
        (-[WebPlaybackControlsManager setAudioTouchBarMediaSelectionOptions:]):
        (-[WebPlaybackControlsManager currentAudioTouchBarMediaSelectionOption]):
        (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
        (-[WebPlaybackControlsManager legibleTouchBarMediaSelectionOptions]):
        (-[WebPlaybackControlsManager setLegibleTouchBarMediaSelectionOptions:]):
        (-[WebPlaybackControlsManager currentLegibleTouchBarMediaSelectionOption]):
        (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
        (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
        (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
        (-[WebPlaybackControlsManager audioFunctionBarMediaSelectionOptions]): Deleted.
        (-[WebPlaybackControlsManager setAudioFunctionBarMediaSelectionOptions:]): Deleted.
        (-[WebPlaybackControlsManager currentAudioFunctionBarMediaSelectionOption]): Deleted.
        (-[WebPlaybackControlsManager setCurrentAudioFunctionBarMediaSelectionOption:]): Deleted.
        (-[WebPlaybackControlsManager legibleFunctionBarMediaSelectionOptions]): Deleted.
        (-[WebPlaybackControlsManager setLegibleFunctionBarMediaSelectionOptions:]): Deleted.
        (-[WebPlaybackControlsManager currentLegibleFunctionBarMediaSelectionOption]): Deleted.
        (-[WebPlaybackControlsManager setCurrentLegibleFunctionBarMediaSelectionOption:]): Deleted.

2017-04-21  Jer Noble  <jer.noble@apple.com>

        Make CoreAudioCaptureDevice stackable.
        https://bugs.webkit.org/show_bug.cgi?id=171097

        Reviewed by Eric Carlson.

        There's no real reason to keep CoreAudioCaptureDevice from being created on the stack. 
        Make it un-RefCounted, and have it's static factory method return an std::optional rather
        than a RefPtr.

        Drive-by fix: clean up the factory method of CoreAudioCaptureSource a bit.

        * platform/mediastream/mac/CoreAudioCaptureDevice.cpp:
        (WebCore::CoreAudioCaptureDevice::create):
        (WebCore::CoreAudioCaptureDevice::deviceID): Deleted.
        * platform/mediastream/mac/CoreAudioCaptureDevice.h:
        (WebCore::CoreAudioCaptureDevice::deviceID):
        * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
        (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
        (WebCore::CoreAudioCaptureDeviceManager::coreAudioDeviceWithUID):
        (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
        * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::create):
        (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
        * platform/mediastream/mac/CoreAudioCaptureSource.h:

2017-04-21  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream iOS] Release capture session when not producing data
        https://bugs.webkit.org/show_bug.cgi?id=171148
        <rdar://problem/29265868>

        Reviewed by Jer Noble.

        On iOS, only one AVCaptureSession can be active at a time, so release a session whenever
        it is told to stop producing data. The session will recreated if the capture source if/when
        told to produce data again.

        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        (WebCore::AVMediaCaptureSource::stopProducingData): Clear m_session to release the session.
        It will be re-allocated if startProducingData is called later.

2017-04-21  Aaron Chu  <aaron_chu@apple.com>

        AX: FKA: Buttons need a visible focus indicator
        https://bugs.webkit.org/show_bug.cgi?id=171040
        <rdar://problem/30922548>

        Reviewed by Antoine Quint.

        Added a background color for the focus state of the icon buttons in modern media controls.

        Test: media/modern-media-controls/icon-button/icon-button-focus-state.html

        * Modules/modern-media-controls/controls/icon-button.css:
        (button.icon:focus):

2017-03-22  Matt Rajca  <mrajca@apple.com>

        Consider muting audio hardware a form of autoplay interference.
        https://bugs.webkit.org/show_bug.cgi?id=169971

        Reviewed by Eric Carlson.

        If the user mutes audio hardware and a media element is auto-playing, consider that
        as a form of auto-play interference that we tell clients about.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::HTMLMediaElement):
        (WebCore::HTMLMediaElement::~HTMLMediaElement):
        (WebCore::HTMLMediaElement::hardwareMutedStateDidChange):
        * html/HTMLMediaElement.h:
        * platform/audio/AudioSession.h:
        (WebCore::AudioSession::MutedStateObserver::~MutedStateObserver):
        * platform/audio/mac/AudioSessionMac.cpp:
        (WebCore::AudioSession::isMuted):
        (WebCore::muteProcess):
        (WebCore::AudioSession::handleMutedStateChange):
        (WebCore::AudioSession::addMutedStateObserver):
        (WebCore::AudioSession::removeMutedStateObserver):

2017-04-21  Chris Dumez  <cdumez@apple.com>

        Regression(r206240): XMLSerializer.serializeToString() does not properly escape '<' / '>' in attribute values
        https://bugs.webkit.org/show_bug.cgi?id=171132
        <rdar://problem/31426752>

        Reviewed by Ryosuke Niwa.

        Use XMLSerialization [1] in MarkupAccumulator::appendAttribute() when inXMLFragmentSerialization()
        returns true, even if the node's associated document is an HTML document. When XMLSerializer.serializeToString()
        is called on a Node, we want XML serialization, even if the node comes from an HTML document.

        [1] https://w3c.github.io/DOM-Parsing/#dfn-xml-serialization

        Test: fast/dom/XMLSerializer-serializeToString-entities.html

        * editing/MarkupAccumulator.cpp:
        (WebCore::MarkupAccumulator::appendAttributeValue):
        (WebCore::MarkupAccumulator::appendAttribute):
        * editing/MarkupAccumulator.h:

2017-04-20  Sam Weinig  <sam@webkit.org>

        Split cryptographic digest computation and parsing out of CSP code so it can be reused
        https://bugs.webkit.org/show_bug.cgi?id=171076

        Reviewed by Chris Dumez.

        Factor out cryptographic digest parsing from Content Security Policy code
        so that it can be reused for the Subresource Integrity implementation.

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        Add new files.

        * html/parser/ParsingUtilities.h:
        (WebCore::skipExactlyIgnoringASCIICase):
        Add parsing helper to match / skip over a constant string, using IgnoringASCIICase semantics.

        * loader/ResourceCryptographicDigest.cpp: Added.
        (WebCore::parseHashAlgorithmAdvancingPosition):
        (WebCore::parseCryptographicDigestImpl):
        (WebCore::parseCryptographicDigest):
        Move parsing of cryptographic-digest strings from ContentSecurityPolicySourceList.cpp
        and optimize it a little by avoiding String allocations and generalizing it so that it
        can parse either UChars or LChars.

        * loader/ResourceCryptographicDigest.h: Added.
        (WebCore::ResourceCryptographicDigest::operator==):
        (WebCore::ResourceCryptographicDigest::operator!=):
        (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::Hash::hash):
        (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::Hash::equal):
        (WTF::HashTraits<WebCore::ResourceCryptographicDigest>::emptyValue):
        (WTF::HashTraits<WebCore::ResourceCryptographicDigest>::constructDeletedValue):
        (WTF::HashTraits<WebCore::ResourceCryptographicDigest>::isDeletedValue):
        Add a struct (rather than using a std::pair) to represent the digest + algorithm. And add
        HashTraits so it can be used as HashMap.
        
        * page/csp/ContentSecurityPolicy.cpp:
        (WebCore::ContentSecurityPolicy::findHashOfContentInPolicies):
        (WebCore::toCryptoDigestAlgorithm): Deleted.
        Move algorithm conversion to ResourceCryptographicDigest.cpp. Make use of new 
        cryptographicDigestForBytes function to do hashing.

        * page/csp/ContentSecurityPolicy.h:
        * page/csp/ContentSecurityPolicyHash.h:
        (WTF::DefaultHash<WebCore::ContentSecurityPolicyDigest>::Hash::hash): Deleted.
        (WTF::DefaultHash<WebCore::ContentSecurityPolicyDigest>::Hash::equal): Deleted.
        Remove HashTraits for the digest, this is now handled by ResourceCryptographicDigest. 
        To keep things relatively straight-forward, redefine ContentSecurityPolicyHashAlgorithm
        and ContentSecurityPolicyHash in terms of ResourceCryptographicDigest, so that less code
        has to be changed all at once. In a later pass, if wanted, we can remove these using 
        declarations.

        * page/csp/ContentSecurityPolicySourceList.cpp:
        (WebCore::isNonceCharacter):
        Use renamed isBase64OrBase64URLCharacter predicate.

        (WebCore::ContentSecurityPolicySourceList::parseHashSource):
        Rework using ResourceCryptographicDigest parsing. Quotation and maximum digest
        length have been kept here, as they are not applicable to other uses of 
        the digest, specifically Subresource Integrity.

2017-04-21  Jer Noble  <jer.noble@apple.com>

        Unreviewed fix after r215624; null-deref crash.

        Make sure to call reset() inside each constructor.

        * platform/audio/WebAudioBufferList.cpp:
        (WebCore::WebAudioBufferList::WebAudioBufferList):

2017-04-21  Anders Carlsson  <andersca@apple.com>

        Stop using deprecated APIs, part 5
        https://bugs.webkit.org/show_bug.cgi?id=171134
        rdar://problem/31589635

        Reviewed by Tim Horton.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::convertAndValidate):
        Stop using the toPaymentAuthorizationStatus. Convert the passed in status results to the remaining
        PaymentAuthorizationStatus values, and add errors if needed.

        (WebCore::toPaymentAuthorizationStatus):
        This function is no longer used.

        * Modules/applepay/PaymentAuthorizationStatus.h:
        Remove deprecated status values. We can achieve the same results with errors now.

        * Modules/applepay/PaymentRequest.cpp:
        (WebCore::isFinalStateResult):
        Remove deprecated status values.

        * Modules/applepay/PaymentRequest.h:
        Remove deprecated status values.

2017-04-21  Per Arne Vollan  <pvollan@apple.com>

        Validate vImage arguments
        https://bugs.webkit.org/show_bug.cgi?id=171109
        rdar://problem/30236606

        Reviewed by Brent Fulgham.

        When writing data to a canvas context, clip the source rectangle to the data rectangle
        to make sure we will not attempt to read data outside of the buffer.

        Test: fast/canvas/canvas-crash.html

        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::putImageData):

2017-04-21  David Kilzer  <ddkilzer@apple.com>

        Switch from -std=gnu++11 to -std=gnu++14 for consistency in DerivedSources.make
        <https://webkit.org/b/171122>

        Reviewed by Brent Fulgham.

        * DerivedSources.make: Switch to -std=gnu++14 for preprocessing
        headers to check for build settings.

2017-04-21  Jer Noble  <jer.noble@apple.com>

        [MediaCapture][iOS] AVAudioSession must be active and the correct category before IO AudioUnits start producing data.
        https://bugs.webkit.org/show_bug.cgi?id=171095

        Reviewed by Youenn Fablet.

        If an input audio unit is asked to start before the AVAudioSession is in a recording category and active,
        CoreAudio will return an error stating that no input device is available.

        The PlatformMediaSessionManager will automatically set the category of and activate the AVAudioSession when one
        of its associated MediaStreams has a capturing RealtimeMediaSource and is currently producing data.  To solve
        the chicken-or-egg problem of activating the AVAudioSession before the source produces data, move the state bit
        of "producing data" directly into MediaStreams, and notify the PlatformMediaSessionManager that capturing is
        occurring after flipping that bit, but before asking the constituent tracks to begin producing data.

        In places (i.e. UserMediaRequest) where we previously told a stream's tracks to begin producing data, instead
        allow the stream to handle that by telling it to produce data directly.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::startProducingData):
        (WebCore::MediaStream::stopProducingData):
        (WebCore::MediaStream::mediaState):
        (WebCore::MediaStream::mediaType):
        (WebCore::MediaStream::characteristics):
        (WebCore::MediaStream::canProduceAudio):
        * Modules/mediastream/MediaStream.h:
        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::allow):
        * platform/mediastream/mac/CoreAudioCaptureSource.h:

2017-04-21  Jer Noble  <jer.noble@apple.com>

        Add a method to retrieve the current I/O buffer size from AudioSession
        https://bugs.webkit.org/show_bug.cgi?id=171126

        Reviewed by Eric Carlson.

        There is an existing method to get and set the preferred I/O buffer size; add a matching method to return
        the acutal I/O buffer size.

        * platform/audio/AudioSession.cpp:
        (WebCore::AudioSession::bufferSize):
        * platform/audio/AudioSession.h:
        * platform/audio/ios/AudioSessionIOS.mm:
        (WebCore::AudioSession::bufferSize):
        * platform/audio/mac/AudioSessionMac.cpp:
        (WebCore::AudioSession::bufferSize):

2017-04-21  Jer Noble  <jer.noble@apple.com>

        Make AudioSampleBufferList::reset() less expensive.
        https://bugs.webkit.org/show_bug.cgi?id=171124

        Reviewed by Eric Carlson.

        Previously, AudioSampleBufferList would reallocate its constituent WebAudioBufferList every time reset() was
        called. Instead, add a reset() method to WebAudioBufferList which re-initializes its AudioBufferList (which is a
        simple memcpy of a 24-byte struct), reusing the existing memory buffers.

        While making these changes, we'll also take the opportunity to clean up the AudioSampleBufferList class by
        making some of its members into UniqueRefs instead of unique_ptrs, thus removing the possibility of null-
        dereferences.

        * platform/audio/WebAudioBufferList.cpp:
        (WebCore::WebAudioBufferList::WebAudioBufferList):
        (WebCore::WebAudioBufferList::reset):
        * platform/audio/WebAudioBufferList.h:
        * platform/audio/mac/AudioSampleBufferList.cpp:
        (WebCore::AudioSampleBufferList::AudioSampleBufferList):
        (WebCore::AudioSampleBufferList::applyGain):
        (WebCore::AudioSampleBufferList::mixFrom):
        (WebCore::AudioSampleBufferList::reset):
        (WebCore::AudioSampleBufferList::zero):
        (WebCore::AudioSampleBufferList::~AudioSampleBufferList): Deleted.
        * platform/audio/mac/AudioSampleBufferList.h:
        (WebCore::AudioSampleBufferList::bufferList):

2017-04-21  Jer Noble  <jer.noble@apple.com>

        Fix some spurious ASSERTs when working with capturing media elements
        https://bugs.webkit.org/show_bug.cgi?id=171096

        Reviewed by Youenn Fablet.

        Two related ASSERTS:

        1) When we added a new PlatformMediaSession MediaType (MediaStreamCapturingAudio), we did not update all the
        places that validated the enum. This would lead to spurious ASSERTs when an element capturing audio would
        fail various checks to enusre it's type's validity.

        2) Audio elements will ASSERT when they change page visibility, as they do not have a renderer which implements
        visibleInViewportStateChanged(). So opt out of visibility-state checking for non-video media elements.

        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForAutoplay):
        * platform/audio/PlatformMediaSessionManager.cpp:
        (WebCore::PlatformMediaSessionManager::resetRestrictions):
        (WebCore::PlatformMediaSessionManager::addRestriction):
        (WebCore::PlatformMediaSessionManager::removeRestriction):
        (WebCore::PlatformMediaSessionManager::restrictions):
        * platform/audio/PlatformMediaSessionManager.h:

2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>

        [cmake] WTF target should not have wtf and subdirectries in public interface
        https://bugs.webkit.org/show_bug.cgi?id=171115

        Reviewed by Michael Catanzaro.

        In r209665 WEBCORE_FRAMEWORK macro started to export INCLUDE_DIRECTORIES of
        targets as their public interface, so that linked targets can use them
        implicitly without copying directory lists around. This matches existing
        practice for all targets except WTF, headers from which are always included
        with full path starting from "<wtf/...".

        Since r209665 it became possible to include headers from wtf or its
        subdirectories in CMake builds without using "<wtf/..." path. It should
        not be allowed.

        * platform/graphics/texmap/coordinated/TiledBackingStore.cpp: Fix
        incorrect include of WTF header.

2017-04-21  Gwang Yoon Hwang  <yoon@igalia.com>

        Do not paint the border of the box if the dirty region does not intersect with border area
        https://bugs.webkit.org/show_bug.cgi?id=170988

        Reviewed by Simon Fraser.

        No new tests, since there is no change in behavior.

        * platform/graphics/GeometryUtilities.cpp:
        (WebCore::ellipseContainsPoint):
        Checks if a point is within an ellipse.

        * platform/graphics/GeometryUtilities.h:
        Replace header-guards with #pragma once.

        * platform/graphics/RoundedRect.cpp:
        (WebCore::RoundedRect::contains):
        Implemented to know the dirty rectangle intersects with rounded rectangle or not.
        * platform/graphics/RoundedRect.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::paintBorder):
        When typing in decorated text box, the dirty rect generated only for the
        inside of the text box, not for the decorations.  So we can avoid the
        calculations to draw borders if the inner border totally covers the
        target surface. It will optimize the rendering process since we don't
        have to render border decorations whenever we type somethings in side of
        the text input element.

2017-04-21  Anders Carlsson  <andersca@apple.com>

        Remove another use of toPaymentAuthorizationStatus
        https://bugs.webkit.org/show_bug.cgi?id=171114

        Reviewed by Dan Bernstein.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::ApplePaySession::completeShippingContactSelection):

2017-04-21  Alex Christensen  <achristensen@webkit.org>

        Reduce copies and allocations in SharedBuffer::append
        https://bugs.webkit.org/show_bug.cgi?id=170956

        Reviewed by Andreas Kling.

        SharedBuffer was a mess of different data structures added over the years.
        SharedBuffer::append would allocate large Vector<char>s and call memcpy, and that
        is inefficient and causes crashes when large allocations fail, and the allocations
        and copies aren't even necessary.  There were also const correctness problems in
        ResourceLoader::addDataOrBuffer, and iterating a SharedBuffer was strange because
        sometimes we don't want to add unnecessary copies.

        These problems are solved by making SharedBuffer a Vector of read-only data segments,
        which can be contained in various ways but we don't care because all we want to do is
        read them.  Appending SharedBuffers is now const correct because we just add to a
        Vector<Ref<DataSegment>> and neither SharedBuffer can write to the data.  Sometimes,
        though, we want all the data to be in continuous memory, and if there are multiple
        segments then the data needs to be copied once to a new segment.  We should audit the
        call sites of SharedBuffer::data and see if this is really necessary.

        No change in functional behavior.  Fewer copies of the data are made when buffering
        data in the NetworkProcess.  No extra memory is allocated for bytes we think we might
        need to append in the future.  Data is now only copied into one buffer lazily as needed,
        which could slightly change when small delays from memcpy happen, but it's an overall
        improvement.  We could have a performance hit if we were to call append() then data()
        then append() then data() etc. but that doesn't happen in WebKit because we call append
        repeatedly when buffering the data then call data() once when reading the data.

        * editing/cocoa/EditorCocoa.mm:
        (WebCore::archivedDataForAttributedString):
        (WebCore::Editor::selectionInWebArchiveFormat):
        (WebCore::Editor::dataInRTFDFormat):
        (WebCore::Editor::dataInRTFFormat):
        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::WebContentReader::readURL):
        * editing/mac/EditorMac.mm:
        (WebCore::Editor::imageInWebArchiveFormat):
        * loader/TextTrackLoader.cpp:
        (WebCore::TextTrackLoader::processNewCueData):
        * loader/archive/cf/LegacyWebArchive.cpp:
        (WebCore::LegacyWebArchive::createResource):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::tryReplaceEncodedData):
        * loader/cocoa/DiskCacheMonitorCocoa.mm:
        (WebCore::DiskCacheMonitor::tryGetFileBackedSharedBufferFromCFURLCachedResponse):
        * platform/SharedBuffer.cpp:
        (WebCore::SharedBuffer::SharedBuffer):
        (WebCore::SharedBuffer::create):
        (WebCore::SharedBuffer::combineToOneSegment):
        (WebCore::SharedBuffer::data):
        (WebCore::SharedBuffer::createArrayBuffer):
        (WebCore::SharedBuffer::append):
        (WebCore::SharedBuffer::clear):
        (WebCore::SharedBuffer::copy):
        (WebCore::SharedBuffer::DataSegment::data):
        (WebCore::SharedBuffer::DataSegment::size):
        (WebCore::segmentIndex): Deleted.
        (WebCore::offsetInSegment): Deleted.
        (WebCore::allocateSegment): Deleted.
        (WebCore::freeSegment): Deleted.
        (WebCore::SharedBuffer::~SharedBuffer): Deleted.
        (WebCore::SharedBuffer::size): Deleted.
        (WebCore::SharedBuffer::duplicateDataBufferIfNecessary): Deleted.
        (WebCore::SharedBuffer::appendToDataBuffer): Deleted.
        (WebCore::SharedBuffer::clearDataBuffer): Deleted.
        (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
        (WebCore::SharedBuffer::buffer): Deleted.
        (WebCore::SharedBuffer::getSomeData): Deleted.
        (WebCore::SharedBuffer::maybeTransferMappedFileData): Deleted.
        (WebCore::SharedBuffer::clearPlatformData): Deleted.
        (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
        (WebCore::SharedBuffer::hasPlatformData): Deleted.
        (WebCore::SharedBuffer::platformData): Deleted.
        (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
        * platform/SharedBuffer.h:
        (WebCore::SharedBuffer::create): Deleted.
        (WebCore::SharedBuffer::isEmpty): Deleted.
        * platform/SharedBufferChunkReader.cpp:
        (WebCore::SharedBufferChunkReader::nextChunk):
        (WebCore::SharedBufferChunkReader::peek):
        * platform/SharedBufferChunkReader.h:
        * platform/URLParser.cpp:
        (WebCore::URLParser::URLParser):
        * platform/cf/KeyedEncoderCF.cpp:
        (WebCore::KeyedEncoderCF::finishEncoding):
        * platform/cf/SharedBufferCF.cpp:
        (WebCore::SharedBuffer::SharedBuffer):
        (WebCore::SharedBuffer::createCFData):
        (WebCore::SharedBuffer::create):
        (WebCore::SharedBuffer::hintMemoryNotNeededSoon):
        (WebCore::SharedBuffer::append):
        (WebCore::SharedBuffer::wrapCFData): Deleted.
        (WebCore::SharedBuffer::hasPlatformData): Deleted.
        (WebCore::SharedBuffer::platformData): Deleted.
        (WebCore::SharedBuffer::platformDataSize): Deleted.
        (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
        (WebCore::SharedBuffer::clearPlatformData): Deleted.
        (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.
        (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
        (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
        (WebCore::SharedBuffer::copySomeDataFromDataArray): Deleted.
        (WebCore::SharedBuffer::singleDataArrayBuffer): Deleted.
        (WebCore::SharedBuffer::maybeAppendDataArray): Deleted.
        * platform/cocoa/NetworkExtensionContentFilter.mm:
        (WebCore::NetworkExtensionContentFilter::replacementData):
        * platform/cocoa/ParentalControlsContentFilter.mm:
        (WebCore::ParentalControlsContentFilter::replacementData):
        * platform/cocoa/SharedBufferCocoa.mm:
        (-[WebCoreSharedBufferData initWithSharedBufferDataSegment:]):
        (-[WebCoreSharedBufferData length]):
        (-[WebCoreSharedBufferData bytes]):
        (WebCore::SharedBuffer::create):
        (WebCore::SharedBuffer::createCFData):
        (WebCore::SharedBuffer::createFromReadingFile):
        (WebCore::SharedBuffer::createNSDataArray):
        (-[WebCoreSharedBufferData initWithSharedBufferDataBuffer:]): Deleted.
        (WebCore::SharedBuffer::wrapNSData): Deleted.
        (WebCore::SharedBuffer::existingCFData): Deleted.
        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
        (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
        (WebCore::FontPlatformData::openTypeTable):
        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (ResourceHandleStreamingClient::didReceiveBuffer):
        * platform/graphics/mac/ImageMac.mm:
        (WebCore::Image::loadPlatformResource):
        * platform/image-decoders/ImageDecoder.cpp:
        (WebCore::ImageDecoder::create):
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageReader::decode):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::readBuffer):
        * platform/mac/PasteboardMac.mm:
        (WebCore::writeFileWrapperAsRTFDAttachment):
        (WebCore::Pasteboard::write):
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::PlatformPasteboard::bufferForType):
        * platform/network/BlobResourceHandle.cpp:
        (WebCore::BlobResourceHandle::notifyReceiveData):
        * platform/network/MIMEHeader.cpp:
        * platform/network/MIMEHeader.h:
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
        * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
        (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData):
        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
        (-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]):
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
        * platform/soup/SharedBufferSoup.cpp:
        (WebCore::SharedBuffer::SharedBuffer):
        (WebCore::SharedBuffer::createSoupBuffer):
        (WebCore::SharedBuffer::clearPlatformData): Deleted.
        (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
        (WebCore::SharedBuffer::hasPlatformData): Deleted.
        (WebCore::SharedBuffer::platformData): Deleted.
        (WebCore::SharedBuffer::platformDataSize): Deleted.
        (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
        (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.

2017-04-21  Timothy Horton  <timothy_horton@apple.com>

        Expose obscured insets to web content (as "safe area insets")
        https://bugs.webkit.org/show_bug.cgi?id=171013
        <rdar://problem/31564652>

        Reviewed by Wenson Hsieh and Dave Hyatt.

        Tests: fast/css/variables/constants/invalid-constant-name-fallback.html
               fast/css/variables/constants/ios/safe-area-inset-set.html
               fast/css/variables/constants/safe-area-inset-cannot-override.html
               fast/css/variables/constants/safe-area-inset-zero.html

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSValueKeywords.in:
        * css/CSSVariableData.cpp:
        (WebCore::CSSVariableData::checkVariablesForCyclesWithRange):
        (WebCore::CSSVariableData::resolveTokenRange):
        * css/parser/CSSVariableParser.cpp:
        (WebCore::isValidConstantName):
        (WebCore::classifyBlock):
        (WebCore::isValidConstantReference):
        Add a constant() function, which takes both custom properties and
        arbitrary idents which are looked up in ConstantPropertyMap, allowing
        fallback from the arbitrary, UA-defined idents to custom properties.

        * dom/ConstantPropertyMap.cpp: Added.
        (WebCore::ConstantPropertyMap::ConstantPropertyMap):
        (WebCore::ConstantPropertyMap::values):
        (WebCore::ConstantPropertyMap::nameForProperty):
        (WebCore::ConstantPropertyMap::setValueForProperty):
        (WebCore::ConstantPropertyMap::buildValues):
        (WebCore::variableDataForSafeAreaInset):
        (WebCore::ConstantPropertyMap::didChangeObscuredInsets):
        * dom/ConstantPropertyMap.h: Added.
        Keep a mapping of UA-defined "constants", which can be looked up
        from CSS via the aforementioned function. For now, this mapping
        includes only safe-area-inset-{top, right, bottom, left}, which
        expose the obscured insets (now that they can be painted into via
        the viewport parameter clip-to-safe-area-inset=no).

        * dom/Document.cpp:
        (WebCore::Document::Document):
        (WebCore::Document::didChangeObscuredInsets):
        * dom/Document.h:
        (WebCore::Document::constantProperties):
        * page/Page.cpp:
        (WebCore::Page::setObscuredInsets):
        * page/Page.h:
        (WebCore::Page::setObscuredInsets): Deleted.
        Make setObscuredInsets and related storage not iOS-specific, though
        nothing from the other platforms yet calls this code.

        * style/StyleResolveForDocument.cpp:
        (WebCore::Style::resolveForDocument):
        Grab the constant properties from ConstantPropertyMap and plop them into
        the CustomPropertyValueMap. Constant properties aren't allowed to start
        with --, and variable properties must, so there is no opportunity here
        for exposing things to var() (or allowing custom properties to override
        UA-defined constant properties).

2017-04-20  Konstantin Tokarev  <annulen@yandex.ru>

        [cmake] Define FORWARDING_HEADERS_DIR in WebKitFS and use it everywhere
        https://bugs.webkit.org/show_bug.cgi?id=171071

        Reviewed by Michael Catanzaro.

        "${DERIVED_SOURCES_DIR}/ForwardingHeaders" path occurs very often in the
        build system files. GTK-specifc FORWARDING_HEADERS_DIR variable should
        be available for all ports.

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

2017-04-20  Commit Queue  <commit-queue@webkit.org>

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

        Made all tests crash under GuardMalloc (Requested by ap on
        #webkit).

        Reverted changeset:

        "Expose obscured insets to web content (as "safe area
        insets")"
        https://bugs.webkit.org/show_bug.cgi?id=171013
        http://trac.webkit.org/changeset/215597

2017-04-20  Dean Jackson  <dino@apple.com>

        Add Web Sharing to the features under consideration.

        * features.json:

2017-04-20  Dean Jackson  <dino@apple.com>

        Add Scroll Anchoring to features under consideration.

        * features.json:

2017-04-20  Konstantin Tokarev  <annulen@yandex.ru>

        Remove unused lamda captures
        https://bugs.webkit.org/show_bug.cgi?id=171098

        Reviewed by Yusuke Suzuki.

        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
        (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
        * loader/ResourceLoadStatisticsStore.cpp:
        (WebCore::ResourceLoadStatisticsStore::createEncoderFromData):
        (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):

2017-04-20  Timothy Horton  <timothy_horton@apple.com>

        Expose obscured insets to web content (as "safe area insets")
        https://bugs.webkit.org/show_bug.cgi?id=171013
        <rdar://problem/31564652>

        Reviewed by Wenson Hsieh and Dave Hyatt.

        Tests: fast/css/variables/constants/invalid-constant-name-fallback.html
               fast/css/variables/constants/ios/safe-area-inset-set.html
               fast/css/variables/constants/safe-area-inset-cannot-override.html
               fast/css/variables/constants/safe-area-inset-zero.html

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSValueKeywords.in:
        * css/CSSVariableData.cpp:
        (WebCore::CSSVariableData::checkVariablesForCyclesWithRange):
        (WebCore::CSSVariableData::resolveTokenRange):
        * css/parser/CSSVariableParser.cpp:
        (WebCore::isValidConstantName):
        (WebCore::classifyBlock):
        (WebCore::isValidConstantReference):
        Add a constant() function, which takes both custom properties and
        arbitrary idents which are looked up in ConstantPropertyMap, allowing
        fallback from the arbitrary, UA-defined idents to custom properties.

        * dom/ConstantPropertyMap.cpp: Added.
        (WebCore::ConstantPropertyMap::ConstantPropertyMap):
        (WebCore::ConstantPropertyMap::values):
        (WebCore::ConstantPropertyMap::nameForProperty):
        (WebCore::ConstantPropertyMap::setValueForProperty):
        (WebCore::ConstantPropertyMap::buildValues):
        (WebCore::variableDataForSafeAreaInset):
        (WebCore::ConstantPropertyMap::didChangeObscuredInsets):
        * dom/ConstantPropertyMap.h: Added.
        Keep a mapping of UA-defined "constants", which can be looked up
        from CSS via the aforementioned function. For now, this mapping
        includes only safe-area-inset-{top, right, bottom, left}, which
        expose the obscured insets (now that they can be painted into via
        the viewport parameter clip-to-safe-area-inset=no).

        * dom/Document.cpp:
        (WebCore::Document::Document):
        (WebCore::Document::didChangeObscuredInsets):
        * dom/Document.h:
        (WebCore::Document::constantProperties):
        * page/Page.cpp:
        (WebCore::Page::setObscuredInsets):
        * page/Page.h:
        (WebCore::Page::setObscuredInsets): Deleted.
        Make setObscuredInsets and related storage not iOS-specific, though
        nothing from the other platforms yet calls this code.

        * style/StyleResolveForDocument.cpp:
        (WebCore::Style::resolveForDocument):
        Grab the constant properties from ConstantPropertyMap and plop them into
        the CustomPropertyValueMap. Constant properties aren't allowed to start
        with --, and variable properties must, so there is no opportunity here
        for exposing things to var() (or allowing custom properties to override
        UA-defined constant properties).

2017-04-20  Anders Carlsson  <andersca@apple.com>

        Remove one use of toPaymentAuthorizationStatus
        https://bugs.webkit.org/show_bug.cgi?id=171086

        Reviewed by Tim Horton.

        Just switch on the individual ApplePaySession::STATUS_ values.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::ApplePaySession::completeShippingMethodSelection):

2017-04-20  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] Fix build break after updating ANGLE
        https://bugs.webkit.org/show_bug.cgi?id=170980

        Reviewed by Brent Fulgham.

        By stopping using SoftLinking for ANGLE, some changes are needed
        for WebCore and WebKit.
          - Define a macro 'GL_GLEXT_PROTOTYPES' before #include <GLES2/gl2.h> or <GLES2/gl2ext.h>.
          - Link libEGL import library explicitly.

        * PlatformWin.cmake: Link libEGL to WebCore.
        * platform/graphics/PlatformDisplay.cpp:
        (WebCore::PlatformDisplay::initializeEGLDisplay): Removed the code for SoftLinking.
        * platform/graphics/GLContext.cpp: Define GL_GLEXT_PROTOTYPES.
        * platform/graphics/egl/GLContextEGL.cpp: Ditto.
        * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: Ditto.
        * platform/graphics/opengl/Extensions3DOpenGLES.h: Ditto.
        * platform/graphics/opengl/TemporaryOpenGLSetting.cpp: Ditto.
        * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp: Ditto.

2017-04-20  Matt Baker  <mattbaker@apple.com>

        Web Inspector: Add regular expression support to XHR breakpoints
        https://bugs.webkit.org/show_bug.cgi?id=170099
        <rdar://problem/31558082>

        Reviewed by Joseph Pecoraro.

        * inspector/InspectorDOMDebuggerAgent.cpp:
        (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint):
        (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
        Use ContentSearchUtilities for both Text and RegularExpression breakpoints.

        * inspector/InspectorDOMDebuggerAgent.h:
        Associate XHR breakpoint with a type.

2017-04-20  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Cleanup and simplify CoreAudioCaptureSource
        https://bugs.webkit.org/show_bug.cgi?id=171064

        There is no need for a mutex to guard against internal state changes because we
        don't currently change configuration after the audio unit is allocated. Once
        we do support reconfiguration on the fly, we can just stop the output unit before
        changing configuration because the I/O proc isn't called if the output unit
        is stopped, and AudioOutputUnitStop blocks until the audio device has stopped.
        
        Reviewed by Jer Noble.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): Call cleanupAudioUnits
        instead of duplicating logic. 
        (WebCore::CoreAudioCaptureSource::preferredIOBufferDuration): Change preferred
        duration from 20ms to 40ms.
        (WebCore::CoreAudioCaptureSource::configureMicrophoneProc): Set mSampleRate to the
        preferred sample rate if it is 0.
        (WebCore::CoreAudioCaptureSource::configureSpeakerProc): Ditto.
        (WebCore::CoreAudioCaptureSource::provideSpeakerData): Only increment counter and
        check timestamps in debug builds.
        (WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Ditto.
        (WebCore::CoreAudioCaptureSource::cleanupAudioUnits): We only need the audio unit
        name in debug builds.
        (WebCore::CoreAudioCaptureSource::setupAudioUnits): Ditto. No more internal state
        lock. Don't try to get the default input device on iOS.
        (WebCore::CoreAudioCaptureSource::startProducingData): No more internal state lock.
        Assert if not called on the main thread.
        (WebCore::CoreAudioCaptureSource::stopProducingData): Ditto.
        (WebCore::CoreAudioCaptureSource::suspend): Ditto.
        (WebCore::CoreAudioCaptureSource::resume): Ditto.
        * platform/mediastream/mac/CoreAudioCaptureSource.h:

2017-04-20  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream iOS] Hold process assertion while media capture is active
        https://bugs.webkit.org/show_bug.cgi?id=171017
        <rdar://problem/31719177>

        Reviewed by Dean Jackson.

        * page/ActivityState.h: Add IsCapturingMedia flag.

        * page/Page.cpp:
        (WebCore::Page::updateTimerThrottlingState): Enable timer throttling when capture is active
        like we do when playing audio.
        (WebCore::Page::setActivityState): Ditto.

        * page/PerformanceMonitor.cpp:
        (WebCore::PerformanceMonitor::updateProcessStateForMemoryPressure): A process is active when
        capturing media, as it is when playing audio.

2017-04-20  Wenson Hsieh  <wenson_hsieh@apple.com>

        Inline anchor elements cannot be dragged when starting the drag from a block descendant
        https://bugs.webkit.org/show_bug.cgi?id=171062
        <rdar://problem/31697835>

        Reviewed by Tim Horton.

        Tweaks DragController::draggableElement to traverse the DOM instead of the render tree when finding a draggable
        element. This prevents us from skipping elements that are in the DOM ancestor chain, but appear as siblings to
        the hit-tested node's renderer in the render tree.

        There was also previously a check to ensure that we skip anonymous RenderObjects while traversing up the chain,
        but this is no longer necessary fter this change, since all the elements we traverse in the DOM should have
        renderers that are not anonymous.

        Test: fast/events/drag-and-drop-link-containing-block.html

        * page/DragController.cpp:
        (WebCore::DragController::draggableElement):

2017-04-20  Michael Catanzaro  <mcatanzaro@igalia.com>

        -Wformat warning on HistoryController.cpp:295:5
        https://bugs.webkit.org/show_bug.cgi?id=171028

        Reviewed by Daniel Bates.

        Need to cast WebCore::FrameLoadType to int before using it in printf.

        * loader/HistoryController.cpp:
        (WebCore::HistoryController::goToItem):

2017-04-20  Per Arne Vollan  <pvollan@apple.com>

        The toleranceBefore parameter in the AVPlayerItem method seekToTime should not be negative.
        https://bugs.webkit.org/show_bug.cgi?id=171063

        Reviewed by Eric Carlson.

        The AVPlayerItem method seekToTime will throw an exception if toleranceBefore is negative.

        No new tests since the change is a sanity check.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::seekTask):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):

2017-04-20  Anders Carlsson  <andersca@apple.com>

        Replace isFinalStateStatus with isFinalStateResult
        https://bugs.webkit.org/show_bug.cgi?id=171072
        rdar://problem/31589635

        Reviewed by Tim Horton.

        This will let us get rid of some of the status enum declarations.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::ApplePaySession::completePayment):
        * Modules/applepay/PaymentAuthorizationStatus.h:
        (WebCore::isFinalStateStatus): Deleted.
        * Modules/applepay/PaymentCoordinator.cpp:
        (WebCore::PaymentCoordinator::completePaymentSession):
        * Modules/applepay/PaymentRequest.cpp:
        (WebCore::isFinalStateResult):
        * Modules/applepay/PaymentRequest.h:

2017-04-20  Brent Fulgham  <bfulgham@apple.com>

        [Win] REGRESSION(r215486): Windows Release build is broken
        https://bugs.webkit.org/show_bug.cgi?id=171024
        <rdar://problem/31722618>

        Reviewed by Mark Lam.

        Add missing include needed for clean Release build on Windows (proper
        fix found by Fujii Hironori).

        * bindings/js/JSDOMGlobalObject.h:

2017-04-20  Said Abou-Hallawa  <sabouhallawa@apple.com>

        CachedImage should cancel loading images for unsupported/unknown types
        https://bugs.webkit.org/show_bug.cgi?id=170697

        Reviewed by Youenn Fablet.

        Currently when the image decoder detects an error with the incoming encoded
        data of an image, we mark the image to be a broken image. But the network
        process keeps feeding the web process with the rest of the data. We should
        cancel loading the rest of the data to save network bandwidth and CPU time
        loading and processing useless data.

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::addIncrementalDataBuffer):
        (WebCore::CachedImage::finishLoading):

2017-04-20  Aaron Chu  <aaron_chu@apple.com>

        AX: Modern Media Controls Timeline slider should be operable
        https://bugs.webkit.org/show_bug.cgi?id=170250

        Reviewed by Antoine Quint.

        Added a "change" event listener and aria-valuetext to the slider so that when a
        VoiceOver user operates the timeline control, VO speaks the updated timestamp

        Test: media/modern-media-controls/scrubber/scrubber-has-correct-ax-label.html

        * English.lproj/modern-media-controls-localized-strings.js:
        * Modules/modern-media-controls/controls/scrubber.js:
        (Scrubber.prototype.set inputAccessibleLabel):
        (Scrubber.prototype._formatTime):
        * Modules/modern-media-controls/controls/slider.js:
        (Slider.prototype.handleEvent):
        (Slider.prototype._handleInputEvent): Deleted.
        * Modules/modern-media-controls/controls/time-control.js:
        (TimeControl.prototype.updateScrubberLabel):
        * Modules/modern-media-controls/controls/time-label.js:
        (TimeLabel.prototype.commitProperty):
        (TimeLabel.prototype._formattedTime):
        * Modules/modern-media-controls/main.js:
        (formatTimeByUnit):
        (unitizeTime):

2017-04-20  Andy Estes  <aestes@apple.com>

        Fix indentation in AVKitSPI.h
        https://bugs.webkit.org/show_bug.cgi?id=171066

        Reviewed by Jer Noble.

        * platform/spi/cocoa/AVKitSPI.h:

2017-04-20  Jer Noble  <jer.noble@apple.com>

        [MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess.
        https://bugs.webkit.org/show_bug.cgi?id=171021

        Reviewed by Eric Carlson.

        Refactor the creation of RealtimeMediaSources to take a persistent device ID rather
        than a CaptureDevice directly. This allows WebKit2 to iterate devices in the UIProcess
        rather than the WebProcess.

        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/mac/AVAudioCaptureSource.mm:
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::create):
        (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
        * platform/mediastream/mac/CoreAudioCaptureSource.h:
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
        (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints):
        * platform/mock/MockRealtimeAudioSource.cpp:
        * platform/mock/MockRealtimeVideoSource.cpp:

2017-04-20  Tim Horton  <timothy_horton@apple.com>

        Make it possible to request the non-expanded scrollbar width from ScrollbarTheme
        https://bugs.webkit.org/show_bug.cgi?id=171047

        Reviewed by Sam Weinig.

        No new tests, new behavior is not exposed in any way.

        * platform/ScrollTypes.h:
        * platform/ScrollbarTheme.h:
        (WebCore::ScrollbarTheme::scrollbarThickness):
        * platform/gtk/ScrollbarThemeGtk.cpp:
        (WebCore::ScrollbarThemeGtk::scrollbarThickness):
        * platform/gtk/ScrollbarThemeGtk.h:
        * platform/ios/ScrollbarThemeIOS.h:
        * platform/ios/ScrollbarThemeIOS.mm:
        (WebCore::ScrollbarThemeIOS::scrollbarThickness):
        * platform/mac/ScrollbarThemeMac.h:
        * platform/mac/ScrollbarThemeMac.mm:
        (WebCore::ScrollbarThemeMac::scrollbarThickness):
        * platform/mock/ScrollbarThemeMock.cpp:
        (WebCore::ScrollbarThemeMock::scrollbarThickness):
        * platform/mock/ScrollbarThemeMock.h:
        * platform/win/ScrollbarThemeWin.cpp:
        (WebCore::ScrollbarThemeWin::scrollbarThickness):
        * platform/win/ScrollbarThemeWin.h:
        * rendering/RenderScrollbarTheme.h:
        On Mac, when the scrollbar is hovered, it gets bigger.
        Currently, scrollbarThickness always returns the big size.
        It should be possible to request the smaller, "regular" scrollbar size as well.

2017-04-20  Jon Lee  <jonlee@apple.com>

        Update pip placard to "picture in picture"
        https://bugs.webkit.org/show_bug.cgi?id=171036
        rdar://problem/30201536

        Reviewed by Antoine Quint.

        Updated media/modern-media-controls/pip-placard/pip-placard.html

        Update the text shown with the picture in picture placard.

        * English.lproj/mediaControlsLocalizedStrings.js:
        * English.lproj/modern-media-controls-localized-strings.js:
        * Modules/mediacontrols/mediaControlsApple.js:
        (Controller.prototype.updatePictureInPicturePlaceholder):
        * Modules/modern-media-controls/controls/pip-placard.js:
        (PiPPlacard):

2017-04-20  Youenn Fablet  <youenn@apple.com>

        RTCPeerConnection is stopping its backend twice sometimes
        https://bugs.webkit.org/show_bug.cgi?id=171043

        Reviewed by Eric Carlson.

        Test: webrtc/closing-peerconnection.html

        Making sure we stop the backend only once.
        Adding an internals API to close the peer connection so as to replicate frame disconnection.

        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::doClose):
        (WebCore::RTCPeerConnection::doStop):
        * Modules/mediastream/RTCPeerConnection.h:
        * testing/Internals.cpp:
        (WebCore::Internals::stopPeerConnection):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-04-20  Antti Koivisto  <antti@apple.com>

        Increase large animation cutoff
        https://bugs.webkit.org/show_bug.cgi?id=171051
        <rdar://problem/31731532>

        Reviewed by Andreas Kling.

        We currently switch to per-frame decoding if the animation is larger than 5MB. This is very
        power-inefficient and such animations are now common. The cutoff originates from 2007 (r20069),
        it is time update it.

        Note that the normal low memory handling will still kill animation frames as needed.

        * platform/graphics/BitmapImage.h:

            Increase cutoff to 30MB. This is enough (with some room to spare) for animations on current
            tumblr.com/search/aww.

            Also remove the separate cutoff value for iOS.

2017-04-20  Zan Dobersek  <zdobersek@igalia.com>

        Register missing AES_CTR, ECDSA and HKDF algorithms in
        GCrypt's CryptoAlgorithmRegistry implementation.

        Rubber-stamped by Carlos Alberto Lopez Perez.

        * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
        (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):

2017-04-20  Joanmarie Diggs  <jdiggs@igalia.com>

        [ATK] Implement support for DPub ARIA roles
        https://bugs.webkit.org/show_bug.cgi?id=170679

        Reviewed by Chris Fleizach.

        Create two new WebCore AccessibilityRole values: TextGroup and ApplicationTextGroup.
        These roles make it possible for platforms to distinguish groups which are primarily
        intended to display textual content from groups which are primarily intended to hold
        user-interface objects. Use these roles to fix the ATK mapping of DPub's groups, which
        should be exposed as ATK_ROLE_SECTION; not ATK_ROLE_PANEL.

        Modify the following WebCore AccessibilityRole mappings:
        - doc-abstract changed to ApplicationTextGroupRole because this DPub ARIA role does
          not subclass the ARIA landmark role
        - doc-biblioentry and doc-endnote changed to ListItemRole, because these DPub ARIA
          roles subclass the ARIA listitem role
        - doc-notice and doc-tip changed to DocumentNoteRole because these DPub ARIA roles
          subclass the ARIA note role
        - doc-pagebreak changed to SplitterRole because this DPub ARIA role subclasses the
          ARIA separator role

        No new tests required: New test cases were added to xml-roles-exposed.html, and
        the platform expectations for roles-exposed.html were updated to reflect the
        correct mappings.

        * accessibility/AccessibilityList.cpp:
        (WebCore::AccessibilityList::determineAccessibilityRole):
        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::isGroup):
        (WebCore::AccessibilityNodeObject::helpText):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::ariaTreeItemContent):
        (WebCore::initializeRoleMap):
        (WebCore::AccessibilityObject::computedRoleString):
        * accessibility/AccessibilityObject.h:
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::helpText):
        (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant):
        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (webkitAccessibleGetAttributes):
        (atkRole):
        (roleIsTextType):
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
        (-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (createAccessibilityRoleMap):
        (-[WebAccessibilityObjectWrapper subrole]):

2017-04-19  Youenn Fablet  <youenn@apple.com>

        [Mac] Allow customizing H264 encoder
        https://bugs.webkit.org/show_bug.cgi?id=170829

        Reviewed by Alex Christensen.

        Using WebKitAdditions CreateCompressionSession if available.

        * Configurations/FeatureDefines.xcconfig:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.h: Added.
        * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm: Added.
        (WebCore::H264VideoToolboxEncoder::CreateCompressionSession):
        * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp:
        (WebCore::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder):

2017-04-19  Eric Carlson  <eric.carlson@apple.com>

        Another deadlock in CoreAudioCaptureSource
        https://bugs.webkit.org/show_bug.cgi?id=171001

        Fix another regression introduced by r215201, plus make changes suggested
        in the review of 170771.

        Reviewed by Youenn Fablet.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::configureSpeakerProc): Assert if the lock is no held.
        (WebCore::CoreAudioCaptureSource::provideSpeakerData): Don't reset the buffer.
        (WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Take the state lock. Don't
        reset the buffer. No more microphone callbacks.
        (WebCore::CoreAudioCaptureSource::stopProducingData): Return early if the io unit isn't
        running. Drop the lock before calling setMuted to avoid another deadlock.
        (WebCore::CoreAudioCaptureSource::addMicrophoneDataConsumer): Deleted.
        (WebCore::CoreAudioCaptureSource::removeMicrophoneDataConsumer): Deleted.
        * platform/mediastream/mac/CoreAudioCaptureSource.h:

2017-04-19  Anders Carlsson  <andersca@apple.com>

        Stop using deprecated APIs, part 3
        https://bugs.webkit.org/show_bug.cgi?id=171003
        rdar://problem/31589635
        rdar://problem/31589635

        Reviewed by Tim Horton.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::convertAndValidate):
        The status member variable has been removed from ApplePayShippingMethodUpdate.

        (WebCore::ApplePaySession::completeShippingMethodSelection):
        If status is not STATUS_SUCCESS, cancel the payment session.

        (WebCore::ApplePaySession::canSuspendForDocumentSuspension):
        (WebCore::ApplePaySession::canBegin):
        (WebCore::ApplePaySession::canAbort):
        (WebCore::ApplePaySession::canCancel):
        (WebCore::ApplePaySession::canCompleteShippingMethodSelection):
        (WebCore::ApplePaySession::canCompleteShippingContactSelection):
        (WebCore::ApplePaySession::canCompletePaymentMethodSelection):
        (WebCore::ApplePaySession::canCompletePayment):
        (WebCore::ApplePaySession::isFinalState):
        Add State::CancelRequested.

        * Modules/applepay/ApplePayShippingMethodUpdate.h:
        * Modules/applepay/ApplePayShippingMethodUpdate.idl:
        Remove status.

        * Modules/applepay/PaymentCoordinator.cpp:
        (WebCore::PaymentCoordinator::cancelPaymentSession):
        Call through to the client.

        * Modules/applepay/PaymentCoordinator.h:
        * Modules/applepay/PaymentCoordinatorClient.h:
        Add cancelPaymentSession().

        * Modules/applepay/PaymentRequest.h:
        Remove status.

        * loader/EmptyClients.cpp:
        Add new client member function.

2017-04-19  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Limit capture to one tab at a time
        https://bugs.webkit.org/show_bug.cgi?id=171009

        Reviewed by Jon Lee.

        No new tests yet, filed bug 171011.

        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::stopTrack): Drive-by fix: renamed from stopProducingData
        because stopProducingData is a method in RealtimeMediaSource that does something different.
        (WebCore::MediaStreamTrack::stop): Call stopTrack.
        (WebCore::MediaStreamTrack::stopProducingData): Deleted.
        * Modules/mediastream/MediaStreamTrack.h:
        * Modules/mediastream/MediaStreamTrack.idl:

        * Modules/mediastream/RTCRtpSender.cpp:
        (WebCore::RTCRtpSender::replaceTrack): Update for rename.

        * platform/mediastream/MediaStreamPrivate.cpp:
        (WebCore::MediaStreamPrivate::muted): Drive-by fix: a track that has ended but 
        which is not muted will never produce data.

2017-04-19  Alex Christensen  <achristensen@webkit.org>

        Parsing large XML strings fails
        https://bugs.webkit.org/show_bug.cgi?id=170999
        <rdar://problem/17336267>

        Reviewed by Brady Eidson.

        Test: fast/dom/xml-large.html

        * xml/parser/XMLDocumentParserLibxml2.cpp:
        (WebCore::XMLParserContext::createStringParser):
        (WebCore::XMLParserContext::createMemoryParser):
        Allow huge XML strings. They work fine in Chrome and Firefox.

2017-04-19  Chris Fleizach  <cfleizach@apple.com>

        AX: <hr> should use a different role description than interactive separators
        https://bugs.webkit.org/show_bug.cgi?id=170317
        <rdar://problem/31363024>

        Reviewed by Joanmarie Diggs.

        Users are confused with WebKit's accessibility description of separators. 
        We should call these what they are, horizontal rules.

        Updated test: accessibility/mac/hr-element-expected.txt

        * English.lproj/Localizable.strings:
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::orientation):
        * platform/cocoa/LocalizedStringsCocoa.mm:
        (WebCore::AXHorizontalRuleDescriptionText):

2017-04-19  Anders Carlsson  <andersca@apple.com>

        Rename cancelPayment to cancelPaymentSession
        https://bugs.webkit.org/show_bug.cgi?id=171007

        Reviewed by Tim Horton.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::ApplePaySession::didCancelPaymentSession):
        (WebCore::ApplePaySession::didCancelPayment): Deleted.
        * Modules/applepay/ApplePaySession.h:
        * Modules/applepay/PaymentCoordinator.cpp:
        (WebCore::PaymentCoordinator::didCancelPaymentSession):
        (WebCore::PaymentCoordinator::didCancelPayment): Deleted.
        * Modules/applepay/PaymentCoordinator.h:

2017-04-19  Joseph Pecoraro  <pecoraro@apple.com>

        ASAN Crash running LayoutTests/inspector/worker tests
        https://bugs.webkit.org/show_bug.cgi?id=170967
        <rdar://problem/31256437>

        Reviewed by Alex Christensen.

        * workers/WorkerMessagingProxy.h:
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
        (WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal):
        Make the MessagingProxy thread safe ref counted. Since it used to
        delete itself, turn this into a ref (implicit on construction)
        and deref (replacing delete this).

        (WebCore::WorkerMessagingProxy::postMessageToPageInspector):
        When dispatching have the lambda implicitly ref/deref with the
        lambda to keep the proxy alive while a lambda is queued.

2017-04-19  Brent Fulgham  <bfulgham@apple.com>

        [iOS, macOS] Guard against passing nullptr to vImagePremultiplyData
        https://bugs.webkit.org/show_bug.cgi?id=170912
        <rdar://problem/30565800>

        Reviewed by Brady Eidson.

        * platform/graphics/cg/ImageBufferDataCG.cpp:
        (WebCore::affineWarpBufferData): Assert if we passed nullptr buffers.
        (WebCore::transferData): Ditto.
        (WebCore::ImageBufferData::getData): Check for nullptr data member and avoid passing to vImage routines.
        (WebCore::ImageBufferData::putData): Ditto.

2017-04-19  Dave Hyatt  <hyatt@apple.com>

        Remove bogus assert for :not.
        https://bugs.webkit.org/show_bug.cgi?id=170995
        <rdar://problem/29693115>

        Reviewed by Zalan Bujtas.

        * css/parser/CSSSelectorParser.cpp:

2017-04-19  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] Allow non-PNG resources
        https://bugs.webkit.org/show_bug.cgi?id=170992
        <rdar://problem/31706590>

        Reviewed by Dean Jackson.

        Instead of passing in a name and a platform to MediaControlsHost::base64StringForIconAndPlatform(),
        we now pass in a name and a type to MediaControlsHost::base64StringForIconNameAndType(). We've removed
        the need to provide a platform by copying the resources directly under "Resources/modern-media-controls"
        insted of "Resources/modern-media-controls/platform-name-here", and now we provide a type so that it
        may be passed down to -[NSBundle pathForResource:ofType:inDirectory:].

        * Modules/mediacontrols/MediaControlsHost.cpp:
        (WebCore::MediaControlsHost::base64StringForIconNameAndType):
        (WebCore::MediaControlsHost::base64StringForIconAndPlatform): Deleted.
        * Modules/mediacontrols/MediaControlsHost.h:
        * Modules/mediacontrols/MediaControlsHost.idl:
        * Modules/modern-media-controls/controls/icon-service.js:
        (const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits):
        * WebCore.xcodeproj/project.pbxproj:
        * rendering/RenderTheme.h:
        (WebCore::RenderTheme::mediaControlsBase64StringForIconNameAndType):
        (WebCore::RenderTheme::mediaControlsBase64StringForIconAndPlatform): Deleted.
        * rendering/RenderThemeIOS.h:
        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::mediaControlsBase64StringForIconNameAndType):
        (WebCore::RenderThemeIOS::mediaControlsBase64StringForIconAndPlatform): Deleted.
        * rendering/RenderThemeMac.h:
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::mediaControlsBase64StringForIconNameAndType):
        (WebCore::RenderThemeMac::mediaControlsBase64StringForIconAndPlatform): Deleted.

2017-04-19  Antti Koivisto  <antti@apple.com>

        Avoid repaints for invisible animations on tumblr.com/search/aww
        https://bugs.webkit.org/show_bug.cgi?id=170986
        <rdar://problem/28644580>

        Reviewed by Andreas Kling.

        Test: fast/repaint/mutate-non-visible.html

        * rendering/style/RenderStyle.cpp:
        (WebCore::requiresPainting):
        (WebCore::RenderStyle::changeRequiresRepaint):

            If an element is invisible it does not require repaint even if something else changes.

2017-04-19  Dean Jackson  <dino@apple.com>

        Non-muxable GPUs shouldn't allow offline rendering
        https://bugs.webkit.org/show_bug.cgi?id=170984
        <rdar://problem/31614406>

        Reviewed by Myles Maxfield.

        Setting the kCGLPFAAllowOfflineRenderers flag doesn't do any
        harm on devices that only have one GPU. It's also what we
        want on devices that can mux between GPUs. However, we were
        also setting it unconditionally on devices with multiple
        GPUs that have issues muxing.

        * platform/graphics/mac/GraphicsContext3DMac.mm:
        (WebCore::setPixelFormat): Add a test for hasMuxableGPU.

2017-04-18  Youenn Fablet  <youenn@apple.com>

        RTCOfferOptions iceRestart should be supported
        https://bugs.webkit.org/show_bug.cgi?id=170966

        Reviewed by Alex Christensen.

        No ability to test iceRestart as of now.
        Passing iceRestart value to libwebrtc.
        Passing also voiceActivityDetection value to libwebrtc.
        Updating mock to use the new overloaded CreateOffer method.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::doCreateOffer):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
        * testing/MockLibWebRTCPeerConnection.cpp:
        (WebCore::MockLibWebRTCPeerConnection::CreateOffer):
        * testing/MockLibWebRTCPeerConnection.h:

2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WK2] Support DataTransfer::files() when performing a DHTML data interaction
        https://bugs.webkit.org/show_bug.cgi?id=170880
        <rdar://problem/31314689>

        Reviewed by Tim Horton.

        Adds support for fetching files from the DataTransfer when performing a data interaction operation handled by
        JavaScript. There are two changes we make here to achieve this:

        First, we teach the Pasteboard on iOS to know what file paths hold the item provider contents used in the
        current data interaction operation. On iOS, Pasteboard::readFilenames is currently hard-coded to return an empty
        vector. To fix this, we add logic to the iOS Pasteboard to remember what the paths of all files that were
        successfully loaded from item providers as the data interaction is taking place. This ensures that at the
        WebCore layer, the implementation of Pasteboard::readFilenames on Mac and iOS is similar -- they both call out
        to the client layer in order to read file paths off of their respective pasteboards. Once in the client layer
        (WebKit1 or WebKit2) we then call into PlatformPasteboard::filenamesForDataInteraction, which then calls into
        WebItemProviderPasteboard if applicable.

        The second tweak is to propagate information about whether the document is preventing default data interaction
        behavior to the client layer. This prevents us from having to save pasteboard content when performing data
        interaction in cases where file information is not needed (i.e. the default behavior is being performed, and
        the target is not a file input). This also avoids compatibility issues with insertion animations when performing
        data interaction in editable areas, due to the extra time spent loading item provider data into a temporary
        file.

        Unit tests in <https://bugs.webkit.org/show_bug.cgi?id=170903>.

        * page/DragController.cpp:
        (WebCore::DragController::DragController):
        (WebCore::DragController::performDragOperation):
        (WebCore::DragController::dragEnteredOrUpdated):
        (WebCore::DragController::tryDocumentDrag):

        Refactor DragController::tryDocumentDrag to return a DragHandlingMethod. This method currently returns either
        true or false; this patch changes it to return a DragHandlingMethod, which is either None (the equivalent of
        returning false before the patch), Default (indicating that the drop destination is allowing default handling),
        or NonDefault, which indicates that the drop destination has explicitly prevented default.

        * page/DragController.h:
        (WebCore::DragController::documentIsHandlingNonDefaultDrag):

        Used by WebPage when sending an IPC response after handling dragentered or dragupdated.

        * platform/PasteboardStrategy.h:
        * platform/PlatformPasteboard.h:
        * platform/ios/AbstractPasteboard.h:
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::readFilenames):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::filenamesForDataInteraction):
        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:

        WebItemProviderPasteboard now remembers the file URLs of successfully loaded item provider content when a data
        interaction is being performed. The new filenamesForDataInteraction property returns the array of data
        interaction file URLs which have been propagated to the web process along with sandbox extensions. This state
        is cleaned up when list of item providers change (i.e. when the data interaction operation is finished, or if
        the web content process crashes, etc.)

        (-[WebItemProviderPasteboard init]):
        (-[WebItemProviderPasteboard setItemProviders:]):
        (-[WebItemProviderPasteboard filenamesForDataInteraction]):
        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):

2017-04-18  Dean Jackson  <dino@apple.com>

        Cairo build fix.
        https://bugs.webkit.org/show_bug.cgi?id=170941

        * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
        (WebCore::GraphicsContext3D::GraphicsContext3D):

2017-04-18  Ryan Haddad  <ryanhaddad@apple.com>

        Rebaseline bindings tests after r215486.

        Unreviewed test gardening.

        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjOnfooGetter):
        (WebCore::jsTestObjOnwebkitfooGetter):

2017-04-18  Dean Jackson  <dino@apple.com>

        Attempted build fix. Add/remove some files from ANGLE.

        * CMakeLists.txt:

2017-04-18  Dean Jackson  <dino@apple.com>

        Update ANGLE
        https://bugs.webkit.org/show_bug.cgi?id=170941
        <rdar://problem/31633999>

        Reviewed by Alex Christensen.

        * platform/graphics/ANGLEWebKitBridge.cpp:
        (WebCore::getSymbolInfo):
        (WebCore::ANGLEWebKitBridge::ANGLEWebKitBridge):
        (WebCore::ANGLEWebKitBridge::cleanupCompilers):
        (WebCore::ANGLEWebKitBridge::compileShaderSource):
        * platform/graphics/mac/GraphicsContext3DMac.mm:
        (WebCore::GraphicsContext3D::GraphicsContext3D):
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::checkVaryingsPacking):

2017-04-18  John Wilander  <wilander@apple.com>

        Make WebCore::topPrivatelyControlledDomain() return "localhost" for localhost
        https://bugs.webkit.org/show_bug.cgi?id=170798
        <rdar://problem/31595108>

        Reviewed by Alex Christensen.

        API test augmented.

        * platform/mac/PublicSuffixMac.mm:
        (WebCore::topPrivatelyControlledDomain):
            Now returns the lowercase top privately controlled
            domain including "localhost" for the host localhost.

2017-04-18  Brent Fulgham  <bfulgham@apple.com>

        JSEventListener::m_isolatedWorld should be a Ref
        https://bugs.webkit.org/show_bug.cgi?id=170910
        <rdar://problem/30470332>

        Reviewed by Alex Christensen.

        Since m_isolatedWorld should never be nullptr, change the implementation of m_isolatedWorld
        from a RefPtr to a Ref, and adjust the various call sites to support this change.

        This should help us catch any changes that permit the isolatedWorld to be set to nullptr.

        No new tests since there should be no change in behavior.

        * bindings/js/JSEventListener.cpp:
        (WebCore::JSEventListener::JSEventListener):
        (WebCore::JSEventListener::initializeJSFunction):
        (WebCore::JSEventListener::handleEvent):
        * bindings/js/JSEventListener.h:
        (WebCore::JSEventListener::cast):
        (WebCore::JSEventListener::isolatedWorld):
        (WebCore::JSEventListener::jsFunction):

2017-04-18  Brent Fulgham  <bfulgham@apple.com>

        Correct handling of isolatedWorld in event handling
        https://bugs.webkit.org/show_bug.cgi?id=65589
        <rdar://problem/24097804>

        Reviewed by Geoffrey Garen.

        This patch was inspired by Adam's original patch as well as the
        following Blink change:
        https://src.chromium.org/viewvc/blink?revision=152377&view=revision

        Thread isolatedWorld state through event handling logic.

        Tests: fast/dom/event-attrs-isolated-world.html
               http/tests/security/isolatedWorld/onclick-attribute.html

        * bindings/js/JSEventListener.cpp:
        (WebCore::JSEventListener::initializeJSFunction):
        (WebCore::JSEventListener::world):
        (WebCore::eventHandlerAttribute):
        (WebCore::setEventHandlerAttribute):
        (WebCore::windowEventHandlerAttribute):
        (WebCore::setWindowEventHandlerAttribute):
        (WebCore::documentEventHandlerAttribute):
        (WebCore::setDocumentEventHandlerAttribute):
        * bindings/js/JSEventListener.h:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateImplementation):
        * dom/Document.cpp:
        (WebCore::Document::setWindowAttributeEventListener):
        (WebCore::Document::getWindowAttributeEventListener):
        * dom/Document.h:
        * dom/Element.cpp:
        (WebCore::Element::setAttributeEventListener):
        * dom/EventTarget.cpp:
        (WebCore::EventTarget::setAttributeEventListener):
        (WebCore::EventTarget::attributeEventListener):
        * dom/EventTarget.h:
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplacementFragment::ReplacementFragment):
        * html/HTMLBodyElement.cpp:
        (WebCore::HTMLBodyElement::parseAttribute):
        * html/HTMLFrameSetElement.cpp:
        (WebCore::HTMLFrameSetElement::parseAttribute):
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::parseAttribute):

2017-04-18  Jeremy Jones  <jeremyj@apple.com>

        Deadlock in CoreAudioCaptureSource
        https://bugs.webkit.org/show_bug.cgi?id=170771
        rdar://problem/31578919

        Reviewed by Eric Carlson.

        Fixes a regression introduced by r215201.

        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::startProducingData):
        (WebCore::CoreAudioCaptureSource::stopProducingData):

2017-04-18  Anders Carlsson  <andersca@apple.com>

        Stop using deprecated APIs, part 2
        https://bugs.webkit.org/show_bug.cgi?id=170965
        rdar://problem/31589635

        Reviewed by Tim Horton.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::convertAndValidate):
        No need to convert the status anymore.

        (WebCore::ApplePaySession::completeShippingContactSelection):
        Create an ApplePayError given the status.

        * Modules/applepay/ApplePayShippingContactUpdate.h:
        Remove the status member variable.

        * Modules/applepay/PaymentRequest.h:
        Remove the status member variable.

2017-04-18  Tim Horton  <timothy_horton@apple.com>

        Safari crash when clicking phone number data detector popover button
        https://bugs.webkit.org/show_bug.cgi?id=170936
        <rdar://problem/31416570>

        Reviewed by Wenson Hsieh.

        * platform/spi/mac/DataDetectorsSPI.h:
        Soft-link the phone number key from the correct framework.

2017-04-17  Sam Weinig  <sam@webkit.org>

        [WebIDL] Make annotated types first class allowing them to be used in sequences and unions
        https://bugs.webkit.org/show_bug.cgi?id=170926

        Reviewed by Chris Dumez.

        - Adds IDL types for WebIDL annotated types:
            [Clamp] T -> IDLClampAdaptor<T>
            [EnforceRange] T -> IDLEnforceRangeAdaptor<T>
            [TreatNullAs=EmptyString] T -> IDLTreatNullAsEmptyAdaptor<T>
        - Adds additional adaptors for existing specializations
            [AtomicString] T -> IDLAtomicStringAdaptor<T>
            [RequiresExistingAtomicString] T -> IDLRequiresExistingAtomicStringAdaptor<T>
        - Removes the need for IntegerConversionConfiguration and StringConversionConfiguration
          overloads of convert().
        - Allows the use of annotated types as subtypes, such as in sequences and unions.

        * bindings/IDLTypes.h:
        Add new types:
            - IDLClampAdaptor
            - IDLEnforceRangeAdaptor
            - IDLTreatNullAsEmptyAdaptor
            - IDLAtomicStringAdaptor
            - IDLRequiresExistingAtomicStringAdaptor
        Add new predicates for matching strings and strings/enumerations.

        * bindings/js/JSDOMConvertNullable.h:
        Remove now unnecessary overloads of convert that took IntegerConversionConfiguration
        and StringConversionConfiguration.

        * bindings/js/JSDOMConvertNumbers.cpp:
        * bindings/js/JSDOMConvertNumbers.h:
        Replace individually named conversion functions with explicit template specializations
        based on type.
        (WebCore::Converter<IDLByte>::convert):
        (WebCore::Converter<IDLOctet>::convert):
        (WebCore::Converter<IDLShort>::convert):
        (WebCore::Converter<IDLUnsignedShort>::convert):
        (WebCore::Converter<IDLLong>::convert):
        (WebCore::Converter<IDLUnsignedLong>::convert):
        (WebCore::Converter<IDLLongLong>::convert):
        (WebCore::Converter<IDLUnsignedLongLong>::convert):
        Simplify convert functions for normal integer converters to only handle
        the normal case. 

        (WebCore::Converter<IDLClampAdaptor<T>>::convert):
        (WebCore::JSConverter<IDLClampAdaptor<T>>::convert):
        (WebCore::Converter<IDLEnforceRangeAdaptor<T>>::convert):
        (WebCore::JSConverter<IDLEnforceRangeAdaptor<T>>::convert):
        Add converters for the new annotated types that call into the new
        template specialized conversion functions.

        * bindings/js/JSDOMConvertStrings.h:
        (WebCore::Converter<IDLDOMString>::convert):
        (WebCore::Converter<IDLByteString>::convert):
        (WebCore::Converter<IDLUSVString>::convert):
        Remove no longer needed StringConversionConfiguration parameter.

        (WebCore::Converter<IDLTreatNullAsEmptyAdaptor<T>>::convert):
        (WebCore::JSConverter<IDLTreatNullAsEmptyAdaptor<T>>::convert):
        (WebCore::Converter<IDLAtomicStringAdaptor<T>>::convert):
        (WebCore::JSConverter<IDLAtomicStringAdaptor<T>>::convert):
        (WebCore::Converter<IDLRequiresExistingAtomicStringAdaptor<T>>::convert):
        (WebCore::JSConverter<IDLRequiresExistingAtomicStringAdaptor<T>>::convert):
        Add converters for new annotated types. Statically assert that the atomic string
        adaptors only work for DOMString at present.

        * bindings/js/JSDOMConvertUnion.h:
        Update union code to fix a long standing FIXME, treating enumerations as strings
        for the purposes of the union algorithm, and using the new predicate that works
        with the slightly more complicated IDLString type (e.g. it can now either be a String
        or an AtomicString).

        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
        * bindings/js/JSCryptoAlgorithmDictionary.cpp:
        * bindings/js/JSDocumentCustom.cpp:
        * bindings/js/JSEventListener.cpp:
        * bindings/js/JSHTMLCanvasElementCustom.cpp:
        * bindings/js/JSMockContentFilterSettingsCustom.cpp:
        * bindings/js/JSNodeFilterCustom.cpp:
        * bindings/js/JSSubtleCryptoCustom.cpp:
        Remove explicit passing of Normal for the conversion configuration
        and use new adaptors where appropriate.

        * bindings/scripts/CodeGeneratorJS.pm:
        (IsAnnotatedType):
        (GetAnnotatedIDLType):
        (GetIDLType):
        (JSValueToNative):
        (UnsafeToNative):
        (GetIntegerConversionConfiguration): Deleted.
        (GetStringConversionConfiguration): Deleted.
        Replace passing conversion configuration and specializing for atomic string
        with annotated types.

        * bindings/scripts/IDLParser.pm:
        (parseUnionMemberType):
        Fix parser error where we weren't parsing extended attributes for a union correctly.

        * bindings/scripts/test/JS/JSMapLike.cpp:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        Update tests for changes to integer and string conversion.

        * domjit/DOMJITIDLConvert.h:
        * domjit/DOMJITIDLType.h:
        * domjit/DOMJITIDLTypeFilter.h:
        Add specializations for AtomicString related adaptors.

        * testing/TypeConversions.h:
        * testing/TypeConversions.idl:
        - Re-arrange integer attributes to be in size order, and add [Clamp] variants. 
        - Replace function taking a dictionary + attributes to inspect it
          with a dictionary attribute. This has been supported for a while
          and makes the test much clearer (this includes the enum used for
          inspecting the union in the dictionary).
        - Add additional test unions that exercise annotated types as subtypes.
        - Add additional dictionary items that exercise annotated types as subtypes.

2017-04-18  Antti Koivisto  <antti@apple.com>

        Enable optimized layer flushes on iOS
        https://bugs.webkit.org/show_bug.cgi?id=170938
        <rdar://problem/31677395>

        Reviewed by Simon Fraser.

        Test: compositing/ios/overflow-scroll-touch-tiles.html

        * platform/graphics/GraphicsLayer.h:
        (WebCore::GraphicsLayer::setApproximatePosition):

            Make virtual.

        (WebCore::GraphicsLayer::flushCompositingState):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::syncPosition):

            Rename PositionChanged enum value to more descriptive NeedsComputeVisibleAndCoverageRect.

        (WebCore::GraphicsLayerCA::setApproximatePosition):
        (WebCore::GraphicsLayerCA::syncBoundsOrigin):

            Like syncPosition make these invalidate the geometry without scheduling a flush. This is needed
            so when flush happens we don't just optimize it away. Tile coverage depends on position and bounds.

        (WebCore::GraphicsLayerCA::flushCompositingState):

            Remove FlushScope argument.
            Disable optimization on WK1 due to some UIKit interactions.

        * platform/graphics/ca/GraphicsLayerCA.h:
        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
        (WebCore::GraphicsLayerTextureMapper::flushCompositingState):
        * platform/graphics/texmap/GraphicsLayerTextureMapper.h:

2017-04-18  Tim Horton  <timothy_horton@apple.com>

        Try to fix the iOS Debug build

        * platform/LengthBox.h:

2017-04-18  Andreas Kling  <akling@apple.com>

        Break Document::m_associatedFormControls reference cycle.
        <https://webkit.org/b/170946>

        Reviewed by Antti Koivisto.

        There was a race between didAssociateFormControls() and didAssociateFormControlsTimerFired()
        where detaching Document from its frame between the two would lead to an unbreakable reference
        cycle between Document and its form elements.

        Solve this by clearing the set of associated form elements in removedLastRef(), where we clear
        all the other strong smart pointers to elements.

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

2017-04-18  Manuel Rego Casasnovas  <rego@igalia.com>

        [css-grid] Add support for percentage gaps
        https://bugs.webkit.org/show_bug.cgi?id=170764

        Reviewed by Sergio Villar Senin.

        Part of the code to support percentage gaps was already imported
        from Blink in r213149 (bug #168657). However parsing was not enabled yet,
        so some pieces were missing.

        This patch accepts percentages in the parsing of grid-column-gap and
        grid-row-gap properties, and the grid-gap shorthand.
        On top of that it gets rid of GridTrackSizingAlgorithm::sizingOperation()
        method as it's not needed. And instead it passes the specific operation
        to each call to RenderGrid::guttersSize(), otherwise we would be getting
        wrong results.

        Test: fast/css-grid-layout/grid-gutters-as-percentage.html

        * css/parser/CSSPropertyParser.cpp:
        (WebCore::CSSPropertyParser::parseSingleValue): Add support for
        percentage values.
        (WebCore::CSSPropertyParser::parseShorthand): Ditto.
        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
        Pass the specific sizing operation.
        * rendering/GridTrackSizingAlgorithm.h: Remove sizingOperation().
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::computeTrackBasedLogicalHeight): Pass the specific
        sizing operation.
        (WebCore::RenderGrid::computeTrackSizesForDefiniteSize): Ditto.
        (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize): Ditto.
        (WebCore::RenderGrid::populateGridPositionsForDirection): Ditto.

2017-04-18  Per Arne Vollan  <pvollan@apple.com>

        Add fallback fonts to video captions stylesheet.
        https://bugs.webkit.org/show_bug.cgi?id=170495

        Reviewed by Eric Carlson.

        The kCTFontCascadeListAttribute key is used to obtain the cascade list for a font reference.

        I have not added a test, since CaptionUserPreferences::testingMode() returns true when running tests,
        preventing this code path from being executed.

        * page/CaptionUserPreferencesMediaAF.cpp:
        (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
        * platform/spi/win/CoreTextSPIWin.h:

2017-04-18  Miguel Gomez  <magomez@igalia.com>

        [GTK+] Crash in WebCore::ImageFrame::ImageFrame()
        https://bugs.webkit.org/show_bug.cgi?id=170332

        Reviewed by Carlos Garcia Campos.

        When decoding a PNG image, don't reset the number of frames to 1 when there's a decoding error. Doing
        so causes a crash if the number of frames we reported before is bigger than 1.

        Test: fast/images/bad-png-missing-fdat.html

        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::fallbackNotAnimated):

2017-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GLIB] Define priorities also for async network IO tasks
        https://bugs.webkit.org/show_bug.cgi?id=170905

        Reviewed by Žan Doberšek.

        * platform/network/soup/ResourceHandleSoup.cpp:
        (WebCore::redirectSkipCallback):
        (WebCore::sendRequestCallback):
        (WebCore::continueAfterDidReceiveResponse):
        (WebCore::readCallback):
        * platform/network/soup/SocketStreamHandleImplSoup.cpp:
        (WebCore::SocketStreamHandleImpl::connected):
        (WebCore::SocketStreamHandleImpl::readBytes):

2017-04-17  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed build fix for !ENABLE(MEDIA_STREAM) configurations.

        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::playbackPermitted): Guard the use of
        HTMLMediaElement::hasMediaStreamSrcObject() with ENABLE(MEDIA_STREAM).

2017-04-17  Alex Christensen  <achristensen@webkit.org>

        Allow Variants of RetainPtrs
        https://bugs.webkit.org/show_bug.cgi?id=170923

        Reviewed by Tim Horton and Sam Weinig.

        No change in behavior.  Just updated the one class that used RetainPtr::operator& to cleanly initialize
        RetainPtrs instead of taking the address of a smart pointer and forcing a value inside of it.

        * platform/mac/SSLKeyGeneratorMac.mm:
        (WebCore::signedPublicKeyAndChallengeString):

2017-04-17  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] 'WebCore::GraphicsLayerTextureMapper::flushCompositingStated': method with override specifier 'override' did not override any base class methods
        https://bugs.webkit.org/show_bug.cgi?id=170928

        Reviewed by Simon Fraser.

        Apply the same change of CoordinatedGraphicsLayer.{cpp,h} of r215410 to GraphicsLayerTextureMapper.{cpp,h}.

        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
        (WebCore::GraphicsLayerTextureMapper::flushCompositingState): Added the second argument.
        * platform/graphics/texmap/GraphicsLayerTextureMapper.h: Ditto.

2017-04-17  Timothy Horton  <timothy_horton@apple.com>

        Plumb all four obscured insets to WebCore, instead of just top/left
        https://bugs.webkit.org/show_bug.cgi?id=170913

        Reviewed by Wenson Hsieh.

        No new tests, no observable behavior change yet.

        In preparation for a future patch (for rdar://problem/31564652), plumb
        all four obscured insets to WebCore/the Web Content process, instead of
        just the top and left insets.

        * history/HistoryItem.cpp:
        (WebCore::HistoryItem::HistoryItem):
        * history/HistoryItem.h:
        (WebCore::HistoryItem::obscuredInsets):
        (WebCore::HistoryItem::setObscuredInsets):
        (WebCore::HistoryItem::obscuredInset): Deleted.
        (WebCore::HistoryItem::setObscuredInset): Deleted.
        * loader/HistoryController.cpp:
        (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
        * page/Page.h:
        (WebCore::Page::obscuredInsets):
        (WebCore::Page::setObscuredInsets):
        (WebCore::Page::obscuredInset): Deleted.
        (WebCore::Page::setObscuredInset): Deleted.
        Adopt FloatBoxExtent for obscuredInsets (and adjust pluralization).

2017-04-17  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Doesn't show size of compressed content correctly
        https://bugs.webkit.org/show_bug.cgi?id=155112
        <rdar://problem/25006728>

        Reviewed by Alex Christensen and Timothy Hatcher.

        Tests: http/tests/inspector/network/resource-sizes-disk-cache.html
               http/tests/inspector/network/resource-sizes-memory-cache.html
               http/tests/inspector/network/resource-sizes-network.html

        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::buildObjectForMetrics):
        * platform/network/NetworkLoadMetrics.h:
        (WebCore::NetworkLoadMetrics::isolatedCopy):
        (WebCore::NetworkLoadMetrics::reset):
        (WebCore::NetworkLoadMetrics::clearNonTimingData):
        (WebCore::NetworkLoadMetrics::operator==):
        (WebCore::NetworkLoadMetrics::encode):
        (WebCore::NetworkLoadMetrics::decode):
        * platform/spi/cf/CFNetworkSPI.h:

2017-04-17  Youenn Fablet  <youenn@apple.com>

        Enable video autoplay when getUserMedia is on
        https://bugs.webkit.org/show_bug.cgi?id=170919

        Reviewed by Geoffrey Garen.

        Test: webrtc/video-autoplay.html

        * dom/Document.h:
        (WebCore::Document::isCapturing):
        * html/HTMLMediaElement.h:
        (WebCore::HTMLMediaElement::hasMediaStreamSrcObject):
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::playbackPermitted): Allowing playback if getUserMedia is capturing audio or video
        on the document and if element is rendering MediaStream based content.
        * page/MediaProducer.h:
        (WebCore::MediaProducer::isCapturing):

2017-04-17  Alex Christensen  <achristensen@webkit.org>

        Fix CMake build.

        * PlatformMac.cmake:

2017-04-17  Anders Carlsson  <andersca@apple.com>

        Stop using deprecated APIs, part 1
        https://bugs.webkit.org/show_bug.cgi?id=170915
        rdar://problem/31589635

        Reviewed by Tim Horton.

        Get rid of the status parameter from ApplePayPaymentMethodUpdate.

        * Modules/applepay/ApplePayPaymentMethodUpdate.h:
        * Modules/applepay/ApplePayPaymentMethodUpdate.idl:
        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::convertAndValidate):
        (WebCore::ApplePaySession::completePaymentMethodSelection):
        * Modules/applepay/PaymentRequest.h:

2017-04-17  Youenn Fablet  <youenn@apple.com>

        Disable outdated WritableStream API
        https://bugs.webkit.org/show_bug.cgi?id=170749
        <rdar://problem/31446233>

        Reviewed by Alex Christensen.

        No change of behavior.
        Replacing READABLE_STREAM_API, READABLE_BYTE_STREAM_API and WRITABLE_STREAM_API compilation flag by:
        - A STREAMS_API compilation flag.
        - A ReadableByteStreamAPI and WritableStreamAPI runtime flags, turned off except for RWT and DRT.

        * Configurations/FeatureDefines.xcconfig:
        * Modules/fetch/FetchBody.cpp:
        * Modules/fetch/FetchBody.h:
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::isDisturbedOrLocked):
        (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/FetchResponseSource.cpp:
        * Modules/fetch/FetchResponseSource.h:
        * Modules/streams/ByteLengthQueuingStrategy.idl:
        * Modules/streams/ByteLengthQueuingStrategy.js:
        * Modules/streams/CountQueuingStrategy.idl:
        * Modules/streams/CountQueuingStrategy.js:
        * Modules/streams/ReadableByteStreamController.idl:
        * Modules/streams/ReadableByteStreamController.js:
        * Modules/streams/ReadableByteStreamInternals.js:
        * Modules/streams/ReadableStream.idl:
        * Modules/streams/ReadableStream.js:
        (initializeReadableStream): Using readableByteStreamAPI runtime flag directly.
        * Modules/streams/ReadableStreamBYOBRequest.idl:
        * Modules/streams/ReadableStreamBYOBRequest.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::isReadableByteStreamAPIEnabled):
        (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
        * bindings/js/JSReadableStreamPrivateConstructors.cpp:
        (WebCore::constructJSReadableStreamBYOBRequest):
        (WebCore::JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable):
        (WebCore::createReadableStreamBYOBRequestPrivateConstructor):
        * bindings/js/JSReadableStreamPrivateConstructors.h:
        * bindings/js/JSReadableStreamSourceCustom.cpp:
        * bindings/js/ReadableStreamDefaultController.cpp:
        * bindings/js/ReadableStreamDefaultController.h:
        * bindings/js/WebCoreBuiltinNames.h:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setReadableByteStreamAPIEnabled):
        (WebCore::RuntimeEnabledFeatures::readableByteStreamAPIEnabled):
        (WebCore::RuntimeEnabledFeatures::setWritableStreamAPIEnabled):
        (WebCore::RuntimeEnabledFeatures::writableStreamAPIEnabled):
        * testing/Internals.cpp:
        * testing/Internals.h:
        * testing/Internals.idl:

2017-04-17  Tim Horton  <timothy_horton@apple.com>

        Provide a viewport parameter to disable clipping to the safe area
        https://bugs.webkit.org/show_bug.cgi?id=170766
        <rdar://problem/31564634>

        Reviewed by Beth Dakin.

        Tests: tiled-drawing/ios/viewport-clip-to-safe-area-no-gets-margin-tiles.html,
               tiled-drawing/ios/viewport-clip-to-safe-area-yes-gets-no-margin-tiles.html,

        * dom/ViewportArguments.cpp:
        (WebCore::ViewportArguments::resolve):
        (WebCore::setViewportFeature):
        * dom/ViewportArguments.h:
        (WebCore::ViewportArguments::operator==):
        * page/ViewportConfiguration.cpp:
        (WebCore::ViewportConfiguration::updateConfiguration):
        (WebCore::operator<<):
        (WebCore::ViewportConfiguration::description):
        * page/ViewportConfiguration.h:
        (WebCore::ViewportConfiguration::Parameters::Parameters):
        (WebCore::ViewportConfiguration::clipToSafeArea):
        Add viewport parameter.

        * page/ChromeClient.h:
        * page/FrameView.h:
        * page/FrameView.cpp:
        (WebCore::FrameView::enableSpeculativeTilingIfNeeded):
        If not clipping to the safe area, enable "speculative" tiling immediately,
        because the margin tiles can be visible immediately.

        (WebCore::FrameView::hasExtendedBackgroundRectForPainting):
        (WebCore::FrameView::updateTilesForExtendedBackgroundMode):
        Don't check the setting here; just respect the mode that is computed
        by calculateExtendedBackgroundMode.

        (WebCore::FrameView::calculateExtendedBackgroundMode):
        If the viewport parameter was set, add margin tiles on both axes.

        (WebCore::FrameView::setClipToSafeArea):
        Notify ChromeClient of the change, and re-compute the margin tile mode.

        * rendering/RenderLayerCompositor.h:
        * rendering/RenderLayerCompositor.cpp:
        Factor out code that decides whether the content layer clips to bounds,
        and make it take the new viewport parameter into account.

        * rendering/RenderObject.cpp:
        Don't clip RenderView repaints to RenderView's GraphicsLayer bounds if
        clip-to-safe-area is off, just like we do for slow-repaint objects in
        extended background mode.

2017-04-17  Dan Bernstein  <mitz@apple.com>

        [Cocoa] Move isNullFunctionPointer down into WTF
        https://bugs.webkit.org/show_bug.cgi?id=170892

        Reviewed by Sam Weinig.

        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::LibWebRTCProvider::webRTCAvailable): Changed to use WTF::isNullFunctionPointer,
          and removed the static variable, so instead of loading from the initialization guard,
          branching, then loading from the variable itself, we just load from the function pointer.
        (WebCore::isNullFunctionPointer): Deleted.

2017-04-14  Jiewen Tan  <jiewen_tan@apple.com>

        [WebCrypto] Add support for ECDSA
        https://bugs.webkit.org/show_bug.cgi?id=170789
        <rdar://problem/31588604>

        Reviewed by Brent Fulgham.

        This patch implements ECDSA according to the spec: https://www.w3.org/TR/WebCryptoAPI/#ecdsa.
        Supported operations include sign, verify, generateKey, importKey and exportKey.

        Tests: crypto/subtle/ecdh-generate-export-key-pkcs8-p256.html
               crypto/subtle/ecdh-generate-export-key-pkcs8-p384.html
               crypto/subtle/ecdsa-generate-export-jwk-key.html
               crypto/subtle/ecdsa-generate-export-key-pkcs8.html
               crypto/subtle/ecdsa-generate-export-key-raw.html
               crypto/subtle/ecdsa-generate-export-key-spki.html
               crypto/subtle/ecdsa-generate-key-sign-verify-p256.html
               crypto/subtle/ecdsa-generate-key-sign-verify-p384.html
               crypto/subtle/ecdsa-generate-key.html
               crypto/subtle/ecdsa-import-jwk-private-key.html
               crypto/subtle/ecdsa-import-jwk-public-key-alg-256.html
               crypto/subtle/ecdsa-import-jwk-public-key-alg-384.html
               crypto/subtle/ecdsa-import-jwk-public-key.html
               crypto/subtle/ecdsa-import-key-sign-p256.html
               crypto/subtle/ecdsa-import-key-sign-p384.html
               crypto/subtle/ecdsa-import-key-verify-p256.html
               crypto/subtle/ecdsa-import-key-verify-p384.html
               crypto/subtle/ecdsa-import-pkcs8-key.html
               crypto/subtle/ecdsa-import-raw-key.html
               crypto/subtle/ecdsa-import-spki-key.html
               crypto/subtle/ecdsa-verify-malformed-parameters.html
               crypto/workers/subtle/ecdsa-import-key-sign.html
               crypto/workers/subtle/ecdsa-import-key-verify.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * PlatformGTK.cmake:
        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSSubtleCryptoCustom.cpp:
        (WebCore::normalizeCryptoAlgorithmParameters):
        (WebCore::jsSubtleCryptoFunctionSignPromise):
        (WebCore::jsSubtleCryptoFunctionVerifyPromise):
        Add missing parameters.
        * crypto/CommonCryptoUtilities.h:
        * crypto/CryptoAlgorithm.cpp:
        (WebCore::CryptoAlgorithm::sign):
        (WebCore::CryptoAlgorithm::verify):
        * crypto/CryptoAlgorithm.h:
        Add missing parameters.
        * crypto/CryptoAlgorithmParameters.h:
        * crypto/algorithms/CryptoAlgorithmECDSA.cpp: Added.
        (WebCore::CryptoAlgorithmECDSA::create):
        (WebCore::CryptoAlgorithmECDSA::identifier):
        (WebCore::CryptoAlgorithmECDSA::sign):
        (WebCore::CryptoAlgorithmECDSA::verify):
        (WebCore::CryptoAlgorithmECDSA::generateKey):
        (WebCore::CryptoAlgorithmECDSA::importKey):
        (WebCore::CryptoAlgorithmECDSA::exportKey):
        * crypto/algorithms/CryptoAlgorithmECDSA.h: Added.
        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
        (WebCore::CryptoAlgorithmHMAC::sign):
        (WebCore::CryptoAlgorithmHMAC::verify):
        * crypto/algorithms/CryptoAlgorithmHMAC.h:
        Add missing parameters.
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
        * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
        Add missing parameters.
        * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp: Added.
        (WebCore::CryptoAlgorithmECDSA::platformSign):
        (WebCore::CryptoAlgorithmECDSA::platformVerify):
        * crypto/mac/CommonCryptoDERUtilities.cpp: Added.
        (WebCore::bytesUsedToEncodedLength):
        (WebCore::extraBytesNeededForEncodedLength):
        (WebCore::addEncodedASN1Length):
        (WebCore::bytesNeededForEncodedLength):
        * crypto/mac/CommonCryptoDERUtilities.h:
        (WebCore::bytesUsedToEncodedLength): Deleted.
        (WebCore::extraBytesNeededForEncodedLength): Deleted.
        (WebCore::addEncodedASN1Length): Deleted.
        (WebCore::bytesNeededForEncodedLength): Deleted.
        Move implementations to a .cpp file.
        * crypto/mac/CryptoAlgorithmECDSAMac.cpp: Added.
        (WebCore::cryptoDigestAlgorithm):
        (WebCore::signECDSA):
        (WebCore::verifyECDSA):
        (WebCore::CryptoAlgorithmECDSA::platformSign):
        (WebCore::CryptoAlgorithmECDSA::platformVerify):
        * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
        (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
        * crypto/parameters/CryptoAlgorithmEcdsaParams.h: Added.
        * crypto/parameters/EcdsaParams.idl: Added.

2017-04-17  Jeremy Jones  <jeremyj@apple.com>

        Refactor enumerateDevices to allow separate CaptureDeviceManagers for audio and video.
        https://bugs.webkit.org/show_bug.cgi?id=170778

        Reviewed by Eric Carlson.

        Add CoreAudioCaptureDeviceManager to enumerate CoreAudio devices.

        Refactor RealtimeMediaSourceCenter and RealtimeMediaSourceCenterMac to provide independent audio and video capture device managers
        and the abiliity to override the capture device managers.

        CoreAudioCaptureSource now uses CoreAudioCaptureDeviceManager to use the specified device instead of the default one. 

        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/CaptureDeviceManager.cpp:
        (CaptureDeviceManager::getAudioSourcesInfo):
        (CaptureDeviceManager::getVideoSourcesInfo):
        (CaptureDeviceManager::getSourcesInfo): Deleted.
        * platform/mediastream/CaptureDeviceManager.h:
        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::setAudioCaptureDeviceManager):
        (WebCore::RealtimeMediaSourceCenter::unsetAudioCaptureDeviceManager):
        (WebCore::RealtimeMediaSourceCenter::setVideoCaptureDeviceManager):
        (WebCore::RealtimeMediaSourceCenter::unsetVideoCaptureDeviceManager):
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureDeviceManager):
        (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureDeviceManager):
        (WebCore::RealtimeMediaSourceCenter::audioCaptureDeviceManager):
        (WebCore::RealtimeMediaSourceCenter::videoCaptureDeviceManager):
        * platform/mediastream/mac/AVCaptureDeviceManager.h:
        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
        (WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType):
        (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
        (WebCore::AVCaptureDeviceManager::getAudioSourcesInfo):
        (WebCore::AVCaptureDeviceManager::getVideoSourcesInfo):
        (WebCore::AVCaptureDeviceManager::setUseAVFoundationAudioCapture): Deleted.
        (WebCore::AVCaptureDeviceManager::getSourcesInfo): Deleted.
        * platform/mediastream/mac/CoreAudioCaptureDevice.cpp: Added.
        (WebCore::getDeviceInfo):
        (WebCore::CoreAudioCaptureDevice::create):
        (WebCore::CoreAudioCaptureDevice::CoreAudioCaptureDevice):
        (WebCore::CoreAudioCaptureDevice::deviceID):
        (WebCore::CoreAudioCaptureDevice::deviceClock):
        (WebCore::CoreAudioCaptureDevice::isAlive):
        * platform/mediastream/mac/CoreAudioCaptureDevice.h: Copied from Source/WebCore/platform/mediastream/CaptureDeviceManager.h.
        * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: Added.
        (WebCore::CoreAudioCaptureDeviceManager::singleton):
        (WebCore::CoreAudioCaptureDeviceManager::captureDevices):
        (WebCore::deviceHasInputStreams):
        (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
        (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
        (WebCore::CoreAudioCaptureDeviceManager::devicesChanged):
        * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h: Copied from Source/WebCore/platform/mediastream/CaptureDeviceManager.h.
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
        (WebCore::CoreAudioCaptureSource::startProducingData):
        (WebCore::CoreAudioCaptureSource::stopProducingData):
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::setUseAVFoundationAudioCapture):
        (WebCore::RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac):
        (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
        (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamDevices):
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:

2017-04-17  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r215366.

        This test is failing on performance bots.

        Reverted changeset:

        "Add performance test for asking the platform for a font for
        U+2060 WORD JOINER"
        https://bugs.webkit.org/show_bug.cgi?id=170842
        http://trac.webkit.org/changeset/215366

2017-04-17  Youenn Fablet  <youenn@apple.com>

        RTCPeerConnection addTrack does not require a stream parameter
        https://bugs.webkit.org/show_bug.cgi?id=170894

        Reviewed by Alex Christensen.

        Test: webrtc/video-addTrack.html

        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::addTrack): Removing obsolete error throwing.

2017-04-17  Youenn Fablet  <youenn@apple.com>

        Add an external libwebrtc encoder factory in WebCore
        https://bugs.webkit.org/show_bug.cgi?id=170883

        Reviewed by Alex Christensen.

        No change of behavior, WebCore factory instantiating the default libwebrtc H264 encoder.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::staticFactoryAndThreads):
        * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp: Added.
        (WebCore::VideoToolboxVideoEncoderFactory::CreateVideoEncoder):
        (WebCore::VideoToolboxVideoEncoderFactory::DestroyVideoEncoder):
        * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.h: Added.

2017-04-17  Antti Koivisto  <antti@apple.com>

        GraphicsLayerCA::recursiveCommitChanges should not descend into subtrees without changes
        https://bugs.webkit.org/show_bug.cgi?id=170851

        Reviewed by Simon Fraser.

        With lots of layers this can be very slow as it always traverses the entire layer tree.
        For example GIF animations on tumblr.com trigger expensive commits where almost nothing changes.

        This patch adds m_hasDescendantsWithUncommittedChanges bit to GraphicsLayerCA. With this
        we can avoid descending to branches without changes when committing.

        This patch enabled the optimization on Mac.

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

            Set PositionChanged flag when syncing layer position. This flag does nothing except makes
            next commit to update the coverage rect (so tiling gets updated).

        (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):

            Do all setting of m_uncommittedChanges bits via addUncommittedChanges function.

        (WebCore::GraphicsLayerCA::recursiveCommitChanges):

            Bail out if neither the current layer nor any of its descendants have any uncommited changes
            and none of the ancestors had changes.

        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
        (WebCore::GraphicsLayerCA::ensureStructuralLayer):
        (WebCore::GraphicsLayerCA::changeLayerTypeTo):
        (WebCore::GraphicsLayerCA::addUncommittedChanges):

            Set m_hasDescendantsWithUncommittedChanges bit in ancestors when mutating m_uncommittedChanges.

        (WebCore::GraphicsLayerCA::noteLayerPropertyChanged):
        * platform/graphics/ca/GraphicsLayerCA.h:
        (WebCore::RenderLayerCompositor::frameViewDidScroll):

            Tell the scrolling layer that it needs to recompute coverage.
            This also schedules a layer flush so no need to do that separately.

2017-04-16  Chris Dumez  <cdumez@apple.com>

        CMD+R / CMD+Q is considered as user interaction and beforeunload alert is shown
        https://bugs.webkit.org/show_bug.cgi?id=169995
        <rdar://problem/23798897>

        Reviewed by Sam Weinig.

        Any key event was considered as user interaction with the page, which meant that they
        would allow beforeunload alerts to be shown even when they do not represent actual
        user interaction (e.g CMD+R / CMD+Q / CMD+T keyboard shortcuts).

        To address the issue, we now only treat as user interaction with the page key events
        that are actually handled by the page (i.e. handled by JS, typed into a field, ...).

        Tests: fast/events/beforeunload-alert-handled-keydown.html
               fast/events/beforeunload-alert-unhandled-keydown.html

        * dom/Document.h:
        (WebCore::Document::setUserDidInteractWithPage):
        (WebCore::Document::userDidInteractWithPage):
        * dom/UserGestureIndicator.cpp:
        (WebCore::UserGestureIndicator::UserGestureIndicator):
        * loader/FrameLoader.cpp:
        (WebCore::shouldAskForNavigationConfirmation):
        * page/EventHandler.cpp:
        (WebCore::EventHandler::keyEvent):
        (WebCore::EventHandler::internalKeyEvent):
        * page/EventHandler.h:

2017-04-16  Sam Weinig  <sam@webkit.org>

        [WebIDL] Switch IDLAttributes.txt over to a more structured format so that more information can be added for each attribute
        https://bugs.webkit.org/show_bug.cgi?id=170843

        Reviewed by Chris Dumez.

        - Converts IDLAttributes.txt to IDLAttributes.json, and adds additional
          information for each attribute about what contexts they are valid in 
          which is checked by the parser.
        - Removes CustomSetPrototype which was unused, and Immutable which did 
          nothing. 

        * DerivedSources.make:
        Update extension of IDLAttributes to .json

        * WebCore.xcodeproj/project.pbxproj:
        Update project file for new file name and add some missing IDL files.

        * bindings/scripts/CodeGenerator.pm:
        Store the processed IDLAttributes in the code generator, so it can
        be used for any additional Parser instantiations.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        Remove support for CustomSetPrototype. Nobody is using it.

        * bindings/scripts/IDLAttributes.json: Copied from Source/WebCore/bindings/scripts/IDLAttributes.txt.
        * bindings/scripts/IDLAttributes.txt: Removed.
        Rename IDLAttributes.txt -> IDLAttributes.json and move the data
        into a more structured format. For now each extended attribute can
        have the following fields:
            Required:
                'contextsAllowed' -> Non-empty array of strings from the contexts array.

            Optional:
                'values' -> Non-empty array of strings allowed after the equal (=) sign in 
                   the extended attribute. Like before, an empty string indicates it is 
                   ok to not have a value and a star (*) indicates any string is allowed.
                   Not providing a values property at all indicates that no value is
                   allowed.

                'standard' -> An object with information about the standard this attribute
                   comes from. Should only be added to attributes that come from standards.

                'unsupported' -> A boolean with value true, indicating this property is not
                   yet supported. Should only be used for standard attributes.

                'notes' -> A string with notes explaining something about this attribute.
        
        * bindings/scripts/IDLParser.pm:
        Pass and store the processed extended attribute map to the parser, and use it
        validate that extended attributes being added to things are appropriate for the
        context. Fix FIXME in isExtendedAttributeApplicableToTypes by using the map to 
        implement the predicate, rather than hard coding the list.

        * bindings/scripts/generate-bindings.pl:
        (generateEmptyHeaderAndCpp):
        (loadIDLAttributes): Deleted.
        (checkIDLAttributes): Deleted.
        (checkIfIDLAttributesExists): Deleted.
        Make specifying an IDL attributes file required. Switch to processing it
        as a JSON file, and having the parser validate attributes.

        * bindings/scripts/test/JS/JSTestObj.cpp:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        * bindings/scripts/test/TestImplements.idl:
        * bindings/scripts/test/TestObj.idl:
        * bindings/scripts/test/TestSupplemental.idl:
        * bindings/scripts/test/TestTypedefs.idl:
        - Remove use of Immutable extended attribute in the tests, as it does nothing.
        - Remove use of the made up ReadOnly attribute, as the tests now use the IDLAttributes
          file to validate that the attributes are supported, so this would otherwise fail.

        * css/WebKitCSSMatrix.idl:
        * svg/SVGZoomEvent.idl:
        - Remove use of the Immutable extended attribute, as it does nothing.

        * page/NavigatorID.idl:
        * page/NavigatorLanguage.idl:
        - Remove use of the Nondeterministic extended attribute, as it does nothing.

        * Modules/mediasource/SourceBufferList.idl:
        Remove use of CallWith on the interface. It is illegal, and does nothing.

        * animation/KeyframeEffect.idl:
        * animation/WebAnimation.idl:
        Remove use of [Default=Undefined]. This construct does nothing and now
        correctly fails to parse. 

2017-04-15  Alex Christensen  <achristensen@webkit.org>

        Fix Windows build after r215396.
        https://bugs.webkit.org/show_bug.cgi?id=170828

        * platform/graphics/win/FontPlatformDataWin.cpp:
        (WebCore::FontPlatformData::openTypeTable):

2017-04-15  Alex Christensen  <achristensen@webkit.org>

        Remove unused SharedBuffer constructor
        https://bugs.webkit.org/show_bug.cgi?id=170828

        Reviewed by Brady Eidson.

        * platform/SharedBuffer.cpp:
        (WebCore::SharedBuffer::append):
        * platform/SharedBuffer.h:
        (WebCore::SharedBuffer::create):
        * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
        (WebCore::FontPlatformData::openTypeTable):
        * platform/graphics/win/FontPlatformDataWin.cpp:
        (WebCore::FontPlatformData::openTypeTable):

2017-04-15  Commit Queue  <commit-queue@webkit.org>

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

        breaks scrollable iframes on ios (Requested by anttik on
        #webkit).

        Reverted changeset:

        "GraphicsLayerCA::recursiveCommitChanges should not descend
        into subtrees without changes"
        https://bugs.webkit.org/show_bug.cgi?id=170851
        http://trac.webkit.org/changeset/215393

2017-04-14  Antti Koivisto  <antti@apple.com>

        GraphicsLayerCA::recursiveCommitChanges should not descend into subtrees without changes
        https://bugs.webkit.org/show_bug.cgi?id=170851

        Reviewed by Simon Fraser.

        With lots of layers this can be very slow as it always traverses the entire layer tree.
        For example GIF animations on tumblr.com trigger expensive commits where almost nothing changes.

        This patch adds m_hasDescendantsWithUncommittedChanges bit to GraphicsLayerCA. With this
        we can avoid descending to branches without changes when committing.

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

            Do all setting of m_uncommittedChanges bits via addUncommittedChanges function.

        (WebCore::GraphicsLayerCA::recursiveCommitChanges):

            Bail out if neither the current layer nor any of its descendants have any uncommited changes
            and none of the ancestors had changes.

        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
        (WebCore::GraphicsLayerCA::ensureStructuralLayer):
        (WebCore::GraphicsLayerCA::changeLayerTypeTo):
        (WebCore::GraphicsLayerCA::addUncommittedChanges):

            Set m_hasDescendantsWithUncommittedChanges bit in ancestors when mutating m_uncommittedChanges.

        (WebCore::GraphicsLayerCA::noteLayerPropertyChanged):
        * platform/graphics/ca/GraphicsLayerCA.h:
        (WebCore::RenderLayerCompositor::frameViewDidScroll):

            Tell the scrolling layer that it needs to recompute coverage.
            This also schedules a layer flush so no need to do that separately.

2017-04-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WK2] Support data interaction of files into file inputs
        https://bugs.webkit.org/show_bug.cgi?id=170803
        <rdar://problem/31286130>

        Reviewed by Tim Horton.

        Adds remaining support to allow data interaction of files onto inputs of type file. See per-change annotations
        for more details. Unit tests to be added in the next patch.

        * platform/PasteboardStrategy.h:
        * platform/PlatformPasteboard.h:
        * platform/ios/AbstractPasteboard.h:
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::numberOfFiles):
        * platform/ios/WebItemProviderPasteboard.mm:

        Implements numberOfFiles by counting the number of item providers that may be represented as a file, which
        includes all item providers that contain at least one content UTI type.

        (-[WebItemProviderPasteboard numberOfFiles]):

        Adds boilerplate plumbing to fetch the number of files available on the pasteboard. On Mac, logic that
        previously existed in DragData::numberOfFiles to query the number of files available in the pasteboard is now
        on PlatformPasteboard instead, which both makes the implementation of DragData::numberOfFiles platform-invariant,
        and also saves us one synchronous IPC call to the UI process in the WebKit2 implementation.

        * platform/mac/DragDataMac.mm:
        (WebCore::DragData::containsFiles):
        (WebCore::DragData::numberOfFiles):
        (WebCore::DragData::asFilenames):

        Add support for recognizing objects in the pasteboard that may be represented by files, and therefore may be
        uploaded via file input. Following suit with behavior elsewhere on the platform, we consider item providers able
        to be represented by a file if they contain at least one content UTI type.

        * platform/mac/PlatformPasteboardMac.mm:

        Logic previously in DragData::numberOfFiles to get and then count all file path names in the pasteboard has been
        moved here instead, and no longer needs to go through the pasteboard proxy.

        (WebCore::PlatformPasteboard::numberOfFiles):

2017-04-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the build after r215389

        Use WebCore::createTemporaryDirectory instead of -_webkit_createTemporaryDirectoryWithTemplatePrefix:.

        * platform/ios/WebItemProviderPasteboard.mm:
        (temporaryFileURLForDataInteractionContent):

2017-04-14  Wenson Hsieh  <wenson_hsieh@apple.com>

        Implement a way in WebItemProviderPasteboard to perform actions after file loading completes
        https://bugs.webkit.org/show_bug.cgi?id=170839
        <rdar://problem/31286130>

        Reviewed by Tim Horton, Andy Estes, and Dan Bernstein.

        Introduces -[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:], which performs an action
        after all item providers which are able to provide content are done loading their content into temporary file
        URLs. If no item providers have available data, we will immediately invoke the action with an empty URL array.

        For each item provider with data, we save the local URL returned in the load completion block to a randomly
        generated path in the container's temporary directory. When all files are finished loading, we then invoke the
        action with all file URLs that successfully loaded.

        No new tests, since there is no change in behavior.

        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:
        (temporaryFileURLForDataInteractionContent):
        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):

2017-04-14  Nikita Vasilyev  <nvasilyev@apple.com>

        Web Inspector: WebSockets: messages with non-latin letters are displayed incorrectly
        https://bugs.webkit.org/show_bug.cgi?id=170760

        Reviewed by Joseph Pecoraro.

        Add payloadLength property, which is used to display size. When payloadLength is unavailable,
        it is calculated from payloadData by Web Inspector frontend.

        This fixes <webkit.org/b/170609> Web Inspector: WebSockets: Transferred size is incorrect.

        Tests: http/tests/websocket/tests/hybi/inspector/binary.html
               http/tests/websocket/tests/hybi/inspector/send-and-receive.html

        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::didReceiveWebSocketFrame):
        (WebCore::InspectorNetworkAgent::didSendWebSocketFrame):

2017-04-14  Mark Lam  <mark.lam@apple.com>

        Update architectures in xcconfig files.
        https://bugs.webkit.org/show_bug.cgi?id=170867
        <rdar://problem/31628104>

        Reviewed by Joseph Pecoraro.

        No new tests needed.  Only updating xcconfig files.

        * Configurations/Base.xcconfig:
        * Configurations/FeatureDefines.xcconfig:

2017-04-14  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WK2] Support Icon creation from file URLs on iOS
        https://bugs.webkit.org/show_bug.cgi?id=170809
        <rdar://problem/31286130>

        Reviewed by Tim Horton.

        Minor tweaks and refactoring to support displaying a WebCore::Icon from a list of filepaths on iOS. Please see
        below annotations for more details. No new tests yet, as behavior on Mac should not have changed, and behavior
        on iOS will not change until later patches land. Tests will be added in a later patch.

        Most of the changes here remove platform special-casing in FileInputType for iOS and Mac, refactoring the code
        such that it works for both platforms while preserving behavior.

        * html/FileInputType.cpp:
        (WebCore::FileInputType::~FileInputType):
        (WebCore::FileInputType::setFiles):
        (WebCore::FileInputType::filesChosen):
        * html/FileInputType.h:

        Un-guard m_fileIconLoader on iOS, and un-guard m_displayString for Mac. Consolidate logic in both version of
        filesChosen and remove the iOS-specific version. Behavior when passing in an empty display string and null Icon
        will be the same as that of the existing filesChosen method on Mac. Also, introduce a version of setFiles that
        takes an additional RequestIcon enum that indicates whether or not to additionally use the new filepaths to
        request an Icon update. filesChosen invokes this with RequestIcon::No if a non-null Icon was specified, as is
        the case when uploading a file via the image picker on iOS.

        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::displayString):
        * html/HTMLInputElement.h:
        * html/InputType.cpp:
        * html/InputType.h:
        * loader/EmptyClients.h:
        * page/ChromeClient.h:

        Introduce ChromeClient::createIconForFiles, which generates an icon representing the content at a list of file
        paths. See WebKit and WebKit2 ChangeLogs for more details.

        * platform/FileChooser.h:
        (WebCore::FileChooserClient::filesChosen):
        * rendering/RenderFileUploadControl.cpp:
        (WebCore::RenderFileUploadControl::fileTextValue):

        Remove platform special-casing when generating the text to display when uploading a file. If a displayString
        is specified, then we use the contents of the displayString; otherwise, fall back to using the input element's
        FileList to compute the display string.

2017-04-14  Brady Eidson  <beidson@apple.com>

        Fix basic WKURLSchemeHandler bugs.
        <rdar://problem/30647559> and https://bugs.webkit.org/show_bug.cgi?id=170862

        Reviewed by Andy Estes.

        Covered by new API tests.

        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::didReceiveDataOrBuffer):

2017-04-14  Jiewen Tan  <jiewen_tan@apple.com>

        [WebCrypto] Support HKDF
        https://bugs.webkit.org/show_bug.cgi?id=170636
        <rdar://problem/23539827>

        Reviewed by Brent Fulgham.

        This patch implements HKDF according to the spec: https://www.w3.org/TR/WebCryptoAPI/#hkdf.
        Supported operations include deriveKey, deriveBits, importKey and getKeyLength.

        Tests: crypto/subtle/ecdh-import-key-derive-hkdf-key.html
               crypto/subtle/hkdf-derive-bits-malformed-parametrs.html
               crypto/subtle/hkdf-import-key-derive-bits.html
               crypto/subtle/hkdf-import-key-derive-hmac-key.html
               crypto/subtle/hkdf-import-key-malformed-parameters.html
               crypto/subtle/hkdf-import-key.html
               crypto/workers/subtle/hkdf-import-key-derive-bits.html
               crypto/workers/subtle/hkdf-import-key-derive-hmac-key.html
               crypto/workers/subtle/hkdf-import-key.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * PlatformGTK.cmake:
        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSCryptoAlgorithmDictionary.cpp:
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForEncrypt):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForDecrypt):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForSign):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForVerify):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForDigest):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForGenerateKey):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveKey):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForDeriveBits):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey):
        (WebCore::JSCryptoAlgorithmDictionary::createParametersForExportKey):
        Rename HKDF_CTR to HKDF.
        * bindings/js/JSSubtleCryptoCustom.cpp:
        (WebCore::normalizeCryptoAlgorithmParameters):
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneSerializer::write):
        (WebCore::CloneDeserializer::read):
        Rename HKDF_CTR to HKDF.
        * crypto/CommonCryptoUtilities.h:
        * crypto/CryptoAlgorithmIdentifier.h:
        * crypto/CryptoAlgorithmParameters.h:
        * crypto/algorithms/CryptoAlgorithmHKDF.cpp: Added.
        (WebCore::CryptoAlgorithmHKDF::create):
        (WebCore::CryptoAlgorithmHKDF::identifier):
        (WebCore::CryptoAlgorithmHKDF::deriveBits):
        (WebCore::CryptoAlgorithmHKDF::importKey):
        (WebCore::CryptoAlgorithmHKDF::getKeyLength):
        * crypto/algorithms/CryptoAlgorithmHKDF.h: Added.
        * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp: Added.
        (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
        * crypto/mac/CryptoAlgorithmHKDFMac.cpp: Added.
        (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
        * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
        (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
        * crypto/parameters/CryptoAlgorithmHkdfParams.h: Added.
        * crypto/parameters/HkdfParams.idl: Added.

2017-04-14  Zalan Bujtas  <zalan@apple.com>

        text-align start / end failure in table cells
        https://bugs.webkit.org/show_bug.cgi?id=141417
        <rdar://problem/31051672>

        Reviewed by Antti Koivisto.

        Apply "text-align: center" on th elements when parent's computed value for the 'text-align' property
        is its initial value, unless it is explicitly set.

        Test: fast/table/center-th-when-parent-has-initial-text-align.html

        * css/CSSProperties.json:
        * css/StyleBuilderCustom.h:
        (WebCore::StyleBuilderCustom::applyInitialTextAlign):
        (WebCore::StyleBuilderCustom::applyValueTextAlign):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::adjustRenderStyle):
        (WebCore::StyleResolver::applyProperty):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::hasExplicitlySetTextAlign):
        (WebCore::RenderStyle::setHasExplicitlySetTextAlign):
        (WebCore::RenderStyle::NonInheritedFlags::hasExplicitlySetTextAlign):
        (WebCore::RenderStyle::NonInheritedFlags::setHasExplicitlySetTextAlign):

2017-04-14  Andy Estes  <aestes@apple.com>

        [ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out
        https://bugs.webkit.org/show_bug.cgi?id=161967

        Reviewed by Alexey Proskuryakov.

        DataDetectorsCoreSPI.h defined DDQueryOffset as a struct of two CFIndexes, which is 16 bytes
        on LP64, but the struct is actually defined as two CFIndex-typed 32-bit bitfields, which is
        8 bytes on LP64. This breaks the ABI on Public SDK builds when calling functions that take
        or return DDQueryOffsets.

        * platform/spi/cocoa/DataDetectorsCoreSPI.h: Updated the DDQueryOffset definition for
        Public SDK builds, and added a static_assert to detect future size changes at compile time.

2017-04-14  Konstantin Tokarev  <annulen@yandex.ru>

        Removed unused and unimplemented methods from MediaPlayer
        https://bugs.webkit.org/show_bug.cgi?id=170848

        Reviewed by Jer Noble.

        No new tests needed.

        * platform/graphics/MediaPlayer.h:

2017-04-14  Myles C. Maxfield  <mmaxfield@apple.com>

        Add performance test for asking the platform for a font for U+2060 WORD JOINER
        https://bugs.webkit.org/show_bug.cgi?id=170842

        Reviewed by Tim Horton.

        No new tests because there is no behavior change.

        * platform/graphics/WidthCache.h:
        (WebCore::WidthCache::add):
        (WebCore::WidthCache::addSlowCase):

2017-04-14  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r215350.

        This change broke the Windows build.

        Reverted changeset:

        "Remove unused SharedBuffer constructor"
        https://bugs.webkit.org/show_bug.cgi?id=170828
        http://trac.webkit.org/changeset/215350

2017-04-14  Jer Noble  <jer.noble@apple.com>

        [MediaSource] Push capabilities across process boundary during UIProcess capture.
        https://bugs.webkit.org/show_bug.cgi?id=170814

        Reviewed by Eric Carlson.

        There's no real reason for RealtimeMediaSourceCapabilities to be RefCounted nor to keep them from
        being created on the stack. So in addition to making that class coder-compliant, change all the
        classes that vend capabilities to use a unique_ptr<> instead of a RefPtr<>.

        * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
        * Modules/webaudio/MediaStreamAudioSource.cpp:
        (WebCore::MediaStreamAudioSource::capabilities):
        * Modules/webaudio/MediaStreamAudioSource.h:
        * platform/mediastream/MediaEndpoint.cpp:
        * platform/mediastream/MediaStreamTrackPrivate.cpp:
        (WebCore::MediaStreamTrackPrivate::capabilities):
        * platform/mediastream/MediaStreamTrackPrivate.h:
        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/RealtimeMediaSourceCapabilities.h:
        (WebCore::CapabilityValueOrRange::encode):
        (WebCore::CapabilityValueOrRange::decode):
        (WebCore::RealtimeMediaSourceCapabilities::RealtimeMediaSourceCapabilities):
        (WebCore::RealtimeMediaSourceCapabilities::supportedConstraints):
        (WebCore::RealtimeMediaSourceCapabilities::setSupportedConstraints):
        (WebCore::RealtimeMediaSourceCapabilities::encode):
        (WebCore::RealtimeMediaSourceCapabilities::decode):
        (WebCore::RealtimeMediaSourceCapabilities::create): Deleted.
        * platform/mediastream/RealtimeMediaSourceSettings.h:
        * platform/mediastream/mac/AVMediaCaptureSource.h:
        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        (WebCore::AVMediaCaptureSource::initializeCapabilities):
        (WebCore::AVMediaCaptureSource::capabilities):
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::capabilities):
        * platform/mediastream/mac/CoreAudioCaptureSource.h:
        * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
        (WebCore::RealtimeIncomingAudioSource::capabilities):
        * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
        * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
        (WebCore::RealtimeIncomingVideoSource::capabilities):
        * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
        * platform/mock/MockRealtimeMediaSource.cpp:
        (WebCore::MockRealtimeMediaSource::initializeCapabilities):
        (WebCore::MockRealtimeMediaSource::capabilities):
        * platform/mock/MockRealtimeMediaSource.h:
        * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:

2017-04-13  Saam Barati  <sbarati@apple.com>

        WebAssembly: We should be able to postMessage a JSWebAssemblyModule
        https://bugs.webkit.org/show_bug.cgi?id=170573

        Reviewed by Filip Pizlo.

        This patch's main purpose is to implement postMessage of JSWebAssemblyModule.
        The spec text describing the behavior is: https://github.com/WebAssembly/design/blob/master/JS.md#structured-clone-of-a-webassemblymodule
        We only allow for JSWebAssemblyModule to be serialized in the postMessage
        context. More work needs to be done to make it valid to store a module in
        IndexDB.
        
        All that is needed to serialize a JSWebAssemblyModule is grab a Ref
        to its underlying Wasm::Module. So, when doing a postMessage, all we
        do is grab this Ref, and then re-create the JSWebAssemblyModule from
        the Wasm::Module in the new VM/global object. Because the code for
        Wasm::Module is VM-independent, this is all that's needed. This turned
        out nicely, because it requires little knowledge from WebCore about
        what it means to clone a JSWebAssemblyModule.
        
        
        The second significant part of this patch is teaching WorkerRunLoop about
        the various timers inside JSC. Before, the WorkerRunLoop wouldn't always
        wake up to address JSC timers. I noticed this bug when I was writing
        tests to make sure that Wasm was running concurrently in different
        workers. The bug is that the WorkerRunLoop's message queue has no insight
        into a timer being scheduled. This effected the PromiseDeferredTimer that
        Wasm uses, as well as the various GC timers that Heap uses. Now, WorkerRunLoop
        will set itself up to be notified when timers are set. When a timer is
        set, the WorkerRunLoop will perform an iteration to to reset its top
        level MessageQueue timeout to be no longer than the next timer fire date.

        Tests: storage/indexeddb/wasm-exceptions.html
               workers/wasm-hashset-many.html
               workers/wasm-hashset.html
               workers/wasm-long-compile-many.html
               workers/wasm-long-compile.html

        * ForwardingHeaders/heap/GCActivityCallback.h: Added.
        * ForwardingHeaders/runtime/JSRunLoopTimer.h: Added.
        * ForwardingHeaders/runtime/PromiseDeferredTimer.h: Added.
        * ForwardingHeaders/wasm: Added.
        * ForwardingHeaders/wasm/js: Added.
        * ForwardingHeaders/wasm/js/JSWebAssemblyModule.h: Added.
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneSerializer::serialize):
        (WebCore::CloneSerializer::CloneSerializer):
        (WebCore::CloneSerializer::dumpIfTerminal):
        (WebCore::CloneDeserializer::deserialize):
        (WebCore::CloneDeserializer::CloneDeserializer):
        (WebCore::CloneDeserializer::readTerminal):
        (WebCore::SerializedScriptValue::SerializedScriptValue):
        (WebCore::SerializedScriptValue::create):
        (WebCore::SerializedScriptValue::deserialize):
        * bindings/js/SerializedScriptValue.h:
        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::addTimerSetNotification):
        (WebCore::WorkerScriptController::removeTimerSetNotification):
        * bindings/js/WorkerScriptController.h:
        * workers/WorkerRunLoop.cpp:
        (WebCore::WorkerRunLoop::runInMode):

2017-04-13  Dean Jackson  <dino@apple.com>

        Large negative animation-delays may not work depending on machine uptime
        https://bugs.webkit.org/show_bug.cgi?id=166962
        <rdar://problem/30091526>

        Reviewed by Tim Horton.

        If you set a really negative animation delay, it would cause
        AnimationBase::m_startTime to become negative, because the delay
        value was "bigger" than monotonicallyIncreasingTime.

        However, the state machine was using -1 to mean that the start time
        hadn't yet been set. Classic cmarrin!

        Replace all the special values with std::optional, and use nullopt
        to mean the value doesn't exist yet.

        Test: animations/large-negative-delay.html

        * page/animation/AnimationBase.cpp:
        (WebCore::AnimationBase::updateStateMachine):
        (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
        (WebCore::AnimationBase::getTimeToNextEvent):
        (WebCore::AnimationBase::freezeAtTime):
        (WebCore::AnimationBase::getElapsedTime):
        * page/animation/AnimationBase.h: Use std::optional.
        (WebCore::AnimationBase::paused):

2017-04-13  Alex Christensen  <achristensen@webkit.org>

        Remove unused SharedBuffer constructor
        https://bugs.webkit.org/show_bug.cgi?id=170828

        Reviewed by Brady Eidson.

        * platform/SharedBuffer.cpp:
        (WebCore::SharedBuffer::append):
        * platform/SharedBuffer.h:
        (WebCore::SharedBuffer::create):

2017-04-13  Antti Koivisto  <antti@apple.com>

        Don't invalidate composition for style changes in non-composited layers
        https://bugs.webkit.org/show_bug.cgi?id=170805
        <rdar://problem/31606185>

        Reviewed by Simon Fraser.

        Test: compositing/updates/animation-non-composited.html

        In most cases they can't affect composition. Composition updates are expensive, this can
        save a lot of work (tumblr.com animations hit this at the moment).

        * rendering/RenderElement.h:
        (WebCore::RenderElement::createsGroup):
        (WebCore::RenderElement::createsGroupForStyle):

            Factor to a static function so we can test style directly.

        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::layerStyleChanged):
        (WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons):

            Test if style change might cause compositing change that can't be determined without compositing update.

        * rendering/RenderLayerCompositor.h:

2017-04-13  JF Bastien  <jfbastien@apple.com>

        WebAssembly: manage memory better
        https://bugs.webkit.org/show_bug.cgi?id=170628

        Reviewed by Keith Miller, Michael Saboff.

        Re-use a VM tag which was intended for JavaScript core, was then
        used by our GC, and is now unused. If I don't do this then
        WebAssembly fast memories will make vmmap look super weird because
        it'll look like multi-gigabyte of virtual memory are allocated as
        part of our process' regular memory!

        Separately I need to update vmmap and other tools to print the
        right name. Right now this tag gets identified as "JS garbage
        collector".

        * page/ResourceUsageData.cpp:
        (WebCore::ResourceUsageData::ResourceUsageData):
        * page/ResourceUsageData.h:
        * page/cocoa/ResourceUsageOverlayCocoa.mm:
        (WebCore::HistoricResourceUsageData::HistoricResourceUsageData):
        * page/cocoa/ResourceUsageThreadCocoa.mm:
        (WebCore::displayNameForVMTag):
        (WebCore::categoryForVMTag):

2017-04-13  Ryosuke Niwa  <rniwa@webkit.org>

        Update the comments for the number of bits in RenderStyle::InheritedFlags.

        Rubber-stamped by Zalan Bujtas

        * rendering/style/RenderStyle.h:

2017-04-13  Myles C. Maxfield  <mmaxfield@apple.com>

        Addressing post-review comment after r215314.
        https://bugs.webkit.org/show_bug.cgi?id=169015

        Reviewed by Alexey Proskuryakov.

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

2017-04-13  Sam Weinig  <sam@webkit.org>

        [WebIDL] Add support for extended attributes on types in WebIDL
        https://bugs.webkit.org/show_bug.cgi?id=170759

        Reviewed by Alex Christensen.

        - Update parsing for WebIDL grammar changes.
        - Adds an extended attributes hash to IDLType that is filled according
          to the WebIDL annotated type rules.
        - Updates code generation to take advantage of IDLType's extended attribute
          simplifying some existing code.
        - Update IDLs in the project to adhere to the new grammar.
          
        * Modules/indexeddb/IDBFactory.idl:
        * Modules/indexeddb/IDBIndex.idl:
        * Modules/indexeddb/IDBKeyRange.idl:
        * Modules/indexeddb/IDBObjectStore.idl:
        * Modules/websockets/WebSocket.idl:
        * crypto/parameters/AesCtrParams.idl:
        * crypto/parameters/AesKeyParams.idl:
        * crypto/parameters/Pbkdf2Params.idl:
        * crypto/parameters/RsaKeyGenParams.idl:
        * testing/TypeConversions.idl:
        Update for grammar change.

        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateDefaultValue):
        (GetBaseIDLType):
        (GetIDLType):
        (GetIntegerConversionConfiguration):
        (GetStringConversionConfiguration):
        (JSValueToNative):
        (UnsafeToNative):
        (NativeToJSValueDOMConvertNeedsState):
        (NativeToJSValueDOMConvertNeedsGlobalObject):
        (NativeToJSValue):
        Remove the need for the type's context in many places since type
        associated extended attributes are now on the type itself.

        * bindings/scripts/IDLParser.pm:
        (copyExtendedAttributes):
        Move up so it can be reused.

        (isExtendedAttributeApplicableToTypes):
        Add temporary predicated to indicate which attributes should be moved to types. This
        logic should be moved to IDLAttributes.txt.

        (moveExtendedAttributesApplicableToTypes):
        Add helper to move attributes to the type's extended attributes hash if applicable.

        (makeSimpleType):
        Use initializer syntax to simplify.

        (cloneType):
        Support cloning types with extended attributes.

        (typeByApplyingTypedefs):
        When constructing the clone for a typedef application, move any applicable attributes
        to the clone from the original type.

        (parseDictionaryMember):
        (parseTypedef):
        (parseAttributeOrOperationRest):
        (parseAttributeRest):
        (parseOperationOrIterator):
        (parseSpecialOperation):
        (parseOptionalIterableInterface):
        (parseMapLikeProperties):
        (parseOptionalOrRequiredArgument):
        (parseType):
        (parseTypeWithExtendedAttributes):
        (parseUnionMemberType):
        (parseNonAnyType):
        Update for new grammar, moving applicable attributes eagerly.

        (assertNoExtendedAttributesInTypedef): Deleted.
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampOnOptional):
        (WebCore::jsTestObjPrototypeFunctionClassMethodWithClampOnOptionalCaller):
        (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeOnOptional):
        (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRangeOnOptionalCaller):
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        (WebCore::jsTestTypedefsAttributeWithClamp):
        (WebCore::jsTestTypedefsAttributeWithClampGetter):
        (WebCore::jsTestTypedefsAttributeWithClampInTypedef):
        (WebCore::jsTestTypedefsAttributeWithClampInTypedefGetter):
        (WebCore::setJSTestTypedefsAttributeWithClamp):
        (WebCore::setJSTestTypedefsAttributeWithClampFunction):
        (WebCore::setJSTestTypedefsAttributeWithClampInTypedef):
        (WebCore::setJSTestTypedefsAttributeWithClampInTypedefFunction):
        (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampInTypedef):
        (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampInTypedefCaller):
        * bindings/scripts/test/TestObj.idl:
        * bindings/scripts/test/TestTypedefs.idl:
        Update for new grammar. Add some new tests for uncovered cases.

2017-04-13  Alex Christensen  <achristensen@webkit.org>

        Fix CMake build
        https://bugs.webkit.org/show_bug.cgi?id=170815

        Reviewed by Beth Dakin.

        * platform/spi/cocoa/AVKitSPI.h:

2017-04-13  JF Bastien  <jfbastien@apple.com>

        cmake build fix

        Unreviewed build fix. A file was removed but left in the cmake
        build.

        * PlatformMac.cmake:

2017-04-13  Youenn Fablet  <youenn@apple.com>

        Remove RTCSignalingState::Closed
        https://bugs.webkit.org/show_bug.cgi?id=170811

        Reviewed by Eric Carlson.

        Covered by existing and rebased tests.

        Adding RTCPeerConnection::isClosed to better match the isClosed internal slot in webrtc specification.
        Using isClosed instead of checking signalingState value.
        Implementing isClosed in terms of m_connectionState which has a Closed value.

        * Modules/mediastream/MediaEndpointPeerConnection.cpp:
        (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
        (WebCore::MediaEndpointPeerConnection::replaceTrackTask):
        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::createOffer):
        (WebCore::PeerConnectionBackend::createOfferSucceeded):
        (WebCore::PeerConnectionBackend::createOfferFailed):
        (WebCore::PeerConnectionBackend::createAnswer):
        (WebCore::PeerConnectionBackend::createAnswerSucceeded):
        (WebCore::PeerConnectionBackend::createAnswerFailed):
        (WebCore::PeerConnectionBackend::setLocalDescription):
        (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
        (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
        (WebCore::PeerConnectionBackend::setRemoteDescription):
        (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
        (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
        (WebCore::PeerConnectionBackend::addIceCandidate):
        (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
        (WebCore::PeerConnectionBackend::addIceCandidateFailed):
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::create):
        (WebCore::RTCPeerConnection::RTCPeerConnection):
        (WebCore::RTCPeerConnection::addTrack):
        (WebCore::RTCPeerConnection::removeTrack):
        (WebCore::RTCPeerConnection::queuedCreateOffer):
        (WebCore::RTCPeerConnection::queuedCreateAnswer):
        (WebCore::RTCPeerConnection::queuedSetLocalDescription):
        (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
        (WebCore::RTCPeerConnection::queuedAddIceCandidate):
        (WebCore::RTCPeerConnection::setConfiguration):
        (WebCore::RTCPeerConnection::createDataChannel):
        (WebCore::RTCPeerConnection::doClose):
        (WebCore::RTCPeerConnection::updateIceGatheringState):
        (WebCore::RTCPeerConnection::updateIceConnectionState):
        (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
        * Modules/mediastream/RTCPeerConnection.h:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::signalingState):
        * platform/mediastream/RTCSignalingState.h:

2017-04-13  Zalan Bujtas  <zalan@apple.com>

        BreakingContext::WordTrailingSpace cleanup.
        https://bugs.webkit.org/show_bug.cgi?id=170750

        Reviewed by Myles C. Maxfield.

        No change in functionality.

        * rendering/RenderText.cpp:
        (WebCore::RenderText::computePreferredLogicalWidths):
        * rendering/line/BreakingContext.h:
        (WebCore::WordTrailingSpace::WordTrailingSpace):
        (WebCore::WordTrailingSpace::width):
        (WebCore::BreakingContext::handleText):

2017-04-13  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Implement cloneArrayBuffer in WebCore
        https://bugs.webkit.org/show_bug.cgi?id=170008

        Reviewed by Youenn Fablet.

        Implemented cloneArrayBuffer based on existing structuredCloneArrayBuffer
        implementation. The code has been factorized so that both cloneArrayBuffer
        and structuredCloneArrayBuffer rely on the same code (which is basically
        the previous implementation of structuredCloneArrayBuffer + the ability
        to clone only a part of considered buffer).

        Test: streams/clone-array-buffer.html

        * Modules/streams/ReadableByteStreamInternals.js: Deleted cloneArrayBuffer JS implementation.
        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Add cloneArrayBuffer private declaration.
        * bindings/js/StructuredClone.cpp:
        (WebCore::cloneArrayBufferImpl): Added (mostly based on previous structuredCloneArrayBuffer).
        (WebCore::cloneArrayBuffer): Added.
        (WebCore::structuredCloneArrayBuffer): Updated.
        * bindings/js/StructuredClone.h: Added cloneArrayBuffer declaration.
        * bindings/js/WebCoreBuiltinNames.h: Added cloneArrayBuffer declaration.
        * testing/Internals.cpp: Added support for testing cloneArrayBuffer.
        * testing/Internals.h: Added support for testing cloneArrayBuffer.
        * testing/Internals.idl: Added support for testing cloneArrayBuffer.

2017-04-13  Youenn Fablet  <youenn@apple.com>

        onnegotiationneeded should only be called once
        https://bugs.webkit.org/show_bug.cgi?id=170785

        Reviewed by Alex Christensen.

        Covered by updated test.

        Disabling explicit call to markAsNeedingNegotiation in case libwebrtc is used as libwebrtc is calling it.
        Making sure removeTrack gets notified up to libwebrtc.

        * Modules/mediastream/PeerConnectionBackend.h:
        (WebCore::PeerConnectionBackend::notifyRemovedTrack):
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::addTrack):
        (WebCore::RTCPeerConnection::removeTrack):
        (WebCore::RTCPeerConnection::completeAddTransceiver):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::removeTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::notifyRemovedTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

2017-04-13  Dave Hyatt  <hyatt@apple.com>

        Rendering flexbox children across columns
        https://bugs.webkit.org/show_bug.cgi?id=164166
        <rdar://problem/29055587>

        Reviewed by Zalan Bujtas.

        Added fast/multicol/flexbox-rows.html

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::adjustForUnsplittableChild):

2017-04-12  Alex Christensen  <achristensen@webkit.org>

        Clean up SharedBuffer public functions
        https://bugs.webkit.org/show_bug.cgi?id=170795

        Reviewed by Andreas Kling.

        Make some member functions that are now only used internally private.

        * platform/SharedBuffer.cpp:
        (WebCore::SharedBuffer::append):
        (WebCore::SharedBuffer::platformDataSize): Deleted.
        * platform/SharedBuffer.h:

2017-04-12  Dan Bernstein  <mitz@apple.com>

        [Mac] Future-proof .xcconfig files
        https://bugs.webkit.org/show_bug.cgi?id=170802

        Reviewed by Tim Horton.

        * Configurations/Base.xcconfig:
        * Configurations/DebugRelease.xcconfig:
        * Configurations/FeatureDefines.xcconfig:
        * Configurations/Version.xcconfig:

2017-04-12  Brady Eidson  <beidson@apple.com>

        QuotaExceededError when saving to localStorage in private mode.
        https://bugs.webkit.org/show_bug.cgi?id=157010

        Reviewed by Alex Christensen.

        No new tests (Covered by changes to existing test).
        
        LocalStorage in private browsing is now effectively SessionStorage.
        It's ephemeral, per-tab, and copied over to tabs window.open()'ed from the current.

        * loader/EmptyClients.cpp:
        (WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace):

        * page/Chrome.cpp:
        (WebCore::Chrome::createWindow):

        * page/Page.cpp:
        (WebCore::Page::ephemeralLocalStorage):
        (WebCore::Page::setEphemeralLocalStorage):
        * page/Page.h:

        * page/SecurityOriginData.h:

        * storage/Storage.cpp:
        (WebCore::Storage::length):
        (WebCore::Storage::key):
        (WebCore::Storage::getItem):
        (WebCore::Storage::setItem):
        (WebCore::Storage::removeItem):
        (WebCore::Storage::clear):
        (WebCore::Storage::contains):
        (WebCore::Storage::isDisabledByPrivateBrowsing): Deleted.

        * storage/StorageMap.h:

        * storage/StorageNamespaceProvider.cpp:
        (WebCore::StorageNamespaceProvider::localStorageArea):
        * storage/StorageNamespaceProvider.h:

        * storage/StorageType.h:
        (WebCore::isLocalStorage):
        (WebCore::isPersistentLocalStorage):

2017-04-12  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Suppress font download dialog in new matching algorithm
        https://bugs.webkit.org/show_bug.cgi?id=169015

        Reviewed by Alexey Proskuryakov.

        Not testable.

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

2017-04-12  Eric Carlson  <eric.carlson@apple.com>

        REGRESSION (r215242-215243): [ios-simulator] API test WebKit1.AudioSessionCategoryIOS is failing
        https://bugs.webkit.org/show_bug.cgi?id=170777
        <rdar://problem/31592877>

        Reviewed by Jer Noble.

        No new tests, fixes an existing test.

        * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
        (PlatformMediaSessionManager::updateSessionState): Pass parameters to lambda by reference.

2017-04-12  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Set correct audio session category when capturing audio
        https://bugs.webkit.org/show_bug.cgi?id=170736
        <rdar://problem/31559405>

        Unreviewed, update an assertion I missed in r215242.

        * platform/audio/PlatformMediaSession.cpp:
        (WebCore::PlatformMediaSession::PlatformMediaSession):

2017-04-12  Alex Christensen  <achristensen@webkit.org>

        Remove unused SharedBuffer::wrapCFDataArray
        https://bugs.webkit.org/show_bug.cgi?id=170794

        Reviewed by Brady Eidson.

        It's unused since r215280.

        * platform/SharedBuffer.h:
        * platform/cf/SharedBufferCF.cpp:
        (WebCore::SharedBuffer::wrapCFDataArray): Deleted.

2017-04-12  Anders Carlsson  <andersca@apple.com>

        Tweak WebCore::setMetadataURL function
        https://bugs.webkit.org/show_bug.cgi?id=170786

        Reviewed by Beth Dakin.

        Get rid of the "referrer" parameter, it isn't used. Make the remaining parameters const. Swap the
        urlString and path parameters since that makes more sense. Use String instead of NSString in the call to WKSetMetadataURL.

        * platform/FileSystem.cpp:
        (WebCore::setMetadataURL): Deleted.
        * platform/FileSystem.h:
        * platform/mac/FileSystemMac.mm:
        (WebCore::setMetadataURL):

2017-04-12  Myles C. Maxfield  <mmaxfield@apple.com>

        Well-known variations should clamp to the values listed in the @font-face block
        https://bugs.webkit.org/show_bug.cgi?id=169260

        Reviewed by Dean Jackson.

        Most of this patch is plumbing the variation ranges from the CSSFontFace object
        to preparePlatformFont() where variation values get applied.

        Beyond that, there is one other piece of this patch - a nonspecified value in an
        @font-face block shouldn't perform any clamping, but a specified value should be
        clamped. This means that we need to retain whether or not a value is specified.
        This patch does this by migrating CSSFontFace from using FontSelectionCapabilities
        to using FontSelectionSpecifiedCapabilities, which has its internals behind
        std::optionals which represent whether or not the value was specified. For the
        purposes of font selection, these unspecified values are replaced with default
        values.

        Test: fast/text/variations/font-face-clamp.html

        * css/CSSFontFace.cpp:
        (WebCore::CSSFontFace::font):
        * css/CSSFontFace.h:
        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::font):
        * css/CSSFontFaceSource.h:
        * css/CSSFontSelector.cpp:
        (WebCore::CSSFontSelector::addFontFaceRule):
        * loader/cache/CachedFont.cpp:
        (WebCore::CachedFont::createFont):
        (WebCore::CachedFont::platformDataFromCustomData):
        * loader/cache/CachedFont.h:
        * loader/cache/CachedSVGFont.cpp:
        (WebCore::CachedSVGFont::createFont):
        (WebCore::CachedSVGFont::platformDataFromCustomData):
        * loader/cache/CachedSVGFont.h:
        * platform/graphics/FontCache.cpp:
        (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
        (WebCore::FontPlatformDataCacheKey::operator==):
        (WebCore::FontPlatformDataCacheKeyHash::hash):
        (WebCore::FontCache::getCachedFontPlatformData):
        (WebCore::FontCache::fontForFamily):
        * platform/graphics/FontCache.h:
        (WebCore::FontCache::fontForFamily):
        (WebCore::FontCache::getCachedFontPlatformData):
        (WebCore::FontCache::createFontPlatformDataForTesting):
        * platform/graphics/FontSelectionAlgorithm.h:
        (WebCore::FontSelectionRange::uniqueValue):
        (WebCore::FontSelectionCapabilities::operator==):
        (WebCore::FontSelectionCapabilities::operator!=):
        (WebCore::FontSelectionSpecifiedCapabilities::computeFontSelectionCapabilities):
        (WebCore::FontSelectionSpecifiedCapabilities::operator==):
        (WebCore::FontSelectionSpecifiedCapabilities::operator!=):
        (WebCore::FontSelectionSpecifiedCapabilities::operator=):
        (WebCore::FontSelectionSpecifiedCapabilities::computeWeight):
        (WebCore::FontSelectionSpecifiedCapabilities::computeWidth):
        (WebCore::FontSelectionSpecifiedCapabilities::computeSlope):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::preparePlatformFont):
        (WebCore::fontWithFamily):
        (WebCore::FontCache::createFontPlatformData):
        (WebCore::FontCache::systemFallbackForCharacters):
        * platform/graphics/mac/FontCacheMac.mm:
        (WebCore::FontCache::lastResortFallbackFont):
        * platform/graphics/mac/FontCustomPlatformData.cpp:
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/graphics/mac/FontCustomPlatformData.h:

2017-04-12  Beth Dakin  <bdakin@apple.com>

        Speculative open source build fix.

        * platform/spi/cocoa/AVKitSPI.h:

2017-04-12  Alex Christensen  <achristensen@webkit.org>

        Stop using didReceiveDataArray callback on El Capitan
        https://bugs.webkit.org/show_bug.cgi?id=170780

        Reviewed by Brady Eidson.

        didReceiveDataArray was an optimization that improved performance on iOS but is not needed any more.
        The only platform where this is used is El Capitan, and didReceiveData works fine on that platform.
        I've left some cleanup still to be done in SharedBuffer, and doing that is the motivation for this change.

        * WebCore.xcodeproj/project.pbxproj:
        * loader/ResourceLoader.h:
        * loader/SubresourceLoader.h:
        * loader/cf/SubresourceLoaderCF.cpp: Removed.
        * loader/mac/ResourceLoaderMac.mm:
        (WebCore::ResourceLoader::didReceiveDataArray): Deleted.
        * platform/network/ResourceHandleClient.h:
        (WebCore::ResourceHandleClient::supportsDataArray): Deleted.
        (WebCore::ResourceHandleClient::didReceiveDataArray): Deleted.
        * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
        (WebCore::ResourceHandleCFURLConnectionDelegate::makeConnectionClient):
        (WebCore::ResourceHandleCFURLConnectionDelegate::didReceiveDataArrayCallback): Deleted.
        * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray): Deleted.
        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
        * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
        (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveDataArray): Deleted.
        * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
        (-[WebCoreResourceHandleAsDelegate connection:didReceiveDataArray:]): Deleted.
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveDataArray:]): Deleted.

2017-04-12  Beth Dakin  <bdakin@apple.com>

        Attempted build fix.

        * platform/spi/cocoa/AVKitSPI.h:

2017-04-12  Beth Dakin  <bdakin@apple.com>

        Adopt AVKit name change from AVFunctionBar* to AVTouchBar*
        https://bugs.webkit.org/show_bug.cgi?id=170693
        -and corresponding-
        rdar://problem/31230018

        Reviewed by San Weinig.

        Since the new names only apply to some versions of macOS, this patch uses typedefs 
        for the older OS’s. SO:

        AVFunctionBarScrubber is now AVTouchBarScrubber

        AVFunctionBarPlaybackControlsProvider is now AVTouchBarPlaybackControlsProvider

        AVFunctionBarMediaSelectionOption is now AVTouchBarMediaSelectionOption

        And the protocol AVFunctionBarPlaybackControlsControlling is now 
        AVTouchBarPlaybackControlsControlling

        * platform/mac/WebPlaybackControlsManager.h:
        * platform/mac/WebPlaybackControlsManager.mm:
        (-[WebPlaybackControlsManager audioFunctionBarMediaSelectionOptions]):
        (-[WebPlaybackControlsManager setAudioFunctionBarMediaSelectionOptions:]):
        (-[WebPlaybackControlsManager currentAudioFunctionBarMediaSelectionOption]):
        (-[WebPlaybackControlsManager setCurrentAudioFunctionBarMediaSelectionOption:]):
        (-[WebPlaybackControlsManager legibleFunctionBarMediaSelectionOptions]):
        (-[WebPlaybackControlsManager setLegibleFunctionBarMediaSelectionOptions:]):
        (-[WebPlaybackControlsManager currentLegibleFunctionBarMediaSelectionOption]):
        (-[WebPlaybackControlsManager setCurrentLegibleFunctionBarMediaSelectionOption:]):
        (mediaSelectionOptions):

        Here is where the typedefs and #define are declared.
        * platform/spi/cocoa/AVKitSPI.h:

2017-04-12  Alex Christensen  <achristensen@webkit.org>

        Fix WinCairo build after r215265
        https://bugs.webkit.org/show_bug.cgi?id=170502

        m_threadId was removed in the header but not in the constructor implementation.
        Initializer lists are our friends.

        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownloadManager::CurlDownloadManager):
        (WebCore::CurlDownload::CurlDownload): Deleted.
        * platform/network/curl/CurlDownload.h:

2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>

        Unreviewed, build fix for Win and GTK
        https://bugs.webkit.org/show_bug.cgi?id=170758

        * platform/posix/SharedBufferPOSIX.cpp:
        (WebCore::SharedBuffer::createFromReadingFile):
        * platform/win/SharedBufferWin.cpp:
        (WebCore::SharedBuffer::createFromReadingFile):

2017-04-12  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Introduce Thread class and use RefPtr<Thread> and align Windows Threading implementation semantics to Pthread one
        https://bugs.webkit.org/show_bug.cgi?id=170502

        Reviewed by Mark Lam.

        Mechanical change. Use Thread:: APIs.

        * Modules/indexeddb/server/IDBServer.cpp:
        (WebCore::IDBServer::IDBServer::IDBServer):
        * Modules/indexeddb/server/IDBServer.h:
        * Modules/webaudio/AsyncAudioDecoder.cpp:
        (WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
        (WebCore::AsyncAudioDecoder::~AsyncAudioDecoder):
        (WebCore::AsyncAudioDecoder::runLoop):
        * Modules/webaudio/AsyncAudioDecoder.h:
        * Modules/webaudio/OfflineAudioDestinationNode.cpp:
        (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode):
        (WebCore::OfflineAudioDestinationNode::uninitialize):
        (WebCore::OfflineAudioDestinationNode::startRendering):
        * Modules/webaudio/OfflineAudioDestinationNode.h:
        * Modules/webdatabase/Database.cpp:
        (WebCore::Database::securityOrigin):
        * Modules/webdatabase/DatabaseThread.cpp:
        (WebCore::DatabaseThread::start):
        (WebCore::DatabaseThread::databaseThread):
        (WebCore::DatabaseThread::recordDatabaseOpen):
        (WebCore::DatabaseThread::recordDatabaseClosed):
        * Modules/webdatabase/DatabaseThread.h:
        (WebCore::DatabaseThread::getThreadID):
        * bindings/js/GCController.cpp:
        (WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
        * fileapi/AsyncFileStream.cpp:
        (WebCore::callOnFileThread):
        * loader/icon/IconDatabase.cpp:
        (WebCore::IconDatabase::open):
        (WebCore::IconDatabase::close):
        * loader/icon/IconDatabase.h:
        * page/ResourceUsageThread.cpp:
        (WebCore::ResourceUsageThread::createThreadIfNeeded):
        * page/ResourceUsageThread.h:
        * page/scrolling/ScrollingThread.cpp:
        (WebCore::ScrollingThread::ScrollingThread):
        (WebCore::ScrollingThread::isCurrentThread):
        (WebCore::ScrollingThread::createThreadIfNeeded):
        (WebCore::ScrollingThread::threadCallback):
        * page/scrolling/ScrollingThread.h:
        * platform/audio/HRTFDatabaseLoader.cpp:
        (WebCore::HRTFDatabaseLoader::HRTFDatabaseLoader):
        (WebCore::HRTFDatabaseLoader::loadAsynchronously):
        (WebCore::HRTFDatabaseLoader::waitForLoaderThreadCompletion):
        * platform/audio/HRTFDatabaseLoader.h:
        * platform/audio/ReverbConvolver.cpp:
        (WebCore::ReverbConvolver::ReverbConvolver):
        (WebCore::ReverbConvolver::~ReverbConvolver):
        * platform/audio/ReverbConvolver.h:
        * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
        (WebCore::createBusFromAudioFile):
        (WebCore::createBusFromInMemoryAudioFile):
        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (ResourceHandleStreamingClient::ResourceHandleStreamingClient):
        (ResourceHandleStreamingClient::~ResourceHandleStreamingClient):
        * platform/network/cf/LoaderRunLoopCF.cpp:
        (WebCore::loaderRunLoop):
        * platform/network/curl/CurlDownload.cpp:
        (WebCore::CurlDownloadManager::startThreadIfNeeded):
        (WebCore::CurlDownloadManager::stopThread):
        * platform/network/curl/CurlDownload.h:
        * platform/network/curl/SocketStreamHandleImpl.h:
        * platform/network/curl/SocketStreamHandleImplCurl.cpp:
        (WebCore::SocketStreamHandleImpl::startThread):
        (WebCore::SocketStreamHandleImpl::stopThread):
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::WorkerThread):
        (WebCore::WorkerThread::start):
        (WebCore::WorkerThread::workerThread):
        * workers/WorkerThread.h:
        (WebCore::WorkerThread::threadID):

2017-04-10  Antti Koivisto  <antti@apple.com>

        Cache small media resources in disk cache
        https://bugs.webkit.org/show_bug.cgi?id=170676
        <rdar://problem/31532649>

        Reviewed by Andreas Kling.

        Test: http/tests/cache/disk-cache/disk-cache-media-small.html

        Testing support. Functional changes are in WebKit2.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
        (WebCore::HTMLMediaElement::lastMediaResourceLoaderForTesting):
        * html/HTMLMediaElement.h:
        * loader/MediaResourceLoader.cpp:
        (WebCore::MediaResourceLoader::MediaResourceLoader):
        (WebCore::MediaResourceLoader::addResponseForTesting):
        (WebCore::MediaResource::responseReceived):
        * loader/MediaResourceLoader.h:
        * platform/network/cocoa/WebCoreNSURLSession.mm:
        (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):

            We can now receive cached responses.

        * testing/Internals.cpp:
        (WebCore::responseSourceToString):
        (WebCore::Internals::xhrResponseSource):
        (WebCore::Internals::mediaResponseSources):
        (WebCore::Internals::mediaResponseContentRanges):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-04-12  Alex Christensen  <achristensen@webkit.org>

        Modernize vector adoption
        https://bugs.webkit.org/show_bug.cgi?id=170758

        Reviewed by Geoffrey Garen.

        * Modules/encryptedmedia/InitDataRegistry.cpp:
        (WebCore::extractKeyIDsKeyids):
        * Modules/indexeddb/IDBGetResult.cpp:
        (WebCore::IDBGetResult::dataFromBuffer):
        * Modules/indexeddb/IDBKeyData.cpp:
        (WebCore::IDBKeyData::decode):
        * Modules/indexeddb/server/IDBSerialization.cpp:
        (WebCore::serializeIDBKeyData):
        (WebCore::decodeKey):
        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
        (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
        * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
        (WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):
        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::font):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadResourceSynchronously):
        * loader/appcache/ApplicationCacheStorage.cpp:
        (WebCore::ApplicationCacheStorage::loadCache):
        * loader/archive/mhtml/MHTMLParser.cpp:
        (WebCore::MHTMLParser::parseNextPart):
        * loader/cache/CachedFont.cpp:
        (WebCore::CachedFont::createCustomFontData):
        * loader/cache/CachedSVGFont.cpp:
        (WebCore::CachedSVGFont::ensureCustomFontData):
        * platform/SharedBuffer.cpp:
        (WebCore::SharedBuffer::create):
        (WebCore::utf8Buffer):
        (WebCore::SharedBuffer::adoptVector): Deleted.
        * platform/SharedBuffer.h:
        * platform/ThreadSafeDataBuffer.h:
        (WebCore::ThreadSafeDataBufferImpl::ThreadSafeDataBufferImpl):
        (WebCore::ThreadSafeDataBuffer::create):
        (WebCore::ThreadSafeDataBuffer::ThreadSafeDataBuffer):
        (WebCore::ThreadSafeDataBuffer::decode):
        (): Deleted.
        (WebCore::ThreadSafeDataBuffer::adoptVector): Deleted.
        * platform/network/BlobRegistryImpl.cpp:
        (WebCore::BlobRegistryImpl::registerBlobURL):
        * platform/network/DataURLDecoder.cpp:
        (WebCore::DataURLDecoder::decodeBase64):
        (WebCore::DataURLDecoder::decodeEscaped):

2017-04-12  Per Arne Vollan  <pvollan@apple.com>

        Implement stroke-color CSS property.
        https://bugs.webkit.org/show_bug.cgi?id=169352

        Reviewed by Jon Lee.

        Support setting text stroke color using the CSS property stroke-color, see https://drafts.fxtf.org/paint/.
        Text stroke color can currently be set with the -webkit-text-stroke-color property. To make sure this still
        works, I added a check to determine if the stroke-color property has been explicitly set. If it has not been
        set, we fall back to the value of the -webkit-text-stroke-color property.

        Tests: fast/css/stroke-color-fallback.html
               fast/css/stroke-color.html
               fast/css/visited-link-stroke-color.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::propertyValue):
        * css/CSSProperties.json:
        * css/StyleBuilderCustom.h:
        (WebCore::StyleBuilderCustom::applyValueStrokeColor):
        * css/StyleResolver.cpp:
        (WebCore::isValidVisitedLinkProperty):
        * css/parser/CSSParserFastPaths.cpp:
        (WebCore::isColorPropertyID):
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::CSSPropertyParser::parseSingleValue):
        * rendering/TextDecorationPainter.cpp:
        (WebCore::decorationColor):
        * rendering/TextPaintStyle.cpp:
        (WebCore::computeTextPaintStyle):
        (WebCore::computeTextSelectionPaintStyle):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline):
        (WebCore::RenderStyle::colorIncludingFallback):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::strokeColor):
        (WebCore::RenderStyle::setStrokeColor):
        (WebCore::RenderStyle::setVisitedLinkStrokeColor):
        (WebCore::RenderStyle::visitedLinkStrokeColor):
        (WebCore::RenderStyle::setHasExplicitlySetStrokeColor):
        (WebCore::RenderStyle::hasExplicitlySetStrokeColor):
        * rendering/style/StyleRareInheritedData.cpp:
        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
        (WebCore::StyleRareInheritedData::operator==):
        * rendering/style/StyleRareInheritedData.h:

2017-04-11  Zan Dobersek  <zdobersek@igalia.com>

        [GTK] Use the DisplayRefreshMonitor facilities
        https://bugs.webkit.org/show_bug.cgi?id=170599

        Reviewed by Carlos Garcia Campos.

        * CMakeLists.txt: Add missing files to the build.
        * platform/graphics/DisplayRefreshMonitor.cpp: Build fixes.
        (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer): Mark the
        platform layer as updated in the layer's CoordinatedGraphicsState.
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:

2017-04-11  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] Allow modern-media-controls to be provided through WebKitAdditions
        https://bugs.webkit.org/show_bug.cgi?id=170722
        <rdar://problem/31553089>

        Reviewed by Dean Jackson.

        If modern media controls source files are provided through WebKitAdditions, use these instead
        of the sources found in the WebCore module.

        * WebCore.xcodeproj/project.pbxproj:

2017-04-11  Dean Jackson  <dino@apple.com>

        Disable outdated WritableStream API
        https://bugs.webkit.org/show_bug.cgi?id=170749
        <rdar://problem/31446233>

        Reviewed by Tim Horton.

        The API we implement is no longer accurate. Disable it until we
        are compatible with the new specification

        * Configurations/FeatureDefines.xcconfig:

2017-04-11  Matt Rajca  <mrajca@apple.com>

        Consider the current document when allowing autoplay quirks.
        https://bugs.webkit.org/show_bug.cgi?id=170744

        Reviewed by Eric Carlson.

        Added API test.

        In addition to checking if the top-level document supports autoplay quirks, we should check
        if the current document supports quirks. This allows all embedded YouTube videos (which use
        iframes) to play correctly if the client allows autoplay quirks on youtube.com.

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

2017-04-11  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r215245.

        This change broke internal builds.

        Reverted changeset:

        "[Modern Media Controls] Allow modern-media-controls to be
        provided through WebKitAdditions"
        https://bugs.webkit.org/show_bug.cgi?id=170722
        http://trac.webkit.org/changeset/215245

2017-04-11  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] Allow modern-media-controls to be provided through WebKitAdditions
        https://bugs.webkit.org/show_bug.cgi?id=170722
        <rdar://problem/31553089>

        Reviewed by Dean Jackson.

        If modern media controls source files are provided through WebKitAdditions, use these instead
        of the sources found in the WebCore module.

        * WebCore.xcodeproj/project.pbxproj:

2017-04-10  Matt Rajca  <mrajca@apple.com>

        Change autoplay state to "prevented" when media is paused due to restrictions.
        https://bugs.webkit.org/show_bug.cgi?id=170686

        Reviewed by Alex Christensen.

        Added API tests.

        Currently, the autoplay state is set to "prevented" when playback is about to begin without
        user interaction and there are restrictions in place. We should also be setting this flag when
        autoplay is allowed but due to a change in audio tracks, for example, it gets paused.

        This patch also moves some common logic into setPlaybackWithoutUserGesture without changing behavior.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::setReadyState):
        (WebCore::HTMLMediaElement::play):
        (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
        (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
        (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture):
        (WebCore::HTMLMediaElement::updateShouldPlay):

2017-04-11  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Set correct audio session category when capturing audio
        https://bugs.webkit.org/show_bug.cgi?id=170736
        <rdar://problem/31559405>

        Reviewed by Jer Noble.

        No new tests yet, filed bug 170737.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::MediaStream): Initialize m_mediaSession.
        (WebCore::MediaStream::statusDidChange): Call canProduceAudioChanged.
        (WebCore::MediaStream::mediaType): New. Return MediaStreamCapturingAudio when actively
        capturing audio.
        (WebCore::MediaStream::presentationType):
        (WebCore::MediaStream::characteristics):
        (WebCore::MediaStream::mayResumePlayback):
        (WebCore::MediaStream::suspendPlayback):
        (WebCore::MediaStream::sourceApplicationIdentifier):
        (WebCore::MediaStream::canProduceAudio):
        * Modules/mediastream/MediaStream.h:

        * platform/audio/PlatformMediaSession.h: Add MediaStreamCapturingAudio.
        * platform/audio/PlatformMediaSessionManager.cpp:
        (WebCore::PlatformMediaSessionManager::has): Adjust assert for MediaStreamCapturingAudio.
        (WebCore::PlatformMediaSessionManager::count): Ditto.
        * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
        (PlatformMediaSessionManager::updateSessionState): Set small preferred buffer size when
        capturing audio. Set audio session category to PlayAndRecord whenever there is a media
        stream that is capturing audio.

2017-04-11  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WebCore][JSC] ResourceUsageData.{timeOfNextEdenCollection,timeOfNextFullCollection} should be MonotonicTime
        https://bugs.webkit.org/show_bug.cgi?id=170725

        Reviewed by Sam Weinig.

        Use MonotonicTime instead of raw doubles.
        Currently, large part of data structures and helper functions are the same in
        ResourceUsageOverlayCocoa.mm and ResourceUsageOverlayLinux.cpp. This should be
        unified in a separate patch.

        * page/ResourceUsageData.h:
        * page/cocoa/ResourceUsageOverlayCocoa.mm:
        (WebCore::gcTimerString):
        (WebCore::ResourceUsageOverlay::platformDraw):
        * page/linux/ResourceUsageOverlayLinux.cpp:
        (WebCore::gcTimerString):

2017-04-11  Youenn Fablet  <youenn@apple.com>

        Activate WebRTC data channel tests for WK1
        https://bugs.webkit.org/show_bug.cgi?id=170710

        Reviewed by Eric Carlson.

        Covered by existing and activated tests.

        Making LibWebRTCProvider::factory not static.
        For that purpose LibWebRTCMediaEndpoint now stores its peer connection factory reference.
        Making LibWebRTCProvider use libebrtc networking by default.

        Removing some no longer needed checks related to libwebrtc availability.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
        (WebCore::LibWebRTCMediaEndpoint::addTrack):
        (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
        (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::LibWebRTCProvider::factory):
        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:

2017-04-11  Youenn Fablet  <youenn@apple.com>

        MediaStream id should be equal to msid
        https://bugs.webkit.org/show_bug.cgi?id=170712

        Reviewed by Eric Carlson.

        Covered by rebased tests.

        Setting MediaStream id to libwebrtc mediastream label.
        Refactoring to use more Ref<> in MediaStream code.

        Making PeerConnection use the libwebrtc backend by default for layout tests instead of the mock.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::create):
        (WebCore::createTrackPrivateVector):
        (WebCore::MediaStream::MediaStream):
        * Modules/mediastream/MediaStream.h:
        * Modules/mediastream/MediaStreamRegistry.cpp:
        (WebCore::MediaStreamRegistry::lookUp):
        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::allow):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
        (WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
        (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::load):
        * platform/graphics/MediaPlayer.h:
        * platform/mediastream/MediaStreamPrivate.cpp:
        (WebCore::MediaStreamPrivate::MediaStreamPrivate):
        * platform/mediastream/MediaStreamPrivate.h:
        (WebCore::MediaStreamPrivate::create):
        * testing/Internals.cpp:
        (WebCore::Internals::Internals):

2017-04-11  Chris Fleizach  <cfleizach@apple.com>

        AX: Web article navigation does not work (article rotor for Facebook, Twitter, Messages etc.)
        https://bugs.webkit.org/show_bug.cgi?id=170330
        <rdar://problem/31366105>

        Reviewed by Joanmarie Diggs.

        Add a search ability for the "article" role.

        Test: accessibility/mac/search-predicate-article.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
        * accessibility/AccessibilityObject.h:
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
        * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
        (createAccessibilitySearchKeyMap):

2017-04-11  Chris Fleizach  <cfleizach@apple.com>

        AX: PDF plugin needs to support PDF-DOM Mode
        https://bugs.webkit.org/show_bug.cgi?id=170589

        Reviewed by Tim Horton.

        Provide WebCore support for accessibility connect to PDF document.
        This includes the ability to connect a PDF annotation created node within WebKit to 
         its PDFAnnotation parent (through use of shadowPluginParent).

        * accessibility/AXObjectCache.h:
        * accessibility/mac/AXObjectCacheMac.mm:
        (WebCore::AXPostNotificationWithUserInfo):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper shadowPluginParent]):
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
        * html/HTMLAttributeNames.in:
        * plugins/PluginViewBase.h:
        (WebCore::PluginViewBase::accessibilityShadowPluginParentForElement):

2017-04-11  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r215153): Request Animation Frame broken when building without REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR
        https://bugs.webkit.org/show_bug.cgi?id=170719

        Reviewed by Žan Doberšek.

        This is because when not using the display refresh monitor, the timer is always used, not only when throttling,
        but since r215153 the rAF timer is always aligned to 30ms.

        Fixes: fast/animation/request-animation-frame-too-rapid.html

        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::scheduleAnimation): Only do the timer alignment when throttling.

2017-04-11  Yoav Weiss  <yoav@yoav.ws>

        [link preload] Double downloads of preloaded content when it's in MemoryCache
        https://bugs.webkit.org/show_bug.cgi?id=170122

        Reviewed by Antti Koivisto.

        No new tests, but unflaked http/tests/preload/single_download_preload_headers_charset.html.

        The test was flaky because it appears as if MemoryCache is not being evicted between runs,
        and running multiple iterations of the test resulted in preloaded being taken out of MemoryCache
        and not having the unknown encoding flag. In those cases, the result was a double download and
        a failed test.

        * loader/TextResourceDecoder.cpp:
        (WebCore::TextResourceDecoder::setEncoding): Set the m_encodingSet flag.
        * loader/TextResourceDecoder.h: Added an m_encodingSet flag initialized to false.
        * loader/cache/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::setEncoding): Assert that stylesheets don't maintain decoded text.
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::CachedResource): Remove initialization of hasUnknownEncoding flag.
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::hasUnknownEncoding): Remove.
        (WebCore::CachedResource::setHasUnknownEncoding): Remove.
        (WebCore::CachedResource::CachedResource): Remove initialization of hasUnknownEncoding flag.
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::determineRevalidationPolicy): Set the encoding in case it changed.

2017-04-11  Miguel Gomez  <magomez@igalia.com>

        REGRESSION(r215211): [GTK] Lots of image related tests are timing out, causing the test bot to exit early
        https://bugs.webkit.org/show_bug.cgi?id=170727

        Reviewed by Carlos Garcia Campos.

        Since r215211 ImageDecoder::isSizeAvailable() calls encodedDataStatus() in the different decoder implementations,
        and those implementations force a partial decoding of the image if the size is not available yet. But
        ImageDecoder::isSizeAvailable() was already being used inside the decoders assuming that it wasn't going to
        force this partial decoding. Due to this, there are some situations where the partial decoding is not
        desired but it's happening anyway. For example, the check in setSize(), which causes the partial decoding
        to happen again and again because no value is actually set to the animation size (which causes the timouts
        in the test bot).

        To avoid this, replace all the calls to ImageDecoder::isSizeAvailable() inside the decoders with calls to
        ImageDecoder::encodedDataStatus(), which doesn't force the partial decoding.

        Covered by existent tests.

        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::setSize):
        * platform/image-decoders/ico/ICOImageDecoder.cpp:
        (WebCore::ICOImageDecoder::decodeAtIndex):
        * platform/image-decoders/jpeg/JPEGImageDecoder.h:
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageReader::decode):
        (WebCore::PNGImageDecoder::frameBufferAtIndex):
        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::decode):

2017-04-11  Miguel Gomez  <magomez@igalia.com>

        REGRESSION(r215211): [GTK] Lots of image related tests are crashing, causing the test bot to exit early
        https://bugs.webkit.org/show_bug.cgi?id=170721

        Reviewed by Carlos Garcia Campos.

        r215211 caused an infinite loop because of calls between ImageDecoder::isSizeAvailable() and the specializations of
        ImageDecoder::encodedDataStatus(). Change the different decoders so ImageDecoder::encodedDataStatus doesn't call
        ImageDecoder::isSizeAvailable().

        Covered by existent tests.

        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
        (WebCore::BMPImageDecoder::encodedDataStatus):
        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::encodedDataStatus):
        * platform/image-decoders/ico/ICOImageDecoder.cpp:
        (WebCore::ICOImageDecoder::encodedDataStatus):
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageDecoder::encodedDataStatus):
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::encodedDataStatus):
        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::encodedDataStatus):

2017-04-10  Alex Christensen  <achristensen@webkit.org>

        Revert r215217
        https://bugs.webkit.org/show_bug.cgi?id=170703

        * Configurations/FeatureDefines.xcconfig:

2017-04-10  Chris Dumez  <cdumez@apple.com>

        Fix bad change in r215167.
        https://bugs.webkit.org/show_bug.cgi?id=170656

        Reviewed by Yusuke Suzuki.

        Revert mistake made in r215167.

        * rendering/RenderThemeGtk.cpp:
        (WebCore::RenderThemeGtk::caretBlinkInterval):

2017-04-10  Alex Christensen  <achristensen@webkit.org>

        Continue enabling WebRTC
        https://bugs.webkit.org/show_bug.cgi?id=170703

        Reviewed by Youenn Fablet.

        * Configurations/FeatureDefines.xcconfig:

2017-04-10  Jeremy Jones  <jeremyj@apple.com>

        PlayerLayerView +layerClass methods should use return type Class.
        https://bugs.webkit.org/show_bug.cgi?id=165406

        Reviewed by Sam Weinig.

        No new tests because not behavior change.

        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebAVPictureInPicturePlayerLayerView_layerClass):
        (WebAVPlayerLayerView_layerClass):

2017-04-10  Said Abou-Hallawa  <sabouhallawa@apple.com>

        CachedImage should stop decoding images when unknown type is detected
        https://bugs.webkit.org/show_bug.cgi?id=170530

        Reviewed by Tim Horton.

        If the status of the encoded data is "unknown type", WebKit should stop
        decoding the rest of the data. Ideally WebKit should also cancel loading
        the rest of the encoded data.
        
        To do that we need to add a function to the ImageDecoder to return the
        encodedDataStatus(). We also need to change the return type of Image::setData()
        and Image::dataChanged() form bool to EncodedDataStatus.

        * WebCore.xcodeproj/project.pbxproj: Add ImageTypes.h to the WebCore project.
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::addIncrementalDataBuffer): Replace checking !sizeAvailable 
        by checking if encodedDataStatus isn't an error but it has not reached
        sizeAvailable state
        * loader/cache/CachedResourceClientWalker.h:
        (WebCore::CachedResourceClientWalker::CachedResourceClientWalker): Unrelated clean-up.
        (WebCore::CachedResourceClientWalker::next): Ditto.
        * loader/icon/IconRecord.cpp:
        (WebCore::IconRecord::setImageData): Image::setData() used to return a bool. Now it returns
        an EncodedDataStatus. !setData() now means setData() < EncodedDataStatus::SizeAvailable.
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::dataChanged): Replace the return of dataChanged() from bool
        by EncodedDataStatus.
        * platform/graphics/BitmapImage.h: Replace isSizeAvailable() by a new function
        named encodedDataStatus().
        * platform/graphics/Image.cpp:
        (WebCore::Image::setData): Code clean-up and adding a clarification comment.
        * platform/graphics/Image.h: Change the return of setData() and dataChanged() to be
        EncodedDataStatus.
        (WebCore::Image::dataChanged): Return EncodedDataStatus::Unknown as an indication
        the size is not available but we do not have an error.
        * platform/graphics/ImageTypes.h: Added.
        Image definitions which are shared among Image, ImageDecoder, ImageSource,
        ImageFrameCache and ImageFrame used to be added to ImageFrame.h. This has
        been annoying since these definitions aren't related to ImageFrame only.
        A new header file named ImageTypes.h is to the to include such definitions.
        (WebCore::operator++):
        * platform/graphics/ImageFrame.h:
        (WebCore::operator++): Deleted.
        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::ImageFrameCache): This is the case of a BitmapImage without
        a decoder but with a NativeImage. The status has to be EncodedDataStatus::Complete.
        (WebCore::ImageFrameCache::growFrames): Replace if (isSizeAvailable()) by
        if (encodedDataStatus() >= EncodedDataStatus::SizeAvailable).
        (WebCore::ImageFrameCache::metadata): Ditto.
        (WebCore::ImageFrameCache::encodedDataStatus): This is a replacement for isSizeAvailable().
        Don't cache the EncodedDataStatus until it is Complete. Don't call didDecodeProperties()
        until the status >= EncodedDataStatus::SizeAvailable.
        (WebCore::ImageFrameCache::isSizeAvailable): Deleted.
        * platform/graphics/ImageFrameCache.h: Replace isSizeAvailable() by encodedDataStatus().
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::dataChanged): Make return an EncodedDataStatus instead of returning
        a bool for isSizeAvailable.
        * platform/graphics/ImageSource.h:
        (WebCore::ImageSource::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
        (WebCore::ImageSource::isSizeAvailable): Deleted.
        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::ImageDecoder::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
        The logic of this function is the following:
            -- CGImageSourceGetStatus() can return kCGImageStatusUnexpectedEOF, kCGImageStatusInvalidData
            or kCGImageStatusReadingHeader even if CG will end up recovering form the error and drawing
            the image. Actually CG initializes the status of CGImageSource before receiving any data
            with kCGImageStatusInvalidData. So the status will be considered an error only if all the
            data is received but CG does not move the status of this CGImageSource to Complete.
            -- If CGImageSourceGetStatus() returns Incomplete, this means CG already created the image
            reader and therefore the image type is known.
            -- If CGImageSourceGetStatus() returns UnknownType, this means CG could not create the
            image reader and this should be considered an error.
        (WebCore::ImageDecoder::isSizeAvailable): Deleted.
        * platform/graphics/cg/ImageDecoderCG.h: Replace isSizeAvailable() by encodedDataStatus().
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::dataChanged): The PDFDocument is created only when allDataReceived.
        * platform/graphics/cg/PDFDocumentImage.h: Change the return type from bool to EncodedDataStatus.
        * platform/image-decoders/ImageDecoder.h: 
        (WebCore::ImageDecoder::encodedDataStatus): Add a new function encodedDataStatus(). Deduce the
        status of the encoded data from the flags m_failed, m_isAllDataReceived and m_sizeAvailable in
        this order.
        (WebCore::ImageDecoder::isSizeAvailable): Make this function uses encodedDataStatus().
        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
        (WebCore::BMPImageDecoder::encodedDataStatus): Replace isSizeAvailable() by encodedDataStatus().
        (WebCore::BMPImageDecoder::isSizeAvailable): Deleted.
        * platform/image-decoders/bmp/BMPImageDecoder.h:
        * platform/image-decoders/gif/GIFImageDecoder.cpp:
        (WebCore::GIFImageDecoder::encodedDataStatus): Ditto.
        (WebCore::GIFImageDecoder::isSizeAvailable): Deleted.
        * platform/image-decoders/gif/GIFImageDecoder.h:
        * platform/image-decoders/ico/ICOImageDecoder.cpp:
        (WebCore::ICOImageDecoder::encodedDataStatus): Ditto.
        (WebCore::ICOImageDecoder::isSizeAvailable): Deleted.
        * platform/image-decoders/ico/ICOImageDecoder.h:
        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
        (WebCore::JPEGImageDecoder::encodedDataStatus): Ditto.
        (WebCore::JPEGImageDecoder::isSizeAvailable): Deleted.
        * platform/image-decoders/jpeg/JPEGImageDecoder.h:
        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::encodedDataStatus): Ditto.
        (WebCore::PNGImageDecoder::isSizeAvailable): Deleted.
        * platform/image-decoders/png/PNGImageDecoder.h:
        * platform/image-decoders/webp/WEBPImageDecoder.cpp:
        (WebCore::WEBPImageDecoder::encodedDataStatus): Ditto.
        (WebCore::WEBPImageDecoder::isSizeAvailable): Deleted.
        * platform/image-decoders/webp/WEBPImageDecoder.h:
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::dataChanged): m_page is created only when allDataReceived is true.
        * svg/graphics/SVGImage.h:

2017-04-10  Myles C. Maxfield  <mmaxfield@apple.com>

        Mark SVG-Within-OpenType as "Under Consideration"
        https://bugs.webkit.org/show_bug.cgi?id=170706

        Reviewed by Brady Eidson.

        * features.json:

2017-04-10  Jeremy Jones  <jeremyj@apple.com>

        Add CoreAudioCaptureSource.
        https://bugs.webkit.org/show_bug.cgi?id=170112
        rdar://problem/30293338

        Reviewed by Eric Carlson.

        No new tests because this provides the same funcitonality as AVAudioCaptureSource. 
        Funcionality is covered by existing test cases.

        Add CoreAudioCaptureSource for audio capture. And use it by default in AVCaptureDeviceManager.
        Add UseAVFoundationAudioCapture setting to switch back to AVFoundation for audio capture.

        * WebCore.xcodeproj/project.pbxproj:
        * page/Settings.cpp:
        (WebCore::Settings::useAVFoundationAudioCapture):
        (WebCore::Settings::setUseAVFoundationAudioCapture):
        * page/Settings.h:
        * platform/mediastream/mac/AVCaptureDeviceManager.h:
        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
        (WebCore::AVCaptureDeviceManager::setUseAVFoundationAudioCapture):
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp: Added.
        (WebCore::CoreAudioCaptureSource::create):
        (WebCore::CoreAudioCaptureSource::factory):
        (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
        (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
        (WebCore::CoreAudioCaptureSource::preferredSampleRate):
        (WebCore::CoreAudioCaptureSource::preferredIOBufferDuration):
        (WebCore::CoreAudioCaptureSource::configureMicrophoneProc):
        (WebCore::CoreAudioCaptureSource::configureSpeakerProc):
        (WebCore::CoreAudioCaptureSource::addMicrophoneDataConsumer):
        (WebCore::CoreAudioCaptureSource::removeMicrophoneDataConsumer):
        (WebCore::CoreAudioCaptureSource::addEchoCancellationSource):
        (WebCore::CoreAudioCaptureSource::removeEchoCancellationSource):
        (WebCore::CoreAudioCaptureSource::checkTimestamps):
        (WebCore::CoreAudioCaptureSource::provideSpeakerData):
        (WebCore::CoreAudioCaptureSource::speakerCallback):
        (WebCore::CoreAudioCaptureSource::processMicrophoneSamples):
        (WebCore::CoreAudioCaptureSource::microphoneCallback):
        (WebCore::CoreAudioCaptureSource::defaultOutputDevice):
        (WebCore::CoreAudioCaptureSource::defaultInputDevice):
        (WebCore::CoreAudioCaptureSource::setupAudioUnits):
        (WebCore::CoreAudioCaptureSource::startProducingData):
        (WebCore::CoreAudioCaptureSource::stopProducingData):
        (WebCore::CoreAudioCaptureSource::suspend):
        (WebCore::CoreAudioCaptureSource::resume):
        (WebCore::CoreAudioCaptureSource::capabilities):
        (WebCore::CoreAudioCaptureSource::settings):
        * platform/mediastream/mac/CoreAudioCaptureSource.h: Added.
        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
        (WebCore::RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac):
        (WebCore::RealtimeMediaSourceCenterMac::defaultAudioFactory):

2017-04-10  Youenn Fablet  <youenn@apple.com>

        Wrap legacy MediaStream API in runtime flag
        https://bugs.webkit.org/show_bug.cgi?id=169877

        Reviewed by Alex Christensen.

        Covered by binding tests.

        Marking navigator.getUserMedia and MediaStreamEvent as runtime enabled if mediastream and webrtclegacy api flags
        are on.
        Updated binding generator to support multiple runtime flags.

        * Modules/mediastream/MediaStreamEvent.idl:
        * Modules/mediastream/NavigatorUserMedia.idl:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GetRuntimeEnableFunctionName):
        (GenerateImplementation):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::JSTestObjPrototype::finishCreation):
        * bindings/scripts/test/TestObj.idl:

2017-04-10  Youenn Fablet  <youenn@apple.com>

        Remove deprecated parts of media stream spec
        https://bugs.webkit.org/show_bug.cgi?id=169879

        Reviewed by Jon Lee.

        Removing MediaStreamTrackState 'new' value which was unused.
        Removing MediaStreamTrack _readonly attribute which was unused.

        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::readonly): Deleted.
        * Modules/mediastream/MediaStreamTrack.h:
        * Modules/mediastream/MediaStreamTrack.idl:
        * platform/mediastream/MediaStreamTrackPrivate.cpp:
        (WebCore::MediaStreamTrackPrivate::readonly): Deleted.
        * platform/mediastream/MediaStreamTrackPrivate.h:
        * platform/mediastream/RealtimeMediaSource.h:

2017-04-10  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r215175.

        This change caused a flaky crash in existing media tests.

        Reverted changeset:

        "Add fallback fonts to video captions stylesheet."
        https://bugs.webkit.org/show_bug.cgi?id=170495
        http://trac.webkit.org/changeset/215175

2017-04-10  Wenson Hsieh  <wenson_hsieh@apple.com>

        Data interaction on an image enclosed by an anchor should vend the anchor's URL
        https://bugs.webkit.org/show_bug.cgi?id=170660
        <rdar://problem/31043220>

        Reviewed by Tim Horton.

        When writing an image embedded inside an anchor to the pasteboard, actually use the enclosing anchor's href if
        it exists. Previously, we were simply dropping this argument on the floor.

        Covered by 2 new DataInteractionTests: ImageInLinkToInput and ImageInLinkWithoutHREFToInput.

        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::writeImageToPasteboard):

2017-04-10  Jon Lee  <jonlee@apple.com>

        Update localizable strings to "full screen" from "fullscreen"
        https://bugs.webkit.org/show_bug.cgi?id=170675
        rdar://problem/28207034

        Reviewed by Antoine Quint.

        For localizable strings, it should consistently be "full screen" instead of "fullscreen".

        * English.lproj/Localizable.strings:
        * English.lproj/modern-media-controls-localized-strings.js:
        * platform/LocalizedStrings.cpp:
        (WebCore::contextMenuItemTagExitVideoFullscreen):
        (WebCore::localizedMediaControlElementString):
        * platform/cocoa/LocalizedStringsCocoa.mm:
        (WebCore::exitFullScreenButtonAccessibilityTitle):

2017-04-10  Andreas Kling  <akling@apple.com>

        Don't generate extra scrolling tiles for non-visible pages.
        https://bugs.webkit.org/show_bug.cgi?id=167213
        <rdar://problem/30105774>

        Reviewed by Antti Koivisto.

        Reduce the tiling coverage to a minimum when the page is non-visible.
        On macOS, this means that fully occluded web views can maintain a smaller set of tiles
        in non-volatile surfaces, reducing net footprint.

        Test: compositing/tiling/non-visible-window-tile-coverage.html

        * rendering/RenderLayerBacking.cpp:
        (WebCore::computePageTiledBackingCoverage): If the page's activity state is non-visible, use minimal tile coverage.
        * platform/ScrollView.h:
        * page/FrameView.h:
        * page/FrameView.cpp:
        (WebCore::FrameView::hide): Call adjustTiledBackingCoverage() in hide() since it now takes page visibility into account.

        (WebCore::FrameView::enableSpeculativeTilingIfNeeded):
        * testing/Internals.cpp:
        (WebCore::Internals::setSpeculativeTilingDelayDisabledForTesting):
        * testing/Internals.h:
        * testing/Internals.idl: Add an internals API for disabling the 500ms delay before speculative tiling begins after
        the main frame load finishes. This is needed for reliably testing this change.

2017-04-10  Per Arne Vollan  <pvollan@apple.com>

        Add fallback fonts to video captions stylesheet.
        https://bugs.webkit.org/show_bug.cgi?id=170495

        Reviewed by Myles C. Maxfield.

        The kCTFontCascadeListAttribute key is used to obtain the cascade list for a font reference.

        I have not added a test, since CaptionUserPreferences::testingMode() returns true when running tests,
        preventing this code path from being executed.

        * page/CaptionUserPreferencesMediaAF.cpp:
        (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):

2017-04-10  Chris Dumez  <cdumez@apple.com>

        Drop Timer::startOneShot() overload taking a double
        https://bugs.webkit.org/show_bug.cgi?id=170659

        Reviewed by Yusuke Suzuki.

        Drop Timer::startOneShot() overload taking a double as people should use Seconds type now.

        * Modules/geolocation/GeoNotifier.cpp:
        (WebCore::GeoNotifier::startTimerIfNeeded):
        * Modules/mediasession/WebMediaSessionManager.cpp:
        (WebCore::WebMediaSessionManager::configureWatchdogTimer):
        * Modules/mediasession/WebMediaSessionManager.h:
        * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
        (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
        * Modules/vibration/Vibration.cpp:
        (WebCore::Vibration::timerFired):
        * Modules/websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::close):
        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
        (WebCore::AXObjectCache::postLiveRegionChangeNotification):
        (WebCore::AXObjectCache::focusAriaModalNode):
        * css/CSSFontFace.cpp:
        (WebCore::CSSFontFace::setStatus):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::addToMatchedPropertiesCache):
        * dom/Document.cpp:
        (WebCore::Document::setVisualUpdatesAllowed):
        (WebCore::Document::finishedParsing):
        * dom/ScriptedAnimationController.cpp:
        * editing/AlternativeTextController.cpp:
        (WebCore::AlternativeTextController::startAlternativeTextUITimer):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary):
        (WebCore::HTMLMediaElement::handleSeekToPlaybackPosition):
        * html/SearchInputType.cpp:
        (WebCore::SearchInputType::startSearchEventTimer):
        * html/ValidationMessage.cpp:
        (WebCore::ValidationMessage::setMessageDOMAndStartTimer):
        * html/canvas/WebGLRenderingContextBase.cpp:
        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlPanelElement::startTimer):
        (WebCore::MediaControlPanelElement::makeTransparent):
        * html/track/VTTRegion.cpp:
        (WebCore::VTTRegion::startTimer):
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::frameScheduledNavigationImpl):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::frameScheduledNavigation):
        * inspector/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::frameScheduledNavigation):
        * inspector/InspectorPageAgent.h:
        * loader/NavigationScheduler.cpp:
        (WebCore::NavigationScheduler::startTimer):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::documentDidFinishLoadEvent):
        * loader/icon/IconDatabase.cpp:
        * page/EventHandler.cpp:
        * page/EventSource.cpp:
        (WebCore::EventSource::scheduleReconnect):
        * page/FocusController.cpp:
        (WebCore::FocusController::setFocusedElementNeedsRepaint):
        * page/FrameView.cpp:
        (WebCore::FrameView::scrollPositionChanged):
        (WebCore::FrameView::enableSpeculativeTilingIfNeeded):
        * page/Settings.cpp:
        (WebCore::Settings::Settings):
        * page/Settings.h:
        (WebCore::Settings::setTimeWithoutMouseMovementBeforeHidingControls):
        (WebCore::Settings::timeWithoutMouseMovementBeforeHidingControls):
        * page/SuspendableTimer.h:
        * page/animation/CSSAnimationController.cpp:
        * page/mac/EventHandlerMac.mm:
        * page/mac/TextIndicatorWindow.mm:
        (WebCore::TextIndicatorWindow::setTextIndicator):
        * platform/HysteresisActivity.h:
        (WebCore::HysteresisActivity::stop):
        * platform/ScrollAnimationSmooth.cpp:
        (WebCore::getAnimationParametersForGranularity):
        (WebCore::ScrollAnimationSmooth::updatePerAxisData):
        (WebCore::ScrollAnimationSmooth::animateScroll):
        (WebCore::ScrollAnimationSmooth::animationTimerFired):
        (WebCore::ScrollAnimationSmooth::startNextTimer):
        * platform/ScrollAnimationSmooth.h:
        * platform/Timer.h:
        (WebCore::TimerBase::startRepeating):
        * platform/audio/PlatformMediaSession.cpp:
        (WebCore::PlatformMediaSession::scheduleClientDataBufferingCheck):
        * platform/cocoa/ScrollController.mm:
        (WebCore::ScrollController::scheduleStatelessScrollSnap):
        * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
        (WebCore::GameControllerGamepadProvider::gamepadHadInput):
        * platform/gamepad/mac/HIDGamepadProvider.cpp:
        (WebCore::HIDGamepadProvider::openAndScheduleManager):
        (WebCore::HIDGamepadProvider::valuesChanged):
        * platform/glib/MainThreadSharedTimerGLib.cpp:
        (WebCore::MainThreadSharedTimer::setFireInterval):
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::startTimer):
        (WebCore::BitmapImage::internalStartAnimation):
        (WebCore::BitmapImage::advanceAnimation):
        (WebCore::BitmapImage::resetAnimation):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/MediaPlaybackTargetPicker.cpp:
        * platform/graphics/ShadowBlur.cpp:
        (WebCore::ScratchBuffer::scheduleScratchBufferPurge):
        * platform/graphics/ca/LayerPool.cpp:
        (WebCore::LayerPool::schedulePrune):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
        * platform/graphics/mac/GraphicsContext3DMac.mm:
        (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
        * platform/graphics/texmap/BitmapTexturePool.cpp:
        (WebCore::BitmapTexturePool::scheduleReleaseUnusedTextures):
        (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
        (WebCore::TextureMapperPlatformLayerProxy::scheduleReleaseUnusedBuffers):
        (WebCore::TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired):
        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
        * platform/gtk/ScrollAnimatorGtk.cpp:
        (WebCore::ScrollAnimatorGtk::overlayScrollbarAnimationTimerFired):
        (WebCore::ScrollAnimatorGtk::showOverlayScrollbars):
        (WebCore::ScrollAnimatorGtk::hideOverlayScrollbars):
        * platform/gtk/ScrollAnimatorGtk.h:
        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
        * platform/mac/ScrollAnimatorMac.mm:
        (WebCore::ScrollAnimatorMac::startScrollbarPaintTimer):
        * platform/mock/MediaPlaybackTargetPickerMock.cpp:
        * platform/mock/PlatformSpeechSynthesizerMock.cpp:
        (WebCore::PlatformSpeechSynthesizerMock::speak):
        * platform/mock/TimerEventBasedMock.h:
        (WebCore::TimerEvent::TimerEvent):
        * platform/network/DNSResolveQueue.cpp:
        (WebCore::DNSResolveQueue::add):
        (WebCore::DNSResolveQueue::timerFired):
        * platform/network/PingHandle.h:
        * platform/network/curl/ResourceHandleManager.cpp:
        (WebCore::ResourceHandleManager::downloadTimerCallback):
        (WebCore::ResourceHandleManager::add):
        (WebCore::ResourceHandleManager::cancel):
        * platform/network/mac/NetworkStateNotifierMac.cpp:
        * platform/network/soup/ResourceHandleSoup.cpp:
        (WebCore::ResourceHandle::sendPendingRequest):
        * rendering/ImageQualityController.cpp:
        (WebCore::ImageQualityController::restartTimer):
        * rendering/RenderLayerCompositor.cpp:
        * rendering/RenderProgress.cpp:
        (WebCore::RenderProgress::RenderProgress):
        * rendering/RenderProgress.h:
        * rendering/RenderText.cpp:
        (WebCore::SecureTextTimer::restart):
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::animationRepeatIntervalForProgressBar):
        * rendering/RenderTheme.h:
        (WebCore::RenderTheme::mediaControlsFadeOutDuration):
        * rendering/RenderThemeGtk.cpp:
        (WebCore::RenderThemeGtk::animationRepeatIntervalForProgressBar):
        * rendering/RenderThemeGtk.h:
        * rendering/RenderThemeIOS.h:
        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::animationRepeatIntervalForProgressBar):
        * rendering/RenderThemeMac.h:
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::animationRepeatIntervalForProgressBar):
        (WebCore::RenderThemeMac::animationDurationForProgressBar):
        * replay/EventLoopInputDispatcher.cpp:
        (WebCore::EventLoopInputDispatcher::dispatchInputSoon):
        * svg/animation/SMILTimeContainer.cpp:
        (WebCore::SMILTimeContainer::startTimer):
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls):
        * testing/InternalSettings.h:
        * testing/Internals.cpp:
        (WebCore::Internals::setImageFrameDecodingDuration):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::createRequest):

2017-04-10  Miguel Gomez  <magomez@igalia.com>

        REGRESSION(r205841): [GTK] Test fast/images/animated-png.html is failing since r205841
        https://bugs.webkit.org/show_bug.cgi?id=168425

        Reviewed by Said Abou-Hallawa.

        There is a problem with animations that are blending their frames into the previous frame. Due to a change
        in how pixel components are premultiplied (the result is now rounded up), the parameters to the blending
        operation may vary in one unit, causing the result of the blending to be different from the expected result.
        In order to fix this, a new parameter is added to indicate whether we want to use rounding up when
        premultiplying or not, and ImageBackingStore uses that parameter to disable rounding up.

        Adjusted the expectation for fast/images/animated-png.html, as it must pass now.

        * platform/graphics/Color.cpp:
        (WebCore::premultipliedChannel):
        (WebCore::makePremultipliedRGBA):
        * platform/graphics/Color.h:
        * platform/graphics/ImageBackingStore.h:
        (WebCore::ImageBackingStore::blendPixel):
        (WebCore::ImageBackingStore::pixelValue):

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

        [WK2] Add infrastructure to perform actions after an asynchronous position information request finishes
        https://bugs.webkit.org/show_bug.cgi?id=170658
        <rdar://problem/31431450>

        Reviewed by Tim Horton.

        Minor adjustments to fix the build in the newest version of the SDK.

        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):
        (-[WebItemProviderPasteboard _tryToCreateAndAppendObjectOfClass:toArray:usingProvider:]):

2017-04-09  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Annotate Seconds' member functions and operators with constexpr
        https://bugs.webkit.org/show_bug.cgi?id=170662

        Reviewed by Daniel Bates.

        * page/Frame.cpp:

2017-04-09  Chris Dumez  <cdumez@apple.com>

        Drop Timer::startRepeating() overload taking a double
        https://bugs.webkit.org/show_bug.cgi?id=170656

        Reviewed by Yusuke Suzuki.

        Drop Timer::startRepeating() overload taking a double as people should use Seconds type now.

        * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
        (WebCore::CanvasCaptureMediaStreamTrack::Source::startProducingData):
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::updateAppearance):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::startProgressEventTimer):
        (WebCore::HTMLMediaElement::scheduleTimeupdateEvent):
        * html/HTMLMediaElement.h:
        * html/MediaController.cpp:
        (MediaController::MediaController):
        (MediaController::scheduleTimeupdateEvent):
        * html/MediaController.h:
        * html/MediaElementSession.cpp:
        * inspector/InspectorOverlay.cpp:
        (WebCore::InspectorOverlay::showPaintRect):
        * loader/ProgressTracker.cpp:
        * page/AutoscrollController.cpp:
        * page/Frame.cpp:
        * page/PageOverlay.cpp:
        (WebCore::PageOverlay::startFadeAnimation):
        * page/SuspendableTimer.h:
        * page/WheelEventTestTrigger.cpp:
        (WebCore::WheelEventTestTrigger::setTestCallbackAndStartNotificationTimer):
        * platform/Theme.h:
        (WebCore::Theme::caretBlinkInterval):
        * platform/Timer.h:
        * platform/cocoa/ScrollController.mm:
        (WebCore::ScrollController::startSnapRubberbandTimer):
        (WebCore::ScrollController::startScrollSnapTimer):
        * platform/graphics/ca/TileGrid.cpp:
        (WebCore::TileGrid::scheduleCohortRemoval):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
        * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
        (WebCore::MockRealtimeAudioSourceMac::reconfigure):
        * platform/mock/MockRealtimeAudioSource.cpp:
        (WebCore::MockRealtimeAudioSource::startProducingData):
        * platform/mock/MockRealtimeAudioSource.h:
        (WebCore::MockRealtimeAudioSource::renderInterval):
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::startProducingData):
        (WebCore::MockRealtimeVideoSource::applyFrameRate):
        * rendering/RenderMarquee.cpp:
        (WebCore::RenderMarquee::start):
        (WebCore::RenderMarquee::updateMarqueeStyle):
        * rendering/RenderTheme.h:
        (WebCore::RenderTheme::caretBlinkInterval):
        * rendering/RenderThemeGtk.cpp:
        (WebCore::RenderThemeGtk::caretBlinkInterval):
        * rendering/RenderThemeGtk.h:
        * xml/XMLHttpRequestProgressEventThrottle.cpp:
        (WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent):
        * xml/XMLHttpRequestProgressEventThrottle.h:

2017-04-09  Fujii Hironori  <Hironori.Fujii@sony.com>

        generate-bindings-all.pl shouldn't use Perl threads
        https://bugs.webkit.org/show_bug.cgi?id=170106

        Reviewed by Yusuke Suzuki.

        The use of interpreter-based threads in Perl is officially
        discouraged and not all Linux distributions and BSD compile Perl
        with threads support. Use fork instead of threads to run
        generate-bindings.pl in parallel.

        * bindings/scripts/generate-bindings-all.pl:
        (spawnGenerateBindingsIfNeeded): Added.
        (executeCommand): Removed the workaround for Cygwin Perl threads.
        (spawnCommand): Added.
        (worker): Deleted.

2017-04-09  Said Abou-Hallawa  <sabouhallawa@apple.com>

        REGRESSION(r214635): Calculate image subsampling only for CG
        https://bugs.webkit.org/show_bug.cgi?id=170353

        Reviewed by Simon Fraser.

        In r214635, we needed to calculate the image scaleFactor for all platforms.
        It was needed do the calculation: sizeForDrawing = sizeOfImage * imageScaleFactor.
        This made ImageSource::subsamplingLevelForScale() now returns a SubsamplingLevel
        not equal to SubsamplingLevel::Default if the image scaleFactor is greater
        than {1, 1} for all platforms. The subsamplingLevel should only be used for CG.
        
        This is also a chance to make nativeImageDrawingScale() a across platform
        function and move it to the GraphicsContext class.

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::draw):
        * platform/graphics/GraphicsContext.cpp:
        (WebCore::GraphicsContext::scaleFactorForDrawing):
        * platform/graphics/GraphicsContext.h:
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::subsamplingLevelForScaleFactor):
        (WebCore::ImageSource::subsamplingLevelForScale): Deleted.
        * platform/graphics/ImageSource.h:
        * platform/graphics/NativeImage.h:
        * platform/graphics/cairo/NativeImageCairo.cpp:
        (WebCore::nativeImageDrawingScale): Deleted.
        * platform/graphics/cg/NativeImageCG.cpp:
        (WebCore::nativeImageDrawingScale): Deleted.
        * platform/graphics/win/NativeImageDirect2D.cpp:
        (WebCore::nativeImageDrawingScale): Deleted.

2017-04-09  Chris Dumez  <cdumez@apple.com>

        Start dropping Timer API dealing with double
        https://bugs.webkit.org/show_bug.cgi?id=170649

        Reviewed by Yusuke Suzuki.

        Start dropping Timer API dealing with double as people should use Seconds now.

        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
        (WebCore::WebKitMediaKeySession::generateKeyRequest):
        (WebCore::WebKitMediaKeySession::update):
        * Modules/geolocation/GeoNotifier.cpp:
        (WebCore::GeoNotifier::setFatalError):
        (WebCore::GeoNotifier::setUseCachedPosition):
        * Modules/geolocation/Geolocation.cpp:
        (WebCore::Geolocation::resume):
        * Modules/indexeddb/IDBTransaction.cpp:
        (WebCore::IDBTransaction::schedulePendingOperationTimer):
        (WebCore::IDBTransaction::scheduleCompletedOperationTimer):
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::rangeRemoval):
        (WebCore::SourceBuffer::appendBufferInternal):
        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::scheduleActiveStateChange):
        * Modules/mediastream/RTCDTMFSender.cpp:
        (WebCore::RTCDTMFSender::scheduleDispatchEvent):
        * Modules/mediastream/RTCDataChannel.cpp:
        (WebCore::RTCDataChannel::scheduleDispatchEvent):
        * Modules/notifications/Notification.cpp:
        * Modules/notifications/NotificationCenter.cpp:
        (WebCore::NotificationCenter::requestPermission):
        * Modules/vibration/Vibration.cpp:
        (WebCore::Vibration::vibrate):
        * Modules/websockets/WebSocket.cpp:
        (WebCore::WebSocket::resume):
        * Modules/websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::resume):
        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::postNotification):
        * bindings/js/GCController.cpp:
        (WebCore::GCController::garbageCollectOnNextRunLoop):
        * css/CSSFontSelector.cpp:
        (WebCore::CSSFontSelector::beginLoadingFontSoon):
        * dom/Document.cpp:
        (WebCore::Document::scheduleStyleRecalc):
        (WebCore::Document::updateFocusAppearanceSoon):
        (WebCore::Document::resumeScheduledTasks):
        (WebCore::Document::requestFullScreenForElement):
        (WebCore::Document::webkitDidEnterFullScreenForElement):
        (WebCore::Document::webkitDidExitFullScreenForElement):
        (WebCore::Document::decrementLoadEventDelayCount):
        (WebCore::Document::didAssociateFormControl):
        (WebCore::Document::setCachedDOMCookies):
        * dom/DocumentEventQueue.cpp:
        (WebCore::DocumentEventQueue::enqueueEvent):
        * dom/EventSender.h:
        (WebCore::EventSender<T>::dispatchEventSoon):
        * dom/Microtasks.cpp:
        (WebCore::MicrotaskQueue::append):
        * dom/ScriptRunner.cpp:
        (WebCore::ScriptRunner::resume):
        (WebCore::ScriptRunner::notifyFinished):
        * dom/ScriptableDocumentParser.cpp:
        (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
        * editing/Editor.cpp:
        (WebCore::Editor::respondToChangedSelection):
        * editing/SpellChecker.cpp:
        (WebCore::SpellChecker::didCheck):
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::finishRequestAutocomplete):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::scheduleDelayedAction):
        (WebCore::HTMLMediaElement::beginScanning):
        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::setDisplayState):
        * html/HTMLSourceElement.cpp:
        (WebCore::HTMLSourceElement::scheduleErrorEvent):
        (WebCore::HTMLSourceElement::resume):
        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::scheduleLoad):
        * html/MediaController.cpp:
        (MediaController::currentTime):
        (MediaController::scheduleEvent):
        * html/MediaDocument.cpp:
        (WebCore::MediaDocument::mediaElementSawUnsupportedTracks):
        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
        * html/ValidationMessage.cpp:
        (WebCore::ValidationMessage::setMessage):
        (WebCore::ValidationMessage::requestToHideMessage):
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::loseContextImpl):
        (WebCore::WebGLRenderingContextBase::forceRestoreContext):
        (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
        * html/parser/HTMLParserScheduler.cpp:
        (WebCore::HTMLParserScheduler::continueNextChunkTimerFired):
        (WebCore::HTMLParserScheduler::scheduleForResume):
        (WebCore::HTMLParserScheduler::resume):
        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlTextTrackContainerElement::updateSizes):
        * html/track/LoadableTextTrack.cpp:
        (WebCore::LoadableTextTrack::scheduleLoad):
        * inspector/InspectorCSSAgent.cpp:
        (WebCore::ChangeRegionOversetTask::scheduleFor):
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::RevalidateStyleAttributeTask::scheduleFor):
        * inspector/InspectorFrontendClientLocal.cpp:
        (WebCore::InspectorBackendDispatchTask::dispatch):
        (WebCore::InspectorBackendDispatchTask::timerFired):
        * inspector/WebHeapAgent.cpp:
        (WebCore::SendGarbageCollectionEventsTask::addGarbageCollection):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::startDataLoadTimer):
        (WebCore::DocumentLoader::deliverSubstituteResourcesAfterDelay):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::startCheckCompleteTimer):
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::updatedHasPendingEvent):
        * loader/TextTrackLoader.cpp:
        (WebCore::TextTrackLoader::notifyFinished):
        (WebCore::TextTrackLoader::newCuesParsed):
        (WebCore::TextTrackLoader::fileFailedToParse):
        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::scheduleReachedMaxAppCacheSizeCallback):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::Callback::Callback):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::loadDone):
        * loader/cache/MemoryCache.cpp:
        (WebCore::MemoryCache::pruneSoon):
        * page/CaptionUserPreferences.cpp:
        (WebCore::CaptionUserPreferences::notify):
        * page/CaptionUserPreferencesMediaAF.cpp:
        (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::postMessage):
        * page/EventHandler.cpp:
        (WebCore::EventHandler::scheduleHoverStateUpdate):
        * page/EventSource.cpp:
        (WebCore::EventSource::scheduleInitialConnect):
        * page/FrameView.cpp:
        (WebCore::FrameView::layout):
        (WebCore::FrameView::performPostLayoutTasks):
        * page/Settings.cpp:
        (WebCore::Settings::setLoadsImagesAutomatically):
        (WebCore::Settings::setImagesEnabled):
        * page/SuspendableTimer.h:
        * page/animation/CSSAnimationController.cpp:
        (WebCore::CSSAnimationControllerPrivate::startUpdateStyleIfNeededDispatcher):
        * page/mac/ServicesOverlayController.mm:
        (WebCore::ServicesOverlayController::invalidateHighlightsOfType):
        * page/scrolling/AsyncScrollingCoordinator.cpp:
        (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
        * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
        (WebCore::ScrollingCoordinatorIOS::scheduleTreeStateCommit):
        * page/scrolling/mac/ScrollingCoordinatorMac.mm:
        (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
        * platform/GenericTaskQueue.cpp:
        (WebCore::TaskDispatcher<Timer>::postTask):
        * platform/Scrollbar.cpp:
        (WebCore::Scrollbar::autoscrollPressedPart):
        (WebCore::Scrollbar::startTimerIfNeeded):
        * platform/Scrollbar.h:
        * platform/ScrollbarTheme.h:
        (WebCore::ScrollbarTheme::initialAutoscrollTimerDelay):
        (WebCore::ScrollbarTheme::autoscrollTimerDelay):
        * platform/Timer.cpp:
        * platform/Timer.h:
        (WebCore::TimerBase::startRepeating):
        (WebCore::TimerBase::startOneShot):
        (WebCore::TimerBase::augmentFireInterval):
        (WebCore::TimerBase::augmentRepeatInterval):
        * platform/gamepad/mac/HIDGamepadProvider.cpp:
        (WebCore::HIDGamepadProvider::deviceAdded):
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::networkStateChanged):
        * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
        (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
        (WebCore::MediaSelectionGroupAVFObjC::setSelectedOption):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
        * platform/graphics/ca/TileCoverageMap.cpp:
        (WebCore::TileCoverageMap::setNeedsUpdate):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
        * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
        (VideoRenderRequestScheduler::requestRender):
        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
        (WebCore::TextureMapperPlatformLayerProxy::scheduleUpdateOnCompositorThread):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::addAnimation):
        * platform/gtk/ScrollAnimatorGtk.cpp:
        (WebCore::ScrollAnimatorGtk::showOverlayScrollbars):
        * platform/gtk/ScrollbarThemeGtk.h:
        * platform/ios/LegacyTileCache.mm:
        (WebCore::LegacyTileCache::finishedCreatingTiles):
        (WebCore::LegacyTileCache::setSpeculativeTileCreationEnabled):
        * platform/ios/ScrollbarThemeIOS.h:
        * platform/ios/ScrollbarThemeIOS.mm:
        (WebCore::ScrollbarThemeIOS::initialAutoscrollTimerDelay):
        (WebCore::ScrollbarThemeIOS::autoscrollTimerDelay):
        * platform/mac/ScrollAnimatorMac.mm:
        (WebCore::ScrollAnimatorMac::sendContentAreaScrolledSoon):
        * platform/mac/ScrollbarThemeMac.h:
        * platform/mac/ScrollbarThemeMac.mm:
        (WebCore::ScrollbarThemeMac::preferencesChanged):
        (WebCore::ScrollbarThemeMac::initialAutoscrollTimerDelay):
        (WebCore::ScrollbarThemeMac::autoscrollTimerDelay):
        * platform/mock/DeviceOrientationClientMock.cpp:
        (WebCore::DeviceOrientationClientMock::setOrientation):
        * platform/mock/GeolocationClientMock.cpp:
        (WebCore::GeolocationClientMock::asyncUpdatePermission):
        (WebCore::GeolocationClientMock::asyncUpdateController):
        * platform/mock/MockMediaEndpoint.cpp:
        (WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
        (WebCore::MockMediaEndpoint::iceCandidateTimerFired):
        (WebCore::MockMediaEndpoint::stepIceTransportStates):
        (WebCore::MockMediaEndpoint::iceTransportTimerFired):
        (WebCore::MockMediaEndpoint::unmuteRemoteSourcesByMid):
        (WebCore::MockMediaEndpoint::unmuteTimerFired):
        * platform/network/DataURLDecoder.cpp:
        (WebCore::DataURLDecoder::DecodingResultDispatcher::startTimer):
        * platform/network/ResourceHandle.cpp:
        (WebCore::ResourceHandle::scheduleFailure):
        (WebCore::ResourceHandle::setDefersLoading):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::scheduleCompositingLayerUpdate):
        * rendering/RenderNamedFlowThread.cpp:
        (WebCore::RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded):
        * rendering/RenderScrollbarTheme.h:
        * rendering/RenderView.cpp:
        (WebCore::RenderView::scheduleLazyRepaint):
        * style/StyleScope.cpp:
        (WebCore::Style::Scope::scheduleUpdate):
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::sendSVGLoadEventIfPossibleAsynchronously):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::prepareToSend):
        (WebCore::XMLHttpRequest::didFail):
        (WebCore::XMLHttpRequest::resume):
        * xml/XMLHttpRequestProgressEventThrottle.cpp:
        (WebCore::XMLHttpRequestProgressEventThrottle::resume):

2017-04-08  Myles C. Maxfield  <mmaxfield@apple.com>

        [Variation Fonts] Width values of GX fonts are not mapped correctly
        https://bugs.webkit.org/show_bug.cgi?id=170367

        Reviewed by Simon Fraser.

        For some reason, when I performed my calculations for how to map the 'wdth' axis of GX-style
        variation fonts, I thought that font-stretch: 100% should map to a variation value of 0.0.
        Instead, this should map to 1.0.

        Test: fast/text/variations/gx-width.html

        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::denormalizeSlope):
        (WebCore::denormalizeVariationWidth):
        (WebCore::normalizeVariationWidth):
        (WebCore::normalizeWidth):
        (WebCore::preparePlatformFont):
        (WebCore::variationCapabilitiesForFontDescriptor):
        (WebCore::denormalizeWidth): Deleted.

2017-04-08  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream Mac] Revert change of Mac video capture format
        https://bugs.webkit.org/show_bug.cgi?id=170642
        <rdar://problem/31520492>

        Reviewed by Sam Weinig.

        Revert r214968 which changed macOS video capture format to kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
        from kCVPixelFormatType_420YpCbCr8Planar because AVSampleBufferDisplayLayer sometimes fails
        to display the former.

        * platform/mediastream/mac/AVVideoCaptureSource.mm:

2017-04-08  Said Abou-Hallawa  <sabouhallawa@apple.com>

        A synchronous DecodingOptions should be compatible with any asynchronous sizeForDrawing DecodingOptions
        https://bugs.webkit.org/show_bug.cgi?id=170577

        Reviewed by Simon Fraser.

        Once a synchronous decoded frame is found, there is no need to decode it
        again. This decoded frame is suitable for any sizeForDrawing. This will
        prevent double decoding if one image client wants synchronous decoded
        frame while the other needs an asynchronous decode frame for a specific
        sizeForDrawing.

        Test: fast/images/async-image-background-image-repeated.html

        * platform/graphics/DecodingOptions.h:
        (WebCore::DecodingOptions::DecodingOptions):
        (WebCore::DecodingOptions::isNone):
        (WebCore::DecodingOptions::isAsynchronousCompatibleWith):

2017-04-08  Simon Fraser  <simon.fraser@apple.com>

        Align the timers for throttled rAF to reduce power usage
        https://bugs.webkit.org/show_bug.cgi?id=170630
        rdar://problem/31490620

        Reviewed by Chris Dumez.

        Align the timers for all throttled ScriptedAnimationControllers in the process with
        a resolution of 30ms, which reduces process wake-ups and thus saves power.

        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::scheduleAnimation):

2017-04-08  Chris Dumez  <cdumez@apple.com>

        Drop std::chrono support from Timer class
        https://bugs.webkit.org/show_bug.cgi?id=170645

        Reviewed by Sam Weinig.

        Drop std::chrono support from Timer class now that we prefer using Seconds type.

        * css/CSSImageGeneratorValue.cpp:
        * html/HTMLPlugInImageElement.cpp:
        * html/canvas/WebGLRenderingContextBase.cpp:
        * loader/cache/CachedResource.cpp:
        (WebCore::deadDecodedDataDeletionIntervalForResourceType):
        (WebCore::CachedResource::destroyDecodedDataIfNeeded):
        * loader/cache/MemoryCache.cpp:
        (WebCore::MemoryCache::MemoryCache):
        * loader/cache/MemoryCache.h:
        (WebCore::MemoryCache::setDeadDecodedDataDeletionInterval):
        (WebCore::MemoryCache::deadDecodedDataDeletionInterval):
        * page/PerformanceMonitor.cpp:
        * page/SuspendableTimer.h:
        * page/mac/ServicesOverlayController.h:
        * page/mac/ServicesOverlayController.mm:
        (WebCore::ServicesOverlayController::selectionRectsDidChange):
        (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
        (WebCore::ServicesOverlayController::determineActiveHighlight):
        (WebCore::ServicesOverlayController::mouseEvent):
        * platform/Timer.h:
        (WebCore::TimerBase::startRepeating):
        (WebCore::TimerBase::startOneShot):
        (WebCore::TimerBase::augmentFireInterval):
        (WebCore::TimerBase::augmentRepeatInterval):
        (WebCore::DeferrableOneShotTimer::DeferrableOneShotTimer):
        * platform/graphics/FontCache.cpp:
        (WebCore::FontCache::fontForFamily):
        * platform/graphics/ca/TileController.cpp:
        * platform/graphics/cg/IOSurfacePool.cpp:
        * platform/graphics/cg/SubimageCacheWithTimer.cpp:
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::setTimeout):
        (WebCore::XMLHttpRequest::createRequest):
        * xml/XMLHttpRequest.h:

2017-04-08  Simon Fraser  <simon.fraser@apple.com>

        Update CSSProperties.json with correct fill-and-stroke status, and other cleanup
        https://bugs.webkit.org/show_bug.cgi?id=170643

        Reviewed by Chris Dumez.

        Structural changes:
            - move implementation-related "comment" blocks into "codegen-properties"
            - move status-related "comment" blocks into "status"
        
        Add the concept of "obsolete-category" and "obsolete-url" for properties
        like the text-fill-and-stroke properties that used to be specified in SVG but
        now have their own module shared with CSS.
        
        Update the status of paint-order, stroke-linecap, stroke-linejoin, stroke-miterlimit
        and stroke-width to "supported", overriding the default for css-text-fill-and-stroke which
        is "under consideration".
        
        Add display values "flow" and "flow-root" but mark them as unimplemented.
        
        Fix makeprop.pl to ignore comments inside codegen-properties.

        * css/CSSProperties.json:
        * css/makeprop.pl:
        (addProperty):

2017-04-08  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream iOS] Update muted state when interrupted
        https://bugs.webkit.org/show_bug.cgi?id=170605
        <rdar://problem/31503896>

        Reviewed by Youenn Fablet.

        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::setMuted): Don't check both m_stopped and stopped(). Split code
        to  notify observers out into notifyMutedObservers.
        (WebCore::RealtimeMediaSource::notifyMutedObservers): Split from setMuted.
        * platform/mediastream/RealtimeMediaSource.h:

        * platform/mediastream/mac/AVMediaCaptureSource.h:
        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        (WebCore::AVMediaCaptureSource::captureSessionIsRunningDidChange): Set m_muted directly and 
        call notifyMutedObservers because the session has already stopped running.
        (WebCore::AVMediaCaptureSource::isProducingData): Move from .h file to make debugging easier.

2017-04-08  Simon Fraser  <simon.fraser@apple.com>

        Unprefix CSS cursor values grab and grabbing
        https://bugs.webkit.org/show_bug.cgi?id=170543

        Reviewed by Jon Lee.

        Add support for unprefixed "grab" and "grabbing" values for cursor (retaining
        support for the prefixed values) which are now in <https://drafts.csswg.org/css-ui-3/#cursor>

        Canonicalize the order of the values based on the order in the spec in the enums
        and switch statements.

        Tested by fast/css/cursor-parsing.html

        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator ECursor):
        * css/CSSProperties.json:
        * css/CSSValueKeywords.in:
        * page/EventHandler.cpp:
        (WebCore::EventHandler::selectCursor):
        * rendering/style/RenderStyleConstants.h:

2017-04-08  Youenn Fablet  <youenn@apple.com>

        WebRTC tests gardening
        https://bugs.webkit.org/show_bug.cgi?id=170508

        Reviewed by Eric Carlson.

        * Configurations/FeatureDefines.xcconfig: Changing webrtc enabling for ios.

2017-04-08  Youenn Fablet  <youenn@apple.com>

        MediaStreamTrack id should be preserved by PeerConnection
        https://bugs.webkit.org/show_bug.cgi?id=170624

        Reviewed by Eric Carlson.

        Covered by updated test.

        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::createReceiverForSource): Setting track id according source id.

2017-04-08  Chris Dumez  <cdumez@apple.com>

        Timer's nextFireInterval() / repeatInterval() should return Seconds
        https://bugs.webkit.org/show_bug.cgi?id=170639

        Reviewed by Simon Fraser.

        Timer's nextFireInterval() / repeatInterval() should return Seconds, not double.

        * loader/NavigationScheduler.cpp:
        * page/DOMTimer.cpp:
        (WebCore::DOMTimer::updateTimerIntervalIfNecessary):
        * page/SuspendableTimer.cpp:
        (WebCore::SuspendableTimer::suspend):
        (WebCore::SuspendableTimer::repeatInterval):
        * page/SuspendableTimer.h:
        * page/animation/AnimationBase.cpp:
        (WebCore::AnimationBase::timeToNextService):
        (WebCore::AnimationBase::getTimeToNextEvent):
        (WebCore::AnimationBase::goIntoEndingOrLoopingState):
        * page/animation/AnimationBase.h:
        * page/animation/CSSAnimationController.cpp:
        (WebCore::CSSAnimationControllerPrivate::updateAnimations):
        (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer):
        (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
        (WebCore::CSSAnimationControllerPrivate::animationFrameCallbackFired):
        * page/animation/CSSAnimationControllerPrivate.h:
        * page/animation/CompositeAnimation.cpp:
        (WebCore::CompositeAnimation::timeToNextService):
        * page/animation/CompositeAnimation.h:
        * page/animation/ImplicitAnimation.cpp:
        (WebCore::ImplicitAnimation::timeToNextService):
        * page/animation/ImplicitAnimation.h:
        * page/animation/KeyframeAnimation.cpp:
        (WebCore::KeyframeAnimation::timeToNextService):
        * page/animation/KeyframeAnimation.h:
        * platform/ThreadTimers.cpp:
        (WebCore::ThreadTimers::sharedTimerFiredInternal):
        * platform/Timer.cpp:
        (WebCore::TimerBase::nextFireInterval):
        * platform/Timer.h:
        (WebCore::TimerBase::repeatInterval):
        * platform/graphics/ca/TileController.cpp:
        (WebCore::TileController::setIsInWindow):
        (WebCore::TileController::scheduleTileRevalidation):
        * platform/graphics/ca/TileController.h:
        * platform/graphics/ca/TileGrid.cpp:
        (WebCore::TileGrid::revalidateTiles):

2017-04-08  Csaba Osztrogonác  <ossy@webkit.org>

        Unreviewed Mac cmake buildfix after r215051, just for fun.
        https://bugs.webkit.org/show_bug.cgi?id=169761

        * PlatformMac.cmake:

2017-04-07  Simon Fraser  <simon.fraser@apple.com>

        Build fix: TimerBase::start(double, double) can't be inline and exported,
        so make it non-inline.

        * platform/Timer.cpp:
        (WebCore::TimerBase::start):
        * platform/Timer.h:
        (WebCore::TimerBase::start): Deleted.

2017-04-07  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r203941): iAd Producer widgets fail to play in iBooks
        https://bugs.webkit.org/show_bug.cgi?id=170635
        <rdar://problem/30797958>

        Reviewed by Daniel Bates.

        Extend the MouseEvent::initMouseEvent() workaround we added for iAd Producer
        to iBooks since the iBooks widgets generated by iAd Producer contain the same
        bug.

        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::initMouseEventQuirk):

2017-04-07  Chris Dumez  <cdumez@apple.com>

        Start using MonotonicTime / Seconds in Timer class
        https://bugs.webkit.org/show_bug.cgi?id=170625

        Reviewed by Simon Fraser.

        Start using MonotonicTime / Seconds in Timer class. More work will be needed
        for the transition to be complete. I plan to do this in a follow-up.

        * page/DOMTimer.cpp:
        (WebCore::DOMTimer::alignedFireTime):
        * page/DOMTimer.h:
        * page/SuspendableTimer.cpp:
        (WebCore::SuspendableTimer::suspend):
        (WebCore::SuspendableTimer::startRepeating):
        (WebCore::SuspendableTimer::startOneShot):
        (WebCore::SuspendableTimer::repeatInterval):
        (WebCore::SuspendableTimer::augmentFireInterval):
        (WebCore::SuspendableTimer::augmentRepeatInterval):
        * page/SuspendableTimer.h:
        (WebCore::SuspendableTimer::startRepeating):
        (WebCore::SuspendableTimer::startOneShot):
        (WebCore::SuspendableTimer::augmentFireInterval):
        (WebCore::SuspendableTimer::augmentRepeatInterval):
        * platform/ThreadTimers.cpp:
        (WebCore::ThreadTimers::ThreadTimers):
        (WebCore::ThreadTimers::setSharedTimer):
        (WebCore::ThreadTimers::updateSharedTimer):
        (WebCore::ThreadTimers::sharedTimerFiredInternal):
        (WebCore::ThreadTimers::fireTimersInNestedEventLoop):
        * platform/ThreadTimers.h:
        * platform/Timer.cpp:
        (WebCore::TimerHeapLessThanFunction::operator()):
        (WebCore::TimerBase::TimerBase):
        (WebCore::TimerBase::start):
        (WebCore::TimerBase::stop):
        (WebCore::TimerBase::nextFireInterval):
        (WebCore::TimerBase::heapPop):
        (WebCore::TimerBase::updateHeapIfNeeded):
        (WebCore::TimerBase::setNextFireTime):
        (WebCore::TimerBase::nextUnalignedFireInterval):
        * platform/Timer.h:
        (WebCore::TimerBase::start):
        (WebCore::TimerBase::startOneShot):
        (WebCore::TimerBase::repeatInterval):
        (WebCore::TimerBase::repeatIntervalSeconds):
        (WebCore::TimerBase::augmentFireInterval):
        (WebCore::TimerBase::augmentRepeatInterval):
        (WebCore::TimerBase::alignedFireTime):
        (WebCore::TimerBase::isActive):
        * testing/Internals.cpp:
        (WebCore::Internals::isTimerThrottled):

2017-04-07  Yuichiro Kikura  <y.kikura@gmail.com>

        WebGPU: implement ComputeCommandEncoder and related components
        https://bugs.webkit.org/show_bug.cgi?id=170444

        Reviewed by Alex Christensen.

        I implemented WebGPUComputeCommandEncoder and related components based on the WebGPU proposal.
        https://webkit.org/wp-content/uploads/webgpu-api-proposal.html

        Test: fast/canvas/webgpu/webgpu-dispatch.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSWebGPUCommandBufferCustom.cpp: Added.
        (WebCore::JSWebGPUCommandBuffer::completed):
        * html/canvas/WebGPUCommandBuffer.cpp:
        (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder):
        * html/canvas/WebGPUCommandBuffer.h:
        * html/canvas/WebGPUCommandBuffer.idl:
        * html/canvas/WebGPUComputeCommandEncoder.cpp: Added.
        (WebCore::GPUSizeMake):
        (WebCore::WebGPUComputeCommandEncoder::create):
        (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder):
        (WebCore::WebGPUComputeCommandEncoder::~WebGPUComputeCommandEncoder):
        (WebCore::WebGPUComputeCommandEncoder::setComputePipelineState):
        (WebCore::WebGPUComputeCommandEncoder::setBuffer):
        (WebCore::WebGPUComputeCommandEncoder::dispatch):
        (WebCore::WebGPUComputeCommandEncoder::endEncoding):
        * html/canvas/WebGPUComputeCommandEncoder.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
        (WebCore::WebGPUComputeCommandEncoder::computeCommandEncoder):
        * html/canvas/WebGPUComputeCommandEncoder.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
        * html/canvas/WebGPUComputePipelineState.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
        (WebCore::WebGPUComputePipelineState::create):
        (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState):
        (WebCore::WebGPUComputePipelineState::~WebGPUComputePipelineState):
        * html/canvas/WebGPUComputePipelineState.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
        (WebCore::WebGPUComputePipelineState::computePipelineState):
        * html/canvas/WebGPUComputePipelineState.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
        * html/canvas/WebGPURenderingContext.cpp:
        (WebCore::WebGPURenderingContext::createComputePipelineState):
        * html/canvas/WebGPURenderingContext.h:
        * html/canvas/WebGPURenderingContext.idl:
        * html/canvas/WebGPUSize.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
        * html/canvas/WebGPUSize.idl: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
        * platform/graphics/cocoa/GPUCommandBufferMetal.mm:
        (WebCore::GPUCommandBuffer::completed):
        * platform/graphics/cocoa/GPUComputeCommandEncoderMetal.mm: Added.
        (WebCore::MTLSizeMake):
        (WebCore::GPUComputeCommandEncoder::GPUComputeCommandEncoder):
        (WebCore::GPUComputeCommandEncoder::setComputePipelineState):
        (WebCore::GPUComputeCommandEncoder::setBuffer):
        (WebCore::GPUComputeCommandEncoder::dispatch):
        (WebCore::GPUComputeCommandEncoder::endEncoding):
        (WebCore::GPUComputeCommandEncoder::platformComputeCommandEncoder):
        * platform/graphics/cocoa/GPUComputePipelineStateMetal.mm: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
        (WebCore::GPUComputePipelineState::GPUComputePipelineState):
        (WebCore::GPUComputePipelineState::platformComputePipelineState):
        * platform/graphics/gpu/GPUCommandBuffer.cpp:
        (WebCore::GPUCommandBuffer::createComputeCommandEncoder):
        * platform/graphics/gpu/GPUCommandBuffer.h:
        * platform/graphics/gpu/GPUComputeCommandEncoder.cpp: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp.
        (WebCore::GPUComputeCommandEncoder::create):
        (WebCore::GPUComputeCommandEncoder::~GPUComputeCommandEncoder):
        (WebCore::GPUComputeCommandEncoder::setComputePipelineState):
        (WebCore::GPUComputeCommandEncoder::setBuffer):
        (WebCore::GPUComputeCommandEncoder::endEncoding):
        * platform/graphics/gpu/GPUComputeCommandEncoder.h: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h.
        * platform/graphics/gpu/GPUComputePipelineState.cpp: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
        (WebCore::GPUComputePipelineState::create):
        (WebCore::GPUComputePipelineState::~GPUComputePipelineState):
        * platform/graphics/gpu/GPUComputePipelineState.h: Copied from Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h.
        * platform/graphics/gpu/GPUSize.h: Copied from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.

2017-04-07  Alex Christensen  <achristensen@webkit.org>

        Private browsing sessions should not look in keychain for client certificates
        https://bugs.webkit.org/show_bug.cgi?id=170618
        <rdar://problem/18457427>

        Reviewed by Dan Bernstein.

        Our client certificate testing in WebKit leaves much to be desired.
        See rdar://problem/17694210 for reproduction steps.

        * platform/spi/cf/CFNetworkSPI.h:
        Add some new SPI.

2017-04-07  Zalan Bujtas  <zalan@apple.com>

        Simple line layout: FlowContents::segmentIndexForRunSlow skips empty runs.
        https://bugs.webkit.org/show_bug.cgi?id=170552

        Reviewed by Antti Koivisto.

        The compare function passed to std::lower_bound completely misses empty runs. 

        Test: fast/text/simple-line-layout-hover-over-subsequent-linebreaks.html

        * rendering/SimpleLineLayoutFlowContents.cpp:
        (WebCore::SimpleLineLayout::FlowContents::segmentIndexForRunSlow):

2017-04-07  Chris Dumez  <cdumez@apple.com>

        We should log how much CPU a background process was using when killing it due to CPU limiting
        https://bugs.webkit.org/show_bug.cgi?id=170619

        Reviewed by Andreas Kling.

        CPUMonitor now passes the CPU usage to the callback when it exceeds the threashold.

        * platform/CPUMonitor.cpp:
        (WebCore::CPUMonitor::timerFired):
        * platform/CPUMonitor.h:

2017-04-07  Chris Dumez  <cdumez@apple.com>

        Audible autoplay videos should not get paused when outside the viewport
        https://bugs.webkit.org/show_bug.cgi?id=170610
        <rdar://problem/31505984>

        Reviewed by Eric Carlson.

        Audible autoplay videos should not get paused when outside the viewport as this
        would be observable by the user.

        Test: media/video-restricted-invisible-autoplay-allowed-if-audible.html

        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::autoplayPermitted):

2017-04-07  Myles C. Maxfield  <mmaxfield@apple.com>

        REGRESSION(r211382): Complex text with justification erroneously overflows containers
        https://bugs.webkit.org/show_bug.cgi?id=170399
        <rdar://problem/31442008>

        Reviewed by Simon Fraser.

        When we perform justification, we adjust glyphs' advances to add extra space between words.
        ComplexTextController maintains an invariant where m_totalWidth is equal to the sum of these
        advances. However, in RTL text, inserting extra justification space to the left of a glyph
        would break that invariant, and would increase the advances of two glyphs instead of just
        one. Then, when we go to draw the text, the sum of the advances is wider than m_totalWidth,
        which means the glyphs would be drawn outside of their container.

        This regressed in r211382 simply because of an oversight and because there were no tests for
        this codepath.

        Test: ComplexTextControllerTest.TotalWidthWithJustification

        * platform/graphics/ComplexTextController.cpp:
        (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
        * rendering/InlineBox.h:
        (WebCore::InlineBox::InlineBox):

2017-04-07  Chris Dumez  <cdumez@apple.com>

        Throttle / Align DOM Timers in cross-origin iframes to 30fps
        https://bugs.webkit.org/show_bug.cgi?id=170613
        <rdar://problem/31506444>

        Reviewed by Simon Fraser.

        Throttle / Align DOM Timers in cross-origin iframes to 30fps unless the user
        has interacted with them, in order to reduce power use.

        Test: http/tests/frame-throttling/timer-throttle-in-cross-origin-subframe.html

        * dom/Document.cpp:
        (WebCore::Document::domTimerAlignmentInterval):
        (WebCore::Document::updateLastHandledUserGestureTimestamp):
        * page/DOMTimer.h:

2017-04-07  John Wilander  <wilander@apple.com>

        Follow-up fix for Soup platform.
        https://bugs.webkit.org/show_bug.cgi?id=170322

        Unreviewed build fix. Error introduced by me in
        https://trac.webkit.org/changeset/215104/webkit.

        No new tests.

        * platform/network/soup/SocketStreamHandleImpl.h:
            Move parameter change to the right
            SocketStreamHandleImpl::create() function.

2017-04-07  John Wilander  <wilander@apple.com>

        WebSocket streams should have network usage attributed to correct process
        https://bugs.webkit.org/show_bug.cgi?id=170322
        <rdar://problem/26413551>

        Reviewed by Alex Christensen.

        Tested manually since it requires a per-app VPN.

        * page/SocketProvider.cpp:
        (WebCore::SocketProvider::createSocketStreamHandle):
            Sends in an empty struct since it doesn't have access to
            platform dependent sourceApplicationAuditData.
        * platform/network/SocketStreamHandle.h:
            Declaration of a per-platform struct to hold CF data for
            Cocoa platforms.
        * platform/network/cf/SocketStreamHandleImpl.h:
        (WebCore::SocketStreamHandleImpl::create):
            Now takes WebCore::SourceApplicationAuditToken which is
            passed on to the constructor.
        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
        (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
            Now takes WebCore::SourceApplicationAuditToken which is
            passed on to the streams once created.
        (WebCore::SocketStreamHandleImpl::createStreams):
            Now sets kCFStreamPropertySourceApplication for the two
            streams.
        * platform/network/curl/SocketStreamHandleImpl.h:
        (WebCore::SocketStreamHandleImpl::create):
            Added unused WebCore::SourceApplicationAuditToken parameter.
        * platform/network/soup/SocketStreamHandleImpl.h:
        * platform/network/soup/SocketStreamHandleImplSoup.cpp:
        (WebCore::SocketStreamHandleImpl::create):
            Added unused WebCore::SourceApplicationAuditToken parameter.

2017-04-07  Alex Christensen  <achristensen@webkit.org>

        REGRESSION(r204512): WebSocket errors with "Failed to send WebSocket frame."  if too much data is sent
        https://bugs.webkit.org/show_bug.cgi?id=170463

        Reviewed by Michael Catanzaro.

        This only reproduces when using WebSockets to communicate with an external server.
        When communicating with a local server, CFWriteStreamWrite succeeds too reliably, so
        CFWriteStreamCanAcceptBytes returns true, when sometimes it doesn't when communicating
        across the real internet.

        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
        (WebCore::SocketStreamHandleImpl::platformSendInternal):
        * platform/network/soup/SocketStreamHandleImplSoup.cpp:
        (WebCore::SocketStreamHandleImpl::platformSendInternal):
        Returning std::nullopt means there was an error, which is not true when the socket stream
        is in a state where it cannot be written to because it is actively communicating.
        Returning 0 means 0 new bytes were sent, so we will try again later.

2017-04-07  Eric Carlson  <eric.carlson@apple.com>

        MediaSample should store video sample rotation instead of orientation
        https://bugs.webkit.org/show_bug.cgi?id=170598

        Reviewed by Youenn Fablet.

        No new tests, no functional change.

        * platform/MediaSample.h:
        (WebCore::MediaSample::videoRotation):
        (WebCore::MediaSample::videoOrientation): Deleted.
        * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix):
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayLayer):

        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::processNewFrame):

        * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
        (WebCore::RealtimeIncomingVideoSource::OnFrame):
        (WebCore::RealtimeIncomingVideoSource::processNewSample):
        * platform/mediastream/mac/RealtimeIncomingVideoSource.h:

        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):

2017-04-07  Brent Fulgham  <bfulgham@apple.com>

        WebKit should percent encode single quotes in query strings
        https://bugs.webkit.org/show_bug.cgi?id=170561
        <rdar://problem/7415154>

        Reviewed by Alex Christensen.

        Modify the characterClassTable to instruct the URLParser to convert
        the single-quote character ' to %27 in URL query strings.

        Tests: URLParserTest in TestWebKitAPI.
            fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame.html
            fast/frames/xss-auditor-handles-file-urls.html
            http/tests/security/xssAuditor

        * platform/URLParser.cpp:

2017-04-07  Zalan Bujtas  <zalan@apple.com>

        Text insertion cursor disappears after pressing enter
        https://bugs.webkit.org/show_bug.cgi?id=169291
        <rdar://problem/30899611>

        Reviewed by Tim Horton.

        Positon upstream/downstream (as the result of VisiblePosition -> canonicalPosition) require
        linebox tree. In addition to regular text, we need to bail out of simple line layout on line breaks too.

        Test: editing/simple-line-layout-caret-is-gone.html

        * dom/Position.cpp:
        (WebCore::ensureLineBoxesIfNeeded):
        (WebCore::Position::upstream):
        (WebCore::Position::downstream):
        (WebCore::Position::getInlineBoxAndOffset):
        * rendering/RenderLineBreak.cpp:
        (WebCore::RenderLineBreak::ensureLineBoxes):
        (WebCore::RenderLineBreak::positionForPoint):
        (WebCore::RenderLineBreak::setSelectionState):
        (WebCore::RenderLineBreak::collectSelectionRects):
        (WebCore::ensureLineBoxes): Deleted.
        * rendering/RenderLineBreak.h:

2017-04-07  Xan Lopez  <xlopez@igalia.com>

        [GTK] Fix codec name in OWR ASSERT
        https://bugs.webkit.org/show_bug.cgi?id=170600

        Reviewed by Carlos Garcia Campos.

        * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
        (WebCore::MediaEndpointOwr::prepareMediaSession): uppercase the
        codec name we are looking for, that's how they appear in the
        vector.

2017-04-07  Per Arne Vollan  <pvollan@apple.com>

        Add hasVideo property to WebAVPlayerController.
        https://bugs.webkit.org/show_bug.cgi?id=170545
        rdar://problem/31325182

        Reviewed by Eric Carlson.

        Add a new "hasVideo" property which can be used to discover if any video content is present in the playback item,
        whether video content is currently enabled or not.

        * platform/ios/WebAVPlayerController.h:
        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebVideoFullscreenInterfaceAVKit::hasVideoChanged):

2017-04-07  Miguel Gomez  <magomez@igalia.com>

        [GTK+] Animations not played properly when using synchronous decoding
        https://bugs.webkit.org/show_bug.cgi?id=170591

        Reviewed by Carlos Garcia Campos.

        Fix an index error when destroying decoded frames that was sometimes deleting the frame we wanted
        to keep.

        Covered by exitent tests.

        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::destroyDecodedData):

2017-04-07  Xan Lopez  <xan@igalia.com>

        [GTK] Add message about missing codecs to ASSERT in OWR
        https://bugs.webkit.org/show_bug.cgi?id=170596

        Reviewed by Carlos Garcia Campos.

        * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
        (WebCore::MediaEndpointOwr::prepareMediaSession): add a message
        about the missing coded to the ASSERT.

2017-04-07  Tomas Popela  <tpopela@redhat.com>

        AX: Don't crash if no renderer is available for AccessibilityRenderObject
        https://bugs.webkit.org/show_bug.cgi?id=170448

        Reviewed by Chris Fleizach.

        Don't crash or assert if no renderer is available, but early return
        gracefully (as in other places in the AccessibilityRenderObject.cpp).
        Spotted by running some tests through dogtail.

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::isOffScreen):
        (WebCore::AccessibilityRenderObject::isUnvisited):
        (WebCore::AccessibilityRenderObject::isVisited):

2017-04-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Update the priorities used in glib main loop sources
        https://bugs.webkit.org/show_bug.cgi?id=170457

        Reviewed by Žan Doberšek.

        * platform/glib/MainThreadSharedTimerGLib.cpp:
        (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
        (WebCore::TextureMapperPlatformLayerProxy::TextureMapperPlatformLayerProxy):
        (WebCore::TextureMapperPlatformLayerProxy::activateOnCompositingThread):

2017-04-07  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement AES_CBC support
        https://bugs.webkit.org/show_bug.cgi?id=170550

        Reviewed by Michael Catanzaro.

        Implement the CryptoAlgorithmAES_CBC::platform{Encrypt,Decrypt}
        functionality for configurations that use libgcrypt. This is done
        by leveraging the gcry_cipher_* APIs for the AES algorithm that's
        deduced appropriately from the key size and the CBC cipher mode.
        Additionally, the PKCS#7 padding is implemented for each operation,
        as demanded by the Web Crypto specification.

        No new tests -- current ones cover this sufficiently, but are not yet
        enabled due to missing platform-specific SUBTLE_CRYPTO implementations.

        * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
        (WebCore::gcryptEncrypt):
        (WebCore::gcryptDecrypt):
        (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):

2017-04-07  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement raw and JWK imports and exports for EC keys
        https://bugs.webkit.org/show_bug.cgi?id=170546

        Reviewed by Michael Catanzaro.

        Implement import and export operations for EC keys, covering the raw
        and JWK import/export types.

        CryptoKeyEC::platformImportRaw() builds a public-key s-expression,
        providing the curve name and the key data, and yields the gcry_sexp_t
        object to the new CryptoKeyEC.

        CryptoKeyEC::platformImportJWKPublic() first constructs a Vector<uint8_t>
        object that contains the EC point in the uncompressed format. It then
        puts that data into a newly-constructed public-key s-expression that is
        then used to construct the new CryptoKeyEC object.

        CryptoKeyEC::platformImportJWKPrivate() constructs the EC point data just
        the same, but it also lays out the private key field element data into
        the private-key s-expression that's then handed off to the CryptoKeyEC
        object.

        CryptoKeyEC::platformExportRaw() constructs a new EC operations context
        and then uses it to retrieve the q parameter as an MPI. A Vector<uint8_t>
        is retrieved from the MPI data through the extractMPIData() helper
        function.

        CryptoKeyEC::platformAddFieldElements() similarly uses the EC operations
        context to retrieve the q parameter data, which it then splits into the
        x and y field elements and Base64 URL-encodes them into a form that can
        be placed in a JsonWebKey. If the key is private, the d parameter is
        retrieved in the same fashion and again Base64 URL-encoded and stored
        in the JsonWebKey object.

        No new tests -- current ones cover this sufficiently, but are not yet
        enabled due to other missing platform-specific SUBTLE_CRYPTO
        implementations.

        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        (WebCore::uncompressedPointSizeForCurve):
        (WebCore::uncompressedFieldElementSizeForCurve):
        (WebCore::extractMPIData):
        (WebCore::CryptoKeyEC::platformImportRaw):
        (WebCore::CryptoKeyEC::platformImportJWKPublic):
        (WebCore::CryptoKeyEC::platformImportJWKPrivate):
        (WebCore::CryptoKeyEC::platformExportRaw):
        (WebCore::CryptoKeyEC::platformAddFieldElements):

2017-04-07  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement CryptoKeyRSA::generatePair()
        https://bugs.webkit.org/show_bug.cgi?id=170350

        Reviewed by Michael Catanzaro.

        Start implementing the libgcrypt-based platform bits of CryptoKeyRSA.

        Implement generatePair() by constructing a genkey s-expression
        that requests a generation of an RSA key that should use a modulus
        of the specified bit-length and the specified exponent. The exponent
        is extracted from an uint8_t array through a helper function. The
        modulus length value is checked to be at least 16, since libgcrypt
        does not support generating primes of less than that length in bits.

        The returned s-expression upon request will contain the data for
        both the public and the private key. gcry_sexp_t handles representing
        those s-expressions are then passed to CryptoKeyRSA::create() before
        invoking the success callback with a new CryptoKeyPair object in a
        separate ScriptExecutionContext task.

        The CryptoKeyRSA constructor simply has the notImplemented() call
        removed. The destructor now invokes the HandleDeleter<gcry_sexp_t>
        object instance to destroy the object represented by the
        m_platformKey handle.

        The methods in CryptoKeyRSA.cpp are also reordered to follow the
        declaration order used in the header.

        No new tests -- current ones cover this sufficiently, but are not yet
        enabled due to other missing platform-specific SUBTLE_CRYPTO
        implementations.

        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
        (WebCore::CryptoKeyRSA::CryptoKeyRSA):
        (WebCore::CryptoKeyRSA::~CryptoKeyRSA):
        (WebCore::exponentVectorToUInt32):
        (WebCore::CryptoKeyRSA::generatePair):
        (WebCore::CryptoKeyRSA::importSpki):
        (WebCore::CryptoKeyRSA::importPkcs8):
        (WebCore::CryptoKeyRSA::exportPkcs8):
        (WebCore::CryptoKeyRSA::buildAlgorithm):
        (WebCore::CryptoKeyRSA::exportData):
        * crypto/keys/CryptoKeyRSA.h:

2017-04-06  Youenn Fablet  <youenn@apple.com>

        [Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
        https://bugs.webkit.org/show_bug.cgi?id=170395
        <rdar://problem/31394017>

        Reviewed by Mark Lam.

        * bindings/js/JSDOMPromise.cpp:
        (WebCore::DeferredPromise::reject): Exiting early in case of scope having an exception.
        Adding an assertion to ensure this is a worker termination exception.

2017-04-06  Andreas Kling  <akling@apple.com>

        Inaudible background tabs should become eligible for memory kill after 8 minutes
        https://bugs.webkit.org/show_bug.cgi?id=170574
        <rdar://problem/31488686>

        Reviewed by Gavin Barraclough.

        Lower the delay for potentially marking background tabs as inactive from 60 minutes to 8 minutes.
        Letting a tab misbehave in the background for an entire hour was overly charitable.

        * page/PerformanceMonitor.cpp:

2017-04-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        Scroll offset jumps after a programmatic scroll in an overflow container with scroll snapping
        https://bugs.webkit.org/show_bug.cgi?id=170560
        <rdar://problem/31484693>

        Reviewed by Tim Horton.

        Test: css3/scroll-snap/scroll-snap-programmatic-overflow-scroll.html

        Logic for maintaining the scroll snap state in ScrollController was previously removed from iOS when refactoring
        ScrollController. This was done because scroll snapping on iOS is driven not by the ScrollController (as it is
        on Mac) but rather by sending scroll snap offsets to the UI process and hooking into UIScrollView delegates to
        handle retargeted scrolling.

        However, on iOS, this ScrollController state is still important for the purposes of keeping the last active
        snap point index in sync with the UI process when the scroll offset changes outside of a user gesture (i.e.
        programmatic scrolling). Since the UI process does not get a chance to update the active snap offset during a
        programmatic scroll, our last active snap offset state was only being updated to the last snap position that the
        user manually scrolled to, making programmatic scrolling jump to this offset.

        To fix this, we need to update scroll snap state on iOS within ScrollController. Also adds a new Layout test
        that exercises programmatic scrolling in an overflow scrolling container on all platforms.

        * platform/cocoa/ScrollController.mm:
        (WebCore::otherScrollEventAxis):
        (WebCore::ScrollController::updateScrollSnapState):
        (WebCore::ScrollController::updateScrollSnapPoints):

2017-04-05  Simon Fraser  <simon.fraser@apple.com>

        Throttle requestAnimationFrame in cross-origin iframes to 30fps
        https://bugs.webkit.org/show_bug.cgi?id=170534

        Reviewed by Dan Bates.

        Add a throttling reason to ScriptedAnimationController which is NonInteractedCrossOriginFrame,
        set on cross-origin iframes whose documents have never seen a user interaction. It's cleared
        as soon as an interaction on this frame or a child frame is detected.

        Move the initialization of the LowPowerMode throttling reason to Document::requestAnimationFrame(),
        since it's more appropriate to compute NonInteractedCrossOriginFrame here than down in ScriptedAnimationController,
        and best to do both in the same place.

        Tests: http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html

        * dom/Document.cpp:
        (WebCore::Document::requestAnimationFrame):
        (WebCore::Document::updateLastHandledUserGestureTimestamp):
        * dom/Document.h:
        (WebCore::Document::hasHadUserInteraction):
        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::ScriptedAnimationController):
        (WebCore::throttlingReasonToString):
        (WebCore::ScriptedAnimationController::interval):
        * dom/ScriptedAnimationController.h:
        * loader/FrameLoader.cpp:
        (WebCore::shouldAskForNavigationConfirmation):

2017-04-05  Simon Fraser  <simon.fraser@apple.com>

        Use the Accelerate framework to optimize FEColorMatrix operations
        https://bugs.webkit.org/show_bug.cgi?id=170518

        Reviewed by Tim Horton.

        On macOS and iOS, we can use the Accelerate framework (vImage) to do color matrix
        math to optimize color matrix, hue rotate, saturation and luminosity to alpha filters.
        
        Change ImageBuffer::getUnmultipliedImageData() and getPremultipliedImageData() to
        return the size of the returned Uint8ClampedArray in physical pixels, because we
        need to pass that to vImage.

        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::getImageData):
        * platform/graphics/ImageBuffer.h:
        * platform/graphics/cairo/ImageBufferCairo.cpp:
        (WebCore::ImageBuffer::getUnmultipliedImageData):
        (WebCore::ImageBuffer::getPremultipliedImageData):
        * platform/graphics/cg/ImageBufferCG.cpp:
        (WebCore::ImageBuffer::getUnmultipliedImageData):
        (WebCore::ImageBuffer::getPremultipliedImageData):
        * platform/graphics/filters/FEColorMatrix.cpp:
        (WebCore::effectApplyAccelerated):
        (WebCore::effectType):
        (WebCore::FEColorMatrix::platformApplySoftware):
        * platform/graphics/filters/FEDropShadow.cpp:
        (WebCore::FEDropShadow::platformApplySoftware):
        * platform/graphics/win/ImageBufferDirect2D.cpp:
        (WebCore::ImageBuffer::getUnmultipliedImageData):
        (WebCore::ImageBuffer::getPremultipliedImageData):

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

        Do some minor FEColorMatrix code cleanup and optimization
        https://bugs.webkit.org/show_bug.cgi?id=170474

        Reviewed by Dean Jackson.

        Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).
        
        Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
        of multiple times, which is faster.
        
        This kind of code benefits from aligning things with spaces for readability, so do so,
        violating webkit style.
        
        Add some off-by-default performance logging code.

        Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.

        * platform/graphics/filters/FEColorMatrix.cpp:
        (WebCore::matrix):
        (WebCore::saturateAndHueRotate):
        (WebCore::effectType):
        (WebCore::FEColorMatrix::platformApplySoftware):

2017-04-06  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r215041.

        The LayoutTest for this change is failing on ios-simulator.

        Reverted changeset:

        "Rendering flexbox children across columns"
        https://bugs.webkit.org/show_bug.cgi?id=164166
        http://trac.webkit.org/changeset/215041

2017-04-06  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r215046.

        This change broke internal builds.

        Reverted changeset:

        "WebRTC tests gardening"
        https://bugs.webkit.org/show_bug.cgi?id=170508
        http://trac.webkit.org/changeset/215046

2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Only Capture Extra Network Load Metrics when there is a Web Inspector Frontend
        https://bugs.webkit.org/show_bug.cgi?id=170525

        Reviewed by Youenn Fablet.

        Covered by existing tests that when Web Inspector is open we enable collecting the extra data.

        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::firstFrontendCreated):
        (WebCore::InspectorInstrumentation::lastFrontendDeleted):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::frontendCreated):
        (WebCore::InspectorInstrumentation::frontendDeleted):
        When the first frontend is created enable a new loader strategy to
        collect extra network load metrics. When the last frontend is closed
        disable the extra metrics.

        * loader/LoaderStrategy.h:
        * platform/PlatformStrategies.h:
        New load strategy to enable/disable new metrics.

2017-04-06  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: Show all headers in the Request Headers section of the Resource details sidebar
        https://bugs.webkit.org/show_bug.cgi?id=16531
        <rdar://problem/5712895>

        Reviewed by Timothy Hatcher.

        Test: http/tests/inspector/network/resource-request-headers.html

        * loader/ResourceTiming.cpp:
        (WebCore::ResourceTiming::ResourceTiming):
        Eliminate unnecessary data from the NetworkLoadTiming object
        when it is used for ResourceTiming. This clears up some memory
        that will otherwise never be used.

        * platform/network/NetworkLoadMetrics.h:
        (WebCore::NetworkLoadMetrics::isolatedCopy):
        (WebCore::NetworkLoadMetrics::reset):
        (WebCore::NetworkLoadMetrics::clearNonTimingData):
        (WebCore::NetworkLoadMetrics::operator==):
        (WebCore::NetworkLoadMetrics::encode):
        (WebCore::NetworkLoadMetrics::decode):
        Include an optional HTTPHeaderMap for a refined list of
        request headers for this network load.

        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::buildObjectForMetrics):
        Include request headers with other optional metrics data
        when the load is completed.

2017-04-06  Tim Horton  <timothy_horton@apple.com>

        Follow up to r209304, remove line numbers from one more StyleRule construction
        https://bugs.webkit.org/show_bug.cgi?id=170564

        Reviewed by Simon Fraser.

        * css/StyleRule.cpp:
        (WebCore::StyleRuleViewport::StyleRuleViewport):
        This one was missed in r209304.

2017-04-06  Timothy Horton  <timothy_horton@apple.com>

        Remove an unused member and constructor parameter from CSSPropertyParser
        https://bugs.webkit.org/show_bug.cgi?id=170562

        Reviewed by Simon Fraser.

        * css/parser/CSSParser.cpp:
        (WebCore::CSSParser::parseSingleValue):
        (WebCore::CSSParser::parseValueWithVariableReferences):
        * css/parser/CSSParserImpl.cpp:
        (WebCore::CSSParserImpl::consumeDeclarationValue):
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::CSSPropertyParser::CSSPropertyParser):
        (WebCore::CSSPropertyParser::parseValue):
        (WebCore::CSSPropertyParser::parseSingleValue):
        * css/parser/CSSPropertyParser.h:
        It is possible to get Clang to complain about the unused member, though
        I'm not sure why it doesn't in the build today.

2017-04-06  Zalan Bujtas  <zalan@apple.com>

        Simple line layout: Hittest always returns the first renderer in the block.
        https://bugs.webkit.org/show_bug.cgi?id=170520
        <rdar://problem/30979175>

        Reviewed by Antti Koivisto.

        This is incorrect now with <br> support (multiple renderers within the same block flow).

        Test: fast/dom/Document/CaretRangeFromPoint/simple-line-layout-hittest-with-caret-range-from-point.html

        * rendering/RenderText.cpp:
        (WebCore::RenderText::positionForPoint): Related fix. We don't yet support positionForPoint with multiple renderes. 
        * rendering/SimpleLineLayoutFlowContents.h:
        (WebCore::SimpleLineLayout::FlowContents::segmentForRun): Empty runs are all valid.
        * rendering/SimpleLineLayoutFunctions.cpp:
        (WebCore::SimpleLineLayout::hitTestFlow):
        (WebCore::SimpleLineLayout::collectFlowOverflow):
        * rendering/SimpleLineLayoutResolver.cpp:
        (WebCore::SimpleLineLayout::LineResolver::Iterator::operator*): This should eventually return a list of renderes.
        * rendering/SimpleLineLayoutResolver.h:
        (WebCore::SimpleLineLayout::RunResolver::flowContents):

2017-04-06  Jon Davis  <jond@apple.com>

        Updates feature status for recently shipped features
        https://bugs.webkit.org/show_bug.cgi?id=170359

        Reviewed by Brian Burg.

        Added missing Gamepad entry.
        Changed "Done" status to "Supported".
        Also changed status from "In Development" to "Supported" for:
        
        - CSS Grid Layout Level 1
        - CSS Inline Layout Module Level 3
        - CSS Scroll Snap Points Module Level 1
        - CSS Color Level 4
        - Fetch API
        - Indexed Database 2.0
        - Media Capture and Streams
        - Pointer Lock
        - Preload
        - Input Events

        * features.json:

2017-03-31  Jiewen Tan  <jiewen_tan@apple.com>

        [WebCrypto] Add support for AES-CTR
        https://bugs.webkit.org/show_bug.cgi?id=169761
        <rdar://problem/31331321>

        Reviewed by Brent Fulgham.

        This patch adds support for AES-CTR. Operations of AES-CTR include: encrypt, decrypt, generateKey,
        importKey, exportKey, wrapKey, and unwrapKey. This implementation follows the latest WebCryptoAPI
        spec: https://www.w3.org/TR/WebCryptoAPI/#aes-ctr.

        Tests: crypto/subtle/aes-ctr-encrypt-malformed-parameters.html
               crypto/subtle/aes-ctr-encrypt-overflow.html
               crypto/subtle/aes-ctr-generate-export-key-jwk-length-128.html
               crypto/subtle/aes-ctr-generate-export-key-jwk-length-192.html
               crypto/subtle/aes-ctr-generate-export-key-jwk-length-256.html
               crypto/subtle/aes-ctr-generate-export-raw-key.html
               crypto/subtle/aes-ctr-generate-key-encrypt-decrypt.html
               crypto/subtle/aes-ctr-generate-key.html
               crypto/subtle/aes-ctr-import-jwk-key-length-128.html
               crypto/subtle/aes-ctr-import-jwk-key-length-192.html
               crypto/subtle/aes-ctr-import-jwk-key-length-256.html
               crypto/subtle/aes-ctr-import-key-decrypt.html
               crypto/subtle/aes-ctr-import-key-encrypt.html
               crypto/subtle/aes-ctr-import-key-unwrap-jwk-key.html
               crypto/subtle/aes-ctr-import-key-unwrap-raw-key.html
               crypto/subtle/aes-ctr-import-key-wrap-jwk-key.html
               crypto/subtle/aes-ctr-import-key-wrap-raw-key.html
               crypto/subtle/aes-ctr-import-raw-key.html
               crypto/workers/subtle/aes-ctr-import-key-decrypt.html
               crypto/workers/subtle/aes-ctr-import-key-encrypt.html
               crypto/workers/subtle/aes-ctr-import-key-unwrap-key.html
               crypto/workers/subtle/aes-ctr-import-key-wrap-key.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * PlatformGTK.cmake:
        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSSubtleCryptoCustom.cpp:
        (WebCore::normalizeCryptoAlgorithmParameters):
        * crypto/CryptoAlgorithmParameters.h:
        * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp: Added.
        (WebCore::usagesAreInvalidForCryptoAlgorithmAES_CTR):
        (WebCore::parametersAreValid):
        (WebCore::CryptoAlgorithmAES_CTR::create):
        (WebCore::CryptoAlgorithmAES_CTR::identifier):
        (WebCore::CryptoAlgorithmAES_CTR::encrypt):
        (WebCore::CryptoAlgorithmAES_CTR::decrypt):
        (WebCore::CryptoAlgorithmAES_CTR::generateKey):
        (WebCore::CryptoAlgorithmAES_CTR::importKey):
        (WebCore::CryptoAlgorithmAES_CTR::exportKey):
        (WebCore::CryptoAlgorithmAES_CTR::getKeyLength):
        * crypto/algorithms/CryptoAlgorithmAES_CTR.h: Added.
        * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp: Added.
        (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
        * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: Added.
        (WebCore::bigIntegerToSize):
        (WebCore::transformAES_CTR):
        (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
        * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
        (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
        * crypto/parameters/AesCtrParams.idl: Added.
        * crypto/parameters/CryptoAlgorithmAesCtrParams.h: Added.

2017-04-06  Youenn Fablet  <youenn@apple.com>

        WebRTC tests gardening
        https://bugs.webkit.org/show_bug.cgi?id=170508

        Reviewed by Eric Carlson.

        * Configurations/FeatureDefines.xcconfig: Changing webrtc enabling for ios.

2017-04-06  Andreas Kling  <akling@apple.com>

        Stop forcing CA commit when memory pressure changes.
        https://bugs.webkit.org/show_bug.cgi?id=170522
        <rdar://problem/31460236>

        Reviewed by Antti Koivisto.

        Don't force a CA commit when reaching critical memory pressure. We're already doing a ton
        of work in response to the pressure, and this was really a hack to try to react quickly on
        512 MB devices which we don't support anymore.

        * page/MemoryRelease.cpp:
        (WebCore::releaseCriticalMemory):

2017-04-06  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Implement ReadableStreamBYOBRequest respondWithNewView()
        https://bugs.webkit.org/show_bug.cgi?id=170339

        Reviewed by Youenn Fablet.

        Implemented ReadableStreamBYOBRequest respondWithNewView().

        Added new tests to check respondWithNewView() behaviour.

        * Modules/streams/ReadableByteStreamInternals.js:
        (readableByteStreamControllerRespondWithNewView): Added.
        * Modules/streams/ReadableStreamBYOBRequest.js:
        (respondWithNewView): Updated.

2017-04-06  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Host application should be able to mute and unmute media streams
        https://bugs.webkit.org/show_bug.cgi?id=170519
        <rdar://problem/31174326>

        Unreviewed, fix crash introduced in r214980.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::MediaStream): NULL-check page.

2017-04-06  Dave Hyatt  <hyatt@apple.com>

        Rendering flexbox children across columns
        https://bugs.webkit.org/show_bug.cgi?id=164166
        <rdar://problem/29055587>

        Reviewed by Zalan Bujtas.

        Added fast/multicol/flexbox-rows.html.

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::adjustForUnsplittableChild):
        Treat block-level flexboxes that occur inside block flows the same as replaced
        and unsplittable elements and push them to the next page if they don't fit. We don't
        update the minimum page height though, since the flexbox is not really unsplittable.

2017-04-05  Simon Fraser  <simon.fraser@apple.com>

        Set lastHandledUserGestureTimestamp on all ancestor documents, not just the top document
        https://bugs.webkit.org/show_bug.cgi?id=170479

        Reviewed by Sam Weinig.

        When interacting with a subframe document, set lastHandledUserGestureTimestamp on all ancestor
        documents up to the root.

        This will be used in future for requestAnimationFrame throttling.

        Test: fast/frames/user-gesture-timestamp-propagation.html

        * dom/Document.cpp:
        (WebCore::Document::updateLastHandledUserGestureTimestamp):
        * dom/Document.h:
        * dom/UserGestureIndicator.cpp:
        (WebCore::UserGestureIndicator::UserGestureIndicator):
        * testing/Internals.cpp:
        (WebCore::Internals::lastHandledUserGestureTimestamp):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-04-05  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Host application should be able to mute and unmute media streams
        https://bugs.webkit.org/show_bug.cgi?id=170519
        <rdar://problem/31174326>

        Unreviewed, address review comments missed in the initial checkin.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::MediaStream): Mute the private stream if the page doesn't allow
        capture.
        (WebCore::MediaStream::pageMutedStateDidChange): setMuted -> setCaptureTracksMuted.

        * platform/mediastream/MediaStreamPrivate.cpp:
        (WebCore::MediaStreamPrivate::addTrack): Don't track muted state, the capture source already does.
        (WebCore::MediaStreamPrivate::startProducingData):  Ditto.
        (WebCore::MediaStreamPrivate::setCaptureTracksMuted): Renamed from setMuted.
        (WebCore::MediaStreamPrivate::setMuted): Deleted.
        * platform/mediastream/MediaStreamPrivate.h:

2017-04-05  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Host application should be able to mute and unmute media streams
        https://bugs.webkit.org/show_bug.cgi?id=170519
        <rdar://problem/31174326>

        Reviewed by Youenn Fablet.

        No new tests, fast/mediastream/MediaStream-page-muted.html was updated.

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::~MediaStream): Fix a typo.
        (WebCore::MediaStream::pageMutedStateDidChange): Don't store muted state, let the private
        stream store it.
        (WebCore::MediaStream::mediaState): Deal with new muted state flags.
        * Modules/mediastream/MediaStream.h:

        * dom/Document.cpp:
        (WebCore::Document::prepareForDestruction): Clear media state before the frame is cleared.

        * page/MediaProducer.h: Add muted flags.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): The display layer
        should not be visible when the video track is muted.

        * platform/mediastream/MediaStreamPrivate.cpp:
        (WebCore::MediaStreamPrivate::addTrack): Mute the new track if necessary.
        (WebCore::MediaStreamPrivate::startProducingData): Do nothing when muted.
        (WebCore::MediaStreamPrivate::setExternallyMuted): New, mute/unmute tracks.
        * platform/mediastream/MediaStreamPrivate.h:

        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::setMuted): Start/stop producing data.

        * testing/Internals.cpp:
        (WebCore::Internals::pageMediaState): Support new media stream muted flags.

2017-04-05  Andreas Kling  <akling@apple.com>

        Make inactive web processes behave as though under memory pressure.
        https://bugs.webkit.org/show_bug.cgi?id=170042
        <rdar://problem/31038445>

        Reviewed by Antti Koivisto.

        Prevent PerformanceMonitor from marking the process as inactive at startup.
        This fixes the API test failure that caused this patch to get rolled out.

        * page/PerformanceMonitor.h:

2017-04-05  Youenn Fablet  <youenn@apple.com>

        Switch to kCVPixelFormatType_420YpCbCr8BiPlanarFullRange for Mac video capture format
        https://bugs.webkit.org/show_bug.cgi?id=170509

        Reviewed by Eric Carlson.

        Covered by existing tests.

        * platform/mediastream/mac/AVVideoCaptureSource.mm:

2017-04-05  Javier Fernandez  <jfernandez@igalia.com>

        [css-align] Implement the place-items shorthand
        https://bugs.webkit.org/show_bug.cgi?id=168847

        Reviewed by David Hyatt.

        The CSS Box Alignment specification defines a new shorthand to set the
        Content Alignment properties (align-items and justify-items) at the
        same time.

        This patch provides the implementation of the CSS parsing logic and the
        required regression tests. For the time being, as it happens with the
        rest of the new alignment properties, the new parsing logic is
        implemented behind the CSS Grid Layout runtime flag.

        Test: css3/parse-place-items.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::propertyValue):
        * css/CSSProperties.json:
        * css/StyleProperties.cpp:
        (WebCore::StyleProperties::getPropertyValue):
        (WebCore::StyleProperties::getAlignmentShorthandValue):
        * css/StyleProperties.h:
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::isAutoOrNormalOrStretch):
        (WebCore::consumeSelfPositionOverflowPosition):
        (WebCore::consumeSimplifiedItemPosition):
        (WebCore::CSSPropertyParser::consumePlaceItemsShorthand):
        * css/parser/CSSPropertyParser.h:

2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r214932.

        This change broke an internal build.

        Reverted changeset:

        "[ios-simulator] API test WebKit2.DataDetectionReferenceDate
        timing out"
        https://bugs.webkit.org/show_bug.cgi?id=161967
        http://trac.webkit.org/changeset/214932

2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r214962.

        Roll r214937 back in because it wasn't at fault for the build
        breakage.

        Reverted changeset:

        "Unreviewed, rolling out r214937."
        https://bugs.webkit.org/show_bug.cgi?id=170365
        http://trac.webkit.org/changeset/214962

2017-04-05  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r214937.

        This change broke an internal build.

        Reverted changeset:

        "REGRESSION (r202472): Data Detection overwrites existing
        links in detected ranges"
        https://bugs.webkit.org/show_bug.cgi?id=170365
        http://trac.webkit.org/changeset/214937

2017-04-05  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [WebRTC][OpenWebRTC] Add support for SDP BUNDLE ("a:group:BUNDLE" and "a=bundle-only" lines)
        https://bugs.webkit.org/show_bug.cgi?id=170157

        Reviewed by Alejandro G. Castro.

        This implements support on the SDPProcessor for generating an "a=group:BUNDLE"
        attribute with the MID identifiers specified in the bundle group in the most
        recent answer.
        It also implements support for generating "a=bundle-only" attributes on the
        "m=" sections of the SDP according to the bundlePolicy defined.

        Test: fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html

        * Modules/mediastream/MediaEndpointPeerConnection.cpp:
        (WebCore::MediaEndpointPeerConnection::createOfferTask):
        (WebCore::MediaEndpointPeerConnection::createAnswerTask):
        * Modules/mediastream/SDPProcessor.cpp:
        (WebCore::getBundlePolicyName):
        (WebCore::configurationToJSON):
        * Modules/mediastream/sdp.js:
        (SDP.generate):
        * platform/mediastream/MediaEndpointSessionConfiguration.h:
        (WebCore::MediaEndpointSessionConfiguration::bundlePolicy):
        (WebCore::MediaEndpointSessionConfiguration::setBundlePolicy):
        (WebCore::MediaEndpointSessionConfiguration::clone):

2017-04-05  Jer Noble  <jer.noble@apple.com>

        [MSE] Seeks to currentTime=0 will fail if currentTime is already 0.
        https://bugs.webkit.org/show_bug.cgi?id=170510
        <rdar://problem/30988403>

        Reviewed by Eric Carlson.

        Test: media/media-source/media-source-unnecessary-seek-seeked.html

        The AVSampleBufferRenderSynchronizer won't fire a time jumped notification if no seek is actully
        necessary. So short circuit the seek logic if the seek time is identical to the current synchronizer
        time.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):

2017-04-05  Chris Dumez  <cdumez@apple.com>

        <input type="range"> changing to disabled while active breaks all pointer events
        https://bugs.webkit.org/show_bug.cgi?id=170447
        <rdar://problem/31442875>

        Reviewed by Geoffrey Garen.

        When a range's slider is being moved, we set SliderThumbElement's m_inDragMode flag
        to true and mark the range elements as the CapturingMouseEventsElement. When we get
        the mouseUp event, we are supposed to exit drag mode. However, when the range element
        gets disabled while dragging, we do not get the mouseUp event and we need to make
        sure we exit dragging mode anyway. r112547 tried to fix this by calling stopDragging()
        in SliderThumbElement::defaultEventHandler() when the input element is disabled.
        While this often works, this is fragile and we sometimes fail to exit dragging mode
        when we should.

        This patch addressed the issue by calling stopDragging() in
        SliderThumbElement::disabledAttributeChanged() instead. This is much safer as we
        guarantee will exit dragging mode whenever the range element gets disabled, even
        if SliderThumbElement::defaultEventHandler() does not get called after that.

        Test: fast/forms/range/disabled-while-dragging.html

        * html/RangeInputType.cpp:
        (WebCore::RangeInputType::disabledAttributeChanged):
        * html/RangeInputType.h:
        * html/shadow/SliderThumbElement.cpp:
        (WebCore::SliderThumbElement::defaultEventHandler):
        (WebCore::SliderThumbElement::disabledAttributeChanged):
        * html/shadow/SliderThumbElement.h:

2017-04-05  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Video doesn't render in fullscreen on iOS
        https://bugs.webkit.org/show_bug.cgi?id=170404

        Reviewed by Youenn Fablet.
        
        No new tests, filed https://bugs.webkit.org/show_bug.cgi?id=170512.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Include
        video fullscreen manager on iOS too.
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): Add paramater
        to force transform recalculation.
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Restructure code since
        the display layer resize happens elsewhere.
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Include video fullscreen
        manager on iOS too.
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): Ditto.
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Ditto.
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer): Ditto.
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::backgroundLayerBoundsChanged): Change the
        display layer size and position immediately instead of waiting for the next sample buffer
        so the display is correct when fullscreen mode changes when paused.

2017-04-05  Youenn Fablet  <youenn@apple.com>

        Deprecate and remove URL.createObjectURL(mediastream)
        https://bugs.webkit.org/show_bug.cgi?id=167518
        <rdar://problem/31149607>

        Reviewed by Eric Carlson.

        Covered by updated tests.

        * CMakeLists.txt:
        * DerivedSources.cpp:
        * DerivedSources.make:
        * Modules/mediastream/DOMURLMediaStream.cpp: Removed.
        * Modules/mediastream/DOMURLMediaStream.h: Removed.
        * Modules/mediastream/DOMURLMediaStream.idl: Removed.
        * WebCore.xcodeproj/project.pbxproj:
        * html/DOMURL.idl:

2017-04-05  Alejandro G. Castro  <alex@igalia.com>

        [Webrtc] Mock realtime sources factories should be static after r213941
        https://bugs.webkit.org/show_bug.cgi?id=170282

        Reviewed by Alex Christensen.

        If we don't make the variables static we would be returning a
        local variable.

        * platform/mock/MockRealtimeAudioSource.cpp:
        (WebCore::MockRealtimeAudioSource::factory):
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::factory):

2017-04-05  Alex Christensen  <achristensen@webkit.org>

        Fix CMake build.

        * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
        Some JavaScript inline functions were not being accessed from this file with different enable flags.
        * platform/spi/cf/CFNetworkSPI.h:
        * platform/spi/cocoa/NSURLConnectionSPI.h:
        Moved NSURLSession-specific SPI from NSURLConnectionSPI.h to CFNetworkSPI.h.

2017-04-05  Chris Dumez  <cdumez@apple.com>

        _blank / _self / _parent / _top browsing context names should be case-insensitive
        https://bugs.webkit.org/show_bug.cgi?id=169747

        Reviewed by Alex Christensen.

        _blank / _self / _parent / _top browsing context names should be case-insensitive
        as per the HTML specification:
        - https://html.spec.whatwg.org/#browsing-context-names

        This aligns our behavior with Firefox as well. See discussion at:
        - https://github.com/whatwg/html/issues/2443

        Tests: imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html
               imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html
               imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html
               imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html
               imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
        (WebCore::createWindow):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::open):
        * page/FrameTree.cpp:
        (WebCore::FrameTree::uniqueChildName):
        (WebCore::FrameTree::find):

2017-04-05  Miguel Gomez  <magomez@igalia.com>

        [GTK+] PNG animations that should run once are not played at all
        https://bugs.webkit.org/show_bug.cgi?id=170499

        Reviewed by Carlos Garcia Campos.

        The repetition count reported bu the PNGImageDecoder is wrong. It's returning m_playCount - 1, which
        means 0 for the animations that need to be played once. Change it to return an appropriate value.

        Covered by existent tests.

        * platform/image-decoders/png/PNGImageDecoder.cpp:
        (WebCore::PNGImageDecoder::repetitionCount):
        * platform/image-decoders/png/PNGImageDecoder.h:

2017-04-05  Andy Estes  <aestes@apple.com>

        REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
        https://bugs.webkit.org/show_bug.cgi?id=170365
        <rdar://problem/29205721>

        Reviewed by Tim Horton.

        r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
        consider nodes that are descendants of startNode, but we need to traverse all nodes between
        startNode and endNode to find existing non-DD links.

        As a result, we'd add a Data Detector link to the following snippet and make the original
        links un-clickable:

            <a href='#'>tomorrow</a> <a href='#'>night</a>

        Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
        will terminate when we reach endNode.

        Updated WebKit2.DataDetectionReferenceDate API test.

        * editing/cocoa/DataDetection.mm:
        (WebCore::searchForLinkRemovingExistingDDLinks):

2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
        https://bugs.webkit.org/show_bug.cgi?id=156974

        Reviewed by Sam Weinig.

        Remove ErrorsGtk.

        * PlatformGTK.cmake:
        * platform/gtk/ErrorsGtk.cpp: Removed.
        * platform/gtk/ErrorsGtk.h: Removed.

2017-04-05  Andy Estes  <aestes@apple.com>

        [ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out
        https://bugs.webkit.org/show_bug.cgi?id=161967

        Reviewed by Alexey Proskuryakov.

        DataDetectorsCoreSPI.h defined DDQueryOffset as a struct of two CFIndexes, which is 16 bytes
        on LP64, but the struct is actually defined as two CFIndex-typed 32-bit bitfields, which is
        8 bytes on LP64. This breaks the ABI on Public SDK builds when calling functions that take
        or return DDQueryOffsets.

        * platform/spi/cocoa/DataDetectorsCoreSPI.h: Updated the DDQueryOffset definition for
        Public SDK builds, and added a static_assert to detect future size changes at compile time.

2017-04-04  Jer Noble  <jer.noble@apple.com>

        Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
        https://bugs.webkit.org/show_bug.cgi?id=170471

        Reviewed by Eric Carlson.

        Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        * platform/spi/mac/AVFoundationSPI.h:

2017-04-04  Youenn Fablet  <youenn@apple.com>

        Canvas is tainted when painting a video with MediaStreamTrack
        https://bugs.webkit.org/show_bug.cgi?id=170486

        Reviewed by Eric Carlson.

        Test: http/tests/media/media-stream/getusermedia-with-canvas.html

        Adding the notion of isolated source so that we can later on implement WebRTC isolated tracks.
        For now, canvas will not be tainted if painted from a MediaStreamTrack.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didPassCORSAccessCheck):
        * platform/mediastream/MediaStreamTrackPrivate.h:
        (WebCore::MediaStreamTrackPrivate::isIsolated):
        * platform/mediastream/RealtimeMediaSource.h:

2017-04-04  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r214894, r214895, r214907, r214912,
        and r214918.
        https://bugs.webkit.org/show_bug.cgi?id=170491

        Caused build failures on Mac (Requested by rniwa on #webkit).

        Reverted changesets:

        "Build fix."
        http://trac.webkit.org/changeset/214894

        "Rolling back the build fix, as it broke other builds."
        http://trac.webkit.org/changeset/214895

        "Move AVSampleBufferDisplayLayer declarations into
        AVFoundationSPI.h"
        https://bugs.webkit.org/show_bug.cgi?id=170471
        http://trac.webkit.org/changeset/214907

        "Unreviewed build fix: fix compilation error on Sierra."
        http://trac.webkit.org/changeset/214912

        "More build fixing."
        http://trac.webkit.org/changeset/214918

2017-04-04  Youenn Fablet  <youenn@apple.com>

        [Mac] Add back web audio support for getUserMedia MediaStreamTrack
        https://bugs.webkit.org/show_bug.cgi?id=170482

        Reviewed by Eric Carlson.

        ´Covered by reenabled test.

        Exporting method and class used in WebKit2.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/audio/mac/CAAudioStreamDescription.h:
        * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:

2017-04-04  Alexey Proskuryakov  <ap@apple.com>

        More build fixing.

        * platform/spi/mac/AVFoundationSPI.h:

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

        Do some minor FEColorMatrix code cleanup and optimization
        https://bugs.webkit.org/show_bug.cgi?id=170474

        Reviewed by Dean Jackson.

        Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).
        
        Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
        of multiple times, which is faster.
        
        This kind of code benefits from aligning things with spaces for readability, so do so,
        violating webkit style.
        
        Add some off-by-default performance logging code.

        Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.

        * platform/graphics/filters/FEColorMatrix.cpp:
        (WebCore::matrix):
        (WebCore::saturateAndHueRotate):
        (WebCore::effectType):
        (WebCore::FEColorMatrix::platformApplySoftware):

2017-04-04  Brent Fulgham  <bfulgham@apple.com>

        Do not assert when CharacterData representing an Attr fires events
        https://bugs.webkit.org/show_bug.cgi?id=170454
        <rdar://problem/30979320>

        Reviewed by Ryosuke Niwa.

        Make the NoEventDispatchAssertion in CharacterData::notifyParentAfterChange conditional
        since Attr elements should be allowed to fire events.

        Tests: fast/dom/no-assert-for-malformed-js-url-attribute.html

        * dom/CharacterData.cpp:
        (WebCore::CharacterData::notifyParentAfterChange):

2017-04-04  Youenn Fablet  <youenn@apple.com>

        LayoutTest webrtc/libwebrtc/descriptionGetters.html is a flaky failure
        https://bugs.webkit.org/show_bug.cgi?id=169481

        Reviewed by Eric Carlson.

        No need to enumerate all network interfaces in most layout tests.
        Adding an Internals API for that in case we want to use TCP localhost candidates.

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


2017-04-04  Jer Noble  <jer.noble@apple.com>

        Unreviewed build fix: fix compilation error on Sierra.

        * platform/spi/mac/AVFoundationSPI.h:

2017-04-04  Jer Noble  <jer.noble@apple.com>

        Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
        https://bugs.webkit.org/show_bug.cgi?id=170471

        Reviewed by Eric Carlson.

        Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Deleted.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer): Deleted.
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        * platform/spi/mac/AVFoundationSPI.h:

2017-04-04  Saam Barati  <sbarati@apple.com>

        WebAssembly: JSWebAssemblyCallee should not be a JSCell
        https://bugs.webkit.org/show_bug.cgi?id=170135

        Reviewed by Michael Saboff.

        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::callerDOMWindow):

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

        Change Document's lastHandledUserGestureTimestamp to be a MonotonicTime
        https://bugs.webkit.org/show_bug.cgi?id=170468

        Reviewed by Zalan Bujtas.
        
        Change the double to MonotonicTime. No behavior change.

        * dom/Document.cpp:
        (WebCore::Document::updateLastHandledUserGestureTimestamp):
        * dom/Document.h:
        (WebCore::Document::lastHandledUserGestureTimestamp):
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::documentHadRecentUserGesture):
        * loader/FrameLoader.cpp:
        (WebCore::shouldAskForNavigationConfirmation):

2017-04-04  Youenn Fablet  <youenn@apple.com>

        [Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
        https://bugs.webkit.org/show_bug.cgi?id=170395
        <rdar://problem/31394017>

        Reviewed by Mark Lam.

        No change of behavior.

        * bindings/js/JSDOMPromise.cpp:
        (WebCore::DeferredPromise::reject): Adding early ASSERT that creating an exception is happening correctly.

2017-04-04  Alexey Proskuryakov  <ap@apple.com>

        Rolling back the build fix, as it broke other builds.

        * platform/spi/mac/AVFoundationSPI.h:

2017-04-04  Alexey Proskuryakov  <ap@apple.com>

        Build fix.

        Rubber-stamped by Jer Noble.

        * platform/spi/mac/AVFoundationSPI.h:

2017-04-04  Tim Horton  <timothy_horton@apple.com>

        [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps
        https://bugs.webkit.org/show_bug.cgi?id=165801
        <rdar://problem/29649535>

        Reviewed by Wenson Hsieh.

        New API tests: WebKit2.FindInPageWrapping*

        * page/FrameTree.cpp:
        (WebCore::FrameTree::traverseNextWithWrap):
        (WebCore::FrameTree::traversePreviousWithWrap):
        (WebCore::FrameTree::traverseNextInPostOrderWithWrap):
        * page/FrameTree.h:
        Add CanWrap and DidWrap boolean enums, and add an optional out argument
        to traverse*WithWrap indicating whether a wrap actually occurred.

        * history/CachedPage.cpp:
        (WebCore::firePageShowAndPopStateEvents):
        * history/PageCache.cpp:
        (WebCore::destroyRenderTree):
        Adjust to the new CanWrap enum.
        
        * page/Page.cpp:
        (WebCore::incrementFrame):
        (WebCore::Page::findString):
        (WebCore::Page::findStringMatchingRanges):
        (WebCore::Page::rangeOfString):
        (WebCore::Page::findMatchesForText):
        (WebCore::Page::unmarkAllTextMatches):
        * page/Page.h:
        Adjust to the new CanWrap enum, and optionally plumb DidWrap through
        to callers of findString().

2017-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] PLATFORM(GTK) && !USE(COORDINATED_GRAPHICS_THREADED) is no longer possible
        https://bugs.webkit.org/show_bug.cgi?id=170458

        Reviewed by Carlos Alberto Lopez Perez.

        That is not supported anymore, so we can remove dead code from VideoSinkGStreamer.cpp

        * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
        (VideoRenderRequestScheduler::VideoRenderRequestScheduler):

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

        Unreviewed Windows build fix.

        * bindings/js/JSDOMGuardedObject.h:

2017-04-03  Wenson Hsieh  <wenson_hsieh@apple.com>

        Data interaction should register type identifiers in order of priority
        https://bugs.webkit.org/show_bug.cgi?id=170428
        <rdar://problem/30633296>

        Reviewed by Tim Horton.

        Currently, due to the shared logic for writing to a UIPasteboard (in the case of copy/paste) and the shared
        UIItemProvider-based pasteboard wrapper (in the case of data interaction), we don't enforce any particular
        ordering in which type identifiers are registered in the generated item provider. This is because
        -[UIPasteboard setItems:] only takes an unordered mapping of type identifiers to objects.

        To fix this, we introduce a separate way to set pasteboard data that first writes a list of object
        representations in order of priority (which is dependent on the content being interacted with) and then register
        individual type-data mappings at the end.

        Augmented existing API tests in DataInteractionTests to check for the existence and priority of type identifiers
        in the UIItemProviders created upon starting data interaction. Also adds a new unit test:
        DataInteractionTests.TextAreaToInput.

        * WebCore.xcodeproj/project.pbxproj:
        * editing/cocoa/EditorCocoa.mm:
        (WebCore::archivedDataForAttributedString):
        (WebCore::Editor::writeSelectionToPasteboard):
        (WebCore::Editor::writeSelection):
        * platform/Pasteboard.h:
        * platform/PasteboardWriterData.h:
        * platform/PlatformPasteboard.h:
        * platform/ios/AbstractPasteboard.h:
        * platform/ios/AbstractPasteboard.mm: Copied from Source/WebCore/platform/ios/AbstractPasteboard.h.

        Introduce WebPasteboardItemData, a wrapper around a list of objects representating the pasteboard data in order
        of priority, and a dictionary containing additional NSData blobs that contain data useful for private clients.

        (+[WebPasteboardItemData itemWithRepresentingObjects:additionalData:]):
        (-[WebPasteboardItemData initWithRepresentingObjects:additionalData:]):
        (-[WebPasteboardItemData representingObjects]):
        (-[WebPasteboardItemData additionalData]):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::richTextRepresentationsForPasteboardWebContent):
        (WebCore::PlatformPasteboard::writeObjectRepresentations):
        (WebCore::PlatformPasteboard::write):

        Tweaked to check whether the pasteboard responds to -setItemsFromObjectRepresentations:. If so, uses the
        PlatformPasteboard::writeObjectRepresentations codepath to write data to the pasteboard, respecting type
        priority.

        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard pasteboardTypes]):
        (-[WebItemProviderPasteboard setItemProviders:]):
        (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):

        Replaces -setItems: with -setItemsFromObjectRepresentations:, which respects the priority of each object
        representation of the data in the pasteboard.

        (-[WebItemProviderPasteboard setItems:]): Deleted.

2017-04-03  Javier Fernandez  <jfernandez@igalia.com>

        [css-align] Adapt place-content alignment shorthand to the new baseline syntax
        https://bugs.webkit.org/show_bug.cgi?id=170340

        Reviewed by David Hyatt.

        Now that the align-content and justify-content CSS properties are
        adapted to the new baseline-position CSS values syntax we can adapt the
        shorthand that controls such properties to the new syntax as well.

        No new tests, just adding some additional cases to the tests we already have.

        * css/StyleProperties.cpp:
        (WebCore::StyleProperties::getPropertyValue):
        (WebCore::StyleProperties::placeContentPropertyValue):
        * css/StyleProperties.h:
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::isContentDistributionKeyword):
        (WebCore::isContentPositionKeyword):
        (WebCore::isOverflowKeyword):
        (WebCore::getBaselineKeyword):
        (WebCore::consumeContentDistributionOverflowPosition):
        (WebCore::consumeSimplifiedContentPosition):

2017-04-03  Nan Wang  <n_wang@apple.com>

        AX: Expose link children when doing search predication on iOS
        https://bugs.webkit.org/show_bug.cgi?id=170424
        <rdar://problem/31413335>

        The children of links are accessible elements on iOS instead of the link itself, 
        so we should expose the children when doing predicated searches as well.

        Reviewed by Chris Fleizach.

        Test: accessibility/ios-simulator/ios-search-predicate-link-children.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):

2017-04-03  Jer Noble  <jer.noble@apple.com>

        No audio output for MediaStream-backed audio elements on iOS
        https://bugs.webkit.org/show_bug.cgi?id=170427

        Reviewed by Eric Carlson.

        The logic for setting the output timestamp offset in AudioSampleDataSource was reversed; instead of
        subtracting out the timestamp of the first pull request, it effectively doubled it.

        * platform/audio/mac/AudioSampleDataSource.mm:
        (WebCore::AudioSampleDataSource::pullSamplesInternal):

2017-04-03  Dave Hyatt  <hyatt@apple.com>

        Japanese fonts in vertical text should support synthesized italics
        https://bugs.webkit.org/show_bug.cgi?id=169301

        Reviewed by Simon Fraser.

        Updated test in fast/text/international.

        * platform/graphics/Font.cpp:
        (WebCore::Font::nonSyntheticItalicFont): Deleted.
        * platform/graphics/Font.h:
        Removed the non-synthetic italic font member, since it's not used.

        * platform/graphics/FontCascadeFonts.cpp:
        (WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
        Patched to ensure that a text-orientation-fallback font data is always
        returned in the synthetic oblique case, so that non-CJK and CJK are
        guaranteed to be broken up so that their slants can be applied differently.

        (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
        (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
        (WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic): Deleted.
        Patched to no longer turn off synthetic oblique for CJK.

        * platform/graphics/cocoa/FontCascadeCocoa.mm:
        (WebCore::FontCascade::drawGlyphs):
        Apply the correct italic transform to CJK when in vertical text.

2017-04-03  Chris Dumez  <cdumez@apple.com>

        REGRESSION (r206744): CSS background-image in style attribute ignored when using createHTMLDocument method of DOM parsing
        https://bugs.webkit.org/show_bug.cgi?id=170285
        <rdar://problem/31378543>

        Reviewed by Andy Estes.

        r206744 caused up to stop trying to resolve relative URLs when trying to load an image
        referred to by CSS. We already try to resolve the relative URL when parsing the CSS
        property so this will usually work fine. However, in the case when the CSS property
        is parsed in detached document and then moved to another document, we will not have
        the complete URL.

        Test: fast/images/background-image-relative-url-changes-document.html

        * css/CSSImageValue.cpp:
        (WebCore::CSSImageValue::loadImage):

2017-04-03  Jeremy Jones  <jeremyj@apple.com>

        Do not set WebAVPlayerLayerView background to black in fullscreen.
        https://bugs.webkit.org/show_bug.cgi?id=170132
        rdar://problem/30839278

        Reviewed by Tim Horton.

        No new tests because no behavior change.

        The black background on WebAVPlayerLayerView interferes with the fullscreen animation
        and has been removed.

        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebVideoFullscreenInterfaceAVKit::enterFullscreen):
        (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):

2017-04-03  Antti Koivisto  <antti@apple.com>

        REGRESSION (r207669): FileMaker Pro Help pages do not render correctly
        https://bugs.webkit.org/show_bug.cgi?id=170402
        <rdar://problem/31004344>

        Reviewed by Simon Fraser.

        If a new stylesheet load is started from the load event the document.styleSheets does not
        always reflect the already loaded stylesheets.

        Test: fast/css/document-stylesheets-dynamic.html

        * style/StyleScope.cpp:
        (WebCore::Style::Scope::updateActiveStyleSheets):

            Remove an old optimization where we would not update active stylesheets if there were pending
            (head) stylesheet loads and they had not been updated already.
            This is probably not a valuable optimization anymore with the new lazy stylesheet update strategy.

        * style/StyleScope.h:

2017-04-03  Anders Carlsson  <andersca@apple.com>

        Tweak ApplePaySession API
        https://bugs.webkit.org/show_bug.cgi?id=170409
        rdar://problem/31405459

        Reviewed by Tim Horton.

        Rename "address" to "addressLines". Add "postalAddress". Reorder the ApplePayError constructor parameters.

        * Modules/applepay/ApplePayError.cpp:
        (WebCore::ApplePayError::create):
        (WebCore::ApplePayError::ApplePayError):
        * Modules/applepay/ApplePayError.h:
        * Modules/applepay/ApplePayError.idl:
        * Modules/applepay/PaymentRequest.h:

2017-04-03  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement CryptoKeyEC::keySizeInBits(), ::platformGeneratePair()
        https://bugs.webkit.org/show_bug.cgi?id=170345

        Reviewed by Michael Catanzaro.

        Start implementing the libgcrypt-based platform bits of CryptoKeyEC.

        Implement keySizeInBits() by returning the appropriate size for this
        object's curve type. An assertion is added to ensure that this size
        matches the one that's returned by gcry_pk_get_nbits() for this
        object's EC key as represented by the m_platformKey gcry_sexp_t object.

        Implement platformGeneratePair() by constructing a genkey s-expression
        that requests a generation of an EC key for the specified curve type.
        The s-expression is then passed to gcry_pk_genkey(), and the public
        and private key data is then retrieved from the returned s-expression
        upon success and used to create the public and private CryptoKeyEC
        objects.

        The PlatformECKey type alias is changed to match gcry_sexp_t. The
        CryptoKeyEC destructor releases the gcry_sexp_t object through
        a PAL::GCrypt::HandleDeleter<gcry_sexp_t> instance.

        The method definitions in the CryptoKeyECGCrypt.cpp file are also
        sorted to match the declaration order in the header.

        No new tests -- current ones cover this sufficiently, but are not yet
        enabled due to other missing platform-specific SUBTLE_CRYPTO
        implementations.

        * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
        (WebCore::curveSize):
        (WebCore::curveName):
        (WebCore::CryptoKeyEC::~CryptoKeyEC):
        (WebCore::CryptoKeyEC::keySizeInBits):
        (WebCore::CryptoKeyEC::platformGeneratePair):
        (WebCore::CryptoKeyEC::platformImportSpki):
        (WebCore::CryptoKeyEC::platformImportPkcs8):
        (WebCore::CryptoKeyEC::platformExportRaw):
        (WebCore::CryptoKeyEC::platformAddFieldElements):
        (WebCore::CryptoKeyEC::platformExportSpki):
        * crypto/keys/CryptoKeyEC.h:

2017-04-03  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement AES_KW support
        https://bugs.webkit.org/show_bug.cgi?id=170274

        Reviewed by Michael Catanzaro.

        Implement the CryptoAlgorithmAES_KW::platform{Wrap,Unwrap}Key()
        functionality for configurations that use libgcrypt. This is done
        by leveraging the gcry_cipher_* APIs for the AES algorithm that's
        deducted appropriately from the key size and the AESWRAP cipher mode.

        No new tests -- current ones cover this sufficiently, but are not yet
        enabled due to other missing platform-specific SUBTLE_CRYPTO
        implementations.

        * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
        (WebCore::gcryptWrapKey):
        (WebCore::gcryptUnwrapKey):
        (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
        (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):

2017-04-03  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement AES_GCM support
        https://bugs.webkit.org/show_bug.cgi?id=170271

        Reviewed by Michael Catanzaro.

        Implement the CryptoAlgorithmAES_GCM::platform{Encrypt,Decrypt}
        functionality for configurations that use libgcrypt. This is done
        by leveraging the gcry_cipher_* APIs for the AES algorithm that's
        deducted appropriately from the key size and the GCM cipher mode.

        No new tests -- current ones cover this sufficiently, but are not yet
        enabled due to other missing platform-specific SUBTLE_CRYPTO
        implementations.

        * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
        (WebCore::gcryptEncrypt):
        (WebCore::gcryptDecrypt):
        (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
        (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):

2017-04-03  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Implement PBKDF2 support
        https://bugs.webkit.org/show_bug.cgi?id=170270

        Reviewed by Michael Catanzaro.

        Implement the CryptoAlgorithmPBKDF2::platformDeriveBits() functionality
        for configurations that use libgcrypt. This is done by leveraging the
        gcry_kdf_derive() API, using GCRY_KDF_PBKDF2 as the preferred KDF
        along with the properly deducted SHA algorithm.

        No new tests -- current ones cover this sufficiently, but are not yet
        enabled due to other missing platform-specific SUBTLE_CRYPTO
        implementations.

        * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
        (WebCore::gcryptDeriveBits):
        (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):

2017-04-01  Simon Fraser  <simon.fraser@apple.com>

        Clean up touch event handler registration when moving nodes between documents
        https://bugs.webkit.org/show_bug.cgi?id=170384
        rdar://problem/30816694

        Reviewed by Chris Dumez.

        Make sure that Node::didMoveToNewDocument() does the correct unregistration on the
        old document, and registration on the new document for nodes with touch event listeners,
        and gesture event listeners. Touch "handler" nodes (those for overflow and sliders) are
        already correctly moved via renderer-related teardown.

        Add assertions that fire when removal was not complete.

        Use references in more places.

        Tests: fast/events/touch/ios/gesture-node-move-between-documents.html
               fast/events/touch/ios/overflow-node-move-between-documents.html
               fast/events/touch/ios/slider-node-move-between-documents.html
               fast/events/touch/ios/touch-node-move-between-documents.html

        * dom/EventNames.h:
        (WebCore::EventNames::gestureEventNames):
        * dom/Node.cpp:
        (WebCore::Node::willBeDeletedFrom):
        (WebCore::Node::didMoveToNewDocument):
        (WebCore::tryAddEventListener):
        (WebCore::tryRemoveEventListener):
        * html/shadow/SliderThumbElement.cpp:
        (WebCore::SliderThumbElement::registerForTouchEvents):
        (WebCore::SliderThumbElement::unregisterForTouchEvents):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::registerAsTouchEventListenerForScrolling):
        (WebCore::RenderLayer::unregisterAsTouchEventListenerForScrolling):

2017-04-03  Youenn Fablet  <youenn@apple.com>

        captureStream is getting black frames with webgl canvas
        https://bugs.webkit.org/show_bug.cgi?id=170325

        Reviewed by Dean Jackson.

        Test: fast/mediastream/captureStream/canvas3d.html

        Changing the webgl context to save buffers in case the canvas is captured.
        Adding a canvas changed notification in case of clear.
        In the future, we might want to change this notification and do it when endPaint or similar is called.

        Adding an Internals API to grab the RGBA equivalent of the next track frame.
        For that purpose, adding a bunch of WEBCORE_EXPORT.

        * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
        (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Adding constraints support so that track settings
        getter actually transmits the width and height of the source.
        (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): ensuring webgl canvas context keep their drawing buffer.
        * Modules/mediastream/MediaStreamTrack.h:
        * bindings/js/JSDOMGuardedObject.h:
        * bindings/js/JSDOMPromise.h:
        (WebCore::DeferredPromise::resolve):
        (WebCore::DeferredPromise::reject):
        * dom/ActiveDOMCallback.h:
        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::captureStream):
        * html/ImageData.h:
        * html/ImageData.idl:
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::clear): ensuring canvas observers get notified in case of clear calls.
        * html/canvas/WebGLRenderingContextBase.h:
        (WebCore::WebGLRenderingContextBase::preserveDrawingBuffer): Added to allow canvas capture to update this property.
        * platform/MediaSample.h:
        (WebCore::MediaSample::getRGBAImageData): Added for internals API.
        * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
        (WebCore::MediaSampleAVFObjC::getRGBAImageData):
        * platform/graphics/cv/PixelBufferConformerCV.cpp:
        (WebCore::PixelBufferConformerCV::convert): Helper routine for getRGBAImageData.
        * platform/graphics/cv/PixelBufferConformerCV.h:
        * platform/mediastream/RealtimeMediaSourceSettings.h:
        (WebCore::RealtimeMediaSourceSettings::setSupportedConstraints):
        (WebCore::RealtimeMediaSourceSettings::setSupportedConstraits): Deleted.
        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        (WebCore::AVMediaCaptureSource::initializeSettings):
        * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h:
        * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h:
        * platform/mock/MockRealtimeMediaSource.cpp:
        (WebCore::MockRealtimeMediaSource::initializeSettings):
        * testing/Internals.cpp:
        (WebCore::Internals::grabNextMediaStreamTrackFrame):
        (WebCore::Internals::videoSampleAvailable):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-04-03  Per Arne Vollan  <pvollan@apple.com>

        Implement stroke-miterlimit.
        https://bugs.webkit.org/show_bug.cgi?id=169078

        Reviewed by Dean Jackson.

        Support stroke-miterlimit for text rendering, see https://drafts.fxtf.org/paint/.

        Tests: fast/css/stroke-miterlimit-default.html
               fast/css/stroke-miterlimit-large.html
               fast/css/stroke-miterlimit-zero.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::propertyValue):
        * css/CSSProperties.json:
        * css/SVGCSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::svgPropertyValue):
        * rendering/TextPaintStyle.cpp:
        (WebCore::computeTextPaintStyle):
        (WebCore::updateGraphicsContext):
        * rendering/TextPaintStyle.h:
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::diff):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::strokeMiterLimit):
        (WebCore::RenderStyle::setStrokeMiterLimit):
        (WebCore::RenderStyle::initialStrokeMiterLimit):
        (WebCore::RenderStyle::setStrokeDashOffset):
        * rendering/style/RenderStyleConstants.cpp:
        * rendering/style/RenderStyleConstants.h:
        * rendering/style/SVGRenderStyle.cpp:
        (WebCore::SVGRenderStyle::diff):
        * rendering/style/SVGRenderStyle.h:
        (WebCore::SVGRenderStyle::initialStrokeDashArray):
        (WebCore::SVGRenderStyle::strokeDashArray):
        (WebCore::SVGRenderStyle::initialStrokeMiterLimit): Deleted.
        (WebCore::SVGRenderStyle::strokeMiterLimit): Deleted.
        (WebCore::SVGRenderStyle::setStrokeMiterLimit): Deleted.
        * rendering/style/SVGRenderStyleDefs.cpp:
        (WebCore::StyleStrokeData::StyleStrokeData):
        (WebCore::StyleStrokeData::operator==):
        * rendering/style/SVGRenderStyleDefs.h:
        * rendering/style/StyleRareInheritedData.cpp:
        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
        (WebCore::StyleRareInheritedData::operator==):
        * rendering/style/StyleRareInheritedData.h:
        * rendering/svg/RenderSVGShape.cpp:
        (WebCore::RenderSVGShape::hasSmoothStroke):
        * rendering/svg/SVGRenderSupport.cpp:
        (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
        * rendering/svg/SVGRenderTreeAsText.cpp:
        (WebCore::writeStyle):

2017-04-03  Alejandro G. Castro  <alex@igalia.com>

        [OWR] Fix class structure for the OWR mock classes after last modifications
        https://bugs.webkit.org/show_bug.cgi?id=170173

        Reviewed by Youenn Fablet.

        In case of OWR MockRealtimeMediaSource inherits from
        RealtimeMediaSourceOwr, so we have to change some of the function
        interfaces.

        * platform/mock/MockRealtimeMediaSource.h:

2017-04-02  Alexey Proskuryakov  <ap@apple.com>

        Build fix for
        Add missing text styles
        https://bugs.webkit.org/show_bug.cgi?id=170295

        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::cachedSystemFontDescription):
        (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):

2017-04-01  Zalan Bujtas  <zalan@apple.com>

        Long Arabic text in ContentEditable with css white-space=pre hangs Safari
        https://bugs.webkit.org/show_bug.cgi?id=170245

        Reviewed by Myles C. Maxfield.

        While searching for mid-word break, we measure the text by codepoints in a loop until the accumulated width > available width.
        When we see that the accumulated width for the individual codepoints overflows, we join the codepoints and re-measure them.
        These 2 widths could be considerably different for number of reasons (ligatures is a prime example). When we figure that
        the run still fits, we go back to the main loop (since we are not supposed to wrap the line here) and take the next codepoint.
        However this time we start the measurement from the last whitespace, so we end up remeasuring a potentially long chuck of text
        until we hit the wrapping point. This is way too expensive.
        This patch changes the logic so that we just go back to measuring individual codepoints until we hit the constrain again.  

        Covered by existing tests.

        * rendering/line/BreakingContext.h:
        (WebCore::BreakingContext::handleText): canUseSimpleFontCodePath() is just to mitigate the potential risk of regression and
        complex text is more likely to fall into this category. 

2017-04-01  Jon Lee  <jonlee@apple.com>

        Add missing text styles
        https://bugs.webkit.org/show_bug.cgi?id=170295
        rdar://problem/30219503

        Reviewed by Dean Jackson.

        Updated existing test to include new text styles.

        * css/CSSValueKeywords.in: Add title0 and title4.
        * platform/spi/cocoa/CoreTextSPI.h:
        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::cachedSystemFontDescription):
        (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):

2017-04-01  Dan Bernstein  <mitz@apple.com>

        [iOS] <input type=file> label should be specified using plural rules
        https://bugs.webkit.org/show_bug.cgi?id=170388

        Reviewed by Alexey Proskuryakov.

        * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.

        * English.lproj/Localizable.stringsdict: Added an entry for the new key "%lu photo(s) and
          %lu video(s)", with plural rules covering all the different combinations in English.
          Other localizations may specify additional combinations as needed.

2017-04-01  Alexey Proskuryakov  <ap@apple.com>

        Rolling back <https://trac.webkit.org/r214697>, as it made WebKit2.DataDetectionReferenceDate time out.

        Was REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
        https://bugs.webkit.org/show_bug.cgi?id=170365

        * editing/cocoa/DataDetection.mm:
        (WebCore::searchForLinkRemovingExistingDDLinks):

2017-04-01  Chris Dumez  <cdumez@apple.com>

        We should pause silent WebAudio rendering in background tabs
        https://bugs.webkit.org/show_bug.cgi?id=170299
        <rdar://problem/31289132>

        Reviewed by Eric Carlson.

        We should pause silent WebAudio rendering in background tabs since it uses CPU and is
        not observable by the user. Such silent WebAudio rendering seems to be used by
        doubleclick ads.

        Test: webaudio/silent-audio-interrupted-in-background.html

        * Modules/webaudio/AudioContext.cpp:
        (WebCore::AudioContext::lazyInitialize):
        (WebCore::AudioContext::uninitialize):
        Have AudioContext register / unregister itself with the Document to get
        visibility change notifications, similarly to what HTMLMediaElement was
        already doing.

        (WebCore::AudioContext::visibilityStateChanged):
        Begin / End session interruption whenever the page visiblity changes.

        * Modules/webaudio/AudioContext.h:
        * WebCore.xcodeproj/project.pbxproj:

        * dom/Document.cpp:
        (WebCore::Document::registerForVisibilityStateChangedCallbacks):
        (WebCore::Document::unregisterForVisibilityStateChangedCallbacks):
        (WebCore::Document::visibilityStateChanged):
        * dom/Document.h:
        * dom/Element.h:
        * dom/VisibilityChangeClient.h: Added.
        (WebCore::VisibilityChangeClient::~VisibilityChangeClient):
        * html/HTMLMediaElement.h:
        Introduce a new VisibilityChangeClient interface and have both AudioContext
        and HTMLMediaElement subclass it. Previously, the visibilityStateChanged()
        function was on Element but this prevented AudioContext from registering
        itself since AudioContext is not an Element.

2017-04-01  Dan Bernstein  <mitz@apple.com>

        [Cocoa] A couple of UI strings use three periods instead of an ellipsis
        https://bugs.webkit.org/show_bug.cgi?id=170386

        Reviewed by Tim Horton.

        * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.

        * platform/LocalizedStrings.cpp:
        (WebCore::mediaElementLoadingStateText): Changed "Loading..." to "Loading…".

        * platform/cocoa/LocalizedStringsCocoa.mm:
        (WebCore::contextMenuItemTagStyles): Changed "Styles..." to "Styles…".

2017-04-01  Dan Bernstein  <mitz@apple.com>

        Localizable strings files are out of date
        https://bugs.webkit.org/show_bug.cgi?id=170383

        Reviewed by Tim Horton.

        Ran update-webkit-localizable-strings.

        * English.lproj/Localizable.strings:

2017-04-01  Dan Bernstein  <mitz@apple.com>

        [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid
        https://bugs.webkit.org/show_bug.cgi?id=170385

        Reviewed by Tim Horton.

        * Configurations/DebugRelease.xcconfig: Set WK_RELOCATABLE_FRAMEWORKS to YES like we do
          in some other projects’ DebugRelease.xcconfig. Engineering builds are always relocatable.
        * Configurations/WebCore.xcconfig: When WebCore is relocatable, tell the linker that it’s
          not going to be in the shared cache, even if its install name implies that it might be.

2017-04-01  Alexey Proskuryakov  <ap@apple.com>

        Rolling back http://trac.webkit.org/r214663 - memory corruption

        * Modules/streams/ReadableByteStreamInternals.js:
        (cloneArrayBuffer):
        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
        * bindings/js/StructuredClone.cpp:
        (WebCore::structuredCloneArrayBuffer):
        (WebCore::cloneArrayBufferImpl): Deleted.
        (WebCore::cloneArrayBuffer): Deleted.
        * bindings/js/StructuredClone.h:
        * bindings/js/WebCoreBuiltinNames.h:
        * testing/Internals.cpp:
        (WebCore::markerTypeFrom):
        (WebCore::Internals::resetToConsistentState):
        (WebCore::Internals::isLoadingFromMemoryCache):
        (WebCore::Internals::setImageFrameDecodingDuration):
        (WebCore::deferredStyleRulesCountForList):
        (WebCore::deferredGroupRulesCountForList):
        (WebCore::deferredKeyframesRulesCountForList):
        (WebCore::Internals::eventThrottlingBehaviorOverride):
        (WebCore::Internals::enableMockSpeechSynthesizer):
        (WebCore::Internals::rangeForDictionaryLookupAtLocation):
        (WebCore::Internals::nodesFromRect):
        (WebCore::Internals::layerIDForElement):
        (WebCore::Internals::setElementUsesDisplayListDrawing):
        (WebCore::Internals::setElementTracksDisplayListReplay):
        (WebCore::Internals::styleRecalcCount):
        (WebCore::Internals::compositingUpdateCount):
        (WebCore::Internals::setCaptionDisplayMode):
        (WebCore::Internals::endMediaSessionInterruption):
        (WebCore::Internals::postRemoteControlCommand):
        (WebCore::appendOffsets):
        (WebCore::Internals::scrollSnapOffsets):
        (WebCore::Internals::setShowAllPlugins):
        (WebCore::Internals::cloneArrayBuffer): Deleted.
        * testing/Internals.h:
        * testing/Internals.idl:

2017-03-31  Zalan Bujtas  <zalan@apple.com>

        <table>: Including <caption>, <thead> or <tbody> causes clipping across page breaks
        https://bugs.webkit.org/show_bug.cgi?id=170348
        <rdar://problem/24727151>

        Reviewed by David Hyatt.

        1. In RenderFlowThread::offsetFromLogicalTopOfFirstRegion() we need to take table section offset into account (they are skipped
        during the containing block traversal).
        2. Trigger paginated relayout when body is moved vertically due to caption/thead etc.

        Test: fast/multicol/table-section-page-break.html

        * rendering/RenderFlowThread.cpp:
        (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::layout):

2017-03-31  Simon Fraser  <simon.fraser@apple.com>

        Rename DOMWindow's m_touchEventListenerCount to m_touchAndGestureEventListenerCount
        https://bugs.webkit.org/show_bug.cgi?id=170371

        Reviewed by Tim Horton.

        This count tracks touch and gesture event listeners, so name it appropriately.

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::addEventListener):
        (WebCore::DOMWindow::removeEventListener):
        (WebCore::DOMWindow::removeAllEventListeners):
        * page/DOMWindow.h:

2017-03-31  Simon Fraser  <simon.fraser@apple.com>

        When destroying a Node, assert that it's been removed from all the touch handler maps
        https://bugs.webkit.org/show_bug.cgi?id=170363
        rdar://problem/31377469

        Reviewed by Tim Horton.

        Assert that the Node has been removed from the touch handler maps in all documents on destruction.

        * dom/Document.h:
        (WebCore::Document::hasTouchEventHandlers):
        (WebCore::Document::touchEventTargetsContain):
        * dom/Node.cpp:
        (WebCore::Node::~Node):

2017-03-31  Alexey Proskuryakov  <ap@apple.com>

        Rolling back https://trac.webkit.org/r214689, as it caused many crashes.

        Was:
        Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
        https://bugs.webkit.org/show_bug.cgi?id=170357

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

2017-03-31  Youenn Fablet  <youenn@apple.com>

        Fix memory leak in RealtimeVideoIncomingSource
        https://bugs.webkit.org/show_bug.cgi?id=170356

        Reviewed by Eric Carlson.

        No change of behavior.

        * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
        (WebCore::RealtimeIncomingVideoSource::OnFrame): Adopting the newly created pointer.

2017-03-31  Andy Estes  <aestes@apple.com>

        REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
        https://bugs.webkit.org/show_bug.cgi?id=170365
        <rdar://problem/29205721>

        Reviewed by Tim Horton.

        r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
        consider nodes that are descendants of startNode, but we need to traverse all nodes between
        startNode and endNode to find existing non-DD links.

        As a result, we'd add a Data Detector link to the following snippet and make the original
        links un-clickable:

            <a href='#'>tomorrow</a> <a href='#'>night</a>

        Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
        will terminate when we reach endNode.

        Updated WebKit2.DataDetectionReferenceDate API test.

        * editing/cocoa/DataDetection.mm:
        (WebCore::searchForLinkRemovingExistingDDLinks):

2017-03-31  Eric Carlson  <eric.carlson@apple.com>

        Incoming video source doesn't propogate frame rotation
        https://bugs.webkit.org/show_bug.cgi?id=170364

        Reviewed by Youenn Fablet.

        No new tests, the mock video source doesn't support rotation. Test will be added when
        this is fixed in https://bugs.webkit.org/show_bug.cgi?id=169822. The changes were 
        verified manually.

        * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
        (WebCore::RealtimeIncomingVideoSource::OnFrame): Convert frame rotation to sample
        orientation and swap width and height when necessary.
        (WebCore::RealtimeIncomingVideoSource::processNewSample):
        * platform/mediastream/mac/RealtimeIncomingVideoSource.h:

2017-03-31  Chris Dumez  <cdumez@apple.com>

        Possible null dereference under SourceBuffer::sourceBufferPrivateDidReceiveSample()
        https://bugs.webkit.org/show_bug.cgi?id=159639

        Reviewed by Eric Carlson.

        Add a null check for trackBuffer.description before dereferencing as it seems
        it can be null.

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

2017-03-31  Youenn Fablet  <youenn@apple.com>

        Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
        https://bugs.webkit.org/show_bug.cgi?id=170357

        Reviewed by Geoffrey Garen.

        No change of behavior.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded): Adopting the raw pointer parameter.

2017-03-31  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] WebCore::PlatformDisplay::terminateEGLDisplay causes a crash in libGLESv2.dll while processing atexit
        https://bugs.webkit.org/show_bug.cgi?id=170331

        Reviewed by Michael Catanzaro.

        WebCore::PlatformDisplay uses atexit to destruct EGL displays
        while exiting process. But, when the atexit will be processed,
        heap of libGLESv2.dll would be already destructed and causing a
        crash on Windows. Do not use atexit for Windows.

        AppleWin port does not use PlatformDisplay. Thus, it does not have
        this bug.

        * platform/graphics/PlatformDisplay.cpp:
        (WebCore::PlatformDisplay::initializeEGLDisplay): Do not use atexit for Windows.
        (WebCore::PlatformDisplay::shutDownEglDisplays): Added.
        * platform/graphics/PlatformDisplay.h: Added a declaration of shutDownEglDisplays.

2017-03-31  Yoav Weiss  <yoav@yoav.ws>

        Remove PRELOAD_DEBUG related code.
        https://bugs.webkit.org/show_bug.cgi?id=170352

        Reviewed by Youenn Fablet.

        As the PRELOAD_DEBUG related code stopped building and it seems like no one noticed,
        it seems safe to assume that we can remove that code. This patch removes it.

        No new tests as there's no functional change.

        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::preload):
        (WebCore::CachedResourceLoader::clearPreloads):
        (WebCore::CachedResourceLoader::printPreloadStats): Deleted.

2017-03-31  Brady Eidson  <beidson@apple.com>

        Clean up the "StorageType" enum.
        https://bugs.webkit.org/show_bug.cgi?id=170349

        Reviewed by Tim Horton.

        - Make this `enum` into an `enum class`
        - Add a new type specific for "transient local storage"

        No new tests (No behavior change).

        * WebCore.xcodeproj/project.pbxproj:
        
        * inspector/InspectorDOMStorageAgent.cpp:
        (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
        
        * inspector/InspectorInstrumentation.h:
        
        * loader/EmptyClients.cpp:
        
        * storage/Storage.cpp:
        (WebCore::Storage::isDisabledByPrivateBrowsing):
        
        * storage/StorageArea.h:
        (): Deleted.
        
        * storage/StorageEventDispatcher.cpp:
        (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
        (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
        
        * storage/StorageType.h:
        (WebCore::isLocalStorage):

2017-03-31  Chris Dumez  <cdumez@apple.com>

        Unreviewed, Mark "HTML interactive form validation" as done.

        It is shipping in Safari 10.1.
 
        * features.json:

2017-03-31  Csaba Osztrogonác  <ossy@webkit.org>

        Mac cmake buildfix after r214666
        https://bugs.webkit.org/show_bug.cgi?id=170342

        Unreviewed buildfix.

        * PlatformMac.cmake:
        * testing/MockPreviewLoaderClient.h:

2017-03-31  Sam Weinig  <sam@webkit.org>

        Remove unneeded custom constructors include.

        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/ios: Removed.
        * bindings/js/ios/TouchConstructors.cpp: Removed.

2017-03-31  John Wilander  <wilander@apple.com>

        Resource Load Statistics: Check if the store exists before clearing it
        https://bugs.webkit.org/show_bug.cgi?id=170324
        <rdar://problem/31258505>

        Reviewed by Brent Fulgham.

        No new tests. Added a null check.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
            Added a null check.

2017-03-31  Romain Bellessort  <romain.bellessort@crf.canon.fr>

        [Readable Streams API] Implement cloneArrayBuffer in WebCore
        https://bugs.webkit.org/show_bug.cgi?id=170008

        Reviewed by Youenn Fablet.

        Implemented cloneArrayBuffer based on existing structuredCloneArrayBuffer
        implementation. The code has been factorized so that both cloneArrayBuffer
        and structuredCloneArrayBuffer rely on the same code (which is basically
        the previous implementation of structuredCloneArrayBuffer + the ability
        to clone only a part of considered buffer).

        Added test to check cloneArrayBuffer behaviour.

        * Modules/streams/ReadableByteStreamInternals.js: Deleted cloneArrayBuffer JS implementation.
        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Add cloneArrayBuffer private declaration.
        * bindings/js/StructuredClone.cpp:
        (WebCore::cloneArrayBufferImpl): Added (mostly based on previous structuredCloneArrayBuffer).
        (WebCore::cloneArrayBuffer): Added.
        (WebCore::structuredCloneArrayBuffer): Updated.
        * bindings/js/StructuredClone.h: Added cloneArrayBuffer declaration.
        * bindings/js/WebCoreBuiltinNames.h: Added cloneArrayBuffer declaration.
        * testing/Internals.cpp: Added support for testing cloneArrayBuffer.
        * testing/Internals.h: Added support for testing cloneArrayBuffer.
        * testing/Internals.idl: Added support for testing cloneArrayBuffer.

2017-03-31  Antoine Quint  <graouts@apple.com>

        [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
        https://bugs.webkit.org/show_bug.cgi?id=168409
        <rdar://problem/30799198>

        Unreviewed. Yet more logging to determine under what circumstance ScriptedAnimationController gets suspended.

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

2017-03-30  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed GTK+ build fix. Add missing ANGLE build targets
        to the build.

        * CMakeLists.txt:

2017-03-30  Simon Fraser  <simon.fraser@apple.com>

        Ensure that Node::willBeDeletedFrom() always removes touch event handlers from the document
        https://bugs.webkit.org/show_bug.cgi?id=170323
        rdar://problem/23647630

        Reviewed by Chris Dumez.

        There are two instances where nodes are registered as touch event handlers without
        having normal touch event listeners: slider thumb elements, and elements with overflow scrolling,
        on iOS.

        For such nodes, hasEventTargetData() will be false, but we want to ensure
        that they are removed from the Document's touchEventHandler set, so move the
        call to document.removeTouchEventHandler() outside of the conditional block.

        This should be cheap in most cases when the touchEventHandler is empty.

        * dom/Node.cpp:
        (WebCore::Node::willBeDeletedFrom):

2017-03-30  Simon Fraser  <simon.fraser@apple.com>

        Minor cleanup checking for gesture event names
        https://bugs.webkit.org/show_bug.cgi?id=170319

        Reviewed by Tim Horton.

        Just use isGestureEventType() in a couple of places.

        * dom/Node.cpp:
        (WebCore::tryAddEventListener):
        (WebCore::tryRemoveEventListener):

2017-03-30  Simon Fraser  <simon.fraser@apple.com>

        Rename a touch event function, and new touch region test results
        https://bugs.webkit.org/show_bug.cgi?id=170309
        rdar://problem/31329520

        Reviewed by Chris Dumez.

        Adapt to a naming change in WebKitAdditions.

        * dom/Document.cpp:
        (WebCore::Document::removeAllEventListeners):
        * page/FrameView.cpp:
        (WebCore::FrameView::layout):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::styleWillChange):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::scrollTo):
        (WebCore::RenderLayer::calculateClipRects):

2017-03-30  Matt Rajca  <mrajca@apple.com>

        YouTube sometimes does not respect "user gesture" restriction for videos.
        https://bugs.webkit.org/show_bug.cgi?id=170297

        I discovered a code path that does not honor the "user gesture" requirement and playback is able to begin
        even though we have a restriction in place. When using Media Source Extensions, which YouTube does, we transition
        from a "Have Metadata" to a "Future Data" state that causes playback to begin, however, we never check
        if we have a playback restriction in place.

        Reviewed by Eric Carlson.

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

2017-03-30  Said Abou-Hallawa  <sabouhallawa@apple.com>

        REGRESSION (r213764): Background image from sprite sheet incorrectly scaled
        https://bugs.webkit.org/show_bug.cgi?id=169547

        Reviewed by Simon Fraser.

        The bug happens when drawing only a rectangle of an image not the whole
        image. In BitmapImage::draw(), sizeForDrawing was calculated as the destRect
        scaled by the transformation which is applied to the GraphicsContext. Two
        problems with this approach. The first one is destRect can be only part of
        the image. The second problem is, the ratio destRect / srcRect is another
        scaling that needs to be considered.

        To fix this issue, first the base size has to be size of the image and not
        destRect.size(). Secondly, we need to scale this base size with the context
        transformation multiplied by the ratio destRect / srcRect. This scaling is
        exactly the same scaling which is calculated in subsamplingScale(). Finally
        we use this scaled size as the sizeForDrawing to send to the ImageDecoder.

        Test: fast/images/sprite-sheet-image-draw.html

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::draw): Fix the bug.
        (WebCore::BitmapImage::stopAnimation): Stops the async image decoding for animated images only.
        The decoding for large images will be stopped when BitmapImage::newFrameNativeImageAvailableAtIndex()
        is called and the decoding queue is idle.
        (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Add image logging.
        * platform/graphics/BitmapImage.h: Move sourceURL() to the Image class.
        * platform/graphics/GraphicsContext.cpp: Pass imagePaintingOptions.m_decodingMode to Image::drawTiled().
        (WebCore::GraphicsContext::drawTiledImage): Pass imagePaintingOptions.m_decodingMode) to Image::drawTiled().
        * platform/graphics/Image.cpp:
        (WebCore::Image::sourceURL): Moved from BitmapImage.
        (WebCore::Image::drawTiled): Add a DecodingMode argument instead of calling always with DecodingMode::Synchronous.
        * platform/graphics/Image.h:
        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Add image logging.
        (WebCore::ImageFrameCache::startAsyncDecodingQueue): Ditto,
        (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Ditto.
        (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Ditto.
        (WebCore::ImageFrameCache::sourceURL): A helper function to avoid checking the value of m_image.
        * platform/graphics/ImageFrameCache.h:
        * platform/graphics/NativeImage.h: Rename subsamplingScale() to nativeImageDrawingScale() and return image scaling instead.
        * platform/graphics/cairo/NativeImageCairo.cpp:
        (WebCore::nativeImageDrawingScale): Ditto.
        (WebCore::subsamplingScale): Deleted.
        * platform/graphics/cg/NativeImageCG.cpp:
        (WebCore::nativeImageDrawingScale): Ditto.
        (WebCore::subsamplingScale): Deleted.
        * platform/graphics/win/NativeImageDirect2D.cpp:
        (WebCore::nativeImageDrawingScale): Ditto.
        (WebCore::subsamplingScale): Deleted.

2017-03-30  Matt Baker  <mattbaker@apple.com>

        Web Inspector: Assertion failure in InspectorStyleProperty::setRawTextFromStyleDeclaration
        https://bugs.webkit.org/show_bug.cgi?id=170279
        <rdar://problem/30200492>

        Reviewed by David Hyatt.

        The SourceRange for a CSSPropertySourceData should be relative to the start
        of the declaration body, not the start of the StyleSheetHandler’s parsed
        text. This only affected the ranges of unparsed (parsedOK == false) properties
        lacking a trailing semi-colon.

        This patch doesn't change the behavior of InspectorStyleSheet other than
        silencing an irksome assert, as String::substring does a safety check on
        the passed in length.

        * inspector/InspectorStyleSheet.cpp:
        (WebCore::fixUnparsedProperties):

2017-03-30  Youenn Fablet  <youenn@apple.com> and Jon Lee <jonlee@apple.com>

        Clean up RTCDataChannel
        https://bugs.webkit.org/show_bug.cgi?id=169732

        Reviewed by Chris Dumez.

        Test: webrtc/datachannel/datachannel-event.html
              webrtc/datachannel/bufferedAmountLowThreshold.html

        Making RTCDataChannel interface closer to the spec updating implementation accordingly.
        See https://w3c.github.io/webrtc-pc/#rtcdatachannel.
        In particular adding RTCDataChannelEvent constructor, and missing bufferedAmount related attributes.
        Doing some additional cleaning refactoring.

        Making bufferedAmountIsDecreasing take a bufferedAmount argument so that we get the actual value passed by
        libwebrtc without needing to get it from the libwebrtc network thread again.
        In the future, we should store the bufferedAmount value in RTCDataChannel and update its value on each libwebrtc
        OnBufferedAmountChange. Special treatment may be needed when the data channel is closed, in which case the bufferedAmount should just be
        updated to increase in the send method.

        Added some FIXMEs as RTCDataChannel is not aligned with the spec related to send and bufferedAmount.

        * Modules/mediastream/RTCDataChannel.cpp:
        (WebCore::RTCDataChannel::send):
        (WebCore::RTCDataChannel::close):
        (WebCore::RTCDataChannel::didChangeReadyState):
        (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
        * Modules/mediastream/RTCDataChannel.h:
        * Modules/mediastream/RTCDataChannel.idl:
        * Modules/mediastream/RTCDataChannelEvent.cpp:
        (WebCore::RTCDataChannelEvent::create):
        (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
        (WebCore::RTCDataChannelEvent::channel):
        * Modules/mediastream/RTCDataChannelEvent.h:
        * Modules/mediastream/RTCDataChannelEvent.idl:
        * Modules/mediastream/RTCPeerConnection.idl:
        * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
        (WebCore::LibWebRTCDataChannelHandler::OnStateChange):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
        * WebCore.xcodeproj/project.pbxproj:
        * dom/EventNames.h:
        * platform/mediastream/RTCDataChannelHandler.h:
        * platform/mediastream/RTCDataChannelHandlerClient.h:
        * platform/mediastream/RTCDataChannelState.h: Added.
        * platform/mediastream/RTCPeerConnectionHandlerClient.h:
        * platform/mock/RTCDataChannelHandlerMock.cpp:
        (WebCore::RTCDataChannelHandlerMock::setClient):
        (WebCore::RTCDataChannelHandlerMock::close):
        * platform/mock/RTCNotifiersMock.cpp:
        (WebCore::IceConnectionNotifier::IceConnectionNotifier):
        (WebCore::SignalingStateNotifier::SignalingStateNotifier):
        (WebCore::DataChannelStateNotifier::DataChannelStateNotifier):
        * platform/mock/RTCNotifiersMock.h:

2017-03-30  Javier Fernandez  <jfernandez@igalia.com>

        [css-align] Adapt content-alignment properties to the new baseline syntax
        https://bugs.webkit.org/show_bug.cgi?id=170262

        Reviewed by David Hyatt.

        The baseline-position syntax has changed recently, so we need to update
        the CSS properties using the old syntax. This patch address only the
        content-alignment (align-content and justify-content).

        I used this patch to adapt the implementation of the parsing logic for
        these properties to the new Blink's CSS Parsing Design.

        The new baseline syntax is "[first | last ]? baseline" which implies
        modifying the parsing and computed value logic.

        There are several layout tests affected by this change, so I'll update
        them accordingly.

        No new tests, just added/modified some cases to the tests we
        already have using the new baseline values.

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
        * css/CSSContentDistributionValue.cpp:
        (WebCore::CSSContentDistributionValue::customCSSText):
        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::operator ItemPosition):
        (WebCore::CSSPrimitiveValue::operator ContentPosition):
        * css/CSSValueKeywords.in:
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::isBaselineKeyword):
        (WebCore::consumeBaselineKeyword):
        (WebCore::consumeContentDistributionOverflowPosition):
        (WebCore::consumeSelfPositionOverflowPosition):

2017-03-30  James Craig  <jcraig@apple.com>

        AX: Expose a new AXSubrole for explicit ARIA "group" role
        https://bugs.webkit.org/show_bug.cgi?id=169810
        <rdar://problem/31039693>

        Reviewed by Chris Fleizach.

        Split GroupRole into generics (GroupRole) and explicit groups 
        (ApplicationGroupRole) so we can expose a subrole on the explicit 
        groups. Account for the change in ARIA Tree and Menu hierachies. 
        Update the computedRoleValue for WebKit Inspector usage, too.

        Updated existing tests.

        Test: accessibility/list-detection2.html:
        Test: accessibility/roles-computedRoleString.html:
        Test: inspector/dom/getAccessibilityPropertiesForNode.html:
        Test: inspector/dom/highlightFrame.html:
        Test: inspector/dom/highlightSelector.html:

        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::helpText):
        (WebCore::AccessibilityNodeObject::hierarchicalLevel):
        (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
        (WebCore::AccessibilityObject::ariaTreeItemContent):
        (WebCore::initializeRoleMap):
        (WebCore::AccessibilityObject::computedRoleString):
        * accessibility/AccessibilityObject.h:
        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
        (atkRole):
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (createAccessibilityRoleMap):
        (-[WebAccessibilityObjectWrapper subrole]):

2017-03-30  Chris Dumez  <cdumez@apple.com>

        We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com
        https://bugs.webkit.org/show_bug.cgi?id=170288
        <rdar://problem/31289132>

        Reviewed by Eric Carlson.

        We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com due
        to doubleclick ads using WebAudio with a 0-gain GainNode. We should optimize the
        0-gain case as much as possible.

        No new tests, only an optimization.

        * Modules/webaudio/AudioNode.cpp:
        (WebCore::AudioNode::processIfNecessary):
        Drop call to unsilenceOutputs() before calling AudioNode::process(). The AudioChannel
        API already takes care of clearing its 'silent' flag whenever its buffer changes so
        there should be no need to explicitly clearing the 'silent' flag before calling
        process(). This was causing us to zero out buffers that were already filled with
        zeros because AudioChannel::zero() would no longer return early, not knowing the
        channel is already silent. This reduces the number of bzero() calls by ~3.5x on
        uni-watch.com (from 100 calls every ~20ms to 100 calls every ~70ms.

        * Modules/webaudio/AudioNode.h:
        * platform/audio/mac/AudioDestinationMac.cpp:
        (WebCore::AudioDestinationMac::render):
        Avoid clamping the values in the channel buffer if the channel is silent since this
        will have no effect (given that the buffer only contains zeros).

2017-03-30  Eric Carlson  <eric.carlson@apple.com>

        [Crash] WebCore::AudioBuffer::AudioBuffer don't checking illegal value
        https://bugs.webkit.org/show_bug.cgi?id=169956

        Reviewed by Youenn Fablet.

        Test: webaudio/audiobuffer-crash.html

        * Modules/webaudio/AudioBuffer.cpp:
        (WebCore::AudioBuffer::AudioBuffer): Invalidate the object and return early if the channel 
        array allocation fails.
        (WebCore::AudioBuffer::AudioBuffer): Ditto.
        (WebCore::AudioBuffer::invalidate): Invalidate the object.
        * Modules/webaudio/AudioBuffer.h:

2017-03-30  Antoine Quint  <graouts@apple.com>

        [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
        https://bugs.webkit.org/show_bug.cgi?id=168409
        <rdar://problem/30799198>

        Unreview. Print the backtrace when we suspend scripted animations.

        * page/Page.cpp:
        (WebCore::Page::suspendScriptedAnimations):

2017-03-30  Antoine Quint  <graouts@apple.com>

        [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
        https://bugs.webkit.org/show_bug.cgi?id=168409
        <rdar://problem/30799198>

        Unreview. Pring the backtrace when we suspend ScriptedAnimationController.

        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::suspend):

2017-03-30  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] Invalid placard icon is not visible for short video
        https://bugs.webkit.org/show_bug.cgi?id=170277
        <rdar://problem/31327955>

        Reviewed by Eric Carlson.

        Make the minimum dimension needed to display a placard icon configurable and let the
        invalid placard use a 50pt dimension. We also make a drive-by fix to reset "text-align"
        for media controls as having a "text-align: center" inherited value would mess up
        positioning of the placard icon and make it flush to the right of the placard.

        Test: media/modern-media-controls/invalid-placard/invalid-placard-constrained-metrics.html

        * Modules/modern-media-controls/controls/invalid-placard.js:
        (InvalidPlacard):
        * Modules/modern-media-controls/controls/media-controls.css:
        (.media-controls):
        * Modules/modern-media-controls/controls/placard.js:
        (Placard.prototype.layout):

2017-03-30  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Register missing algorithms in CryptoAlgorithmRegistry::platformRegisterAlgoritmhs()
        https://bugs.webkit.org/show_bug.cgi?id=170273

        Reviewed by Michael Catanzaro.

        * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
        (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
        Add registerAlgorithm<> calls for AES_CFB, AES_GCM, ECDH and
        PBKDF2 algorithms.

2017-03-30  Brent Fulgham  <bfulgham@apple.com>

        Remove unused MediaControlsApple implementation
        https://bugs.webkit.org/show_bug.cgi?id=170258
        <rdar://problem/31331056>

        Reviewed by Eric Carlson.

        Remove dead code related to old media controls. We switched to HTML5-based media controls
        several years ago.

        No new tests. Removing this dead code should have no change in behavior.

        * WebCore.xcodeproj/project.pbxproj: Remove unused files.
        * dom/EventListener.h: Remove unused event type.
        * html/shadow/MediaControlsApple.cpp: Removed.
        * html/shadow/MediaControlsApple.h: Removed.

2017-03-30  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WinCairo] ImageCairoWin.cpp: error C2660: 'WebCore::BitmapImage::draw': function does not take 6 arguments
        https://bugs.webkit.org/show_bug.cgi?id=170275

        Reviewed by Said Abou-Hallawa.

        Apply the similar change of ImageCGWin.cpp of r214450 to ImageCairoWin.cpp.

        * platform/graphics/win/ImageCairoWin.cpp:
        (WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
        (WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.

2017-03-27  Sergio Villar Senin  <svillar@igalia.com>

        [css-grid] Clamp the number of autorepeat tracks
        https://bugs.webkit.org/show_bug.cgi?id=170120

        Reviewed by Manuel Rego Casasnovas.

        As suggested by the specs we do clamp the maximum number of tracks per grid in order to
        minimize potential OOM situations. However we were not considering the case of the recently
        added auto repeat syntax. Abnormally huge values for the width/height on the grid container
        could lead to a number of auto repeat tracks higher than the maximum.

        A new API was added to Internals in order to test limits without having to create huge
        grids. This new API allows clients to set an arbitrary limit to the number of tracks. The
        addition of this new API forced us to add GridPosition.cpp to the project to define the
        global variable we use for testing. We took the chance to move part of the implementation
        from the header file to the source file.

        Last but not least, several new ASSERTs were added to Grid.cpp implementation to ensure that
        we do not surpass the grid track limits.

        Test: fast/css-grid-layout/grid-auto-repeat-huge-grid.html

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::consumeGridTrackRepeatFunction):
        * rendering/Grid.cpp:
        (WebCore::Grid::ensureGridSize): Added ASSERT.
        (WebCore::Grid::setSmallestTracksStart): Ditto.
        (WebCore::Grid::setAutoRepeatTracks): Ditto.
        (WebCore::Grid::setAutoRepeatEmptyColumns): Ditto.
        (WebCore::Grid::setAutoRepeatEmptyRows): Ditto.
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::clampAutoRepeatTracks): New method.
        (WebCore::RenderGrid::placeItemsOnGrid): Clamp the number of auto repeat tracks before
        passing them to the Grid.
        * rendering/RenderGrid.h:
        * rendering/style/GridArea.h:
        (WebCore::GridSpan::GridSpan):
        * rendering/style/GridPosition.cpp: Added.
        (WebCore::GridPosition::setExplicitPosition):
        (WebCore::GridPosition::setAutoPosition):
        (WebCore::GridPosition::setSpanPosition):
        (WebCore::GridPosition::setNamedGridArea):
        (WebCore::GridPosition::integerPosition):
        (WebCore::GridPosition::namedGridLine):
        (WebCore::GridPosition::spanPosition):
        (WebCore::GridPosition::operator==):
        * rendering/style/GridPosition.h:
        (WebCore::GridPosition::shouldBeResolvedAgainstOppositePosition):
        (WebCore::GridPosition::max):
        (WebCore::GridPosition::min):
        (WebCore::GridPosition::setMaxPositionForTesting):
        (WebCore::GridPosition::setExplicitPosition): Deleted.
        (WebCore::GridPosition::setAutoPosition): Deleted.
        (WebCore::GridPosition::setSpanPosition): Deleted.
        (WebCore::GridPosition::setNamedGridArea): Deleted.
        (WebCore::GridPosition::integerPosition): Deleted.
        (WebCore::GridPosition::namedGridLine): Deleted.
        (WebCore::GridPosition::spanPosition): Deleted.
        (WebCore::GridPosition::operator==): Deleted.
        * rendering/style/GridPositionsResolver.cpp:
        (WebCore::GridPositionsResolver::explicitGridColumnCount):
        (WebCore::GridPositionsResolver::explicitGridRowCount):
        * testing/Internals.cpp:
        (WebCore::Internals::setGridMaxTracksLimit):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-03-29  Ryosuke Niwa  <rniwa@webkit.org>

        Disconnecting a HTMLObjectElement does not always unload its content document
        https://bugs.webkit.org/show_bug.cgi?id=169606

        Reviewed by Andy Estes.

        When removing a node, we first disconnect all subframes then update the focused element as we remove each child.
        However, when the removed element is a focused object element with a content document, removeFocusedNodeOfSubtree
        can update the style tree synchronously inside Document::setFocusedElement, and reload the document.

        Avoid this by instantiating a SubframeLoadingDisabler on the parent of the focused element.

        Test: fast/dom/removing-focused-object-element.html

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

2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>

        Migrate to kCTFontCSSWidthAttribute
        https://bugs.webkit.org/show_bug.cgi?id=170265

        Reviewed by Darin Adler.

        Previously, we were mapping from Core Text widths to CSS widths in WebKit.
        However, on some OSes, Core Text can directly tell us what the CSS width
        value is.

        No new tests because there is no behavior change.

        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::getCSSAttribute):
        (WebCore::capabilitiesForFontDescriptor):
        * platform/spi/cocoa/CoreTextSPI.h:

2017-03-28  Simon Fraser  <simon.fraser@apple.com>

        Make it possible to dump touch event regions for testing
        https://bugs.webkit.org/show_bug.cgi?id=170209
        <rdar://problem/31309258>

        Reviewed by Tim Horton.

        Expose internals.touchEventRectsForEvent() and internals.passiveTouchEventListenerRects(), which
        fetch data via Page.

        Because the regions are normally updated on a timer, we have to force an eager update via Document::updateTouchEventRegions().

        Test: fast/events/touch/ios/touch-event-regions.html

        * page/Page.cpp:
        (WebCore::Page::nonFastScrollableRects):
        (WebCore::Page::touchEventRectsForEvent):
        (WebCore::Page::passiveTouchEventListenerRects):
        * page/Page.h:
        * testing/Internals.cpp:
        (WebCore::Internals::touchEventRectsForEvent):
        (WebCore::Internals::passiveTouchEventListenerRects):
        * testing/Internals.h:
        * testing/Internals.idl:

2017-03-29  Zalan Bujtas  <zalan@apple.com>

        RenderBlockFlow::addFloatsToNewParent should check if float is already added to the object list.
        https://bugs.webkit.org/show_bug.cgi?id=170259
        <rdar://problem/31300584>

        Reviewed by Simon Fraser.

        r210145 assumed that m_floatingObjects would simply ignore the floating box if it was already in the list.  

        Test: fast/block/float/placing-multiple-floats-crash.html

        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::addFloatsToNewParent):

2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>

        Try to normalize variation ranges
        https://bugs.webkit.org/show_bug.cgi?id=170119

        Unreviewed.

        Addressing post-review comment.

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

2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>

        Try to normalize variation ranges
        https://bugs.webkit.org/show_bug.cgi?id=170119

        Reviewed by Simon Fraser.

        TrueType GX-style variation fonts use one particular scale for values on their
        weight/width/slope axes - usually the values lie between -1 and 1 on that scale.
        However, OpenType 1.8-style fonts use the CSS scale for values on these axes.
        For the purposes of font selection, these values need to lie on the same scale.
        However, when font selection is completed and the variation values are actually
        being applied to the fonts, values which lie on the font's actual scale need to
        be applied. This patch adds normalize*() and denormalize*() functions to perform
        both of these operations. 

        The conversion itself between the two scales isn't an exact mapping. Mapping
        slope is just a linear relationship with 0deg <=> 0 and 20deg <=> 1 (as per the
        CSS Fonts spec). Mapping widths is similar, it uses a 2-component piecewise
        linear relationship which includes the values given in the Microsoft OpenType
        spec for the OS/2 table's usWidthClass field. Weights are more difficult, so I
        plotted the CSS weights and the GX-style weights for every style of San
        Francisco, saw that the relationship appears to be linear, and ran a linear
        regression to compute the line equation.

        As for the actual discrimination of determining whether a font is a GX-style
        font or not, we can use the presence of the 'STAT' table. This table didn't
        exist when GX fonts were being created, and OpenType 1.8 variable fonts are
        required to have this table.

        Facebook uses the string ".SFNSText" in their @font-face blocks. This font is
        a variation font, but uses the GX-style values. Facebook asks us to create
        this font with a weight of 700, and because the values in the font are around
        1.0, we were erroneously thinking that the font wasn't bold, so we were then
        applying synthetic bold. This was causing text on facebook to look fuzzy and
        ugly.

        Test: fast/text/variations/font-selection-properties-expected.html

        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::isGXVariableFont):
        (WebCore::normalizeWeight):
        (WebCore::normalizeSlope):
        (WebCore::denormalizeWeight):
        (WebCore::denormalizeWidth):
        (WebCore::denormalizeSlope):
        (WebCore::normalizeWidth):
        (WebCore::preparePlatformFont): Instead of using FontSelectionValues for the
        intermediate values, we should use floats instead. This is because
        FontSelectionValues are fixed-point numbers with the denominator having 2 bits.
        When using this data type to represent values on the GX scale, which are usually
        between 0 and 1, you lose a lot of fidelity. Instead, our intermediate
        calculations should be done with floats, and converted to FontSelectionValues at
        the end when they are representative of values on the CSS scale.
        (WebCore::stretchFromCoreTextTraits):
        (WebCore::fontWeightFromCoreText):
        (WebCore::extractVariationBounds):
        (WebCore::variationCapabilitiesForFontDescriptor):
        (WebCore::capabilitiesForFontDescriptor):

2017-03-29  Saam Barati  <sbarati@apple.com>

        LinkBuffer and ExecutableAllocator shouldn't have anything to do with VM
        https://bugs.webkit.org/show_bug.cgi?id=170210

        Reviewed by Mark Lam.

        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::compileSelector):
        (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):

2017-03-29  Javier Fernandez  <jfernandez@igalia.com>

        [css-align] Adapt self-alignment properties to the new baseline syntax
        https://bugs.webkit.org/show_bug.cgi?id=170235

        Reviewed by David Hyatt.

        The baseline-position syntax has changed recently, so we need to update
        the CSS properties using the old syntax. This patch address only the
        self-alignment (align-self and justify-self) and default-alignment
        (align-items and justify-items).

        The content-distribution properties (align-content and justify-content)
        will be updated in a follow up patch.

        The new baseline syntax is "[first | last ]? baseline" which implies
        modifying the parsing and computed value logic.

        There are several layout tests affected by this change, so I'll update
        them accordingly.

        No new tests, just added/modified some cases to the tests we already have using the new baseline values.

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::valueForItemPositionWithOverflowAlignment):
        * css/CSSValueKeywords.in:
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::consumeBaselineKeyword):
        (WebCore::consumeSelfPositionOverflowPosition):

2017-03-29  Chris Dumez  <cdumez@apple.com>

        Animated SVG images are not paused in pages loaded in the background
        https://bugs.webkit.org/show_bug.cgi?id=170043
        <rdar://problem/31234412>

        Reviewed by Simon Fraser.

        Animated SVG images are not paused in pages loaded in the background. We rely
        on FrameView::isOffscreen() to stop images animations in background tab (See
        logic in RenderElement's shouldRepaintForImageAnimation()). This works fine
        if a tab is visble and then becomes hidden (i.e. by switching to another
        tab). However, in the case where the tab gets loaded while in the background
        (e.g. opening link in new background tab, or session restore), then the
        animations would not be paused, due to FrameView::isOffscreen() erroneously
        returning false in this case.

        Normally, the following chain of events happens:
        - Page is visible, we construct a main frame and its FrameView for loading
          the page. When a FrameView is constructed, we call FrameView::show() to
          make it visible. Then, if the page becomes non-visible, we call
          Page::setIsVisibleInternal(false) which calls FrameView::hide(). After
          that, FrameView::isOffscreen() correctly returns true because we properly
          called FrameView::hide().

        However, when doing a load while the Page is hidden, the following was
        happening:
        - Page is not visible, we call Page::setIsVisibleInternal(false) which tries
          to call FrameView::hide() for the main frame but it does not have a FrameView
          yet (because the load has not started). We start the load and end up creating
          a FrameView. The FrameView constructor was calling FrameView::show()
          unconditionally, thus making the FrameView think is visible, even though its
          page isn't. At this point, FrameView::isOffscreen() was returning false
          and animations would keep running, even though the page is not visible.

        To address the issue, we now call FrameView::show() in FrameView::create() only
        if the Page is actually visible, instead of calling it unconditionally. If the
        page ever becomes visible, Page::setIsVisibleInternal(true) will be called and
        it will take care of calling FrameView::show() then.

        Tests: svg/animations/animations-paused-in-background-page-iframe.html
               svg/animations/animations-paused-in-background-page.html

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

2017-03-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        Links with empty hrefs should not be drag sources
        https://bugs.webkit.org/show_bug.cgi?id=170241
        <rdar://problem/31305505>

        Reviewed by Tim Horton.

        The m_dragSouceAction member of DragController represents the drag source actions that are available to the
        document, rather than the available actions given the dragging element. Thus, it is not correct to only check
        that (m_dragSourceAction & DragSourceActionAttachment) before proceeding down the attachment dragging codepath.
        This should be additionally guarded with a check that the element being dragged is, in fact, an attachment
        element.

        New API test (see Tools/ChangeLog).

        * page/DragController.cpp:
        (WebCore::DragController::startDrag):

2017-03-29  Jeremy Jones  <jeremyj@apple.com>

        WebVideoFullscreenInterfaceAVKit needs a strong self ref before dispatching to the main thread.
        https://bugs.webkit.org/show_bug.cgi?id=170129

        Reviewed by David Kilzer.

        No new tests becuase no new behavior.

        Hold a strong reference to WebVideoFullscreenInterfaceAVKit when dispatching to the main thread.
        Make WebVideoFullscreenInterfaceAVKit safe to retain from non-main thread.

        * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
        (WebVideoFullscreenInterfaceAVKit::exitFullscreen):

2017-03-29  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Add a Handle<> class to help with GCrypt object lifetime control
        https://bugs.webkit.org/show_bug.cgi?id=170238

        Reviewed by Michael Catanzaro.

        The platform-specific CryptoAlgorithmHMAC implementation is modified
        to showcase the GCrypt::Handle<> use. HandleDeleter<gcry_mac_hd_t>
        is added accordingly.

        * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
        (WebCore::calculateSignature):

2017-03-29  Myles C. Maxfield  <mmaxfield@apple.com>

        Variation fonts: Make sure that feature detection and preprocessor macros are right
        https://bugs.webkit.org/show_bug.cgi?id=169518

        Reviewed by Simon Fraser.

        When I added variable fonts support, I made all OSes parse the newly accepted values,
        instead of just the OSes which support variable fonts.

        Test: fast/text/font-variations-feature-detection.html

        * css/parser/CSSPropertyParser.cpp:
        (WebCore::consumeFontStretch):
        (WebCore::consumeFontStyle):
        * css/parser/CSSPropertyParserHelpers.cpp:
        (WebCore::CSSPropertyParserHelpers::divisibleBy100):
        (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):

2017-03-29  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] Controls bar may disappear while captions menu is visible (redux)
        https://bugs.webkit.org/show_bug.cgi?id=170239
        <rdar://problem/31320685>

        Reviewed by Dean Jackson.

        We did some work in webkit.org/b/168751 to prevent the controls bar from disappearing while the
        captions menu is visible. But there were two cases where the behavior was not as intended:

            1. the controls bar would hide upon exiting the video.
            2. clicking on the controls bar while the caption panel is up would hide the controls bar
               as well as the captions panel.

        Instead of determining that the "userInteractionEnabled" property being set to "false" is indicative
        of secondary UI, such as the tracks panel, being attached to the controls bar, we now have an
        explicit property to specify this. Now, when "hasSecondaryUIAttached" is "true", we prevent the
        controls bar from fading when exiting the media.

        Additionally, when dismissing the tracks panel, we check whether a mouse event lead to this and check
        if the mouse was positioned over the controls bar. If that is the case, we no longer hide the controls
        bar and only dismiss the tracks panel.

        Test: media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html

        * Modules/modern-media-controls/controls/controls-bar.js:
        (ControlsBar.prototype.set userInteractionEnabled):
        (ControlsBar.prototype.handleEvent):
        (ControlsBar.prototype._autoHideTimerFired):
        * Modules/modern-media-controls/controls/macos-media-controls.js:
        (MacOSMediaControls.prototype.showTracksPanel):
        (MacOSMediaControls.prototype.hideTracksPanel):

2017-03-29  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] Volume slider is initially empty
        https://bugs.webkit.org/show_bug.cgi?id=170237
        <rdar://problem/31319077>

        Reviewed by Dean Jackson.

        Fixing fallout from https://bugs.webkit.org/show_bug.cgi?id=167935 where we changed the behavior
        of layout() to happen prior to a commit. In this one instance, we were overriding layout() to run
        after a commit, so we now override commit(). Otherwise, the <canvas> that we draw the volume slider
        into would have its "width" and "height" properties set after we drew, which would clear the <canvas>.

        * Modules/modern-media-controls/controls/slider.js:
        (Slider.prototype.commit):
        (Slider.prototype.layout): Deleted.

2017-03-29  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Move over empty GnuTLS-based SUBTLE_CRYPTO implementation files
        https://bugs.webkit.org/show_bug.cgi?id=170232

        Reviewed by Michael Catanzaro.

        Migrate the GnuTLS SUBTLE_CRYPTO implementation files to the gcrypt/
        directory. The implementation files themselves are no-op, so this is
        a simple move-and-rename operation that will enable proceeding with
        the libgcrypt-based implementation of SUBTLE_CRYPTO functionality.

        No change in behavior. The SUBTLE_CRYPTO feature should build as it
        did before, and the implementations are empty anyway.

        * PlatformGTK.cmake:
        * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp.
        * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp.
        * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp.
        * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp.
        * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmECDHGnuTLS.cpp.
        * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmPBKDF2GnuTLS.cpp.
        * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp.
        * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp: This one already exists.
        * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp.
        * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp.
        * crypto/gcrypt/CryptoKeyECGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyECGnuTLS.cpp.
        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyRSAGnuTLS.cpp.
        * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp.
        * crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp: Removed.

2017-03-29  Zan Dobersek  <zdobersek@igalia.com>

        [GnuTLS] Remove unused CryptoDigestGnuTLS, CryptoAlgorithmHMACGnuTLS implementation files
        https://bugs.webkit.org/show_bug.cgi?id=170231

        Reviewed by Michael Catanzaro.

        * crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp: Removed. The GCrypt counterpart
        is already in use, and this file wasn't even being built.

2017-03-29  Youenn Fablet  <youenn@apple.com>

        Move DTMF WebRTC extension behind its own compile flag
        https://bugs.webkit.org/show_bug.cgi?id=170226

        Reviewed by Eric Carlson.

        Moving RTCDTMFSender and RTCDTMFToneChangeEvent behinf a WEB_RTC_DTMF compile flag.
        This compile flag is not set on any supported platform yet.
        Disabling related test and updated test expectations.

        * Modules/mediastream/RTCDTMFSender.cpp:
        * Modules/mediastream/RTCDTMFSender.h:
        * Modules/mediastream/RTCDTMFSender.idl:
        * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
        * Modules/mediastream/RTCDTMFToneChangeEvent.h:
        * Modules/mediastream/RTCDTMFToneChangeEvent.idl:
        * dom/EventNames.in:
        * dom/EventTargetFactory.in:
        * platform/mediastream/RTCDTMFSenderHandler.h:
        * platform/mediastream/RTCDTMFSenderHandlerClient.h:

2017-03-29  Antoine Quint  <graouts@apple.com>

        [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
        https://bugs.webkit.org/show_bug.cgi?id=168409
        <rdar://problem/30799198>

        Reviewed by Dean Jackson.

        Add a new internals setting to opt into ScriptedAnimationController logging through DOM events dispatched
        through the document. This should allow this flaky test to get information as to why the frame isn't
        firing when it times out.

        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::suspend):
        (WebCore::ScriptedAnimationController::resume):
        (WebCore::ScriptedAnimationController::addThrottlingReason):
        (WebCore::ScriptedAnimationController::removeThrottlingReason):
        (WebCore::ScriptedAnimationController::registerCallback):
        (WebCore::ScriptedAnimationController::cancelCallback):
        (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
        (WebCore::ScriptedAnimationController::scheduleAnimation):
        (WebCore::ScriptedAnimationController::dispatchLoggingEventIfRequired):
        * dom/ScriptedAnimationController.h:
        * page/Settings.in:
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::resetToConsistentState):
        (WebCore::InternalSettings::shouldDispatchRequestAnimationFrameEvents):
        (WebCore::InternalSettings::setShouldDispatchRequestAnimationFrameEvents):
        * testing/InternalSettings.h:
        * testing/InternalSettings.idl:

2017-03-28  Youenn Fablet  <youenn@apple.com>

        [WebRTC] After r214441 addIceCandidate no longer accepts an RTCIceCandidateInit dictionary
        https://bugs.webkit.org/show_bug.cgi?id=170192

        Reviewed by Jon Lee.

        Covered by updated tests.

        * Modules/mediastream/RTCIceCandidate.idl: Candidate is no longer a required field in RTCIceCandidateInit.
        * Modules/mediastream/RTCPeerConnectionInternals.js: Reworking defaultsToNull to handle both undefined and null cases.

2017-03-28  Youenn Fablet  <youenn@apple.com>

        LibWebRTCProvider should allow setting encoder and decoder factories
        https://bugs.webkit.org/show_bug.cgi?id=170212

        Reviewed by Eric Carlson.

        No change of behavior.
        Adding the ability to set encoder/decoder libwebrtc factory getters.
        Setting default cocoa factory getters.

        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::staticFactoryAndThreads):
        (WebCore::initializePeerConnectionFactoryAndThreads):
        (WebCore::LibWebRTCProvider::setDecoderFactoryGetter):
        (WebCore::LibWebRTCProvider::setEncoderFactoryGetter):
        (WebCore::LibWebRTCProvider::setPeerConnectionFactory):
        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:

2017-03-27  Brent Fulgham  <bfulgham@apple.com>

        Only attach Attributes to a given element one time
        https://bugs.webkit.org/show_bug.cgi?id=170125
        <rdar://problem/31279676>

        Reviewed by Chris Dumez.

        Attach the attribute node to the Element before calling 'setAttributeInternal', since that method may cause
        arbitrary JavaScript events to fire. 

        Test: fast/dom/Attr/only-attach-attr-once.html

        * dom/Element.cpp:
        (WebCore::Element::attachAttributeNodeIfNeeded): Added.
        (WebCore::Element::setAttributeNode): Use new method. Revise to attach attribute before calling 'setAttributeInternal'. 
        (WebCore::Element::setAttributeNodeNS): Ditto.
        * dom/Element.h:

2017-03-28  Youenn Fablet  <youenn@apple.com>

        Stop RTCDataChannel when closing page
        https://bugs.webkit.org/show_bug.cgi?id=170166

        Reviewed by Eric Carlson.

        Test: webrtc/datachannel/datachannel-gc.html

        Making RTCDataChannel an ActiveDOMObject.
        Closing the data channel backend and freeing upon close and stop.

        * Modules/mediastream/RTCDataChannel.cpp:
        (WebCore::RTCDataChannel::create):
        (WebCore::RTCDataChannel::RTCDataChannel):
        (WebCore::RTCDataChannel::close):
        (WebCore::RTCDataChannel::stop):
        * Modules/mediastream/RTCDataChannel.h:
        * Modules/mediastream/RTCDataChannel.idl:
        * Modules/mediastream/RTCPeerConnection.h:

2017-03-28  Myles C. Maxfield  <mmaxfield@apple.com>

        Ranges for variation font properties are not enforced
        https://bugs.webkit.org/show_bug.cgi?id=169979

        Reviewed by David Hyatt.

        The spec specifies that:
        - Font weights less than or equal to 0, or greater than or equal to 1000 are parse errors
        - Font stretch values less than or equal to 0% are parse errors
        - Font style values less than or equal to -90deg or greater than or equal to 90deg are parse errors

        Test: fast/text/variations/out-of-bounds-selection-properties.html

        * css/parser/CSSPropertyParser.cpp:
        (WebCore::consumeFontWeightRange):
        (WebCore::fontStretchIsWithinRange):
        (WebCore::consumeFontStretch):
        (WebCore::consumeFontStretchRange):
        (WebCore::fontStyleIsWithinRange):
        (WebCore::consumeFontStyle):
        (WebCore::consumeFontStyleRange):

2017-03-28  Andy Estes  <aestes@apple.com>

        [iOS] Crash in -[WebPreviewLoader failed] when running http/tests/multipart/policy-ignore-crash.php
        https://bugs.webkit.org/show_bug.cgi?id=170197
        <rdar://problem/30314067>

        Reviewed by Brady Eidson.

        If QuickLook conversion fails, we call ResourceLoader::didFail() with the NSError from
        QuickLook, which will call back into PreviewLoader::didFail(). We only care about network
        failures in PreviewLoader, not conversion failures, so check if
        m_finishedLoadingDataIntoConverter is set before continuing (like we do in
        PreviewLoader::didFinishLoading()).

        Fixes crash in http/tests/multipart/policy-ignore-crash.php.

        * loader/ios/PreviewLoader.mm:
        (WebCore::PreviewLoader::didFail):

2017-03-28  Chris Dumez  <cdumez@apple.com>

        Audio indicator is visible on uni-watch.com but there is no audible audio
        https://bugs.webkit.org/show_bug.cgi?id=170200
        <rdar://problem/31289132>

        Reviewed by Eric Carlson.

        Cherry-pick the following patch from Blink by <rtoy@chromium.org>:
        - https://chromium.googlesource.com/chromium/src.git/+/439de5bb2a31384666db1a0e2dadb2b97d2f3ce4

        When the gain of a GainNode is 0 or 1, the operation of the node can
        be optimized.  When gain = 1, just copy the input to the output.  When
        gain = 0; just zero out the output.  Currently, the input is
        multiplied by the gain to produce the output.  This just optimizes the
        multiplication away for the two special cases.

        Also, have the GainNode set the silence hint if the gain is 0.

        And fix a bug in processIfNecessary when unsilenceOutputs was causing the
        silence hint to be cleared after the node's process method was finished
        and may have set the silence hint.  The processing should come after
        unsilenceOutputs to preserve any hints from processing the node.

        * Modules/webaudio/AudioNode.cpp:
        (WebCore::AudioNode::processIfNecessary):
        * Modules/webaudio/GainNode.cpp:
        (WebCore::GainNode::process):
        * platform/audio/AudioBus.cpp:
        (WebCore::AudioBus::copyWithGainFrom):

2017-03-28  Chris Dumez  <cdumez@apple.com>

        Animated SVG images are not paused when outside viewport
        https://bugs.webkit.org/show_bug.cgi?id=170155
        <rdar://problem/31288893>

        Reviewed by Antti Koivisto.

        Make sure animated SVG images get paused when outside the viewport,
        similarly to what was already done for animated GIF images. Also
        make sure they are paused when they no longer have any renderers
        using them.

        Tests: svg/animations/animated-svg-image-outside-viewport-paused.html
               svg/animations/animated-svg-image-removed-from-document-paused.html

        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::didAddClient):
        Restart the animation whenever a new CachedImage client is added. This
        will cause us the re-evaluate if the animation should run. The animation
        will pause again if the new renderer is not inside the viewport.

        (WebCore::CachedImage::animationAdvanced):
        Add a flag to newImageAnimationFrameAvailable() so that the renderers can
        let us know if we can pause the animation. Pause the animation if all no
        renderer requires it (i.e. they are all outside the viewport, or there
        are no renderers).

        * loader/cache/CachedImageClient.h:
        (WebCore::CachedImageClient::newImageAnimationFrameAvailable):
        By default, the CachedImageClients allow pausing. Only renderer will
        potentially prevent pausing if they are inside the viewport.

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::isAnimating):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/Image.h:
        (WebCore::Image::isAnimating):
        Add isAnimating() flag on Image for layout testing purposes.

        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::newImageAnimationFrameAvailable):
        Set canPause flag to true if the renderer is not inside the viewport.

        (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
        Call startAnimation() if the renderer is now visible to resume SVG
        animations. Repainting is enough for GIF animations but not for SVG
        animations, we have to explicitly resume them.

        * rendering/RenderElement.h:
        * rendering/RenderView.cpp:
        (WebCore::RenderView::addRendererWithPausedImageAnimations):
        (WebCore::RenderView::removeRendererWithPausedImageAnimations):
        (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
        * rendering/RenderView.h:
        Store CachedImages with the renderers that have paused animations.
        This is required for SVG where we need to explicitly resume the
        animation on the CachedImage when the renderer becomes visible
        again. Having access to the Image will also allow us to do smarter
        visibility checks in RenderElement's shouldRepaintForImageAnimation(),
        in the future.

        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::hasActiveAnimation):
        * svg/SVGSVGElement.h:
        Add hasActiveAnimation() method.

        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::startAnimation):
        Check that animations are paused before starting them. This avoid
        jumping due to unnecessary calls to rootElement->setCurrentTime(0).

        (WebCore::SVGImage::isAnimating):
        Add isAnimating() method for layout tests purposes.

        * svg/graphics/SVGImage.h:
        * svg/graphics/SVGImageClients.h:
        Call animationAdvanced() on the observer instead of the generic
        changedInRect() when the SVGImage is animating. This way, we go
        through the same code path as GIF animations and we end up calling
        CachedImage::animationAdvanced() which calls newImageAnimationFrameAvailable()
        on RenderElement, which determines if the animation should keep
        running or not.

        * testing/Internals.cpp:
        (WebCore::Internals::isImageAnimating):
        * testing/Internals.h:
        * testing/Internals.idl:
        Add layout testing infrastructure.

2017-03-28  Antti Koivisto  <antti@apple.com>

        Missing render tree position invalidation when tearing down renderers for display:contents subtree
        https://bugs.webkit.org/show_bug.cgi?id=170199
        <rdar://problem/31260856>

        Reviewed by Zalan Bujtas.

        Test: fast/shadow-dom/slot-renderer-teardown.html

        * style/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::updateElementRenderer):

            Invalidate the render tree position in case we do a teardown for an element without renderer.

2017-03-28  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r214485.

        This change caused LayoutTest crashes.

        Reverted changeset:

        "Stop RTCDataChannel when closing page"
        https://bugs.webkit.org/show_bug.cgi?id=170166
        http://trac.webkit.org/changeset/214485

2017-03-28  Anders Carlsson  <andersca@apple.com>

        ApplePayShippingContactUpdate.idl shouldn't have status field
        https://bugs.webkit.org/show_bug.cgi?id=170202
        rdar://problem/31307106

        Reviewed by Beth Dakin.

        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::convertAndValidate):
        If status isn't set, infer it based on whether there are errors present or not.

        * Modules/applepay/ApplePayShippingContactUpdate.h:
        Make status optional here; it's still used by the old code path.

        * Modules/applepay/ApplePayShippingContactUpdate.idl:
        Remove status here.

2017-03-28  Brian Burg  <bburg@apple.com>

        Web Inspector: Add "Disable Caches" option that only applies to the inspected page while Web Inspector is open
        https://bugs.webkit.org/show_bug.cgi?id=169865
        <rdar://problem/31250573>

        Reviewed by Joseph Pecoraro.

        Rewrite the network agent's command for disabling resource caching to use Page::setResourceCachingEnabled.
        The old implementation was doing weird stuff like setting no-cache headers and evicting the
        contents of the memory cache, neither of which is correct. The new approach has no side effects
        on the network, disk, or memory cache so it can be turned on temporarily without causing problems.

        New tests:
        - http/tests/inspector/network/set-resource-caching-disabled-disk-cache.html
        - http/tests/inspector/network/set-resource-caching-disabled-memory-cache.html

        * inspector/InspectorNetworkAgent.h:
        * inspector/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::setCacheDisabled): Deleted.
        (WebCore::InspectorNetworkAgent::setResourceCachingDisabled): Added.
        Implement new command.

        (WebCore::InspectorNetworkAgent::willSendRequest):
        (WebCore::InspectorNetworkAgent::mainFrameNavigated):
        Remove crufty attempts to break caches. I believe these are intended to defeat caching
        proxies and similar middlemen, but this is just as likely to cause unusual loading behavior.

        * page/Page.h:
        (WebCore::Page::isResourceCachingDisabled):
        (WebCore::Page::setResourceCachingDisabledOverride):
        Add an override setting so that Web Inspector's override does not mess up the value
        of isResourceCachingDisabled that may have been set by a WebKit API client.

2017-03-28  Youenn Fablet  <youenn@apple.com>

        Fix addIceCandidate after r214441
        https://bugs.webkit.org/show_bug.cgi?id=170146

        Reviewed by Chris Dumez.

        Covered by rebased test.

        * Modules/mediastream/RTCPeerConnection.js:
        (addIceCandidate): Setting function length to 1 and throwing if no parameter is passed.

2017-03-28  Youenn Fablet  <youenn@apple.com>

        Stop RTCDataChannel when closing page
        https://bugs.webkit.org/show_bug.cgi?id=170166

        Reviewed by Eric Carlson.

        Test: webrtc/datachannel/datachannel-gc.html

        Making RTCDataChannel an ActiveDOMObject.
        Closing the data channel backend and freeing upon close and stop.

        * Modules/mediastream/RTCDataChannel.cpp:
        (WebCore::RTCDataChannel::create):
        (WebCore::RTCDataChannel::RTCDataChannel):
        (WebCore::RTCDataChannel::close):
        (WebCore::RTCDataChannel::stop):
        * Modules/mediastream/RTCDataChannel.h:
        * Modules/mediastream/RTCDataChannel.idl:
        * Modules/mediastream/RTCPeerConnection.h:

2017-03-27  Simon Fraser  <simon.fraser@apple.com>

        Enhance the touch region debug overlay to show regions for the different events
        https://bugs.webkit.org/show_bug.cgi?id=170162

        Reviewed by Tim Horton.

        Have NonFastScrollableRegionOverlay use a different color for each region in EventTrackingRegions,
        and to draw a legend showing what the colors mean.
        
        On Mac, this overlay displays the non-fast scrollable region (which we don't keep separate from the wheel event
        region).

        * page/DebugPageOverlays.cpp:
        (WebCore::NonFastScrollableRegionOverlay::updateRegion):
        (WebCore::touchEventRegionColors):
        (WebCore::drawRightAlignedText):
        (WebCore::NonFastScrollableRegionOverlay::drawRect):
        (WebCore::RegionOverlay::drawRect):
        (WebCore::RegionOverlay::drawRegion):

2017-03-27  Simon Fraser  <simon.fraser@apple.com>

        Make sure the non-fast scrolling debug overlay is correctly updated
        https://bugs.webkit.org/show_bug.cgi?id=170142

        Reviewed by Tim Horton.

        AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged() is called on a timer
        from Document code, so the existing DebugPageOverlays::didLayout() call at the end
        of FrameView::layout() wasn't sufficient to keep the non-fast scrollable region up-to-date
        on iOS.

        * page/scrolling/AsyncScrollingCoordinator.cpp:
        (WebCore::AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged):

2017-03-28  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] AirPlay placard text looks bad on 1x displays
        https://bugs.webkit.org/show_bug.cgi?id=170183
        <rdar://problem/30663416>

        Reviewed by Dean Jackson.

        Use subpixel antialiasing for all text in modern media controls.

        * Modules/modern-media-controls/controls/media-controls.css:
        (.media-controls-container,):

2017-03-28  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] Improve appearance of tracks panel on macOS
        https://bugs.webkit.org/show_bug.cgi?id=168929
        <rdar://problem/30741589>

        Reviewed by Eric Carlson.

        We use a solid color for the focus state that matches the style used on macOS
        and blend the titles the same way we blend other non-solid labels in the controls bar.

        * Modules/modern-media-controls/controls/tracks-panel.css:
        (.tracks-panel section):
        (.tracks-panel section > h3):
        (.tracks-panel section > ul > li:focus):

2017-03-28  Yoav Weiss  <yoav@yoav.ws>

        Add a warning for unused link preloads.
        https://bugs.webkit.org/show_bug.cgi?id=165670

        Reviewed by Youenn Fablet.

        Tests: http/tests/preload/single_download_preload_headers_charset.php
               http/tests/preload/unused_preload_warning.html

        * dom/Document.cpp:
        (WebCore::Document::prepareForDestruction): Stop the timer once the document is destructed.
        * loader/LinkPreloadResourceClients.h: Add shouldMarkAsReferenced overides for the LinkPreloadResourceClient classes.
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::addClientToSet): Make sure LinkPreloadResourceClients don't set resource to be referenced.
        * loader/cache/CachedResourceClient.h:
        (WebCore::CachedResourceClient::shouldMarkAsReferenced): Make sure that ResourceClients mark preloads as referenced by default.
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::CachedResourceLoader): Initialize timer.
        (WebCore::CachedResourceLoader::~CachedResourceLoader): Stop timer.
        (WebCore::CachedResourceLoader::documentDidFinishLoadEvent): Trigger a timer if preloads weren't cleared at load time.
        (WebCore::CachedResourceLoader::stopUnusedPreloadsTimer): Stop the timer.
        (WebCore::CachedResourceLoader::warnUnusedPreloads): Iterate over m_preloads and issue a warning for non-referenced preloads.
        * loader/cache/CachedResourceLoader.h:
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::willDetachDocumentFromFrame): Clear Resource Timing buffer when document detaches, to avoid test flakiness.

2017-03-28  Antoine Quint  <graouts@apple.com>

        REGRESSION: Double-clicking the captions button while the captions popover is open prevents the popover from being opened again
        https://bugs.webkit.org/show_bug.cgi?id=170171
        <rdar://problem/31095500>

        Reviewed by Dean Jackson.

        We used to consider that the tracks panel was presented as long as it had a parent, but since we were using for the animated
        transition to complete before actually removing the panel from the node hierarchy, consecutive calls to hide then present
        would fail to present the panel. We now use a private instance variable to track the presented state which is set immediately
        as presentInParent() and hide() are called.

        Test: media/modern-media-controls/tracks-support/tracks-support-show-panel-then-double-click-on-tracks-button.html

        * Modules/modern-media-controls/controls/tracks-panel.js:
        (TracksPanel.prototype.get presented):
        (TracksPanel.prototype.presentInParent):
        (TracksPanel.prototype.hide):

2017-03-28  Aaron Chu  <aaron_chu@apple.com>

        AX: Media controls should be able to be re-activated after faded away
        https://bugs.webkit.org/show_bug.cgi?id=170048
        <rdar://problem/30157179>

        Reviewed by Antoine Quint.

        Added a "foucsin" listener for the controls bar so that when an element
        within fires a "focusin" event, the controls bar reappears if it is faded.

        Test: media/modern-media-controls/media-controls/media-controls-appear-when-focus.html

        * Modules/modern-media-controls/controls/controls-bar.js:
        (ControlsBar.prototype.handleEvent):

2017-03-28  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] Improve media documents across macOS, iPhone and iPad
        https://bugs.webkit.org/show_bug.cgi?id=169145
        <rdar://problem/17048858>

        Reviewed by Dean Jackson.

        There were a variety of issues with media documents, some longstanding, and some specifically
        about modern media controls.

        One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
        due to using a <video> element to load the audio file. We now have additional logic in MediaController
        to identify if the loaded media is really an audio file, and using this information to hide the
        fullscreen and picture-in-picture buttons.

        Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
        controls when we could have the modern-media-controls module injected CSS handle this styling. We now
        use the injected style in the shadow root to size media documents based on the device characteristics
        and ensuring that page styles are overridden.

        We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
        attribute and not a <source> element.

        Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
        a media document to hide the controls while we determine the type of media we're loading (audio vs.
        video) in order to apply the appropriate styling without flashes.

        As a result of the new styles applied by the modern-media-controls module, media documents have a
        similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
        to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
        we want to always play the media at full width, with some padding in the case of audio.

        Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
               media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
               media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
               media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
               media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
               media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
               media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
               media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html

        * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
        (:host(audio) .media-controls.ios.inline > .controls-bar:before,):
        (:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
        * Modules/modern-media-controls/controls/macos-media-controls.css:
        (:host(audio) .media-controls.mac.inline > .controls-bar,):
        (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
        (:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
        (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
        * Modules/modern-media-controls/controls/media-document.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.css.
        (:host(.media-document)):
        (:host(.media-document.ready)):
        (:host(.media-document.audio.mac)):
        (:host(.media-document.audio.ipad)):
        (:host(.media-document.audio.iphone)):
        (:host(.media-document.video.mac)):
        (:host(.media-document.video.ipad)):
        (:host(.media-document.video.iphone)):
        * Modules/modern-media-controls/js-files:
        * Modules/modern-media-controls/media/fullscreen-support.js:
        (FullscreenSupport.prototype.syncControl):
        (FullscreenSupport):
        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController):
        (MediaController.prototype.get isAudio):
        * Modules/modern-media-controls/media/media-document-controller.js: Copied from Source/WebCore/Modules/modern-media-controls/media/fullscreen-support.js.
        (MediaDocumentController):
        (MediaDocumentController.prototype.handleEvent):
        (MediaDocumentController.prototype._mediaDocumentHasMetadata):
        (MediaDocumentController.prototype._mediaDocumentHasSize):
        * Modules/modern-media-controls/media/pip-support.js:
        (PiPSupport.prototype.syncControl):
        (PiPSupport):
        * html/MediaDocument.cpp:
        (WebCore::MediaDocumentParser::createDocumentStructure):

2017-03-28  Myles C. Maxfield  <mmaxfield@apple.com>

        Follow-up patch after r214364.
        https://bugs.webkit.org/show_bug.cgi?id=168895

        Unreviewed.

        * platform/graphics/FontDescription.cpp:
        (WebCore::FontDescription::FontDescription):

2017-03-27  Said Abou-Hallawa  <sabouhallawa@apple.com>

        REGRESSION(213764): Large images should not be decoded asynchronously when they are drawn on a canvas
        https://bugs.webkit.org/show_bug.cgi?id=169771

        Reviewed by Simon Fraser.

        Sometimes we have to draw the image immediately like when a canvas calls  
        drawImage. In this case we have to decode the image synchronously to guarantee
        the drawing. Other times we need to decode with the native size of the image.
        The animated images have to be decoded with native size always. Otherwise
        the frame cache will be messed up if the same image is animated with different
        sizes. Currently we always decode asynchronously with sizeForDrawing. We need
        to decouple the decoding mode from the sizeForDrawing.

        This patch introduce the DecodingOptions class which can store and compare the
        following four cases:
            -- Synchronous: The frame has be decoded with native size only.
            -- Asynchronous + anySize: This is passed from the Image::draw() callers.
            -- Asynchronous + fullSize: The image has to be decoded with its full size.
            -- Asynchronous + sizeForDrawing: The image can be decoded with sizeForDrawing unless
            it was decoded with either a full size or sizeForDrawing which is larger than the
            requested sizeForDrawing.
            
        A new argument of type DecodingMode will be added to Image::draw() function.
        Only when the drawing comes from the render tree, it will be Asynchronous.
        Otherwise it will be Synchronous.

        Tests: fast/images/animated-image-different-dest-size.html
               fast/images/async-image-background-image.html
               fast/images/async-image-canvas-draw-image.html

        * WebCore.xcodeproj/project.pbxproj:
        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded): Gets the frame image, cache it synchronously if
        the current one is invalid. frameImageAtIndex() returns whatever stored in the cache.
        (WebCore::BitmapImage::nativeImage): Call frameImageAtIndexCacheIfNeeded() instead of frameImageAtIndex().
        (WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
        (WebCore::BitmapImage::nativeImageOfSize): Ditto.
        (WebCore::BitmapImage::framesNativeImages): Ditto.
        (WebCore::BitmapImage::draw): Change the logic to do the following:
        -- The animated image has to be decoded with its full size.
        -- The animated image expects the current frame to be ready for drawing.
        -- The large image decoding does not need to call internalStartAnimation().
        -- The large image has to request async image decoding but draw the current one if it exists.
        (WebCore::BitmapImage::drawPattern): Draw the pattern synchronously.
        (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): Delete the call to shouldUseAsyncDecodingForTesting()
        since it is only applied for animated images.
        (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
        (WebCore::BitmapImage::internalStartAnimation): Request decoding with the full size.
        (WebCore::BitmapImage::advanceAnimation): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
        (WebCore::BitmapImage::internalAdvanceAnimation): Assert the current frame is not being decoding asynchronously for any size.
        (WebCore::BitmapImage::frameImageAtIndex): Deleted. Moved to the header file but with a new purpose: return
        the current frame from the frame cache as is; do not cache a new one.
        (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImage): Deleted. Function was renamed to shouldUseAsyncDecodingForLargeImages.
        (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImage): Deleted. Function was renamed to shouldUseAsyncDecodingForAnimatedImages.
        * platform/graphics/BitmapImage.h:
        * platform/graphics/CrossfadeGeneratedImage.cpp:
        (WebCore::CrossfadeGeneratedImage::draw): Add a new argument of type DecodingMode.
        * platform/graphics/CrossfadeGeneratedImage.h:
        * platform/graphics/DecodingOptions.h: Added.
        (WebCore::DecodingOptions::DecodingOptions): Default constructor: Synchronous mode.
        (WebCore::DecodingOptions::operator==): Compares two DecodingOptions for equality.
        (WebCore::DecodingOptions::isSynchronous): Is the frame decoded synchronously?
        (WebCore::DecodingOptions::isAsynchronous): Is the frame decoded asynchronously?
        (WebCore::DecodingOptions::isAsynchronousCompatibleWith): Is this DecodingOptions compatible with another one?
        (WebCore::DecodingOptions::hasFullSize): Is the decoding mode asynchronous but for the image full size?
        (WebCore::DecodingOptions::hasSizeForDrawing): Is this decoding mode asynchronous but for a sizeForDrawing?
        (WebCore::DecodingOptions::sizeForDrawing): Returns the sizeForDrawing. m_decodingModeOrSize has to hold an IntSize.
        (WebCore::DecodingOptions::maxDimension): Moved form ImageFrame.cpp.
        (WebCore::DecodingOptions::has): A helper function.
        (WebCore::DecodingOptions::hasDecodingMode): Does m_decodingModeOrSize a DecodingMode?
        (WebCore::DecodingOptions::hasSize): Does m_decodingModeOrSize an IntSize?
        * platform/graphics/GeneratedImage.h: Add a new argument of type DecodingMode.
        * platform/graphics/GradientImage.cpp:
        (WebCore::GradientImage::draw): Ditto.
        * platform/graphics/GradientImage.h: Ditto.
        * platform/graphics/GraphicsContext.cpp:
        (WebCore::GraphicsContext::drawImage): Pass the ImagePaintingOptions::m_DecodingMode to Image::draw().
        * platform/graphics/GraphicsContext.h:
        (WebCore::ImagePaintingOptions::ImagePaintingOptions): Add a new member of type DecodingMode to ImagePaintingOptions.
        * platform/graphics/Image.cpp:
        (WebCore::Image::drawTiled): Pass DecodingMode::Synchronous to Image::draw().
        * platform/graphics/Image.h: Add a new argument of type DecodingMode to Image::draw().
        * platform/graphics/ImageFrame.cpp:
        (WebCore::ImageFrame::operator=): Replace m_sizeForDrawing by m_decodingOptions.
        (WebCore::ImageFrame::hasNativeImage): Check if m_nativeImage is valid and the subsamplingLevels match.
        (WebCore::ImageFrame::hasFullSizeNativeImage): Checks hasNativeImage() and whether the image frame was
        decoded for the image full size.
        (WebCore::ImageFrame::hasDecodedNativeImageCompatibleWithOptions): Checks hasNativeImage() and the DecodingOptions match.
        (WebCore::maxDimension): Deleted. Moved to DecodingOptions.h.
        (WebCore::ImageFrame::isBeingDecoded): Deleted. The check for having an ImageFrame being decoded is
        moved to ImageFrameCache.
        (WebCore::ImageFrame::hasValidNativeImage): Deleted. No need to this function.
        * platform/graphics/ImageFrame.h:
        (WebCore::ImageFrame::hasNativeImage): Add an std::optional<SubsamplingLevel> argument.
        (WebCore::ImageFrame::hasFullSizeNativeImage): Checks whether the ImageFrame was decoded for the image full size.
        (WebCore::ImageFrame::enqueueSizeForDecoding): Deleted.
        (WebCore::ImageFrame::dequeueSizeForDecoding): Deleted.
        (WebCore::ImageFrame::clearSizeForDecoding): Deleted.
        (WebCore::ImageFrame::isBeingDecoded): Deleted.
        (WebCore::ImageFrame::sizeForDrawing): Deleted.
        (WebCore::ImageFrame::hasDecodedNativeImage): Deleted.
        The logic of knowing whether an ImageFrame is being decoded is moved to ImageFrameCache.
        * platform/graphics/ImageFrameCache.cpp:
        (WebCore::ImageFrameCache::cacheFrameMetadataAtIndex): Caches the metadata of an ImageFrame. If the NativeImage
        was decoded for a sizeForDrawing, the size of the ImageFrame will be the nativeImageSize(). Otherwise, the
        frameSizeAtIndex() will be called.
        (WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Cache a new NativeImage which involves caching new
        metadata and updating the memory cache. No need to check if the existing native image is valid or not for the
        DecodingOptions. Actually it would be a bug if it happens. This is why cacheNativeImageForFrameRequest() asserts
        !frame.hasAsyncNativeImage() before calling cacheFrameNativeImageAtIndex().
        (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Cache new NativeImage which was decoded asynchronously.
        (WebCore::ImageFrameCache::startAsyncDecodingQueue): Call cacheAsyncFrameNativeImageAtIndex() instead of
        cacheNativeImageForFrameRequest() for clarity.
        (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Call hasAsyncNativeImage() instead of hasValidNativeImage()
        Call frameIsDecodingCompatibleWithOptionsAtIndex() instead of frame.isBeingDecoded(). Replace the call to enqueueSizeForDecoding()
        by appending the same ImageFrameRequest to m_frameCommitQueue.
        (WebCore::ImageFrameCache::isAsyncDecodingQueueIdle): Use m_frameCommitQueue to answer the question whether the decodingQueue is idle.
        (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Use m_frameCommitQueue to loop through all the ImageFrames which are currently being decoded.
        (WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): For getting the metadata, this function needs a valid frame. If it is requested
        to decode the nativeImage, it has to do it synchronously.
        (WebCore::ImageFrameCache::singlePixelSolidColor): Don't cache the frame if it is an animated image or the size is not a single pixel.
        (WebCore::ImageFrameCache::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Use m_frameCommitQueue to answer the question whether an ImageFrame
        is being decoded and is compatible with DecodingOptions.
        (WebCore::ImageFrameCache::frameHasFullSizeNativeImageAtIndex): Calls ImageFrame::hasFullNativeImage() for a frame. 
        (WebCore::ImageFrameCache::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Calls ImageFrame::hasDecodedNativeImageCompatibleWithOptions() for a frame.
        (WebCore::ImageFrameCache::frameImageAtIndex): Returns the current NativeImage without caching.
        (WebCore::ImageFrameCache::frameImageAtIndexCacheIfNeeded): Returns the current NativeImage but cache it synchronously if needed.
        (WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Deleted.
        (WebCore::ImageFrameCache::setFrameMetadataAtIndex): Deleted.
        (WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): Deleted.
        (WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Deleted.
        (WebCore::ImageFrameCache::frameHasImageAtIndex): Deleted.
        (WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Deleted.
        (WebCore::ImageFrameCache::frameHasDecodedNativeImage): Deleted.
        * platform/graphics/ImageFrameCache.h: Two ImageFrameRequest queues will be used.
        -- The existing one m_frameRequestQueue which is shared between the main thread and decoding thread. The requests will be
        dequeued from it before starting the decoding. The decoded NativeImage will be cached only on the main thread. The decoding
        thread is not blocked by the callOnMainThread(). This means there might be multiple ImageFrameRequests which were dequeued
        while their NativeImages have not been cached yet.
        -- A new one m_frameCommitQueue which is track all the ImageFrameRequests whose NativeImages have not been cached yet.
        (WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): Be explicit about caching the image frame. frameImageAtIndex()
        returns the current image frame without caching. frameAtIndexCacheIfNeeded(). returns the current image frame but cache
        it if needed.
        (WebCore::ImageFrameCache::ImageFrameRequest::operator==): Compares two ImageFrameRequests for equality.
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::frameImageAtIndexCacheIfNeeded): 
        (WebCore::ImageSource::frameImageAtIndex): Deleted.
        * platform/graphics/ImageSource.h:
        (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex): Change the type of the argument from IntSize to be const std::optional<IntSize>.
        (WebCore::ImageSource::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Rename of frameIsBeingDecodedAtIndex(). Replace the argument of type
        std::optional<IntSize> by an argument of type DecodingOptions.
        (WebCore::ImageSource::frameHasFullSizeNativeImageAtIndex): A wrapper around the ImageFrameCache function.
        (WebCore::ImageSource::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Ditto.
        (WebCore::ImageSource::frameImageAtIndex): Ditto.
        (WebCore::ImageSource::frameIsBeingDecodedAtIndex): Deleted.
        (WebCore::ImageSource::frameHasValidNativeImageAtIndex): Deleted.
        (WebCore::ImageSource::frameHasDecodedNativeImage): Deleted.
        * platform/graphics/NamedImageGeneratedImage.cpp:
        (WebCore::NamedImageGeneratedImage::draw): Add a new argument of type DecodingMode.
        * platform/graphics/NamedImageGeneratedImage.h: Ditto.
        * platform/graphics/cairo/ImageBufferCairo.cpp:
        (WebCore::ImageBuffer::draw): Add a new argument of type DecodingMode.
        * platform/graphics/cg/ImageDecoderCG.cpp:
        (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument. Add a new handling
        for decoding asynchronously for the image full size.
        * platform/graphics/cg/ImageDecoderCG.h: Change the prototype of the function.
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::draw): Add a new argument of type DecodingMode.
        * platform/graphics/cg/PDFDocumentImage.h:
        * platform/graphics/win/ImageCGWin.cpp:
        (WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
        (WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.
        * platform/graphics/win/ImageDecoderDirect2D.cpp:
        (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
        * platform/graphics/win/ImageDecoderDirect2D.h: Change the prototype of the function.
        * platform/image-decoders/ImageDecoder.cpp: 
        (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
        * platform/image-decoders/ImageDecoder.h: Change the prototype of the function.
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::paintFillLayerExtended): Draw the background image asynchronously if the image size is large.
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintIntoRect): Draw the background image element asynchronously if the image size is large.
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::drawForContainer): Pass DecodingMode::Synchronous to draw().
        (WebCore::SVGImage::nativeImageForCurrentFrame): Ditto.
        (WebCore::SVGImage::nativeImage): Ditto.
        (WebCore::SVGImage::draw): Add a new argument of type DecodingMode.
        * svg/graphics/SVGImage.h: Change the prototype of the function.
        * svg/graphics/SVGImageForContainer.cpp:
        (WebCore::SVGImageForContainer::draw): Add a new argument of type DecodingMode.
        * svg/graphics/SVGImageForContainer.h: Change the prototype of the function.

2017-03-27  Youenn Fablet  <youenn@apple.com>

        Activate release libwebrtc logging when WebRTC log channel is on
        https://bugs.webkit.org/show_bug.cgi?id=169659

        Reviewed by Alex Christensen.

        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::initializePeerConnectionFactoryAndThreads):

2017-03-27  Antti Koivisto  <antti@apple.com>

        Move visibleInViewportStateChanged callback from Element to render tree
        https://bugs.webkit.org/show_bug.cgi?id=170039

        Reviewed by Zalan Bujtas.

        Make it easier to use from the render tree.

        Also for simplicity move the bits from RenderObject rare data to RenderElement.
        There is plenty of space there.

        * dom/Element.h:
        (WebCore::Element::isVisibleInViewportChanged): Deleted.
        * html/HTMLMediaElement.h:
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::RenderElement):
        (WebCore::RenderElement::willBeDestroyed):
        (WebCore::RenderElement::registerForVisibleInViewportCallback):
        (WebCore::RenderElement::unregisterForVisibleInViewportCallback):
        (WebCore::RenderElement::setVisibleInViewportState):
        (WebCore::RenderElement::visibleInViewportStateChanged):
        * rendering/RenderElement.h:
        (WebCore::RenderElement::visibleInViewportState):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::setIsRegisteredForVisibleInViewportCallback): Deleted.
        (WebCore::RenderObject::setVisibleInViewportState): Deleted.
        * rendering/RenderObject.h:
        (WebCore::RenderObject::hasOutlineAutoAncestor):
        (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
        (WebCore::RenderObject::isRegisteredForVisibleInViewportCallback): Deleted.
        (WebCore::RenderObject::visibleInViewportState): Deleted.
        * rendering/RenderVideo.cpp:
        (WebCore::RenderVideo::visibleInViewportStateChanged):
        * rendering/RenderVideo.h:
        * rendering/RenderView.cpp:
        (WebCore::RenderView::updateVisibleViewportRect):

2017-03-27  Youenn Fablet  <youenn@apple.com>

        addIceCandidate should not throw if passed null or undefined
        https://bugs.webkit.org/show_bug.cgi?id=170118

        Reviewed by Eric Carlson.

        Covered by updated test.

        A null/undefined candidate passed to addIceCandidate means end of Ice candidate..

        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::addIceCandidate):
        * Modules/mediastream/PeerConnectionBackend.h:
        (WebCore::PeerConnectionBackend::endOfIceCandidates):
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::queuedAddIceCandidate):
        * Modules/mediastream/RTCPeerConnection.h:
        * Modules/mediastream/RTCPeerConnection.idl:
        * Modules/mediastream/RTCPeerConnection.js:
        (addIceCandidate):

2017-03-27  Antti Koivisto  <antti@apple.com>

        Allow the page to render before <link> stylesheet tags in body
        https://bugs.webkit.org/show_bug.cgi?id=149157
        <rdar://problem/24658830>

        Reviewed by Simon Fraser.

        Currently we block style and renderer building completely if document has any loading
        stylesheets. In case a script queries something layout dependent we construct the render
        tree with whatever style we have but block painting in it.

        This patch changes behavior so that a loading stylesheet in body only blocks rendering for elements
        that are after it. The expectation is that such stylesheets rarely affect elements before them
        and the elements can be rendered without causing ugly visible styling changes.

        The patch replaces the old flash-of-unstyled-content (FOUC) preventation mechanism with a more
        fine-grained one. Paint blocking is now done on per-renderer basis with based on isNonFinal flag in
        RenderStyle.

        For stylesheets in head the behavior should be largely unchanged.

        Test: http/tests/incremental/stylesheet-body-incremental-rendering.html

        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::pseudoStyleRulesForElement):
        * dom/Document.cpp:
        (WebCore::Document::Document):
        (WebCore::Document::resolveStyle):
        (WebCore::Document::updateLayoutIgnorePendingStylesheets):

            Remove the old FOUC preventation state tracking.

        (WebCore::Document::shouldScheduleLayout):
        (WebCore::Document::didRemoveAllPendingStylesheet):

            Repaints will now get triggered by the normal style mechanism.

        * dom/Document.h:
        (WebCore::Document::hasNodesWithNonFinalStyle):
        (WebCore::Document::setHasNodesWithNonFinalStyle):

            Track if we need to recompute the style later because non-final or unstyled elements.

        (WebCore::Document::didLayoutWithPendingStylesheets): Deleted.
        (WebCore::Document::hasNodesWithPlaceholderStyle): Deleted.
        (WebCore::Document::setHasNodesWithPlaceholderStyle): Deleted.
        * html/HTMLFrameSetElement.cpp:
        (WebCore::HTMLFrameSetElement::rendererIsNeeded):
        * page/FrameView.cpp:
        (WebCore::FrameView::qualifiesAsVisuallyNonEmpty):

            Don't qualify as visually non-empty if we have loading stylesheets in head (even if there is
            a fouc-prevented render tree).

        (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::paintContents):

            Instead of a global test, block painting if isNonFinal is set in the renderer's style.

        * rendering/RenderLayer.cpp:
        (WebCore::shouldSuppressPaintingLayer):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::changeRequiresRepaint):

            The isNonFinal flag prevents painting so we need to trigger repaint when it gets cleared.

        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::isNotFinal):
        (WebCore::RenderStyle::setIsNotFinal):
        (WebCore::RenderStyle::isPlaceholderStyle): Deleted.
        (WebCore::RenderStyle::setIsPlaceholderStyle): Deleted.

            There is no need for placeholder styles anymore. Reuse the bit for isNotFinal.

        * rendering/style/StyleRareNonInheritedData.cpp:
        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
        (WebCore::StyleRareNonInheritedData::operator==):
        * rendering/style/StyleRareNonInheritedData.h:
        * style/StyleScope.cpp:
        (WebCore::Style::Scope::analyzeStyleSheetChange):
        (WebCore::Style::Scope::updateActiveStyleSheets):
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::styleForElement):
        (WebCore::Style::TreeResolver::resolveElement):

            If we have seens a loading stylesheet and don't have a renderer yet don't style the element.
            In case there is a renderer or we are ignoring pending sheets, resolve the style normally
            but mark it as non-final.

        (WebCore::Style::makePlaceholderStyle): Deleted.

2017-03-27  Myles C. Maxfield  <mmaxfield@apple.com>

        Test variation font ranges in the CSS Font Loading API
        https://bugs.webkit.org/show_bug.cgi?id=170022

        Reviewed by Dean Jackson.

        Test: fast/text/variations/font-loading-api-parse-ranges.html

        Don't use keywords when reporting font variation range values.

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::fontNonKeywordWeightFromStyleValue):
        (WebCore::ComputedStyleExtractor::fontWeightFromStyleValue):
        (WebCore::ComputedStyleExtractor::fontNonKeywordStretchFromStyleValue):
        (WebCore::ComputedStyleExtractor::fontStretchFromStyleValue):
        (WebCore::ComputedStyleExtractor::fontNonKeywordStyleFromStyleValue):
        (WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
        * css/CSSComputedStyleDeclaration.h:
        * css/FontFace.cpp:
        (WebCore::FontFace::style):
        (WebCore::FontFace::weight):
        (WebCore::FontFace::stretch):

2017-03-27  Anders Carlsson  <andersca@apple.com>

        Propagate shipping contact update errors
        https://bugs.webkit.org/show_bug.cgi?id=170141
        rdar://problem/31276576

        Reviewed by Tim Horton.

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

2017-03-27  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r214411.

        Two of the LayoutTests for this change time out on ios-
        simulator.

        Reverted changeset:

        "[Modern Media Controls] Improve media documents across macOS,
        iPhone and iPad"
        https://bugs.webkit.org/show_bug.cgi?id=169145
        http://trac.webkit.org/changeset/214411

2017-03-27  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] Clicking on the tracks button when the tracks panel is up in a media document pauses the video
        https://bugs.webkit.org/show_bug.cgi?id=168517
        <rdar://problem/30577636>

        Reviewed by Dean Jackson.

        We completely turn off default event handling in MediaDocument.cpp since we're implementing the
        behavior we expect to pause and resume the video in the modern-media-controls module already. This
        gets rid of this odd case where the content would not see the "click" event while the C++ side would
        handle it and pause the video.

        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController):
        (MediaController.prototype.handleEvent):
        (MediaController.prototype._containerWasClicked): Deleted.
        * html/MediaDocument.cpp:
        (WebCore::MediaDocument::defaultEventHandler):

2017-03-27  Youenn Fablet  <youenn@apple.com>

        Tighten RTCDatachannel creation and parameter getters
        https://bugs.webkit.org/show_bug.cgi?id=170081

        Reviewed by Eric Carlson.

        Covered by updated tests.

        Adding some parameter checks when creating data channels.
        Making some getters nullable as per the spec.

        * Modules/mediastream/RTCDataChannel.h:
        * Modules/mediastream/RTCDataChannel.idl:
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::createDataChannel):
        * Modules/mediastream/RTCPeerConnection.idl:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::createDataChannel):
        (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
        * platform/mediastream/RTCDataChannelHandler.h:
        (): Deleted.

2017-03-27  Youenn Fablet  <youenn@apple.com>

        Add support for RTCRtpReceiver/RTCRtpSender getParameters
        https://bugs.webkit.org/show_bug.cgi?id=170057

        Reviewed by Alex Christensen.

        Test: webrtc/video-getParameters.html

        getParameters returns a dictionary of values taken from libwebrtc RtpReceiverInterface/RtpSenderInrterface objects.
        Added a direct link between WebCore RTCRtpReceiver and libwebrtc RtpReceiverInterface object.
        Making the link between WebCore RTCRtpSender and libwebrtc RtpSenderInrterface object through
        PeerConnectionBackend to keep the current architecture shared with OpenWebRTC.
        In the future, we should try to make the link more direct.

        Added routines to support the conversion from libwebrtc to WebCore.
        Ensured that RTCRtpReceiver is cleaning its backend when being stopped.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/mediastream/MediaEndpointPeerConnection.cpp:
        (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
        * Modules/mediastream/PeerConnectionBackend.h:
        (WebCore::PeerConnectionBackend::getParameters):
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::doClose):
        (WebCore::RTCPeerConnection::getParameters):
        * Modules/mediastream/RTCPeerConnection.h:
        * Modules/mediastream/RTCRtpParameters.h: Added.
        * Modules/mediastream/RTCRtpParameters.idl: Added.
        * Modules/mediastream/RTCRtpReceiver.cpp:
        (WebCore::RTCRtpReceiver::RTCRtpReceiver):
        * Modules/mediastream/RTCRtpReceiver.h:
        (WebCore::RTCRtpReceiver::Backend::~Backend):
        (WebCore::RTCRtpReceiver::Backend::getParameters):
        (WebCore::RTCRtpReceiver::create):
        (WebCore::RTCRtpReceiver::stop):
        (WebCore::RTCRtpReceiver::setBackend):
        (WebCore::RTCRtpReceiver::getParameters):
        * Modules/mediastream/RTCRtpReceiver.idl:
        * Modules/mediastream/RTCRtpSender.cpp:
        (WebCore::RTCRtpSender::create):
        (WebCore::RTCRtpSender::RTCRtpSender):
        (WebCore::RTCRtpSender::replaceTrack):
        (WebCore::RTCRtpSender::getParameters):
        * Modules/mediastream/RTCRtpSender.h:
        (WebCore::RTCRtpSender::Backend::~Backend):
        (WebCore::RTCRtpSender::isStopped):
        (WebCore::RTCRtpSender::stop):
        * Modules/mediastream/RTCRtpSender.idl:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::addTrack):
        (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
        (WebCore::LibWebRTCMediaEndpoint::OnAddTrack):
        (WebCore::LibWebRTCMediaEndpoint::stop):
        (WebCore::fillEncodingParameters):
        (WebCore::fillHeaderExtensionParameters):
        (WebCore::fillCodecParameters):
        (WebCore::fillRtpParameters):
        (WebCore::RTCRtpReceiverBackend::getParameters):
        (WebCore::LibWebRTCMediaEndpoint::getRTCRtpSenderParameters):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::notifyAddedTrack):
        (WebCore::LibWebRTCPeerConnectionBackend::getParameters):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:

2017-03-27  Myles C. Maxfield  <mmaxfield@apple.com>

        font variation properties don't need to accept numbers
        https://bugs.webkit.org/show_bug.cgi?id=169357

        Reviewed by Antti Koivisto.

        The CSS Fonts level 4 spec stabilized the grammar accepted by font-weight,
        font-style, and font-stretch. The changes are that font-style and
        font-stretch no longer accept raw numbers, and the @font-face descriptor
        ranges are now separated by spaces instead of slashes.

        Tests: fast/text/font-selection-font-face-parse.html
               fast/text/font-selection-font-loading-api-parse.html
               fast/text/font-stretch-parse.html
               fast/text/font-style-parse.html
               fast/text/variations/font-selection-properties.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::fontWeightFromStyleValue):
        (WebCore::fontWeightFromStyle):
        (WebCore::ComputedStyleExtractor::fontStretchFromStyleValue):
        (WebCore::fontStretchFromStyle):
        (WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
        (WebCore::fontStyleFromStyle):
        * css/CSSComputedStyleDeclaration.h:
        * css/FontFace.cpp:
        (WebCore::FontFace::style):
        (WebCore::FontFace::weight):
        (WebCore::FontFace::stretch):
        (WebCore::rangeIsSingleValue): Deleted.
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertFontStretchFromValue):
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::consumeFontWeightRange):
        (WebCore::consumeFontStretch):
        (WebCore::consumeFontStretchRange):
        (WebCore::consumeFontStyle):
        (WebCore::consumeFontStyleRange):

2017-03-27  Youenn Fablet  <youenn@apple.com>

        Further optimize checkWebRTCAvailability
        https://bugs.webkit.org/show_bug.cgi?id=169147

        Reviewed by Alex Christensen.

        Tested locally by removing libwebrtc.dylib.
        Replacing dlopen check by checking an exported symbol, rtc::LogMessage::LogToDebug.
        This check is more efficient and accurate. It should work in more configurations than the previous one.

        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::isNullFunctionPointer):
        (WebCore::LibWebRTCProvider::webRTCAvailable):

2017-03-27  Myles C. Maxfield  <mmaxfield@apple.com>

        Implement format specifier for variation fonts
        https://bugs.webkit.org/show_bug.cgi?id=169327

        Reviewed by Simon Fraser.

        Variation fonts require the format("woff-variations"), format("truetype-variations"),
        and format("opentype-variations") format specifies in @font-face rules.

        Test: fast/text/variations/font-face-format.html

        * platform/graphics/mac/FontCustomPlatformData.cpp:
        (WebCore::FontCustomPlatformData::supportsFormat):

2017-03-27  Myles C. Maxfield  <mmaxfield@apple.com>

        Make sure animation works for font-weight, font-stretch, and font-style
        https://bugs.webkit.org/show_bug.cgi?id=169683

        Reviewed by Simon Fraser.

        Hook up animation code for FontSelectionValues.

        Tests: animations/font-variations/font-stretch.html
               animations/font-variations/font-style.html
               animations/font-variations/font-weight.html

        * page/animation/CSSPropertyAnimation.cpp:
        (WebCore::blendFunc):
        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::setFontWeight):
        (WebCore::RenderStyle::setFontStretch):
        (WebCore::RenderStyle::setFontItalic):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::fontWeight):
        (WebCore::RenderStyle::fontStretch):
        (WebCore::RenderStyle::fontItalic):

2017-03-27  Alex Christensen  <achristensen@webkit.org>

        Make WebSockets work in network process
        https://bugs.webkit.org/show_bug.cgi?id=169930

        Reviewed by Youenn Fablet.

        Covered by 136 existing tests in http/tests/websocket/tests/hybi
        This also does fine with the 544 websocket tests in the web-platform-tests which we have not yet imported.
        Also added http/tests/websocket/tests/hybi/network-process-crash-error.html
        to test a new condition that couldn't happen before this move: the NetworkProcess crashing.

        * Modules/websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::fail):
        We were asserting that didCloseSocketStream was called.  It is still called,
        but not synchronously like it used to.  This assertion is now invalid, but tests
        that would hit it still pass.
        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
        (WebCore::SocketStreamHandleImpl::platformSendInternal):
        CFWriteStreamCanAcceptBytes crashes if you give it a null parameter, and that can happen now.
        If we have no write stream, then we cannot write.  Tests that hit this pass still.

2017-03-27  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] Improve media documents across macOS, iPhone and iPad
        https://bugs.webkit.org/show_bug.cgi?id=169145
        <rdar://problem/17048858>

        Reviewed by Dean Jackson.

        There were a variety of issues with media documents, some longstanding, and some specifically
        about modern media controls.

        One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
        due to using a <video> element to load the audio file. We now have additional logic in MediaController
        to identify if the loaded media is really an audio file, and using this information to hide the
        fullscreen and picture-in-picture buttons.

        Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
        controls when we could have the modern-media-controls module injected CSS handle this styling. We now
        use the injected style in the shadow root to size media documents based on the device characteristics
        and ensuring that page styles are overridden.

        We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
        attribute and not a <source> element.

        Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
        a media document to hide the controls while we determine the type of media we're loading (audio vs.
        video) in order to apply the appropriate styling without flashes.

        As a result of the new styles applied by the modern-media-controls module, media documents have a
        similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
        to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
        we want to always play the media at full width, with some padding in the case of audio.

        Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
               media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
               media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
               media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
               media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
               media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
               media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
               media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html

        * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
        (:host(audio) .media-controls.ios.inline > .controls-bar:before,):
        (:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
        * Modules/modern-media-controls/controls/macos-media-controls.css:
        (:host(audio) .media-controls.mac.inline > .controls-bar,):
        (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
        (:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
        (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
        * Modules/modern-media-controls/controls/media-document.css: Added.
        (:host(.media-document)):
        (:host(.media-document.ready)):
        (:host(.media-document.audio.mac)):
        (:host(.media-document.audio.ipad)):
        (:host(.media-document.audio.iphone)):
        (:host(.media-document.video.mac)):
        (:host(.media-document.video.ipad)):
        (:host(.media-document.video.iphone)):
        * Modules/modern-media-controls/js-files:
        * Modules/modern-media-controls/media/fullscreen-support.js:
        (FullscreenSupport.prototype.syncControl):
        (FullscreenSupport):
        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController):
        (MediaController.prototype.get isAudio):
        * Modules/modern-media-controls/media/media-document-controller.js: Added.
        (MediaDocumentController):
        (MediaDocumentController.prototype.handleEvent):
        (MediaDocumentController.prototype._mediaDocumentHasMetadata):
        (MediaDocumentController.prototype._mediaDocumentHasSize):
        * Modules/modern-media-controls/media/pip-support.js:
        (PiPSupport.prototype.syncControl):
        (PiPSupport):
        * html/MediaDocument.cpp:
        (WebCore::MediaDocumentParser::createDocumentStructure):

2017-03-25  Chris Dumez  <cdumez@apple.com>

        REGRESSION(r214195): zillow.com header video doesn't resume when switching to another tab and back
        https://bugs.webkit.org/show_bug.cgi?id=170080
        <rdar://problem/31252522>

        Reviewed by Eric Carlson.

        The video header on zillow.com would pause when switching to another tab after r214195. On
        switching back to the zillow.com tab, we would resume the video but fail to take the poster
        away, making it look like the video is still paused.

        We normally take the poster away when HTMLMediaElement::mediaPlayerFirstVideoFrameAvailable()
        is called. However, mediaPlayerFirstVideoFrameAvailable() was only ever called once because of
        the m_haveReportedFirstVideoFrame flag in MediaPlayerPrivateAVFoundation::updateStates().
        We now reset m_haveReportedFirstVideoFrame to false in updateStates() if hasAvailableVideoFrame()
        return false, so that we call mediaPlayerFirstVideoFrameAvailable() again when the return
        value of asAvailableVideoFrame() becomes true again (e.g. after the media session interruption
        has ended).

        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        (WebCore::MediaPlayerPrivateAVFoundation::updateStates):

2017-03-24  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WK2] Add a UI delegate SPI hook to enable or disable navigation on drop
        https://bugs.webkit.org/show_bug.cgi?id=169168
        <rdar://problem/30688374>

        Reviewed by Tim Horton.

        Refactor client hooks for the drag destination action in WebCore to ask for the drag destination action mask
        upon initializing the DragData. In DragController, rather than setting m_dragDestinationAction to the result of
        m_client.actionMaskForDrag, we instead set it to the DragData's destination action.

        Tests to come in a future patch.

        * loader/EmptyClients.cpp:
        * page/DragClient.h:

        Rather than pass in a DragData, pass in only the platform data that we need to hand to the delegate. This is
        because we now ask for drag destination actions prior to creating the DragData.

        * page/DragController.cpp:
        (WebCore::DragController::dragEnteredOrUpdated):

        Update the available drag destination actions in WebCore using the destination actions stored in DragData rather
        than calling out to the client delegate.

        * loader/EmptyClients.cpp:
        * platform/DragData.cpp:
        (WebCore::DragData::DragData):
        * platform/DragData.h:
        (WebCore::DragData::dragDestinationAction):
        (WebCore::DragData::operator =):
        * platform/mac/DragDataMac.mm:
        (WebCore::DragData::DragData):

2017-03-25  Aaron Chu  <aaron_chu@apple.com>

        AX: Media controls are unlabeled
        https://bugs.webkit.org/show_bug.cgi?id=169947
        <rdar://problem/30153323>

        Reviewed by Antoine Quint.

        Added a "label" property for Icons, which are used to set
        the aria-label for the controls in modern media controls.

        Test: Addition to all existing modern media controls tests.

        * English.lproj/modern-media-controls-localized-strings.js:
        * Modules/modern-media-controls/controls/icon-button.js:
        (IconButton.prototype.set iconName):
        (IconButton.prototype.handleEvent):
        (IconButton.prototype._loadImage):
        * Modules/modern-media-controls/controls/icon-service.js:
        * Modules/modern-media-controls/controls/start-button.js:
        (StartButton):
        * Modules/modern-media-controls/js-files:

2017-03-25  Carlos Garcia Campos  <cgarcia@igalia.com>

        [XDG] MIMETypeRegistry::getMIMETypeForExtension should return a null/empty string when mime type is unknown
        https://bugs.webkit.org/show_bug.cgi?id=170050

        Reviewed by Michael Catanzaro.

        That's what the callers expect, but we alre always returning XDG_MIME_TYPE_UNKNOWN which is
        application/octet-stream.

        Fixes: plugins/no-mime-with-valid-extension.html

        * platform/xdg/MIMETypeRegistryXdg.cpp:
        (WebCore::MIMETypeRegistry::getMIMETypeForExtension):

2017-03-24  Myles C. Maxfield  <mmaxfield@apple.com>

        Add font-optical-sizing to CSSComputedStyleDeclaration
        https://bugs.webkit.org/show_bug.cgi?id=170083

        Reviewed by Joseph Pecoraro.

        Covered by existing tests.

        * css/CSSComputedStyleDeclaration.cpp:

2017-03-24  Daniel Bates  <dabates@apple.com>

        media/restore-from-page-cache.html causes NoEventDispatchAssertion::isEventAllowedInMainThread() assertion failure
        https://bugs.webkit.org/show_bug.cgi?id=170087
        <rdar://problem/31254822>

        Reviewed by Simon Fraser.

        Reduce the scope of code that should never dispatch DOM events so as to allow updating contents size
        after restoring a page from the page cache.

        In r214014 we instantiate a NoEventDispatchAssertion in FrameLoader::commitProvisionalLoad()
        around the call to CachedPage::restore() to assert when a DOM event is dispatched during
        page restoration as such events can cause re-entrancy into the page cache. As it turns out
        it is sufficient to ensure that no DOM events are dispatched after restoring all cached frames
        as opposed to after CachedPage::restore() returns.

        Also rename Document::enqueue{Pageshow, Popstate}Event() to dispatch{Pageshow, Popstate}Event(),
        respectively, since they synchronously dispatch events :(. We hope in the future to make them
        asynchronously dispatch events.

        * dom/Document.cpp:
        (WebCore::Document::implicitClose): Update for renaming.
        (WebCore::Document::statePopped): Ditto.
        (WebCore::Document::dispatchPageshowEvent): Renamed; formerly named enqueuePageshowEvent().
        (WebCore::Document::dispatchPopstateEvent): Renamed; formerly named enqueuePopstateEvent().
        (WebCore::Document::enqueuePageshowEvent): Deleted.
        (WebCore::Document::enqueuePopstateEvent): Deleted.
        * dom/Document.h:
        * history/CachedPage.cpp:
        (WebCore::firePageShowAndPopStateEvents): Moved logic from FrameLoader::didRestoreFromCachedPage() to here.
        (WebCore::CachedPage::restore): Modified to call firePageShowAndPopStateEvents().
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::commitProvisionalLoad): Removed use of NoEventDispatchAssertion RAII object. We
        will instantiate it in CachedPage::restore() with a smaller scope.
        (WebCore::FrameLoader::didRestoreFromCachedPage): Deleted; moved logic from here to WebCore::firePageShowAndPopStateEvents().
        * loader/FrameLoader.h:

2017-03-24  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r214361.

        This change caused flakiness in http/tests/preload tests.

        Reverted changeset:

        "Add a warning for unused link preloads."
        https://bugs.webkit.org/show_bug.cgi?id=165670
        http://trac.webkit.org/changeset/214361

2017-03-24  Antoine Quint  <graouts@webkit.org>

        [Modern Media Controls] Remove placard icon if height is compressed
        https://bugs.webkit.org/show_bug.cgi?id=167935
        <rdar://problem/30397128>

        Reviewed by Dean Jackson.

        We make the addition of certain Placard children conditional on the placard's metrics. Whenever the
        media controls metrics changes, the placard, if any, is set to have the same metrics and layout() is
        called where we ensure that there is enough space, per designs, to have the icon, description and even
        the title visible. We also make some CSS improvements to guarantee that the description is laid out on
        two lines at most and that both text labels are trimmed elegantly with an ellipsis shold the width be
        insufficient to display the whole text.

        Since we would have needed to have more width/height setter overrides to trigger layout, we now make
        LayoutNode trigger layout() directly and remove the need for subclasses to do this on a per-class basis.
        We also make layout() a method that can be called safely anytime as it's now no longer part of the DOM
        commit step, a new commit() method is used instead of that.

        Tests: media/modern-media-controls/layout-node/node-made-dirty-during-commit.html
               media/modern-media-controls/media-controls/media-controls-placard-compressed-metrics.html

        * Modules/modern-media-controls/controls/layout-node.js:
        (LayoutNode.prototype.set width):
        (LayoutNode.prototype.set height):
        Trigger a call to layout() anytime "width" or "height" is set on any LayoutNode.

        (LayoutNode.prototype.layout):
        (LayoutNode.prototype.commit):
        (performScheduledLayout):
        Make layout() an empty method that subclasses can override easily outside of the DOM commit cycle,
        its previous implementation is now called "commit()" which is a more accurate name.

        * Modules/modern-media-controls/controls/media-controls.js:
        (MediaControls.prototype.get placard):
        (MediaControls.prototype.get showsPlacard):
        (MediaControls.prototype.showPlacard):
        (MediaControls.prototype.hidePlacard):
        (MediaControls.prototype.layout):
        (MediaControls.prototype.get width): Deleted.
        (MediaControls.prototype.set width): Deleted.
        Add a "placard" property to make it simpler to reference the placard instead of making assumptions in
        several places in that class on the children order. Anytime we run a layout or show the placard, ensure
        that the placard metrics are synced with the media controls metrics.

        * Modules/modern-media-controls/controls/placard.css:
        (.placard .container):
        (.placard .title,):
        (.placard .description):
        We now ensure that both the title and description are trimmed with an ellipsis when we run out of space
        to display them fully.

        * Modules/modern-media-controls/controls/placard.js:
        (Placard.):
        (Placard.prototype.layout):
        We add new constraints to only show the icon, title and description if the placard is tall and wide enough.

        * Modules/modern-media-controls/controls/slider.js:
        (Slider.prototype.get width): Deleted.
        (Slider.prototype.set width): Deleted.
        Removed custom "width" getters and setters now we can just override layout() in case node metrics change.

        * Modules/modern-media-controls/controls/time-control.js:
        (TimeControl.prototype.set useSixDigitsForTimeLabels):
        (TimeControl.prototype.layout):
        (TimeControl.prototype.get width): Deleted.
        (TimeControl.prototype.set width): Deleted.
        (TimeControl.prototype._availableWidthHasChanged): Deleted.
        Removed custom "width" getters and setters now we can just override layout() in case node metrics change.

        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController):
        Ensure we flush pending updates at construction time so that we match the size of the media controls right
        at the first media layout.

2017-03-24  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] "ideal" constraints passed to getUserMedia should affect fitness score
        https://bugs.webkit.org/show_bug.cgi?id=170056

        Reviewed by Youenn Fablet.

        Include the fitness score calculated for ideal constraints in the calculation of a capture
        overall device fitness score. 

        No new tests, existing tests updated.

        * platform/mediastream/MediaConstraints.cpp:
        (WebCore::StringConstraint::fitnessDistance): Drive-by fix: return early if ideal is empty,
        not exact.

        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): Return fitness distance.
        (WebCore::RealtimeMediaSource::selectSettings): Include the fitness distance of supported
        ideal constraints.
        (WebCore::RealtimeMediaSource::supportsConstraint): New.
        (WebCore::RealtimeMediaSource::applyConstraints):
        * platform/mediastream/RealtimeMediaSource.h:

        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
        (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Sort candidate sources
        by their fitness score.

        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::initializeCapabilities): Each video source should support
        one facing mode, not both.

2017-03-24  Dean Jackson  <dino@apple.com>

        Serialization of custom props in longhand should be "" not value of shorthand
        https://bugs.webkit.org/show_bug.cgi?id=167699
        <rdar://problem/30324200>

        Reviewed by Sam Weinig.

        https://www.w3.org/TR/css-variables/#variables-in-shorthands says
        "Pending-substitution values must be serialized as the empty string, if
        an API allows them to be observed."

        We were returning the cssText instead.

        Test: fast/css/variables/rule-property-get.html has been updated.

        * css/StyleProperties.cpp:
        (WebCore::StyleProperties::getPropertyValue): Return the empty string
        if we're a pending substitution value.

2017-03-24  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the ToT build on the latest SDK.

        Add deprecated declaration guards around two synchronous UIItemProvider methods in WebItemProviderPasteboard.
        <rdar://problem/30451096> tracks adoption of the asynchronous versions of these methods.

        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
        (-[WebItemProviderPasteboard _tryToCreateAndAppendObjectOfClass:toArray:usingProvider:]):

2017-03-24  Antoine Quint  <graouts@webkit.org>

        [Modern Media Controls] Captions don't move with the appearance of the inline controls
        https://bugs.webkit.org/show_bug.cgi?id=170051
        <rdar://problem/30754428>

        Reviewed by Dean Jackson.

        We now size the captions container to account for the controls bar height when visible. To do this,
        we use CSS variables to specify the height of the controls bar in default inline mode, compact inline
        mode and fullscreen mode.

        Test: media/modern-media-controls/tracks-support/tracks-support-captions-offset-with-controls-bar.html

        * Modules/modern-media-controls/controls/controls-bar.js:
        (ControlsBar.prototype.set faded):
        Notify the hosting MediaControls that the "faded" property changed.

        * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
        (.media-controls.ios.inline > .controls-bar):
        Use the new --inline-controls-bar-height CSS variable to specify the inline bar height.

        * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
        (.media-controls.mac.inline.compact > .controls-bar):
        Use the new --inline-compact-controls-bar-height CSS variable to specify the inline bar height.

        * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
        (.media-controls.mac.fullscreen > .controls-bar):
        Use the new --fullscreen-controls-bar-height CSS variable to specify the inline bar height.

        * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
        (.media-controls.mac.inline > .controls-bar):
        Use the new --inline-controls-bar-height CSS variable to specify the inline bar height.

        * Modules/modern-media-controls/controls/media-controls.css:
        (*):
        Specify new CSS variables for the various controls bar heights.

        * Modules/modern-media-controls/controls/media-controls.js:
        (MediaControls.prototype.controlsBarFadedStateDidChange):
        Notify the delegate of a controls bar "faded" property change. 

        * Modules/modern-media-controls/controls/text-tracks.css:
        (video::-webkit-media-text-track-container):
        (video::-webkit-media-text-track-container.visible-controls-bar):
        (video::-webkit-media-text-track-container.visible-controls-bar.compact-controls-bar):
        (video::-webkit-media-text-track-display):
        Shorten the height of the captions container when the controls bar is visible. We also
        fix a couple of prefixed properties that didn't need to be.

        * Modules/modern-media-controls/media/media-controller.js:
        (MediaController.prototype.controlsBarFadedStateDidChange):
        (MediaController.prototype._updateControlsIfNeeded):
        (MediaController.prototype._updateTextTracksClassList):
        (MediaController):
        Ensure we reflect the "faded" state of the controls bar on the captions container using
        a CSS class, as well as whether the controls bar mode is compact.

2017-03-24  Brent Fulgham  <bfulgham@apple.com>

        Handle recursive calls to ProcessingInstruction::checkStyleSheet
        https://bugs.webkit.org/show_bug.cgi?id=169982
        <rdar://problem/31083051>

        Reviewed by Antti Koivisto.

       See if we triggered a recursive load of the stylesheet during the 'beforeload'
       event handler. If so, reset to a valid state before completing the load.

       We should also check after 'beforeload' that we were not disconnected from (or
       moved to a new) document.

       I also looked for other cases of this pattern and fixed them, too.

       Tests: fast/dom/beforeload/image-removed-during-before-load.html
               fast/dom/beforeload/recursive-css-pi-before-load.html
               fast/dom/beforeload/recursive-link-before-load.html
               fast/dom/beforeload/recursive-xsl-pi-before-load.html

        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::clearExistingCachedSheet): Added.
        (WebCore::ProcessingInstruction::checkStyleSheet): Prevent recursive calls into
        this function during 'beforeload' handling. Also, safely handle the case where
        the element was disconnected in the 'beforeload' handler (similar to what
        we do in HTMLLinkElement).
        (WebCore::ProcessingInstruction::setCSSStyleSheet): Drive-by Fix: Protect the
        current document to match what we do in setXSLStyleSheet.
        * dom/ProcessingInstruction.h:
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::process): Prevent recursive calls into
        this function during 'beforeload' handling.
        * html/HTMLLinkElement.h:
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent): safely handle the case where
        the element was disconnected in the 'beforeload' handler (similar to what
        we do in HTMLLinkElement).
        * style/StyleScope.cpp:
        (WebCore::Style::Scope::hasPendingSheet): Added.
        * style/StyleScope.h:

2017-03-24  Brady Eidson  <beidson@apple.com>

        A null compound index value crashes the Databases process.
        <rdar://problem/30499831> and https://bugs.webkit.org/show_bug.cgi?id=170000

        Reviewed by Alex Christensen.

        Test: storage/indexeddb/modern/single-entry-index-invalid-key-crash.html

        * bindings/js/IDBBindingUtilities.cpp:
        (WebCore::createKeyPathArray): Fix the bug by rejecting arrays with any invalid keys in them.
        
        Add some logging:
        * Modules/indexeddb/IDBKeyPath.cpp:
        (WebCore::loggingString):
        * Modules/indexeddb/IDBKeyPath.h:
        * Modules/indexeddb/IDBObjectStore.cpp:
        (WebCore::IDBObjectStore::createIndex):
        * Modules/indexeddb/shared/IDBIndexInfo.cpp:
        (WebCore::IDBIndexInfo::loggingString):

2017-03-24  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r214360.

        This change caused 20+ LayoutTest failures.

        Reverted changeset:

        "Handle recursive calls to
        ProcessingInstruction::checkStyleSheet"
        https://bugs.webkit.org/show_bug.cgi?id=169982
        http://trac.webkit.org/changeset/214360

2017-03-24  Youenn Fablet  <youenn@apple.com>

        Add support for qpSum in WebRTC stats
        https://bugs.webkit.org/show_bug.cgi?id=170060

        Reviewed by Eric Carlson.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::fillRTCRTPStreamStats): exposing libwebrtc qpSum value.

2017-03-24  Daniel Bates  <dabates@apple.com>

        Prevent new navigations during document unload
        https://bugs.webkit.org/show_bug.cgi?id=169934
        <rdar://problem/31247584>

        Reviewed by Chris Dumez.

        Similar to our policy of preventing new navigations from onbeforeunload handlers
        we should prevent new navigations that are initiated during the document unload
        process.

        The significant part of this change is the instantiation of the RAII object NavigationDisabler
        in Document::prepareForDestruction(). The rest of this change just renames class
        NavigationDisablerForBeforeUnload to NavigationDisabler now that this RAII class is
        used to prevent navigation from both onbeforeunload event handlers and when unloading
        a document.

        Test: fast/frames/frame-unload-navigate-and-setTimeout-assert-fail.html

        * dom/Document.cpp:
        (WebCore::Document::prepareForDestruction): Disable new navigations when disconnecting
        subframes. Also assert that the document is not in the page cache before we fall off
        the end of the function.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::isNavigationAllowed): Update for renaming below.
        (WebCore::FrameLoader::shouldClose): Ditto.
        * loader/NavigationScheduler.cpp:
        (WebCore::NavigationScheduler::shouldScheduleNavigation): Ditto.
        * loader/NavigationScheduler.h:
        (WebCore::NavigationDisabler::NavigationDisabler): Renamed class; formerly named NavigationDisablerForBeforeUnload.
        (WebCore::NavigationDisabler::~NavigationDisabler): Ditto.
        (WebCore::NavigationDisabler::isNavigationAllowed): Ditto.
        (WebCore::NavigationDisablerForBeforeUnload::NavigationDisablerForBeforeUnload): Deleted.
        (WebCore::NavigationDisablerForBeforeUnload::~NavigationDisablerForBeforeUnload): Deleted.
        (WebCore::NavigationDisablerForBeforeUnload::isNavigationAllowed): Deleted.

2017-03-24  Myles C. Maxfield  <mmaxfield@apple.com>

        Implement font-optical-sizing
        https://bugs.webkit.org/show_bug.cgi?id=168895

        Reviewed by Dean Jackson.

        Upon advice from Microsoft, the only input to optical sizing is just the
        font-size computed value. It is implemented by setting the 'opsz' font
        variation axis. Because the propery has such a simple grammar, the
        implementation is quite straightforward.

        Test: fast/text/variations/optical-sizing.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::propertyValue):
        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator FontOpticalSizing):
        * css/CSSProperties.json:
        * css/parser/CSSParserFastPaths.cpp:
        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
        (WebCore::CSSParserFastPaths::isKeywordPropertyID):
        * platform/graphics/FontCache.h:
        (WebCore::FontDescriptionKey::makeFlagsKey):
        * platform/graphics/FontDescription.h:
        (WebCore::FontDescription::opticalSizing):
        (WebCore::FontDescription::setOpticalSizing):
        (WebCore::FontDescription::operator==):
        (WebCore::FontCascadeDescription::initialOpticalSizing):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::preparePlatformFont):
        (WebCore::fontWithFamily):
        (WebCore::FontCache::createFontPlatformData):
        (WebCore::FontCache::systemFallbackForCharacters):
        * platform/graphics/mac/FontCustomPlatformData.cpp:
        (WebCore::FontCustomPlatformData::fontPlatformData):
        * platform/text/TextFlags.h:

2017-03-24  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r214329.

        Significantly regressed Speedometer

        Reverted changeset:

        "window.crypto.getRandomValues() uses the insecure RC4 RNG"
        https://bugs.webkit.org/show_bug.cgi?id=169623
        http://trac.webkit.org/changeset/214329

2017-03-24  Yoav Weiss  <yoav@yoav.ws>

        Add a warning for unused link preloads.
        https://bugs.webkit.org/show_bug.cgi?id=165670

        Reviewed by Youenn Fablet.

        This patch adds a warning message, to warn developers that are using
        link preloads in cases where the downloaded resource is likely to
        remain unused.

        Test: http/tests/preload/unused_preload_warning.html

        * dom/Document.cpp:
        (WebCore::Document::prepareForDestruction): Stop the timer once the document is destructed.
        * loader/LinkPreloadResourceClients.h: Add shouldMarkAsReferenced overides for the LinkPreloadResourceClient classes.
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::addClientToSet): Make sure LinkPreloadResourceClients don't set resource to be referenced.
        * loader/cache/CachedResourceClient.h:
        (WebCore::CachedResourceClient::shouldMarkAsReferenced): Make sure that ResourceClients mark preloads as referenced by default.
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::CachedResourceLoader): Initialize timer.
        (WebCore::CachedResourceLoader::~CachedResourceLoader): Stop timer.
        (WebCore::CachedResourceLoader::warnUnusedPreloads): Iterate over m_preloads and issue a warning for non-referenced preloads.
        (WebCore::CachedResourceLoader::documentDidFinishLoadEvent): Trigger a timer if preloads weren't cleared at load time.
        (WebCore::CachedResourceLoader::warnUnusedPreloads): Triggered by the timer, and called CachedResourceLoader::warnUnusedPreloads.
        (WebCore::CachedResourceLoader::stopUnusedPreloadsTimer): Stop the timer.

2017-03-24  Brent Fulgham  <bfulgham@apple.com>

        Handle recursive calls to ProcessingInstruction::checkStyleSheet
        https://bugs.webkit.org/show_bug.cgi?id=169982
        <rdar://problem/31083051>

        Reviewed by Antti Koivisto.

        See if we triggered a recursive load of the stylesheet during the 'beforeload'
        event handler. If so, reset to a valid state before completing the load.

        We should also check after 'beforeload' that we were not disconnected from (or
        moved to a new) document.

        I also looked for other cases of this pattern and fixed them.

        Tests: fast/dom/beforeload/image-removed-during-before-load.html
               fast/dom/beforeload/recursive-css-pi-before-load.html
               fast/dom/beforeload/recursive-link-before-load.html
               fast/dom/beforeload/recursive-xsl-pi-before-load.html

        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::clearExistingCachedSheet): Added.
        (WebCore::ProcessingInstruction::checkStyleSheet): Reset to valid state
        if necessary after the 'beforeload' handler. Also, safely handle the case where
        the element was disconnected in the 'beforeload' handler (similar to what
        we do in HTMLLinkElement).
        (WebCore::ProcessingInstruction::setCSSStyleSheet): Drive-by Fix: Protect the
        current document to match what we do in setXSLStyleSheet.
        * dom/ProcessingInstruction.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::selectMediaResource): Safely handle the case where
        the element was disconnected in the 'beforeload' handler.
        (WebCore::HTMLMediaElement::selectNextSourceChild): Ditto.
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent): Ditto.

2017-03-24  Myles C. Maxfield  <mmaxfield@apple.com>

        font-style needs a new CSSValue to make CSSRule.cssText work correctly
        https://bugs.webkit.org/show_bug.cgi?id=169258

        Reviewed by David Hyatt.

        With variation fonts, font-style's value can't be captured in a CSSPrimitiveValue (nor any other subclass
        off CSSValue) any more. Instead, we need to create two new CSSValues which represent the grammar that font-
        style and it's associated @font-face descriptor accept.

        The grammar of the font-style property is "normal | italic | oblique [ <<angle>> ]?"
        The grammar of the font-style descriptor is "normal | italic | oblique [ <<angle>> | <<angle>> <<angle>> ]?"

        We currently still support numbers in place of the <<angle>> value (contrary to the spec). We will remove
        this support in https://bugs.webkit.org/show_bug.cgi?id=169357.

        Tests: fast/text/font-selection-font-face-parse.html:
               fast/text/font-style-parse.html:

        * CMakeLists.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSAllInOne.cpp:
        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::fontStyleFromStyle):
        (WebCore::fontShorthandValueForSelectionProperties):
        * css/CSSFontFace.cpp:
        (WebCore::calculateWeightRange):
        (WebCore::calculateStretchRange):
        (WebCore::calculateItalicRange):
        * css/CSSFontFaceSet.cpp:
        (WebCore::computeFontSelectionRequest):
        (WebCore::CSSFontFaceSet::matchingFaces):
        (WebCore::calculateWeightValue): Deleted.
        (WebCore::calculateStretchValue): Deleted.
        (WebCore::calculateStyleValue): Deleted.
        * css/CSSFontFaceSet.h:
        * css/CSSFontSelector.cpp:
        (WebCore::CSSFontSelector::addFontFaceRule):
        * css/CSSFontStyleRangeValue.cpp: Added.
        (WebCore::CSSFontStyleRangeValue::customCSSText):
        (WebCore::CSSFontStyleRangeValue::equals):
        * css/CSSFontStyleRangeValue.h: Added.
        * css/CSSFontStyleValue.cpp: Added.
        (WebCore::CSSFontStyleValue::customCSSText):
        (WebCore::CSSFontStyleValue::equals):
        * css/CSSFontStyleValue.h: Added.
        * css/CSSFontValue.cpp:
        (WebCore::CSSFontValue::customCSSText):
        * css/CSSFontValue.h:
        * css/CSSValue.cpp:
        (WebCore::CSSValue::equals):
        (WebCore::CSSValue::cssText):
        (WebCore::CSSValue::destroy):
        * css/CSSValue.h:
        (WebCore::CSSValue::isFontStyleValue):
        (WebCore::CSSValue::isFontStyleRangeValue):
        * css/FontFace.cpp:
        (WebCore::FontFace::style):
        (WebCore::FontFace::weight):
        (WebCore::FontFace::stretch):
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertFontWeightFromValue):
        (WebCore::StyleBuilderConverter::convertFontStretchFromValue):
        (WebCore::StyleBuilderConverter::convertFontStyleFromValue):
        (WebCore::StyleBuilderConverter::convertFontWeight):
        (WebCore::StyleBuilderConverter::convertFontStretch):
        (WebCore::StyleBuilderConverter::convertFontStyle):
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::consumeFontStyle):
        (WebCore::consumeFontStyleRange):
        (WebCore::CSSPropertyParser::consumeSystemFont):
        (WebCore::CSSPropertyParser::consumeFont):
        * svg/SVGFontFaceElement.cpp:
        (WebCore::SVGFontFaceElement::parseAttribute):

2017-03-24  Alex Christensen  <achristensen@webkit.org>

        REGRESSION: Content Blocker: Blocking "a[href*=randomString]" doesn't work
        https://bugs.webkit.org/show_bug.cgi?id=169167

        Reviewed by Simon Fraser.

        When testing content extensions, we have always called an API function that internally
        has called AtomicString::init somewhere before we start compiling the content extension.
        On iOS, though, we call [_WKUserContentExtensionStore compileContentExtensionForIdentifier:...]
        without having already called anything that calls AtomicString::init.  The new CSS parser is now
        failing to parse some selectors because CSSSelectorParser::defaultNamespace is returning starAtom,
        which is a null atomic string before AtomicString::init is called.

        Covered by a new API test.

        * contentextensions/ContentExtensionParser.cpp:
        (WebCore::ContentExtensions::isValidCSSSelector):
        (WebCore::ContentExtensions::loadAction):
        (WebCore::ContentExtensions::isValidSelector): Deleted.
        * contentextensions/ContentExtensionParser.h:
        Call AtomicString::init before checking if a css selector is valid.

2017-03-24  Youenn Fablet  <youenn@apple.com>

        Add libwebrtc backend support for RTCRtpSender::replaceTrack
        https://bugs.webkit.org/show_bug.cgi?id=169841

        Reviewed by Alex Christensen.

        Tests: webrtc/audio-replace-track.html
               webrtc/video-replace-track.html

        Adding support for replaceTrack for audio and video sources.
        Replacing tracks will always succeed for audio sources.
        For video tracks, it will only succeed if the video resolution is not greater.
        LibWebRTCPeerConnectionBackend will delegate the track replacing by replacing the source of the outgoing sources with the source wrapped in the replacing track.

        Video test is not fully passing as size constraints for mock video sources are not providing the right video stream resolution.

        * Modules/mediastream/RTCRtpSender.cpp:
        (WebCore::RTCRtpSender::replaceTrack):
        * Modules/mediastream/RTCRtpSender.h:
        * Modules/mediastream/RTCRtpSender.idl:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
        (WebCore::RealtimeOutgoingAudioSource::setSource):
        * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
        (WebCore::RealtimeOutgoingVideoSource::setSource):
        * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::drawText):
        (WebCore::MockRealtimeVideoSource::generateFrame):

2017-03-24  Jon Lee  <jonlee@apple.com>

        Remove comment from RTCStatsReport.idl to convert ssrc to DOMString.
        Unreviewed.

        Latest available Editor's Draft of WebRTC Statistics API is from 14 December 2016,
        but since then, in https://github.com/w3c/webrtc-stats/pull/157, it was changed to become
        unsigned long.

        * Modules/mediastream/RTCStatsReport.idl:

2017-03-24  Youenn Fablet  <youenn@apple.com>

        Add support for DataChannel and MediaStreamTrack stats
        https://bugs.webkit.org/show_bug.cgi?id=170031

        Reviewed by Eric Carlson.

        Tests: webrtc/datachannel/datachannel-stats.html
               webrtc/video-mediastreamtrack-stats.html

        Exposing libwebrtc stats through WebRTC stats API, gathered for data channel and media stream tracks.

        * Modules/mediastream/RTCStatsReport.h:
        (WebCore::RTCStatsReport::MediaStreamTrackStats::MediaStreamTrackStats):
        (WebCore::RTCStatsReport::DataChannelStats::DataChannelStats):
        * Modules/mediastream/RTCStatsReport.idl:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::fillRTCMediaStreamTrackStats):
        (WebCore::fillRTCDataChannelStats):
        (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):

2017-03-24  Youenn Fablet  <youenn@apple.com>

        Fix framesEncoded/framesDecoded RTC stats
        https://bugs.webkit.org/show_bug.cgi?id=170024

        Reviewed by Eric Carlson.

        Test: webrtc/video-stats.html

        Adding access to these fields now that they are available.

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

2017-03-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        Unreviewed. Fix GTK+ test /webkit2/WebKitWebView/default-menu after r214244.

        Fix mnemonic string of contextMenuItemTagOpenAudioInNewWindow() that I copy pasted from
        contextMenuItemTagOpenVideoInNewWindow().

        * platform/LocalizedStrings.cpp:
        (WebCore::contextMenuItemTagOpenAudioInNewWindow):

2017-03-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GStreamer] MediaPlayerPrivateGStreamerOwr shouldn't be the default engine
        https://bugs.webkit.org/show_bug.cgi?id=170049

        Reviewed by Žan Doberšek.

        This is causing several media tests to fail after r214338. When trying to load something like this:

        http://127.0.0.1:8000/media/resources/serve-video.php?name=../../../../media/content/silence.wav&type=audio/wav&content-length=no&icy-data=yes

        since r214338, the content type is known and inferred from the extension in this case, what ends up calling
        nextMediaEngine() in MediaPlayer::loadWithNextMediaEngine. That returns the first registered media engine, that
        is Owr that doesn't know how to load that and fails.

        Fixes: http/tests/media/media-play-stream-chunked-icy.html
               http/tests/media/media-seeking-no-ranges-server.html
               http/tests/media/video-auth.html
               http/tests/media/video-play-stall-before-meta-data.html
               http/tests/security/contentSecurityPolicy/audio-redirect-allowed.html
               http/tests/security/contentSecurityPolicy/audio-redirect-allowed2.html
               http/tests/security/contentSecurityPolicy/audio-redirect-blocked.html
               http/tests/security/contentSecurityPolicy/video-redirect-allowed.html
               http/tests/security/contentSecurityPolicy/video-redirect-allowed2.html
               http/tests/security/contentSecurityPolicy/video-redirect-blocked.html

        * platform/graphics/MediaPlayer.cpp:
        (WebCore::buildMediaEnginesVector):

2017-03-24  Per Arne Vollan  <pvollan@apple.com>

        Text stroke is sometimes clipped on video captions.
        https://bugs.webkit.org/show_bug.cgi?id=170006

        Reviewed by Eric Carlson.

        Set 'overflow' property to 'visible' on cue element to avoid clipping of text stroke.

        Updated test media/track/track-css-stroke-cues.html.

        * html/track/TextTrackCueGeneric.cpp:
        (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
        * html/track/VTTCue.cpp:
        (WebCore::VTTCueBox::applyCSSProperties):

2017-03-24  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK] Add MIMETypeRegistry implementation using xdgmime and remove the GTK+ one
        https://bugs.webkit.org/show_bug.cgi?id=170001

        Reviewed by Michael Catanzaro.

        The XDG implementation could be used by any port where shared-mime-info is expected to be available. It also
        improves the current GTK+ implementation that is based on a very small map of mime types and extensions.

        * CMakeLists.txt:
        * PlatformGTK.cmake:
        * platform/xdg/MIMETypeRegistryXdg.cpp: Renamed from Source/WebCore/platform/gtk/MIMETypeRegistryGtk.cpp.
        (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
        (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):

2017-03-23  Jon Lee  <jonlee@apple.com>

        Update createDataChannel on RTCPeerConnection
        https://bugs.webkit.org/show_bug.cgi?id=170044

        Reviewed by Youenn Fablet.

        * Modules/mediastream/RTCPeerConnection.idl: Change label to USVString.

2017-03-23  Antti Koivisto  <antti@apple.com>

        Revert r213712, caused iPad PLT regression
        https://bugs.webkit.org/show_bug.cgi?id=170040

        Unreviewed.

        A few subtests have big regressions.

        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::pseudoStyleRulesForElement):
        * dom/Document.cpp:
        (WebCore::Document::resolveStyle):
        (WebCore::Document::updateLayoutIgnorePendingStylesheets):
        (WebCore::Document::shouldScheduleLayout):
        (WebCore::Document::didRemoveAllPendingStylesheet):
        * dom/Document.h:
        (WebCore::Document::didLayoutWithPendingStylesheets):
        (WebCore::Document::hasNodesWithPlaceholderStyle):
        (WebCore::Document::setHasNodesWithPlaceholderStyle):
        (WebCore::Document::hasNodesWithNonFinalStyle): Deleted.
        (WebCore::Document::setHasNodesWithNonFinalStyle): Deleted.
        * html/HTMLFrameSetElement.cpp:
        (WebCore::HTMLFrameSetElement::rendererIsNeeded):
        * page/FrameView.cpp:
        (WebCore::FrameView::qualifiesAsVisuallyNonEmpty):
        (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::paintContents):
        * rendering/RenderLayer.cpp:
        (WebCore::shouldSuppressPaintingLayer):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::changeRequiresRepaint):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::isPlaceholderStyle):
        (WebCore::RenderStyle::setIsPlaceholderStyle):
        (WebCore::RenderStyle::isNotFinal): Deleted.
        (WebCore::RenderStyle::setIsNotFinal): Deleted.
        * rendering/style/StyleRareNonInheritedData.cpp:
        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
        (WebCore::StyleRareNonInheritedData::operator==):
        * rendering/style/StyleRareNonInheritedData.h:
        * style/StyleScope.cpp:
        (WebCore::Style::Scope::analyzeStyleSheetChange):
        (WebCore::Style::Scope::updateActiveStyleSheets):
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::makePlaceholderStyle):
        (WebCore::Style::TreeResolver::styleForElement):
        (WebCore::Style::TreeResolver::resolveElement):

2017-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        Dragging on a large image should not revert to a file icon if data interaction is enabled
        https://bugs.webkit.org/show_bug.cgi?id=170018
        <rdar://problem/31184508>

        Reviewed by Tim Horton.

        If data interaction is enabled, don't fall back to showing a file icon when initiating a drag on an image element.

        New API tests:  DataInteractionTests.LargeImageToTargetDiv
                        DataInteractionTests.AttachmentElementItemProviders

        * page/DragController.cpp:
        (WebCore::DragController::doImageDrag):
        (WebCore::DragController::shouldUseCachedImageForDragImage):
        * page/DragController.h:

2017-03-23  Youenn Fablet  <youenn@apple.com>

        Rename RTCIceCandidateEvent to RTCPeerConnectionIceEvent
        https://bugs.webkit.org/show_bug.cgi?id=169981

        Reviewed by Eric Carlson.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/mediastream/MediaEndpointPeerConnection.cpp:
        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::fireICECandidateEvent):
        (WebCore::PeerConnectionBackend::doneGatheringCandidates):
        * Modules/mediastream/RTCPeerConnection.cpp:
        * Modules/mediastream/RTCPeerConnectionIceEvent.cpp: Renamed from Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.cpp.
        (WebCore::RTCPeerConnectionIceEvent::create):
        (WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent):
        (WebCore::RTCPeerConnectionIceEvent::~RTCPeerConnectionIceEvent):
        (WebCore::RTCPeerConnectionIceEvent::candidate):
        (WebCore::RTCPeerConnectionIceEvent::eventInterface):
        * Modules/mediastream/RTCPeerConnectionIceEvent.h: Renamed from Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.h.
        * Modules/mediastream/RTCPeerConnectionIceEvent.idl: Renamed from Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.idl.
        * WebCore.xcodeproj/project.pbxproj:
        * dom/EventNames.in:

2017-03-23  Michael Catanzaro  <mcatanzaro@igalia.com>

        window.crypto.getRandomValues() uses the insecure RC4 RNG
        https://bugs.webkit.org/show_bug.cgi?id=169623

        Reviewed by Alex Christensen.

        * PlatformMac.cmake:
        * WebCore.xcodeproj/project.pbxproj:
        * crypto/CryptoKey.cpp:
        (WebCore::CryptoKey::randomData): Use this on Mac now.
        * crypto/mac/CryptoKeyMac.cpp: Removed.
        * page/Crypto.cpp:
        (WebCore::Crypto::getRandomValues): Rollout r214188.

2017-03-23  Chris Dumez  <cdumez@apple.com>

        SVG animations are not paused when their <svg> element is removed from the document
        https://bugs.webkit.org/show_bug.cgi?id=170030
        <rdar://problem/31230252>

        Reviewed by Dean Jackson.

        SVG animations were not paused when their <svg> element was removed from the document.
        This patch fixes the issue.

        Test: svg/animations/animations-paused-when-removed-from-document.html

        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::insertedInto):
        (WebCore::SVGSVGElement::removedFrom):

2017-03-22  Myles C. Maxfield  <mmaxfield@apple.com>

        font shorthand should accept variation values
        https://bugs.webkit.org/show_bug.cgi?id=168998

        Reviewed by Simon Fraser.

        The CSS Fonts 4 spec has stabilized as to which variation values are allowed in
        the font shorthand property. Weights are allowed because a 0 weight is considered
        as a parse error, so there is no conflict with a unitless font-size of 0.
        font-style accepts angles, so there is no conflict there. However, font-stretch
        accepts percentages, which are also accepted by font-size, which means the newly
        extended grammar for font-stretch can't be accepted in the shorthand.

        Tests: fast/text/font-style-parse.html
               fast/text/font-weight-parse.html

        * css/parser/CSSPropertyParser.cpp:
        (WebCore::consumeFontWeight):
        (WebCore::consumeFontStyle):
        (WebCore::CSSPropertyParser::consumeFont):
        (WebCore::consumeFontWeightCSS21): Deleted.
        * css/parser/CSSPropertyParserHelpers.cpp:
        (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
        * css/parser/CSSPropertyParserHelpers.h:

2017-03-23  Chris Dumez  <cdumez@apple.com>

        SVG animations are not paused when inserted into a hidden page
        https://bugs.webkit.org/show_bug.cgi?id=170026
        <rdar://problem/31228704>

        Reviewed by Andreas Kling.

        SVG animations were not paused when inserted into a hidden page. We would pause
        animations in a page when the page becomes hidden. However, new animations
        inserted in the page after this point would start, despite the page being
        hidden.

        Tests:
        - svg/animations/animations-paused-when-inserted-in-hidden-document.html
        - svg/animations/animations-paused-when-inserted-in-hidden-document2.html

        * dom/Document.cpp:
        (WebCore::Document::accessSVGExtensions):
        * svg/SVGDocumentExtensions.cpp:
        (WebCore::SVGDocumentExtensions::SVGDocumentExtensions):
        (WebCore::SVGDocumentExtensions::addTimeContainer):
        (WebCore::reportMessage):
        * svg/SVGDocumentExtensions.h:
        * testing/Internals.cpp:
        (WebCore::Internals::areSVGAnimationsPaused):
        * testing/Internals.h:
        * testing/Internals.idl:

== Rolled over to ChangeLog-2017-03-23 ==