OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 // and the root box's baseline. The value is negative if the child box'
s baseline is above the | 532 // and the root box's baseline. The value is negative if the child box'
s baseline is above the |
533 // root box's baseline, and it is positive if the child box's baseline i
s below the root box's baseline. | 533 // root box's baseline, and it is positive if the child box's baseline i
s below the root box's baseline. |
534 curr->setLogicalTop(rootBox->verticalPositionForBox(curr, verticalPositi
onCache)); | 534 curr->setLogicalTop(rootBox->verticalPositionForBox(curr, verticalPositi
onCache)); |
535 | 535 |
536 int ascent = 0; | 536 int ascent = 0; |
537 int descent = 0; | 537 int descent = 0; |
538 rootBox->ascentAndDescentForBox(curr, textBoxDataMap, ascent, descent, a
ffectsAscent, affectsDescent); | 538 rootBox->ascentAndDescentForBox(curr, textBoxDataMap, ascent, descent, a
ffectsAscent, affectsDescent); |
539 | 539 |
540 int boxHeight = ascent + descent; | 540 int boxHeight = ascent + descent; |
541 if (curr->verticalAlign() == TOP) { | 541 if (curr->verticalAlign() == TOP) { |
542 if (maxPositionTop < ascent) | 542 if (maxPositionTop < boxHeight) |
543 maxPositionTop = boxHeight; | 543 maxPositionTop = boxHeight; |
544 } else if (curr->verticalAlign() == BOTTOM) { | 544 } else if (curr->verticalAlign() == BOTTOM) { |
545 if (maxPositionBottom < boxHeight) | 545 if (maxPositionBottom < boxHeight) |
546 maxPositionBottom = boxHeight; | 546 maxPositionBottom = boxHeight; |
547 } else if (!inlineFlowBox || strictMode || inlineFlowBox->hasTextChildre
n() || (inlineFlowBox->descendantsHaveSameLineHeightAndBaseline() && inlineFlowB
ox->hasTextDescendants()) | 547 } else if (!inlineFlowBox || strictMode || inlineFlowBox->hasTextChildre
n() || (inlineFlowBox->descendantsHaveSameLineHeightAndBaseline() && inlineFlowB
ox->hasTextDescendants()) |
548 || inlineFlowBox->boxModelObject()->hasInlineDirectionBorders
OrPadding()) { | 548 || inlineFlowBox->boxModelObject()->hasInlineDirectionBorders
OrPadding()) { |
549 // Note that these values can be negative. Even though we only affe
ct the maxAscent and maxDescent values | 549 // Note that these values can be negative. Even though we only affe
ct the maxAscent and maxDescent values |
550 // if our box (excluding line-height) was above (for ascent) or belo
w (for descent) the root baseline, once you factor in line-height | 550 // if our box (excluding line-height) was above (for ascent) or belo
w (for descent) the root baseline, once you factor in line-height |
551 // the final box can end up being fully above or fully below the roo
t box's baseline! This is ok, but what it | 551 // the final box can end up being fully above or fully below the roo
t box's baseline! This is ok, but what it |
552 // means is that ascent and descent (including leading), can end up
being negative. The setMaxAscent and | 552 // means is that ascent and descent (including leading), can end up
being negative. The setMaxAscent and |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1442 ASSERT(child->prevOnLine() == prev); | 1442 ASSERT(child->prevOnLine() == prev); |
1443 prev = child; | 1443 prev = child; |
1444 } | 1444 } |
1445 ASSERT(prev == m_lastChild); | 1445 ASSERT(prev == m_lastChild); |
1446 #endif | 1446 #endif |
1447 } | 1447 } |
1448 | 1448 |
1449 #endif | 1449 #endif |
1450 | 1450 |
1451 } // namespace WebCore | 1451 } // namespace WebCore |
OLD | NEW |