Backed out changeset 1200482baf04 (bug 1393189)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 30 Aug 2017 10:04:34 +0200
changeset 377771 657c8ee01fcfe0a2403ec1f705fd785b988ffa1d
parent 377770 095109d7ba80f68446fdb8b7b58949d5fb4fb5d4
child 377772 4960488f939ec95fb8152774d0230bbce7f9d242
push id94338
push userkwierso@gmail.com
push dateThu, 31 Aug 2017 02:58:58 +0000
treeherdermozilla-inbound@9ca18987dabb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1393189
milestone57.0a1
backs out1200482baf04a5d9bea563be0c2ce4e7a4e47a50
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 1200482baf04 (bug 1393189)
layout/style/CounterStyleManager.cpp
layout/style/CounterStyleManager.h
layout/style/ServoBindings.cpp
layout/style/nsComputedDOMStyle.cpp
--- a/layout/style/CounterStyleManager.cpp
+++ b/layout/style/CounterStyleManager.cpp
@@ -576,17 +576,17 @@ class BuiltinCounterStyle : public Count
 {
 public:
   constexpr BuiltinCounterStyle(int32_t aStyle, nsIAtom** aName)
     : CounterStyle(aStyle)
     , mName(aName)
   {
   }
 
-  virtual nsIAtom* GetStyleName() const override;
+  virtual void GetStyleName(nsAString& aResult) override;
   virtual void GetPrefix(nsAString& aResult) override;
   virtual void GetSuffix(nsAString& aResult) override;
   virtual void GetSpokenCounterText(CounterValue aOrdinal,
                                     WritingMode aWritingMode,
                                     nsAString& aResult,
                                     bool& aIsBullet) override;
   virtual bool IsBullet() override;
 
@@ -613,20 +613,24 @@ protected:
 private:
   // The atom for the name of the builtin counter style.
   // Extra indirection to point to nsGkAtoms members rather than the
   // nsIAtom, because members of nsGkAtoms are updated at runtime but
   // we want to construct BuiltinCounterStyle at compile time.
   nsIAtom** const mName;
 };
 
-/* virtual */ nsIAtom*
-BuiltinCounterStyle::GetStyleName() const
+/* virtual */ void
+BuiltinCounterStyle::GetStyleName(nsAString& aResult)
 {
-  return *mName;
+  MOZ_ASSERT(mStyle != NS_STYLE_LIST_STYLE_CUSTOM);
+  const nsCString& str =
+    nsCSSProps::ValueToKeyword(mStyle, nsCSSProps::kListStyleKTable);
+  MOZ_ASSERT(!str.IsEmpty());
+  aResult.Assign(NS_ConvertUTF8toUTF16(str));
 }
 
 /* virtual */ void
 BuiltinCounterStyle::GetPrefix(nsAString& aResult)
 {
   aResult.Truncate();
 }
 
@@ -1057,17 +1061,17 @@ public:
   // For counter style extends other, in addition, all fields will be
   // reset to uninitialized state. This method should be called when any
   // other counter style is added, removed, or changed.
   void ResetDependentData();
 
   nsCSSCounterStyleRule* GetRule() const { return mRule; }
   uint32_t GetRuleGeneration() const { return mRuleGeneration; }
 
-  virtual nsIAtom* GetStyleName() const override;
+  virtual void GetStyleName(nsAString& aResult) override;
   virtual void GetPrefix(nsAString& aResult) override;
   virtual void GetSuffix(nsAString& aResult) override;
   virtual void GetSpokenCounterText(CounterValue aOrdinal,
                                     WritingMode aWritingMode,
                                     nsAString& aResult,
                                     bool& aIsBullet) override;
   virtual bool IsBullet() override;
 
@@ -1214,20 +1218,21 @@ CustomCounterStyle::ResetDependentData()
   if (IsExtendsSystem()) {
     mFlags &= ~(FLAG_NEGATIVE_INITED |
                 FLAG_PREFIX_INITED |
                 FLAG_SUFFIX_INITED |
                 FLAG_PAD_INITED);
   }
 }
 
-/* virtual */ nsIAtom*
-CustomCounterStyle::GetStyleName() const
+/* virtual */ void
+CustomCounterStyle::GetStyleName(nsAString& aResult)
 {
-  return mName;
+  nsDependentAtomString name(mName);
+  aResult.Assign(name);
 }
 
 /* virtual */ void
 CustomCounterStyle::GetPrefix(nsAString& aResult)
 {
   if (!(mFlags & FLAG_PREFIX_INITED)) {
     mFlags |= FLAG_PREFIX_INITED;
 
@@ -1737,20 +1742,20 @@ AnonymousCounterStyle::AnonymousCounterS
                                              nsTArray<nsString> aSymbols)
   : CounterStyle(NS_STYLE_LIST_STYLE_CUSTOM)
   , mSingleString(false)
   , mSystem(aSystem)
   , mSymbols(Move(aSymbols))
 {
 }
 
-/* virtual */ nsIAtom*
-AnonymousCounterStyle::GetStyleName() const
+/* virtual */ void
+AnonymousCounterStyle::GetStyleName(nsAString& aResult)
 {
-  return nullptr;
+  aResult.Truncate();
 }
 
 /* virtual */ void
 AnonymousCounterStyle::GetPrefix(nsAString& aResult)
 {
   aResult.Truncate();
 }
 
--- a/layout/style/CounterStyleManager.h
+++ b/layout/style/CounterStyleManager.h
@@ -47,17 +47,17 @@ public:
   constexpr int32_t GetStyle() const { return mStyle; }
   bool IsNone() const { return mStyle == NS_STYLE_LIST_STYLE_NONE; }
   bool IsCustomStyle() const { return mStyle == NS_STYLE_LIST_STYLE_CUSTOM; }
   // A style is dependent if it depends on the counter style manager.
   // Custom styles are certainly dependent. In addition, some builtin
   // styles are dependent for fallback.
   bool IsDependentStyle() const;
 
-  virtual nsIAtom* GetStyleName() const = 0;
+  virtual void GetStyleName(nsAString& aResult) = 0;
   virtual void GetPrefix(nsAString& aResult) = 0;
   virtual void GetSuffix(nsAString& aResult) = 0;
   void GetCounterText(CounterValue aOrdinal,
                       WritingMode aWritingMode,
                       nsAString& aResult,
                       bool& aIsRTL);
   virtual void GetSpokenCounterText(CounterValue aOrdinal,
                                     WritingMode aWritingMode,
@@ -103,17 +103,17 @@ protected:
 
 class AnonymousCounterStyle final : public CounterStyle
 {
 public:
   explicit AnonymousCounterStyle(const nsAString& aContent);
   AnonymousCounterStyle(uint8_t aSystem, nsTArray<nsString> aSymbols);
   explicit AnonymousCounterStyle(const nsCSSValue::Array* aValue);
 
-  virtual nsIAtom* GetStyleName() const override;
+  virtual void GetStyleName(nsAString& aResult) override;
   virtual void GetPrefix(nsAString& aResult) override;
   virtual void GetSuffix(nsAString& aResult) override;
   virtual bool IsBullet() override;
 
   virtual void GetNegative(NegativeType& aResult) override;
   virtual bool IsOrdinalInRange(CounterValue aOrdinal) override;
   virtual bool IsOrdinalInAutoRange(CounterValue aOrdinal) override;
   virtual void GetPad(PadType& aResult) override;
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -1463,18 +1463,17 @@ bool
 Gecko_CounterStyle_IsName(const CounterStylePtr* aPtr) {
   return !Gecko_CounterStyle_IsNone(aPtr) && !(*aPtr)->AsAnonymous();
 }
 
 void
 Gecko_CounterStyle_GetName(const CounterStylePtr* aPtr,
                            nsAString* aResult) {
   MOZ_ASSERT(Gecko_CounterStyle_IsName(aPtr));
-  nsIAtom* name = (*aPtr)->GetStyleName();
-  *aResult = nsDependentAtomString(name);
+  (*aPtr)->GetStyleName(*aResult);
 }
 
 const nsTArray<nsString>&
 Gecko_CounterStyle_GetSymbols(const CounterStylePtr* aPtr) {
   MOZ_ASSERT((*aPtr)->AsAnonymous());
   AnonymousCounterStyle* anonymous = (*aPtr)->AsAnonymous();
   return anonymous->GetSymbols();
 }
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -1320,17 +1320,18 @@ nsComputedDOMStyle::DoGetColumnRuleColor
 }
 
 static void
 AppendCounterStyle(CounterStyle* aStyle, nsAString& aString)
 {
   AnonymousCounterStyle* anonymous = aStyle->AsAnonymous();
   if (!anonymous) {
     // want SetIdent
-    nsDependentAtomString type(aStyle->GetStyleName());
+    nsString type;
+    aStyle->GetStyleName(type);
     nsStyleUtil::AppendEscapedCSSIdent(type, aString);
   } else if (anonymous->IsSingleString()) {
     const nsTArray<nsString>& symbols = anonymous->GetSymbols();
     MOZ_ASSERT(symbols.Length() == 1);
     nsStyleUtil::AppendEscapedCSSString(symbols[0], aString);
   } else {
     aString.AppendLiteral("symbols(");