Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d39bde2caea58d8ff99e881f143b58fe215fa3d4
      
https://github.com/WebKit/WebKit/commit/d39bde2caea58d8ff99e881f143b58fe215fa3d4
  Author: Anne van Kesteren <[email protected]>
  Date:   2026-04-04 (Sat, 04 Apr 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-picker-option-animation-reopens-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-picker-option-animation-reopens.html
    M LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/style/Styleable.cpp

  Log Message:
  -----------
  Cancel animations in display: none subtree so they restart
https://bugs.webkit.org/show_bug.cgi?id=311329
rdar://171478911

Reviewed by Antoine Quint.

If you open the select at https://codepen.io/mobalti/full/myPPmwL a
second time, the options are no longer visible.

When a select picker closes, the popover gets display: none and render
tree teardown calls cancelStyleOriginatedAnimations() on the option
elements, clearing their cssAnimationList. However, the select/popover
close also triggers a style recalc (to verify the appearance value),
which causes the style resolver to re-visit the options while they're
still in the display: none subtree. updateCSSAnimations() is called
with isInDisplayNoneTree=Yes — it skips animation creation (correctly),
but setCSSAnimationList() at the end of the function re-populates
cssAnimationList. When the picker reopens, the early return in
updateCSSAnimations() sees previousAnimationList matches the new
animation list and returns without creating a new animation. The
animation never restarts.

The fix adds isInDisplayNoneTree == Yes to the existing cancellation
condition at the top of updateCSSAnimations(), so it cancels and
returns early before reaching setCSSAnimationList(). This is cheap (the
existing isInDisplayNoneTree == No guard already prevents animation
creation, so no useful work would happen past this point) and ensures
the animation state stays clean for when the subtree becomes visible
again.

Test: 
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/select-picker-option-animation-reopens.html

Upstream:
    https://github.com/web-platform-tests/wpt/pull/58941
    https://github.com/web-platform-tests/wpt/pull/58979

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



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

Reply via email to