1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 22:58:36 +00:00

Issue #1757 - Reinstate "dom.details_element.enabled" preference

The removal of this preference was botched, all other surrounding plumbing changes appear to be working okay. The ability to use prefs to control this stylesheet might be useful in the future, so perhaps this is one of those "if it ain't broke, don't fix it" bugs where leaving well enough alone in the first place would have been the best choice.
This commit is contained in:
athenian200
2021-03-31 17:57:48 -05:00
committed by roytam1
parent be539ad8fc
commit 618fa768c8
15 changed files with 111 additions and 19 deletions
+6 -2
View File
@@ -3580,6 +3580,10 @@ 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,
@@ -5791,7 +5795,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
// ::before and ::after); we always want to create "internal" anonymous
// content.
auto* details = HTMLDetailsElement::FromContentOrNull(parent);
if (details && !details->Open() &&
if (details && details->IsDetailsEnabled() && !details->Open() &&
(!aContent->IsRootOfNativeAnonymousSubtree() ||
aContent->IsGeneratedContentContainerForBefore() ||
aContent->IsGeneratedContentContainerForAfter())) {
@@ -5959,7 +5963,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
}
FrameConstructionItem* item = nullptr;
if (details && details->Open()) {
if (details && details->IsDetailsEnabled() && 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