Bug 171393 - Range.getClientRects() / getBoundingClientRect() should return DOMRect types
Summary: Range.getClientRects() / getBoundingClientRect() should return DOMRect types
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://drafts.csswg.org/cssom-view/#...
Keywords: WebExposed
Depends on:
Blocks: 171412 171418
  Show dependency treegraph
 
Reported: 2017-04-27 14:25 PDT by Chris Dumez
Modified: 2017-04-28 14:16 PDT (History)
12 users (show)

See Also:


Attachments
WIP Patch (5.06 KB, patch)
2017-04-27 16:43 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (9.25 KB, patch)
2017-04-27 16:54 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (14.67 KB, patch)
2017-04-28 07:39 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (14.80 KB, patch)
2017-04-28 08:25 PDT, Chris Dumez
simon.fraser: review+
simon.fraser: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2017-04-27 14:25:42 PDT
Range.getClientRects() / getBoundingClientRect() should return DOMRect types:
- https://drafts.csswg.org/cssom-view/#extensions-to-the-range-interface
Comment 1 Chris Dumez 2017-04-27 16:43:19 PDT
Created attachment 308476 [details]
WIP Patch
Comment 2 Chris Dumez 2017-04-27 16:54:46 PDT
Created attachment 308478 [details]
Patch
Comment 3 Sam Weinig 2017-04-28 06:11:32 PDT
Comment on attachment 308478 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=308478&action=review

> Source/WebCore/dom/DOMRect.h:44
> +    static Vector<Ref<DOMRect>> createVector(const Vector<FloatQuad>&);

I think its a little weird to have a "create" function, even one with a suffix, as a class function if it doesn't return the class (or a Ref<> of said class).  I think this would be clearer as a free function.

> Source/WebCore/dom/Range.h:-38
> -class ClientRectList;

Are there any remaining uses of ClientRect or ClientRectList? Can we remove them?
Comment 4 Chris Dumez 2017-04-28 06:41:55 PDT
(In reply to Sam Weinig from comment #3)
> Comment on attachment 308478 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=308478&action=review
> 
> > Source/WebCore/dom/DOMRect.h:44
> > +    static Vector<Ref<DOMRect>> createVector(const Vector<FloatQuad>&);
> 
> I think its a little weird to have a "create" function, even one with a
> suffix, as a class function if it doesn't return the class (or a Ref<> of
> said class).  I think this would be clearer as a free function.

Ok, will do.

> 
> > Source/WebCore/dom/Range.h:-38
> > -class ClientRectList;
> 
> Are there any remaining uses of ClientRect or ClientRectList? Can we remove
> them?

Yes and yes. See related radars. I am doing this gradually.
Comment 5 Chris Dumez 2017-04-28 07:39:25 PDT
Created attachment 308529 [details]
Patch
Comment 6 Chris Dumez 2017-04-28 08:25:56 PDT
Created attachment 308530 [details]
Patch
Comment 7 Chris Dumez 2017-04-28 08:35:12 PDT
(In reply to Chris Dumez from comment #4)
> (In reply to Sam Weinig from comment #3)
> > Comment on attachment 308478 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=308478&action=review
> > 
> > > Source/WebCore/dom/DOMRect.h:44
> > > +    static Vector<Ref<DOMRect>> createVector(const Vector<FloatQuad>&);
> > 
> > I think its a little weird to have a "create" function, even one with a
> > suffix, as a class function if it doesn't return the class (or a Ref<> of
> > said class).  I think this would be clearer as a free function.
> 
> Ok, will do.
> 
> > 
> > > Source/WebCore/dom/Range.h:-38
> > > -class ClientRectList;
> > 
> > Are there any remaining uses of ClientRect or ClientRectList? Can we remove
> > them?
> 
> Yes and yes. See related radars. I am doing this gradually.

I meant related bugs:
https://bugs.webkit.org/show_bug.cgi?id=171412
https://bugs.webkit.org/show_bug.cgi?id=171393
Comment 8 Simon Fraser (smfr) 2017-04-28 14:14:36 PDT
Comment on attachment 308530 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=308530&action=review

> Source/WebCore/WebCore.xcodeproj/project.pbxproj:3325
>  		83120C711C56F3FB001CB112 /* HTMLDataElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 834B86A71C56E83A00F3F0E3 /* HTMLDataElement.h */; };
> +		83149FF61EB38B3700089665 /* DOMRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83149FF51EB38B1200089665 /* DOMRect.cpp */; };

Should probably run sort-Xcode-project-file
Comment 9 Chris Dumez 2017-04-28 14:16:35 PDT
Committed r215946: <http://trac.webkit.org/changeset/215946>