diff options
author | athenian200 <athenian200@outlook.com> | 2020-09-06 13:51:08 -0500 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-09-21 10:58:18 +0000 |
commit | 157f218c8d9f026eb530bb87cb23c2b81fd42a54 (patch) | |
tree | 2234e086305bb47ad1bd7a88083e30447347d967 | |
parent | d49fb8a6919dfa446951bf83e14939ff2fc95db1 (diff) | |
download | UXP-157f218c8d9f026eb530bb87cb23c2b81fd42a54.tar UXP-157f218c8d9f026eb530bb87cb23c2b81fd42a54.tar.gz UXP-157f218c8d9f026eb530bb87cb23c2b81fd42a54.tar.lz UXP-157f218c8d9f026eb530bb87cb23c2b81fd42a54.tar.xz UXP-157f218c8d9f026eb530bb87cb23c2b81fd42a54.zip |
Issue #1629 - Part 4: Ensure isExplicitlyEnabled is false upon sheet creation.
This clarifies the assumptions the code is making and the order in which the variables pass through the loading process. The new variable is set after the sheet is created and prepared, and is assumed to be false in the beginning.
-rw-r--r-- | layout/style/Loader.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index df523174d..1038ff53f 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -2272,7 +2272,8 @@ Loader::LoadChildSheet(StyleSheet* aParentSheet, state = eSheetComplete; } else { bool isAlternate; - bool isExplicitlyEnabled; + // For now, child sheets are not explicitly enabled. + bool isExplicitlyEnabled = false; const nsSubstring& empty = EmptyString(); // For now, use CORS_NONE for child sheets rv = CreateSheet(aURL, nullptr, principal, @@ -2396,7 +2397,9 @@ Loader::InternalLoadNonDocumentSheet(nsIURI* aURL, StyleSheetState state; bool isAlternate; - bool isExplicitlyEnabled; + // Sheets can only be explicitly enabled after creation and preparation, so + // set isExplicitlyEnabled to false. + bool isExplicitlyEnabled = false; RefPtr<StyleSheet> sheet; bool syncLoad = (aObserver == nullptr); const nsSubstring& empty = EmptyString(); |