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
commit 618fa768c8
15 changed files with 111 additions and 19 deletions

View file

@ -14,7 +14,17 @@
#include "mozilla/TextEvents.h"
#include "nsFocusManager.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Summary)
// 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);
}
namespace mozilla {
namespace dom {