Title: [102650] trunk/Source/WebCore
Revision
102650
Author
[email protected]
Date
2011-12-12 18:36:47 -0800 (Mon, 12 Dec 2011)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (102649 => 102650)


--- trunk/Source/WebCore/ChangeLog	2011-12-13 02:32:20 UTC (rev 102649)
+++ trunk/Source/WebCore/ChangeLog	2011-12-13 02:36:47 UTC (rev 102650)
@@ -1,3 +1,19 @@
+2011-12-12  Luke Macpherson   <[email protected]>
+
+        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):
+
 2011-12-12  Adrienne Walker  <[email protected]>
 
         iframe fails to scroll in composited page

Modified: trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp (102649 => 102650)


--- trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp	2011-12-13 02:32:20 UTC (rev 102649)
+++ trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp	2011-12-13 02:36:47 UTC (rev 102650)
@@ -870,6 +870,25 @@
     }
 };
 
+class ApplyPropertyTextDecoration {
+public:
+    static void applyValue(CSSStyleSelector* selector, CSSValue* value)
+    {
+        ETextDecoration t = RenderStyle::initialTextDecoration();
+        for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
+            CSSValue* item = i.value();
+            ASSERT(item->isPrimitiveValue());
+            t |= *static_cast<CSSPrimitiveValue*>(item);
+        }
+        selector->style()->setTextDecoration(t);
+    }
+    static PropertyHandler createHandler()
+    {
+        PropertyHandler handler = ApplyPropertyDefaultBase<ETextDecoration, &RenderStyle::textDecoration, ETextDecoration, &RenderStyle::setTextDecoration, ETextDecoration, &RenderStyle::initialTextDecoration>::createHandler();
+        return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
+    }
+};
+
 class ApplyPropertyPageSize {
 private:
     static Length mmLength(double mm) { return CSSPrimitiveValue::create(mm, CSSPrimitiveValue::CSS_MM)->computeLength<Length>(0, 0); }
@@ -1544,6 +1563,7 @@
     setPropertyHandler(CSSPropertyFontWeight, ApplyPropertyFontWeight::createHandler());
 
     setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
+    setPropertyHandler(CSSPropertyTextDecoration, ApplyPropertyTextDecoration::createHandler());
 
     setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler());
     setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color>::createHandler());

Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (102649 => 102650)


--- trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-12-13 02:32:20 UTC (rev 102649)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-12-13 02:36:47 UTC (rev 102650)
@@ -3050,18 +3050,6 @@
         }
         return;
     }
-    case CSSPropertyTextDecoration: {
-        // list of ident
-        HANDLE_INHERIT_AND_INITIAL(textDecoration, TextDecoration)
-        ETextDecoration t = RenderStyle::initialTextDecoration();
-        for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
-            CSSValue* item = i.value();
-            ASSERT(item->isPrimitiveValue());
-            t |= *static_cast<CSSPrimitiveValue*>(item);
-        }
-        m_style->setTextDecoration(t);
-        return;
-    }
 // shorthand properties
     case CSSPropertyBackground:
         if (isInitial) {
@@ -3866,6 +3854,7 @@
     case CSSPropertyResize:
     case CSSPropertySize:
     case CSSPropertyTextAlign:
+    case CSSPropertyTextDecoration:
     case CSSPropertyTextIndent:
     case CSSPropertyMaxHeight:
     case CSSPropertyHeight:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to