Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement Document#elementsFromPoint #10034
Conversation
highfive
commented
Mar 16, 2016
|
Good job! I've left a few comments :) Let's see if there's any test for that, @bors-servo: try -S-awaiting-review +S-needs-code-changes Review status: 0 of 4 files reviewed at latest revision, 4 unresolved discussions. components/layout/query.rs, line 101 [r1] (raw file): components/script/dom/document.rs, line 1498 [r1] (raw file): components/script/dom/document.rs, line 2610 [r1] (raw file): self.elements_from_point().iter().flat_map(|addr| {
let node = node::from_untrusted_node_address(js_runtime, addr);
node.downcast::<Element>()
}).collect();Should be enough, the parent of a node that is not an element should already be in the list after it. Your code might unexpectedly panic depending on which point are you using as input. components/script/dom/document.rs, line 2624 [r1] (raw file): Can't we do: if elements.last() != Some(root_element) {
elements.push(root_element);
}Or Comments from the review on Reviewable.io |
Implement Document#elementsFromPoint Fixes #9859. I'm trying to implement Document#elementsFromPoint, which I need to reuse the `get_nodes_under_mouse` and `mouse_over` function which have been removed a days ago in #9715. So I added it back while I'm not sure if my implementation is correct. Any advice will be greatly appreciated. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10034) <!-- Reviewable:end -->
|
|
|
Looks like the non-windows platforms had no unexpected test results. |
|
We are apparently ignoring the tests in tests/wpt/web-platform-tests/cssom-view/. Could you add that directory to tests/wpt/include.ini? |
|
Review status: 0 of 4 files reviewed at latest revision, 4 unresolved discussions. components/script/dom/document.rs, line 1498 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: 0 of 4 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. components/script/dom/document.rs, line 1498 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: 0 of 4 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. components/script/dom/document.rs, line 1498 [r1] (raw file): Comments from the review on Reviewable.io |
|
Left a few more comments, let's see how the cssom tests go! @bors-servo: try -S-awaiting-review +S-needs-code-changes Reviewed 2 of 4 files at r1, 3 of 3 files at r2. components/script/dom/document.rs, line 2612 [r2] (raw file): I don't know if we include text nodes in the tests/wpt/include.ini, line 58 [r2] (raw file): Comments from the review on Reviewable.io |
Implement Document#elementsFromPoint Fixes #9859. I'm trying to implement Document#elementsFromPoint, which I need to reuse the `get_nodes_under_mouse` and `mouse_over` function which have been removed a days ago in #9715. So I added it back while I'm not sure if my implementation is correct. Any advice will be greatly appreciated. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10034) <!-- Reviewable:end -->
|
|
Heh, that's it, we can't assume every node returned by |
|
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. components/script/dom/document.rs, line 2612 [r2] (raw file): Comments from the review on Reviewable.io |
|
components/script/dom/document.rs, line 2612 [r2] (raw file):
How do I make Comments from the review on Reviewable.io |
|
I think the problem is the unanswered question. |
|
@bors-servo r=emilio |
|
|
Implement Document#elementsFromPoint Fixes #9859. I'm trying to implement Document#elementsFromPoint, which I need to reuse the `get_nodes_under_mouse` and `mouse_over` function which have been removed a days ago in #9715. So I added it back while I'm not sure if my implementation is correct. Any advice will be greatly appreciated. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10034) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
Implement Document#elementsFromPoint Fixes #9859. I'm trying to implement Document#elementsFromPoint, which I need to reuse the `get_nodes_under_mouse` and `mouse_over` function which have been removed a days ago in #9715. So I added it back while I'm not sure if my implementation is correct. Any advice will be greatly appreciated. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10034) <!-- Reviewable:end -->
|
@bors-servo retry |
Implement Document#elementsFromPoint Fixes #9859. I'm trying to implement Document#elementsFromPoint, which I need to reuse the `get_nodes_under_mouse` and `mouse_over` function which have been removed a days ago in #9715. So I added it back while I'm not sure if my implementation is correct. Any advice will be greatly appreciated. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10034) <!-- Reviewable:end -->
|
|
|
Thanks, Servo team I'll proceed with #.10093 |
…ble-test, r=nox Fix Document#elementsFromPoint no viewport available test Fixes #10093 and improves #10034. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10426) <!-- Reviewable:end -->
rilut commentedMar 16, 2016
Fixes #9859.
I'm trying to implement Document#elementsFromPoint, which I need to reuse the
get_nodes_under_mouseandmouse_overfunction which have been removed a days ago in #9715. So I added it back while I'm not sure if my implementation is correct. Any advice will be greatly appreciated.This change is