mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:37:34 +00:00
LibWeb: Support min-inline-size & max-inline-size
Currently this assumes that writing-mode is horizontal, and therefore only affects the min-width/max-width
This commit is contained in:
parent
72507c318a
commit
733b74af7c
2 changed files with 30 additions and 0 deletions
|
@ -1227,6 +1227,11 @@
|
||||||
"unitless-length"
|
"unitless-length"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"max-inline-size": {
|
||||||
|
"logical-alias-for": "max-width",
|
||||||
|
"__comment": "Also a logical alias for max-height",
|
||||||
|
"initial": "none"
|
||||||
|
},
|
||||||
"max-width": {
|
"max-width": {
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "none",
|
"initial": "none",
|
||||||
|
@ -1257,6 +1262,11 @@
|
||||||
"unitless-length"
|
"unitless-length"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"min-inline-size": {
|
||||||
|
"logical-alias-for": "min-width",
|
||||||
|
"__comment": "Also a logical alias for min-height",
|
||||||
|
"initial": "0"
|
||||||
|
},
|
||||||
"min-width": {
|
"min-width": {
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "auto",
|
"initial": "auto",
|
||||||
|
|
|
@ -675,6 +675,26 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (property_id == CSS::PropertyID::MaxInlineSize || property_id == CSS::PropertyID::MinInlineSize) {
|
||||||
|
// FIXME: Use writing-mode to determine if we should set width or height.
|
||||||
|
bool is_horizontal = true;
|
||||||
|
|
||||||
|
if (is_horizontal) {
|
||||||
|
if (property_id == CSS::PropertyID::MaxInlineSize) {
|
||||||
|
style.set_property(CSS::PropertyID::MaxWidth, value);
|
||||||
|
} else {
|
||||||
|
style.set_property(CSS::PropertyID::MinWidth, value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (property_id == CSS::PropertyID::MaxInlineSize) {
|
||||||
|
style.set_property(CSS::PropertyID::MaxHeight, value);
|
||||||
|
} else {
|
||||||
|
style.set_property(CSS::PropertyID::MinHeight, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
style.set_property(property_id, value);
|
style.set_property(property_id, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue