Changeset 102650 in webkit


Ignore:
Timestamp:
Dec 12, 2011 6:36:47 PM (12 years ago)
Author:
macpherson@chromium.org
Message:

Implement CSS text-decoration property in CSSStyleApplyProperty.
https://bugs.webkit.org/show_bug.cgi?id=74258

Reviewed by Andreas Kling.

No new tests / refactoring only.

  • css/CSSStyleApplyProperty.cpp:

(WebCore::ApplyPropertyTextDecoration::applyValue):
(WebCore::ApplyPropertyTextDecoration::createHandler):
(WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):

  • css/CSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::applyProperty):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r102649 r102650  
     12011-12-12  Luke Macpherson   <macpherson@chromium.org>
     2
     3        Implement CSS text-decoration property in CSSStyleApplyProperty.
     4        https://bugs.webkit.org/show_bug.cgi?id=74258
     5
     6        Reviewed by Andreas Kling.
     7
     8        No new tests / refactoring only.
     9
     10        * css/CSSStyleApplyProperty.cpp:
     11        (WebCore::ApplyPropertyTextDecoration::applyValue):
     12        (WebCore::ApplyPropertyTextDecoration::createHandler):
     13        (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
     14        * css/CSSStyleSelector.cpp:
     15        (WebCore::CSSStyleSelector::applyProperty):
     16
    1172011-12-12  Adrienne Walker  <enne@google.com>
    218
  • trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp

    r102557 r102650  
    867867    {
    868868        PropertyHandler handler = ApplyPropertyDefaultBase<ETextAlign, &RenderStyle::textAlign, ETextAlign, &RenderStyle::setTextAlign, ETextAlign, &RenderStyle::initialTextAlign>::createHandler();
     869        return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
     870    }
     871};
     872
     873class ApplyPropertyTextDecoration {
     874public:
     875    static void applyValue(CSSStyleSelector* selector, CSSValue* value)
     876    {
     877        ETextDecoration t = RenderStyle::initialTextDecoration();
     878        for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
     879            CSSValue* item = i.value();
     880            ASSERT(item->isPrimitiveValue());
     881            t |= *static_cast<CSSPrimitiveValue*>(item);
     882        }
     883        selector->style()->setTextDecoration(t);
     884    }
     885    static PropertyHandler createHandler()
     886    {
     887        PropertyHandler handler = ApplyPropertyDefaultBase<ETextDecoration, &RenderStyle::textDecoration, ETextDecoration, &RenderStyle::setTextDecoration, ETextDecoration, &RenderStyle::initialTextDecoration>::createHandler();
    869888        return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
    870889    }
     
    15451564
    15461565    setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
     1566    setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
    15471567
    15481568    setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler());
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r102621 r102650  
    30493049            setFontDescription(fontDescription);
    30503050        }
    3051         return;
    3052     }
    3053     case CSSPropertyTextDecoration: {
    3054         // list of ident
    3055         HANDLE_INHERIT_AND_INITIAL(textDecoration, TextDecoration)
    3056         ETextDecoration t = RenderStyle::initialTextDecoration();
    3057         for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
    3058             CSSValue* item = i.value();
    3059             ASSERT(item->isPrimitiveValue());
    3060             t |= *static_cast<CSSPrimitiveValue*>(item);
    3061         }
    3062         m_style->setTextDecoration(t);
    30633051        return;
    30643052    }
     
    38673855    case CSSPropertySize:
    38683856    case CSSPropertyTextAlign:
     3857    case CSSPropertyTextDecoration:
    38693858    case CSSPropertyTextIndent:
    38703859    case CSSPropertyMaxHeight:
Note: See TracChangeset for help on using the changeset viewer.