mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 18:19:03 +00:00
LibWeb: Map hr
width attribute to the width dimension property
This commit is contained in:
parent
45a3360a62
commit
4c3101e021
Notes:
github-actions[bot]
2024-10-02 09:28:38 +00:00
Author: https://github.com/tcl3
Commit: 4c3101e021
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1591
4 changed files with 41 additions and 0 deletions
21
Tests/LibWeb/Text/input/HTML/dimension-attributes.html
Normal file
21
Tests/LibWeb/Text/input/HTML/dimension-attributes.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const tests = [
|
||||
{ elementName: "hr", attribute: "width", mappedProperty: "width" },
|
||||
];
|
||||
const values = ["100", " 00110 ", "120."];
|
||||
|
||||
for (const { elementName, attribute, mappedProperty } of tests) {
|
||||
const element = document.createElement(elementName);
|
||||
document.body.appendChild(element);
|
||||
const style = document.defaultView.getComputedStyle(element);
|
||||
for (const value of values) {
|
||||
element[attribute] = value;
|
||||
println(`Test ${elementName}.${attribute} = "${value}" maps to ${mappedProperty}: ${style[mappedProperty]}`);
|
||||
}
|
||||
element.remove();
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue