element-timing icon indicating copy to clipboard operation
element-timing copied to clipboard

Text nodes do not have a "border box"

Open bzbarsky opened this issue 6 years ago • 4 comments

https://wicg.github.io/element-timing/#sec-report-text step 2.1 says:

the border box of text

where text is a Text node. In CSS elements can have border boxes but text cannot. See https://www.w3.org/TR/css-display-3/#intro which defines boxes (for elements and pseudo-elements, plus anonymous boxes) and https://drafts.csswg.org/css-box-3/#border-box which defines a "border box", but only for boxes, not text runs.

bzbarsky avatar Aug 14 '19 03:08 bzbarsky

@hawkinsw @npm1

bzbarsky avatar Aug 14 '19 03:08 bzbarsky

Hmmm I wonder if there is no CSS box which specifies the content size of a text node or text run then?

npm1 avatar Aug 14 '19 14:08 npm1

I don't believe there is, but it's worth checking with the CSSWG.

Note also that if you have something like <span>text</span> then the content box of the span may not contain all of the bits the text paints. See https://drafts.csswg.org/css-overflow-3/#ink for some examples. It's not clear to me whether you'd want to include such bits in the rectangle you want here.

bzbarsky avatar Aug 14 '19 15:08 bzbarsky