2019-02-15 Ryosuke Niwa Crash in the hit testing code via HTMLPlugInElement::isReplacementObscured() https://bugs.webkit.org/show_bug.cgi?id=194691 Reviewed by Simon Fraser. The crash was caused by HTMLPlugInElement::isReplacementObscured updating the document without updating the layout of ancestor documents (i.e. documents in which frame owner elements appear) even though it hit-tests against the top-level document's RenderView. Fixed the bug by updating the layout of the top-level document as needed. Test: plugins/unsupported-plugin-with-replacement-in-iframe-crash.html * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::isReplacementObscured): 2019-02-13 Ryosuke Niwa Crash in DOMTimer::fired https://bugs.webkit.org/show_bug.cgi?id=194638 Reviewed by Brent Fulgham. This patch continues the saga of hunting down timer related crashes after r239814, r225985, r227934. The crash was caused by the bug that we don't remove a DOMTimer from NestedTimersMap if a DOMTimer is created & installed inside another DOMTimer's callback (via execute call in DOMTimer::fired). Fixed the crash by using a Ref in NestedTimersMap. This will keep the timer alive until we exit from DOMTimer::fired. Because DOMTimer::fired always calls stopTracking() which clears the map we would not leak these DOM timers. We could, alternatively, use WeakPtr in NestedTimersMap but that would unnecessarily increase the size of DOMTimer for a very marginal benefit of DOMTimer objcets being deleted slightly earlier. Deleting itself in DOMTimer's destructor involves more logic & house keeping in the timer code, and is no longer the preferred approach when dealing with these classes of bugs in WebKit. Test: fast/dom/timer-destruction-during-firing.html * page/DOMTimer.cpp: (WebCore::NestedTimersMap::add): (WebCore::DOMTimer::install): (WebCore::DOMTimer::fired): 2018-01-31 Ryosuke Niwa Add a release assertion to ensure timers are deleted in the right thread https://bugs.webkit.org/show_bug.cgi?id=182351 Reviewed by David Kilzer. Added a relese assertion in ~TimerBase that the current thread is the one in which the timer was created. We use canAccessThreadLocalDataForThread for this purpose since the condition is more complicated when WebThread is being used. * platform/Timer.cpp: (WebCore::TimerBase::~TimerBase): Added the assertion. * platform/Timer.h: (WebCore::TimerBase::m_thread): Always store the current thread in a timer. 2019-01-09 Ryosuke Niwa ThreadTimers should not store a raw pointer in its heap https://bugs.webkit.org/show_bug.cgi?id=192975 Reviewed by Geoffrey Garen. Right now, ThreadTimers's heap data structure stores a raw pointer to TimerBase. In order to harden the timer code, this patch replaces it with ThreadTimerHeapItem, a newly introduced struct, which effectively acks like WeakReference as the timer heap and TimerBase both store RefPtr to it, and TimerBase's destructor clears the raw pointer back to TimerBase*. This approach was taken instead of an out-right adoptation of WeakPtr since the heap data structure requires each node in the heap to have a fixed "priority" yet WeakPtr with no valid pointer back to TimerBase would effectively lose its "priority" thereby corrupting the heap data structure. That is, each item in the heap must remember its fire time and insertion order even when the underlying TimerBase had gone away (this should never happen but the whole point of this hardening is to make it work even in the precense of such a bug). This patch also moves the heap index in TimerBase to ThreadTimerHeapItem, and replaces the pointer to the heap vector in TimerBase by a reference to ThreadTimers in ThreadTimerHeapItem. Note that ThreadTimers is a per-thread singleton. The correctness of this hardening was tested by commenting out the call to stop() and !isInHeap() assertion in TimerBase::~TimerBase() as well as the !isInHeap() assertion in ThreadTimerHeapItem::clearTimer() and observing that layout tests run successfully without hitting any debug assertions. No new tests since there should be no observable behavior difference. * WebCore.xcodeproj/project.pbxproj: Export ThreadTimers.h as a private header since it's now included in Timer.h * platform/ThreadTimers.cpp: (WebCore::ThreadTimers::updateSharedTimer): Delete ThreadTimerHeapItem's with nullptr TimerBase* (TimerBase had already been deleted). This should only happen when TimerBase's destructor failed to remove itself from the timer heap, which should never happen. (WebCore::ThreadTimers::sharedTimerFiredInternal): Ditto. Also removed the redundant code which had removed the timer from the heap since setNextFireTime does the removal already. * platform/ThreadTimers.h: Outdented the whole file. (WebCore::ThreadTimers::timerHeap): We use Vector> instead of Vector> since Ref<~> doesn't have a copy constructor which is used by std::push_heap. (WebCore::ThreadTimerHeapItem): Added. (WebCore::ThreadTimerHeapItem::hasTimer const): Added. (WebCore::ThreadTimerHeapItem::setNotInHeap): Added. ThreadTimerHeapItem uses unsigned -1 as the single value which signifies the item not being in the heap instead of all negative values as in the old code in TimerBase. (WebCore::ThreadTimerHeapItem::isInHeap const): Added. (WebCore::ThreadTimerHeapItem::isFirstInHeap const): Added. (WebCore::ThreadTimerHeapItem::timer): Added. (WebCore::ThreadTimerHeapItem::clearTimer): Added. (WebCore::ThreadTimerHeapItem::heapIndex const): Added. (WebCore::ThreadTimerHeapItem::setHeapIndex): Added. (WebCore::ThreadTimerHeapItem::timerHeap const): Added. * platform/Timer.cpp: (WebCore::threadGlobalTimerHeap): This function is now only used in assertions. (WebCore::ThreadTimerHeapItem::ThreadTimerHeapItem): Added. (WebCore::ThreadTimerHeapItem::create): Added. (WebCore::TimerHeapPointer::TimerHeapPointer): (WebCore::TimerHeapPointer::operator-> const): (WebCore::TimerHeapReference::TimerHeapReference): Added a copy constructor. (WebCore::TimerHeapReference::copyRef const): Added. (WebCore::TimerHeapReference::operator RefPtr& const): (WebCore::TimerHeapPointer::operator* const): (WebCore::TimerHeapReference::operator=): Use move assignment operator. (WebCore::TimerHeapReference::swapWith): (WebCore::TimerHeapReference::updateHeapIndex): Extracted to share code between two verions of operator=. (WebCore::swap): (WebCore::TimerHeapIterator::TimerHeapIterator): (WebCore::TimerHeapIterator::operator-> const): (WebCore::TimerHeapLessThanFunction::compare): Added variants which take RefPtr. (WebCore::TimerHeapLessThanFunction::operator() const): (WebCore::TimerBase::TimerBase): (WebCore::TimerBase::~TimerBase):Clear the raw pointer in ThreadTimerHeapItem. (WebCore::TimerBase::stop): (WebCore::TimerBase::nextFireInterval const): (WebCore::TimerBase::checkHeapIndex const): Added the consistency check for other items in the heap. (WebCore::TimerBase::checkConsistency const): (WebCore::TimerBase::heapDecreaseKey): (WebCore::TimerBase::heapDelete): (WebCore::TimerBase::heapDeleteMin): (WebCore::TimerBase::heapIncreaseKey): (WebCore::TimerBase::heapInsert): (WebCore::TimerBase::heapPop): (WebCore::TimerBase::heapPopMin): (WebCore::TimerBase::heapDeleteNullMin): Added. Used to delete ThreadTimerHeapItem which no longer has a valid TimerBase. (WebCore::parentHeapPropertyHolds): (WebCore::childHeapPropertyHolds): (WebCore::TimerBase::hasValidHeapPosition const): (WebCore::TimerBase::updateHeapIfNeeded): Tweaked the heap index assertion as heapIndex() itself would assert when called on an item with an invalid (-1) heap index. (WebCore::TimerBase::setNextFireTime): Create ThreadTimerHeapItem. Note m_heapItem is never cleared until this TimerBase is deleted. (WebCore::TimerHeapReference::operator TimerBase* const): Deleted. * platform/Timer.h: (WebCore::TimerBase): Replaced m_nextFireTime, m_heapIndex, m_heapInsertionOrder, and m_cachedThreadGlobalTimerHeap by m_heapItem, RefPtr to an ThreadTimerHeapItem. (WebCore::TimerBase::augmentFireInterval): (WebCore::TimerBase::inHeap const): (WebCore::TimerBase::nextFireTime const): (WebCore::TimerBase::isActive const): (WebCore::TimerBase:: const): Deleted. 2019-02-12 Jiewen Tan Further restricting webarchive loads https://bugs.webkit.org/show_bug.cgi?id=194567 Reviewed by Youenn Fablet. This patch futher restricts main frame webarchive loads to the followings: 1) loaded by clients; 2) loaded by drag; 3) reloaded from any of the previous two. It moves setAlwaysAllowLocalWebarchive, which is used for testing only, from Document to FrameLoader such that the option is remembered during redirections. Covered by API tests. * dom/Document.h: (WebCore::Document::setAlwaysAllowLocalWebarchive): Deleted. (WebCore::Document::alwaysAllowLocalWebarchive const): Deleted. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::disallowWebArchive const): * loader/DocumentLoader.h: (WebCore::DocumentLoader::setAllowsWebArchiveForMainFrame): (WebCore::DocumentLoader::allowsWebArchiveForMainFrame): * loader/FrameLoadRequest.h: (WebCore::FrameLoadRequest::setIsRequestFromClientOrUserInput): (WebCore::FrameLoadRequest::isRequestFromClientOrUserInput): * loader/FrameLoader.cpp: (WebCore::FrameLoader::load): (WebCore::FrameLoader::reload): * loader/FrameLoader.h: (WebCore::FrameLoader::setAlwaysAllowLocalWebarchive): (WebCore::FrameLoader::alwaysAllowLocalWebarchive const): * page/DragController.cpp: (WebCore::DragController::performDragOperation): * testing/Internals.cpp: (WebCore::Internals::setAlwaysAllowLocalWebarchive const): * testing/Internals.h: * testing/Internals.idl: 2019-02-08 Chris Fleizach AXObjectCache::childrenChanged shouldn't update layout or style during another style recalc https://bugs.webkit.org/show_bug.cgi?id=182280 Reviewed by Alan Bujtas. Remove the possibility that changing children calls back into updating layout by handling children changes in a deferred manner. This follows the same architecture as many other deferred changes, but also requires us to check deferred changes in updateBackingStore, because things like aria-hidden changes won't trigger a layout, but will require us to update children. A few tests had to be modified to no longer change the tree and then check the children immediately. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::childrenChanged): (WebCore::AXObjectCache::prepareForDocumentDestruction): (WebCore::AXObjectCache::performDeferredCacheUpdate): * accessibility/AXObjectCache.h: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::updateBackingStore): * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (convertToNSArray): (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]): 2019-02-13 Carlos Garcia Campos [FreeType] Unable to render some Hebrew characters https://bugs.webkit.org/show_bug.cgi?id=194498 Reviewed by Michael Catanzaro. We are failing to find a font for some of the combining character sequences because normalization is failing due to overflow error. In case of overflow, normalize returns the required length for the normalized characters, so we should handle that case to resize the output buffer and try again. * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp: (WebCore::FontCascade::fontForCombiningCharacterSequence const): 2019-02-01 Claudio Saavedra Race-condition during scrolling thread creation https://bugs.webkit.org/show_bug.cgi?id=194016 Reviewed by Saam Barati. There is a threading issue during the initialization of the scrolling thread caused by createThreadIfNeeded locking only on the creation of the thread but not on the initialization of the main loop, making it possible for a thread to try to spin the main loop before it's created. Fix this by unconditionally waiting on the main loop being created. This makes it necessary to always hold the lock, even when the thread is already created. * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::createThreadIfNeeded): 2019-01-31 Alexander Mikhaylenko [GTK] Momentum scrolling stops abruptly before websites end https://bugs.webkit.org/show_bug.cgi?id=193350 Reviewed by Carlos Garcia Campos. Don't immediately set velocity to 0 when position reaches upper or bottom limit. Instead, set it to the overshot distance, so that position exactly matches upper or lower limit on the next frame, and then clamp velocity to 0 using the existing mechanism. * platform/ScrollAnimationKinetic.cpp: (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll): 2018-12-06 Carlos Eduardo Ramalho REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds https://bugs.webkit.org/show_bug.cgi?id=191997 Reviewed by Philippe Normand. Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF. No new tests required. Only fixing build. * platform/gtk/PlatformWheelEventGtk.cpp: (WebCore::PlatformWheelEvent::PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING) 2019-01-11 Miguel Gomez [GTK] Garbled rendering on Youtube while scrolling under X11. https://bugs.webkit.org/show_bug.cgi?id=192982 Reviewed by Carlos Garcia Campos. When creating a GLX window context, try to get a GLXFBConfig that has depth and stencil buffers for the default framebuffer. * platform/graphics/glx/GLContextGLX.cpp: (WebCore::compatibleVisuals): (WebCore::GLContextGLX::createWindowContext): 2019-01-18 Ali Juma FetchResponse::url should return the empty string for tainted responses https://bugs.webkit.org/show_bug.cgi?id=193553 Reviewed by Youenn Fablet. Check whether the response is tainted in FetchResponse::url, to match the behavior described in https://fetch.spec.whatwg.org/#concept-filtered-response-opaque. * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::url const): 2019-01-04 Brent Fulgham Parsed protocol of javascript URLs with embedded newlines and carriage returns do not match parsed protocol in Chrome and Firefox https://bugs.webkit.org/show_bug.cgi?id=193155 Reviewed by Chris Dumez. Test: fast/loader/comment-only-javascript-url.html Make a special case for URLs beginning with 'javascript:'. We should always treat these as JS URLs, even if the content contained within the URL string might match other parts of the URL parsing spec. * html/URLUtils.h: (WebCore::URLUtils::protocol const): 2018-12-21 Zalan Bujtas Synchronous media query evaluation could destroy current Frame/FrameView. https://bugs.webkit.org/show_bug.cgi?id=192781 Reviewed by Chris Dumez. Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid. Test: printing/print-with-media-query-destory.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::finishedLoading): * page/Frame.cpp: (WebCore::Frame::setPrinting): * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): * page/PrintContext.cpp: (WebCore::PrintContext::PrintContext): (WebCore::PrintContext::computePageRects): (WebCore::PrintContext::computePageRectsWithPageSizeInternal): (WebCore::PrintContext::begin): (WebCore::PrintContext::computeAutomaticScaleFactor): (WebCore::PrintContext::spoolPage): (WebCore::PrintContext::spoolRect): (WebCore::PrintContext::end): * page/PrintContext.h: (WebCore::PrintContext::frame const): Deleted. 2018-12-10 Brent Fulgham SVGViewSpec objects should mark relevant SVG elements https://bugs.webkit.org/show_bug.cgi?id=192567 Reviewed by Ryosuke Niwa. SVGViewSpec elements reflect the state of an underlying SVGElement. Teach the mark algorithm to recognize the relevant SVGElement as active as long as the SVGViewSpec is active. Update SVGElement so that it can vend WeakPtrs. I also noticed that SVGAttributeOwner used a bare pointer to the SVGElement, so switched to a WeakPtr. Test: svg/animations/view-dependency-crash.html * Sources.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * bindings/js/JSSVGViewSpecCustom.cpp: Added. (WebCore::JSSVGViewSpec::visitAdditionalChildren): * svg/SVGElement.h: * svg/SVGPathElement.h: * svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::SVGViewSpec): Hold a weak pointer (rather than a bare pointer) to the underlying element. * svg/SVGViewSpec.h: * svg/SVGViewSpec.idl: * svg/properties/SVGAttributeOwnerProxy.cpp: Added. (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Hold a weak pointer (rather than a bare pointer) to the underling SVGElement. (WebCore::SVGAttributeOwnerProxy::element const): Ditto. * svg/properties/SVGAttributeOwnerProxy.h: (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Move implementation to cpp file. (WebCore::SVGAttributeOwnerProxy::element const): Ditto. * svg/properties/SVGAttributeOwnerProxyImpl.h: Update for WeakPtr use. 2018-12-10 Mark Lam PropertyAttribute needs a CustomValue bit. https://bugs.webkit.org/show_bug.cgi?id=191993 Reviewed by Saam Barati. This patch revealed a bug in the CodeGenerator where a constructor property is set with a ReadOnly attribute. This conflicts with the WebIDL link (see clause 12 in https://heycam.github.io/webidl/#interface-prototype-object) which states that it should be [Writable]. The ReadOnly attribute is now removed. On the WebCore side, this change is covered by existing tests. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor): 2018-11-12 Michael Catanzaro [GTK] Silence ATK_XY_PARENT warnings https://bugs.webkit.org/show_bug.cgi?id=191504 Reviewed by Carlos Garcia Campos. * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp: (atkToContents): * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (textExtents): * accessibility/atk/WebKitAccessibleUtil.cpp: (contentsRelativeToAtkCoordinateType): 2018-12-06 Carlos Eduardo Ramalho [GStreamer] -DENABLE_VIDEO=ON -DENABLE_OPENGL=OFF still tries to build GstreamerGL https://bugs.webkit.org/show_bug.cgi?id=191998 Reviewed by Philippe Normand. Fix compilation with -DENABLE_VIDEO=ON and -DENABLE_OPENGL=OFF due to GStreamerGL. No new tests required. Only fixing the build with certain flags. * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): add required #if ENABLE(WEBGL). 2018-12-06 Carlos Eduardo Ramalho REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds https://bugs.webkit.org/show_bug.cgi?id=191997 Reviewed by Philippe Normand. Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF. No new tests required. Only fixing build. * platform/gtk/PlatformWheelEventGtk.cpp: (WebCore::PlatformWheelEvent::PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING) 2018-12-01 Brent Fulgham Lifetime of HTMLMediaElement is not properly handled in asynchronous actions https://bugs.webkit.org/show_bug.cgi?id=192087 Reviewed by Dean Jackson. The HTMLMediaElement performs operations that allow arbitrary JavaScript to run. We need to make sure the active media element is protected until those calls complete. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::didFinishInsertingNode): (WebCore::HTMLMediaElement::exitFullscreen): (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): (WebCore::HTMLMediaElement::scheduleConfigureTextTracks): (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated): (WebCore::HTMLMediaElement::scheduleUpdatePlayState): (WebCore::HTMLMediaElement::scheduleUpdateMediaState): 2018-11-16 Jiewen Tan Disallow loading webarchives as iframes https://bugs.webkit.org/show_bug.cgi?id=191728 Reviewed by Youenn Fablet. Disallow loading webarchives as iframes. We don't allow loading remote webarchives. Now, this policy is hardened to disallow loading webarchives as iframes for local documents as well. To allow old tests still be able to run, a flag is added to always allow loading local webarchives in document. The flag can be set via window.internals. Tests: webarchive/loading/test-loading-archive-subresource.html webarchive/loading/test-loading-top-archive.html * dom/Document.h: (WebCore::Document::setAlwaysAllowLocalWebarchive): (WebCore::Document::alwaysAllowLocalWebarchive): * loader/DocumentLoader.cpp: (WebCore::disallowWebArchive): (WebCore::DocumentLoader::continueAfterContentPolicy): (WebCore::isRemoteWebArchive): Deleted. * testing/Internals.cpp: (WebCore::Internals::setAlwaysAllowLocalWebarchive const): * testing/Internals.h: * testing/Internals.idl: 2018-11-30 Jiewen Tan Don't report resource timing to parent frame for history items https://bugs.webkit.org/show_bug.cgi?id=192273 Reviewed by Youenn Fablet. We should not report history items to its parent frame as those are less interested to its parent and might not be the first navigation in the iframes. This change aligns the behavior when a cached document is not available for the history item with the available case as we don't report resource timing for any cached main document. Test: http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadDifferentDocumentItem): 2018-11-21 Michael Catanzaro [FreeType] Problem under WebCore::FontPlatformData::FontPlatformData https://bugs.webkit.org/show_bug.cgi?id=191595 Unofficially reviewed stable branch commit. Blacklist cairo 1.15 and 1.16.0 when setting FreeType memory allocation functions. These broken versions of cairo free memory allocated by FreeType with system free. We can avoid trouble by using the system allocator instead of bmalloc. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: (WebCore::initializeFreeTypeLibrary): 2018-11-20 Zan Dobersek Segfaults on https://terminalizer.com/ https://bugs.webkit.org/show_bug.cgi?id=191805 Reviewed by Michael Catanzaro. In HarfBuzzFace, the CacheEntry's HashMap object that caches Unicode codepoints and their corresponding glyph indices should allow zero values as valid keys since zero is a valid Unicode codepoint. This change enables properly caching zero codepoints, avoiding repetitive additions to the HashMap cache that end up in a crash. * platform/graphics/harfbuzz/HarfBuzzFace.h: Move the elongated GlyphCache type alias to the public section of HarfBuzzFace class declaration, making it reusable in the helper HarfBuzzFontData struct. * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: 2018-11-18 Zan Dobersek HarfBuzzFace::CacheEntry should use 32-bit values in its HashMap https://bugs.webkit.org/show_bug.cgi?id=191825 Reviewed by Michael Catanzaro. The HashMap-based glyph cache contained in HarfBuzzFace::CacheEntry objects is used to map given Unicode codepoints to corresponding glyph indices (which occurs in the harfBuzzGetGlyph() function that's invoked by HarfBuzz). The 16-bit unsigned integer as the map's value type is not enough here when the glyph index mapping is done through Freetype -- its API returns 32-bit glyph indices, and Cairo assigns this value to the 64-bit unsigned index variable in the cairo_glyph_t struct. The value type is thus bumped to 32 bits to match the unsigned type size of the index's origin. * platform/graphics/harfbuzz/HarfBuzzFace.h: * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: 2018-10-27 Charlie Turner Fix release build with -DLOG_DISABLED=0 https://bugs.webkit.org/show_bug.cgi?id=190866 Reviewed by Xabier Rodriguez-Calvar. No new tests since no functionality changed. * platform/graphics/Font.cpp: * platform/graphics/Font.h: * platform/graphics/FontPlatformData.h: * platform/graphics/cocoa/FontPlatformDataCocoa.mm: * platform/graphics/freetype/FontPlatformDataFreeType.cpp: * platform/graphics/win/FontPlatformDataWin.cpp: 2018-11-16 Jer Noble An early return from updateSchedulingInfo can leave some variables uninitialized. https://bugs.webkit.org/show_bug.cgi?id=191755 Reviewed by Brent Fulgham. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::process): * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::updateSchedulingInfo): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::process): 2018-11-15 Antti Koivisto Remove fonts from CSSFontFaceSet safely https://bugs.webkit.org/show_bug.cgi?id=191676 Reviewed by Zalan Bujtas. Test: fast/text/font-face-set-remove-safely.html * css/CSSFontFaceSet.cpp: (WebCore::CSSFontFaceSet::remove): 2018-11-12 Zalan Bujtas Do not collapse the soon-to-be-parent anon block when we shuffle around the marker item renderer. https://bugs.webkit.org/show_bug.cgi?id=191554 Reviewed by Antti Koivisto. While moving the marker item renderer to its correct subtree, we accidentally remove the soon-to-be parent anonymous block. Moving a renderer is a 2 step process: 1. Detach the renderer from its current parent 2. Attach it to its new parent. During step #1, we check if there is a chance to collapse anonymous blocks. In this case the soon-to-be-parent is a sibling anonymous block which, after detaching the marker sibling is not needed anymore (except we use it as the new parent). Test: fast/inline/marker-list-item-move-should-not-crash.html * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::detach): * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::detach): * rendering/updating/RenderTreeBuilderBlock.h: * rendering/updating/RenderTreeBuilderList.cpp: (WebCore::RenderTreeBuilder::List::updateItemMarker): 2018-11-01 Claudio Saavedra Fix build with VIDEO and WEB_AUDIO disabled https://bugs.webkit.org/show_bug.cgi?id=191147 Reviewed by Philippe Normand. Supported or not, there were a few build fixes needed to be able to build WebKit with media disabled. Mostly low-hanging fruits. * Modules/mediasource/VideoPlaybackQuality.cpp: * Modules/mediasource/VideoPlaybackQuality.h: * Modules/mediasource/VideoPlaybackQuality.idl: * dom/Document.cpp: (WebCore::Document::dispatchFullScreenChangeOrErrorEvent): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::InspectorDOMAgent): (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend): * inspector/agents/InspectorDOMAgent.h: * rendering/RenderThemeGtk.cpp: 2018-10-11 Jiewen Tan Only report resource timing to parent frame for the first iframe load https://bugs.webkit.org/show_bug.cgi?id=190498 Reviewed by Youenn Fablet. Only the first iframe navigation or the first iframe navigation after about:blank should be reported. https://www.w3.org/TR/resource-timing-2/#resources-included-in-the-performanceresourcetiming-interface Test: http/tests/misc/resource-timing-navigation-in-restored-iframe.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadWithDocumentLoader): * loader/FrameLoader.h: (WebCore::FrameLoader::shouldReportResourceTimingToParentFrame): (WebCore::FrameLoader::setShouldReportResourceTimingToParentFrame): Deleted. * loader/ResourceTimingInformation.cpp: (WebCore::ResourceTimingInformation::addResourceTiming): 2018-10-18 Jer Noble [MSE] timestampOffset can introduce floating-point rounding errors to incoming samples https://bugs.webkit.org/show_bug.cgi?id=190590 Reviewed by Eric Carlson. Test: media/media-source/media-source-timestampoffset-rounding-error.html SourceBuffer.timestampOffset is a double property, which, when added to a MediaTime will result in a double-backed MediaTime as PTS & DTS. This can introduce rounding errors when these samples are appended as overlapping existing samples. Rather than converting a MediaTime to double-backed when adding the timestampOffset, convert the offset to a multiple of the sample's timeBase. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::setTimestampOffset): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): 2018-10-15 Yoshiaki Jitsukawa [Cairo] Incorrect rendering for 135-deg skews https://bugs.webkit.org/show_bug.cgi?id=190513 Compensation value to zero the the translation components of the transformation matrix is incorrect if the matrix has a shear factor. Reviewed by Žan Doberšek. Tests: fast/transforms/skew-x-135deg-with-gradient.html fast/transforms/skew-y-135deg-with-gradient.html * platform/graphics/cairo/CairoUtilities.cpp: (WebCore::drawPatternToCairoContext): 2018-10-09 Said Abou-Hallawa REGRESSION(r234620): SVGLangSpace::svgAttributeChanged() should invalidate the renderer of the SVGGeometryElement descendant only https://bugs.webkit.org/show_bug.cgi?id=190411 Reviewed by Simon Fraser. Test: svg/dynamic-updates/SVGStopElement-dom-xml-lang-attrr.html When changing the attributes of the SVGLangSpace, we should invalidate the renderer of the SVGGeometryElement descendant only. Renderer of other elements, like SVGStopElement, should not be invalidated because they do not have geometry and they can be used as resources for drawing another SVGGeometryElement. * svg/SVGElement.h: (WebCore::SVGElement::isSVGGeometryElement const): * svg/SVGGeometryElement.h: (isType): * svg/SVGLangSpace.cpp: (WebCore::SVGLangSpace::svgAttributeChanged): 2018-10-09 Michael Catanzaro [WPE][GTK] Complex text crashes with harfbuzz 1.8.8 https://bugs.webkit.org/show_bug.cgi?id=190409 Reviewed by Žan Doberšek. We discovered that harfbuzz 1.8.8 breaks WebKit by changing the ownership semantics of hb_icu_get_unicode_funcs() from (transfer full) to (transfer none). Our code was actually expecting (transfer none), so it's not immediately clear to me why it's crashing now, but doesn't matter as Behdad recommends removing this line of code because it hasn't been been needed for many years. This should be covered by all our complex text tests if the bots were upgraded to the newer harfbuzz. * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): 2018-10-09 Philippe Normand [GStreamer] Stealing cross-origin video pixel with HLS https://bugs.webkit.org/show_bug.cgi?id=190003 Reviewed by Xabier Rodriguez-Calvar. Report the SecurityOrigin of downloaded adaptivedemux (HLS, DASH, SmoothStreaming) fragments as tainted if their origin differs from the manifest SecurityOrigin. SecurityOrigins are stored in the CachedResourceStreamingClient implemented in the internal GStreamer HTTP(S) source element. The implementation is not ideal yet because the fragments download is performed by the WebProcess, until bug 189967 is fixed. When this bug is fixed, the m_hasTaintedOrigin member variable should be removed and all checks be done unconditionally to the webkithttpsrc element which will manage the download of the manifests and fragments. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::loadFull): Reset the m_hasTaintedOrigin value. (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Get the fragment URL from the adaptivedemux stats message and check if its origin is tainted. (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const): Initial implementation by checking the m_hasTaintedOrigin member variable value. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::responseReceived): Store the resource origin internally so it can be checked later on by webKitSrtcWouldTaintOrigin(). (webKitSrcWouldTaintOrigin): Check given origin against cached origins. This implementation is similar to Cocoa's WebCoreNSURLSession implementation. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: 2018-10-03 Zan Dobersek Ref use-after-move in DOMCache::put() https://bugs.webkit.org/show_bug.cgi?id=190239 Reviewed by Youenn Fablet. Retrieve reference from the Ref object before it's move-captured in the lambda that's passed to the FetchResponse::consumeBodyReceivedByChunk() method that is invoked on that very same object. This is a classic use-after-move bug that pops up on compilers with different C++ calling convention. * Modules/cache/DOMCache.cpp: (WebCore::DOMCache::put): 2018-09-20 Zalan Bujtas Release assert under RenderView::pageOrViewLogicalHeight https://bugs.webkit.org/show_bug.cgi?id=189798 Reviewed by Simon Fraser. Only the mainframe's render view is sized to the page while printing. Use the matching check (see RenderView::layout) when accessing m_pageLogicalSize. Test: printing/crash-while-formatting-subframe-for-printing.html * rendering/RenderView.cpp: (WebCore::RenderView::pageOrViewLogicalHeight const): 2018-09-11 Ryosuke Niwa imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html hits assertion https://bugs.webkit.org/show_bug.cgi?id=189493 Reviewed by Alex Christensen. The debug assertion was caused by RefPtr in FormAssociatedElement::formOwnerRemovedFromTree introduced by r224390 and r223644 ref'ing ShadowRoot while calling removeDetachedChildren inside ~ShadowRoot. When a form (or any other) element has more than one ref inside removeDetachedChildren, addChildNodesToDeletionQueue calls notifyChildNodeRemoved in the tree oreder. However, when a form associated element of this form element appears later in the tree order, FormAssociatedElement::formOwnerRemovedFromTree can traverse up ancestors including the ShadowRoot. Fixed the bug by using raw pointers instead. Luckily, there is no DOM mutations or other non-trivial operations happening in this function so this should be safe. Test: imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html * html/FormAssociatedElement.cpp: (WebCore::FormAssociatedElement::formOwnerRemovedFromTree): Fixed the bug. 2018-10-02 Alicia Boya García [MSE][GStreamer] Add h264parse to accept MP4 without stss https://bugs.webkit.org/show_bug.cgi?id=190143 Reviewed by Xabier Rodriguez-Calvar. The MP4 file used in this URL does not contain a stss (Sync Sample Box). In consequence, in acordance with the ISO BMFF spec, all samples are assumed to be sync frames... But in this case that is not true, it's just that the file is wrong (e.g. created with a buggy muxer). http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest The way it works in other browsers is because instead of trusting the MP4 stss table, they rely on parsing the h264 frames. We can do that too. This patch also changes RELEASE_ASSERT() when creating the parsers to GLib criticals. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::createOptionalParserForFormat): 2018-10-02 Philippe Normand [GStreamer][playbin3] Stream tag lists leaks https://bugs.webkit.org/show_bug.cgi?id=190192 Reviewed by Xabier Rodriguez-Calvar. The gst_stream_get_tags() result is transfer-full, so needs to be adopted to prevent a leak. Also check the tags list pointer which might be NULL in some cases. * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp: (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::naturalSize const): * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp: (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer): 2018-10-01 Alicia Boya García [GStreamer] Fix abort in gst_sample_get_info() https://bugs.webkit.org/show_bug.cgi?id=190135 Reviewed by Philippe Normand. A flush can occur before any frame has finished decoding -- especially in tests, where actions on the player often occur in quick succession. Therefore, the code must not assume by the time a flush occurs any frame has reached the sink. This patch fixes a case when such wrong assumption was causing gst_sample_get_info() to abort (crashing WebKit). * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer): (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): 2018-10-02 Alicia Boya García [MSE][GStreamer] Make same thread assert non-release https://bugs.webkit.org/show_bug.cgi?id=189924 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::handleNewAppsinkSample): 2018-09-27 Alicia Boya García [MSE][GStreamer] Use sentinel buffer to detect end of append https://bugs.webkit.org/show_bug.cgi?id=189924 Reviewed by Philippe Normand. This patch introduces a new mechanism to detect when an append has been consumed completely by the demuxer. It takes advantage of the fact that buffer pushing is synchronous: both the appsrc and the demuxer live in the same streaming thread. When appsrc pushes a buffer, it's actually making a qtdemux function call (it calls its "chain" function). The demuxer will return from that call when it has finished processing that buffer; only then the control returns to appsrc, that can push the next buffer. By pushing an additional buffer and capturing it in a probe we can detect reliably when the previous buffer has been processed. Because the pipeline only has one thread, at this point no more frames can arrive to the appsink. This replaces the old method of detecting end of append which relied on the `need-data` event, which is more difficult to handle correctly because it fires whenever the appsrc is empty (or below a given level), which also happens when a buffer has not been pushed yet or in response to a flush. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::EndOfAppendMeta::init): (WebCore::EndOfAppendMeta::transform): (WebCore::EndOfAppendMeta::free): (WebCore::AppendPipeline::staticInitialization): (WebCore::AppendPipeline::AppendPipeline): (WebCore::AppendPipeline::~AppendPipeline): (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe): (WebCore::AppendPipeline::handleApplicationMessage): (WebCore::AppendPipeline::handleEndOfAppend): (WebCore::AppendPipeline::consumeAppsinkAvailableSamples): (WebCore::AppendPipeline::resetPipeline): (WebCore::AppendPipeline::pushNewBuffer): (WebCore::AppendPipeline::handleAppsrcNeedDataReceived): Deleted.: (WebCore::AppendPipeline::handleAppsrcAtLeastABufferLeft): Deleted. (WebCore::AppendPipeline::checkEndOfAppend): Deleted. (WebCore::AppendPipeline::setAppsrcDataLeavingProbe): Deleted. (WebCore::AppendPipeline::removeAppsrcDataLeavingProbe): Deleted. (WebCore::AppendPipeline::reportAppsrcAtLeastABufferLeft): Deleted. (WebCore::AppendPipeline::reportAppsrcNeedDataReceived): Deleted. (WebCore::appendPipelineAppsrcDataLeaving): Deleted. (WebCore::appendPipelineAppsrcNeedData): Deleted. * platform/graphics/gstreamer/mse/AppendPipeline.h: 2018-09-24 Alicia Boya García [MSE][GStreamer] Use no-more-pads event for noticing initialization segments https://bugs.webkit.org/show_bug.cgi?id=189868 Reviewed by Xabier Rodriguez-Calvar. Fixes the following YTTV 2018 tests: 62.VideoDimensionVP9 63.PlaybackStateVP9 This removes the hack that was making supporting multiple tracks in the same file in MSE impossible. For WebM, this GStreamer patch is required: https://bugzilla.gnome.org/show_bug.cgi?id=797187 "matroskademux: Emit no-more-pads after parsing Tracks" * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::AppendPipeline): (WebCore::AppendPipeline::handleApplicationMessage): (WebCore::AppendPipeline::demuxerNoMorePads): (WebCore::AppendPipeline::appsinkCapsChanged): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): (WebCore::AppendPipeline::appendPipelineDemuxerNoMorePadsFromAnyThread): (WebCore::appendPipelineDemuxerNoMorePads): * platform/graphics/gstreamer/mse/AppendPipeline.h: 2018-10-01 Alicia Boya García [MSE][GStreamer] Reset running time in PlaybackPipeline::flush() https://bugs.webkit.org/show_bug.cgi?id=190076 Reviewed by Philippe Normand. Test: media/media-source/media-source-seek-redundant-append.html PlaybackPipeline::flush() is called when already enqueued frames are appended again. This may be caused by a quality change or just a redundant append. Either way, the pipeline has to be flushed and playback begin again, but without changing the player position by much. There are two kinds of time to consider here: stream time (i.e. the time of a frame as written in the file, e.g. a frame may have stream time 0:01:00), and running time (i.e. how much time since playback started should pass before the frame should be played, e.g. if we started playing at 0:00:59 that same frame would have a running time of just 1 second). Notice how running time depends on where and when playback starts. Running time can also be optionally resetted after a flush. (This is indeed done currently by most demuxers after a seek.) Instead of resetting running time, PlaybackPipeline used to modify the first GstSegment emitted after the flush. A GstSegment declares the mapping between stream time and running time for the following frames. There, PlaybackPipeline used to set `base` (the running time at which the segment starts) to the position reported by a position query (which is stream time). This, of course, only worked when playback (or the last seek) started at stream time 0:00:00, since that's the only case where running time equals stream time. In other cases delays as long as the difference between these timelines would appear. This is demonstrated in the attached test, where seeks and appends are made in such an order that the difference is more than 5 minutes, making the playback stall for >5 minutes before playing 1 second of audio. This patch fixes the problem by resetting running time with the flush and not modifying GstSegment.base anymore (it will be left as zero, which is now correct since the running time has been reset). * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: (WebCore::PlaybackPipeline::flush): (WebCore::segmentFixerProbe): Deleted. 2018-10-01 Alicia Boya García [MSE] Use tolerance when growing the coded frame group https://bugs.webkit.org/show_bug.cgi?id=190085 Test: media/media-source/media-source-append-acb-tolerance.html This patch introduces a millisecond tolerance in the range of potential frames that should be erased frame from the track buffer when the coded frame group is growing. This is necessary because some files have imprecise overlapping timestamps (especially WebM files). This fixes a stall when seeking back and forth in YouTube with WebM video. A test case simulating the problem with video/mock using timestamps similar to those of a typical 30 fps WebM video is also added. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): 2018-10-01 Alicia Boya García [MSE][GStreamer] Set a minimum sample duration https://bugs.webkit.org/show_bug.cgi?id=190125 Reviewed by Xabier Rodriguez-Calvar. The last sample of the audio track in the asset used in this test player has a tiny duration (100 ns): http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest So small, we were truncating it to zero. We're not supposed to have frames with zero duration. Instead, lets set a minimum frame duration for those fringe cases. * platform/graphics/gstreamer/MediaSampleGStreamer.cpp: (WebCore::MediaSampleGStreamer::MediaSampleGStreamer): 2018-10-01 Olivier Blin [WPE] fix buffer over-read in RenderThemeWPE::mediaControlsStyleSheet() https://bugs.webkit.org/show_bug.cgi?id=190139 Reviewed by Michael Catanzaro. Like done upstream for EFL in r210213 https://bugs.webkit.org/show_bug.cgi?id=166622 This has been detected by a charactersAreAllASCII() assert failure. This is because ASCIILiteral() is wrongly used in mediaControlsStyleSheet(). mediaControlsBaseUserAgentStyleSheet is a char array, not a null-terminated string. It is thus incorrect to use StringImpl::createFromLiteral() that calls strlen() to get the string length. The String::ConstructFromLiteral constructor can not be used, since it skips the last character. * platform/wpe/RenderThemeWPE.cpp: (WebCore::RenderThemeWPE::mediaControlsStyleSheet): Explicitely pass the size to the String constructor. 2018-09-27 Alicia Boya García [MSE] Fix unwanted sample erase from the decode queue https://bugs.webkit.org/show_bug.cgi?id=180643 Reviewed by Jer Noble. Test: media/media-source/media-source-append-acb-no-frame-lost.html This bug reproduced when unordered appends were made. For instance, if the application appended [0, 10) and then [20, 30), the frame at 20 would be wrongly discarded from the decode queue. Later the application could append [10, 20) and the gap at [20, 21) would persist in the decode queue, even if the frame remained in the track buffer table. Thanks to Daniel Zhang for reporting the issue. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::provideMediaData): 2018-09-24 Alicia Boya García [MSE][GStreamer] Pull demuxed samples in batches https://bugs.webkit.org/show_bug.cgi?id=189871 Reviewed by Xabier Rodriguez-Calvar. After this patch, only the notifications of "new samples available" (appsink-new-sample bus messages) travel from the streaming thread to the main thread through the bus and the main thread is the responsible of pulling as many samples as it can from appsink. Before, the samples were pulled from appsink in the non-main thread and traveled to the main thread through the bus one by one. This reduces drastically the amount of context switches and waiting time in the streaming thread, resulting in a noticeable performance improvement. This fixes stutter while loading YouTube videos. * platform/graphics/gstreamer/MediaSampleGStreamer.cpp: (WebCore::MediaSampleGStreamer::MediaSampleGStreamer): * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::AppendPipeline): (WebCore::AppendPipeline::~AppendPipeline): (WebCore::AppendPipeline::clearPlayerPrivate): (WebCore::AppendPipeline::handleApplicationMessage): (WebCore::AppendPipeline::appsinkNewSample): (WebCore::AppendPipeline::consumeAppSinkAvailableSamples): (WebCore::AppendPipeline::resetPipeline): (WebCore::AppendPipeline::handleNewAppsinkSample): * platform/graphics/gstreamer/mse/AppendPipeline.h: 2018-09-24 Enrique Ocaña González [MSE][GStreamer] Don't update duration when it was not previously NaN https://bugs.webkit.org/show_bug.cgi?id=189869 Reviewed by Xabier Rodriguez-Calvar. This is what the spec mandates. The spec doesn't say anything about updating duration when it had been previously set, even if the new init segment says that the duration is growing. This fixes MSE YTTV 2018 69.MediaSourceDurationVP9. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): 2018-08-30 Ross Kirsling Speculative build fix for WPE after r235531. * platform/graphics/filters/PointLightSource.cpp: Add missing include. 2018-09-22 Adrian Perez de Castro [ARM] Building FELightingNEON.cpp fails due to missing lightVector member https://bugs.webkit.org/show_bug.cgi?id=189890 Reviewed by Darin Adler. No new tests needed. * platform/graphics/cpu/arm/filters/FELightingNEON.h: (WebCore::FELighting::platformApplyNeon): Adapt to new layout of "struct PaintingData" after r225122. 2018-09-21 Alicia Boya García [MSE] Fix comparsion with uninitialized greatestDecodeDuration https://bugs.webkit.org/show_bug.cgi?id=189805 Reviewed by Michael Catanzaro. This bug was causing greatestDecodeDuration to never be initialized, which in turned caused unintended frame erase as distant appends where not being recognized as distinct coded frame groups. A test reproducing the sequence of appends that caused unintended frame deletion has also been added (media-source-append-out-of-order.html). * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): 2018-09-20 Alicia Boya García [GStreamer][MSE] Add a default sample duration https://bugs.webkit.org/show_bug.cgi?id=189788 Some WebM files don't provide sample durations, so we need to provide a safe default in order for them to be playable. Reviewed by Michael Catanzaro. * platform/graphics/gstreamer/MediaSampleGStreamer.cpp: (WebCore::MediaSampleGStreamer::MediaSampleGStreamer): 2018-09-20 Alicia Boya García [MSE] Use some tolerance when deciding whether a frame should be appended to the decode queue https://bugs.webkit.org/show_bug.cgi?id=189782 Reviewed by Xabier Rodriguez-Calvar. Ideally, container formats should use exact timestamps and frames should not overlap. Unfortunately, there are lots of files out there where this is not always the case. This is particularly a problem in WebM, where timestamps are expressed in a power of 10 timescale, which forces some rounding. This patch makes SourceBuffer allow frames with a small overlaps (<=1ms) as those usually found in WebM. 1 ms is chosen because it's the default time scale of WebM files. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): 2018-09-11 Pablo Saavedra playbackControlsManagerUpdateTimerFired and m_playbackControlsManagerUpdateTimer must be guarded with ENABLE(VIDEO), otherwise the following error occurs with the VIDEO feature turned off: error: 'MediaElementSession' has not been declared Add missing #if ENABLE(VIDEO) Page.cpp and Page.h https://bugs.webkit.org/show_bug.cgi?id=189500 Reviewed by Anders Carlsson. * page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::schedulePlaybackControlsManagerUpdate): * page/Page.h: 2018-09-18 Chris Dumez "DidFirstVisuallyNonEmptyLayout" callback does not get called when restoring a page from PageCache https://bugs.webkit.org/show_bug.cgi?id=189681 Reviewed by Alex Christensen and Zalan Bujtas. The "DidFirstVisuallyNonEmptyLayout" callback was not getting called when restoring a page from PageCache because the FrameView is restored from PageCache and we would fail to restore its flags (such as m_firstVisuallyNonEmptyLayoutCallbackPending) when entering Page Cache. We now call reset those flags that are related to layout miletones when entering PageCache so that layout milestone events properly get sent again when restoring from Page Cache. * history/CachedFrame.cpp: (WebCore::CachedFrame::CachedFrame): 2018-09-15 Rob Buis XMLHttpRequest::createResponseBlob() should create a Blob with type for empty response https://bugs.webkit.org/show_bug.cgi?id=189627 Reviewed by Alexey Proskuryakov. Right now we return an empty Blob without type when the response is empty, but it should always include the type [1]. Test: web-platform-tests/xhr/overridemimetype-blob.html [1] https://xhr.spec.whatwg.org/#blob-response * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createResponseBlob): 2018-09-13 Ms2ger [GLib] Fix format string in KeyedEncoderGlib::beginObject(). https://bugs.webkit.org/show_bug.cgi?id=189585 Reviewed by Michael Catanzaro. This appears to fix the following assertion locally: GLib-CRITICAL **: g_variant_builder_add_value: assertion '!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed Covered by existing tests. * platform/glib/KeyedEncoderGlib.cpp: (WebCore::KeyedEncoderGlib::beginObject): 2018-09-12 Pablo Saavedra Linking against libWPEWebKit-0.1.so is not posible when WPE is build with ENABLE_VIDEO=OFF and ENABLE_WEB_AUDIO=OFF https://bugs.webkit.org/show_bug.cgi?id=189540 Reviewed by Philippe Normand. Related issues: This issue is related with changes in https://bugs.webkit.org/show_bug.cgi?id=183080 This issue is introduced in https://bugs.webkit.org/show_bug.cgi?id=186547 No new tests, no changes in the functionality. * platform/GStreamer.cmake: * platform/SourcesGLib.txt: * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp: (WebCore::LibWebRTCProvider::webRTCAvailable): 2018-09-11 Zan Dobersek Unreviewed WPE build fix. * platform/network/soup/SocketStreamHandleImplSoup.cpp: Add extra header inclusions to get this code building after the unified sources system shifted it into a different translation unit. 2018-09-10 Simon Fraser Many textarea tests leak documents because Document::removeFocusNavigationNodeOfSubtree() can trigger a Document retain cycle https://bugs.webkit.org/show_bug.cgi?id=188722 Reviewed by Ryosuke Niwa. Fix a retain cycle created when Document::adjustFocusNavigationNodeOnNodeRemoval() sets m_focusNavigationStartingNode to itself. m_focusNavigationStartingNode is a Node* (not sure why it's not an Element*), making it possible to assign the Document to it, which creates a reference to the document which prevents Document::removedLastRef() ever running and doing the necessary cleanup. Fix by setting m_focusNavigationStartingNode to null if code tries to set it to the Document. This can happen when an element is focused and the page calls document.write(), which removes all children. Will be tested by future leak testing. Fixes the document leak in at least the following tests: fast/forms/append-children-during-form-submission.html fast/forms/empty-textarea-toggle-disabled.html fast/forms/textarea-paste-newline.html fast/forms/textarea-trailing-newline.html * dom/Document.cpp: (WebCore::Document::setFocusNavigationStartingNode): (WebCore::Document::adjustFocusNavigationNodeOnNodeRemoval): 2018-09-10 Simon Fraser svg/W3C-SVG-1.1/render-groups-03-t.svg and some other SVG tests leak documents https://bugs.webkit.org/show_bug.cgi?id=189147 Reviewed by Dean Jackson. Document::removedLastRef() needs to clean up m_fontSelector, because it can reference CSSFontFaceSources that keep SVGFontFaceElements alive, and they in turn will keep the Document alive. Also add the beginnings of a Fonts log channel. This will be tested by world leak testing (webkit.org/b/189332). * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::CSSFontSelector): (WebCore::CSSFontSelector::~CSSFontSelector): * dom/Document.cpp: (WebCore::Document::removedLastRef): * platform/Logging.h: * platform/graphics/FontCache.cpp: (WebCore::FontCache::purgeInactiveFontDataIfNeeded): (WebCore::FontCache::purgeInactiveFontData): * svg/SVGFontFaceElement.cpp: (WebCore::SVGFontFaceElement::SVGFontFaceElement): (WebCore::SVGFontFaceElement::~SVGFontFaceElement): * svg/SVGFontFaceElement.h: 2018-09-10 Alicia Boya García [GStreamer] Fix overflow in buffered ranges https://bugs.webkit.org/show_bug.cgi?id=189419 Reviewed by Philippe Normand. Scale operations on big numbers (like media timestamps or durations) should be made with GStreamer utility functions to avoid overflows. This fixes an assertion when a 24 hour long fragmented MP4 file is played. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::buffered const): 2018-09-10 Philippe Normand [GStreamer] Several media related tests timing out around the same revision https://bugs.webkit.org/show_bug.cgi?id=189349 Reviewed by Carlos Garcia Campos. The timeouts were happening because the `ended` event was no longer properly emitted. The change in playbackPosition also ensures `timeupdate` event remains emitted in a... timely manner. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): Reduce the position cache threshold to 200ms, which is a value slightly lower than the 250ms defined in HTMLMediaElement. (WebCore::MediaPlayerPrivateGStreamer::didEnd): Reset the cached position value to ensure the following query will most likely return the same value as reported by the duration query. 2018-09-10 Rob Buis XMLHttpRequest: overrideMimeType should not update the response's "Content-Type" header https://bugs.webkit.org/show_bug.cgi?id=189465 Reviewed by Frédéric Wang. The xhr spec changed [1, 2] so that overrideMimeType should not update the response's "Content-Type" header anymore. Behavior matches Firefox and Chrome. [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-overridemimetype [2] https://github.com/whatwg/xhr/issues/157 Tests: http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::didReceiveResponse): 2018-09-10 Antoine Quint [Web Animations] Interrupting an accelerated CSS transition on a composited element in flight fails https://bugs.webkit.org/show_bug.cgi?id=189405 Reviewed by Simon Fraser. Test: webanimations/accelerated-transition-interrupted-on-composited-element.html If we interrupt an animation on an element that is composited also outside of the duration of the animation, the "stop" accelerated action would fail to be performed because we no longer had a resolved current time and the accelerated animation applied to the layer would never be removed. However, having a resolved current time is not necessary to stop an animation, only for the other types of actions (play, pause and seek). So we now simply default to a 0s time for an unresolved current time for a simple fix to this issue. * animation/KeyframeEffectReadOnly.cpp: (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): 2018-09-08 Yusuke Suzuki [CSSJIT] Use lshiftPtr instead of mul32 https://bugs.webkit.org/show_bug.cgi?id=189451 Reviewed by Sam Weinig. Use `value << 4` instead of `value * 16`. In 64bit environment, sizeof(Style::Relation) is 16, so that we can use `value << 4` in CSS JIT. No behavior change. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation): 2018-09-07 Rob Buis XMLHttpRequest: open() does not throw a SYNTAX_ERR exception if method is empty or url cannot be resolved https://bugs.webkit.org/show_bug.cgi?id=46008 Reviewed by Chris Dumez. Check if passed URL is valid as specified here [1]. Test: web-platform-tests/xhr/open-url-bogus.htm [1] https://xhr.spec.whatwg.org/#the-open()-method Step 7 * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::open): 2018-09-07 Don Olmstead [AX] Fix compile error in AXObjectCache constructor when !HAVE(ACCESSIBILITY) https://bugs.webkit.org/show_bug.cgi?id=189423 Reviewed by Yusuke Suzuki. No new tests. Compilation fix. * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::AXObjectCache): 2018-09-05 Brent Fulgham The width of an empty or nullptr TextRun should be zero https://bugs.webkit.org/show_bug.cgi?id=189154 Reviewed by Zalan Bujtas. If a page has an empty TextRun and attempts to paint it we can crash with a nullptr. This patch recognizes that an empty TextRun should always produce a zero width, rather than attempt to compute this value from font data. It also prevents ListBox from attempting to paint a null string. Test: fast/text/null-string-textrun.html * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthOfTextRange const): An empty TextRun has zero width. (WebCore::FontCascade::width const): Ditto. * platform/graphics/TextRun.h: (WebCore::TextRun::TextRun): ASSERT that the supplied String is non-null. (WebCore::TextRun::setText): Ditto. * rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintItemForeground): Don't attempt to paint a null string. 2018-09-04 Daniel Bates Attempt to fix failing tests following r235615 (https://bugs.webkit.org/show_bug.cgi?id=187925) An inline text box that does not have combined text and contains a single character should be considered as having text content. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::hasTextContent const): 2018-09-04 Daniel Bates Remove redundant inline text boxes for empty combined text https://bugs.webkit.org/show_bug.cgi?id=189119 Reviewed by Zalan Bujtas. We should consider inline text boxes that have a combined text renderer (RenderCombineText) whose composed string is empty as "redundant" just as we do for inline text boxes that have a non-combined text renderer that have zero length so that we remove them. Such boxes are visibly empty and do not take up space visually. By removing them we reduce memory and make it easier to reason about the line box tree. Currently RenderBlockFlow::computeBlockDirectionPositionsForLine() tests if an inline text box is empty by checking if it has a zero length (InlineTextBox::len()). However an inline text box associated with a RenderCombineText always has length 1 regardless of whether the composed string it represents is the empty string. Instead we should expose a way to check if an inline text box is visually empty and have RenderBlockFlow::computeBlockDirectionPositionsForLine() query the inline text box for this answer. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::hasTextContent const): Added. Returns whether an inline text box has text content. We do not need to consider hypenation since hypens are an embellishment (i.e. they are not part of the markup of the page). (WebCore::InlineTextBox::paint): Write in terms of hasTextContent(). (WebCore::InlineTextBox::subdivideAndResolveStyle): Assert that WebCore::subdivide() always returns a non-empty list of subdivisions. A non-empty text box should always have at least one subdivision, say for the unmarked text. I left the existing conditonal (though marked it as UNLIKELY()) so as to be forgiving and avoid a bad user experience should WebCore::subdivide() return an empty vector in a non-debug build. * rendering/InlineTextBox.h: * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine): Write in terms of InlineTextBox::hasTextContent() so that we remove empty inline text boxes associated with combined text. * rendering/RenderText.cpp: (WebCore::RenderText::positionLineBox): Write in terms of InlineTextBox::hasTextContent(). 2018-09-03 Youenn Fablet REGRESSION: Layout Test http/tests/security/bypassing-cors-checks-for-extension-urls.html is Flaky https://bugs.webkit.org/show_bug.cgi?id=187658 Reviewed by Alexey Proskuryakov. Test is flaky as a previous test was setting the isRunningUserScripts state on the Page and it was never reset. This patch moves this state to the topDocument so that it will be reset for every navigation. Covered by existing test being no longer flaky. * dom/Document.h: (WebCore::Document::setAsRunningUserScripts): (WebCore::Document::isRunningUserScripts const): * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): * page/Frame.cpp: (WebCore::Frame::injectUserScriptImmediately): * page/Page.h: (WebCore::Page::setAsRunningUserScripts): Deleted. (WebCore::Page::isRunningUserScripts const): Deleted. * testing/Internals.cpp: (WebCore::Internals::setAsRunningUserScripts): 2018-09-02 Zalan Bujtas REGRESSION (r191336): RenderFlexibleBox::adjustChildSizeForMinAndMax crashes in std::optional<>::value() https://bugs.webkit.org/show_bug.cgi?id=189232 Reviewed by Brent Fulgham. It's not guaranteed that RenderFlexibleBox::computeMainAxisExtentForChild() always returns with a valid value. Test: fast/flexbox/crash-when-min-max-content-is-not-computed.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): 2018-08-31 Jer Noble Compilation error in FormData.cpp: incomplete type 'WebCore::SharedBuffer' https://bugs.webkit.org/show_bug.cgi?id=189207 Reviewed by Youenn Fablet. If FormData.cpp is compiled alone (non-unified) or if it is the first file compiled in a unified build, SharedBuffer.h is not included. * platform/network/FormData.cpp: 2018-08-31 John Wilander Storage Access API: Maintain access through same-site navigations https://bugs.webkit.org/show_bug.cgi?id=188564 Reviewed by Alex Christensen. Tests: http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access.html http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html * dom/Document.h: Removed unused member variable m_hasFrameSpecificStorageAccess. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::willSendRequest): * loader/FrameLoaderClient.h: 2018-08-31 Chris Dumez Assertion hit in ~CompletionHandler() from ~WebFrame() https://bugs.webkit.org/show_bug.cgi?id=189199 Reviewed by Youenn Fablet. The issue was caused by WebFrame::m_willSubmitFormCompletionHandlers implicitly containing CompletionHandlers (wrapped in WTF::Functions) and not calling them upon WebFrame destruction. No new tests, covered by fast/frames/iframe-target.html. * loader/EmptyClients.cpp: (WebCore::EmptyFrameLoaderClient::dispatchWillSubmitForm): * loader/EmptyFrameLoaderClient.h: * loader/FrameLoaderClient.h: 2018-08-30 Zalan Bujtas CounterMaps should hold a unique_ptr of CounterMap. https://bugs.webkit.org/show_bug.cgi?id=189174 Reviewed by Ryosuke Niwa. In certain cases calls to CounterMaps might lead to unexpected deletion of the CounterMap object. Test: fast/css/counters/crash-when-cloning-body.html * rendering/RenderCounter.cpp: (WebCore::makeCounterNode): (WebCore::destroyCounterNodeWithoutMapRemoval): (WebCore::RenderCounter::destroyCounterNodes): (WebCore::RenderCounter::destroyCounterNode): (WebCore::updateCounters): (showCounterRendererTree): 2018-08-30 Tim Horton Bundle unified sources more tightly in projects with deep directory structures https://bugs.webkit.org/show_bug.cgi?id=189009 Reviewed by Simon Fraser. Fix a variety of unification errors due to reshuffling the bundles. * Modules/mediastream/RTCController.cpp: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * crypto/algorithms/CryptoAlgorithmECDSA.cpp: (WebCore::CryptoAlgorithmECDSA::importKey): * dom/Document.h: * html/parser/HTMLTreeBuilder.cpp: * loader/appcache/ApplicationCacheResourceLoader.h: * page/AlternativeTextClient.h: * platform/Pasteboard.h: * platform/graphics/DisplayRefreshMonitor.cpp: * platform/graphics/FontFamilySpecificationNull.cpp: * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer initWithGraphicsContext3D:]): (-[WebGLLayer copyImageSnapshotWithColorSpace:]): (-[WebGLLayer display]): (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): * platform/graphics/cocoa/WebGPULayer.mm: (-[WebGPULayer initWithGPUDevice:]): * platform/graphics/metal/GPUCommandQueueMetal.mm: * platform/mac/PasteboardMac.mm: * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp: * platform/network/ResourceRequestBase.cpp: * rendering/updating/RenderTreeBuilderBlockFlow.cpp: * rendering/updating/RenderTreeBuilderInline.cpp: 2018-08-29 Daniel Bates REGRESSION (r226138): WebCore::subdivide() may return an empty vector; Web process can crash when performing find in Epiphany https://bugs.webkit.org/show_bug.cgi?id=184390 And Reviewed by Simon Fraser. Speculative fix for Epiphany. In theory, WebCore::subdivide() should never return an empty vector - no subdivisions - as such a result represents a programmer error. In practice, InlineTextBox can invoke WebCore::subdivide() such that it returns an empty vector. One way this can happen is when subdividing an empty inline text box associated with combined text (RenderCombineText). For now we add a check to bail out of resolving the style of subdivisions when WebCore::subdivide() returns no subdivisions. In a subsequent patch we will look to assert that WebCore::subdivide() always returns subdivisions. Test: fast/text/text-combine-surroundContents-crash.html * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::subdivideAndResolveStyle): 2018-08-28 Don Olmstead Check for null renderer in canBeScrolledIntoView https://bugs.webkit.org/show_bug.cgi?id=188935 Reviewed by Simon Fraser. Test: fast/spatial-navigation/snav-display-contents-crash.html * page/SpatialNavigation.cpp: (WebCore::canBeScrolledIntoView): 2018-08-28 Youenn Fablet IDBDatabase should not return true to hasPendingActivity after being stopped https://bugs.webkit.org/show_bug.cgi?id=189073 Reviewed by Darin Adler. There is a chance that IDBDatabase::hasPendingActivity returns true. The case that might happen is when stop() is called but there are still some active/being committed transactions. In that case, hasPendingActivity will return true until these transactions get finalized. While these transactions will probably be finalized at some point, it delays GC for no good reason. And we might want in a follow-up patch to assert that ActiveDOMObject are GC-able whenever their context is stopped. For that purpose, make sure hasPendingActivity returns false when context is stopped. * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::hasPendingActivity const): 2018-08-28 Youenn Fablet MediaDevices should be collectable as soon as its document is stopped https://bugs.webkit.org/show_bug.cgi?id=189021 Reviewed by Eric Carlson. Introduce ActiveDOMObject::isContextStopped to check whether the context is stopped. Use this check in MediaDevices::hasPendingActivity so that it returns false as soon as active dom objects are stopped. Test: http/tests/media/collect-media-devices.https.html * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::hasPendingActivity const): * dom/ActiveDOMObject.cpp: (WebCore::ActiveDOMObject::hasPendingActivity const): (WebCore::ActiveDOMObject::isContextStopped const): * dom/ActiveDOMObject.h: 2018-08-27 Myles C. Maxfield Null pointer deref in WidthIterator https://bugs.webkit.org/show_bug.cgi?id=188993 Reviewed by Brent Fulgham. Test: fast/text/rtl-justification.html We simply need to guard glyphBuffer like we do in the rest of the function. * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::advanceInternal): 2018-08-27 Youenn Fablet Various IndexDB tests abandon documents https://bugs.webkit.org/show_bug.cgi?id=188728 Reviewed by Alex Christensen. Some IDB objects implement hasPendingActivity but there are some possibilities that they continue returning true after being stopped. This is the case for requests that get stopped while still waiting for some pending activity. This is also the case for requests that emits upgradeneeded or blocked events. Enforce that these objects return false to hasPendingActivity once being stopped. This ensures that they can be garbage collected once their context is preparing for destruction like in Document::prepareForDestruction. Test: http/tests/IndexedDB/collect-IDB-objects.https.html * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::hasPendingActivity const): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::hasPendingActivity const): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::hasPendingActivity const): (WebCore::IDBRequest::enqueueEvent): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::notifyDidAbort): In case the context is stopped, IDBTransaction should not ask IDBRequest to fire an event. 2018-08-27 Rob Buis XMLHTTPRequest.send for Document should have same Content-Type processing rules as String https://bugs.webkit.org/show_bug.cgi?id=188953 Reviewed by Darin Adler. Processing rules for Content-Type have been implemented for send with String as parameter, but not for Document, but both should be treated the same according to the spec [1]. This patch implements this. Behavior matches Firefox. [1] https://xhr.spec.whatwg.org/#the-send()-method Test: web-platform-tests/XMLHttpRequest/setrequestheader-content-type.htm * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::send): 2018-08-25 Yusuke Suzuki Shrink size of HTMLCollection https://bugs.webkit.org/show_bug.cgi?id=188945 Reviewed by Darin Adler. Shrink the size of HTMLCollection by reordering members. No behavior change. * html/HTMLCollection.cpp: (WebCore::HTMLCollection::HTMLCollection): * html/HTMLCollection.h: 2018-08-25 Yusuke Suzuki Shrink size of XMLHttpRequest https://bugs.webkit.org/show_bug.cgi?id=188944 Reviewed by Saam Barati. Shrink the size of XMLHttpRequest by packing bits and reordering members. It reduces the size from 1248 to 1176. No behavior change. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::XMLHttpRequest): (WebCore::XMLHttpRequest::responseText): (WebCore::XMLHttpRequest::createResponseBlob): (WebCore::XMLHttpRequest::createResponseArrayBuffer): (WebCore::XMLHttpRequest::setResponseType): (WebCore::XMLHttpRequest::changeState): (WebCore::XMLHttpRequest::callReadyStateChangeListener): (WebCore::XMLHttpRequest::setWithCredentials): (WebCore::XMLHttpRequest::open): (WebCore::XMLHttpRequest::prepareToSend): (WebCore::XMLHttpRequest::createRequest): (WebCore::XMLHttpRequest::abort): (WebCore::XMLHttpRequest::overrideMimeType): (WebCore::XMLHttpRequest::setRequestHeader): (WebCore::XMLHttpRequest::getAllResponseHeaders const): (WebCore::XMLHttpRequest::getResponseHeader const): (WebCore::XMLHttpRequest::status const): (WebCore::XMLHttpRequest::statusText const): (WebCore::XMLHttpRequest::didFinishLoading): (WebCore::XMLHttpRequest::createDecoder const): (WebCore::XMLHttpRequest::didReceiveData): (WebCore::XMLHttpRequest::didReachTimeout): (WebCore::XMLHttpRequest::readyState const): Deleted. * xml/XMLHttpRequest.h: (WebCore::XMLHttpRequest::responseType const): (WebCore::XMLHttpRequest::readyState const): * xml/XMLHttpRequestProgressEventThrottle.cpp: (WebCore::XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle): * xml/XMLHttpRequestProgressEventThrottle.h: 2018-08-26 Youenn Fablet Make IDBCursor::m_request a WeakPtr https://bugs.webkit.org/show_bug.cgi?id=188938 Reviewed by Alex Christensen. Make m_request a WeakPtr so that if m_request is destroyed, the related cursor will not use the invalid pointer. Covered by existing tests. * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::continuePrimaryKey): Other continue and advance methods that are calling uncheckedIterateCursor do check for m_request. Apply the same check for continuePrimaryKey. (WebCore::IDBCursor::uncheckedIterateCursor): * Modules/indexeddb/IDBCursor.h: (WebCore::IDBCursor::setRequest): (WebCore::IDBCursor::clearRequest): (WebCore::IDBCursor::request): * Modules/indexeddb/IDBRequest.h: 2018-08-26 Youenn Fablet IDBCursor does not need to be an ActiveDOMObject https://bugs.webkit.org/show_bug.cgi?id=188937 Reviewed by Alex Christensen. Remove ActiveDOMObject from IDBCursor IDL. Update constructors and call sites accordingly. This allows removing m_outstandingRequestCount and related code in IDBRequest. Covered by existing tests. * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::create): (WebCore::IDBCursor::IDBCursor): (WebCore::IDBCursor::update): (WebCore::IDBCursor::uncheckedIterateCursor): (WebCore::IDBCursor::deleteFunction): (WebCore::IDBCursor::activeDOMObjectName const): Deleted. (WebCore::IDBCursor::canSuspendForDocumentSuspension const): Deleted. (WebCore::IDBCursor::hasPendingActivity const): Deleted. (WebCore::IDBCursor::decrementOutstandingRequestCount): Deleted. * Modules/indexeddb/IDBCursor.h: * Modules/indexeddb/IDBCursor.idl: * Modules/indexeddb/IDBCursorWithValue.cpp: (WebCore::IDBCursorWithValue::create): (WebCore::IDBCursorWithValue::IDBCursorWithValue): * Modules/indexeddb/IDBCursorWithValue.h: * Modules/indexeddb/IDBCursorWithValue.idl: * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::setSource): (WebCore::IDBRequest::dispatchEvent): (WebCore::IDBRequest::willIterateCursor): (WebCore::IDBRequest::didOpenOrIterateCursor): * Modules/indexeddb/IDBRequest.h: * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::requestOpenCursor): * WebCore.xcodeproj/project.pbxproj: 2018-08-24 Ryosuke Niwa Add getModifierState to MouseEvent https://bugs.webkit.org/show_bug.cgi?id=188913 Reviewed by Simon Fraser. Moved getModifierState from KeyboardEvent to UIEventWithKeyState and exposed it in MouseEvent. See https://www.w3.org/TR/2016/WD-uievents-20160804/#mouseevent This patch also fixes the bug that initMouseEvent was not clearing AltGraph and CapsLock states, which was preserved in the refactoring done in r235158. Tests: fast/events/constructors/mouse-event-getModifierState.html fast/events/dblclick-event-getModifierState.html * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::getModifierState const): Moved to UIEventWithKeyState. * dom/KeyboardEvent.h: * dom/KeyboardEvent.idl: Insert a blank line to match the spec's IDL. * dom/MouseEvent.idl: Added getModifierState. * dom/UIEventWithKeyState.cpp: (WebCore::UIEventWithKeyState::modifiersFromInitializer): Moved from the header file. (WebCore::UIEventWithKeyState::getModifierState const): (WebCore::UIEventWithKeyState::setModifierKeys): Moved from the header file. * dom/UIEventWithKeyState.h: (WebCore::UIEventWithKeyState::modifierKeys const): (WebCore::UIEventWithKeyState::setModifierKeys): Deleted the variant which didn't take altGraphKey since that variant behaves same as the one which takes altGraphKey. 2018-08-24 Antti Koivisto Allow creating WeakPtrs to const objects https://bugs.webkit.org/show_bug.cgi?id=188785 Reviewed by Geoff Garen. Remove some unneeded const_casts. * css/MediaQueryEvaluator.cpp: (WebCore::MediaQueryEvaluator::MediaQueryEvaluator): (WebCore::MediaQueryEvaluator::evaluate const): * css/MediaQueryEvaluator.h: * rendering/FloatingObjects.cpp: (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter): (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter): (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter): (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter): (WebCore::FloatingObjects::FloatingObjects): * rendering/FloatingObjects.h: (WebCore::FloatingObjects::renderer const): 2018-08-23 Ryosuke Niwa initKeyboardEvent doesn't clear CapsLock state https://bugs.webkit.org/show_bug.cgi?id=188909 Reviewed by Wenson Hsieh. Fixed the bug by not preserving CapsLock state in setModifierKeys variant which takes boolean for altGraphKey, which is only called by KeyboardEvent::initKeyboardEvent. Test: fast/events/init-event-clears-capslock.html * dom/UIEventWithKeyState.h: (WebCore::UIEventWithKeyState::setModifierKeys): 2018-08-23 Saam barati JSRunLoopTimer may run part of a member function after it's destroyed https://bugs.webkit.org/show_bug.cgi?id=188426 Reviewed by Mark Lam. * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::ResourceUsageThread::platformThreadBody): * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::ResourceUsageThread::platformThreadBody): 2018-08-23 Mark Lam Move vmEntryGlobalObject() to VM from CallFrame. https://bugs.webkit.org/show_bug.cgi?id=188900 Reviewed by Michael Saboff. No new tests needed because this patch does not introduce new functionality. * bindings/js/JSCustomXPathNSResolver.cpp: (WebCore::JSCustomXPathNSResolver::create): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::callerGlobalObject): (WebCore::toJSDOMGlobalObject): Deleted. * bindings/js/JSDOMWindowBase.cpp: (WebCore::firstDOMWindow): * bridge/c/c_utility.cpp: (JSC::Bindings::convertValueToNPVariant): * bridge/objc/WebScriptObject.mm: (WebCore::addExceptionToConsole): * bridge/objc/objc_instance.mm: (ObjcInstance::moveGlobalExceptionToExecState): * bridge/objc/objc_runtime.mm: (JSC::Bindings::convertValueToObjcObject): * bridge/objc/objc_utility.mm: (JSC::Bindings::convertValueToObjcValue): * testing/Internals.cpp: (WebCore::Internals::cloneArrayBuffer): 2018-08-22 Rob Buis Fetch: Stop checking Request.integrity's value in no-cors mode https://bugs.webkit.org/show_bug.cgi?id=188802 Reviewed by Frédéric Wang. Remove this check since it was removed from the spec. Behavior matches Chrome and Firefox. Test: http/tests/subresource-integrity/sri-fetch.js: * Modules/fetch/FetchRequest.cpp: (WebCore::FetchRequest::initializeOptions): 2018-08-22 Ms2ger [GTK] Never return an uninitialized ImageGStreamer object. https://bugs.webkit.org/show_bug.cgi?id=188305 Reviewed by Philippe Normand. The single caller was already checking for a null return value, so make that check actually do something. Also remove the null-check on the return value of image(), which asserted that it would never return null. Test: fast/canvas/canvas-createPattern-video-loading.html * platform/graphics/gstreamer/ImageGStreamer.h: (WebCore::ImageGStreamer::createImage): Return null if m_image wasn't created. (WebCore::ImageGStreamer::image): Return a reference. (WebCore::ImageGStreamer::rect): Always assert that m_image is present. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::paint): Update for new signature. 2018-08-22 Zalan Bujtas Add changes missing from r234925. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::isMarginTopCollapsedWithParent): (WebCore::Layout::isMarginBottomCollapsedThrough): (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent): 2018-08-22 Carlos Garcia Campos Do not try to update the compositing policy when not in accelerated compositing mode https://bugs.webkit.org/show_bug.cgi?id=188787 Reviewed by Simon Fraser. RenderLayerCompositor::updateCompositingPolicy() is called very often (called from RenderLayerCompositor::cacheAcceleratedCompositingFlags()) and it uses WTF::memoryFootprint() to decide the current compositing policy. Getting the memory footprint is an expensive operation in Linux (and I suspect other non-cocoa ports too), causing an excessive CPU usage. This caused the WPE and GTK+ unit test /webkit/WebKitWebContext/uri-scheme to start timing out in the bots, because the test expects things to happen fast and that's no longer the case. We could reduce the CPU usage a lot by not trying to update the policy when not in accelerated compositing mode. We will need a solution for the accelerated compositing mode, though. Fixes WPE/GTK+ unit test /webkit/WebKitWebContext/uri-scheme. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingPolicy): Return early when not in accelerated compositing mode. 2018-08-21 Ryosuke Niwa Replace booleans for modifier keys in UIEventWithKeyState with OptionSet https://bugs.webkit.org/show_bug.cgi?id=188777 Reviewed by Simon Fraser. Replaced boolean arguments and instance variables for modifier keys (ctrl, alt, shift, and meta keys) in UIEventWithKeyState with OptionSet and isSimulated boolean in MouseRelatedEvent with IsSimulated enum class. Also made movementDelta always compiled instead of only when ENABLE(POINTER_LOCK) to simplify the code. No new tests since there should be no observable behavioral change. * dom/Element.cpp: (WebCore::Element::dispatchMouseEvent): * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::KeyboardEvent): (WebCore::KeyboardEvent::initKeyboardEvent): Call setModifierKeys. * dom/MouseEvent.cpp: (WebCore::MouseEvent::create): (WebCore::MouseEvent::MouseEvent): (WebCore::MouseEvent::initMouseEvent): Ditto. * dom/MouseEvent.h: * dom/MouseRelatedEvent.cpp: (WebCore::MouseRelatedEvent::MouseRelatedEvent): Added a new variant which takes the minimum arguments for gesture & touch events. In those events, detail is always set to 0, movementDelta is always set to 0,0, and they are never simulated. * dom/MouseRelatedEvent.h: (WebCore::MouseRelatedEvent::IsSimulated): Added. * dom/SimulatedClick.cpp: (WebCore::SimulatedMouseEvent::SimulatedMouseEvent): Get OptionSet out of the underlying event instead of manually setting each key state. This code now preserves the state of caps lock and alt-graph keys but this is not observable because we have yet to implement getModifierState on MouseEvent. (WebCore::SimulatedMouseEvent::modifiersFromUnderlyingEvent): Added. * dom/TouchEvent.cpp: (WebCore::TouchEvent::TouchEvent): * dom/TouchEvent.h: * dom/UIEventWithKeyState.h: (WebCore::UIEventWithKeyState::Modifier): Alias to PlatformEvent::Modifier. (WebCore::UIEventWithKeyState::ctrlKey const): Updated to use m_modifiers. (WebCore::UIEventWithKeyState::shiftKey const): Ditto. (WebCore::UIEventWithKeyState::altKey const): Ditto. (WebCore::UIEventWithKeyState::metaKey const): Ditto. (WebCore::UIEventWithKeyState::altGraphKey const): Ditto. (WebCore::UIEventWithKeyState::capsLockKey const): Ditto. (WebCore::UIEventWithKeyState::modifierKeys): Added. (WebCore::UIEventWithKeyState::UIEventWithKeyState): Now takes OptionSet. (WebCore::UIEventWithKeyState::setModifierKeys): Added. Used by init*Event functions in subclasses. Note that these functions preseve the states of alt-graph and caps lock keys to match the existing behaviors in this cleanup patch but they don't match behaviors of Chrome or Firefox. (WebCore::UIEventWithKeyState::modifiersFromInitializer): Added. * dom/WheelEvent.cpp: (WebCore::WheelEvent::WheelEvent): Simulated::No corresponds to the last boolean being false. * page/EventHandler.cpp: (WebCore::EventHandler::dispatchDragEvent): (WebCore::EventHandler::handleTouchEvent): * platform/PlatformEvent.h: (WebCore::PlatformEvent::Modifier): Added AltGraphKey. * platform/mac/PlatformEventFactoryMac.h: (WebCore::modifiersForEvent): Exported to be used in [WebPDFView PDFViewWillClickOnLink:withURL:]. * platform/mac/PlatformEventFactoryMac.mm: (WebCore::modifiersForEvent): * testing/Internals.cpp: (WebCore::Internals::accessKeyModifiers const): 2018-08-21 Daniel Bates Disallow navigations when page cache updates the current document of the frame https://bugs.webkit.org/show_bug.cgi?id=188422 Reviewed by Ryosuke Niwa. Make use of NavigationDisabler to disallow navigations when associating the cached document back with its frame (i.e. calling Frame::setDocument()). When we associate a cached document with its frame we will construct its render tree and run post style resolution callbacks that can do anything, including performing a frame load. Until page restoration is comnplete the frame tree is in a transient state that makes reasoning about it difficult and error prone. We should not allow navigations in this state. Test: fast/history/go-back-to-object-subframe.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::open): 2018-08-21 Daniel Bates Replace TextCheckingTypeMask with OptionSet https://bugs.webkit.org/show_bug.cgi?id=188678 Reviewed by Antti Koivisto. Replaces TextCheckingTypeMask with an OptionSet to improve type safety and code clarity. Additionally change the values of TextCheckingType such that all the enumerators fit within an uint8_t. * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::hasMisspelling const): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (AXAttributeStringSetSpelling): * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::timerFired): (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult): * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): (WebCore::isAutomaticTextReplacementType): (WebCore::Editor::markAndReplaceFor): For now, change a local variable from const to non-const to work around the following MSVC compiler bug: . (WebCore::Editor::markMisspellingsAndBadGrammar): (WebCore::Editor::updateMarkersForWordsAffectedByEditing): (WebCore::Editor::editorUIUpdateTimerFired): (WebCore::Editor::resolveTextCheckingTypeMask): * editing/Editor.h: * editing/SpellChecker.cpp: (WebCore::SpellCheckRequest::SpellCheckRequest): (WebCore::SpellCheckRequest::create): (WebCore::SpellChecker::didCheckSucceed): * editing/SpellChecker.h: * editing/TextCheckingHelper.cpp: (WebCore::findGrammaticalErrors): (WebCore::findMisspellings): (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const): (WebCore::checkTextOfParagraph): * editing/TextCheckingHelper.h: * loader/EmptyClients.cpp: * platform/text/TextCheckerClient.h: * platform/text/TextChecking.h: Remove TextCheckingTypeMask. Reorganized the fields of TextCheckingRequestData to coallesce padding and move it to the end of class. Also used default initializer syntax and defaulted (= default) the default constructor of TextCheckingRequestData, removing the need for a user-defined default constructor. (WebCore::TextCheckingRequestData::TextCheckingRequestData): (WebCore::TextCheckingRequestData::text const): Changed return type from String to const String& to avoid unnecessary ref-count churn for callers that do not need to take a shared ownership in this string. (WebCore::TextCheckingRequestData::checkingTypes const): Renamed; formerly named mask. (WebCore::TextCheckingRequestData::mask const): Deleted. * platform/text/mac/TextCheckingMac.mm: Added. (WebCore::nsTextCheckingTypes): * testing/Internals.cpp: (WebCore::Internals::handleAcceptedCandidate): 2018-08-21 Fujii Hironori Don't place "using namespace XXX;" in global space for unified source builds https://bugs.webkit.org/show_bug.cgi?id=188739 Reviewed by Yusuke Suzuki. No new tests (No behavior change). * html/track/AudioTrackList.cpp: * html/track/TextTrackList.cpp: * html/track/VideoTrackList.cpp: * page/SecurityOriginData.cpp: * page/TextIndicator.cpp: * platform/geoclue/GeolocationProviderGeoclue.cpp: * platform/graphics/gstreamer/ImageGStreamerCairo.cpp: * platform/graphics/win/FullScreenController.cpp: * platform/mediastream/CaptureDeviceManager.cpp: * platform/mock/MediaPlaybackTargetPickerMock.cpp: * svg/animation/SMILTime.cpp: * testing/js/WebCoreTestSupport.cpp: * xml/XPathParser.cpp: 2018-08-21 Philippe Normand [GStreamer] Warn early about incomplete MSE track switching support https://bugs.webkit.org/show_bug.cgi?id=188653 Reviewed by Xabier Rodriguez-Calvar. The proper track switching support shall be fixed at some point by: https://bugs.webkit.org/show_bug.cgi?id=182531. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Remove redundant test. (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Exit early if this method is called by the MSE player. 2018-08-21 Philippe Normand [GStreamer][MSE] Generic main thread notification support https://bugs.webkit.org/show_bug.cgi?id=188647 Reviewed by Xabier Rodriguez-Calvar. Using GstBus for main thread notifications has the side effect of "leaking" the application messages to the media player, leading to CPU cycles wasting. No new tests, existing MSE tests cover this change. * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: (webkit_media_src_init): (webKitMediaSrcFinalize): (webKitMediaSrcSetMediaPlayerPrivate): * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h: 2018-08-21 Philippe Normand [GStreamer][MSE] Remove parsers from playback pipeline https://bugs.webkit.org/show_bug.cgi?id=188646 Reviewed by Xabier Rodriguez-Calvar. Decodebin already includes parsers in front of the decoders. No new tests, existing MSE tests cover this change. * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: (WebCore::PlaybackPipeline::addSourceBuffer): (WebCore::PlaybackPipeline::attachTrack): * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: (webKitMediaSrcLinkSourcePad): * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h: 2018-08-21 Commit Queue Unreviewed, rolling out r234979. https://bugs.webkit.org/show_bug.cgi?id=188780 broke ubuntu LTS build (Requested by philn on #webkit). Reverted changeset: "[GTK] Never return an uninitialized ImageGStreamer object." https://bugs.webkit.org/show_bug.cgi?id=188305 https://trac.webkit.org/changeset/234979 2018-08-20 Devin Rousso Web Inspector: allow breakpoints to be set for specific event listeners https://bugs.webkit.org/show_bug.cgi?id=183138 Reviewed by Joseph Pecoraro. Test: inspector/dom/breakpoint-for-event-listener.html * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::getEventListenersForNode): (WebCore::InspectorDOMAgent::setEventListenerDisabled): (WebCore::InspectorDOMAgent::setBreakpointForEventListener): Added. (WebCore::InspectorDOMAgent::removeBreakpointForEventListener): Added. (WebCore::InspectorDOMAgent::buildObjectForEventListener): (WebCore::InspectorDOMAgent::willRemoveEventListener): (WebCore::InspectorDOMAgent::isEventListenerDisabled): (WebCore::InspectorDOMAgent::hasBreakpointForEventListener): Added. (WebCore::InspectorDOMAgent::idForEventListener): Added. Rework the event listener data structure to be based on ID instead of `EventListener`, since it is possible to have the same `EventListener` be used for multiple events. * inspector/agents/InspectorDOMDebuggerAgent.h: * inspector/agents/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): (WebCore::InspectorDOMDebuggerAgent::willHandleEvent): Added. (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): For DOM events, also check to see if there is a matching event listener specific breakpoint set via the DOMAgent, and break on it if one is found. * inspector/InspectorInstrumentation.h: * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::didInstallTimerImpl): (WebCore::InspectorInstrumentation::didRemoveTimerImpl): (WebCore::InspectorInstrumentation::willHandleEventImpl): (WebCore::InspectorInstrumentation::willFireTimerImpl): (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded): (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl): (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl): (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl): Split off `pauseOnNativeEventIfNeeded` to only handle non-DOM events, since all DOM events would already only go through `willHandleEvent`. 2018-08-20 Michael Catanzaro [CMake] Sync unified build with Cocoa ports https://bugs.webkit.org/show_bug.cgi?id=188732 Reviewed by Tim Horton. For iOS, disambiguate between ::WebEvent declared in PlatformKeyboardEvent.h and WebCore::WebEvent declared in WebEvent.h. It's expected that we'll have to deal with random issues like this when modifying unrelated source files in higher-level projects, since any change to the sources list changes which files get bundled together, and headers from lower-level projects that were not included before may now be included together. * platform/PlatformKeyboardEvent.h: (WebCore::PlatformKeyboardEvent::event const): 2018-08-20 Rob Buis Throw an exception if window.open() gets passed a URL that cannot be parsed https://bugs.webkit.org/show_bug.cgi?id=171656 Reviewed by Darin Adler. Throw a SyntaxError exception when an invalid url gets passed into window.open(). Tests: imported/w3c/web-platform-tests/url/failure.html fast/dom/Window/open-invalid-url.html * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): (WebCore::DOMWindow::open): (WebCore::DOMWindow::showModalDialog): * page/DOMWindow.h: * page/DOMWindow.idl: * testing/Internals.cpp: (WebCore::Internals::openDummyInspectorFrontend): 2018-08-20 Ms2ger [SOUP] Check length before calling soup_message_body_append_buffer. https://bugs.webkit.org/show_bug.cgi?id=176803 Reviewed by Carlos Garcia Campos. The function has a precondition that the buffer is non-empty. Test: http/tests/local/blob/send-hybrid-blob-using-open-panel.html * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::appendEncodedBlobItemToSoupMessageBody): (WebCore::ResourceRequest::updateSoupMessageBody const): 2018-08-20 Rob Buis Relax Request constructor around referrers https://bugs.webkit.org/show_bug.cgi?id=168649 Reviewed by Darin Adler. Implement remaining part of fetch change https://github.com/whatwg/fetch/pull/377, i.e. if "parsedReferrer’s origin is not same origin with origin", then set request’s referrer to "client", instead of throwing an exception [1]. WebKit's new behavior matches that of Chrome and Firefox. Testing is covered by existing wpt tests. [1] Step 15.3.3 of https://fetch.spec.whatwg.org/#main-fetch * Modules/fetch/FetchRequest.cpp: (WebCore::computeReferrer): 2018-08-19 Yusuke Suzuki Shrink size of WebCore::Event further by reordering members https://bugs.webkit.org/show_bug.cgi?id=188734 Reviewed by Daniel Bates. Since WebCore::Event is ref-counted class, it has 4bytes m_refCount at the head of the class. So placing 4bytes just after that before placing 8bytes aligned member (like pointers in 64bit platforms) can save the size of WebCore::Event further. This patch reorders members of WebCore::Event to shrink the size from 80bytes to 72bytes. No behavior change. * dom/Event.cpp: (WebCore::Event::Event): * dom/Event.h: 2018-08-18 Ali Juma [IntersectionObserver] Fire an initial dummy notification https://bugs.webkit.org/show_bug.cgi?id=188670 Reviewed by Simon Fraser. Add logic to track ongoing intersection observations. Create an IntersectionObserverRegistration and fire a single dummy notification for each one. Test: intersection-observer/root-element-moved.html Also tested by existing tests in imported/w3c/web-platform-tests/intersection-observer. * dom/Document.cpp: (WebCore::Document::~Document): (WebCore::Document::addIntersectionObserver): (WebCore::Document::removeIntersectionObserver): (WebCore::Document::updateIntersectionObservations): (WebCore::Document::notifyIntersectionObserversTimerFired): * dom/Document.h: (WebCore::Document::numberOfIntersectionObservers const): * dom/Element.cpp: (WebCore::Element::didMoveToNewDocument): (WebCore::Element::disconnectFromIntersectionObservers): * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::create): (WebCore::IntersectionObserver::IntersectionObserver): (WebCore::IntersectionObserver::~IntersectionObserver): (WebCore::IntersectionObserver::observe): (WebCore::IntersectionObserver::unobserve): (WebCore::IntersectionObserver::disconnect): (WebCore::IntersectionObserver::takeRecords): (WebCore::IntersectionObserver::targetDestroyed): (WebCore::IntersectionObserver::removeTargetRegistration): (WebCore::IntersectionObserver::removeAllTargets): (WebCore::IntersectionObserver::rootDestroyed): (WebCore::IntersectionObserver::appendQueuedEntry): (WebCore::IntersectionObserver::notify): * page/IntersectionObserver.h: (WebCore::IntersectionObserver::trackingDocument): (WebCore::IntersectionObserver:: const): (WebCore::IntersectionObserver::hasObservationTargets const): * page/IntersectionObserver.idl: * testing/Internals.cpp: (WebCore::Internals::numberOfIntersectionObservers const): * testing/Internals.h: * testing/Internals.idl: 2018-08-17 Ryosuke Niwa Pack booleans in Event into a bitfield https://bugs.webkit.org/show_bug.cgi?id=188713 Reviewed by Daniel Bates. Use bitfields for booleans in Event class. * dom/Event.cpp: (WebCore::Event::Event): * dom/Event.h: (WebCore::Event::IsComposed): Added. (WebCore::Event): Packed booleans into a bitfield. 2018-08-17 Alex Christensen Clean up CSSSelectorList after r234825 https://bugs.webkit.org/show_bug.cgi?id=188566 Reviewed by Megan Gardner. This is responding to Darin's feedback in https://bugs.webkit.org/show_bug.cgi?id=188539 * css/CSSSelectorList.cpp: (WebCore::CSSSelectorList::operator=): Deleted. * css/CSSSelectorList.h: (WebCore::CSSSelectorList::CSSSelectorList): * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::parsePageSelector): * css/parser/CSSSelectorParser.cpp: (WebCore::CSSSelectorParser::consumeComplexSelectorList): (WebCore::CSSSelectorParser::consumeCompoundSelectorList): 2018-08-17 Brent Fulgham Remove Adobe SSO exception now that StorageAccess API is available https://bugs.webkit.org/show_bug.cgi?id=188710 Reviewed by Alex Christensen. Remove custom quirk now that proper API exists to allow the same functions. * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::logSubresourceLoading): Remove unneeded quirk. (WebCore::resourceNeedsSSOQuirk): Deleted. 2018-08-17 Ryosuke Niwa Replace canBubble and cancelable booleans in Event by enum classes https://bugs.webkit.org/show_bug.cgi?id=188692 Rubber-stamped by Alex Christensen. Make these enum classes uint8_t. * dom/Event.h: 2018-08-16 Ryosuke Niwa Replace canBubble and cancelable booleans in Event by enum classes https://bugs.webkit.org/show_bug.cgi?id=188692 Reviewed by Alex Christensen. Replaced booleans indicating whether an event can bubble and an event is cancelable by two enum classes: CanBubble and IsCancelable. No new tests since there should be no behavioral changes. * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp: (WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent): * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp: (WebCore::ApplePayPaymentAuthorizedEvent::ApplePayPaymentAuthorizedEvent): * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp: (WebCore::ApplePayPaymentMethodSelectedEvent::ApplePayPaymentMethodSelectedEvent): * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::didCancelPaymentSession): * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp: (WebCore::ApplePayShippingContactSelectedEvent::ApplePayShippingContactSelectedEvent): * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp: (WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent): * Modules/applepay/ApplePayValidateMerchantEvent.cpp: (WebCore::ApplePayValidateMerchantEvent::ApplePayValidateMerchantEvent): * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::updateKeyStatuses): * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp: (WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent): * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp: (WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent): * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp: (WebCore::WebKitMediaKeySession::addKeyTimerFired): (WebCore::WebKitMediaKeySession::sendError): * Modules/gamepad/GamepadEvent.cpp: (WebCore::GamepadEvent::GamepadEvent): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::connectionToServerLost): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::onError): (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): (WebCore::IDBOpenDBRequest::onSuccess): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::onError): (WebCore::IDBRequest::onSuccess): * Modules/indexeddb/IDBRequestCompletionEvent.cpp: (WebCore::IDBRequestCompletionEvent::IDBRequestCompletionEvent): * Modules/indexeddb/IDBRequestCompletionEvent.h: (WebCore::IDBRequestCompletionEvent::create): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::fireOnComplete): (WebCore::IDBTransaction::fireOnAbort): * Modules/indexeddb/IDBVersionChangeEvent.cpp: (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent): * Modules/mediasession/MediaSession.cpp: (WebCore::MediaSession::skipToNextTrack): (WebCore::MediaSession::skipToPreviousTrack): * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::scheduleEvent): * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::scheduleEvent): * Modules/mediasource/SourceBufferList.cpp: (WebCore::SourceBufferList::scheduleEvent): * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::scheduledEventTimerFired): * Modules/mediastream/MediaStream.cpp: (WebCore::MediaStream::internalAddTrack): (WebCore::MediaStream::internalRemoveTrack): * Modules/mediastream/MediaStreamEvent.cpp: (WebCore::MediaStreamEvent::create): (WebCore::MediaStreamEvent::MediaStreamEvent): * Modules/mediastream/MediaStreamEvent.h: * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::trackEnded): (WebCore::MediaStreamTrack::trackMutedChanged): * Modules/mediastream/MediaStreamTrackEvent.cpp: (WebCore::MediaStreamTrackEvent::create): (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent): * Modules/mediastream/MediaStreamTrackEvent.h: * Modules/mediastream/OverconstrainedErrorEvent.h: (WebCore::OverconstrainedErrorEvent::create): (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent): * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::fireICECandidateEvent): (WebCore::PeerConnectionBackend::doneGatheringCandidates): (WebCore::PeerConnectionBackend::updateSignalingState): * Modules/mediastream/RTCDTMFToneChangeEvent.cpp: (WebCore::RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent): * Modules/mediastream/RTCDataChannel.cpp: (WebCore::RTCDataChannel::didChangeReadyState): (WebCore::RTCDataChannel::didDetectError): (WebCore::RTCDataChannel::bufferedAmountIsDecreasing): * Modules/mediastream/RTCDataChannelEvent.cpp: (WebCore::RTCDataChannelEvent::create): (WebCore::RTCDataChannelEvent::RTCDataChannelEvent): * Modules/mediastream/RTCDataChannelEvent.h: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::updateIceGatheringState): (WebCore::RTCPeerConnection::updateIceConnectionState): (WebCore::RTCPeerConnection::updateConnectionState): (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent): * Modules/mediastream/RTCPeerConnectionIceEvent.cpp: (WebCore::RTCPeerConnectionIceEvent::create): (WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent): * Modules/mediastream/RTCPeerConnectionIceEvent.h: * Modules/mediastream/RTCTrackEvent.cpp: (WebCore::RTCTrackEvent::create): (WebCore::RTCTrackEvent::RTCTrackEvent): * Modules/mediastream/RTCTrackEvent.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::addRemoteStream): (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack): (WebCore::LibWebRTCMediaEndpoint::addDataChannel): * Modules/notifications/Notification.cpp: (WebCore::Notification::dispatchShowEvent): (WebCore::Notification::dispatchClickEvent): (WebCore::Notification::dispatchCloseEvent): (WebCore::Notification::dispatchErrorEvent): * Modules/paymentrequest/MerchantValidationEvent.cpp: (WebCore::MerchantValidationEvent::MerchantValidationEvent): * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp: (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent): * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::QuickTimePluginReplacement::postEvent): * Modules/speech/SpeechSynthesisEvent.cpp: (WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent): * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::setState): * Modules/webaudio/AudioProcessingEvent.cpp: (WebCore::AudioProcessingEvent::AudioProcessingEvent): * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::finish): * Modules/webaudio/OfflineAudioCompletionEvent.cpp: (WebCore::OfflineAudioCompletionEvent::OfflineAudioCompletionEvent): * Modules/websockets/CloseEvent.h: (WebCore::CloseEvent::CloseEvent): * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::didConnect): (WebCore::WebSocket::dispatchOrQueueErrorEvent): * Modules/webvr/VRDisplayEvent.cpp: (WebCore::VRDisplayEvent::VRDisplayEvent): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const): * accessibility/AccessibleSetValueEvent.cpp: (WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent): * animation/AnimationPlaybackEvent.cpp: (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent): * dom/AbortSignal.cpp: (WebCore::AbortSignal::abort): * dom/AnimationEvent.cpp: (WebCore::AnimationEvent::AnimationEvent): * dom/BeforeLoadEvent.h: * dom/BeforeTextInsertedEvent.cpp: (WebCore::BeforeTextInsertedEvent::BeforeTextInsertedEvent): * dom/BeforeUnloadEvent.cpp: (WebCore::BeforeUnloadEvent::BeforeUnloadEvent): * dom/CharacterData.cpp: (WebCore::CharacterData::dispatchModifiedEvent): * dom/CompositionEvent.cpp: (WebCore::CompositionEvent::CompositionEvent): * dom/ContainerNode.cpp: (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/DeviceMotionEvent.cpp: (WebCore::DeviceMotionEvent::DeviceMotionEvent): * dom/DeviceOrientationEvent.cpp: (WebCore::DeviceOrientationEvent::DeviceOrientationEvent): * dom/Document.cpp: (WebCore::Document::setReadyState): (WebCore::Document::visibilityStateChanged): (WebCore::Document::finishedParsing): (WebCore::Document::dispatchFullScreenChangeOrErrorEvent): (WebCore::Document::orientationChanged): * dom/DocumentEventQueue.cpp: (WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent): (WebCore::DocumentEventQueue::enqueueScrollEvent): (WebCore::DocumentEventQueue::enqueueResizeEvent): * dom/DocumentEventQueue.h: * dom/Element.cpp: (WebCore::Element::dispatchMouseEvent): (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): (WebCore::Element::dispatchFocusEvent): (WebCore::Element::dispatchBlurEvent): (WebCore::Element::dispatchWebKitImageReadyEventForTesting): * dom/ErrorEvent.cpp: (WebCore::ErrorEvent::ErrorEvent): * dom/Event.cpp: (WebCore::Event::Event): (WebCore::Event::create): * dom/Event.h: * dom/FocusEvent.cpp: (WebCore::FocusEvent::FocusEvent): * dom/FocusEvent.h: * dom/HashChangeEvent.h: * dom/InputEvent.cpp: (WebCore::InputEvent::create): (WebCore::InputEvent::InputEvent): * dom/InputEvent.h: * dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::KeyboardEvent): * dom/MessageEvent.cpp: (WebCore::MessageEvent::MessageEvent): * dom/MouseEvent.cpp: (WebCore::MouseEvent::create): (WebCore::MouseEvent::MouseEvent): * dom/MouseEvent.h: * dom/MouseRelatedEvent.cpp: (WebCore::MouseRelatedEvent::MouseRelatedEvent): * dom/MouseRelatedEvent.h: * dom/MutationEvent.cpp: (WebCore::MutationEvent::MutationEvent): * dom/MutationEvent.h: * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): (WebCore::Node::dispatchInputEvent): * dom/OverflowEvent.cpp: (WebCore::OverflowEvent::OverflowEvent): * dom/PageTransitionEvent.cpp: (WebCore::PageTransitionEvent::PageTransitionEvent): * dom/PopStateEvent.cpp: (WebCore::PopStateEvent::PopStateEvent): * dom/ProgressEvent.cpp: (WebCore::ProgressEvent::ProgressEvent): * dom/ScriptElement.cpp: (WebCore::ScriptElement::dispatchErrorEvent): * dom/SecurityPolicyViolationEvent.h: * dom/SimulatedClick.cpp: * dom/TextEvent.cpp: (WebCore::TextEvent::TextEvent): * dom/TransitionEvent.cpp: (WebCore::TransitionEvent::TransitionEvent): * dom/UIEvent.cpp: (WebCore::UIEvent::UIEvent): * dom/UIEvent.h: (WebCore::UIEvent::create): * dom/UIEventWithKeyState.h: (WebCore::UIEventWithKeyState::UIEventWithKeyState): * dom/WebKitAnimationEvent.cpp: (WebCore::WebKitAnimationEvent::WebKitAnimationEvent): * dom/WebKitTransitionEvent.cpp: (WebCore::WebKitTransitionEvent::WebKitTransitionEvent): * dom/WheelEvent.cpp: (WebCore::WheelEvent::WheelEvent): * editing/Editor.cpp: (WebCore::dispatchBeforeInputEvent): (WebCore::dispatchBeforeInputEvents): (WebCore::Editor::willApplyEditing const): * editing/FrameSelection.cpp: (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance): (WebCore::FrameSelection::selectAll): (WebCore::FrameSelection::dispatchSelectStart): * html/HTMLDetailsElement.cpp: (WebCore::HTMLDetailsElement::dispatchPendingEvent): * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::dispatchChangeEvent): (WebCore::HTMLFormControlElement::checkValidity): * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::prepareForSubmission): (WebCore::HTMLFormElement::reset): * html/HTMLImageLoader.cpp: (WebCore::HTMLImageLoader::dispatchLoadEvent): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::onSearch): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::dispatchPendingEvent): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::scheduleEvent): (WebCore::HTMLMediaElement::notifyAboutPlaying): (WebCore::HTMLMediaElement::updateActiveTextTrackCues): (WebCore::HTMLMediaElement::layoutSizeChanged): * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::checkSnapshotStatus): * html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::dispatchLoadEvent): * html/HTMLSlotElement.cpp: (WebCore::HTMLSlotElement::dispatchSlotChangeEvent): * html/HTMLSourceElement.cpp: (WebCore::HTMLSourceElement::errorEventTimerFired): * html/HTMLStyleElement.cpp: (WebCore::HTMLStyleElement::dispatchPendingEvent): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::selectionChanged): * html/HTMLTrackElement.cpp: (WebCore::HTMLTrackElement::didCompleteLoad): * html/MediaController.cpp: (WebCore::MediaController::scheduleEvent): * html/canvas/WebGLContextEvent.cpp: (WebCore::WebGLContextEvent::WebGLContextEvent): * html/canvas/WebGLContextEvent.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::create): (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent): (WebCore::WebGLRenderingContextBase::maybeRestoreContext): (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): * html/parser/HTMLScriptRunner.cpp: (WebCore::createScriptLoadEvent): * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: * html/track/TrackListBase.cpp: (WebCore::TrackListBase::scheduleTrackEvent): (WebCore::TrackListBase::scheduleChangeEvent): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied): * loader/FrameLoader.cpp: (WebCore::FrameLoader::dispatchUnloadEvents): * loader/ImageLoader.cpp: (WebCore::ImageLoader::dispatchPendingErrorEvent): * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * loader/appcache/ApplicationCacheHost.cpp: (WebCore::createApplicationCacheEvent): * page/DOMWindow.cpp: (WebCore::DOMWindow::dispatchAllPendingUnloadEvents): (WebCore::DOMWindow::languagesChanged): (WebCore::DOMWindow::dispatchLoadEvent): * page/EventHandler.cpp: (WebCore::dispatchSelectStart): (WebCore::EventHandler::dispatchDragEvent): * page/EventSource.cpp: (WebCore::EventSource::scheduleReconnect): (WebCore::EventSource::didReceiveResponse): (WebCore::EventSource::abortConnectionAttempt): * page/FocusController.cpp: (WebCore::dispatchEventsOnWindowAndFocusedElement): (WebCore::FocusController::setFocusedFrame): * page/FrameView.cpp: (WebCore::FrameView::sendResizeEventIfNeeded): * page/Page.cpp: (WebCore::networkStateChanged): * page/Performance.cpp: (WebCore::Performance::resourceTimingBufferFullTimerFired): * page/PointerLockController.cpp: (WebCore::PointerLockController::enqueueEvent): * page/VisualViewport.cpp: (WebCore::VisualViewport::enqueueResizeEvent): (WebCore::VisualViewport::enqueueScrollEvent): * storage/StorageEvent.cpp: (WebCore::StorageEvent::StorageEvent): * svg/SVGElement.cpp: (WebCore::SVGElement::sendSVGLoadEventIfPossible): * svg/SVGImageLoader.cpp: (WebCore::SVGImageLoader::dispatchLoadEvent): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::notifyFinished): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::dispatchPendingEvent): * workers/Worker.cpp: (WebCore::Worker::notifyFinished): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::notifyNetworkStateChange): * workers/service/ExtendableEvent.cpp: (WebCore::ExtendableEvent::ExtendableEvent): * workers/service/ExtendableEvent.h: * workers/service/ExtendableMessageEvent.cpp: (WebCore::ExtendableMessageEvent::ExtendableMessageEvent): * workers/service/ServiceWorker.cpp: (WebCore::ServiceWorker::scheduleTaskToUpdateState): * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent): * workers/service/ServiceWorkerRegistration.cpp: (WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent): * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::callReadyStateChangeListener): 2018-08-17 Yusuke Suzuki and Fujii Hironori [JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg https://bugs.webkit.org/show_bug.cgi?id=188589 Reviewed by Mark Lam. And reviewed by Yusuke Suzuki for Hironori's change. * cssjit/FunctionCall.h: (WebCore::FunctionCall::FunctionCall): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo): * html/HTMLKeygenElement.cpp: Remove `using namespace WebCore` not to introduce `operator+/-` which makes the resolution of `operator+/-` for RegisterID ambiguous. 2018-08-17 Philippe Normand [GStreamer] reduce position queries frequency https://bugs.webkit.org/show_bug.cgi?id=188645 Reviewed by Xabier Rodriguez-Calvar. There is no need to perform dozens of position queries per second. One every 300ms is enough. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone): (WebCore::MediaPlayerPrivateGStreamer::updateStates): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 2018-08-17 Michael Catanzaro [SOUP] Handle OAuth authentication after r234912 https://bugs.webkit.org/show_bug.cgi?id=188651 Reviewed by Carlos Garcia Campos. Update this switch to consider the new OAuth enum value added in r234912. I suppose OAuth is used for HTTP Auth now. It will be a one-time compatibility break as passwords previously stored with type "Unknown" will no longer be accessible. * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::authTypeFromProtectionSpaceAuthenticationScheme): 2018-08-17 Ms2ger [GTK] Never return an uninitialized ImageGStreamer object. https://bugs.webkit.org/show_bug.cgi?id=188305 Reviewed by Philippe Normand. The single caller was already checking for a null return value, so make that check actually do something. Also remove the null-check on the return value of image(), which asserted that it would never return null. Test: fast/canvas/canvas-createPattern-video-loading.html * platform/graphics/gstreamer/ImageGStreamer.h: (WebCore::ImageGStreamer::createImage): Return null if m_image wasn't created. (WebCore::ImageGStreamer::image): Return a reference. (WebCore::ImageGStreamer::rect): Always assert that m_image is present. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::paint): Update for new signature. 2018-08-17 Philippe Normand [GStreamer] Enable fpsdisplaysink only when MEDIA_STATISTICS is enabled https://bugs.webkit.org/show_bug.cgi?id=188648 Reviewed by Xabier Rodriguez-Calvar. The fpsdisplaysink is useful only when MEDIA_STATISTICS is turned on. The text overlay is now enabled when GST_DEBUG tracing is enabled for the player. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): 2018-08-17 Philippe Normand [GStreamer][MSE] Disable last-sample support in AppendPipeline https://bugs.webkit.org/show_bug.cgi?id=188649 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::AppendPipeline): This property isn't used by the append pipeline. So as a micro-optimization, it is now disabled. 2018-08-16 Devin Rousso Web Inspector: support breakpoints for arbitrary event names https://bugs.webkit.org/show_bug.cgi?id=183118 Reviewed by Joseph Pecoraro. Tests: inspector/dom-debugger/event-breakpoints.html inspector/dom-debugger/event-breakpoints-with-navigation.html * inspector/agents/InspectorDOMDebuggerAgent.cpp: (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): 2018-08-16 Alex Christensen Remove unused allowScriptsToCloseWindows setting https://bugs.webkit.org/show_bug.cgi?id=188602 Reviewed by Simon Fraser. No change in behaviour. It was always false. * page/DOMWindow.cpp: (WebCore::DOMWindow::close): * page/Settings.yaml: 2018-08-16 Ryosuke Niwa Custom element constructor doesn't use HTMLElement in new.target's realm https://bugs.webkit.org/show_bug.cgi?id=188634 Reviewed by Keith Miller. Fixed the bug that HTMLElement's constructor was constructing an element of its own realm instead of the realm of new.target. This results in the JS wrapper created for the element belonging to the global object of the HTMLElement constructor which was invoked instead of the global object of new.target as specified in: https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors In particular, step 9.2. specifies that we "perform element.[[SetPrototypeOf]](prototype)." where prototype is the result of Get(NewTarget, "prototype") in step 7. WebKit's new behavior matches that of Chrome and Firefox. Test: imported/w3c/web-platform-tests/custom-elements/htmlconstructor/newtarget.html * bindings/js/JSHTMLElementCustom.cpp: (WebCore::constructJSHTMLElement): 2018-08-16 Ryosuke Niwa Custom element doesn't invalidate its style when :defined rule starts to apply https://bugs.webkit.org/show_bug.cgi?id=188637 Reviewed by Antti Koivisto. Fixed the bug by invalidating the subtree when a custom element gets defined. Test: fast/custom-elements/defined-update-style.html * dom/Element.cpp: (WebCore::Element::setIsDefinedCustomElement): 2018-08-16 Ryosuke Niwa Perform a microtask checkpoint before creating a custom element https://bugs.webkit.org/show_bug.cgi?id=188189 Reviewed by Geoffrey Garen. Fixed the bug that the HTML parser was not performing a microtask checkpoint prior to synchronously constructing a custom element in the concept to create an element for a token: https://html.spec.whatwg.org/multipage/parsing.html#creating-and-inserting-nodes:perform-a-microtask-checkpoint Also added a microtask checkpoint before dispatching DOMContentLoaded to work around webkit.org/b/82931 since scheduling a task to fire a DOMContentLoaded event in Document::finishedParsing as the HTML5 spec mandates is a long standing bug with a lot of implications, which is completely outside the scope of this bug fix: https://html.spec.whatwg.org/multipage/parsing.html#stop-parsing Test: fast/custom-elements/perform-microtask-checkpoint-before-construction.html * dom/Document.cpp: (WebCore::Document::finishedParsing): Perform a microtask checkpoint before dispatching DOMContentLoaded here as a workaround for webkit.org/b/82931. * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Perform a microtask checkpoint here to fix the bug. 2018-08-16 Alex Christensen Re-introduce assertion removed in r234890 https://bugs.webkit.org/show_bug.cgi?id=188611 Reviewed by Geoffrey Garen. The assertion was failing because Vector::operator== was using memcmp, which failed to consider different instances of equal Strings equal. Added an API test and this assertion, which now succeeds. * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): 2018-08-16 Zan Dobersek [Nicosia] Add Nicosia::ImageBackingTextureMapperImpl https://bugs.webkit.org/show_bug.cgi?id=188550 Reviewed by Carlos Garcia Campos. Add the Nicosia::ImageBackingTextureMapperImpl class, the TextureMapper-specific implementation that will extend the ImageBacking class. This class will be used to contain and manage updates for layers that are backed by image objects. The CoordinatedGraphicsLayer instance will use the LayerState object to track the currently-presented image objects and to store the latest update of these objects. The Update struct contains information about the current visibility of the image in the layer tree as well as the Nicosia::Buffer object containing the painted image data that's to be presented on the screen. During the layer flush the flushUpdate() method will move the current update data into the pending position, from which this data will be gathered by the composition component through the takeUpdate() method and used to update the CoordinatedBackingStore object that's kept in the CompositionState object on this impl class. This will be deployed for use in the CoordinatedGraphicsLayer at a later stage as it requires a larger rework in both CoordinatedGraphicsLayer as well as the CoordinatedGraphicsScene classes. The implementation itself differs from the current image backing support in CoordinatedGraphicsLayer and CompositingCoordinator by abandoning the idea of sharing single image backings between layers that might be backed by identical Image objects. We thus end up trading any memory consumption benefit in these scenarios for a much simplified implementation. Overall this area needs more research both in figuring out whether there's worthy improvements in grouping image backings, as well as investigating whether it's possible to avoid additional image rasterization by just leveraging direct pixel data via the NativeImagePtr object. * platform/TextureMapper.cmake: * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: Added. (Nicosia::ImageBackingTextureMapperImpl::createFactory): (Nicosia::ImageBackingTextureMapperImpl::flushUpdate): (Nicosia::ImageBackingTextureMapperImpl::takeUpdate): * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h: Added. 2018-08-16 Zalan Bujtas [lFC][Floating] Add estimated margin top computation. https://bugs.webkit.org/show_bug.cgi?id=188619 Reviewed by Antti Koivisto. In order to figure out whether a box should avoid a float, we need to know the final positions of both (ignore relative positioning for now). In block formatting context the final position for a normal flow box includes 1. the static position and 2. the corresponding (non)collapsed margins. Now the vertical margins are computed when all the descendants are finalized, because the margin values might be depending on the height of the box (and the height might be based on the content). So when we get to the point where we intersect the box with the float to decide if the box needs to move, we don't yet have the final vertical position. The idea here is that as long as we don't cross the block formatting context boundary, we should be able to pre-compute the final top margin. (if this holds true for all the cases, the estimated prefix could be removed and just use marginTop() instead.) Covered by existing block-only tests. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layout const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginTop): * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setHasValidTop): (WebCore::Display::Box::setHasValidLeft): (WebCore::Display::Box::top const): (WebCore::Display::Box::left const): (WebCore::Display::Box::topLeft const): (WebCore::Display::Box::setTopLeft): (WebCore::Display::Box::setTop): (WebCore::Display::Box::setLeft): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::setEstimatedMarginTop): (WebCore::Display::Box::estimatedMarginTop const): 2018-08-16 Zalan Bujtas [LFC][BFC] Display::Box interface should reflect that padding is optional. https://bugs.webkit.org/show_bug.cgi?id=188630 Reviewed by Antti Koivisto. Certain type of boxes can't have paddings (see Layout::Box::isPaddingApplicable). * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeBorderAndPadding const): (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::width const): (WebCore::Display::Box::height const): (WebCore::Display::Box::contentBoxTop const): (WebCore::Display::Box::contentBoxLeft const): (WebCore::Display::Box::setPadding): (WebCore::Display::Box::paddingTop const): (WebCore::Display::Box::paddingLeft const): (WebCore::Display::Box::paddingBottom const): (WebCore::Display::Box::paddingRight const): 2018-08-16 Zalan Bujtas [LFC] Add showLayoutTree() that does not require LayoutContext. https://bugs.webkit.org/show_bug.cgi?id=188631 Reviewed by Antti Koivisto. * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::formattingContextRoot const): (WebCore::Layout::Box::initialContainingBlock const): * layout/layouttree/LayoutBox.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputLayoutTree): (WebCore::Layout::showLayoutTree): (WebCore::Layout::TreeBuilder::showLayoutTree): Deleted. * layout/layouttree/LayoutTreeBuilder.h: 2018-08-16 Zalan Bujtas [LFC] Tree builder should construct block and inline containers based on the display type. https://bugs.webkit.org/show_bug.cgi?id=188632 Reviewed by Antti Koivisto. Inline elements can also construct RenderBlock renderers (inline-bloc etc), so use the display type instead when deciding what type of container to construct. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createSubTree): 2018-08-16 Zalan Bujtas [LFC] Bail out of subtree verification when trees are out of sync. https://bugs.webkit.org/show_bug.cgi?id=188633 Reviewed by Antti Koivisto. There's no point of trying to match geometry when subtrees are out of sync. They get out of sync when the render tree has unsupported boxes (see LayoutTreeBuilder). * layout/Verification.cpp: (WebCore::Layout::verifyAndOutputSubtree): 2018-08-16 Antti Koivisto Use OptionSet for ActivityState::Flags https://bugs.webkit.org/show_bug.cgi?id=188554 Reviewed by Brent Fulgham. More typesafe flags. * Modules/geolocation/GeolocationController.cpp: (WebCore::GeolocationController::activityStateDidChange): * Modules/geolocation/GeolocationController.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::activityStateDidChange): * html/canvas/WebGLRenderingContextBase.h: * page/ActivityState.cpp: (WebCore::operator<<): (WebCore::activityStateFlagsToString): Deleted. * page/ActivityState.h: (WebCore::ActivityState::allFlags): * page/ActivityStateChangeObserver.h: * page/FocusController.cpp: (WebCore::FocusController::FocusController): (WebCore::FocusController::setFocused): (WebCore::FocusController::setActivityState): (WebCore::FocusController::setActive): * page/FocusController.h: (WebCore::FocusController::isActive const): (WebCore::FocusController::isFocused const): (WebCore::FocusController::contentIsVisible const): * page/Page.cpp: (WebCore::pageInitialActivityState): (WebCore::Page::Page): (WebCore::Page::setIsInWindow): (WebCore::Page::updateTimerThrottlingState): (WebCore::Page::setActivityState): (WebCore::Page::isVisibleAndActive const): (WebCore::Page::isWindowActive const): (WebCore::Page::setIsVisible): * page/Page.h: (WebCore::Page::activityState const): (WebCore::Page::isVisible const): (WebCore::Page::isInWindow const): * page/PerformanceMonitor.cpp: (WebCore::activityStateForCPUSampling): (WebCore::PerformanceMonitor::activityStateChanged): * page/PerformanceMonitor.h: * platform/text/cocoa: Added. 2018-08-15 Ansh Shukla NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault https://bugs.webkit.org/show_bug.cgi?id=186870 Reviewed by Alex Christensen. Add the ProtectionSpaceAuthenticationSchemeOAuth type. * platform/network/ProtectionSpaceBase.cpp: (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge expects a token in return. * platform/network/ProtectionSpaceBase.h: * platform/network/cocoa/ProtectionSpaceCocoa.mm: (WebCore::scheme): (WebCore::ProtectionSpace::nsSpace const): 2018-08-15 Ben Richards We should cache the compiled sandbox profile in a data vault https://bugs.webkit.org/show_bug.cgi?id=184991 Reviewed by Ryosuke Niwa. Added functionality to FileHandle so that it can lock a file while open. Added a function to FileSystem to delete non empty directories. * platform/FileHandle.cpp: (WebCore::FileHandle::FileHandle): (WebCore::FileHandle::open): (WebCore::FileHandle::close): * platform/FileHandle.h: * platform/FileSystem.h: * platform/cocoa/FileSystemCocoa.mm: (WebCore::FileSystem::deleteNonEmptyDirectory): 2018-08-15 Ryosuke Niwa Can't share an app on AppStore to WeChat due to a release assert https://bugs.webkit.org/show_bug.cgi?id=188621 Reviewed by Geoffrey Garen. Disable the thread safety check when the app is not linked on or after iOS 12 since this release assert is getting hit by third party applications on iOS in UI process. * platform/Timer.cpp: (WebCore::shouldSuppressThreadSafetyCheck): Added a SDK check. 2018-08-15 Christopher Reid [Curl] Implement default cookie path handling correctly as outlined in RFC6265. https://bugs.webkit.org/show_bug.cgi?id=188609 Reviewed by Alex Christensen. Curl implementation of default cookie path was wrong so that some cookies cannot be accessible. It should be generated as outlined in: https://tools.ietf.org/html/rfc6265#section-5.1.4 Tests: http/tests/cookies/http-get-cookie-set-in-js.html * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::setCookie): * platform/network/curl/CookieUtil.cpp: (WebCore::CookieUtil::defaultPathForURL): * platform/network/curl/CookieUtil.h: 2018-08-15 Aditya Keerthi [Datalist] Add button to TextFieldInputs with a datalist https://bugs.webkit.org/show_bug.cgi?id=187741 Reviewed by Tim Horton. TextFieldInputs that have an associated datalist element should be drawn as combo boxes. However, we cannot use NSComboBox for this control, as NSComboBox is not height-resizable. Furthermore, the input should also be able to contain additional elements, such as the stepper for type=number and the cancel button for type=search. For these reasons, we draw a button at the end of the input, mimicking appearance of a combo box. The list-button -webkit-appearance value was added to display the new button. Tests: fast/forms/datalist/datalist-searchinput-appearance.html fast/forms/datalist/datalist-textinput-appearance.html * Resources/ListButtonArrow.png: Added. * Resources/ListButtonArrow@2x.png: Added. * WebCore.xcodeproj/project.pbxproj: * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/html.css: (input::-webkit-list-button): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::dataListButtonElement const): * html/HTMLInputElement.h: * html/InputType.h: (WebCore::InputType::dataListButtonElement const): * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::needsContainer const): (WebCore::TextFieldInputType::createShadowSubtree): (WebCore::TextFieldInputType::destroyShadowSubtree): (WebCore::TextFieldInputType::listAttributeTargetChanged): (WebCore::TextFieldInputType::dataListButtonElement const): (WebCore::TextFieldInputType::dataListButtonElementWasClicked): (WebCore::TextFieldInputType::didCloseSuggestions): * html/TextFieldInputType.h: * html/shadow/DataListButtonElement.cpp: Added. (WebCore::DataListButtonElement::create): (WebCore::DataListButtonElement::DataListButtonElement): (WebCore::DataListButtonElement::~DataListButtonElement): (WebCore::DataListButtonElement::defaultEventHandler): * html/shadow/DataListButtonElement.h: Added. * platform/ThemeTypes.h: * rendering/RenderTheme.cpp: (WebCore::RenderTheme::adjustStyle): (WebCore::RenderTheme::adjustListButtonStyle const): * rendering/RenderTheme.h: * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (-[WebListButtonCell drawWithFrame:inView:]): (WebCore::RenderThemeMac::paintListButtonForInput): (WebCore::RenderThemeMac::adjustListButtonStyle const): (WebCore::RenderThemeMac::paintTextField): (WebCore::RenderThemeMac::paintSearchField): (WebCore::RenderThemeMac::paintSearchFieldCancelButton): (WebCore::RenderThemeMac::listButton const): 2018-08-15 Ryan Haddad Unreviewed, rolling out r234870. The test introduced with this change is a flaky failure. Reverted changeset: "NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault" https://bugs.webkit.org/show_bug.cgi?id=186870 https://trac.webkit.org/changeset/234870 2018-08-14 Ryosuke Niwa connectedCallback is invoked by the HTML parser after child nodes had been inserted https://bugs.webkit.org/show_bug.cgi?id=183931 Reviewed by Alex Christensen. Invoke the custom element reactions after constructing and inserting a custom element as specifed in step 3.3 of: https://html.spec.whatwg.org/multipage/parsing.html#insert-a-foreign-element The bug here was that HTMLConstructionSite::insertCustomElement uses attachLater so that even though the task to insert the custom element was created, it didn't get executed until after CustomElementReactionStack in HTMLDocumentParser::runScriptsForPausedTreeBuilder had been popped off of the stack. Test: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html * html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::insertCustomElement): Fixed the bug by manually executing the scheduled tasks. This will enqueue any custom element reactions while CustomElementReactionStack in runScriptsForPausedTreeBuilder is still in the stack. 2018-08-15 Basuke Suzuki [Curl] Don't send Content-Type header for POST request when body is null. https://bugs.webkit.org/show_bug.cgi?id=188588 Reviewed by Youenn Fablet. The Content-Type header was sent by libcurl automatically. Suppress that behavior when body is null. Tests: http/tests/xmlhttprequest/methods.html * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::setupPOST): 2018-08-15 Alex Christensen Remove failing assertion introduced in r234873 https://bugs.webkit.org/show_bug.cgi?id=188581 * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): The assertion is correct but failing because VectorTraits is incorrect. I'll re-add it and fix VectorTraits in a separate patch. 2018-08-15 Wenson Hsieh [Attachment SPI] Remove attachment display mode options https://bugs.webkit.org/show_bug.cgi?id=188596 Reviewed by Dan Bernstein. Remove the ability to specify an "in-place" or "icon" representation for attachment elements, as well as logic needed to allow an attachment element to render image or video elements in a shadow root. The requirements that initially drove this effort are obviated by r227068, which allows Mail to intercept and provide a custom scheme for images inserted into the document via rich editing operations. Removed some existing API tests in _WKAttachmentTests that exercised this functionality. * editing/Editor.cpp: (WebCore::Editor::insertAttachmentFromFile): * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::createFragmentForImageAttachment): (WebCore::replaceRichContentWithAttachments): * html/AttachmentTypes.h: (WebCore::AttachmentDisplayOptions::encode const): (WebCore::AttachmentDisplayOptions::decode): Remove logic for encoding the attachment display mode. While this leaves AttachmentDisplayOptions completely empty, I haven't removed AttachmentDisplayOptions as well in this patch, since it's not clear that we won't be needing any mechanism for influencing the display of attachment elements inserted via native SPI. (): Deleted. * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::createElementRenderer): (WebCore::HTMLAttachmentElement::setFile): (WebCore::HTMLAttachmentElement::parseAttribute): (WebCore::HTMLAttachmentElement::invalidateShadowRootChildrenIfNecessary): Deleted. (WebCore::HTMLAttachmentElement::attachmentRenderer const): Deleted. (WebCore::HTMLAttachmentElement::updateDisplayMode): Deleted. (WebCore::HTMLAttachmentElement::ensureInnerImage): Deleted. (WebCore::HTMLAttachmentElement::ensureInnerVideo): Deleted. (WebCore::HTMLAttachmentElement::innerImage const): Deleted. (WebCore::HTMLAttachmentElement::innerVideo const): Deleted. (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary): Deleted. Remove logic for building the shadow root to house inline media elements. * html/HTMLAttachmentElement.h: The renderer of the attachment element is once again always a `RenderAttachment`, so we can remove `attachmentRenderer()` altogether and revert to overriding `renderer()` to return a `RenderAttachment*`. * page/DragController.cpp: (WebCore::DragController::startDrag): * rendering/RenderAttachment.h: (WebCore::HTMLAttachmentElement::renderer const): 2018-08-15 Ali Juma [IntersectionObserver] Do not hold a strong reference to the root element https://bugs.webkit.org/show_bug.cgi?id=188575 Reviewed by Simon Fraser. Make IntersectionObserver have only a raw pointer to its root element rather than a reference, so that an otherwise-unreachable root isn't kept alive. Add logic to to clear this pointer when the root element gets deleted. Test: intersection-observer/root-element-deleted.html * dom/Element.cpp: (WebCore::Element::~Element): (WebCore::Element::disconnectFromIntersectionObservers): (WebCore::Element::ensureIntersectionObserverData): (WebCore::Element::intersectionObserverData): * dom/Element.h: * dom/ElementRareData.cpp: * dom/ElementRareData.h: (WebCore::ElementRareData::intersectionObserverData): (WebCore::ElementRareData::setIntersectionObserverData): * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::create): (WebCore::IntersectionObserver::IntersectionObserver): (WebCore::IntersectionObserver::~IntersectionObserver): (WebCore::IntersectionObserver::rootDestroyed): * page/IntersectionObserver.h: (WebCore::IntersectionObserver::root const): 2018-08-14 Zan Dobersek [Nicosia] Add Nicosia::BackingStoreTextureMapperImpl https://bugs.webkit.org/show_bug.cgi?id=188548 Reviewed by Carlos Garcia Campos. Add the Nicosia::BackingStoreTextureMapperImpl class, the TextureMapper-specific implementation that will extend the BackingStore class. Purpose of this class is to manage content of painted layers. In the LayerState object that will be exposed to the CoordinatedGraphicsLayer owner we keep the current and previous TiledBackingStore objects that will be used for painting. A TileUpdate object is used to store all tile creation, removal and update changes that happen during the painting that's performed during the CoordinatedGraphicsLayer flush. At the point of synchronization under the Nicosia::Scene object, these updates will be moved over to the pending TileUpdate object that will then be accessed during the composition step. For that purpose we keep in the CompositionState member object a reference to the CoordinatedBackingStore object that will get updated with the tile creation, removal and update changes (if there are any). The composition step will use the takeUpdate() method to retrieve all these changes and apply them outside of the point of synchronization (avoiding this sync step to take too long). This will be integrated into the CoordinatedGraphicsLayer class at a later point, when the switch to the new infrastructure can be made in one go. * platform/TextureMapper.cmake: * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: Added. (Nicosia::BackingStoreTextureMapperImpl::createFactory): (Nicosia::BackingStoreTextureMapperImpl::tiledBackingStoreHasPendingTileCreation): (Nicosia::BackingStoreTextureMapperImpl::createTile): (Nicosia::BackingStoreTextureMapperImpl::updateTile): (Nicosia::BackingStoreTextureMapperImpl::removeTile): (Nicosia::BackingStoreTextureMapperImpl::flushUpdate): (Nicosia::BackingStoreTextureMapperImpl::takeUpdate): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h: Added. 2018-08-14 Fujii Hironori Unreviewed, rolling out r234874 and r234876. WinCairo port can't compile Reverted changesets: "[JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg" https://bugs.webkit.org/show_bug.cgi?id=188589 https://trac.webkit.org/changeset/234874 "Unreviewed, attempt to fix CLoop build" https://bugs.webkit.org/show_bug.cgi?id=188589 https://trac.webkit.org/changeset/234876 2018-08-14 Zalan Bujtas [LFC][Floating] Add support for negative clearance. https://bugs.webkit.org/show_bug.cgi?id=188555 Reviewed by Simon Fraser. 1. Compute clearance to avoid float(s) (border box needs to avoid floats) 2. Reset vertical margins to non-collapsed values. 4. Adjust clearance with the new margins. 5. Take the adjusted clearance and move the box vertically if needed. Test: fast/block/block-only/margin-collapse-with-clearance.html * layout/FloatingContext.cpp: (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): * layout/FloatingState.cpp: (WebCore::Layout::FloatingState::FloatItem::FloatItem): * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::mapBoxToAncestor): (WebCore::Layout::FormattingContext::mapTopLeftToAncestor): (WebCore::Layout::FormattingContext::mapCoordinateToAncestor): (WebCore::Layout::FormattingContext::mapToAncestor): Deleted. * layout/FormattingContext.h: * layout/LayoutUnits.h: (WebCore::Layout::Position::Position): (WebCore::Layout::Position::moveBy): * layout/displaytree/DisplayBox.h: 2018-08-14 Fujii Hironori Unreviewed, rolling out r234859. Windows ports can't compile Reverted changeset: "Use a Variant instead of a union in CSSSelector" https://bugs.webkit.org/show_bug.cgi?id=188559 https://trac.webkit.org/changeset/234859 2018-08-14 Yusuke Suzuki [JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg https://bugs.webkit.org/show_bug.cgi?id=188589 Reviewed by Mark Lam. No behavior change. * cssjit/FunctionCall.h: (WebCore::FunctionCall::FunctionCall): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo): 2018-08-14 Alex Christensen isValidCSSSelector is unsafe to be called from a non-main thread https://bugs.webkit.org/show_bug.cgi?id=188581 Reviewed by Sam Weinig. Parsing and determining whether the css selectors are valid is fast enough to do before hopping to the background thread for the slow NFA/DFA operations and writing to disk. Doing it on the main thread avoids the thread safety issues in the CSSParser's use of strings. * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): * contentextensions/ContentExtensionCompiler.h: * contentextensions/ContentExtensionParser.cpp: (WebCore::ContentExtensions::isValidCSSSelector): (WebCore::ContentExtensions::loadEncodedRules): (WebCore::ContentExtensions::parseRuleList): * contentextensions/ContentExtensionParser.h: * contentextensions/ContentExtensionRule.cpp: (WebCore::ContentExtensions::Trigger::isolatedCopy const): (WebCore::ContentExtensions::Action::isolatedCopy const): * contentextensions/ContentExtensionRule.h: (WebCore::ContentExtensions::Trigger::isEmpty const): (WebCore::ContentExtensions::Trigger::operator== const): (WebCore::ContentExtensions::Action::Action): (WebCore::ContentExtensions::ContentExtensionRule::isolatedCopy const): (WebCore::ContentExtensions::ContentExtensionRule::operator== const): (WebCore::ContentExtensions::vectorIsolatedCopy): 2018-08-14 Ansh Shukla NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault https://bugs.webkit.org/show_bug.cgi?id=186870 Reviewed by Alex Christensen. Add the ProtectionSpaceAuthenticationSchemeOAuth type. * platform/network/ProtectionSpaceBase.cpp: (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge expects a token in return. * platform/network/ProtectionSpaceBase.h: * platform/network/cocoa/ProtectionSpaceCocoa.mm: (WebCore::scheme): (WebCore::ProtectionSpace::nsSpace const): 2018-08-14 Basuke Suzuki [Curl] Implement platform default timeout interval. https://bugs.webkit.org/show_bug.cgi?id=188565 Reviewed by Alex Christensen. Curl port didn't implement platform default timeout interval. It treated zero value for timeout interval as no timeout. Add platform dependent timeout interval into CurlContext and use that if timeout and default timeout aren't supplied. Tests: http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html * platform/network/curl/CurlContext.cpp: (WebCore::CurlHandle::setTimeout): * platform/network/curl/CurlContext.h: (WebCore::CurlContext::defaultTimeoutInterval const): * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::setupTransfer): (WebCore::CurlRequest::timeoutInterval const): (WebCore::CurlRequest::didCompleteTransfer): * platform/network/curl/CurlRequest.h: 2018-08-14 Alex Christensen Use a Variant instead of a union in CSSSelector https://bugs.webkit.org/show_bug.cgi?id=188559 Reviewed by Antti Koivisto. No change in behavior. This just makes some of the existing problems more obvious and easy to fix. I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData. I only have m_isForPage when assertions are enabled because it's only used for an assertion. The rest is pretty straightforward translating union syntax to Variant syntax. I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary. * css/CSSSelector.cpp: (WebCore::CSSSelector::CSSSelector): (WebCore::CSSSelector::createRareData): (WebCore::CSSSelector::setAttribute): (WebCore::CSSSelector::setArgument): (WebCore::CSSSelector::setLangArgumentList): (WebCore::CSSSelector::setSelectorList): (WebCore::CSSSelector::setNth): (WebCore::CSSSelector::matchNth const): (WebCore::CSSSelector::nthA const): (WebCore::CSSSelector::nthB const): (WebCore::CSSSelector::RareData::RareData): * css/CSSSelector.h: (WebCore::CSSSelector::argument const): (WebCore::CSSSelector::langArgumentList const): (WebCore::CSSSelector::selectorList const): (WebCore::CSSSelector::attribute const): (WebCore::CSSSelector::attributeCanonicalLocalName const): (WebCore::CSSSelector::setValue): (WebCore::CSSSelector::CSSSelector): (WebCore::CSSSelector::~CSSSelector): (WebCore::CSSSelector::tagQName const): (WebCore::CSSSelector::tagLowercaseLocalName const): (WebCore::CSSSelector::value const): (WebCore::CSSSelector::serializingValue const): (WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const): (WebCore::CSSSelector::RareData::create): Deleted. * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::parsePageSelector): * css/parser/CSSParserSelector.h: 2018-08-14 Yusuke Suzuki Unhandled Promise Rejection logging in workers should not emit ErrorEvent to host Worker object https://bugs.webkit.org/show_bug.cgi?id=188551 Reviewed by Youenn Fablet. Previously we dispatched ErrorEvent on the Worker object of the host side when the unhandled promise rejection happens in the worker. But that was wrong. We should not dispatch such an event and we should just log the error message. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::reportUnhandledPromiseRejection): 2018-08-14 Yusuke Suzuki Unreviewed, follow-up patch for comments https://bugs.webkit.org/show_bug.cgi?id=188265 * bindings/js/JSExecState.cpp: (WebCore::JSExecState::didLeaveScriptContext): Do nothing if `context` is nullptr. It is OK since we do not need to drain microtasks / rejected promise events after ScriptExecutionContext is gone. * dom/Microtasks.cpp: (WebCore::MicrotaskQueue::contextQueue): Drop unnecessary assertion since it is subsumed by downcast<>. 2018-08-14 Ali Juma Follow-up: [IntersectionObserver] Implement rootMargin parsing https://bugs.webkit.org/show_bug.cgi?id=188469 Address review feedback from Darin Adler. * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::rootMargin const): Use StringBuilder::appendLiteral instead of ::append to append a literal. 2018-08-14 Antoine Quint [Web Animations] Crash under AnimationTimeline::cancelOrRemoveDeclarativeAnimation() https://bugs.webkit.org/show_bug.cgi?id=188519 Reviewed by Eric Carlson. Test: webanimations/css-animation-effect-target-change-and-animation-removal-crash.html We would crash because we blindly assumed an animation that was found in the previous style must be in the list of running animations but in fact it could have been removed already due to the element being removed from the DOM or its effect target changing, etc. So when we iterate over names of animations that were found in the previous style but not in the new style, we must make a null check to ensure that there is an animation to remove. Adding an ASSERT() in AnimationTimeline::cancelOrRemoveDeclarativeAnimation() will also clarify the expectation here. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::updateCSSAnimationsForElement): (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): 2018-08-14 Zalan Bujtas [LFC][Floating] Adjust vertical position with non-collapsed previous sibling margin. https://bugs.webkit.org/show_bug.cgi?id=188543 Reviewed by Antti Koivisto. This patch ensures that the inital vertical position for a float is adjusted with the non-collapsed sibling margin.
While computing the static position for element "B", we simply call marginBottom() on A. In the case above, A's margin bottom is collapsed with C's margin top and the value is 0 (C.marginTop() is 20px). However CSS spec says that in block formatting context, the non-collapsed margin should be used instead to offset the float box. (The reason why this should not be part of the BlockMarginCollapse::marginBottom() logic is because it can not differentiate the context of sibling float/sibling inflow. When we margin collapse, we always do it in the context of inflow boxes.) Test: fast/block/block-only/float-and-siblings-with-margins.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): * layout/blockformatting/BlockFormattingContext.h: 2018-08-14 Yusuke Suzuki Worker should support unhandled promise rejections https://bugs.webkit.org/show_bug.cgi?id=188265 Reviewed by Darin Adler. This patch adds PromiseRejectionEvent support in workers. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::promiseRejectionTracker): Move promiseRejectionTracker handler from JSDOMWindowBase to JSDOMGlobalObject to share it with WorkerGlobalScope. * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::promiseRejectionTracker): Deleted. Moved to JSDOMGlobalObject. * bindings/js/JSDOMWindowBase.h: * bindings/js/JSExecState.cpp: (WebCore::JSExecState::didLeaveScriptContext): PromiseRejectionTracker is driven in workers too. * bindings/js/JSPromiseRejectionEventCustom.cpp: Added. (WebCore::JSPromiseRejectionEvent::visitAdditionalChildren): Marking PromiseRejectionEvent::m_reason. * bindings/js/JSWorkerGlobalScopeBase.cpp: Configure promiseRejectionTracker. * dom/Microtasks.cpp: (WebCore::MicrotaskQueue::contextQueue): * dom/Microtasks.h: * dom/PromiseRejectionEvent.cpp: (WebCore::PromiseRejectionEvent::PromiseRejectionEvent): * dom/PromiseRejectionEvent.h: * dom/PromiseRejectionEvent.idl: Expose it to worker scope. The custom mark function is required since we start using JSValueInWrappedObject. And the constructor no longer requires ExecState. * dom/RejectedPromiseTracker.cpp: (WebCore::RejectedPromiseTracker::reportUnhandledRejections): (WebCore::RejectedPromiseTracker::reportRejectionHandled): Remove state argument for PromiseRejectionEvent::create. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::removeRejectedPromiseTracker): * dom/ScriptExecutionContext.h: In worker thread, we should delete PromiseRejectionTracker before destroying VM because PromiseRejectionTracker's destruction requires VM. If we destroy VM first, PromiseRejectionTracker's destruction causes crashing. In main thread, we do not need to handle this case since we never destroy VM. * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::prepareForTermination): (WebCore::WorkerGlobalScope::removeMicrotaskQueue): Deleted. * workers/WorkerGlobalScope.h: * workers/WorkerGlobalScope.idl: Add onunhandledrejection and onrejectionhandled event handler attributes. * workers/WorkerThread.cpp: (WebCore::WorkerThread::stop): We call WorkerGlobalScope::prepareForTermination, which cleans up Worker's objects touching VM. 2018-08-14 Rob Buis Fetch: content-length header is being added to the safe-list https://bugs.webkit.org/show_bug.cgi?id=185473 Reviewed by Youenn Fablet. Content-Length is a CORS-safelisted reponse header: https://fetch.spec.whatwg.org/#cors-safelisted-response-header-name Tests: web-platform-tests/fetch/api/cors/cors-filtering.html web-platform-tests/fetch/api/cors/cors-filtering-worker.html * platform/network/HTTPParsers.cpp: (WebCore::isCrossOriginSafeHeader): 2018-08-13 Zalan Bujtas [LFC][Floating] Do not confuse clear with clearance. https://bugs.webkit.org/show_bug.cgi?id=188541 Reviewed by Simon Fraser. clear -> CSS property. clearance -> the offset required to avoid floats when clear is present. * layout/FloatingContext.cpp: (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layout const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForClear const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionWithClearance const): Deleted. * layout/blockformatting/BlockFormattingContext.h: * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::hasClear const): (WebCore::Layout::Box::hasClearance const): Deleted. * layout/layouttree/LayoutBox.h: 2018-08-13 James Savage [iOS] Crash at -[UIViewController _presentViewController:withAnimationController:completion:] https://bugs.webkit.org/show_bug.cgi?id=188537 Reviewed by Tim Horton. * platform/ios/ValidationBubbleIOS.mm: (WebCore::ValidationBubble::show): Avoid hitting a UIKit exception for presenting an already presented view controller by turning the scenario into an early return. 2018-08-13 Alex Christensen Make CSSSelectorList a little more sane https://bugs.webkit.org/show_bug.cgi?id=188539 Reviewed by Simon Fraser. This patch does four things: 1. Use a UniqueArray instead of a raw pointer and manually calling destructors. 2. Use move semantics a little bit better. 3. Add a CSSSelectorList&& to the StyleRule and StyleRulePage because every time we create either one of those objects we call a setter to give it a CSSSelectorList. That's what constructor arguments are for. 4. Don't use CSSSelectorList.componentCount(), which iterates all components, to determine if it's empty. Use first() instead. * css/CSSPageRule.cpp: (WebCore::CSSPageRule::setSelectorText): * css/CSSSelectorList.cpp: (WebCore::CSSSelectorList::CSSSelectorList): (WebCore::CSSSelectorList::componentCount const): (WebCore::CSSSelectorList::listSize const): (WebCore::CSSSelectorList::operator=): (WebCore::CSSSelectorList::deleteSelectors): Deleted. * css/CSSSelectorList.h: (WebCore::CSSSelectorList::CSSSelectorList): (WebCore::CSSSelectorList::first const): (WebCore::CSSSelectorList::indexOfNextSelectorAfter const): (WebCore::CSSSelectorList::~CSSSelectorList): Deleted. (WebCore::CSSSelectorList::adoptSelectorArray): Deleted. (WebCore::CSSSelectorList::hasOneSelector const): Deleted. * css/CSSStyleRule.cpp: (WebCore::CSSStyleRule::setSelectorText): * css/StyleRule.cpp: (WebCore::StyleRule::StyleRule): (WebCore::StyleRule::createForSplitting): (WebCore::StyleRulePage::StyleRulePage): * css/StyleRule.h: * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::consumePageRule): (WebCore::CSSParserImpl::consumeStyleRule): * css/parser/CSSSelectorParser.cpp: (WebCore::CSSSelectorParser::consumePseudo): 2018-08-13 Ali Juma [IntersectionObserver] Validate threshold values https://bugs.webkit.org/show_bug.cgi?id=188475 Reviewed by Simon Fraser. Throw an exception if any of an IntersectionObserver's thresholds are outside the range [0, 1]. Tested by: imported/w3c/web-platform-tests/intersection-observer/observer-exceptions.html intersection-observer/intersection-observer-interface.html * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::create): (WebCore::IntersectionObserver::IntersectionObserver): * page/IntersectionObserver.h: 2018-08-13 Alex Christensen Remove unused CSSSelector::parseNth https://bugs.webkit.org/show_bug.cgi?id=188529 Reviewed by Simon Fraser. This was conceptually replaced by the call to setNth in CSSSelectorParser::consumePseudo. * css/CSSSelector.cpp: (WebCore::CSSSelector::CSSSelector): (WebCore::CSSSelector::setNth): (WebCore::CSSSelector::nthA const): (WebCore::CSSSelector::nthB const): (WebCore::CSSSelector::parseNth const): Deleted. (WebCore::CSSSelector::RareData::parseNth): Deleted. * css/CSSSelector.h: (WebCore::CSSSelector::CSSSelector): * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne const): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addNthChildType): 2018-08-13 Alex Christensen Remove unused code in CSSParserSelector/CSSSelector https://bugs.webkit.org/show_bug.cgi?id=188528 Reviewed by Simon Fraser. * css/CSSSelector.cpp: * css/CSSSelector.h: (WebCore::CSSSelector::serializingValue const): (WebCore::CSSSelector::setAttributeValueMatchingIsCaseInsensitive): Deleted. * css/parser/CSSParserSelector.h: (WebCore::CSSParserSelector::setAttributeValueMatchingIsCaseInsensitive): Deleted. 2018-08-13 Alex Christensen Modernize CSSSelectorList a little https://bugs.webkit.org/show_bug.cgi?id=188527 Reviewed by Simon Fraser. No change in behavior. Just use make_unique and move semantics a little more. * css/CSSSelectorList.cpp: (WebCore::CSSSelectorList::CSSSelectorList): (WebCore::CSSSelectorList::adoptSelectorVector): Deleted. * css/CSSSelectorList.h: * css/StyleRule.h: * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::parsePageSelector): * css/parser/CSSParserSelector.cpp: (WebCore::CSSParserSelector::adoptSelectorVector): * css/parser/CSSParserSelector.h: * css/parser/CSSSelectorParser.cpp: (WebCore::CSSSelectorParser::consumeComplexSelectorList): (WebCore::CSSSelectorParser::consumeCompoundSelectorList): (WebCore::CSSSelectorParser::consumePseudo): 2018-08-13 Antti Koivisto Meaning of OptionSet::contains is unclear when used with OptionSet argument https://bugs.webkit.org/show_bug.cgi?id=188501 Reviewed by Anders Carlsson. * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::possiblyHasMarkers): * dom/DocumentMarkerController.h: (WebCore::DocumentMarkerController::hasMarkers const): * platform/FileSystem.h: (WebCore::FileSystem::openAndLockFile): * rendering/RenderElement.cpp: (WebCore::RenderElement::selectionColor const): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintForegroundForFragments): 2018-08-13 Commit Queue Unreviewed, rolling out r234747. https://bugs.webkit.org/show_bug.cgi?id=188524 plugin processes crash on launch (Requested by smfr on #webkit). Reverted changeset: "We should cache the compiled sandbox profile in a data vault" https://bugs.webkit.org/show_bug.cgi?id=184991 https://trac.webkit.org/changeset/234747 2018-08-13 Wenson Hsieh [iOS] Dragging a non-editable text selection into a plain text input inserts HTML markup https://bugs.webkit.org/show_bug.cgi?id=188485 Reviewed by Tim Horton. Before r223678, -typeIdentifiersToLoadForRegisteredTypeIdentifiers:, which is responsible for determining which type identifiers to load upon performing a drop, returned the following when dropping a rich text selection onto a textarea: "public.plain-text", "public.html" After r223678, we now propagate a custom pasteboard data type when dragging, and the same list now looks like: "com.apple.WebKit.custom-pasteboard-data", "public.html", "public.plain-text" Subsequently, logic in `-_preLoadedDataConformingToType:…` (responsible for mapping a requested type identifier to data that has been loaded from an item provider) iterates through the aforementioned list of type identifiers and selects the data of the first type identifier in the list that conforms to the requested type identifier. However, this list of type identifiers is currently the result of `-[NSSet allObjects]`, which means that the type identifiers in the list are in no particular order! As such, this particular use case only worked by accident prior to r223678, and after that change, this latent bug was surfaced. The patch here makes two adjustments to pasteboard handling on iOS to fix the bug. Test: DragAndDropTests.NonEditableTextSelectionToTextarea * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::read): When reading plain text from the pasteboard, give "public.plain-text" priority over "public.text". This ensures that we don't end up reading markup as "plain text" when there's already more relevant plain text data present in the pasteboard. * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentifiers:]): Refactor existing logic to enforce a consistent ordering of type identifiers to load. First, we use NSMutableOrderedSet instead of just an NSMutableSet to store type identifiers we've added. Secondly, move all logic to insert type identifiers into this set to the end of the method, where we iterate over all of the type identifiers in order and add each type identifier to the set if needed. This ensures that the order of resulting types is from highest to lowest fidelity. (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]): (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]): Deleted. Fix a typo in the method name. 2018-08-13 Alex Christensen Use a 1-byte enum class for TextDirection https://bugs.webkit.org/show_bug.cgi?id=188350 Reviewed by Simon Fraser. * Modules/notifications/Notification.h: * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator TextDirection const): * css/ElementRuleCollector.cpp: (WebCore::ElementRuleCollector::matchAllRules): * dom/Document.cpp: (WebCore::Document::updateTitleFromTitleElement): (WebCore::Document::setTitle): * dom/Position.cpp: (WebCore::Position::primaryDirection const): * dom/Range.cpp: (WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines const): * editing/Editing.cpp: (WebCore::directionOfEnclosingBlock): * editing/Editor.cpp: (WebCore::Editor::baseWritingDirectionForSelectionStart const): * editing/FrameSelection.cpp: (WebCore::FrameSelection::willBeModified): (WebCore::FrameSelection::modifyExtendingRight): (WebCore::FrameSelection::modifyExtendingForward): (WebCore::FrameSelection::modifyMovingRight): (WebCore::FrameSelection::modifyExtendingLeft): (WebCore::FrameSelection::modifyExtendingBackward): (WebCore::FrameSelection::modifyMovingLeft): (WebCore::FrameSelection::textSelectionIntent): (WebCore::FrameSelection::modify): * editing/VisiblePosition.cpp: (WebCore::VisiblePosition::leftVisuallyDistinctCandidate const): (WebCore::VisiblePosition::rightVisuallyDistinctCandidate const): * editing/VisibleUnits.cpp: (WebCore::visualWordPosition): (WebCore::leftWordPosition): (WebCore::rightWordPosition): (WebCore::leftBoundaryOfLine): (WebCore::rightBoundaryOfLine): * html/HTMLElement.cpp: (WebCore::HTMLElement::directionalityIfhasDirAutoAttribute const): (WebCore::HTMLElement::directionality const): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setupDateTimeChooserParameters): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::directionForFormData const): (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const): * html/HTMLTitleElement.cpp: (WebCore::HTMLTitleElement::computedTextWithDirection): * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::toTextDirection const): (WebCore::CanvasRenderingContext2D::direction const): (WebCore::CanvasRenderingContext2D::textOffset): * html/shadow/SliderThumbElement.cpp: (WebCore::RenderSliderContainer::layout): * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * page/Chrome.cpp: (WebCore::Chrome::setToolTip): * page/FrameView.cpp: (WebCore::paginationModeForRenderStyle): * page/Settings.yaml: * platform/RectEdges.h: (WebCore::RectEdges::start): (WebCore::RectEdges::end): (WebCore::RectEdges::start const): (WebCore::RectEdges::end const): (WebCore::RectEdges::setStart): (WebCore::RectEdges::setEnd): * platform/UserInterfaceLayoutDirection.h: * platform/graphics/ComplexTextController.cpp: (WebCore::ComplexTextController::computeExpansionOpportunity): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::expansionOpportunityCountInternal): (WebCore::FontCascade::leadingExpansionOpportunity): (WebCore::FontCascade::trailingExpansionOpportunity): * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawBidiText): * platform/graphics/TextRun.h: (WebCore::TextRun::TextRun): (WebCore::TextRun::rtl const): (WebCore::TextRun::ltr const): (WebCore::TextRun::setDirection): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::WidthIterator): * platform/ios/SelectionRect.cpp: (WebCore::SelectionRect::SelectionRect): * platform/text/BidiResolver.h: (WebCore::BidiStatus::BidiStatus): * platform/text/StringWithDirection.h: * platform/text/WritingMode.h: (WebCore::isLeftToRightDirection): (WebCore::isVerticalWritingMode): (WebCore::isFlippedWritingMode): (WebCore::mapLogicalSideToPhysicalSide): * rendering/HitTestResult.cpp: (WebCore::HitTestResult::spellingToolTip const): (WebCore::HitTestResult::title const): (WebCore::HitTestResult::innerTextIfTruncated const): * rendering/InlineBox.h: (WebCore::InlineBox::direction const): (WebCore::InlineBox::isLeftToRightDirection const): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::paintFillLayer): * rendering/InlineIterator.h: (WebCore::embedCharFromDirection): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): (WebCore::mirrorRTLSegment): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::constructTextRun): * rendering/RenderBlockLineLayout.cpp: (WebCore::determineDirectionality): (WebCore::RenderBlockFlow::textAlignmentForLine const): (WebCore::RenderBlockFlow::updateLogicalWidthForAlignment): (WebCore::RenderBlockFlow::handleTrailingSpaces): (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): * rendering/RenderBox.cpp: (WebCore::computeInlineStaticDistance): (WebCore::RenderBox::computePositionedLogicalWidthUsing const): (WebCore::RenderBox::computePositionedLogicalWidthReplaced const): * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp): * rendering/RenderFragmentedFlow.cpp: (WebCore::RenderFragmentedFlow::updateLogicalWidth): (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect): * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft const): * rendering/RenderMarquee.cpp: (WebCore::RenderMarquee::direction const): * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::adjustInnerStyle): (RenderMenuList::clientPaddingLeft const): (RenderMenuList::clientPaddingRight const): * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::popupInternalPaddingBox const): (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintMenuListButtonDecorations): (WebCore::RenderThemeMac::popupInternalPaddingBox const): (WebCore::RenderThemeMac::setPopupButtonCellState): (WebCore::RenderThemeMac::paintSearchFieldCancelButton): (WebCore::RenderThemeMac::paintSearchFieldResultsButton): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::mirrorIfNeeded const): * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::layoutBlock): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::RenderStyle): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::isLeftToRightDirection const): (WebCore::RenderStyle::initialDirection): * testing/InternalSettings.cpp: (WebCore::InternalSettings::systemLayoutDirection): (WebCore::InternalSettings::setSystemLayoutDirection): * testing/Internals.h: 2018-08-13 Said Abou-Hallawa Followup (r234683): Element::getAttribute() should return the first non-null attribute value https://bugs.webkit.org/show_bug.cgi?id=188419 Reviewed by Darin Adler. Element::getAttribute() should return the first non-null attribute value since an empty string is a legitimate attribute value. Test: svg/custom/href-svg-namespace-empty.html * dom/Element.h: (WebCore::Element::getAttribute const): 2018-08-13 Michael Catanzaro Unreviewed, since -Wsign-compare warnings in URL.cpp This regressed in r233798 when m_schemeEnd changed to a bitfield. The code looks safe to me, so just silence the warnings with casts. * platform/URL.cpp: (WebCore::URL::setHost): (WebCore::URL::setHostAndPort): (WebCore::URL::setUser): (WebCore::URL::setPass): 2018-08-13 Antti Koivisto Use OptionSet more in editing code https://bugs.webkit.org/show_bug.cgi?id=188500 Reviewed by Wenson Hsieh. Typesafe flags. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/Editor.cpp: (WebCore::TemporarySelectionChange::TemporarySelectionChange): (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::appliedEditing): (WebCore::Editor::selectComposition): (WebCore::Editor::changeSelectionAfterCommand): (WebCore::Editor::respondToChangedSelection): * editing/Editor.h: (WebCore::TemporarySelectionChange::TemporarySelectionChange): * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveWithoutValidationTo): (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance): (WebCore::FrameSelection::setSelection): (WebCore::FrameSelection::setSelectedRange): * editing/FrameSelection.h: (WebCore::FrameSelection::defaultSetSelectionOptions): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand): * editing/ReplaceSelectionCommand.h: (WebCore::ReplaceSelectionCommand::create): * editing/SetSelectionCommand.cpp: (WebCore::SetSelectionCommand::SetSelectionCommand): * editing/SetSelectionCommand.h: (WebCore::SetSelectionCommand::create): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): 2018-08-13 Zalan Bujtas [LFC][Floating] Add basic clearance support https://bugs.webkit.org/show_bug.cgi?id=188492 Reviewed by Antti Koivisto. Adjust final position of a block level box with clearance when float is present. Test: fast/block/block-only/floating-left-and-right-with-clearance.html * layout/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): (WebCore::Layout::FloatingContext::alignWithContainingBlock const): (WebCore::Layout::FloatingContext::toContainingBlock const): (WebCore::Layout::FloatingContext::computePosition const): Deleted. * layout/FloatingContext.h: * layout/FloatingState.cpp: (WebCore::Layout::FloatingState::bottom const): * layout/FloatingState.h: (WebCore::Layout::FloatingState::leftBottom const): (WebCore::Layout::FloatingState::rightBottom const): (WebCore::Layout::FloatingState::bottom const): * layout/Verification.cpp: (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layout const): (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionWithClearance const): * layout/blockformatting/BlockFormattingContext.h: * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::hasClearance const): * layout/layouttree/LayoutBox.h: 2018-08-13 Yusuke Suzuki Expose CloseEvent and CustomEvent to workers https://bugs.webkit.org/show_bug.cgi?id=188493 Reviewed by Sam Weinig. This patch exposes CloseEvent and CustomEvent to workers. It is OK since they do not depend on things in the main thread. For example, we cannot expose FormData right now since it depends on Page. We do not expose PromiseRejectionEvent in this patch since it will be done in [1]. [1]: https://bugs.webkit.org/show_bug.cgi?id=188265 * Modules/websockets/CloseEvent.idl: * dom/CustomEvent.idl: 2018-08-13 Oriol Brufau [css-logical] Implement flow-relative margin, padding, border and sizing properties https://bugs.webkit.org/show_bug.cgi?id=188386 Reviewed by Manuel Rego Casasnovas. These properties provide the author with the ability to control margins through logical, rather than physical, direction and dimension mappings. Only longhand properties and border shorthands for specific sides are implemented as part of this patch. The existing prefixed properties become aliases of the new ones. The change in WebCore::isLayoutDependent fixes an existing issue that made getComputedStyle provide an old value for -webkit-logical-height and -webkit-logical-height (see https://crbug.com/849855). Tests: imported/w3c/web-platform-tests/css/css-logical/animation-001.html imported/w3c/web-platform-tests/css/css-logical/animation-002.html imported/w3c/web-platform-tests/css/css-logical/animation-003.tentative.html imported/w3c/web-platform-tests/css/css-logical/cascading-001.html imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html imported/w3c/web-platform-tests/css/css-logical/logical-box-size.html imported/w3c/web-platform-tests/css/css-logical/logicalprops-block-size-vlr.html imported/w3c/web-platform-tests/css/css-logical/logicalprops-block-size.html imported/w3c/web-platform-tests/css/css-logical/logicalprops-inline-size-vlr.html imported/w3c/web-platform-tests/css/css-logical/logicalprops-inline-size.html imported/w3c/web-platform-tests/css/css-logical/logicalprops-quirklength.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::isLayoutDependent): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSProperties.json: * css/CSSProperty.cpp: (WebCore::CSSProperty::resolveDirectionAwareProperty): (WebCore::CSSProperty::isDirectionAwareProperty): * css/StyleProperties.cpp: (WebCore::StyleProperties::getPropertyValue const): * css/parser/CSSParserFastPaths.cpp: (WebCore::isSimpleLengthPropertyID): (WebCore::isColorPropertyID): (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): (WebCore::CSSParserFastPaths::isKeywordPropertyID): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): (WebCore::CSSPropertyParser::parseShorthand): * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::collectStyleForPresentationAttribute): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::computeCollapsedStartBorder const): (WebCore::RenderTableCell::computeCollapsedEndBorder const): (WebCore::RenderTableCell::computeCollapsedBeforeBorder const): (WebCore::RenderTableCell::computeCollapsedAfterBorder const): 2018-08-12 Sihui Liu CrashTracer: com.apple.WebKit.Storage at WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient(WebCore::IDBServer::UniqueIDBDatabaseConnection&) https://bugs.webkit.org/show_bug.cgi?id=188474 Reviewed by Chris Dumez. UniqueIDBDatabaseConnection is refcounted by UniqueIDBDatabaseTransaction and it refcounts UniqueIDBDatabaseTransaction. This cycle could make UniqueIDBDatabaseConnection outlives UniqueIDBDatabase, so its reference to UniqueIDBDatabase may be stale. Calling a function on a stale object is probably the reason of recent various storage process crashes in indexedDB. This patch makes m_database a WeakPtr and adds assertions that could help us debug the crashes. * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince): (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction): (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction): * Modules/indexeddb/server/UniqueIDBDatabase.h: * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp: (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection): (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection): (WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback): (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient): (WebCore::IDBServer::UniqueIDBDatabaseConnection::confirmDidCloseFromServer): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange): (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction): (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction): * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h: (WebCore::IDBServer::UniqueIDBDatabaseConnection::database): * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp: (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor): (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers): * Modules/indexeddb/shared/IDBResultData.cpp: (WebCore::IDBResultData::openDatabaseSuccess): (WebCore::IDBResultData::openDatabaseUpgradeNeeded): 2018-08-12 Yusuke Suzuki Break reference cycle in ErrorEvent by using JSValueInWrappedObject https://bugs.webkit.org/show_bug.cgi?id=188491 Reviewed by Darin Adler. ErrorEvent should not use Strong to hold error JSValue. This patch integrates JSValueInWrappedObject into ErrorEvent. * Modules/webvr/VRDisplayEvent.h: Fix unified build errors due to added JSErrorEventCustom.cpp. It changes the files grouped in unified build. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSErrorEventCustom.cpp: Copied from Source/WebCore/Modules/webvr/VRDisplayEvent.h. (WebCore::JSErrorEvent::visitAdditionalChildren): Add custom mark function for JSValueInWrappedObject. * bindings/js/JSEventListener.h: * bindings/js/WindowProxy.cpp: Fix unified build errors due to added JSErrorEventCustom.cpp. It changes the files grouped in unified build. * dom/ErrorEvent.cpp: (WebCore::ErrorEvent::ErrorEvent): (WebCore::ErrorEvent::error): (WebCore::ErrorEvent::trySerializeError): Align the implementation to PushStateEvent::trySerializeState. * dom/ErrorEvent.h: * dom/ErrorEvent.idl: 2018-08-12 Aditya Keerthi [macOS] Color wells should appear pressed when presenting a color picker https://bugs.webkit.org/show_bug.cgi?id=188477 Reviewed by Tim Horton. Currently, when clicking on a color well, the color well loses its pressed appearance once the mouse is lifted. Because of this behavior, the color well does not appear to be active when the color picker is displayed. Added the color-well -webkit-appearance value to control the drawing of the color well separate from other buttons. Also added a new ControlState, named PresentingState. A control can be in this state whenever it is presenting some attached view. In the case of the color well this is the color picker. The Information as to whether a form control is in the presenting state comes from isPresentingAttachedView() in HTMLInputElement. * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/html.css: (input[type="color"]::-webkit-color-swatch): * html/ColorInputType.cpp: (WebCore::ColorInputType::isPresentingAttachedView const): (WebCore::ColorInputType::elementDidBlur): (WebCore::ColorInputType::didEndChooser): * html/ColorInputType.h: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::isPresentingAttachedView const): * html/HTMLInputElement.h: * html/InputType.cpp: (WebCore::InputType::isPresentingAttachedView const): * html/InputType.h: * platform/ControlStates.h: * platform/ThemeTypes.h: * platform/mac/ThemeMac.mm: (WebCore::updateStates): (WebCore::setUpButtonCell): (WebCore::paintColorWell): (WebCore::ThemeMac::minimumControlSize const): (WebCore::ThemeMac::controlBorder const): (WebCore::ThemeMac::paint): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::adjustStyle): (WebCore::RenderTheme::paint): (WebCore::RenderTheme::paintBorderOnly): (WebCore::RenderTheme::paintDecorations): (WebCore::RenderTheme::isControlStyled const): (WebCore::RenderTheme::extractControlStatesForRenderer const): (WebCore::RenderTheme::isPresenting const): * rendering/RenderTheme.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::adjustRepaintRect): 2018-08-12 Zalan Bujtas [LFC] Float prev/next sibling should prevent top/bottom margin collapsing with parent. https://bugs.webkit.org/show_bug.cgi?id=188487 Reviewed by Antti Koivisto. Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin.html * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::isMarginTopCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent): 2018-08-10 Antti Koivisto Use OptionSet for various RenderLayer flags https://bugs.webkit.org/show_bug.cgi?id=188472 Followup, fix some mistakes. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::~RenderLayerBacking): 2018-08-10 Ryosuke Niwa [macOS] Multiple third party apps crash due to the thread safety check in TimerBase::setNextFireTime https://bugs.webkit.org/show_bug.cgi?id=188480 Reviewed by Simon Fraser. Suppress the release assert in WebKit1 on macOS (isInWebProcess is always true in non-Cocoa platforms). In the future, we should consider throwing Objective-C exceptions when third party apps call WebKit1 or WebKit2 APIs in non-main threads. * platform/Timer.cpp: (WebCore::shouldSuppressThreadSafetyCheck): Extracted out of ~TimerBase and setNextFireTime. (WebCore::TimerBase::~TimerBase): (WebCore::TimerBase::setNextFireTime): 2018-08-10 Daniel Bates Cleanup: Remove unnecessary code to resume animations from CachedFrameBase::restore() https://bugs.webkit.org/show_bug.cgi?id=188459 Reviewed by Chris Dumez. It is unnessary for CachedFrameBase::restore() to explicitly resume animations on the document as it calls Document::resume(), which already does this. No functionality changed. So, no new tests. * history/CachedFrame.cpp: (WebCore::CachedFrameBase::restore): 2018-08-10 Antti Koivisto Use OptionSet for various RenderLayer flags https://bugs.webkit.org/show_bug.cgi?id=188472 Reviewed by Simon Fraser. Typesafe flags. * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): * page/FrameView.cpp: (WebCore::updateLayerPositionFlags): (WebCore::FrameView::paintContents): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositionsAfterLayout): (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::paint): (WebCore::paintForFixedRootBackground): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerContentsAndReflection): (WebCore::RenderLayer::filterPainter const): (WebCore::RenderLayer::hasFilterThatIsPainting const): (WebCore::RenderLayer::setupFilters): (WebCore::RenderLayer::paintLayerContents): (RenderLayer::paintLayerByApplyingTransform): (RenderLayer::paintList): (RenderLayer::updatePaintingInfoForFragments): (RenderLayer::paintTransformedLayerIntoFragments): (RenderLayer::calculateClipRects const): (WebCore::RenderLayer::paintLayerByApplyingTransform): Deleted. (WebCore::RenderLayer::paintList): Deleted. (WebCore::RenderLayer::enclosingPaginationLayerInSubtree const): Deleted. (WebCore::RenderLayer::collectFragments): Deleted. (WebCore::RenderLayer::updatePaintingInfoForFragments): Deleted. (WebCore::RenderLayer::paintTransformedLayerIntoFragments): Deleted. (WebCore::RenderLayer::paintBackgroundForFragments): Deleted. (WebCore::RenderLayer::paintForegroundForFragments): Deleted. (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): Deleted. (WebCore::RenderLayer::paintOutlineForFragments): Deleted. (WebCore::RenderLayer::paintMaskForFragments): Deleted. (WebCore::RenderLayer::paintChildClippingMaskForFragments): Deleted. (WebCore::RenderLayer::paintOverflowControlsForFragments): Deleted. (WebCore::RenderLayer::hitTest): Deleted. (WebCore::RenderLayer::enclosingElement const): Deleted. (WebCore::RenderLayer::enclosingFragmentedFlowAncestor const): Deleted. (WebCore::computeZOffset): Deleted. (WebCore::RenderLayer::createLocalTransformState const): Deleted. (WebCore::isHitCandidate): Deleted. (WebCore::RenderLayer::hitTestLayer): Deleted. (WebCore::RenderLayer::hitTestContentsForFragments const): Deleted. (WebCore::RenderLayer::hitTestResizerInFragments const): Deleted. (WebCore::RenderLayer::hitTestTransformedLayerInFragments): Deleted. (WebCore::RenderLayer::hitTestLayerByApplyingTransform): Deleted. (WebCore::RenderLayer::hitTestContents const): Deleted. (WebCore::RenderLayer::hitTestList): Deleted. (WebCore::RenderLayer::updateClipRects): Deleted. (WebCore::RenderLayer::clipRects const): Deleted. (WebCore::RenderLayer::calculateClipRects const): Deleted. (WebCore::showLayerTree): Deleted. * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateCompositedBounds): (WebCore::RenderLayerBacking::detachFromScrollingCoordinator): (WebCore::RenderLayerBacking::paintIntoLayer): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): * rendering/RenderLayerCompositor.h: * rendering/RenderReplica.cpp: (WebCore::RenderReplica::paint): 2018-08-10 Sihui Liu CrashTracer: com.apple.WebKit.Storage at WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose https://bugs.webkit.org/show_bug.cgi?id=188461 Reviewed by Chris Dumez. When we try to schedule shutdown for database, we should cancel the timer so no scheduleShutdownForClose will be running after this. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose): 2018-08-10 Daniel Bates Once is hidden, its content won't be displayed again if its URL has fragment identifier ("#"). https://bugs.webkit.org/show_bug.cgi?id=187990 Reviewed by Simon Fraser. Fixes an issue where an HTML object element that behaves like an iframe and references a resource whose URL contains a fragment would not be repainted when its CSS display property changes. Rendering of an that behaves like an iframe is handled by a widget (FrameView). When the CSS display property for an is set to "none" we detach the widget from its renderer as part of destroying the render tree for the . Subsequently changing the CSS display to a non-"none"/"contents" value will create a new renderer for R. For an that behaves like an iframe, we navigate to the resource associated with the reusing the existing Frame F object created when we first displayed the . Unlike the case where the URL of the resource does not contain a fragment, navigating to a fragment in the same document uses a different code path that does not re-associate the FrameView of F with R before it scrolls the view; => the FrameView of F is not in the view hierarchy. Therefore we do not paint anything for the content of the and hence the scroll is not observable. Instead we need to ensure that the FrameView of F installed in the view hierarchy when navigating to an anchor in the same document. As a side benefit of this fix we now also repaint an that is programmatically navigated to a different anchor in the same document. Tests: fast/repaint/object-as-iframe-hide-and-show-document-at-anchor.html fast/repaint/object-as-iframe-navigate-to-same-document-anchor-repaint.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadInSameDocument): 2018-08-10 Ali Juma [IntersectionObserver] Implement rootMargin parsing https://bugs.webkit.org/show_bug.cgi?id=188469 Reviewed by Darin Adler. Parse IntersectionObserver's rootMargin argument and throw an exception if it's invalid. Change the stored rootMargin from a String to a LengthBox so that future patches can use this value in intersection logic. Tested by: imported/w3c/web-platform-tests/intersection-observer/observer-attributes.html imported/w3c/web-platform-tests/intersection-observer/observer-exceptions.html intersection-observer/intersection-observer-interface.html * page/IntersectionObserver.cpp: (WebCore::parseRootMargin): (WebCore::IntersectionObserver::create): (WebCore::IntersectionObserver::IntersectionObserver): (WebCore::IntersectionObserver::rootMargin const): * page/IntersectionObserver.h: (WebCore::IntersectionObserver::create): Deleted. (WebCore::IntersectionObserver::rootMargin const): Deleted. * page/IntersectionObserver.idl: 2018-08-09 Ben Richards We should cache the compiled sandbox profile in a data vault https://bugs.webkit.org/show_bug.cgi?id=184991 Reviewed by Ryosuke Niwa. Added functionality to FileHandle so that it can lock a file while open. Added a function to FileSystem to delete non empty directories. * platform/FileHandle.cpp: (WebCore::FileHandle::FileHandle): (WebCore::FileHandle::open): (WebCore::FileHandle::close): * platform/FileHandle.h: * platform/FileSystem.h: * platform/cocoa/FileSystemCocoa.mm: (WebCore::FileSystem::deleteNonEmptyDirectory): 2018-08-09 Chris Dumez InputType should not interact with an HTMLInputElement is no longer associated with https://bugs.webkit.org/show_bug.cgi?id=188410 Reviewed by Ryosuke Niwa. Clear InputType::m_element when the InputType is no longer associated with the HTMLInputElement because the element changed type. We were already dealing with the InputType no longer being associated with an element because the element died by using a WeakPtr. However, it is conceptually better (more correct) to also clear this pointer if the element is still alive but associated with another InputType. * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::updateType): * html/InputType.h: (WebCore::InputType::detachFromElement): 2018-08-09 Jer Noble Video playback is using more power https://bugs.webkit.org/show_bug.cgi?id=188452 Reviewed by Eric Carlson. Test: TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm When the meaning of PlatformMediaSession::Video changed to "video-only", we failed to update MediaSessionManagerCocoa::updateSessionState() to use the new PlatformMediaSession::VideoAudio enum, so Video-only sessions were getting the higher audio buffer size (where it's not needed) and Video-and-Audio sessions were getting the default value. To enable testing, add a preferredAudioBufferSize property to Internals. Also, the getter for AudioSession::preferredBufferSize was using the wrong CoreAudio property address, and was always returning 0. * platform/audio/AudioSession.h: * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: (MediaSessionManagerCocoa::updateSessionState): * platform/audio/mac/AudioSessionMac.cpp: (WebCore::AudioSession::preferredBufferSize const): * testing/Internals.cpp: (WebCore::Internals::preferredAudioBufferSize const): * testing/Internals.h: * testing/Internals.idl: 2018-08-09 Saam Barati memoryFootprint should return size_t not optional https://bugs.webkit.org/show_bug.cgi?id=188444 Reviewed by Simon Fraser. * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::ResourceUsageOverlay::platformDraw): 2018-08-09 Ali Juma Update IDL for IntersectionObserverEntry and IntersectionObserverEntryInit https://bugs.webkit.org/show_bug.cgi?id=188445 Reviewed by Simon Fraser. Update IntersectionObserverEntry by making rootBounds nullable, and adding an isIntersecting attribute. Make the same changes to IntersectionObserverEntryInit, and also add an intersectionRatio attribute. Tested by intersection-observer/intersection-observer-entry-interface.html * page/IntersectionObserverEntry.cpp: (WebCore::IntersectionObserverEntry::IntersectionObserverEntry): * page/IntersectionObserverEntry.h: (WebCore::IntersectionObserverEntry::isIntersecting const): * page/IntersectionObserverEntry.idl: 2018-08-09 Charlie Turner Fix copyright headers on new ISO parsing class https://bugs.webkit.org/show_bug.cgi?id=188432 Unreviewed fix. This was left off from a previous bug by mistake, retrospectively adding the correct copyright headers. No tests required. * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp: * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h: 2018-08-08 Ross Kirsling run-bindings-tests is not Win32-compatible https://bugs.webkit.org/show_bug.cgi?id=188424 Reviewed by Fujii Hironori. * bindings/scripts/preprocessor.pm: (applyPreprocessor): Ensure that we fall back to cl.exe if CC env var is not set on Windows. 2018-08-08 Ryosuke Niwa REGRESSION (r228260): Events handled by input method invoke default event handler https://bugs.webkit.org/show_bug.cgi?id=188370 Reviewed by Wenson Hsieh. The bug was caused by the default event handler being invoked for the "virtual" keydown events generated for input methods. Namely, when Japanese or Chinese input methods swallows TAB key, WebKit should not invoke the default event handler and move the focus during input composition. Fixed the bug by adding a new boolean on Event indicating whether the default event handler should be invoked, and restoring the behavior prior to r228260 for these virtual keydown events. Test: editing/input/press-tab-during-ime-composition.html * dom/Event.h: (WebCore::Event::isDefaultEventHandlerIgnored const): Added. (WebCore::Event::setIsDefaultEventHandlerIgnored): Added. * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): Don't invoke the default event handler if isDefaultEventHandlerIgnored is set. * page/EventHandler.cpp: (WebCore::EventHandler::internalKeyEvent): Set isDefaultEventHandlerIgnored. This restores WebKit's behavior prior to r228260. 2018-08-08 Justin Fan Prevent collectScreenProperties from crashing Base System https://bugs.webkit.org/show_bug.cgi?id=188429 Reviewed by Simon Fraser. Adding some error-checking and early returns to further prevent calling CGLDescribeRenderer with invalid parameters. Existing WebGL tests should cover; no expected change in behavior. Crash happened primarily on Base System. * platform/mac/PlatformScreenMac.mm: (WebCore::gpuIDForDisplayMask): 2018-08-08 Don Olmstead [Curl] Surface additional NetworkLoadMetrics https://bugs.webkit.org/show_bug.cgi?id=188391 Reviewed by Joseph Pecoraro. * platform/network/curl/CurlContext.cpp: (WebCore::CurlHandle::getNetworkLoadMetrics): 2018-08-08 Don Olmstead [Nicosia] Add the Nicosia-specific PlatformLayer type alias https://bugs.webkit.org/show_bug.cgi?id=188405 Unreviewed build fix. * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: 2018-08-08 Simon Fraser Add a WebKit2 logging channel for ActivityState https://bugs.webkit.org/show_bug.cgi?id=188411 Reviewed by Tim Horton. Add logging for ActivityState changes and the entrypoints that affect ActivityState. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * page/ActivityState.cpp: Added. (WebCore::activityStateFlagsToString): * page/ActivityState.h: 2018-08-08 Eric Carlson Add LogArgument template for PlatformMediaSession::RemoteControlCommandType https://bugs.webkit.org/show_bug.cgi?id=188314 Reviewed by Alex Christensen. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Don't coerce to int for logging. * platform/audio/PlatformMediaSession.cpp: (WebCore::convertEnumerationToString): New. (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand): Log command. * platform/audio/PlatformMediaSession.h: (WTF::LogArgument::toString): 2018-08-08 Joseph Pecoraro Web Inspector: XHR content sometimes shows as error even though load succeeded https://bugs.webkit.org/show_bug.cgi?id=188385 Reviewed by Devin Rousso. * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::didReceiveData): Avoid a double hash lookup in the common case. Allow synchronous XHR to have text data appended in the normal case. Allow synchronous XHR to set base64 encoded data right here for non-text data. * inspector/NetworkResourcesData.h: (WebCore::NetworkResourcesData::ResourceData::hasBufferedData const): Getter to see if data is buffered or not for this resource. * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::maybeAddResourceData): Return the updated ResourceData to avoid clients having to do a lookup. 2018-08-08 Sihui Liu Assertion failed in Webcore::Process::setIdentifier() https://bugs.webkit.org/show_bug.cgi?id=188404 Reviewed by Chris Dumez. App using both WebKit1 and WebKit may crash in WebKit initialization. * platform/Process.cpp: (WebCore::Process::setIdentifier): 2018-08-08 Charlie Turner Add CENC sanitization https://bugs.webkit.org/show_bug.cgi?id=188376 Reviewed by Xabier Rodriguez-Calvar. This patch adds support for sanitizing the CENC initialization data, to ensure there are no obviously bogus values in the untrusted input from generateRequest, see https://www.w3.org/TR/encrypted-media/#dom-mediakeysession-generaterequest for more details on sanitization. Tested by imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html * Modules/encryptedmedia/InitDataRegistry.cpp: The diff looks a bit wonky because I had to reorder extractKeyIDsCenc to come before sanitizeCenc. (WebCore::extractKeyIDsCenc): Added implementation, a nullopt return value here indicates the parsing found an error in the box values. (WebCore::sanitizeCenc): Added implementation, if the box can be parsed, return a copy of the buffer as before, otherwise an error value. * Sources.txt: Add the new PSSH box type. * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp: Added, parsing methods come from ISO/IEC 23001-7-2016 Section 8.1.1. (WebCore::ISOProtectionSystemSpecificHeaderBox::parse): Ditto. * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h: Ditto. (WebCore::ISOProtectionSystemSpecificHeaderBox::boxTypeName): Ditto. (WebCore::ISOProtectionSystemSpecificHeaderBox::systemID const): Ditto. (WebCore::ISOProtectionSystemSpecificHeaderBox::keyIDs const): Ditto. (WebCore::ISOProtectionSystemSpecificHeaderBox::data const): Ditto. 2018-08-08 Zan Dobersek [Nicosia] Add the Nicosia-specific PlatformLayer type alias https://bugs.webkit.org/show_bug.cgi?id=188405 Reviewed by Carlos Garcia Campos. Add a Nicosia-specific PlatformLayer type alias that points to the Nicosia::PlatformLayer type. This is guarded by the USE(NICOSIA) macro, which guards additional code in this patch but will be added to other Nicosia-specific classes later. To keep things buildable when USE(NICOSIA) is defined, additional changes are made to classes that operate with platform layers. Cairo-specific ImageBuffer implementation and the related ImageBufferData class are modified to work with a Nicosia::ContentLayer object. This object is using the TextureMapper-specific Impl class which internally keeps a TextureMapperPlatformLayerProxy object. This way we can reuse existing code that also works with an object of this type, only difference is where the proxy object is kept. Main difference is in the ImageBuffer::platformLayer() method, where pointer to the Nicosia::ContentLayer object is returned when USE(NICOSIA) is enabled. Similar approach is taked for the MediaPlayerPrivateGStreamerBase class. When USE(NICOSIA) is enabled, a Nicosia::ContentLayer object is constructed, and with the TextureMapper-specific Impl we again operate on the TextureMapperPlatformLayerProxy object like before, so all of the proxy-specific code is bundled into helper lambdas that operate on the given proxy object. In the platformLayer() method, we again return pointer to the Nicosia::ContentLayer object when USE(NICOSIA) is on. For the GraphicsContext3D integration, we have to provide a separate class that replicates most of the functionality currently present in the TextureMapperGC3DPlatformLayer class. Main difference is that in the new Nicosia::GC3DLayer class, a Nicosia::ContentLayer object is spawned with the TextureMapper-specific Impl. The proxy object held by that Impl is then again used to push new buffers into the rendering pipeline. As before, pointer to the Nicosia::ContentLayer is returned in the GraphicsContext3D::platformLayer() object. Integration of the GraphicsContext3D class into Nicosia layering needs further work in the future. Target should be providing a class that is not specific to the TextureMapper layer. Additionally, when USE(NICOSIA) is enabled, we remove the TextureMapperGC3DPlatformLayer class from compilation since it depends on a PlatformLayer type alias to the TextureMapperPlatformLayerProxyProvider class. This patch also doesn't address the abundance of macros that this code now uses. While USE(NICOSIA) is introduced, we have to work around four additional macros in this code: USE(TEXTURE_MAPPER), USE(TEXTURE_MAPPER_GL), USE(COORDINATED_GRAPHICS) and USE(COORDINATED_GRAPHICS_THREADED). In a lot of places these are used interchangeably, but they should be merged and simplified in use. I hope to approach this once the USE(NICOSIA) functionality lands and is turned on for ports that currently build with USE(COORDINATED_GRAPHICS). * platform/TextureMapper.cmake: * platform/graphics/GraphicsContext3D.h: * platform/graphics/PlatformLayer.h: * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBufferData::ImageBufferData): (WebCore::ImageBufferData::~ImageBufferData): (WebCore::ImageBufferData::swapBuffersIfNeeded): (WebCore::ImageBuffer::platformLayer const): * platform/graphics/cairo/ImageBufferDataCairo.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): (WebCore::MediaPlayerPrivateGStreamerBase::platformLayer const): (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded): (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor): (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp: Added. (Nicosia::GC3DLayer::GC3DLayer): (Nicosia::GC3DLayer::~GC3DLayer): (Nicosia::GC3DLayer::makeContextCurrent): (Nicosia::GC3DLayer::platformContext): (Nicosia::GC3DLayer::swapBuffersIfNeeded): * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.h: Added. (Nicosia::GC3DLayer::contentLayer const): * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: (WebCore::GraphicsContext3D::GraphicsContext3D): (WebCore::GraphicsContext3D::makeContextCurrent): (WebCore::GraphicsContext3D::platformGraphicsContext3D): (WebCore::GraphicsContext3D::platformLayer const): * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp: * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer): (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer): (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer): 2018-08-08 Manuel Rego Casasnovas [css-grid] Update behavior of percentage row tracks and gutters https://bugs.webkit.org/show_bug.cgi?id=188403 Reviewed by Sergio Villar Senin. The CSSWG decided to change how percentage row tracks and gutters in a grid container with indefinite height are resolved. The CSSWG issues are: - https://github.com/w3c/csswg-drafts/issues/1921 - https://github.com/w3c/csswg-drafts/issues/509 So far they were resolved as "auto", like it happens with percentage heights in regular blocks. But now they're going to behave similar to what happens in the columns axis, they would be ignored to compute the intrinsic height. This causes that we need to repeat the track sizing algorithm when we have a grid container with indefinite height that has some percentage rows using the intrinsic height calculated on the first pass. Then the percentages will be resolved against the intrinsic height. Tests: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-content-alignment-second-pass-001.html imported/w3c/web-platform-tests/css/css-grid/alignment/grid-content-alignment-second-pass-002.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-percentage-rows-indefinite-height-001.html imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-percentage-rows-indefinite-height-002.html * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::gridTrackSize const): (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes): (WebCore::GridTrackSizingAlgorithm::setup): (WebCore::GridTrackSizingAlgorithm::reset): * rendering/GridTrackSizingAlgorithm.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::availableSpaceForGutters const): (WebCore::RenderGrid::repeatTracksSizingIfNeeded): (WebCore::RenderGrid::layoutBlock): 2018-08-07 Saam Barati ResourceUsageOverlay should use physical footprint for its "Footprint" label https://bugs.webkit.org/show_bug.cgi?id=188395 Reviewed by Simon Fraser. Let's use physical footprint on Cocoa for the number we say is "footprint". Before, we were just using the number of dirty pages multiplies by page size. This number was an upper bound on footprint since it doesn't take into account compressed memory. * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::ResourceUsageOverlay::platformDraw): 2018-08-05 Darin Adler [Cocoa] More tweaks and refactoring to prepare for ARC https://bugs.webkit.org/show_bug.cgi?id=188245 Reviewed by Dan Bernstein. * bridge/objc/objc_instance.mm: Updated include for rename: FoundationSPI.h -> objcSPI.h. * platform/ios/wak/WebCoreThread.mm: Ditto. 2018-08-07 Chris Dumez navigator.sendBeacon does not work in pagehide callbacks https://bugs.webkit.org/show_bug.cgi?id=188329 Reviewed by Alex Christensen. Add support for sending beacons from pagehide event handlers. We normally do not allow loads because we're about to enter PageCache. However, in case of Beacon, this is fine since it uses PingLoad and does not WebCore to do the load. Test: http/wpt/beacon/sendBeacon-in-pagehide.html * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): - Allow Beacon loads to go through even if the document's pageCacheState is AboutToEnterPageCache (i.e. we're firing the 'pagehide' event) - Allow Becon loads to go though even if the FrameLoader's state is provisional (i.e. a load is pending) 2018-08-07 Said Abou-Hallawa Allow href attribute without xlink on SVG elements https://bugs.webkit.org/show_bug.cgi?id=153854 Reviewed by Dean Jackson. SVG 2 has moved the href attribute from xlink namespace to svg namespace. Instead of using xlink:href, svg:href should be used or simply use href if the svg namespace is defined. See https://www.w3.org/TR/SVG2/linking.html#XLinkRefAttrs. For backward compatibility, xlink:href will be treated as an alias to href till it is acceptable to completely remove the support for the deprecated xlink:href. Tests: svg/custom/href-svg-namespace-animate.svg svg/custom/href-svg-namespace-dynamic.svg svg/custom/href-svg-namespace-elements.html svg/custom/href-svg-namespace-expected.svg svg/custom/href-svg-namespace-static.svg * dom/Element.cpp: (WebCore::Element::absoluteLinkURL const): * dom/Element.h: (WebCore::Element::getAttribute const): This new template function with template pack parameter QualifiedNames is added to return the first none empty attribute value given a set of attributes' names. This should be useful for deprecated attributes. When we decide to remove the support for the deprecated attribute, all we need is to remove it as a parameter to getAttribute(). In this case, the none template function will be called. * dom/VisitedLinkState.cpp: (WebCore::linkAttribute): * html/parser/XSSAuditor.cpp: (WebCore::XSSAuditor::filterScriptToken): * svg/SVGAElement.cpp: (WebCore::SVGAElement::isURLAttribute const): * svg/SVGAltGlyphElement.cpp: (WebCore::SVGAltGlyphElement::hasValidGlyphElements const): * svg/SVGCursorElement.cpp: * svg/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::rebuildElements): (WebCore::SVGDocumentExtensions::rebuildAllElementReferencesForTarget): * svg/SVGElement.cpp: (WebCore::SVGElement::animatableAttributeForName): * svg/SVGFEImageElement.cpp: * svg/SVGFilterElement.cpp: * svg/SVGFontFaceUriElement.cpp: (WebCore::SVGFontFaceUriElement::srcValue const): (WebCore::SVGFontFaceUriElement::parseAttribute): (WebCore::SVGFontFaceUriElement::loadFont): * svg/SVGForeignObjectElement.cpp: * svg/SVGGlyphRefElement.cpp: (WebCore::SVGGlyphRefElement::hasValidGlyphElement const): * svg/SVGGradientElement.cpp: * svg/SVGImageElement.cpp: (WebCore::SVGImageElement::imageSourceURL const): * svg/SVGMPathElement.cpp: * svg/SVGPatternElement.cpp: * svg/SVGScriptElement.h: * svg/SVGTRefElement.cpp: * svg/SVGTextPathElement.cpp: * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::registerAttributes): (WebCore::SVGURIReference::parseAttribute): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::expandUseElementsInShadowTree const): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::isSupportedAttribute): (WebCore::SVGSMILElement::svgAttributeChanged): * svg/svgattrs.in: 2018-08-07 Ryosuke Niwa document.open and document.write must throw while the HTML parser is synchronously constructing a custom element https://bugs.webkit.org/show_bug.cgi?id=187319 Reviewed by Frédéric Wang. Make document.open, document.write, document.writeln, and document.close throw InvalidStateError during a synchronous custom element construction as specified: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#throw-on-dynamic-markup-insertion-counter Tests: fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::openForBindings): Throw InvalidStateError when m_throwOnDynamicMarkupInsertionCount is non-zero. (WebCore::Document::closeForBindings): Ditto. (WebCore::Document::write): Ditto. (WebCore::Document::writeln): Ditto. * dom/Document.h: Re-ordered the related instance variables in the order they appear in the spec, and updated spec URLs. * dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h: Added. (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer): Added. (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::ThrowOnDynamicMarkupInsertionCountIncrementer): (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::~ThrowOnDynamicMarkupInsertionCountIncrementer): * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate ThrowOnDynamicMarkupInsertionCountIncrementer. 2018-08-07 Alex Christensen Use 1-byte enum class for Document::StandaloneStatus https://bugs.webkit.org/show_bug.cgi?id=188352 Reviewed by Chris Dumez. * dom/Document.cpp: (WebCore::Document::setXMLStandalone): * dom/Document.h: (WebCore::Document::xmlStandalone const): * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::appendXMLDeclaration): 2018-08-07 Rob Buis fetch() with subresource integrity crashes on zero length body https://bugs.webkit.org/show_bug.cgi?id=184325 Reviewed by Alex Christensen. Check that resourceBuffer() is non null before dereferencing. Tests: http/tests/subresource-integrity/sri-fetch.js http/tests/subresource-integrity/sri-fetch-worker.js * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::didFinishLoading): 2018-08-07 Justin Fan Prevent querying for renderer info for disconnected or uninitialized displays https://bugs.webkit.org/show_bug.cgi?id=188387 Reviewed by Simon Fraser. Calling CGL functions with a NULL displayMask crashes the process. No tests; requires multiple displays. * platform/mac/PlatformScreenMac.mm: (WebCore::collectScreenProperties): 2018-08-06 Ryosuke Niwa document.open and document.write must throw while the HTML parser is synchronously constructing a custom element https://bugs.webkit.org/show_bug.cgi?id=187319 Reviewed by Frédéric Wang. Make document.open, document.write, document.writeln, and document.close throw InvalidStateError during a synchronous custom element construction as specified: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#throw-on-dynamic-markup-insertion-counter Tests: fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html * WebCore.xcodeproj/project.pbxproj: * dom/Document.cpp: (WebCore::Document::openForBindings): Throw InvalidStateError when m_throwOnDynamicMarkupInsertionCount is non-zero. (WebCore::Document::closeForBindings): Ditto. (WebCore::Document::write): Ditto. (WebCore::Document::writeln): Ditto. * dom/Document.h: Re-ordered the related instance variables in the order they appear in the spec, and updated spec URLs. * dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h: Added. (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer): Added. (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::ThrowOnDynamicMarkupInsertionCountIncrementer): (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::~ThrowOnDynamicMarkupInsertionCountIncrementer): * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate ThrowOnDynamicMarkupInsertionCountIncrementer. 2018-08-07 Ryan Haddad Unreviewed, suppress warnings to fix the build. * crypto/CommonCryptoUtilities.cpp: (WebCore::getCommonCryptoDigestAlgorithm): 2018-08-07 Alex Christensen Removed unused *AllInOne.cpp https://bugs.webkit.org/show_bug.cgi?id=188369 Reviewed by Yusuke Suzuki. * accessibility/AccessibilityAllInOne.cpp: Removed. * bindings/js/JSBindingsAllInOne.cpp: Removed. * css/CSSAllInOne.cpp: Removed. * dom/DOMAllInOne.cpp: Removed. * editing/EditingAllInOne.cpp: Removed. * html/HTMLElementsAllInOne.cpp: Removed. * inspector/InspectorAllInOne.cpp: Removed. * loader/appcache/ApplicationCacheAllInOne.cpp: Removed. * mathml/MathMLAllInOne.cpp: Removed. * platform/text/TextAllInOne.cpp: Removed. * rendering/RenderingAllInOne.cpp: Removed. * rendering/style/StyleAllInOne.cpp: Removed. * rendering/svg/RenderSVGAllInOne.cpp: Removed. * svg/SVGAllInOne.cpp: Removed. 2018-08-07 Carlos Garcia Campos [WPE][GTK] Handle some virtual keys commonly used on TVs https://bugs.webkit.org/show_bug.cgi?id=188375 Reviewed by Žan Doberšek. * platform/gtk/PlatformKeyboardEventGtk.cpp: (WebCore::PlatformKeyboardEvent::keyValueForGdkKeyCode): (WebCore::PlatformKeyboardEvent::windowsKeyCodeForGdkKeyCode): * platform/wpe/PlatformKeyboardEventWPE.cpp: (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode): (WebCore::PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode): 2018-08-07 Zan Dobersek [Nicosia] Add Nicosia::CompositionLayerTextureMapperImpl https://bugs.webkit.org/show_bug.cgi?id=188348 Reviewed by Carlos Garcia Campos. Add the Nicosia::CompositionLayerTextureMapperImpl class, the TextureMapper-specific implementation that will extend the CompositionLayer class. The important deatil of this implementation is the TextureMapperLayer object that's expected to be managed by the composition controller. As such, it is placed inside the CompositionState struct to clearly indicate its utility and expected place of management. In the current setup, this place would be the CoordinatedGraphicsScene class. The Nicosia::CompositionLayer object that's spawned for each CoordinatedGraphicsLayer instance is now switched to using the CompositionLayerTextureMapperImpl object, with the local temporary no-op CompositionLayer::Impl class removed. * platform/TextureMapper.cmake: * platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.cpp: Added. (Nicosia::CompositionLayerTextureMapperImpl::createFactory): * platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.h: Added. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer): (): Deleted. 2018-08-07 Zan Dobersek [Nicosia] Add the TextureMapper-specific ContentLayer::Impl derivative https://bugs.webkit.org/show_bug.cgi?id=188344 Reviewed by Carlos Garcia Campos. Add Nicosia::ContentLayerTextureMapperImpl class, providing the TextureMapper-specific implementation that derives from the ContentLayer::Impl class and which can be used by the Nicosia::ContentLayer instances. Internally a TextureMapperPlatformLayerProxy is created, and is accessible to others through a getter. This way the content producers can push new buffers into this proxy object, and the scene compositor can take these buffers for display purposes. Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded() will be called during layer flushes, and the call will cause the content layer clients to take their texture, wrap it into a buffer, and push it into the TextureMapperPlatformLayerProxy object. At the moment this operation is required by the ImageBuffer and GraphicsContext3D producers. The Client object is managed under its own lock. While the producers will only live on the main thread, the thread-safe check in the destructor is necessary in case the ContentLayerTextureMapperImpl object ends up being destroyed on some other thread. The patch only adds the class implementation. It will be integrated into the layer tree later, once all the other pieces of the puzzle land. * platform/TextureMapper.cmake: * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: Added. (Nicosia::ContentLayerTextureMapperImpl::createFactory): (Nicosia::ContentLayerTextureMapperImpl::ContentLayerTextureMapperImpl): (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): (Nicosia::ContentLayerTextureMapperImpl::invalidateClient): (Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h: Added. 2018-08-07 Frederic Wang Make DOMWindow::scrollBy rely on DOMWindow::scrollTo https://bugs.webkit.org/show_bug.cgi?id=188343 Reviewed by Darin Adler. This patch makes DOMWindow::scrollBy rely on DOMWindow::scrollTo in order to perform actual scrolling of the view. In particular, this reduces the number of code path to modify in order to implement the ScrollBehavior option (bug 188043). The only change is an optimization when scrolling to position (0, 0) but it is not observable. No new tests, behavior unchanged and already tested. * page/DOMWindow.cpp: (WebCore::DOMWindow::scrollBy const): Add the current view position to the scrollBy offset in order to obtain the scrollTo offset. 2018-08-04 Ryosuke Niwa Add CEReactions=NotNeeded for reactions only needed for customized builtins https://bugs.webkit.org/show_bug.cgi?id=187851 Reviewed by Chris Dumez. Because WebKit doesn't and will not support customized builtin elements, there are many DOM APIs marked with [CEReactions] which don't actually need CustomElementReactionStack. To clarify and document this difference, this patch introduces WebKit extention: [CEReactions=NotNeeded]. When this IDL attribute is specified, we generate CustomElementReactionDisallowedScope in the bindings code to assert that there are no custom elements reactions being enqueued within the DOM API. We suppress this assertion in CustomElementReactionStack since a DOM API with [CEReactions=NotNeeded] can synchronously fire an event and otherwise execute arbirary scripts, which in turn could invoke a DOM API with [CEReactions]. This patch deployes this change to HTMLIFrameElement since "src" IDL attribute triggers this second scenario. Test: fast/custom-elements/custom-element-reaction-within-disallowed-scope.html * bindings/scripts/CodeGeneratorJS.pm: (GeneratePut): (GeneratePutByIndex): (GenerateDefineOwnProperty): (GenerateDeletePropertyCommon): (GenerateAttributeSetterBodyDefinition): (GenerateCustomElementReactionsStackIfNeeded): Added. Generate CustomElementReactionStack for [CEReactions] and CustomElementReactionDisallowedScope for [CEReactions=NotNeeded]. * bindings/scripts/test/JS/JSTestCEReactions.cpp: * bindings/scripts/test/TestCEReactions.idl: Added test cases for [CEReactions=NotNeeded]. * bindings/scripts/test/TestCEReactionsStringifier.idl: Ditto. * dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): Added an assertion to catch cases where a DOM API with [CEReactions=NotNeeded] enqueues a custom element reaction; i.e. cases where [CEReactions] should have been used. (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Ditto. (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Ditto. (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Ditto. (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Ditto. (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Ditto. (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions): Ditto. * dom/CustomElementReactionQueue.h: (WebCore::CustomElementReactionDisallowedScope): Added. Enables the assertion in enqueue* functions above. (WebCore::CustomElementReactionDisallowedScope::CustomElementReactionDisallowedScope): Added. (WebCore::CustomElementReactionDisallowedScope::~CustomElementReactionDisallowedScope): Added. (WebCore::CustomElementReactionDisallowedScope::isReactionAllowed): Added. (WebCore::CustomElementReactionDisallowedScope::AllowedScope): Added. (WebCore::CustomElementReactionDisallowedScope::AllowedScope::AllowedScope): Added. (WebCore::CustomElementReactionDisallowedScope::AllowedScope::~AllowedScope): Added. (WebCore::CustomElementReactionStack): Suppress the assertion. See above for why this is needed. * html/HTMLIFrameElement.idl: 2018-08-06 Simon Fraser Clean up initialization of some RenderLayer members https://bugs.webkit.org/show_bug.cgi?id=188330 Reviewed by Dean Jackson. Use initializers for the pointers. No need to initialize LayoutUnits, which initialize to zero. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): * rendering/RenderLayer.h: 2018-08-06 Said Abou-Hallawa Remove the SVG elements' attributes macros https://bugs.webkit.org/show_bug.cgi?id=186751 Reviewed by Simon Fraser. This is how the SVG attributes are implemented after removing the SVG macros: 1) The SVG attribute is defined as a super class of SVGAttribute. The super classes of SVGAttribute are template classes. The type of these template are the property type or the TearOff type. 2) To unify accessing attributes of the SVGElements and its super classes an SVGAttributeAccessor template class is added. It is inherited by other template classes. The types of these templates are the owner and the attributes types. The main functions of these classes is to synchronize the new property value with the document attributes pool and to create and cache the TearOff objects. 3) To make code shorter and more readable, attribute types and attribute accessors are defined for every SVG TearOff type, e.g. -- SVGLength: SVGAnimatedLengthAttribute and SVGAnimatedLengthAttributeAccessor -- SVGAnimatedNumber: SVGAnimatedNumberAttribute and SVGAnimatedNumberAttributeAccessor 4) A special accessor is defined for animated pair and optional attributes: SVGAnimatedPairAttributeAccessor, e.g. -- SVGMarkerElement: orient attribute: "angle" or "type" -- SVGFEGaussianBlurElement: stdDeviation attribute: "x" and "y" 5) The SVG attributes have to be registered into an singleton SVGAttributeRegistry. The SVGAttributeRegistry is a template class. The types of this template class are the the type of the owner and the base classes of this owner. This registry holds a map from "attribute name" to "attribute accessor". 6) To make the code easier to read, the SVGAttributeRegistry implements registerAttribute() for different attribute types. The owner needs only to provide the attribute name and a pointer to the class member of this attribute to the same function "registerAttribute()". The compiler will pick the right function to call based on the type of the attribute. 7) Given a reference to the owner element, SVGAttributeRegistry can loop through the attributes of this owner and through the attributes of its base classes as well to do operations like synchronizing all the attributes or creating the TearOff object of a certain attribute. 8) To make the base class SVGElement have the ability to access the attributes of any of its super classes, SVGAttributeOwnerProxy will be used. SVGAttributeOwnerProxy is a base class which have all the functions that SVGElement needs as pure virtual functions. 9) SVGAttributeOwnerProxyImpl is a template class which implements SVGAttributeOwnerProxy and whose types are the owner and its base classes. SVGAttributeOwnerProxyImpl keeps a reference to the owner and the context SVGElement. 10) All the SVG attribute owners have to implement the virtual function attributeOwnerProxy() which returns a reference to SVGAttributeOwnerProxy. The local attributeOwnerProxy() returns a reference to a local SVGAttributeOwnerProxyImpl. Its type and base types are the class hierarchy of this element. All the attributes of the non-SVGElement-based classes are moved as members of these classes instead of adding them to all the super classes. These classes are: -- SVGExternalResourcesRequired -- SVGURIReference -- SVGFitToViewBox -- SVGZoomAndPan -- SVGLangSpace The svgAttributeChanged() of all the SVGElement-based classes are now simplified by distributing the responsibilities of changing an attribute to the base classes. One exception is the SVGURIReference since the action to be taken when changing the "href" is different for every super class. Other work will be done in separate patches. -- Shrinking the memory of the SVGElements. -- Making all the attributes RefCounted objects. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * rendering/svg/RenderSVGResourceMarker.cpp: (WebCore::RenderSVGResourceMarker::draw): * svg/SVGAElement.cpp: (WebCore::SVGAElement::SVGAElement): (WebCore::SVGAElement::registerAttributes): (WebCore::SVGAElement::parseAttribute): (WebCore::SVGAElement::svgAttributeChanged): * svg/SVGAElement.h: * svg/SVGAElement.idl: * svg/SVGAltGlyphElement.cpp: (WebCore::SVGAltGlyphElement::SVGAltGlyphElement): * svg/SVGAltGlyphElement.h: * svg/SVGAnimatedAngle.h: * svg/SVGAnimatedBoolean.h: * svg/SVGAnimatedEnumeration.h: * svg/SVGAnimatedInteger.h: * svg/SVGAnimatedLength.h: * svg/SVGAnimatedLengthList.h: * svg/SVGAnimatedNumber.h: * svg/SVGAnimatedNumberList.h: * svg/SVGAnimatedPath.h: * svg/SVGAnimatedPointList.h: * svg/SVGAnimatedPreserveAspectRatio.h: * svg/SVGAnimatedRect.h: * svg/SVGAnimatedString.h: * svg/SVGAnimatedTransformList.h: * svg/SVGAnimatedTypeAnimator.cpp: (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::SVGAnimationElement): (WebCore::SVGAnimationElement::requiredFeatures): Deleted. (WebCore::SVGAnimationElement::requiredExtensions): Deleted. (WebCore::SVGAnimationElement::systemLanguage): Deleted. * svg/SVGAnimationElement.h: (WebCore::SVGAnimationElement::attributeRegistry): * svg/SVGCircleElement.cpp: (WebCore::SVGCircleElement::SVGCircleElement): (WebCore::SVGCircleElement::registerAttributes): (WebCore::SVGCircleElement::parseAttribute): (WebCore::SVGCircleElement::svgAttributeChanged): * svg/SVGCircleElement.h: * svg/SVGClipPathElement.cpp: (WebCore::SVGClipPathElement::SVGClipPathElement): (WebCore::SVGClipPathElement::registerAttributes): (WebCore::SVGClipPathElement::parseAttribute): (WebCore::SVGClipPathElement::svgAttributeChanged): (WebCore::SVGClipPathElement::isSupportedAttribute): Deleted. * svg/SVGClipPathElement.h: * svg/SVGComponentTransferFunctionElement.cpp: (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement): (WebCore::SVGComponentTransferFunctionElement::registerAttributes): (WebCore::SVGComponentTransferFunctionElement::parseAttribute): (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged): (WebCore::SVGComponentTransferFunctionElement::transferFunction const): (WebCore::SVGComponentTransferFunctionElement::isSupportedAttribute): Deleted. * svg/SVGComponentTransferFunctionElement.h: (WebCore::SVGComponentTransferFunctionElement::type const): (WebCore::SVGComponentTransferFunctionElement::tableValues const): (WebCore::SVGComponentTransferFunctionElement::slope const): (WebCore::SVGComponentTransferFunctionElement::intercept const): (WebCore::SVGComponentTransferFunctionElement::amplitude const): (WebCore::SVGComponentTransferFunctionElement::exponent const): (WebCore::SVGComponentTransferFunctionElement::offset const): (WebCore::SVGComponentTransferFunctionElement::typeAnimated): (WebCore::SVGComponentTransferFunctionElement::tableValuesAnimated): (WebCore::SVGComponentTransferFunctionElement::slopeAnimated): (WebCore::SVGComponentTransferFunctionElement::interceptAnimated): (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated): (WebCore::SVGComponentTransferFunctionElement::exponentAnimated): (WebCore::SVGComponentTransferFunctionElement::offsetAnimated): (WebCore::SVGComponentTransferFunctionElement::attributeRegistry): (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute): * svg/SVGCursorElement.cpp: (WebCore::SVGCursorElement::SVGCursorElement): (WebCore::SVGCursorElement::registerAttributes): (WebCore::SVGCursorElement::parseAttribute): (WebCore::SVGCursorElement::svgAttributeChanged): (WebCore::SVGCursorElement::isSupportedAttribute): Deleted. (WebCore::SVGCursorElement::requiredFeatures): Deleted. (WebCore::SVGCursorElement::requiredExtensions): Deleted. (WebCore::SVGCursorElement::systemLanguage): Deleted. * svg/SVGCursorElement.h: * svg/SVGDefsElement.cpp: (WebCore::SVGDefsElement::SVGDefsElement): * svg/SVGDefsElement.h: * svg/SVGElement.cpp: (WebCore::SVGElement::SVGElement): (WebCore::SVGElement::registerAttributes): (WebCore::SVGElement::parseAttribute): (WebCore::SVGElement::animatedPropertyTypesForAttribute): (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): (WebCore::SVGElement::svgAttributeChanged): (WebCore::SVGElement::synchronizeRequiredFeatures): Deleted. (WebCore::SVGElement::synchronizeRequiredExtensions): Deleted. (WebCore::SVGElement::synchronizeSystemLanguage): Deleted. (WebCore::SVGElement::isKnownAttribute): Deleted. * svg/SVGElement.h: (WebCore::SVGElement::attributeRegistry): (WebCore::SVGElement::isKnownAttribute): (WebCore::SVGElement::attributeOwnerProxy const): (WebCore::SVGElement::synchronizeAttribute): (WebCore::SVGElement::synchronizeAttributes): (WebCore::SVGElement::animatedTypes const): (WebCore::SVGElement::lookupAnimatedProperty const): (WebCore::SVGElement::lookupOrCreateAnimatedProperty): (WebCore::SVGElement::lookupOrCreateAnimatedProperties): (WebCore::SVGElement::className const): (WebCore::SVGElement::classNameAnimated): (WebCore::SVGElement::synchronizeRequiredFeatures): Deleted. (WebCore::SVGElement::synchronizeRequiredExtensions): Deleted. (WebCore::SVGElement::synchronizeSystemLanguage): Deleted. * svg/SVGEllipseElement.cpp: (WebCore::SVGEllipseElement::SVGEllipseElement): (WebCore::SVGEllipseElement::registerAttributes): (WebCore::SVGEllipseElement::parseAttribute): (WebCore::SVGEllipseElement::svgAttributeChanged): * svg/SVGEllipseElement.h: * svg/SVGExternalResourcesRequired.cpp: (WebCore::SVGExternalResourcesRequired::SVGExternalResourcesRequired): (WebCore::SVGExternalResourcesRequired::registerAttributes): (WebCore::SVGExternalResourcesRequired::parseAttribute): (WebCore::SVGExternalResourcesRequired::svgAttributeChanged): (WebCore::SVGExternalResourcesRequired::addSupportedAttributes): (WebCore::SVGExternalResourcesRequired::dispatchLoadEvent): (WebCore::SVGExternalResourcesRequired::insertedIntoDocument): (WebCore::SVGExternalResourcesRequired::finishParsingChildren): (WebCore::SVGExternalResourcesRequired::haveLoadedRequiredResources const): (WebCore::SVGExternalResourcesRequired::isKnownAttribute): Deleted. (WebCore::SVGExternalResourcesRequired::handleAttributeChange): Deleted. * svg/SVGExternalResourcesRequired.h: (WebCore::SVGExternalResourcesRequired::attributeRegistry): (WebCore::SVGExternalResourcesRequired::externalResourcesRequiredAnimated): (WebCore::SVGExternalResourcesRequired::externalResourcesRequired const): (WebCore::SVGExternalResourcesRequired::setExternalResourcesRequired): (WebCore::SVGExternalResourcesRequired::isKnownAttribute): (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy): * svg/SVGFEBlendElement.cpp: (WebCore::SVGFEBlendElement::SVGFEBlendElement): (WebCore::SVGFEBlendElement::registerAttributes): (WebCore::SVGFEBlendElement::parseAttribute): * svg/SVGFEBlendElement.h: * svg/SVGFEColorMatrixElement.cpp: (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement): (WebCore::SVGFEColorMatrixElement::registerAttributes): (WebCore::SVGFEColorMatrixElement::parseAttribute): * svg/SVGFEColorMatrixElement.h: * svg/SVGFEComponentTransferElement.cpp: (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement): (WebCore::SVGFEComponentTransferElement::registerAttributes): (WebCore::SVGFEComponentTransferElement::parseAttribute): * svg/SVGFEComponentTransferElement.h: * svg/SVGFECompositeElement.cpp: (WebCore::SVGFECompositeElement::SVGFECompositeElement): (WebCore::SVGFECompositeElement::registerAttributes): (WebCore::SVGFECompositeElement::parseAttribute): * svg/SVGFECompositeElement.h: * svg/SVGFEConvolveMatrixElement.cpp: (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement): (WebCore::SVGFEConvolveMatrixElement::registerAttributes): (WebCore::SVGFEConvolveMatrixElement::parseAttribute): (WebCore::SVGFEConvolveMatrixElement::setFilterEffectAttribute): (WebCore::SVGFEConvolveMatrixElement::setOrder): (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength): * svg/SVGFEConvolveMatrixElement.h: (WebCore::SVGPropertyTraits::initialValue): * svg/SVGFEDiffuseLightingElement.cpp: (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement): (WebCore::SVGFEDiffuseLightingElement::registerAttributes): (WebCore::SVGFEDiffuseLightingElement::parseAttribute): * svg/SVGFEDiffuseLightingElement.h: * svg/SVGFEDisplacementMapElement.cpp: (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement): (WebCore::SVGFEDisplacementMapElement::registerAttributes): (WebCore::SVGFEDisplacementMapElement::parseAttribute): * svg/SVGFEDisplacementMapElement.h: * svg/SVGFEDropShadowElement.cpp: (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement): (WebCore::SVGFEDropShadowElement::setStdDeviation): (WebCore::SVGFEDropShadowElement::registerAttributes): (WebCore::SVGFEDropShadowElement::parseAttribute): (WebCore::SVGFEDropShadowElement::svgAttributeChanged): * svg/SVGFEDropShadowElement.h: * svg/SVGFEGaussianBlurElement.cpp: (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement): (WebCore::SVGFEGaussianBlurElement::setStdDeviation): (WebCore::SVGFEGaussianBlurElement::registerAttributes): (WebCore::SVGFEGaussianBlurElement::parseAttribute): (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): * svg/SVGFEGaussianBlurElement.h: * svg/SVGFEImageElement.cpp: (WebCore::SVGFEImageElement::SVGFEImageElement): (WebCore::SVGFEImageElement::registerAttributes): (WebCore::SVGFEImageElement::parseAttribute): * svg/SVGFEImageElement.h: * svg/SVGFELightElement.cpp: (WebCore::SVGFELightElement::SVGFELightElement): (WebCore::SVGFELightElement::registerAttributes): (WebCore::SVGFELightElement::parseAttribute): (WebCore::SVGFELightElement::svgAttributeChanged): * svg/SVGFELightElement.h: (WebCore::SVGFELightElement::azimuth const): (WebCore::SVGFELightElement::elevation const): (WebCore::SVGFELightElement::x const): (WebCore::SVGFELightElement::y const): (WebCore::SVGFELightElement::z const): (WebCore::SVGFELightElement::pointsAtX const): (WebCore::SVGFELightElement::pointsAtY const): (WebCore::SVGFELightElement::pointsAtZ const): (WebCore::SVGFELightElement::specularExponent const): (WebCore::SVGFELightElement::limitingConeAngle const): (WebCore::SVGFELightElement::azimuthAnimated): (WebCore::SVGFELightElement::elevationAnimated): (WebCore::SVGFELightElement::xAnimated): (WebCore::SVGFELightElement::yAnimated): (WebCore::SVGFELightElement::zAnimated): (WebCore::SVGFELightElement::pointsAtXAnimated): (WebCore::SVGFELightElement::pointsAtYAnimated): (WebCore::SVGFELightElement::pointsAtZAnimated): (WebCore::SVGFELightElement::specularExponentAnimated): (WebCore::SVGFELightElement::limitingConeAngleAnimated): (WebCore::SVGFELightElement::attributeRegistry): (WebCore::SVGFELightElement::isKnownAttribute): * svg/SVGFEMergeNodeElement.cpp: (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement): (WebCore::SVGFEMergeNodeElement::registerAttributes): (WebCore::SVGFEMergeNodeElement::parseAttribute): * svg/SVGFEMergeNodeElement.h: * svg/SVGFEMorphologyElement.cpp: (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement): (WebCore::SVGFEMorphologyElement::setRadius): (WebCore::SVGFEMorphologyElement::registerAttributes): (WebCore::SVGFEMorphologyElement::parseAttribute): * svg/SVGFEMorphologyElement.h: * svg/SVGFEOffsetElement.cpp: (WebCore::SVGFEOffsetElement::SVGFEOffsetElement): (WebCore::SVGFEOffsetElement::registerAttributes): (WebCore::SVGFEOffsetElement::parseAttribute): (WebCore::SVGFEOffsetElement::svgAttributeChanged): * svg/SVGFEOffsetElement.h: * svg/SVGFESpecularLightingElement.cpp: (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement): (WebCore::SVGFESpecularLightingElement::registerAttributes): (WebCore::SVGFESpecularLightingElement::parseAttribute): * svg/SVGFESpecularLightingElement.h: * svg/SVGFETileElement.cpp: (WebCore::SVGFETileElement::SVGFETileElement): (WebCore::SVGFETileElement::registerAttributes): (WebCore::SVGFETileElement::parseAttribute): * svg/SVGFETileElement.h: * svg/SVGFETurbulenceElement.cpp: (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement): (WebCore::SVGFETurbulenceElement::registerAttributes): (WebCore::SVGFETurbulenceElement::parseAttribute): (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute): (WebCore::SVGFETurbulenceElement::svgAttributeChanged): * svg/SVGFETurbulenceElement.h: * svg/SVGFilterElement.cpp: (WebCore::SVGFilterElement::SVGFilterElement): (WebCore::SVGFilterElement::setFilterRes): (WebCore::SVGFilterElement::registerAttributes): (WebCore::SVGFilterElement::parseAttribute): (WebCore::SVGFilterElement::svgAttributeChanged): (WebCore::SVGFilterElement::isSupportedAttribute): Deleted. * svg/SVGFilterElement.h: * svg/SVGFilterPrimitiveStandardAttributes.cpp: (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes): (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes): (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute): (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged): (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute): Deleted. * svg/SVGFilterPrimitiveStandardAttributes.h: (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): (WebCore::SVGFilterPrimitiveStandardAttributes::x const): (WebCore::SVGFilterPrimitiveStandardAttributes::y const): (WebCore::SVGFilterPrimitiveStandardAttributes::width const): (WebCore::SVGFilterPrimitiveStandardAttributes::height const): (WebCore::SVGFilterPrimitiveStandardAttributes::result const): (WebCore::SVGFilterPrimitiveStandardAttributes::xAnimated): (WebCore::SVGFilterPrimitiveStandardAttributes::yAnimated): (WebCore::SVGFilterPrimitiveStandardAttributes::widthAnimated): (WebCore::SVGFilterPrimitiveStandardAttributes::heightAnimated): (WebCore::SVGFilterPrimitiveStandardAttributes::resultAnimated): (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute): * svg/SVGFitToViewBox.cpp: (WebCore::SVGFitToViewBox::SVGFitToViewBox): (WebCore::SVGFitToViewBox::registerAttributes): (WebCore::SVGFitToViewBox::setViewBox): (WebCore::SVGFitToViewBox::resetViewBox): (WebCore::SVGFitToViewBox::reset): (WebCore::SVGFitToViewBox::parseAttribute): (WebCore::SVGFitToViewBox::parseViewBox): (WebCore::SVGFitToViewBox::isKnownAttribute): Deleted. (WebCore::SVGFitToViewBox::addSupportedAttributes): Deleted. * svg/SVGFitToViewBox.h: (WebCore::SVGFitToViewBox::attributeRegistry): (WebCore::SVGFitToViewBox::viewBox const): (WebCore::SVGFitToViewBox::preserveAspectRatio const): (WebCore::SVGFitToViewBox::viewBoxAnimated): (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated): (WebCore::SVGFitToViewBox::setPreserveAspectRatio): (WebCore::SVGFitToViewBox::resetPreserveAspectRatio): (WebCore::SVGFitToViewBox::viewBoxString const): (WebCore::SVGFitToViewBox::preserveAspectRatioString const): (WebCore::SVGFitToViewBox::hasValidViewBox const): (WebCore::SVGFitToViewBox::hasEmptyViewBox const): (WebCore::SVGFitToViewBox::isKnownAttribute): (WebCore::SVGFitToViewBox::parseAttribute): Deleted. * svg/SVGFontElement.cpp: (WebCore::SVGFontElement::SVGFontElement): * svg/SVGFontElement.h: * svg/SVGForeignObjectElement.cpp: (WebCore::SVGForeignObjectElement::SVGForeignObjectElement): (WebCore::SVGForeignObjectElement::registerAttributes): (WebCore::SVGForeignObjectElement::parseAttribute): (WebCore::SVGForeignObjectElement::svgAttributeChanged): (WebCore::SVGForeignObjectElement::isSupportedAttribute): Deleted. * svg/SVGForeignObjectElement.h: * svg/SVGGElement.cpp: (WebCore::SVGGElement::SVGGElement): (WebCore::SVGGElement::svgAttributeChanged): (WebCore::SVGGElement::isSupportedAttribute): Deleted. * svg/SVGGElement.h: * svg/SVGGeometryElement.cpp: (WebCore::SVGGeometryElement::SVGGeometryElement): (WebCore::SVGGeometryElement::registerAttributes): (WebCore::SVGGeometryElement::parseAttribute): (WebCore::SVGGeometryElement::svgAttributeChanged): (WebCore::SVGGeometryElement::isSupportedAttribute): Deleted. * svg/SVGGeometryElement.h: (WebCore::SVGGeometryElement::attributeRegistry): (WebCore::SVGGeometryElement::pathLengthAnimated): (WebCore::SVGGeometryElement::isKnownAttribute): * svg/SVGGlyphRefElement.cpp: (WebCore::SVGGlyphRefElement::SVGGlyphRefElement): * svg/SVGGlyphRefElement.h: * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::SVGGradientElement): (WebCore::SVGGradientElement::registerAttributes): (WebCore::SVGGradientElement::parseAttribute): (WebCore::SVGGradientElement::svgAttributeChanged): (WebCore::SVGGradientElement::isSupportedAttribute): Deleted. * svg/SVGGradientElement.h: (WebCore::SVGGradientElement::attributeRegistry): (WebCore::SVGGradientElement::spreadMethod const): (WebCore::SVGGradientElement::gradientUnits const): (WebCore::SVGGradientElement::gradientTransform const): (WebCore::SVGGradientElement::spreadMethodAnimated): (WebCore::SVGGradientElement::gradientUnitsAnimated): (WebCore::SVGGradientElement::gradientTransformAnimated): (WebCore::SVGGradientElement::isKnownAttribute): * svg/SVGGraphicsElement.cpp: (WebCore::SVGGraphicsElement::SVGGraphicsElement): (WebCore::SVGGraphicsElement::registerAttributes): (WebCore::SVGGraphicsElement::parseAttribute): (WebCore::SVGGraphicsElement::svgAttributeChanged): (WebCore::SVGGraphicsElement::isSupportedAttribute): Deleted. (WebCore::SVGGraphicsElement::requiredFeatures): Deleted. (WebCore::SVGGraphicsElement::requiredExtensions): Deleted. (WebCore::SVGGraphicsElement::systemLanguage): Deleted. * svg/SVGGraphicsElement.h: (WebCore::SVGGraphicsElement::attributeRegistry): (WebCore::SVGGraphicsElement::transform const): (WebCore::SVGGraphicsElement::transformAnimated): (WebCore::SVGGraphicsElement::isKnownAttribute): * svg/SVGImageElement.cpp: (WebCore::SVGImageElement::SVGImageElement): (WebCore::SVGImageElement::registerAttributes): (WebCore::SVGImageElement::parseAttribute): (WebCore::SVGImageElement::svgAttributeChanged): (WebCore::SVGImageElement::haveLoadedRequiredResources): (WebCore::SVGImageElement::isSupportedAttribute): Deleted. * svg/SVGImageElement.h: * svg/SVGImageLoader.cpp: (WebCore::SVGImageLoader::dispatchLoadEvent): * svg/SVGLangSpace.cpp: (WebCore::SVGLangSpace::SVGLangSpace): (WebCore::SVGLangSpace::registerAttributes): (WebCore::SVGLangSpace::xmlspace const): (WebCore::SVGLangSpace::svgAttributeChanged): (WebCore::SVGLangSpace::setXmllang): Deleted. (WebCore::SVGLangSpace::setXmlspace): Deleted. (WebCore::SVGLangSpace::isKnownAttribute): Deleted. (WebCore::addWithAndWithoutXMLPrefix): Deleted. (WebCore::SVGLangSpace::addSupportedAttributes): Deleted. * svg/SVGLangSpace.h: (WebCore::SVGLangSpace::xmllang const): (WebCore::SVGLangSpace::setXmllang): (WebCore::SVGLangSpace::setXmlspace): (WebCore::SVGLangSpace::attributeRegistry): (WebCore::SVGLangSpace::isKnownAttribute): * svg/SVGLineElement.cpp: (WebCore::SVGLineElement::SVGLineElement): (WebCore::SVGLineElement::registerAttributes): (WebCore::SVGLineElement::parseAttribute): (WebCore::SVGLineElement::svgAttributeChanged): (WebCore::SVGLineElement::isSupportedAttribute): Deleted. * svg/SVGLineElement.h: * svg/SVGLinearGradientElement.cpp: (WebCore::SVGLinearGradientElement::SVGLinearGradientElement): (WebCore::SVGLinearGradientElement::registerAttributes): (WebCore::SVGLinearGradientElement::parseAttribute): (WebCore::SVGLinearGradientElement::svgAttributeChanged): (WebCore::SVGLinearGradientElement::isSupportedAttribute): Deleted. * svg/SVGLinearGradientElement.h: * svg/SVGMPathElement.cpp: (WebCore::SVGMPathElement::SVGMPathElement): (WebCore::SVGMPathElement::svgAttributeChanged): * svg/SVGMPathElement.h: * svg/SVGMarkerElement.cpp: (WebCore::SVGMarkerElement::SVGMarkerElement): (WebCore::SVGMarkerElement::registerAttributes): (WebCore::SVGMarkerElement::parseAttribute): (WebCore::SVGMarkerElement::svgAttributeChanged): (WebCore::SVGMarkerElement::setOrient): (WebCore::SVGMarkerElement::orientTypePropertyInfo): Deleted. (WebCore::SVGMarkerElement::isSupportedAttribute): Deleted. (WebCore::SVGMarkerElement::synchronizeOrientType): Deleted. (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper): Deleted. (WebCore::SVGMarkerElement::orientType const): Deleted. (WebCore::SVGMarkerElement::orientTypeAnimated): Deleted. * svg/SVGMarkerElement.h: * svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::SVGMaskElement): (WebCore::SVGMaskElement::registerAttributes): (WebCore::SVGMaskElement::parseAttribute): (WebCore::SVGMaskElement::svgAttributeChanged): (WebCore::SVGMaskElement::isSupportedAttribute): Deleted. (WebCore::SVGMaskElement::requiredFeatures): Deleted. (WebCore::SVGMaskElement::requiredExtensions): Deleted. (WebCore::SVGMaskElement::systemLanguage): Deleted. * svg/SVGMaskElement.h: * svg/SVGPathElement.cpp: (WebCore::SVGPathElement::SVGPathElement): (WebCore::SVGPathElement::registerAttributes): (WebCore::SVGPathElement::parseAttribute): (WebCore::SVGPathElement::svgAttributeChanged): (WebCore::SVGPathElement::pathByteStream const): (WebCore::SVGPathElement::lookupOrCreateDWrapper): (WebCore::SVGPathElement::animatedPropertyWillBeDeleted): (WebCore::SVGPathElement::pathSegList): (WebCore::SVGPathElement::animatedPathSegList): (WebCore::SVGPathElement::pathSegListChanged): (WebCore::SVGPathElement::dPropertyInfo): Deleted. (WebCore::SVGPathElement::isSupportedAttribute): Deleted. (WebCore::SVGPathElement::synchronizeD): Deleted. * svg/SVGPathElement.h: * svg/SVGPathSegListValues.h: (WebCore::SVGPropertyTraits::toString): * svg/SVGPathSegWithContext.h: (WebCore::SVGPathSegWithContext::animatedProperty const): * svg/SVGPatternElement.cpp: (WebCore::SVGPatternElement::SVGPatternElement): (WebCore::SVGPatternElement::registerAttributes): (WebCore::SVGPatternElement::parseAttribute): (WebCore::SVGPatternElement::svgAttributeChanged): (WebCore::SVGPatternElement::collectPatternAttributes const): (WebCore::SVGPatternElement::isSupportedAttribute): Deleted. (WebCore::SVGPatternElement::requiredFeatures): Deleted. (WebCore::SVGPatternElement::requiredExtensions): Deleted. (WebCore::SVGPatternElement::systemLanguage): Deleted. * svg/SVGPatternElement.h: * svg/SVGPointListValues.h: (WebCore::SVGPropertyTraits::toString): * svg/SVGPolyElement.cpp: (WebCore::SVGPolyElement::SVGPolyElement): (WebCore::SVGPolyElement::registerAttributes): (WebCore::SVGPolyElement::parseAttribute): (WebCore::SVGPolyElement::svgAttributeChanged): (WebCore::SVGPolyElement::points): (WebCore::SVGPolyElement::animatedPoints): (WebCore::SVGPolyElement::pointsPropertyInfo): Deleted. (WebCore::SVGPolyElement::synchronizePoints): Deleted. (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper): Deleted. * svg/SVGPolyElement.h: (WebCore::SVGPolyElement::pointList const): (WebCore::SVGPolyElement::attributeRegistry): (WebCore::SVGPolyElement::isKnownAttribute): * svg/SVGPreserveAspectRatioValue.cpp: (WebCore::SVGPreserveAspectRatioValue::transformRect const): (WebCore::SVGPreserveAspectRatioValue::transformRect): Deleted. * svg/SVGPreserveAspectRatioValue.h: * svg/SVGRadialGradientElement.cpp: (WebCore::SVGRadialGradientElement::SVGRadialGradientElement): (WebCore::SVGRadialGradientElement::registerAttributes): (WebCore::SVGRadialGradientElement::parseAttribute): (WebCore::SVGRadialGradientElement::svgAttributeChanged): (WebCore::SVGRadialGradientElement::isSupportedAttribute): Deleted. * svg/SVGRadialGradientElement.h: * svg/SVGRectElement.cpp: (WebCore::SVGRectElement::SVGRectElement): (WebCore::SVGRectElement::registerAttributes): (WebCore::SVGRectElement::parseAttribute): (WebCore::SVGRectElement::svgAttributeChanged): * svg/SVGRectElement.h: * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::SVGSVGElement): (WebCore::SVGSVGElement::registerAttributes): (WebCore::SVGSVGElement::parseAttribute): (WebCore::SVGSVGElement::svgAttributeChanged): (WebCore::SVGSVGElement::viewBoxToViewTransform const): (WebCore::SVGSVGElement::resetScrollAnchor): (WebCore::SVGSVGElement::inheritViewAttributes): * svg/SVGSVGElement.h: (WebCore::SVGSVGElement::useCurrentView const): Deleted. (WebCore::SVGSVGElement::currentTranslateValue): Deleted. (WebCore::SVGSVGElement::zoomAndPan const): Deleted. (WebCore::SVGSVGElement::setZoomAndPan): Deleted. (WebCore::SVGSVGElement::timeContainer): Deleted. (WebCore::SVGSVGElement::hasEmptyViewBox const): Deleted. * svg/SVGScriptElement.cpp: (WebCore::SVGScriptElement::SVGScriptElement): (WebCore::SVGScriptElement::svgAttributeChanged): (WebCore::SVGScriptElement::insertedIntoAncestor): (WebCore::SVGScriptElement::addSubresourceAttributeURLs const): (WebCore::SVGScriptElement::isURLAttribute const): Deleted. (WebCore::SVGScriptElement::sourceAttributeValue const): Deleted. (WebCore::SVGScriptElement::charsetAttributeValue const): Deleted. (WebCore::SVGScriptElement::typeAttributeValue const): Deleted. (WebCore::SVGScriptElement::languageAttributeValue const): Deleted. (WebCore::SVGScriptElement::forAttributeValue const): Deleted. (WebCore::SVGScriptElement::eventAttributeValue const): Deleted. (WebCore::SVGScriptElement::hasAsyncAttribute const): Deleted. (WebCore::SVGScriptElement::hasDeferAttribute const): Deleted. (WebCore::SVGScriptElement::hasNoModuleAttribute const): Deleted. (WebCore::SVGScriptElement::hasSourceAttribute const): Deleted. (WebCore::SVGScriptElement::filterOutAnimatableAttribute const): Deleted. * svg/SVGScriptElement.h: * svg/SVGStopElement.cpp: (WebCore::SVGStopElement::SVGStopElement): (WebCore::SVGStopElement::registerAttributes): (WebCore::SVGStopElement::parseAttribute): * svg/SVGStopElement.h: * svg/SVGStringListValues.h: (WebCore::SVGPropertyTraits::toString): * svg/SVGSwitchElement.cpp: (WebCore::SVGSwitchElement::SVGSwitchElement): * svg/SVGSwitchElement.h: * svg/SVGSymbolElement.cpp: (WebCore::SVGSymbolElement::SVGSymbolElement): (WebCore::SVGSymbolElement::parseAttribute): (WebCore::SVGSymbolElement::svgAttributeChanged): * svg/SVGSymbolElement.h: * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::SVGTRefElement): * svg/SVGTRefElement.h: * svg/SVGTests.cpp: (WebCore::SVGTests::SVGTests): (WebCore::SVGTests::registerAttributes): (WebCore::SVGTests::attributeRegistry): (WebCore::SVGTests::isKnownAttribute): (WebCore::SVGTests::isValid const): (WebCore::SVGTests::parseAttribute): (WebCore::SVGTests::svgAttributeChanged): (WebCore::SVGTests::requiredFeatures): (WebCore::SVGTests::requiredExtensions): (WebCore::SVGTests::systemLanguage): (WebCore::createSVGTestPropertyInfo): Deleted. (WebCore::createSVGTextAttributeToPropertyMap): Deleted. (WebCore::SVGTests::attributeToPropertyMap): Deleted. (WebCore::SVGTests::handleAttributeChange): Deleted. (WebCore::SVGTests::synchronizeAttribute): Deleted. (WebCore::SVGTests::synchronizeRequiredFeatures): Deleted. (WebCore::SVGTests::synchronizeRequiredExtensions): Deleted. (WebCore::SVGTests::synchronizeSystemLanguage): Deleted. * svg/SVGTests.h: * svg/SVGTextContentElement.cpp: (WebCore::SVGTextContentElement::SVGTextContentElement): (WebCore::SVGTextContentElement::registerAttributes): (WebCore::SVGTextContentElement::parseAttribute): (WebCore::SVGTextContentElement::svgAttributeChanged): (WebCore::SVGTextContentElement::textLengthPropertyInfo): Deleted. (WebCore::SVGTextContentElement::synchronizeTextLength): Deleted. (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper): Deleted. (WebCore::SVGTextContentElement::textLengthAnimated): Deleted. (WebCore::SVGTextContentElement::isSupportedAttribute): Deleted. * svg/SVGTextContentElement.h: (WebCore::SVGTextContentElement::specifiedTextLength): (WebCore::SVGTextContentElement::attributeRegistry): (WebCore::SVGTextContentElement::textLength const): (WebCore::SVGTextContentElement::lengthAdjust const): (WebCore::SVGTextContentElement::textLengthAnimated): (WebCore::SVGTextContentElement::lengthAdjustAnimated): (WebCore::SVGTextContentElement::isKnownAttribute): (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::SVGAnimatedCustomLengthAttribute): (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::synchronize): (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::animatedProperty): * svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::SVGTextPathElement): (WebCore::SVGTextPathElement::registerAttributes): (WebCore::SVGTextPathElement::parseAttribute): (WebCore::SVGTextPathElement::svgAttributeChanged): (WebCore::SVGTextPathElement::isSupportedAttribute): Deleted. * svg/SVGTextPathElement.h: * svg/SVGTextPositioningElement.cpp: (WebCore::SVGTextPositioningElement::SVGTextPositioningElement): (WebCore::SVGTextPositioningElement::registerAttributes): (WebCore::SVGTextPositioningElement::parseAttribute): (WebCore::SVGTextPositioningElement::svgAttributeChanged): * svg/SVGTextPositioningElement.h: (WebCore::SVGTextPositioningElement::attributeRegistry): (WebCore::SVGTextPositioningElement::x const): (WebCore::SVGTextPositioningElement::y const): (WebCore::SVGTextPositioningElement::dx const): (WebCore::SVGTextPositioningElement::dy const): (WebCore::SVGTextPositioningElement::rotate const): (WebCore::SVGTextPositioningElement::xAnimated): (WebCore::SVGTextPositioningElement::yAnimated): (WebCore::SVGTextPositioningElement::dxAnimated): (WebCore::SVGTextPositioningElement::dyAnimated): (WebCore::SVGTextPositioningElement::rotateAnimated): (WebCore::SVGTextPositioningElement::isKnownAttribute): * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::SVGURIReference): (WebCore::SVGURIReference::registerAttributes): (WebCore::SVGURIReference::attributeRegistry): (WebCore::SVGURIReference::isKnownAttribute): (WebCore::SVGURIReference::parseAttribute): (WebCore::SVGURIReference::href const): (WebCore::SVGURIReference::hrefAnimated): (WebCore::SVGURIReference::addSupportedAttributes): Deleted. * svg/SVGURIReference.h: * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::SVGUseElement): (WebCore::SVGUseElement::registerAttributes): (WebCore::SVGUseElement::parseAttribute): (WebCore::SVGUseElement::insertedIntoAncestor): (WebCore::SVGUseElement::transferSizeAttributesToTargetClone const): (WebCore::SVGUseElement::svgAttributeChanged): (WebCore::SVGUseElement::notifyFinished): * svg/SVGUseElement.h: * svg/SVGValue.h: * svg/SVGViewElement.cpp: (WebCore::SVGViewElement::SVGViewElement): (WebCore::SVGViewElement::parseAttribute): * svg/SVGViewElement.h: * svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::SVGViewSpec): (WebCore::SVGViewSpec::registerAttributes): (WebCore::SVGViewSpec::transform): (WebCore::SVGViewSpec::reset): (WebCore::SVGViewSpec::parseViewSpec): (WebCore::SVGViewSpec::viewBoxPropertyInfo): Deleted. (WebCore::SVGViewSpec::preserveAspectRatioPropertyInfo): Deleted. (WebCore::SVGViewSpec::transformPropertyInfo): Deleted. (WebCore::SVGViewSpec::viewBoxIdentifier): Deleted. (WebCore::SVGViewSpec::preserveAspectRatioIdentifier): Deleted. (WebCore::SVGViewSpec::transformIdentifier): Deleted. (WebCore::SVGViewSpec::setZoomAndPan): Deleted. (WebCore::SVGViewSpec::transformString const): Deleted. (WebCore::SVGViewSpec::viewBoxString const): Deleted. (WebCore::SVGViewSpec::preserveAspectRatioString const): Deleted. (WebCore::SVGViewSpec::viewBoxAnimated): Deleted. (WebCore::SVGViewSpec::preserveAspectRatioAnimated): Deleted. (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Deleted. (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper): Deleted. (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Deleted. * svg/SVGViewSpec.h: * svg/SVGViewSpec.idl: * svg/SVGZoomAndPan.cpp: (WebCore::SVGZoomAndPan::SVGZoomAndPan): (WebCore::SVGZoomAndPan::registerAttributes): (WebCore::SVGZoomAndPan::parseZoomAndPan): (WebCore::SVGZoomAndPan::parseAttribute): (WebCore::SVGZoomAndPan::parse): Deleted. (WebCore::SVGZoomAndPan::parseAttributeValue): Deleted. * svg/SVGZoomAndPan.h: (WebCore::SVGZoomAndPan::zoomAndPan const): (WebCore::SVGZoomAndPan::setZoomAndPan): (WebCore::SVGZoomAndPan::reset): (WebCore::SVGZoomAndPan::attributeRegistry): (WebCore::SVGZoomAndPan::isKnownAttribute): (WebCore::SVGZoomAndPan::parseFromNumber): Deleted. (WebCore::SVGZoomAndPan::parseAttribute): Deleted. * svg/SVGZoomAndPanType.h: Copied from Source/WebCore/svg/SVGValue.h. (WebCore::SVGPropertyTraits::initialValue): (WebCore::SVGPropertyTraits::toString): (WebCore::SVGPropertyTraits::fromString): * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h: * svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp: Copied from Source/WebCore/svg/SVGValue.h. (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff): (WebCore::SVGAnimatedPathSegListPropertyTearOff::~SVGAnimatedPathSegListPropertyTearOff): (WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange): * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: * svg/properties/SVGAnimatedProperty.cpp: (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): (WebCore::SVGAnimatedProperty::animatedPropertyCache): Deleted. * svg/properties/SVGAnimatedProperty.h: (WebCore::SVGAnimatedProperty::isAnimating const): (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const): (WebCore::SVGAnimatedProperty::lookupOrCreateAnimatedProperty): (WebCore::SVGAnimatedProperty::lookupAnimatedProperty): (WebCore::SVGAnimatedProperty::animatedPropertyCache): (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper): Deleted. (WebCore::SVGAnimatedProperty::lookupWrapper): Deleted. * svg/properties/SVGAnimatedPropertyMacros.h: Removed. * svg/properties/SVGAnimatedPropertyType.h: Copied from Source/WebCore/svg/SVGAElement.idl. * svg/properties/SVGAttribute.h: Added. (WebCore::SVGPropertyAttribute::SVGPropertyAttribute): (WebCore::SVGPropertyAttribute::value): (WebCore::SVGPropertyAttribute::value const): (WebCore::SVGPropertyAttribute::setValue): (WebCore::SVGPropertyAttribute::resetValue): (WebCore::SVGPropertyAttribute::toString const): (WebCore::SVGPropertyAttribute::setShouldSynchronize): (WebCore::SVGPropertyAttribute::shouldSynchronize const): (WebCore::SVGPropertyAttribute::synchronize): (WebCore::SVGAnimatedAttribute::SVGAnimatedAttribute): (WebCore::SVGAnimatedAttribute::currentValue const): (WebCore::SVGAnimatedAttribute::animatedProperty): (WebCore::SVGAnimatedAttributeList::SVGAnimatedAttributeList): (WebCore::SVGAnimatedAttributeList::detachAnimatedListWrappers): * svg/properties/SVGAttributeAccessor.h: Added. (WebCore::SVGAttributeAccessor::SVGAttributeAccessor): (WebCore::SVGAttributeAccessor::attributeName const): (WebCore::SVGAttributeAccessor::isAnimatedLengthAttribute const): (WebCore::SVGAttributeAccessor::animatedType const): (WebCore::SVGAttributeAccessor::animatedTypes const): (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperty const): (WebCore::SVGAttributeAccessor::lookupAnimatedProperty const): (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperties const): (WebCore::SVGPropertyAttributeAccessor::singleton): (WebCore::SVGPropertyAttributeAccessor::SVGPropertyAttributeAccessor): (WebCore::SVGPropertyAttributeAccessor::attribute const): (WebCore::SVGAnimatedAttributeAccessor::singleton): (WebCore::SVGAnimatedAttributeAccessor::SVGAnimatedAttributeAccessor): (WebCore::SVGAnimatedAttributeAccessor::lookupOrCreateAnimatedProperty): (WebCore::SVGAnimatedAttributeAccessor::lookupAnimatedProperty): (WebCore::SVGAnimatedPairAttributeAccessor::SVGAnimatedPairAttributeAccessor): (WebCore::SVGAnimatedPairAttributeAccessor::secondAttribute const): * svg/properties/SVGAttributeOwnerProxy.h: Copied from Source/WebCore/svg/SVGValue.h. (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): (WebCore::SVGAttributeOwnerProxy::element const): * svg/properties/SVGAttributeOwnerProxyImpl.h: Added. (WebCore::SVGAttributeOwnerProxyImpl::SVGAttributeOwnerProxyImpl): (WebCore::SVGAttributeOwnerProxyImpl::attributeRegistry): (WebCore::SVGAttributeOwnerProxyImpl::isKnownAttribute): (WebCore::SVGAttributeOwnerProxyImpl::isAnimatedLengthAttribute): * svg/properties/SVGAttributeRegistry.h: Added. (WebCore::SVGAttributeRegistry::registerAttribute): (WebCore::SVGAttributeRegistry::isEmpty const): (WebCore::SVGAttributeRegistry::isKnownAttribute const): (WebCore::SVGAttributeRegistry::isAnimatedLengthAttribute const): (WebCore::SVGAttributeRegistry::animatedTypes const): (WebCore::SVGAttributeRegistry::synchronizeAttributes const): (WebCore::SVGAttributeRegistry::synchronizeAttribute const): (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperty const): (WebCore::SVGAttributeRegistry::lookupAnimatedProperty const): (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperties const): (WebCore::SVGAttributeRegistry::animatedTypesBaseTypes): (WebCore::SVGAttributeRegistry::synchronizeAttributesBaseTypes): (WebCore::SVGAttributeRegistry::synchronizeAttributeBaseTypes): (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertyBaseTypes): (WebCore::SVGAttributeRegistry::lookupAnimatedPropertyBaseTypes): (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertiesBaseTypes): (WebCore::SVGAttributeRegistry::findAttributeAccessor const): * svg/properties/SVGAttributeToPropertyMap.cpp: Removed. * svg/properties/SVGAttributeToPropertyMap.h: Removed. * svg/properties/SVGPropertyInfo.cpp: Removed. * svg/properties/SVGPropertyInfo.h: Removed. 2018-08-06 Alex Christensen Use enum classes and OptionSets for PaintPhase and PaintBehavior https://bugs.webkit.org/show_bug.cgi?id=188323 Reviewed by Simon Fraser. No change in behaviour. * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): * page/FrameSnapshotting.cpp: (WebCore::snapshotFrameRectWithClip): * page/FrameView.cpp: (WebCore::FrameView::reset): (WebCore::FrameView::willPaintContents): (WebCore::FrameView::paintContents): (WebCore::FrameView::setPaintBehavior): (WebCore::FrameView::paintBehavior const): (WebCore::FrameView::paintContentsForSnapshot): * page/FrameView.h: * rendering/InlineElementBox.cpp: (WebCore::InlineElementBox::paint): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::paint): (WebCore::InlineFlowBox::paintBoxDecorations): (WebCore::InlineFlowBox::paintMask): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): * rendering/PaintInfo.h: (WebCore::PaintInfo::PaintInfo): (WebCore::PaintInfo::forceBlackText const): (WebCore::PaintInfo::forceWhiteText const): (WebCore::PaintInfo::skipRootBackground const): (WebCore::PaintInfo::paintRootBackgroundOnly const): * rendering/PaintPhase.h: (): Deleted. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paint): (WebCore::RenderBlock::paintContents): (WebCore::RenderBlock::paintObject): (WebCore::RenderBlock::paintSelection): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::paintFloats): * rendering/RenderBox.cpp: (WebCore::RenderBox::paintMask): (WebCore::RenderBox::paintClippingMask): (WebCore::RenderBox::paintMaskImages): (WebCore::RenderBox::pushContentsClip): (WebCore::RenderBox::popContentsClip): * rendering/RenderBox.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::decodingModeForImageDraw const): (WebCore::RenderBoxModelObject::paintMaskForTextFillBox): (WebCore::RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates const): * rendering/RenderDetailsMarker.cpp: (WebCore::RenderDetailsMarker::paint): * rendering/RenderElement.cpp: (WebCore::RenderElement::paintAsInlineBlock): (WebCore::RenderElement::selectionColor const): * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::paint): (WebCore::RenderEmbeddedObject::paintReplaced): * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::paintObject): * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::paint): * rendering/RenderHTMLCanvas.cpp: (WebCore::RenderHTMLCanvas::paintReplaced): * rendering/RenderImage.cpp: (WebCore::RenderImage::paintReplaced): (WebCore::RenderImage::paint): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::renderableTransform const): (WebCore::transparencyClipBox): (WebCore::expandClipRectForDescendantsAndReflection): (WebCore::paintingExtent): (WebCore::RenderLayer::paint): (WebCore::RenderLayer::paintOverlayScrollbars): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintBackgroundForFragments): (WebCore::RenderLayer::paintForegroundForFragments): (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): (WebCore::RenderLayer::paintOutlineForFragments): (WebCore::RenderLayer::paintMaskForFragments): (WebCore::RenderLayer::paintChildClippingMaskForFragments): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerBacking.h: * rendering/RenderLineBoxList.cpp: (WebCore::RenderLineBoxList::paint const): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintObject): * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::paint): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::paint): (WebCore::RenderReplaced::shouldPaint): * rendering/RenderReplica.cpp: (WebCore::RenderReplica::paint): * rendering/RenderScrollbarPart.cpp: (WebCore::RenderScrollbarPart::paintIntoRect): * rendering/RenderSnapshottedPlugIn.cpp: (WebCore::RenderSnapshottedPlugIn::paint): * rendering/RenderTable.cpp: (WebCore::RenderTable::paintObject): (WebCore::RenderTable::paintMask): (WebCore::RenderTable::overflowClipRect): * rendering/RenderTable.h: * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::paint): (WebCore::RenderTableCell::paintCollapsedBorders): (WebCore::RenderTableCell::paintMask): * rendering/RenderTableRow.cpp: (WebCore::RenderTableRow::paintOutlineForRowIfNeeded): (WebCore::RenderTableRow::paint): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::paint): (WebCore::RenderTableSection::paintCell): (WebCore::RenderTableSection::paintObject): * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay): (WebCore::RenderThemeMac::paintImageControlsButton): * rendering/RenderVideo.cpp: (WebCore::RenderVideo::paintReplaced): * rendering/RenderWidget.cpp: (WebCore::RenderWidget::paintContents): (WebCore::RenderWidget::paint): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::paintEllipsisBox const): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): * rendering/mathml/MathOperator.cpp: (WebCore::MathOperator::paint): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::paint): * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::paint): * rendering/mathml/RenderMathMLMenclose.cpp: (WebCore::RenderMathMLMenclose::paint): * rendering/mathml/RenderMathMLToken.cpp: (WebCore::RenderMathMLToken::paint): * rendering/svg/RenderSVGContainer.cpp: (WebCore::RenderSVGContainer::paint): * rendering/svg/RenderSVGForeignObject.cpp: (WebCore::RenderSVGForeignObject::paint): * rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::paint): * rendering/svg/RenderSVGResource.cpp: (WebCore::requestPaintingResource): * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage): * rendering/svg/RenderSVGResourceSolidColor.cpp: (WebCore::RenderSVGResourceSolidColor::applyResource): * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::paintReplaced): * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::paint): * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::paint): * rendering/svg/SVGInlineFlowBox.cpp: (WebCore::SVGInlineFlowBox::paintSelectionBackground): (WebCore::SVGInlineFlowBox::paint): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::paintSelectionBackground): (WebCore::SVGInlineTextBox::paint): * rendering/svg/SVGRenderingContext.cpp: (WebCore::isRenderingMaskImage): (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): * rendering/svg/SVGRootInlineBox.cpp: (WebCore::SVGRootInlineBox::paint): 2018-08-06 Ryan Haddad Unreviewed, rolling out r234569. Breaks internal builds. Reverted changeset: "We should cache the compiled sandbox profile in a data vault" https://bugs.webkit.org/show_bug.cgi?id=184991 https://trac.webkit.org/changeset/234569 2018-08-06 Alex Christensen Make BlendMode an enum class https://bugs.webkit.org/show_bug.cgi?id=188325 Reviewed by Darin Adler. No change in behavior. * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator BlendMode const): * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::State::State): (WebCore::CanvasRenderingContext2DBase::setGlobalCompositeOperation): (WebCore::CanvasRenderingContext2DBase::drawImageFromRect): * platform/graphics/BitmapImage.h: * platform/graphics/GraphicsContext.h: (WebCore::ImagePaintingOptions::ImagePaintingOptions): * platform/graphics/GraphicsContextImpl.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::dumpProperties const): * platform/graphics/GraphicsLayer.h: * platform/graphics/GraphicsTypes.cpp: (WebCore::parseBlendMode): (WebCore::parseCompositeAndBlendOperator): (WebCore::compositeOperatorName): (WebCore::blendModeName): (WebCore::operator<<): * platform/graphics/GraphicsTypes.h: * platform/graphics/Image.cpp: (WebCore::Image::drawTiled): * platform/graphics/Image.h: * platform/graphics/ImageBuffer.h: * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: (PlatformCAFilters::setBlendingFiltersOnLayer): * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::selectCGBlendMode): * platform/graphics/cpu/arm/filters/FEBlendNEON.h: (WebCore::FEBlend::platformApplyNEON): * platform/graphics/displaylists/DisplayListItems.h: * platform/graphics/displaylists/DisplayListRecorder.h: * platform/graphics/filters/FEBlend.cpp: (WebCore::FEBlend::externalRepresentation const): * rendering/RenderBox.cpp: (WebCore::RenderBox::paintFillLayers): * rendering/RenderImage.cpp: (WebCore::RenderImage::paintIntoRect): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::updateBlendMode): (WebCore::RenderLayer::beginTransparencyLayers): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateBlendMode): * rendering/style/FillLayer.cpp: (WebCore::FillLayer::FillLayer): (WebCore::FillLayer::hasOpaqueImage const): * rendering/style/FillLayer.h: (WebCore::FillLayer::initialFillBlendMode): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setBlendMode): (WebCore::RenderStyle::hasBlendMode const): (WebCore::RenderStyle::blendMode const): (WebCore::RenderStyle::initialBlendMode): * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::prepareToRenderSVGContent): * svg/SVGAnimatedEnumeration.cpp: (WebCore::enumerationValueForTargetAttribute): * svg/SVGFEBlendElement.cpp: (WebCore::SVGFEBlendElement::SVGFEBlendElement): (WebCore::SVGFEBlendElement::parseAttribute): * svg/SVGFEBlendElement.h: (WebCore::SVGPropertyTraits::highestEnumValue): (WebCore::SVGPropertyTraits::toString): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::nativeImageForCurrentFrame): (WebCore::SVGImage::nativeImage): (WebCore::SVGImage::drawPatternForContainer): (WebCore::SVGImage::draw): 2018-08-06 Aditya Keerthi [iOS] Indeterminate checkboxes appear unchecked https://bugs.webkit.org/show_bug.cgi?id=160484 Reviewed by Wenson Hsieh. Add support for rendering indeterminate checkboxes on iOS. We now paint the unchecked appearance only if the checkbox is not checked and is not indeterminate. Otherwise, we draw a checkmark if the checkbox is in the checked state and a dash if the checkbox is in the indeterminate state. Both of these states share the same dark background. Test: fast/forms/ios/render-indeterminate-checkbox.html * css/html.css: (input[type="checkbox"]:indeterminate): (input[type="checkbox"]:indeterminate:disabled): * rendering/RenderThemeIOS.mm: (WebCore::drawJoinedLines): (WebCore::RenderThemeIOS::paintCheckboxDecorations): 2018-08-06 Ryosuke Niwa HTML parser should execute custom element reactions for setting attributes immediately after creating a custom element https://bugs.webkit.org/show_bug.cgi?id=188336 Reviewed by Frédéric Wang. Push and pop an element queue from the custom element reactions stack when constructing a custom element: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token To do this, we instantiate CustomElementReactionStack in HTMLDocumentParser::runScriptsForPausedTreeBuilder where we synchronously construct a custom element. We don't have to worry about whether *will execute script* is set or not since the presence of an element queue should not be observable in the case where we're constructing a fallback element (since it would not enqueue any new custom element reaction). Tests: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html * html/parser/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate CustomElementReactionStack. Note that we don't insert the custom element into the parser until we finish processing the custom element reactions. 2018-08-06 Charlie Turner Return extracted key ids as an optional https://bugs.webkit.org/show_bug.cgi?id=188303 Reviewed by Darin Adler. An empty list of extracted key ids was being considered a failure case before this patch. In the PSSH boxes from the CENC standard, it's not uncommon for the box to be version 0, meaning it has no embedded key ids, so the case when there's an empty list should not be treated as an error. Given this, the interface should be more general and allow for a sentinel value indicating a parsing error rather than an absence of key ids. Covered by existing tests. * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::extractKeyIDsKeyids): Change return type to be wrapped in an optional, and make parsing errors return a nullopt rather than an empty vector. (WebCore::sanitizeKeyids): Use the new optional interface, return a null RefPtr in the case of a parsing error, this method may now return an empty vector. (WebCore::extractKeyIDsCenc): Not implemented, so return an error value rather than an empty vector. (WebCore::extractKeyIDsWebM): Ditto. (WebCore::InitDataRegistry::extractKeyIDs): Ditto. * Modules/encryptedmedia/InitDataRegistry.h: Update the interface to use an optional return type. * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSinf): Update to use the new interface. (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSkd): Ditto. * platform/graphics/avfoundation/CDMFairPlayStreaming.h: Ditto. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keyIDs): Convert the optional value into a vector, since it is assumed you can not have an empty vector of key ids in the init datas FPS supports. * testing/MockCDMFactory.cpp: (WebCore::MockCDMInstance::requestLicense): Only return an error if there really was a parsing error, rather than the case of there being zero key ids in the init data payload. 2018-08-06 Frederic Wang Make two-arguments versions of scrollBy/scrollTo depend on the one-argument versions https://bugs.webkit.org/show_bug.cgi?id=188300 Reviewed by Darin Adler. This patch refactors a bit the scrollBy/scrollTo code, so that the two-arguments versions share the same code path as the more generic one-argument versions. In particular, this helps to implement the ScrollBehavior option (bug 188043) since the one-argument versions will require to distinguish between smooth and instant scrolling. The logic to normalize non finite left/right values or to use a fallback when they are absent is also factored out into ScrollToOptions. References: https://drafts.csswg.org/cssom-view/#dom-element-scroll https://drafts.csswg.org/cssom-view/#dom-element-scrollby https://drafts.csswg.org/cssom-view/#dom-window-scroll https://drafts.csswg.org/cssom-view/#dom-window-scrollby No new tests, behavior is unchanged. * dom/Element.cpp: (WebCore::Element::scrollBy): Make two-parameter version depends on one-parameter version and rewrite the normalize / fallback logic. (WebCore::Element::scrollTo): Rewrite the normalize / fallback logic. (WebCore::normalizeNonFiniteValue): Deleted. The logic is moved to ScrollToOptions. * page/DOMWindow.cpp: (WebCore::DOMWindow::scrollBy const): Make two-parameter version depends on one-parameter version and rewrite the normalize / fallback logic. (WebCore::DOMWindow::scrollTo const): Make two-parameter version depends on one-parameter version and rewrite the normalize / fallback logic. * page/ScrollToOptions.h: Add to use std::isfinite (WebCore::ScrollToOptions::normalizeNonFiniteCoordinatesOrFallBackTo): New function to normalize left/right values or fallback to the specified value if it is missing. 2018-08-06 Zan Dobersek Unreviewed follow-up to r234594. Add missing constructor and destructor definitions for the bunch of new classes that were added in that revision. * platform/graphics/nicosia/NicosiaPlatformLayer.cpp: (Nicosia::ContentLayer::ContentLayer): (Nicosia::BackingStore::BackingStore): (Nicosia::ImageBacking::ImageBacking): 2018-08-06 Zan Dobersek [Nicosia] Add additional layer state classes, use impl-based approach to make them extendable https://bugs.webkit.org/show_bug.cgi?id=188341 Reviewed by Carlos Garcia Campos. Add the ContentLayer, BackingStore and ImageBacking classes in the Nicosia namespace. State objects of CompositionLayer instances keep references to objects of these classes depending on the content that's presented in the associated GraphicsLayer. ContentLayer derives from the PlatformLayer class. It's used for layers that display things like WebGL and HTML5 canvas and media content in a platform-specific way. In case of TextureMapper the hardware-accelerated content is piped into that rendering pipeline. BackingStore is meant to represent the painted contents of a layer. The equivalent current functionality is using a tiled backing store that has its contents copied into the CoordinatedBackingStore instance. ImageBacking is used for a layer whose content is a simple Image object. Image's pixel data is rasterized and again managed through CoordinatedBackingStore for rendering. All these classes, along with the CompositionLayer class, should now be constructed with a factory function that returns an object that derives the class-specific Impl interface. This will allow for simpler implementation of different approaches in parallel. The TextureMapper variants will be the first ones, replicating the current behavior as it is implemented across classes in the CoordinatedGraphics and TextureMapper layers. * platform/graphics/nicosia/NicosiaPlatformLayer.cpp: (Nicosia::CompositionLayer::CompositionLayer): * platform/graphics/nicosia/NicosiaPlatformLayer.h: (Nicosia::PlatformLayer::isContentLayer const): (Nicosia::CompositionLayer::Impl::isTextureMapperImpl const): (Nicosia::CompositionLayer::create): (Nicosia::CompositionLayer::impl const): (Nicosia::ContentLayer::Impl::isTextureMapperImpl const): (Nicosia::ContentLayer::create): (Nicosia::ContentLayer::impl const): (Nicosia::BackingStore::Impl::isTextureMapperImpl const): (Nicosia::BackingStore::create): (Nicosia::BackingStore::impl const): (Nicosia::ImageBacking::Impl::isTextureMapperImpl const): (Nicosia::ImageBacking::create): (Nicosia::ImageBacking::impl const): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer): 2018-08-06 Zan Dobersek [Nicosia] Add Nicosia::Scene https://bugs.webkit.org/show_bug.cgi?id=188340 Reviewed by Carlos Garcia Campos. Add the Nicosia::Scene class that controls the scene's state and enables thread-safe updates to that state. The State struct itself holds a set of all the layers in the scene, and separates out the root layer specifically. An ID counter is also present there, allowing consumers of this state to easily check for any updates. A reference to the Nicosia::Scene object now replaces the HashSet-and-root-layer pair in the CoordinatedGraphicsState struct. * platform/TextureMapper.cmake: * platform/graphics/nicosia/NicosiaScene.cpp: Added. * platform/graphics/nicosia/NicosiaScene.h: Added. (Nicosia::Scene::create): (Nicosia::Scene::accessState): * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h: 2018-08-06 Carlos Eduardo Ramalho [GTK] Buttons are drawn too large, text not centered https://bugs.webkit.org/show_bug.cgi?id=185854 Reviewed by Carlos Garcia Campos. Some pages require small buttons and the GTK theme was drawing only down to a minimum size. No new tests required. Current layout tests and ManualTests/gtk/theme.html already cover it. * platform/gtk/RenderThemeGadget.cpp: (WebCore::RenderThemeGadget::create): (WebCore::RenderThemeButtonGadget::RenderThemeButtonGadget): Added (WebCore::RenderThemeButtonGadget::minimumSize const): Allow sizes smaller than the minimum size. * platform/gtk/RenderThemeGadget.h: * platform/gtk/RenderThemeWidget.cpp: (WebCore::RenderThemeButton::RenderThemeButton): 2018-08-05 Yusuke Suzuki Implement self.queueMicrotask in Workers https://bugs.webkit.org/show_bug.cgi?id=188247 Reviewed by Ryosuke Niwa. This patch adds support for self.queueMicrotask to workers. Tests: http/wpt/workers/queue-microtask.any.html http/wpt/workers/queue-microtask.any.worker.html * bindings/js/JSWorkerGlobalScopeCustom.cpp: (WebCore::JSWorkerGlobalScope::queueMicrotask): * page/DOMWindow.idl: Move queueMicrotask declaration to WindowOrWorkerGlobalScope.idl. * page/WindowOrWorkerGlobalScope.idl: 2018-08-05 Rob Buis [GTK][WPE] Fetch tests assert in SubresourceLoader::didReceiveResponse() https://bugs.webkit.org/show_bug.cgi?id=188163 Reviewed by Frédéric Wang. Fetch in manual redirect mode uses didReceiveResponse instead of willSendRequestInternal, so update the ASSERT. * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didReceiveResponse): 2018-08-05 Yusuke Suzuki Add support for microtasks in workers https://bugs.webkit.org/show_bug.cgi?id=188246 Reviewed by Darin Adler. This patch adds the microtask mechanism to workers. To adopt the existing microtask mechanism from the main thread, we extend JSMainThreadExecState for non-main-threads. We rename it to JSExecState, and store stacked ExecState* data in thread local storage in ThreadGlobalData instead of a static variable s_mainThreadState. We add MicrotaskQueue to WorkerGlobalScope since each worker has its own thread and it should have its own microtask queue. * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSBindingsAllInOne.cpp: * bindings/js/JSCallbackData.cpp: (WebCore::JSCallbackData::invokeCallback): * bindings/js/JSCustomElementInterface.cpp: (WebCore::constructCustomElementSynchronously): (WebCore::JSCustomElementInterface::upgradeElement): (WebCore::JSCustomElementInterface::invokeCallback): * bindings/js/JSCustomXPathNSResolver.cpp: (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI): * bindings/js/JSDOMGlobalObjectTask.cpp: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::queueTaskToEventLoop): Queue a microtask to MicrotaskQueue instead of posting a macrotask. (WebCore::JSDOMWindowMicrotaskCallback::create): Deleted. (WebCore::JSDOMWindowMicrotaskCallback::call): Deleted. (WebCore::JSDOMWindowMicrotaskCallback::JSDOMWindowMicrotaskCallback): Deleted. (): Deleted. Extract JSDOMWindowMicrotaskCallback as JSMicrotaskCallback and create a new file for it. * bindings/js/JSErrorHandler.cpp: (WebCore::JSErrorHandler::handleEvent): * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): * bindings/js/JSExecState.cpp: Renamed from Source/WebCore/bindings/js/JSMainThreadExecState.cpp. (WebCore::JSExecState::didLeaveScriptContext): If we are in a main thread, we consume main thread microtask queue. If we are in worker thread, we consume a microtask queue per worker. (WebCore::functionCallHandlerFromAnyThread): (WebCore::evaluateHandlerFromAnyThread): * bindings/js/JSExecState.h: Renamed from Source/WebCore/bindings/js/JSMainThreadExecState.h. (WebCore::JSExecState::currentState): (WebCore::JSExecState::call): (WebCore::JSExecState::evaluate): (WebCore::JSExecState::profiledCall): (WebCore::JSExecState::profiledEvaluate): (WebCore::JSExecState::runTask): (WebCore::JSExecState::loadModule): (WebCore::JSExecState::linkAndEvaluateModule): (WebCore::JSExecState::JSExecState): (WebCore::JSExecState::~JSExecState): (WebCore::JSExecState::setCurrentState): Store and load ExecState in thread local storage, ThreadGlobalData. This allows us to use it for workers. (WebCore::JSMainThreadNullState::JSMainThreadNullState): (WebCore::JSMainThreadNullState::~JSMainThreadNullState): We keep this name "JSMainThreadNullState" since CustomElementReactionStack should be stick to the main thread. And this class is only used in the main thread. * bindings/js/JSExecStateInstrumentation.h: Renamed from Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h. (WebCore::JSExecState::instrumentFunctionInternal): (WebCore::JSExecState::instrumentFunctionCall): (WebCore::JSExecState::instrumentFunctionConstruct): * bindings/js/JSMicrotaskCallback.h: Copied from Source/WebKitLegacy/mac/DOM/DOMHTMLBaseElement.mm. (WebCore::JSMicrotaskCallback::create): (WebCore::JSMicrotaskCallback::call): (WebCore::JSMicrotaskCallback::JSMicrotaskCallback): * bindings/js/JSWorkerGlobalScopeBase.cpp: (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::executeFunctionInContext): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::evaluateInWorld): (WebCore::ScriptController::loadModuleScriptInWorld): (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld): (WebCore::ScriptController::canAccessFromCurrentOrigin): * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::evaluate): * bridge/objc/WebScriptObject.mm: (-[WebScriptObject callWebScriptMethod:withArguments:]): (-[WebScriptObject evaluateWebScript:]): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::compileShader): (WebCore::WebGLRenderingContextBase::printToConsole): * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildObjectForCanvas): (WebCore::InspectorCanvas::buildAction): * inspector/InspectorController.cpp: * inspector/InspectorFrontendHost.cpp: * inspector/TimelineRecordFactory.cpp: (WebCore::TimelineRecordFactory::createGenericRecord): * inspector/WorkerInspectorController.cpp: * inspector/agents/InspectorCanvasAgent.cpp: * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildInitiatorObject): * page/DOMWindow.cpp: (WebCore::DOMWindow::postMessage): * page/PageConsoleClient.cpp: (WebCore::PageConsoleClient::addMessage): * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::reportViolation const): * platform/ThreadGlobalData.h: (WebCore::ThreadGlobalData::ThreadGlobalData::currentState const): (WebCore::ThreadGlobalData::ThreadGlobalData::setCurrentState): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): (WebCore::WorkerGlobalScope::removeMicrotaskQueue): * workers/WorkerGlobalScope.h: (WebCore::WorkerGlobalScope::microtaskQueue const): * workers/WorkerThread.cpp: (WebCore::WorkerThread::stop): * workers/service/ExtendableEvent.cpp: (WebCore::ExtendableEvent::addExtendLifetimePromise): When dispatching an "install" event from service worker, we first create an event, dispatch it, and set a handler which is called when a pending promise count becomes zero. However, the old code checked pending promise count in a queued microtask. It worked previously because microtask is actually a macrotask in the service worker. So this check is done after a handler is set. But this patch introduces real microtask, and this check happens before a handler is set because dispatching an event can exhaust microtask queue. According to the spec, this check should not be done in microtask[1]. We make this checking part as a macrotask. We note that algorithm noted as FIXMEs should be done in this microtask while the checking part should not be done. [1]: https://w3c.github.io/ServiceWorker/#installation-algorithm 2018-08-05 Ryosuke Niwa Properties set on window.customElements can disappear due to GC https://bugs.webkit.org/show_bug.cgi?id=172575 Lexicologically sort the IDL attributes per Darin's comment. * dom/CustomElementRegistry.idl: 2018-08-05 Zalan Bujtas [LFC][BFC] contentHeightForFormattingContextRoot uses the wrong coordinate system to compute the height. https://bugs.webkit.org/show_bug.cgi?id=188319 Reviewed by Antti Koivisto. Display::Box::marginBox() is in the coordinate system of the box itself (8px top margin translates to y = -8px). What we need instead to compute the content height is the top/bottom position in the containing block's coordinate system (rect and rectWithMargin). * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): 2018-08-05 Ms2ger [GStreamer] Remove unsound assertions in MediaPlayerPrivateGStreamerBase. https://bugs.webkit.org/show_bug.cgi?id=188162 Reviewed by Philippe Normand. These assertions sometimes fail, and there's a runtime check right after them anyway. Tests: fast/canvas/webgl/texImage2D-video-flipY-false.html fast/canvas/webgl/texImage2D-video-flipY-true.html * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture): (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime): 2018-08-05 Philippe Normand [MediaCapabilities] Platform integration https://bugs.webkit.org/show_bug.cgi?id=187850 Reviewed by Eric Carlson. Mock platform support for the MediaCapabilities specification. Test: media/mediacapabilities/mock-decodingInfo.html media/mediacapabilities/mock-encodingInfo.html * Modules/mediacapabilities/MediaCapabilities.cpp: (WebCore::MediaCapabilities::decodingInfo): (WebCore::MediaCapabilities::encodingInfo): * Modules/mediacapabilities/MediaCapabilitiesInfo.h: (WebCore::MediaCapabilitiesInfo::create): * PlatformGTK.cmake: * PlatformMac.cmake: * PlatformWPE.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediacapabilities/MediaEngineConfiguration.cpp: Added. (WebCore::MediaEngineVideoConfiguration::MediaEngineVideoConfiguration): (WebCore::MediaEngineAudioConfiguration::MediaEngineAudioConfiguration): (WebCore::MediaEngineConfiguration::MediaEngineConfiguration): * platform/mediacapabilities/MediaEngineConfiguration.h: Added. (WebCore::MediaEngineVideoConfiguration::create): (WebCore::MediaEngineVideoConfiguration::contentType const): (WebCore::MediaEngineVideoConfiguration::size const): (WebCore::MediaEngineVideoConfiguration::bitrate const): (WebCore::MediaEngineVideoConfiguration::framerate const): (WebCore::MediaEngineAudioConfiguration::create): (WebCore::MediaEngineAudioConfiguration::contentType const): (WebCore::MediaEngineAudioConfiguration::channels const): (WebCore::MediaEngineAudioConfiguration::bitrate const): (WebCore::MediaEngineAudioConfiguration::samplerate const): (WebCore::MediaEngineConfiguration::audioConfiguration const): (WebCore::MediaEngineConfiguration::videoConfiguration const): * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp: Added. (WebCore::mockEnabled): (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration): (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration): (WebCore::MediaEngineConfigurationFactory::enableMock): (WebCore::MediaEngineConfigurationFactory::disableMock): * platform/mediacapabilities/MediaEngineConfigurationFactory.h: Added. * platform/mediacapabilities/MediaEngineDecodingConfiguration.h: Added. (WebCore::MediaEngineDecodingConfiguration::MediaEngineDecodingConfiguration): (WebCore::MediaEngineDecodingConfiguration::canDecodeMedia): (WebCore::MediaEngineDecodingConfiguration::canSmoothlyDecodeMedia): (WebCore::MediaEngineDecodingConfiguration::canPowerEfficientlyDecodeMedia): (WebCore::MediaEngineDecodingConfiguration::decodingType const): * platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Added. (WebCore::MediaEngineEncodingConfiguration::MediaEngineEncodingConfiguration): (WebCore::MediaEngineEncodingConfiguration::canEncodeMedia): (WebCore::MediaEngineEncodingConfiguration::canSmoothlyEncodeMedia): (WebCore::MediaEngineEncodingConfiguration::canPowerEfficientlyEncodeMedia): (WebCore::MediaEngineEncodingConfiguration::encodingType const): * platform/mock/MediaEngineDecodingConfigurationMock.cpp: Added. (WebCore::MediaEngineDecodingConfigurationMock::canDecodeMedia): (WebCore::MediaEngineDecodingConfigurationMock::canSmoothlyDecodeMedia): (WebCore::MediaEngineDecodingConfigurationMock::canPowerEfficientlyDecodeMedia): * platform/mock/MediaEngineDecodingConfigurationMock.h: Added. * platform/mock/MediaEngineEncodingConfigurationMock.cpp: Added. (WebCore::MediaEngineEncodingConfigurationMock::canEncodeMedia): (WebCore::MediaEngineEncodingConfigurationMock::canSmoothlyEncodeMedia): (WebCore::MediaEngineEncodingConfigurationMock::canPowerEfficientlyEncodeMedia): * platform/mock/MediaEngineEncodingConfigurationMock.h: Added. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::enableMockMediaCapabilities): * testing/Internals.h: * testing/Internals.idl: 2018-08-04 Simon Fraser Make WebCore::Timer more space-efficient https://bugs.webkit.org/show_bug.cgi?id=187455 Reviewed by Brent Fulgham. Steal a bit from m_heapIndex for m_wasDeleted to eliminate padding in Timer. This reduces the size of Document, which has 8 Timers, from 3360 to 3296 bytes (saving 64 bytes). * platform/Timer.cpp: (WebCore::TimerBase::TimerBase): * platform/Timer.h: 2018-08-04 Ryosuke Niwa Properties set on window.customElements can disappear due to GC https://bugs.webkit.org/show_bug.cgi?id=172575 Reviewed by Saam Barati. Fixed the bug that JS wrapper of CustomElementsRegistry can erroneously get collected during GC by keeping it alive as long as the global object is alive. Test: fast/custom-elements/custom-element-registry-wrapper-should-stay-alive.html * dom/CustomElementRegistry.cpp: (WebCore::CustomElementRegistry::create): (WebCore::CustomElementRegistry::CustomElementRegistry): * dom/CustomElementRegistry.h: (WebCore::CustomElementRegistry): Make this inherited from ContextDestructionObserver. * dom/CustomElementRegistry.idl: Set GenerateIsReachable=ImplScriptExecutionContext in IDL. This will make CustomElementRegistry reachable from the global object. * page/DOMWindow.cpp: (WebCore::DOMWindow::ensureCustomElementRegistry): 2018-08-03 Ryosuke Niwa innerHTML should not synchronously create a custom element https://bugs.webkit.org/show_bug.cgi?id=188327 Reviewed by Daniel Bates. Fixed the bug that the fragment parsing algorithm was synchronously constructing a custom element instead of enqueuing an element to upgrade. The fragment parsing algorithm creates an element for a token with *will execute script* flag set to false: https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token which results in creating an element with synchronous custom elements flag *not* set: https://dom.spec.whatwg.org/#concept-create-element When synchronous custom elements flag is false, we're supposed to create an element and enqueue a custom element upgrade reaction. createHTMLElementOrFindCustomElementInterface was missing this last logic. Also fixed a bug that Element::enqueueToUpgrade would hit a debug assertion when a custom element which has been enqueued to upgrade is enqueued to upgrade for the second time. In this case, we need to put the element into the current element queue (https://html.spec.whatwg.org/multipage/custom-elements.html#current-element-queue) again. While the specification simply enqueues another upgrade reaction and bails out immediately in the first step of the upgrade, WebKit's implementation simply avoids this redundancy in the first place: https://html.spec.whatwg.org/multipage/custom-elements.html#concept-upgrade-an-element Existing tests such as imported/w3c/web-platform-tests/custom-elements/reactions/Document.html exercises this code path after the fragment parsing algorithm fix. Tests: imported/w3c/web-platform-tests/custom-elements/connected-callbacks-html-fragment-parsing.html * dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueueItem::type const): Added for an assertion. (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): Enqueue this element to the current element queue by calling ensureCurrentQueue and avoid inserting a redundant upgrade reaction. * dom/CustomElementReactionQueue.h: * dom/Element.cpp: (WebCore::Element::enqueueToUpgrade): Handle the case when a custom element is enqueued to upgrade for the second time while it had been waiting in some element queue. In this case, the reaction queue for this element has already been created and we simply need to put this element back into the current element queue (i.e. this element now belongs to both element queues). * html/parser/HTMLConstructionSite.cpp: (WebCore::findCustomElementInterface): Extracted out of createHTMLElementOrFindCustomElementInterface. (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): Fixed the bug that the HTML parser was synchronously constructing a custom element even for the fragment parsing algorithm. 2018-08-03 Ben Richards We should cache the compiled sandbox profile in a data vault https://bugs.webkit.org/show_bug.cgi?id=184991 Reviewed by Ryosuke Niwa. Added functionality to FileHandle so that it can lock a file while open. Added a function to FileSystem to delete non empty directories. * platform/FileHandle.cpp: (WebCore::FileHandle::FileHandle): (WebCore::FileHandle::open): (WebCore::FileHandle::close): * platform/FileHandle.h: * platform/FileSystem.h: * platform/cocoa/FileSystemCocoa.mm: (WebCore::FileSystem::deleteNonEmptyDirectory): 2018-08-03 Justin Fan WebGL 2 conformance: vertex_arrays/vertex_array_object.html https://bugs.webkit.org/show_bug.cgi?id=188291 Reviewed by Dean Jackson. Get https://www.khronos.org/registry/webgl/conformance-suites/2.0.0/conformance2/vertex_arrays/vertex-array-object.html working on Mac OS and iOS, and check in the new test expectations. Existing test: webgl/2.0.0/conformance2/vertex_arrays/vertex-array-object.html * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects): (WebCore::WebGL2RenderingContext::deleteVertexArray): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::deleteObject): * html/canvas/WebGLVertexArrayObject.cpp: (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::checkVaryingsPacking const): (WebCore::GraphicsContext3D::createVertexArray): (WebCore::GraphicsContext3D::deleteVertexArray): (WebCore::GraphicsContext3D::isVertexArray): (WebCore::GraphicsContext3D::bindVertexArray): 2018-08-03 Sam Weinig Remove WebGPUObject https://bugs.webkit.org/show_bug.cgi?id=188114 Reviewed by Darin Adler. This removes the unecessary WebGPUObject base class and updates the classes that were inheriting from it to instead inherit directly from RefCounted. This shrinks the size of all the classes that were inheriting from it, as they no longer store a RefPtr member, which is unused. Most of the classes also shrink because they can be devirtualized. This also updates most of the create functions and constructors for the classes that were inheriting from WebGPUObject to no longer require the WebGPURenderingContext to be passed in. - For WebGPUBuffer, WebGPUCommandQueue, WebGPUComputeCommandEncoder, WebGPUComputePipelineState, WebGPUDepthStencilState, WebGPUDrawable, WebGPUFunction, WebGPULibrary, WebGPURenderCommandEncoder, WebGPURenderPassDepthAttachmentDescriptor, WebGPURenderPipelineColorAttachmentDescriptor, WebGPURenderPipelineState, and WebGPUTexture the WebGPURenderingContext and any other additional parameters needed for initialization were replaced with the underlying type (e.g. WebGPUBuffer now gets passed a GPUBuffer). - WebGPUCommandBuffer is passed a GPUCommandQueue, since it needs to construct the underlying GPUCommandBuffer itself so it can pass in the completion handler. - For WebGPUDepthStencilDescriptor, WebGPURenderPassAttachmentDescriptor, WebGPURenderPassColorAttachmentDescriptor, WebGPURenderPassDescriptor and WebGPURenderPipelineDescriptor the create and constructor functions are empty. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Remove WebGPUObject.h/cpp * html/canvas/WebGPUBuffer.cpp: (WebCore::WebGPUBuffer::WebGPUBuffer): * html/canvas/WebGPUBuffer.h: * html/canvas/WebGPUBuffer.idl: Switch from inheriting from WebGPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUBuffer directly, rather than the context. * html/canvas/WebGPUCommandBuffer.cpp: (WebCore::WebGPUCommandBuffer::create): (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer): Update create and constructor to no longer require a context, as it would now be unused, as it no longer inherits from WebGPUObject nor needs to hold onto the context for any reason. (WebCore::WebGPUCommandBuffer::createRenderCommandEncoderWithDescriptor): Update to call the new WebGPURenderCommandEncoder::create, which no longer requires a context. (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder): Update to call the new WebGPUComputeCommandEncoder::create, which no longer requires a context. * html/canvas/WebGPUCommandBuffer.h: * html/canvas/WebGPUCommandBuffer.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to no longer take a context, and just take a GPUCommandQueue. We can't directly pass a GPUCommandBuffer as WebGPUCommandBuffer needs to pass in a completion handler on construction of the underlying GPUCommandBuffer. * html/canvas/WebGPUCommandQueue.cpp: (WebCore::WebGPUCommandQueue::WebGPUCommandQueue): (WebCore::WebGPUCommandQueue::createCommandBuffer): Update to call the new WebGPUCommandBuffer::create, which no longer requires a context. * html/canvas/WebGPUCommandQueue.h: * html/canvas/WebGPUCommandQueue.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUCommandQueue directly. * html/canvas/WebGPUComputeCommandEncoder.cpp: (WebCore::WebGPUComputeCommandEncoder::create): (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder): * html/canvas/WebGPUComputeCommandEncoder.h: * html/canvas/WebGPUComputeCommandEncoder.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUComputeCommandEncoder directly * html/canvas/WebGPUComputePipelineState.cpp: (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState): * html/canvas/WebGPUComputePipelineState.h: * html/canvas/WebGPUComputePipelineState.idl: Switch from inheriting from WebGPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUComputePipelineState directly. * html/canvas/WebGPUDepthStencilDescriptor.cpp: Remove unneeded include of include "WebGPURenderingContext.h". * html/canvas/WebGPUDepthStencilDescriptor.h: * html/canvas/WebGPUDepthStencilDescriptor.idl: Switch from inheriting from WebGPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. * html/canvas/WebGPUDepthStencilState.cpp: (WebCore::WebGPUDepthStencilState::WebGPUDepthStencilState): * html/canvas/WebGPUDepthStencilState.h: * html/canvas/WebGPUDepthStencilState.idl: Switch from inheriting from WebGPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUDepthStencilState directly. * html/canvas/WebGPUDrawable.cpp: (WebCore::WebGPUDrawable::WebGPUDrawable): * html/canvas/WebGPUDrawable.h: * html/canvas/WebGPUDrawable.idl: Switch from inheriting from WebGPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUDrawable directly. * html/canvas/WebGPUFunction.cpp: (WebCore::WebGPUFunction::create): (WebCore::WebGPUFunction::WebGPUFunction): * html/canvas/WebGPUFunction.h: * html/canvas/WebGPUFunction.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPUFunction directly. * html/canvas/WebGPULibrary.cpp: (WebCore::WebGPULibrary::WebGPULibrary): (WebCore::WebGPULibrary::functionWithName const): Update for new WebGPUFunction::create, which no longer requires a context. * html/canvas/WebGPULibrary.h: * html/canvas/WebGPULibrary.idl: Switch from inheriting from WebGPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPULibrary directly, rather than the context. Unlike the other create functions that take their underlying type, this one also continues to need the sourceCode String to be passed, as that is not available from the underlying GPULibrary and must be stored seperately. * html/canvas/WebGPUObject.cpp: Removed. * html/canvas/WebGPUObject.h: Removed. Deleted. * html/canvas/WebGPURenderCommandEncoder.cpp: (WebCore::WebGPURenderCommandEncoder::create): (WebCore::WebGPURenderCommandEncoder::WebGPURenderCommandEncoder): * html/canvas/WebGPURenderCommandEncoder.h: * html/canvas/WebGPURenderCommandEncoder.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPURenderCommandEncoder directly. * html/canvas/WebGPURenderPassAttachmentDescriptor.cpp: (WebCore::WebGPURenderPassAttachmentDescriptor::WebGPURenderPassAttachmentDescriptor): * html/canvas/WebGPURenderPassAttachmentDescriptor.h: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Also update create and constructor to no longer take a context, as it is now not used. This remains virtual as it is inherited from by WebGPURenderPassColorAttachmentDescriptor and WebGPURenderPassDepthAttachmentDescriptor. * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp: (WebCore::WebGPURenderPassColorAttachmentDescriptor::create): (WebCore::WebGPURenderPassColorAttachmentDescriptor::WebGPURenderPassColorAttachmentDescriptor): * html/canvas/WebGPURenderPassColorAttachmentDescriptor.h: Update create and constructor to no longer take a context, as it is now not used. Declare final as this is not inherited by anything. * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp: (WebCore::WebGPURenderPassDepthAttachmentDescriptor::create): (WebCore::WebGPURenderPassDepthAttachmentDescriptor::WebGPURenderPassDepthAttachmentDescriptor): * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h: Update create and constructor to no longer take a context, as it is now not used. Declare final as this is not inherited by anything. * html/canvas/WebGPURenderPassDescriptor.cpp: (WebCore::WebGPURenderPassDescriptor::depthAttachment): Update for new WebGPURenderPassDepthAttachmentDescriptor::create function which no longer requires a context. Semi-interesting note: This function was previously calling "*context()" to pass a WebGPURenderingContext& to WebGPURenderPassDepthAttachmentDescriptor::create. However, "context()" was always returning null, as the constructor of WebGPURenderPassDescriptor was not initializing the WebGPUObject with a WebGPURenderingContext. Now, one might think that this would cause a null-deref, but, because it was being assigned into a WebGPURenderingContext&, no dereference happens right away (it essentially just passes a pointer) and since the function it is being passed to does not use it, it never actually gets dereferenced. (WebCore::WebGPURenderPassDescriptor::colorAttachments): Update for new WebGPURenderPassColorAttachmentDescriptor::create function which no longer requires a context. * html/canvas/WebGPURenderPassDescriptor.h: * html/canvas/WebGPURenderPassDescriptor.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp: (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::create): (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::WebGPURenderPipelineColorAttachmentDescriptor): * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h: * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to no longer take a context, as it is now not used. * html/canvas/WebGPURenderPipelineDescriptor.cpp: (WebCore::WebGPURenderPipelineDescriptor::colorAttachments): Update for new WebGPURenderPipelineColorAttachmentDescriptor::create which no longer requires a context. * html/canvas/WebGPURenderPipelineDescriptor.h: * html/canvas/WebGPURenderPipelineDescriptor.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. * html/canvas/WebGPURenderPipelineState.cpp: (WebCore::WebGPURenderPipelineState::WebGPURenderPipelineState): * html/canvas/WebGPURenderPipelineState.h: * html/canvas/WebGPURenderPipelineState.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. Also update create and constructor to take a GPURenderPipelineState directly. * html/canvas/WebGPURenderingContext.cpp: (WebCore::WebGPURenderingContext::createLibrary): (WebCore::WebGPURenderingContext::createRenderPipelineState): (WebCore::WebGPURenderingContext::createDepthStencilState): (WebCore::WebGPURenderingContext::createComputePipelineState): (WebCore::WebGPURenderingContext::createCommandQueue): (WebCore::WebGPURenderingContext::nextDrawable): (WebCore::WebGPURenderingContext::createBuffer): (WebCore::WebGPURenderingContext::createTexture): Update for new create functions which require the caller to pass the underlying type. * html/canvas/WebGPUTexture.cpp: (WebCore::WebGPUTexture::createFromDrawableTexture): Renamed to create. (WebCore::WebGPUTexture::create): Deleted All callers now pass a GPUTexture directly. * html/canvas/WebGPUTexture.h: * html/canvas/WebGPUTexture.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. * html/canvas/WebGPUTextureDescriptor.h: * html/canvas/WebGPUTextureDescriptor.idl: Switch from inheriting from GPUObject to directly inheriting from RefCounted. Since this de-virtualizes it, also add ImplementationLacksVTable to the IDL file. 2018-08-03 Alex Christensen Fix spelling of "overridden" https://bugs.webkit.org/show_bug.cgi?id=188315 Reviewed by Darin Adler. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityLabel]): (-[WebAccessibilityObjectWrapper accessibilityValue]): * contentextensions/ContentExtensionsBackend.h: * editing/EditingStyle.cpp: (WebCore::EditingStyle::removeStyleFromRulesAndContext): * inspector/CommandLineAPIModuleSource.js: * platform/ScrollView.h: * platform/ScrollableArea.h: * platform/mediasession/MediaSessionInterruptionProvider.h: * rendering/RenderFragmentedFlow.cpp: (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const): * rendering/RenderLayer.h: * rendering/RenderListBox.h: * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage): * svg/SVGElement.cpp: (WebCore::SVGElement::localCoordinateSpaceTransform const): * svg/SVGLengthContext.cpp: (WebCore::SVGLengthContext::SVGLengthContext): (WebCore::SVGLengthContext::convertValueToUserUnits const): (WebCore::SVGLengthContext::determineViewport const): * svg/SVGLengthContext.h: 2018-08-03 Zalan Bujtas [LFC][BFC] Special case the document renderer when computing the height and margin https://bugs.webkit.org/show_bug.cgi?id=188313 Reviewed by Antti Koivisto. The document renderer is certainly special and its geometry is likely to be computed as part of "10.6.6 Complicated cases" (spec is unclear) but probably not by making the it a formatting root. Let's just special case it at contentHeightForFormattingContextRoot(), since having the document renderer as a context root has unwanted side effect. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::establishesBlockFormattingContext const): 2018-08-03 Zalan Bujtas [LFC][BFC] Layout out-of-flow descendants only on the formatting context root. https://bugs.webkit.org/show_bug.cgi?id=188312 Reviewed by Antti Koivisto. Collect out-of-flow descendants on the formatting root container instead of the containing block and run layout on them on the root level. It's more efficient this way. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layout const): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createSubTree): 2018-08-03 Andy Estes ContentFilterUnblockHandler's constructors access moved-from variables https://bugs.webkit.org/show_bug.cgi?id=188308 Reviewed by Alex Christensen. * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm: 2018-08-03 Zalan Bujtas [LFC][Floating] Now that the document renderer belongs to "complicated cases", adjust viewport stretching. https://bugs.webkit.org/show_bug.cgi?id=188306 Reviewed by Antti Koivisto. And add passing cases for floats. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::initialContainingBlock): (WebCore::Layout::isStretchedToInitialContainingBlock): (WebCore::Layout::stretchHeightToInitialContainingBlock): (WebCore::Layout::stretchWidthToInitialContainingBlock): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): (WebCore::Layout::isStretchedToViewport): Deleted. 2018-08-03 Zalan Bujtas [LFC] Do not check margin box while validating geometry. https://bugs.webkit.org/show_bug.cgi?id=188297 Reviewed by Antti Koivisto. The current RenderBox::marginBox implementation is not spec compliant. Ignore it for now. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): 2018-08-03 Carlos Garcia Campos [WPE] Use WPE key symbols and new API instead of xkbcommon and the key mapper https://bugs.webkit.org/show_bug.cgi?id=188093 Reviewed by Žan Doberšek. Add helper functions to get key code, hardware key code, key identifier and windows key code from a WPE key symbol. * platform/PlatformKeyboardEvent.h: * platform/wpe/PlatformKeyboardEventWPE.cpp: (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode): (WebCore::PlatformKeyboardEvent::keyCodeForHardwareKeyCode): (WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode): (WebCore::PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode): (WebCore::PlatformKeyboardEvent::singleCharacterString): 2018-08-02 Ryosuke Niwa Release assert when throwing exceptions in custom element reactions https://bugs.webkit.org/show_bug.cgi?id=187805 Reviewed by Saam Barati. The release assertion was hit because we were not catching & re-throwing the exception thrown by DOM API before trying to execute custom elements reactions in ~CustomElementReactionStack as specified here: https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions Fixed the bug by capturing the exception and re-throwing the exception as specified. Tests: imported/w3c/web-platform-tests/custom-elements/reactions/with-exceptions.html * bindings/js/JSMainThreadExecState.h: (WebCore::JSMainThreadNullState::JSMainThreadNullState): Use the previous JS state. * bindings/scripts/CodeGeneratorJS.pm: (GeneratePut): Pass in the exec state to CustomElementReactionStack. (GeneratePutByIndex): Ditto. (GenerateDefineOwnProperty): Ditto. (GenerateDeletePropertyCommon): Ditto. (GenerateAttributeSetterBodyDefinition): Ditto. (GenerateOperationBodyDefinition): Ditto. * bindings/scripts/test/JS/JSTestCEReactions.cpp: (WebCore::setJSTestCEReactionsAttributeWithCEReactionsSetter): (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsSetter): (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsBody): * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: (WebCore::setJSTestCEReactionsStringifierValueSetter): * dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueue::ElementQueue::processQueue): Added. If there is a script running in the stack (i.e. ExecState is not null), catch any exception before executing custom element reactions, then re-throw the exception afterwards. ExecState is null when DOM API is invoked via Objective-C bindings or when custom element reactions are executed in the backup queue (e.g. for editing operations). (WebCore::CustomElementReactionStack::processQueue): (WebCore::CustomElementReactionQueue::processBackupQueue): * dom/CustomElementReactionQueue.h: (WebCore::CustomElementReactionStack::CustomElementReactionStack): (WebCore::CustomElementReactionStack::~CustomElementReactionStack): 2018-08-02 Zalan Bujtas [LFC][BFC] Apply the "10.6.6 Complicated cases" when computing height and margin for the document renderer https://bugs.webkit.org/show_bug.cgi?id=188296 Reviewed by Simon Fraser. The spec is not clear about what to do with the document renderer. It behaves as if it was a formatting context root when it comes to computing the content height. Let's apply "10.6.6 Complicated cases" for now. * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin): Deleted. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::establishesBlockFormattingContext const): * layout/layouttree/LayoutBox.h: 2018-08-02 Zalan Bujtas [LFC][Floating] Add FloatingState::bottom() to enable content height computation for formatting roots. https://bugs.webkit.org/show_bug.cgi?id=188294 Reviewed by Simon Fraser. "10.6.7 'Auto' heights for block formatting context roots ... In addition, if the element has any floating descendants whose bottom margin edge is below the element's bottom content edge, then the height is increased to include those edges. Only floats that participate in this block formatting context are taken into account, e.g., floats inside absolutely positioned descendants or other floats are not..." * layout/FloatingState.cpp: (WebCore::Layout::FloatingState::bottom const): * layout/FloatingState.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): 2018-08-02 Jer Noble Control center controls disappear when pausing, locking device. https://bugs.webkit.org/show_bug.cgi?id=188282 Reviewed by Eric Carlson. Test: platform/mac/media/audio-session-category-video-paused.html MediaRemote will set any app whose audio session category changes from MediaPlayback to Ambient as not eligable for being the "now playing" app. Previously, due to the ordering of events, we never moved from MediaPlayback to Ambient when pausing