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 dissimilar-origin window.parent and window.top #15799
Conversation
highfive
commented
Mar 2, 2017
|
Heads up! This PR modifies the following files:
|
highfive
commented
Mar 2, 2017
|
r? @Ms2ger |
|
Accidentally fixes #11660. |
|
Is there anyone else who could review this? |
|
I will as soon as #15536 lands and this gets rebased on top of master. |
|
|
60de134
to
166eeea
|
@nox: ready when you are! |
|
|
166eeea
to
b2531fc
|
Rebased. |
8e2c901
to
2563a31
|
|
|
Some questions. |
| result_receiver.recv().expect("Failed to get frame id from constellation.") | ||
| } | ||
|
|
||
| fn remote_browsing_context(&self, |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
asajeffrey
Mar 17, 2017
Author
Member
Gets a browsing context for a pipeline in another script thread. I'll add a comment.
| Some(browsing_context) | ||
| } | ||
|
|
||
| fn local_browsing_context(&self, |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
asajeffrey
Mar 17, 2017
Author
Member
Gets a browsing context for a pipeline in this script thread. I'll add a comment.
| -> Root<BrowsingContext> | ||
| { | ||
| if let Some(browsing_context) = self.browsing_contexts.borrow().get(&frame_id) { | ||
| browsing_context.set_currently_active(&*window); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
asajeffrey
Mar 17, 2017
Author
Member
The browsing context already exists, but another window is currently active.
This comment has been minimized.
This comment has been minimized.
nox
Mar 17, 2017
Member
I don't get it. Why does getting a browsing context for a pipeline in this script thread should change the active window?
|
|
||
| FromScriptMsg::GetFrameId(pipeline_id, sender) => { | ||
| let result = self.pipelines.get(&pipeline_id).map(|pipeline| pipeline.frame_id); | ||
| let _ = sender.send(result); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| } | ||
| FromScriptMsg::GetParentInfo(pipeline_id, sender) => { | ||
| let result = self.pipelines.get(&pipeline_id).and_then(|pipeline| pipeline.parent_info); | ||
| let _ = sender.send(result); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thanks for the review! |
|
|
||
| FromScriptMsg::GetFrameId(pipeline_id, sender) => { | ||
| let result = self.pipelines.get(&pipeline_id).map(|pipeline| pipeline.frame_id); | ||
| let _ = sender.send(result); |
This comment has been minimized.
This comment has been minimized.
| } | ||
| FromScriptMsg::GetParentInfo(pipeline_id, sender) => { | ||
| let result = self.pipelines.get(&pipeline_id).and_then(|pipeline| pipeline.parent_info); | ||
| let _ = sender.send(result); |
This comment has been minimized.
This comment has been minimized.
| result_receiver.recv().expect("Failed to get frame id from constellation.") | ||
| } | ||
|
|
||
| fn remote_browsing_context(&self, |
This comment has been minimized.
This comment has been minimized.
asajeffrey
Mar 17, 2017
Author
Member
Gets a browsing context for a pipeline in another script thread. I'll add a comment.
| Some(browsing_context) | ||
| } | ||
|
|
||
| fn local_browsing_context(&self, |
This comment has been minimized.
This comment has been minimized.
asajeffrey
Mar 17, 2017
Author
Member
Gets a browsing context for a pipeline in this script thread. I'll add a comment.
| -> Root<BrowsingContext> | ||
| { | ||
| if let Some(browsing_context) = self.browsing_contexts.borrow().get(&frame_id) { | ||
| browsing_context.set_currently_active(&*window); |
This comment has been minimized.
This comment has been minimized.
asajeffrey
Mar 17, 2017
Author
Member
The browsing context already exists, but another window is currently active.
97bbf4f
to
2155054
|
Rebased. |
|
Squash it and r=me. |
2155054
to
6bcb5f6
|
Squashed. @bors-servo r=nox |
|
|
Implement dissimilar-origin window.parent and window.top <!-- Please describe your changes on the following line: --> This PR implements `window.parent` and `window.top` for dissimilar-origin windows. This PR builds on #15536, only the last commit is part of this PR. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #14996 and fix #11660. - [X] These changes do not require tests because there's already a parentage test in `mozilla/cross-origin-objects/cross-origin-objects.html`. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15799) <!-- Reviewable:end -->
|
|
asajeffrey commentedMar 2, 2017
•
edited by Ms2ger
This PR implements
window.parentandwindow.topfor dissimilar-origin windows.This PR builds on #15536, only the last commit is part of this PR.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsmozilla/cross-origin-objects/cross-origin-objects.html.This change is