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. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
4 * All right reserved. | 4 * All right reserved. |
5 * Copyright (C) 2010 Google Inc. All rights reserved. | 5 * Copyright (C) 2010 Google Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 void LayoutBlockFlow::updateLogicalWidthForAlignment( | 653 void LayoutBlockFlow::updateLogicalWidthForAlignment( |
654 const ETextAlign& textAlign, | 654 const ETextAlign& textAlign, |
655 const RootInlineBox* rootInlineBox, | 655 const RootInlineBox* rootInlineBox, |
656 BidiRun* trailingSpaceRun, | 656 BidiRun* trailingSpaceRun, |
657 LayoutUnit& logicalLeft, | 657 LayoutUnit& logicalLeft, |
658 LayoutUnit& totalLogicalWidth, | 658 LayoutUnit& totalLogicalWidth, |
659 LayoutUnit& availableLogicalWidth, | 659 LayoutUnit& availableLogicalWidth, |
660 unsigned expansionOpportunityCount) { | 660 unsigned expansionOpportunityCount) { |
661 TextDirection direction; | 661 TextDirection direction; |
662 if (rootInlineBox && | 662 if (rootInlineBox && |
663 rootInlineBox->getLineLayoutItem().style()->unicodeBidi() == Plaintext) | 663 rootInlineBox->getLineLayoutItem().style()->unicodeBidi() == |
| 664 EUnicodeBidi::kPlaintext) |
664 direction = rootInlineBox->direction(); | 665 direction = rootInlineBox->direction(); |
665 else | 666 else |
666 direction = style()->direction(); | 667 direction = style()->direction(); |
667 | 668 |
668 // Armed with the total width of the line (without justification), | 669 // Armed with the total width of the line (without justification), |
669 // we now examine our text-align property in order to determine where to | 670 // we now examine our text-align property in order to determine where to |
670 // position the objects horizontally. The total width of the line can be | 671 // position the objects horizontally. The total width of the line can be |
671 // increased if we end up justifying text. | 672 // increased if we end up justifying text. |
672 switch (textAlign) { | 673 switch (textAlign) { |
673 case ETextAlign::kLeft: | 674 case ETextAlign::kLeft: |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 lastRootBox()->setLineBreakInfo(endOfLine.getLineLayoutItem(), | 1138 lastRootBox()->setLineBreakInfo(endOfLine.getLineLayoutItem(), |
1138 endOfLine.offset(), resolver.status()); | 1139 endOfLine.offset(), resolver.status()); |
1139 resolver.runs().deleteRuns(); | 1140 resolver.runs().deleteRuns(); |
1140 } else { | 1141 } else { |
1141 VisualDirectionOverride override = | 1142 VisualDirectionOverride override = |
1142 (styleToUse.rtlOrdering() == EOrder::Visual | 1143 (styleToUse.rtlOrdering() == EOrder::Visual |
1143 ? (styleToUse.direction() == TextDirection::kLtr | 1144 ? (styleToUse.direction() == TextDirection::kLtr |
1144 ? VisualLeftToRightOverride | 1145 ? VisualLeftToRightOverride |
1145 : VisualRightToLeftOverride) | 1146 : VisualRightToLeftOverride) |
1146 : NoVisualOverride); | 1147 : NoVisualOverride); |
1147 if (isNewUBAParagraph && styleToUse.unicodeBidi() == Plaintext && | 1148 if (isNewUBAParagraph && |
| 1149 styleToUse.unicodeBidi() == EUnicodeBidi::kPlaintext && |
1148 !resolver.context()->parent()) { | 1150 !resolver.context()->parent()) { |
1149 TextDirection direction = determinePlaintextDirectionality( | 1151 TextDirection direction = determinePlaintextDirectionality( |
1150 resolver.position().root(), resolver.position().getLineLayoutItem(), | 1152 resolver.position().root(), resolver.position().getLineLayoutItem(), |
1151 resolver.position().offset()); | 1153 resolver.position().offset()); |
1152 resolver.setStatus( | 1154 resolver.setStatus( |
1153 BidiStatus(direction, isOverride(styleToUse.unicodeBidi()))); | 1155 BidiStatus(direction, isOverride(styleToUse.unicodeBidi()))); |
1154 } | 1156 } |
1155 // FIXME: This ownership is reversed. We should own the BidiRunList and | 1157 // FIXME: This ownership is reversed. We should own the BidiRunList and |
1156 // pass it to createBidiRunsForLine. | 1158 // pass it to createBidiRunsForLine. |
1157 BidiRunList<BidiRun>& bidiRuns = resolver.runs(); | 1159 BidiRunList<BidiRun>& bidiRuns = resolver.runs(); |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2104 | 2106 |
2105 if (last) { | 2107 if (last) { |
2106 setLogicalHeight(last->lineBottomWithLeading()); | 2108 setLogicalHeight(last->lineBottomWithLeading()); |
2107 InlineIterator iter = InlineIterator(LineLayoutBlockFlow(this), | 2109 InlineIterator iter = InlineIterator(LineLayoutBlockFlow(this), |
2108 LineLayoutItem(last->lineBreakObj()), | 2110 LineLayoutItem(last->lineBreakObj()), |
2109 last->lineBreakPos()); | 2111 last->lineBreakPos()); |
2110 resolver.setPosition(iter, numberOfIsolateAncestors(iter)); | 2112 resolver.setPosition(iter, numberOfIsolateAncestors(iter)); |
2111 resolver.setStatus(last->lineBreakBidiStatus()); | 2113 resolver.setStatus(last->lineBreakBidiStatus()); |
2112 } else { | 2114 } else { |
2113 TextDirection direction = style()->direction(); | 2115 TextDirection direction = style()->direction(); |
2114 if (style()->unicodeBidi() == Plaintext) | 2116 if (style()->unicodeBidi() == EUnicodeBidi::kPlaintext) |
2115 direction = determinePlaintextDirectionality(LineLayoutItem(this)); | 2117 direction = determinePlaintextDirectionality(LineLayoutItem(this)); |
2116 resolver.setStatus( | 2118 resolver.setStatus( |
2117 BidiStatus(direction, isOverride(style()->unicodeBidi()))); | 2119 BidiStatus(direction, isOverride(style()->unicodeBidi()))); |
2118 InlineIterator iter = InlineIterator( | 2120 InlineIterator iter = InlineIterator( |
2119 LineLayoutBlockFlow(this), | 2121 LineLayoutBlockFlow(this), |
2120 bidiFirstSkippingEmptyInlines(LineLayoutBlockFlow(this), | 2122 bidiFirstSkippingEmptyInlines(LineLayoutBlockFlow(this), |
2121 resolver.runs(), &resolver), | 2123 resolver.runs(), &resolver), |
2122 0); | 2124 0); |
2123 resolver.setPosition(iter, numberOfIsolateAncestors(iter)); | 2125 resolver.setPosition(iter, numberOfIsolateAncestors(iter)); |
2124 } | 2126 } |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2511 | 2513 |
2512 bool LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { | 2514 bool LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { |
2513 // LayoutBlockFlow is in charge of paint invalidation of the first line. | 2515 // LayoutBlockFlow is in charge of paint invalidation of the first line. |
2514 if (firstLineBox()) | 2516 if (firstLineBox()) |
2515 return false; | 2517 return false; |
2516 | 2518 |
2517 return LayoutBlock::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); | 2519 return LayoutBlock::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); |
2518 } | 2520 } |
2519 | 2521 |
2520 } // namespace blink | 2522 } // namespace blink |
OLD | NEW |