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

  Changed paths:
    M LayoutTests/TestExpectations
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/absolute-tables-height-001-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/absolute-tables-height-001.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/absolute-tables-height-quirks-001-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/absolute-tables-height-quirks-001.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-002-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-003-expected.txt
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/RenderTable.cpp

  Log Message:
  -----------
  Fix imported/w3c/web-platform-tests/css/css-tables/absolute-tables-007.html
https://bugs.webkit.org/show_bug.cgi?id=313510

Reviewed by Antti Koivisto.

Absolutely positioned tables with explicit height (e.g. height: 100%)
were not resolving their height correctly because two code paths
bypassed the out-of-flow constraint equation:

1. computeOutOfFlowPositionedLogicalHeightUsing had a blanket early
   return for all tables that returned the current content height
   (0, since rows haven't been laid out yet) instead of resolving the specified
   value against the containing block.

   For example (absolute-tables-007):

     <div style="position: relative; width: 100px;">
       <div style="position: absolute; display: table; width: 100%; height: 
100%; background: green;"></div>
       <div style="height: 100px; background: red;"></div>
     </div>

   Before:
     computeOutOfFlowPositionedLogicalHeightUsing(height: 100%) -> 
isRenderTable() -> return 0

   After:
     computeOutOfFlowPositionedLogicalHeightUsing(height: 100%) -> isAuto()? NO 
-> 100% of containingSize(100) = 100

2. The row distribution height in RenderTable::layout used
   convertStyleLogicalHeightToComputedHeight, which calls the in-flow
   percentage resolution path. For OOF tables this is wrong: it skips
   the constraint equation and in quirks mode walks to the viewport
   through auto-height ancestors.

   For example (no doctype = quirks mode):

     <div style="position: relative; width: 100px;">
       <div style="position: absolute; display: table; width: 100%; height: 
100%; background: green;">
         <div style="height: 100px;"></div>
       </div>
     </div>

   Before: table stretched to viewport (~800px) because 
computePercentageLogicalHeight resolved against the viewport.

   After: computeLogicalHeight uses the constraint equation which gives 100% of 
containingSize(0) = 0, then content
   expands the table to 100px.

* LayoutTests/TestExpectations:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/absolute-tables-height-001-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/absolute-tables-height-001.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/absolute-tables-height-quirks-001-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-tables/absolute-tables-height-quirks-001.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-002-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint-003-expected.txt:
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalHeight const):
(WebCore::RenderBox::computeOutOfFlowPositionedLogicalHeightUsing const):
* Source/WebCore/rendering/RenderTable.cpp:
(WebCore::RenderTable::layout):

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



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

Reply via email to