Changeset 164536 in webkit
- Timestamp:
- Feb 22, 2014 2:08:02 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r164535 r164536 1 2014-02-22 Frédéric Wang <fred.wang@free.fr> 2 3 Bug 119043 - Large stretch size error for MathML operators. 4 https://bugs.webkit.org/show_bug.cgi?id=119043 5 6 Reviewed by Chris Fleizach. 7 8 This adds a test to check that the depth/height of stretchy operators match the maximum of their siblings. This also fixes the reference of mo-stretch.html to ignore the stretch error. 9 10 * mathml/presentation/stretchy-depth-height-expected.txt: Added. 11 * mathml/presentation/stretchy-depth-height.html: Added. 12 * platform/mac/mathml/presentation/mo-stretch-expected.txt: 13 1 14 2014-02-22 Frédéric Wang <fred.wang@free.fr> 2 15 -
trunk/LayoutTests/platform/mac/mathml/presentation/mo-stretch-expected.txt
r164535 r164536 1 1 layer at (0,0) size 800x600 2 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x 2164 RenderBlock {HTML} at (0,0) size 800x 2165 RenderBody {BODY} at (8,8) size 784x 2003 layer at (0,0) size 800x166 4 RenderBlock {HTML} at (0,0) size 800x166 5 RenderBody {BODY} at (8,8) size 784x150 6 6 RenderMathMLMath {math} at (0,0) size 195x20 [padding: 0 1 0 1] 7 7 RenderMathMLRow {mrow} at (1,0) size 193x20 … … 79 79 text run at (194,0) width 5: " " 80 80 RenderBR {BR} at (0,0) size 0x0 81 RenderMathMLMath {math} at (0,20) size 199x 114[padding: 0 1 0 1]82 RenderMathMLRow {mrow} at (1,0) size 197x 11483 RenderMathMLOperator {mo} at (1, 22) size 8x9281 RenderMathMLMath {math} at (0,20) size 199x76 [padding: 0 1 0 1] 82 RenderMathMLRow {mrow} at (1,0) size 197x76 83 RenderMathMLOperator {mo} at (1,0) size 8x76 84 84 RenderMathMLBlock (flex) {mo} at (0,0) size 7x14 85 85 RenderBlock (anonymous) at (0,0) size 5x14 86 86 RenderText at (0,-6) size 5x24 87 87 text run at (0,-6) width 5: "(" 88 RenderMathMLOperator {mo} at (13, 22) size 8x9288 RenderMathMLOperator {mo} at (13,0) size 8x76 89 89 RenderMathMLBlock (flex) {mo} at (0,0) size 7x14 90 90 RenderBlock (anonymous) at (0,0) size 5x14 91 91 RenderText at (0,-6) size 5x24 92 92 text run at (0,-6) width 5: ")" 93 RenderMathMLOperator {mo} at (26, 22) size 11x9293 RenderMathMLOperator {mo} at (26,0) size 11x76 94 94 RenderMathMLBlock (flex) {mo} at (0,0) size 10x14 95 95 RenderBlock (anonymous) at (0,0) size 8x14 96 96 RenderText at (0,-6) size 8x24 97 97 text run at (0,-6) width 8: "{" 98 RenderMathMLOperator {mo} at (43, 22) size 11x9298 RenderMathMLOperator {mo} at (43,0) size 11x76 99 99 RenderMathMLBlock (flex) {mo} at (0,0) size 10x14 100 100 RenderBlock (anonymous) at (0,0) size 8x14 101 101 RenderText at (0,-6) size 8x24 102 102 text run at (0,-6) width 8: "}" 103 RenderMathMLOperator {mo} at (59, 22) size 8x92103 RenderMathMLOperator {mo} at (59,0) size 8x76 104 104 RenderMathMLBlock (flex) {mo} at (0,0) size 7x14 105 105 RenderBlock (anonymous) at (0,0) size 5x14 106 106 RenderText at (0,-6) size 5x24 107 107 text run at (0,-6) width 5: "[" 108 RenderMathMLOperator {mo} at (72, 22) size 8x92108 RenderMathMLOperator {mo} at (72,0) size 8x76 109 109 RenderMathMLBlock (flex) {mo} at (0,0) size 7x14 110 110 RenderBlock (anonymous) at (0,0) size 5x14 111 111 RenderText at (0,-6) size 5x24 112 112 text run at (0,-6) width 5: "]" 113 RenderMathMLOperator {mo} at (86, 22) size 9x92113 RenderMathMLOperator {mo} at (86,0) size 9x76 114 114 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 115 115 RenderBlock (anonymous) at (0,0) size 8x16 116 116 RenderText at (0,-5) size 8x24 117 117 text run at (0,-5) width 8: "\x{2308}" 118 RenderMathMLOperator {mo} at (100, 22) size 9x92118 RenderMathMLOperator {mo} at (100,0) size 9x76 119 119 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 120 120 RenderBlock (anonymous) at (0,0) size 8x16 121 121 RenderText at (0,-5) size 8x24 122 122 text run at (0,-5) width 8: "\x{2309}" 123 RenderMathMLOperator {mo} at (115, 22) size 8x92123 RenderMathMLOperator {mo} at (115,0) size 8x76 124 124 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 125 125 RenderBlock (anonymous) at (0,0) size 8x16 126 126 RenderText at (0,-5) size 8x24 127 127 text run at (0,-5) width 8: "\x{230A}" 128 RenderMathMLOperator {mo} at (129, 22) size 9x92128 RenderMathMLOperator {mo} at (129,0) size 9x76 129 129 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 130 130 RenderBlock (anonymous) at (0,0) size 8x16 131 131 RenderText at (0,-5) size 8x24 132 132 text run at (0,-5) width 8: "\x{230B}" 133 RenderMathMLOperator {mo} at (143, 22) size 12x92133 RenderMathMLOperator {mo} at (143,0) size 12x76 134 134 RenderMathMLBlock (flex) {mo} at (0,0) size 11x20 135 135 RenderBlock (anonymous) at (0,0) size 7x20 136 136 RenderText at (0,-3) size 7x24 137 137 text run at (0,-3) width 7: "\x{222B}" 138 RenderMathMLOperator {mo} at (161, 22) size 4x92138 RenderMathMLOperator {mo} at (161,0) size 4x76 139 139 RenderMathMLBlock (flex) {mo} at (0,0) size 3x12 140 140 RenderBlock (anonymous) at (0,0) size 3x12 141 141 RenderText at (0,-6) size 3x24 142 142 text run at (0,-6) width 3: "|" 143 RenderMathMLOperator {mo} at (170, 22) size 9x92143 RenderMathMLOperator {mo} at (170,0) size 9x76 144 144 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 145 145 RenderBlock (anonymous) at (0,0) size 8x16 146 146 RenderText at (0,-5) size 8x24 147 147 text run at (0,-5) width 8: "\x{2016}" 148 RenderMathMLOperator {mo} at (184, 22) size 9x92148 RenderMathMLOperator {mo} at (184,0) size 9x76 149 149 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 150 150 RenderBlock (anonymous) at (0,0) size 8x16 … … 154 154 RenderText {#text} at (198,81) size 5x18 155 155 text run at (198,81) width 5: " " 156 RenderMathMLMath {math} at (202,45) size 199x 77[padding: 0 1 0 1]157 RenderMathMLRow {mrow} at (1,0) size 197x 77158 RenderMathMLOperator {mo} at (1, 15) size 8x62156 RenderMathMLMath {math} at (202,45) size 199x51 [padding: 0 1 0 1] 157 RenderMathMLRow {mrow} at (1,0) size 197x51 158 RenderMathMLOperator {mo} at (1,0) size 8x51 159 159 RenderMathMLBlock (flex) {mo} at (0,0) size 7x14 160 160 RenderBlock (anonymous) at (0,0) size 5x14 161 161 RenderText at (0,-6) size 5x24 162 162 text run at (0,-6) width 5: "(" 163 RenderMathMLOperator {mo} at (13, 15) size 8x62163 RenderMathMLOperator {mo} at (13,0) size 8x51 164 164 RenderMathMLBlock (flex) {mo} at (0,0) size 7x14 165 165 RenderBlock (anonymous) at (0,0) size 5x14 166 166 RenderText at (0,-6) size 5x24 167 167 text run at (0,-6) width 5: ")" 168 RenderMathMLOperator {mo} at (26, 15) size 11x62168 RenderMathMLOperator {mo} at (26,0) size 11x51 169 169 RenderMathMLBlock (flex) {mo} at (0,0) size 10x14 170 170 RenderBlock (anonymous) at (0,0) size 8x14 171 171 RenderText at (0,-6) size 8x24 172 172 text run at (0,-6) width 8: "{" 173 RenderMathMLOperator {mo} at (43, 15) size 11x62173 RenderMathMLOperator {mo} at (43,0) size 11x51 174 174 RenderMathMLBlock (flex) {mo} at (0,0) size 10x14 175 175 RenderBlock (anonymous) at (0,0) size 8x14 176 176 RenderText at (0,-6) size 8x24 177 177 text run at (0,-6) width 8: "}" 178 RenderMathMLOperator {mo} at (59, 15) size 8x62178 RenderMathMLOperator {mo} at (59,0) size 8x51 179 179 RenderMathMLBlock (flex) {mo} at (0,0) size 7x14 180 180 RenderBlock (anonymous) at (0,0) size 5x14 181 181 RenderText at (0,-6) size 5x24 182 182 text run at (0,-6) width 5: "[" 183 RenderMathMLOperator {mo} at (72, 15) size 8x62183 RenderMathMLOperator {mo} at (72,0) size 8x51 184 184 RenderMathMLBlock (flex) {mo} at (0,0) size 7x14 185 185 RenderBlock (anonymous) at (0,0) size 5x14 186 186 RenderText at (0,-6) size 5x24 187 187 text run at (0,-6) width 5: "]" 188 RenderMathMLOperator {mo} at (86, 15) size 9x62188 RenderMathMLOperator {mo} at (86,0) size 9x51 189 189 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 190 190 RenderBlock (anonymous) at (0,0) size 8x16 191 191 RenderText at (0,-5) size 8x24 192 192 text run at (0,-5) width 8: "\x{2308}" 193 RenderMathMLOperator {mo} at (100, 15) size 9x62193 RenderMathMLOperator {mo} at (100,0) size 9x51 194 194 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 195 195 RenderBlock (anonymous) at (0,0) size 8x16 196 196 RenderText at (0,-5) size 8x24 197 197 text run at (0,-5) width 8: "\x{2309}" 198 RenderMathMLOperator {mo} at (115, 15) size 8x62198 RenderMathMLOperator {mo} at (115,0) size 8x51 199 199 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 200 200 RenderBlock (anonymous) at (0,0) size 8x16 201 201 RenderText at (0,-5) size 8x24 202 202 text run at (0,-5) width 8: "\x{230A}" 203 RenderMathMLOperator {mo} at (129, 15) size 9x62203 RenderMathMLOperator {mo} at (129,0) size 9x51 204 204 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 205 205 RenderBlock (anonymous) at (0,0) size 8x16 206 206 RenderText at (0,-5) size 8x24 207 207 text run at (0,-5) width 8: "\x{230B}" 208 RenderMathMLOperator {mo} at (143, 15) size 12x62208 RenderMathMLOperator {mo} at (143,0) size 12x51 209 209 RenderMathMLBlock (flex) {mo} at (0,0) size 11x20 210 210 RenderBlock (anonymous) at (0,0) size 7x20 211 211 RenderText at (0,-3) size 7x24 212 212 text run at (0,-3) width 7: "\x{222B}" 213 RenderMathMLOperator {mo} at (161, 15) size 4x62213 RenderMathMLOperator {mo} at (161,0) size 4x51 214 214 RenderMathMLBlock (flex) {mo} at (0,0) size 3x12 215 215 RenderBlock (anonymous) at (0,0) size 3x12 216 216 RenderText at (0,-6) size 3x24 217 217 text run at (0,-6) width 3: "|" 218 RenderMathMLOperator {mo} at (170, 15) size 9x62218 RenderMathMLOperator {mo} at (170,0) size 9x51 219 219 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 220 220 RenderBlock (anonymous) at (0,0) size 8x16 221 221 RenderText at (0,-5) size 8x24 222 222 text run at (0,-5) width 8: "\x{2016}" 223 RenderMathMLOperator {mo} at (184, 15) size 9x62223 RenderMathMLOperator {mo} at (184,0) size 9x51 224 224 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 225 225 RenderBlock (anonymous) at (0,0) size 8x16 … … 229 229 RenderText {#text} at (400,81) size 5x18 230 230 text run at (400,81) width 5: " " 231 RenderMathMLMath {math} at (404,75) size 199x 32[padding: 0 1 0 1]232 RenderMathMLRow {mrow} at (1,0) size 197x 32231 RenderMathMLMath {math} at (404,75) size 199x26 [padding: 0 1 0 1] 232 RenderMathMLRow {mrow} at (1,0) size 197x26 233 233 RenderMathMLOperator {mo} at (1,9) size 8x14 234 234 RenderMathMLBlock (flex) {mo} at (0,0) size 7x14 … … 286 286 RenderText at (0,-3) size 7x24 287 287 text run at (0,-3) width 7: "\x{222B}" 288 RenderMathMLOperator {mo} at (161, 6) size 4x26288 RenderMathMLOperator {mo} at (161,9) size 4x12 289 289 RenderMathMLBlock (flex) {mo} at (0,0) size 3x12 290 290 RenderBlock (anonymous) at (0,0) size 3x12 … … 305 305 text run at (602,81) width 5: " " 306 306 RenderBR {BR} at (0,0) size 0x0 307 RenderMathMLMath {math} at (0,1 33) size 211x68[padding: 0 1 0 1]308 RenderMathMLSquareRoot {msqrt} at (1,0) size 209x 68[intrinsic padding: 3 0 3 12]309 RenderMathMLRow (anonymous) at (12,3) size 197x 62310 RenderMathMLOperator {mo} at (1, 12) size 8x50307 RenderMathMLMath {math} at (0,101) size 211x49 [padding: 0 1 0 1] 308 RenderMathMLSquareRoot {msqrt} at (1,0) size 209x49 [intrinsic padding: 3 0 3 12] 309 RenderMathMLRow (anonymous) at (12,3) size 197x43 310 RenderMathMLOperator {mo} at (1,0) size 8x41 311 311 RenderMathMLBlock (flex) {mo} at (0,0) size 7x14 312 312 RenderBlock (anonymous) at (0,0) size 5x14 313 313 RenderText at (0,-6) size 5x24 314 314 text run at (0,-6) width 5: "(" 315 RenderMathMLOperator {mo} at (13, 12) size 8x50315 RenderMathMLOperator {mo} at (13,0) size 8x41 316 316 RenderMathMLBlock (flex) {mo} at (0,0) size 7x14 317 317 RenderBlock (anonymous) at (0,0) size 5x14 318 318 RenderText at (0,-6) size 5x24 319 319 text run at (0,-6) width 5: ")" 320 RenderMathMLOperator {mo} at (26, 12) size 11x50320 RenderMathMLOperator {mo} at (26,29) size 11x14 321 321 RenderMathMLBlock (flex) {mo} at (0,0) size 10x14 322 322 RenderBlock (anonymous) at (0,0) size 8x14 323 323 RenderText at (0,-6) size 8x24 324 324 text run at (0,-6) width 8: "{" 325 RenderMathMLOperator {mo} at (43, 12) size 11x50325 RenderMathMLOperator {mo} at (43,29) size 11x14 326 326 RenderMathMLBlock (flex) {mo} at (0,0) size 10x14 327 327 RenderBlock (anonymous) at (0,0) size 8x14 328 328 RenderText at (0,-6) size 8x24 329 329 text run at (0,-6) width 8: "}" 330 RenderMathMLOperator {mo} at (59, 12) size 8x50330 RenderMathMLOperator {mo} at (59,0) size 8x41 331 331 RenderMathMLBlock (flex) {mo} at (0,0) size 7x14 332 332 RenderBlock (anonymous) at (0,0) size 5x14 333 333 RenderText at (0,-6) size 5x24 334 334 text run at (0,-6) width 5: "[" 335 RenderMathMLOperator {mo} at (72, 12) size 8x50335 RenderMathMLOperator {mo} at (72,0) size 8x41 336 336 RenderMathMLBlock (flex) {mo} at (0,0) size 7x14 337 337 RenderBlock (anonymous) at (0,0) size 5x14 338 338 RenderText at (0,-6) size 5x24 339 339 text run at (0,-6) width 5: "]" 340 RenderMathMLOperator {mo} at (86, 12) size 9x50340 RenderMathMLOperator {mo} at (86,0) size 9x41 341 341 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 342 342 RenderBlock (anonymous) at (0,0) size 8x16 343 343 RenderText at (0,-5) size 8x24 344 344 text run at (0,-5) width 8: "\x{2308}" 345 RenderMathMLOperator {mo} at (100, 12) size 9x50345 RenderMathMLOperator {mo} at (100,0) size 9x41 346 346 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 347 347 RenderBlock (anonymous) at (0,0) size 8x16 348 348 RenderText at (0,-5) size 8x24 349 349 text run at (0,-5) width 8: "\x{2309}" 350 RenderMathMLOperator {mo} at (115, 12) size 8x50350 RenderMathMLOperator {mo} at (115,0) size 8x41 351 351 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 352 352 RenderBlock (anonymous) at (0,0) size 8x16 353 353 RenderText at (0,-5) size 8x24 354 354 text run at (0,-5) width 8: "\x{230A}" 355 RenderMathMLOperator {mo} at (129, 12) size 9x50355 RenderMathMLOperator {mo} at (129,0) size 9x41 356 356 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 357 357 RenderBlock (anonymous) at (0,0) size 8x16 358 358 RenderText at (0,-5) size 8x24 359 359 text run at (0,-5) width 8: "\x{230B}" 360 RenderMathMLOperator {mo} at (143, 12) size 12x50360 RenderMathMLOperator {mo} at (143,0) size 12x41 361 361 RenderMathMLBlock (flex) {mo} at (0,0) size 11x20 362 362 RenderBlock (anonymous) at (0,0) size 7x20 363 363 RenderText at (0,-3) size 7x24 364 364 text run at (0,-3) width 7: "\x{222B}" 365 RenderMathMLOperator {mo} at (161, 12) size 4x50365 RenderMathMLOperator {mo} at (161,0) size 4x41 366 366 RenderMathMLBlock (flex) {mo} at (0,0) size 3x12 367 367 RenderBlock (anonymous) at (0,0) size 3x12 368 368 RenderText at (0,-6) size 3x24 369 369 text run at (0,-6) width 3: "|" 370 RenderMathMLOperator {mo} at (170, 12) size 9x50370 RenderMathMLOperator {mo} at (170,0) size 9x41 371 371 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 372 372 RenderBlock (anonymous) at (0,0) size 8x16 373 373 RenderText at (0,-5) size 8x24 374 374 text run at (0,-5) width 8: "\x{2016}" 375 RenderMathMLOperator {mo} at (184, 12) size 9x50375 RenderMathMLOperator {mo} at (184,0) size 9x41 376 376 RenderMathMLBlock (flex) {mo} at (0,0) size 8x16 377 377 RenderBlock (anonymous) at (0,0) size 8x16 -
trunk/Source/WebCore/ChangeLog
r164535 r164536 1 2014-02-22 Frédéric Wang <fred.wang@free.fr> 2 3 Bug 119043 - Large stretch size error for MathML operators. 4 https://bugs.webkit.org/show_bug.cgi?id=119043 5 6 Reviewed by Chris Fleizach. 7 8 The MathML code used some arbitrary gOperatorExpansion factor for the 9 stretch size and 2/3 1/2 constants for the baseline. This change tries 10 to consider height/depth of siblings of the stretchy operator so that 11 the stretchy operator now matches its target. 12 13 Test: mathml/presentation/stretchy-depth-height.html 14 15 * rendering/RenderObject.h: 16 (WebCore::RenderObject::isRenderMathMLTable): 17 * rendering/mathml/RenderMathMLBlock.h: 18 * rendering/mathml/RenderMathMLOperator.cpp: 19 (WebCore::RenderMathMLOperator::RenderMathMLOperator): 20 (WebCore::RenderMathMLOperator::stretchTo): 21 (WebCore::RenderMathMLOperator::findAcceptableStretchyCharacter): 22 (WebCore::RenderMathMLOperator::updateStyle): 23 (WebCore::RenderMathMLOperator::firstLineBaseline): 24 (WebCore::RenderMathMLOperator::computeLogicalHeight): 25 * rendering/mathml/RenderMathMLOperator.h: 26 * rendering/mathml/RenderMathMLRow.cpp: 27 (WebCore::RenderMathMLRow::layout): 28 1 29 2014-02-22 Frédéric Wang <fred.wang@free.fr> 2 30 -
trunk/Source/WebCore/rendering/RenderObject.h
r164535 r164536 404 404 #if ENABLE(MATHML) 405 405 virtual bool isRenderMathMLBlock() const { return false; } 406 virtual bool isRenderMathMLTable() const { return false; } 406 407 virtual bool isRenderMathMLOperator() const { return false; } 407 408 virtual bool isRenderMathMLRow() const { return false; } -
trunk/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
r164535 r164536 87 87 88 88 private: 89 virtual bool isRenderMathMLTable() const override final { return true; } 89 90 virtual const char* renderName() const override { return "RenderMathMLTable"; } 90 91 }; 92 93 RENDER_OBJECT_TYPE_CASTS(RenderMathMLTable, isRenderMathMLTable()) 91 94 92 95 // Parsing functions for MathML Length values -
trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
r164535 r164536 1121 1121 RenderMathMLOperator::RenderMathMLOperator(MathMLElement& element, PassRef<RenderStyle> style) 1122 1122 : RenderMathMLBlock(element, std::move(style)) 1123 , m_stretchHeight(0) 1123 , m_stretchHeightAboveBaseline(0) 1124 , m_stretchDepthBelowBaseline(0) 1124 1125 , m_operator(0) 1125 1126 , m_stretchyCharacter(nullptr) … … 1131 1132 RenderMathMLOperator::RenderMathMLOperator(MathMLElement& element, PassRef<RenderStyle> style, UChar operatorChar, MathMLOperatorDictionary::Form form, MathMLOperatorDictionary::Flag flag) 1132 1133 : RenderMathMLBlock(element, std::move(style)) 1133 , m_stretchHeight(0) 1134 , m_stretchHeightAboveBaseline(0) 1135 , m_stretchDepthBelowBaseline(0) 1134 1136 , m_operator(operatorChar == hyphenMinus ? minusSign : operatorChar) 1135 1137 , m_stretchyCharacter(nullptr) … … 1251 1253 } 1252 1254 1253 static const float gOperatorExpansion = 1.2f; 1254 1255 float RenderMathMLOperator::expandedStretchHeight() const 1256 { 1257 return m_stretchHeight * gOperatorExpansion; 1258 } 1259 1260 void RenderMathMLOperator::stretchToHeight(int height) 1261 { 1262 if (m_stretchHeight == height) 1255 void RenderMathMLOperator::stretchTo(int heightAboveBaseline, int depthBelowBaseline) 1256 { 1257 if (heightAboveBaseline <= m_stretchHeightAboveBaseline && depthBelowBaseline <= m_stretchDepthBelowBaseline) 1263 1258 return; 1264 1259 1265 m_stretchHeight = height; 1260 m_stretchHeightAboveBaseline = heightAboveBaseline; 1261 m_stretchDepthBelowBaseline = depthBelowBaseline; 1266 1262 updateStyle(); 1267 1263 } … … 1385 1381 height += glyphHeightForCharacter(stretchyCharacter->middleGlyph); 1386 1382 1387 if (height > expandedStretchHeight())1383 if (height > stretchSize()) 1388 1384 return 0; 1389 1385 … … 1402 1398 1403 1399 float stretchedCharacterHeight = style().fontMetrics().floatHeight(); 1404 m_isStretched = allowStretching && expandedStretchHeight() > stretchedCharacterHeight;1400 m_isStretched = allowStretching && stretchSize() > stretchedCharacterHeight; 1405 1401 1406 1402 // Sometimes we cannot stretch an operator properly, so in that case, we should just use the original size. … … 1413 1409 { 1414 1410 if (m_isStretched) 1415 return expandedStretchHeight() * 2 / 3 - (expandedStretchHeight() - m_stretchHeight) / 2;1411 return m_stretchHeightAboveBaseline; 1416 1412 return RenderMathMLBlock::firstLineBaseline(); 1417 1413 } … … 1420 1416 { 1421 1417 if (m_isStretched) 1422 logicalHeight = expandedStretchHeight();1418 logicalHeight = stretchSize(); 1423 1419 RenderBox::computeLogicalHeight(logicalHeight, logicalTop, computedValues); 1424 1420 } -
trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
r164535 r164536 65 65 MathMLElement& element() { return toMathMLElement(nodeForNonAnonymous()); } 66 66 67 void stretchToHeight(int pixelHeight); 68 int stretchHeight() { return m_stretchHeight; } 69 float expandedStretchHeight() const; 67 void stretchTo(int heightAboveBaseline, int depthBelowBaseline); 68 int stretchSize() const { return m_stretchHeightAboveBaseline + m_stretchDepthBelowBaseline; } 70 69 71 70 bool hasOperatorFlag(MathMLOperatorDictionary::Flag flag) const { return m_operatorFlags & flag; } … … 112 111 void fillWithExtensionGlyph(PaintInfo&, const LayoutPoint& from, const LayoutPoint& to); 113 112 114 int m_stretchHeight; 113 int m_stretchHeightAboveBaseline; 114 int m_stretchDepthBelowBaseline; 115 115 bool m_isStretched; 116 116 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
r164535 r164536 58 58 void RenderMathMLRow::layout() 59 59 { 60 int stretch LogicalHeight= 0;60 int stretchHeightAboveBaseline = 0, stretchDepthBelowBaseline = 0; 61 61 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 62 62 if (child->needsLayout()) … … 65 65 if (child->isRenderMathMLBlock() && toRenderMathMLBlock(child)->unembellishedOperator()) 66 66 continue; 67 if (child->isBox()) 68 stretchLogicalHeight = std::max<int>(stretchLogicalHeight, roundToInt(toRenderBox(child)->logicalHeight())); 67 int childHeightAboveBaseline = 0, childDepthBelowBaseline = 0; 68 if (child->isRenderMathMLBlock()) { 69 RenderMathMLBlock* mathmlChild = toRenderMathMLBlock(child); 70 childHeightAboveBaseline = mathmlChild->firstLineBaseline(); 71 if (childHeightAboveBaseline == -1) 72 childHeightAboveBaseline = mathmlChild->logicalHeight(); 73 childDepthBelowBaseline = mathmlChild->logicalHeight() - childHeightAboveBaseline; 74 } else if (child->isRenderMathMLTable()) { 75 RenderMathMLTable* tableChild = toRenderMathMLTable(child); 76 childHeightAboveBaseline = tableChild->firstLineBaseline(); 77 childDepthBelowBaseline = tableChild->logicalHeight() - childHeightAboveBaseline; 78 } else if (child->isBox()) { 79 childHeightAboveBaseline = toRenderBox(child)->logicalHeight(); 80 childDepthBelowBaseline = 0; 81 } 82 stretchHeightAboveBaseline = std::max<int>(stretchHeightAboveBaseline, roundToInt(childHeightAboveBaseline)); 83 stretchDepthBelowBaseline = std::max<int>(stretchDepthBelowBaseline, roundToInt(childDepthBelowBaseline)); 69 84 } 70 if ( !stretchLogicalHeight)71 stretch LogicalHeight= style().fontSize();85 if (stretchHeightAboveBaseline + stretchDepthBelowBaseline <= 0) 86 stretchHeightAboveBaseline = style().fontSize(); 72 87 73 88 // Set the sizes of (possibly embellished) stretchy operator children. 74 89 for (auto& child : childrenOfType<RenderMathMLBlock>(*this)) { 75 if (auto renderMo = child.unembellishedOperator()) { 76 if (renderMo->stretchHeight() != stretchLogicalHeight) 77 renderMo->stretchToHeight(stretchLogicalHeight); 78 } 90 if (auto renderOperator = child.unembellishedOperator()) 91 renderOperator->stretchTo(stretchHeightAboveBaseline, stretchDepthBelowBaseline); 79 92 } 80 93
Note: See TracChangeset
for help on using the changeset viewer.