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

Initialize iframe viewport immediately #22395

Merged
merged 5 commits into from Dec 18, 2018
Merged

Conversation

@jdm
Copy link
Member

jdm commented Dec 9, 2018

This is probably a significant cause of unstable test results, and it finally bothered me enough to fix it. The solution isn't great for performance (a sync layout query every time a iframe is added to a document), but performance needs to follow correctness.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #14364 and fix #15689 and fix #15688.
  • There are tests for these changes

This change is Reviewable

@highfive
Copy link

highfive commented Dec 9, 2018

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/htmliframeelement.rs, components/script/dom/document.rs, components/constellation/pipeline.rs, components/script/dom/windowproxy.rs, components/constellation/constellation.rs and 5 more
  • @cbrewster: components/constellation/pipeline.rs, components/constellation/constellation.rs, components/constellation/browsingcontext.rs
  • @paulrouget: components/constellation/pipeline.rs, components/compositing/lib.rs, components/constellation/constellation.rs, components/constellation/browsingcontext.rs
  • @KiChjang: components/script/dom/htmliframeelement.rs, components/script/dom/document.rs, components/script/dom/windowproxy.rs, components/script_traits/lib.rs, components/script/dom/htmlimageelement.rs and 3 more
@highfive
Copy link

highfive commented Dec 9, 2018

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@jdm
Copy link
Member Author

jdm commented Dec 9, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Dec 9, 2018

Trying commit af4cc5c with merge a39bbff...

bors-servo added a commit that referenced this pull request Dec 9, 2018
WIP initialize iframe viewport immediately

This is probably a significant cause of unstable test results, and it finally bothered me enough to fix it. The solution isn't great for performance (a sync layout query every time a iframe is added to a document), but performance needs to follow correctness.

---
- [x] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [x] These changes fix #14364 and fix #15689 and fix #15688.
- [x] There are tests for these changes
@bors-servo
Copy link
Contributor

bors-servo commented Dec 9, 2018

💔 Test failed - linux-rel-wpt

@jdm jdm force-pushed the jdm:initial-iframe-size branch from af4cc5c to c8fb961 Dec 9, 2018
@highfive highfive removed the S-tests-failed label Dec 9, 2018
@jdm
Copy link
Member Author

jdm commented Dec 9, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Dec 9, 2018

Trying commit c8fb961 with merge 4e0f3f7...

bors-servo added a commit that referenced this pull request Dec 9, 2018
WIP initialize iframe viewport immediately

This is probably a significant cause of unstable test results, and it finally bothered me enough to fix it. The solution isn't great for performance (a sync layout query every time a iframe is added to a document), but performance needs to follow correctness.

---
- [x] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [x] These changes fix #14364 and fix #15689 and fix #15688.
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22395)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 9, 2018

💔 Test failed - linux-rel-wpt

@jdm
Copy link
Member Author

jdm commented Dec 10, 2018

Who could have foreseen that invoking layout inside of a method that can be called while the document is in an unstable state (ie. from the Node::bind_to_tree callback, which is invoked during the Node::insert algorithm) could lead to layout's head exploding?

@jdm
Copy link
Member Author

jdm commented Dec 10, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Dec 10, 2018

Trying commit fc41ddc with merge f9c115f...

bors-servo added a commit that referenced this pull request Dec 10, 2018
WIP initialize iframe viewport immediately

This is probably a significant cause of unstable test results, and it finally bothered me enough to fix it. The solution isn't great for performance (a sync layout query every time a iframe is added to a document), but performance needs to follow correctness.

---
- [x] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [x] These changes fix #14364 and fix #15689 and fix #15688.
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22395)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 10, 2018

💔 Test failed - linux-rel-css

@jdm
Copy link
Member Author

jdm commented Dec 10, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Dec 10, 2018

Trying commit 9bee8ea with merge 90234c4...

bors-servo added a commit that referenced this pull request Dec 10, 2018
WIP initialize iframe viewport immediately

This is probably a significant cause of unstable test results, and it finally bothered me enough to fix it. The solution isn't great for performance (a sync layout query every time a iframe is added to a document), but performance needs to follow correctness.

---
- [x] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [x] These changes fix #14364 and fix #15689 and fix #15688.
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22395)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 10, 2018

💔 Test failed - linux-rel-css

@jdm jdm force-pushed the jdm:initial-iframe-size branch from 9bee8ea to 1655386 Dec 10, 2018
bors-servo added a commit that referenced this pull request Dec 18, 2018
Initialize iframe viewport immediately

This is probably a significant cause of unstable test results, and it finally bothered me enough to fix it. The solution isn't great for performance (a sync layout query every time a iframe is added to a document), but performance needs to follow correctness.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #14364 and fix #15689 and fix #15688.
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22395)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 18, 2018

💔 Test failed - status-taskcluster

@CYBAI
Copy link
Collaborator

CYBAI commented Dec 18, 2018

@bors-servo retry

{
  "status": "TIMEOUT",
  "group": "default",
  "message": null,
  "stack": null,
  "subtest": null,
  "test": "/html/semantics/embedded-content/the-iframe-element/same_origin_parentage.html",
  "line": 135833,
  "action": "test_result",
  "expected": "OK"
}
@bors-servo
Copy link
Contributor

bors-servo commented Dec 18, 2018

💣 Failed to start rebuilding: Unknown error

@bors-servo
Copy link
Contributor

bors-servo commented Dec 18, 2018

Testing commit 496e2f6 with merge bfdb529...

bors-servo added a commit that referenced this pull request Dec 18, 2018
Initialize iframe viewport immediately

This is probably a significant cause of unstable test results, and it finally bothered me enough to fix it. The solution isn't great for performance (a sync layout query every time a iframe is added to a document), but performance needs to follow correctness.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #14364 and fix #15689 and fix #15688.
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22395)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 18, 2018

💔 Test failed - status-taskcluster

@CYBAI
Copy link
Collaborator

CYBAI commented Dec 18, 2018

@bors-servo retry

{
    "status": "TIMEOUT", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": null, 
    "test": "/wasm/jsapi/table/constructor.any.html", 
    "line": 132064, 
    "action": "test_result", 
    "expected": "OK"
}
{
    "status": "TIMEOUT", 
    "group": "default", 
    "message": null, 
    "stack": null, 
    "subtest": null, 
    "test": "/performance-timeline/po-getentries.any.worker.html", 
    "line": 132152, 
    "action": "test_result", 
    "expected": "OK"
}
@bors-servo
Copy link
Contributor

bors-servo commented Dec 18, 2018

Testing commit 496e2f6 with merge c553c43...

bors-servo added a commit that referenced this pull request Dec 18, 2018
Initialize iframe viewport immediately

This is probably a significant cause of unstable test results, and it finally bothered me enough to fix it. The solution isn't great for performance (a sync layout query every time a iframe is added to a document), but performance needs to follow correctness.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #14364 and fix #15689 and fix #15688.
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22395)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 18, 2018

@bors-servo bors-servo merged commit 496e2f6 into servo:master Dec 18, 2018
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@@ -777,7 +777,10 @@ impl VirtualMethods for HTMLScriptElement {
}

if tree_in_doc && !self.parser_inserted.get() {
self.prepare();
let script = Trusted::new(self);
document_from_node(self).add_delayed_task(task!(ScriptDelayedInitialize: move || {

This comment has been minimized.

@nox

nox Jan 31, 2019

Member

Where is it specified that scripts shouldn't be immediately prepared?

This comment has been minimized.

@jdm

jdm Jan 31, 2019

Author Member

It still is immeditate, but it waits until the current DOM modification is complete, so no intermediate state can be observed by script or layout.

@jdm jdm mentioned this pull request Nov 6, 2019
3 of 3 tasks complete
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 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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.