| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 222 |
| 223 if (maxAscent + maxDescent < max(maxPositionTop, maxPositionBottom)) | 223 if (maxAscent + maxDescent < max(maxPositionTop, maxPositionBottom)) |
| 224 adjustMaxAscentAndDescent(maxAscent, maxDescent, maxPositionTop, maxPosi
tionBottom); | 224 adjustMaxAscentAndDescent(maxAscent, maxDescent, maxPositionTop, maxPosi
tionBottom); |
| 225 | 225 |
| 226 int maxHeight = maxAscent + maxDescent; | 226 int maxHeight = maxAscent + maxDescent; |
| 227 int lineTop = heightOfBlock; | 227 int lineTop = heightOfBlock; |
| 228 int lineBottom = heightOfBlock; | 228 int lineBottom = heightOfBlock; |
| 229 placeBoxesVertically(heightOfBlock, maxHeight, maxAscent, noQuirksMode, line
Top, lineBottom); | 229 placeBoxesVertically(heightOfBlock, maxHeight, maxAscent, noQuirksMode, line
Top, lineBottom); |
| 230 computeVerticalOverflow(lineTop, lineBottom, noQuirksMode, textBoxDataMap); | 230 computeVerticalOverflow(lineTop, lineBottom, noQuirksMode, textBoxDataMap); |
| 231 setLineTopBottomPositions(lineTop, lineBottom); | 231 setLineTopBottomPositions(lineTop, lineBottom); |
| 232 | 232 |
| 233 heightOfBlock += maxHeight; | 233 // Detect integer overflow. |
| 234 if (heightOfBlock > numeric_limits<int>::max() - maxHeight) |
| 235 return numeric_limits<int>::max(); |
| 236 |
| 237 heightOfBlock = heightOfBlock + maxHeight; |
| 234 | 238 |
| 235 return heightOfBlock; | 239 return heightOfBlock; |
| 236 } | 240 } |
| 237 | 241 |
| 238 GapRects RootInlineBox::fillLineSelectionGap(int selTop, int selHeight, RenderBl
ock* rootBlock, int blockX, int blockY, int tx, int ty, | 242 GapRects RootInlineBox::fillLineSelectionGap(int selTop, int selHeight, RenderBl
ock* rootBlock, int blockX, int blockY, int tx, int ty, |
| 239 const PaintInfo* paintInfo) | 243 const PaintInfo* paintInfo) |
| 240 { | 244 { |
| 241 RenderObject::SelectionState lineState = selectionState(); | 245 RenderObject::SelectionState lineState = selectionState(); |
| 242 | 246 |
| 243 bool leftGap, rightGap; | 247 bool leftGap, rightGap; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 { | 430 { |
| 427 block()->lineBoxes()->extractLineBox(this); | 431 block()->lineBoxes()->extractLineBox(this); |
| 428 } | 432 } |
| 429 | 433 |
| 430 void RootInlineBox::attachLineBoxToRenderObject() | 434 void RootInlineBox::attachLineBoxToRenderObject() |
| 431 { | 435 { |
| 432 block()->lineBoxes()->attachLineBox(this); | 436 block()->lineBoxes()->attachLineBox(this); |
| 433 } | 437 } |
| 434 | 438 |
| 435 } // namespace WebCore | 439 } // namespace WebCore |
| OLD | NEW |