| 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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 // Now mark the line boxes as being constructed. | 660 // Now mark the line boxes as being constructed. |
| 661 lastLineBox()->setConstructed(); | 661 lastLineBox()->setConstructed(); |
| 662 | 662 |
| 663 // Return the last line. | 663 // Return the last line. |
| 664 return lastRootBox(); | 664 return lastRootBox(); |
| 665 } | 665 } |
| 666 | 666 |
| 667 ETextAlign RenderBlock::textAlignmentForLine(bool endsWithSoftBreak) const | 667 ETextAlign RenderBlock::textAlignmentForLine(bool endsWithSoftBreak) const |
| 668 { | 668 { |
| 669 ETextAlign alignment = style()->textAlign(); | 669 ETextAlign alignment = style()->textAlign(); |
| 670 if (!endsWithSoftBreak && alignment == JUSTIFY) | 670 if (endsWithSoftBreak) |
| 671 alignment = TASTART; | 671 return alignment; |
| 672 |
| 673 if (!RuntimeEnabledFeatures::css3TextEnabled()) |
| 674 return (alignment == JUSTIFY) ? TASTART : alignment; |
| 675 |
| 676 TextAlignLast alignmentLast = style()->textAlignLast(); |
| 677 switch (alignmentLast) { |
| 678 case TextAlignLastStart: |
| 679 return TASTART; |
| 680 case TextAlignLastEnd: |
| 681 return TAEND; |
| 682 case TextAlignLastLeft: |
| 683 return LEFT; |
| 684 case TextAlignLastRight: |
| 685 return RIGHT; |
| 686 case TextAlignLastCenter: |
| 687 return CENTER; |
| 688 case TextAlignLastJustify: |
| 689 return JUSTIFY; |
| 690 case TextAlignLastAuto: |
| 691 if (alignment != JUSTIFY) |
| 692 return alignment; |
| 693 if (style()->textJustify() == TextJustifyDistribute) |
| 694 return JUSTIFY; |
| 695 return TASTART; |
| 696 } |
| 672 | 697 |
| 673 return alignment; | 698 return alignment; |
| 674 } | 699 } |
| 675 | 700 |
| 676 static void updateLogicalWidthForLeftAlignedBlock(bool isLeftToRightDirection, B
idiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float av
ailableLogicalWidth) | 701 static void updateLogicalWidthForLeftAlignedBlock(bool isLeftToRightDirection, B
idiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float av
ailableLogicalWidth) |
| 677 { | 702 { |
| 678 // The direction of the block should determine what happens with wide lines. | 703 // The direction of the block should determine what happens with wide lines. |
| 679 // In particular with RTL blocks, wide lines should still spill out to the l
eft. | 704 // In particular with RTL blocks, wide lines should still spill out to the l
eft. |
| 680 if (isLeftToRightDirection) { | 705 if (isLeftToRightDirection) { |
| 681 if (totalLogicalWidth > availableLogicalWidth && trailingSpaceRun) | 706 if (totalLogicalWidth > availableLogicalWidth && trailingSpaceRun) |
| (...skipping 2840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3522 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver
ticalPositionCache); | 3547 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver
ticalPositionCache); |
| 3523 | 3548 |
| 3524 setLineGridBox(lineGridBox); | 3549 setLineGridBox(lineGridBox); |
| 3525 | 3550 |
| 3526 // FIXME: If any of the characteristics of the box change compared to the ol
d one, then we need to do a deep dirtying | 3551 // FIXME: If any of the characteristics of the box change compared to the ol
d one, then we need to do a deep dirtying |
| 3527 // (similar to what happens when the page height changes). Ideally, though,
we only do this if someone is actually snapping | 3552 // (similar to what happens when the page height changes). Ideally, though,
we only do this if someone is actually snapping |
| 3528 // to this grid. | 3553 // to this grid. |
| 3529 } | 3554 } |
| 3530 | 3555 |
| 3531 } | 3556 } |
| OLD | NEW |