Skip to content

Implement Range.getClientRects and Range.getBoudingClientRect (Work in progress) - #10828

Closed
jaysonsantos wants to merge 8 commits into
servo:masterfrom
jaysonsantos:range-get-bounding-client-rect
Closed

jaysonsantos wants to merge 8 commits into
servo:masterfrom
jaysonsantos:range-get-bounding-client-rect

Conversation

@jaysonsantos

Copy link
Copy Markdown

Hi guys, I did this pull request so you can check if I am heading on the right track.
This should fix #8982 when done.


This change is Reviewable

@highfive

Copy link
Copy Markdown

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon.

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/webidls/Range.webidl, components/script/dom/range.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 24, 2016
@jaysonsantos
jaysonsantos force-pushed the range-get-bounding-client-rect branch from c118872 to 3e4a06e Compare April 26, 2016 13:03
@Manishearth

Copy link
Copy Markdown
Member

r? @KiChjang

might not get time for this till next week

@highfive highfive assigned KiChjang and unassigned Manishearth Apr 29, 2016
@frewsxcv

Copy link
Copy Markdown
Contributor

components/script/dom/range.rs, line 910 [r13] (raw file):
personally, I'd do:

let node = match node {
    Some(node) => node,
    None => return;
};

...

So it's not one giant indented block.


Comments from Reviewable

@KiChjang

Copy link
Copy Markdown
Contributor

Reviewed 1 of 2 files at r1, 1 of 2 files at r8, 1 of 2 files at r11, 1 of 1 files at r12, 1 of 1 files at r14.
Review status: all files reviewed at latest revision, 9 unresolved discussions, some commit checks failed.


components/script/dom/range.rs, line 30 [r14] (raw file):
nit: Remove the braces.


components/script/dom/range.rs, line 909 [r14] (raw file):
Is the third &Range argument necessary? You can simply use self.


components/script/dom/range.rs, line 920 [r14] (raw file):
This is very imperative-styled, we should instead make a new method in DOMRectList that returns its underlying Vec<JS<DOMRect>> and use an iterator over this vec instead.


components/script/dom/range.rs, line 929 [r14] (raw file):
Are these 3 lines necessary?


components/script/dom/range.rs, line 978 [r14] (raw file):
Step annotations here would be nice.


components/script/dom/range.rs, line 979 [r14] (raw file):

Otherwise, return a static DOMRect object describing the smallest rectangle that includes the first rectangle in list and all of the remaining rectangles of which the height or width is not zero.

This does not look like it is following the spec.


tests/wpt/web-platform-tests/dom/ranges/Range-getBoundingClientRect.html, line 17 [r14] (raw file):
Are these random values or magic values?


tests/wpt/web-platform-tests/dom/ranges/Range-getClientRects.html, line 20 [r14] (raw file):
Same here, random or magic?


Comments from Reviewable

@KiChjang KiChjang added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 29, 2016
@jaysonsantos

Copy link
Copy Markdown
Author

Review status: all files reviewed at latest revision, 9 unresolved discussions, some commit checks failed.


components/script/dom/range.rs, line 909 [r14] (raw file):
It will say that I need to move self to be able to access it.


components/script/dom/range.rs, line 929 [r14] (raw file):
The same, the compiler will say that I need to move to use it here.


components/script/dom/range.rs, line 979 [r14] (raw file):
No, this is the latest point that I will look into


tests/wpt/web-platform-tests/dom/ranges/Range-getBoundingClientRect.html, line 17 [r14] (raw file):
I looked on the return values of chrome. Do you have any suggestions to make it?


tests/wpt/web-platform-tests/dom/ranges/Range-getClientRects.html, line 20 [r14] (raw file):
The same as the other


Comments from Reviewable

@KiChjang

KiChjang commented May 2, 2016

Copy link
Copy Markdown
Contributor

Review status: all files reviewed at latest revision, 9 unresolved discussions, some commit checks failed.


components/script/dom/range.rs, line 909 [r14] (raw file):
Then i don't see the reason why this is an inner function. You can move this outside and take a &self parameter.


Comments from Reviewable

@jaysonsantos
jaysonsantos force-pushed the range-get-bounding-client-rect branch from 5581d76 to 4f922fe Compare May 12, 2016 17:31
@highfive highfive removed the S-needs-code-changes Changes have not yet been made that were requested by a reviewer. label May 12, 2016
@highfive

Copy link
Copy Markdown

New code was committed to pull request.

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label May 12, 2016
@jdm

jdm commented May 12, 2016

Copy link
Copy Markdown
Member

Looks like that rebase didn't work quite right...

@jaysonsantos
jaysonsantos force-pushed the range-get-bounding-client-rect branch from 4f922fe to 68e33c0 Compare May 12, 2016 18:11
@highfive

Copy link
Copy Markdown

New code was committed to pull request.

@jaysonsantos
jaysonsantos force-pushed the range-get-bounding-client-rect branch from 68e33c0 to 523519d Compare May 13, 2016 19:13
@highfive

Copy link
Copy Markdown

New code was committed to pull request.

@KiChjang KiChjang added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels May 17, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #11496) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Jun 3, 2016
@KiChjang

KiChjang commented Jun 5, 2016

Copy link
Copy Markdown
Contributor

@jaysonsantos Is this still being worked on?

@jaysonsantos

Copy link
Copy Markdown
Author

Hey @KiChjang sorry for the late response. I wasn't able to understand the architecture of servo and the specs and I didn't have time these days. I think it is better to let someone that already know it and I will get an easier issue later.

@KiChjang

KiChjang commented Jun 8, 2016

Copy link
Copy Markdown
Contributor

Okay, no problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-needs-code-changes Changes have not yet been made that were requested by a reviewer. S-needs-rebase There are merge conflict errors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[devtools.html] Range.getBoundingClientRect support

7 participants