[webkit-changes] [WebKit/WebKit] 9951fe: Element::userAgentShadowRoot() shouldn't return a ...

Chris Dumez noreply at github.com
Tue Feb 13 19:43:50 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9951fe460428c043d54ceb41d050680c1bb40d01
      https://github.com/WebKit/WebKit/commit/9951fe460428c043d54ceb41d050680c1bb40d01
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2024-02-13 (Tue, 13 Feb 2024)

  Changed paths:
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/dom/ImageOverlay.cpp
    M Source/WebCore/dom/mac/ImageControlsMac.cpp
    M Source/WebCore/html/AttachmentAssociatedElement.cpp
    M Source/WebCore/html/BaseDateAndTimeInputType.cpp
    M Source/WebCore/html/CheckboxInputType.cpp
    M Source/WebCore/html/ColorInputType.cpp
    M Source/WebCore/html/FileInputType.cpp
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/html/HTMLPlugInElement.cpp
    M Source/WebCore/html/HTMLProgressElement.cpp
    M Source/WebCore/html/HTMLTextAreaElement.cpp
    M Source/WebCore/html/HTMLTextAreaElement.h
    M Source/WebCore/html/HTMLTextFormControlElement.cpp
    M Source/WebCore/html/InputType.cpp
    M Source/WebCore/html/RangeInputType.cpp
    M Source/WebCore/html/TextFieldInputType.cpp
    M Source/WebCore/html/ValidationMessage.cpp
    M Source/WebCore/page/mac/ImageOverlayControllerMac.mm
    M Source/WebCore/svg/SVGUseElement.cpp

  Log Message:
  -----------
  Element::userAgentShadowRoot() shouldn't return a RefPtr
https://bugs.webkit.org/show_bug.cgi?id=269331

Reviewed by Ryosuke Niwa.

Element::userAgentShadowRoot() shouldn't return a RefPtr. It causes unnecessary
ref-counting churn for caller that don't need it. Have it return a raw pointer
instead and add a `protectedUserAgentShadowRoot()` getter for the callers that
actually want a RefPtr.

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::userAgentShadowRoot const):
(WebCore::Element::protectedUserAgentShadowRoot const):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/ImageOverlay.cpp:
(WebCore::ImageOverlay::isInsideOverlay):
(WebCore::ImageOverlay::isOverlayText):
(WebCore::ImageOverlay::removeOverlaySoonIfNeeded):
* Source/WebCore/dom/mac/ImageControlsMac.cpp:
(WebCore::ImageControlsMac::isInsideImageControls):
* Source/WebCore/html/AttachmentAssociatedElement.cpp:
(WebCore::AttachmentAssociatedElement::attachmentElement const):
* Source/WebCore/html/BaseDateAndTimeInputType.cpp:
(WebCore::BaseDateAndTimeInputType::createShadowSubtree):
(WebCore::BaseDateAndTimeInputType::didChangeValueFromControl):
* Source/WebCore/html/CheckboxInputType.cpp:
(WebCore::CheckboxInputType::createShadowSubtree):
* Source/WebCore/html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtree):
(WebCore::ColorInputType::shadowColorSwatch const):
* Source/WebCore/html/FileInputType.cpp:
(WebCore::FileInputType::createShadowSubtree):
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::layoutSizeChanged):
* Source/WebCore/html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::swapRendererTimerFired):
* Source/WebCore/html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::renderProgress const):
* Source/WebCore/html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::innerTextElement const):
(WebCore::HTMLTextAreaElement::updatePlaceholderText):
(WebCore::HTMLTextAreaElement::protectedPlaceholderElement const):
* Source/WebCore/html/HTMLTextAreaElement.h:
* Source/WebCore/html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setInnerTextValue):
* Source/WebCore/html/InputType.cpp:
(WebCore::InputType::removeShadowSubtree):
* Source/WebCore/html/RangeInputType.cpp:
(WebCore::RangeInputType::handleMouseDownEvent):
(WebCore::RangeInputType::createShadowSubtree):
(WebCore::RangeInputType::sliderTrackElement const):
* Source/WebCore/html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::updatePlaceholderText):
(WebCore::TextFieldInputType::createContainer):
* Source/WebCore/html/ValidationMessage.cpp:
(WebCore::ValidationMessage::deleteBubbleTree):
* Source/WebCore/page/mac/ImageOverlayControllerMac.mm:
(WebCore::ImageOverlayController::updateDataDetectorHighlights):
* Source/WebCore/svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::targetClone const):
(WebCore::SVGUseElement::expandUseElementsInShadowTree const):
(WebCore::SVGUseElement::expandSymbolElementsInShadowTree const):
(WebCore::SVGUseElement::transferEventListenersToShadowTree const):

Canonical link: https://commits.webkit.org/274602@main




More information about the webkit-changes mailing list