Skip to content

Initialize iframe viewport immediately#22395

Merged
bors-servo merged 5 commits intoservo:masterfrom
jdm:initial-iframe-size
Dec 18, 2018
Merged

Initialize iframe viewport immediately#22395
bors-servo merged 5 commits intoservo:masterfrom
jdm:initial-iframe-size

Conversation

@jdm
Copy link
Copy Markdown
Member

@jdm 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.



This change is Reviewable

@highfive
Copy link
Copy Markdown

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 highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 9, 2018
@highfive
Copy link
Copy Markdown

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
Copy Markdown
Member Author

jdm commented Dec 9, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Trying commit af4cc5c with merge a39bbff...

bors-servo pushed 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
Copy Markdown
Contributor

💔 Test failed - linux-rel-wpt

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Dec 9, 2018
@jdm jdm force-pushed the initial-iframe-size branch from af4cc5c to c8fb961 Compare December 9, 2018 19:36
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Dec 9, 2018
@jdm
Copy link
Copy Markdown
Member Author

jdm commented Dec 9, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Trying commit c8fb961 with merge 4e0f3f7...

bors-servo pushed 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
Copy Markdown
Contributor

💔 Test failed - linux-rel-wpt

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Dec 9, 2018
@jdm
Copy link
Copy Markdown
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?

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Dec 10, 2018
@jdm
Copy link
Copy Markdown
Member Author

jdm commented Dec 10, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Trying commit fc41ddc with merge f9c115f...

bors-servo pushed 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
Copy Markdown
Contributor

💔 Test failed - linux-rel-css

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-tests-failed The changes caused existing tests to fail. labels Dec 10, 2018
@jdm
Copy link
Copy Markdown
Member Author

jdm commented Dec 10, 2018

@bors-servo try=wpt

@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Trying commit 9bee8ea with merge 90234c4...

bors-servo pushed 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
Copy Markdown
Contributor

💔 Test failed - linux-rel-css

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Dec 10, 2018
@jdm jdm force-pushed the initial-iframe-size branch from 9bee8ea to 1655386 Compare December 10, 2018 06:24
@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Testing commit 496e2f6 with merge 5eb3d27...

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Dec 18, 2018
@bors-servo
Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Dec 18, 2018
@CYBAI
Copy link
Copy Markdown
Member

CYBAI commented Dec 18, 2018

@bors-servo retry

@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Testing commit 496e2f6 with merge 0d2e811...

bors-servo pushed 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 -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Dec 18, 2018
@bors-servo
Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Dec 18, 2018
@CYBAI
Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

💣 Failed to start rebuilding: Unknown error

@bors-servo
Copy link
Copy Markdown
Contributor

⌛ Testing commit 496e2f6 with merge bfdb529...

bors-servo pushed 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 -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Dec 18, 2018
@bors-servo
Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Dec 18, 2018
@CYBAI
Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

⌛ Testing commit 496e2f6 with merge c553c43...

@bors-servo
Copy link
Copy Markdown
Contributor

☀️ Test successful - android-mac, arm32, arm64, linux-rel-css, linux-rel-wpt, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, magicleap, status-taskcluster
Approved by: Manishearth
Pushing c553c43 to master...

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 || {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

6 participants