WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 34239
Implement CSSOM Range.getClientRects for collapsed selections
https://bugs.webkit.org/show_bug.cgi?id=34239
Summary
Implement CSSOM Range.getClientRects for collapsed selections
Julie Parent
Reported
2010-01-27 20:09:45 PST
The spec used to say to return null when the endpoints were the same, but now has been updated to handle this case. See
http://www.w3.org/TR/2009/WD-cssom-view-20090804/#extensions-to-the-range-interface
for full details. Example:
http://www.plexode.com/cgi-bin/eval3.py#ht=%3Cdiv%20contentEditable%3E%3Cdiv%20id%3D'bar'%3Efooo%3C%2Fdiv%3E%3C%2Fdiv%3E&ohh=1&ohj=1&jt=var%20bar%20%3D%20gebi('bar')%3B%0Avar%20range%20%3D%20document.createRange()%3B%0Arange.setStart(bar.firstChild%2C%200)%3B%0Arange.setEnd(bar.firstChild%2C%200)%3B%0A%0Avar%20rects%20%3D%20range.getClientRects()%3B%0Avar%20rect%20%3D%20rects.item(0)%3B%0A%0Aalert('top%3A%20'%20%2B%20rect.top%20%2B%20'%20bottom%3A%20'%20%2Brect.bottom%20%2B%20'%20left%3A%20'%20%2B%20rect.left%20%2B%20'%20right%3A%20'%20%2B%20rect.right%20%2B%20'%20width%3A%20'%20%2Brect.width%20%2B%20'%20height%3A%20'%20%2B%20rect.height)%3B&ojh=1&ojj=0&ms=100&oth=0&otj=0&cex=1
WebKit returns null, Firefox 3.7a returns a rect with width = 0 and height = line height (and appropriate top, left, right, bottom values as well).
Attachments
Patch
(5.62 KB, patch)
2010-01-28 23:09 PST
,
Ojan Vafai
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Ojan Vafai
Comment 1
2010-01-28 23:09:11 PST
Created
attachment 47682
[details]
Patch
Ojan Vafai
Comment 2
2010-01-31 16:54:56 PST
Committed
r54117
: <
http://trac.webkit.org/changeset/54117
>
Simon Fraser (smfr)
Comment 3
2011-06-10 14:11:06 PDT
Why did this alter the behavior of absoluteQuadsForRange() but not absoluteRectsForRange()? Now one uses !isEmpty(), and the other uses if (r.height()), which is inconsistent.
Simon Fraser (smfr)
Comment 4
2011-06-10 14:16:48 PDT
Bug 62478
exists for that.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug