Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: Source/core/rendering/RenderBlockLineLayout.cpp

Issue 19471004: Rendering the property, text-align-last. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 1st patch for review Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 // Now mark the line boxes as being constructed. 701 // Now mark the line boxes as being constructed.
702 lastLineBox()->setConstructed(); 702 lastLineBox()->setConstructed();
703 703
704 // Return the last line. 704 // Return the last line.
705 return lastRootBox(); 705 return lastRootBox();
706 } 706 }
707 707
708 ETextAlign RenderBlock::textAlignmentForLine(bool endsWithSoftBreak) const 708 ETextAlign RenderBlock::textAlignmentForLine(bool endsWithSoftBreak) const
709 { 709 {
710 ETextAlign alignment = style()->textAlign(); 710 ETextAlign alignment = style()->textAlign();
711 if (!endsWithSoftBreak && alignment == JUSTIFY) 711 if (endsWithSoftBreak)
712 alignment = TASTART; 712 return alignment;
713
714 if (!RuntimeEnabledFeatures::css3TextEnabled()) {
715 if (alignment == JUSTIFY)
716 alignment = TASTART;
Julien - ping for review 2013/10/22 15:06:06 return TASTART; This could even be written: retu
dw.im 2013/10/23 02:40:58 Oh, it could be.
717 return alignment;
718 }
719
720 TextAlignLast alignmentLast = style()->textAlignLast();
721 switch (alignmentLast) {
722 case TextAlignLastStart:
723 return TASTART;
724 case TextAlignLastEnd:
725 return TAEND;
726 case TextAlignLastLeft:
727 return LEFT;
728 case TextAlignLastRight:
729 return RIGHT;
730 case TextAlignLastCenter:
731 return CENTER;
732 case TextAlignLastJustify:
733 return JUSTIFY;
734 case TextAlignLastAuto:
735 if (alignment != JUSTIFY)
736 return alignment;
737 if (style()->textJustify() == TextJustifyDistribute)
738 return JUSTIFY;
739 return TASTART;
740 }
713 741
714 return alignment; 742 return alignment;
715 } 743 }
716 744
717 static void updateLogicalWidthForLeftAlignedBlock(bool isLeftToRightDirection, B idiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float av ailableLogicalWidth) 745 static void updateLogicalWidthForLeftAlignedBlock(bool isLeftToRightDirection, B idiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float av ailableLogicalWidth)
718 { 746 {
719 // The direction of the block should determine what happens with wide lines. 747 // The direction of the block should determine what happens with wide lines.
720 // In particular with RTL blocks, wide lines should still spill out to the l eft. 748 // In particular with RTL blocks, wide lines should still spill out to the l eft.
721 if (isLeftToRightDirection) { 749 if (isLeftToRightDirection) {
722 if (totalLogicalWidth > availableLogicalWidth && trailingSpaceRun) 750 if (totalLogicalWidth > availableLogicalWidth && trailingSpaceRun)
(...skipping 2825 matching lines...) Expand 10 before | Expand all | Expand 10 after
3548 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache); 3576 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, ver ticalPositionCache);
3549 3577
3550 setLineGridBox(lineGridBox); 3578 setLineGridBox(lineGridBox);
3551 3579
3552 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying 3580 // FIXME: If any of the characteristics of the box change compared to the ol d one, then we need to do a deep dirtying
3553 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping 3581 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping
3554 // to this grid. 3582 // to this grid.
3555 } 3583 }
3556 3584
3557 } 3585 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698