summaryrefslogtreecommitdiff
path: root/dom/html/HTMLLinkElement.h
diff options
context:
space:
mode:
authorathenian200 <athenian200@outlook.com>2020-08-11 05:27:40 -0500
committerathenian200 <athenian200@outlook.com>2020-08-13 01:09:58 -0500
commitdf8fa4a5aa0793d2b290caa53167917eef5755b7 (patch)
treee736e47a0d896d784749c2d940d838579dad623e /dom/html/HTMLLinkElement.h
parent16c000bcdb6bcac45c963b03470e5589e36974b5 (diff)
downloadaura-central-df8fa4a5aa0793d2b290caa53167917eef5755b7.tar.gz
Issue mcp-graveyard/UXP%1629 - Part 2: Implement the Explicitly Enabled flag.
This part of the bug was significantly complicated by the following major refactors: https://bugzilla.mozilla.org/show_bug.cgi?id=1456435 https://bugzilla.mozilla.org/show_bug.cgi?id=1459498 As best as I can tell, we just need to implement the explicitly enabled flag on every instance of GetStyleSheetInfo, make sure aIsExplicitlyEnabled is false in every situation except the one where the disabled content attribute is removed from a link element, and enable alternate stylesheets if this flag is set on them. So we take the explicitly enabled flag as an input to PrepareSheet, and also add it to LoadStyleLink and LoadInlineStyle. I also decided not to defer loading of alternate stylesheets that have been explicitly enabled.
Diffstat (limited to 'dom/html/HTMLLinkElement.h')
-rw-r--r--dom/html/HTMLLinkElement.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/dom/html/HTMLLinkElement.h b/dom/html/HTMLLinkElement.h
index e024d42bb..190213028 100644
--- a/dom/html/HTMLLinkElement.h
+++ b/dom/html/HTMLLinkElement.h
@@ -181,10 +181,18 @@ protected:
nsAString& aType,
nsAString& aMedia,
bool* aIsScoped,
- bool* aIsAlternate) override;
-protected:
+ bool* aIsAlternate,
+ bool* aIsExplicitlyEnabled) override;
+
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;
+
private:
RefPtr<ImportLoader> mImportLoader;
};