Open Bug 1600224 Opened 2 months ago Updated 2 months ago

Unexpectedly small line box, with "display:contents; line-height:[anything]"


(Core :: Layout: Block and Inline, defect, P3)





(Reporter: dholbert, Unassigned, NeedInfo)




(3 files)

Attached file testcase 1


  1. Load attached testcase.

There should be a box around the text.

The box is very tiny and doesn't fit the text. It seems to be as tall as the inherited font-size (which in this case is tiny).

Note that the testcase includes a custom line-height value, which Chrome honors (and I'm not sure if it makes sense to honor or not, but we probably should?). Instead of honoring it, we throw it away and then trigger this bug. It does have some effect, though, because if I remove the line-height entirely, then we produce EXPECTED RESULTS with a box that's as tall as the text.

Here's a reference-ish case (not an exact reference, but just for comparison). It's identical to the testcase, except I've removed line-height:50px which we're not respecting anyway.

With that removal, we produce a nicely sized box and nicely positioned text, for some reason.

Attachment #9112460 - Attachment description: reference(ish) case 1 (removed `line-height`) → semi-reference case 1 (removed `line-height`)

(This might really be a style-system bug -- not sure.)

Meant to say:

So the issue here seems to be that we look at the wrong font-size during line layout... I'm ~sure there's no style system bug but I can take a look anyway.

Flags: needinfo?(emilio)

Here's the bug:

I don't understand why... But we should probably do that for display: contents children.

Assignee: nobody → emilio

Well, that was unexpectedly super-orange... :/

It seems like Blink and WebKit create an anonymous inline around display: contents text:

Jonathan, do you have any insight here? Is there anything totally off with the patch in comment 6?

Assignee: emilio → nobody
Flags: needinfo?(jfkthame)
See Also: → 1597680
You need to log in before you can comment on or make changes to this bug.