Bug 1273706 - Part 11: Have StyleAnimationValue::UncomputeValue(..., nsCSSValue) uncompute UnparsedStrings to token stream nsCSSValues. draft
authorJonathan Chan <jyc@eqv.io>
Thu, 18 Aug 2016 15:30:35 -0700
changeset 402900 6508bc57aa61423ba1238ccca5c8471bb4964399
parent 402899 aea3ba284453b6b6cd1ef7c54f3746a739938d78
child 402901 a83885d31250d03e29caadc1c987d298e75c875a
push id26775
push userjchan@mozilla.com
push dateThu, 18 Aug 2016 22:38:41 +0000
bugs1273706
milestone51.0a1
Bug 1273706 - Part 11: Have StyleAnimationValue::UncomputeValue(..., nsCSSValue) uncompute UnparsedStrings to token stream nsCSSValues. UncomputeValue(..., nsAString) already uncomputes these to strings. A later patch in this series uses unparsed strings to represent non-interpolable but animatable custom properties that don't require additional context (URL values require a principal, and StyleAnimationValue provides a URL type). MozReview-Commit-ID: ERHLMPCfFVF
layout/style/StyleAnimationValue.cpp
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -21,16 +21,17 @@
 #include "nsStyleSet.h"
 #include "nsComputedDOMStyle.h"
 #include "nsCSSParser.h"
 #include "nsCSSPseudoElements.h"
 #include "mozilla/css/Declaration.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Likely.h"
+#include "mozilla/RefPtr.h"
 #include "gfxMatrix.h"
 #include "gfxQuaternion.h"
 #include "nsIDocument.h"
 #include "nsIFrame.h"
 #include "gfx2DGlue.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
@@ -3174,16 +3175,23 @@ StyleAnimationValue::UncomputeValue(nsCS
         toList->mValue = value;
         if (i != fromList->Length() - 1) {
           toList->mNext = new nsCSSValueList;
           toList = toList->mNext;
         }
       }
       break;
     }
+    case eUnit_UnparsedString: {
+      RefPtr<nsCSSValueTokenStream> value = new nsCSSValueTokenStream;
+      value->mPropertyID = aProperty;
+      aComputedValue.GetStringValue(value->mTokenStream);
+      aSpecifiedValue.SetTokenStreamValue(value);
+      break;
+    }
     default:
       return false;
   }
   return true;
 }
 
 bool
 StyleAnimationValue::UncomputeValue(nsCSSPropertyID aProperty,