Changeset 134190 in webkit


Ignore:
Timestamp:
Nov 11, 2012 10:37:55 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS3] Parsing the property, text-align-last.
https://bugs.webkit.org/show_bug.cgi?id=99439

Patch by Dongwoo Joshua Im <dw.im@samsung.com> on 2012-11-11
Reviewed by Julien Chaffraix.

This patch implements the parsing side of the "text-align-last" property specified
in CSS3 working draft, with "-webkit-" prefix, under ENABLE_CSS3_TEXT flag.
Specification link : http://www.w3.org/TR/css3-text/#text-align-last

Source/WebCore:

Tests: fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-inherited.html

fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last.html

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Get the value of the text-align-last property.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue): Parse the value, and check whether it is a proper value which text-align-last can have.

  • css/CSSPrimitiveValueMappings.h:

(WebCore):
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ETextAlignLast):

  • css/CSSProperty.cpp:

(WebCore::CSSProperty::isInheritedProperty):

  • css/CSSPropertyNames.in: Add '-webkit-text-align-last' property.
  • css/StyleBuilder.cpp:

(WebCore::StyleBuilder::StyleBuilder):

  • css/StylePropertySet.cpp:

(WebCore):

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::applyProperty):

  • rendering/style/RenderStyle.h:
  • rendering/style/RenderStyleConstants.h:
  • rendering/style/StyleRareInheritedData.cpp:

(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):

  • rendering/style/StyleRareInheritedData.h:

(StyleRareInheritedData): Add m_textAlignLast.

LayoutTests:

  • fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-inherited.html: Added.
  • fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last.html: Added.
  • fast/css3-text/css3-text-align-last/getComputedStyle/script-tests/getComputedStyle-text-align-last-inherited.js: Added.

(testComputedStyle):

  • fast/css3-text/css3-text-align-last/getComputedStyle/script-tests/getComputedStyle-text-align-last.js: Added.

(testElementStyle):
(testComputedStyle):

  • platform/chromium/TestExpectations:
  • fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-expected.txt: Added.
  • fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-inherited-expected.txt: Added.
  • platform/mac/TestExpectations:
  • platform/qt-4.8/TestExpectations:
  • platform/qt-mac/TestExpectations:
  • platform/qt/TestExpectations:
Location:
trunk
Files:
9 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r134187 r134190  
     12012-11-11  Dongwoo Joshua Im  <dw.im@samsung.com>
     2
     3        [CSS3] Parsing the property, text-align-last.
     4        https://bugs.webkit.org/show_bug.cgi?id=99439
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        This patch implements the parsing side of the "text-align-last" property specified
     9        in CSS3 working draft, with "-webkit-" prefix, under ENABLE_CSS3_TEXT flag.
     10        Specification link : http://www.w3.org/TR/css3-text/#text-align-last
     11
     12        * fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-inherited.html: Added.
     13        * fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last.html: Added.
     14        * fast/css3-text/css3-text-align-last/getComputedStyle/script-tests/getComputedStyle-text-align-last-inherited.js: Added.
     15        (testComputedStyle):
     16        * fast/css3-text/css3-text-align-last/getComputedStyle/script-tests/getComputedStyle-text-align-last.js: Added.
     17        (testElementStyle):
     18        (testComputedStyle):
     19        * platform/chromium/TestExpectations:
     20        * fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-expected.txt: Added.
     21        * fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-inherited-expected.txt: Added.
     22        * platform/mac/TestExpectations:
     23        * platform/qt-4.8/TestExpectations:
     24        * platform/qt-mac/TestExpectations:
     25        * platform/qt/TestExpectations:
     26
    1272012-11-11  Keishi Hattori  <keishi@webkit.org>
    228
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r134187 r134190  
    202202# CSS3 Text support is not yet enabled (needs ENABLE_CSS3_TEXT).
    203203webkit.org/b/58491 fast/css3-text/css3-text-decoration
     204webkit.org/b/76173 fast/css3-text/css3-text-align-last
    204205
    205206# Chromium does not support smart pasting in text controls yet.
  • trunk/LayoutTests/platform/mac/TestExpectations

    r134150 r134190  
    986986# CSS3 Text support is not yet enabled (needs ENABLE_CSS3_TEXT).
    987987webkit.org/b/58491 fast/css3-text/css3-text-decoration
     988webkit.org/b/76173 fast/css3-text/css3-text-align-last
    988989
    989990# Our slow tests, in alphabetical order.
  • trunk/LayoutTests/platform/qt-4.8/TestExpectations

    r134125 r134190  
    708708# CSS3 Text support is not yet enabled (needs ENABLE_CSS3_TEXT).
    709709webkit.org/b/58491 fast/css3-text/css3-text-decoration
     710webkit.org/b/76173 fast/css3-text/css3-text-align-last
    710711
    711712# Needs rebaseline after bug 86441
  • trunk/LayoutTests/platform/qt-mac/TestExpectations

    r132043 r134190  
    58075807# CSS3 Text support is not yet enabled (needs ENABLE_CSS3_TEXT).
    58085808webkit.org/b/58491 fast/css3-text/css3-text-decoration
     5809webkit.org/b/76173 fast/css3-text/css3-text-align-last
    58095810
    58105811# Needs rebaseline after bug 86441
  • trunk/LayoutTests/platform/qt/TestExpectations

    r134125 r134190  
    352352# CSS3 Text support is not yet enabled (needs ENABLE_CSS3_TEXT).
    353353webkit.org/b/58491 fast/css3-text/css3-text-decoration
     354webkit.org/b/76173 fast/css3-text/css3-text-align-last
    354355
    355356# Web Inspector: Implement support for InspectorClient::overrideDeviceMetrics() in platforms other than Chromium
  • trunk/Source/WebCore/ChangeLog

    r134189 r134190  
     12012-11-11  Dongwoo Joshua Im  <dw.im@samsung.com>
     2
     3        [CSS3] Parsing the property, text-align-last.
     4        https://bugs.webkit.org/show_bug.cgi?id=99439
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        This patch implements the parsing side of the "text-align-last" property specified
     9        in CSS3 working draft, with "-webkit-" prefix, under ENABLE_CSS3_TEXT flag.
     10        Specification link : http://www.w3.org/TR/css3-text/#text-align-last
     11
     12        Tests: fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-inherited.html
     13               fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last.html
     14
     15        * css/CSSComputedStyleDeclaration.cpp:
     16        (WebCore):
     17        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Get the value of the text-align-last property.
     18        * css/CSSParser.cpp:
     19        (WebCore::CSSParser::parseValue): Parse the value, and check whether it is a proper value which text-align-last can have.
     20        * css/CSSPrimitiveValueMappings.h:
     21        (WebCore):
     22        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     23        (WebCore::CSSPrimitiveValue::operator ETextAlignLast):
     24        * css/CSSProperty.cpp:
     25        (WebCore::CSSProperty::isInheritedProperty):
     26        * css/CSSPropertyNames.in: Add '-webkit-text-align-last' property.
     27        * css/StyleBuilder.cpp:
     28        (WebCore::StyleBuilder::StyleBuilder):
     29        * css/StylePropertySet.cpp:
     30        (WebCore):
     31        * css/StyleResolver.cpp:
     32        (WebCore::StyleResolver::applyProperty):
     33        * rendering/style/RenderStyle.h:
     34        * rendering/style/RenderStyleConstants.h:
     35        * rendering/style/StyleRareInheritedData.cpp:
     36        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
     37        (WebCore::StyleRareInheritedData::operator==):
     38        * rendering/style/StyleRareInheritedData.h:
     39        (StyleRareInheritedData): Add m_textAlignLast.
     40
    1412012-11-11  Shinya Kawanaka  <shinyak@chromium.org>
    242
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r133458 r134190  
    184184    CSSPropertyWebkitTextDecorationLine,
    185185    CSSPropertyWebkitTextDecorationStyle,
     186    CSSPropertyWebkitTextAlignLast,
    186187#endif // CSS3_TEXT
    187188    CSSPropertyTextIndent,
     
    20372038        case CSSPropertyWebkitTextDecorationStyle:
    20382039            return renderTextDecorationStyleFlagsToCSSValue(style->textDecorationStyle());
     2040        case CSSPropertyWebkitTextAlignLast:
     2041            return cssValuePool().createValue(style->textAlignLast());
    20392042#endif // CSS3_TEXT
    20402043        case CSSPropertyWebkitTextDecorationsInEffect:
  • trunk/Source/WebCore/css/CSSParser.cpp

    r134156 r134190  
    18651865        }
    18661866        break;
     1867
     1868#if ENABLE(CSS3_TEXT)
     1869    case CSSPropertyWebkitTextAlignLast:
     1870        // auto | start | end | left | right | center | justify
     1871        if ((id >= CSSValueLeft && id <= CSSValueJustify) || id == CSSValueStart || id == CSSValueEnd || id == CSSValueAuto)
     1872            validPrimitive = true;
     1873        break;
     1874#endif // CSS3_TEXT
    18671875
    18681876    case CSSPropertyCursor: {
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r133227 r134190  
    21992199    }
    22002200}
     2201
     2202#if ENABLE(CSS3_TEXT)
     2203template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ETextAlignLast e)
     2204    : CSSValue(PrimitiveClass)
     2205{
     2206    m_primitiveUnitType = CSS_IDENT;
     2207    switch (e) {
     2208    case TextAlignLastStart:
     2209        m_value.ident = CSSValueStart;
     2210        break;
     2211    case TextAlignLastEnd:
     2212        m_value.ident = CSSValueEnd;
     2213        break;
     2214    case TextAlignLastLeft:
     2215        m_value.ident = CSSValueLeft;
     2216        break;
     2217    case TextAlignLastRight:
     2218        m_value.ident = CSSValueRight;
     2219        break;
     2220    case TextAlignLastCenter:
     2221        m_value.ident = CSSValueCenter;
     2222        break;
     2223    case TextAlignLastJustify:
     2224        m_value.ident = CSSValueJustify;
     2225        break;
     2226    case TextAlignLastAuto:
     2227        m_value.ident = CSSValueAuto;
     2228        break;
     2229    }
     2230}
     2231
     2232template<> inline CSSPrimitiveValue::operator ETextAlignLast() const
     2233{
     2234    switch (m_value.ident) {
     2235    case CSSValueAuto:
     2236        return TextAlignLastAuto;
     2237    case CSSValueStart:
     2238        return TextAlignLastStart;
     2239    case CSSValueEnd:
     2240        return TextAlignLastEnd;
     2241    case CSSValueLeft:
     2242        return TextAlignLastLeft;
     2243    case CSSValueRight:
     2244        return TextAlignLastRight;
     2245    case CSSValueCenter:
     2246        return TextAlignLastCenter;
     2247    case CSSValueJustify:
     2248        return TextAlignLastJustify;
     2249    }
     2250
     2251    ASSERT_NOT_REACHED();
     2252    return TextAlignLastAuto;
     2253}
     2254#endif // CSS3_TEXT
    22012255
    22022256template<> inline CSSPrimitiveValue::operator ETextDecoration() const
  • trunk/Source/WebCore/css/CSSProperty.cpp

    r133458 r134190  
    328328#if ENABLE(CSS3_TEXT)
    329329    case CSSPropertyWebkitTextDecorationLine:
     330    case CSSPropertyWebkitTextAlignLast:
    330331#endif // CSS3_TEXT
    331332    case CSSPropertyWebkitTextDecorationsInEffect:
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r133458 r134190  
    358358-webkit-text-decoration-line
    359359-webkit-text-decoration-style
     360-webkit-text-align-last
    360361#endif
    361362-webkit-text-decorations-in-effect
  • trunk/Source/WebCore/css/StyleBuilder.cpp

    r132942 r134190  
    19201920    setPropertyHandler(CSSPropertyWebkitTextDecorationLine, ApplyPropertyTextDecoration::createHandler());
    19211921    setPropertyHandler(CSSPropertyWebkitTextDecorationStyle, ApplyPropertyDefault<TextDecorationStyle, &RenderStyle::textDecorationStyle, TextDecorationStyle, &RenderStyle::setTextDecorationStyle, TextDecorationStyle, &RenderStyle::initialTextDecorationStyle>::createHandler());
     1922    setPropertyHandler(CSSPropertyWebkitTextAlignLast, ApplyPropertyDefault<ETextAlignLast, &RenderStyle::textAlignLast, ETextAlignLast, &RenderStyle::setTextAlignLast, ETextAlignLast, &RenderStyle::initialTextAlignLast>::createHandler());
    19221923#endif // CSS3_TEXT
    19231924    setPropertyHandler(CSSPropertyTextIndent, ApplyPropertyLength<&RenderStyle::textIndent, &RenderStyle::setTextIndent, &RenderStyle::initialTextIndent>::createHandler());
  • trunk/Source/WebCore/css/StylePropertySet.cpp

    r133581 r134190  
    975975#endif
    976976    CSSPropertyTextAlign,
     977#if ENABLE(CSS3_TEXT)
     978    CSSPropertyWebkitTextAlignLast,
     979#endif // CSS3_TEXT
    977980    CSSPropertyTextIndent,
    978981    CSSPropertyWidows
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r133926 r134190  
    38533853    case CSSPropertyWebkitTextDecorationLine:
    38543854    case CSSPropertyWebkitTextDecorationStyle:
     3855    case CSSPropertyWebkitTextAlignLast:
    38553856#endif // CSS3_TEXT
    38563857    case CSSPropertyWebkitTextEmphasisColor:
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r133926 r134190  
    620620#if ENABLE(CSS3_TEXT)
    621621    TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); }
     622    ETextAlignLast textAlignLast() const { return static_cast<ETextAlignLast>(rareInheritedData->m_textAlignLast); }
    622623#else
    623624    TextDecorationStyle textDecorationStyle() const { return TextDecorationStyleSolid; }
     
    11531154#if ENABLE(CSS3_TEXT)
    11541155    void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); }
     1156    void setTextAlignLast(ETextAlignLast v) { SET_VAR(rareInheritedData, m_textAlignLast, v) }
    11551157#endif // CSS3_TEXT
    11561158    void setDirection(TextDirection v) { inherited_flags._direction = v; }
     
    16121614#if ENABLE(CSS3_TEXT)
    16131615    static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; }
     1616    static ETextAlignLast initialTextAlignLast() { return TextAlignLastAuto; }
    16141617#endif // CSS3_TEXT
    16151618    static float initialZoom() { return 1.0f; }
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r132942 r134190  
    347347};
    348348
     349#if ENABLE(CSS3_TEXT)
     350enum ETextAlignLast {
     351    TextAlignLastAuto, TextAlignLastStart, TextAlignLastEnd, TextAlignLastLeft, TextAlignLastRight, TextAlignLastCenter, TextAlignLastJustify
     352};
     353#endif // CSS3_TEXT
     354
    349355enum EPageBreak {
    350356    PBAUTO, PBALWAYS, PBAVOID
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp

    r132942 r134190  
    9696    , m_imageResolutionSnap(RenderStyle::initialImageResolutionSnap())
    9797#endif
     98#if ENABLE(CSS3_TEXT)
     99    , m_textAlignLast(RenderStyle::initialTextAlignLast())
     100#endif // CSS3_TEXT
    98101    , hyphenationLimitBefore(-1)
    99102    , hyphenationLimitAfter(-1)
     
    158161    , m_imageResolutionSnap(o.m_imageResolutionSnap)
    159162#endif
     163#if ENABLE(CSS3_TEXT)
     164    , m_textAlignLast(o.m_textAlignLast)
     165#endif // CSS3_TEXT
    160166    , hyphenationString(o.hyphenationString)
    161167    , hyphenationLimitBefore(o.hyphenationLimitBefore)
     
    247253        && m_imageResolution == o.m_imageResolution
    248254#endif
     255#if ENABLE(CSS3_TEXT)
     256        && m_textAlignLast == o.m_textAlignLast
     257#endif // CSS3_TEXT
    249258        && m_lineSnap == o.m_lineSnap
    250259#if ENABLE(CSS_VARIABLES)
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h

    r132942 r134190  
    111111    unsigned m_imageResolutionSnap : 1; // ImageResolutionSnap
    112112#endif
     113#if ENABLE(CSS3_TEXT)
     114    unsigned m_textAlignLast : 3; // ETextAlignLast
     115#endif // CSS3_TEXT
    113116
    114117    AtomicString hyphenationString;
Note: See TracChangeset for help on using the changeset viewer.