Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[MathML] Poor spacing around delimiters in MathML Torture Test 14
https://bugs.webkit.org/show_bug.cgi?id=122837

Reviewed by Brent Fulgham.

Instead of stretching the vertical bar with the stretchable version, just repeat
the normal vertical bar. This follows what Gecko does when rendering tall vertical
bars and also works around an issue with STIX fonts leading to poor spacing in
formulas.

Source/WebCore:

* rendering/mathml/RenderMathMLOperator.cpp: Stretch the vertical bar with the
normal variant.

LayoutTests:

* platform/gtk/mathml/presentation/mo-stretch-expected.png: Update to reflect new results.
* platform/gtk/mathml/presentation/mo-stretch-expected.txt: Ditto.
* platform/mac/mathml/presentation/mo-stretch-expected.png: Ditto.
* platform/mac/mathml/presentation/mo-stretch-expected.txt: Ditto.

Canonical link: https://commits.webkit.org/142304@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159007 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
mrobinson committed Nov 10, 2013
1 parent c3d372d commit 9e6ac9a
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 77 deletions.
17 changes: 17 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
2013-11-09 Martin Robinson <mrobinson@igalia.com>

[MathML] Poor spacing around delimiters in MathML Torture Test 14
https://bugs.webkit.org/show_bug.cgi?id=122837

Reviewed by Brent Fulgham.

Instead of stretching the vertical bar with the stretchable version, just repeat
the normal vertical bar. This follows what Gecko does when rendering tall vertical
bars and also works around an issue with STIX fonts leading to poor spacing in
formulas.

* platform/gtk/mathml/presentation/mo-stretch-expected.png: Update to reflect new results.
* platform/gtk/mathml/presentation/mo-stretch-expected.txt: Ditto.
* platform/mac/mathml/presentation/mo-stretch-expected.png: Ditto.
* platform/mac/mathml/presentation/mo-stretch-expected.txt: Ditto.

2013-11-09 Andreas Kling <akling@apple.com>

Optimize baselines: svg/clip-path
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -3,8 +3,8 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x216
RenderBlock {HTML} at (0,0) size 800x216
RenderBody {BODY} at (8,8) size 784x200
RenderMathMLMath {math} at (0,0) size 188x20 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 186x20
RenderMathMLMath {math} at (0,0) size 181x20 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 179x20
RenderMathMLOperator {mo} at (1,3) size 8x14
RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
RenderBlock (anonymous) at (0,0) size 5x14
Expand Down Expand Up @@ -60,21 +60,21 @@ layer at (0,0) size 800x216
RenderBlock (anonymous) at (0,0) size 7x20
RenderText at (0,-3) size 7x25
text run at (0,-3) width 7: "\x{222B}"
RenderMathMLOperator {mo} at (161,3) size 11x12
RenderMathMLBlock (flex) {mo} at (0,0) size 10x12
RenderMathMLOperator {mo} at (161,3) size 4x12
RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
RenderBlock (anonymous) at (0,0) size 3x12
RenderText at (0,-6) size 3x25
text run at (0,-6) width 3: "|"
RenderMathMLOperator {mo} at (175,2) size 9x16
RenderMathMLOperator {mo} at (168,2) size 9x16
RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
RenderBlock (anonymous) at (0,0) size 8x16
RenderText at (0,-5) size 8x25
text run at (0,-5) width 8: "\x{2016}"
RenderText {#text} at (187,0) size 5x17
text run at (187,0) width 5: " "
RenderText {#text} at (180,0) size 5x17
text run at (180,0) width 5: " "
RenderBR {BR} at (0,0) size 0x0
RenderMathMLMath {math} at (0,20) size 191x114 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 189x114
RenderMathMLMath {math} at (0,20) size 184x114 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 182x114
RenderMathMLOperator {mo} at (1,22) size 8x92
RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
RenderBlock (anonymous) at (0,0) size 5x14
Expand Down Expand Up @@ -130,21 +130,21 @@ layer at (0,0) size 800x216
RenderBlock (anonymous) at (0,0) size 7x20
RenderText at (0,-3) size 7x25
text run at (0,-3) width 7: "\x{222B}"
RenderMathMLOperator {mo} at (161,22) size 11x92
RenderMathMLBlock (flex) {mo} at (0,0) size 10x12
RenderMathMLOperator {mo} at (161,22) size 4x92
RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
RenderBlock (anonymous) at (0,0) size 3x12
RenderText at (0,-6) size 3x25
text run at (0,-6) width 3: "|"
RenderMathMLOperator {mo} at (177,22) size 9x92
RenderMathMLOperator {mo} at (170,22) size 9x92
RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
RenderBlock (anonymous) at (0,0) size 8x16
RenderText at (0,-5) size 8x25
text run at (0,-5) width 8: "\x{2016}"
RenderMathMLSpace {mspace} at (188,0) size 1x76
RenderText {#text} at (190,81) size 5x17
text run at (190,81) width 5: " "
RenderMathMLMath {math} at (194,45) size 192x77 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 189x77
RenderMathMLSpace {mspace} at (181,0) size 1x76
RenderText {#text} at (183,81) size 5x17
text run at (183,81) width 5: " "
RenderMathMLMath {math} at (187,45) size 185x77 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 182x77
RenderMathMLOperator {mo} at (1,15) size 8x62
RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
RenderBlock (anonymous) at (0,0) size 5x14
Expand Down Expand Up @@ -200,21 +200,21 @@ layer at (0,0) size 800x216
RenderBlock (anonymous) at (0,0) size 7x20
RenderText at (0,-3) size 7x25
text run at (0,-3) width 7: "\x{222B}"
RenderMathMLOperator {mo} at (161,15) size 11x62
RenderMathMLBlock (flex) {mo} at (0,0) size 10x12
RenderMathMLOperator {mo} at (161,15) size 4x62
RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
RenderBlock (anonymous) at (0,0) size 3x12
RenderText at (0,-6) size 3x25
text run at (0,-6) width 3: "|"
RenderMathMLOperator {mo} at (177,15) size 9x62
RenderMathMLOperator {mo} at (170,15) size 9x62
RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
RenderBlock (anonymous) at (0,0) size 8x16
RenderText at (0,-5) size 8x25
text run at (0,-5) width 8: "\x{2016}"
RenderMathMLSpace {mspace} at (188,0) size 1x51
RenderText {#text} at (385,81) size 5x17
text run at (385,81) width 5: " "
RenderMathMLMath {math} at (389,75) size 192x26 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 189x26
RenderMathMLSpace {mspace} at (181,0) size 1x51
RenderText {#text} at (371,81) size 5x17
text run at (371,81) width 5: " "
RenderMathMLMath {math} at (375,75) size 185x32 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 182x32
RenderMathMLOperator {mo} at (1,9) size 8x14
RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
RenderBlock (anonymous) at (0,0) size 5x14
Expand Down Expand Up @@ -270,23 +270,23 @@ layer at (0,0) size 800x216
RenderBlock (anonymous) at (0,0) size 7x20
RenderText at (0,-3) size 7x25
text run at (0,-3) width 7: "\x{222B}"
RenderMathMLOperator {mo} at (161,9) size 11x12
RenderMathMLBlock (flex) {mo} at (0,0) size 10x12
RenderMathMLOperator {mo} at (161,6) size 4x26
RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
RenderBlock (anonymous) at (0,0) size 3x12
RenderText at (0,-6) size 3x25
text run at (0,-6) width 3: "|"
RenderMathMLOperator {mo} at (177,8) size 9x16
RenderMathMLOperator {mo} at (170,8) size 9x16
RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
RenderBlock (anonymous) at (0,0) size 8x16
RenderText at (0,-5) size 8x25
text run at (0,-5) width 8: "\x{2016}"
RenderMathMLSpace {mspace} at (188,0) size 1x21
RenderText {#text} at (580,81) size 5x17
text run at (580,81) width 5: " "
RenderMathMLSpace {mspace} at (181,0) size 1x21
RenderText {#text} at (559,81) size 5x17
text run at (559,81) width 5: " "
RenderBR {BR} at (0,0) size 0x0
RenderMathMLMath {math} at (0,133) size 203x68 [padding: 0 1 0 1]
RenderMathMLSquareRoot {msqrt} at (1,0) size 201x68 [intrinsic padding: 3 0 3 12]
RenderMathMLRow (anonymous) at (12,3) size 189x62
RenderMathMLMath {math} at (0,133) size 196x68 [padding: 0 1 0 1]
RenderMathMLSquareRoot {msqrt} at (1,0) size 194x68 [intrinsic padding: 3 0 3 12]
RenderMathMLRow (anonymous) at (12,3) size 182x62
RenderMathMLOperator {mo} at (1,12) size 8x50
RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
RenderBlock (anonymous) at (0,0) size 5x14
Expand Down Expand Up @@ -342,15 +342,15 @@ layer at (0,0) size 800x216
RenderBlock (anonymous) at (0,0) size 7x20
RenderText at (0,-3) size 7x25
text run at (0,-3) width 7: "\x{222B}"
RenderMathMLOperator {mo} at (161,12) size 11x50
RenderMathMLBlock (flex) {mo} at (0,0) size 10x12
RenderMathMLOperator {mo} at (161,12) size 4x50
RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
RenderBlock (anonymous) at (0,0) size 3x12
RenderText at (0,-6) size 3x25
text run at (0,-6) width 3: "|"
RenderMathMLOperator {mo} at (177,12) size 9x50
RenderMathMLOperator {mo} at (170,12) size 9x50
RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
RenderBlock (anonymous) at (0,0) size 8x16
RenderText at (0,-5) size 8x25
text run at (0,-5) width 8: "\x{2016}"
RenderMathMLSpace {mspace} at (188,0) size 1x41
RenderMathMLSpace {mspace} at (181,0) size 1x41
RenderText {#text} at (0,0) size 0x0
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -3,8 +3,8 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x216
RenderBlock {HTML} at (0,0) size 800x216
RenderBody {BODY} at (8,8) size 784x200
RenderMathMLMath {math} at (0,0) size 181x20 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 179x20
RenderMathMLMath {math} at (0,0) size 174x20 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 172x20
RenderMathMLOperator {mo} at (1,3) size 7x14
RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
RenderBlock (anonymous) at (0,0) size 5x14
Expand Down Expand Up @@ -60,21 +60,21 @@ layer at (0,0) size 800x216
RenderBlock (anonymous) at (0,0) size 7x20
RenderText at (0,-3) size 7x24
text run at (0,-3) width 7: "\x{222B}"
RenderMathMLOperator {mo} at (156,3) size 10x12
RenderMathMLBlock (flex) {mo} at (0,0) size 10x12
RenderMathMLOperator {mo} at (156,3) size 3x12
RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
RenderBlock (anonymous) at (0,0) size 3x12
RenderText at (0,-6) size 3x24
text run at (0,-6) width 3: "|"
RenderMathMLOperator {mo} at (170,2) size 8x16
RenderMathMLOperator {mo} at (163,2) size 8x16
RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
RenderBlock (anonymous) at (0,0) size 8x16
RenderText at (0,-5) size 8x24
text run at (0,-5) width 8: "\x{2016}"
RenderText {#text} at (181,0) size 4x18
text run at (181,0) width 4: " "
RenderText {#text} at (174,0) size 4x18
text run at (174,0) width 4: " "
RenderBR {BR} at (0,0) size 0x0
RenderMathMLMath {math} at (0,20) size 185x113 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 183x113
RenderMathMLMath {math} at (0,20) size 178x113 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 176x113
RenderMathMLOperator {mo} at (1,22) size 7x91
RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
RenderBlock (anonymous) at (0,0) size 5x14
Expand Down Expand Up @@ -130,21 +130,21 @@ layer at (0,0) size 800x216
RenderBlock (anonymous) at (0,0) size 7x20
RenderText at (0,-3) size 7x24
text run at (0,-3) width 7: "\x{222B}"
RenderMathMLOperator {mo} at (156,22) size 10x91
RenderMathMLBlock (flex) {mo} at (0,0) size 10x12
RenderMathMLOperator {mo} at (156,22) size 3x91
RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
RenderBlock (anonymous) at (0,0) size 3x12
RenderText at (0,-6) size 3x24
text run at (0,-6) width 3: "|"
RenderMathMLOperator {mo} at (172,22) size 8x91
RenderMathMLOperator {mo} at (165,22) size 8x91
RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
RenderBlock (anonymous) at (0,0) size 8x16
RenderText at (0,-5) size 8x24
text run at (0,-5) width 8: "\x{2016}"
RenderMathMLSpace {mspace} at (183,0) size 0x76
RenderText {#text} at (185,81) size 4x18
text run at (185,81) width 4: " "
RenderMathMLMath {math} at (189,45) size 185x76 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 183x76
RenderMathMLSpace {mspace} at (176,0) size 0x76
RenderText {#text} at (178,81) size 4x18
text run at (178,81) width 4: " "
RenderMathMLMath {math} at (182,45) size 178x76 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 176x76
RenderMathMLOperator {mo} at (1,15) size 7x61
RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
RenderBlock (anonymous) at (0,0) size 5x14
Expand Down Expand Up @@ -200,21 +200,21 @@ layer at (0,0) size 800x216
RenderBlock (anonymous) at (0,0) size 7x20
RenderText at (0,-3) size 7x24
text run at (0,-3) width 7: "\x{222B}"
RenderMathMLOperator {mo} at (156,15) size 10x61
RenderMathMLBlock (flex) {mo} at (0,0) size 10x12
RenderMathMLOperator {mo} at (156,15) size 3x61
RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
RenderBlock (anonymous) at (0,0) size 3x12
RenderText at (0,-6) size 3x24
text run at (0,-6) width 3: "|"
RenderMathMLOperator {mo} at (172,15) size 8x61
RenderMathMLOperator {mo} at (165,15) size 8x61
RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
RenderBlock (anonymous) at (0,0) size 8x16
RenderText at (0,-5) size 8x24
text run at (0,-5) width 8: "\x{2016}"
RenderMathMLSpace {mspace} at (183,0) size 0x51
RenderText {#text} at (374,81) size 4x18
text run at (374,81) width 4: " "
RenderMathMLMath {math} at (378,75) size 185x26 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 183x26
RenderMathMLSpace {mspace} at (176,0) size 0x51
RenderText {#text} at (360,81) size 4x18
text run at (360,81) width 4: " "
RenderMathMLMath {math} at (364,75) size 178x31 [padding: 0 1 0 1]
RenderMathMLRow {mrow} at (1,0) size 176x31
RenderMathMLOperator {mo} at (1,9) size 7x14
RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
RenderBlock (anonymous) at (0,0) size 5x14
Expand Down Expand Up @@ -270,23 +270,23 @@ layer at (0,0) size 800x216
RenderBlock (anonymous) at (0,0) size 7x20
RenderText at (0,-3) size 7x24
text run at (0,-3) width 7: "\x{222B}"
RenderMathMLOperator {mo} at (156,9) size 10x12
RenderMathMLBlock (flex) {mo} at (0,0) size 10x12
RenderMathMLOperator {mo} at (156,6) size 3x25
RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
RenderBlock (anonymous) at (0,0) size 3x12
RenderText at (0,-6) size 3x24
text run at (0,-6) width 3: "|"
RenderMathMLOperator {mo} at (172,8) size 8x16
RenderMathMLOperator {mo} at (165,8) size 8x16
RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
RenderBlock (anonymous) at (0,0) size 8x16
RenderText at (0,-5) size 8x24
text run at (0,-5) width 8: "\x{2016}"
RenderMathMLSpace {mspace} at (183,0) size 0x21
RenderText {#text} at (563,81) size 4x18
text run at (563,81) width 4: " "
RenderMathMLSpace {mspace} at (176,0) size 0x21
RenderText {#text} at (542,81) size 4x18
text run at (542,81) width 4: " "
RenderBR {BR} at (0,0) size 0x0
RenderMathMLMath {math} at (0,133) size 197x67 [padding: 0 1 0 1]
RenderMathMLSquareRoot {msqrt} at (1,0) size 195x67 [intrinsic padding: 3 0 3 12]
RenderMathMLRow (anonymous) at (12,3) size 183x61
RenderMathMLMath {math} at (0,133) size 190x67 [padding: 0 1 0 1]
RenderMathMLSquareRoot {msqrt} at (1,0) size 188x67 [intrinsic padding: 3 0 3 12]
RenderMathMLRow (anonymous) at (12,3) size 176x61
RenderMathMLOperator {mo} at (1,12) size 7x49
RenderMathMLBlock (flex) {mo} at (0,0) size 7x14
RenderBlock (anonymous) at (0,0) size 5x14
Expand Down Expand Up @@ -342,15 +342,15 @@ layer at (0,0) size 800x216
RenderBlock (anonymous) at (0,0) size 7x20
RenderText at (0,-3) size 7x24
text run at (0,-3) width 7: "\x{222B}"
RenderMathMLOperator {mo} at (156,12) size 10x49
RenderMathMLBlock (flex) {mo} at (0,0) size 10x12
RenderMathMLOperator {mo} at (156,12) size 3x49
RenderMathMLBlock (flex) {mo} at (0,0) size 3x12
RenderBlock (anonymous) at (0,0) size 3x12
RenderText at (0,-6) size 3x24
text run at (0,-6) width 3: "|"
RenderMathMLOperator {mo} at (172,12) size 8x49
RenderMathMLOperator {mo} at (165,12) size 8x49
RenderMathMLBlock (flex) {mo} at (0,0) size 8x16
RenderBlock (anonymous) at (0,0) size 8x16
RenderText at (0,-5) size 8x24
text run at (0,-5) width 8: "\x{2016}"
RenderMathMLSpace {mspace} at (183,0) size 0x41
RenderMathMLSpace {mspace} at (176,0) size 0x41
RenderText {#text} at (0,0) size 0x0
15 changes: 15 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
2013-11-09 Martin Robinson <mrobinson@igalia.com>

[MathML] Poor spacing around delimiters in MathML Torture Test 14
https://bugs.webkit.org/show_bug.cgi?id=122837

Reviewed by Brent Fulgham.

Instead of stretching the vertical bar with the stretchable version, just repeat
the normal vertical bar. This follows what Gecko does when rendering tall vertical
bars and also works around an issue with STIX fonts leading to poor spacing in
formulas.

* rendering/mathml/RenderMathMLOperator.cpp: Stretch the vertical bar with the
normal variant.

2013-11-09 Anders Carlsson <andersca@apple.com>

Encode form data using the KeyedEncoder
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Expand Up @@ -56,7 +56,7 @@ static RenderMathMLOperator::StretchyCharacter stretchyCharacters[13] = {
{ 0x2309, 0x23a4, 0x23a5, 0x23a5, 0x0 }, // right ceiling
{ 0x230b, 0x23a5, 0x23a5, 0x23a6, 0x0 }, // right floor
{ 0x7b , 0x23a7, 0x23aa, 0x23a9, 0x23a8 }, // left curly bracket
{ 0x7c , 0x23aa, 0x23aa, 0x23aa, 0x0 }, // vertical bar
{ 0x7c , 0x7c, 0x7c, 0x7c, 0x0 }, // vertical bar
{ 0x2016, 0x2016, 0x2016, 0x2016, 0x0 }, // double vertical line
{ 0x7d , 0x23ab, 0x23aa, 0x23ad, 0x23ac }, // right curly bracket
{ 0x222b, 0x2320, 0x23ae, 0x2321, 0x0 } // integral sign
Expand Down

0 comments on commit 9e6ac9a

Please sign in to comment.