[webkit-changes] [WebKit/WebKit] d83537: REGRESSION (iOS 17.4, macOS 14.4, 270890 at main): An...

Antti Koivisto noreply at github.com
Wed Mar 13 10:41:53 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d83537abc7e7901653c42553b3f7d71505f5dbc8
      https://github.com/WebKit/WebKit/commit/d83537abc7e7901653c42553b3f7d71505f5dbc8
  Author: Antti Koivisto <antti at apple.com>
  Date:   2024-03-13 (Wed, 13 Mar 2024)

  Changed paths:
    A LayoutTests/fast/animation/animation-with-DOM-mutation-and-display-none-expected.html
    A LayoutTests/fast/animation/animation-with-DOM-mutation-and-display-none.html
    M Source/WebCore/style/StyleTreeResolver.cpp

  Log Message:
  -----------
  REGRESSION (iOS 17.4, macOS 14.4, 270890 at main): Animating element with display: none still remain visible
https://bugs.webkit.org/show_bug.cgi?id=270697
rdar://124289418

Reviewed by Antoine Quint and Darin Adler.

The page sets the root of the overlay containing tree to display:none and immediately (before style recall) reinserts
it into another position in the document, causing render tree teardown. When we recompute the style (applying display:none)
we don't consider it a style change since there was no existing style due to the earlier teardown.
In this case we fail to clear lastStyleChangeEventStyle which has been set by an animation on the element.

Another animation triggered style recalc comes along, takes the optimized AnimationOnly code path and picks up
the lastStyleChangeEventStyle (which doesn't have display:none) bringing the element back alive.

* LayoutTests/fast/animation/animation-with-DOM-mutation-and-display-none-expected.html: Added.
* LayoutTests/fast/animation/animation-with-DOM-mutation-and-display-none.html: Added.
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):

Fix by clearing lastStyleChangeEventStyle also when we have a style change to display:none without existing renderer.

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list