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::Re