Log Message
MathOperator: Add fallback mechanisms for stretching and mirroring radical symbols https://bugs.webkit.org/show_bug.cgi?id=156836
Source/WebCore: Patch by Frederic Wang <[email protected]> on 2016-06-17 Reviewed by Sergio Villar Senin. Some platforms do not have OpenType MATH fonts pre-installed and thus can not draw stretchy operators using size variants or glyph assembly. This is especially problematic for the radical symbol which is used to write roots. Currently, we have some fallback code to draw that symbol using graphical primitives but it is a bit complex and makes the style of radical inconsistent with the font used. We solve these issues by just scaling the base glyph via a scale transform. Such scale transform is also used to mirror the radical symbol so that we have some support for right-to-left roots until we can do glyph-level mirroring via the OpenType rtlm feature. Test: mathml/radical-fallback.html * rendering/mathml/MathOperator.cpp: Add a constant for the code point U+221A of the radical. (WebCore::MathOperator::reset): In general, we don't need any vertical scaling for radical symbols so m_radicalVerticalScale is initialized to 1. (WebCore::MathOperator::calculateStretchyData): If we don't have a font with a MATH table and we try streching a radical, then we update the vertical metrics to match the target size and set m_radicalVerticalScale to the value necessary to make the base glyph scaled to that size. (WebCore::MathOperator::paint): For a radical operator, we may apply a scale transform of parameters (radicalHorizontalScale, m_radicalVerticalScale) in order to support RTL mirroring or vertical stretching. * rendering/mathml/MathOperator.h: We add a m_radicalVerticalScale member to indicate the scaling to apply to the base radical glyph when the stretchy fallback is necessary. (WebCore::MathOperator::isStretched): The operator is also considered stretched when the m_radicalVerticalScale is applied to the base size. * rendering/mathml/RenderMathMLRadicalOperator.cpp: Remove code specific to the old fallback mechanism. * rendering/mathml/RenderMathMLRadicalOperator.h: Ditto. LayoutTests: Reviewed by Sergio Villar Senin. We add a pixel test to verify the result of stretching a radical operator. We test RTL/LTR direction as well as default/sans-serif font in order to check the fallback code. * mathml/radical-fallback.html: Added. * platform/gtk/mathml/radical-fallback-expected.png: Added. * platform/gtk/mathml/radical-fallback-expected.txt: Added. * platform/ios-simulator/mathml/radical-fallback-expected.txt: Added. * platform/mac/mathml/radical-fallback-expected.png: Added. * platform/mac/mathml/radical-fallback-expected.txt: Added. * platform/ios-simulator/mathml/presentation/roots.txt: Updated.
Modified Paths
- trunk/LayoutTests/ChangeLog
- trunk/LayoutTests/platform/ios-simulator/mathml/presentation/roots-expected.txt
- trunk/Source/WebCore/ChangeLog
- trunk/Source/WebCore/rendering/mathml/MathOperator.cpp
- trunk/Source/WebCore/rendering/mathml/MathOperator.h
- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
- trunk/Source/WebCore/rendering/mathml/RenderMathMLRadicalOperator.cpp
- trunk/Source/WebCore/rendering/mathml/RenderMathMLRadicalOperator.h
Added Paths
- trunk/LayoutTests/mathml/radical-fallback.html
- trunk/LayoutTests/platform/gtk/mathml/radical-fallback-expected.png
- trunk/LayoutTests/platform/gtk/mathml/radical-fallback-expected.txt
- trunk/LayoutTests/platform/ios-simulator/mathml/radical-fallback-expected.txt
- trunk/LayoutTests/platform/mac/mathml/radical-fallback-expected.png
- trunk/LayoutTests/platform/mac/mathml/radical-fallback-expected.txt
Diff
Modified: trunk/LayoutTests/ChangeLog (202160 => 202161)
--- trunk/LayoutTests/ChangeLog 2016-06-17 06:23:26 UTC (rev 202160)
+++ trunk/LayoutTests/ChangeLog 2016-06-17 09:24:49 UTC (rev 202161)
@@ -1,3 +1,21 @@
+2016-06-17 Frederic Wang <[email protected]>
+
+ MathOperator: Add fallback mechanisms for stretching and mirroring radical symbols
+ https://bugs.webkit.org/show_bug.cgi?id=156836
+
+ Reviewed by Sergio Villar Senin.
+
+ We add a pixel test to verify the result of stretching a radical operator.
+ We test RTL/LTR direction as well as default/sans-serif font in order to check the fallback code.
+
+ * mathml/radical-fallback.html: Added.
+ * platform/gtk/mathml/radical-fallback-expected.png: Added.
+ * platform/gtk/mathml/radical-fallback-expected.txt: Added.
+ * platform/ios-simulator/mathml/radical-fallback-expected.txt: Added.
+ * platform/mac/mathml/radical-fallback-expected.png: Added.
+ * platform/mac/mathml/radical-fallback-expected.txt: Added.
+ * platform/ios-simulator/mathml/presentation/roots.txt: Updated.
+
2016-06-16 Commit Queue <[email protected]>
Unreviewed, rolling out r202147.
Added: trunk/LayoutTests/mathml/radical-fallback.html (0 => 202161)
--- trunk/LayoutTests/mathml/radical-fallback.html (rev 0)
+++ trunk/LayoutTests/mathml/radical-fallback.html 2016-06-17 09:24:49 UTC (rev 202161)
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Radical fallback</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <!-- This pixel test verifies stretching of radical operators with either
+ the default MathML font or a sans-serif font. The latter is likely
+ to require a fallback mechanism ascsans-serif are generally not math
+ fonts and so can not stretch radicals. -->
+
+ <p>Large LTR radicals:
+ <math>
+ <msqrt><mspace height="5em"/></msqrt>
+ <msqrt style="font-family: sans-serif"><mspace height="5em"/></msqrt>
+ </math>
+ </p>
+
+ <p>Large RTL radicals:
+ <math dir="rtl">
+ <msqrt><mspace height="5em"/></msqrt>
+ <msqrt style="font-family: sans-serif"><mspace height="5em"/></msqrt>
+ </math>
+ </p>
+
+ </body>
+</html>
Property changes on: trunk/LayoutTests/mathml/radical-fallback.html
___________________________________________________________________
Added: svn:mime-type
Added: svn:eol-style
Added: trunk/LayoutTests/platform/gtk/mathml/radical-fallback-expected.png
(Binary files differ)
Added: svn:mime-type
Added: trunk/LayoutTests/platform/gtk/mathml/radical-fallback-expected.txt (0 => 202161)
--- trunk/LayoutTests/platform/gtk/mathml/radical-fallback-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/gtk/mathml/radical-fallback-expected.txt 2016-06-17 09:24:49 UTC (rev 202161)
@@ -0,0 +1,51 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x222
+ RenderBlock {HTML} at (0,0) size 800x222
+ RenderBody {BODY} at (8,16) size 784x190
+ RenderBlock {P} at (0,0) size 784x87
+ RenderText {#text} at (0,70) size 132x17
+ text run at (0,70) width 132: "Large LTR radicals: "
+ RenderMathMLMath {math} at (132,0) size 28x85 [padding: 0 1 0 1]
+ RenderMathMLSquareRoot {msqrt} at (1,2) size 17x83
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 17x83
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 17x83
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 13x82
+ RenderBlock (anonymous) at (0,0) size 13x82
+ RenderText at (0,-56) size 13x106
+ text run at (0,-56) width 13: "\x{221A}"
+ RenderMathMLRootWrapper at (17,2) size 0x81
+ RenderMathMLSpace {mspace} at (0,0) size 0x80
+ RenderMathMLSquareRoot {msqrt} at (18,0) size 9x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x84
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x83
+ RenderBlock (anonymous) at (0,0) size 9x83
+ RenderText at (0,-1) size 9x17
+ text run at (0,-1) width 9: "\x{221A}"
+ RenderMathMLRootWrapper at (9,3) size 0x81
+ RenderMathMLSpace {mspace} at (0,0) size 0x80
+ RenderText {#text} at (0,0) size 0x0
+ RenderBlock {P} at (0,103) size 784x87
+ RenderText {#text} at (0,70) size 132x17
+ text run at (0,70) width 132: "Large RTL radicals: "
+ RenderMathMLMath {math} at (132,0) size 28x85 [padding: 0 1 0 1]
+ RenderMathMLSquareRoot {msqrt} at (10,2) size 17x83
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 17x83
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 17x83
+ RenderMathMLBlock (anonymous, flex) at (4,0) size 13x82
+ RenderBlock (anonymous) at (0,0) size 13x82
+ RenderText at (0,-56) size 13x106
+ text run at (0,-56) width 13 RTL: "\x{221A}"
+ RenderMathMLRootWrapper at (0,2) size 0x81
+ RenderMathMLSpace {mspace} at (0,0) size 0x80
+ RenderMathMLSquareRoot {msqrt} at (1,0) size 9x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x84
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x83
+ RenderBlock (anonymous) at (0,0) size 9x83
+ RenderText at (0,-1) size 9x17
+ text run at (0,-1) width 9 RTL: "\x{221A}"
+ RenderMathMLRootWrapper at (0,3) size 0x81
+ RenderMathMLSpace {mspace} at (0,0) size 0x80
+ RenderText {#text} at (0,0) size 0x0
Property changes on: trunk/LayoutTests/platform/gtk/mathml/radical-fallback-expected.txt
___________________________________________________________________
Added: svn:eol-style
Modified: trunk/LayoutTests/platform/ios-simulator/mathml/presentation/roots-expected.txt (202160 => 202161)
--- trunk/LayoutTests/platform/ios-simulator/mathml/presentation/roots-expected.txt 2016-06-17 06:23:26 UTC (rev 202160)
+++ trunk/LayoutTests/platform/ios-simulator/mathml/presentation/roots-expected.txt 2016-06-17 09:24:49 UTC (rev 202161)
@@ -1,20 +1,20 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
-layer at (0,0) size 800x518
- RenderBlock {html} at (0,0) size 800x518
- RenderBody {body} at (8,16) size 784x486
+layer at (0,0) size 800x492
+ RenderBlock {html} at (0,0) size 800x492
+ RenderBody {body} at (8,16) size 784x460
RenderBlock {p} at (0,0) size 784x20
RenderText {#text} at (0,0) size 181x19
text run at (0,0) width 181: "square root (should be red): "
- RenderMathMLMath {math} at (180,0) size 23x18 [padding: 0 1 0 1]
- RenderMathMLSquareRoot {msqrt} at (1,0) size 20x18 [color=#FF0000]
- RenderMathMLBlock (anonymous, flex) at (0,0) size 12x18
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x18
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x18
- RenderBlock (anonymous) at (0,0) size 9x18
+ RenderMathMLMath {math} at (180,0) size 20x17 [padding: 0 1 0 1]
+ RenderMathMLSquareRoot {msqrt} at (1,0) size 17x17 [color=#FF0000]
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x17
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x17
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x16
+ RenderBlock (anonymous) at (0,0) size 9x16
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 8x15
+ RenderMathMLRootWrapper at (8,3) size 9x14
RenderMathMLToken {mn} at (0,0) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
@@ -23,15 +23,15 @@
RenderBlock {p} at (0,36) size 784x20
RenderText {#text} at (0,0) size 113x19
text run at (0,0) width 113: "long square root: "
- RenderMathMLMath {math} at (112,0) size 47x18 [padding: 0 1 0 1]
- RenderMathMLSquareRoot {msqrt} at (1,0) size 45x18
- RenderMathMLBlock (anonymous, flex) at (0,0) size 12x18
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x18
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x18
- RenderBlock (anonymous) at (0,0) size 9x18
+ RenderMathMLMath {math} at (112,0) size 44x17 [padding: 0 1 0 1]
+ RenderMathMLSquareRoot {msqrt} at (1,0) size 42x17
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x17
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x17
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x16
+ RenderBlock (anonymous) at (0,0) size 9x16
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 33x15
+ RenderMathMLRootWrapper at (8,3) size 34x14
RenderMathMLRow {mrow} at (0,0) size 33x12
RenderMathMLToken {mi} at (0,3) size 9x9 [padding: 0 2 0 0]
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x9
@@ -51,15 +51,15 @@
RenderBlock {p} at (0,72) size 784x25
RenderText {#text} at (0,5) size 227x19
text run at (0,5) width 227: "long square root with implied row: "
- RenderMathMLMath {math} at (226,0) size 57x24 [padding: 0 1 0 1]
- RenderMathMLSquareRoot {msqrt} at (1,0) size 54x24
- RenderMathMLBlock (anonymous, flex) at (0,0) size 12x24
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x24
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x23
- RenderBlock (anonymous) at (0,0) size 9x23
+ RenderMathMLMath {math} at (226,0) size 54x22 [padding: 0 1 0 1]
+ RenderMathMLSquareRoot {msqrt} at (1,0) size 51x22
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x22
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x22
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x21
+ RenderBlock (anonymous) at (0,0) size 9x21
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 42x21
+ RenderMathMLRootWrapper at (8,3) size 43x19
RenderMathMLScripts {msup} at (0,0) size 18x18
RenderMathMLToken {mi} at (0,8) size 9x10 [padding: 0 2 0 0]
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x9
@@ -81,18 +81,18 @@
RenderBlock (anonymous) at (0,0) size 8x12
RenderText {#text} at (0,-1) size 8x17
text run at (0,-1) width 8: "1"
- RenderBlock {p} at (0,113) size 784x37
+ RenderBlock {p} at (0,113) size 784x34
RenderText {#text} at (0,8) size 117x19
text run at (0,8) width 117: "root of a fraction: "
- RenderMathMLMath {math} at (116,0) size 47x38 [padding: 0 1 0 1]
- RenderMathMLSquareRoot {msqrt} at (1,0) size 45x38
- RenderMathMLBlock (anonymous, flex) at (0,0) size 12x38
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x38
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x37
- RenderBlock (anonymous) at (0,0) size 9x37
+ RenderMathMLMath {math} at (116,0) size 44x35 [padding: 0 1 0 1]
+ RenderMathMLSquareRoot {msqrt} at (1,0) size 42x35
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x35
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x35
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x35
+ RenderBlock (anonymous) at (0,0) size 9x35
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 33x35
+ RenderMathMLRootWrapper at (8,3) size 34x32
RenderMathMLFraction {mfrac} at (0,0) size 33x32
RenderMathMLRow {mrow} at (0,0) size 33x12
RenderMathMLToken {mi} at (0,3) size 9x9 [padding: 0 2 0 0]
@@ -126,35 +126,35 @@
RenderBlock (anonymous) at (0,0) size 8x12
RenderText {#text} at (0,-1) size 8x17
text run at (0,-1) width 8: "2"
- RenderBlock {p} at (0,166) size 784x20
- RenderText {#text} at (0,0) size 177x19
- text run at (0,0) width 177: "cube root (should be blue): "
- RenderMathMLMath {math} at (176,0) size 23x19 [color=#0000FF] [padding: 0 1 0 1]
- RenderMathMLRoot {mroot} at (1,0) size 21x19
- RenderMathMLRootWrapper at (4,0) size 5x19
+ RenderBlock {p} at (0,163) size 784x21
+ RenderText {#text} at (0,1) size 177x19
+ text run at (0,1) width 177: "cube root (should be blue): "
+ RenderMathMLMath {math} at (176,0) size 20x18 [color=#0000FF] [padding: 0 1 0 1]
+ RenderMathMLRoot {mroot} at (1,0) size 17x18
+ RenderMathMLRootWrapper at (4,0) size 5x18
RenderMathMLToken {mn} at (0,0) size 5x8
RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
RenderBlock (anonymous) at (0,0) size 5x8
RenderText {#text} at (0,0) size 5x10
text run at (0,0) width 5: "3"
- RenderMathMLBlock (anonymous, flex) at (0,0) size 13x19
- RenderMathMLRadicalOperator (anonymous) at (0,1) size 12x18
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x18
- RenderBlock (anonymous) at (0,0) size 9x18
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x18
+ RenderMathMLRadicalOperator (anonymous) at (0,1) size 9x17
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x16
+ RenderBlock (anonymous) at (0,0) size 9x16
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,4) size 9x15
+ RenderMathMLRootWrapper at (8,4) size 9x14
RenderMathMLToken {mn} at (0,0) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
RenderText {#text} at (0,-1) size 8x17
text run at (0,-1) width 8: "2"
- RenderBlock {p} at (0,202) size 784x20
+ RenderBlock {p} at (0,200) size 784x20
RenderText {#text} at (0,0) size 77x19
text run at (0,0) width 77: "long index: "
- RenderMathMLMath {math} at (76,0) size 51x18 [padding: 0 1 0 1]
- RenderMathMLRoot {mroot} at (1,0) size 48x18
- RenderMathMLRootWrapper at (4,0) size 33x18
+ RenderMathMLMath {math} at (76,0) size 47x17 [padding: 0 1 0 1]
+ RenderMathMLRoot {mroot} at (1,0) size 45x17
+ RenderMathMLRootWrapper at (4,0) size 33x17
RenderMathMLRow {mrow} at (0,0) size 33x7
RenderMathMLToken {mi} at (0,1) size 5x5 [padding: 0 1 0 0]
RenderMathMLBlock (anonymous, flex) at (0,0) size 4x5
@@ -181,24 +181,24 @@
RenderBlock (anonymous) at (0,0) size 4x5
RenderText {#text} at (0,-3) size 4x10
text run at (0,-3) width 4: "z"
- RenderMathMLBlock (anonymous, flex) at (27,0) size 13x18
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x18
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x18
- RenderBlock (anonymous) at (0,0) size 9x18
+ RenderMathMLBlock (anonymous, flex) at (27,0) size 10x17
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x17
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x16
+ RenderBlock (anonymous) at (0,0) size 9x16
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (39,3) size 9x15
+ RenderMathMLRootWrapper at (36,3) size 9x14
RenderMathMLToken {mn} at (0,0) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
RenderText {#text} at (0,-1) size 8x17
text run at (0,-1) width 8: "2"
- RenderBlock {p} at (0,238) size 784x37
+ RenderBlock {p} at (0,236) size 784x34
RenderText {#text} at (0,8) size 188x19
text run at (0,8) width 188: "long index w/ complex base: "
- RenderMathMLMath {math} at (187,0) size 76x38 [padding: 0 1 0 1]
- RenderMathMLRoot {mroot} at (1,0) size 73x38
- RenderMathMLRootWrapper at (4,8) size 33x30
+ RenderMathMLMath {math} at (187,0) size 72x35 [padding: 0 1 0 1]
+ RenderMathMLRoot {mroot} at (1,0) size 70x35
+ RenderMathMLRootWrapper at (4,7) size 33x28
RenderMathMLRow {mrow} at (0,0) size 33x7
RenderMathMLToken {mi} at (0,1) size 5x5 [padding: 0 1 0 0]
RenderMathMLBlock (anonymous, flex) at (0,0) size 4x5
@@ -225,13 +225,13 @@
RenderBlock (anonymous) at (0,0) size 4x5
RenderText {#text} at (0,-3) size 4x10
text run at (0,-3) width 4: "z"
- RenderMathMLBlock (anonymous, flex) at (27,0) size 13x38
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x38
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x37
- RenderBlock (anonymous) at (0,0) size 9x37
+ RenderMathMLBlock (anonymous, flex) at (27,0) size 10x35
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x35
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x35
+ RenderBlock (anonymous) at (0,0) size 9x35
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (39,3) size 34x35
+ RenderMathMLRootWrapper at (36,3) size 34x32
RenderMathMLFraction {mfrac} at (0,0) size 33x32
RenderMathMLRow {mrow} at (0,0) size 33x12
RenderMathMLToken {mi} at (0,3) size 9x9 [padding: 0 2 0 0]
@@ -265,12 +265,12 @@
RenderBlock (anonymous) at (0,0) size 8x12
RenderText {#text} at (0,-1) size 8x17
text run at (0,-1) width 8: "2"
- RenderBlock {p} at (0,291) size 784x36
- RenderText {#text} at (0,16) size 77x19
- text run at (0,16) width 77: "high index: "
- RenderMathMLMath {math} at (76,0) size 23x35 [padding: 0 1 0 1]
- RenderMathMLRoot {mroot} at (1,0) size 21x35
- RenderMathMLRootWrapper at (4,0) size 6x35
+ RenderBlock {p} at (0,286) size 784x37
+ RenderText {#text} at (0,17) size 77x19
+ text run at (0,17) width 77: "high index: "
+ RenderMathMLMath {math} at (76,0) size 20x34 [padding: 0 1 0 1]
+ RenderMathMLRoot {mroot} at (1,0) size 18x34
+ RenderMathMLRootWrapper at (4,0) size 6x34
RenderMathMLFraction {mfrac} at (0,0) size 5x25
RenderMathMLFraction {mfrac} at (0,0) size 5x16
RenderMathMLToken {mi} at (0,0) size 5x5 [padding: 0 1 0 0]
@@ -288,30 +288,30 @@
RenderBlock (anonymous) at (0,0) size 4x5
RenderText {#text} at (0,-3) size 4x10
text run at (0,-3) width 4: "z"
- RenderMathMLBlock (anonymous, flex) at (0,0) size 13x35
- RenderMathMLRadicalOperator (anonymous) at (0,17) size 12x18
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x18
- RenderBlock (anonymous) at (0,0) size 9x18
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 10x34
+ RenderMathMLRadicalOperator (anonymous) at (0,17) size 9x17
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x16
+ RenderBlock (anonymous) at (0,0) size 9x16
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,20) size 9x15
+ RenderMathMLRootWrapper at (9,20) size 9x14
RenderMathMLToken {mn} at (0,0) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
RenderText {#text} at (0,-1) size 8x17
text run at (0,-1) width 8: "2"
- RenderBlock {p} at (0,343) size 784x59
+ RenderBlock {p} at (0,339) size 784x48
RenderText {#text} at (0,28) size 160x19
text run at (0,28) width 160: "Imbricated square roots: "
- RenderMathMLMath {math} at (159,0) size 277x60 [padding: 0 1 0 1]
- RenderMathMLSquareRoot {msqrt} at (1,0) size 275x60
- RenderMathMLBlock (anonymous, flex) at (0,0) size 12x60
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x60
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x60
- RenderBlock (anonymous) at (0,0) size 9x60
+ RenderMathMLMath {math} at (159,0) size 252x44 [padding: 0 1 0 1]
+ RenderMathMLSquareRoot {msqrt} at (1,0) size 249x44
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x44
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x44
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x43
+ RenderBlock (anonymous) at (0,0) size 9x43
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 263x57
+ RenderMathMLRootWrapper at (8,3) size 241x41
RenderMathMLToken {mn} at (0,28) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
@@ -322,15 +322,15 @@
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLSquareRoot {msqrt} at (23,0) size 240x54
- RenderMathMLBlock (anonymous, flex) at (0,0) size 12x54
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x54
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x54
- RenderBlock (anonymous) at (0,0) size 9x54
+ RenderMathMLSquareRoot {msqrt} at (23,0) size 217x40
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x40
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x40
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x39
+ RenderBlock (anonymous) at (0,0) size 9x39
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 227x51
- RenderMathMLRow {mrow} at (0,0) size 227x48
+ RenderMathMLRootWrapper at (8,3) size 209x37
+ RenderMathMLRow {mrow} at (0,0) size 208x36
RenderMathMLToken {mn} at (0,24) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
@@ -341,15 +341,15 @@
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLSquareRoot {msqrt} at (23,0) size 204x48
- RenderMathMLBlock (anonymous, flex) at (0,0) size 12x48
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x48
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x48
- RenderBlock (anonymous) at (0,0) size 9x48
+ RenderMathMLSquareRoot {msqrt} at (23,0) size 185x36
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x36
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x36
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x35
+ RenderBlock (anonymous) at (0,0) size 9x35
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 191x45
- RenderMathMLRow {mrow} at (0,0) size 191x42
+ RenderMathMLRootWrapper at (8,3) size 176x33
+ RenderMathMLRow {mrow} at (0,0) size 175x32
RenderMathMLToken {mn} at (0,20) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
@@ -360,15 +360,15 @@
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLSquareRoot {msqrt} at (23,0) size 168x42
- RenderMathMLBlock (anonymous, flex) at (0,0) size 12x42
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x42
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x42
- RenderBlock (anonymous) at (0,0) size 9x42
+ RenderMathMLSquareRoot {msqrt} at (23,0) size 152x32
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x32
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x32
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x32
+ RenderBlock (anonymous) at (0,0) size 9x32
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 155x39
- RenderMathMLRow {mrow} at (0,0) size 155x36
+ RenderMathMLRootWrapper at (8,3) size 143x29
+ RenderMathMLRow {mrow} at (0,0) size 142x29
RenderMathMLToken {mn} at (0,16) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
@@ -379,15 +379,15 @@
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLSquareRoot {msqrt} at (23,0) size 132x36
- RenderMathMLBlock (anonymous, flex) at (0,0) size 12x36
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x36
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x36
- RenderBlock (anonymous) at (0,0) size 9x36
+ RenderMathMLSquareRoot {msqrt} at (23,0) size 119x29
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x29
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x29
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x28
+ RenderBlock (anonymous) at (0,0) size 9x28
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 119x33
- RenderMathMLRow {mrow} at (0,0) size 119x30
+ RenderMathMLRootWrapper at (8,3) size 111x26
+ RenderMathMLRow {mrow} at (0,0) size 110x25
RenderMathMLToken {mn} at (0,12) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
@@ -398,15 +398,15 @@
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLSquareRoot {msqrt} at (23,0) size 96x30
- RenderMathMLBlock (anonymous, flex) at (0,0) size 12x30
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x30
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x30
- RenderBlock (anonymous) at (0,0) size 9x30
+ RenderMathMLSquareRoot {msqrt} at (23,0) size 87x25
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x25
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x25
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x24
+ RenderBlock (anonymous) at (0,0) size 9x24
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 84x27
- RenderMathMLRow {mrow} at (0,0) size 84x24
+ RenderMathMLRootWrapper at (8,3) size 78x22
+ RenderMathMLRow {mrow} at (0,0) size 77x21
RenderMathMLToken {mn} at (0,8) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
@@ -417,15 +417,15 @@
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLSquareRoot {msqrt} at (23,0) size 61x24
- RenderMathMLBlock (anonymous, flex) at (0,0) size 12x24
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x24
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x24
- RenderBlock (anonymous) at (0,0) size 9x24
+ RenderMathMLSquareRoot {msqrt} at (23,0) size 54x21
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x21
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x21
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x20
+ RenderBlock (anonymous) at (0,0) size 9x20
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 48x21
- RenderMathMLRow {mrow} at (0,0) size 48x18
+ RenderMathMLRootWrapper at (8,3) size 45x18
+ RenderMathMLRow {mrow} at (0,0) size 45x17
RenderMathMLToken {mn} at (0,4) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
@@ -436,201 +436,201 @@
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLSquareRoot {msqrt} at (23,0) size 25x18
- RenderMathMLBlock (anonymous, flex) at (0,0) size 12x18
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x18
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x18
- RenderBlock (anonymous) at (0,0) size 9x18
+ RenderMathMLSquareRoot {msqrt} at (23,0) size 22x17
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x17
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x17
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x16
+ RenderBlock (anonymous) at (0,0) size 9x16
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 12x15
+ RenderMathMLRootWrapper at (8,3) size 13x14
RenderMathMLToken {mi} at (0,0) size 12x12 [padding: 0 2 0 0]
RenderMathMLBlock (anonymous, flex) at (0,0) size 10x12
RenderBlock (anonymous) at (0,0) size 10x12
RenderText {#text} at (0,-1) size 10x17
text run at (0,-1) width 10: "A"
RenderText {#text} at (0,0) size 0x0
- RenderBlock {p} at (0,418) size 784x68
- RenderText {#text} at (0,36) size 114x19
- text run at (0,36) width 114: "Imbricated roots: "
- RenderMathMLMath {math} at (113,0) size 292x69 [padding: 0 1 0 1]
- RenderMathMLRoot {mroot} at (1,0) size 290x69
- RenderMathMLRootWrapper at (4,19) size 5x50
+ RenderBlock {p} at (0,403) size 784x57
+ RenderText {#text} at (0,37) size 114x19
+ text run at (0,37) width 114: "Imbricated roots: "
+ RenderMathMLMath {math} at (113,0) size 267x53 [padding: 0 1 0 1]
+ RenderMathMLRoot {mroot} at (1,0) size 264x53
+ RenderMathMLRootWrapper at (4,13) size 5x40
RenderMathMLToken {mn} at (0,0) size 5x8
RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
RenderBlock (anonymous) at (0,0) size 5x8
RenderText {#text} at (0,0) size 5x10
text run at (0,0) width 5: "3"
- RenderMathMLBlock (anonymous, flex) at (0,0) size 13x69
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x69
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x68
- RenderBlock (anonymous) at (0,0) size 9x68
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x53
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x53
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x52
+ RenderBlock (anonymous) at (0,0) size 9x52
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 278x66
- RenderMathMLRow {mrow} at (0,0) size 278x63
- RenderMathMLToken {mn} at (0,36) size 8x12
+ RenderMathMLRootWrapper at (8,3) size 256x50
+ RenderMathMLRow {mrow} at (0,0) size 255x49
+ RenderMathMLToken {mn} at (0,37) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
RenderText {#text} at (0,-1) size 8x17
text run at (0,-1) width 8: "1"
- RenderMathMLOperator {mo} at (8,39) size 16x9
+ RenderMathMLOperator {mo} at (8,40) size 16x9
RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLRoot {mroot} at (23,0) size 255x63
- RenderMathMLRootWrapper at (4,17) size 5x46
+ RenderMathMLRoot {mroot} at (23,0) size 232x49
+ RenderMathMLRootWrapper at (4,11) size 5x38
RenderMathMLToken {mn} at (0,0) size 5x8
RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
RenderBlock (anonymous) at (0,0) size 5x8
RenderText {#text} at (0,0) size 5x10
text run at (0,0) width 5: "4"
- RenderMathMLBlock (anonymous, flex) at (0,0) size 13x63
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x63
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x62
- RenderBlock (anonymous) at (0,0) size 9x62
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x49
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x49
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x48
+ RenderBlock (anonymous) at (0,0) size 9x48
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 242x60
- RenderMathMLRow {mrow} at (0,0) size 242x57
- RenderMathMLToken {mn} at (0,32) size 8x12
+ RenderMathMLRootWrapper at (8,3) size 223x46
+ RenderMathMLRow {mrow} at (0,0) size 222x45
+ RenderMathMLToken {mn} at (0,33) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
RenderText {#text} at (0,-1) size 8x17
text run at (0,-1) width 8: "2"
- RenderMathMLOperator {mo} at (8,35) size 16x9
+ RenderMathMLOperator {mo} at (8,36) size 16x9
RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLRoot {mroot} at (23,0) size 219x57
- RenderMathMLRootWrapper at (4,14) size 5x43
+ RenderMathMLRoot {mroot} at (23,0) size 199x45
+ RenderMathMLRootWrapper at (4,10) size 5x35
RenderMathMLToken {mn} at (0,0) size 5x8
RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
RenderBlock (anonymous) at (0,0) size 5x8
RenderText {#text} at (0,0) size 5x10
text run at (0,0) width 5: "5"
- RenderMathMLBlock (anonymous, flex) at (0,0) size 13x57
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x57
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x56
- RenderBlock (anonymous) at (0,0) size 9x56
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x45
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x45
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x44
+ RenderBlock (anonymous) at (0,0) size 9x44
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 206x54
- RenderMathMLRow {mrow} at (0,0) size 206x51
- RenderMathMLToken {mn} at (0,28) size 8x12
+ RenderMathMLRootWrapper at (8,3) size 191x42
+ RenderMathMLRow {mrow} at (0,0) size 190x41
+ RenderMathMLToken {mn} at (0,29) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
RenderText {#text} at (0,-1) size 8x17
text run at (0,-1) width 8: "3"
- RenderMathMLOperator {mo} at (8,31) size 16x9
+ RenderMathMLOperator {mo} at (8,32) size 16x9
RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLRoot {mroot} at (23,0) size 183x51
- RenderMathMLRootWrapper at (4,12) size 5x39
+ RenderMathMLRoot {mroot} at (23,0) size 167x41
+ RenderMathMLRootWrapper at (4,8) size 5x33
RenderMathMLToken {mn} at (0,0) size 5x8
RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
RenderBlock (anonymous) at (0,0) size 5x8
RenderText {#text} at (0,0) size 5x10
text run at (0,0) width 5: "6"
- RenderMathMLBlock (anonymous, flex) at (0,0) size 13x51
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x51
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x50
- RenderBlock (anonymous) at (0,0) size 9x50
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x41
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x41
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x40
+ RenderBlock (anonymous) at (0,0) size 9x40
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 170x48
- RenderMathMLRow {mrow} at (0,0) size 170x45
- RenderMathMLToken {mn} at (0,24) size 8x12
+ RenderMathMLRootWrapper at (8,3) size 158x38
+ RenderMathMLRow {mrow} at (0,0) size 157x37
+ RenderMathMLToken {mn} at (0,25) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
RenderText {#text} at (0,-1) size 8x17
text run at (0,-1) width 8: "4"
- RenderMathMLOperator {mo} at (8,27) size 16x9
+ RenderMathMLOperator {mo} at (8,28) size 16x9
RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLRoot {mroot} at (23,0) size 147x45
- RenderMathMLRootWrapper at (4,11) size 5x34
+ RenderMathMLRoot {mroot} at (23,0) size 134x37
+ RenderMathMLRootWrapper at (4,7) size 5x30
RenderMathMLToken {mn} at (0,0) size 5x7
RenderMathMLBlock (anonymous, flex) at (0,0) size 5x7
RenderBlock (anonymous) at (0,0) size 5x7
RenderText {#text} at (0,-1) size 5x10
text run at (0,-1) width 5: "7"
- RenderMathMLBlock (anonymous, flex) at (0,0) size 13x45
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x45
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x44
- RenderBlock (anonymous) at (0,0) size 9x44
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x37
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x37
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x37
+ RenderBlock (anonymous) at (0,0) size 9x37
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 134x42
- RenderMathMLRow {mrow} at (0,0) size 134x39
- RenderMathMLToken {mn} at (0,20) size 8x12
+ RenderMathMLRootWrapper at (8,3) size 125x34
+ RenderMathMLRow {mrow} at (0,0) size 124x34
+ RenderMathMLToken {mn} at (0,21) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
RenderText {#text} at (0,-1) size 8x17
text run at (0,-1) width 8: "5"
- RenderMathMLOperator {mo} at (8,23) size 16x9
+ RenderMathMLOperator {mo} at (8,24) size 16x9
RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLRoot {mroot} at (23,0) size 111x39
- RenderMathMLRootWrapper at (4,7) size 5x32
+ RenderMathMLRoot {mroot} at (23,0) size 101x34
+ RenderMathMLRootWrapper at (4,5) size 5x29
RenderMathMLToken {mn} at (0,0) size 5x8
RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
RenderBlock (anonymous) at (0,0) size 5x8
RenderText {#text} at (0,0) size 5x10
text run at (0,0) width 5: "8"
- RenderMathMLBlock (anonymous, flex) at (0,0) size 13x39
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x39
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x38
- RenderBlock (anonymous) at (0,0) size 9x38
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x34
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x34
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x33
+ RenderBlock (anonymous) at (0,0) size 9x33
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 98x36
- RenderMathMLRow {mrow} at (0,0) size 98x33
- RenderMathMLToken {mn} at (0,16) size 8x12
+ RenderMathMLRootWrapper at (8,3) size 92x31
+ RenderMathMLRow {mrow} at (0,0) size 92x30
+ RenderMathMLToken {mn} at (0,17) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
RenderText {#text} at (0,-1) size 8x17
text run at (0,-1) width 8: "6"
- RenderMathMLOperator {mo} at (8,19) size 16x9
+ RenderMathMLOperator {mo} at (8,20) size 16x9
RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLRoot {mroot} at (23,0) size 75x33
- RenderMathMLRootWrapper at (4,5) size 5x28
+ RenderMathMLRoot {mroot} at (23,0) size 69x30
+ RenderMathMLRootWrapper at (4,3) size 5x27
RenderMathMLToken {mn} at (0,0) size 5x8
RenderMathMLBlock (anonymous, flex) at (0,0) size 5x8
RenderBlock (anonymous) at (0,0) size 5x8
RenderText {#text} at (0,0) size 5x10
text run at (0,0) width 5: "9"
- RenderMathMLBlock (anonymous, flex) at (0,0) size 13x33
- RenderMathMLRadicalOperator (anonymous) at (0,0) size 12x33
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x32
- RenderBlock (anonymous) at (0,0) size 9x32
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x30
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x30
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x29
+ RenderBlock (anonymous) at (0,0) size 9x29
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (12,3) size 62x30
- RenderMathMLRow {mrow} at (0,0) size 62x27
- RenderMathMLToken {mn} at (0,12) size 8x12
+ RenderMathMLRootWrapper at (8,3) size 60x27
+ RenderMathMLRow {mrow} at (0,0) size 59x26
+ RenderMathMLToken {mn} at (0,13) size 8x12
RenderMathMLBlock (anonymous, flex) at (0,0) size 8x12
RenderBlock (anonymous) at (0,0) size 8x12
RenderText {#text} at (0,-1) size 8x17
text run at (0,-1) width 8: "7"
- RenderMathMLOperator {mo} at (8,15) size 16x9
+ RenderMathMLOperator {mo} at (8,16) size 16x9
RenderMathMLBlock (anonymous, flex) at (3,0) size 10x9
RenderBlock (anonymous) at (0,0) size 9x9
RenderText at (0,-4) size 9x17
text run at (0,-4) width 9: "+"
- RenderMathMLRoot {mroot} at (23,0) size 39x27
- RenderMathMLRootWrapper at (4,0) size 20x27
+ RenderMathMLRoot {mroot} at (23,0) size 36x26
+ RenderMathMLRootWrapper at (4,0) size 20x26
RenderMathMLFraction {mfrac} at (0,0) size 19x17
RenderMathMLRow {mrow} at (0,0) size 19x7
RenderMathMLToken {mi} at (0,1) size 5x5 [padding: 0 1 0 0]
@@ -653,13 +653,13 @@
RenderBlock (anonymous) at (0,0) size 4x5
RenderText {#text} at (0,-3) size 4x10
text run at (0,-3) width 4: "z"
- RenderMathMLBlock (anonymous, flex) at (14,0) size 13x27
- RenderMathMLRadicalOperator (anonymous) at (0,9) size 12x18
- RenderMathMLBlock (anonymous, flex) at (0,0) size 9x18
- RenderBlock (anonymous) at (0,0) size 9x18
+ RenderMathMLBlock (anonymous, flex) at (14,0) size 10x26
+ RenderMathMLRadicalOperator (anonymous) at (0,9) size 9x17
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x16
+ RenderBlock (anonymous) at (0,0) size 9x16
RenderText at (0,1) size 9x17
text run at (0,1) width 9: "\x{221A}"
- RenderMathMLRootWrapper at (26,12) size 12x15
+ RenderMathMLRootWrapper at (23,12) size 12x14
RenderMathMLToken {mi} at (0,0) size 12x12 [padding: 0 2 0 0]
RenderMathMLBlock (anonymous, flex) at (0,0) size 10x12
RenderBlock (anonymous) at (0,0) size 10x12
Added: trunk/LayoutTests/platform/ios-simulator/mathml/radical-fallback-expected.txt (0 => 202161)
--- trunk/LayoutTests/platform/ios-simulator/mathml/radical-fallback-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/mathml/radical-fallback-expected.txt 2016-06-17 09:24:49 UTC (rev 202161)
@@ -0,0 +1,51 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x226
+ RenderBlock {HTML} at (0,0) size 800x226
+ RenderBody {BODY} at (8,16) size 784x194
+ RenderBlock {P} at (0,0) size 784x89
+ RenderText {#text} at (0,69) size 132x19
+ text run at (0,69) width 132: "Large LTR radicals: "
+ RenderMathMLMath {math} at (131,0) size 21x84 [padding: 0 1 0 1]
+ RenderMathMLSquareRoot {msqrt} at (1,0) size 9x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x84
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x83
+ RenderBlock (anonymous) at (0,0) size 9x83
+ RenderText at (0,1) size 9x17
+ text run at (0,1) width 9: "\x{221A}"
+ RenderMathMLRootWrapper at (8,3) size 0x81
+ RenderMathMLSpace {mspace} at (0,0) size 0x80
+ RenderMathMLSquareRoot {msqrt} at (9,0) size 10x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x84
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x83
+ RenderBlock (anonymous) at (0,0) size 9x83
+ RenderText at (0,-1) size 9x20
+ text run at (0,-1) width 9: "\x{221A}"
+ RenderMathMLRootWrapper at (8,3) size 0x81
+ RenderMathMLSpace {mspace} at (0,0) size 0x80
+ RenderText {#text} at (0,0) size 0x0
+ RenderBlock {P} at (0,105) size 784x89
+ RenderText {#text} at (0,69) size 132x19
+ text run at (0,69) width 132: "Large RTL radicals: "
+ RenderMathMLMath {math} at (131,0) size 21x84 [padding: 0 1 0 1]
+ RenderMathMLSquareRoot {msqrt} at (9,0) size 10x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x84
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x83
+ RenderBlock (anonymous) at (0,0) size 9x83
+ RenderText at (0,1) size 9x17
+ text run at (0,1) width 9 RTL: "\x{221A}"
+ RenderMathMLRootWrapper at (0,3) size 0x81
+ RenderMathMLSpace {mspace} at (0,0) size 0x80
+ RenderMathMLSquareRoot {msqrt} at (1,0) size 9x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x84
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x83
+ RenderBlock (anonymous) at (0,0) size 9x83
+ RenderText at (0,-1) size 9x20
+ text run at (0,-1) width 9 RTL: "\x{221A}"
+ RenderMathMLRootWrapper at (0,3) size 0x81
+ RenderMathMLSpace {mspace} at (0,0) size 0x80
+ RenderText {#text} at (0,0) size 0x0
Property changes on: trunk/LayoutTests/platform/ios-simulator/mathml/radical-fallback-expected.txt
___________________________________________________________________
Added: svn:eol-style
Added: trunk/LayoutTests/platform/mac/mathml/radical-fallback-expected.png
(Binary files differ)
Added: svn:executable
Added: svn:mime-type
Added: trunk/LayoutTests/platform/mac/mathml/radical-fallback-expected.txt (0 => 202161)
--- trunk/LayoutTests/platform/mac/mathml/radical-fallback-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac/mathml/radical-fallback-expected.txt 2016-06-17 09:24:49 UTC (rev 202161)
@@ -0,0 +1,51 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x224
+ RenderBlock {HTML} at (0,0) size 800x224
+ RenderBody {BODY} at (8,16) size 784x192
+ RenderBlock {P} at (0,0) size 784x88
+ RenderText {#text} at (0,70) size 132x18
+ text run at (0,70) width 132: "Large LTR radicals: "
+ RenderMathMLMath {math} at (131,0) size 27x84 [padding: 0 1 0 1]
+ RenderMathMLSquareRoot {msqrt} at (1,0) size 15x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 15x84
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 15x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 15x83
+ RenderBlock (anonymous) at (0,0) size 15x83
+ RenderText at (0,-1) size 15x24
+ text run at (0,-1) width 15: "\x{221A}"
+ RenderMathMLRootWrapper at (14,3) size 0x81
+ RenderMathMLSpace {mspace} at (0,0) size 0x80
+ RenderMathMLSquareRoot {msqrt} at (15,0) size 10x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x84
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x83
+ RenderBlock (anonymous) at (0,0) size 9x83
+ RenderText at (0,1) size 9x18
+ text run at (0,1) width 9: "\x{221A}"
+ RenderMathMLRootWrapper at (8,3) size 0x81
+ RenderMathMLSpace {mspace} at (0,0) size 0x80
+ RenderText {#text} at (0,0) size 0x0
+ RenderBlock {P} at (0,104) size 784x88
+ RenderText {#text} at (0,70) size 132x18
+ text run at (0,70) width 132: "Large RTL radicals: "
+ RenderMathMLMath {math} at (131,0) size 27x84 [padding: 0 1 0 1]
+ RenderMathMLSquareRoot {msqrt} at (9,0) size 16x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 15x84
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 15x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 15x83
+ RenderBlock (anonymous) at (0,0) size 15x83
+ RenderText at (0,-1) size 16x24
+ text run at (0,-1) width 15 RTL: "\x{221A}"
+ RenderMathMLRootWrapper at (0,3) size 0x81
+ RenderMathMLSpace {mspace} at (0,0) size 0x80
+ RenderMathMLSquareRoot {msqrt} at (1,0) size 9x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x84
+ RenderMathMLRadicalOperator (anonymous) at (0,0) size 9x84
+ RenderMathMLBlock (anonymous, flex) at (0,0) size 9x83
+ RenderBlock (anonymous) at (0,0) size 9x83
+ RenderText at (0,1) size 9x18
+ text run at (0,1) width 9 RTL: "\x{221A}"
+ RenderMathMLRootWrapper at (0,3) size 0x81
+ RenderMathMLSpace {mspace} at (0,0) size 0x80
+ RenderText {#text} at (0,0) size 0x0
Property changes on: trunk/LayoutTests/platform/mac/mathml/radical-fallback-expected.txt
___________________________________________________________________
Added: svn:executable
Added: svn:eol-style
Modified: trunk/Source/WebCore/ChangeLog (202160 => 202161)
--- trunk/Source/WebCore/ChangeLog 2016-06-17 06:23:26 UTC (rev 202160)
+++ trunk/Source/WebCore/ChangeLog 2016-06-17 09:24:49 UTC (rev 202161)
@@ -1,3 +1,37 @@
+2016-06-17 Frederic Wang <[email protected]>
+
+ MathOperator: Add fallback mechanisms for stretching and mirroring radical symbols
+ https://bugs.webkit.org/show_bug.cgi?id=156836
+
+ Reviewed by Sergio Villar Senin.
+
+ Some platforms do not have OpenType MATH fonts pre-installed and thus can not draw stretchy
+ operators using size variants or glyph assembly. This is especially problematic for the
+ radical symbol which is used to write roots. Currently, we have some fallback code to draw
+ that symbol using graphical primitives but it is a bit complex and makes the style of radical
+ inconsistent with the font used. We solve these issues by just scaling the base glyph via a
+ scale transform. Such scale transform is also used to mirror the radical symbol so that we
+ have some support for right-to-left roots until we can do glyph-level mirroring
+ via the OpenType rtlm feature.
+
+ Test: mathml/radical-fallback.html
+
+ * rendering/mathml/MathOperator.cpp: Add a constant for the code point U+221A of the radical.
+ (WebCore::MathOperator::reset): In general, we don't need any vertical scaling for radical
+ symbols so m_radicalVerticalScale is initialized to 1.
+ (WebCore::MathOperator::calculateStretchyData): If we don't have a font with a MATH table and we
+ try streching a radical, then we update the vertical metrics to match the target size and
+ set m_radicalVerticalScale to the value necessary to make the base glyph scaled to that size.
+ (WebCore::MathOperator::paint): For a radical operator, we may apply a scale transform of
+ parameters (radicalHorizontalScale, m_radicalVerticalScale) in order to support RTL
+ mirroring or vertical stretching.
+ * rendering/mathml/MathOperator.h: We add a m_radicalVerticalScale member to indicate the
+ scaling to apply to the base radical glyph when the stretchy fallback is necessary.
+ (WebCore::MathOperator::isStretched): The operator is also considered stretched when the
+ m_radicalVerticalScale is applied to the base size.
+ * rendering/mathml/RenderMathMLRadicalOperator.cpp: Remove code specific to the old fallback mechanism.
+ * rendering/mathml/RenderMathMLRadicalOperator.h: Ditto.
+
2016-06-16 Commit Queue <[email protected]>
Unreviewed, rolling out r202147.
Modified: trunk/Source/WebCore/rendering/mathml/MathOperator.cpp (202160 => 202161)
--- trunk/Source/WebCore/rendering/mathml/MathOperator.cpp 2016-06-17 06:23:26 UTC (rev 202160)
+++ trunk/Source/WebCore/rendering/mathml/MathOperator.cpp 2016-06-17 09:24:49 UTC (rev 202161)
@@ -31,6 +31,8 @@
#include "RenderStyle.h"
#include "StyleInheritedData.h"
+static const unsigned kRadicalOperator = 0x221A;
+
namespace WebCore {
static inline FloatRect boundsForGlyph(const GlyphData& data)
@@ -97,6 +99,7 @@
m_ascent = 0;
m_descent = 0;
m_italicCorrection = 0;
+ m_radicalVerticalScale = 1;
// We use the base size for the calculation of the preferred width.
GlyphData baseGlyph;
@@ -347,6 +350,19 @@
}
}
+ // Unicode contains U+23B7 RADICAL SYMBOL BOTTOM but it is generally not provided by fonts without a MATH table.
+ // Moreover, it's not clear what the proper vertical extender or top hook would be.
+ // Hence we fallback to scaling the base glyph vertically.
+ if (!calculateMaxPreferredWidth && m_baseCharacter == kRadicalOperator) {
+ LayoutUnit height = m_ascent + m_descent;
+ if (height > 0 && height < targetSize) {
+ m_radicalVerticalScale = targetSize.toFloat() / height;
+ m_ascent *= m_radicalVerticalScale;
+ m_descent *= m_radicalVerticalScale;
+ }
+ return;
+ }
+
// If we didn't find a stretchy character set for this character, we don't know how to stretch it.
if (!stretchyCharacter)
return;
@@ -593,6 +609,16 @@
GraphicsContextStateSaver stateSaver(info.context());
info.context().setFillColor(style.visitedDependentColor(CSSPropertyColor));
+ // For a radical character, we may need some scale transform to stretch it vertically or mirror it.
+ if (m_baseCharacter == kRadicalOperator) {
+ float radicalHorizontalScale = style.isLeftToRightDirection() ? 1 : -1;
+ if (radicalHorizontalScale == -1 || m_radicalVerticalScale > 1) {
+ LayoutPoint scaleOrigin = paintOffset;
+ scaleOrigin.move(m_width / 2, 0);
+ info.applyTransform(AffineTransform().translate(scaleOrigin).scale(radicalHorizontalScale, m_radicalVerticalScale).translate(-scaleOrigin));
+ }
+ }
+
if (m_stretchType == StretchType::GlyphAssembly) {
if (m_operatorType == Type::VerticalOperator)
paintVerticalGlyphAssembly(style, info, paintOffset);
Modified: trunk/Source/WebCore/rendering/mathml/MathOperator.h (202160 => 202161)
--- trunk/Source/WebCore/rendering/mathml/MathOperator.h 2016-06-17 06:23:26 UTC (rev 202160)
+++ trunk/Source/WebCore/rendering/mathml/MathOperator.h 2016-06-17 09:24:49 UTC (rev 202161)
@@ -52,7 +52,7 @@
void stretchTo(const RenderStyle&, LayoutUnit ascent, LayoutUnit descent);
void stretchTo(const RenderStyle&, LayoutUnit width);
- bool isStretched() const { return m_stretchType != StretchType::Unstretched; }
+ bool isStretched() const { return m_stretchType != StretchType::Unstretched || m_radicalVerticalScale > 1; }
void unstretch() { m_stretchType = StretchType::Unstretched; }
void paint(const RenderStyle&, PaintInfo&, const LayoutPoint&);
@@ -100,6 +100,7 @@
LayoutUnit m_ascent { 0 };
LayoutUnit m_descent { 0 };
LayoutUnit m_italicCorrection { 0 };
+ float m_radicalVerticalScale { 1 };
};
}
Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h (202160 => 202161)
--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h 2016-06-17 06:23:26 UTC (rev 202160)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h 2016-06-17 09:24:49 UTC (rev 202161)
@@ -43,7 +43,7 @@
RenderMathMLOperator(MathMLElement&, RenderStyle&&);
RenderMathMLOperator(Document&, RenderStyle&&, const String& operatorString, MathMLOperatorDictionary::Form, unsigned short flags = 0);
- virtual void stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline);
+ void stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline);
void stretchTo(LayoutUnit width);
LayoutUnit stretchSize() const { return m_isVertical ? m_stretchHeightAboveBaseline + m_stretchDepthBelowBaseline : m_stretchWidth; }
void resetStretchSize();
@@ -57,7 +57,7 @@
void styleDidChange(StyleDifference, const RenderStyle* oldStyle) final;
void updateStyle() final;
- void paint(PaintInfo&, const LayoutPoint&) override;
+ void paint(PaintInfo&, const LayoutPoint&) final;
void updateTokenContent(const String& operatorString);
void updateTokenContent() final;
@@ -67,8 +67,8 @@
protected:
virtual void setOperatorProperties();
- void computePreferredLogicalWidths() override;
- void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const override;
+ void computePreferredLogicalWidths() final;
+ void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const final;
void setLeadingSpace(LayoutUnit leadingSpace) { m_leadingSpace = leadingSpace; }
void setTrailingSpace(LayoutUnit trailingSpace) { m_trailingSpace = trailingSpace; }
UChar textContent() const { return m_textContent; }
Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLRadicalOperator.cpp (202160 => 202161)
--- trunk/Source/WebCore/rendering/mathml/RenderMathMLRadicalOperator.cpp 2016-06-17 06:23:26 UTC (rev 202160)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLRadicalOperator.cpp 2016-06-17 09:24:49 UTC (rev 202161)
@@ -35,42 +35,12 @@
static const UChar gRadicalCharacter = 0x221A;
// This class relies on the RenderMathMLOperator class to draw a radical symbol.
-// This does not work well when an OpenType MATH font is not available.
-// In that case, we fallback to the old implementation of RenderMathMLRoot.cpp with graphic primitives.
-// Normal width of the front of the radical sign, before the base & overbar (em)
-const float gFrontWidthEms = 0.75f;
-// Horizontal position of the bottom point of the radical (* frontWidth)
-const float gRadicalBottomPointXFront = 0.5f;
-// Lower the radical sign's bottom point (px)
-const int gRadicalBottomPointLower = 3;
-// Horizontal position of the top left point of the radical "dip" (* frontWidth)
-const float gRadicalDipLeftPointXFront = 0.8f;
-// Vertical position of the top left point of a sqrt radical "dip" (* baseHeight)
-const float gSqrtRadicalDipLeftPointYPos = 0.5f;
-// Vertical shift of the left end point of the radical (em)
-const float gRadicalLeftEndYShiftEms = 0.05f;
-
-// Radical line thickness (em)
-const float gRadicalLineThicknessEms = 0.02f;
-// Radical thick line thickness (em)
-const float gRadicalThickLineThicknessEms = 0.1f;
-
RenderMathMLRadicalOperator::RenderMathMLRadicalOperator(Document& document, RenderStyle&& style)
: RenderMathMLOperator(document, WTFMove(style), String(&gRadicalCharacter, 1), MathMLOperatorDictionary::Prefix)
{
}
-void RenderMathMLRadicalOperator::stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline)
-{
- if (!style().fontCascade().primaryFont().mathData()) {
- // If we do not have an OpenType MATH font, we always make the radical depth a bit larger than the target.
- depthBelowBaseline += gRadicalBottomPointLower;
- }
-
- RenderMathMLOperator::stretchTo(heightAboveBaseline, depthBelowBaseline);
-}
-
void RenderMathMLRadicalOperator::setOperatorProperties()
{
RenderMathMLOperator::setOperatorProperties();
@@ -79,99 +49,6 @@
setTrailingSpace(0);
}
-void RenderMathMLRadicalOperator::computePreferredLogicalWidths()
-{
- ASSERT(preferredLogicalWidthsDirty());
-
- if (style().fontCascade().primaryFont().mathData()) {
- RenderMathMLOperator::computePreferredLogicalWidths();
- return;
- }
-
- // If we do not have an OpenType MATH font, the front width is just given by the gFrontWidthEms constant.
- int frontWidth = lroundf(gFrontWidthEms * style().fontSize());
- m_minPreferredLogicalWidth = frontWidth;
- m_maxPreferredLogicalWidth = frontWidth;
}
-void RenderMathMLRadicalOperator::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
-{
- if (style().fontCascade().primaryFont().mathData()) {
- RenderMathMLOperator::computeLogicalHeight(logicalHeight, logicalTop, computedValues);
- return;
- }
-
- // If we do not have an OpenType MATH font, the logical height is always the stretch size.
- logicalHeight = stretchSize();
- RenderBox::computeLogicalHeight(logicalHeight, logicalTop, computedValues);
-}
-
-void RenderMathMLRadicalOperator::paint(PaintInfo& info, const LayoutPoint& paintOffset)
-{
- if (info.context().paintingDisabled() || info.phase != PaintPhaseForeground || style().visibility() != VISIBLE)
- return;
-
- if (style().fontCascade().primaryFont().mathData()) {
- RenderMathMLOperator::paint(info, paintOffset);
- return;
- }
-
- // If we do not have an OpenType MATH font, we paint the radical sign with graphic primitives.
- IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location() + contentBoxRect().location());
- int frontWidth = lroundf(gFrontWidthEms * style().fontSize());
- int startX = adjustedPaintOffset.x() + frontWidth;
- int baseHeight = stretchSize() - gRadicalBottomPointLower;
-
- float radicalDipLeftPointYPos = gSqrtRadicalDipLeftPointYPos * baseHeight;
-
- FloatPoint overbarLeftPoint(startX, adjustedPaintOffset.y());
- FloatPoint bottomPoint(startX - gRadicalBottomPointXFront * frontWidth, adjustedPaintOffset.y() + baseHeight + gRadicalBottomPointLower);
- FloatPoint dipLeftPoint(startX - gRadicalDipLeftPointXFront * frontWidth, adjustedPaintOffset.y() + radicalDipLeftPointYPos);
- FloatPoint leftEnd(startX - frontWidth, dipLeftPoint.y() + gRadicalLeftEndYShiftEms * style().fontSize());
-
- GraphicsContextStateSaver stateSaver(info.context());
-
- info.context().setStrokeThickness(gRadicalLineThicknessEms * style().fontSize());
- info.context().setStrokeStyle(SolidStroke);
- info.context().setStrokeColor(style().visitedDependentColor(CSSPropertyColor));
- info.context().setLineJoin(MiterJoin);
- info.context().setMiterLimit(style().fontSize());
-
- Path root;
-
- root.moveTo(FloatPoint(overbarLeftPoint.x(), adjustedPaintOffset.y()));
- // draw from top left corner to bottom point of radical
- root.addLineTo(bottomPoint);
- // draw from bottom point to top of left part of radical base "dip"
- root.addLineTo(dipLeftPoint);
- // draw to end
- root.addLineTo(leftEnd);
-
- info.context().strokePath(root);
-
- GraphicsContextStateSaver maskStateSaver(info.context());
-
- // Build a mask to draw the thick part of the root.
- Path maskPath;
-
- maskPath.moveTo(overbarLeftPoint);
- maskPath.addLineTo(bottomPoint);
- maskPath.addLineTo(dipLeftPoint);
- maskPath.addLineTo(FloatPoint(2 * dipLeftPoint.x() - leftEnd.x(), 2 * dipLeftPoint.y() - leftEnd.y()));
-
- info.context().clipPath(maskPath);
-
- // Draw the thick part of the root.
- info.context().setStrokeThickness(gRadicalThickLineThicknessEms * style().fontSize());
- info.context().setLineCap(SquareCap);
-
- Path line;
- line.moveTo(bottomPoint);
- line.addLineTo(dipLeftPoint);
-
- info.context().strokePath(line);
-}
-
-}
-
#endif
Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLRadicalOperator.h (202160 => 202161)
--- trunk/Source/WebCore/rendering/mathml/RenderMathMLRadicalOperator.h 2016-06-17 06:23:26 UTC (rev 202160)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLRadicalOperator.h 2016-06-17 09:24:49 UTC (rev 202161)
@@ -36,10 +36,6 @@
class RenderMathMLRadicalOperator final : public RenderMathMLOperator {
public:
RenderMathMLRadicalOperator(Document&, RenderStyle&&);
- void stretchTo(LayoutUnit heightAboveBaseline, LayoutUnit depthBelowBaseline) override;
- void computePreferredLogicalWidths() override;
- void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const override;
- void paint(PaintInfo&, const LayoutPoint& paintOffset) override;
private:
bool isRenderMathMLRadicalOperator() const override { return true; }
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
