Bug 1338388 - Part 6: stylo: Support stroke-dasharray and stroke-dashoffset; r?heycam draft
authorManish Goregaokar <manishearth@gmail.com>
Thu, 09 Feb 2017 17:43:52 -0800
changeset 486545 9fa68b823e3cd7a9895aa3ef1b08c96f5edfb1ae
parent 486544 ce3f96e34265888ebd5ebc7d1fc377c092d7eda2
child 486546 37f8713308dac780f6f4516ed2c71830b8a8badc
push id46019
push userbmo:manishearth@gmail.com
push dateSat, 18 Feb 2017 10:29:53 +0000
reviewersheycam
bugs1338388
milestone54.0a1
Bug 1338388 - Part 6: stylo: Support stroke-dasharray and stroke-dashoffset; r?heycam MozReview-Commit-ID: 4QKKzJ1DVYP
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -1074,16 +1074,29 @@ Gecko_nsStyleSVGPaint_SetURLValue(nsStyl
   aPaint->SetPaintServer(url.get(), NS_RGB(0, 0, 0));
 }
 
 void Gecko_nsStyleSVGPaint_Reset(nsStyleSVGPaint* aPaint)
 {
   aPaint->SetNone();
 }
 
+void
+Gecko_nsStyleSVG_SetDashArrayLength(nsStyleSVG* aSvg, uint32_t aLen)
+{
+  aSvg->mStrokeDasharray.Clear();
+  aSvg->mStrokeDasharray.SetLength(aLen);
+}
+
+void
+Gecko_nsStyleSVG_CopyDashArray(nsStyleSVG* aDst, const nsStyleSVG* aSrc)
+{
+  aDst->mStrokeDasharray = aSrc->mStrokeDasharray;
+}
+
 css::URLValue*
 Gecko_NewURLValue(ServoBundledURI aURI)
 {
   RefPtr<css::URLValue> url = aURI.IntoCssUrl();
   return url.forget().take();
 }
 
 NS_IMPL_THREADSAFE_FFI_REFCOUNTING(css::URLValue, CSSURLValue);
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -293,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);
 
+void Gecko_nsStyleSVG_SetDashArrayLength(nsStyleSVG* svg, uint32_t len);
+void Gecko_nsStyleSVG_CopyDashArray(nsStyleSVG* dst, const nsStyleSVG* src);
+
 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);