Commit 065fdfb4 authored by Tamas Szentpeteri's avatar Tamas Szentpeteri
Browse files

Backed out 2 changesets (bug 1890428) for causing wpt failures on...

Backed out 2 changesets (bug 1890428) for causing wpt failures on idlharness.https.html. CLOSED TREE

Backed out changeset 1954ce9669b8 (bug 1890428)
Backed out changeset 3e45e3d15eed (bug 1890428)
parent 276dbf52
Loading
Loading
Loading
Loading
+3 −17
Original line number Diff line number Diff line
@@ -1286,14 +1286,12 @@ already_AddRefed<ShadowRoot> Element::AttachShadow(const ShadowRootInit& aInit,

  return AttachShadowWithoutNameChecks(
      aInit.mMode, DelegatesFocus(aInit.mDelegatesFocus), aInit.mSlotAssignment,
      ShadowRootClonable(aInit.mClonable),
      ShadowRootSerializable(aInit.mSerializable));
      ShadowRootClonable(aInit.mClonable));
}

already_AddRefed<ShadowRoot> Element::AttachShadowWithoutNameChecks(
    ShadowRootMode aMode, DelegatesFocus aDelegatesFocus,
    SlotAssignmentMode aSlotAssignment, ShadowRootClonable aClonable,
    ShadowRootSerializable aSerializable) {
    SlotAssignmentMode aSlotAssignment, ShadowRootClonable aClonable) {
  nsAutoScriptBlocker scriptBlocker;

  auto* nim = mNodeInfo->NodeInfoManager();
@@ -1319,7 +1317,7 @@ already_AddRefed<ShadowRoot> Element::AttachShadowWithoutNameChecks(
   */
  RefPtr<ShadowRoot> shadowRoot = new (nim)
      ShadowRoot(this, aMode, aDelegatesFocus, aSlotAssignment, aClonable,
                 aSerializable, ShadowRootDeclarative::No, nodeInfo.forget());
                 ShadowRootDeclarative::No, nodeInfo.forget());

  if (NodeOrAncestorHasDirAuto()) {
    shadowRoot->SetAncestorHasDirAuto();
@@ -5063,18 +5061,6 @@ void Element::SetHTML(const nsAString& aInnerHTML,
                                                     oldChildCount);
}

void Element::GetHTML(const GetHTMLOptions& aOptions, nsAString& aResult) {
  if (aOptions.mSerializableShadowRoots || !aOptions.mShadowRoots.IsEmpty()) {
    nsContentUtils::SerializeNodeToMarkup<SerializeShadowRoots::Yes>(
        this, true, aResult, aOptions.mSerializableShadowRoots,
        aOptions.mShadowRoots);
  } else {
    nsContentUtils::SerializeNodeToMarkup<SerializeShadowRoots::No>(
        this, true, aResult, aOptions.mSerializableShadowRoots,
        aOptions.mShadowRoots);
  }
}

bool Element::Translate() const {
  if (const auto* parent = Element::FromNodeOrNull(mParent)) {
    return parent->Translate();
+1 −5
Original line number Diff line number Diff line
@@ -120,7 +120,6 @@ namespace dom {
struct CheckVisibilityOptions;
struct CustomElementData;
struct SetHTMLOptions;
struct GetHTMLOptions;
struct GetAnimationsOptions;
struct ScrollIntoViewOptions;
struct ScrollToOptions;
@@ -1360,13 +1359,11 @@ class Element : public FragmentOrElement {

  enum class DelegatesFocus : bool { No, Yes };
  enum class ShadowRootClonable : bool { No, Yes };
  enum class ShadowRootSerializable : bool { No, Yes };

  already_AddRefed<ShadowRoot> AttachShadowWithoutNameChecks(
      ShadowRootMode aMode, DelegatesFocus = DelegatesFocus::No,
      SlotAssignmentMode aSlotAssignmentMode = SlotAssignmentMode::Named,
      ShadowRootClonable aClonable = ShadowRootClonable::No,
      ShadowRootSerializable aSerializable = ShadowRootSerializable::No);
      ShadowRootClonable aClonable = ShadowRootClonable::No);

  // Attach UA Shadow Root if it is not attached.
  enum class NotifyUAWidgetSetup : bool { No, Yes };
@@ -1546,7 +1543,6 @@ class Element : public FragmentOrElement {

  void SetHTML(const nsAString& aInnerHTML, const SetHTMLOptions& aOptions,
               ErrorResult& aError);
  void GetHTML(const GetHTMLOptions& aOptions, nsAString& aResult);

  //----------------------------------------

+1 −2
Original line number Diff line number Diff line
@@ -1870,8 +1870,7 @@ void FragmentOrElement::GetMarkup(bool aIncludeSelf, nsAString& aMarkup) {

  Document* doc = OwnerDoc();
  if (IsInHTMLDocument()) {
    nsContentUtils::SerializeNodeToMarkup(this, !aIncludeSelf, aMarkup, false,
                                          {});
    nsContentUtils::SerializeNodeToMarkup(this, !aIncludeSelf, aMarkup);
    return;
  }

+2 −11
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@
#include "nsWindowSizes.h"
#include "mozilla/dom/DirectionalityUtils.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/ElementBinding.h"
#include "mozilla/dom/HTMLDetailsElement.h"
#include "mozilla/dom/HTMLSlotElement.h"
#include "mozilla/dom/HTMLSummaryElement.h"
@@ -53,8 +52,7 @@ NS_IMPL_RELEASE_INHERITED(ShadowRoot, DocumentFragment)
ShadowRoot::ShadowRoot(Element* aElement, ShadowRootMode aMode,
                       Element::DelegatesFocus aDelegatesFocus,
                       SlotAssignmentMode aSlotAssignment,
                       IsClonable aIsClonable, IsSerializable aIsSerializable,
                       Declarative aDeclarative,
                       IsClonable aIsClonable, Declarative aDeclarative,
                       already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
    : DocumentFragment(std::move(aNodeInfo)),
      DocumentOrShadowRoot(this),
@@ -64,8 +62,7 @@ ShadowRoot::ShadowRoot(Element* aElement, ShadowRootMode aMode,
      mIsDetailsShadowTree(aElement->IsHTMLElement(nsGkAtoms::details)),
      mIsAvailableToElementInternals(false),
      mIsDeclarative(aDeclarative),
      mIsClonable(aIsClonable),
      mIsSerializable(aIsSerializable) {
      mIsClonable(aIsClonable) {
  // nsINode.h relies on this.
  MOZ_ASSERT(static_cast<nsINode*>(this) == reinterpret_cast<nsINode*>(this));
  MOZ_ASSERT(static_cast<nsIContent*>(this) ==
@@ -888,9 +885,3 @@ void ShadowRoot::SetHTMLUnsafe(const nsAString& aHTML) {
  RefPtr<Element> host = GetHost();
  nsContentUtils::SetHTMLUnsafe(this, host, aHTML);
}

void ShadowRoot::GetHTML(const GetHTMLOptions& aOptions, nsAString& aResult) {
  nsContentUtils::SerializeNodeToMarkup<SerializeShadowRoots::Yes>(
      this, true, aResult, aOptions.mSerializableShadowRoots,
      aOptions.mShadowRoots);
}
+1 −8
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ class ShadowRoot final : public DocumentFragment, public DocumentOrShadowRoot {

  using Declarative = Element::ShadowRootDeclarative;
  using IsClonable = Element::ShadowRootClonable;
  using IsSerializable = Element::ShadowRootSerializable;

 public:
  NS_IMPL_FROMNODE_HELPER(ShadowRoot, IsShadowRoot());
@@ -55,7 +54,7 @@ class ShadowRoot final : public DocumentFragment, public DocumentOrShadowRoot {
  ShadowRoot(Element* aElement, ShadowRootMode aMode,
             Element::DelegatesFocus aDelegatesFocus,
             SlotAssignmentMode aSlotAssignment, IsClonable aClonable,
             IsSerializable aIsSerializable, Declarative aDeclarative,
             Declarative aDeclarative,
             already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);

  void AddSizeOfExcludingThis(nsWindowSizes&, size_t* aNodeSize) const final;
@@ -84,7 +83,6 @@ class ShadowRoot final : public DocumentFragment, public DocumentOrShadowRoot {
  SlotAssignmentMode SlotAssignment() const { return mSlotAssignment; }
  bool Clonable() const { return mIsClonable == IsClonable::Yes; }
  bool IsClosed() const { return mMode == ShadowRootMode::Closed; }
  bool Serializable() const { return mIsSerializable == IsSerializable::Yes; }

  void RemoveSheetFromStyles(StyleSheet&);
  void RuleAdded(StyleSheet&, css::Rule&);
@@ -249,8 +247,6 @@ class ShadowRoot final : public DocumentFragment, public DocumentOrShadowRoot {
  MOZ_CAN_RUN_SCRIPT
  void SetHTMLUnsafe(const nsAString& aHTML);

  void GetHTML(const GetHTMLOptions& aOptions, nsAString& aResult);

 protected:
  // FIXME(emilio): This will need to become more fine-grained.
  void ApplicableRulesChanged();
@@ -294,9 +290,6 @@ class ShadowRoot final : public DocumentFragment, public DocumentOrShadowRoot {
  // https://dom.spec.whatwg.org/#shadowroot-clonable
  const IsClonable mIsClonable;

  // https://dom.spec.whatwg.org/#shadowroot-serializable
  const IsSerializable mIsSerializable;

  nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
};

Loading