| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 bool shouldClearDescendantsHaveSameLineHeightAndBaseline = false; | 124 bool shouldClearDescendantsHaveSameLineHeightAndBaseline = false; |
| 125 if (child->layoutObject().isReplaced()) { | 125 if (child->layoutObject().isReplaced()) { |
| 126 shouldClearDescendantsHaveSameLineHeightAndBaseline = true; | 126 shouldClearDescendantsHaveSameLineHeightAndBaseline = true; |
| 127 } else if (child->isText()) { | 127 } else if (child->isText()) { |
| 128 if (child->layoutObject().isBR() || child->layoutObject().parent() !
= layoutObject()) { | 128 if (child->layoutObject().isBR() || child->layoutObject().parent() !
= layoutObject()) { |
| 129 if (!parentStyle.font().fontMetrics().hasIdenticalAscentDescentA
ndLineGap(childStyle.font().fontMetrics()) | 129 if (!parentStyle.font().fontMetrics().hasIdenticalAscentDescentA
ndLineGap(childStyle.font().fontMetrics()) |
| 130 || parentStyle.lineHeight() != childStyle.lineHeight() | 130 || parentStyle.lineHeight() != childStyle.lineHeight() |
| 131 || (parentStyle.verticalAlign() != BASELINE && !isRootInline
Box()) || childStyle.verticalAlign() != BASELINE) | 131 || (parentStyle.verticalAlign() != BASELINE && !isRootInline
Box()) || childStyle.verticalAlign() != BASELINE) |
| 132 shouldClearDescendantsHaveSameLineHeightAndBaseline = true; | 132 shouldClearDescendantsHaveSameLineHeightAndBaseline = true; |
| 133 } | 133 } |
| 134 if (childStyle.hasTextCombine() || childStyle.textEmphasisMark() !=
TextEmphasisMarkNone) | 134 if (child->layoutObject().isCombineText() || childStyle.textEmphasis
Mark() != TextEmphasisMarkNone) |
| 135 shouldClearDescendantsHaveSameLineHeightAndBaseline = true; | 135 shouldClearDescendantsHaveSameLineHeightAndBaseline = true; |
| 136 } else { | 136 } else { |
| 137 if (child->layoutObject().isBR()) { | 137 if (child->layoutObject().isBR()) { |
| 138 // FIXME: This is dumb. We only turn off because current layout
test results expect the <br> to be 0-height on the baseline. | 138 // FIXME: This is dumb. We only turn off because current layout
test results expect the <br> to be 0-height on the baseline. |
| 139 // Other than making a zillion tests have to regenerate results,
there's no reason to ditch the optimization here. | 139 // Other than making a zillion tests have to regenerate results,
there's no reason to ditch the optimization here. |
| 140 shouldClearDescendantsHaveSameLineHeightAndBaseline = true; | 140 shouldClearDescendantsHaveSameLineHeightAndBaseline = true; |
| 141 } else { | 141 } else { |
| 142 ASSERT(isInlineFlowBox()); | 142 ASSERT(isInlineFlowBox()); |
| 143 InlineFlowBox* childFlowBox = toInlineFlowBox(child); | 143 InlineFlowBox* childFlowBox = toInlineFlowBox(child); |
| 144 // Check the child's bit, and then also check for differences in
font, line-height, vertical-align | 144 // Check the child's bit, and then also check for differences in
font, line-height, vertical-align |
| 145 if (!childFlowBox->descendantsHaveSameLineHeightAndBaseline() | 145 if (!childFlowBox->descendantsHaveSameLineHeightAndBaseline() |
| 146 || !parentStyle.font().fontMetrics().hasIdenticalAscentDesce
ntAndLineGap(childStyle.font().fontMetrics()) | 146 || !parentStyle.font().fontMetrics().hasIdenticalAscentDesce
ntAndLineGap(childStyle.font().fontMetrics()) |
| 147 || parentStyle.lineHeight() != childStyle.lineHeight() | 147 || parentStyle.lineHeight() != childStyle.lineHeight() |
| 148 || (parentStyle.verticalAlign() != BASELINE && !isRootInline
Box()) || childStyle.verticalAlign() != BASELINE | 148 || (parentStyle.verticalAlign() != BASELINE && !isRootInline
Box()) || childStyle.verticalAlign() != BASELINE |
| 149 || childStyle.hasBorder() || childStyle.hasPadding() || chil
dStyle.hasTextCombine()) | 149 || childStyle.hasBorder() || childStyle.hasPadding() || chil
d->layoutObject().isCombineText()) |
| 150 shouldClearDescendantsHaveSameLineHeightAndBaseline = true; | 150 shouldClearDescendantsHaveSameLineHeightAndBaseline = true; |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 if (shouldClearDescendantsHaveSameLineHeightAndBaseline) | 154 if (shouldClearDescendantsHaveSameLineHeightAndBaseline) |
| 155 clearDescendantsHaveSameLineHeightAndBaseline(); | 155 clearDescendantsHaveSameLineHeightAndBaseline(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 if (!child->layoutObject().isOutOfFlowPositioned()) { | 158 if (!child->layoutObject().isOutOfFlowPositioned()) { |
| 159 if (child->isText()) { | 159 if (child->isText()) { |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 ASSERT(child->prevOnLine() == prev); | 1310 ASSERT(child->prevOnLine() == prev); |
| 1311 prev = child; | 1311 prev = child; |
| 1312 } | 1312 } |
| 1313 ASSERT(prev == m_lastChild); | 1313 ASSERT(prev == m_lastChild); |
| 1314 #endif | 1314 #endif |
| 1315 } | 1315 } |
| 1316 | 1316 |
| 1317 #endif | 1317 #endif |
| 1318 | 1318 |
| 1319 } // namespace blink | 1319 } // namespace blink |
| OLD | NEW |