Commit ba7aebf0 authored by Masayuki Nakano's avatar Masayuki Nakano
Browse files

Bug 1767386 - part 1: Make some `CSSEditUtils` methods using...

Bug 1767386 - part 1: Make some `CSSEditUtils` methods using `GetCSSEquivalentToHTMLInlineStyleSetInternal` return error with `Result` r=m_kato

`CSSEditUtils::GetCSSEquivalentToHTMLInlineStyleSetInternal` may return error
which is unexpected.  And the methods changed by this patch may cause destroying
editor if and only if they treat computed style.  Therefore, they should be
non-static members and they should return error to make each caller avoid the
unexpected cases if necessary.

Differential Revision: https://phabricator.services.mozilla.com/D145303
parent 49511601
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -987,8 +987,8 @@ nsresult CSSEditUtils::GetCSSEquivalentToHTMLInlineStyleSetInternal(
// The nsIContent variant returns aIsSet instead of using an out parameter, and
// does not modify aValue.

// static
bool CSSEditUtils::IsCSSEquivalentToHTMLInlineStyleSetInternal(
Result<bool, nsresult>
CSSEditUtils::IsCSSEquivalentToHTMLInlineStyleSetInternal(
    nsIContent& aContent, nsAtom* aHTMLProperty, nsAtom* aAttribute,
    nsAString& aValue, StyleType aStyleType) {
  MOZ_ASSERT(aHTMLProperty || aAttribute);
@@ -1005,14 +1005,17 @@ bool CSSEditUtils::IsCSSEquivalentToHTMLInlineStyleSetInternal(
    // get the value of the CSS equivalent styles
    nsresult rv = GetCSSEquivalentToHTMLInlineStyleSetInternal(
        *content, aHTMLProperty, aAttribute, aValue, aStyleType);
    if (NS_WARN_IF(!mHTMLEditor || mHTMLEditor->Destroyed())) {
      return Err(NS_ERROR_EDITOR_DESTROYED);
    }
    if (NS_FAILED(rv)) {
      NS_WARNING(
          "CSSEditUtils::GetCSSEquivalentToHTMLInlineStyleSetInternal() "
          "failed");
      return false;
      return Err(rv);
    }
    if (NS_WARN_IF(parentNode != content->GetParentNode())) {
      return false;
      return Err(NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE);
    }

    // early way out if we can
@@ -1143,9 +1146,8 @@ bool CSSEditUtils::IsCSSEquivalentToHTMLInlineStyleSetInternal(
  return isSet;
}

bool CSSEditUtils::HaveCSSEquivalentStylesInternal(nsIContent& aContent,
                                                   nsAtom* aHTMLProperty,
                                                   nsAtom* aAttribute,
Result<bool, nsresult> CSSEditUtils::HaveCSSEquivalentStylesInternal(
    nsIContent& aContent, nsAtom* aHTMLProperty, nsAtom* aAttribute,
    StyleType aStyleType) {
  MOZ_ASSERT(aHTMLProperty || aAttribute);

@@ -1159,14 +1161,17 @@ bool CSSEditUtils::HaveCSSEquivalentStylesInternal(nsIContent& aContent,
    // get the value of the CSS equivalent styles
    nsresult rv = GetCSSEquivalentToHTMLInlineStyleSetInternal(
        *content, aHTMLProperty, aAttribute, valueString, aStyleType);
    if (NS_WARN_IF(!mHTMLEditor || mHTMLEditor->Destroyed())) {
      return Err(NS_ERROR_EDITOR_DESTROYED);
    }
    if (NS_FAILED(rv)) {
      NS_WARNING(
          "CSSEditUtils::GetCSSEquivalentToHTMLInlineStyleSetInternal() "
          "failed");
      return false;
      return Err(rv);
    }
    if (NS_WARN_IF(parentNode != content->GetParentNode())) {
      return false;
      return Err(NS_ERROR_EDITOR_UNEXPECTED_DOM_TREE);
    }

    if (!valueString.IsEmpty()) {
+21 −14
Original line number Diff line number Diff line
@@ -199,14 +199,16 @@ class CSSEditUtils final {
   * @return               A boolean being true if the css properties are
   *                       not same as initial value.
   */
  MOZ_CAN_RUN_SCRIPT static bool IsComputedCSSEquivalentToHTMLInlineStyleSet(
      nsIContent& aContent, nsAtom* aHTMLProperty, nsAtom* aAttribute,
  [[nodiscard]] MOZ_CAN_RUN_SCRIPT Result<bool, nsresult>
  IsComputedCSSEquivalentToHTMLInlineStyleSet(nsIContent& aContent,
                                              nsAtom* aHTMLProperty,
                                              nsAtom* aAttribute,
                                              nsAString& aValue) {
    MOZ_ASSERT(aHTMLProperty || aAttribute);
    return IsCSSEquivalentToHTMLInlineStyleSetInternal(
        aContent, aHTMLProperty, aAttribute, aValue, StyleType::Computed);
  }
  MOZ_CAN_RUN_SCRIPT_BOUNDARY static bool
  [[nodiscard]] MOZ_CAN_RUN_SCRIPT_BOUNDARY Result<bool, nsresult>
  IsSpecifiedCSSEquivalentToHTMLInlineStyleSet(nsIContent& aContent,
                                               nsAtom* aHTMLProperty,
                                               nsAtom* aAttribute,
@@ -232,14 +234,16 @@ class CSSEditUtils final {
   * @return               A boolean being true if the css properties are
   *                       not set.
   */
  MOZ_CAN_RUN_SCRIPT static bool HaveComputedCSSEquivalentStyles(
      nsIContent& aContent, nsAtom* aHTMLProperty, nsAtom* aAttribute) {
  [[nodiscard]] MOZ_CAN_RUN_SCRIPT Result<bool, nsresult>
  HaveComputedCSSEquivalentStyles(nsIContent& aContent, nsAtom* aHTMLProperty,
                                  nsAtom* aAttribute) {
    MOZ_ASSERT(aHTMLProperty || aAttribute);
    return HaveCSSEquivalentStylesInternal(aContent, aHTMLProperty, aAttribute,
                                           StyleType::Computed);
  }
  MOZ_CAN_RUN_SCRIPT_BOUNDARY static bool HaveSpecifiedCSSEquivalentStyles(
      nsIContent& aContent, nsAtom* aHTMLProperty, nsAtom* aAttribute) {
  [[nodiscard]] MOZ_CAN_RUN_SCRIPT_BOUNDARY Result<bool, nsresult>
  HaveSpecifiedCSSEquivalentStyles(nsIContent& aContent, nsAtom* aHTMLProperty,
                                   nsAtom* aAttribute) {
    MOZ_ASSERT(aHTMLProperty || aAttribute);
    return HaveCSSEquivalentStylesInternal(aContent, aHTMLProperty, aAttribute,
                                           StyleType::Specified);
@@ -423,12 +427,15 @@ class CSSEditUtils final {
                                               nsAtom* aAttribute,
                                               nsAString& aValue,
                                               StyleType aStyleType);
  MOZ_CAN_RUN_SCRIPT static bool IsCSSEquivalentToHTMLInlineStyleSetInternal(
      nsIContent& aContent, nsAtom* aHTMLProperty, nsAtom* aAttribute,
      nsAString& aValue, StyleType aStyleType);
  MOZ_CAN_RUN_SCRIPT static bool HaveCSSEquivalentStylesInternal(
      nsIContent& aContent, nsAtom* aHTMLProperty, nsAtom* aAttribute,
  [[nodiscard]] MOZ_CAN_RUN_SCRIPT Result<bool, nsresult>
  IsCSSEquivalentToHTMLInlineStyleSetInternal(nsIContent& aContent,
                                              nsAtom* aHTMLProperty,
                                              nsAtom* aAttribute,
                                              nsAString& aValue,
                                              StyleType aStyleType);
  [[nodiscard]] MOZ_CAN_RUN_SCRIPT Result<bool, nsresult>
  HaveCSSEquivalentStylesInternal(nsIContent& aContent, nsAtom* aHTMLProperty,
                                  nsAtom* aAttribute, StyleType aStyleType);

  [[nodiscard]] MOZ_CAN_RUN_SCRIPT nsresult RemoveCSSPropertyInternal(
      nsStyledElement& aStyledElement, nsAtom& aProperty,
+18 −9
Original line number Diff line number Diff line
@@ -8803,11 +8803,15 @@ nsresult HTMLEditor::GetInlineStyles(nsIContent& aContent,
      isSet = HTMLEditUtils::IsInlineStyleSetByElement(
          aContent, *tag, attribute, nullptr, &value);
    } else {
      isSet = CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet(
      Result<bool, nsresult> isComputedCSSEquivalentToHTMLInlineStyleOrError =
          mCSSEditUtils->IsComputedCSSEquivalentToHTMLInlineStyleSet(
              aContent, MOZ_KnownLive(tag), MOZ_KnownLive(attribute), value);
      if (NS_WARN_IF(Destroyed())) {
        return NS_ERROR_EDITOR_DESTROYED;
      if (isComputedCSSEquivalentToHTMLInlineStyleOrError.isErr()) {
        NS_WARNING(
            "CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet failed");
        return isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrapErr();
      }
      isSet = isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrap();
    }
    if (isSet) {
      aStyleCacheArray.AppendElement(StyleCache(tag, attribute, value));
@@ -8859,12 +8863,17 @@ nsresult HTMLEditor::ReapplyCachedStyles() {
    nsAutoString currentValue;
    if (useCSS) {
      // check computed style first in css case
      isAny = CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet(
      Result<bool, nsresult> isComputedCSSEquivalentToHTMLInlineStyleOrError =
          mCSSEditUtils->IsComputedCSSEquivalentToHTMLInlineStyleSet(
              *startContainerContent, MOZ_KnownLive(styleCacheBeforeEdit.Tag()),
              MOZ_KnownLive(styleCacheBeforeEdit.GetAttribute()), currentValue);
      if (NS_WARN_IF(Destroyed())) {
        return NS_ERROR_EDITOR_DESTROYED;
      if (isComputedCSSEquivalentToHTMLInlineStyleOrError.isErr()) {
        NS_WARNING(
            "CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet() "
            "failed");
        return isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrapErr();
      }
      isAny = isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrap();
    }
    if (!isAny) {
      // then check typeinstate and html style
+4 −2
Original line number Diff line number Diff line
@@ -4100,8 +4100,10 @@ class HTMLEditor final : public EditorBase,
   *     calling this.  Which is the way to smart to make every caller
   *     must check the editor state?
   */
  MOZ_CAN_RUN_SCRIPT bool IsRemovableParentStyleWithNewSpanElement(
      nsIContent& aContent, nsAtom* aHTMLProperty, nsAtom* aAttribute) const;
  MOZ_CAN_RUN_SCRIPT Result<bool, nsresult>
  IsRemovableParentStyleWithNewSpanElement(nsIContent& aContent,
                                           nsAtom* aHTMLProperty,
                                           nsAtom* aAttribute) const;

  /**
   * XXX These methods seem odd and except the only caller,
+125 −63
Original line number Diff line number Diff line
@@ -450,8 +450,15 @@ nsresult HTMLEditor::SetInlinePropertyOnTextNode(
    // The HTML styles defined by aProperty/aAttribute have a CSS equivalence
    // for node; let's check if it carries those CSS styles
    nsAutoString value(aValue);
    if (CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet(
            aText, &aProperty, aAttribute, value)) {
    Result<bool, nsresult> isComputedCSSEquivalentToHTMLInlineStyleOrError =
        mCSSEditUtils->IsComputedCSSEquivalentToHTMLInlineStyleSet(
            aText, &aProperty, aAttribute, value);
    if (isComputedCSSEquivalentToHTMLInlineStyleOrError.isErr()) {
      NS_WARNING(
          "CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet() failed");
      return isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrapErr();
    }
    if (isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrap()) {
      return NS_OK;
    }
  } else if (HTMLEditUtils::IsInlineStyleSetByElement(aText, aProperty,
@@ -685,8 +692,15 @@ nsresult HTMLEditor::SetInlinePropertyOnNodeImpl(nsIContent& aContent,
  // Don't need to do anything if property already set on node
  if (CSSEditUtils::IsCSSEditableProperty(&aContent, &aProperty, aAttribute)) {
    nsAutoString value(aValue);
    if (CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet(
            aContent, &aProperty, aAttribute, value)) {
    Result<bool, nsresult> isComputedCSSEquivalentToHTMLInlineStyleOrError =
        mCSSEditUtils->IsComputedCSSEquivalentToHTMLInlineStyleSet(
            aContent, &aProperty, aAttribute, value);
    if (isComputedCSSEquivalentToHTMLInlineStyleOrError.isErr()) {
      NS_WARNING(
          "CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet() failed");
      return isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrapErr();
    }
    if (isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrap()) {
      return NS_OK;
    }
  } else if (HTMLEditUtils::IsInlineStyleSetByElement(aContent, aProperty,
@@ -937,8 +951,17 @@ SplitNodeResult HTMLEditor::SplitAncestorStyledInlineElementsAt(
      // in this implementation for the node; let's check if it carries those
      // CSS styles
      nsAutoString firstValue;
      isSetByCSS = CSSEditUtils::IsSpecifiedCSSEquivalentToHTMLInlineStyleSet(
      Result<bool, nsresult> isSpecifiedByCSSOrError =
          mCSSEditUtils->IsSpecifiedCSSEquivalentToHTMLInlineStyleSet(
              *content, aProperty, aAttribute, firstValue);
      if (isSpecifiedByCSSOrError.isErr()) {
        result.IgnoreCaretPointSuggestion();
        NS_WARNING(
            "CSSEditUtils::IsSpecifiedCSSEquivalentToHTMLInlineStyleSet() "
            "failed");
        return SplitNodeResult(isSpecifiedByCSSOrError.unwrapErr());
      }
      isSetByCSS = isSpecifiedByCSSOrError.unwrap();
    }
    if (!isSetByCSS) {
      if (!content->IsElement()) {
@@ -1305,10 +1328,17 @@ nsresult HTMLEditor::RemoveStyleInside(Element& aElement, nsAtom* aProperty,
  // Then, remove CSS style if specified.
  // XXX aElement may have already been removed from the DOM tree.  Why
  //     do we keep handling aElement here??
  if (CSSEditUtils::IsCSSEditableProperty(&aElement, aProperty, aAttribute) &&
      CSSEditUtils::HaveSpecifiedCSSEquivalentStyles(aElement, aProperty,
                                                     aAttribute)) {
    if (nsStyledElement* styledElement = nsStyledElement::FromNode(&aElement)) {
  if (CSSEditUtils::IsCSSEditableProperty(&aElement, aProperty, aAttribute)) {
    Result<bool, nsresult> elementHasSpecifiedCSSEquivalentStylesOrError =
        mCSSEditUtils->HaveSpecifiedCSSEquivalentStyles(aElement, aProperty,
                                                        aAttribute);
    if (elementHasSpecifiedCSSEquivalentStylesOrError.isErr()) {
      NS_WARNING("CSSEditUtils::HaveSpecifiedCSSEquivalentStyles() failed");
      return elementHasSpecifiedCSSEquivalentStylesOrError.unwrapErr();
    }
    if (elementHasSpecifiedCSSEquivalentStylesOrError.unwrap()) {
      if (nsStyledElement* styledElement =
              nsStyledElement::FromNode(&aElement)) {
        // If aElement has CSS declaration of the given style, remove it.
        // MOZ_KnownLive(*styledElement): It's aElement and its lifetime must be
        // guaranteed by the caller because of MOZ_CAN_RUN_SCRIPT method.
@@ -1330,7 +1360,8 @@ nsresult HTMLEditor::RemoveStyleInside(Element& aElement, nsAtom* aProperty,
      // and it does not have non-empty `style`, `id` nor `class` attribute.
      if (aElement.IsAnyOfHTMLElements(nsGkAtoms::span, nsGkAtoms::font) &&
          !HTMLEditor::HasStyleOrIdOrClassAttribute(aElement)) {
      DebugOnly<nsresult> rvIgnored = RemoveContainerWithTransaction(aElement);
        DebugOnly<nsresult> rvIgnored =
            RemoveContainerWithTransaction(aElement);
        if (NS_WARN_IF(Destroyed())) {
          return NS_ERROR_EDITOR_DESTROYED;
        }
@@ -1339,6 +1370,7 @@ nsresult HTMLEditor::RemoveStyleInside(Element& aElement, nsAtom* aProperty,
            "HTMLEditor::RemoveContainerWithTransaction() failed, but ignored");
      }
    }
  }

  // Finally, remove aElement if it's a `<big>` or `<small>` element and
  // we're removing `<font size>`.
@@ -1576,13 +1608,18 @@ nsresult HTMLEditor::GetInlinePropertyBase(nsAtom& aHTMLProperty,
        if (aValue) {
          tOutString.Assign(*aValue);
        }
        *aFirst = *aAny = *aAll =
            CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet(
        Result<bool, nsresult> isComputedCSSEquivalentToHTMLInlineStyleOrError =
            mCSSEditUtils->IsComputedCSSEquivalentToHTMLInlineStyleSet(
                MOZ_KnownLive(*collapsedNode->AsContent()), &aHTMLProperty,
                aAttribute, tOutString);
        if (NS_WARN_IF(Destroyed())) {
          return NS_ERROR_EDITOR_DESTROYED;
        if (isComputedCSSEquivalentToHTMLInlineStyleOrError.isErr()) {
          NS_WARNING(
              "CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet() "
              "failed");
          return isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrapErr();
        }
        *aFirst = *aAny = *aAll =
            isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrap();
        if (outValue) {
          outValue->Assign(tOutString);
        }
@@ -1650,11 +1687,17 @@ nsresult HTMLEditor::GetInlinePropertyBase(nsAtom& aHTMLProperty,
          if (aValue) {
            firstValue.Assign(*aValue);
          }
          isSet = CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet(
          Result<bool, nsresult>
              isComputedCSSEquivalentToHTMLInlineStyleOrError =
                  mCSSEditUtils->IsComputedCSSEquivalentToHTMLInlineStyleSet(
                      *content, &aHTMLProperty, aAttribute, firstValue);
          if (NS_WARN_IF(Destroyed())) {
            return NS_ERROR_EDITOR_DESTROYED;
          if (isComputedCSSEquivalentToHTMLInlineStyleOrError.isErr()) {
            NS_WARNING(
                "CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet() "
                "failed");
            return isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrapErr();
          }
          isSet = isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrap();
        } else {
          isSet = HTMLEditUtils::IsInlineStyleSetByElement(
              *content, aHTMLProperty, aAttribute, aValue, &firstValue);
@@ -1673,11 +1716,17 @@ nsresult HTMLEditor::GetInlinePropertyBase(nsAtom& aHTMLProperty,
          if (aValue) {
            theValue.Assign(*aValue);
          }
          isSet = CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet(
          Result<bool, nsresult>
              isComputedCSSEquivalentToHTMLInlineStyleOrError =
                  mCSSEditUtils->IsComputedCSSEquivalentToHTMLInlineStyleSet(
                      *content, &aHTMLProperty, aAttribute, theValue);
          if (NS_WARN_IF(Destroyed())) {
            return NS_ERROR_EDITOR_DESTROYED;
          if (isComputedCSSEquivalentToHTMLInlineStyleOrError.isErr()) {
            NS_WARNING(
                "CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet() "
                "failed");
            return isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrapErr();
          }
          isSet = isComputedCSSEquivalentToHTMLInlineStyleOrError.unwrap();
        } else {
          isSet = HTMLEditUtils::IsInlineStyleSetByElement(
              *content, aHTMLProperty, aAttribute, aValue, &theValue);
@@ -2109,13 +2158,17 @@ nsresult HTMLEditor::RemoveInlinePropertyInternal(
            }
          }

          bool isRemovable = IsRemovableParentStyleWithNewSpanElement(
          Result<bool, nsresult> isRemovableParentStyleOrError =
              IsRemovableParentStyleWithNewSpanElement(
                  MOZ_KnownLive(content), MOZ_KnownLive(style.mProperty),
                  MOZ_KnownLive(style.mAttribute));
          if (NS_WARN_IF(Destroyed())) {
            return NS_ERROR_EDITOR_DESTROYED;
          if (isRemovableParentStyleOrError.isErr()) {
            NS_WARNING(
                "HTMLEditor::IsRemovableParentStyleWithNewSpanElement() "
                "failed");
            return isRemovableParentStyleOrError.unwrapErr();
          }
          if (!isRemovable) {
          if (!isRemovableParentStyleOrError.unwrap()) {
            continue;
          }

@@ -2175,13 +2228,17 @@ nsresult HTMLEditor::RemoveInlinePropertyInternal(
            }
          }
          for (OwningNonNull<Text>& textNode : leafTextNodes) {
            bool isRemovable = IsRemovableParentStyleWithNewSpanElement(
            Result<bool, nsresult> isRemovableParentStyleOrError =
                IsRemovableParentStyleWithNewSpanElement(
                    MOZ_KnownLive(textNode), MOZ_KnownLive(style.mProperty),
                    MOZ_KnownLive(style.mAttribute));
            if (NS_WARN_IF(Destroyed())) {
              return NS_ERROR_EDITOR_DESTROYED;
            if (isRemovableParentStyleOrError.isErr()) {
              NS_WARNING(
                  "HTMLEditor::IsRemovableParentStyleWithNewSpanElement() "
                  "failed");
              return isRemovableParentStyleOrError.unwrapErr();
            }
            if (!isRemovable) {
            if (!isRemovableParentStyleOrError.unwrap()) {
              continue;
            }
            // MOZ_KnownLive because 'leafTextNodes' is guaranteed to
@@ -2207,7 +2264,7 @@ nsresult HTMLEditor::RemoveInlinePropertyInternal(
  return NS_WARN_IF(Destroyed()) ? NS_ERROR_EDITOR_DESTROYED : NS_OK;
}

bool HTMLEditor::IsRemovableParentStyleWithNewSpanElement(
Result<bool, nsresult> HTMLEditor::IsRemovableParentStyleWithNewSpanElement(
    nsIContent& aContent, nsAtom* aHTMLProperty, nsAtom* aAttribute) const {
  // We don't support to remove all inline styles with this path.
  if (!aHTMLProperty) {
@@ -2233,9 +2290,14 @@ bool HTMLEditor::IsRemovableParentStyleWithNewSpanElement(
  // assume it comes from a rule and let's try to insert a span
  // "inverting" the style
  nsAutoString emptyString;
  bool isSet = CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet(
  Result<bool, nsresult> isComputedCSSEquivalentToHTMLInlineStyleOrError =
      mCSSEditUtils->IsComputedCSSEquivalentToHTMLInlineStyleSet(
          aContent, aHTMLProperty, aAttribute, emptyString);
  return NS_WARN_IF(Destroyed()) ? false : isSet;
  NS_WARNING_ASSERTION(
      isComputedCSSEquivalentToHTMLInlineStyleOrError.isOk(),
      "CSSEditUtils::IsComputedCSSEquivalentToHTMLInlineStyleSet() "
      "failed");
  return isComputedCSSEquivalentToHTMLInlineStyleOrError;
}

void HTMLEditor::CollectEditableLeafTextNodes(