Bug 1712140 - Part 5: Block Declarative ShadowDOM behind feature pref. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D194846
This commit is contained in:
Adam Vandolder 2023-12-07 21:27:10 +00:00
parent 925078cda0
commit c9f1ad5fd2
6 changed files with 18 additions and 3 deletions

View file

@ -151,6 +151,7 @@ interface Document : Node {
// https://html.spec.whatwg.org/multipage/dom.html#the-document-object
partial interface Document {
[Pref="dom.webcomponents.shadowdom.declarative.enabled"]
static Document parseHTMLUnsafe(DOMString html);
[PutForwards=href, LegacyUnforgeable] readonly attribute Location? location;

View file

@ -276,6 +276,7 @@ dictionary ShadowRootInit {
required ShadowRootMode mode;
boolean delegatesFocus = false;
SlotAssignmentMode slotAssignment = "named";
[Pref="dom.webcomponents.shadowdom.declarative.enabled"]
boolean clonable = false;
};
@ -406,5 +407,7 @@ partial interface Element {
};
partial interface Element {
// https://html.spec.whatwg.org/#dom-element-sethtmlunsafe
[Pref="dom.webcomponents.shadowdom.declarative.enabled"]
undefined setHTMLUnsafe(DOMString html);
};

View file

@ -14,6 +14,8 @@ interface HTMLTemplateElement : HTMLElement {
[HTMLConstructor] constructor();
readonly attribute DocumentFragment content;
[CEReactions] attribute DOMString shadowRootMode;
[CEReactions] attribute boolean shadowRootDelegatesFocus;
[CEReactions, Pref="dom.webcomponents.shadowdom.declarative.enabled"]
attribute DOMString shadowRootMode;
[CEReactions, Pref="dom.webcomponents.shadowdom.declarative.enabled"]
attribute boolean shadowRootDelegatesFocus;
};

View file

@ -57,6 +57,8 @@ interface ShadowRoot : DocumentFragment
};
partial interface ShadowRoot {
// https://html.spec.whatwg.org/#dom-shadowroot-sethtmlunsafe
[Pref="dom.webcomponents.shadowdom.declarative.enabled"]
undefined setHTMLUnsafe(DOMString html);
};

View file

@ -314,7 +314,8 @@ nsresult nsContentDLF::CreateDocument(
nsCOMPtr<nsIDocumentViewer> viewer = NS_NewDocumentViewer();
doc->SetContainer(static_cast<nsDocShell*>(aContainer));
doc->SetAllowDeclarativeShadowRoots(true);
doc->SetAllowDeclarativeShadowRoots(
mozilla::StaticPrefs::dom_webcomponents_shadowdom_declarative_enabled());
// Initialize the document to begin loading the data. An
// nsIStreamListener connected to the parser is returned in

View file

@ -4528,6 +4528,12 @@
value: false
mirror: always
# Is support for Declarative ShadowDOM enabled?
- name: dom.webcomponents.shadowdom.declarative.enabled
type: bool
value: @IS_NIGHTLY_BUILD@
mirror: always
# Is support for the Web GPU API enabled?
- name: dom.webgpu.enabled
type: RelaxedAtomicBool