diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-07 20:27:27 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:08 -0500 |
commit | bc8543bf793b5c203600c57565214b5e20f54592 (patch) | |
tree | ba44f39310bb1eb1304a36ab60a82bc031306b78 | |
parent | ce285b6f2d48ce945b194fd7982cd6a5a306e939 (diff) | |
download | UXP-bc8543bf793b5c203600c57565214b5e20f54592.tar UXP-bc8543bf793b5c203600c57565214b5e20f54592.tar.gz UXP-bc8543bf793b5c203600c57565214b5e20f54592.tar.lz UXP-bc8543bf793b5c203600c57565214b5e20f54592.tar.xz UXP-bc8543bf793b5c203600c57565214b5e20f54592.zip |
Bug 1271549 - Remove details and summary preference.
Tag UXP Issue #1344
20 files changed, 21 insertions, 121 deletions
diff --git a/dom/html/HTMLDetailsElement.cpp b/dom/html/HTMLDetailsElement.cpp index ed20b50ca..8619b1450 100644 --- a/dom/html/HTMLDetailsElement.cpp +++ b/dom/html/HTMLDetailsElement.cpp @@ -6,39 +6,11 @@ #include "mozilla/dom/HTMLDetailsElement.h" #include "mozilla/dom/HTMLDetailsElementBinding.h" -#include "mozilla/dom/HTMLUnknownElement.h" -#include "mozilla/Preferences.h" - -// Expand NS_IMPL_NS_NEW_HTML_ELEMENT(Details) to add pref check. -nsGenericHTMLElement* -NS_NewHTMLDetailsElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo, - mozilla::dom::FromParser aFromParser) -{ - if (!mozilla::dom::HTMLDetailsElement::IsDetailsEnabled()) { - return new mozilla::dom::HTMLUnknownElement(aNodeInfo); - } - - return new mozilla::dom::HTMLDetailsElement(aNodeInfo); -} +NS_IMPL_NS_NEW_HTML_ELEMENT(Details) namespace mozilla { namespace dom { -/* static */ bool -HTMLDetailsElement::IsDetailsEnabled() -{ - static bool isDetailsEnabled = false; - static bool added = false; - - if (!added) { - Preferences::AddBoolVarCache(&isDetailsEnabled, - "dom.details_element.enabled"); - added = true; - } - - return isDetailsEnabled; -} - HTMLDetailsElement::~HTMLDetailsElement() { } diff --git a/dom/html/HTMLDetailsElement.h b/dom/html/HTMLDetailsElement.h index 5a3af27b4..6adf567bf 100644 --- a/dom/html/HTMLDetailsElement.h +++ b/dom/html/HTMLDetailsElement.h @@ -23,8 +23,6 @@ class HTMLDetailsElement final : public nsGenericHTMLElement public: using NodeInfo = mozilla::dom::NodeInfo; - static bool IsDetailsEnabled(); - explicit HTMLDetailsElement(already_AddRefed<NodeInfo>& aNodeInfo) : nsGenericHTMLElement(aNodeInfo) { diff --git a/dom/html/HTMLSummaryElement.cpp b/dom/html/HTMLSummaryElement.cpp index ee3c07b20..42ead6b87 100644 --- a/dom/html/HTMLSummaryElement.cpp +++ b/dom/html/HTMLSummaryElement.cpp @@ -14,17 +14,7 @@ #include "mozilla/TextEvents.h" #include "nsFocusManager.h" -// Expand NS_IMPL_NS_NEW_HTML_ELEMENT(Summary) to add pref check. -nsGenericHTMLElement* -NS_NewHTMLSummaryElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo, - mozilla::dom::FromParser aFromParser) -{ - if (!mozilla::dom::HTMLDetailsElement::IsDetailsEnabled()) { - return new mozilla::dom::HTMLUnknownElement(aNodeInfo); - } - - return new mozilla::dom::HTMLSummaryElement(aNodeInfo); -} +NS_IMPL_NS_NEW_HTML_ELEMENT(Summary) namespace mozilla { namespace dom { diff --git a/dom/webidl/EventHandler.webidl b/dom/webidl/EventHandler.webidl index b92e3a2bb..484a8e95c 100644 --- a/dom/webidl/EventHandler.webidl +++ b/dom/webidl/EventHandler.webidl @@ -94,7 +94,6 @@ interface GlobalEventHandlers { [Pref="dom.select_events.enabled"] attribute EventHandler onselectstart; - [Pref="dom.details_element.enabled"] attribute EventHandler ontoggle; // Pointer events handlers diff --git a/dom/webidl/HTMLDetailsElement.webidl b/dom/webidl/HTMLDetailsElement.webidl index 133ecf125..104606eb1 100644 --- a/dom/webidl/HTMLDetailsElement.webidl +++ b/dom/webidl/HTMLDetailsElement.webidl @@ -11,7 +11,6 @@ * and create derivative works of this document. */ -[Pref="dom.details_element.enabled"] interface HTMLDetailsElement : HTMLElement { [SetterThrows] attribute boolean open; diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index ec676ca92..34cfc6b59 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -3563,10 +3563,6 @@ nsCSSFrameConstructor::FindHTMLData(Element* aElement, return nullptr; } - if (aTag == nsGkAtoms::details && !HTMLDetailsElement::IsDetailsEnabled()) { - return nullptr; - } - static const FrameConstructionDataByTag sHTMLData[] = { SIMPLE_TAG_CHAIN(img, nsCSSFrameConstructor::FindImgData), SIMPLE_TAG_CHAIN(mozgeneratedcontentimage, @@ -5788,7 +5784,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState // ::before and ::after); we always want to create "internal" anonymous // content. auto* details = HTMLDetailsElement::FromContentOrNull(parent); - if (details && details->IsDetailsEnabled() && !details->Open() && + if (details && !details->Open() && (!aContent->IsRootOfNativeAnonymousSubtree() || aContent->IsGeneratedContentContainerForBefore() || aContent->IsGeneratedContentContainerForAfter())) { @@ -5956,7 +5952,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState } FrameConstructionItem* item = nullptr; - if (details && details->IsDetailsEnabled() && details->Open()) { + if (details && details->Open()) { auto* summary = HTMLSummaryElement::FromContentOrNull(aContent); if (summary && summary->IsMainSummary()) { // If details is open, the main summary needs to be rendered as if it is diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list index 183556ab9..a3c0d62c6 100644 --- a/layout/generic/crashtests/crashtests.list +++ b/layout/generic/crashtests/crashtests.list @@ -606,19 +606,19 @@ pref(layout.css.grid.enabled,true) load 1225376.html pref(layout.css.grid.enabled,true) load 1225592.html load 1229437-1.html load 1229437-2.html -pref(dom.details_element.enabled,true) load details-containing-only-text.html -pref(dom.details_element.enabled,true) load details-display-none-summary-1.html -pref(dom.details_element.enabled,true) load details-display-none-summary-2.html -pref(dom.details_element.enabled,true) load details-display-none-summary-3.html -pref(dom.details_element.enabled,true) load details-open-overflow-auto.html -pref(dom.details_element.enabled,true) load details-open-overflow-hidden.html -pref(dom.details_element.enabled,true) load details-three-columns.html +load details-containing-only-text.html +load details-display-none-summary-1.html +load details-display-none-summary-2.html +load details-display-none-summary-3.html +load details-open-overflow-auto.html +load details-open-overflow-hidden.html +load details-three-columns.html load first-letter-638937-1.html load first-letter-638937-2.html load flex-nested-abspos-1.html pref(dom.meta-viewport.enabled,true) test-pref(font.size.inflation.emPerLine,15) asserts(0-100) load font-inflation-762332.html # bug 762332 load outline-on-frameset.xhtml -pref(dom.details_element.enabled,true) load summary-position-out-of-flow.html +load summary-position-out-of-flow.html load text-overflow-bug666751-1.html load text-overflow-bug666751-2.html load text-overflow-bug670564.xhtml diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index abf687c9b..afc4ed96f 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -1890,12 +1890,10 @@ nsContainerFrame::RenumberFrameAndDescendants(int32_t* aOrdinal, } // Do not renumber list for summary elements. - if (HTMLDetailsElement::IsDetailsEnabled()) { - HTMLSummaryElement* summary = - HTMLSummaryElement::FromContent(kid->GetContent()); - if (summary && summary->IsMainSummary()) { - return false; - } + HTMLSummaryElement* summary = + HTMLSummaryElement::FromContent(kid->GetContent()); + if (summary && summary->IsMainSummary()) { + return false; } bool kidRenumberedABullet = false; diff --git a/layout/reftests/details-summary/disabled-no-summary-ref.html b/layout/reftests/details-summary/disabled-no-summary-ref.html deleted file mode 100644 index 6ecdbcdc0..000000000 --- a/layout/reftests/details-summary/disabled-no-summary-ref.html +++ /dev/null @@ -1,11 +0,0 @@ -<!DOCTYPE html> -<!-- Any copyright is dedicated to the Public Domain. - - http://creativecommons.org/publicdomain/zero/1.0/ --> - -<html> - <body> - <div> - <p>This is the details.</p> - </div> - </body> -</html> diff --git a/layout/reftests/details-summary/disabled-single-summary-ref.html b/layout/reftests/details-summary/disabled-single-summary-ref.html deleted file mode 100644 index f643af6dc..000000000 --- a/layout/reftests/details-summary/disabled-single-summary-ref.html +++ /dev/null @@ -1,12 +0,0 @@ -<!DOCTYPE html> -<!-- Any copyright is dedicated to the Public Domain. - - http://creativecommons.org/publicdomain/zero/1.0/ --> - -<html> - <body> - <div> - <div>Summary</div> - <p>This is the details.</p> - </div> - </body> -</html> diff --git a/layout/reftests/details-summary/reftest-stylo.list b/layout/reftests/details-summary/reftest-stylo.list index e23b1206b..2c6ec0d7b 100644 --- a/layout/reftests/details-summary/reftest-stylo.list +++ b/layout/reftests/details-summary/reftest-stylo.list @@ -1,10 +1,4 @@ # DO NOT EDIT! This is a auto-generated temporary list for Stylo testing -default-preferences pref(dom.details_element.enabled,true) - -# Disable <details> and <summary> -pref(dom.details_element.enabled,false) == single-summary.html single-summary.html -pref(dom.details_element.enabled,false) == open-single-summary.html open-single-summary.html -pref(dom.details_element.enabled,false) == no-summary.html no-summary.html # Basic <summary> handling == multiple-summary.html multiple-summary.html diff --git a/layout/reftests/details-summary/reftest.list b/layout/reftests/details-summary/reftest.list index 92b1404b5..e96581ad4 100644 --- a/layout/reftests/details-summary/reftest.list +++ b/layout/reftests/details-summary/reftest.list @@ -1,10 +1,3 @@ -default-preferences pref(dom.details_element.enabled,true) - -# Disable <details> and <summary> -pref(dom.details_element.enabled,false) == single-summary.html disabled-single-summary-ref.html -pref(dom.details_element.enabled,false) == open-single-summary.html disabled-single-summary-ref.html -pref(dom.details_element.enabled,false) == no-summary.html disabled-no-summary-ref.html - # Basic <summary> handling == multiple-summary.html single-summary.html == open-multiple-summary.html open-multiple-summary-ref.html diff --git a/layout/style/nsLayoutStylesheetCache.cpp b/layout/style/nsLayoutStylesheetCache.cpp index e8c6d09d7..0e6bc35ee 100644 --- a/layout/style/nsLayoutStylesheetCache.cpp +++ b/layout/style/nsLayoutStylesheetCache.cpp @@ -122,11 +122,6 @@ nsLayoutStylesheetCache::UASheet() StyleSheet* nsLayoutStylesheetCache::HTMLSheet() { - if (!mHTMLSheet) { - LoadSheetURL("resource://gre-resources/html.css", - &mHTMLSheet, eAgentSheetFeatures, eCrash); - } - return mHTMLSheet; } @@ -322,6 +317,8 @@ nsLayoutStylesheetCache::nsLayoutStylesheetCache(StyleBackendType aType) // per-profile, since they're profile-invariant. LoadSheetURL("resource://gre-resources/counterstyles.css", &mCounterStylesSheet, eAgentSheetFeatures, eCrash); + LoadSheetURL("resource://gre-resources/html.css", + &mHTMLSheet, eAgentSheetFeatures, eCrash); LoadSheetURL("chrome://global/content/minimal-xul.css", &mMinimalXULSheet, eAgentSheetFeatures, eCrash); LoadSheetURL("resource://gre-resources/quirk.css", @@ -382,8 +379,6 @@ nsLayoutStylesheetCache::For(StyleBackendType aType) // "layout.css.example-pref.enabled"); Preferences::RegisterCallback(&DependentPrefChanged, "layout.css.grid.enabled"); - Preferences::RegisterCallback(&DependentPrefChanged, - "dom.details_element.enabled"); } return cache; @@ -555,7 +550,6 @@ nsLayoutStylesheetCache::DependentPrefChanged(const char* aPref, void* aData) gStyleCache_Servo ? &gStyleCache_Servo->sheet_ : nullptr); INVALIDATE(mUASheet); // for layout.css.grid.enabled - INVALIDATE(mHTMLSheet); // for dom.details_element.enabled #undef INVALIDATE } diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index c5daf9213..dacfe6e49 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -5328,9 +5328,6 @@ pref("dom.audiochannel.mutedByDefault", false); // HTML <dialog> element pref("dom.dialog_element.enabled", false); -// Enable <details> and <summary> tags. -pref("dom.details_element.enabled", true); - // Secure Element API #ifdef MOZ_SECUREELEMENT pref("dom.secureelement.enabled", false); diff --git a/testing/web-platform/meta/html/dom/interfaces.html.ini b/testing/web-platform/meta/html/dom/interfaces.html.ini index 16a03337e..db6a464d0 100644 --- a/testing/web-platform/meta/html/dom/interfaces.html.ini +++ b/testing/web-platform/meta/html/dom/interfaces.html.ini @@ -1,6 +1,6 @@ [interfaces.html] type: testharness - prefs: [dom.forms.inputmode:true, dom.details_element.enabled:true, dom.dialog_element.enabled:true] + prefs: [dom.forms.inputmode:true, dom.dialog_element.enabled:true] [Document interface: attribute domain] expected: FAIL diff --git a/testing/web-platform/meta/html/dom/reflection-misc.html.ini b/testing/web-platform/meta/html/dom/reflection-misc.html.ini index b0909cc6d..bc65d4191 100644 --- a/testing/web-platform/meta/html/dom/reflection-misc.html.ini +++ b/testing/web-platform/meta/html/dom/reflection-misc.html.ini @@ -1,6 +1,6 @@ [reflection-misc.html] type: testharness - prefs: [dom.details_element.enabled: true, dom.dialog_element.enabled: true] + prefs: [dom.dialog_element.enabled: true] [html.tabIndex: setAttribute() to object "3" followed by getAttribute()] expected: FAIL diff --git a/testing/web-platform/meta/html/semantics/interactive-elements/the-details-element/details.html.ini b/testing/web-platform/meta/html/semantics/interactive-elements/the-details-element/details.html.ini deleted file mode 100644 index 6ffca742c..000000000 --- a/testing/web-platform/meta/html/semantics/interactive-elements/the-details-element/details.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[details.html] - type: testharness - prefs: [dom.details_element.enabled:true] diff --git a/testing/web-platform/meta/html/semantics/interactive-elements/the-details-element/toggleEvent.html.ini b/testing/web-platform/meta/html/semantics/interactive-elements/the-details-element/toggleEvent.html.ini deleted file mode 100644 index 335ffd5b3..000000000 --- a/testing/web-platform/meta/html/semantics/interactive-elements/the-details-element/toggleEvent.html.ini +++ /dev/null @@ -1,3 +0,0 @@ -[toggleEvent.html] - type: testharness - prefs: [dom.details_element.enabled:true] diff --git a/testing/web-platform/meta/html/semantics/interfaces.html.ini b/testing/web-platform/meta/html/semantics/interfaces.html.ini index 23f55fbe4..f191cad52 100644 --- a/testing/web-platform/meta/html/semantics/interfaces.html.ini +++ b/testing/web-platform/meta/html/semantics/interfaces.html.ini @@ -1,6 +1,6 @@ [interfaces.html] type: testharness - prefs: [dom.details_element.enabled: true, dom.dialog_element.enabled: true] + prefs: [dom.dialog_element.enabled: true] [Interfaces for image] expected: FAIL diff --git a/testing/web-platform/meta/svg/interfaces.html.ini b/testing/web-platform/meta/svg/interfaces.html.ini index 292ca6b74..410f20f69 100644 --- a/testing/web-platform/meta/svg/interfaces.html.ini +++ b/testing/web-platform/meta/svg/interfaces.html.ini @@ -1,6 +1,5 @@ [interfaces.html] type: testharness - prefs: [dom.details_element.enabled:true] [SVGGeometryElement interface: existence and properties of interface object] expected: FAIL |