diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-11-07 07:40:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-07 07:40:29 -0500 |
commit | 9a518cf7979b79b34611135d09c1dd0a96945255 (patch) | |
tree | 9ffeb03a554620b6741494bc80fc77596195a649 /components/script/script_thread.rs | |
parent | a33d493a4ff6f8a629a9b82202c49c41ecbefa49 (diff) | |
parent | 4578ae834c286570361d8cc6c1322b3acd3b7751 (diff) | |
download | servo-9a518cf7979b79b34611135d09c1dd0a96945255.tar.gz servo-9a518cf7979b79b34611135d09c1dd0a96945255.zip |
Auto merge of #24677 - jdm:iframe-sizing-cleanup, r=asajeffrey
Ensure all iframes are sized correctly at creation
Following in the path of #22395, these commits serve several purposes:
* prevent layout instability early during iframe loads caused by a succession of resize events
* reduce the complexity of determining what actual DPI and initial window size values are being used at startup
* ensure that all documents have a correct initial viewport size at creation
These changes fix problems that were exposed by the changes in #24462 but are independent of that PR.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 6a7a69651e7..191df335ec5 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -2392,6 +2392,7 @@ impl ScriptThread { load_data.url.clone(), ), layout_is_busy: layout_is_busy.clone(), + window_size, }); // Pick a layout thread, any layout thread @@ -3696,6 +3697,15 @@ impl ScriptThread { }; let window = document.window(); + if window.window_size() == new_size { + return; + } + debug!( + "resizing pipeline {:?} from {:?} to {:?}", + pipeline_id, + window.window_size(), + new_size + ); window.set_window_size(new_size); window.force_reflow(ReflowGoal::Full, ReflowReason::WindowResize); |