Bug 29760 - Implement CSSOM Range.getClientRects/getBoundingClientRect
Summary: Implement CSSOM Range.getClientRects/getBoundingClientRect
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-25 22:19 PDT by Sam Weinig
Modified: 2009-09-27 16:59 PDT (History)
0 users

See Also:


Attachments
WIP Patch (9.75 KB, patch)
2009-09-25 22:19 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
patch (90.44 KB, patch)
2009-09-27 14:54 PDT, Sam Weinig
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2009-09-25 22:19:15 PDT
Created attachment 40161 [details]
WIP Patch

We should implement CSSOM Range.getClientRects/getBoundingClientRect (http://www.w3.org/TR/2009/WD-cssom-view-20090804/) to complement Element.getClientRects/getBoundingClientRect.
Comment 1 Sam Weinig 2009-09-25 22:20:32 PDT
The attached patch works, but I am not happy with how I determined if the parent node was in the Range.  It obviously also needs tests.
Comment 2 Sam Weinig 2009-09-27 14:54:53 PDT
Created attachment 40207 [details]
patch
Comment 3 mitz 2009-09-27 15:03:30 PDT
Comment on attachment 40207 [details]
patch

> +    IntRect result = quads[0].enclosingBoundingBox();
> +    for (size_t i = 1; i < quads.size(); ++i)
> +        result.unite(quads[i].enclosingBoundingBox());

There is no need to special-case the first rect.
Comment 4 Sam Weinig 2009-09-27 16:59:31 PDT
Landed in r48806.