Bug 159251 - RenderBox::hasDefiniteLogicalHeight() shouldn't consider all abspos elements as definite
Summary: RenderBox::hasDefiniteLogicalHeight() shouldn't consider all abspos elements ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-29 00:21 PDT by Manuel Rego Casasnovas
Modified: 2016-06-29 09:00 PDT (History)
6 users (show)

See Also:


Attachments
Test case to reproduce the issue (393 bytes, text/html)
2016-06-29 00:21 PDT, Manuel Rego Casasnovas
no flags Details
Current output (1.60 KB, image/png)
2016-06-29 00:21 PDT, Manuel Rego Casasnovas
no flags Details
Expected output (1.55 KB, image/png)
2016-06-29 00:22 PDT, Manuel Rego Casasnovas
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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