Summary: | [css-grid] Height percentages are not properly resolved for item's children | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Manuel Rego Casasnovas <rego> | ||||
Component: | Layout and Rendering | Assignee: | Manuel Rego Casasnovas <rego> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, esprehn+autocc, glenn, jfernandez, kondapallykalyan, rego, simon.fraser, svillar | ||||
Priority: | P2 | Keywords: | BlinkMergeCandidate | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
See Also: | https://bugs.chromium.org/p/chromium/issues/detail?id=612755 | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 60731 | ||||||
Attachments: |
|
Description
Manuel Rego Casasnovas
2016-06-29 03:49:59 PDT
Created attachment 282339 [details]
Patch
Comment on attachment 282339 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=282339&action=review > Source/WebCore/rendering/RenderBox.cpp:2993 > + availableHeight = cb->overrideLogicalContentHeight(); Hmm it looks to me that this is only valid for direct children of a grid item, what happens if we have a child of a child of a grid item? Comment on attachment 282339 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=282339&action=review >> Source/WebCore/rendering/RenderBox.cpp:2993 >> + availableHeight = cb->overrideLogicalContentHeight(); > > Hmm it looks to me that this is only valid for direct children of a grid item, what happens if we have a child of a child of a grid item? Mmmm, I'm not sure if I follow you. It'd work like in any regular element. The child of a child of a grid item, has to resolve its percentage against the height of the child of the grid item. So we don't need anything special here. Example: <div style="display: grid; grid: 100px / 100px;> <div id="item"> <div id="subitem"> <div id="subsubitem"></div> </div> </div> </div> A percentage height in the "subitem" needs to be resolved against the "item" height. If the "item" is stretched (that's when we have hasOverrideLogicalContentHeight()), then we should use that height to resolve the "subitem" percentage. Imagine that the "subitem" has a 30% in the previous example, it should resolve against the 100px height of the stretched "item". A percentage height in the "subsubitem" has to be resolved against the "subitem" height. If the "subitem" height is "auto", it cannot be resolved, that's all. Comment on attachment 282339 [details] Patch Clearing flags on attachment: 282339 Committed r202856: <http://trac.webkit.org/changeset/202856> All reviewed patches have been landed. Closing bug. |