[webkit-changes] [WebKit/WebKit] 519c7e: Store `display: none` RenderStyle objects

Antoine Quint noreply at github.com
Sun Jan 21 23:53:17 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 519c7ed4ac755138208e8daf71057c4ac8a2f810
      https://github.com/WebKit/WebKit/commit/519c7ed4ac755138208e8daf71057c4ac8a2f810
  Author: Antoine Quint <graouts at webkit.org>
  Date:   2024-01-21 (Sun, 21 Jan 2024)

  Changed paths:
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/dom/ElementRareData.h
    M Source/WebCore/dom/Node.cpp
    M Source/WebCore/dom/NodeRareData.h
    M Source/WebCore/rendering/updating/RenderTreeUpdater.cpp
    M Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp

  Log Message:
  -----------
  Store `display: none` RenderStyle objects
https://bugs.webkit.org/show_bug.cgi?id=267683

Reviewed by Antti Koivisto.

We currently store `display: contents` RenderStyle objects on Element. In order to implement support
for animating the `display` property, we need to also store styles in the `display: none` case so that
we may return such stored styles in `Element::existingComputedStyle()`.

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::hasDisplayContents const):
(WebCore::Element::hasDisplayNone const):
(WebCore::Element::storeDisplayContentsOrNoneStyle):
(WebCore::Element::clearDisplayContentsOrNoneStyle):
(WebCore::Element::existingComputedStyle const):
(WebCore::Element::renderOrDisplayContentsStyle const):
(WebCore::Element::resetComputedStyle):
(WebCore::Element::storeDisplayContentsStyle): Deleted.
(WebCore::Element::clearDisplayContentsStyle): Deleted.
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/ElementRareData.h:
(WebCore::ElementRareData::displayContentsOrNoneStyle const):
(WebCore::ElementRareData::setDisplayContentsOrNoneStyle):
(WebCore::ElementRareData::useTypes const):
(WebCore::ElementRareData::displayContentsStyle const): Deleted.
(WebCore::ElementRareData::setDisplayContentsStyle): Deleted.
* Source/WebCore/dom/Node.cpp:
(WebCore::stringForRareDataUseType):
* Source/WebCore/dom/NodeRareData.h:
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
* Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):

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




More information about the webkit-changes mailing list