mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1246185 - Do not collapsed <details> when preference off. r=bz
To retain backward compatibility, <details> tags should not collapse its children when dom.details_element.enabled = false. --HG-- extra : rebase_source : 6b47e64672720ffecd23f670c31de1c7d92bee8c
This commit is contained in:
parent
516923c1f6
commit
612a133caa
@ -24,7 +24,7 @@ NS_NewHTMLDetailsElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
bool
|
||||
/* static */ bool
|
||||
HTMLDetailsElement::IsDetailsEnabled()
|
||||
{
|
||||
static bool isDetailsEnabled = false;
|
||||
|
@ -5641,7 +5641,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
|
||||
// When constructing a child of a non-open <details>, create only the frame
|
||||
// for the main <summary> element, and skip other elements.
|
||||
auto* details = HTMLDetailsElement::FromContentOrNull(parent);
|
||||
if (details && !details->Open()) {
|
||||
if (details && details->IsDetailsEnabled() && !details->Open()) {
|
||||
auto* summary = HTMLSummaryElement::FromContentOrNull(aContent);
|
||||
if (!summary || !summary->IsMainSummary()) {
|
||||
SetAsUndisplayedContent(aState, aItems, aContent, styleContext,
|
||||
|
11
layout/reftests/details-summary/disabled-no-summary-ref.html
Normal file
11
layout/reftests/details-summary/disabled-no-summary-ref.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!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>
|
@ -0,0 +1,12 @@
|
||||
<!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>
|
@ -1,3 +1,8 @@
|
||||
# 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
|
||||
pref(dom.details_element.enabled,true) == multiple-summary.html single-summary.html
|
||||
pref(dom.details_element.enabled,true) == open-multiple-summary.html open-multiple-summary-ref.html
|
||||
|
Loading…
x
Reference in New Issue
Block a user