New issue
Advanced search Search tips

Issue 880062 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 874753



Sign in to add a comment

Fieldset content before the legend is not interoperable

Project Member Reported by zcorpan@gmail.com, Sep 3

Issue description

Test https://github.com/web-platform-tests/wpt/pull/12810

Firefox renders as expected. WebKit and Chrome put the X and the Y on separate lines. Edge puts the X above the legend.
 
Right. Blink treats the legend as a regular block when generating layout boxes. This means that the text before and after the legend are wrapped inside separate anonymous blocks [1]. We'll lay out the legend specially (i.e. treat it as a legend) during layout only. There'll still be two separate anonymous blocks for the two pieces of text, suddenly appearing to be adjacent.

To fix this we probably have to extend (and possibly rename) our term "floating or out of flow positioned". We probably need to consider a rendered legend to be of such a type, since such objects don't trigger creation of anonymous blocks around sibling inline content. We're generally not allowed to let the order of layout objects diverge from that of the DOM nodes, so just letting it e.g. be the first layout object child won't work.

[1] https://www.w3.org/TR/CSS22/visuren.html#anonymous-block-level

Test case:
<fieldset>
  X
  <legend>legend</legend>
  Y
</fieldset>
Components: Blink>Layout
Labels: Hotlist-Interop

Sign in to add a comment