mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
LibWeb: Implement HTMLImageElement.loading
Removes some console noise while loading mmu.ac.uk :)
This commit is contained in:
parent
c484625631
commit
9ee061ea14
Notes:
sideshowbarker
2024-07-17 00:23:42 +09:00
Author: https://github.com/jamierocks Commit: https://github.com/SerenityOS/serenity/commit/9ee061ea14 Pull-request: https://github.com/SerenityOS/serenity/pull/24425 Reviewed-by: https://github.com/tcl3
3 changed files with 25 additions and 1 deletions
5
Tests/LibWeb/Text/expected/HTML/img-element-loading.txt
Normal file
5
Tests/LibWeb/Text/expected/HTML/img-element-loading.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
loading = eager
|
||||
|
||||
loading = lazy
|
||||
|
||||
loading = eager
|
18
Tests/LibWeb/Text/input/HTML/img-element-loading.html
Normal file
18
Tests/LibWeb/Text/input/HTML/img-element-loading.html
Normal 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>
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue