mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibWeb: Don't crash when encountering calc() inside a CSS rect() value
This allows us to run the WPT tests under quirks/unitless-length/ without crashing, giving us over 4600 new passing subtests. :^)
This commit is contained in:
parent
5e240f997c
commit
5df6c6eecf
Notes:
github-actions[bot]
2024-10-09 13:15:10 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/5df6c6eecff Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1698 Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 20 additions and 1 deletions
|
@ -0,0 +1,10 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x0 children: not-inline
|
||||
BlockContainer <div> at (8,8) content-size 784x0 children: inline
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x0]
|
||||
PaintableWithLines (BlockContainer<DIV>) [8,8 784x0]
|
|
@ -0,0 +1,6 @@
|
|||
<style>
|
||||
div {
|
||||
clip: rect(0, 0, 0, calc(2px));
|
||||
}
|
||||
</style>
|
||||
<div>
|
|
@ -2710,7 +2710,10 @@ RefPtr<CSSStyleValue> Parser::parse_rect_value(TokenStream<ComponentValue>& toke
|
|||
auto maybe_length = parse_length(argument_tokens);
|
||||
if (!maybe_length.has_value())
|
||||
return nullptr;
|
||||
// FIXME: Support calculated lengths
|
||||
if (maybe_length.value().is_calculated()) {
|
||||
dbgln("FIXME: Support calculated lengths in rect(): {}", maybe_length.value().calculated()->to_string());
|
||||
return nullptr;
|
||||
}
|
||||
params.append(maybe_length.value().value());
|
||||
}
|
||||
argument_tokens.skip_whitespace();
|
||||
|
|
Loading…
Reference in a new issue