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

Transplant WindowProxy objects #13608

Closed
asajeffrey opened this issue Oct 6, 2016 · 3 comments · Fixed by #15120
Closed

Transplant WindowProxy objects #13608

asajeffrey opened this issue Oct 6, 2016 · 3 comments · Fixed by #15120
Assignees
Labels
A-content/script Related to the script thread

Comments

@asajeffrey
Copy link
Member

As part of #633 we should use JS_TransplantObject to transplant window proxy objects when an iframe navigates. At the moment, if a same-origin iframe stores its window in its parent, then same-origin navigates, the window object in the new document is different from the old one.

@asajeffrey
Copy link
Member Author

cc @jdm @bholley

@asajeffrey asajeffrey added the A-content/script Related to the script thread label Oct 6, 2016
@asajeffrey asajeffrey self-assigned this Oct 6, 2016
@asajeffrey
Copy link
Member Author

This may have an impact on XOWs, so cc @avadacatavra

@asajeffrey
Copy link
Member Author

Should be dealt with as part of #14843.

bors-servo pushed a commit that referenced this issue Jan 27, 2017
…xts, r=jdm

Allow windows to share browsing contexts.

<!-- Please describe your changes on the following line: -->

This PR allows different `Window` objects in the same browsing context to share a `BrowsingContext` object.

SpiderMonkey requires a `WindowProxy` object to be in the same compartment as its `Window`, so when a `WindowProxy` changes `Window`, we have to brain-transplant it. In turn this requires the reflector of a `BrowsingContext` to be mutable.

---
<!-- 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 #13608 and #14843
- [X] These changes do not require tests because an existing test catches this (`/html/browsers/the-window-object/Window-document.html` is now `PASS`)

<!-- 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/15120)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Jan 29, 2017
…xts, r=jdm

Allow windows to share browsing contexts.

<!-- Please describe your changes on the following line: -->

This PR allows different `Window` objects in the same browsing context to share a `BrowsingContext` object.

SpiderMonkey requires a `WindowProxy` object to be in the same compartment as its `Window`, so when a `WindowProxy` changes `Window`, we have to brain-transplant it. In turn this requires the reflector of a `BrowsingContext` to be mutable.

---
<!-- 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 #13608 and #14843
- [X] These changes do not require tests because an existing test catches this (`/html/browsers/the-window-object/Window-document.html` is now `PASS`)

<!-- 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/15120)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-content/script Related to the script thread
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant