Title: [91433] trunk/Source/WebCore
Revision
91433
Author
[email protected]
Date
2011-07-20 18:07:17 -0700 (Wed, 20 Jul 2011)

Log Message

Implement CSSPropertyWebkitTransformOriginZ and Origin in CSSStyleApplyProperty.
https://bugs.webkit.org/show_bug.cgi?id=64785
Note that this changes a cast from
  computed length double -> 28 bit int -> float
to
  computed length double -> float
I couldn't see any reason in the code that this was strictly necessary,
however it may have been so that X,Y,Z all have the same behavior, even though Z itself is not stored in a Length.

Reviewed by Simon Fraser.

No new tests / refactoring.

* css/CSSStyleApplyProperty.cpp:
(WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (91432 => 91433)


--- trunk/Source/WebCore/ChangeLog	2011-07-21 00:50:23 UTC (rev 91432)
+++ trunk/Source/WebCore/ChangeLog	2011-07-21 01:07:17 UTC (rev 91433)
@@ -1,3 +1,23 @@
+2011-07-20  Luke Macpherson   <[email protected]>
+
+        Implement CSSPropertyWebkitTransformOriginZ and Origin in CSSStyleApplyProperty.
+        https://bugs.webkit.org/show_bug.cgi?id=64785
+        Note that this changes a cast from
+          computed length double -> 28 bit int -> float
+        to
+          computed length double -> float
+        I couldn't see any reason in the code that this was strictly necessary,
+        however it may have been so that X,Y,Z all have the same behavior, even though Z itself is not stored in a Length.
+
+        Reviewed by Simon Fraser.
+
+        No new tests / refactoring.
+
+        * css/CSSStyleApplyProperty.cpp:
+        (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applyProperty):
+
 2011-07-20  Tony Chang  <[email protected]>
 
         Remove stray reference to StyleFlexibleBoxData.h that was accidentally

Modified: trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp (91432 => 91433)


--- trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp	2011-07-21 00:50:23 UTC (rev 91432)
+++ trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp	2011-07-21 01:07:17 UTC (rev 91433)
@@ -803,6 +803,8 @@
     setPropertyHandler(CSSPropertyWebkitPerspectiveOrigin, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyWebkitPerspectiveOriginX), propertyHandler(CSSPropertyWebkitPerspectiveOriginY)));
     setPropertyHandler(CSSPropertyWebkitTransformOriginX, new ApplyPropertyLength<>(&RenderStyle::transformOriginX, &RenderStyle::setTransformOriginX, &RenderStyle::initialTransformOriginX));
     setPropertyHandler(CSSPropertyWebkitTransformOriginY, new ApplyPropertyLength<>(&RenderStyle::transformOriginY, &RenderStyle::setTransformOriginY, &RenderStyle::initialTransformOriginY));
+    setPropertyHandler(CSSPropertyWebkitTransformOriginZ, new ApplyPropertyComputeLength<float>(&RenderStyle::transformOriginZ, &RenderStyle::setTransformOriginZ, &RenderStyle::initialTransformOriginZ));
+    setPropertyHandler(CSSPropertyWebkitTransformOrigin, new ApplyPropertyExpanding<SuppressValue>(propertyHandler(CSSPropertyWebkitTransformOriginX), propertyHandler(CSSPropertyWebkitTransformOriginY), propertyHandler(CSSPropertyWebkitTransformOriginZ)));
 }
 
 

Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (91432 => 91433)


--- trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-07-21 00:50:23 UTC (rev 91432)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-07-21 01:07:17 UTC (rev 91433)
@@ -4945,24 +4945,6 @@
         m_style->setTransform(operations);
         return;
     }
-    case CSSPropertyWebkitTransformOrigin:
-        HANDLE_INHERIT_AND_INITIAL(transformOriginX, TransformOriginX)
-        HANDLE_INHERIT_AND_INITIAL(transformOriginY, TransformOriginY)
-        HANDLE_INHERIT_AND_INITIAL(transformOriginZ, TransformOriginZ)
-        return;
-    case CSSPropertyWebkitTransformOriginZ: {
-        HANDLE_INHERIT_AND_INITIAL(transformOriginZ, TransformOriginZ)
-        if (!primitiveValue)
-            return;
-        float f;
-        int type = primitiveValue->primitiveType();
-        if (CSSPrimitiveValue::isUnitTypeLength(type))
-            f = static_cast<float>(primitiveValue->computeLengthIntForLength(style(), m_rootElementStyle));
-        else
-            return;
-        m_style->setTransformOriginZ(f);
-        break;
-    }
     case CSSPropertyWebkitTransformStyle:
         HANDLE_INHERIT_AND_INITIAL(transformStyle3D, TransformStyle3D)
         if (primitiveValue)
@@ -5341,6 +5323,8 @@
     case CSSPropertyMinHeight:
     case CSSPropertyWebkitTransformOriginX:
     case CSSPropertyWebkitTransformOriginY:
+    case CSSPropertyWebkitTransformOriginZ:
+    case CSSPropertyWebkitTransformOrigin:
     case CSSPropertyWebkitPerspectiveOriginX:
     case CSSPropertyWebkitPerspectiveOriginY:
     case CSSPropertyWebkitPerspectiveOrigin:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to