Closed Bug 1169627 Opened 9 years ago Closed 5 years ago

[css-grid][css-flexbox] ApplyStyleFixups is too eager to blockify display:flex/grid children

Categories

(Core :: Layout, defect, P4)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: MatsPalmgren_bugz, Unassigned)

References

Details

Follow-up from bug 997709.

That bug was about <select style="display:flex"> where
nsComboboxControlFrame child frames was blockified by
ApplyStyleFixups.  This problem might also affect other
frame types (form controls, MathML, SVG, XUL) leading
to wrong layout or crashes.

This bug is about auditing the code and see if we can
come up with a more general solution.
The tools we currently use this for are...
 (1) the RAII AutoParentDisplayBasedStyleFixupSkipper class (used in nsCSSFrameConstructor)
 (2) nsStyleSet::eSkipParentDisplayBasedStyleFixup.

These both ultimately set the nsStyleContext constructor-arg "aSkipParentDisplayBasedStyleFixup" to true. (The goal is to cover cases where we should ignore the parent's "display" value for these fixups, because we know the parent element has its own type of [non-flex|grid] frame class that it wants, regardless of its "display".)

It's possible there are more places we need to apply these tools (as shown by bug 997709 I suppose).
Summary: ApplyStyleFixups is too eager to blockify display:flex/grid children → [css-grid][css-flexbox] ApplyStyleFixups is too eager to blockify display:flex/grid children
Depends on: 1339287

(In reply to Daniel Holbert [:dholbert] from comment #1)

The tools we currently use this for are...
(1) the RAII AutoParentDisplayBasedStyleFixupSkipper class (used in
nsCSSFrameConstructor)
(2) nsStyleSet::eSkipParentDisplayBasedStyleFixup.

Looks like neither of these tools exist anymore (nor does nsStyleContext). Not sure how specifically this works in today's Stylo world, but it seems to be working out OK. Is there more that we need to do here?

Flags: needinfo?(mats)

I think this is probably OK now. We still have something similar:
https://searchfox.org/mozilla-central/source/servo/components/style/style_adjuster.rs#199-202
where skip_item_display_fixup() is true for anon frames:
https://searchfox.org/mozilla-central/source/servo/components/style/gecko/wrapper.rs#1519
which should skip form control interior in general.

Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(mats)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.