LibWeb: Implement HTMLImageElement::decode with a few FIXMEs

Implements enough of HTMLImageElement::decode for it to not break
websites and actually load an image :)

(cherry picked from commit 862fc91b2cf9bee9b7f180cdf930c6c99b5dd053)
This commit is contained in:
Enver Balalic
2024-06-05 23:15:26 +02:00
committed by Nico Weber
parent 69514c8a18
commit 18d589c520
3 changed files with 86 additions and 1 deletions

View File

@@ -60,6 +60,9 @@ public:
// https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-currentsrc
String current_src() const;
// https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode
[[nodiscard]] WebIDL::ExceptionOr<JS::NonnullGCPtr<JS::Promise>> decode() const;
virtual Optional<ARIA::Role> default_role() const override;
// https://html.spec.whatwg.org/multipage/images.html#img-environment-changes