Bug 1371115 - Part 7: implements nsStyleBorder type properties animatable. r=hiro draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Wed, 05 Jul 2017 13:53:07 +0900
changeset 604015 118b6659a7be58f7b84e6024bfeea0a13dad66c0
parent 604014 89bde072ff1ec5f9539617b224e61e0787808898
child 604016 e0bd4ee1969177f43ecb6f65096cfc204e211b42
push id66924
push userbmo:dakatsuka@mozilla.com
push dateWed, 05 Jul 2017 04:54:52 +0000
reviewershiro
bugs1371115
milestone56.0a1
Bug 1371115 - Part 7: implements nsStyleBorder type properties animatable. r=hiro In this patch, implements following properties: * -moz-border-bottom-colors * -moz-border-left-colors * -moz-border-right-colors * -moz-border-top-colors To realize, we introduced a binding method Gecko_GetMozBorderColors. MozReview-Commit-ID: JeseSyl8rMG
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
layout/style/ServoBindings.toml
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -1215,16 +1215,23 @@ void
 Gecko_CopyMozBorderColors(nsStyleBorder* aDest, const nsStyleBorder* aSrc,
                           mozilla::Side aSide)
 {
   if (aSrc->mBorderColors) {
     aDest->CopyBorderColorsFrom(aSrc->mBorderColors[aSide], aSide);
   }
 }
 
+const nsBorderColors*
+Gecko_GetMozBorderColors(const nsStyleBorder* aBorder, mozilla::Side aSide)
+{
+  MOZ_ASSERT(aBorder);
+  return aBorder->mBorderColors ? aBorder->mBorderColors[aSide] : nullptr;
+}
+
 void
 Gecko_FontFamilyList_Clear(FontFamilyList* aList) {
   aList->Clear();
 }
 
 void
 Gecko_FontFamilyList_AppendNamed(FontFamilyList* aList, nsIAtom* aName, bool aQuoted)
 {
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -259,16 +259,18 @@ bool Gecko_AtomEqualsUTF8IgnoreCase(nsIA
 
 // Border style
 void Gecko_EnsureMozBorderColors(nsStyleBorder* aBorder);
 void Gecko_ClearMozBorderColors(nsStyleBorder* aBorder, mozilla::Side aSide);
 void Gecko_AppendMozBorderColors(nsStyleBorder* aBorder, mozilla::Side aSide,
                                  nscolor aColor);
 void Gecko_CopyMozBorderColors(nsStyleBorder* aDest, const nsStyleBorder* aSrc,
                                mozilla::Side aSide);
+const nsBorderColors* Gecko_GetMozBorderColors(const nsStyleBorder* aBorder,
+                                               mozilla::Side aSide);
 
 // Font style
 void Gecko_FontFamilyList_Clear(FontFamilyList* aList);
 void Gecko_FontFamilyList_AppendNamed(FontFamilyList* aList, nsIAtom* aName, bool aQuoted);
 void Gecko_FontFamilyList_AppendGeneric(FontFamilyList* list, FontFamilyType familyType);
 void Gecko_CopyFontFamilyFrom(nsFont* dst, const nsFont* src);
 // will not run destructors on dst, give it uninitialized memory
 // font_id is LookAndFeel::FontID
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -374,16 +374,17 @@ structs-types = [
     "ServoBundledURI",
     "ServoElementSnapshot",
     "ServoElementSnapshotTable",
     "SheetParsingMode",
     "StyleBasicShape",
     "StyleBasicShapeType",
     "StyleShapeSource",
     "StyleTransition",
+    "nsBorderColors",
     "nsCSSCounterStyleRule",
     "nsCSSFontFaceRule",
     "nsCSSKeyword",
     "nsCSSPropertyID",
     "nsCSSPropertyIDSet",
     "nsCSSShadowArray",
     "nsCSSUnit",
     "nsCSSValue",