Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed

Conversation

@jaysonsantos
Copy link

jaysonsantos commented Apr 24, 2016

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

highfive commented Apr 24, 2016

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

highfive commented Apr 24, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/webidls/Range.webidl, components/script/dom/range.rs
@jaysonsantos jaysonsantos force-pushed the jaysonsantos:range-get-bounding-client-rect branch from c118872 to 3e4a06e Apr 26, 2016
@Manishearth
Copy link
Member

Manishearth commented Apr 29, 2016

r? @KiChjang

might not get time for this till next week

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

frewsxcv commented Apr 29, 2016

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
Member

KiChjang commented Apr 29, 2016

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

@jaysonsantos
Copy link
Author

jaysonsantos commented May 1, 2016

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
Copy link
Member

KiChjang commented May 2, 2016

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 jaysonsantos:range-get-bounding-client-rect branch from 5581d76 to 4f922fe May 12, 2016
@highfive
Copy link

highfive commented May 12, 2016

New code was committed to pull request.

@jdm
Copy link
Member

jdm commented May 12, 2016

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

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

highfive commented May 12, 2016

New code was committed to pull request.

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

highfive commented May 13, 2016

New code was committed to pull request.

@bors-servo
Copy link
Contributor

bors-servo commented Jun 3, 2016

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

@KiChjang
Copy link
Member

KiChjang commented Jun 5, 2016

@jaysonsantos Is this still being worked on?

@jaysonsantos
Copy link
Author

jaysonsantos commented Jun 8, 2016

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
Copy link
Member

KiChjang commented Jun 8, 2016

Okay, no problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

7 participants
You can’t perform that action at this time.