2022-04-24 Philippe Normand [GStreamer] Disable new demuxers based on adaptivedemux2 https://bugs.webkit.org/show_bug.cgi?id=239701 Reviewed by Xabier Rodriguez-Calvar. The new demuxers based on adaptivedemux2 cannot be used in WebKit yet because this new base class does not abstract away network access. They can't work in a sandboxed media process, so demote their rank in order to prevent decodebin3 from auto-plugging them. * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::registerWebKitGStreamerElements): 2022-05-16 Loïc Le Page REGRESSION(r294104): [GStreamer][VideoCapture] Webcam raw streams may hang up the video capture pipeline https://bugs.webkit.org/show_bug.cgi?id=240456 Reviewed by Philippe Normand. When capturing a raw stream from a webcam, the pipeline may hang up because the decodebin3 cannot fix the upstream caps. The webcam capsfilter should not only specify the captured mime-type (video/x-raw) but also the capture image dimensions. Manually tested. * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: 2022-05-15 Philippe Normand REGRESSION(r294104): [GStreamer] getUserMedia broken https://bugs.webkit.org/show_bug.cgi?id=240420 Reviewed by Xabier Rodriguez-Calvar. The converter handling logic was modified in order to fix getUserMedia negotiated with raw video and also getDisplayMedia which is always raw video and thus doesn't require decoding. This patch also introduces a small optimization, reconfiguration is now done once only, after setting size and framerate. Before this patch it was done twice, so the pipeline was a taking more time to produce the first frame. * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::GStreamerVideoCaptureSource::~GStreamerVideoCaptureSource): (WebCore::GStreamerVideoCaptureSource::settingsDidChange): Trigger capturer reconfiguration after setting both size and framerate. (WebCore::GStreamerVideoCaptureSource::startProducingData): Ditto. * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: (WebCore::GStreamerVideoCapturer::createConverter): Do not decode display capture streams, these are always raw anyway. (WebCore::GStreamerVideoCapturer::setSize): Delay reconfiguration. (WebCore::GStreamerVideoCapturer::setFrameRate): Ditto. (WebCore::GStreamerVideoCapturer::reconfigure): Keep track of compatible video format. This is needed to workaround an issue in pipewiresrc caps negotiation. (WebCore::GStreamerVideoCapturer::adjustVideoSrcMIMEType): Renamed to reconfigure(). * platform/mediastream/gstreamer/GStreamerVideoCapturer.h: 2022-05-12 Loïc Le Page [GStreamer][VideoCapture] Add support for capturing encoded video streams from a webcam https://bugs.webkit.org/show_bug.cgi?id=240229 Reviewed by Philippe Normand. Takes into account encoded video streams produced by a webcam for video capture. Manually tested (requires a webcam with encoded video streams). * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::GStreamerVideoCaptureSource::generatePresets): * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: (WebCore::GStreamerVideoCapturer::createConverter): (WebCore::GStreamerVideoCapturer::setSize): (WebCore::GStreamerVideoCapturer::setFrameRate): (WebCore::GStreamerVideoCapturer::adjustVideoSrcMIMEType): * platform/mediastream/gstreamer/GStreamerVideoCapturer.h: 2022-04-28 Philippe Normand [GStreamer] Pipewire display capture broken https://bugs.webkit.org/show_bug.cgi?id=239435 Reviewed by Xabier Rodriguez-Calvar. The pipewiresrc GStreamer element now needs both the `fd` and `path` properties set in order to open the right Pipewire stream, so we need to get the node ID from the portal Start response and pass it to the GStreamer element. * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: * platform/mediastream/gstreamer/GStreamerDisplayCaptureDeviceManager.cpp: (WebCore::GStreamerDisplayCaptureDeviceManager::createDisplayCaptureSource): (WebCore::GStreamerDisplayCaptureDeviceManager::waitResponseSignal): * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::GStreamerVideoCaptureSource::createPipewireSource): (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): (WebCore::m_deviceType): (WebCore::GStreamerVideoCaptureSource::~GStreamerVideoCaptureSource): * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: (WebCore::GStreamerVideoCapturer::createSource): (WebCore::GStreamerVideoCapturer::setSize): (WebCore::GStreamerVideoCapturer::setFrameRate): * platform/mediastream/gstreamer/GStreamerVideoCapturer.h: 2022-03-08 Sihui Liu UniqueIDBDatabase::didFireVersionChangeEvent should capture identifier of UniqueIDBDatabaseConnection https://bugs.webkit.org/show_bug.cgi?id=236950 rdar://problem/89218299 Reviewed by Chris Dumez. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::didFireVersionChangeEvent): 2022-05-13 Adrian Perez de Castro Non-unified build broken in debug mode https://bugs.webkit.org/show_bug.cgi?id=240378 Unreviewed non-unified build fixes. * contentextensions/ContentExtensionCompiler.cpp: Add missing wtf/CrossThreadCopier.h header. * workers/service/ServiceWorkerClients.cpp: Add missing Logging.h header. 2022-05-13 Lauro Moura Unreviewed, non-unified build fixes https://bugs.webkit.org/show_bug.cgi?id=240369 * Modules/highlight/HighlightRegister.h: * rendering/TextPainter.h: 2022-05-09 Miguel Gomez [Nicosia] Canvas animations don't work with threaded rendering https://bugs.webkit.org/show_bug.cgi?id=227760 Reviewed by Adrian Perez de Castro. Implement Nicosia::CairoOperationRecorder::draImageBuffer(), which is required in order to paint canvas contents into a GraphicsContext. * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: (Nicosia::CairoOperationRecorder::drawImageBuffer): 2022-03-01 Fujii Hironori Fix deprecations for ERB.new in GenerateSettings.rb https://bugs.webkit.org/show_bug.cgi?id=237237 Reviewed by Don Olmstead. Ruby 3.1.0 reported the following warning: > GenerateSettings.rb:283: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments. > GenerateSettings.rb:283: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead. r290104 and r290331 fixed the same problem for GeneratePreferences.rb, but forgot GenerateSettings.rb. * Scripts/GenerateSettings.rb: Use the keyword argument for ERB.new for Ruby 2.6+. 2022-05-06 Miguel Gomez [Nicosia] Images in webkit.org/blog/ don't show up with threaded rendering https://bugs.webkit.org/show_bug.cgi?id=238259 Reviewed by Carlos Garcia Campos. Implement Nicosia::CairoOperationRecorder::drawFilteredImageBuffer(), which is required to render images that have CSS filters applied. * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: (Nicosia::CairoOperationRecorder::drawFilteredImageBuffer): * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: 2022-05-05 Carlos Garcia Campos REGRESSION(249114@main) [GTK] Crashes on shutdown if the display is not set https://bugs.webkit.org/show_bug.cgi?id=239767 Reviewed by Michael Catanzaro. Handle the case of PlatformDisplay created with a nullptr GdkDisplay. * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::PlatformDisplay): * platform/graphics/wayland/PlatformDisplayWayland.cpp: (WebCore::PlatformDisplayWayland::PlatformDisplayWayland): (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland): * platform/graphics/x11/PlatformDisplayX11.cpp: (WebCore::PlatformDisplayX11::PlatformDisplayX11): (WebCore::PlatformDisplayX11::~PlatformDisplayX11): 2022-04-26 Xi Ruoyao [GTK] Initialize m_eglDisplay in PlatformDisplay::PlatformDisplay(GdkDisplay*) https://bugs.webkit.org/show_bug.cgi?id=239760 Reviewed by Michael Catanzaro. No new tests because there is no behavior change. * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::PlatformDisplay): initialize m_eglDisplay to EGL_NO_DISPLAY. 2022-04-14 Martin Robinson [GTK] AddressSanitizer: heap-buffer-overflow in WebCore::Length::ref() https://bugs.webkit.org/show_bug.cgi?id=237389 Reviewed by Žan Doberšek. * platform/graphics/nicosia/NicosiaAnimation.cpp: (Nicosia::createThreadsafeKeyFrames): Convert Length members of transform functions to the fixed variety before they are moved to separate threads. (Nicosia::Animation::Animation): Use the new helper. * platform/graphics/transforms/TranslateTransformOperation.h: Added setters. 2022-04-01 Carlos Garcia Campos REGRESSION(r290360): [GLX] Crash on process exit https://bugs.webkit.org/show_bug.cgi?id=238494 Reviewed by Michael Catanzaro. When creating a PlatformDisplay from a shared GdkDisplay, we need to keep a reference to the display and connect to closed signal to release our display dependent resources. Closed signal is emitted right before the native display is actually closed by GDK. We also need to make sure that the sharing GL context is released before the PlatformDisplay is destroyed. This is always happening for EGL because the sharing GL context is cleared before terminating the EGL display in the atexit handler, but that's not the case of GLX. Since X11 only allows one PlatformDisplay, which is always the shared one, we can just install an atexit handler in the constructor to clear the sharing context before the destructor is called. * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::createPlatformDisplay): (WebCore::PlatformDisplay::PlatformDisplay): (WebCore::PlatformDisplay::sharedDisplayDidClose): (WebCore::PlatformDisplay::~PlatformDisplay): (WebCore::PlatformDisplay::clearSharingGLContext): (WebCore::PlatformDisplay::terminateEGLDisplay): * platform/graphics/PlatformDisplay.h: * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: (WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE): * platform/graphics/wayland/PlatformDisplayWayland.cpp: (WebCore::PlatformDisplayWayland::create): (WebCore::PlatformDisplayWayland::PlatformDisplayWayland): (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland): (WebCore::PlatformDisplayWayland::sharedDisplayDidClose): * platform/graphics/wayland/PlatformDisplayWayland.h: * platform/graphics/win/PlatformDisplayWin.h: * platform/graphics/x11/PlatformDisplayX11.cpp: (WebCore::PlatformDisplayX11::create): (WebCore::clearSharingGLContextAtExit): (WebCore::PlatformDisplayX11::PlatformDisplayX11): (WebCore::PlatformDisplayX11::~PlatformDisplayX11): (WebCore::PlatformDisplayX11::sharedDisplayDidClose): * platform/graphics/x11/PlatformDisplayX11.h: 2022-04-09 Khem Raj Include locale.h for LC_MESSAGES definition. https://bugs.webkit.org/show_bug.cgi?id=239030 Reviewed by Michael Catanzaro. * accessibility/atspi/AccessibilityRootAtspi.cpp: 2022-03-24 Jean-Yves Avenard Safari can't play video completely at bilibili.com https://bugs.webkit.org/show_bug.cgi?id=236440 rdar://88761053 Reviewed by Jer Noble. Video frames were incorrectly evicted during a call to appendBuffer as the Source Buffer incorrectly assumed a discontinuity was present. When appending data to a source buffer, the MSE specs describe a method to detect discontinuities in the Coded Frame Processing algorithm (https://www.w3.org/TR/media-source/#sourcebuffer-coded-frame-processing) step 6: " - If last decode timestamp for track buffer is set and decode timestamp is less than last decode timestamp: OR - If last decode timestamp for track buffer is set and the difference between decode timestamp and last decode timestamp is greater than 2 times last frame duration. " The issue being what defines the last frame duration. Is it the frame last seen in the coded frame processing loop or the frame whose presentation timestamp is just before the one we are currently processing. H264 and HEVC have a concept of b-frames: that is a frame that depends on a future frame to be decoded. Those frames are found in the container and can be identified by their presentation timestamp higher than the frame following in decode order. Those present a challenge as the frame prior the current one in presentation order, may actually only be found several frames back in decode order. Bug 181891 attempted to fix a similar issue, and used the longest "decode duration" as a workaround to detect discontinuity in the content. It mentioned adopting the same technique as in Mozilla's MSE implementation, but Mozilla also skip discontinuity detection within a media segment (https://www.w3.org/TR/media-source/#media-segment which for fMP4 is a single moof box) an approach that can't be achieved with CoreMedia's AVStreamDataParser. As mentioned in bug 181891, CoreMedia ignore the decode timestamps' delta and juggles with the sample's duration so that there's no discontinuity in the demuxed samples' presentation time, causing false positive in the gap detection algorithm. Bilibili uses HEVC content, and uses an encoding that generate lots of b-frames, with a very wide sliding window (seen up to 12 frames). By using the longest frame duration found in either presentation or decode duration as threshold to identify a discontinuity, we can properly parse the content and not incorrectly evict appended frames. (As a side note, the use of HEVC with B-Frames is peculiar as not all hardware support it.) It is difficult to identify here if the issue is within the bilibili's content or CoreMedia's output, though the responsibility more than likely lies with bilibili. Test: media/media-source/media-mp4-hevc-bframes.html * platform/graphics/SourceBufferPrivate.cpp: (WebCore::SourceBufferPrivate::TrackBuffer::TrackBuffer): (WebCore::SourceBufferPrivate::resetTrackBuffers): (WebCore::SourceBufferPrivate::didReceiveSample): * platform/graphics/SourceBufferPrivate.h: 2022-03-21 Carlos Garcia Campos REGRESSION(r286955): Rendering Links during search: highlighting fails https://bugs.webkit.org/show_bug.cgi?id=237816 Reviewed by Simon Fraser. Since r286955 the same coalesced marked text loop is used for painting the foreground text in case of text with decorations. StyledMarkedText::coalesceAdjacentWithEqualDecorations() doesn't take into account the text style, so when selected foreground color is different we end up painting the whole decorated text with the same foreground color for the selected and non-selected parts. Test: fast/text/selection-with-text-decorations.html * rendering/StyledMarkedText.cpp: (WebCore::StyledMarkedText::coalesceAdjacentWithEqualDecorations): Take into account the text styles too. * rendering/TextBoxPainter.cpp: (WebCore::TextBoxPainter::paintForegroundAndDecorations): Do not call StyledMarkedText::coalesceAdjacentWithEqualForeground() in case of text with decorations, since it's unused. 2022-03-20 Philippe Normand REGRESSION(r289154) [GSTREAMER] webrtc/vp8-then-h264.html is crashing after SDK update to fdo 21.08 and Gstreamer 1.20 https://bugs.webkit.org/show_bug.cgi?id=237872 Reviewed by Adrian Perez de Castro. * platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp: (WebCore::VP8Decoder::Create): Fix typo in decoder factory test. 2022-03-01 Cameron McCormack Make input element UA shadow tree creation lazy https://bugs.webkit.org/show_bug.cgi?id=236747 Reviewed by Aditya Keerthi. We currently delay InputType creation for parser inserted elements until just after the attributes have been set, so that we don't wastefully create an InputType and the UA shadow tree creation if a non-text type="" was specified on the tag. We don't do anything similar for script inserted input elements. We could make the InputType creation lazy, but most of the wasted time is due to the shadow tree creation. This patch makes InputType shadow tree creation lazy by delaying it until one of the following happens: 1. the element is inserted into the document 2. the type="" or value="" attributes are changed before the element is inserted into the document 3. any DOM methods that need access to the innerTextElement() are called on the element before the element is inserted into the document Not all places where we call innerTextElement() on the HTMLInputElement are safe to lazily create the shadow trees, so we have two accessors: - innerTextElement() returns the inner text element if it's been created already - innerTextElementCreatingShadowSubtreeIfNeeded will perform the lazy shadow tree construction if it hasn't already been done Since the existing createShadowSubtreeAndUpdateInnerTextElementEditability function has more responsibility than just creating the subtree and ensuring the editability is set appropriately, it's renamed to a more manageable createShadowSubtree. This change is a 0.5% progression on Speedometer 2. Test: fast/forms/lazy-shadow-tree-creation.html * html/BaseDateAndTimeInputType.h: * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::createShadowSubtree): (WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/ColorInputType.h: * html/ColorInputType.cpp: (WebCore::ColorInputType::createShadowSubtree): (WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/FileInputType.h: * html/FileInputType.cpp: (WebCore::FileInputType::createShadowSubtree): (WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/InputType.cpp: (WebCore::InputType::createShadowSubtree): (WebCore::InputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/RangeInputType.h: * html/RangeInputType.cpp: (WebCore::RangeInputType::createShadowSubtree): (WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/SearchInputType.h: * html/SearchInputType.cpp: (WebCore::SearchInputType::createShadowSubtree): (WebCore::SearchInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): Renamed createShadowSubtreeAndUpdateInnerTextElementEditability to createShadowSubtree and remove the "isInnerTextElementEditable" argument, since we can ask the element() for its value if needed. createShadowSubtree is now also responsible for creating the shadow root. * html/TextFieldInputType.h: * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::createShadowSubtree): (WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): Renamed. Ensure all shadow tree state is up to date now that it can be created later. * html/InputType.h: * html/InputType.cpp: (WebCore::InputType::createShadowSubtree): (WebCore::InputType::hasCreatedShadowSubtree const): New functions to create the shadow subtree if it hasn't been done already, and to query whether it's been done. * html/HTMLInputElement.h: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::innerTextElementCreatingShadowSubtreeIfNeeded): * html/HTMLTextAreaElement.h: * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::innerTextElementCreatingShadowSubtreeIfNeeded): * html/HTMLTextFormControlElement.h: * html/InputType.h: * html/InputType.cpp: (WebCore::InputType::innerTextElementCreatingShadowSubtreeIfNeeded): New functions to first create the shadow subtree before returning innerTextElement(). HTMLTextAreaElement never lazily creates its shadow subtree and so just returns innerTextElement(). * html/HTMLInputElement.h: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::createShadowSubtreeAndUpdateInnerTextElementEditability): Deleted. Just call through to m_inputType->createShadowTree() directly. (WebCore::HTMLInputElement::HTMLInputElement): (WebCore::HTMLInputElement::create): (WebCore::HTMLInputElement::initializeInputType): (WebCore::HTMLInputElement::updateType): Don't immediately create the shadow tree. (WebCore::HTMLInputElement::didFinishInsertingNode): Create the shadow subtree now that the element's been inserted. No need to call dataListMayHaveChanged since TextFieldInputType::createShadowSubtree will now do this. * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::updateInnerTextValue): Ensure the shadow subtree is created since we need to poke at it. * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::forwardEvent): Don't forward the event if the shadow tree hasn't been created yet. (WebCore::HTMLTextFormControlElement::setSelectionRange): Ensure the shadow tree has been created. This is needed if the selection APIs are called on the input element before it's inserted into the document. (WebCore::HTMLTextFormControlElement::visiblePositionForIndex const): Assert that the shadow tree has been created, since editing functionality should only be needed if the element's been inserted into the document. (WebCore::HTMLTextFormControlElement::setInnerTextValue): Ensure the shadow tree has been created. * html/RangeInputType.cpp: (WebCore::RangeInputType::handleMouseDownEvent): (WebCore::RangeInputType::handleTouchEvent): Ensure the shadow tree has been created in case the event will change the value. (WebCore::RangeInputType::sliderTrackElement const): Only return the element if it's been created. (WebCore::RangeInputType::typedSliderThumbElement const): Assert that the element has been created. (WebCore::RangeInputType::dataListMayHaveChanged): Only try to re-layout if the shadow tree has been created. * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::isEmptyValue const): Avoid creating the shadow subtree. (WebCore::TextFieldInputType::forwardEvent): Move the element assertion up to be consistent with other functions. (WebCore::TextFieldInputType::innerTextElement const): Don't assert, since this now can legitimately return null. * html/FileInputType.cpp: (WebCore::FileInputType::disabledStateChanged): (WebCore::FileInputType::attributeChanged): * html/RangeInputType.cpp: (WebCore::RangeInputType::disabledStateChanged): (WebCore::RangeInputType::attributeChanged): (WebCore::RangeInputType::setValue): * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::disabledStateChanged): (WebCore::TextFieldInputType::readOnlyStateChanged): (WebCore::TextFieldInputType::updatePlaceholderText): (WebCore::TextFieldInputType::updateAutoFillButton): (WebCore::TextFieldInputType::dataListMayHaveChanged): Don't update the shadow tree contents if it hasn't been created yet. createShadowTree is responsible for ensuring it creates the shadow tree contents reflecting the current state. 2022-02-27 Cameron McCormack Add a mechanism to request a UA shadow tree update before style https://bugs.webkit.org/show_bug.cgi?id=237224 Reviewed by Antti Koivisto. SVG elements register themselves with the document when their shadow tree contents need updating, and this updating is done in Document::resolveStyle. For lazy HTML element UA shadow trees (in bug 236747) we need something similar. * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::Document::addElementWithPendingUserAgentShadowTreeUpdate): (WebCore::Document::removeElementWithPendingUserAgentShadowTreeUpdate): * dom/Document.h: * dom/Element.h: (WebCore::Element::updateUserAgentShadowTree): * svg/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::~SVGDocumentExtensions): Deleted. (WebCore::SVGDocumentExtensions::addUseElementWithPendingShadowTreeUpdate): Deleted. (WebCore::SVGDocumentExtensions::removeUseElementWithPendingShadowTreeUpdate): Deleted. * svg/SVGDocumentExtensions.h: (WebCore::SVGDocumentExtensions::useElementsWithPendingShadowTreeUpdate const): Deleted. * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::insertedIntoAncestor): (WebCore::SVGUseElement::removedFromAncestor): (WebCore::SVGUseElement::updateUserAgentShadowTree): (WebCore::SVGUseElement::invalidateShadowTree): (WebCore::SVGUseElement::updateShadowTree): Deleted. * svg/SVGUseElement.h: 2022-02-23 Commit Queue Unreviewed, reverting r290284. https://bugs.webkit.org/show_bug.cgi?id=237131 It is preventing the fuzzer from finding other bugs Reverted changeset: "Make input element UA shadow tree creation lazy" https://bugs.webkit.org/show_bug.cgi?id=236747 https://commits.webkit.org/r290284 2022-03-10 Philippe Normand REGRESSION(r284711): [GStreamer] Buffering, seek broken on youtube.com https://bugs.webkit.org/show_bug.cgi?id=233861 Unreviewed, manual revert of 284711. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::currentTimeFudgeFactor): * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::timeFudgeFactor const): * platform/graphics/gstreamer/GStreamerCommon.h: (WebCore::toGstClockTime): * platform/graphics/gstreamer/MediaSampleGStreamer.cpp: (WebCore::MediaSampleGStreamer::MediaSampleGStreamer): * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::appsinkNewSample): (WebCore::bufferTimeToStreamTime): Deleted. 2022-03-07 Alberto Garcia makeprop.pl breaks reproducible builds https://bugs.webkit.org/show_bug.cgi?id=237521 Reviewed by Carlos Garcia Campos. * css/makeprop.pl: Sort hash elements so the output file is always the same across different builds. 2022-03-01 Michael Catanzaro Misc compiler warnings, late Feb 2022 edition https://bugs.webkit.org/show_bug.cgi?id=237275 Reviewed by Adrian Perez de Castro. Remove a redundant move. Sprinkle RELEASE_ASSERT_NOT_REACHED() as required to avoid -Wreturn-type warnings. * Modules/push-api/PushDatabase.cpp: (WebCore::openAndMigrateDatabaseImpl): * style/ContainerQueryEvaluator.cpp: (WebCore::Style::ContainerQueryEvaluator::evaluateCondition const): (WebCore::Style::ContainerQueryEvaluator::evaluateSizeFeature const): * style/ContainerQueryEvaluator.h: (WebCore::Style::operator!): * style/StyleScope.cpp: (WebCore::Style::Scope::updateQueryContainerState): 2022-03-02 Carlos Garcia Campos REGRESSION(r216096): [GTK] Test accessibility/gtk/menu-list-unfocused-notifications.html is failing since r216096 https://bugs.webkit.org/show_bug.cgi?id=171598 Reviewed by Adrian Perez de Castro. Enable accessibility when a WTR observer is added. * accessibility/atspi/AccessibilityAtspi.cpp: (WebCore::AccessibilityAtspi::addNotificationObserver): 2022-03-01 Carlos Garcia Campos [ATSPI] Remove layout tests checking children added/removed notifications https://bugs.webkit.org/show_bug.cgi?id=237272 Reviewed by Adrian Perez de Castro. Do not send children-changed notifications to WTR observers. * accessibility/atspi/AccessibilityAtspi.cpp: (WebCore::AccessibilityAtspi::childrenChanged): (WebCore::AccessibilityAtspi::notifyChildrenChanged const): Deleted. * accessibility/atspi/AccessibilityAtspi.h: 2022-02-25 Carlos Garcia Campos AX: List item marker not exposed when not a direct child of a list item https://bugs.webkit.org/show_bug.cgi?id=236777 Reviewed by Adrian Perez de Castro. It can happen that the marker is not a direct child of a list item, in which case the marker is ignored and not exposed to ATs. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::parentObjectUnignored const): In case of list marker find the marker list item. (WebCore::AccessibilityRenderObject::markerRenderer const): Helper to return the list item marker renderer. (WebCore::AccessibilityRenderObject::addListItemMarker): Add always the list item marker as the first child of list items. (WebCore::AccessibilityRenderObject::addChildren): Do not add list item marker children, they will be added to the right parent in addListItemMarker(). * accessibility/AccessibilityRenderObject.h: 2022-02-28 Carlos Garcia Campos [ATSPI] Always expose table cells (layout and CSS) that have rendered text content https://bugs.webkit.org/show_bug.cgi?id=237204 Reviewed by Adrian Perez de Castro. * accessibility/atspi/AccessibilityObjectAtspi.cpp: (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const): 2022-02-28 Carlos Garcia Campos [GTK][a11y] Test accessibility/gtk/xml-roles-exposed.html is failing since ATSPI switch https://bugs.webkit.org/show_bug.cgi?id=237202 Reviewed by Adrian Perez de Castro. Handle the special case of form item having unknown aria role to be exposed as landmark. * accessibility/atspi/AccessibilityObjectAtspi.cpp: (WebCore::AccessibilityObjectAtspi::effectiveRole const): 2022-02-22 Chris Dumez CachedResourceLoader::allCachedSVGImages() reparses resource URLs unnecessarily https://bugs.webkit.org/show_bug.cgi?id=237002 Reviewed by Darin Adler. Store URLs in the HashMaps instead of Strings since we have URLs initially and we need URLs eventually. This avoids having to re-parse the URL unnecessarily, which is fairly expensive. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::determineRevalidationPolicy const): (WebCore::CachedResourceLoader::notifyFinished): * loader/cache/CachedResourceLoader.h: 2022-02-22 Pablo Saavedra Properly uninitialize EGL display before termination https://bugs.webkit.org/show_bug.cgi?id=236766 From the docs [1], if contexts or surfaces associated with display is current to any thread, they are not released until they are no longer current as a result of eglMakeCurrent. So call eglMakeCurrent() to such effect. [1] https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglMakeCurrent.xhtml Reviewed by Carlos Garcia Campos. * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::terminateEGLDisplay): 2022-02-21 Alex Christensen Improve const correctness for SecurityOrigin accessors https://bugs.webkit.org/show_bug.cgi?id=236983 Reviewed by Chris Dumez. * loader/SubresourceLoader.h: * loader/cache/CachedResource.h: (WebCore::CachedResource::origin const): (WebCore::CachedResource::origin): * loader/cache/CachedResourceRequest.h: (WebCore::CachedResourceRequest::origin const): (WebCore::CachedResourceRequest::origin): 2022-02-21 Brandon Stewart Ensure layer has backing during traversal https://bugs.webkit.org/show_bug.cgi?id=236858 Reviewed by Simon Fraser. Ensure the layer has a backing attached to it before trying to append the node id. * rendering/RenderLayerCompositor.cpp: (WebCore::collectStationaryLayerRelatedOverflowNodes): 2022-02-21 Cameron McCormack Make input element UA shadow tree creation lazy https://bugs.webkit.org/show_bug.cgi?id=236747 Reviewed by Aditya Keerthi. We currently delay InputType creation for parser inserted elements until just after the attributes have been set, so that we don't wastefully create an InputType and the UA shadow tree creation if a non-text type="" was specified on the tag. We don't do anything similar for script inserted input elements. We could make the InputType creation lazy, but most of the wasted time is due to the shadow tree creation. This patch makes InputType shadow tree creation lazy by delaying it until one of the following happens: 1. the element is inserted into the document 2. the type="" or value="" attributes are changed before the element is inserted into the document 3. any DOM methods that need access to the innerTextElement() are called on the element before the element is inserted into the document Not all places where we call innerTextElement() on the HTMLInputElement are safe to lazily create the shadow trees, so we have two accessors: - innerTextElement() returns the inner text element if it's been created already - innerTextElementCreatingShadowSubtreeIfNeeded will perform the lazy shadow tree construction if it hasn't already been done Since the existing createShadowSubtreeAndUpdateInnerTextElementEditability function has more responsibility than just creating the subtree and ensuring the editability is set appropriately, it's renamed to a more manageable createShadowSubtree. This change is a 0.5% progression on Speedometer 2. Test: fast/forms/lazy-shadow-tree-creation.html * html/BaseDateAndTimeInputType.h: * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::createShadowSubtree): (WebCore::BaseDateAndTimeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/ColorInputType.h: * html/ColorInputType.cpp: (WebCore::ColorInputType::createShadowSubtree): (WebCore::ColorInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/FileInputType.h: * html/FileInputType.cpp: (WebCore::FileInputType::createShadowSubtree): (WebCore::FileInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/InputType.cpp: (WebCore::InputType::createShadowSubtree): (WebCore::InputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/RangeInputType.h: * html/RangeInputType.cpp: (WebCore::RangeInputType::createShadowSubtree): (WebCore::RangeInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): * html/SearchInputType.h: * html/SearchInputType.cpp: (WebCore::SearchInputType::createShadowSubtree): (WebCore::SearchInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): Renamed createShadowSubtreeAndUpdateInnerTextElementEditability to createShadowSubtree and remove the "isInnerTextElementEditable" argument, since we can ask the element() for its value if needed. createShadowSubtree is now also responsible for creating the shadow root. * html/TextFieldInputType.h: * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::createShadowSubtree): (WebCore::TextFieldInputType::createShadowSubtreeAndUpdateInnerTextElementEditability): Renamed. Ensure all shadow tree state is up to date now that it can be created later. * html/InputType.h: * html/InputType.cpp: (WebCore::InputType::createShadowSubtree): (WebCore::InputType::hasCreatedShadowSubtree const): New functions to create the shadow subtree if it hasn't been done already, and to query whether it's been done. * html/HTMLInputElement.h: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::innerTextElementCreatingShadowSubtreeIfNeeded): * html/HTMLTextAreaElement.h: * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::innerTextElementCreatingShadowSubtreeIfNeeded): * html/HTMLTextFormControlElement.h: * html/InputType.h: * html/InputType.cpp: (WebCore::InputType::innerTextElementCreatingShadowSubtreeIfNeeded): New functions to first create the shadow subtree before returning innerTextElement(). HTMLTextAreaElement never lazily creates its shadow subtree and so just returns innerTextElement(). * html/HTMLInputElement.h: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::createShadowSubtreeAndUpdateInnerTextElementEditability): Deleted. Just call through to m_inputType->createShadowTree() directly. (WebCore::HTMLInputElement::HTMLInputElement): (WebCore::HTMLInputElement::create): (WebCore::HTMLInputElement::initializeInputType): (WebCore::HTMLInputElement::updateType): Don't immediately create the shadow tree. (WebCore::HTMLInputElement::didFinishInsertingNode): Create the shadow subtree now that the element's been inserted. No need to call dataListMayHaveChanged since TextFieldInputType::createShadowSubtree will now do this. * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::updateInnerTextValue): Ensure the shadow subtree is created since we need to poke at it. * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::forwardEvent): Don't forward the event if the shadow tree hasn't been created yet. (WebCore::HTMLTextFormControlElement::setSelectionRange): Ensure the shadow tree has been created. This is needed if the selection APIs are called on the input element before it's inserted into the document. (WebCore::HTMLTextFormControlElement::visiblePositionForIndex const): Assert that the shadow tree has been created, since editing functionality should only be needed if the element's been inserted into the document. (WebCore::HTMLTextFormControlElement::setInnerTextValue): Ensure the shadow tree has been created. * html/RangeInputType.cpp: (WebCore::RangeInputType::handleMouseDownEvent): (WebCore::RangeInputType::handleTouchEvent): (WebCore::RangeInputType::handleKeydownEvent): Ensure the shadow tree has been created in case the event will change the value. (WebCore::RangeInputType::sliderTrackElement const): Only return the element if it's been created. (WebCore::RangeInputType::typedSliderThumbElement const): Assert that the element has been created. (WebCore::RangeInputType::dataListMayHaveChanged): Only try to re-layout if the shadow tree has been created. * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::isEmptyValue const): Avoid creating the shadow subtree. (WebCore::TextFieldInputType::forwardEvent): Move the element assertion up to be consistent with other functions. (WebCore::TextFieldInputType::innerTextElement const): Don't assert, since this now can legitimately return null. * html/FileInputType.cpp: (WebCore::FileInputType::disabledStateChanged): (WebCore::FileInputType::attributeChanged): * html/RangeInputType.cpp: (WebCore::RangeInputType::disabledStateChanged): (WebCore::RangeInputType::attributeChanged): (WebCore::RangeInputType::setValue): * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::disabledStateChanged): (WebCore::TextFieldInputType::readOnlyStateChanged): (WebCore::TextFieldInputType::updatePlaceholderText): (WebCore::TextFieldInputType::updateAutoFillButton): (WebCore::TextFieldInputType::dataListMayHaveChanged): Don't update the shadow tree contents if it hasn't been created yet. createShadowTree is responsible for ensuring it creates the shadow tree contents reflecting the current state. 2022-02-21 Wenson Hsieh Add test coverage for the pasteboard writing codepath added in r289839 https://bugs.webkit.org/show_bug.cgi?id=236944 Reviewed by Aditya Keerthi. Add test coverage for the changes in r289839 in the case where `ENABLE(IMAGE_ANALYSIS_ENHANCEMENTS)` is turned on. To do this, we set the platform image analysis results to a new internal mock object, `FakeImageAnalysisResult`, that returns a string for a given NSRange. This code is then exercised by several existing layout tests that copy and paste text inside image overlays: - fast/images/text-recognition/image-overlay-line-wrapping.html - fast/images/text-recognition/image-overlay-text-without-leading-whitespace.html - fast/images/text-recognition/mac/copy-image-overlay-text-with-context-menu.html * testing/Internals.cpp: (WebCore::Internals::installImageOverlay): * testing/Internals.h: * testing/Internals.mm: (-[FakeImageAnalysisResult initWithString:]): (-[FakeImageAnalysisResult _attributedStringForRange:]): (WebCore::Internals::fakeImageAnalysisResultForTesting): 2022-02-21 Myles C. Maxfield Sort WebCore and WebKit Xcode project files https://bugs.webkit.org/show_bug.cgi?id=237010 Unreviewed. No new tests because there is no behavior change. * WebCore.xcodeproj/project.pbxproj: == Rolled over to ChangeLog-2022-02-22 ==