OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. |
4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 if (current != root) | 57 if (current != root) |
58 current = 0; | 58 current = 0; |
59 else | 59 else |
60 current = next; | 60 current = next; |
61 break; | 61 break; |
62 } | 62 } |
63 current = current->parent(); | 63 current = current->parent(); |
64 } | 64 } |
65 | 65 |
66 if (!current) | 66 if (!current) |
67 current = root->firstChild(); | 67 current = root->slowFirstChild(); |
68 | 68 |
69 while (current) { | 69 while (current) { |
70 next = 0; | 70 next = 0; |
71 if (isIteratorTarget(current) && !(current->isText() && toRenderText(cur
rent)->isAllCollapsibleWhitespace())) | 71 if (isIteratorTarget(current) && !(current->isText() && toRenderText(cur
rent)->isAllCollapsibleWhitespace())) |
72 break; | 72 break; |
73 | 73 |
74 if (!isIteratorTarget(current) && !isIsolated(current->style()->unicodeB
idi())) | 74 if (!isIteratorTarget(current) && !isIsolated(current->style()->unicodeB
idi())) |
75 next = current->firstChild(); | 75 next = current->slowFirstChild(); |
76 | 76 |
77 if (!next) { | 77 if (!next) { |
78 while (current && current != root) { | 78 while (current && current != root) { |
79 next = current->nextSibling(); | 79 next = current->nextSibling(); |
80 if (next) | 80 if (next) |
81 break; | 81 break; |
82 current = current->parent(); | 82 current = current->parent(); |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 | 592 |
593 void RenderBlockFlow::computeInlineDirectionPositionsForLine(RootInlineBox* line
Box, const LineInfo& lineInfo, BidiRun* firstRun, BidiRun* trailingSpaceRun, boo
l reachedEnd, | 593 void RenderBlockFlow::computeInlineDirectionPositionsForLine(RootInlineBox* line
Box, const LineInfo& lineInfo, BidiRun* firstRun, BidiRun* trailingSpaceRun, boo
l reachedEnd, |
594 GlyphOverflowAndFallbac
kFontsMap& textBoxDataMap, VerticalPositionCache& verticalPositionCache, WordMea
surements& wordMeasurements) | 594 GlyphOverflowAndFallbac
kFontsMap& textBoxDataMap, VerticalPositionCache& verticalPositionCache, WordMea
surements& wordMeasurements) |
595 { | 595 { |
596 ETextAlign textAlign = textAlignmentForLine(!reachedEnd && !lineBox->endsWit
hBreak()); | 596 ETextAlign textAlign = textAlignmentForLine(!reachedEnd && !lineBox->endsWit
hBreak()); |
597 | 597 |
598 // CSS 2.1: "'Text-indent' only affects a line if it is the first formatted
line of an element. For example, the first line of an anonymous block | 598 // CSS 2.1: "'Text-indent' only affects a line if it is the first formatted
line of an element. For example, the first line of an anonymous block |
599 // box is only affected if it is the first child of its parent element." | 599 // box is only affected if it is the first child of its parent element." |
600 // CSS3 "text-indent", "each-line" affects the first line of the block conta
iner as well as each line after a forced line break, | 600 // CSS3 "text-indent", "each-line" affects the first line of the block conta
iner as well as each line after a forced line break, |
601 // but does not affect lines after a soft wrap break. | 601 // but does not affect lines after a soft wrap break. |
602 bool isFirstLine = lineInfo.isFirstLine() && !(isAnonymousBlock() && parent(
)->firstChild() != this); | 602 bool isFirstLine = lineInfo.isFirstLine() && !(isAnonymousBlock() && parent(
)->slowFirstChild() != this); |
603 bool isAfterHardLineBreak = lineBox->prevRootBox() && lineBox->prevRootBox()
->endsWithBreak(); | 603 bool isAfterHardLineBreak = lineBox->prevRootBox() && lineBox->prevRootBox()
->endsWithBreak(); |
604 IndentTextOrNot shouldIndentText = requiresIndent(isFirstLine, isAfterHardLi
neBreak, style()); | 604 IndentTextOrNot shouldIndentText = requiresIndent(isFirstLine, isAfterHardLi
neBreak, style()); |
605 float lineLogicalLeft; | 605 float lineLogicalLeft; |
606 float lineLogicalRight; | 606 float lineLogicalRight; |
607 float availableLogicalWidth; | 607 float availableLogicalWidth; |
608 updateLogicalInlinePositions(this, lineLogicalLeft, lineLogicalRight, availa
bleLogicalWidth, isFirstLine, shouldIndentText, 0); | 608 updateLogicalInlinePositions(this, lineLogicalLeft, lineLogicalRight, availa
bleLogicalWidth, isFirstLine, shouldIndentText, 0); |
609 bool needsWordSpacing; | 609 bool needsWordSpacing; |
610 | 610 |
611 if (firstRun && firstRun->m_object->isReplaced()) { | 611 if (firstRun && firstRun->m_object->isReplaced()) { |
612 RenderBox* renderBox = toRenderBox(firstRun->m_object); | 612 RenderBox* renderBox = toRenderBox(firstRun->m_object); |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 RenderObject* next(); | 1254 RenderObject* next(); |
1255 }; | 1255 }; |
1256 | 1256 |
1257 RenderObject* InlineMinMaxIterator::next() | 1257 RenderObject* InlineMinMaxIterator::next() |
1258 { | 1258 { |
1259 RenderObject* result = 0; | 1259 RenderObject* result = 0; |
1260 bool oldEndOfInline = endOfInline; | 1260 bool oldEndOfInline = endOfInline; |
1261 endOfInline = false; | 1261 endOfInline = false; |
1262 while (current || current == parent) { | 1262 while (current || current == parent) { |
1263 if (!oldEndOfInline && (current == parent || (!current->isFloating() &&
!current->isReplaced() && !current->isOutOfFlowPositioned()))) | 1263 if (!oldEndOfInline && (current == parent || (!current->isFloating() &&
!current->isReplaced() && !current->isOutOfFlowPositioned()))) |
1264 result = current->firstChild(); | 1264 result = current->slowFirstChild(); |
1265 | 1265 |
1266 if (!result) { | 1266 if (!result) { |
1267 // We hit the end of our inline. (It was empty, e.g., <span></span>.
) | 1267 // We hit the end of our inline. (It was empty, e.g., <span></span>.
) |
1268 if (!oldEndOfInline && current->isRenderInline()) { | 1268 if (!oldEndOfInline && current->isRenderInline()) { |
1269 result = current; | 1269 result = current; |
1270 endOfInline = true; | 1270 endOfInline = true; |
1271 break; | 1271 break; |
1272 } | 1272 } |
1273 | 1273 |
1274 while (current && current != parent) { | 1274 while (current && current != parent) { |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2193 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat
(); | 2193 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat
(); |
2194 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal
se) - logicalLeft; | 2194 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal
se) - logicalLeft; |
2195 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); | 2195 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); |
2196 | 2196 |
2197 if (!style()->isLeftToRightDirection()) | 2197 if (!style()->isLeftToRightDirection()) |
2198 return logicalWidth() - logicalLeft; | 2198 return logicalWidth() - logicalLeft; |
2199 return logicalLeft; | 2199 return logicalLeft; |
2200 } | 2200 } |
2201 | 2201 |
2202 } | 2202 } |
OLD | NEW |