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

Ensure all iframes are sized correctly at creation #24677

Merged
merged 6 commits into from Nov 7, 2019

Conversation

@jdm
Copy link
Member

jdm commented Nov 6, 2019

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.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes
@highfive
Copy link

highfive commented Nov 6, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/htmliframeelement.rs, components/constellation/pipeline.rs, components/constellation/constellation.rs, components/script/script_thread.rs, components/script/dom/window.rs and 1 more
  • @cbrewster: components/constellation/pipeline.rs, components/constellation/constellation.rs, components/constellation/session_history.rs
  • @KiChjang: components/script/dom/htmliframeelement.rs, components/script/script_thread.rs, components/script/dom/window.rs, components/script_traits/lib.rs
  • @emilio: components/layout/display_list/builder.rs, components/layout/query.rs
@jdm
Copy link
Member Author

jdm commented Nov 6, 2019

@bors-servo try=wpt

@highfive
Copy link

highfive commented Nov 6, 2019

warning Warning warning

  • These commits modify layout and script code, but no tests are modified. Please consider adding a test!
bors-servo added a commit that referenced this pull request 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
@bors-servo
Copy link
Contributor

bors-servo commented Nov 6, 2019

Trying commit 91dfa35 with merge b09fd92...

@jdm jdm mentioned this pull request Nov 6, 2019
4 of 4 tasks complete
@jdm jdm changed the title Iframe sizing cleanup Ensure all iframes are sized correctly at creation Nov 6, 2019
@jdm
Copy link
Member Author

jdm commented Nov 6, 2019

@highfive highfive assigned asajeffrey and unassigned ferjm Nov 6, 2019
@@ -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.

Copy link
@jdm

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.

Copy link
@asajeffrey
@bors-servo
Copy link
Contributor

bors-servo commented Nov 6, 2019

💔 Test failed - linux-rel-css

@jdm jdm force-pushed the jdm:iframe-sizing-cleanup branch from 46f149e to 4578ae8 Nov 6, 2019
Copy link
Member

asajeffrey left a comment

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.

Copy link
@asajeffrey
@jdm
Copy link
Member Author

jdm commented Nov 6, 2019

@bors-servo r=asajeffrey

@bors-servo
Copy link
Contributor

bors-servo commented Nov 6, 2019

📌 Commit 4578ae8 has been approved by asajeffrey

@bors-servo
Copy link
Contributor

bors-servo commented Nov 7, 2019

Testing commit 4578ae8 with merge 2a43d5e...

bors-servo added a commit that referenced this pull request Nov 7, 2019
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
Copy link
Contributor

bors-servo commented Nov 7, 2019

💔 Test failed - status-taskcluster

@jdm
Copy link
Member Author

jdm commented Nov 7, 2019

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Nov 7, 2019

Testing commit 4578ae8 with merge 9a518cf...

bors-servo added a commit that referenced this pull request Nov 7, 2019
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
Copy link
Contributor

bors-servo commented Nov 7, 2019

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-community-tc, status-taskcluster
Approved by: asajeffrey
Pushing 9a518cf to master...

@bors-servo bors-servo merged commit 4578ae8 into servo:master Nov 7, 2019
2 of 3 checks passed
2 of 3 checks passed
Community-TC (pull_request) TaskGroup: failure
Details
Taskcluster (pull_request) TaskGroup: success
Details
homu Test successful
Details
jdm added a commit that referenced this pull request Dec 28, 2019
jdm added a commit to jdm/servo that referenced this pull request Jan 9, 2020
…effrey"

This reverts commit 9a518cf, reversing
changes made to a33d493.
jdm added a commit to jdm/servo that referenced this pull request Jan 9, 2020
…effrey"

This reverts commit 9a518cf, reversing
changes made to a33d493.
jdm added a commit that referenced this pull request Jan 15, 2020
jdm added a commit to jdm/servo that referenced this pull request Jan 21, 2020
bors-servo added a commit that referenced this pull request Jan 21, 2020
Revert #24677 due to frequent intermittent reftest failures.

This should fix #24726.
jdm added a commit to jdm/servo that referenced this pull request Feb 15, 2020
jdm added a commit to jdm/servo that referenced this pull request Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.