Title: [176524] trunk/Source/WebCore
Revision
176524
Author
[email protected]
Date
2014-11-24 14:12:53 -0800 (Mon, 24 Nov 2014)

Log Message

Move the '-webkit-box-reflext' CSS property to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=139008

Reviewed by Anders Carlsson.

* css/CSSPropertyNames.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertReflection):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (176523 => 176524)


--- trunk/Source/WebCore/ChangeLog	2014-11-24 22:09:06 UTC (rev 176523)
+++ trunk/Source/WebCore/ChangeLog	2014-11-24 22:12:53 UTC (rev 176524)
@@ -1,3 +1,16 @@
+2014-11-22  Sam Weinig  <[email protected]>
+
+        Move the '-webkit-box-reflext' CSS property to the new StyleBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=139008
+
+        Reviewed by Anders Carlsson.
+
+        * css/CSSPropertyNames.in:
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertReflection):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::applyProperty):
+
 2014-11-24  Antti Koivisto  <[email protected]>
 
         Remove unused Style struct from SimpleLineLayout.cpp

Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (176523 => 176524)


--- trunk/Source/WebCore/css/CSSPropertyNames.in	2014-11-24 22:09:06 UTC (rev 176523)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in	2014-11-24 22:12:53 UTC (rev 176524)
@@ -322,7 +322,7 @@
 -webkit-box-ordinal-group [TypeName=unsigned]
 -webkit-box-orient
 -webkit-box-pack
--webkit-box-reflect [LegacyStyleBuilder]
+-webkit-box-reflect [Converter=Reflection]
 // -webkit-box-shadow differs from box-shadow in its treatement of blur radii > 8px.
 // Let -webkit-box-shadow blur radius be w_r and box-shadow blur radius be b_r. For
 // w_r > 8px, b_r = 8 + 4 * sqrt((w_r - 8) / 2).

Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (176523 => 176524)


--- trunk/Source/WebCore/css/StyleBuilderConverter.h	2014-11-24 22:09:06 UTC (rev 176523)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h	2014-11-24 22:12:53 UTC (rev 176524)
@@ -30,6 +30,7 @@
 #include "BasicShapeFunctions.h"
 #include "CSSCalculationValue.h"
 #include "CSSPrimitiveValue.h"
+#include "CSSReflectValue.h"
 #include "Length.h"
 #include "Pair.h"
 #include "QuotesData.h"
@@ -68,6 +69,7 @@
     static int convertMarqueeSpeed(StyleResolver&, CSSValue&);
     static PassRefPtr<QuotesData> convertQuotes(StyleResolver&, CSSValue&);
     static TextUnderlinePosition convertTextUnderlinePosition(StyleResolver&, CSSValue&);
+    static PassRefPtr<StyleReflection> convertReflection(StyleResolver&, CSSValue&);
 
 private:
     static Length convertToRadiusLength(CSSToLengthConversionData&, CSSPrimitiveValue&);
@@ -469,6 +471,29 @@
     return static_cast<TextUnderlinePosition>(combinedPosition);
 }
 
+inline PassRefPtr<StyleReflection> StyleBuilderConverter::convertReflection(StyleResolver& styleResolver, CSSValue& value)
+{
+    if (is<CSSPrimitiveValue>(value)) {
+        ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNone);
+        return nullptr;
+    }
+
+    CSSReflectValue& reflectValue = downcast<CSSReflectValue>(value);
+
+    RefPtr<StyleReflection> reflection = StyleReflection::create();
+    reflection->setDirection(*reflectValue.direction());
+
+    if (reflectValue.offset())
+        reflection->setOffset(reflectValue.offset()->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(styleResolver.state().cssToLengthConversionData()));
+
+    NinePieceImage mask;
+    mask.setMaskDefaults();
+    styleResolver.styleMap()->mapNinePieceImage(CSSPropertyWebkitBoxReflect, reflectValue.mask(), mask);
+    reflection->setMask(mask);
+
+    return reflection.release();
+}
+
 } // namespace WebCore
 
 #endif // StyleBuilderConverter_h

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (176523 => 176524)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2014-11-24 22:09:06 UTC (rev 176523)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2014-11-24 22:12:53 UTC (rev 176524)
@@ -2411,29 +2411,6 @@
         }
         return;
     }
-    case CSSPropertyWebkitBoxReflect: {
-        HANDLE_INHERIT_AND_INITIAL(boxReflect, BoxReflect)
-        if (primitiveValue) {
-            state.style()->setBoxReflect(RenderStyle::initialBoxReflect());
-            return;
-        }
-
-        if (!is<CSSReflectValue>(*value))
-            return;
-
-        CSSReflectValue& reflectValue = downcast<CSSReflectValue>(*value);
-        RefPtr<StyleReflection> reflection = StyleReflection::create();
-        reflection->setDirection(*reflectValue.direction());
-        if (reflectValue.offset())
-            reflection->setOffset(reflectValue.offset()->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(state.cssToLengthConversionData()));
-        NinePieceImage mask;
-        mask.setMaskDefaults();
-        m_styleMap.mapNinePieceImage(id, reflectValue.mask(), mask);
-        reflection->setMask(mask);
-
-        state.style()->setBoxReflect(reflection.release());
-        return;
-    }
     case CSSPropertySrc: // Only used in @font-face rules.
         return;
     case CSSPropertyUnicodeRange: // Only used in @font-face rules.
@@ -3081,6 +3058,7 @@
     case CSSPropertyWebkitBoxOrdinalGroup:
     case CSSPropertyWebkitBoxOrient:
     case CSSPropertyWebkitBoxPack:
+    case CSSPropertyWebkitBoxReflect:
     case CSSPropertyWebkitColorCorrection:
     case CSSPropertyWebkitColumnAxis:
     case CSSPropertyWebkitColumnBreakAfter:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to