Bug 1338388 - Part 7: stylo: Add mako template for URLOrNone, use for marker-* properties; r?heycam draft
authorManish Goregaokar <manishearth@gmail.com>
Thu, 09 Feb 2017 17:43:52 -0800
changeset 486540 8ba8b6240a203ef8962c5d1217be824587660394
parent 486539 0ff2cc32fdc3358e65aa10f2f35f61220e40b357
child 486541 54fe3cbb489d6767922219fc279d196c3e0c65dc
push id46018
push userbmo:manishearth@gmail.com
push dateSat, 18 Feb 2017 10:19:07 +0000
reviewersheycam
bugs1338388
milestone54.0a1
Bug 1338388 - Part 7: stylo: Add mako template for URLOrNone, use for marker-* properties; r?heycam MozReview-Commit-ID: 4QKKzJ1DVYP
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -763,30 +763,16 @@ ServoBundledURI::IntoCssUrl()
   RefPtr<css::URLValue> urlValue = new css::URLValue(urlBuffer,
                                                      do_AddRef(mBaseURI),
                                                      do_AddRef(mReferrer),
                                                      do_AddRef(mPrincipal));
   return urlValue.forget();
 }
 
 void
-Gecko_SetMozBinding(nsStyleDisplay* aDisplay, ServoBundledURI aBundledURI)
-{
-    MOZ_ASSERT(aDisplay);
-    aDisplay->mBinding = aBundledURI.IntoCssUrl();
-}
-
-void
-Gecko_CopyMozBindingFrom(nsStyleDisplay* aDest, const nsStyleDisplay* aSrc)
-{
-  aDest->mBinding = aSrc->mBinding;
-}
-
-
-void
 Gecko_SetNullImageValue(nsStyleImage* aImage)
 {
   MOZ_ASSERT(aImage);
   aImage->SetNull();
 }
 
 void
 Gecko_SetGradientImageValue(nsStyleImage* aImage, nsStyleGradient* aGradient)
@@ -1088,16 +1074,25 @@ Gecko_nsStyleSVGPaint_SetURLValue(nsStyl
   aPaint->SetPaintServer(url.get(), NS_RGB(0, 0, 0));
 }
 
 void Gecko_nsStyleSVGPaint_Reset(nsStyleSVGPaint* aPaint)
 {
   aPaint->SetNone();
 }
 
+css::URLValue*
+Gecko_NewURLValue(ServoBundledURI aURI)
+{
+  RefPtr<css::URLValue> url = aURI.IntoCssUrl();
+  return url.forget().take();
+}
+
+NS_IMPL_THREADSAFE_FFI_REFCOUNTING(css::URLValue, CSSURLValue);
+
 NS_IMPL_THREADSAFE_FFI_REFCOUNTING(nsStyleCoord::Calc, Calc);
 
 nsCSSShadowArray*
 Gecko_NewCSSShadowArray(uint32_t aLen)
 {
   RefPtr<nsCSSShadowArray> arr = new(aLen) nsCSSShadowArray(aLen);
   return arr.forget().take();
 }
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -228,20 +228,16 @@ void Gecko_SetCursorArrayLength(nsStyleU
 void Gecko_SetCursorImage(nsCursorImage* cursor,
                           const uint8_t* string_bytes, uint32_t string_length,
                           ThreadSafeURIHolder* base_uri,
                           ThreadSafeURIHolder* referrer,
                           ThreadSafePrincipalHolder* principal);
 void Gecko_CopyCursorArrayFrom(nsStyleUserInterface* dest,
                                const nsStyleUserInterface* src);
 
-// Display style.
-void Gecko_SetMozBinding(nsStyleDisplay* style_struct, ServoBundledURI bundled_uri);
-void Gecko_CopyMozBindingFrom(nsStyleDisplay* des, const nsStyleDisplay* src);
-
 // Dirtiness tracking.
 uint32_t Gecko_GetNodeFlags(RawGeckoNodeBorrowed node);
 void Gecko_SetNodeFlags(RawGeckoNodeBorrowed node, uint32_t flags);
 void Gecko_UnsetNodeFlags(RawGeckoNodeBorrowed node, uint32_t flags);
 void Gecko_SetOwnerDocumentNeedsStyleFlush(RawGeckoElementBorrowed element);
 
 // Incremental restyle.
 // Also, we might want a ComputedValues to ComputedValues API for animations?
@@ -297,16 +293,19 @@ void Gecko_StyleClipPath_SetURLValue(moz
 void Gecko_ResetFilters(nsStyleEffects* effects, size_t new_len);
 void Gecko_CopyFiltersFrom(nsStyleEffects* aSrc, nsStyleEffects* aDest);
 void Gecko_nsStyleFilter_SetURLValue(nsStyleFilter* effects, ServoBundledURI uri);
 
 void Gecko_nsStyleSVGPaint_CopyFrom(nsStyleSVGPaint* dest, const nsStyleSVGPaint* src);
 void Gecko_nsStyleSVGPaint_SetURLValue(nsStyleSVGPaint* paint, ServoBundledURI uri);
 void Gecko_nsStyleSVGPaint_Reset(nsStyleSVGPaint* paint);
 
+mozilla::css::URLValue* Gecko_NewURLValue(ServoBundledURI uri);
+NS_DECL_THREADSAFE_FFI_REFCOUNTING(mozilla::css::URLValue, CSSURLValue);
+
 void Gecko_FillAllBackgroundLists(nsStyleImageLayers* layers, uint32_t max_len);
 void Gecko_FillAllMaskLists(nsStyleImageLayers* layers, uint32_t max_len);
 NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsStyleCoord::Calc, Calc);
 
 nsCSSShadowArray* Gecko_NewCSSShadowArray(uint32_t len);
 NS_DECL_THREADSAFE_FFI_REFCOUNTING(nsCSSShadowArray, CSSShadowArray);
 
 nsStyleQuoteValues* Gecko_NewStyleQuoteValues(uint32_t len);