Commit 95df13dd authored by Butkovits Atila's avatar Butkovits Atila
Browse files

Backed out changeset f7944c3f9e5b (bug 1711437) for causing mochitest failures. CLOSED TREE

parent 8dffd155
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17,5 +17,5 @@ interface CSSImportRule : CSSRule {
  [SameObject, PutForwards=mediaText] readonly attribute MediaList? media;
  // Per spec, the .styleSheet is never null, but in our implementation it can
  // be.  See <https://bugzilla.mozilla.org/show_bug.cgi?id=1326509>.
  [SameObject, BinaryName="styleSheetForBindings"] readonly attribute CSSStyleSheet? styleSheet;
  [SameObject] readonly attribute CSSStyleSheet? styleSheet;
};
+0 −6
Original line number Diff line number Diff line
@@ -45,12 +45,6 @@ void ServoStyleRuleMap::SheetAdded(StyleSheet& aStyleSheet) {
  }
}

void ServoStyleRuleMap::SheetCloned(StyleSheet& aStyleSheet) {
  // Invalidate all data inside. We could probably track down all the individual
  // rules that changed etc, but it doesn't seem worth it.
  mTable.Clear();
}

void ServoStyleRuleMap::SheetRemoved(StyleSheet& aStyleSheet) {
  // Invalidate all data inside. This isn't strictly necessary since
  // we should always get update from document before new queries come.
+0 −1
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ class ServoStyleRuleMap {

  void SheetAdded(StyleSheet&);
  void SheetRemoved(StyleSheet&);
  void SheetCloned(StyleSheet&);

  void RuleAdded(StyleSheet& aStyleSheet, css::Rule&);
  void RuleRemoved(StyleSheet& aStyleSheet, css::Rule&);
+15 −26
Original line number Diff line number Diff line
@@ -31,11 +31,6 @@ uint16_t CSSCounterStyleRule::Type() const {
  return CSSRule_Binding::COUNTER_STYLE_RULE;
}

void CSSCounterStyleRule::SetRawAfterClone(
    RefPtr<RawServoCounterStyleRule> aRaw) {
  mRawRule = std::move(aRaw);
}

void CSSCounterStyleRule::GetCssText(nsACString& aCssText) const {
  Servo_CounterStyleRule_GetCssText(mRawRule, &aCssText);
}
@@ -47,27 +42,16 @@ void CSSCounterStyleRule::GetName(nsAString& aName) {
  nsStyleUtil::AppendEscapedCSSIdent(nameStr, aName);
}

template <typename Func>
void CSSCounterStyleRule::ModifyRule(Func aCallback) {
void CSSCounterStyleRule::SetName(const nsAString& aName) {
  if (IsReadOnly()) {
    return;
  }

  StyleSheet* sheet = GetStyleSheet();
  if (sheet) {
    sheet->WillDirty();
  }

  if (aCallback() && sheet) {
  NS_ConvertUTF16toUTF8 name(aName);
  if (Servo_CounterStyleRule_SetName(mRawRule, &name)) {
    if (StyleSheet* sheet = GetStyleSheet()) {
      sheet->RuleChanged(this, StyleRuleChangeKind::Generic);
    }
  }

void CSSCounterStyleRule::SetName(const nsAString& aName) {
  ModifyRule([&] {
    NS_ConvertUTF16toUTF8 name(aName);
    return Servo_CounterStyleRule_SetName(mRawRule, &name);
  });
}

#define CSS_COUNTER_DESC(name_, method_)                             \
@@ -77,10 +61,15 @@ void CSSCounterStyleRule::SetName(const nsAString& aName) {
        mRawRule, eCSSCounterDesc_##method_, &aValue);               \
  }                                                                  \
  void CSSCounterStyleRule::Set##method_(const nsACString& aValue) { \
    ModifyRule([&] {                                                 \
      return Servo_CounterStyleRule_SetDescriptor(                   \
          mRawRule, eCSSCounterDesc_##method_, &aValue);             \
    });                                                              \
    if (IsReadOnly()) {                                              \
      return;                                                        \
    }                                                                \
    if (Servo_CounterStyleRule_SetDescriptor(                        \
            mRawRule, eCSSCounterDesc_##method_, &aValue)) {         \
      if (StyleSheet* sheet = GetStyleSheet()) {                     \
        sheet->RuleChanged(this, StyleRuleChangeKind::Generic);      \
      }                                                              \
    }                                                                \
  }
#include "nsCSSCounterDescList.h"
#undef CSS_COUNTER_DESC
+0 −4
Original line number Diff line number Diff line
@@ -27,14 +27,10 @@ class CSSCounterStyleRule final : public css::Rule {
  CSSCounterStyleRule(const CSSCounterStyleRule& aCopy) = delete;
  ~CSSCounterStyleRule() = default;

  template <typename Func>
  void ModifyRule(Func);

 public:
  bool IsCCLeaf() const final;

  const RawServoCounterStyleRule* Raw() const { return mRawRule.get(); }
  void SetRawAfterClone(RefPtr<RawServoCounterStyleRule>);

#ifdef DEBUG
  void List(FILE* out = stdout, int32_t aIndent = 0) const final;
Loading