diff --git a/Tests/LibWeb/Layout/expected/calc-with-fr.txt b/Tests/LibWeb/Layout/expected/calc-with-fr.txt new file mode 100644 index 0000000000..84f91a3980 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/calc-with-fr.txt @@ -0,0 +1,30 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x68.40625 [BFC] children: not-inline + BlockContainer at (8,8) content-size 784x52.40625 children: not-inline + Box at (8,8) content-size 784x52.40625 [GFC] children: not-inline + BlockContainer
at (8,8) content-size 784x17.46875 [BFC] children: inline + line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [8,8 6.34375x17.46875] + "1" + TextNode <#text> + BlockContainer
at (8,25.46875) content-size 784x17.46875 [BFC] children: inline + line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [8,25.46875 8.8125x17.46875] + "2" + TextNode <#text> + BlockContainer
at (8,42.9375) content-size 784x17.46875 [BFC] children: inline + line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [8,42.9375 9.09375x17.46875] + "3" + TextNode <#text> + +ViewportPaintable (Viewport<#document>) [0,0 800x600] + PaintableWithLines (BlockContainer) [0,0 800x68.40625] + PaintableWithLines (BlockContainer) [8,8 784x52.40625] + PaintableBox (Box
.container) [8,8 784x52.40625] + PaintableWithLines (BlockContainer
) [8,8 784x17.46875] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer
) [8,25.46875 784x17.46875] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer
) [8,42.9375 784x17.46875] + TextPaintable (TextNode<#text>) diff --git a/Tests/LibWeb/Layout/input/calc-with-fr.html b/Tests/LibWeb/Layout/input/calc-with-fr.html new file mode 100644 index 0000000000..4e0ba8076b --- /dev/null +++ b/Tests/LibWeb/Layout/input/calc-with-fr.html @@ -0,0 +1,7 @@ + +
1
2
3
\ No newline at end of file diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 9951dc7a89..8b3134c67e 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -6476,8 +6476,14 @@ OwnPtr Parser::parse_a_calculation(Vector const // FIXME: Resolutions, once calc() supports them. else if (dimension->is_time()) values.append({ NumericCalculationNode::create(dimension->time()) }); - else + else if (dimension->is_flex()) { + // https://www.w3.org/TR/css3-grid-layout/#fr-unit + // NOTE: values are not s (nor are they compatible with s, like some values), + // so they cannot be represented in or combined with other unit types in calc() expressions. + return nullptr; + } else { VERIFY_NOT_REACHED(); + } continue; }