MathML WPT test for RadicalDegreeBottomRaisePercent fails
https://bugs.webkit.org/show_bug.cgi?id=183631

Patch by Rob Buis <rbuis@igalia.com> on 2019-07-15
Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

Adjust test expectation.

* web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1-expected.txt:

Source/WebCore:

When stretching the radical operator also take thickness
and radical gap into account:
https://mathml-refresh.github.io/mathml-core/#radicals-msqrt-mroot

Test: imported/w3c/web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1.html

* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::layoutBlock):

LayoutTests:

Adjust test expectations.

* platform/ios/mathml/presentation/roots-expected.txt:
* platform/mac/mathml/presentation/roots-expected.txt:
* platform/win/mathml/presentation/roots-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@247441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 2ce1cb6..be022e0 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2019-07-15  Rob Buis  <rbuis@igalia.com>
+
+        MathML WPT test for RadicalDegreeBottomRaisePercent fails
+        https://bugs.webkit.org/show_bug.cgi?id=183631
+
+        Reviewed by Frédéric Wang.
+
+        Adjust test expectations.
+
+        * platform/ios/mathml/presentation/roots-expected.txt:
+        * platform/mac/mathml/presentation/roots-expected.txt:
+        * platform/win/mathml/presentation/roots-expected.txt:
+
 2019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [JSC] Improve wasm wpt test results by fixing miscellaneous issues
diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog
index 6ab552e..c761911 100644
--- a/LayoutTests/imported/w3c/ChangeLog
+++ b/LayoutTests/imported/w3c/ChangeLog
@@ -1,3 +1,14 @@
+2019-07-15  Rob Buis  <rbuis@igalia.com>
+
+        MathML WPT test for RadicalDegreeBottomRaisePercent fails
+        https://bugs.webkit.org/show_bug.cgi?id=183631
+
+        Reviewed by Frédéric Wang.
+
+        Adjust test expectation.
+
+        * web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1-expected.txt:
+
 2019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [JSC] Improve wasm wpt test results by fixing miscellaneous issues
diff --git a/LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1-expected.txt
index 38ad70f..d06bc36 100644
--- a/LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1-expected.txt
+++ b/LayoutTests/imported/w3c/web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1-expected.txt
@@ -1,5 +1,5 @@
 
-FAIL RadicalDegreeBottomRaisePercent assert_approx_equals: mroot: vertical position of index expected 27.5 +/- 1 but got 25
+PASS RadicalDegreeBottomRaisePercent 
 PASS RadicalDisplayStyleVerticalGap 
 PASS RadicalExtraAscender 
 PASS RadicalKernAfterDegree 
diff --git a/LayoutTests/platform/ios/mathml/presentation/roots-expected.txt b/LayoutTests/platform/ios/mathml/presentation/roots-expected.txt
index 02f5b20..7060eb3 100644
--- a/LayoutTests/platform/ios/mathml/presentation/roots-expected.txt
+++ b/LayoutTests/platform/ios/mathml/presentation/roots-expected.txt
@@ -159,7 +159,7 @@
                   RenderBlock (anonymous) at (0,0) size 8x12
                     RenderText {#text} at (0,-6) size 8x25
                       text run at (0,-6) width 8: "2"
-            RenderMathMLRow {mrow} at (4,6) size 35x8
+            RenderMathMLRow {mrow} at (4,5) size 35x8
               RenderMathMLToken {mi} at (0,1) size 5x5 [padding: 0 1 0 0]
                 RenderBlock (anonymous) at (0,0) size 5x6
                   RenderText {#text} at (0,-5) size 5x15
@@ -379,31 +379,31 @@
                                             RenderBlock (anonymous) at (0,0) size 4x6
                                               RenderText {#text} at (0,-5) size 4x15
                                                 text run at (0,-5) width 4: "z"
-                                    RenderMathMLToken {mn} at (4,4) size 5x9
+                                    RenderMathMLToken {mn} at (4,3) size 5x9
                                       RenderBlock (anonymous) at (0,0) size 5x8
                                         RenderText {#text} at (0,-3) size 5x15
                                           text run at (0,-3) width 5: "9"
-                                RenderMathMLToken {mn} at (4,5) size 5x9
+                                RenderMathMLToken {mn} at (4,4) size 5x9
                                   RenderBlock (anonymous) at (0,0) size 5x8
                                     RenderText {#text} at (0,-3) size 5x15
                                       text run at (0,-3) width 5: "8"
-                            RenderMathMLToken {mn} at (4,7) size 5x8
+                            RenderMathMLToken {mn} at (4,6) size 5x8
                               RenderBlock (anonymous) at (0,0) size 5x7
                                 RenderText {#text} at (0,-4) size 5x15
                                   text run at (0,-4) width 5: "7"
-                        RenderMathMLToken {mn} at (4,7) size 5x9
+                        RenderMathMLToken {mn} at (4,6) size 5x9
                           RenderBlock (anonymous) at (0,0) size 5x8
                             RenderText {#text} at (0,-3) size 5x15
                               text run at (0,-3) width 5: "6"
-                    RenderMathMLToken {mn} at (4,8) size 5x9
+                    RenderMathMLToken {mn} at (4,7) size 5x9
                       RenderBlock (anonymous) at (0,0) size 5x8
                         RenderText {#text} at (0,-3) size 5x15
                           text run at (0,-3) width 5: "5"
-                RenderMathMLToken {mn} at (4,9) size 5x9
+                RenderMathMLToken {mn} at (4,8) size 5x9
                   RenderBlock (anonymous) at (0,0) size 5x8
                     RenderText {#text} at (0,-3) size 5x15
                       text run at (0,-3) width 5: "4"
-            RenderMathMLToken {mn} at (4,10) size 5x9
+            RenderMathMLToken {mn} at (4,9) size 5x9
               RenderBlock (anonymous) at (0,0) size 5x8
                 RenderText {#text} at (0,-3) size 5x15
                   text run at (0,-3) width 5: "3"
@@ -505,31 +505,31 @@
                                             RenderBlock (anonymous) at (0,0) size 4x6
                                               RenderText {#text} at (0,-5) size 4x15
                                                 text run at (0,-5) width 4: "z"
-                                    RenderMathMLToken {mn} at (73,4) size 5x9
+                                    RenderMathMLToken {mn} at (73,3) size 5x9
                                       RenderBlock (anonymous) at (0,0) size 5x8
                                         RenderText {#text} at (0,-3) size 5x15
                                           text run at (0,-3) width 5: "9"
-                                RenderMathMLToken {mn} at (114,5) size 5x9
+                                RenderMathMLToken {mn} at (114,4) size 5x9
                                   RenderBlock (anonymous) at (0,0) size 5x8
                                     RenderText {#text} at (0,-3) size 5x15
                                       text run at (0,-3) width 5: "8"
-                            RenderMathMLToken {mn} at (155,7) size 5x8
+                            RenderMathMLToken {mn} at (155,6) size 5x8
                               RenderBlock (anonymous) at (0,0) size 5x7
                                 RenderText {#text} at (0,-4) size 5x15
                                   text run at (0,-4) width 5: "7"
-                        RenderMathMLToken {mn} at (196,7) size 5x9
+                        RenderMathMLToken {mn} at (196,6) size 5x9
                           RenderBlock (anonymous) at (0,0) size 5x8
                             RenderText {#text} at (0,-3) size 5x15
                               text run at (0,-3) width 5: "6"
-                    RenderMathMLToken {mn} at (237,8) size 5x9
+                    RenderMathMLToken {mn} at (237,7) size 5x9
                       RenderBlock (anonymous) at (0,0) size 5x8
                         RenderText {#text} at (0,-3) size 5x15
                           text run at (0,-3) width 5: "5"
-                RenderMathMLToken {mn} at (278,9) size 5x9
+                RenderMathMLToken {mn} at (278,8) size 5x9
                   RenderBlock (anonymous) at (0,0) size 5x8
                     RenderText {#text} at (0,-3) size 5x15
                       text run at (0,-3) width 5: "4"
-            RenderMathMLToken {mn} at (319,10) size 5x9
+            RenderMathMLToken {mn} at (319,9) size 5x9
               RenderBlock (anonymous) at (0,0) size 5x8
                 RenderText {#text} at (0,-3) size 5x15
                   text run at (0,-3) width 5: "3"
diff --git a/LayoutTests/platform/mac/mathml/presentation/roots-expected.txt b/LayoutTests/platform/mac/mathml/presentation/roots-expected.txt
index ec84d2e..43c078e 100644
--- a/LayoutTests/platform/mac/mathml/presentation/roots-expected.txt
+++ b/LayoutTests/platform/mac/mathml/presentation/roots-expected.txt
@@ -159,7 +159,7 @@
                   RenderBlock (anonymous) at (0,0) size 8x12
                     RenderText {#text} at (0,-6) size 8x24
                       text run at (0,-6) width 8: "2"
-            RenderMathMLRow {mrow} at (4,6) size 35x8
+            RenderMathMLRow {mrow} at (4,5) size 35x8
               RenderMathMLToken {mi} at (0,1) size 5x5 [padding: 0 1 0 0]
                 RenderBlock (anonymous) at (0,0) size 5x6
                   RenderText {#text} at (0,-4) size 5x13
@@ -379,31 +379,31 @@
                                             RenderBlock (anonymous) at (0,0) size 4x6
                                               RenderText {#text} at (0,-4) size 4x13
                                                 text run at (0,-4) width 4: "z"
-                                    RenderMathMLToken {mn} at (4,4) size 5x9
+                                    RenderMathMLToken {mn} at (4,3) size 5x9
                                       RenderBlock (anonymous) at (0,0) size 5x8
                                         RenderText {#text} at (0,-2) size 5x13
                                           text run at (0,-2) width 5: "9"
-                                RenderMathMLToken {mn} at (4,5) size 5x9
+                                RenderMathMLToken {mn} at (4,4) size 5x9
                                   RenderBlock (anonymous) at (0,0) size 5x8
                                     RenderText {#text} at (0,-2) size 5x13
                                       text run at (0,-2) width 5: "8"
-                            RenderMathMLToken {mn} at (4,7) size 5x8
+                            RenderMathMLToken {mn} at (4,6) size 5x8
                               RenderBlock (anonymous) at (0,0) size 5x7
                                 RenderText {#text} at (0,-3) size 5x13
                                   text run at (0,-3) width 5: "7"
-                        RenderMathMLToken {mn} at (4,7) size 5x9
+                        RenderMathMLToken {mn} at (4,6) size 5x9
                           RenderBlock (anonymous) at (0,0) size 5x8
                             RenderText {#text} at (0,-2) size 5x13
                               text run at (0,-2) width 5: "6"
-                    RenderMathMLToken {mn} at (4,8) size 5x9
+                    RenderMathMLToken {mn} at (4,7) size 5x9
                       RenderBlock (anonymous) at (0,0) size 5x8
                         RenderText {#text} at (0,-2) size 5x13
                           text run at (0,-2) width 5: "5"
-                RenderMathMLToken {mn} at (4,9) size 5x9
+                RenderMathMLToken {mn} at (4,8) size 5x9
                   RenderBlock (anonymous) at (0,0) size 5x8
                     RenderText {#text} at (0,-2) size 5x13
                       text run at (0,-2) width 5: "4"
-            RenderMathMLToken {mn} at (4,10) size 5x9
+            RenderMathMLToken {mn} at (4,9) size 5x9
               RenderBlock (anonymous) at (0,0) size 5x8
                 RenderText {#text} at (0,-2) size 5x13
                   text run at (0,-2) width 5: "3"
@@ -505,31 +505,31 @@
                                             RenderBlock (anonymous) at (0,0) size 4x6
                                               RenderText {#text} at (0,-4) size 4x13
                                                 text run at (0,-4) width 4: "z"
-                                    RenderMathMLToken {mn} at (73,4) size 5x9
+                                    RenderMathMLToken {mn} at (73,3) size 5x9
                                       RenderBlock (anonymous) at (0,0) size 5x8
                                         RenderText {#text} at (0,-2) size 5x13
                                           text run at (0,-2) width 5: "9"
-                                RenderMathMLToken {mn} at (114,5) size 5x9
+                                RenderMathMLToken {mn} at (114,4) size 5x9
                                   RenderBlock (anonymous) at (0,0) size 5x8
                                     RenderText {#text} at (0,-2) size 5x13
                                       text run at (0,-2) width 5: "8"
-                            RenderMathMLToken {mn} at (155,7) size 5x8
+                            RenderMathMLToken {mn} at (155,6) size 5x8
                               RenderBlock (anonymous) at (0,0) size 5x7
                                 RenderText {#text} at (0,-3) size 5x13
                                   text run at (0,-3) width 5: "7"
-                        RenderMathMLToken {mn} at (196,7) size 5x9
+                        RenderMathMLToken {mn} at (196,6) size 5x9
                           RenderBlock (anonymous) at (0,0) size 5x8
                             RenderText {#text} at (0,-2) size 5x13
                               text run at (0,-2) width 5: "6"
-                    RenderMathMLToken {mn} at (237,8) size 5x9
+                    RenderMathMLToken {mn} at (237,7) size 5x9
                       RenderBlock (anonymous) at (0,0) size 5x8
                         RenderText {#text} at (0,-2) size 5x13
                           text run at (0,-2) width 5: "5"
-                RenderMathMLToken {mn} at (278,9) size 5x9
+                RenderMathMLToken {mn} at (278,8) size 5x9
                   RenderBlock (anonymous) at (0,0) size 5x8
                     RenderText {#text} at (0,-2) size 5x13
                       text run at (0,-2) width 5: "4"
-            RenderMathMLToken {mn} at (319,10) size 5x9
+            RenderMathMLToken {mn} at (319,9) size 5x9
               RenderBlock (anonymous) at (0,0) size 5x8
                 RenderText {#text} at (0,-2) size 5x13
                   text run at (0,-2) width 5: "3"
diff --git a/LayoutTests/platform/win/mathml/presentation/roots-expected.txt b/LayoutTests/platform/win/mathml/presentation/roots-expected.txt
index 80c1650..0d7aa0b 100644
--- a/LayoutTests/platform/win/mathml/presentation/roots-expected.txt
+++ b/LayoutTests/platform/win/mathml/presentation/roots-expected.txt
@@ -1,8 +1,8 @@
-layer at (0,0) size 800x699
+layer at (0,0) size 800x733
   RenderView at (0,0) size 800x600
-layer at (0,0) size 800x699
-  RenderBlock {html} at (0,0) size 800x699
-    RenderBody {body} at (8,16) size 784x667
+layer at (0,0) size 800x733
+  RenderBlock {html} at (0,0) size 800x733
+    RenderBody {body} at (8,16) size 784x701
       RenderBlock {p} at (0,0) size 784x18
         RenderText {#text} at (0,0) size 177x18
           text run at (0,0) width 177: "square root (should be red): "
@@ -52,11 +52,11 @@
               RenderBlock (anonymous) at (0,0) size 9x12
                 RenderText {#text} at (0,-1) size 9x16
                   text run at (0,-1) width 9: "1"
-      RenderBlock {p} at (0,106) size 784x37
+      RenderBlock {p} at (0,106) size 784x54
         RenderText {#text} at (0,14) size 113x18
           text run at (0,14) width 113: "root of a fraction: "
-        RenderMathMLMath {math} at (113,0) size 50x38
-          RenderMathMLRoot {msqrt} at (0,0) size 50x38
+        RenderMathMLMath {math} at (113,0) size 50x55
+          RenderMathMLRoot {msqrt} at (0,0) size 50x55
             RenderMathMLFraction {mfrac} at (12,3) size 38x35
               RenderMathMLRow {mrow} at (0,0) size 38x12
                 RenderMathMLToken {mi} at (0,3) size 10x9 [padding: 0 2 0 0]
@@ -84,7 +84,7 @@
                   RenderBlock (anonymous) at (0,0) size 9x12
                     RenderText {#text} at (0,-1) size 9x16
                       text run at (0,-1) width 9: "2"
-      RenderBlock {p} at (0,159) size 784x20
+      RenderBlock {p} at (0,176) size 784x20
         RenderText {#text} at (0,2) size 173x18
           text run at (0,2) width 173: "cube root (should be blue): "
         RenderMathMLMath {math} at (173,0) size 22x18 [color=#0000FF]
@@ -97,7 +97,7 @@
               RenderBlock (anonymous) at (0,0) size 5x8
                 RenderText {#text} at (0,0) size 5x9
                   text run at (0,0) width 5: "3"
-      RenderBlock {p} at (0,195) size 784x20
+      RenderBlock {p} at (0,212) size 784x20
         RenderText {#text} at (0,2) size 75x18
           text run at (0,2) width 75: "long index: "
         RenderMathMLMath {math} at (75,0) size 54x18
@@ -127,11 +127,11 @@
                 RenderBlock (anonymous) at (0,0) size 4x6
                   RenderText {#text} at (0,-2) size 4x9
                     text run at (0,-2) width 4: "z"
-      RenderBlock {p} at (0,231) size 784x37
+      RenderBlock {p} at (0,248) size 784x54
         RenderText {#text} at (0,14) size 185x18
           text run at (0,14) width 185: "long index w/ complex base: "
-        RenderMathMLMath {math} at (185,0) size 84x38
-          RenderMathMLRoot {mroot} at (0,0) size 84x38
+        RenderMathMLMath {math} at (185,0) size 84x55
+          RenderMathMLRoot {mroot} at (0,0) size 84x55
             RenderMathMLFraction {mfrac} at (45,3) size 39x35
               RenderMathMLRow {mrow} at (0,0) size 38x12
                 RenderMathMLToken {mi} at (0,3) size 10x9 [padding: 0 2 0 0]
@@ -159,7 +159,7 @@
                   RenderBlock (anonymous) at (0,0) size 9x12
                     RenderText {#text} at (0,-1) size 9x16
                       text run at (0,-1) width 9: "2"
-            RenderMathMLRow {mrow} at (1,6) size 38x9
+            RenderMathMLRow {mrow} at (1,11) size 38x9
               RenderMathMLToken {mi} at (0,1) size 5x6 [padding: 0 1 0 0]
                 RenderBlock (anonymous) at (0,0) size 4x6
                   RenderText {#text} at (0,-2) size 4x9
@@ -180,7 +180,7 @@
                 RenderBlock (anonymous) at (0,0) size 4x6
                   RenderText {#text} at (0,-2) size 4x9
                     text run at (0,-2) width 4: "z"
-      RenderBlock {p} at (0,284) size 784x38
+      RenderBlock {p} at (0,318) size 784x38
         RenderText {#text} at (0,20) size 75x18
           text run at (0,20) width 75: "high index: "
         RenderMathMLMath {math} at (75,0) size 22x36
@@ -203,7 +203,7 @@
                 RenderBlock (anonymous) at (0,0) size 4x6
                   RenderText {#text} at (0,-2) size 4x9
                     text run at (0,-2) width 4: "z"
-      RenderBlock {p} at (0,338) size 784x97
+      RenderBlock {p} at (0,372) size 784x97
         RenderText {#text} at (0,21) size 155x18
           text run at (0,21) width 155: "Imbricated square roots: "
         RenderMathMLMath {math} at (155,0) size 300x98
@@ -282,7 +282,7 @@
                                           RenderText {#text} at (0,-1) size 10x16
                                             text run at (0,-1) width 10: "A"
         RenderText {#text} at (0,0) size 0x0
-      RenderBlock {p} at (0,451) size 784x100
+      RenderBlock {p} at (0,485) size 784x100
         RenderText {#text} at (0,33) size 110x18
           text run at (0,33) width 110: "Imbricated roots: "
         RenderMathMLMath {math} at (110,0) size 323x101
@@ -395,20 +395,20 @@
                           RenderBlock (anonymous) at (0,0) size 5x8
                             RenderText {#text} at (0,0) size 5x9
                               text run at (0,0) width 5: "6"
-                    RenderMathMLToken {mn} at (1,26) size 6x9
+                    RenderMathMLToken {mn} at (1,25) size 6x9
                       RenderBlock (anonymous) at (0,0) size 5x8
                         RenderText {#text} at (0,0) size 5x9
                           text run at (0,0) width 5: "5"
-                RenderMathMLToken {mn} at (1,28) size 6x9
+                RenderMathMLToken {mn} at (1,26) size 6x9
                   RenderBlock (anonymous) at (0,0) size 5x8
                     RenderText {#text} at (0,0) size 5x9
                       text run at (0,0) width 5: "4"
-            RenderMathMLToken {mn} at (1,29) size 6x9
+            RenderMathMLToken {mn} at (1,27) size 6x9
               RenderBlock (anonymous) at (0,0) size 5x8
                 RenderText {#text} at (0,0) size 5x9
                   text run at (0,0) width 5: "3"
         RenderText {#text} at (0,0) size 0x0
-      RenderBlock {p} at (0,567) size 784x100
+      RenderBlock {p} at (0,601) size 784x100
         RenderText {#text} at (0,33) size 74x18
           text run at (0,33) width 74: "RTL roots: "
         RenderMathMLMath {math} at (74,0) size 323x101
@@ -521,15 +521,15 @@
                           RenderBlock (anonymous) at (0,0) size 5x8
                             RenderText {#text} at (0,0) size 5x9
                               text run at (0,0) width 5: "6"
-                    RenderMathMLToken {mn} at (238,26) size 5x9
+                    RenderMathMLToken {mn} at (238,25) size 5x9
                       RenderBlock (anonymous) at (0,0) size 5x8
                         RenderText {#text} at (0,0) size 5x9
                           text run at (0,0) width 5: "5"
-                RenderMathMLToken {mn} at (277,28) size 6x9
+                RenderMathMLToken {mn} at (277,26) size 6x9
                   RenderBlock (anonymous) at (0,0) size 5x8
                     RenderText {#text} at (0,0) size 5x9
                       text run at (0,0) width 5: "4"
-            RenderMathMLToken {mn} at (316,29) size 6x9
+            RenderMathMLToken {mn} at (316,27) size 6x9
               RenderBlock (anonymous) at (0,0) size 5x8
                 RenderText {#text} at (0,0) size 5x9
                   text run at (0,0) width 5: "3"
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index f60d1c4..4086c19 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2019-07-15  Rob Buis  <rbuis@igalia.com>
+
+        MathML WPT test for RadicalDegreeBottomRaisePercent fails
+        https://bugs.webkit.org/show_bug.cgi?id=183631
+
+        Reviewed by Frédéric Wang.
+
+        When stretching the radical operator also take thickness
+        and radical gap into account:
+        https://mathml-refresh.github.io/mathml-core/#radicals-msqrt-mroot
+
+        Test: imported/w3c/web-platform-tests/mathml/presentation-markup/radicals/root-parameters-1.html
+
+        * rendering/mathml/RenderMathMLRoot.cpp:
+        (WebCore::RenderMathMLRoot::layoutBlock):
+
 2019-07-15  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [JSC] Improve wasm wpt test results by fixing miscellaneous issues
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp b/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
index 0cbeffd..8188f4f 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
@@ -217,7 +217,7 @@
 
     // Stretch the radical operator to cover the base height.
     // We can then determine the metrics of the radical operator + the base.
-    m_radicalOperator.stretchTo(style(), baseAscent + baseDescent);
+    m_radicalOperator.stretchTo(style(), baseAscent + baseDescent + vertical.verticalGap + vertical.ruleThickness);
     LayoutUnit radicalOperatorHeight = m_radicalOperator.ascent() + m_radicalOperator.descent();
     LayoutUnit indexBottomRaise { vertical.degreeBottomRaisePercent * radicalOperatorHeight };
     LayoutUnit radicalAscent = baseAscent + vertical.verticalGap + vertical.ruleThickness + vertical.extraAscender;