-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1076583 - Make src attribute not load sync. r=smaug,extension-rev…
…iewers,devtools-reviewers,robwu,nchevobbe This fixes src loads to be consistent with srcset/picture loads, modulo the special synchronous case in the spec (https://html.spec.whatwg.org/#update-the-image-data step 7), which requires src loads to be sync if the image is available. We now avoid triggering the load from the parser consistently for src / srcset / picture, and unify the codepath with BindToTree. That should avoid some useless task allocations. Only the sync load code-path needs a script runner (mostly to deal with anonymous content like the video poster <img> and such, but it also helps not trigger sync loads at unexpected times like on adoption). About the HTMLImageElement::Complete() getter change, we need to also return false if there's an existing load task. That is the proposal in whatwg/html#4884, and prevents some failures in the-img-element/{update-src-complete,img.complete}.html WPTs. It technically changes our behavior on .srcset changes, but it makes it consistent with .src changes and other browsers, so seems fine. There are a couple regressions in CSP tests and the networkEvent stubs, but these are really a pre-existing issue. What happens is that, since the loads are now async, CSP can't figure out the script that triggered the load anymore. I need to look if there's an easy way to propagate that information in the image load tasks, but this is trivially reproducible by changing these tests to use srcset rather than src. The rest of the test changes are as expected: either new passes, or expected test changes from this. Differential Revision: https://phabricator.services.mozilla.com/D215519
- Loading branch information
Showing
17 changed files
with
216 additions
and
374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.