mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07: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.
This commit is contained in:
parent
a3b261fb2e
commit
90ef1eae6a
@ -24,7 +24,7 @@ NS_NewHTMLDetailsElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
bool
|
/* static */ bool
|
||||||
HTMLDetailsElement::IsDetailsEnabled()
|
HTMLDetailsElement::IsDetailsEnabled()
|
||||||
{
|
{
|
||||||
static bool isDetailsEnabled = false;
|
static bool isDetailsEnabled = false;
|
||||||
|
@ -5641,7 +5641,7 @@ nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState
|
|||||||
// When constructing a child of a non-open <details>, create only the frame
|
// When constructing a child of a non-open <details>, create only the frame
|
||||||
// for the main <summary> element, and skip other elements.
|
// for the main <summary> element, and skip other elements.
|
||||||
auto* details = HTMLDetailsElement::FromContentOrNull(parent);
|
auto* details = HTMLDetailsElement::FromContentOrNull(parent);
|
||||||
if (details && !details->Open()) {
|
if (details && details->IsDetailsEnabled() && !details->Open()) {
|
||||||
auto* summary = HTMLSummaryElement::FromContentOrNull(aContent);
|
auto* summary = HTMLSummaryElement::FromContentOrNull(aContent);
|
||||||
if (!summary || !summary->IsMainSummary()) {
|
if (!summary || !summary->IsMainSummary()) {
|
||||||
SetAsUndisplayedContent(aState, aItems, aContent, styleContext,
|
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
|
# Basic <summary> handling
|
||||||
pref(dom.details_element.enabled,true) == multiple-summary.html single-summary.html
|
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
|
pref(dom.details_element.enabled,true) == open-multiple-summary.html open-multiple-summary-ref.html
|
||||||
|
Loading…
Reference in New Issue
Block a user