mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWeb/CSS: Allow whitespace inside fit-content() function
This commit is contained in:
@@ -2556,8 +2556,6 @@ RefPtr<FitContentStyleValue> Parser::parse_fit_content_value(TokenStream<Compone
|
||||
auto const& function = component_value.function();
|
||||
if (function.name != "fit-content"sv)
|
||||
return nullptr;
|
||||
if (function.value.size() != 1)
|
||||
return nullptr;
|
||||
TokenStream argument_tokens { function.value };
|
||||
argument_tokens.discard_whitespace();
|
||||
auto maybe_length = parse_length_percentage(argument_tokens);
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
"fit-content(10%)" became "fit-content(10%)"
|
||||
"fit-content( 10%)" became "fit-content(10%)"
|
||||
"fit-content(10% )" became "fit-content(10%)"
|
||||
"fit-content( 10% )" became "fit-content(10%)"
|
||||
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test(() => {
|
||||
let inputs = [
|
||||
"fit-content(10%)",
|
||||
"fit-content( 10%)",
|
||||
"fit-content(10% )",
|
||||
"fit-content( 10% )",
|
||||
];
|
||||
let target = document.getElementById('target');
|
||||
for (let input of inputs) {
|
||||
target.style.width = '';
|
||||
target.style.width = input;
|
||||
println(`"${input}" became "${target.style.width}"`);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user