RESOLVED CONFIGURATION CHANGED 157577
getBoundingClientRect should use the first rect if all rects are empty
https://bugs.webkit.org/show_bug.cgi?id=157577
Summary getBoundingClientRect should use the first rect if all rects are empty
Simon Pieters (:zcorpan)
Reported 2016-05-11 11:57:27 PDT
Test http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4189 <!DOCTYPE html> <div id=x>123</div> <script> var r = new Range(); r.setStart(x.firstChild, 1); r.setEnd(x.firstChild, 1); w(r.getBoundingClientRect()); </script> Actual result: log: object "[object ClientRect]" (6 props: top=0, right=0, bottom=0, left=0...) Expected result: log: object "[object ClientRect]" (6 props: top=8, right=16, bottom=26, left=16...) (this is what I get in Chromium, but actual numbers might depend on fonts etc.) Spec: https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect https://drafts.csswg.org/cssom-view/#dom-range-getboundingclientrect Related Chromium issue: https://bugs.chromium.org/p/chromium/issues/detail?id=606662#c9 Recent spec change (because of the Chromium issue above) https://github.com/w3c/csswg-drafts/commit/0e7a5cbdea19397086e9423b508fe6f41decdcec
Attachments
Ahmad Saleem
Comment 1 2022-07-28 13:05:20 PDT
Safari 15.6 results following: log: object "[object DOMRect]" (9 props: x=16, y=8, width=0, height=18...) Firefox Nightly 105: log: object "[object DOMRect]" (9 props: x=16, y=9.600006103515625, width=0, height=16...) Chrome Canary 106: log: object "[object DOMRect]" (9 props: x=16, y=8, width=0, height=18.5...) r _____________ I think this can be marked as "RESOLVED CONFIGURATION CHANGED", since now Safari does not show [0] etc. in the attached test case and work as other browsers (with slight differences). Thanks!
Note You need to log in before you can comment on or make changes to this bug.