Backed out changeset ef991fe893a4 (bug 1281135) for failures in browser_bug839103.js
authorNoemi Erli <nerli@mozilla.com>
Fri, 19 Apr 2019 09:18:03 +0300
changeset 470175 0ca59c12ed2a1c6d5aec3cd06b274a18cfab26e8
parent 470174 0fc9a9b3d76b963f858b87f151cbff584f83d117
child 470176 c263feabee1dd5eafa9cbea373e451cb5b9cbf3a
push id112843
push useraiakab@mozilla.com
push dateFri, 19 Apr 2019 09:50:22 +0000
treeherdermozilla-inbound@c06f27cbfe40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1281135, 839103
milestone68.0a1
backs outef991fe893a435f4416bde5f518135655a9740e1
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 ef991fe893a4 (bug 1281135) for failures in browser_bug839103.js
dom/base/nsContentSink.cpp
dom/base/nsIStyleSheetLinkingElement.h
dom/base/nsStyleLinkElement.cpp
dom/html/HTMLLinkElement.cpp
dom/html/HTMLLinkElement.h
dom/html/HTMLStyleElement.cpp
dom/html/HTMLStyleElement.h
dom/svg/SVGStyleElement.cpp
dom/webidl/HTMLLinkElement.webidl
dom/xml/XMLStylesheetProcessingInstruction.cpp
layout/reftests/bugs/360746-1.html
layout/style/Loader.cpp
layout/style/Loader.h
modules/libpref/init/StaticPrefList.h
testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-001.tentative.html
testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-002.tentative.html
testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-003.tentative.html
testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-004.tentative.html
testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-005.tentative.html
testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-006.tentative.html
testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-007.tentative.html
testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-alternate-ref.html
testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-alternate.tentative.html
--- a/dom/base/nsContentSink.cpp
+++ b/dom/base/nsContentSink.cpp
@@ -753,17 +753,16 @@ nsresult nsContentSink::ProcessStyleLink
       url.forget(),
       nullptr,
       net::AttributeReferrerPolicyFromString(aReferrerPolicy),
       CORS_NONE,
       aTitle,
       aMedia,
       aAlternate ? Loader::HasAlternateRel::Yes : Loader::HasAlternateRel::No,
       Loader::IsInline::No,
-      Loader::IsExplicitlyEnabled::No,
   };
 
   auto loadResultOrErr =
       mCSSLoader->LoadStyleLink(info, mRunsToCompletion ? nullptr : this);
   if (loadResultOrErr.isErr()) {
     return loadResultOrErr.unwrapErr();
   }
 
--- a/dom/base/nsIStyleSheetLinkingElement.h
+++ b/dom/base/nsIStyleSheetLinkingElement.h
@@ -19,47 +19,36 @@ class nsIURI;
   {                                                  \
     0xa8b79f3b, 0x9d18, 0x4f9c, {                    \
       0xb1, 0xaa, 0x8c, 0x9b, 0x1b, 0xaa, 0xac, 0xad \
     }                                                \
   }
 
 class nsIStyleSheetLinkingElement : public nsISupports {
  public:
-  enum class ForceUpdate : uint8_t {
+  enum class ForceUpdate {
+    Yes,
     No,
-    Yes,
   };
 
-  enum class Completed : uint8_t {
-    No,
+  enum class Completed {
     Yes,
-  };
-
-  enum class HasAlternateRel : uint8_t {
     No,
-    Yes,
   };
 
-  enum class IsAlternate : uint8_t {
+  enum class HasAlternateRel { Yes, No };
+
+  enum class IsAlternate {
+    Yes,
     No,
-    Yes,
   };
 
-  enum class IsInline : uint8_t {
-    No,
-    Yes,
-  };
+  enum class IsInline { Yes, No };
 
-  enum class IsExplicitlyEnabled : uint8_t {
-    No,
-    Yes,
-  };
-
-  enum class MediaMatched : uint8_t {
+  enum class MediaMatched {
     Yes,
     No,
   };
 
   struct Update {
    private:
     bool mWillNotify;
     bool mIsAlternate;
@@ -96,24 +85,24 @@ class nsIStyleSheetLinkingElement : publ
     mozilla::net::ReferrerPolicy mReferrerPolicy;
     mozilla::CORSMode mCORSMode;
     nsString mTitle;
     nsString mMedia;
     nsString mIntegrity;
 
     bool mHasAlternateRel;
     bool mIsInline;
-    IsExplicitlyEnabled mIsExplicitlyEnabled;
 
     SheetInfo(const mozilla::dom::Document&, nsIContent*,
               already_AddRefed<nsIURI> aURI,
               already_AddRefed<nsIPrincipal> aTriggeringPrincipal,
-              mozilla::net::ReferrerPolicy aReferrerPolicy, mozilla::CORSMode,
-              const nsAString& aTitle, const nsAString& aMedia, HasAlternateRel,
-              IsInline, IsExplicitlyEnabled);
+              mozilla::net::ReferrerPolicy aReferrerPolicy,
+              mozilla::CORSMode aCORSMode, const nsAString& aTitle,
+              const nsAString& aMedia, HasAlternateRel aHasAlternateRel,
+              IsInline aIsInline);
 
     ~SheetInfo();
   };
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTYLESHEETLINKINGELEMENT_IID)
 
   /**
    * Used to make the association between a style sheet and
--- a/dom/base/nsStyleLinkElement.cpp
+++ b/dom/base/nsStyleLinkElement.cpp
@@ -35,28 +35,26 @@ using namespace mozilla;
 using namespace mozilla::dom;
 
 nsStyleLinkElement::SheetInfo::SheetInfo(
     const Document& aDocument, nsIContent* aContent,
     already_AddRefed<nsIURI> aURI,
     already_AddRefed<nsIPrincipal> aTriggeringPrincipal,
     mozilla::net::ReferrerPolicy aReferrerPolicy, mozilla::CORSMode aCORSMode,
     const nsAString& aTitle, const nsAString& aMedia,
-    HasAlternateRel aHasAlternateRel, IsInline aIsInline,
-    IsExplicitlyEnabled aIsExplicitlyEnabled)
+    HasAlternateRel aHasAlternateRel, IsInline aIsInline)
     : mContent(aContent),
       mURI(aURI),
       mTriggeringPrincipal(aTriggeringPrincipal),
       mReferrerPolicy(aReferrerPolicy),
       mCORSMode(aCORSMode),
       mTitle(aTitle),
       mMedia(aMedia),
       mHasAlternateRel(aHasAlternateRel == HasAlternateRel::Yes),
-      mIsInline(aIsInline == IsInline::Yes),
-      mIsExplicitlyEnabled(aIsExplicitlyEnabled) {
+      mIsInline(aIsInline == IsInline::Yes) {
   MOZ_ASSERT(!mIsInline || aContent);
   MOZ_ASSERT_IF(aContent, aContent->OwnerDoc() == &aDocument);
 
   if (mReferrerPolicy == net::ReferrerPolicy::RP_Unset) {
     mReferrerPolicy = aDocument.GetReferrerPolicy();
   }
 
   if (!mIsInline && aContent && aContent->IsElement()) {
--- a/dom/html/HTMLLinkElement.cpp
+++ b/dom/html/HTMLLinkElement.cpp
@@ -80,28 +80,22 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_IN
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(HTMLLinkElement,
                                              nsGenericHTMLElement,
                                              nsIStyleSheetLinkingElement, Link)
 
 NS_IMPL_ELEMENT_CLONE(HTMLLinkElement)
 
-bool HTMLLinkElement::Disabled() const {
-  if (StaticPrefs::dom_link_disabled_attribute_enabled()) {
-    return GetBoolAttr(nsGkAtoms::disabled);
-  }
+bool HTMLLinkElement::Disabled() {
   StyleSheet* ss = GetSheet();
   return ss && ss->Disabled();
 }
 
-void HTMLLinkElement::SetDisabled(bool aDisabled, ErrorResult& aRv) {
-  if (StaticPrefs::dom_link_disabled_attribute_enabled()) {
-    return SetHTMLBoolAttr(nsGkAtoms::disabled, aDisabled, aRv);
-  }
+void HTMLLinkElement::SetDisabled(bool aDisabled) {
   if (StyleSheet* ss = GetSheet()) {
     ss->SetDisabled(aDisabled);
   }
 }
 
 void HTMLLinkElement::OnDNSPrefetchRequested() {
   UnsetFlags(HTML_LINK_DNS_PREFETCH_DEFERRED);
   SetFlags(HTML_LINK_DNS_PREFETCH_REQUESTED);
@@ -315,19 +309,17 @@ nsresult HTMLLinkElement::AfterSetAttr(i
     }
   }
 
   if (aValue) {
     if (aNameSpaceID == kNameSpaceID_None &&
         (aName == nsGkAtoms::href || aName == nsGkAtoms::rel ||
          aName == nsGkAtoms::title || aName == nsGkAtoms::media ||
          aName == nsGkAtoms::type || aName == nsGkAtoms::as ||
-         aName == nsGkAtoms::crossorigin ||
-         (aName == nsGkAtoms::disabled &&
-          StaticPrefs::dom_link_disabled_attribute_enabled()))) {
+         aName == nsGkAtoms::crossorigin)) {
       bool dropSheet = false;
       if (aName == nsGkAtoms::rel) {
         nsAutoString value;
         aValue->ToString(value);
         uint32_t linkTypes = nsStyleLinkElement::ParseLinkTypes(value);
         if (GetSheet()) {
           dropSheet = !(linkTypes & nsStyleLinkElement::eSTYLESHEET);
         }
@@ -341,35 +333,28 @@ nsresult HTMLLinkElement::AfterSetAttr(i
       if ((aName == nsGkAtoms::as || aName == nsGkAtoms::type ||
            aName == nsGkAtoms::crossorigin || aName == nsGkAtoms::media) &&
           IsInComposedDoc()) {
         UpdatePreload(aName, aValue, aOldValue);
       }
 
       const bool forceUpdate = dropSheet || aName == nsGkAtoms::title ||
                                aName == nsGkAtoms::media ||
-                               aName == nsGkAtoms::type ||
-                               aName == nsGkAtoms::disabled;
+                               aName == nsGkAtoms::type;
 
       Unused << UpdateStyleSheetInternal(
           nullptr, nullptr, forceUpdate ? ForceUpdate::Yes : ForceUpdate::No);
     }
   } else {
+    // Since removing href or rel makes us no longer link to a
+    // stylesheet, force updates for those too.
     if (aNameSpaceID == kNameSpaceID_None) {
-      if (aName == nsGkAtoms::disabled &&
-          StaticPrefs::dom_link_disabled_attribute_enabled()) {
-        mExplicitlyEnabled = true;
-      }
-      // Since removing href or rel makes us no longer link to a stylesheet,
-      // force updates for those too.
       if (aName == nsGkAtoms::href || aName == nsGkAtoms::rel ||
           aName == nsGkAtoms::title || aName == nsGkAtoms::media ||
-          aName == nsGkAtoms::type ||
-          (aName == nsGkAtoms::disabled &&
-           StaticPrefs::dom_link_disabled_attribute_enabled())) {
+          aName == nsGkAtoms::type) {
         Unused << UpdateStyleSheetInternal(nullptr, nullptr, ForceUpdate::Yes);
       }
       if ((aName == nsGkAtoms::as || aName == nsGkAtoms::type ||
            aName == nsGkAtoms::crossorigin || aName == nsGkAtoms::media) &&
           IsInComposedDoc()) {
         UpdatePreload(aName, aValue, aOldValue);
       }
     }
@@ -425,20 +410,16 @@ Maybe<nsStyleLinkElement::SheetInfo> HTM
   if (!(linkTypes & nsStyleLinkElement::eSTYLESHEET)) {
     return Nothing();
   }
 
   if (!IsCSSMimeTypeAttribute(*this)) {
     return Nothing();
   }
 
-  if (StaticPrefs::dom_link_disabled_attribute_enabled() && Disabled()) {
-    return Nothing();
-  }
-
   nsAutoString title;
   nsAutoString media;
   GetTitleAndMediaForElement(*this, title, media);
 
   bool alternate = linkTypes & nsStyleLinkElement::eALTERNATE;
   if (alternate && title.IsEmpty()) {
     // alternates must have title.
     return Nothing();
@@ -458,17 +439,16 @@ Maybe<nsStyleLinkElement::SheetInfo> HTM
       uri.forget(),
       prin.forget(),
       GetReferrerPolicyAsEnum(),
       GetCORSMode(),
       title,
       media,
       alternate ? HasAlternateRel::Yes : HasAlternateRel::No,
       IsInline::No,
-      mExplicitlyEnabled ? IsExplicitlyEnabled::Yes : IsExplicitlyEnabled::No,
   });
 }
 
 EventStates HTMLLinkElement::IntrinsicState() const {
   return Link::LinkState() | nsGenericHTMLElement::IntrinsicState();
 }
 
 void HTMLLinkElement::AddSizeOfExcludingThis(nsWindowSizes& aSizes,
--- a/dom/html/HTMLLinkElement.h
+++ b/dom/html/HTMLLinkElement.h
@@ -73,18 +73,18 @@ class HTMLLinkElement final : public nsG
 
   void CreateAndDispatchEvent(Document* aDoc, const nsAString& aEventName);
 
   virtual void OnDNSPrefetchDeferred() override;
   virtual void OnDNSPrefetchRequested() override;
   virtual bool HasDeferredDNSPrefetchRequest() override;
 
   // WebIDL
-  bool Disabled() const;
-  void SetDisabled(bool aDisabled, ErrorResult& aRv);
+  bool Disabled();
+  void SetDisabled(bool aDisabled);
 
   void GetHref(nsAString& aValue) {
     GetURIAttr(nsGkAtoms::href, nullptr, aValue);
   }
   void SetHref(const nsAString& aHref, nsIPrincipal* aTriggeringPrincipal,
                ErrorResult& aRv) {
     SetHTMLAttr(nsGkAtoms::href, aHref, aTriggeringPrincipal, aRv);
   }
@@ -165,22 +165,16 @@ class HTMLLinkElement final : public nsG
                                 const nsAString& aMedia, Document* aDocument);
 
  protected:
   virtual ~HTMLLinkElement();
 
   // nsStyleLinkElement
   Maybe<SheetInfo> GetStyleSheetInfo() final;
 
+ protected:
   RefPtr<nsDOMTokenList> mRelList;
-
-  // The "explicitly enabled" flag. This flag is set whenever the `disabled`
-  // attribute is explicitly unset, and makes alternate stylesheets not be
-  // disabled by default anymore.
-  //
-  // See https://github.com/whatwg/html/issues/3840#issuecomment-481034206.
-  bool mExplicitlyEnabled = false;
 };
 
 }  // namespace dom
 }  // namespace mozilla
 
 #endif  // mozilla_dom_HTMLLinkElement_h
--- a/dom/html/HTMLStyleElement.cpp
+++ b/dom/html/HTMLStyleElement.cpp
@@ -40,17 +40,17 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(HTMLStyleElement,
                                              nsGenericHTMLElement,
                                              nsIStyleSheetLinkingElement,
                                              nsIMutationObserver)
 
 NS_IMPL_ELEMENT_CLONE(HTMLStyleElement)
 
-bool HTMLStyleElement::Disabled() const {
+bool HTMLStyleElement::Disabled() {
   StyleSheet* ss = GetSheet();
   return ss && ss->Disabled();
 }
 
 void HTMLStyleElement::SetDisabled(bool aDisabled) {
   if (StyleSheet* ss = GetSheet()) {
     ss->SetDisabled(aDisabled);
   }
@@ -181,17 +181,16 @@ Maybe<nsStyleLinkElement::SheetInfo> HTM
       nullptr,
       prin.forget(),
       net::ReferrerPolicy::RP_Unset,
       CORS_NONE,
       title,
       media,
       HasAlternateRel::No,
       IsInline::Yes,
-      IsExplicitlyEnabled::No,
   });
 }
 
 JSObject* HTMLStyleElement::WrapNode(JSContext* aCx,
                                      JS::Handle<JSObject*> aGivenProto) {
   return HTMLStyleElement_Binding::Wrap(aCx, this, aGivenProto);
 }
 
--- a/dom/html/HTMLStyleElement.h
+++ b/dom/html/HTMLStyleElement.h
@@ -51,17 +51,17 @@ class HTMLStyleElement final : public ns
   virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
 
   // nsIMutationObserver
   NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
 
-  bool Disabled() const;
+  bool Disabled();
   void SetDisabled(bool aDisabled);
   void GetMedia(nsAString& aValue) { GetHTMLAttr(nsGkAtoms::media, aValue); }
   void SetMedia(const nsAString& aMedia, ErrorResult& aError) {
     SetHTMLAttr(nsGkAtoms::media, aMedia, aError);
   }
   void GetType(nsAString& aValue) { GetHTMLAttr(nsGkAtoms::type, aValue); }
   void SetType(const nsAString& aType, ErrorResult& aError) {
     SetHTMLAttr(nsGkAtoms::type, aType, aError);
--- a/dom/svg/SVGStyleElement.cpp
+++ b/dom/svg/SVGStyleElement.cpp
@@ -192,14 +192,13 @@ Maybe<nsStyleLinkElement::SheetInfo> SVG
       net::ReferrerPolicy::RP_Unset,
       // FIXME(bug 1459822): Why does this need a crossorigin attribute, but
       // HTMLStyleElement doesn't?
       AttrValueToCORSMode(GetParsedAttr(nsGkAtoms::crossorigin)),
       title,
       media,
       HasAlternateRel::No,
       IsInline::Yes,
-      IsExplicitlyEnabled::No,
   });
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/webidl/HTMLLinkElement.webidl
+++ b/dom/webidl/HTMLLinkElement.webidl
@@ -9,17 +9,17 @@
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-link-element
 [HTMLConstructor]
 interface HTMLLinkElement : HTMLElement {
-  [CEReactions, SetterThrows, Pure]
+  [Pure]
            attribute boolean disabled;
   [CEReactions, SetterNeedsSubjectPrincipal=NonSystem, SetterThrows, Pure]
            attribute DOMString href;
   [CEReactions, SetterThrows, Pure]
            attribute DOMString? crossOrigin;
   [CEReactions, SetterThrows, Pure]
            attribute DOMString rel;
   [PutForwards=value]
--- a/dom/xml/XMLStylesheetProcessingInstruction.cpp
+++ b/dom/xml/XMLStylesheetProcessingInstruction.cpp
@@ -132,17 +132,16 @@ XMLStylesheetProcessingInstruction::GetS
       uri.forget(),
       nullptr,
       net::RP_Unset,
       CORS_NONE,
       title,
       media,
       alternate ? HasAlternateRel::Yes : HasAlternateRel::No,
       IsInline::No,
-      IsExplicitlyEnabled::No,
   });
 }
 
 already_AddRefed<CharacterData>
 XMLStylesheetProcessingInstruction::CloneDataNode(
     mozilla::dom::NodeInfo* aNodeInfo, bool aCloneText) const {
   nsAutoString data;
   GetData(data);
--- a/layout/reftests/bugs/360746-1.html
+++ b/layout/reftests/bugs/360746-1.html
@@ -1,28 +1,28 @@
 <html>
   <head>
     <title>Testcase bug 360746 - The right panel has disappeared at andrewdupont.net</title>
     <style>
       div { height: 20px }
       #test1 {
-        background-color: green;
+        background-color: red;
       }
       #test2 {
         background-color: red;
       }
       #test3 {
         background-color: green;
       }
       #test4 {
         background-color: green;
       }
     </style>
     <link href="data:text/css;charset=utf-8," title="narrow" rel="stylesheet" type="text/css" />
-    <link href="data:text/css;charset=utf-8,%23test1%20%7Bbackground-color%3A%20red%3B%7D" title="medium" rel="alternate stylesheet" type="text/css" />
+    <link href="data:text/css;charset=utf-8,%23test1%20%7Bbackground-color%3A%20green%3B%7D" title="medium" rel="alternate stylesheet" type="text/css" />
     <link href="data:text/css;charset=utf-8,%23test2%20%7Bbackground-color%3A%20green%3B%7D" type="text/css" />    
     <link href="data:text/css;charset=utf-8,%23test3%20%7Bbackground-color%3A%20red%3B%7D" rel="stylesheet" type="text/css" />    
     <link href="data:text/css;charset=utf-8,%23test4%20%7Bbackground-color%3A%20red%3B%7D" rel="stylesheet" type="text/css" />    
     <script>
       document.getElementsByTagName('link')[1].disabled = false;
       document.getElementsByTagName('link')[1].rel = 'stylesheet';
     </script>
   </head>
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -1083,35 +1083,35 @@ static Loader::MediaMatched MediaListMat
   return Loader::MediaMatched::No;
 }
 
 /**
  * PrepareSheet() handles setting the media and title on the sheet, as
  * well as setting the enabled state based on the title and whether
  * the sheet had "alternate" in its rel.
  */
-Loader::MediaMatched Loader::PrepareSheet(
-    StyleSheet* aSheet, const nsAString& aTitle, const nsAString& aMediaString,
-    MediaList* aMediaList, IsAlternate aIsAlternate,
-    IsExplicitlyEnabled aIsExplicitlyEnabled) {
+Loader::MediaMatched Loader::PrepareSheet(StyleSheet* aSheet,
+                                          const nsAString& aTitle,
+                                          const nsAString& aMediaString,
+                                          MediaList* aMediaList,
+                                          IsAlternate aIsAlternate) {
   MOZ_ASSERT(aSheet, "Must have a sheet!");
 
   RefPtr<MediaList> mediaList(aMediaList);
 
   if (!aMediaString.IsEmpty()) {
     NS_ASSERTION(!aMediaList,
                  "must not provide both aMediaString and aMediaList");
     mediaList = MediaList::Create(aMediaString);
   }
 
   aSheet->SetMedia(mediaList);
 
   aSheet->SetTitle(aTitle);
-  aSheet->SetEnabled(aIsAlternate == IsAlternate::No ||
-                     aIsExplicitlyEnabled == IsExplicitlyEnabled::Yes);
+  aSheet->SetEnabled(aIsAlternate == IsAlternate::No);
   return MediaListMatches(mediaList, mDocument);
 }
 
 /**
  * InsertSheetInTree handles ordering of sheets in the document or shadow root.
  *
  * Here we have two types of sheets -- those with linking elements and
  * those without.  The latter are loaded by Link: headers, and are only added to
@@ -1830,18 +1830,18 @@ Result<Loader::LoadSheetResult, nsresult
   if (NS_FAILED(rv)) {
     return Err(rv);
   }
   NS_ASSERTION(state == eSheetNeedsParser,
                "Inline sheets should not be cached");
 
   LOG(("  Sheet is alternate: %d", static_cast<int>(isAlternate)));
 
-  auto matched = PrepareSheet(sheet, aInfo.mTitle, aInfo.mMedia, nullptr,
-                              isAlternate, aInfo.mIsExplicitlyEnabled);
+  auto matched =
+      PrepareSheet(sheet, aInfo.mTitle, aInfo.mMedia, nullptr, isAlternate);
 
   InsertSheetInTree(*sheet, aInfo.mContent);
 
   nsIPrincipal* principal = aInfo.mContent->NodePrincipal();
   if (aInfo.mTriggeringPrincipal) {
     // The triggering principal may be an expanded principal, which is safe to
     // use for URL security checks, but not as the loader principal for a
     // stylesheet. So treat this as principal inheritance, and downgrade if
@@ -1935,18 +1935,18 @@ Result<Loader::LoadSheetResult, nsresult
   rv = CreateSheet(aInfo, principal, eAuthorSheetFeatures, syncLoad, state,
                    &sheet);
   if (NS_FAILED(rv)) {
     return Err(rv);
   }
 
   LOG(("  Sheet is alternate: %d", static_cast<int>(isAlternate)));
 
-  auto matched = PrepareSheet(sheet, aInfo.mTitle, aInfo.mMedia, nullptr,
-                              isAlternate, aInfo.mIsExplicitlyEnabled);
+  auto matched =
+      PrepareSheet(sheet, aInfo.mTitle, aInfo.mMedia, nullptr, isAlternate);
 
   InsertSheetInTree(*sheet, aInfo.mContent);
 
   nsCOMPtr<nsIStyleSheetLinkingElement> owningElement(
       do_QueryInterface(aInfo.mContent));
 
   if (state == eSheetComplete) {
     LOG(("  Sheet already complete: 0x%p", sheet.get()));
@@ -2102,18 +2102,17 @@ nsresult Loader::LoadChildSheet(StyleShe
     // For now, use CORS_NONE for child sheets
     rv = CreateSheet(aURL, nullptr, principal, aParentSheet->ParsingMode(),
                      CORS_NONE, aParentSheet->GetReferrerPolicy(),
                      EmptyString(),  // integrity is only checked on main sheet
                      aParentData ? aParentData->mSyncLoad : false, state,
                      &sheet);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    PrepareSheet(sheet, empty, empty, aMedia, IsAlternate::No,
-                 IsExplicitlyEnabled::No);
+    PrepareSheet(sheet, empty, empty, aMedia, IsAlternate::No);
   }
 
   MOZ_ASSERT(sheet);
   InsertChildSheet(*sheet, *aParentSheet);
 
   if (state == eSheetComplete) {
     LOG(("  Sheet already complete"));
     // We're completely done.  No need to notify, even, since the
@@ -2214,18 +2213,17 @@ nsresult Loader::InternalLoadNonDocument
   StyleSheetState state;
   RefPtr<StyleSheet> sheet;
   bool syncLoad = (aObserver == nullptr);
   const nsAString& empty = EmptyString();
   rv = CreateSheet(aURL, nullptr, aOriginPrincipal, aParsingMode, aCORSMode,
                    aReferrerPolicy, aIntegrity, syncLoad, state, &sheet);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  PrepareSheet(sheet, empty, empty, nullptr, IsAlternate::No,
-               IsExplicitlyEnabled::No);
+  PrepareSheet(sheet, empty, empty, nullptr, IsAlternate::No);
 
   if (state == eSheetComplete) {
     LOG(("  Sheet already complete"));
     if (aObserver || !mObservers.IsEmpty()) {
       rv = PostLoadEvent(aURL, sheet, aObserver, IsAlternate::No,
                          MediaMatched::Yes, nullptr);
     }
     if (aSheet) {
--- a/layout/style/Loader.h
+++ b/layout/style/Loader.h
@@ -194,17 +194,16 @@ enum StyleSheetState {
 class Loader final {
   typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
 
  public:
   typedef nsIStyleSheetLinkingElement::Completed Completed;
   typedef nsIStyleSheetLinkingElement::HasAlternateRel HasAlternateRel;
   typedef nsIStyleSheetLinkingElement::IsAlternate IsAlternate;
   typedef nsIStyleSheetLinkingElement::IsInline IsInline;
-  typedef nsIStyleSheetLinkingElement::IsExplicitlyEnabled IsExplicitlyEnabled;
   typedef nsIStyleSheetLinkingElement::MediaMatched MediaMatched;
   typedef nsIStyleSheetLinkingElement::Update LoadSheetResult;
   typedef nsIStyleSheetLinkingElement::SheetInfo SheetInfo;
 
   Loader();
   // aDocGroup is used for dispatching SheetLoadData in PostLoadEvent(). It
   // can be null if you want to use this constructor, and there's no
   // document when the Loader is constructed.
@@ -476,18 +475,18 @@ class Loader final {
                        StyleSheetState& aSheetState,
                        RefPtr<StyleSheet>* aSheet);
 
   // Pass in either a media string or the MediaList from the CSSParser.  Don't
   // pass both.
   //
   // This method will set the sheet's enabled state based on aIsAlternate
   MediaMatched PrepareSheet(StyleSheet* aSheet, const nsAString& aTitle,
-                            const nsAString& aMediaString, dom::MediaList*,
-                            IsAlternate, IsExplicitlyEnabled);
+                            const nsAString& aMediaString,
+                            dom::MediaList* aMediaList, IsAlternate);
 
   // Inserts a style sheet in a document or a ShadowRoot.
   void InsertSheetInTree(StyleSheet& aSheet, nsIContent* aLinkingContent);
   // Inserts a style sheet into a parent style sheet.
   void InsertChildSheet(StyleSheet& aSheet, StyleSheet& aParentSheet);
 
   nsresult InternalLoadNonDocumentSheet(
       nsIURI* aURL, bool aIsPreload, SheetParsingMode aParsingMode,
--- a/modules/libpref/init/StaticPrefList.h
+++ b/modules/libpref/init/StaticPrefList.h
@@ -248,28 +248,16 @@ VARCACHE_PREF(
 // NOTE: This preference is used in unit tests. If it is removed or its default
 // value changes, please update test_sharedMap_var_caches.js accordingly.
 VARCACHE_PREF(
   "dom.mutation-events.cssom.disabled",
    dom_mutation_events_cssom_disabled,
   bool, true
 )
 
-// Whether the disabled attribute in HTMLLinkElement disables the sheet loading
-// altogether, or forwards to the inner stylesheet method without attribute
-// reflection.
-//
-// Historical behavior is the second, the first is being discussed at:
-// https://github.com/whatwg/html/issues/3840
-VARCACHE_PREF(
-  "dom.link.disabled_attribute.enabled",
-   dom_link_disabled_attribute_enabled,
-  bool, true
-)
-
 VARCACHE_PREF(
   "dom.performance.enable_scheduler_timing",
   dom_performance_enable_scheduler_timing,
   RelaxedAtomicBool, true
 )
 
 // Should we defer timeouts and intervals while loading a page.  Released
 // on Idle or when the page is loaded.
deleted file mode 100644
--- a/testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-001.tentative.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!doctype html>
-<title>&lt;link disabled&gt;, HTMLLinkElement.disabled and CSSStyleSheet.disabled interactions</title>
-<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
-<link rel="author" title="Mozilla" href="https://mozilla.org">
-<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1281135">
-<link rel="help" href="https://github.com/whatwg/html/issues/3840">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<link title="alt" rel="stylesheet" disabled href="data:text/css,html { background: green }">
-<script>
-function assert_applies(applies) {
-  (applies ? assert_equals : assert_not_equals)(getComputedStyle(document.documentElement).backgroundColor, "rgb(0, 128, 0)");
-}
-
-const link = document.querySelector("link[disabled]");
-
-test(function() {
-  assert_equals(document.styleSheets.length, 0);
-  assert_applies(false);
-}, "<link disabled> prevents the stylesheet from being in document.styleSheets (from parser)");
-
-async_test(function(t) {
-  assert_true(link.disabled);
-
-  link.onload = t.step_func_done(function() {
-    assert_equals(document.styleSheets.length, 1);
-    let sheet = document.styleSheets[0];
-    assert_equals(sheet.ownerNode, link);
-    assert_applies(true);
-
-    link.disabled = true;
-    assert_equals(sheet.ownerNode, null);
-    assert_false(sheet.disabled);
-    assert_applies(false);
-    assert_true(link.hasAttribute("disabled"));
-
-    assert_equals(document.styleSheets.length, 0);
-    assert_applies(false);
-  });
-
-  link.disabled = false;
-  assert_true(!link.hasAttribute("disabled"));
-  assert_false(link.disabled);
-}, "HTMLLinkElement.disabled reflects the <link disabled> attribute, and behaves consistently");
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-002.tentative.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!doctype html>
-<title>&lt;link disabled&gt;, HTMLLinkElement.disabled and CSSStyleSheet.disabled interactions (alternate)</title>
-<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
-<link rel="author" title="Mozilla" href="https://mozilla.org">
-<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1281135">
-<link rel="help" href="https://github.com/whatwg/html/issues/3840">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<link title="alt" rel="alternate stylesheet" disabled href="data:text/css,html { background: green }">
-<script>
-function assert_applies(applies) {
-  (applies ? assert_equals : assert_not_equals)(getComputedStyle(document.documentElement).backgroundColor, "rgb(0, 128, 0)");
-}
-
-const link = document.querySelector("link[disabled]");
-
-async_test(function(t) {
-  assert_true(link.disabled);
-
-  link.onload = t.step_func_done(function() {
-    assert_equals(document.styleSheets.length, 1);
-    let sheet = document.styleSheets[0];
-    assert_equals(sheet.ownerNode, link);
-    assert_applies(true);
-
-    link.disabled = true;
-    assert_equals(sheet.ownerNode, null);
-    assert_false(sheet.disabled);
-    assert_applies(false);
-    assert_true(link.hasAttribute("disabled"));
-    assert_equals(document.styleSheets.length, 0);
-  });
-
-  link.disabled = false;
-  assert_true(!link.hasAttribute("disabled"));
-  assert_false(link.disabled);
-}, "HTMLLinkElement.disabled reflects the <link disabled> attribute, and behaves consistently, when the sheet is an alternate");
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-003.tentative.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!doctype html>
-<title>&lt;link disabled&gt;'s "explicitly enabled" state persists after getting disconnected from the tree</title>
-<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
-<link rel="author" title="Mozilla" href="https://mozilla.org">
-<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1281135">
-<link rel="help" href="https://github.com/whatwg/html/issues/3840">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<link title="alt" rel="alternate stylesheet" disabled href="data:text/css,html { background: green }">
-<script>
-function assert_applies(applies) {
-  (applies ? assert_equals : assert_not_equals)(getComputedStyle(document.documentElement).backgroundColor, "rgb(0, 128, 0)");
-}
-
-const link = document.querySelector("link[disabled]");
-async_test(function(t) {
-  assert_true(link.disabled);
-  link.disabled = false;
-  assert_false(link.disabled);
-  assert_true(!link.hasAttribute("disabled"));
-  link.remove();
-
-  link.onload = t.step_func_done(function() {
-    assert_equals(document.styleSheets.length, 1);
-    let sheet = document.styleSheets[0];
-    assert_equals(sheet.ownerNode, link);
-    assert_applies(true);
-  });
-
-  document.head.appendChild(link);
-}, "HTMLLinkElement.disabled's explicitly enabled state persists when disconnected and connected again");
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-004.tentative.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<!doctype html>
-<title>&lt;link disabled&gt;'s "explicitly enabled" state doesn't persist for clones</title>
-<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
-<link rel="author" title="Mozilla" href="https://mozilla.org">
-<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1281135">
-<link rel="help" href="https://github.com/whatwg/html/issues/3840">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<link title="alt" rel="alternate stylesheet" disabled href="data:text/css,html { background: green }">
-<script>
-function assert_applies(applies) {
-  (applies ? assert_equals : assert_not_equals)(getComputedStyle(document.documentElement).backgroundColor, "rgb(0, 128, 0)");
-}
-
-const link = document.querySelector("link[disabled]");
-
-async_test(function(t) {
-  link.remove();
-  link.disabled = false; // `link` is explicitly enabled.
-
-  let clonesLoaded = 0;
-
-  for (let shallow of [true, false]) {
-    const clone = link.cloneNode(shallow);
-    clone.onload = t.step_func(function() {
-      assert_false(link.disabled);
-      // Even though it's not disabled, it still doesn't apply, since it's an alternate.
-      assert_applies(false);
-      if (++clonesLoaded == 2) {
-        link.onload = t.step_func_done(function() {
-          assert_false(link.disabled);
-          assert_applies(true); // `link` is still explicitly enabled.
-        });
-        document.head.appendChild(link);
-      }
-    });
-    document.head.appendChild(clone);
-  }
-}, "HTMLLinkElement.disabled's explicitly enabled state doesn't persist on clones");
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-005.tentative.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!doctype html>
-<title>&lt;link disabled&gt;'s "explicitly enabled" persists across rel changes</title>
-<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
-<link rel="author" title="Mozilla" href="https://mozilla.org">
-<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1281135">
-<link rel="help" href="https://github.com/whatwg/html/issues/3840">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<link title="alt" rel="yadayada" disabled href="data:text/css,html { background: green }">
-<script>
-function assert_applies(applies) {
-  (applies ? assert_equals : assert_not_equals)(getComputedStyle(document.documentElement).backgroundColor, "rgb(0, 128, 0)");
-}
-
-const link = document.querySelector("link[disabled]");
-
-async_test(function(t) {
-  link.onload = t.step_func_done(function() {
-    assert_applies(true);
-    link.setAttribute("rel", "alternate stylesheet");
-    assert_applies(true);
-    assert_false(link.disabled);
-  });
-  link.disabled = false;
-  link.setAttribute("rel", "stylesheet");
-}, "HTMLLinkElement.disabled's explicitly enabled state persists regardless of rel");
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-006.tentative.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!doctype html>
-<title>&lt;link disabled&gt;'s "explicitly enabled" state isn't magically set from the setter</title>
-<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
-<link rel="author" title="Mozilla" href="https://mozilla.org">
-<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1281135">
-<link rel="help" href="https://github.com/whatwg/html/issues/3840">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script>
-function assert_applies(applies) {
-  (applies ? assert_equals : assert_not_equals)(getComputedStyle(document.documentElement).backgroundColor, "rgb(0, 128, 0)");
-}
-
-async_test(function(t) {
-  const link = document.createElement("link");
-  link.setAttribute("rel", "alternate stylesheet");
-  link.setAttribute("title", "alt");
-  link.href = "data:text/css,html { background: green }";
-  link.disabled = false; // This should do nothing, and is the point of this test.
-  link.onload = t.step_func_done(function() {
-    assert_applies(false); // Should not apply, since it's an alternate that hasn't been enabled.
-    assert_false(link.disabled);
-  });
-  document.head.appendChild(link);
-}, "HTMLLinkElement.disabled setter does nothing if the attribute isn't present already.");
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-007.tentative.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!doctype html>
-<title>&lt;link disabled&gt;'s "explicitly enabled" state works when set explicitly back and forth</title>
-<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
-<link rel="author" title="Mozilla" href="https://mozilla.org">
-<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1281135">
-<link rel="help" href="https://github.com/whatwg/html/issues/3840">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script>
-function assert_applies(applies) {
-  (applies ? assert_equals : assert_not_equals)(getComputedStyle(document.documentElement).backgroundColor, "rgb(0, 128, 0)");
-}
-
-async_test(function(t) {
-  const link = document.createElement("link");
-  link.setAttribute("rel", "alternate stylesheet");
-  link.setAttribute("title", "alt");
-  link.href = "data:text/css,html { background: green }";
-  link.disabled = true;
-  link.disabled = false; // This should make it "explicitly enabled".
-  link.onload = t.step_func_done(function() {
-    assert_applies(true); // Should apply, since it's explicitly enabled.
-    assert_false(link.disabled);
-  });
-  document.head.appendChild(link);
-}, "HTMLLinkElement.disabled setter sets the explicitly enabled state if toggled back and forth.");
-</script>
deleted file mode 100644
--- a/testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-alternate-ref.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE html>
-<title>CSS Test Reference</title>
-<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
-<link rel="author" title="Mozilla" href="https://mozilla.org">
-<style>
-  html { background: green }
-</style>
deleted file mode 100644
--- a/testing/web-platform/tests/css/cssom/HTMLLinkElement-disabled-alternate.tentative.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-wait">
-<title>CSS Test: alternate stylesheets can be disabled by HTMLLinkElement.disabled if they have the disabled attribute already</title>
-<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
-<link rel="author" title="Mozilla" href="https://mozilla.org">
-<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1281135">
-<link rel="help" href="https://github.com/whatwg/html/issues/3840">
-<link rel="match" href="HTMLLinkElement-disabled-alternate-ref.html">
-<link title="alt" rel="alternate stylesheet" href="data:text/css,html { background: green }" disabled onload="document.documentElement.className = ''">
-<script>
-  onload = function() {
-    const link = document.querySelector("link[rel='alternate stylesheet']");
-    link.disabled = false;
-  }
-</script>