servo: Merge #15016 - Documents now fully deactivate when a freeze message is sent (from prampey:doc-deactivate); r=cbrewster

<!-- Please describe your changes on the following line: -->
Documents now fully deactivate when a freeze message is sent

---
<!-- 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 #14906  (github issue number if applicable).

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

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 2fb9a345d6341f57ab4cfdd9a1ae68b2bbd5f9a2
This commit is contained in:
Prudhvi Rampey 2017-01-13 14:15:44 -08:00
parent 06f9b106e9
commit d6dbb327cf

View File

@ -1354,9 +1354,10 @@ impl ScriptThread {
/// Handles freeze message
fn handle_freeze_msg(&self, id: PipelineId) {
let window = self.documents.borrow().find_window(id);
if let Some(window) = window {
window.freeze();
let document = self.documents.borrow().find_document(id);
if let Some(document) = document {
document.window().freeze();
document.fully_deactivate();
return;
}
let mut loads = self.incomplete_loads.borrow_mut();