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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 // Return the last line. | 326 // Return the last line. |
327 return lastRootBox(); | 327 return lastRootBox(); |
328 } | 328 } |
329 | 329 |
330 ETextAlign LayoutBlockFlow::textAlignmentForLine(bool endsWithSoftBreak) const | 330 ETextAlign LayoutBlockFlow::textAlignmentForLine(bool endsWithSoftBreak) const |
331 { | 331 { |
332 ETextAlign alignment = style()->textAlign(); | 332 ETextAlign alignment = style()->textAlign(); |
333 if (endsWithSoftBreak) | 333 if (endsWithSoftBreak) |
334 return alignment; | 334 return alignment; |
335 | 335 |
336 TextAlignLast alignmentLast = style()->textAlignLast(); | 336 TextAlignLast alignmentLast = style()->getTextAlignLast(); |
337 switch (alignmentLast) { | 337 switch (alignmentLast) { |
338 case TextAlignLastStart: | 338 case TextAlignLastStart: |
339 return TASTART; | 339 return TASTART; |
340 case TextAlignLastEnd: | 340 case TextAlignLastEnd: |
341 return TAEND; | 341 return TAEND; |
342 case TextAlignLastLeft: | 342 case TextAlignLastLeft: |
343 return LEFT; | 343 return LEFT; |
344 case TextAlignLastRight: | 344 case TextAlignLastRight: |
345 return RIGHT; | 345 return RIGHT; |
346 case TextAlignLastCenter: | 346 case TextAlignLastCenter: |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 | 608 |
609 BidiRun* LayoutBlockFlow::computeInlineDirectionPositionsForSegment(RootInlineBo
x* lineBox, const LineInfo& lineInfo, ETextAlign textAlign, LayoutUnit& logicalL
eft, | 609 BidiRun* LayoutBlockFlow::computeInlineDirectionPositionsForSegment(RootInlineBo
x* lineBox, const LineInfo& lineInfo, ETextAlign textAlign, LayoutUnit& logicalL
eft, |
610 LayoutUnit& availableLogicalWidth, BidiRun* firstRun, BidiRun* trailingSpace
Run, GlyphOverflowAndFallbackFontsMap& textBoxDataMap, VerticalPositionCache& ve
rticalPositionCache, | 610 LayoutUnit& availableLogicalWidth, BidiRun* firstRun, BidiRun* trailingSpace
Run, GlyphOverflowAndFallbackFontsMap& textBoxDataMap, VerticalPositionCache& ve
rticalPositionCache, |
611 WordMeasurements& wordMeasurements) | 611 WordMeasurements& wordMeasurements) |
612 { | 612 { |
613 bool needsWordSpacing = true; | 613 bool needsWordSpacing = true; |
614 LayoutUnit totalLogicalWidth = lineBox->getFlowSpacingLogicalWidth(); | 614 LayoutUnit totalLogicalWidth = lineBox->getFlowSpacingLogicalWidth(); |
615 bool isAfterExpansion = true; | 615 bool isAfterExpansion = true; |
616 ExpansionOpportunities expansions; | 616 ExpansionOpportunities expansions; |
617 LayoutObject* previousObject = nullptr; | 617 LayoutObject* previousObject = nullptr; |
618 TextJustify textJustify = style()->textJustify(); | 618 TextJustify textJustify = style()->getTextJustify(); |
619 | 619 |
620 BidiRun* r = firstRun; | 620 BidiRun* r = firstRun; |
621 for (; r; r = r->next()) { | 621 for (; r; r = r->next()) { |
622 if (!r->m_box || r->m_lineLayoutItem.isOutOfFlowPositioned() || r->m_box
->isLineBreak()) { | 622 if (!r->m_box || r->m_lineLayoutItem.isOutOfFlowPositioned() || r->m_box
->isLineBreak()) { |
623 continue; // Positioned objects are only participating to figure out
their | 623 continue; // Positioned objects are only participating to figure out
their |
624 // correct static x position. They have no effect on the width. | 624 // correct static x position. They have no effect on the width. |
625 // Similarly, line break boxes have no effect on the width. | 625 // Similarly, line break boxes have no effect on the width. |
626 } | 626 } |
627 if (r->m_lineLayoutItem.isText()) { | 627 if (r->m_lineLayoutItem.isText()) { |
628 LayoutText* rt = toLayoutText(r->m_lineLayoutItem); | 628 LayoutText* rt = toLayoutText(r->m_lineLayoutItem); |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1537 } | 1537 } |
1538 | 1538 |
1539 // Text truncation kicks in in two cases: | 1539 // Text truncation kicks in in two cases: |
1540 // 1) If your overflow isn't visible and your text-overflow-mode isn't c
lip. | 1540 // 1) If your overflow isn't visible and your text-overflow-mode isn't c
lip. |
1541 // 2) If you're an anonymous block with a block parent that satisfies #1
that was created | 1541 // 2) If you're an anonymous block with a block parent that satisfies #1
that was created |
1542 // to accommodate a block that has inline and block children. This ex
cludes parents where | 1542 // to accommodate a block that has inline and block children. This ex
cludes parents where |
1543 // canCollapseAnonymousBlockChild is false, notably flex items and gr
id items. | 1543 // canCollapseAnonymousBlockChild is false, notably flex items and gr
id items. |
1544 // FIXME: CSS3 says that descendants that are clipped must also know how to
truncate. This is insanely | 1544 // FIXME: CSS3 says that descendants that are clipped must also know how to
truncate. This is insanely |
1545 // difficult to figure out in general (especially in the middle of doing lay
out), so we only handle the | 1545 // difficult to figure out in general (especially in the middle of doing lay
out), so we only handle the |
1546 // simple case of an anonymous block truncating when it's parent is clipped. | 1546 // simple case of an anonymous block truncating when it's parent is clipped. |
1547 bool hasTextOverflow = (style()->textOverflow() && hasOverflowClip()) | 1547 bool hasTextOverflow = (style()->getTextOverflow() && hasOverflowClip()) |
1548 || (isAnonymousBlock() && parent() && parent()->isLayoutBlock() && toLay
outBlock(parent())->canCollapseAnonymousBlockChild() | 1548 || (isAnonymousBlock() && parent() && parent()->isLayoutBlock() && toLay
outBlock(parent())->canCollapseAnonymousBlockChild() |
1549 && parent()->style()->textOverflow() && parent()->hasOverflowClip())
; | 1549 && parent()->style()->getTextOverflow() && parent()->hasOverflowClip
()); |
1550 | 1550 |
1551 // Walk all the lines and delete our ellipsis line boxes if they exist. | 1551 // Walk all the lines and delete our ellipsis line boxes if they exist. |
1552 if (hasTextOverflow) | 1552 if (hasTextOverflow) |
1553 deleteEllipsisLineBoxes(); | 1553 deleteEllipsisLineBoxes(); |
1554 | 1554 |
1555 if (firstChild()) { | 1555 if (firstChild()) { |
1556 // In full layout mode, clear the line boxes of children upfront. Otherw
ise, | 1556 // In full layout mode, clear the line boxes of children upfront. Otherw
ise, |
1557 // siblings can run into stale root lineboxes during layout. Then layout | 1557 // siblings can run into stale root lineboxes during layout. Then layout |
1558 // the replaced elements later. In partial layout mode, line boxes are n
ot | 1558 // the replaced elements later. In partial layout mode, line boxes are n
ot |
1559 // deleted and only dirtied. In that case, we can layout the replaced | 1559 // deleted and only dirtied. In that case, we can layout the replaced |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2107 if (!line || !line->isFirstLineStyle()) | 2107 if (!line || !line->isFirstLineStyle()) |
2108 return reason; | 2108 return reason; |
2109 // It's the RootInlineBox that paints the ::first-line background. Note that
since it may be | 2109 // It's the RootInlineBox that paints the ::first-line background. Note that
since it may be |
2110 // expensive to figure out if the first line is affected by any ::first-line
selectors at all, | 2110 // expensive to figure out if the first line is affected by any ::first-line
selectors at all, |
2111 // we just invalidate it unconditionally, since that's typically cheaper. | 2111 // we just invalidate it unconditionally, since that's typically cheaper. |
2112 invalidateDisplayItemClient(*line); | 2112 invalidateDisplayItemClient(*line); |
2113 return reason; | 2113 return reason; |
2114 } | 2114 } |
2115 | 2115 |
2116 } // namespace blink | 2116 } // namespace blink |
OLD | NEW |