Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d4ee79d749dda787d8229620428597029552a999
      
https://github.com/WebKit/WebKit/commit/d4ee79d749dda787d8229620428597029552a999
  Author: Alan Baradlay <[email protected]>
  Date:   2026-04-25 (Sat, 25 Apr 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/position-relative-percentage-top-005-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/position-relative-percentage-top-005.html
    M Source/WebCore/rendering/RenderBoxModelObject.cpp

  Log Message:
  -----------
  REGRESSION (311908@main): Autoplay button in YouTube controls is misplaced
https://bugs.webkit.org/show_bug.cgi?id=313304
<rdar://175562243>

Reviewed by Simon Fraser.

312944@main added hasDefiniteHeightByStyle as a fast style-only check for 
resolving percentage top/bottom on relatively positioned elements.
This fast path incorrectly returns 'no, the box has no ancestor with definite 
height' for certain nested flex content.

Example:

  <div class=outer style="display: flex; height: 200px">
    <div class=middle style="display: flex; align-items: flex-end">
      <div class=inner style="height: 100%">
        <div style="position: relative; top: 100%">

The "inner" div is a flex item inside "middle" with alignment flex-end (not 
stretch):
Old code returned false immediately: "flex container is not stretch, not 
definite" <- incorrect.

However
1. "inner" has height: 100% which resolves against "middle"
2. "middle" is a flex item inside "outer" with alignment stretch (default)
3. stretch gives "middle" a definite cross size (200px from "outer")

The fix: when the cross-axis alignment is not stretch, don't return false - fall
through to the normal logicalHeight checks. The percentage/stretch/auto checks
below the flex-item block will walk the ancestor chain and find the definite
height through the normal resolution path.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/position-relative-percentage-top-005-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/position-relative-percentage-top-005.html:
 Added.
* Source/WebCore/rendering/RenderBoxModelObject.cpp:
(WebCore::hasDefiniteHeightByStyle):

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



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

Reply via email to