mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-16 05:51:55 +00:00
This change adds the `width` and `height` properties to `HTMLVideoElement` and `HTMLSourceElement`. These properties reflect their respective content attribute values.
29 lines
1,010 B
HTML
29 lines
1,010 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
function setPropertyAndDumpValue(tagName, property, value) {
|
|
const element = document.createElement(tagName);
|
|
element[property] = value;
|
|
println(`${tagName}.${property} after setting to ${value}: ${element[property]}`);
|
|
}
|
|
|
|
function testIntegerReflectedProperty(tagName, property) {
|
|
setPropertyAndDumpValue(tagName, property, -1);
|
|
setPropertyAndDumpValue(tagName, property, 20);
|
|
setPropertyAndDumpValue(tagName, property, 2147483648);
|
|
}
|
|
|
|
test(() => {
|
|
for (const tagName of ["img", "marquee", "object"]) {
|
|
for (const property of ["hspace", "vspace"]) {
|
|
testIntegerReflectedProperty(tagName, property);
|
|
}
|
|
}
|
|
|
|
for (const tagName of ["source", "video"]) {
|
|
for (const property of ["width", "height"]) {
|
|
testIntegerReflectedProperty(tagName, property);
|
|
}
|
|
}
|
|
});
|
|
</script>
|