Skip to content

[cssom-view] Range.getClientRects does not seem interoperable #7155

@Kaiido

Description

@Kaiido

Firefox seems to understand the specs of Range.getClientRects() differently than WebKit and Blink based browsers.
The former will apparently return only the DOMRects of the nodes appearing at the first level of the Range's content, while the latter will traverse whatever element the Range contains to find every text node.

I can understand both readings of the specs, the first step indeed asks that only the elements whose parents aren't selected in the Range participate in the DOMRectList. It can make sense that the inner text nodes would also get ignored in the second step. Also, I personally have no idea which behavior is "the best". So maybe this should be clarified here and then bugs opened on whichever implementation has to change.

I couldn't find a WPT test for this, but Chromium has a web-test that Firefox fails:
Screenshot of the getClientRects test ran on Firefox where "expected" and "actual" results differ in that "actual" doesn't render as many rects

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