at (9,9) content-size 597.96875x21.46875 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
- BlockContainer at (11,11) content-size 95.671875x17.46875 table-cell [BFC] children: inline
+ BlockContainer | at (11,11) content-size 95.65625x17.46875 table-cell [BFC] children: inline
line 0 width: 26.078125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 4, rect: [11,11 26.078125x17.46875]
"cell"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
- BlockContainer | at (110.671875,11) content-size 95.671875x17.46875 table-cell [BFC] children: inline
+ BlockContainer | at (110.65625,11) content-size 95.65625x17.46875 table-cell [BFC] children: inline
line 0 width: 26.078125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
- frag 0 from TextNode start: 0, length: 4, rect: [110.671875,11 26.078125x17.46875]
+ frag 0 from TextNode start: 0, length: 4, rect: [110.65625,11 26.078125x17.46875]
"cell"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
- BlockContainer | at (210.34375,11) content-size 95.671875x17.46875 table-cell [BFC] children: inline
+ BlockContainer | at (210.3125,11) content-size 95.65625x17.46875 table-cell [BFC] children: inline
line 0 width: 94.96875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
- frag 0 from TextNode start: 0, length: 12, rect: [210.34375,11 94.96875x17.46875]
+ frag 0 from TextNode start: 0, length: 12, rect: [210.3125,11 94.96875x17.46875]
"A table cell"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
- BlockContainer | at (310.015625,11) content-size 295x17.46875 table-cell [BFC] children: inline
+ BlockContainer | at (309.96875,11) content-size 295x17.46875 table-cell [BFC] children: inline
line 0 width: 94.96875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
- frag 0 from TextNode start: 0, length: 12, rect: [310.015625,11 94.96875x17.46875]
+ frag 0 from TextNode start: 0, length: 12, rect: [309.96875,11 94.96875x17.46875]
"A table cell"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
- Box |
at (9,30.46875) content-size 597.96875x21.46875 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
- BlockContainer at (11,32.46875) content-size 95.671875x17.46875 table-cell [BFC] children: inline
+ BlockContainer | at (11,32.46875) content-size 95.65625x17.46875 table-cell [BFC] children: inline
line 0 width: 26.078125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 4, rect: [11,32.46875 26.078125x17.46875]
"cell"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
- BlockContainer | at (110.671875,32.46875) content-size 95.671875x17.46875 table-cell [BFC] children: inline
+ BlockContainer | at (110.65625,32.46875) content-size 95.65625x17.46875 table-cell [BFC] children: inline
line 0 width: 26.078125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
- frag 0 from TextNode start: 0, length: 4, rect: [110.671875,32.46875 26.078125x17.46875]
+ frag 0 from TextNode start: 0, length: 4, rect: [110.65625,32.46875 26.078125x17.46875]
"cell"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
- BlockContainer | at (210.34375,32.46875) content-size 95.671875x17.46875 table-cell [BFC] children: inline
+ BlockContainer | at (210.3125,32.46875) content-size 95.65625x17.46875 table-cell [BFC] children: inline
line 0 width: 94.96875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
- frag 0 from TextNode start: 0, length: 12, rect: [210.34375,32.46875 94.96875x17.46875]
+ frag 0 from TextNode start: 0, length: 12, rect: [210.3125,32.46875 94.96875x17.46875]
"A table cell"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
- BlockContainer | at (310.015625,32.46875) content-size 295x17.46875 table-cell [BFC] children: inline
+ BlockContainer | at (309.96875,32.46875) content-size 295x17.46875 table-cell [BFC] children: inline
line 0 width: 94.96875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
- frag 0 from TextNode start: 0, length: 12, rect: [310.015625,32.46875 94.96875x17.46875]
+ frag 0 from TextNode start: 0, length: 12, rect: [309.96875,32.46875 94.96875x17.46875]
"A table cell"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
@@ -77,23 +77,23 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer) [0,0 800x600]
PaintableWithLines (BlockContainer) [8,8 784x44.9375]
PaintableWithLines (TableWrapper(anonymous)) [8,8 600x44.9375]
- PaintableBox (Box) [8,8 600x44.9375] overflow: [9,9 598.015625x42.9375]
- PaintableBox (Box) [9,9 598.015625x42.9375]
- PaintableBox (Box) [9,9 598.015625x21.46875]
- PaintableWithLines (BlockContainer) [9,9 99.671875x21.46875]
+ PaintableBox (Box) [8,8 600x44.9375]
+ PaintableBox (Box) [9,9 597.96875x42.9375]
+ PaintableBox (Box) [9,9 597.96875x21.46875]
+ PaintableWithLines (BlockContainer) [9,9 99.65625x21.46875]
TextPaintable (TextNode<#text>)
- PaintableWithLines (BlockContainer | ) [108.671875,9 99.671875x21.46875]
+ PaintableWithLines (BlockContainer | ) [108.65625,9 99.65625x21.46875]
TextPaintable (TextNode<#text>)
- PaintableWithLines (BlockContainer | ) [208.34375,9 99.671875x21.46875]
+ PaintableWithLines (BlockContainer | ) [208.3125,9 99.65625x21.46875]
TextPaintable (TextNode<#text>)
- PaintableWithLines (BlockContainer | ) [308.015625,9 299x21.46875]
+ PaintableWithLines (BlockContainer | ) [307.96875,9 299x21.46875]
TextPaintable (TextNode<#text>)
- PaintableBox (Box | ) [9,30.46875 598.015625x21.46875]
- PaintableWithLines (BlockContainer) [9,30.46875 99.671875x21.46875]
+ PaintableBox (Box | ) [9,30.46875 597.96875x21.46875]
+ PaintableWithLines (BlockContainer) [9,30.46875 99.65625x21.46875]
TextPaintable (TextNode<#text>)
- PaintableWithLines (BlockContainer | ) [108.671875,30.46875 99.671875x21.46875]
+ PaintableWithLines (BlockContainer | ) [108.65625,30.46875 99.65625x21.46875]
TextPaintable (TextNode<#text>)
- PaintableWithLines (BlockContainer | ) [208.34375,30.46875 99.671875x21.46875]
+ PaintableWithLines (BlockContainer | ) [208.3125,30.46875 99.65625x21.46875]
TextPaintable (TextNode<#text>)
- PaintableWithLines (BlockContainer | ) [308.015625,30.46875 299x21.46875]
+ PaintableWithLines (BlockContainer | ) [307.96875,30.46875 299x21.46875]
TextPaintable (TextNode<#text>)
diff --git a/Tests/LibWeb/Layout/expected/table/row-outer-size-with-computed-size.txt b/Tests/LibWeb/Layout/expected/table/row-outer-size-with-computed-size.txt
index 9eedd718266..c14f0a77d82 100644
--- a/Tests/LibWeb/Layout/expected/table/row-outer-size-with-computed-size.txt
+++ b/Tests/LibWeb/Layout/expected/table/row-outer-size-with-computed-size.txt
@@ -9,7 +9,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
Box | at (10,10) content-size 43.21875x9.734375 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
- BlockContainer at (11,14.875) content-size 0x0 table-cell [BFC] children: not-inline
+ BlockContainer | at (11,14.859375) content-size 0x0 table-cell [BFC] children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer | at (16,12) content-size 37.21875x17.46875 table-cell [BFC] children: inline
@@ -27,7 +27,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
Box | at (10,21.734375) content-size 43.21875x9.734375 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
- BlockContainer at (11,26.609375) content-size 0x0 table-cell [BFC] children: not-inline
+ BlockContainer | at (11,26.59375) content-size 0x0 table-cell [BFC] children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
@@ -38,11 +38,11 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer) [8,8 784x25.46875]
PaintableWithLines (TableWrapper(anonymous)) [8,8 49.21875x25.46875]
PaintableBox (Box) [8,8 49.21875x25.46875]
- PaintableBox (Box) [8,8 43.21875x19.46875] overflow: [8,8 47.21875x23.484375]
+ PaintableBox (Box) [8,8 43.21875x19.46875] overflow: [8,8 47.21875x23.46875]
PaintableBox (Box) [10,10 43.21875x9.734375] overflow: [10,10 45.21875x21.46875]
- PaintableWithLines (BlockContainer) [10,10 2x9.75]
+ PaintableWithLines (BlockContainer | ) [10,10 2x9.71875]
PaintableWithLines (BlockContainer | ) [14,10 41.21875x21.46875]
InlinePaintable (InlineNode)
TextPaintable (TextNode<#text>)
- PaintableBox (Box) [10,21.734375 43.21875x9.734375] overflow: [10,21.734375 43.21875x9.75]
- PaintableWithLines (BlockContainer) [10,21.734375 2x9.75]
+ PaintableBox (Box | ) [10,21.734375 43.21875x9.734375]
+ PaintableWithLines (BlockContainer) [10,21.734375 2x9.71875]
diff --git a/Tests/LibWeb/Layout/expected/table/row-span-and-nested-tables.txt b/Tests/LibWeb/Layout/expected/table/row-span-and-nested-tables.txt
index a0ec10d97ed..347394518ff 100644
--- a/Tests/LibWeb/Layout/expected/table/row-span-and-nested-tables.txt
+++ b/Tests/LibWeb/Layout/expected/table/row-span-and-nested-tables.txt
@@ -15,9 +15,9 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
Box | at (11,11) content-size 67.828125x54.203125 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
- BlockContainer at (17,29.375) content-size 11.5625x17.46875 table-cell [BFC] children: inline
+ BlockContainer | at (17,29.359375) content-size 11.5625x17.46875 table-cell [BFC] children: inline
line 0 width: 11.5625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
- frag 0 from TextNode start: 0, length: 1, rect: [17,29.375 11.5625x17.46875]
+ frag 0 from TextNode start: 0, length: 1, rect: [17,29.359375 11.5625x17.46875]
"X"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
@@ -79,9 +79,9 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
Box | at (11,67.203125) content-size 67.828125x54.203125 table-row children: not-inline
BlockContainer <(anonymous)> (not painted) children: inline
TextNode <#text>
- BlockContainer at (17,85.578125) content-size 11.5625x17.46875 table-cell [BFC] children: inline
+ BlockContainer | at (17,85.5625) content-size 11.5625x17.46875 table-cell [BFC] children: inline
line 0 width: 11.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
- frag 0 from TextNode start: 0, length: 1, rect: [17,85.578125 11.09375x17.46875]
+ frag 0 from TextNode start: 0, length: 1, rect: [17,85.5625 11.09375x17.46875]
"Y"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) children: inline
@@ -100,9 +100,9 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer(anonymous)) [8,8 784x0]
PaintableWithLines (TableWrapper(anonymous)) [8,8 75.828125x116.40625]
PaintableBox (Box) [8,8 75.828125x116.40625]
- PaintableBox (Box) [9,9 67.828125x108.40625] overflow: [9,9 71.828125x112.421875]
+ PaintableBox (Box) [9,9 67.828125x108.40625] overflow: [9,9 71.828125x112.40625]
PaintableBox (Box) [11,11 67.828125x54.203125] overflow: [11,11 69.828125x110.40625]
- PaintableWithLines (BlockContainer) [11,11 23.5625x54.21875]
+ PaintableWithLines (BlockContainer | ) [11,11 23.5625x54.1875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer | ) [36.5625,11 44.265625x110.40625]
PaintableWithLines (BlockContainer(anonymous)) [42.5625,17 32.265625x0]
@@ -122,7 +122,7 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer(anonymous)) [42.5625,17 0x0]
PaintableWithLines (BlockContainer(anonymous)) [42.5625,17 0x0]
PaintableWithLines (BlockContainer(anonymous)) [42.5625,115.40625 32.265625x0]
- PaintableBox (Box | ) [11,67.203125 67.828125x54.203125] overflow: [11,67.203125 67.828125x54.21875]
- PaintableWithLines (BlockContainer) [11,67.203125 23.5625x54.21875]
+ PaintableBox (Box | ) [11,67.203125 67.828125x54.203125]
+ PaintableWithLines (BlockContainer) [11,67.203125 23.5625x54.1875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer(anonymous)) [8,124.40625 784x0]
diff --git a/Tests/LibWeb/Layout/input/block-and-inline/columns-33-percent-width.html b/Tests/LibWeb/Layout/input/block-and-inline/columns-33-percent-width.html
new file mode 100644
index 00000000000..4d2166fec16
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/block-and-inline/columns-33-percent-width.html
@@ -0,0 +1,12 @@
+
\ No newline at end of file
diff --git a/Tests/LibWeb/Ref/reference/images/css-backgrounds-ref.png b/Tests/LibWeb/Ref/reference/images/css-backgrounds-ref.png
index 5f40faec8e6..7d0e69ddadf 100644
Binary files a/Tests/LibWeb/Ref/reference/images/css-backgrounds-ref.png and b/Tests/LibWeb/Ref/reference/images/css-backgrounds-ref.png differ
diff --git a/Tests/LibWeb/Ref/reference/images/object-fit-position.png b/Tests/LibWeb/Ref/reference/images/object-fit-position.png
index 95b59164e11..4330aad35de 100644
Binary files a/Tests/LibWeb/Ref/reference/images/object-fit-position.png and b/Tests/LibWeb/Ref/reference/images/object-fit-position.png differ
diff --git a/Tests/LibWeb/Ref/reference/images/svg-background-no-natural-size-ref.png b/Tests/LibWeb/Ref/reference/images/svg-background-no-natural-size-ref.png
index ecfafc469a4..56cb7f3f46f 100644
Binary files a/Tests/LibWeb/Ref/reference/images/svg-background-no-natural-size-ref.png and b/Tests/LibWeb/Ref/reference/images/svg-background-no-natural-size-ref.png differ
diff --git a/Tests/LibWeb/TestCSSPixels.cpp b/Tests/LibWeb/TestCSSPixels.cpp
index 33b53d8c5a0..4851c298438 100644
--- a/Tests/LibWeb/TestCSSPixels.cpp
+++ b/Tests/LibWeb/TestCSSPixels.cpp
@@ -36,15 +36,6 @@ TEST_CASE(division1)
b = CSSPixels(0.25);
EXPECT(!a.might_be_saturated());
EXPECT((a / b).might_be_saturated());
-
- // Results should be rounded:
- a = CSSPixels::smallest_positive_value() * 3;
- b = 2;
- EXPECT((a / b) == CSSPixels::smallest_positive_value() * 2);
-
- a = CSSPixels::smallest_positive_value() * -5;
- b = 3;
- EXPECT((a / b) == CSSPixels::smallest_positive_value() * -2);
}
TEST_CASE(multiplication1)
diff --git a/Userland/Libraries/LibWeb/PixelUnits.h b/Userland/Libraries/LibWeb/PixelUnits.h
index 5f1da7abbcc..7a69a66973e 100644
--- a/Userland/Libraries/LibWeb/PixelUnits.h
+++ b/Userland/Libraries/LibWeb/PixelUnits.h
@@ -288,14 +288,6 @@ constexpr CSSPixels operator*(T left, CSSPixels right) { return CSSPixels(left)
inline float operator*(float left, CSSPixels right) { return right.to_float() * left; }
inline double operator*(double left, CSSPixels right) { return right.to_double() * left; }
-template
-constexpr static T rounding_divide(T dividend, T divisor)
-{
- if ((dividend < 0) == (divisor < 0))
- return (dividend + (divisor / 2)) / divisor;
- return (dividend - (divisor / 2)) / divisor;
-}
-
class CSSPixelFraction {
public:
constexpr CSSPixelFraction(CSSPixels numerator, CSSPixels denominator)
@@ -321,7 +313,7 @@ public:
{
i64 wide_value = m_numerator.raw_value();
wide_value <<= CSSPixels::fractional_bits;
- wide_value = rounding_divide(wide_value, m_denominator.raw_value());
+ wide_value /= m_denominator.raw_value();
return CSSPixels::from_raw(AK::clamp_to(wide_value));
}
@@ -373,7 +365,7 @@ constexpr CSSPixels CSSPixels::operator*(CSSPixelFraction const& other) const
{
i64 wide_value = raw_value();
wide_value *= other.numerator().raw_value();
- wide_value = rounding_divide(wide_value, other.denominator().raw_value());
+ wide_value /= other.denominator().raw_value();
return CSSPixels::from_raw(AK::clamp_to(wide_value));
}
@@ -385,7 +377,7 @@ constexpr CSSPixels CSSPixels::operator/(CSSPixelFraction const& other) const
{
i64 wide_value = raw_value();
wide_value *= other.denominator().raw_value();
- wide_value = rounding_divide(wide_value, other.numerator().raw_value());
+ wide_value /= other.numerator().raw_value();
return CSSPixels::from_raw(AK::clamp_to(wide_value));
}
| | | | | |