mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibWeb: Support shorthands when setting style attribute
Better support for CSS shorthands when setting the style attribute. This improves some tests in WPT /css/css-align/default-alignment/*shorthand. When setting the style attribute in JS via element.style = '..' or the setAttribute method, shorthand properties were not expanded to longhand properties.
This commit is contained in:
parent
99c66f49fb
commit
2199fde5a9
Notes:
github-actions[bot]
2024-10-31 12:23:58 +00:00
Author: https://github.com/sazarkin 🔰
Commit: 2199fde5a9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1894
Reviewed-by: https://github.com/AtkinsSJ ✅
5 changed files with 130 additions and 1 deletions
34
Tests/LibWeb/Text/input/HTML/place-items-shorthand.html
Normal file
34
Tests/LibWeb/Text/input/HTML/place-items-shorthand.html
Normal file
|
@ -0,0 +1,34 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
for (const alignValue of [
|
||||
"normal",
|
||||
"stretch",
|
||||
"start",
|
||||
"end",
|
||||
"self-start",
|
||||
"self-end",
|
||||
"center",
|
||||
"flex-start",
|
||||
"flex-end",
|
||||
"baseline",
|
||||
// "first baseline",
|
||||
// "last baseline",
|
||||
// "safe flex-end",
|
||||
// "unsafe end",
|
||||
// "safe end",
|
||||
// "unsafe flex-start",
|
||||
// "safe center",
|
||||
"normal start",
|
||||
"normal center",
|
||||
]) {
|
||||
println("=== place-items: " + alignValue);
|
||||
var div = document.createElement("div");
|
||||
div.setAttribute("style", "place-items: " + alignValue + ";");
|
||||
document.body.appendChild(div);
|
||||
for (const prop of ["place-items", "align-items", "justify-items"]) {
|
||||
println(prop + ": " + div.style[prop]);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue