Implement HTMLImageElement decode (#31269)

* Implement HTMLImageElement decode

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Fix Decode doc link

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Temp

* Decode HTML Image

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Fix doc link

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Move image decode to process_image_response_for_environment_change

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update some wpt test result

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Handle multiple image decode promises

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove unnecessary promise calls

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update more wpt test result

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Undo body-size-cross-origin.https.html.ini changes

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Reject decode when src and srcset are missing

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Revert "Reject decode when src and srcset are missing"

This reverts commit 1b57ab978f9fc24facafc8af97ee8851d5142533.

* Drain promises vec and run update_the_image_data when element is created

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* resolve decode promise in abort_request when request is CompletelyAvailable

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update wpt test

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Move storing promise in decode task

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove the resolve logic from decode task

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Revert "Remove the resolve logic from decode task"

This reverts commit eee6096d50.

* reject or reject current promise before storing it

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Add comment to explain why resolve promise when state is CompletelyAvailable

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
Taym Haddadi 2024-06-13 12:15:49 +02:00 committed by GitHub
parent 43df0a48ee
commit 1d048f4f6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 97 additions and 173 deletions

View file

@ -1,4 +1 @@
[image-decode-image-document.html]
expected: ERROR
[HTMLImageElement.prototype.decode(), image document tests. Decode from iframe with image document, succeeds (img not loaded)]
expected: TIMEOUT

View file

@ -1,24 +1,9 @@
[image-decode-path-changes.html]
[HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode.]
expected: FAIL
[HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode; following good png decode succeeds.]
expected: FAIL
[HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode; following good svg decode succeeds.]
expected: FAIL
[HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes fail decode; following bad decode fails.]
expected: FAIL
[HTMLImageElement.prototype.decode(), src/srcset mutation tests. src changes to the same path succeed.]
expected: FAIL
[HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode.]
expected: FAIL
[HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode; following good decode succeeds.]
expected: FAIL
[HTMLImageElement.prototype.decode(), src/srcset mutation tests. srcset changes fail decode; following bad decode fails.]
expected: FAIL

View file

@ -1,24 +1,3 @@
[image-decode-picture.html]
[HTMLImageElement.prototype.decode(), picture tests. Image with PNG source decodes with undefined.]
expected: FAIL
[HTMLImageElement.prototype.decode(), picture tests. Image with multiple sources decodes with undefined.]
expected: FAIL
[HTMLImageElement.prototype.decode(), picture tests. Image with PNG data URL source decodes with undefined.]
expected: FAIL
[HTMLImageElement.prototype.decode(), picture tests. Image with SVG source decodes with undefined.]
expected: FAIL
[HTMLImageElement.prototype.decode(), picture tests. Non-existent source fails decode.]
expected: FAIL
[HTMLImageElement.prototype.decode(), picture tests. Corrupt image in src fails decode.]
expected: FAIL
[HTMLImageElement.prototype.decode(), picture tests. Image without srcset fails decode.]
expected: FAIL
[HTMLImageElement.prototype.decode(), picture tests. Multiple decodes for images with src succeed.]
expected: FAIL

View file

@ -1,3 +1 @@
[image-decode-with-quick-attach.html]
[HTMLImageElement.prototype.decode(), attach to DOM before promise resolves.]
expected: FAIL

View file

@ -1,42 +1,6 @@
[image-decode.html]
[HTMLImageElement.prototype.decode(), basic tests. Image with PNG src decodes with undefined.]
expected: FAIL
[HTMLImageElement.prototype.decode(), basic tests. Image with PNG data URL src decodes with undefined.]
expected: FAIL
[HTMLImageElement.prototype.decode(), basic tests. Image with SVG src decodes with undefined.]
expected: FAIL
[HTMLImageElement.prototype.decode(), basic tests. Non-existent src fails decode.]
expected: FAIL
[HTMLImageElement.prototype.decode(), basic tests. Inactive document fails decode.]
expected: FAIL
[HTMLImageElement.prototype.decode(), basic tests. Adopted active image into inactive document fails decode.]
expected: FAIL
[HTMLImageElement.prototype.decode(), basic tests. Adopted inactive image into active document succeeds.]
expected: FAIL
[HTMLImageElement.prototype.decode(), basic tests. Corrupt image in src fails decode.]
expected: FAIL
[HTMLImageElement.prototype.decode(), basic tests. Image without src/srcset fails decode.]
expected: FAIL
[HTMLImageElement.prototype.decode(), basic tests. Multiple decodes for images with src succeed.]
expected: FAIL
[HTMLImageElement.prototype.decode(), basic tests. Image with PNG srcset decodes with undefined.]
expected: FAIL
[HTMLImageElement.prototype.decode(), basic tests. Image with SVG srcset decodes with undefined.]
expected: FAIL
[HTMLImageElement.prototype.decode(), basic tests. Non-existent srcset fails decode.]
expected: FAIL
[HTMLImageElement.prototype.decode(), basic tests. Multiple decodes for images with srcset succeed.]
expected: FAIL