Bug 29760

Summary: Implement CSSOM Range.getClientRects/getBoundingClientRect
Product: WebKit Reporter: Sam Weinig <sam>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
WIP Patch
none
patch mitz: review+

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.