Skip to content

[cssom-view][css-text][css-break] Clarify Element.getClientRects #1545

Closed
@phistuck

Description

@phistuck

https://drafts.csswg.org/cssom-view-1/#dom-element-getclientrects
web-platform-tests/wpt#6264 (comment) added a test that verifies that source lines do not affect the result (well, the number of items in the returned list) of Element.getClientRects().

Originally, the issue from which the test originated is https://crbug.com/167261 -

<span>test
test</span>

Would return a list of two items, while -

<span>test test</span>

Would return a list of a single item.

@kojiishi argues that the specification does not mandate that the rendered lines are to be returned, but box fragments instead (which may translate to source lines, in the first case?).

Source lines are not very helpful to anything in a non-preformatted element. And if it is a preformatted element, the source line would show up as rendered lines.
So I believe the goal of Element.getClientRects is (and the specified goal should be) to disregard source lines.

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