[Webkit-unassigned] [Bug 157577] New: getBoundingClientRect should use the first rect if all rects are empty

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 11 11:57:27 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=157577

            Bug ID: 157577
           Summary: getBoundingClientRect should use the first rect if all
                    rects are empty
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: zcorpan at gmail.com
                CC: cdumez at apple.com

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160511/1e11eafd/attachment-0001.html>


More information about the webkit-unassigned mailing list