[webkit-changes] [WebKit/WebKit] 538147: REGRESSION (256782 at main): Animating visibility wit...

Antti Koivisto noreply at github.com
Tue Feb 14 12:41:51 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 53814777b5f2c64071b4822a0a4898d516716492
      https://github.com/WebKit/WebKit/commit/53814777b5f2c64071b4822a0a4898d516716492
  Author: Antti Koivisto <antti at apple.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    A LayoutTests/fast/animation/animation-display-contents-expected.html
    A LayoutTests/fast/animation/animation-display-contents.html
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/dom/ElementRareData.cpp
    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
    M Source/WebCore/style/StyleTreeResolver.cpp

  Log Message:
  -----------
  REGRESSION (256782 at main): Animating visibility with a display:contents child causes an element to disappear
https://bugs.webkit.org/show_bug.cgi?id=251597
rdar://105102892

Reviewed by Cameron McCormack.

We currently use ElementRareData::computedStyle() to store styles for Elements that don't have renderers
because they have "display:contents". This creates various problems because the computedStyle field can
update outside normal style resolution/render tree update (as a performance optimization). This can lead
to substly inconsistent state where display:contents style doesn't match the render tree style and
some assumptions break.

This patch gives display:contents style a separate field in element rare data that is only written to
by RenderTreeUpdater. This way it is always in sync with the render tree style.

* LayoutTests/fast/animation/animation-display-contents-expected.html: Added.
* LayoutTests/fast/animation/animation-display-contents.html: Added.
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::hasDisplayContents const):
(WebCore::Element::storeDisplayContentsStyle):
(WebCore::Element::clearDisplayContentsStyle):
(WebCore::Element::existingComputedStyle const):
(WebCore::Element::renderOrDisplayContentsStyle const):
(WebCore::Element::resolveComputedStyle):
(WebCore::Element::resetComputedStyle):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/ElementRareData.cpp:
* Source/WebCore/dom/ElementRareData.h:
(WebCore::ElementRareData::displayContentsStyle const):
(WebCore::ElementRareData::setDisplayContentsStyle):
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
* Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::affectsRenderedSubtree):
(WebCore::Style::TreeResolver::resolveComposedTree):

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




More information about the webkit-changes mailing list