Bug 159251

Summary: RenderBox::hasDefiniteLogicalHeight() shouldn't consider all abspos elements as definite
Product: WebKit Reporter: Manuel Rego Casasnovas <rego>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, hyatt, jfernandez, rego, simon.fraser, svillar, zalan
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Test case to reproduce the issue
none
Current output
none
Expected output none

Description Manuel Rego Casasnovas 2016-06-29 00:21:11 PDT
Created attachment 282326 [details]
Test case to reproduce the issue

An abspos element doesn't have a definite height unless it has a specified height or the top and bottom properties are not auto.

For example, the following div doesn't have a definite height:
  <div style="position: absolute;"></div>

However, this one will have a definite height:
  <div style="position: absolute; top: 0; bottom: 0;"></div>

RenderBox::hasDefiniteLogicalHeight() is considering that both have a definite height which is wrong:
http://trac.webkit.org/browser/trunk/Source/WebCore/rendering/RenderBox.cpp#L4760

This leads to wrong results in CSS Grid Layout check the attached example, the 50% in the 2nd row is resolved against the 100px of the first row when it should be considered "auto".
You can check it live at: http://jsbin.com/xuyane/1/edit?html,css,output
Comment 1 Manuel Rego Casasnovas 2016-06-29 00:21:43 PDT
Created attachment 282327 [details]
Current output
Comment 2 Manuel Rego Casasnovas 2016-06-29 00:22:05 PDT
Created attachment 282328 [details]
Expected output
Comment 3 Ahmad Saleem 2023-03-17 17:01:48 PDT
I am able to reproduce this issue in WebKit ToT (261811@main) using attached test case and also in Chrome Canary 113. Only Firefox Nightly 113 show expected output. Just wanted to share updated test results. Thanks!