Wide float prevents following contents from being in ::first-line

NEW
Unassigned

Status

()

Core
Layout
P3
normal
7 months ago
3 months ago

People

(Reporter: Oriol, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 months ago
Created attachment 8853706 [details]
testcase

According to https://www.w3.org/TR/CSS21/visuren.html#floats,

> If a shortened line box is too small to contain any content,
> then the line box is shifted downward

So if you have a block container with ::first-line whose first child is a wide float which makes the following text move downwards, the text is still in the first line box, so it should be affected by ::first-line.

It works on Edge and Chrome, but not on Firefox.

    <style>
    div {
      color: red;
    }
    div::first-line {
      color: green;
    }
    div::before {
      content: '';
      float: left;
      height: 1px;
      width: 100%;
  }
    </style>
    <div>I should be green</div>

Updated

3 months ago
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.