Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upEnsure all iframes are sized correctly at creation #24677
Conversation
highfive
commented
Nov 6, 2019
|
Heads up! This PR modifies the following files:
|
|
@bors-servo try=wpt |
highfive
commented
Nov 6, 2019
Iframe sizing cleanup 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
|
r? @asajeffrey |
| @@ -173,6 +172,13 @@ impl HTMLIFrameElement { | |||
| replace: replace, | |||
| }; | |||
|
|
|||
| let window_size = WindowSizeData { | |||
| initial_viewport: window | |||
| .inner_window_dimensions_query(browsing_context_id) | |||
This comment has been minimized.
This comment has been minimized.
jdm
Nov 6, 2019
Author
Member
Note: this new query is subtly more correct than the previous use of (effectively) getClientBoundingRect. That query includes the margin/padding/borders that exist on the iframe, so by default that's an extra 2px on every side. The actual viewport for the window should not include these, hence the new layout query.
This comment has been minimized.
This comment has been minimized.
|
|
…hat isn't resized.
|
LGTM |
| @@ -173,6 +172,13 @@ impl HTMLIFrameElement { | |||
| replace: replace, | |||
| }; | |||
|
|
|||
| let window_size = WindowSizeData { | |||
| initial_viewport: window | |||
| .inner_window_dimensions_query(browsing_context_id) | |||
This comment has been minimized.
This comment has been minimized.
|
@bors-servo 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
|
|
|
@bors-servo retry |
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
|
|
jdm commentedNov 6, 2019
Following in the path of #22395, these commits serve several purposes:
These changes fix problems that were exposed by the changes in #24462 but are independent of that PR.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors