Closed Bug 1394662 Opened 7 years ago Closed 7 years ago

Consider making ::-moz-table-column a non-inheriting anon box

Categories

(Core :: CSS Parsing and Computation, enhancement)

53 Branch
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file, 1 obsolete file)

Per spec, the only styles that apply to table columns are border props, background props, 'width, and 'visibility'. The only one of those that inherits is 'visibility'. And the only relevant value is "collapse". But an anonymous col can only be "visibility: collapse" in Gecko right now if its colgroup is, and then the colgroup will get collapsed away as a whole. So it doesn't matter whether the col inherits the visibility style. Given that, I suspect it's safe to make ::-moz-table-column a non-inheriting anon box. This would help out stylo memory usage; right now in the common case of no colgroup/col tags we end up with lots of unshared anonymous col styles because the cols are inheriting from the colgroup anonymous box.
Assignee: nobody → bzbarsky
In our UA sheet the only style we apply to ::-moz-table-column is "display: table-column". Per spec, the only styles that apply to table columns are border props, background props, 'width, and 'visibility'. The only one of those that inherits is 'visibility'. And the only relevant value per spec is "collapse". But an anonymous column can only be "visibility: collapse" in Gecko right now if its colgroup is, and then the colgroup will get collapsed away as a whole. So it doesn't matter whether the column inherits the visibility style. In practice, we do something special for "hidden" on a table-column as well, during display list building, which affects hit-testing. Per https://github.com/w3c/csswg-drafts/issues/1763 it's not clear that we should be doing this at all, but for now we just keep our existing behavior and ensure that the parent colgroup's visibility style is taken into account for anonymous columns when building display lists.
Attachment #8902414 - Flags: review?(cam)
In our UA sheet the only style we apply to ::-moz-table-column is "display: table-column". Per spec, the only styles that apply to table columns are border props, background props, 'width', and 'visibility'. The only one of those that inherits is 'visibility'. And the only relevant value per spec is "collapse". But an anonymous column can only be "visibility: collapse" in Gecko right now if its colgroup is, and then the colgroup will get collapsed away as a whole. So it doesn't matter whether the column inherits the visibility style. In practice, we do something special for "hidden" on a table-column as well, during display list building, which affects hit-testing. Per https://github.com/w3c/csswg-drafts/issues/1763 it's not clear that we should be doing this at all, but for now we just keep our existing behavior and ensure that the parent colgroup's visibility style is taken into account for anonymous columns when building display lists.
Attachment #8902435 - Flags: review?(cam)
Attachment #8902414 - Attachment is obsolete: true
Attachment #8902414 - Flags: review?(cam)
Comment on attachment 8902435 [details] [diff] [review] Make ::-moz-table-column a non-inheriting anonymous box Review of attachment 8902435 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/tables/nsTableFrame.cpp @@ +1515,5 @@ > + // If we have an anonymous column in the AppendAnonymousColFrames sense, it > + // might think it's visible for painting (due to not inheriting its colgroup's > + // styles) while the colgroup as a whole is actually not visible for painting > + // because it has hidden visibility. In that situation we should also treat > + // the column as not visibile, because otherwise hit-testing can get a bit visible
Attachment #8902435 - Flags: review?(cam) → review+
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/1e89ea2871e7 Make ::-moz-table-column a non-inheriting anonymous box. r=heycam
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Depends on: 1403293
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: