LibWeb: Implement the width and height attributes where missing

This change adds the `width` and `height` properties to
`HTMLVideoElement` and `HTMLSourceElement`. These properties reflect
their respective content attribute values.
This commit is contained in:
Tim Ledbetter 2024-05-21 12:22:45 +01:00 committed by Andreas Kling
parent 9f9aa62128
commit 2a7cf1c588
Notes: sideshowbarker 2024-07-17 06:09:44 +09:00
4 changed files with 22 additions and 4 deletions

View File

@ -16,3 +16,15 @@ object.hspace after setting to 2147483648: 0
object.vspace after setting to -1: 0
object.vspace after setting to 20: 20
object.vspace after setting to 2147483648: 0
source.width after setting to -1: 0
source.width after setting to 20: 20
source.width after setting to 2147483648: 0
source.height after setting to -1: 0
source.height after setting to 20: 20
source.height after setting to 2147483648: 0
video.width after setting to -1: 0
video.width after setting to 20: 20
video.width after setting to 2147483648: 0
video.height after setting to -1: 0
video.height after setting to 20: 20
video.height after setting to 2147483648: 0

View File

@ -19,5 +19,11 @@
testIntegerReflectedProperty(tagName, property);
}
}
for (const tagName of ["source", "video"]) {
for (const property of ["width", "height"]) {
testIntegerReflectedProperty(tagName, property);
}
}
});
</script>

View File

@ -11,7 +11,7 @@ interface HTMLSourceElement : HTMLElement {
[CEReactions, Reflect] attribute DOMString srcset;
[CEReactions, Reflect] attribute DOMString sizes;
[CEReactions, Reflect] attribute DOMString media;
[FIXME, CEReactions, Reflect] attribute unsigned long width;
[FIXME, CEReactions, Reflect] attribute unsigned long height;
[CEReactions, Reflect] attribute unsigned long width;
[CEReactions, Reflect] attribute unsigned long height;
};

View File

@ -6,8 +6,8 @@ interface HTMLVideoElement : HTMLMediaElement {
[HTMLConstructor] constructor();
[FIXME, CEReactions] attribute unsigned long width;
[FIXME, CEReactions] attribute unsigned long height;
[CEReactions, Reflect] attribute unsigned long width;
[CEReactions, Reflect] attribute unsigned long height;
readonly attribute unsigned long videoWidth;
readonly attribute unsigned long videoHeight;
[CEReactions, Reflect] attribute USVString poster;