<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - getBoundingClientRect should use the first rect if all rects are empty"
href="https://bugs.webkit.org/show_bug.cgi?id=157577">157577</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>getBoundingClientRect should use the first rect if all rects are empty
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>WebKit Nightly Build
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>OS</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>HTML DOM
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zcorpan@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>cdumez@apple.com
</td>
</tr></table>
<p>
<div>
<pre>Test
<a href="http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4189">http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4189</a>
<!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:
<a href="https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect">https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect</a>
<a href="https://drafts.csswg.org/cssom-view/#dom-range-getboundingclientrect">https://drafts.csswg.org/cssom-view/#dom-range-getboundingclientrect</a>
Related Chromium issue:
<a href="https://bugs.chromium.org/p/chromium/issues/detail?id=606662#c9">https://bugs.chromium.org/p/chromium/issues/detail?id=606662#c9</a>
Recent spec change (because of the Chromium issue above)
<a href="https://github.com/w3c/csswg-drafts/commit/0e7a5cbdea19397086e9423b508fe6f41decdcec">https://github.com/w3c/csswg-drafts/commit/0e7a5cbdea19397086e9423b508fe6f41decdcec</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>