diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations
index e7d834a15a308..07e20227d3ce6 100644
--- a/LayoutTests/TestExpectations
+++ b/LayoutTests/TestExpectations
@@ -1955,7 +1955,6 @@ imported/w3c/web-platform-tests/mathml/relations/css-styling/padding-border-marg
imported/w3c/web-platform-tests/mathml/relations/css-styling/table-width-2.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/mathml/relations/css-styling/table-width-3.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-002.html [ ImageOnlyFailure ]
-imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-003.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/mathml/presentation-markup/operators/mo-form-dynamic-002.html [ ImageOnlyFailure ]
# This MathML test should be rewritten.
diff --git a/LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/spaces/mspace-width-height-001-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/spaces/mspace-width-height-001-expected.txt
index e268e8f07e898..dae4ef901a9e7 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/spaces/mspace-width-height-001-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/spaces/mspace-width-height-001-expected.txt
@@ -1,6 +1,6 @@
-FAIL width attribute + width property assert_approx_equals: mspace width overridden by inline style expected 200 +/- 1 but got 500
-FAIL height/depth attributes + height property assert_approx_equals: mspace height overridden by inline style expected 200 +/- 1 but got 300
-FAIL height attribute + height property assert_approx_equals: mspace height overridden by inline style expected 200 +/- 1 but got 300
-FAIL depth attribute + height property assert_approx_equals: mspace height overridden by inline style expected 200 +/- 1 but got 300
+PASS width attribute + width property
+PASS height/depth attributes + height property
+PASS height attribute + height property
+PASS depth attribute + height property
diff --git a/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-001-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-001-expected.txt
index 123b8fce66a31..d8461bcf21cf1 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-001-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-001-expected.txt
@@ -1,28 +1,28 @@
-FAIL width and height properties on maction assert_approx_equals: width expected 500 +/- 1 but got 76.875
-FAIL inline-size and block-size properties on maction assert_approx_equals: width expected 600 +/- 1 but got 76.875
-FAIL width and height properties on maction (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 76.875
-FAIL width property on maction (preferred width) assert_approx_equals: expected 300 +/- 1 but got 76.875
-FAIL width and height properties on menclose assert_approx_equals: width expected 500 +/- 1 but got 88.03125
-FAIL inline-size and block-size properties on menclose assert_approx_equals: width expected 600 +/- 1 but got 88.03125
-FAIL width and height properties on menclose (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 88.03125
-FAIL width property on menclose (preferred width) assert_approx_equals: expected 300 +/- 1 but got 88.03125
-FAIL width and height properties on merror assert_approx_equals: width expected 500 +/- 1 but got 76.875
-FAIL inline-size and block-size properties on merror assert_approx_equals: width expected 600 +/- 1 but got 76.875
-FAIL width and height properties on merror (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 76.875
-FAIL width property on merror (preferred width) assert_approx_equals: expected 300 +/- 1 but got 76.875
-FAIL width and height properties on mfrac assert_approx_equals: width expected 500 +/- 1 but got 76.875
-FAIL inline-size and block-size properties on mfrac assert_approx_equals: width expected 600 +/- 1 but got 76.875
-FAIL width and height properties on mfrac (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 76.875
-FAIL width property on mfrac (preferred width) assert_approx_equals: expected 300 +/- 1 but got 76.875
+PASS width and height properties on maction
+PASS inline-size and block-size properties on maction
+PASS width and height properties on maction (content overflowing)
+PASS width property on maction (preferred width)
+PASS width and height properties on menclose
+PASS inline-size and block-size properties on menclose
+PASS width and height properties on menclose (content overflowing)
+PASS width property on menclose (preferred width)
+PASS width and height properties on merror
+PASS inline-size and block-size properties on merror
+PASS width and height properties on merror (content overflowing)
+PASS width property on merror (preferred width)
+PASS width and height properties on mfrac
+PASS inline-size and block-size properties on mfrac
+PASS width and height properties on mfrac (content overflowing)
+PASS width property on mfrac (preferred width)
PASS width and height properties on mi
PASS inline-size and block-size properties on mi
PASS width and height properties on mi (content overflowing)
PASS width property on mi (preferred width)
-FAIL width and height properties on mmultiscripts assert_approx_equals: width expected 500 +/- 1 but got 132.03125
-FAIL inline-size and block-size properties on mmultiscripts assert_approx_equals: width expected 600 +/- 1 but got 132.03125
-FAIL width and height properties on mmultiscripts (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 132.03125
-FAIL width property on mmultiscripts (preferred width) assert_approx_equals: expected 300 +/- 1 but got 132.03125
+PASS width and height properties on mmultiscripts
+PASS inline-size and block-size properties on mmultiscripts
+PASS width and height properties on mmultiscripts (content overflowing)
+PASS width property on mmultiscripts (preferred width)
PASS width and height properties on mn
PASS inline-size and block-size properties on mn
PASS width and height properties on mn (content overflowing)
@@ -31,54 +31,54 @@ PASS width and height properties on mo
PASS inline-size and block-size properties on mo
PASS width and height properties on mo (content overflowing)
FAIL width property on mo (preferred width) assert_approx_equals: expected 300 +/- 1 but got 308.875
-FAIL width and height properties on mover assert_approx_equals: width expected 500 +/- 1 but got 76.875
-FAIL inline-size and block-size properties on mover assert_approx_equals: width expected 600 +/- 1 but got 76.875
-FAIL width and height properties on mover (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 76.875
-FAIL width property on mover (preferred width) assert_approx_equals: expected 300 +/- 1 but got 76.875
-FAIL width and height properties on mpadded assert_approx_equals: width expected 500 +/- 1 but got 76.875
-FAIL inline-size and block-size properties on mpadded assert_approx_equals: width expected 600 +/- 1 but got 76.875
-FAIL width and height properties on mpadded (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 76.875
-FAIL width property on mpadded (preferred width) assert_approx_equals: expected 300 +/- 1 but got 76.875
-FAIL width and height properties on mphantom assert_approx_equals: width expected 500 +/- 1 but got 76.875
-FAIL inline-size and block-size properties on mphantom assert_approx_equals: width expected 600 +/- 1 but got 76.875
-FAIL width and height properties on mphantom (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 76.875
-FAIL width property on mphantom (preferred width) assert_approx_equals: expected 300 +/- 1 but got 76.875
-FAIL width and height properties on mroot assert_approx_equals: width expected 500 +/- 1 but got 128.53125
-FAIL inline-size and block-size properties on mroot assert_approx_equals: width expected 600 +/- 1 but got 128.53125
-FAIL width and height properties on mroot (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 128.53125
-FAIL width property on mroot (preferred width) assert_approx_equals: expected 300 +/- 1 but got 135.21875
-FAIL width and height properties on mrow assert_approx_equals: width expected 500 +/- 1 but got 76.875
-FAIL inline-size and block-size properties on mrow assert_approx_equals: width expected 600 +/- 1 but got 76.875
-FAIL width and height properties on mrow (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 76.875
-FAIL width property on mrow (preferred width) assert_approx_equals: expected 300 +/- 1 but got 76.875
+PASS width and height properties on mover
+PASS inline-size and block-size properties on mover
+PASS width and height properties on mover (content overflowing)
+PASS width property on mover (preferred width)
+PASS width and height properties on mpadded
+PASS inline-size and block-size properties on mpadded
+PASS width and height properties on mpadded (content overflowing)
+PASS width property on mpadded (preferred width)
+PASS width and height properties on mphantom
+PASS inline-size and block-size properties on mphantom
+PASS width and height properties on mphantom (content overflowing)
+PASS width property on mphantom (preferred width)
+PASS width and height properties on mroot
+PASS inline-size and block-size properties on mroot
+PASS width and height properties on mroot (content overflowing)
+PASS width property on mroot (preferred width)
+PASS width and height properties on mrow
+PASS inline-size and block-size properties on mrow
+PASS width and height properties on mrow (content overflowing)
+PASS width property on mrow (preferred width)
PASS width and height properties on ms
PASS inline-size and block-size properties on ms
PASS width and height properties on ms (content overflowing)
PASS width property on ms (preferred width)
-FAIL width and height properties on mspace assert_approx_equals: width expected 500 +/- 1 but got 0
-FAIL inline-size and block-size properties on mspace assert_approx_equals: width expected 600 +/- 1 but got 0
-FAIL width and height properties on mspace (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 0
-FAIL width property on mspace (preferred width) assert_approx_equals: expected 300 +/- 1 but got 0
-FAIL width and height properties on msqrt assert_approx_equals: width expected 500 +/- 1 but got 89.578125
-FAIL inline-size and block-size properties on msqrt assert_approx_equals: width expected 600 +/- 1 but got 89.578125
-FAIL width and height properties on msqrt (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 89.578125
-FAIL width property on msqrt (preferred width) assert_approx_equals: expected 300 +/- 1 but got 96.265625
-FAIL width and height properties on mstyle assert_approx_equals: width expected 500 +/- 1 but got 76.875
-FAIL inline-size and block-size properties on mstyle assert_approx_equals: width expected 600 +/- 1 but got 76.875
-FAIL width and height properties on mstyle (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 76.875
-FAIL width property on mstyle (preferred width) assert_approx_equals: expected 300 +/- 1 but got 76.875
-FAIL width and height properties on msub assert_approx_equals: width expected 500 +/- 1 but got 132.03125
-FAIL inline-size and block-size properties on msub assert_approx_equals: width expected 600 +/- 1 but got 132.03125
-FAIL width and height properties on msub (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 132.03125
-FAIL width property on msub (preferred width) assert_approx_equals: expected 300 +/- 1 but got 132.03125
-FAIL width and height properties on msubsup assert_approx_equals: width expected 500 +/- 1 but got 132.03125
-FAIL inline-size and block-size properties on msubsup assert_approx_equals: width expected 600 +/- 1 but got 132.03125
-FAIL width and height properties on msubsup (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 132.03125
-FAIL width property on msubsup (preferred width) assert_approx_equals: expected 300 +/- 1 but got 132.03125
-FAIL width and height properties on msup assert_approx_equals: width expected 500 +/- 1 but got 132.03125
-FAIL inline-size and block-size properties on msup assert_approx_equals: width expected 600 +/- 1 but got 132.03125
-FAIL width and height properties on msup (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 132.03125
-FAIL width property on msup (preferred width) assert_approx_equals: expected 300 +/- 1 but got 132.03125
+PASS width and height properties on mspace
+PASS inline-size and block-size properties on mspace
+PASS width and height properties on mspace (content overflowing)
+PASS width property on mspace (preferred width)
+PASS width and height properties on msqrt
+PASS inline-size and block-size properties on msqrt
+PASS width and height properties on msqrt (content overflowing)
+PASS width property on msqrt (preferred width)
+PASS width and height properties on mstyle
+PASS inline-size and block-size properties on mstyle
+PASS width and height properties on mstyle (content overflowing)
+PASS width property on mstyle (preferred width)
+PASS width and height properties on msub
+PASS inline-size and block-size properties on msub
+PASS width and height properties on msub (content overflowing)
+PASS width property on msub (preferred width)
+PASS width and height properties on msubsup
+PASS inline-size and block-size properties on msubsup
+PASS width and height properties on msubsup (content overflowing)
+PASS width property on msubsup (preferred width)
+PASS width and height properties on msup
+PASS inline-size and block-size properties on msup
+PASS width and height properties on msup (content overflowing)
+PASS width property on msup (preferred width)
PASS width and height properties on mtable
PASS inline-size and block-size properties on mtable
PASS width property on mtable (preferred width)
@@ -86,18 +86,18 @@ PASS width and height properties on mtext
PASS inline-size and block-size properties on mtext
PASS width and height properties on mtext (content overflowing)
PASS width property on mtext (preferred width)
-FAIL width and height properties on munder assert_approx_equals: width expected 500 +/- 1 but got 76.875
-FAIL inline-size and block-size properties on munder assert_approx_equals: width expected 600 +/- 1 but got 76.875
-FAIL width and height properties on munder (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 76.875
-FAIL width property on munder (preferred width) assert_approx_equals: expected 300 +/- 1 but got 76.875
-FAIL width and height properties on munderover assert_approx_equals: width expected 500 +/- 1 but got 76.875
-FAIL inline-size and block-size properties on munderover assert_approx_equals: width expected 600 +/- 1 but got 76.875
-FAIL width and height properties on munderover (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 76.875
-FAIL width property on munderover (preferred width) assert_approx_equals: expected 300 +/- 1 but got 76.875
-FAIL width and height properties on semantics assert_approx_equals: width expected 500 +/- 1 but got 76.875
-FAIL inline-size and block-size properties on semantics assert_approx_equals: width expected 600 +/- 1 but got 76.875
-FAIL width and height properties on semantics (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 76.875
-FAIL width property on semantics (preferred width) assert_approx_equals: expected 300 +/- 1 but got 76.875
+PASS width and height properties on munder
+PASS inline-size and block-size properties on munder
+PASS width and height properties on munder (content overflowing)
+PASS width property on munder (preferred width)
+PASS width and height properties on munderover
+PASS inline-size and block-size properties on munderover
+PASS width and height properties on munderover (content overflowing)
+PASS width property on munderover (preferred width)
+PASS width and height properties on semantics
+PASS inline-size and block-size properties on semantics
+PASS width and height properties on semantics (content overflowing)
+PASS width property on semantics (preferred width)
a
a
a
diff --git a/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-004-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-004-expected.txt
index af1962ce965e1..5e45b1ee93324 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-004-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-004-expected.txt
@@ -27,7 +27,6 @@ X
XXXXXXXXXXXX
XXXXXXXXXXXX
-
XXXXXXXXXXXX
XXXXXXXXXXXX
X
@@ -38,7 +37,6 @@ X
XXXXXXXXXXXX
XXXXXXXXXXXX
-
XXXXXXXXXXXX
XXXXXXXXXXXX
X
@@ -49,7 +47,6 @@ X
XXXXXXXXXXXX
XXXXXXXXXXXX
-
XXXXXXXXXXXX
XXXXXXXXXXXX
X
@@ -60,7 +57,6 @@ X
XXXXXXXXXXXX
XXXXXXXXXXXX
-
XXXXXXXXXXXX
XXXXXXXXXXXX
X
@@ -74,7 +70,6 @@ X
XXXXXXXXXXXX
XXXXXXXXXXXX
XXXXXXXXXXXX
-
XXXXXXXXXXXX
XXXXXXXXXXXX
XXXXXXXXXXXX
diff --git a/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-005-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-005-expected.txt
new file mode 100644
index 0000000000000..0d2ec974a62ba
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-005-expected.txt
@@ -0,0 +1,244 @@
+
+PASS mrow
+PASS mrow (horizontal overflow)
+PASS RTL mrow
+PASS RTL mrow (horizontal overflow)
+PASS mpadded
+PASS mpadded (horizontal overflow)
+PASS RTL mpadded
+PASS RTL mpadded (horizontal overflow)
+PASS msqrt
+PASS msqrt (horizontal overflow)
+PASS RTL msqrt
+PASS RTL msqrt (horizontal overflow)
+PASS mroot
+PASS mroot (horizontal overflow)
+PASS RTL mroot
+PASS RTL mroot (horizontal overflow)
+PASS msub
+PASS msub (horizontal overflow)
+PASS RTL msub
+PASS RTL msub (horizontal overflow)
+PASS msup
+PASS msup (horizontal overflow)
+PASS RTL msup
+PASS RTL msup (horizontal overflow)
+PASS msubsup
+PASS msubsup (horizontal overflow)
+PASS RTL msubsup
+PASS RTL msubsup (horizontal overflow)
+PASS mmultiscripts
+PASS mmultiscripts (horizontal overflow)
+PASS RTL mmultiscripts
+PASS RTL mmultiscripts (horizontal overflow)
+PASS mtext
+PASS mtext (horizontal overflow)
+PASS RTL mtext
+PASS RTL mtext (horizontal overflow)
+PASS legacy menclose
+PASS legacy menclose (horizontal overflow)
+PASS RTL legacy menclose
+PASS RTL legacy menclose (horizontal overflow)
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+
+X
+X
+
+X
+X
+X
+X
+
+X
+X
+
+X
+X
+X
+X
+
+X
+X
+
+X
+X
+X
+X
+
+X
+X
+
+X
+X
+X
+X
+
+X
+X
+
+X
+X
+X
+X
+
+X
+X
+
+X
+X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+X
+X
+X
+
+X
+X
+X
+X
+X
+
+X
+X
+X
+X
+X
+X
+X
+X
+X
+X
+
+X
+X
+X
+X
+X
+
+X
+X
+X
+X
+X
+X X X
+
+X X X
+
+X X X
+X X X
+
+X X X
+
+X X X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-006-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-006-expected.txt
new file mode 100644
index 0000000000000..a522ff0d18539
--- /dev/null
+++ b/LayoutTests/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-006-expected.txt
@@ -0,0 +1,156 @@
+
+PASS mrow
+PASS mrow (vertical overflow)
+PASS mpadded
+PASS mpadded (vertical overflow)
+PASS msqrt
+PASS msqrt (vertical overflow)
+PASS mroot
+PASS mroot (vertical overflow)
+PASS munder
+PASS munder (vertical overflow)
+PASS mover
+PASS mover (vertical overflow)
+PASS munderover
+PASS munderover (vertical overflow)
+PASS msub
+PASS msub (vertical overflow)
+PASS msup
+PASS msup (vertical overflow)
+PASS msubsup
+PASS msubsup (vertical overflow)
+PASS mmultiscripts
+PASS mmultiscripts (vertical overflow)
+PASS mtext
+PASS mtext (vertical overflow)
+PASS legacy menclose
+PASS legacy menclose (vertical overflow)
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+
+X
+X
+
+X
+X
+X
+X
+
+X
+X
+
+X
+X
+X
+X
+
+X
+X
+
+X
+X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+
+X
+X
+
+X
+X
+X
+X
+
+X
+X
+
+X
+X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+X
+X
+X
+X
+X
+
+X
+X
+X
+X
+X
+
+X
+X
+X
+X
+X
+X X X
+
+X X X
+
+X X X
+X
+X
+X
+
+X
+X
+X
+
+X
+X
+X
+
diff --git a/LayoutTests/mathml/presentation/mspace-prefered-width-expected.html b/LayoutTests/mathml/presentation/mspace-prefered-width-expected.html
index 814f339dce709..aec26842c0f5f 100644
--- a/LayoutTests/mathml/presentation/mspace-prefered-width-expected.html
+++ b/LayoutTests/mathml/presentation/mspace-prefered-width-expected.html
@@ -14,10 +14,10 @@
-
+
|
-
+
|
diff --git a/LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/display-2-expected.txt b/LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/display-2-expected.txt
index eba20416b3051..aa738f98c952e 100644
--- a/LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/display-2-expected.txt
+++ b/LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/display-2-expected.txt
@@ -1,19 +1,19 @@
-FAIL block display assert_approx_equals: block size expected 49 +/- 1 but got 20
-FAIL block display with contrained width assert_approx_equals: block size expected 78 +/- 1 but got 20
-FAIL list display inside display block assert_approx_equals: block size expected 194 +/- 1 but got 63
-FAIL inline display assert_approx_equals: block size expected 29 +/- 1 but got 20
-FAIL inline-block display assert_approx_equals: block size expected 29 +/- 1 but got 20
-FAIL table display (math) assert_approx_equals: block size expected 78 +/- 1 but got 28
-FAIL table display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 28
-FAIL inline-table display (math) assert_approx_equals: block size expected 58 +/- 1 but got 20
-FAIL inline-table display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 28
-FAIL flexbox display (math) assert_approx_equals: block size expected 95 +/- 1 but got 20
-FAIL flexbox display (mrow) assert_approx_equals: block size expected 95 +/- 1 but got 20
-FAIL grid display (math) assert_approx_equals: block size expected 99 +/- 1 but got 20
-FAIL grid display (mrow) assert_approx_equals: block size expected 99 +/- 1 but got 20
-FAIL ruby display (math) assert_approx_equals: block size expected 78 +/- 1 but got 20
-FAIL ruby display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 20
-FAIL block display with column width (math) assert_approx_equals: block size expected 49 +/- 1 but got 20
-FAIL block display with column width (mrow) assert_approx_equals: block size expected 49 +/- 1 but got 20
+FAIL block display assert_approx_equals: block size expected 49 +/- 1 but got 45
+FAIL block display with contrained width assert_approx_equals: block size expected 78 +/- 1 but got 70
+FAIL list display inside display block assert_approx_equals: block size expected 194 +/- 1 but got 78
+FAIL inline display assert_approx_equals: block size expected 29 +/- 1 but got 41
+FAIL inline-block display assert_approx_equals: block size expected 29 +/- 1 but got 41
+FAIL table display (math) assert_approx_equals: block size expected 78 +/- 1 but got 95
+FAIL table display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 95
+FAIL inline-table display (math) assert_approx_equals: block size expected 58 +/- 1 but got 75
+FAIL inline-table display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 95
+FAIL flexbox display (math) assert_approx_equals: block size expected 95 +/- 1 but got 45
+FAIL flexbox display (mrow) assert_approx_equals: block size expected 95 +/- 1 but got 45
+FAIL grid display (math) assert_approx_equals: block size expected 99 +/- 1 but got 45
+FAIL grid display (mrow) assert_approx_equals: block size expected 99 +/- 1 but got 45
+FAIL ruby display (math) assert_approx_equals: block size expected 78 +/- 1 but got 41
+FAIL ruby display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 45
+FAIL block display with column width (math) assert_approx_equals: block size expected 49 +/- 1 but got 45
+FAIL block display with column width (mrow) assert_approx_equals: block size expected 49 +/- 1 but got 45
diff --git a/LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-001-expected.txt b/LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-001-expected.txt
deleted file mode 100644
index 4b6bc4316f692..0000000000000
--- a/LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-001-expected.txt
+++ /dev/null
@@ -1,396 +0,0 @@
-
-FAIL width and height properties on maction assert_approx_equals: width expected 500 +/- 1 but got 80
-FAIL inline-size and block-size properties on maction assert_approx_equals: width expected 600 +/- 1 but got 80
-FAIL width and height properties on maction (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 80
-FAIL width property on maction (preferred width) assert_approx_equals: expected 300 +/- 1 but got 80
-FAIL width and height properties on menclose assert_approx_equals: width expected 500 +/- 1 but got 91.15625
-FAIL inline-size and block-size properties on menclose assert_approx_equals: width expected 600 +/- 1 but got 91.15625
-FAIL width and height properties on menclose (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 91.15625
-FAIL width property on menclose (preferred width) assert_approx_equals: expected 300 +/- 1 but got 91.15625
-FAIL width and height properties on merror assert_approx_equals: width expected 500 +/- 1 but got 80
-FAIL inline-size and block-size properties on merror assert_approx_equals: width expected 600 +/- 1 but got 80
-FAIL width and height properties on merror (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 80
-FAIL width property on merror (preferred width) assert_approx_equals: expected 300 +/- 1 but got 80
-FAIL width and height properties on mfrac assert_approx_equals: width expected 500 +/- 1 but got 80
-FAIL inline-size and block-size properties on mfrac assert_approx_equals: width expected 600 +/- 1 but got 80
-FAIL width and height properties on mfrac (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 80
-FAIL width property on mfrac (preferred width) assert_approx_equals: expected 300 +/- 1 but got 80
-PASS width and height properties on mi
-PASS inline-size and block-size properties on mi
-PASS width and height properties on mi (content overflowing)
-PASS width property on mi (preferred width)
-FAIL width and height properties on mmultiscripts assert_approx_equals: width expected 500 +/- 1 but got 140.890625
-FAIL inline-size and block-size properties on mmultiscripts assert_approx_equals: width expected 600 +/- 1 but got 140.890625
-FAIL width and height properties on mmultiscripts (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 140.890625
-FAIL width property on mmultiscripts (preferred width) assert_approx_equals: expected 300 +/- 1 but got 140.890625
-PASS width and height properties on mn
-PASS inline-size and block-size properties on mn
-PASS width and height properties on mn (content overflowing)
-PASS width property on mn (preferred width)
-PASS width and height properties on mo
-PASS inline-size and block-size properties on mo
-PASS width and height properties on mo (content overflowing)
-FAIL width property on mo (preferred width) assert_approx_equals: expected 300 +/- 1 but got 308.875
-FAIL width and height properties on mover assert_approx_equals: width expected 500 +/- 1 but got 80
-FAIL inline-size and block-size properties on mover assert_approx_equals: width expected 600 +/- 1 but got 80
-FAIL width and height properties on mover (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 80
-FAIL width property on mover (preferred width) assert_approx_equals: expected 300 +/- 1 but got 80
-FAIL width and height properties on mpadded assert_approx_equals: width expected 500 +/- 1 but got 80
-FAIL inline-size and block-size properties on mpadded assert_approx_equals: width expected 600 +/- 1 but got 80
-FAIL width and height properties on mpadded (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 80
-FAIL width property on mpadded (preferred width) assert_approx_equals: expected 300 +/- 1 but got 80
-FAIL width and height properties on mphantom assert_approx_equals: width expected 500 +/- 1 but got 80
-FAIL inline-size and block-size properties on mphantom assert_approx_equals: width expected 600 +/- 1 but got 80
-FAIL width and height properties on mphantom (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 80
-FAIL width property on mphantom (preferred width) assert_approx_equals: expected 300 +/- 1 but got 80
-FAIL width and height properties on mroot assert_approx_equals: width expected 500 +/- 1 but got 138.546875
-FAIL inline-size and block-size properties on mroot assert_approx_equals: width expected 600 +/- 1 but got 138.546875
-FAIL width and height properties on mroot (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 138.546875
-FAIL width property on mroot (preferred width) assert_approx_equals: expected 300 +/- 1 but got 142.546875
-FAIL width and height properties on mrow assert_approx_equals: width expected 500 +/- 1 but got 80
-FAIL inline-size and block-size properties on mrow assert_approx_equals: width expected 600 +/- 1 but got 80
-FAIL width and height properties on mrow (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 80
-FAIL width property on mrow (preferred width) assert_approx_equals: expected 300 +/- 1 but got 80
-PASS width and height properties on ms
-PASS inline-size and block-size properties on ms
-PASS width and height properties on ms (content overflowing)
-PASS width property on ms (preferred width)
-FAIL width and height properties on mspace assert_approx_equals: width expected 500 +/- 1 but got 0
-FAIL inline-size and block-size properties on mspace assert_approx_equals: width expected 600 +/- 1 but got 0
-FAIL width and height properties on mspace (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 0
-FAIL width property on mspace (preferred width) assert_approx_equals: expected 300 +/- 1 but got 0
-FAIL width and height properties on msqrt assert_approx_equals: width expected 500 +/- 1 but got 93
-FAIL inline-size and block-size properties on msqrt assert_approx_equals: width expected 600 +/- 1 but got 93
-FAIL width and height properties on msqrt (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 93
-FAIL width property on msqrt (preferred width) assert_approx_equals: expected 300 +/- 1 but got 97
-FAIL width and height properties on mstyle assert_approx_equals: width expected 500 +/- 1 but got 80
-FAIL inline-size and block-size properties on mstyle assert_approx_equals: width expected 600 +/- 1 but got 80
-FAIL width and height properties on mstyle (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 80
-FAIL width property on mstyle (preferred width) assert_approx_equals: expected 300 +/- 1 but got 80
-FAIL width and height properties on msub assert_approx_equals: width expected 500 +/- 1 but got 140.890625
-FAIL inline-size and block-size properties on msub assert_approx_equals: width expected 600 +/- 1 but got 140.890625
-FAIL width and height properties on msub (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 140.890625
-FAIL width property on msub (preferred width) assert_approx_equals: expected 300 +/- 1 but got 140.890625
-FAIL width and height properties on msubsup assert_approx_equals: width expected 500 +/- 1 but got 140.890625
-FAIL inline-size and block-size properties on msubsup assert_approx_equals: width expected 600 +/- 1 but got 140.890625
-FAIL width and height properties on msubsup (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 140.890625
-FAIL width property on msubsup (preferred width) assert_approx_equals: expected 300 +/- 1 but got 140.890625
-FAIL width and height properties on msup assert_approx_equals: width expected 500 +/- 1 but got 140.890625
-FAIL inline-size and block-size properties on msup assert_approx_equals: width expected 600 +/- 1 but got 140.890625
-FAIL width and height properties on msup (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 140.890625
-FAIL width property on msup (preferred width) assert_approx_equals: expected 300 +/- 1 but got 140.890625
-PASS width and height properties on mtable
-PASS inline-size and block-size properties on mtable
-PASS width property on mtable (preferred width)
-PASS width and height properties on mtext
-PASS inline-size and block-size properties on mtext
-PASS width and height properties on mtext (content overflowing)
-PASS width property on mtext (preferred width)
-FAIL width and height properties on munder assert_approx_equals: width expected 500 +/- 1 but got 80
-FAIL inline-size and block-size properties on munder assert_approx_equals: width expected 600 +/- 1 but got 80
-FAIL width and height properties on munder (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 80
-FAIL width property on munder (preferred width) assert_approx_equals: expected 300 +/- 1 but got 80
-FAIL width and height properties on munderover assert_approx_equals: width expected 500 +/- 1 but got 80
-FAIL inline-size and block-size properties on munderover assert_approx_equals: width expected 600 +/- 1 but got 80
-FAIL width and height properties on munderover (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 80
-FAIL width property on munderover (preferred width) assert_approx_equals: expected 300 +/- 1 but got 80
-FAIL width and height properties on semantics assert_approx_equals: width expected 500 +/- 1 but got 80
-FAIL inline-size and block-size properties on semantics assert_approx_equals: width expected 600 +/- 1 but got 80
-FAIL width and height properties on semantics (content overflowing) assert_approx_equals: width expected 2 +/- 1 but got 80
-FAIL width property on semantics (preferred width) assert_approx_equals: expected 300 +/- 1 but got 80
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-aaaaaaaaaa
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-aaaaaaaaaa
-aaaaaaaaaa
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-aaaaaaaaaa
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-aaaaaaaaaa
-aaaaaaaaaa
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
-a
diff --git a/LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-005-expected.txt b/LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-005-expected.txt
deleted file mode 100644
index 44b40b630745a..0000000000000
--- a/LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-005-expected.txt
+++ /dev/null
@@ -1,244 +0,0 @@
-
-FAIL mrow assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mrow (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mrow assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mrow (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mpadded assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mpadded (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mpadded assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mpadded (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msqrt assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msqrt (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msqrt assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msqrt (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mroot assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mroot (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mroot assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mroot (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msub assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msub (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msub assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msub (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msup assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msup (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msup assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msup (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msubsup assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msubsup (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msubsup assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msubsup (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mmultiscripts assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mmultiscripts (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mmultiscripts assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mmultiscripts (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-PASS mtext
-PASS mtext (horizontal overflow)
-PASS RTL mtext
-PASS RTL mtext (horizontal overflow)
-FAIL legacy menclose assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL legacy menclose (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL legacy menclose assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL legacy menclose (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-X X X
-
-X X X
-
-X X X
-X X X
-
-X X X
-
-X X X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-
diff --git a/LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-006-expected.txt b/LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-006-expected.txt
deleted file mode 100644
index 1ecc5234eae0d..0000000000000
--- a/LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-006-expected.txt
+++ /dev/null
@@ -1,156 +0,0 @@
-
-PASS mrow
-PASS mrow (vertical overflow)
-FAIL mpadded assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mpadded (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msqrt assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msqrt (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mroot assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mroot (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL munder assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL munder (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mover assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mover (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL munderover assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL munderover (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msub assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msub (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msup assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msup (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msubsup assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msubsup (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mmultiscripts assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mmultiscripts (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-PASS mtext
-PASS mtext (vertical overflow)
-FAIL legacy menclose assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL legacy menclose (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-X X X
-
-X X X
-
-X X X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-
diff --git a/LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/css-styling/display-2-expected.txt b/LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/css-styling/display-2-expected.txt
index eba20416b3051..aa738f98c952e 100644
--- a/LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/css-styling/display-2-expected.txt
+++ b/LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/css-styling/display-2-expected.txt
@@ -1,19 +1,19 @@
-FAIL block display assert_approx_equals: block size expected 49 +/- 1 but got 20
-FAIL block display with contrained width assert_approx_equals: block size expected 78 +/- 1 but got 20
-FAIL list display inside display block assert_approx_equals: block size expected 194 +/- 1 but got 63
-FAIL inline display assert_approx_equals: block size expected 29 +/- 1 but got 20
-FAIL inline-block display assert_approx_equals: block size expected 29 +/- 1 but got 20
-FAIL table display (math) assert_approx_equals: block size expected 78 +/- 1 but got 28
-FAIL table display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 28
-FAIL inline-table display (math) assert_approx_equals: block size expected 58 +/- 1 but got 20
-FAIL inline-table display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 28
-FAIL flexbox display (math) assert_approx_equals: block size expected 95 +/- 1 but got 20
-FAIL flexbox display (mrow) assert_approx_equals: block size expected 95 +/- 1 but got 20
-FAIL grid display (math) assert_approx_equals: block size expected 99 +/- 1 but got 20
-FAIL grid display (mrow) assert_approx_equals: block size expected 99 +/- 1 but got 20
-FAIL ruby display (math) assert_approx_equals: block size expected 78 +/- 1 but got 20
-FAIL ruby display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 20
-FAIL block display with column width (math) assert_approx_equals: block size expected 49 +/- 1 but got 20
-FAIL block display with column width (mrow) assert_approx_equals: block size expected 49 +/- 1 but got 20
+FAIL block display assert_approx_equals: block size expected 49 +/- 1 but got 45
+FAIL block display with contrained width assert_approx_equals: block size expected 78 +/- 1 but got 70
+FAIL list display inside display block assert_approx_equals: block size expected 194 +/- 1 but got 78
+FAIL inline display assert_approx_equals: block size expected 29 +/- 1 but got 41
+FAIL inline-block display assert_approx_equals: block size expected 29 +/- 1 but got 41
+FAIL table display (math) assert_approx_equals: block size expected 78 +/- 1 but got 95
+FAIL table display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 95
+FAIL inline-table display (math) assert_approx_equals: block size expected 58 +/- 1 but got 75
+FAIL inline-table display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 95
+FAIL flexbox display (math) assert_approx_equals: block size expected 95 +/- 1 but got 45
+FAIL flexbox display (mrow) assert_approx_equals: block size expected 95 +/- 1 but got 45
+FAIL grid display (math) assert_approx_equals: block size expected 99 +/- 1 but got 45
+FAIL grid display (mrow) assert_approx_equals: block size expected 99 +/- 1 but got 45
+FAIL ruby display (math) assert_approx_equals: block size expected 78 +/- 1 but got 41
+FAIL ruby display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 45
+FAIL block display with column width (math) assert_approx_equals: block size expected 49 +/- 1 but got 45
+FAIL block display with column width (mrow) assert_approx_equals: block size expected 49 +/- 1 but got 45
diff --git a/LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-005-expected.txt b/LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-005-expected.txt
deleted file mode 100644
index 44b40b630745a..0000000000000
--- a/LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-005-expected.txt
+++ /dev/null
@@ -1,244 +0,0 @@
-
-FAIL mrow assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mrow (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mrow assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mrow (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mpadded assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mpadded (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mpadded assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mpadded (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msqrt assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msqrt (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msqrt assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msqrt (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mroot assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mroot (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mroot assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mroot (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msub assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msub (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msub assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msub (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msup assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msup (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msup assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msup (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msubsup assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msubsup (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msubsup assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msubsup (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mmultiscripts assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mmultiscripts (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mmultiscripts assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mmultiscripts (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-PASS mtext
-PASS mtext (horizontal overflow)
-PASS RTL mtext
-PASS RTL mtext (horizontal overflow)
-FAIL legacy menclose assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL legacy menclose (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL legacy menclose assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL legacy menclose (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-X X X
-
-X X X
-
-X X X
-X X X
-
-X X X
-
-X X X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-
diff --git a/LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-006-expected.txt b/LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-006-expected.txt
deleted file mode 100644
index 1ecc5234eae0d..0000000000000
--- a/LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-006-expected.txt
+++ /dev/null
@@ -1,156 +0,0 @@
-
-PASS mrow
-PASS mrow (vertical overflow)
-FAIL mpadded assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mpadded (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msqrt assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msqrt (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mroot assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mroot (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL munder assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL munder (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mover assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mover (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL munderover assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL munderover (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msub assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msub (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msup assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msup (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msubsup assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msubsup (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mmultiscripts assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mmultiscripts (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-PASS mtext
-PASS mtext (vertical overflow)
-FAIL legacy menclose assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL legacy menclose (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-X X X
-
-X X X
-
-X X X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-
diff --git a/LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/display-2-expected.txt b/LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/display-2-expected.txt
index eba20416b3051..aa738f98c952e 100644
--- a/LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/display-2-expected.txt
+++ b/LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/display-2-expected.txt
@@ -1,19 +1,19 @@
-FAIL block display assert_approx_equals: block size expected 49 +/- 1 but got 20
-FAIL block display with contrained width assert_approx_equals: block size expected 78 +/- 1 but got 20
-FAIL list display inside display block assert_approx_equals: block size expected 194 +/- 1 but got 63
-FAIL inline display assert_approx_equals: block size expected 29 +/- 1 but got 20
-FAIL inline-block display assert_approx_equals: block size expected 29 +/- 1 but got 20
-FAIL table display (math) assert_approx_equals: block size expected 78 +/- 1 but got 28
-FAIL table display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 28
-FAIL inline-table display (math) assert_approx_equals: block size expected 58 +/- 1 but got 20
-FAIL inline-table display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 28
-FAIL flexbox display (math) assert_approx_equals: block size expected 95 +/- 1 but got 20
-FAIL flexbox display (mrow) assert_approx_equals: block size expected 95 +/- 1 but got 20
-FAIL grid display (math) assert_approx_equals: block size expected 99 +/- 1 but got 20
-FAIL grid display (mrow) assert_approx_equals: block size expected 99 +/- 1 but got 20
-FAIL ruby display (math) assert_approx_equals: block size expected 78 +/- 1 but got 20
-FAIL ruby display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 20
-FAIL block display with column width (math) assert_approx_equals: block size expected 49 +/- 1 but got 20
-FAIL block display with column width (mrow) assert_approx_equals: block size expected 49 +/- 1 but got 20
+FAIL block display assert_approx_equals: block size expected 49 +/- 1 but got 45
+FAIL block display with contrained width assert_approx_equals: block size expected 78 +/- 1 but got 70
+FAIL list display inside display block assert_approx_equals: block size expected 194 +/- 1 but got 78
+FAIL inline display assert_approx_equals: block size expected 29 +/- 1 but got 41
+FAIL inline-block display assert_approx_equals: block size expected 29 +/- 1 but got 41
+FAIL table display (math) assert_approx_equals: block size expected 78 +/- 1 but got 95
+FAIL table display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 95
+FAIL inline-table display (math) assert_approx_equals: block size expected 58 +/- 1 but got 75
+FAIL inline-table display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 95
+FAIL flexbox display (math) assert_approx_equals: block size expected 95 +/- 1 but got 45
+FAIL flexbox display (mrow) assert_approx_equals: block size expected 95 +/- 1 but got 45
+FAIL grid display (math) assert_approx_equals: block size expected 99 +/- 1 but got 45
+FAIL grid display (mrow) assert_approx_equals: block size expected 99 +/- 1 but got 45
+FAIL ruby display (math) assert_approx_equals: block size expected 78 +/- 1 but got 41
+FAIL ruby display (mrow) assert_approx_equals: block size expected 78 +/- 1 but got 45
+FAIL block display with column width (math) assert_approx_equals: block size expected 49 +/- 1 but got 45
+FAIL block display with column width (mrow) assert_approx_equals: block size expected 49 +/- 1 but got 45
diff --git a/LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-005-expected.txt b/LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-005-expected.txt
deleted file mode 100644
index 44b40b630745a..0000000000000
--- a/LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-005-expected.txt
+++ /dev/null
@@ -1,244 +0,0 @@
-
-FAIL mrow assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mrow (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mrow assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mrow (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mpadded assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mpadded (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mpadded assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mpadded (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msqrt assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msqrt (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msqrt assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msqrt (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mroot assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mroot (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mroot assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mroot (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msub assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msub (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msub assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msub (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msup assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msup (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msup assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msup (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msubsup assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL msubsup (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msubsup assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL msubsup (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mmultiscripts assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL mmultiscripts (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mmultiscripts assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL mmultiscripts (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-PASS mtext
-PASS mtext (horizontal overflow)
-PASS RTL mtext
-PASS RTL mtext (horizontal overflow)
-FAIL legacy menclose assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL legacy menclose (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL legacy menclose assert_greater_than: width is modified expected a number greater than 1 but got 0
-FAIL RTL legacy menclose (horizontal overflow) assert_greater_than: width is modified expected a number greater than 1 but got 0
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-X X X
-
-X X X
-
-X X X
-X X X
-
-X X X
-
-X X X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-
diff --git a/LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-006-expected.txt b/LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-006-expected.txt
deleted file mode 100644
index 1ecc5234eae0d..0000000000000
--- a/LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/css-styling/width-height-006-expected.txt
+++ /dev/null
@@ -1,156 +0,0 @@
-
-PASS mrow
-PASS mrow (vertical overflow)
-FAIL mpadded assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mpadded (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msqrt assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msqrt (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mroot assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mroot (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL munder assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL munder (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mover assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mover (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL munderover assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL munderover (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msub assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msub (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msup assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msup (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msubsup assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL msubsup (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mmultiscripts assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL mmultiscripts (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-PASS mtext
-PASS mtext (vertical overflow)
-FAIL legacy menclose assert_greater_than: height is modified expected a number greater than 1 but got 0
-FAIL legacy menclose (vertical overflow) assert_greater_than: height is modified expected a number greater than 1 but got 0
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-
-X
-X
-X
-X
-X
-X X X
-
-X X X
-
-X X X
-X
-X
-X
-
-X
-X
-X
-
-X
-X
-X
-
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp b/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
index 9f35f3884c546..9dedab879b947 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
@@ -283,6 +283,51 @@ void RenderMathMLBlock::adjustLayoutForBorderAndPadding()
shiftInFlowChildren(style().isLeftToRightDirection() ? borderAndPaddingStart() : borderAndPaddingEnd(), borderAndPaddingBefore());
}
+RenderMathMLBlock::SizeAppliedToMathContent RenderMathMLBlock::sizeAppliedToMathContent(LayoutPhase phase)
+{
+ SizeAppliedToMathContent sizes;
+ // FIXME: Resolve percentages.
+ // https://github.com/w3c/mathml-core/issues/76
+ if (style().logicalWidth().isFixed())
+ sizes.logicalWidth = style().logicalWidth().value();
+
+ // FIXME: Resolve percentages.
+ // https://github.com/w3c/mathml-core/issues/77
+ if (phase == LayoutPhase::Layout && style().logicalHeight().isFixed())
+ sizes.logicalHeight = style().logicalHeight().value();
+
+ return sizes;
+}
+
+LayoutUnit RenderMathMLBlock::applySizeToMathContent(LayoutPhase phase, const SizeAppliedToMathContent& sizes)
+{
+ if (phase == LayoutPhase::CalculatePreferredLogicalWidth) {
+ ASSERT(preferredLogicalWidthsDirty());
+ if (sizes.logicalWidth) {
+ m_minPreferredLogicalWidth = *sizes.logicalWidth;
+ m_maxPreferredLogicalWidth = *sizes.logicalWidth;
+ }
+ return LayoutUnit();
+ }
+
+ ASSERT(phase == LayoutPhase::Layout);
+
+ LayoutUnit inlineShift = 0;
+ if (sizes.logicalWidth) {
+ auto oldWidth = logicalWidth();
+ if (isMathContentCentered()) {
+ inlineShift = (*sizes.logicalWidth - oldWidth) / 2;
+ } else if (!style().isLeftToRightDirection())
+ inlineShift = *sizes.logicalWidth - oldWidth;
+ setLogicalWidth(*sizes.logicalWidth);
+ }
+
+ if (sizes.logicalHeight)
+ setLogicalHeight(*sizes.logicalHeight);
+
+ return inlineShift;
+}
+
}
#endif
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
index df5040fcc8636..4c2e3682cb6d8 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
@@ -81,6 +81,22 @@ class RenderMathMLBlock : public RenderBlock {
void adjustPreferredLogicalWidthsForBorderAndPadding();
void adjustLayoutForBorderAndPadding();
+ enum class LayoutPhase : uint8_t {
+ CalculatePreferredLogicalWidth,
+ Layout,
+ };
+ struct SizeAppliedToMathContent {
+ std::optional logicalWidth;
+ std::optional logicalHeight;
+ };
+ // Retrieve the specified (and supported) CSS width/height to apply to math
+ // content box, if any.
+ SizeAppliedToMathContent sizeAppliedToMathContent(LayoutPhase);
+ // Whether math content should be centered on the inline axis if a different size is specified by the user.
+ virtual bool isMathContentCentered() const { return false; }
+ // Apply the specified CSS width/height to the math content box and return inline shift for further adjustments.
+ LayoutUnit applySizeToMathContent(LayoutPhase, const SizeAppliedToMathContent&);
+
private:
bool isRenderMathMLBlock() const final { return true; }
ASCIILiteral renderName() const override { return "RenderMathMLBlock"_s; }
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
index 8b1a77eb8f7fe..5a17308bc58af 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
@@ -190,6 +190,9 @@ void RenderMathMLFraction::computePreferredLogicalWidths()
LayoutUnit denominatorWidth = denominator().maxPreferredLogicalWidth() + marginIntrinsicLogicalWidthForChild(denominator());
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = std::max(numeratorWidth, denominatorWidth);
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::CalculatePreferredLogicalWidth);
+ applySizeToMathContent(LayoutPhase::CalculatePreferredLogicalWidth, sizes);
+
adjustPreferredLogicalWidthsForBorderAndPadding();
setPreferredLogicalWidthsDirty(false);
@@ -267,6 +270,10 @@ void RenderMathMLFraction::layoutBlock(bool relayoutChildren, LayoutUnit)
setLogicalHeight(verticalOffset);
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::Layout);
+ auto shift = applySizeToMathContent(LayoutPhase::Layout, sizes);
+ shiftInFlowChildren(shift, 0);
+
adjustLayoutForBorderAndPadding();
layoutPositionedObjects(relayoutChildren);
@@ -291,6 +298,7 @@ void RenderMathMLFraction::paint(PaintInfo& info, const LayoutPoint& paintOffset
info.context().setStrokeThickness(thickness);
info.context().setStrokeStyle(StrokeStyle::SolidStroke);
info.context().setStrokeColor(style().visitedDependentColorWithColorFilter(CSSPropertyColor));
+ // MathML Core says the fraction bar takes the full width of the content box.
info.context().drawLine(adjustedPaintOffset, roundedIntPoint(LayoutPoint(adjustedPaintOffset.x() + logicalWidth() - borderAndPaddingLogicalWidth(), LayoutUnit(adjustedPaintOffset.y()))));
}
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.h b/Source/WebCore/rendering/mathml/RenderMathMLFraction.h
index 9b9c838984f69..45f5fe30ae6b1 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.h
@@ -55,6 +55,7 @@ class RenderMathMLFraction final : public RenderMathMLRow {
std::optional firstLineBaseline() const final;
void paint(PaintInfo&, const LayoutPoint&) final;
RenderMathMLOperator* unembellishedOperator() const final;
+ bool isMathContentCentered() const final { return true; }
MathMLFractionElement& element() const { return static_cast(nodeForNonAnonymous()); }
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp b/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp
index b67cdb456cccc..3938773bce418 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp
@@ -167,6 +167,9 @@ void RenderMathMLMenclose::computePreferredLogicalWidths()
preferredWidth += space.left + space.right;
m_maxPreferredLogicalWidth = m_minPreferredLogicalWidth = preferredWidth;
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::CalculatePreferredLogicalWidth);
+ applySizeToMathContent(LayoutPhase::CalculatePreferredLogicalWidth, sizes);
+
adjustPreferredLogicalWidthsForBorderAndPadding();
setPreferredLogicalWidthsDirty(false);
@@ -198,6 +201,10 @@ void RenderMathMLMenclose::layoutBlock(bool relayoutChildren, LayoutUnit)
m_contentRect = LayoutRect(space.left, space.top, contentWidth, contentAscent + contentDescent);
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::Layout);
+ auto shift = applySizeToMathContent(LayoutPhase::Layout, sizes);
+ shiftInFlowChildren(shift, 0);
+
adjustLayoutForBorderAndPadding();
m_contentRect.moveBy(LayoutPoint(borderLeft() + paddingLeft(), borderAndPaddingBefore()));
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp b/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp
index 0452bc9364aa6..c26a249169696 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp
@@ -81,6 +81,9 @@ void RenderMathMLPadded::computePreferredLogicalWidths()
preferredWidth = mpaddedWidth(preferredWidth);
m_maxPreferredLogicalWidth = m_minPreferredLogicalWidth = preferredWidth;
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::CalculatePreferredLogicalWidth);
+ applySizeToMathContent(LayoutPhase::CalculatePreferredLogicalWidth, sizes);
+
adjustPreferredLogicalWidthsForBorderAndPadding();
setPreferredLogicalWidthsDirty(false);
@@ -118,6 +121,10 @@ void RenderMathMLPadded::layoutBlock(bool relayoutChildren, LayoutUnit)
setLogicalWidth(width);
setLogicalHeight(ascent + descent);
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::Layout);
+ auto shift = applySizeToMathContent(LayoutPhase::Layout, sizes);
+ shiftInFlowChildren(shift, 0);
+
adjustLayoutForBorderAndPadding();
layoutPositionedObjects(relayoutChildren);
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp b/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
index 26598116068be..2eb7b47f0990a 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
@@ -181,6 +181,9 @@ void RenderMathMLRoot::computePreferredLogicalWidths()
}
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = preferredWidth;
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::CalculatePreferredLogicalWidth);
+ applySizeToMathContent(LayoutPhase::CalculatePreferredLogicalWidth, sizes);
+
adjustPreferredLogicalWidthsForBorderAndPadding();
setPreferredLogicalWidthsDirty(false);
@@ -272,6 +275,10 @@ void RenderMathMLRoot::layoutBlock(bool relayoutChildren, LayoutUnit)
setLogicalHeight(ascent + descent);
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::Layout);
+ auto shift = applySizeToMathContent(LayoutPhase::Layout, sizes);
+ shiftInFlowChildren(shift, 0);
+
adjustLayoutForBorderAndPadding();
layoutPositionedObjects(relayoutChildren);
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp b/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
index 9248cb43db007..3a60679f102ae 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
@@ -134,6 +134,9 @@ void RenderMathMLRow::computePreferredLogicalWidths()
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = preferredLogicalWidthOfRowItems();
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::CalculatePreferredLogicalWidth);
+ applySizeToMathContent(LayoutPhase::CalculatePreferredLogicalWidth, sizes);
+
adjustPreferredLogicalWidthsForBorderAndPadding();
setPreferredLogicalWidthsDirty(false);
@@ -171,8 +174,6 @@ void RenderMathMLRow::layoutBlock(bool relayoutChildren, LayoutUnit)
recomputeLogicalWidth();
computeAndSetBlockDirectionMarginsOfChildren();
- setLogicalHeight(borderAndPaddingLogicalHeight() + scrollbarLogicalHeight());
-
LayoutUnit width, ascent, descent;
stretchVerticalOperatorsAndLayoutChildren();
getContentBoundingBox(width, ascent, descent);
@@ -180,9 +181,11 @@ void RenderMathMLRow::layoutBlock(bool relayoutChildren, LayoutUnit)
setLogicalWidth(width);
setLogicalHeight(ascent + descent);
- adjustLayoutForBorderAndPadding();
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::Layout);
+ auto shift = applySizeToMathContent(LayoutPhase::Layout, sizes);
+ shiftInFlowChildren(shift, 0);
- updateLogicalHeight();
+ adjustLayoutForBorderAndPadding();
layoutPositionedObjects(relayoutChildren);
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp b/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
index 33329fd624a00..928b6192a00b8 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
@@ -233,6 +233,9 @@ void RenderMathMLScripts::computePreferredLogicalWidths()
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth;
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::CalculatePreferredLogicalWidth);
+ applySizeToMathContent(LayoutPhase::CalculatePreferredLogicalWidth, sizes);
+
adjustPreferredLogicalWidthsForBorderAndPadding();
setPreferredLogicalWidthsDirty(false);
@@ -481,6 +484,10 @@ void RenderMathMLScripts::layoutBlock(bool relayoutChildren, LayoutUnit)
}
}
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::Layout);
+ auto shift = applySizeToMathContent(LayoutPhase::Layout, sizes);
+ shiftInFlowChildren(shift, 0);
+
adjustLayoutForBorderAndPadding();
layoutPositionedObjects(relayoutChildren);
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp b/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
index e5a616c0a0de0..56a326a2e8824 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
@@ -51,6 +51,9 @@ void RenderMathMLSpace::computePreferredLogicalWidths()
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = spaceWidth();
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::CalculatePreferredLogicalWidth);
+ applySizeToMathContent(LayoutPhase::CalculatePreferredLogicalWidth, sizes);
+
adjustPreferredLogicalWidthsForBorderAndPadding();
setPreferredLogicalWidthsDirty(false);
@@ -89,10 +92,15 @@ void RenderMathMLSpace::layoutBlock(bool relayoutChildren, LayoutUnit)
recomputeLogicalWidth();
- setLogicalWidth(spaceWidth() + borderAndPaddingLogicalWidth());
+ setLogicalWidth(spaceWidth());
LayoutUnit height, depth;
getSpaceHeightAndDepth(height, depth);
- setLogicalHeight(height + depth + borderAndPaddingLogicalHeight());
+ setLogicalHeight(height + depth);
+
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::Layout);
+ applySizeToMathContent(LayoutPhase::Layout, sizes);
+
+ adjustLayoutForBorderAndPadding();
updateScrollInfoAfterLayout();
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp b/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp
index 8f726f3816847..4f23d1bbd8439 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp
@@ -206,6 +206,9 @@ void RenderMathMLUnderOver::computePreferredLogicalWidths()
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = preferredWidth;
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::CalculatePreferredLogicalWidth);
+ applySizeToMathContent(LayoutPhase::CalculatePreferredLogicalWidth, sizes);
+
adjustPreferredLogicalWidthsForBorderAndPadding();
setPreferredLogicalWidthsDirty(false);
@@ -372,6 +375,10 @@ void RenderMathMLUnderOver::layoutBlock(bool relayoutChildren, LayoutUnit pageLo
setLogicalHeight(verticalOffset);
+ auto sizes = sizeAppliedToMathContent(LayoutPhase::Layout);
+ auto shift = applySizeToMathContent(LayoutPhase::Layout, sizes);
+ shiftInFlowChildren(shift, 0);
+
adjustLayoutForBorderAndPadding();
layoutPositionedObjects(relayoutChildren);
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h b/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h
index 1eed35b6a66d9..17460935a04de 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h
@@ -43,6 +43,7 @@ class RenderMathMLUnderOver final : public RenderMathMLScripts {
private:
bool isRenderMathMLScripts() const final { return false; }
+ bool isMathContentCentered() const final { return !shouldMoveLimits(); }
ASCIILiteral renderName() const final { return "RenderMathMLUnderOver"_s; }
MathMLUnderOverElement& element() const;