[csswg-drafts] [cssom-view] Range.getClientRects does not seem interoperable (#7155)

Kaiido has just created a new issue for https://github.com/w3c/csswg-drafts:

== [cssom-view] Range.getClientRects does not seem interoperable ==
Firefox seems to understand the specs of [`Range.getClientRects()`](https://drafts.csswg.org/cssom-view/#dom-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](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/fast/dom/Range/getClientRects.html;l=173?q=getClientRects&sq=&ss=chromium%2Fchromium%2Fsrc:third_party%2Fblink%2Fweb_tests%2Ffast%2Fdom%2FRange%2F) that Firefox fails:
<img width="1004" alt="Screenshot of the getClientRects test ran on Firefox where &quot;expected&quot; and &quot;actual&quot; results differ in that &quot;actual&quot; doesn't render as many rects" src="https://user-images.githubusercontent.com/7843391/158974536-e78864e4-5e59-439a-8a28-d47c5a84295e.png">



Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7155 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 18 March 2022 09:25:59 UTC