Auto merge of #23967 - gterzian:fix_double_transplant, r=asajeffrey

Remove redundant windowproxy transplanting

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

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/23967)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-08-14 16:13:16 -04:00 committed by GitHub
commit 91469aa472
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -603,12 +603,23 @@ impl WindowProxy {
}
pub fn set_currently_active(&self, window: &Window) {
let globalscope = window.upcast();
let globalscope = window.upcast::<GlobalScope>();
let dest_pipeline_id = globalscope.pipeline_id();
if let Some(pipeline_id) = self.currently_active() {
if pipeline_id == dest_pipeline_id {
return debug!(
"Attempt to set the currently active window to the currently active window."
);
}
}
self.set_window(&*globalscope, &PROXY_HANDLER);
self.currently_active.set(Some(globalscope.pipeline_id()));
}
pub fn unset_currently_active(&self) {
if self.currently_active().is_none() {
return debug!("Attempt to unset the currently active window on a windowproxy that does not have one.");
}
let globalscope = self.global();
let window = DissimilarOriginWindow::new(&*globalscope, self);
self.set_window(&*window.upcast(), &XORIGIN_PROXY_HANDLER);