Skip to content

[css-display][css-pseudo] Interaction of run-in and ::first-line #1441

Closed

Description

@Loirooriol

In Run-In Layout, CSS Display says

If a run-in sequence is immediately followed by a block box that does not establish a new block formatting context, it is inserted as direct children of the block box after its ::marker pseudo-element’s boxes (if any), but preceding any other boxes generated by the contents of the block (including the box generated by the ::before pseudo-element, if any).

The reparented content is then formatted as if originally parented there. Note that only layout is affected, not inheritance, because property inheritance for non-anonymous boxes is based only on the element tree.

First, does "boxes generated by the contents of the block" include block's ::first-line? If yes, what about ::first-lines generated by ancestor blocks?

Second, the premise in the last sentence is false. A non-anonymous box fragment can inherit some properties from a ::first-line pseudo-element, which is based on the box tree. So it's not clear whether a run-in inserted into the next block is supposed to ignore that block's ::first-line styles or not.

Example:

<section>
  <span>Foo</span>
  <div>Bar</div>
</section>
section { color: red }
div::first-line { color: green; background: blue }
span { display: run-in }

What color does Foo have? Does it have a blue background behind?

Activity

  1. Loirooriol commented on May 22, 2017

    @Loirooriol
    ContributorAuthor

    If an in-flow ::marker is inside ::first-line (being discussed in #1442), then I guess a run-in should also. What happens with inheritance?

  2. tabatkins commented on Jul 5, 2017

    @tabatkins
    Member

    My intuition is that runins should be affected by ::first-line styles, but this'll rely on how we actually, properly, define ::first-line, and so this issue is blocked on that.

  3. fantasai commented on Jul 5, 2017

    @fantasai
    Collaborator

    Fixed normatively in 37c01a4 (consistent with the text in the subsequent note).

  4. Loirooriol commented on Jul 5, 2017

    @Loirooriol
    ContributorAuthor

    Seems OK to me. Well, not sure if this will make ::first-line even more hard to implement properly, but I'm not an implementator :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions