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 upInitialize iframe viewport immediately #22395
Conversation
highfive
commented
Dec 9, 2018
|
Heads up! This PR modifies the following files:
|
highfive
commented
Dec 9, 2018
|
@bors-servo try=wpt |
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 try=wpt |
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 -->
|
|
|
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? |
|
@bors-servo try=wpt |
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 try=wpt |
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 -->
|
|
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 retry
|
|
|
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 retry
|
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 -->
|
|
| @@ -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.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
nox
Jan 31, 2019
Member
This seems to specify the opposite.
https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model:prepare-a-script-4
This comment has been minimized.
This comment has been minimized.
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.
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
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
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 commentedDec 9, 2018
•
edited
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 -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is