Check NS_FRAME_OUT_OF_FLOW bit in nsIFrame::IsAbsolutelyPositioned() and nsIFrame::IsFloating()
Categories
(Core :: Layout: Positioned, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox88 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
Attachments
(5 files, 1 obsolete file)
Per discussion with mats in https://phabricator.services.mozilla.com/D103824#3368905,
both nsIFrame::IsAbsolutelyPositioned() and nsIFrame::IsFloating() only check the style so which might be a bit misleading given that they are nsIFrame methods. We should probably just convert all existing consumers to call the corresponding nsStyleDisplay method directly instead. Then we can make the nsIFrame version also check the frame bit, and convert expressions like that one I'm adding here to call the new nsIFrame method.
Per https://drafts.csswg.org/css-position-3/#position-property, table-column-group and table-column ignore position
, so nsIFrame::IsAbsolutelyPositioned()
should also check NS_FRAME_OUT_OF_FLOW
bit to ensure its correctness across all frame types. Similarly for nsIFrame::IsFloating()
.
Assignee | ||
Comment 1•4 years ago
|
||
The nsIFrame::IsAbsolutelyPositioned() is removed to ensure all the
callers are converted. In Part 2, we are going to bring it back with
HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)
added into it.
This patch shouldn't change the behavior at all.
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D106579
Assignee | ||
Comment 3•4 years ago
|
||
Similar to Part 1, nsIFrame::IsFloating() is removed to ensure all the
callers are converted. In Part 4, we are going to bring it back with
HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)
added into it.
Depends on D106580
Assignee | ||
Comment 4•4 years ago
|
||
Depends on D106581
Assignee | ||
Comment 5•4 years ago
|
||
Depends on D106582
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
When aElement is a <table>, styleFrame is the inner table frame. It has
the abspos style, but not the NS_FRAME_OUT_OF_FLOW bit. The bit is set
on the table wrapper frame.
We want to check just the abspos style for styleFrame. Otherwise we'll
break <table> element's offsetParent property after applying Part 2.
Without this patch, running ./mach test dom/html/test/test_bug375003-1.html
can generate the following exception.
dom/html/test/test_bug375003-1.html | uncaught exception -
TypeError: can't access property "id", p is null at
t3@http://mochi.test:8888/tests/dom/html/test/test_bug375003-1.html:39:3
Depends on D106579
Updated•4 years ago
|
Comment 8•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/928da174181e
https://hg.mozilla.org/mozilla-central/rev/53191bd0032c
https://hg.mozilla.org/mozilla-central/rev/a7bf4082de04
https://hg.mozilla.org/mozilla-central/rev/d3e1a283826c
https://hg.mozilla.org/mozilla-central/rev/6b60e720eecd
Description
•