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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
655 // Now mark the line boxes as being constructed. | 655 // Now mark the line boxes as being constructed. |
656 lastLineBox()->setConstructed(); | 656 lastLineBox()->setConstructed(); |
657 | 657 |
658 // Return the last line. | 658 // Return the last line. |
659 return lastRootBox(); | 659 return lastRootBox(); |
660 } | 660 } |
661 | 661 |
662 ETextAlign RenderBlock::textAlignmentForLine(bool endsWithSoftBreak) const | 662 ETextAlign RenderBlock::textAlignmentForLine(bool endsWithSoftBreak) const |
663 { | 663 { |
664 ETextAlign alignment = style()->textAlign(); | 664 ETextAlign alignment = style()->textAlign(); |
665 if (!endsWithSoftBreak && alignment == JUSTIFY) | 665 if (endsWithSoftBreak) |
666 alignment = TASTART; | 666 return alignment; |
667 | |
668 if (!RuntimeEnabledFeatures::css3TextEnabled()) { | |
Julien - ping for review
2013/10/25 18:49:19
Stray open brace.
dw.im
2013/10/28 02:56:14
Done.
| |
669 return (alignment == JUSTIFY) ? TASTART : alignment; | |
670 | |
671 TextAlignLast alignmentLast = style()->textAlignLast(); | |
672 switch (alignmentLast) { | |
673 case TextAlignLastStart: | |
674 return TASTART; | |
675 case TextAlignLastEnd: | |
676 return TAEND; | |
677 case TextAlignLastLeft: | |
678 return LEFT; | |
679 case TextAlignLastRight: | |
680 return RIGHT; | |
681 case TextAlignLastCenter: | |
682 return CENTER; | |
683 case TextAlignLastJustify: | |
684 return JUSTIFY; | |
685 case TextAlignLastAuto: | |
686 if (alignment != JUSTIFY) | |
687 return alignment; | |
688 if (style()->textJustify() == TextJustifyDistribute) | |
689 return JUSTIFY; | |
690 return TASTART; | |
691 } | |
667 | 692 |
668 return alignment; | 693 return alignment; |
669 } | 694 } |
670 | 695 |
671 static void updateLogicalWidthForLeftAlignedBlock(bool isLeftToRightDirection, B idiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float av ailableLogicalWidth) | 696 static void updateLogicalWidthForLeftAlignedBlock(bool isLeftToRightDirection, B idiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float av ailableLogicalWidth) |
672 { | 697 { |
673 // The direction of the block should determine what happens with wide lines. | 698 // The direction of the block should determine what happens with wide lines. |
674 // In particular with RTL blocks, wide lines should still spill out to the l eft. | 699 // In particular with RTL blocks, wide lines should still spill out to the l eft. |
675 if (isLeftToRightDirection) { | 700 if (isLeftToRightDirection) { |
676 if (totalLogicalWidth > availableLogicalWidth && trailingSpaceRun) | 701 if (totalLogicalWidth > availableLogicalWidth && trailingSpaceRun) |
(...skipping 2836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3513 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache); | 3538 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache); |
3514 | 3539 |
3515 setLineGridBox(lineGridBox); | 3540 setLineGridBox(lineGridBox); |
3516 | 3541 |
3517 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying | 3542 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying |
3518 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping | 3543 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping |
3519 // to this grid. | 3544 // to this grid. |
3520 } | 3545 } |
3521 | 3546 |
3522 } | 3547 } |
OLD | NEW |