Changeset 162213 in webkit


Ignore:
Timestamp:
Jan 17, 2014 12:33:04 PM (10 years ago)
Author:
zoltan@webkit.org
Message:

[CSS3] Add rendering support for -webkit-text-align-last
https://bugs.webkit.org/show_bug.cgi?id=99584

Reviewed by David Hyatt.

Source/WebCore:

Add support for the text-align-last CSS3 property, according to the latest specification:
http://dev.w3.org/csswg/css-text-3/#text-align-last-property

Tests: fast/css3-text/css3-text-align-last/text-align-last-with-text-align-justify.html

fast/css3-text/css3-text-align-last/text-align-last-with-text-align-non-justify.html

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlockFlow::textAlignmentForLine):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::changeRequiresLayout):

LayoutTests:

  • fast/css3-text/css3-text-align-last/text-align-last-with-text-align-justify-expected.html: Added.
  • fast/css3-text/css3-text-align-last/text-align-last-with-text-align-justify.html: Added.
  • fast/css3-text/css3-text-align-last/text-align-last-with-text-align-non-justify-expected.html: Added.
  • fast/css3-text/css3-text-align-last/text-align-last-with-text-align-non-justify.html: Added.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r162210 r162213  
     12014-01-17  Zoltan Horvath  <zoltan@webkit.org>
     2
     3        [CSS3] Add rendering support for -webkit-text-align-last
     4        https://bugs.webkit.org/show_bug.cgi?id=99584
     5
     6        Reviewed by David Hyatt.
     7
     8        * fast/css3-text/css3-text-align-last/text-align-last-with-text-align-justify-expected.html: Added.
     9        * fast/css3-text/css3-text-align-last/text-align-last-with-text-align-justify.html: Added.
     10        * fast/css3-text/css3-text-align-last/text-align-last-with-text-align-non-justify-expected.html: Added.
     11        * fast/css3-text/css3-text-align-last/text-align-last-with-text-align-non-justify.html: Added.
     12
    1132014-01-17  Bear Travis  <betravis@adobe.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r162212 r162213  
     12014-01-17  Zoltan Horvath  <zoltan@webkit.org>
     2
     3        [CSS3] Add rendering support for -webkit-text-align-last
     4        https://bugs.webkit.org/show_bug.cgi?id=99584
     5
     6        Reviewed by David Hyatt.
     7
     8        Add support for the text-align-last CSS3 property, according to the latest specification:
     9        http://dev.w3.org/csswg/css-text-3/#text-align-last-property
     10
     11        Tests: fast/css3-text/css3-text-align-last/text-align-last-with-text-align-justify.html
     12               fast/css3-text/css3-text-align-last/text-align-last-with-text-align-non-justify.html
     13
     14        * rendering/RenderBlockLineLayout.cpp:
     15        (WebCore::RenderBlockFlow::textAlignmentForLine):
     16        * rendering/style/RenderStyle.cpp:
     17        (WebCore::RenderStyle::changeRequiresLayout):
     18
    1192014-01-17  Daniel Bates  <dabates@apple.com>
    220
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r161909 r162213  
    356356{
    357357    ETextAlign alignment = style().textAlign();
    358     if (!endsWithSoftBreak && alignment == JUSTIFY)
    359         alignment = TASTART;
    360 
     358    if (endsWithSoftBreak)
     359        return alignment;
     360
     361#if !ENABLE(CSS3_TEXT)
     362    return (alignment == JUSTIFY) ? TASTART : alignment;
     363#else
     364    if (alignment != JUSTIFY)
     365        return alignment;
     366
     367    TextAlignLast alignmentLast = style().textAlignLast();
     368    switch (alignmentLast) {
     369    case TextAlignLastStart:
     370        return TASTART;
     371    case TextAlignLastEnd:
     372        return TAEND;
     373    case TextAlignLastLeft:
     374        return LEFT;
     375    case TextAlignLastRight:
     376        return RIGHT;
     377    case TextAlignLastCenter:
     378        return CENTER;
     379    case TextAlignLastJustify:
     380        return JUSTIFY;
     381    case TextAlignLastAuto:
     382        if (style().textJustify() == TextJustifyDistribute)
     383            return JUSTIFY;
     384        return TASTART;
     385    }
    361386    return alignment;
     387#endif
    362388}
    363389
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r161696 r162213  
    503503            || rareInheritedData->indent != other->rareInheritedData->indent
    504504#if ENABLE(CSS3_TEXT)
     505            || rareInheritedData->m_textAlignLast != other->rareInheritedData->m_textAlignLast
    505506            || rareInheritedData->m_textIndentLine != other->rareInheritedData->m_textIndentLine
    506507#endif
Note: See TracChangeset for help on using the changeset viewer.