Bug 1451289 - Part 6: Rename ServoCounterStyleRule to CSSCounterStyleRule r?emilio draft
authorNazım Can Altınova <canaltinova@gmail.com>
Tue, 05 Jun 2018 02:07:25 +0200
changeset 805174 060209c11577f6bebbe5fdc4ce24dd3a6e22b477
parent 805173 999a9c09ca78c66f682ade3d79da2a6dac452afc
child 805175 bb49d63ab197da39f727b2e939679dfd30305f0f
push id112583
push userbmo:canaltinova@gmail.com
push dateThu, 07 Jun 2018 11:56:39 +0000
reviewersemilio
bugs1451289
milestone62.0a1
Bug 1451289 - Part 6: Rename ServoCounterStyleRule to CSSCounterStyleRule r?emilio MozReview-Commit-ID: 4T4FMJAp9WV
dom/bindings/Bindings.conf
layout/style/CSSCounterStyleRule.cpp
layout/style/CSSCounterStyleRule.h
layout/style/ServoCSSRuleList.cpp
layout/style/ServoCounterStyleRule.cpp
layout/style/ServoCounterStyleRule.h
layout/style/moz.build
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -168,21 +168,16 @@ DOMInterfaces = {
 },
 
 'CSSConditionRule': {
     'concrete': False,
     'nativeType': 'mozilla::css::ConditionRule',
     'headerFile': 'mozilla/css/GroupRule.h',
 },
 
-'CSSCounterStyleRule': {
-    'nativeType': 'mozilla::ServoCounterStyleRule',
-    'headerFile': 'mozilla/ServoCounterStyleRule.h',
-},
-
 'CSSGroupingRule': {
     'concrete': False,
     'nativeType': 'mozilla::css::GroupRule',
 },
 
 'CSSLexer': {
     'wrapperCache': False
 },
rename from layout/style/ServoCounterStyleRule.cpp
rename to layout/style/CSSCounterStyleRule.cpp
--- a/layout/style/ServoCounterStyleRule.cpp
+++ b/layout/style/CSSCounterStyleRule.cpp
@@ -1,102 +1,104 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "mozilla/ServoCounterStyleRule.h"
+#include "mozilla/dom/CSSCounterStyleRule.h"
 
 #include "mozAutoDocUpdate.h"
 #include "mozilla/dom/CSSCounterStyleRuleBinding.h"
 #include "mozilla/ServoBindings.h"
 #include "nsStyleUtil.h"
 
 namespace mozilla {
+namespace dom {
 
 bool
-ServoCounterStyleRule::IsCCLeaf() const
+CSSCounterStyleRule::IsCCLeaf() const
 {
   return Rule::IsCCLeaf();
 }
 
 #ifdef DEBUG
 void
-ServoCounterStyleRule::List(FILE* out, int32_t aIndent) const
+CSSCounterStyleRule::List(FILE* out, int32_t aIndent) const
 {
   nsAutoCString str;
   for (int32_t i = 0; i < aIndent; i++) {
     str.AppendLiteral("  ");
   }
   Servo_CounterStyleRule_Debug(mRawRule, &str);
   fprintf_stderr(out, "%s\n", str.get());
 }
 #endif
 
 uint16_t
-ServoCounterStyleRule::Type() const
+CSSCounterStyleRule::Type() const
 {
   return CSSRuleBinding::COUNTER_STYLE_RULE;
 }
 
 void
-ServoCounterStyleRule::GetCssText(nsAString& aCssText) const
+CSSCounterStyleRule::GetCssText(nsAString& aCssText) const
 {
   Servo_CounterStyleRule_GetCssText(mRawRule, &aCssText);
 }
 
 void
-ServoCounterStyleRule::GetName(nsAString& aName)
+CSSCounterStyleRule::GetName(nsAString& aName)
 {
   aName.Truncate();
   nsAtom* name = Servo_CounterStyleRule_GetName(mRawRule);
   nsDependentAtomString nameStr(name);
   nsStyleUtil::AppendEscapedCSSIdent(nameStr, aName);
 }
 
 void
-ServoCounterStyleRule::SetName(const nsAString& aName)
+CSSCounterStyleRule::SetName(const nsAString& aName)
 {
   NS_ConvertUTF16toUTF8 name(aName);
   if (Servo_CounterStyleRule_SetName(mRawRule, &name)) {
     if (StyleSheet* sheet = GetStyleSheet()) {
       sheet->RuleChanged(this);
     }
   }
 }
 
 #define CSS_COUNTER_DESC(name_, method_)                        \
   void                                                          \
-  ServoCounterStyleRule::Get##method_(nsAString& aValue)        \
+  CSSCounterStyleRule::Get##method_(nsAString& aValue)          \
   {                                                             \
     aValue.Truncate();                                          \
     Servo_CounterStyleRule_GetDescriptorCssText(                \
       mRawRule, eCSSCounterDesc_##method_, &aValue);            \
   }                                                             \
   void                                                          \
-  ServoCounterStyleRule::Set##method_(const nsAString& aValue)  \
+  CSSCounterStyleRule::Set##method_(const nsAString& aValue)    \
   {                                                             \
     NS_ConvertUTF16toUTF8 value(aValue);                        \
     if (Servo_CounterStyleRule_SetDescriptor(                   \
           mRawRule, eCSSCounterDesc_##method_, &value)) {       \
       if (StyleSheet* sheet = GetStyleSheet()) {                \
         sheet->RuleChanged(this);                               \
       }                                                         \
     }                                                           \
   }
 #include "nsCSSCounterDescList.h"
 #undef CSS_COUNTER_DESC
 
 /* virtual */ size_t
-ServoCounterStyleRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
+CSSCounterStyleRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   return aMallocSizeOf(this);
 }
 
 /* virtual */ JSObject*
-ServoCounterStyleRule::WrapObject(JSContext* aCx,
-                                  JS::Handle<JSObject*> aGivenProto)
+CSSCounterStyleRule::WrapObject(JSContext* aCx,
+                                JS::Handle<JSObject*> aGivenProto)
 {
   return CSSCounterStyleRuleBinding::Wrap(aCx, this, aGivenProto);
 }
 
+} // namespace dom
 } // namespace mozilla
rename from layout/style/ServoCounterStyleRule.h
rename to layout/style/CSSCounterStyleRule.h
--- a/layout/style/ServoCounterStyleRule.h
+++ b/layout/style/CSSCounterStyleRule.h
@@ -1,37 +1,38 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef mozilla_ServoCounterStyleRule_h
-#define mozilla_ServoCounterStyleRule_h
+#ifndef mozilla_CSSCounterStyleRule_h
+#define mozilla_CSSCounterStyleRule_h
 
 #include "mozilla/css/Rule.h"
 #include "mozilla/ServoBindingTypes.h"
 
 struct RawServoCounterStyleRule;
 
 namespace mozilla {
+namespace dom {
 
-class ServoCounterStyleRule final : public css::Rule
+class CSSCounterStyleRule final : public css::Rule
 {
 public:
-  ServoCounterStyleRule(already_AddRefed<RawServoCounterStyleRule> aRawRule,
-                        uint32_t aLine, uint32_t aColumn)
+  CSSCounterStyleRule(already_AddRefed<RawServoCounterStyleRule> aRawRule,
+                      uint32_t aLine, uint32_t aColumn)
     : mozilla::css::Rule(aLine, aColumn)
     , mRawRule(std::move(aRawRule))
   {
   }
 
 private:
-  ServoCounterStyleRule(const ServoCounterStyleRule& aCopy) = delete;
-  ~ServoCounterStyleRule() = default;
+  CSSCounterStyleRule(const CSSCounterStyleRule& aCopy) = delete;
+  ~CSSCounterStyleRule() = default;
 
 public:
   bool IsCCLeaf() const final;
 
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
 
@@ -49,11 +50,12 @@ public:
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const final;
 
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
 
 private:
   RefPtr<RawServoCounterStyleRule> mRawRule;
 };
 
+} // namespace dom
 } // namespace mozilla
 
-#endif // mozilla_ServoCounterStyleRule_h
+#endif // mozilla_CSSCounterStyleRule_h
--- a/layout/style/ServoCSSRuleList.cpp
+++ b/layout/style/ServoCSSRuleList.cpp
@@ -3,24 +3,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* representation of CSSRuleList for stylo */
 
 #include "mozilla/ServoCSSRuleList.h"
 
+#include "mozilla/dom/CSSCounterStyleRule.h"
 #include "mozilla/dom/CSSFontFaceRule.h"
 #include "mozilla/dom/CSSKeyframesRule.h"
 #include "mozilla/dom/CSSMediaRule.h"
 #include "mozilla/dom/CSSNamespaceRule.h"
 #include "mozilla/dom/CSSStyleRule.h"
 #include "mozilla/IntegerRange.h"
 #include "mozilla/ServoBindings.h"
-#include "mozilla/ServoCounterStyleRule.h"
 #include "mozilla/ServoDocumentRule.h"
 #include "mozilla/ServoImportRule.h"
 #include "mozilla/ServoFontFeatureValuesRule.h"
 #include "mozilla/ServoPageRule.h"
 #include "mozilla/ServoSupportsRule.h"
 #include "mozilla/StyleSheet.h"
 
 using namespace mozilla::dom;
@@ -109,17 +109,17 @@ ServoCSSRuleList::GetRule(uint32_t aInde
       CASE_RULE_CSS(MEDIA, Media)
       CASE_RULE_CSS(NAMESPACE, Namespace)
       CASE_RULE(PAGE, Page)
       CASE_RULE(SUPPORTS, Supports)
       CASE_RULE(DOCUMENT, Document)
       CASE_RULE(IMPORT, Import)
       CASE_RULE(FONT_FEATURE_VALUES, FontFeatureValues)
       CASE_RULE_CSS(FONT_FACE, FontFace)
-      CASE_RULE(COUNTER_STYLE, CounterStyle)
+      CASE_RULE_CSS(COUNTER_STYLE, CounterStyle)
 #undef CASE_RULE
       case CSSRuleBinding::KEYFRAME_RULE:
         MOZ_ASSERT_UNREACHABLE("keyframe rule cannot be here");
         return nullptr;
       default:
         NS_WARNING("stylo: not implemented yet");
         return nullptr;
     }
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -77,17 +77,16 @@ EXPORTS.mozilla += [
     'PostTraversalTask.h',
     'PreloadedStyleSheet.h',
     'ServoArcTypeList.h',
     'ServoBindingList.h',
     'ServoBindings.h',
     'ServoBindingTypes.h',
     'ServoComputedData.h',
     'ServoComputedDataInlines.h',
-    'ServoCounterStyleRule.h',
     'ServoCSSParser.h',
     'ServoCSSRuleList.h',
     'ServoDocumentRule.h',
     'ServoElementSnapshot.h',
     'ServoElementSnapshotTable.h',
     'ServoFontFeatureValuesRule.h',
     'ServoImportRule.h',
     'ServoPageRule.h',
@@ -104,16 +103,17 @@ EXPORTS.mozilla += [
     'StyleSheet.h',
     'StyleSheetInfo.h',
     'StyleSheetInlines.h',
     'URLExtraData.h',
 ]
 
 EXPORTS.mozilla.dom += [
     'CSS.h',
+    'CSSCounterStyleRule.h',
     'CSSFontFaceRule.h',
     'CSSFontFeatureValuesRule.h',
     'CSSImportRule.h',
     'CSSKeyframeRule.h',
     'CSSKeyframesRule.h',
     'CSSLexer.h',
     'CSSMediaRule.h',
     'CSSMozDocumentRule.h',
@@ -144,16 +144,17 @@ EXPORTS.mozilla.css += [
 
 UNIFIED_SOURCES += [
     'AnimationCollection.cpp',
     'BindingStyleRule.cpp',
     'CachedInheritingStyles.cpp',
     'ComputedStyle.cpp',
     'CounterStyleManager.cpp',
     'CSS.cpp',
+    'CSSCounterStyleRule.cpp',
     'CSSFontFaceRule.cpp',
     'CSSFontFeatureValuesRule.cpp',
     'CSSImportRule.cpp',
     'CSSKeyframeRule.cpp',
     'CSSKeyframesRule.cpp',
     'CSSLexer.cpp',
     'CSSMediaRule.cpp',
     'CSSMozDocumentRule.cpp',
@@ -196,17 +197,16 @@ UNIFIED_SOURCES += [
     'nsStyleStruct.cpp',
     'nsStyleTransformMatrix.cpp',
     'nsStyleUtil.cpp',
     'nsTransitionManager.cpp',
     'PostTraversalTask.cpp',
     'PreloadedStyleSheet.cpp',
     'Rule.cpp',
     'ServoBindings.cpp',
-    'ServoCounterStyleRule.cpp',
     'ServoCSSParser.cpp',
     'ServoCSSRuleList.cpp',
     'ServoDocumentRule.cpp',
     'ServoElementSnapshot.cpp',
     'ServoFontFeatureValuesRule.cpp',
     'ServoImportRule.cpp',
     'ServoPageRule.cpp',
     'ServoSpecifiedValues.cpp',