LibWeb: Map embedded content element attributes to dimension properties

This commit is contained in:
Tim Ledbetter 2024-10-01 17:26:01 +01:00 committed by Andreas Kling
commit 728236f4d2
Notes: github-actions[bot] 2024-10-02 09:28:22 +00:00
8 changed files with 189 additions and 1 deletions

View file

@ -10,6 +10,18 @@
{ elementName: "marquee", attribute: "vspace", mappedProperty: "marginBottom" },
{ elementName: "marquee", attribute: "width", mappedProperty: "width" },
{ elementName: "marquee", attribute: "height", mappedProperty: "height" },
{ elementName: "object", attribute: "hspace", mappedProperty: "marginLeft" },
{ elementName: "object", attribute: "hspace", mappedProperty: "marginRight" },
{ elementName: "object", attribute: "vspace", mappedProperty: "marginTop" },
{ elementName: "object", attribute: "vspace", mappedProperty: "marginBottom" },
{ elementName: "object", attribute: "width", mappedProperty: "width" },
{ elementName: "object", attribute: "height", mappedProperty: "height" },
{ elementName: "embed", attribute: "hspace", mappedProperty: "marginLeft" },
{ elementName: "embed", attribute: "hspace", mappedProperty: "marginRight" },
{ elementName: "embed", attribute: "vspace", mappedProperty: "marginTop" },
{ elementName: "embed", attribute: "vspace", mappedProperty: "marginBottom" },
{ elementName: "embed", attribute: "width", mappedProperty: "width" },
{ elementName: "embed", attribute: "height", mappedProperty: "height" },
];
const values = ["100", " 00110 ", "120."];
@ -18,7 +30,7 @@
document.body.appendChild(element);
const style = document.defaultView.getComputedStyle(element);
for (const value of values) {
element[attribute] = value;
element.setAttribute(attribute, value);
println(`Test ${elementName}.${attribute} = "${value}" maps to ${mappedProperty}: ${style[mappedProperty]}`);
}
element.remove();