Closed Bug 1411422 Opened 2 years ago Closed 6 months ago

Skip pseudo-styled parents when calculating percentage height/width in multicol container

Categories

(Core :: Layout: Columns, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: neerja, Assigned: TYLin, Mentored)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

Currently there is a workaround in UA.css for pseudo-styles like '-moz-column-content' that use 'height: 100%' so that when resolving percentage heights, the pseudo styled parent will have a valid percentage height defined for it. 

This was a reasonable workaround assuming that only one such pseudo-styled child will exist under a parent and therefore it can take up 100% of its parent's height. But, with the proposed implementation for Column-Span this is not true anymore since the new ColumnSetWrapperFrame can have multiple pseudo-styled ColumnSetFrames and ColumnSpanWrappers inside it. So, we must change the code that is calculating this percentage height to hop over any parents with pseudo-styles.

I believe, the same applies for percentage width calculation.
Assignee: nobody → npancholi
Priority: -- → P3
No longer blocks: column-span
Assignee: npancholi → nobody
Blocks: column-span
Component: Layout → Layout: Columns
See Also: → 1523595
Assignee: nobody → aethanyc
Status: NEW → ASSIGNED

After introducing column-span, the ColumnSetWrapperFrame can have more
than one ColumnSetFrame children if there's any column-span:all child.
Thus we cannot use "height:100%" to pass block size information down to
the -moz-column-content's children.

Skip column span wrapper in nsIFrame::IsBlockWrapper() so that the
percentage column-span:all works.

Before this patch, the height of column contents are set to 100% of the
multicol container, so if the previous in-flows of column content
anonymous boxes consume all the height, later in-flows's height are all
0. In this patch, we don't restrict column-content's height, so their
height are calculated based on their children's height.
column-contain-1a.html passes because it can now correctly calculate the
union of all the column content's rect to find the correct sticky
positioning.

Blocks: 1523595
See Also: 1523595
Summary: Skip pseudo-styled parents when calculating percentage height/width → Skip pseudo-styled parents when calculating percentage height/width in multicol container

My patch only attempts to remove the height: 100% for ::-moz-column-set and ::-moz-column-content in ua.css as a first step toward fixing bug 1523595.

There are more to be done. For example, a later continuation of ColumnSet need to restrict the column-content's block size in nsColumnSetFrame::ChooseColumnStrategy if ColumnSetWrapper has block-size constraint and previous continuation of ColumnSet has already consumed some of the ColumnSetWrapper's block size.

Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/c4f25a740b96
Make percentage block size children work without "height:100%" in ::-moz-column-set and ::-moz-column-content. r=dbaron
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16483 for changes under testing/web-platform/tests
Upstream PR merged
Blocks: 1348839
Duplicate of this bug: 1533346
You need to log in before you can comment on or make changes to this bug.