Changeset 109081 in webkit
- Timestamp:
- Feb 27, 2012 10:57:03 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r109079 r109081 1 2012-02-27 David Barton <dbarton@mathscribe.com> 2 3 Fix <msubsup> formatting, especially for a tall base, subscript, or superscript 4 https://bugs.webkit.org/show_bug.cgi?id=79274 5 6 Reviewed by Julien Chaffraix. 7 8 * mathml/presentation/subsup.xhtml: 9 * platform/mac/mathml/presentation/mo-stretch-expected.png: Added property svn:mime-type. 10 * platform/mac/mathml/presentation/mo-stretch-expected.txt: 11 * platform/mac/mathml/presentation/msubsup-base-changed-expected.png: 12 * platform/mac/mathml/presentation/msubsup-base-changed-expected.txt: 13 * platform/mac/mathml/presentation/msubsup-sub-changed-expected.png: 14 * platform/mac/mathml/presentation/msubsup-sub-changed-expected.txt: 15 * platform/mac/mathml/presentation/msubsup-sup-changed-expected.png: 16 * platform/mac/mathml/presentation/msubsup-sup-changed-expected.txt: 17 * platform/mac/mathml/presentation/sub-expected.png: 18 * platform/mac/mathml/presentation/sub-expected.txt: 19 * platform/mac/mathml/presentation/subsup-expected.png: 20 * platform/mac/mathml/presentation/subsup-expected.txt: 21 1 22 2012-02-27 Csaba Osztrogonác <ossy@webkit.org> 2 23 -
trunk/LayoutTests/mathml/presentation/subsup.xhtml
r62152 r109081 41 41 </math> 42 42 </p> 43 <p id='t6'>parts with various heights: 44 <math xmlns='http://www.w3.org/1998/Math/MathML'> 45 <msubsup><mi>x</mi><mi>n</mi><mfrac><mi>f</mi><mi>g</mi></mfrac></msubsup> 46 <mo>+</mo><msubsup><mi>x</mi><mfrac><mi>f</mi><mi>g</mi></mfrac><mi>n</mi></msubsup> 47 <mo>+</mo><msubsup><mfenced><mfrac><mi>f</mi><mi>g</mi></mfrac></mfenced><mi>n</mi><mi>x</mi></msubsup> 48 </math> 49 </p> 43 50 </body> 44 51 </html> -
trunk/LayoutTests/platform/mac/mathml/presentation/mo-stretch-expected.txt
r108262 r109081 61 61 RenderMathMLRow {mrow} at (9,0) size 44x63 62 62 RenderMathMLOperator {mo} at (0,0) size 6x63 63 RenderMathMLSubSup {msubsup} at (6, 4) size 32x5264 RenderMathMLBlock {msubsup} at (0, 3) size 7x3463 RenderMathMLSubSup {msubsup} at (6,7) size 32x52 64 RenderMathMLBlock {msubsup} at (0,0) size 7x34 65 65 RenderInline {mi} at (0,0) size 7x16 66 66 RenderText {#text} at (0,18) size 7x16 … … 108 108 RenderText {mo} at (0,0) size 9x16 109 109 text run at (0,0) width 9: "+" 110 RenderMathMLRow {mrow} at (127,1 0) size 38x66111 RenderMathMLSubSup {msubsup} at (0,0) size 17x 66112 RenderMathMLBlock {msubsup} at (0, 3) size 10x63113 RenderMathMLOperator {mo} at (0,0) size 10x 63114 RenderMathMLBlock {msubsup} at (11,0) size 6x 64115 RenderMathMLBlock {msubsup} at (0, -4) size 6x16110 RenderMathMLRow {mrow} at (127,19) size 38x53 111 RenderMathMLSubSup {msubsup} at (0,0) size 17x53 112 RenderMathMLBlock {msubsup} at (0,0) size 10x53 113 RenderMathMLOperator {mo} at (0,0) size 10x53 114 RenderMathMLBlock {msubsup} at (11,0) size 6x53 115 RenderMathMLBlock {msubsup} at (0,0) size 6x41 116 116 RenderInline {mi} at (0,0) size 6x12 117 RenderText {#text} at (0, 3) size 6x12118 text run at (0, 3) width 6: "b"119 RenderMathMLBlock {msubsup} at (0,4 8) size 6x16117 RenderText {#text} at (0,0) size 6x12 118 text run at (0,0) width 6: "b" 119 RenderMathMLBlock {msubsup} at (0,41) size 6x12 120 120 RenderInline {mi} at (0,0) size 6x12 121 RenderText {#text} at (0, 3) size 6x12122 text run at (0, 3) width 6: "a"123 RenderMathMLRow {mrow} at (17, 16) size 21x44121 RenderText {#text} at (0,0) size 6x12 122 text run at (0,0) width 6: "a" 123 RenderMathMLRow {mrow} at (17,7) size 21x44 124 124 RenderMathMLUnderOver {munderover} at (0,0) size 17x44 125 125 RenderMathMLBlock (anonymous) at (0,0) size 17x16 … … 259 259 layer at (429,73) size 5x11 scrollHeight 14 260 260 RenderMathMLBlock {mo} at (0,52) size 5x11 261 layer at (445,2 1) size 10x10 scrollHeight 15261 layer at (445,27) size 10x10 scrollHeight 15 262 262 RenderMathMLBlock {mo} at (0,0) size 10x10 263 layer at (445,3 1) size 10x10 scrollHeight 14263 layer at (445,37) size 10x10 scrollHeight 14 264 264 RenderMathMLBlock {mo} at (0,10) size 10x10 265 265 RenderText {mo} at (0,-3) size 10x17 266 266 text run at (0,-3) width 10: "\x{23AE}" 267 layer at (445,4 1) size 10x10 scrollHeight 14267 layer at (445,47) size 10x10 scrollHeight 14 268 268 RenderMathMLBlock {mo} at (0,20) size 10x10 269 269 RenderText {mo} at (0,-3) size 10x17 270 270 text run at (0,-3) width 10: "\x{23AE}" 271 layer at (445,5 1) size 10x10 scrollHeight 14271 layer at (445,57) size 10x10 scrollHeight 14 272 272 RenderMathMLBlock {mo} at (0,30) size 10x10 273 273 RenderText {mo} at (0,-3) size 10x17 274 274 text run at (0,-3) width 10: "\x{23AE}" 275 layer at (445,6 1) size 10x10scrollHeight 14276 RenderMathMLBlock {mo} at (0,40) size 10x 10275 layer at (445,67) size 10x2 scrollHeight 14 276 RenderMathMLBlock {mo} at (0,40) size 10x2 277 277 RenderText {mo} at (0,-3) size 10x17 278 278 text run at (0,-3) width 10: "\x{23AE}" 279 layer at (445,71) size 10x2 scrollHeight 14 280 RenderMathMLBlock {mo} at (0,50) size 10x2 281 RenderText {mo} at (0,-3) size 10x17 282 text run at (0,-3) width 10: "\x{23AE}" 283 layer at (445,73) size 10x11 scrollHeight 14 284 RenderMathMLBlock {mo} at (0,52) size 10x11 279 layer at (445,69) size 10x11 scrollHeight 14 280 RenderMathMLBlock {mo} at (0,42) size 10x11 285 281 layer at (323,9) size 5x11 backgroundClip at (323,8) size 5x10 clip at (323,8) size 5x10 outlineClip at (323,8) size 5x10 286 282 RenderBlock (relative positioned) {mo} at (0,0) size 5x11 … … 315 311 RenderText {mo} at (0,-3) size 5x17 316 312 text run at (0,-3) width 5: "\x{23A6}" 317 layer at (445,2 2) size 10x11 backgroundClip at (445,21) size 10x10 clip at (445,21) size 10x10 outlineClip at (445,21) size 10x10313 layer at (445,28) size 10x11 backgroundClip at (445,27) size 10x10 clip at (445,27) size 10x10 outlineClip at (445,27) size 10x10 318 314 RenderBlock (relative positioned) {mo} at (0,0) size 10x11 319 315 RenderText {mo} at (0,-3) size 10x17 320 316 text run at (0,-3) width 10: "\x{2320}" 321 layer at (445, 70) size 10x11 backgroundClip at (445,73) size 10x11 clip at (445,73) size 10x11 outlineClip at (445,73) size 10x11317 layer at (445,66) size 10x11 backgroundClip at (445,69) size 10x11 clip at (445,69) size 10x11 outlineClip at (445,69) size 10x11 322 318 RenderBlock (relative positioned) {mo} at (0,0) size 10x11 323 319 RenderText {mo} at (0,-3) size 10x17 -
trunk/LayoutTests/platform/mac/mathml/presentation/msubsup-base-changed-expected.txt
r95566 r109081 1 1 layer at (0,0) size 800x600 2 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x 644 RenderBlock {html} at (0,0) size 800x 645 RenderBody {body} at (8,16) size 784x 326 RenderBlock {p} at (0,0) size 784x 327 RenderMathMLMath {math} at (0,0) size 16x 328 RenderMathMLSubSup {msubsup} at (1,0) size 14x 329 RenderMathMLBlock {msubsup} at (0, 3) size 7x243 layer at (0,0) size 800x56 4 RenderBlock {html} at (0,0) size 800x56 5 RenderBody {body} at (8,16) size 784x24 6 RenderBlock {p} at (0,0) size 784x24 7 RenderMathMLMath {math} at (0,0) size 16x24 8 RenderMathMLSubSup {msubsup} at (1,0) size 14x24 9 RenderMathMLBlock {msubsup} at (0,0) size 7x20 10 10 RenderInline {mi} at (0,0) size 7x16 11 RenderText {#text} at (0, 8) size 7x1612 text run at (0, 8) width 7: "y"13 RenderMathMLBlock {msubsup} at (7, 22) size 0x014 RenderMathMLBlock {msubsup} at (8,0) size 6x 3215 RenderMathMLBlock {msubsup} at (0,0) size 6x1 611 RenderText {#text} at (0,4) size 7x16 12 text run at (0,4) width 7: "y" 13 RenderMathMLBlock {msubsup} at (7,15) size 0x0 14 RenderMathMLBlock {msubsup} at (8,0) size 6x24 15 RenderMathMLBlock {msubsup} at (0,0) size 6x12 16 16 RenderInline {mi} at (0,0) size 5x12 17 RenderText {#text} at (0, 3) size 5x1218 text run at (0, 3) width 5: "k"19 RenderMathMLBlock {msubsup} at (0,1 6) size 6x1617 RenderText {#text} at (0,0) size 5x12 18 text run at (0,0) width 5: "k" 19 RenderMathMLBlock {msubsup} at (0,12) size 6x12 20 20 RenderInline {mn} at (0,0) size 6x12 21 RenderText {#text} at (0, 3) size 6x1222 text run at (0, 3) width 6: "1"21 RenderText {#text} at (0,0) size 6x12 22 text run at (0,0) width 6: "1" 23 23 RenderText {#text} at (0,0) size 0x0 -
trunk/LayoutTests/platform/mac/mathml/presentation/msubsup-sub-changed-expected.txt
r95566 r109081 1 1 layer at (0,0) size 800x600 2 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x 644 RenderBlock {html} at (0,0) size 800x 645 RenderBody {body} at (8,16) size 784x 326 RenderBlock {p} at (0,0) size 784x 327 RenderMathMLMath {math} at (0,0) size 16x 328 RenderMathMLSubSup {msubsup} at (1,0) size 14x 329 RenderMathMLBlock {msubsup} at (0, 3) size 7x243 layer at (0,0) size 800x56 4 RenderBlock {html} at (0,0) size 800x56 5 RenderBody {body} at (8,16) size 784x24 6 RenderBlock {p} at (0,0) size 784x24 7 RenderMathMLMath {math} at (0,0) size 16x24 8 RenderMathMLSubSup {msubsup} at (1,0) size 14x24 9 RenderMathMLBlock {msubsup} at (0,0) size 7x20 10 10 RenderInline {mi} at (0,0) size 7x16 11 RenderText {#text} at (0, 8) size 7x1612 text run at (0, 8) width 7: "x"13 RenderMathMLBlock {msubsup} at (8,0) size 6x 3214 RenderMathMLBlock {msubsup} at (0,0) size 6x1 611 RenderText {#text} at (0,4) size 7x16 12 text run at (0,4) width 7: "x" 13 RenderMathMLBlock {msubsup} at (8,0) size 6x24 14 RenderMathMLBlock {msubsup} at (0,0) size 6x12 15 15 RenderInline {mi} at (0,0) size 5x12 16 RenderText {#text} at (0, 3) size 5x1217 text run at (0, 3) width 5: "k"18 RenderMathMLBlock {msubsup} at (0,1 6) size 6x019 RenderMathMLBlock {msubsup} at (0,1 6) size 6x1616 RenderText {#text} at (0,0) size 5x12 17 text run at (0,0) width 5: "k" 18 RenderMathMLBlock {msubsup} at (0,12) size 6x0 19 RenderMathMLBlock {msubsup} at (0,12) size 6x12 20 20 RenderInline {mn} at (0,0) size 6x12 21 RenderText {#text} at (0, 3) size 6x1222 text run at (0, 3) width 6: "2"21 RenderText {#text} at (0,0) size 6x12 22 text run at (0,0) width 6: "2" 23 23 RenderText {#text} at (0,0) size 0x0 -
trunk/LayoutTests/platform/mac/mathml/presentation/msubsup-sup-changed-expected.txt
r95566 r109081 1 1 layer at (0,0) size 800x600 2 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x 644 RenderBlock {html} at (0,0) size 800x 645 RenderBody {body} at (8,16) size 784x 326 RenderBlock {p} at (0,0) size 784x 327 RenderMathMLMath {math} at (0,0) size 16x 328 RenderMathMLSubSup {msubsup} at (1,0) size 14x 329 RenderMathMLBlock {msubsup} at (0, 3) size 7x243 layer at (0,0) size 800x56 4 RenderBlock {html} at (0,0) size 800x56 5 RenderBody {body} at (8,16) size 784x24 6 RenderBlock {p} at (0,0) size 784x24 7 RenderMathMLMath {math} at (0,0) size 16x24 8 RenderMathMLSubSup {msubsup} at (1,0) size 14x24 9 RenderMathMLBlock {msubsup} at (0,0) size 7x20 10 10 RenderInline {mi} at (0,0) size 7x16 11 RenderText {#text} at (0, 8) size 7x1612 text run at (0, 8) width 7: "x"13 RenderMathMLBlock {msubsup} at (8,0) size 6x 3214 RenderMathMLBlock {msubsup} at (0,0) size 6x1 611 RenderText {#text} at (0,4) size 7x16 12 text run at (0,4) width 7: "x" 13 RenderMathMLBlock {msubsup} at (8,0) size 6x24 14 RenderMathMLBlock {msubsup} at (0,0) size 6x12 15 15 RenderInline {mi} at (0,0) size 3x12 16 RenderText {#text} at (0, 3) size 3x1217 text run at (0, 3) width 3: "j"18 RenderMathMLBlock {msubsup} at (0,1 6) size 6x019 RenderMathMLBlock {msubsup} at (0,1 6) size 6x1616 RenderText {#text} at (0,0) size 3x12 17 text run at (0,0) width 3: "j" 18 RenderMathMLBlock {msubsup} at (0,12) size 6x0 19 RenderMathMLBlock {msubsup} at (0,12) size 6x12 20 20 RenderInline {mn} at (0,0) size 6x12 21 RenderText {#text} at (0, 3) size 6x1222 text run at (0, 3) width 6: "1"21 RenderText {#text} at (0,0) size 6x12 22 text run at (0,0) width 6: "1" 23 23 RenderText {#text} at (0,0) size 0x0 -
trunk/LayoutTests/platform/mac/mathml/presentation/sub-expected.txt
r95566 r109081 1 1 layer at (0,0) size 800x600 2 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x13 44 RenderBlock {html} at (0,0) size 800x13 45 RenderBody {body} at (8,16) size 784x10 23 layer at (0,0) size 800x132 4 RenderBlock {html} at (0,0) size 800x132 5 RenderBody {body} at (8,16) size 784x100 6 6 RenderBlock {p} at (0,0) size 784x22 7 7 RenderText {#text} at (0,0) size 27x18 … … 31 31 text run at (9,7) width 5: "x" 32 32 RenderText {#text} at (0,0) size 0x0 33 RenderBlock {p} at (0,76) size 784x2 634 RenderText {#text} at (0, 4) size 27x1835 text run at (0, 4) width 27: "text "36 RenderMathMLMath {math} at (27,0) size 1 5x2637 RenderMathMLSubSup {msub} at (1,0) size 1 3x2638 RenderMathMLBlock {msub} at (0,0) size 6x2339 RenderMathMLOperator {mo} at (0,0) size 6x2340 RenderMathMLBlock {mo} at (0,0) size 6x2241 RenderText {mo} at (0,- 2) size 6x2642 text run at (0,- 2) width 6: "\x{222B}"33 RenderBlock {p} at (0,76) size 784x24 34 RenderText {#text} at (0,2) size 27x18 35 text run at (0,2) width 27: "text " 36 RenderMathMLMath {math} at (27,0) size 14x24 37 RenderMathMLSubSup {msub} at (1,0) size 12x24 38 RenderMathMLBlock {msub} at (0,0) size 5x21 39 RenderMathMLOperator {mo} at (0,0) size 5x21 40 RenderMathMLBlock {mo} at (0,0) size 5x19 41 RenderText {mo} at (0,-1) size 5x22 42 text run at (0,-1) width 5: "\x{222B}" 43 43 RenderInline {mi} at (0,0) size 7x12 44 RenderText {#text} at ( 6,14) size 7x1245 text run at ( 6,14) width 7: "Y"44 RenderText {#text} at (5,12) size 7x12 45 text run at (5,12) width 7: "Y" 46 46 RenderText {#text} at (0,0) size 0x0 -
trunk/LayoutTests/platform/mac/mathml/presentation/subsup-expected.txt
r95566 r109081 1 1 layer at (0,0) size 800x600 2 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x2 564 RenderBlock {html} at (0,0) size 800x2 565 RenderBody {body} at (8,16) size 784x2 246 RenderBlock {p} at (0,0) size 784x 327 RenderText {#text} at (0, 8) size 36x188 text run at (0, 8) width 36: "both: "9 RenderMathMLMath {math} at (36,0) size 16x 3210 RenderMathMLSubSup {msubsup} at (1,0) size 14x 3211 RenderMathMLBlock {msubsup} at (0, 3) size 7x243 layer at (0,0) size 800x284 4 RenderBlock {html} at (0,0) size 800x284 5 RenderBody {body} at (8,16) size 784x252 6 RenderBlock {p} at (0,0) size 784x24 7 RenderText {#text} at (0,1) size 36x18 8 text run at (0,1) width 36: "both: " 9 RenderMathMLMath {math} at (36,0) size 16x24 10 RenderMathMLSubSup {msubsup} at (1,0) size 14x24 11 RenderMathMLBlock {msubsup} at (0,0) size 7x20 12 12 RenderInline {mi} at (0,0) size 7x16 13 RenderText {#text} at (0, 8) size 7x1614 text run at (0, 8) width 7: "x"15 RenderMathMLBlock {msubsup} at (8,0) size 6x 3216 RenderMathMLBlock {msubsup} at (0,0) size 6x1 613 RenderText {#text} at (0,4) size 7x16 14 text run at (0,4) width 7: "x" 15 RenderMathMLBlock {msubsup} at (8,0) size 6x24 16 RenderMathMLBlock {msubsup} at (0,0) size 6x12 17 17 RenderInline {mi} at (0,0) size 5x12 18 RenderText {#text} at (0, 3) size 5x1219 text run at (0, 3) width 5: "k"20 RenderMathMLBlock {msubsup} at (0,1 6) size 6x1618 RenderText {#text} at (0,0) size 5x12 19 text run at (0,0) width 5: "k" 20 RenderMathMLBlock {msubsup} at (0,12) size 6x12 21 21 RenderInline {mn} at (0,0) size 6x12 22 RenderText {#text} at (0, 3) size 6x1223 text run at (0, 3) width 6: "1"24 RenderText {#text} at (0,0) size 0x0 25 RenderBlock {p} at (0,4 8) size 784x3226 RenderText {#text} at (0, 8) size 148x1827 text run at (0, 8) width 148: "long subscript w/ both: "28 RenderMathMLMath {math} at (148,0) size 44x 3229 RenderMathMLSubSup {msubsup} at (1,0) size 42x 3230 RenderMathMLBlock {msubsup} at (0, 3) size 9x2422 RenderText {#text} at (0,0) size 6x12 23 text run at (0,0) width 6: "1" 24 RenderText {#text} at (0,0) size 0x0 25 RenderBlock {p} at (0,40) size 784x24 26 RenderText {#text} at (0,1) size 148x18 27 text run at (0,1) width 148: "long subscript w/ both: " 28 RenderMathMLMath {math} at (148,0) size 44x24 29 RenderMathMLSubSup {msubsup} at (1,0) size 42x24 30 RenderMathMLBlock {msubsup} at (0,0) size 9x20 31 31 RenderInline {mi} at (0,0) size 9x16 32 RenderText {#text} at (0, 8) size 9x1633 text run at (0, 8) width 9: "Z"34 RenderMathMLBlock {msubsup} at (10,0) size 32x 3235 RenderMathMLBlock {msubsup} at (0,0) size 32x1 632 RenderText {#text} at (0,4) size 9x16 33 text run at (0,4) width 9: "Z" 34 RenderMathMLBlock {msubsup} at (10,0) size 32x24 35 RenderMathMLBlock {msubsup} at (0,0) size 32x12 36 36 RenderInline {mi} at (0,0) size 3x12 37 RenderText {#text} at (0, 3) size 3x1238 text run at (0, 3) width 3: "j"39 RenderMathMLBlock {msubsup} at (0,1 6) size 32x1640 RenderMathMLRow {mrow} at (1, 3) size 31x1237 RenderText {#text} at (0,0) size 3x12 38 text run at (0,0) width 3: "j" 39 RenderMathMLBlock {msubsup} at (0,12) size 32x12 40 RenderMathMLRow {mrow} at (1,0) size 31x12 41 41 RenderInline {mi} at (0,0) size 5x12 42 42 RenderText {#text} at (0,0) size 5x12 … … 57 57 text run at (26,0) width 5: "z" 58 58 RenderText {#text} at (0,0) size 0x0 59 RenderBlock {p} at (0, 96) size 784x3260 RenderText {#text} at (0, 8) size 160x1861 text run at (0, 8) width 160: "long superscript w/ both: "62 RenderMathMLMath {math} at (160,0) size 29x 3263 RenderMathMLSubSup {msubsup} at (1,0) size 27x 3264 RenderMathMLBlock {msubsup} at (0, 3) size 9x2459 RenderBlock {p} at (0,80) size 784x24 60 RenderText {#text} at (0,1) size 160x18 61 text run at (0,1) width 160: "long superscript w/ both: " 62 RenderMathMLMath {math} at (160,0) size 29x24 63 RenderMathMLSubSup {msubsup} at (1,0) size 27x24 64 RenderMathMLBlock {msubsup} at (0,0) size 9x20 65 65 RenderInline {mi} at (0,0) size 9x16 66 RenderText {#text} at (0, 8) size 9x1667 text run at (0, 8) width 9: "Z"68 RenderMathMLBlock {msubsup} at (10,0) size 17x 3269 RenderMathMLBlock {msubsup} at (0,0) size 17x1 670 RenderMathMLRow {mrow} at (1, 3) size 16x1266 RenderText {#text} at (0,4) size 9x16 67 text run at (0,4) width 9: "Z" 68 RenderMathMLBlock {msubsup} at (10,0) size 17x24 69 RenderMathMLBlock {msubsup} at (0,0) size 17x12 70 RenderMathMLRow {mrow} at (1,0) size 16x12 71 71 RenderInline {mi} at (0,0) size 5x12 72 72 RenderText {#text} at (0,0) size 5x12 … … 79 79 RenderText {#text} at (13,0) size 3x12 80 80 text run at (13,0) width 3: "j" 81 RenderMathMLBlock {msubsup} at (0,1 6) size 17x1681 RenderMathMLBlock {msubsup} at (0,12) size 17x12 82 82 RenderInline {mi} at (0,0) size 5x12 83 RenderText {#text} at (0, 3) size 5x1284 text run at (0, 3) width 5: "x"85 RenderText {#text} at (0,0) size 0x0 86 RenderBlock {p} at (0,1 44) size 784x3287 RenderText {#text} at (0, 8) size 88x1888 text run at (0, 8) width 88: "long w/ both: "89 RenderMathMLMath {math} at (88,0) size 44x 3290 RenderMathMLSubSup {msubsup} at (1,0) size 42x 3291 RenderMathMLBlock {msubsup} at (0, 3) size 9x2483 RenderText {#text} at (0,0) size 5x12 84 text run at (0,0) width 5: "x" 85 RenderText {#text} at (0,0) size 0x0 86 RenderBlock {p} at (0,120) size 784x24 87 RenderText {#text} at (0,1) size 88x18 88 text run at (0,1) width 88: "long w/ both: " 89 RenderMathMLMath {math} at (88,0) size 44x24 90 RenderMathMLSubSup {msubsup} at (1,0) size 42x24 91 RenderMathMLBlock {msubsup} at (0,0) size 9x20 92 92 RenderInline {mi} at (0,0) size 9x16 93 RenderText {#text} at (0, 8) size 9x1694 text run at (0, 8) width 9: "Z"95 RenderMathMLBlock {msubsup} at (10,0) size 32x 3296 RenderMathMLBlock {msubsup} at (0,0) size 32x1 697 RenderMathMLRow {mrow} at (0, 3) size 16x1293 RenderText {#text} at (0,4) size 9x16 94 text run at (0,4) width 9: "Z" 95 RenderMathMLBlock {msubsup} at (10,0) size 32x24 96 RenderMathMLBlock {msubsup} at (0,0) size 32x12 97 RenderMathMLRow {mrow} at (0,0) size 16x12 98 98 RenderInline {mi} at (0,0) size 5x12 99 99 RenderText {#text} at (0,0) size 5x12 … … 106 106 RenderText {#text} at (13,0) size 3x12 107 107 text run at (13,0) width 3: "j" 108 RenderMathMLBlock {msubsup} at (0,1 6) size 32x16109 RenderMathMLRow {mrow} at (1, 3) size 31x12108 RenderMathMLBlock {msubsup} at (0,12) size 32x12 109 RenderMathMLRow {mrow} at (1,0) size 31x12 110 110 RenderInline {mi} at (0,0) size 5x12 111 111 RenderText {#text} at (0,0) size 5x12 … … 126 126 text run at (26,0) width 5: "z" 127 127 RenderText {#text} at (0,0) size 0x0 128 RenderBlock {p} at (0,1 92) size 784x32129 RenderText {#text} at (0, 8) size 123x18130 text run at (0, 8) width 123: "Wrapped in mrow: "131 RenderMathMLMath {math} at (123,0) size 16x 32132 RenderMathMLRow {mrow} at (1,0) size 14x 32133 RenderMathMLSubSup {msubsup} at (0,0) size 14x 32134 RenderMathMLBlock {msubsup} at (0, 3) size 7x24128 RenderBlock {p} at (0,160) size 784x24 129 RenderText {#text} at (0,1) size 123x18 130 text run at (0,1) width 123: "Wrapped in mrow: " 131 RenderMathMLMath {math} at (123,0) size 16x24 132 RenderMathMLRow {mrow} at (1,0) size 14x24 133 RenderMathMLSubSup {msubsup} at (0,0) size 14x24 134 RenderMathMLBlock {msubsup} at (0,0) size 7x20 135 135 RenderInline {mi} at (0,0) size 7x16 136 RenderText {#text} at (0, 8) size 7x16137 text run at (0, 8) width 7: "x"138 RenderMathMLBlock {msubsup} at (8,0) size 6x 32139 RenderMathMLBlock {msubsup} at (0,0) size 6x1 6140 RenderInline {mi} at (0,0) size 5x12 141 RenderText {#text} at (0, 3) size 5x12142 text run at (0, 3) width 5: "k"143 RenderMathMLBlock {msubsup} at (0,1 6) size 6x16136 RenderText {#text} at (0,4) size 7x16 137 text run at (0,4) width 7: "x" 138 RenderMathMLBlock {msubsup} at (8,0) size 6x24 139 RenderMathMLBlock {msubsup} at (0,0) size 6x12 140 RenderInline {mi} at (0,0) size 5x12 141 RenderText {#text} at (0,0) size 5x12 142 text run at (0,0) width 5: "k" 143 RenderMathMLBlock {msubsup} at (0,12) size 6x12 144 144 RenderInline {mn} at (0,0) size 6x12 145 RenderText {#text} at (0,3) size 6x12 146 text run at (0,3) width 6: "1" 147 RenderText {#text} at (0,0) size 0x0 145 RenderText {#text} at (0,0) size 6x12 146 text run at (0,0) width 6: "1" 147 RenderText {#text} at (0,0) size 0x0 148 RenderBlock {p} at (0,200) size 784x52 149 RenderText {#text} at (0,15) size 169x18 150 text run at (0,15) width 169: "parts with various heights: " 151 RenderMathMLMath {math} at (169,0) size 91x52 152 RenderMathMLSubSup {msubsup} at (1,0) size 18x38 153 RenderMathMLBlock {msubsup} at (0,0) size 7x34 154 RenderInline {mi} at (0,0) size 7x16 155 RenderText {#text} at (0,18) size 7x16 156 text run at (0,18) width 7: "x" 157 RenderMathMLBlock {msubsup} at (8,0) size 10x38 158 RenderMathMLBlock {msubsup} at (0,0) size 10x26 159 RenderMathMLFraction {mfrac} at (0,0) size 10x26 160 RenderMathMLBlock {mfrac} at (0,0) size 10x12 161 RenderInline {mi} at (0,0) size 4x12 162 RenderText {#text} at (3,0) size 4x12 163 text run at (3,0) width 4: "f" 164 RenderMathMLBlock {mfrac} at (0,12) size 10x14 165 RenderInline {mi} at (0,0) size 6x12 166 RenderText {#text} at (2,2) size 6x12 167 text run at (2,2) width 6: "g" 168 RenderMathMLBlock {msubsup} at (0,26) size 10x12 169 RenderInline {mi} at (0,0) size 6x12 170 RenderText {#text} at (0,0) size 6x12 171 text run at (0,0) width 6: "n" 172 RenderMathMLOperator {mo} at (19,18) size 10x16 173 RenderMathMLBlock {mo} at (0,0) size 9x16 174 RenderText {mo} at (0,0) size 9x16 175 text run at (0,0) width 9: "+" 176 RenderMathMLSubSup {msubsup} at (29,14) size 18x38 177 RenderMathMLBlock {msubsup} at (0,0) size 7x20 178 RenderInline {mi} at (0,0) size 7x16 179 RenderText {#text} at (0,4) size 7x16 180 text run at (0,4) width 7: "x" 181 RenderMathMLBlock {msubsup} at (8,0) size 10x38 182 RenderMathMLBlock {msubsup} at (0,0) size 10x12 183 RenderInline {mi} at (0,0) size 6x12 184 RenderText {#text} at (0,0) size 6x12 185 text run at (0,0) width 6: "n" 186 RenderMathMLBlock {msubsup} at (0,12) size 10x26 187 RenderMathMLFraction {mfrac} at (0,0) size 10x26 188 RenderMathMLBlock {mfrac} at (0,0) size 10x12 189 RenderInline {mi} at (0,0) size 4x12 190 RenderText {#text} at (3,0) size 4x12 191 text run at (3,0) width 4: "f" 192 RenderMathMLBlock {mfrac} at (0,12) size 10x14 193 RenderInline {mi} at (0,0) size 6x12 194 RenderText {#text} at (2,2) size 6x12 195 text run at (2,2) width 6: "g" 196 RenderMathMLOperator {mo} at (47,18) size 10x16 197 RenderMathMLBlock {mo} at (0,0) size 9x16 198 RenderText {mo} at (0,0) size 9x16 199 text run at (0,0) width 9: "+" 200 RenderMathMLSubSup {msubsup} at (57,6) size 33x41 201 RenderMathMLBlock {msubsup} at (0,0) size 26x41 202 RenderMathMLFenced {mfenced} at (0,0) size 26x41 203 RenderMathMLOperator {mfenced} at (0,0) size 6x41 204 RenderMathMLFraction {mfrac} at (6,2) size 14x34 205 RenderMathMLBlock {mfrac} at (0,0) size 14x16 206 RenderInline {mi} at (0,0) size 4x16 207 RenderText {#text} at (5,0) size 4x16 208 text run at (5,0) width 4: "f" 209 RenderMathMLBlock {mfrac} at (0,16) size 14x18 210 RenderInline {mi} at (0,0) size 8x16 211 RenderText {#text} at (3,2) size 8x16 212 text run at (3,2) width 8: "g" 213 RenderMathMLOperator {mfenced} at (20,0) size 6x41 214 RenderMathMLBlock {msubsup} at (27,0) size 6x41 215 RenderMathMLBlock {msubsup} at (0,0) size 6x29 216 RenderInline {mi} at (0,0) size 5x12 217 RenderText {#text} at (0,0) size 5x12 218 text run at (0,0) width 5: "x" 219 RenderMathMLBlock {msubsup} at (0,29) size 6x12 220 RenderInline {mi} at (0,0) size 6x12 221 RenderText {#text} at (0,0) size 6x12 222 text run at (0,0) width 6: "n" 223 RenderText {#text} at (0,0) size 0x0 224 layer at (234,222) size 5x10 scrollHeight 15 225 RenderMathMLBlock {mfenced} at (0,0) size 5x10 226 layer at (234,232) size 5x10 scrollHeight 14 227 RenderMathMLBlock {mfenced} at (0,10) size 5x10 228 RenderText {mfenced} at (0,-3) size 5x17 229 text run at (0,-3) width 5: "\x{239C}" 230 layer at (234,242) size 5x10 scrollHeight 14 231 RenderMathMLBlock {mfenced} at (0,20) size 5x10 232 RenderText {mfenced} at (0,-3) size 5x17 233 text run at (0,-3) width 5: "\x{239C}" 234 layer at (234,252) size 5x11 scrollHeight 14 235 RenderMathMLBlock {mfenced} at (0,30) size 5x11 236 layer at (254,222) size 5x10 scrollHeight 15 237 RenderMathMLBlock {mfenced} at (0,0) size 5x10 238 layer at (254,232) size 5x10 scrollHeight 14 239 RenderMathMLBlock {mfenced} at (0,10) size 5x10 240 RenderText {mfenced} at (0,-3) size 5x17 241 text run at (0,-3) width 5: "\x{239F}" 242 layer at (254,242) size 5x10 scrollHeight 14 243 RenderMathMLBlock {mfenced} at (0,20) size 5x10 244 RenderText {mfenced} at (0,-3) size 5x17 245 text run at (0,-3) width 5: "\x{239F}" 246 layer at (254,252) size 5x11 scrollHeight 14 247 RenderMathMLBlock {mfenced} at (0,30) size 5x11 248 layer at (234,223) size 5x11 backgroundClip at (234,222) size 5x10 clip at (234,222) size 5x10 outlineClip at (234,222) size 5x10 249 RenderBlock (relative positioned) {mfenced} at (0,0) size 5x11 250 RenderText {mfenced} at (0,-3) size 5x17 251 text run at (0,-3) width 5: "\x{239B}" 252 layer at (234,249) size 5x11 backgroundClip at (234,252) size 5x11 clip at (234,252) size 5x11 outlineClip at (234,252) size 5x11 253 RenderBlock (relative positioned) {mfenced} at (0,0) size 5x11 254 RenderText {mfenced} at (0,-3) size 5x17 255 text run at (0,-3) width 5: "\x{239D}" 256 layer at (254,223) size 5x11 backgroundClip at (254,222) size 5x10 clip at (254,222) size 5x10 outlineClip at (254,222) size 5x10 257 RenderBlock (relative positioned) {mfenced} at (0,0) size 5x11 258 RenderText {mfenced} at (0,-3) size 5x17 259 text run at (0,-3) width 5: "\x{239E}" 260 layer at (254,249) size 5x11 backgroundClip at (254,252) size 5x11 clip at (254,252) size 5x11 outlineClip at (254,252) size 5x11 261 RenderBlock (relative positioned) {mfenced} at (0,0) size 5x11 262 RenderText {mfenced} at (0,-3) size 5x17 263 text run at (0,-3) width 5: "\x{23A0}" -
trunk/Source/WebCore/ChangeLog
r109080 r109081 1 2012-02-27 David Barton <dbarton@mathscribe.com> 2 3 Fix <msubsup> formatting, especially for a tall base, subscript, or superscript 4 https://bugs.webkit.org/show_bug.cgi?id=79274 5 6 Reviewed by Julien Chaffraix. 7 8 Move the <msubsup> formatting code in stretchToHeight() to layout(). Then revise the 9 combined code to produce more vertically accurate results, and without extra white 10 space. Finally, don't multiply msub/msup/msubsup operator stretching by 1.2. 11 12 Test: Added the bug report's attached test case to mathml/presentation/subsup.xhtml, and 13 it and 5 other test files in mathml/presentation now produce improved results. The 14 integral sign in mo-stretch.html is no longer scaled up by an extra 1.2, and baselines 15 are more accurate so the base is higher in msubsup-sub-changed.png. Several examples are 16 slightly tighter vertically, because their (somewhat) anonymous blocks wrapping 17 subscripts and superscripts now have the correct font size. 18 19 * rendering/mathml/RenderMathMLSubSup.cpp: 20 (WebCore): 21 (WebCore::RenderMathMLSubSup::addChild): 22 (WebCore::RenderMathMLSubSup::stretchToHeight): 23 (WebCore::RenderMathMLSubSup::layout): 24 * rendering/mathml/RenderMathMLSubSup.h: 25 (RenderMathMLSubSup): 26 * rendering/style/RenderStyle.h: 27 1 28 2012-02-27 Ned Holbrook <nholbrook@apple.com> 2 29 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp
r108302 r109081 36 36 using namespace MathMLNames; 37 37 38 static const int gTopAdjustDivisor = 3;39 38 static const int gSubsupScriptMargin = 1; 40 static const float gSubSupStretch = 1.2f;41 39 42 40 RenderMathMLSubSup::RenderMathMLSubSup(Element* element) … … 91 89 scriptsStyle->setMarginLeft(Length(gSubsupScriptMargin, Fixed)); 92 90 scriptsStyle->setTextAlign(LEFT); 91 // Set this wrapper's font-size for its line-height & baseline position. 92 scriptsStyle->setBlendedFontSize(static_cast<int>(0.75 * style()->fontSize())); 93 93 m_scripts->setStyle(scriptsStyle.release()); 94 94 RenderMathMLBlock::addChild(m_scripts, beforeChild); … … 127 127 { 128 128 RenderBoxModelObject* base = this->base(); 129 if (base && base->isRenderMathMLBlock()) { 130 toRenderMathMLBlock(base)->stretchToHeight(static_cast<int>(gSubSupStretch * height)); 131 132 // Adjust the script placement after we stretch 133 if (height > 0 && m_kind == SubSup && m_scripts) { 134 RenderObject* supWrapper = m_scripts->firstChild(); 135 if (supWrapper) { 136 // Calculate the script height without the container margins. 137 int supHeight = getBoxModelObjectHeight(supWrapper->firstChild()); 138 int supTopAdjust = supHeight / gTopAdjustDivisor; 139 supWrapper->style()->setMarginTop(Length(-supTopAdjust, Fixed)); 140 supWrapper->style()->setMarginBottom(Length(height - supHeight + supTopAdjust, Fixed)); 141 supWrapper->setNeedsLayout(true); 142 } 143 } 144 } 129 if (base && base->isRenderMathMLBlock()) 130 toRenderMathMLBlock(base)->stretchToHeight(height); 145 131 } 146 132 … … 149 135 RenderBlock::layout(); 150 136 151 if (m_kind == SubSup && m_scripts) { 152 if (RenderBoxModelObject* base = this->base()) { 153 LayoutUnit heightDiff = (m_scripts->offsetHeight() - base->offsetHeight()) / 2; 154 if (heightDiff < 0) 155 heightDiff = 0; 156 RenderObject* baseWrapper = firstChild(); 157 baseWrapper->style()->setPaddingTop(Length(heightDiff, Fixed)); 158 baseWrapper->setNeedsLayout(true); 159 RenderBlock::layout(); 160 } 161 } 137 if (m_kind != SubSup || !m_scripts) 138 return; 139 RenderBoxModelObject* base = this->base(); 140 RenderObject* superscriptWrapper = m_scripts->firstChild(); 141 RenderObject* subscriptWrapper = m_scripts->lastChild(); 142 if (!base || !superscriptWrapper || !subscriptWrapper || superscriptWrapper == subscriptWrapper) 143 return; 144 ASSERT(superscriptWrapper->isRenderMathMLBlock()); 145 ASSERT(subscriptWrapper->isRenderMathMLBlock()); 146 RenderObject* superscript = superscriptWrapper->firstChild(); 147 RenderObject* subscript = subscriptWrapper->firstChild(); 148 if (!superscript || !subscript) 149 return; 150 151 LineDirectionMode lineDirection = style()->isHorizontalWritingMode() ? HorizontalLine : VerticalLine; 152 LayoutUnit baseBaseline = base->baselinePosition(AlphabeticBaseline, true, lineDirection); 153 LayoutUnit baseExtendUnderBaseline = getBoxModelObjectHeight(base) - baseBaseline; 154 LayoutUnit axis = style()->fontMetrics().xHeight() / 2; 155 LayoutUnit superscriptHeight = getBoxModelObjectHeight(superscript); 156 LayoutUnit subscriptHeight = getBoxModelObjectHeight(subscript); 157 158 // Our layout rules are: Don't let the superscript go below the "axis" (half x-height above the 159 // baseline), or the subscript above the axis. Also, don't let the superscript's top edge be 160 // below the base's top edge, or the subscript's bottom edge above the base's bottom edge. 161 // 162 // FIXME: Check any subscriptshift or superscriptshift attributes, and maybe use more sophisticated 163 // heuristics from TeX or elsewhere. See https://bugs.webkit.org/show_bug.cgi?id=79274#c5. 164 165 // Above we did scriptsStyle->setVerticalAlign(TOP) for mscripts' style, so the superscript's 166 // top edge will equal the top edge of the base's padding. 167 LayoutUnit basePaddingTop = superscriptHeight + axis - baseBaseline; 168 // If basePaddingTop is positive, it's indeed the base's padding-top that we need. If it's negative, 169 // then we should instead use its absolute value to pad the bottom of the superscript, to get the 170 // superscript's bottom edge down to the axis. First we compute how much more we need to shift the 171 // subscript down, once its top edge is at the axis. 172 LayoutUnit superPaddingBottom = max<LayoutUnit>(baseExtendUnderBaseline + axis - subscriptHeight, 0); 173 if (basePaddingTop < 0) { 174 superPaddingBottom += -basePaddingTop; 175 basePaddingTop = 0; 176 } 177 178 setChildNeedsLayout(true, false); 179 180 RenderObject* baseWrapper = firstChild(); 181 baseWrapper->style()->setPaddingTop(Length(basePaddingTop, Fixed)); 182 baseWrapper->setNeedsLayout(true, false); 183 184 superscriptWrapper->style()->setPaddingBottom(Length(superPaddingBottom, Fixed)); 185 superscriptWrapper->setNeedsLayout(true, false); 186 187 RenderBlock::layout(); 162 188 } 163 189 164 LayoutUnit RenderMathMLSubSup::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const165 {166 RenderObject* base = firstChild();167 if (!base)168 return offsetHeight();169 170 LayoutUnit baseline = offsetHeight();171 if (!base || !base->isBoxModelObject())172 return baseline;173 174 switch (m_kind) {175 case SubSup:176 base = base->firstChild();177 if (m_scripts && base && base->isBoxModelObject()) {178 RenderBoxModelObject* box = toRenderBoxModelObject(base);179 180 int topAdjust = (m_scripts->offsetHeight() - box->offsetHeight()) / 2;181 182 // FIXME: The last bit of this calculation should be more exact. Why is the 2-3px scaled for zoom necessary?183 // The baseline is top spacing of the base + the baseline of the base + adjusted space for zoom184 float zoomFactor = style()->effectiveZoom();185 return topAdjust + box->baselinePosition(AlphabeticBaseline, firstLine, direction, linePositionMode) + static_cast<int>((zoomFactor > 1.25 ? 2 : 3) * zoomFactor);186 }187 break;188 case Sup:189 case Sub:190 return RenderMathMLBlock::baselinePosition(AlphabeticBaseline, firstLine, direction, linePositionMode);191 }192 193 return baseline;194 195 }196 197 190 } 198 191 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLSubSup.h
r108249 r109081 40 40 virtual RenderMathMLOperator* unembellishedOperator(); 41 41 virtual void stretchToHeight(int pixelHeight); 42 virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;43 42 44 43 protected: -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r109014 r109081 1105 1105 } 1106 1106 1107 // Only used for blending font sizes when animating .1107 // Only used for blending font sizes when animating, or MathML anonymous blocks. 1108 1108 void setBlendedFontSize(int); 1109 1109
Note: See TracChangeset
for help on using the changeset viewer.