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 upabout:blank iframe fires two load events #15727
Comments
jdm
commented
Feb 24, 2017
|
|
|
I'd like to investigate this. |
|
@gpoesia That would be really useful! I suspect it's caused by the special case in HTMLIFramElement::process_the_iframe_attributes and ScriptThread::handle_frame_load_event, so we'll probably want to suppress the one invoked by the ScriptThread. |
|
The first The second load event follows the spec as defined here: https://html.spec.whatwg.org/multipage/embedded-content.html#process-the-iframe-attributes As @jdm said, we will want to suppress the load event that is fired when we are creating the nested browsing context with the initial about:blank load. |
|
@gpoesia how is this going? Is there anything I can do to help? |
|
@cbrewster Would you take a look at #16091? I didn't find a better way of testing than waiting for some timeout. It bothers me that this makes the test non-deterministic in theory, but I think there can't be an exact way since we want to assert that "onload won't ever be called again", and that seems undecidable. |
Fix iframe.onload being fired twice on about:blank. <!-- Please describe your changes on the following line: --> Supress the load event in the script thread when the iframe doesn't have a src attribute. In that case, a load event is already fired when binding the iframe to the tree. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15727 (github issue number if applicable). - [X] There are tests for these changes OR <!-- 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/16091) <!-- Reviewable:end -->
Fix iframe.onload being fired twice on about:blank. <!-- Please describe your changes on the following line: --> Supress the load event in the script thread when the iframe doesn't have a src attribute. In that case, a load event is already fired when binding the iframe to the tree. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15727 (github issue number if applicable). - [X] There are tests for these changes OR <!-- 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/16091) <!-- Reviewable:end -->
Fix iframe.onload being fired twice on about:blank. <!-- Please describe your changes on the following line: --> Supress the load event in the script thread when the iframe doesn't have a src attribute. In that case, a load event is already fired when binding the iframe to the tree. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15727 (github issue number if applicable). - [X] There are tests for these changes OR <!-- 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/16091) <!-- Reviewable:end -->
Fix iframe.onload being fired twice on about:blank. <!-- Please describe your changes on the following line: --> Supress the load event in the script thread when the iframe doesn't have a src attribute. In that case, a load event is already fired when binding the iframe to the tree. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15727 (github issue number if applicable). - [X] There are tests for these changes OR <!-- 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/16091) <!-- Reviewable:end -->
|
#16091 was a work in progress to fix this; I believe #16091 (comment) was the last set of requests but the author stopped responding. |