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

Remove redundant windowproxy transplanting #23967

Merged
merged 1 commit into from Aug 14, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

windowproxy: prevent unnecessary calls to set_window

  • Loading branch information
gterzian committed Aug 14, 2019
commit 9acf3f6d4d8630e1b824a7cd652827ba1159e081
@@ -602,12 +602,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);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.