You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-inline][css-pseudo] Interaction of root inline box and ::first-line #1384
The root inline box is an anonymous inline box which is automatically generated to hold all of the inline-level contents of a block container (if it has any).
The ::first-line pseudo-element’s generated box behaves similar to that of an inline-level element, but with certain restrictions.
A user agent must act as if the fictional start tags of a ::first-line pseudo-element were nested just inside the innermost enclosing block-level element.
So ::first-line is a restricted inline-level, and inline-levels are wrapped inside the root inline box, which is inline, and inline-level fragments in the first line are wrapped inside the ::first-line.
I think the root inline box should interact with ::first-line the same way any other inline boxes interact with ::first-line. I'm not sure we actually agree on what that is, though...
So the root inline box should be broken, and the fragment in the first line be wrapped inside ::first-line?
I read your Inline Box Model proposal, which says that each line has its own root inline box. And Hixie's proposal further specifies that it's that root inline box in the first line what is matched by ::first-line.
I think this made sense, but it seems currently there is a single root inline box in the block container instead of one per line. Maybe ::first-line could be the fragment in the first line of the root inline box.
So I think that based on #2282, we've eliminated the possibility of ::first-line being inside the root inline.
As for the remaining possibilities, I cannot think of a case where that would make a difference, but from a mental model point of view, I think I quite like defining ::first-line to be the fragment of the root inline box , rather than wrapping it. It's easier to keep track of fewer boxes, and avoids the need to worry about "Which one is inside of which one?".
The CSS Working Group just discussed [css-inline][css-pseudo] Interaction of root inline box and ::first-line, and agreed to the following:
RESOLVED: root inline box is inside all the first line pseudo elements
The full IRC log of that discussion
<dael> Topic: [css-inline][css-pseudo] Interaction of root inline box and ::first-line
<dael> github: https://github.com//issues/1384
<dael> oriol: I can explain unless florian prefers
<dael> oriol: The idea is that in css 2 we had concept of the strat that forced the line height to be at least the value of the line height in block container
<dael> oriol: Replaced with root inline box, but not clear how that interacts with first line. root inline is anon inline box that contains inline level contents in first line.
<dael> oriol: The first line is behaving as an inline lievel is it inside the root inline box? Inside the first line pseudo?
<dael> oriol: This was more theoretical but had practical implication we resolved in issue 2282
<dael> oriol: There resolved in first line pseudo element you can set line height to a value smaller than in block. this should reduce it.
<dael> oriol: Implication of this is that first-line pseudo element cannot be inside root inline box. Has to be the opposite
<dael> oriol: Then florian proposed that what we could do is unify the boxes and say first-line pseudo is exactly the frag of the root inline box in the first line. Don't think this works b/c can have multiple first line pseudo elements
<dael> oriol: At most what we could do is innermost is the frag of the root inline box. Otherwise we do need nesting
<dael> oriol: Only possibility we have is that the fragment of the root inline box is inside the innermost or it's equal to innermost
<Rossen_> q?
<dael> florian: Makes sense. Prop because seemed simplier but you have a case where makes a difference. Given that we're left with one possibility and go with that
<dael> fantasai: Prop: root inline box is inside all the first line pseudo elements
<dael> oriol: Yeah
<dael> Rossen_: Other opinions?
<dael> Rossen_: Obj?
<dael> RESOLVED: root inline box is inside all the first line pseudo elements
Activity
dbaron commentedon May 16, 2017
I think the root inline box should interact with ::first-line the same way any other inline boxes interact with ::first-line. I'm not sure we actually agree on what that is, though...
Loirooriol commentedon May 16, 2017
So the root inline box should be broken, and the fragment in the first line be wrapped inside
::first-line?I read your Inline Box Model proposal, which says that each line has its own root inline box. And Hixie's proposal further specifies that it's that root inline box in the first line what is matched by
::first-line.I think this made sense, but it seems currently there is a single root inline box in the block container instead of one per line. Maybe
::first-linecould be the fragment in the first line of the root inline box.fantasai commentedon Dec 31, 2020
@Loirooriol What question are you trying to answer, other than the obvious theoretical one?
Loirooriol commentedon Jan 7, 2021
A practical implication would be #2282
frivoal commentedon Dec 31, 2021
So I think that based on #2282, we've eliminated the possibility of
::first-linebeing inside the root inline.As for the remaining possibilities, I cannot think of a case where that would make a difference, but from a mental model point of view, I think I quite like defining ::first-line to be the fragment of the root inline box , rather than wrapping it. It's easier to keep track of fewer boxes, and avoids the need to worry about "Which one is inside of which one?".
Loirooriol commentedon Feb 3, 2022
I don't think we can do that, because there can be multiple
::first-line(each one originated by a different ancestor).https://drafts.csswg.org/css-pseudo-4/#first-text-line
css-meeting-bot commentedon Feb 3, 2022
The CSS Working Group just discussed
[css-inline][css-pseudo] Interaction of root inline box and ::first-line, and agreed to the following:RESOLVED: root inline box is inside all the first line pseudo elementsThe full IRC log of that discussion
<dael> Topic: [css-inline][css-pseudo] Interaction of root inline box and ::first-line<dael> github: https://github.com//issues/1384
<dael> oriol: I can explain unless florian prefers
<dael> oriol: The idea is that in css 2 we had concept of the strat that forced the line height to be at least the value of the line height in block container
<dael> oriol: Replaced with root inline box, but not clear how that interacts with first line. root inline is anon inline box that contains inline level contents in first line.
<dael> oriol: The first line is behaving as an inline lievel is it inside the root inline box? Inside the first line pseudo?
<dael> oriol: This was more theoretical but had practical implication we resolved in issue 2282
<dael> oriol: There resolved in first line pseudo element you can set line height to a value smaller than in block. this should reduce it.
<dael> oriol: Implication of this is that first-line pseudo element cannot be inside root inline box. Has to be the opposite
<dael> oriol: Then florian proposed that what we could do is unify the boxes and say first-line pseudo is exactly the frag of the root inline box in the first line. Don't think this works b/c can have multiple first line pseudo elements
<dael> oriol: At most what we could do is innermost is the frag of the root inline box. Otherwise we do need nesting
<dael> oriol: Only possibility we have is that the fragment of the root inline box is inside the innermost or it's equal to innermost
<Rossen_> q?
<dael> florian: Makes sense. Prop because seemed simplier but you have a case where makes a difference. Given that we're left with one possibility and go with that
<dael> fantasai: Prop: root inline box is inside all the first line pseudo elements
<dael> oriol: Yeah
<dael> Rossen_: Other opinions?
<dael> Rossen_: Obj?
<dael> RESOLVED: root inline box is inside all the first line pseudo elements
[css-pseudo-4] Root inline fragment is inside ::first-line #1384
[css-pseudo-4] Root inline fragment is inside ::first-line w3c#1384
Disable the `FirstLineTextMetrics` runtime flag
Disable the `FirstLineTextMetrics` runtime flag
Bug 2068935 [wpt PR 62378] - Disable the `FirstLineTextMetrics` runti…
Disable the `FirstLineTextMetrics` runtime flag
Bug 2068935 [wpt PR 62378] - Disable the `FirstLineTextMetrics` runti…