| 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() == | 663 rootInlineBox->getLineLayoutItem().style()->getUnicodeBidi() == |
| 664 EUnicodeBidi::kPlaintext) | 664 UnicodeBidi::kPlaintext) |
| 665 direction = rootInlineBox->direction(); | 665 direction = rootInlineBox->direction(); |
| 666 else | 666 else |
| 667 direction = style()->direction(); | 667 direction = style()->direction(); |
| 668 | 668 |
| 669 // Armed with the total width of the line (without justification), | 669 // Armed with the total width of the line (without justification), |
| 670 // 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 |
| 671 // 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 |
| 672 // increased if we end up justifying text. | 672 // increased if we end up justifying text. |
| 673 switch (textAlign) { | 673 switch (textAlign) { |
| 674 case ETextAlign::kLeft: | 674 case ETextAlign::kLeft: |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 endOfLine.offset(), resolver.status()); | 1139 endOfLine.offset(), resolver.status()); |
| 1140 resolver.runs().deleteRuns(); | 1140 resolver.runs().deleteRuns(); |
| 1141 } else { | 1141 } else { |
| 1142 VisualDirectionOverride override = | 1142 VisualDirectionOverride override = |
| 1143 (styleToUse.rtlOrdering() == EOrder::kVisual | 1143 (styleToUse.rtlOrdering() == EOrder::kVisual |
| 1144 ? (styleToUse.direction() == TextDirection::kLtr | 1144 ? (styleToUse.direction() == TextDirection::kLtr |
| 1145 ? VisualLeftToRightOverride | 1145 ? VisualLeftToRightOverride |
| 1146 : VisualRightToLeftOverride) | 1146 : VisualRightToLeftOverride) |
| 1147 : NoVisualOverride); | 1147 : NoVisualOverride); |
| 1148 if (isNewUBAParagraph && | 1148 if (isNewUBAParagraph && |
| 1149 styleToUse.unicodeBidi() == EUnicodeBidi::kPlaintext && | 1149 styleToUse.getUnicodeBidi() == UnicodeBidi::kPlaintext && |
| 1150 !resolver.context()->parent()) { | 1150 !resolver.context()->parent()) { |
| 1151 TextDirection direction = determinePlaintextDirectionality( | 1151 TextDirection direction = determinePlaintextDirectionality( |
| 1152 resolver.position().root(), resolver.position().getLineLayoutItem(), | 1152 resolver.position().root(), resolver.position().getLineLayoutItem(), |
| 1153 resolver.position().offset()); | 1153 resolver.position().offset()); |
| 1154 resolver.setStatus( | 1154 resolver.setStatus( |
| 1155 BidiStatus(direction, isOverride(styleToUse.unicodeBidi()))); | 1155 BidiStatus(direction, isOverride(styleToUse.getUnicodeBidi()))); |
| 1156 } | 1156 } |
| 1157 // FIXME: This ownership is reversed. We should own the BidiRunList and | 1157 // FIXME: This ownership is reversed. We should own the BidiRunList and |
| 1158 // pass it to createBidiRunsForLine. | 1158 // pass it to createBidiRunsForLine. |
| 1159 BidiRunList<BidiRun>& bidiRuns = resolver.runs(); | 1159 BidiRunList<BidiRun>& bidiRuns = resolver.runs(); |
| 1160 constructBidiRunsForLine( | 1160 constructBidiRunsForLine( |
| 1161 resolver, bidiRuns, endOfLine, override, | 1161 resolver, bidiRuns, endOfLine, override, |
| 1162 layoutState.lineInfo().previousLineBrokeCleanly(), isNewUBAParagraph); | 1162 layoutState.lineInfo().previousLineBrokeCleanly(), isNewUBAParagraph); |
| 1163 ASSERT(resolver.position() == endOfLine); | 1163 ASSERT(resolver.position() == endOfLine); |
| 1164 | 1164 |
| 1165 BidiRun* trailingSpaceRun = resolver.trailingSpaceRun(); | 1165 BidiRun* trailingSpaceRun = resolver.trailingSpaceRun(); |
| (...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2106 | 2106 |
| 2107 if (last) { | 2107 if (last) { |
| 2108 setLogicalHeight(last->lineBottomWithLeading()); | 2108 setLogicalHeight(last->lineBottomWithLeading()); |
| 2109 InlineIterator iter = InlineIterator(LineLayoutBlockFlow(this), | 2109 InlineIterator iter = InlineIterator(LineLayoutBlockFlow(this), |
| 2110 LineLayoutItem(last->lineBreakObj()), | 2110 LineLayoutItem(last->lineBreakObj()), |
| 2111 last->lineBreakPos()); | 2111 last->lineBreakPos()); |
| 2112 resolver.setPosition(iter, numberOfIsolateAncestors(iter)); | 2112 resolver.setPosition(iter, numberOfIsolateAncestors(iter)); |
| 2113 resolver.setStatus(last->lineBreakBidiStatus()); | 2113 resolver.setStatus(last->lineBreakBidiStatus()); |
| 2114 } else { | 2114 } else { |
| 2115 TextDirection direction = style()->direction(); | 2115 TextDirection direction = style()->direction(); |
| 2116 if (style()->unicodeBidi() == EUnicodeBidi::kPlaintext) | 2116 if (style()->getUnicodeBidi() == UnicodeBidi::kPlaintext) |
| 2117 direction = determinePlaintextDirectionality(LineLayoutItem(this)); | 2117 direction = determinePlaintextDirectionality(LineLayoutItem(this)); |
| 2118 resolver.setStatus( | 2118 resolver.setStatus( |
| 2119 BidiStatus(direction, isOverride(style()->unicodeBidi()))); | 2119 BidiStatus(direction, isOverride(style()->getUnicodeBidi()))); |
| 2120 InlineIterator iter = InlineIterator( | 2120 InlineIterator iter = InlineIterator( |
| 2121 LineLayoutBlockFlow(this), | 2121 LineLayoutBlockFlow(this), |
| 2122 bidiFirstSkippingEmptyInlines(LineLayoutBlockFlow(this), | 2122 bidiFirstSkippingEmptyInlines(LineLayoutBlockFlow(this), |
| 2123 resolver.runs(), &resolver), | 2123 resolver.runs(), &resolver), |
| 2124 0); | 2124 0); |
| 2125 resolver.setPosition(iter, numberOfIsolateAncestors(iter)); | 2125 resolver.setPosition(iter, numberOfIsolateAncestors(iter)); |
| 2126 } | 2126 } |
| 2127 return curr; | 2127 return curr; |
| 2128 } | 2128 } |
| 2129 | 2129 |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2513 | 2513 |
| 2514 bool LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { | 2514 bool LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { |
| 2515 // LayoutBlockFlow is in charge of paint invalidation of the first line. | 2515 // LayoutBlockFlow is in charge of paint invalidation of the first line. |
| 2516 if (firstLineBox()) | 2516 if (firstLineBox()) |
| 2517 return false; | 2517 return false; |
| 2518 | 2518 |
| 2519 return LayoutBlock::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); | 2519 return LayoutBlock::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); |
| 2520 } | 2520 } |
| 2521 | 2521 |
| 2522 } // namespace blink | 2522 } // namespace blink |
| OLD | NEW |