LibWeb: Implement HTMLImageElement.loading

Removes some console noise while loading mmu.ac.uk :)
This commit is contained in:
Jamie Mansfield 2024-05-23 22:53:03 +01:00 committed by Andreas Kling
parent c484625631
commit 9ee061ea14
Notes: sideshowbarker 2024-07-17 00:23:42 +09:00
3 changed files with 25 additions and 1 deletions

View file

@ -0,0 +1,5 @@
loading = eager
loading = lazy
loading = eager

View file

@ -0,0 +1,18 @@
<img id="testImg">
<script src="../include.js"></script>
<script>
test(() => {
const img = document.getElementById('testImg');
println(`loading = ${img.loading}`);
println('');
img.loading = 'lazy';
println(`loading = ${img.loading}`);
println('');
img.loading = 'invalid-value';
println(`loading = ${img.loading}`);
});
</script>

View file

@ -1,4 +1,5 @@
#import <HTML/HTMLElement.idl>
#import <HTML/Scripting/Fetching.idl>
// https://html.spec.whatwg.org/multipage/embedded-content.html#htmlimageelement
[Exposed=Window, LegacyFactoryFunction=Image(optional unsigned long width, optional unsigned long height)]
@ -21,7 +22,7 @@ interface HTMLImageElement : HTMLElement {
[FIXME] readonly attribute USVString currentSrc;
[FIXME, CEReactions] attribute DOMString referrerPolicy;
[FIXME, CEReactions] attribute DOMString decoding;
[FIXME, CEReactions] attribute DOMString loading;
[CEReactions, Enumerated=LazyLoadingAttribute, Reflect] attribute DOMString loading;
[FIXME, CEReactions] attribute DOMString fetchPriority;
[FIXME] Promise<undefined> decode();