Repository navigation
Implement dissimilar-origin window.parent and window.top - #15799
Conversation
|
Heads up! This PR modifies the following files:
|
|
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. |
|
☔ The latest upstream changes (presumably #15536) made this pull request unmergeable. Please resolve the merge conflicts. |
60de134 to
166eeea
Compare
|
@nox: ready when you are! |
|
☔ The latest upstream changes (presumably #15679) made this pull request unmergeable. Please resolve the merge conflicts. |
166eeea to
b2531fc
Compare
|
Rebased. |
8e2c901 to
2563a31
Compare
|
☔ The latest upstream changes (presumably #15906) made this pull request unmergeable. Please resolve the merge conflicts. |
| result_receiver.recv().expect("Failed to get frame id from constellation.") | ||
| } | ||
|
|
||
| fn remote_browsing_context(&self, |
There was a problem hiding this comment.
Gets a browsing context for a pipeline in another script thread. I'll add a comment.
| Some(browsing_context) | ||
| } | ||
|
|
||
| fn local_browsing_context(&self, |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
The browsing context already exists, but another window is currently active.
There was a problem hiding this comment.
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); |
| } | ||
| FromScriptMsg::GetParentInfo(pipeline_id, sender) => { | ||
| let result = self.pipelines.get(&pipeline_id).and_then(|pipeline| pipeline.parent_info); | ||
| let _ = sender.send(result); |
asajeffrey
left a comment
There was a problem hiding this comment.
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); |
| } | ||
| FromScriptMsg::GetParentInfo(pipeline_id, sender) => { | ||
| let result = self.pipelines.get(&pipeline_id).and_then(|pipeline| pipeline.parent_info); | ||
| let _ = sender.send(result); |
| result_receiver.recv().expect("Failed to get frame id from constellation.") | ||
| } | ||
|
|
||
| fn remote_browsing_context(&self, |
There was a problem hiding this comment.
Gets a browsing context for a pipeline in another script thread. I'll add a comment.
| Some(browsing_context) | ||
| } | ||
|
|
||
| fn local_browsing_context(&self, |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
The browsing context already exists, but another window is currently active.
97bbf4f to
2155054
Compare
|
Rebased. |
|
Squash it and r=me. |
2155054 to
6bcb5f6
Compare
|
Squashed. @bors-servo r=nox |
|
📌 Commit 6bcb5f6 has been approved by |
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 -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev |
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