Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
[WebKit-https.git] / Source / WebCore / ChangeLog
index afe0d30..abc3134 100644 (file)
+2017-03-07  Chris Dumez  <cdumez@apple.com>
+
+        Port DOMTimer from std::chrono::milliseconds to WTF::Seconds type
+        https://bugs.webkit.org/show_bug.cgi?id=169236
+
+        Reviewed by Simon Fraser.
+
+        * dom/Document.cpp:
+        (WebCore::Document::minimumDOMTimerInterval):
+        (WebCore::Document::timerAlignmentInterval):
+        * dom/Document.h:
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::adjustMinimumDOMTimerInterval):
+        (WebCore::ScriptExecutionContext::minimumDOMTimerInterval):
+        (WebCore::ScriptExecutionContext::timerAlignmentInterval):
+        * dom/ScriptExecutionContext.h:
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::didInstallTimerImpl):
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::didInstallTimer):
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::didInstallTimer):
+        * inspector/InspectorTimelineAgent.h:
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::TimelineRecordFactory::createTimerInstallData):
+        * inspector/TimelineRecordFactory.h:
+        * page/DOMTimer.cpp:
+        (WebCore::shouldForwardUserGesture):
+        (WebCore::userGestureTokenToForward):
+        (WebCore::DOMTimer::DOMTimer):
+        (WebCore::DOMTimer::install):
+        (WebCore::DOMTimer::intervalClampedToMinimum):
+        (WebCore::DOMTimer::alignedFireTime):
+        * page/DOMTimer.h:
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::setTimeout):
+        (WebCore::DOMWindow::setInterval):
+        * page/Page.cpp:
+        (WebCore::Page::setTimerThrottlingState):
+        (WebCore::Page::setDOMTimerAlignmentIntervalIncreaseLimit):
+        (WebCore::Page::updateDOMTimerAlignmentInterval):
+        * page/Page.h:
+        (WebCore::Page::domTimerAlignmentInterval):
+        * page/Settings.cpp:
+        (WebCore::Settings::setMinimumDOMTimerInterval):
+        * page/Settings.h:
+        (WebCore::Settings::minimumDOMTimerInterval):
+        * page/SuspendableTimer.h:
+        (WebCore::SuspendableTimer::startRepeating):
+        (WebCore::SuspendableTimer::startOneShot):
+        (WebCore::SuspendableTimer::augmentFireInterval):
+        (WebCore::SuspendableTimer::augmentRepeatInterval):
+        * platform/Timer.cpp:
+        (WebCore::TimerBase::setNextFireTime):
+        * platform/Timer.h:
+        (WebCore::TimerBase::alignedFireTime):
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::setMinimumTimerInterval):
+        * testing/InternalSettings.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::isTimerThrottled):
+        * workers/WorkerGlobalScope.cpp:
+        (WebCore::WorkerGlobalScope::setTimeout):
+        (WebCore::WorkerGlobalScope::setInterval):
+
+2017-03-07  Chris Dumez  <cdumez@apple.com>
+
+        Align initEvent / initCustomEvent / initMessageEvent with the latest specification
+        https://bugs.webkit.org/show_bug.cgi?id=169176
+
+        Reviewed by Alex Christensen.
+
+        Align initEvent / initCustomEvent / initMessageEvent with the latest specification
+        after:
+        - https://github.com/whatwg/dom/pull/417
+        - https://github.com/whatwg/html/pull/2410
+
+        In particular, the following changes were made:
+        - initEvent: The length property now properly returns 1 instead of 3 as only the
+          first parameter is mandatory. We were already behaving correcting the the length
+          property value was wrong because we forgot to drop a hack from the bindings
+          generator.
+        - initCustomEvent: Make all parameters except the first optional. Previously, all
+          parameters were mandatory so this is safe.
+        - initMessageEvent: Drop the custom code and mark the first parameter as mandatory.
+          A side effect of dropping the custom code is that null is no longer considered as
+          valid input for the last parameter. The parameter is of type sequence<> and the
+          new behavior is consistent with the specification and Firefox. If it turns out to
+          break existing content, I'll make the parameter nullable in a follow-up.
+
+        No new tests, updated existing tests.
+
+        * bindings/js/JSMessageEventCustom.cpp:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GeneratePropertiesHashTable):
+        * dom/CustomEvent.idl:
+        * dom/MessageEvent.idl:
+
+2017-03-07  Antti Koivisto  <antti@apple.com>
+
+        Differentiate between pending head and body stylesheets in Style::Scope
+        https://bugs.webkit.org/show_bug.cgi?id=169277
+
+        Reviewed by Andreas Kling.
+
+        Split pending stylesheet node set into separate sets for head and body elements and processing instructions.
+
+        This tightens typing and will also be useful later.
+
+        * style/StyleScope.cpp:
+        (WebCore::Style::Scope::~Scope):
+        (WebCore::Style::Scope::addPendingSheet):
+        (WebCore::Style::Scope::removePendingSheet):
+        (WebCore::Style::Scope::didRemovePendingStylesheet):
+        (WebCore::Style::Scope::hasPendingSheet):
+        (WebCore::Style::Scope::hasPendingSheetInBody):
+        (WebCore::Style::Scope::hasProcessingInstructionWithPendingSheet): Deleted.
+        * style/StyleScope.h:
+        (WebCore::Style::Scope::hasPendingSheet): Deleted.
+        (WebCore::Style::Scope::hasPendingSheets): Deleted.
+        * style/StyleTreeResolver.cpp:
+        (WebCore::Style::hasLoadingStylesheet):
+
+            Just test for body stylesheets.
+
+        (WebCore::Style::TreeResolver::resolve):
+
+            Treat all before-body stylesheets uniformly.
+
+2017-03-07  Antoine Quint  <graouts@apple.com>
+
+        [Modern Media Controls] Setting a valid source after an invalid one retains the invalid placard
+        https://bugs.webkit.org/show_bug.cgi?id=169280
+        <rdar://problem/30876078>
+
+        Reviewed by Jon Lee.
+
+        We need to track when a new load start to see if we might have recovered from an error
+        and hide the "invalid" placard.
+
+        Test: media/modern-media-controls/placard-support/placard-support-error-recover.html
+
+        * Modules/modern-media-controls/media/placard-support.js:
+        (PlacardSupport.prototype.get mediaEvents):
+
+2017-03-07  Andy Estes  <aestes@apple.com>
+
+        REGRESSION (r213412): JPEG premultiplication tests fail under GuardMalloc
+        https://bugs.webkit.org/show_bug.cgi?id=169266
+
+        Reviewed by Tim Horton.
+
+        r213412 added functions to create a CGImageRef from a canvas image buffer, which were used
+        to create data: URLs and blobs. If JPEG premultiplication is applied, though,
+        WebCore::cgImage() would return an image with a data provider pointing to stack memory.
+
+        I fixed a similar issue in ImageBuffer::toCGImage() by leaking the reference to a
+        Uint8ClampedArray then creating a CGDataProviderRef with a releaseData function that adopts
+        the leaked reference.
+
+        We could take that approach in cgImage() too by allocating the premultiplied data buffer on
+        the heap then freeing it with a releaseData function, but it's simpler to refactor
+        toCGImage()/cgImage() to return an encoded image as a CFDataRef instead of a CFImageRef.
+        This ensures that a CGDataProviderRef never outlives the data it points to.
+
+        Covered by existing tests.
+
+        * platform/graphics/ImageBuffer.h: Renamed toCGImage() to toCFData().
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::dataURL): Changed to take a CFDataRef.
+        (WebCore::dataVector): Renamed from data(). Changed to take a CFDataRef.
+        (WebCore::ImageBuffer::toDataURL): Changed to call toCFData().
+        (WebCore::ImageBuffer::toData): Ditto.
+        (WebCore::ImageBuffer::toCFData): Changed to return a CFDataRef after encoding the
+        CGImageRef that was previously returned.
+        (WebCore::cfData): Ditto.
+        (WebCore::dataURL): Changed to call cfData().
+        (WebCore::data): Ditto.
+        (WebCore::ImageBuffer::toCGImage): Renamed to ImageBuffer::toCFData().
+        (WebCore::cgImage): Renamed to WebCore::cfData().
+
+2017-03-07  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Test fix after r213505
+        https://bugs.webkit.org/show_bug.cgi?id=169267
+
+        Unreviewed.
+
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::preparePlatformFont):
+
+2017-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Apply well-known-axis variation values at the right time in preparePlatformFont()
+        https://bugs.webkit.org/show_bug.cgi?id=168896
+
+        Reviewed by Jon Lee.
+
+        Simply plumb the FontSelectionRequest to the place where font variations are implemented.
+
+        Test: fast/text/variations/font-selection-properties.html
+
+        * platform/graphics/FontCache.h:
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::preparePlatformFont):
+        (WebCore::fontWithFamily):
+        (WebCore::FontCache::createFontPlatformData):
+        (WebCore::FontCache::systemFallbackForCharacters):
+        * platform/graphics/mac/FontCustomPlatformData.cpp:
+        (WebCore::FontCustomPlatformData::fontPlatformData):
+
+2017-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Unreviewed post-review fixup after r213464
+        https://bugs.webkit.org/show_bug.cgi?id=169255
+
+        * platform/graphics/FontCache.h:
+        (WebCore::FontDescriptionKey::FontDescriptionKey):
+        (WebCore::FontDescriptionKey::operator==):
+        (WebCore::FontDescriptionKey::computeHash):
+        (WebCore::FontDescriptionKey::makeFlagsKey):
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::computeNecessarySynthesis):
+
+2017-03-06  Brent Fulgham  <bfulgham@apple.com>
+
+        Validate DOM after potentially destructive actions during parser insert operations
+        https://bugs.webkit.org/show_bug.cgi?id=169222
+        <rdar://problem/30689729>
+
+        Reviewed by Ryosuke Niwa.
+
+        Do not perform an insert operation if the next child's parent is no longer
+        part of the tree. This can happen if JavaScript runs during node removal
+        events and modifies the contents of the document.
+
+        This patch was inspired by a similar Blink change by Marius Mlynski:
+        <https://src.chromium.org/viewvc/blink?view=revision&revision=200690>        
+
+        Tests: fast/parser/scriptexec-during-parserInsertBefore.html
+
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::executeReparentTask):
+        (WebCore::executeInsertAlreadyParsedChildTask):
+
+2017-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Update isEmojiGroupCandidate() to the latest version of Unicode
+        https://bugs.webkit.org/show_bug.cgi?id=168198
+
+        Reviewed by Jon Lee.
+
+        In the latest version of Unicode, many more code points are candidates for emoji groups.
+        Therefore, isEmojiGroupCandidate() should be made more permissive. This way, the function
+        is more future-proof.
+
+        Test: editing/deleting/delete-emoji.html
+
+        * platform/text/CharacterProperties.h:
+        (WebCore::icuLibraryUnderstandsSupplementalSymbolsAndPictographs):
+        (WebCore::isEmojiGroupCandidate):
+
+2017-03-06  Youenn Fablet  <youenn@apple.com>
+
+        Use default configuration for libwebrtc peerconnection
+        https://bugs.webkit.org/show_bug.cgi?id=169239
+
+        Reviewed by Alex Christensen.
+
+        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
+        (WebCore::configurationFromMediaEndpointConfiguration): Using the default configuration instead of the aggressive one.
+
+2017-03-06  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [CMake] SN-DBS fails to build: Cannot open include file: 'WebCoreTestSupportPrefix.h'
+        https://bugs.webkit.org/show_bug.cgi?id=169244
+
+        Reviewed by Alex Christensen.
+
+        A distributed build system SN-DBS can not find
+        WebCoreTestSupportPrefix.h without an include path to it.
+
+        * CMakeLists.txt: Add 'WebCore/testing/js' to include paths.
+
+2017-03-06  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [cairo] error C2065: 'quality': undeclared identifier since r213412
+        https://bugs.webkit.org/show_bug.cgi?id=169240
+
+        Reviewed by Ryosuke Niwa.
+
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        (WebCore::ImageBuffer::toDataURL): Name the unnamed second argument 'quality'.
+
+2017-03-06  Jiewen Tan  <jiewen_tan@apple.com>
+
+        [WebCrypto] Implement ECDH GenerateKey operation
+        https://bugs.webkit.org/show_bug.cgi?id=169093
+        <rdar://problem/23789585>
+
+        Reviewed by Brent Fulgham.
+
+        This patch implements GenerateKey operation of ECDH according to:
+        https://www.w3.org/TR/WebCryptoAPI/#ecdh-operations.
+        Note: Sad that we are not able to support P-521 at this moment due
+        to lack of necessary support in the underlying crypto library.
+
+        Tests: crypto/subtle/ec-generate-key-malformed-parameters.html
+               crypto/subtle/ecdh-generate-key-extractable.html
+               crypto/subtle/ecdh-generate-key-p256.html
+               crypto/subtle/ecdh-generate-key-p384.html
+               crypto/subtle/ecdh-generate-key-single-usage.html
+               crypto/workers/subtle/ec-generate-key.html
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * PlatformGTK.cmake:
+        * PlatformMac.cmake:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSCryptoKeyCustom.cpp:
+        (WebCore::JSCryptoKey::algorithm):
+        * bindings/js/JSSubtleCryptoCustom.cpp:
+        (WebCore::normalizeCryptoAlgorithmParameters):
+        (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
+        Add support for ECDH.
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneSerializer::write):
+        Structured clonable will be added later on.
+        * crypto/CommonCryptoUtilities.h:
+        Add SPI for EC.
+        * crypto/CryptoAlgorithmParameters.h:
+        * crypto/CryptoKey.h:
+        * crypto/algorithms/CryptoAlgorithmECDH.cpp: Added.
+        (WebCore::CryptoAlgorithmECDH::create):
+        (WebCore::CryptoAlgorithmECDH::identifier):
+        (WebCore::CryptoAlgorithmECDH::generateKey):
+        * crypto/algorithms/CryptoAlgorithmECDH.h: Added.
+        * crypto/gnutls/CryptoKeyECGnuTLS.cpp: Added.
+        (WebCore::CryptoKeyEC::~CryptoKeyEC):
+        (WebCore::CryptoKeyEC::platformGeneratePair):
+        * crypto/keys/CryptoKeyEC.cpp: Added.
+        (WebCore::CryptoKeyEC::CryptoKeyEC):
+        (WebCore::CryptoKeyEC::generatePair):
+        (WebCore::CryptoKeyEC::buildAlgorithm):
+        (WebCore::CryptoKeyEC::exportData):
+        * crypto/keys/CryptoKeyEC.h: Added.
+        (WebCore::EcKeyAlgorithm::EcKeyAlgorithm):
+        (WebCore::EcKeyAlgorithm::namedCurve):
+        * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
+        (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
+        Add support for ECDH.
+        * crypto/mac/CryptoKeyECMac.cpp: Added.
+        (WebCore::CryptoKeyEC::~CryptoKeyEC):
+        (WebCore::CryptoKeyEC::platformGeneratePair):
+        * crypto/parameters/CryptoAlgorithmEcKeyParams.h: Added.
+        * crypto/parameters/EcKeyParams.idl: Added.
+
+2017-03-06  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Unreviewed, fix unused parameter warning after r213464
+
+        * platform/graphics/freetype/FontCacheFreeType.cpp:
+        (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
+
+2017-03-06  Michael Saboff  <msaboff@apple.com>
+
+        Take advantage of fast permissions switching of JIT memory for devices that support it
+        https://bugs.webkit.org/show_bug.cgi?id=169155
+
+        Reviewed by Saam Barati.
+
+        Updated the Xcode config files to match what is in the JavaScriptCore ones.
+
+        * Configurations/Base.xcconfig:
+        * Configurations/FeatureDefines.xcconfig:
+        * Configurations/WebCore.xcconfig:
+
+2017-03-06  Aakash Jain  <aakash_jain@apple.com>
+
+        Make WKMenuItemIdentifiersPrivate.h private header
+        https://bugs.webkit.org/show_bug.cgi?id=168981
+
+        Reviewed by Tim Horton.
+
+        * platform/spi/mac/NSMenuSPI.h: NSUserInterfaceItemIdentification is in the public header in recent SDKs.
+
+2017-03-06  Dave Hyatt  <hyatt@apple.com>
+
+        REGRESSION: Block no longer shrinks to preferred width in this flex box layout
+        https://bugs.webkit.org/show_bug.cgi?id=169203
+        <rdar://problem/30873895>
+
+        Reviewed by Simon Fraser.
+
+        Added new test in css3/flexbox.
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::adjustRenderStyle):
+        (WebCore::StyleResolver::adjustStyleForAlignment):
+        * html/shadow/TextControlInnerElements.cpp:
+        (WebCore::TextControlInnerElement::resolveCustomStyle):
+        Resolve auto alignment values by adjusting the render style as needed. Make a helper
+        function for adjusting only alignment that can be called from the inner text control
+        custom style creation.
+
+        * rendering/GridTrackSizingAlgorithm.cpp:
+        (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild):
+        Replaced items in grids should not stretch by default.
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::hasStretchedLogicalWidth):
+        Patched to properly check the default alignment for the child, making sure
+        that if it's a replacd item inside a grid, that the default is start and not
+        stretch.
+
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::selfAlignmentNormalBehavior):
+        Self-alignment function now takes an optional child argument, since the behavior
+        varies in grids depending on the child being replaced or not.
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::alignmentForChild):
+        Fixed to do the right thing when the child is anonymous.
+
+        (WebCore::RenderFlexibleBox::styleDidChange): Deleted.
+        * rendering/RenderFlexibleBox.h:
+        Deleted, since alignment changes are handled at the style diff level now.
+
+        * rendering/RenderFullScreen.h:
+        Patched the selfAlignmentNormalBehavior method to take an optional child argument.
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::styleDidChange):
+        (WebCore::RenderGrid::alignSelfForChild):
+        (WebCore::RenderGrid::justifySelfForChild):
+        (WebCore::RenderGrid::columnAxisPositionForChild):
+        (WebCore::RenderGrid::rowAxisPositionForChild):
+        (WebCore::RenderGrid::columnAxisOffsetForChild):
+        (WebCore::RenderGrid::rowAxisOffsetForChild):
+        (WebCore::defaultAlignmentIsStretch): Deleted.
+        (WebCore::defaultAlignmentChangedToStretchInRowAxis): Deleted.
+        (WebCore::defaultAlignmentChangedFromStretchInRowAxis): Deleted.
+        (WebCore::defaultAlignmentChangedFromStretchInColumnAxis): Deleted.
+        (WebCore::selfAlignmentChangedToStretchInRowAxis): Deleted.
+        (WebCore::selfAlignmentChangedFromStretchInRowAxis): Deleted.
+        (WebCore::selfAlignmentChangedFromStretchInColumnAxis): Deleted.
+        * rendering/RenderGrid.h:
+        Removed the alignment change logic in styleDidChange for grids, since style diffing handles
+        it now. Updated all selfAlignmentForNormalBehavior queries to pass in the child so that
+        replaced elements are handled properly.
+
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::overflowInlineDirection):
+        (WebCore::RenderStyle::overflowBlockDirection):
+        (WebCore::RenderStyle::setJustifySelfPosition):
+        New helpers used by grid and by adjustRenderStyle.
+
+        * style/StyleChange.cpp:
+        (WebCore::Style::determineChange):
+        If alignment or justification changes occur on a parent that could affect the child (e.g., align-items)
+        return Inherit so the child render styles get adjusted properly.
+
+2017-03-06  Youenn Fablet  <youenn@apple.com>
+
+        ASSERTION FAILED: numberOfChannels == 2 in WebCore::RealtimeIncomingAudioSource::OnData
+        https://bugs.webkit.org/show_bug.cgi?id=169224
+        <rdar://problem/30856811>
+
+        Reviewed by Alex Christensen.
+
+        * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
+        (WebCore::RealtimeIncomingAudioSource::OnData): Updated assertion to allow 1 channel since we can handle it as well.
+
+2017-03-06  Chris Dumez  <cdumez@apple.com>
+
+        [iOS] Throttle CSS animations to 30fps in low power mode
+        https://bugs.webkit.org/show_bug.cgi?id=169138
+        <rdar://problem/30837805>
+
+        Reviewed by Said Abou-Hallawa.
+
+        Throttle software CSS animations to 30fps in low power mode on iOS
+        to save battery.
+
+        Test: fast/animation/css-animation-throttling-lowPowerMode.html
+
+        * page/Page.cpp:
+        (WebCore::Page::handleLowModePowerChange):
+        * page/animation/CSSAnimationController.cpp:
+        (WebCore::CSSAnimationControllerPrivate::CSSAnimationControllerPrivate):
+        (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
+        (WebCore::CSSAnimationControllerPrivate::updateThrottlingState):
+        (WebCore::CSSAnimationControllerPrivate::animationInterval):
+        (WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
+        (WebCore::CSSAnimationControllerPrivate::beginAnimationUpdate):
+        (WebCore::CSSAnimationController::updateThrottlingState):
+        (WebCore::CSSAnimationController::animationInterval):
+        * page/animation/CSSAnimationController.h:
+        * page/animation/CSSAnimationControllerPrivate.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::animationsInterval):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
+2017-03-03  Matt Rajca  <mrajca@apple.com>
+
+        Media: notify clients when the user never plays a media element that was prevented from auto-playing
+        https://bugs.webkit.org/show_bug.cgi?id=169150
+
+        Reviewed by Alex Christensen.
+
+        Added API tests.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
+        (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
+        * page/AutoplayEvent.h:
+
+2017-03-06  Alex Christensen  <achristensen@webkit.org>
+
+        Refactor ContentExtensionParser
+        https://bugs.webkit.org/show_bug.cgi?id=169214
+
+        Reviewed by Brady Eidson.
+
+        No change in behavior, as verified by existing API tests.
+        This will make it easier to use getStringList for other things in coming patches.
+
+        * contentextensions/ContentExtensionParser.cpp:
+        (WebCore::ContentExtensions::getStringList):
+        (WebCore::ContentExtensions::getDomainList):
+
+2017-03-06  Alex Christensen  <achristensen@webkit.org>
+
+        Fix URLs relative to file URLs with paths beginning with Windows drive letters
+        https://bugs.webkit.org/show_bug.cgi?id=169178
+
+        Reviewed by Tim Horton.
+
+        Windows drives in file URLs can begin with windows drive letters, such as file:///C:/
+        which should not be removed when making other URLs relative to them.
+        See https://url.spec.whatwg.org/#file-slash-state
+
+        Covered by new API tests and newly passing web-platform-tests.
+
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::copyBaseWindowsDriveLetter):
+        (WebCore::URLParser::copyASCIIStringUntil):
+        (WebCore::URLParser::parse):
+        * platform/URLParser.h:
+
+2017-03-06  Simon Fraser  <simon.fraser@apple.com>
+
+        Only use layer backing store which supports subpixel antialiased text if we know subpixel antialiased will be painted into it
+        https://bugs.webkit.org/show_bug.cgi?id=169191
+
+        Reviewed by Zalan Bujtas.
+
+        Instead of unconditionally calling setSupportsSubpixelAntialiasedText() on GraphicsLayers created
+        by RenderLayerBacking, only do so when we know (or suspect) that a layer contains smoothed text.
+        
+        This is done by enhancing RenderLayer::isVisuallyNonEmpty() and RenderLayer::hasNonEmptyChildRenderers()
+        to take a PaintedContentRequest parameter, which allows the caller to specify what qualities of
+        the layer contents it is interested in. Most of the time, this is just any painted content, but on
+        platforms where GraphicsLayer::supportsSubpixelAntialiasedLayerText() returns true, the query also
+        asks about whether the layer will contain subpixel-antialiased text. In this case, it can't early
+        return as soon as painted content is found; it must keep iterating renderers while all the query 
+        requests are unsatisfied, or until it hits depth or sibling limits. If a limit is hit, we take the
+        same path of assuming there is subpixel-antialiased text (via the "Undetermined" state).
+
+        RenderLayerBacking also makes use of PaintedContentRequest during its non-composited child layer walk.
+
+        To offset the additional cost of this tree walking, RenderLayerBacking now caches information about its
+        painted content for the duration of a single update via PaintedContentsInfo, so we no longer call
+        isDirectlyCompositedImage() and isSimpleContainerCompositingLayer() multiple times per backing per update.
+        The traversal code here too now has to continue until all necessary states in the request have been computed.
+        
+        Add some functions to RenderImage so that we know if it's showing the alt text or has a non-bitmap image
+        (which may contain text).
+        
+        Subpixel-antialiased ("smoothed") text is disabled by DRT and WTR by default, so we need Internals API to enable it.
+        
+        Platforms now express their support for subpixel-antialiased text via GraphicsLayer::supportsSubpixelAntialiasedLayerText()
+        which only returns true on Mac.
+
+        Tests: compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style.html
+               compositing/contents-format/subpixel-antialiased-text-configs.html
+               compositing/contents-format/subpixel-antialiased-text-images.html
+               compositing/contents-format/subpixel-antialiased-text-visibility.html
+
+        * platform/graphics/GraphicsLayer.cpp:
+        (WebCore::GraphicsLayer::supportsSubpixelAntialiasedLayerText):
+        * platform/graphics/GraphicsLayer.h:
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayer::supportsSubpixelAntialiasedLayerText):
+        (WebCore::GraphicsLayerCA::changeLayerTypeTo):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::isShowingMissingOrImageError):
+        (WebCore::RenderImage::isShowingAltText):
+        (WebCore::RenderImage::hasNonBitmapImage):
+        * rendering/RenderImage.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects):
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::PaintedContentsInfo::PaintedContentsInfo):
+        (WebCore::PaintedContentsInfo::setWantsSubpixelAntialiasedTextState):
+        (WebCore::PaintedContentsInfo::paintsBoxDecorations):
+        (WebCore::PaintedContentsInfo::paintsContent):
+        (WebCore::PaintedContentsInfo::paintsSubpixelAntialiasedText):
+        (WebCore::PaintedContentsInfo::isSimpleContainer):
+        (WebCore::PaintedContentsInfo::isDirectlyCompositedImage):
+        (WebCore::PaintedContentsInfo::paintsBoxDecorationsDetermination):
+        (WebCore::PaintedContentsInfo::paintsContentDetermination):
+        (WebCore::PaintedContentsInfo::paintsSubpixelAntialiasedTextDetermination):
+        (WebCore::PaintedContentsInfo::contentsTypeDetermination):
+        (WebCore::RenderLayerBacking::createGraphicsLayer):
+        (WebCore::RenderLayerBacking::updateConfiguration):
+        (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
+        (WebCore::RenderLayerBacking::updateAfterDescendants):
+        (WebCore::RenderLayerBacking::updateDirectlyCompositedBoxDecorations):
+        (WebCore::RenderLayerBacking::updateDrawsContent):
+        (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
+        (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
+        (WebCore::RenderLayerBacking::paintsContent):
+        (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
+        (WebCore::RenderLayerBacking::isPaintDestinationForDescendantLayers):
+        (WebCore::RenderLayerBacking::hasVisibleNonCompositedDescendants):
+        (WebCore::RenderLayerBacking::containsPaintedContent):
+        (WebCore::RenderLayerBacking::contentChanged):
+        (WebCore::RenderLayerBacking::updateImageContents):
+        (WebCore::RenderLayerBacking::paintsChildRenderers): Deleted.
+        * rendering/RenderLayerBacking.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::logLayerInfo):
+        * testing/Internals.cpp:
+        (WebCore::Internals::setFontSmoothingEnabled):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
+2017-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Expand font-weight and font-stretch to take any number
+        https://bugs.webkit.org/show_bug.cgi?id=168889
+
+        Reviewed by Simon Fraser.
+
+        This patch expands parsing support for font-weight and font-stretch so that they can accept
+        numbers in addition to the keyword values they accepted previously. Eventually, these numbers
+        will be used as inputs to select variation fonts; however, in this patch, the values are just
+        parsed and held in our internal data model. This means that this patch doesn't actually change
+        the general behavior of WebKit; instead, it parses new values, outputs them (via
+        getComputedStyle() and similar functions), and provides them as input to our preexisting font
+        selection algorithm. 
+
+        This patch doesn't actually modify anything algorithmically, and therefore, it doesn't include
+        any additional tests for the font selection algorithm. Instead, it tests the parsing of the
+        newly accepted values (both input and output).
+
+        Because our internal data model needs to hold numbers now, this patch also completely eliminates
+        the FontWidth, FontItalic, and FontTraitsMask enum values in favor of FontSelectionValues (which
+        can hold numbers instead of individual enum values). Therefore, every place which we were using
+        these enum values is migrated in this patch to using FontSelectionValues instead.
+
+        Tests: fast/text/font-selection-font-face-parse.html
+               fast/text/font-selection-font-loading-api-parse.html
+               fast/text/font-style-parse.html
+               fast/text/font-weight-parse.html
+
+        * accessibility/AccessibilityRenderObject.cpp: Migrate off of old enum types.
+        (WebCore::AccessibilityRenderObject::hasBoldFont):
+        (WebCore::AccessibilityRenderObject::hasItalicFont):
+        (WebCore::AccessibilityRenderObject::hasPlainText):
+        * accessibility/atk/WebKitAccessibleInterfaceText.cpp: Ditto.
+        (getAttributeSetForAccessibilityObject):
+        * css/CSSComputedStyleDeclaration.cpp: Output newly parsed values.
+        (WebCore::fontWeightFromStyle):
+        (WebCore::fontStretchFromStyle):
+        (WebCore::fontStyleFromStyle):
+        (WebCore::fontShorthandValueForSelectionProperties):
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        * css/CSSFontFace.cpp: Migrate off old enum types.
+        (WebCore::calculateWeightRange):
+        (WebCore::CSSFontFace::setWeight):
+        (WebCore::calculateStretchRange):
+        (WebCore::CSSFontFace::setStretch):
+        (WebCore::calculateStyleRange):
+        (WebCore::CSSFontFace::setStyle):
+        (WebCore::CSSFontFace::calculateStyleMask): Deleted.
+        (WebCore::CSSFontFace::calculateWeightMask): Deleted.
+        (WebCore::CSSFontFace::calculateStretch): Deleted.
+        * css/CSSFontFace.h:
+        * css/CSSFontFaceSet.cpp: Migrate off old enum types.
+        (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
+        (WebCore::calculateWeightValue):
+        (WebCore::calculateStretchValue):
+        (WebCore::calculateStyleValue):
+        (WebCore::computeFontSelectionRequest):
+        (WebCore::CSSFontFaceSet::matchingFaces):
+        (WebCore::CSSFontFaceSet::fontFace):
+        (WebCore::computeFontTraitsMask): Deleted.
+        (WebCore::computeFontStretch): Deleted.
+        * css/CSSFontFaceSet.h:
+        * css/CSSFontSelector.cpp: Migrate off old enum types.
+        (WebCore::CSSFontSelector::fontRangesForFamily):
+        * css/CSSPrimitiveValueMappings.h: font-weight and font-style are no longer
+        keyword properties.
+        (WebCore::CSSPrimitiveValue::operator FontWeight): Deleted.
+        (WebCore::CSSPrimitiveValue::operator FontItalic): Deleted.
+        * css/CSSProperties.json: Use the same infrastructure for all three of the
+        font selection properties.
+        * css/CSSSegmentedFontFace.cpp: Migrate off old enum types.
+        (WebCore::CSSSegmentedFontFace::fontRanges):
+        * css/CSSValueKeywords.in: The 100-based font-weight values are now represented
+        as real numbers.
+        * css/FontFace.cpp: Update the string output functions for the new values.
+        (WebCore::rangeIsSingleValue):
+        (WebCore::FontFace::style):
+        (WebCore::FontFace::weight):
+        (WebCore::FontFace::stretch):
+        * css/StyleBuilderConverter.h: Use CSSValue conversion functions to convert
+        to our new data model.
+        (WebCore::StyleBuilderConverter::convertFontWeight):
+        (WebCore::StyleBuilderConverter::convertFontStretch):
+        (WebCore::StyleBuilderConverter::convertFontStyle):
+        * css/StyleBuilderCustom.h: font-weight is no longer a completely custom
+        property.
+        (WebCore::StyleBuilderCustom::applyInitialFontWeight): Deleted.
+        (WebCore::StyleBuilderCustom::applyInheritFontWeight): Deleted.
+        (WebCore::StyleBuilderCustom::applyValueFontWeight): Deleted.
+        * css/parser/CSSParserFastPaths.cpp: font-style is no longer a keyword property.
+        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
+        (WebCore::CSSParserFastPaths::isKeywordPropertyID):
+        * css/parser/CSSPropertyParser.cpp: Parse the new values in the font selection
+        properties.
+        (WebCore::consumeFontWeightKeywordValue):
+        (WebCore::consumeFontWeightCSS21):
+        (WebCore::consumeFontWeight):
+        (WebCore::consumeFontStyleKeywordValue):
+        (WebCore::consumeFontStyle):
+        (WebCore::CSSPropertyParser::parseSingleValue):
+        (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
+        (WebCore::CSSPropertyParser::consumeSystemFont):
+        (WebCore::CSSPropertyParser::consumeFont):
+        * editing/EditingStyle.cpp: Migrate off old enum types.
+        (WebCore::fontWeightIsBold):
+        * editing/mac/EditorMac.mm: Ditto.
+        (WebCore::Editor::applyFontStyles):
+        * platform/graphics/FontCache.h: Unify our font selection values into
+        their enclosing struct, FontSelectionCapabilities. Also, clean up utility
+        functions.
+        * platform/graphics/FontCascade.cpp: Migrate off old enum types.
+        (WebCore::FontCascade::FontCascade):
+        * platform/graphics/FontCascade.h: Ditto.
+        (WebCore::FontCascade::italic):
+        (WebCore::FontCascade::weight):
+        * platform/graphics/FontDescription.cpp: Ditto.
+        (WebCore::FontDescription::FontDescription):
+        (WebCore::FontCascadeDescription::lighterWeight):
+        (WebCore::FontCascadeDescription::bolderWeight):
+        (WebCore::FontDescription::traitsMask): Deleted.
+        * platform/graphics/FontDescription.h: Migrate off old enum types.
+        (WebCore::FontDescription::italic):
+        (WebCore::FontDescription::stretch):
+        (WebCore::FontDescription::weight):
+        (WebCore::FontDescription::fontSelectionRequest):
+        (WebCore::FontDescription::computedPixelSize):
+        (WebCore::FontDescription::setItalic):
+        (WebCore::FontDescription::setStretch):
+        (WebCore::FontDescription::setIsItalic):
+        (WebCore::FontDescription::setWeight):
+        (WebCore::FontDescription::operator==):
+        (WebCore::FontCascadeDescription::lighterWeight):
+        (WebCore::FontCascadeDescription::bolderWeight):
+        (WebCore::FontCascadeDescription::initialItalic):
+        (WebCore::FontCascadeDescription::initialWeight):
+        (WebCore::FontCascadeDescription::initialStretch):
+        * platform/graphics/FontSelectionAlgorithm.cpp: Delete code which was only
+        present to convert from the old enum types to the new FontSelectionRequest
+        type.
+        (WebCore::fontSelectionRequestForTraitsMask): Deleted.
+        (WebCore::initialFontSelectionCapabilitiesForTraitsMask): Deleted.
+        (WebCore::fontSelectionCapabilitiesForTraitsMask): Deleted.
+        * platform/graphics/FontSelectionAlgorithm.h: Migrate to new named functions
+        for special values.
+        (WebCore::isItalic):
+        (WebCore::boldWeightValue):
+        (WebCore::normalWeightValue):
+        (WebCore::isFontWeightBold):
+        (WebCore::normalStretchValue):
+        (WebCore::FontSelectionRequest::FontSelectionRequest):
+        * platform/graphics/cocoa/FontCacheCoreText.cpp: Migrate all platforms which
+        compile this file to know about FontDatabase. This simplifies the interaction
+        between @font-face fonts and installed fonts. Also, migrate off old enum types.
+        (WebCore::stretchFromCoreTextTraits):
+        (WebCore::fontWeightFromCoreText):
+        (WebCore::capabilitiesForFontDescriptor):
+        (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
+        (WebCore::platformFontLookupWithFamily):
+        (WebCore::invalidateFontCache):
+        (WebCore::fontWithFamily):
+        (WebCore::FontCache::createFontPlatformData):
+        (WebCore::lookupFallbackFont):
+        (WebCore::toTraitsMask): Deleted.
+        (WebCore::isFontWeightBold): Deleted.
+        (WebCore::toCoreTextFontWeight): Deleted.
+        (): Deleted.
+        (WebCore::FontDatabase::capabilitiesForFontDescriptor): Deleted.
+        (WebCore::calculateFontSelectionRequest): Deleted.
+        * platform/graphics/freetype/FontCacheFreeType.cpp: Migrate off old enum types.
+        (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
+        (WebCore::fontWeightToFontconfigWeight):
+        (): Deleted.
+        * platform/graphics/freetype/FontPlatformDataFreeType.cpp: Ditto.
+        (WebCore::FontPlatformData::FontPlatformData):
+        * platform/graphics/ios/FontCacheIOS.mm: Ditto.
+        (WebCore::baseSystemFontDescriptor):
+        (WebCore::systemFontModificationAttributes):
+        (WebCore::systemFontDescriptor):
+        (WebCore::platformFontWithFamilySpecialCase):
+        (WebCore::FontCache::weightOfCTFont): Deleted.
+        * platform/graphics/mac/FontCacheMac.mm: Ditto.
+        (WebCore::toNSFontWeight):
+        (WebCore::platformFontWithFamilySpecialCase):
+        * platform/graphics/win/FontCacheWin.cpp: Ditto.
+        (WebCore::toGDIFontWeight):
+        (WebCore::traitsInFamilyEnumProc):
+        (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
+        (): Deleted.
+        * platform/mock/MockRealtimeVideoSource.cpp: Ditto.
+        (WebCore::MockRealtimeVideoSource::applySize):
+        * platform/text/TextFlags.h: Delete old enum types.
+        * platform/win/DragImageWin.cpp: Migrate off old enum types.
+        (WebCore::dragLabelFont):
+        * rendering/RenderEmbeddedObject.cpp: Ditto.
+        (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
+        * rendering/RenderThemeGtk.cpp: Ditto.
+        (WebCore::RenderThemeGtk::updateCachedSystemFontDescription):
+        * rendering/RenderThemeIOS.mm: Ditto.
+        (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
+        * rendering/RenderThemeMac.mm: Ditto.
+        (WebCore::toFontWeight):
+        * rendering/RenderThemeWin.cpp: Ditto.
+        (WebCore::fillFontDescription):
+
+2017-03-06  Chris Dumez  <cdumez@apple.com>
+
+        [iOS] Disable autoplay of silent videos in low power mode
+        https://bugs.webkit.org/show_bug.cgi?id=168985
+        <rdar://problem/30739051>
+
+        Reviewed by Jer Noble.
+
+        Disable autoplay of silent videos in low power mode on iOS to save battery.
+        We force the display of the start button when denying autoplay in low power
+        mode to allow the user to start playback.
+
+        Test: media/modern-media-controls/start-support/start-support-lowPowerMode.html
+
+        * Modules/mediacontrols/MediaControlsHost.cpp:
+        (WebCore::MediaControlsHost::shouldForceControlsDisplay):
+        * Modules/mediacontrols/MediaControlsHost.h:
+        * Modules/mediacontrols/MediaControlsHost.idl:
+        Add shouldForceControlsDisplay property on MediaControlsHost. This property
+        is set to true when we want to force the display for media controls. Currently,
+        this only returns true for autoplay videos, while in low power mode.
+
+        * Modules/modern-media-controls/media/controls-visibility-support.js:
+        (ControlsVisibilitySupport.prototype._updateControls):
+        Take into consideration MediaControlsHost.shouldForceControlsDisplay when
+        initializing shouldShowControls variable.
+
+        * Modules/modern-media-controls/media/start-support.js:
+        (StartSupport.prototype._shouldShowStartButton):
+        Show the start button when MediaControlsHost.shouldForceControlsDisplay
+        returns true.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement):
+        Add MediaElementSession::RequireUserGestureForVideoDueToLowPowerMode restriction
+        to the session when low power mode is enabled so we know we need to force a
+        gesture to start playback of autoplay videos.
+
+        (WebCore::HTMLMediaElement::shouldForceControlsDisplay):
+        Add convenience function to decide if we should force display of media controls.
+        This returns true if the media element is a video with autoplay attribute and
+        its session has the MediaElementSession::RequireUserGestureForVideoDueToLowPowerMode
+        restriction (i.e. we are in low power mode).
+
+        (WebCore::HTMLMediaElement::configureMediaControls):
+        Force requireControls variable to true if shouldForceControlsDisplay() returns
+        true. We do this here instead of inside HTMLMediaElement::controls() because
+        we do not want to change the value of media.controls exposed to JavaScript.
+
+        (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
+        Add MediaElementSession::RequireUserGestureForVideoDueToLowPowerMode to the list
+        of restrictions that get removed on user gesture.
+
+        * html/MediaElementSession.cpp:
+        (WebCore::MediaElementSession::playbackPermitted):
+        Deny playback for videos that have the RequireUserGestureForVideoDueToLowPowerMode
+        restriction unless there is a user gesture.
+
+        * html/MediaElementSession.h:
+        Add new MediaElementSession::RequireUserGestureForVideoDueToLowPowerMode
+        restriction.
+
+2017-03-06  Chris Dumez  <cdumez@apple.com>
+
+        LayoutTest fast/dom/timer-throttling-hidden-page.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=168927
+
+        Reviewed by Simon Fraser.
+
+        Update internals.isTimerThrottled() to return true for any kind of throttling.
+        It used to only account only for specific timers that do not cause changes
+        inside the viewport. It now accounts for all kind of throttling, such as
+        timer alignment due to the page being hidden.
+
+        * page/DOMTimer.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::isTimerThrottled):
+
+2017-03-06  Dave Hyatt  <hyatt@apple.com>
+
+        Enable fieldsets to be flexboxes, grids and multicolumn.
+        https://bugs.webkit.org/show_bug.cgi?id=169082
+
+        Reviewed by Simon Fraser .
+
+        Added new tests in fast/forms/fieldset.
+
+        This patch eliminates RenderFieldset and moves the functionality into RenderBlock so that
+        derived classes can also be fieldsets.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        Remove RenderFieldset from the project.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::titleUIElement):
+        Call in to RenderBlock now instead of RenderFieldset.
+
+        * html/HTMLFieldSetElement.cpp:
+        (WebCore::HTMLFieldSetElement::createElementRenderer):
+        * html/HTMLFieldSetElement.h:
+        The fieldset DOM element now uses RenderElement::createFor to make renderers so that multiple display types
+        can be supported. A special flag has been added that indicates only to make flexbox and block-related
+        renderers (not table display types).
+
+        * rendering/OrderIterator.cpp:
+        (WebCore::OrderIterator::shouldSkipChild):
+        (WebCore::OrderIteratorPopulator::collectChild):
+        * rendering/OrderIterator.h:
+        Streamline child collection for flexboxes and grids to indicate whether the child should be skipped as a return
+        value from collectChild. Add a shouldSkipChild method that skips both out of flow positioned objects and
+        excluded children like the legends of fieldsets.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlockRareData::RenderBlockRareData):
+        When the legend is taller than the fieldset's borderBefore(), intrinsic border is added to the CSS border width.
+        This intrinsic border being factored in ensures that the padding and content boxes of fieldsets are correct
+        across any layout system, since the legend is now just treated as part of the border.
+
+        (WebCore::RenderBlock::computePreferredLogicalWidths):
+        (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
+        Call the new computePreferredWidthsForExcludedChildren to ensure that excluded children contribute to
+        preferred width in their own way and not as part of a specific layout system.
+
+        (WebCore::RenderBlock::renderName):
+        Hacked to still return RenderFieldSet for RenderBlockFlow-backed fieldsets for layout test compatibility.
+
+        (WebCore::RenderBlock::layoutExcludedChildren):
+        Renamed from layoutSpecialExcludedChild to more accurately reflect the fact that multiple excluded children
+        can be included here (e.g., both a multicolumn flow thread and a legend). The RenderBlock base class handles
+        the layout of legends by both placing them and setting the correct intrinsic border before amount on the
+        block.
+
+        (WebCore::RenderBlock::findFieldsetLegend):
+        Moved from RenderFieldset.
+
+        (WebCore::RenderBlock::adjustBorderBoxRectForPainting):
+        (WebCore::RenderBlock::paintRectToClipOutFromBorder):
+        These methods are used when painting to shrink the border box as needed to account for the legend and to
+        provide the portion of the border that needs to be clipped out. These methods have been enhanced to
+        properly support all writing modes.
+
+        (WebCore::RenderBlock::intrinsicBorderForFieldset):
+        (WebCore::RenderBlock::setIntrinsicBorderForFieldset):
+        (WebCore::RenderBlock::borderTop):
+        (WebCore::RenderBlock::borderLeft):
+        (WebCore::RenderBlock::borderBottom):
+        (WebCore::RenderBlock::borderRight):
+        (WebCore::RenderBlock::borderBefore):
+        These methods are overridden for border to ensure that the intrinsic border added by a tall legend is
+        properly factored in.
+
+        (WebCore::RenderBlock::computePreferredWidthsForExcludedChildren):
+        * rendering/RenderBlock.h:
+        This method computes the preferred widths for legend children in order to ensure that the legend properly
+        grows the width of the fieldset when it is the widest item.
+
+        (WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing):
+        (WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing):
+        Preserve the behavior of fieldsets in that the available content size includes the space lost accounting
+        for the legend. I don't think this makes much sense, but it matches the behavior of other browsers
+        (and our old behavior).
+
+        (WebCore::RenderBlock::paintExcludedChildrenInBorder):
+        Method for painting the excluded children that might be present in our border. We only do this if the
+        paint phase is a box decoration painting phase and if the legend isn't self-painting.
+
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::willCreateColumns):
+        Allow fieldsets to create columns now.
+
+        (WebCore::RenderBlockFlow::layoutBlockChildren):
+        (WebCore::RenderBlockFlow::layoutExcludedChildren):
+        Renamed this method and change it to call the base class to ensure that legends in multicolumn fieldsets
+        get handled properly.
+
+        (WebCore::RenderBlockFlow::addChild):
+        Patched to make sure legends don't get put into the multicolumn flow thread, as they need to
+        remain outside of it.
+
+        (WebCore::RenderBlockFlow::layoutSpecialExcludedChild): Deleted.
+        Renamed to layoutExcludedChildren.
+
+        * rendering/RenderBlockFlow.h:
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::paintBoxDecorations):
+        (WebCore::RenderBox::paintMask):
+        Patched to call the new adjustBorderBoxRectForPainting and paintRectToClipOutFromBorder methods in
+        order to properly shrink the border box rect for painting and to clip out the portion of the border
+        covered by the legend.
+
+        (WebCore::RenderBox::avoidsFloats):
+        Add fieldsets as avoiding floats. RenderFieldset used to subclass this method to return true, but with
+        its removal, we need to put this in the base class along with legends.
+
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::isGridItem):
+        (WebCore::RenderBox::isFlexItem):
+        Patched to exclude legends so that they don't try to size like they are really in the grid or flexbox.
+
+        (WebCore::RenderBox::adjustBorderBoxRectForPainting):
+        This method is overridden by RenderBLock to handle adjusting fieldset border rects for painting.
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintBorder):
+        * rendering/RenderBoxModelObject.h:
+        (WebCore::RenderBoxModelObject::paintRectToClipOutFromBorder):
+        Patched to properly paint fieldsets using the new helpers.
+
+        * rendering/RenderDeprecatedFlexibleBox.cpp:
+        (WebCore::FlexBoxIterator::next):
+        (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
+        (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
+        Make sure deprecated flexible boxes lay out their legends properly by calling layoutExcludedChildren.
+
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::createFor):
+        * rendering/RenderElement.h:
+        Patched to take a flag that limits what renderers can be created so that fieldsets don't make table
+        display types.
+
+        * rendering/RenderFieldset.cpp: Removed.
+        * rendering/RenderFieldset.h: Removed.
+        Remove RenderFieldset files from the tree.
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
+        (WebCore::RenderFlexibleBox::firstLineBaseline):
+        (WebCore::RenderFlexibleBox::layoutBlock):
+        (WebCore::RenderFlexibleBox::layoutFlexItems):
+        (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins):
+        Make sure flexible boxes lay out their legends properly by calling layoutExcludedChildren.
+        Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
+        part of the flexible box layout.
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::layoutBlock):
+        (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
+        (WebCore::RenderGrid::placeItemsOnGrid):
+        (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
+        (WebCore::RenderGrid::layoutGridItems):
+        Make sure grids lay out their legends properly by calling layoutExcludedChildren.
+        Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
+        part of the grid's layout.
+
+        * rendering/RenderMultiColumnFlowThread.cpp:
+        (WebCore::RenderMultiColumnFlowThread::populate):
+        Pull legends back up into the block and don't let them be part of the flow thread.
+
+        * rendering/RenderMultiColumnSet.cpp:
+        (WebCore::RenderMultiColumnSet::requiresBalancing):
+        Fix an assert to allow legends to exist as siblings of multicolumn sets.
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::isFieldset):
+        Changed to examine the HTML element rather than RenderFieldset.
+
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::isExcludedFromNormalLayout):
+        (WebCore::RenderObject::setIsExcludedFromNormalLayout):
+        (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
+        RenderObjects now have a new bit that is set for excluded objects like legends, flow threads,
+        placeholders, and ruby text. This bit lets code easily detect that an object is excluded from
+        the layout system and can be skipped.
+
+        (WebCore::RenderObject::isExcludedAndPlacedInBorder):
+        Helper method for asking if an object is painting inside the border. Used to know we
+        need to factor it into preferred width calculations outside of any one layout system
+        and also to know that we need to paint it when we paint the fieldset's border instead of
+        later (after we might have scrolled or clipped the child painting area).
+
+        * rendering/RenderRubyRun.cpp:
+        (WebCore::RenderRubyRun::layoutExcludedChildren):
+        (WebCore::RenderRubyRun::layoutSpecialExcludedChild): Deleted.
+        * rendering/RenderRubyRun.h:
+        Rename layoutSpecialExcludedChild to layoutExcludedChildren.
+
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::adjustBorderBoxRectForPainting):
+        (WebCore::RenderTable::paintBoxDecorations):
+        (WebCore::RenderTable::paintMask):
+        (WebCore::RenderTable::subtractCaptionRect): Deleted.
+        * rendering/RenderTable.h:
+        Patched tables to share the same border box rect adjustment used by fieldsets when subtracting
+        out captions. This is prep work to allow tables to be fieldsets, but for now I didn't go all the
+        way.
+
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::paintBoxDecorations):
+        (WebCore::RenderTableCell::paintMask):
+        Make sure table cells adjust their border box rects for painting. Again this is prep work for
+        cells potentially being fieldsets, but not supported yet.
+
+        * rendering/RenderTextControl.cpp:
+        (WebCore::RenderTextControl::layoutExcludedChildren):
+        (WebCore::RenderTextControl::layoutSpecialExcludedChild): Deleted.
+        * rendering/RenderTextControl.h:
+        * rendering/RenderTextControlMultiLine.cpp:
+        (WebCore::RenderTextControlMultiLine::layoutExcludedChildren):
+        (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): Deleted.
+        * rendering/RenderTextControlMultiLine.h:
+        Renamed the methods for doing the excluded child layout.
+
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::RenderTreeAsText::writeRenderObject):
+        Make sure to dump the original fieldset border and not the border with the extra legend stuff in it.
+
+2017-03-06  Antoine Quint  <graouts@apple.com>
+
+        [Modern Media Controls] Tracks panel should clip and scroll content when numerous tracks are available
+        https://bugs.webkit.org/show_bug.cgi?id=169201
+        <rdar://problem/30867979>
+
+        Reviewed by Eric Carlson.
+
+        We now position and size the tracks panel dynamically and ensure a max-height is applied
+        to the panel so that it allows a margin of 10px above it within the media controls. We also
+        apply that same max-height to a new intermediary scrollable container for the track lists,
+        so that it scrolls independently of the container and the background tint.
+
+        Test: media/modern-media-controls/tracks-panel/tracks-panel-position-and-size.html
+
+        * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
+        (MacOSFullscreenMediaControls.prototype.showTracksPanel): Deleted.
+        * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
+        (.media-controls.mac.inline .volume.slider):
+        (.media-controls.mac.inline .tracks-panel): Deleted.
+        * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
+        (MacOSInlineMediaControls.prototype.showTracksPanel): Deleted.
+        * Modules/modern-media-controls/controls/macos-media-controls.js:
+        (MacOSMediaControls.prototype.showTracksPanel):
+        * Modules/modern-media-controls/controls/tracks-panel.css:
+        (.tracks-panel > .background-tint > div,):
+        (.tracks-panel > .scrollable-container):
+        (.tracks-panel section):
+        (.tracks-panel section:first-of-type):
+        (.tracks-panel section > h3):
+        (.tracks-panel section > ul):
+        (.tracks-panel section > ul > li):
+        (.tracks-panel section > ul > li:focus):
+        (.tracks-panel section > ul > li.selected:before):
+        (.tracks-panel section > ul > li.animated):
+        (.tracks-panel > .background-tint > div): Deleted.
+        (.tracks-panel > section): Deleted.
+        (.tracks-panel > section:first-of-type): Deleted.
+        (.tracks-panel > section > h3): Deleted.
+        (.tracks-panel > section > ul): Deleted.
+        (.tracks-panel > section > ul > li): Deleted.
+        (.tracks-panel > section > ul > li:focus): Deleted.
+        (.tracks-panel > section > ul > li.selected:before): Deleted.
+        (.tracks-panel > section > ul > li.animated): Deleted.
+        * Modules/modern-media-controls/controls/tracks-panel.js:
+        (TracksPanel.prototype.presentInParent):
+        (TracksPanel.prototype.get maxHeight):
+        (TracksPanel.prototype.set maxHeight):
+        (TracksPanel.prototype.commitProperty):
+        (TracksPanel.prototype._childrenFromDataSource):
+
+2017-03-06  Manuel Rego Casasnovas  <rego@igalia.com>
+
+        [css-grid] Stretch should grow and shrink items to fit its grid area
+        https://bugs.webkit.org/show_bug.cgi?id=163200
+
+        Reviewed by Darin Adler.
+
+        After some discussions the CSS WG agreed that stretch should not only
+        grow items, but also shrink them to fit its grid area.
+        That way the "min-width|height: auto" is somehow ignored for grid items.
+        More info at: https://github.com/w3c/csswg-drafts/issues/283
+
+        The good part is that this allows us to remove some ugly code we've
+        in RenderBox that was only used by Grid Layout.
+
+        For images, we'll be stretching on both axis right now, so the aspect
+        ratio won't be preserved. The default behavior might change in those
+        cases, but that should be implemented in a different patch.
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeLogicalWidthInRegion):
+        (WebCore::RenderBox::computeLogicalHeight):
+
+2017-03-06  Miguel Gomez  <magomez@igalia.com>
+
+        [GTK] WebProcess from WebKitGtk+ 2.15.x SIGSEVs in GIFLZWContext::doLZW(unsigned char const*, unsigned long) at Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp:303
+        https://bugs.webkit.org/show_bug.cgi?id=167304
+
+        Reviewed by Carlos Garcia Campos.
+
+        Add a lock to ensure that the GIFImageReader that we are using for decoding is not deleted while
+        the decoding thread is using it.
+
+        No new tests.
+
+        * platform/image-decoders/gif/GIFImageDecoder.cpp:
+        (WebCore::GIFImageDecoder::clearFrameBufferCache):
+
+2017-03-06  Antti Koivisto  <antti@apple.com>
+
+        Allow render tree building before loading stylesheet elements
+        https://bugs.webkit.org/show_bug.cgi?id=169079
+        <rdar://problem/30865709>
+
+        Reviewed by Andreas Kling.
+
+        Currently we don't resolve style or construct renderers if there are any pending
+        stylesheet loads. This patch enables style and renderer constuction up to the
+        first encountered loading style element.
+
+        This is a step toward allowing incremental rendering for in-body stylesheets.
+
+        * dom/Document.cpp:
+        (WebCore::Document::needsStyleRecalc):
+
+            Ensure scrolling to anchor eventually happens.
+
+        * dom/Document.h:
+        (WebCore::Document::isIgnoringPendingStylesheets):
+        * dom/InlineStyleSheetOwner.cpp:
+        (WebCore::InlineStyleSheetOwner::createSheet):
+        (WebCore::InlineStyleSheetOwner::sheetLoaded):
+        (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
+        * dom/ProcessingInstruction.cpp:
+        (WebCore::ProcessingInstruction::checkStyleSheet):
+        (WebCore::ProcessingInstruction::sheetLoaded):
+        (WebCore::ProcessingInstruction::removedFrom):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::addPendingSheet):
+        (WebCore::HTMLLinkElement::removePendingSheet):
+        * style/StyleScope.cpp:
+        (WebCore::Style::Scope::addPendingSheet):
+        (WebCore::Style::Scope::removePendingSheet):
+
+            Track pending sheet nodes in a map so we can test if a given node has a pending sheet.
+            This is also more robust in general.
+
+        (WebCore::Style::Scope::hasProcessingInstructionWithPendingSheet):
+        (WebCore::Style::Scope::updateActiveStyleSheets):
+        * style/StyleScope.h:
+        (WebCore::Style::Scope::hasPendingSheet):
+        (WebCore::Style::Scope::hasPendingSheets):
+        (WebCore::Style::Scope::addPendingSheet): Deleted.
+        * style/StyleTreeResolver.cpp:
+        (WebCore::Style::TreeResolver::styleForElement):
+
+            Instead of global test for placeholder construction check the status of the pending sheet flag.
+
+        (WebCore::Style::hasLoadingStylesheet):
+        (WebCore::Style::TreeResolver::resolveComposedTree):
+
+            Set a flag when encountering a pending top level sheet during DOM traversal.
+
+        (WebCore::Style::TreeResolver::resolve):
+        * style/StyleTreeResolver.h:
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged):
+
+            Ensure SVG images have layout before getting the size.
+
+2017-03-06  Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
+
+        [GStreamer] Adopt nullptr
+        https://bugs.webkit.org/show_bug.cgi?id=123438
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        To adapt the code to the C++11 standard, all NULL or 0 pointers have been changed to nullptr.
+
+        * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
+        (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
+        * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
+        (WebCore::AudioFileReader::handleNewDeinterleavePad):
+        (WebCore::AudioFileReader::plugDeinterleave):
+        (WebCore::AudioFileReader::decodeAudioForBusCreation):
+        * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
+        (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
+        (WebCore::AudioSourceProviderGStreamer::configureAudioBin):
+        (WebCore::AudioSourceProviderGStreamer::setClient):
+        (WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad):
+        * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
+        (webkit_web_audio_src_init):
+        (webKitWebAudioSrcLoop):
+        (webKitWebAudioSrcChangeState):
+        * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
+        (WebCore::AudioTrackPrivateGStreamer::setEnabled):
+        * platform/graphics/gstreamer/GStreamerUtilities.cpp:
+        (WebCore::initializeGStreamer):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
+        (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
+        (WebCore::initializeGStreamerAndRegisterWebKitElements):
+        (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
+        (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
+        (WebCore::MediaPlayerPrivateGStreamer::newTextSample):
+        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
+        (WebCore::MediaPlayerPrivateGStreamer::processTableOfContents):
+        Removed the unused second argument on processTableOfContentsEntry function.
+        (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry):
+        Removed the unused second argument on this function.
+        (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
+        (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
+        (WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
+        (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+        Removed the unused second argument on processTableOfContentsEntry function.
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
+        (WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
+        (WebCore::MediaPlayerPrivateGStreamerBase::muted):
+        (WebCore::MediaPlayerPrivateGStreamerBase::notifyPlayerOfMute):
+        (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
+        (WebCore::MediaPlayerPrivateGStreamerBase::decodedFrameCount):
+        (WebCore::MediaPlayerPrivateGStreamerBase::droppedFrameCount):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerOwr::registerMediaEngine):
+        * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
+        (webkit_text_combiner_init):
+        (webkitTextCombinerPadEvent):
+        (webkitTextCombinerRequestNewPad):
+        (webkitTextCombinerNew):
+        * platform/graphics/gstreamer/TextSinkGStreamer.cpp:
+        (webkitTextSinkNew):
+        * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
+        (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
+        (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
+        * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
+        (webkit_video_sink_init):
+        (webkitVideoSinkProposeAllocation):
+        (webkitVideoSinkNew):
+        * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
+        (WebCore::VideoTrackPrivateGStreamer::setSelected):
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+        (webkit_web_src_init):
+        (webKitWebSrcDispose):
+        (webKitWebSrcSetProperty):
+        (webKitWebSrcStop):
+        (webKitWebSrcChangeState):
+        (webKitWebSrcQueryWithParent):
+        (webKitWebSrcGetProtocols):
+        (StreamingClient::handleResponseReceived):
+        (StreamingClient::handleDataReceived):
+        (ResourceHandleStreamingClient::didFail):
+        (ResourceHandleStreamingClient::wasBlocked):
+        (ResourceHandleStreamingClient::cannotShowURL):
+        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
+        (webKitMediaSrcGetProtocols):
+
+2017-03-06  Andreas Kling  <akling@apple.com>
+
+        [iOS] Report domains crashing under memory pressure via enhanced privacy logging.
+        <https://webkit.org/b/169133>
+        <rdar://problem/29964017>
+
+        Reviewed by Antti Koivisto.
+
+        * page/DiagnosticLoggingKeys.h:
+
+2017-03-05  Simon Fraser  <simon.fraser@apple.com>
+
+        Avoid backing store for layers with empty text nodes in a few more cases
+        https://bugs.webkit.org/show_bug.cgi?id=169185
+
+        Reviewed by Dan Bernstein.
+
+        In hasPaintingNonLayerDescendants() we can check whether the RenderText's linesBoundingBox()
+        is empty to avoid backing store in a few more cases. Also use containsOnlyWhitespace() rather
+        than isAllCollapsibleWhitespace(), because there's no need for backing store for non-selectable
+        whitespace text.
+
+        Covered by existing tests.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateClipRects):
+
+2017-03-05  Chris Dumez  <cdumez@apple.com>
+
+        Drop unnecessary backslash in ResourceResponse::sanitizeSuggestedFilename()
+        https://bugs.webkit.org/show_bug.cgi?id=169066
+
+        Reviewed by Sam Weinig.
+
+        Drop unnecessary backslash in ResourceResponse::sanitizeSuggestedFilename().
+
+        * platform/network/ResourceResponseBase.cpp:
+        (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
+
+2017-03-05  Chris Dumez  <cdumez@apple.com>
+
+        Using <form> in <template> causes following <form> to get swallowed
+        https://bugs.webkit.org/show_bug.cgi?id=163552
+
+        Reviewed by Sam Weinig.
+
+        As per the HTML specification [1], when finding a "form" tag in the "in body"
+        insertion mode, we should insert an HTML element for the token, and, if there
+        is no template element on the stack of open elements, set the form element
+        pointer to point to the element created.
+
+        We were missing the "if there is no template element on the stack of open
+        elements" check and setting the form element pointer unconditionally.
+        This patch fixes the issue.
+
+        [1] https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody:form-element-pointer-2
+
+        Test: fast/parser/form-after-template.html
+
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::HTMLConstructionSite::insertHTMLFormElement):
+
+2017-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Update CSSFontSelector's matching algorithm to understand ranges
+        https://bugs.webkit.org/show_bug.cgi?id=168892
+
+        Reviewed by Jon Lee.
+
+        This patch migrates the font selection algorithm out of FontCacheCoreText and into its own file which can be shared
+        among all ports. It then migrates our web font selection algorithm to use it.
+
+        This patch doesn't actually change the parsing rules; it just changes the internal machinery for how fonts get
+        selected. Therefore, this patch simply makes zero-length ranges from the discrete values the parser emits, and passes
+        those zero-length ranges to the range-based font selection routine. This means that this patch doesn't actually
+        change the results of the font selection algorithm.
+
+        One of the inputs to the new font selection algorithm is font-stretch, which previously was not parsed inside
+        @font-face blocks or the CSS Font Loading API. This patch therefore adds parsing support and modifies the existing
+        tests for these pieces to expect parsing to work. Because the font selection algorithm itself is shared between
+        installed fonts and webfonts, this patch doesn't add any additional tests for it (because it is already covered under
+        existing tests).
+
+        No new tests because there is no behavior change.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj: Add new file for the font selection algorithm.
+        * css/CSSFontFace.cpp:
+        (WebCore::CSSFontFace::calculateStretch): Used on @font-face blocks and the CSS Font Loading API.
+        (WebCore::CSSFontFace::setStretch): Fill out the previously stubbed function.
+        * css/CSSFontFace.h: Add the range member variable to CSSFontFaces.
+        * css/CSSFontFaceSet.cpp:
+        (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered): Now that we care about font-stretch, we need to
+        look it up for local fonts too. This current approach of an extra FontSelectionValue hanging around with a
+        FontTraitsMask is very ugly and will be removed soon (https://bugs.webkit.org/show_bug.cgi?id=168889 and
+        https://bugs.webkit.org/show_bug.cgi?id=168890).
+        (WebCore::computeFontStretch): Used on @font-face blocks and the CSS Font Loading API.
+        (WebCore::CSSFontFaceSet::matchingFaces): Educate about font-stretch.
+        (WebCore::CSSFontFaceSet::fontFace): Migrate to the new font-selection algorithm.
+        (WebCore::fontFaceComparator): Deleted.
+        * css/CSSFontFaceSet.h:
+        * css/CSSFontSelector.cpp:
+        (WebCore::CSSFontSelector::addFontFaceRule): Educate about font-stretch.
+        (WebCore::CSSFontSelector::fontRangesForFamily): Ditto.
+        * css/FontFace.cpp:
+        (WebCore::FontFace::setStretch): Ditto.
+        (WebCore::FontFace::stretch): Ditto.
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::CSSPropertyParser::parseFontFaceDescriptor): Ditto.
+        * platform/graphics/FontCache.h: Ditto.
+        * platform/graphics/FontDescription.h:
+        * platform/graphics/FontSelectionAlgorithm.cpp: Added.
+        (WebCore::FontSelectionAlgorithm::filterCapability):
+        (WebCore::FontSelectionAlgorithm::indexOfBestCapabilities):
+        (WebCore::fontSelectionRequestForTraitsMask):
+        (WebCore::initialFontSelectionCapabilitiesForTraitsMask):
+        (WebCore::fontSelectionCapabilitiesForTraitsMask):
+        * platform/graphics/FontSelectionAlgorithm.h: Added. Taken from FontCacheCoreText.cpp.
+        (WebCore::FontSelectionValue::FontSelectionValue):
+        (WebCore::FontSelectionValue::operator float):
+        (WebCore::FontSelectionValue::rawValue):
+        (WebCore::FontSelectionValue::maximumValue):
+        (WebCore::FontSelectionValue::minimumValue):
+        (WebCore::FontSelectionValue::operator+):
+        (WebCore::FontSelectionValue::operator-):
+        (WebCore::FontSelectionValue::operator*):
+        (WebCore::FontSelectionValue::operator/):
+        (WebCore::FontSelectionValue::operator==):
+        (WebCore::FontSelectionValue::operator!=):
+        (WebCore::FontSelectionValue::operator<):
+        (WebCore::FontSelectionValue::operator<=):
+        (WebCore::FontSelectionValue::operator>):
+        (WebCore::FontSelectionValue::operator>=):
+        (WebCore::FontSelectionRange::isValid):
+        (WebCore::FontSelectionRange::expand):
+        (WebCore::FontSelectionRange::includes):
+        (WebCore::FontSelectionRequest::operator==):
+        (WebCore::FontSelectionRequest::operator!=):
+        (WebCore::FontSelectionRequestKey::FontSelectionRequestKey):
+        (WebCore::FontSelectionRequestKey::isHashTableDeletedValue):
+        (WebCore::FontSelectionRequestKey::operator==):
+        (WebCore::FontSelectionRequestKeyHash::hash):
+        (WebCore::FontSelectionRequestKeyHash::equal):
+        (WebCore::FontSelectionCapabilities::expand):
+        (WebCore::FontSelectionAlgorithm::FontSelectionAlgorithm):
+        (WebCore::FontSelectionAlgorithm::iterateActiveCapabilitiesWithReturn):
+        (WebCore::FontSelectionAlgorithm::iterateActiveCapabilities):
+        * platform/graphics/cocoa/FontCacheCoreText.cpp: Moved to FontSelectionAlgorithm.
+        (WebCore::stretchFromCoreTextTraits):
+        (WebCore::FontDatabase::capabilitiesForFontDescriptor):
+        (WebCore::findClosestFont):
+        (WebCore::calculateFontSelectionRequest):
+        (WebCore::platformFontLookupWithFamily):
+        (WebCore::FontCache::getTraitsInFamily): Deleted.
+        (WebCore::iterateActiveFontsWithReturn): Deleted.
+        (WebCore::iterateActiveFonts): Deleted.
+        (WebCore::findClosestStretch): Deleted.
+        (WebCore::filterStretch): Deleted.
+        (WebCore::findClosestStyle): Deleted.
+        (WebCore::filterStyle): Deleted.
+        (WebCore::findClosestWeight): Deleted.
+        (WebCore::filterWeight): Deleted.
+        (WebCore::computeTargetWeight): Deleted.
+        * platform/text/TextFlags.h: Moved to FontSelectionAlgorithm.
+        (WebCore::FontSelectionValue::FontSelectionValue): Deleted.
+        (WebCore::FontSelectionValue::operator float): Deleted.
+        (WebCore::FontSelectionValue::operator+): Deleted.
+        (WebCore::FontSelectionValue::operator-): Deleted.
+        (WebCore::FontSelectionValue::operator*): Deleted.
+        (WebCore::FontSelectionValue::operator/): Deleted.
+        (WebCore::FontSelectionValue::operator==): Deleted.
+        (WebCore::FontSelectionValue::operator!=): Deleted.
+        (WebCore::FontSelectionValue::operator<): Deleted.
+        (WebCore::FontSelectionValue::operator<=): Deleted.
+        (WebCore::FontSelectionValue::operator>): Deleted.
+        (WebCore::FontSelectionValue::operator>=): Deleted.
+        (WebCore::FontSelectionValue::rawValue): Deleted.
+        (WebCore::FontSelectionValue::maximumValue): Deleted.
+        (WebCore::FontSelectionValue::minimumValue): Deleted.
+        (WebCore::FontSelectionRange::isValid): Deleted.
+        (WebCore::FontSelectionRange::expand): Deleted.
+        (WebCore::FontSelectionRange::includes): Deleted.
+        (WebCore::FontSelectionCapabilities::expand): Deleted.
+
+2017-03-05  Simon Fraser  <simon.fraser@apple.com>
+
+        Make some RenderLayer tree traversal in RenderLayerBacking more generic
+        https://bugs.webkit.org/show_bug.cgi?id=169177
+
+        Reviewed by Zalan Bujtas.
+
+        The real goal of this patch is reduce the number of callers of
+        RenderLayerBacking::isPaintDestinationForDescendantLayers() to one. To achieve that,
+        have the setContentsVisible() logic (which is really just about the CSS 'visibility' property)
+        do its own tree traversal which just consults layer.hasVisibleContent(). So
+        make descendantLayerPaintsIntoAncestor() a generic traversal function which walks
+        descendant layers which may paint into the target layer. The "Visible" in the name
+        reflects the fact that it can bypass a subtree for a layer with !hasVisibleDescendant().
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateAfterDescendants):
+        (WebCore::traverseVisibleNonCompositedDescendantLayers):
+        (WebCore::RenderLayerBacking::isPaintDestinationForDescendantLayers):
+        (WebCore::RenderLayerBacking::hasVisibleNonCompositedDescendants):
+        (WebCore::descendantLayerPaintsIntoAncestor): Deleted.
+        * rendering/RenderLayerBacking.h:
+
+2017-03-04  Simon Fraser  <simon.fraser@apple.com>
+
+        Clarify some terminology in RenderLayerBacking
+        https://bugs.webkit.org/show_bug.cgi?id=169174
+
+        Reviewed by Zalan Bujtas.
+
+        Rename some functions related to directly-composited background images and
+        box decorations for clarify.
+
+        Only behavior change is for canDirectlyCompositeBackgroundBackgroundImage() to check
+        GraphicsLayer::supportsContentsTiling(), which means that RenderLayerBacking::contentChanged()
+        will no longer trigger a updateGeometry() when it gets BackgroundImageChanged on non-
+        CoordinateGraphics platforms.
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateConfiguration):
+        (WebCore::RenderLayerBacking::updateAfterDescendants):
+        (WebCore::RenderLayerBacking::updateDirectlyCompositedBoxDecorations):
+        (WebCore::canDirectlyCompositeBackgroundBackgroundImage):
+        (WebCore::hasPaintedBoxDecorationsOrBackgroundImage):
+        (WebCore::supportsDirectlyCompositedBoxDecorations):
+        (WebCore::RenderLayerBacking::paintsBoxDecorations):
+        (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
+        (WebCore::RenderLayerBacking::contentChanged):
+        (WebCore::RenderLayerBacking::updateDirectlyCompositedContents): Deleted.
+        (WebCore::canCreateTiledImage): Deleted.
+        (WebCore::hasVisibleBoxDecorationsOrBackgroundImage): Deleted.
+        (WebCore::supportsDirectBoxDecorationsComposition): Deleted.
+        * rendering/RenderLayerBacking.h:
+
+2017-03-04  Alex Christensen  <achristensen@webkit.org>
+
+        Cleanup after r213418
+        https://bugs.webkit.org/show_bug.cgi?id=169165
+
+        Reviewed by Youenn Fablet.
+
+        * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
+        (WebCore::RealtimeIncomingAudioSource::OnData):
+        Restore the assertion I removed.
+
+2017-03-04  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r213379.
+        https://bugs.webkit.org/show_bug.cgi?id=169169
+
+        broke GTK+ and Windows builds (Requested by mcatanzaro on
+        #webkit).
+
+        Reverted changeset:
+
+        "Enable fieldsets to be flexboxes, grids and multicolumn."
+        https://bugs.webkit.org/show_bug.cgi?id=169082
+        http://trac.webkit.org/changeset/213379
+
+2017-03-03  Youenn Fablet  <youenn@apple.com>
+
+        [WebRTC] Update libwebrtc source code
+        https://bugs.webkit.org/show_bug.cgi?id=168599
+
+        Reviewed by Alex Christensen.
+
+        * Modules/mediastream/RTCStatsReport.h:
+        * Modules/mediastream/RTCStatsReport.idl:
+        Update to match the latest spec, which matches the new structures in libwebrtc.
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        (WebCore::fillRTCRTPStreamStats):
+        (WebCore::fillOutboundRTPStreamStats):
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
+        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
+        * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
+        (WebCore::RealtimeIncomingAudioSource::OnData):
+        Comment out an assertion that was failing.  We should revisit this.
+        * testing/MockLibWebRTCPeerConnection.h:
+
+2017-03-03  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r213400.
+        https://bugs.webkit.org/show_bug.cgi?id=169163
+
+        Caused frequent assertion failures (Requested by ap on
+        #webkit).
+
+        Reverted changeset:
+
+        "[Modern Media Controls] Improve media documents across macOS,
+        iPhone and iPad"
+        https://bugs.webkit.org/show_bug.cgi?id=169145
+        http://trac.webkit.org/changeset/213400
+
+2017-03-03  Andy Estes  <aestes@apple.com>
+
+        Add support for canvas.toBlob
+        https://bugs.webkit.org/show_bug.cgi?id=148878
+
+        Reviewed by Tim Horton.
+
+        Address additional review feedback received after r213412 landed.
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::toBlob): Passed null to the blob callback if blob conversion
+        fails for any reason.
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::cgImage): Removed an unnecessary local variable.
+
+2017-03-03  Andy Estes  <aestes@apple.com>
+
+        Add support for canvas.toBlob
+        https://bugs.webkit.org/show_bug.cgi?id=148878
+        <rdar://problem/22590406>
+
+        Reviewed by Tim Horton.
+
+        These tests now pass:
+        imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
+        imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.png.html
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * fileapi/BlobCallback.cpp: Added.
+        (WebCore::BlobCallback::scheduleCallback):
+        * fileapi/BlobCallback.h: Added.
+        (WebCore::BlobCallback::~BlobCallback):
+        * fileapi/BlobCallback.idl: Added.
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::toBlob):
+        * html/HTMLCanvasElement.h:
+        * html/HTMLCanvasElement.idl:
+        * platform/graphics/ImageBuffer.h:
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        (WebCore::writeFunction):
+        (WebCore::encodeImage):
+        (WebCore::ImageBuffer::toDataURL):
+        (WebCore::ImageBuffer::toData):
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::data):
+        (WebCore::ImageBuffer::toDataURL):
+        (WebCore::ImageBuffer::toData):
+        (WebCore::ImageBuffer::toCGImage):
+        (WebCore::cgImage):
+        (WebCore::dataURL):
+        * platform/graphics/gtk/ImageBufferGtk.cpp:
+        (WebCore::ImageBuffer::toDataURL):
+        (WebCore::ImageBuffer::toData):
+        * platform/graphics/win/ImageBufferDirect2D.cpp:
+        (WebCore::ImageBuffer::toData):
+
+2017-03-03  Dean Jackson  <dino@apple.com>
+
+        Add WebGPU compile flag and experimental feature flag
+        https://bugs.webkit.org/show_bug.cgi?id=169161
+        <rdar://problem/30846689>
+
+        Reviewed by Tim Horton.
+
+        Add ENABLE_WEBGPU, an experimental feature flag, a RuntimeEnabledFeature,
+        and an InternalSetting.
+
+        * Configurations/FeatureDefines.xcconfig:
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setWebGPUEnabled):
+        (WebCore::RuntimeEnabledFeatures::webGPUEnabled):
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::Backup::Backup):
+        (WebCore::InternalSettings::Backup::restoreTo):
+        (WebCore::InternalSettings::setWebGPUEnabled):
+        * testing/InternalSettings.h:
+        * testing/InternalSettings.idl:
+
+2017-03-03  Simon Fraser  <simon.fraser@apple.com>
+
+        Clean up some RenderLayerBacking code
+        https://bugs.webkit.org/show_bug.cgi?id=169160
+
+        Reviewed by Dean Jackson.
+
+        Modern loops in descendantLayerPaintsIntoAncestor().
+
+        Rename RenderLayerBacking::paintsChildren() to RenderLayerBacking::paintsChildRenderers() to clarify that
+        it refers to renderers, not RenderLayers.
+
+        Rename RenderLayerBacking::paintsNonDirectCompositedBoxDecoration() to RenderLayerBacking::paintsBoxDecorations().
+        "Paints" already implies non-composited.
+
+        No behavior change.
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateDrawsContent):
+        (WebCore::RenderLayerBacking::paintsBoxDecorations):
+        (WebCore::RenderLayerBacking::paintsChildRenderers):
+        (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
+        (WebCore::descendantLayerPaintsIntoAncestor):
+        (WebCore::RenderLayerBacking::paintsNonDirectCompositedBoxDecoration): Deleted.
+        (WebCore::RenderLayerBacking::paintsChildren): Deleted.
+        * rendering/RenderLayerBacking.h:
+
+2017-03-03  Simon Fraser  <simon.fraser@apple.com>
+
+        Clean up RenderImage and a RenderImageResource function
+        https://bugs.webkit.org/show_bug.cgi?id=169153
+
+        Reviewed by Zalan Bujtas.
+        
+        Change all calls to imageResource().cachedImage() in RenderImage to use the inline
+        cachedImage() function.
+
+        In RenderImage::paintReplaced(), early return after the broken image block (and no need
+        to test imageResource().hasImage() again in the second condition). Convert height/width to size,
+        which also forces us to be explicit about using flooredIntSize() when fetching the image
+        (perhaps this should be a roundedIntSize, but I didn't want to change behavior).
+
+        Change RenderImageResource::image() to take an IntSize, rather than int height and width.
+
+        No behavior change.
+
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::styleDidChange):
+        (WebCore::RenderImage::imageChanged):
+        (WebCore::RenderImage::notifyFinished):
+        (WebCore::RenderImage::paintReplaced):
+        (WebCore::RenderImage::paintIntoRect):
+        (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
+        (WebCore::RenderImage::embeddedContentBox):
+        * rendering/RenderImageResource.cpp:
+        (WebCore::RenderImageResource::image):
+        * rendering/RenderImageResource.h:
+        (WebCore::RenderImageResource::image):
+        * rendering/RenderImageResourceStyleImage.cpp:
+        (WebCore::RenderImageResourceStyleImage::image):
+        * rendering/RenderImageResourceStyleImage.h:
+
+2017-03-03  Antoine Quint  <graouts@apple.com>
+
+        [Modern Media Controls] Improve media documents across macOS, iPhone and iPad
+        https://bugs.webkit.org/show_bug.cgi?id=169145
+        <rdar://problem/17048858>
+
+        Reviewed by Dean Jackson.
+
+        There were a variety of issues with media documents, some longstanding, and some specifically
+        about modern media controls.
+
+        One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
+        due to using a <video> element to load the audio file. We now have additional logic in MediaController
+        to identify if the loaded media is really an audio file, and using this information to hide the
+        fullscreen and picture-in-picture buttons.
+
+        Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
+        controls when we could have the modern-media-controls module injected CSS handle this styling. We now
+        use the injected style in the shadow root to size media documents based on the device characteristics
+        and ensuring that page styles are overridden.
+
+        We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
+        attribute and not a <source> element.
+
+        Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
+        a media document to hide the controls while we determine the type of media we're loading (audio vs.
+        video) in order to apply the appropriate styling without flashes.
+
+        As a result of the new styles applied by the modern-media-controls module, media documents have a
+        similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
+        to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
+        we want to always play the media at full width, with some padding in the case of audio.
+
+        Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
+               media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
+               media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
+               media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
+               media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
+               media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
+               media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
+               media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html
+
+        * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
+        (:host(audio) .media-controls.ios.inline > .controls-bar:before,):
+        (:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
+        * Modules/modern-media-controls/controls/macos-media-controls.css:
+        (:host(audio) .media-controls.mac.inline > .controls-bar,):
+        (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
+        (:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
+        (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
+        * Modules/modern-media-controls/controls/media-document.css: Added.
+        (:host(.media-document)):
+        (:host(.media-document.ready)):
+        (:host(.media-document.audio.mac)):
+        (:host(.media-document.audio.ipad)):
+        (:host(.media-document.audio.iphone)):
+        (:host(.media-document.video.mac)):
+        (:host(.media-document.video.ipad)):
+        (:host(.media-document.video.iphone)):
+        * Modules/modern-media-controls/js-files:
+        * Modules/modern-media-controls/media/fullscreen-support.js:
+        (FullscreenSupport.prototype.syncControl):
+        (FullscreenSupport):
+        * Modules/modern-media-controls/media/media-controller.js:
+        (MediaController):
+        (MediaController.prototype.get isAudio):
+        * Modules/modern-media-controls/media/media-document-controller.js: Added.
+        (MediaDocumentController):
+        (MediaDocumentController.prototype.handleEvent):
+        (MediaDocumentController.prototype._mediaDocumentHasMetadata):
+        (MediaDocumentController.prototype._mediaDocumentHasSize):
+        * Modules/modern-media-controls/media/pip-support.js:
+        (PiPSupport.prototype.syncControl):
+        (PiPSupport):
+        * html/MediaDocument.cpp:
+        (WebCore::MediaDocumentParser::createDocumentStructure):
+
+2017-03-03  Chris Dumez  <cdumez@apple.com>
+
+        [iOS] Throttle SVG SMIL animations to 30fps in low power mode
+        https://bugs.webkit.org/show_bug.cgi?id=169137
+        <rdar://problem/30833754>
+
+        Reviewed by Simon Fraser.
+
+        Throttle SVG SMIL animations to 30fps in low power mode on iOS to save
+        battery.
+
+        Test: svg/animations/animations-lowPowerMode-throttling.html
+
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::SVGSVGElement):
+        * svg/SVGSVGElement.idl:
+        * svg/animation/SMILTime.h:
+        (WebCore::SMILTime::SMILTime):
+        * svg/animation/SMILTimeContainer.cpp:
+        (WebCore::SMILTimeContainer::SMILTimeContainer):
+        (WebCore::SMILTimeContainer::animationFrameDelay):
+        (WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
+        (WebCore::SMILTimeContainer::updateAnimations):
+        * svg/animation/SMILTimeContainer.h:
+        * svg/animation/SVGSMILElement.cpp:
+        (WebCore::SVGSMILElement::calculateNextProgressTime):
+        * testing/Internals.cpp:
+        (WebCore::Internals::svgAnimationsInterval):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
+2017-03-03  Joseph Pecoraro  <pecoraro@apple.com>
+
+        [Mac] WebCore.framework is missing a symlink from Frameworks to Versions/Current/Frameworks when the latter exists
+        https://bugs.webkit.org/show_bug.cgi?id=169067
+
+        Reviewed by Dan Bernstein.
+
+        * WebCore.xcodeproj/project.pbxproj:
+
+2017-03-03  Sam Weinig  <sam@webkit.org>
+
+        REGRESSION (r209760): Apple Pay doesn't work on casper.com, shopspring.com, maybe other sites
+        <rdar://problem/30313445>
+        https://bugs.webkit.org/show_bug.cgi?id=169149
+
+        Reviewed by Simon Fraser.
+
+        Relax restriction that the ApplePayShippingMethod sequence must not be empty. This
+        was incorrect.
+
+        * Modules/applepay/ApplePaySession.cpp:
+        (WebCore::convertAndValidate):
+
+2017-03-03  Alex Christensen  <achristensen@webkit.org>
+
+        [URLParser] Fix file: as a relative file URL
+        https://bugs.webkit.org/show_bug.cgi?id=169122
+
+        Reviewed by Tim Horton.
+
+        This is clearly defined in https://url.spec.whatwg.org/#file-state with the EOF code point.
+        I got it wrong and didn't test it.  It's been added to the web platform tests since we last updated.
+
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::parse):
+
+2017-03-03  Dave Hyatt  <hyatt@apple.com>
+
+        Enable fieldsets to be flexboxes, grids and multicolumn.
+        https://bugs.webkit.org/show_bug.cgi?id=169082
+
+        Reviewed by Simon Fraser.
+
+        Added new tests in fast/forms/fieldset.
+
+        This patch eliminates RenderFieldset and moves the functionality into RenderBlock so that
+        derived classes can also be fieldsets.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        Remove RenderFieldset from the project.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::titleUIElement):
+        Call in to RenderBlock now instead of RenderFieldset.
+
+        * html/HTMLFieldSetElement.cpp:
+        (WebCore::HTMLFieldSetElement::createElementRenderer):
+        * html/HTMLFieldSetElement.h:
+        The fieldset DOM element now uses RenderElement::createFor to make renderers so that multiple display types
+        can be supported. A special flag has been added that indicates only to make flexbox and block-related
+        renderers (not table display types).
+
+        * rendering/OrderIterator.cpp:
+        (WebCore::OrderIterator::shouldSkipChild):
+        (WebCore::OrderIteratorPopulator::collectChild):
+        * rendering/OrderIterator.h:
+        Streamline child collection for flexboxes and grids to indicate whether the child should be skipped as a return
+        value from collectChild. Add a shouldSkipChild method that skips both out of flow positioned objects and
+        excluded children like the legends of fieldsets.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlockRareData::RenderBlockRareData):
+        When the legend is taller than the fieldset's borderBefore(), intrinsic border is added to the CSS border width.
+        This intrinsic border being factored in ensures that the padding and content boxes of fieldsets are correct
+        across any layout system, since the legend is now just treated as part of the border.
+
+        (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
+        Call the new computePreferredWidthsForExcludedChildren to ensure that excluded children contribute to
+        preferred width in their own way and not as part of a specific layout system.
+
+        (WebCore::RenderBlock::renderName):
+        Hacked to still return RenderFieldSet for RenderBlockFlow-backed fieldsets for layout test compatibility.
+
+        (WebCore::RenderBlock::layoutExcludedChildren):
+        Renamed from layoutSpecialExcludedChild to more accurately reflect the fact that multiple excluded children
+        can be included here (e.g., both a multicolumn flow thread and a legend). The RenderBlock base class handles
+        the layout of legends by both placing them and setting the correct intrinsic border before amount on the
+        block.
+
+        (WebCore::RenderBlock::findFieldsetLegend):
+        Moved from RenderFieldset.
+
+        (WebCore::RenderBlock::adjustBorderBoxRectForPainting):
+        (WebCore::RenderBlock::paintRectToClipOutFromBorder):
+        These methods are used when painting to shrink the border box as needed to account for the legend and to
+        provide the portion of the border that needs to be clipped out. These methods have been enhanced to
+        properly support all writing modes.
+
+        (WebCore::RenderBlock::intrinsicBorderForFieldset):
+        (WebCore::RenderBlock::setIntrinsicBorderForFieldset):
+        (WebCore::RenderBlock::borderTop):
+        (WebCore::RenderBlock::borderLeft):
+        (WebCore::RenderBlock::borderBottom):
+        (WebCore::RenderBlock::borderRight):
+        (WebCore::RenderBlock::borderBefore):
+        These methods are overridden for border to ensure that the intrinsic border added by a tall legend is
+        properly factored in.
+
+        (WebCore::RenderBlock::computePreferredWidthsForExcludedChildren):
+        * rendering/RenderBlock.h:
+        This method computes the preferred widths for legend children in order to ensure that the legend properly
+        grows the width of the fieldset when it is the widest item.
+
+        (WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing):
+        (WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing):
+        Preserve the behavior of fieldsets in that the available content size includes the space lost accounting
+        for the legend. I don't think this makes much sense, but it matches the behavior of other browsers
+        (and our old behavior).
+
+        (WebCore::RenderBlock::paintExcludedChildrenInBorder):
+        Method for painting the excluded children that might be present in our border. We only do this if the
+        paint phase is a box decoration painting phase and if the legend isn't self-painting.
+
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::willCreateColumns):
+        Allow fieldsets to create columns now.
+
+        (WebCore::RenderBlockFlow::layoutBlockChildren):
+        (WebCore::RenderBlockFlow::layoutExcludedChildren):
+        Renamed this method and change it to call the base class to ensure that legends in multicolumn fieldsets
+        get handled properly.
+
+        (WebCore::RenderBlockFlow::addChild):
+        Patched to make sure legends don't get put into the multicolumn flow thread, as they need to
+        remain outside of it.
+
+        (WebCore::RenderBlockFlow::layoutSpecialExcludedChild): Deleted.
+        Renamed to layoutExcludedChildren.
+
+        * rendering/RenderBlockFlow.h:
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::paintBoxDecorations):
+        (WebCore::RenderBox::paintMask):
+        Patched to call the new adjustBorderBoxRectForPainting and paintRectToClipOutFromBorder methods in
+        order to properly shrink the border box rect for painting and to clip out the portion of the border
+        covered by the legend.
+
+        (WebCore::RenderBox::avoidsFloats):
+        Add fieldsets as avoiding floats. RenderFieldset used to subclass this method to return true, but with
+        its removal, we need to put this in the base class along with legends.
+
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::isGridItem):
+        (WebCore::RenderBox::isFlexItem):
+        Patched to exclude legends so that they don't try to size like they are really in the grid or flexbox.
+
+        (WebCore::RenderBox::adjustBorderBoxRectForPainting):
+        This method is overridden by RenderBLock to handle adjusting fieldset border rects for painting.
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintBorder):
+        * rendering/RenderBoxModelObject.h:
+        (WebCore::RenderBoxModelObject::paintRectToClipOutFromBorder):
+        Patched to properly paint fieldsets using the new helpers.
+
+        * rendering/RenderDeprecatedFlexibleBox.cpp:
+        (WebCore::FlexBoxIterator::next):
+        (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
+        (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
+        Make sure deprecated flexible boxes lay out their legends properly by calling layoutExcludedChildren.
+
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::createFor):
+        * rendering/RenderElement.h:
+        Patched to take a flag that limits what renderers can be created so that fieldsets don't make table
+        display types.
+
+        * rendering/RenderFieldset.cpp: Removed.
+        * rendering/RenderFieldset.h: Removed.
+        Remove RenderFieldset files from the tree.
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
+        (WebCore::RenderFlexibleBox::firstLineBaseline):
+        (WebCore::RenderFlexibleBox::layoutBlock):
+        (WebCore::RenderFlexibleBox::layoutFlexItems):
+        (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins):
+        Make sure flexible boxes lay out their legends properly by calling layoutExcludedChildren.
+        Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
+        part of the flexible box layout.
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::layoutBlock):
+        (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
+        (WebCore::RenderGrid::placeItemsOnGrid):
+        (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
+        (WebCore::RenderGrid::layoutGridItems):
+        Make sure grids lay out their legends properly by calling layoutExcludedChildren.
+        Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
+        part of the grid's layout.
+
+        * rendering/RenderMultiColumnFlowThread.cpp:
+        (WebCore::RenderMultiColumnFlowThread::populate):
+        Pull legends back up into the block and don't let them be part of the flow thread.
+
+        * rendering/RenderMultiColumnSet.cpp:
+        (WebCore::RenderMultiColumnSet::requiresBalancing):
+        Fix an assert to allow legends to exist as siblings of multicolumn sets.
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::isFieldset):
+        Changed to examine the HTML element rather than RenderFieldset.
+
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::isExcludedFromNormalLayout):
+        (WebCore::RenderObject::setIsExcludedFromNormalLayout):
+        (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
+        RenderObjects now have a new bit that is set for excluded objects like legends, flow threads,
+        placeholders, and ruby text. This bit lets code easily detect that an object is excluded from
+        the layout system and can be skipped.
+
+        (WebCore::RenderObject::isExcludedAndPlacedInBorder):
+        Helper method for asking if an object is painting inside the border. Used to know we
+        need to factor it into preferred width calculations outside of any one layout system
+        and also to know that we need to paint it when we paint the fieldset's border instead of
+        later (after we might have scrolled or clipped the child painting area).
+
+        * rendering/RenderRubyRun.cpp:
+        (WebCore::RenderRubyRun::layoutExcludedChildren):
+        (WebCore::RenderRubyRun::layoutSpecialExcludedChild): Deleted.
+        * rendering/RenderRubyRun.h:
+        Rename layoutSpecialExcludedChild to layoutExcludedChildren.
+
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::adjustBorderBoxRectForPainting):
+        (WebCore::RenderTable::paintBoxDecorations):
+        (WebCore::RenderTable::paintMask):
+        (WebCore::RenderTable::subtractCaptionRect): Deleted.
+        * rendering/RenderTable.h:
+        Patched tables to share the same border box rect adjustment used by fieldsets when subtracting
+        out captions. This is prep work to allow tables to be fieldsets, but for now I didn't go all the
+        way.
+
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::paintBoxDecorations):
+        (WebCore::RenderTableCell::paintMask):
+        Make sure table cells adjust their border box rects for painting. Again this is prep work for
+        cells potentially being fieldsets, but not supported yet.
+
+        * rendering/RenderTextControl.cpp:
+        (WebCore::RenderTextControl::layoutExcludedChildren):
+        (WebCore::RenderTextControl::layoutSpecialExcludedChild): Deleted.
+        * rendering/RenderTextControl.h:
+        * rendering/RenderTextControlMultiLine.cpp:
+        (WebCore::RenderTextControlMultiLine::layoutExcludedChildren):
+        (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): Deleted.
+        * rendering/RenderTextControlMultiLine.h:
+        Renamed the methods for doing the excluded child layout.
+
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::RenderTreeAsText::writeRenderObject):
+        Make sure to dump the original fieldset border and not the border with the extra legend stuff in it.
+
+2017-03-03  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r213344.
+
+        This changed caused LayoutTest crashes under GuardMalloc.
+
+        Reverted changeset:
+
+        "Add support for canvas.toBlob"
+        https://bugs.webkit.org/show_bug.cgi?id=148878
+        http://trac.webkit.org/changeset/213344
+
 2017-03-03  Konstantin Tokarev  <annulen@yandex.ru>
 
         Unreviewed typo fix