mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Expose Element.AttachShadow under dom.shadowdom.enabled pref
This commit is contained in:
parent
091fcbecd1
commit
ffdc9d255f
3 changed files with 10 additions and 1 deletions
|
@ -2642,6 +2642,13 @@ impl ElementMethods for Element {
|
||||||
let doc = document_from_node(self);
|
let doc = document_from_node(self);
|
||||||
doc.enter_fullscreen(self)
|
doc.enter_fullscreen(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXX Hidden under dom.shadowdom.enabled pref. Only exposed to be able
|
||||||
|
// to test partial Shadow DOM support for UA widgets.
|
||||||
|
// https://dom.spec.whatwg.org/#dom-element-attachshadow
|
||||||
|
fn AttachShadow(&self) -> Fallible<DomRoot<ShadowRoot>> {
|
||||||
|
self.attach_shadow()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl VirtualMethods for Element {
|
impl VirtualMethods for Element {
|
||||||
|
|
|
@ -23,7 +23,6 @@ use crate::dom::bindings::inheritance::{EventTargetTypeId, HTMLElementTypeId, No
|
||||||
use crate::dom::bindings::inheritance::{SVGElementTypeId, SVGGraphicsElementTypeId, TextTypeId};
|
use crate::dom::bindings::inheritance::{SVGElementTypeId, SVGGraphicsElementTypeId, TextTypeId};
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot, DomSlice, LayoutDom, MutNullableDom};
|
use crate::dom::bindings::root::{Dom, DomRoot, DomSlice, LayoutDom, MutNullableDom};
|
||||||
use crate::dom::shadowroot::ShadowRoot;
|
|
||||||
use crate::dom::bindings::str::{DOMString, USVString};
|
use crate::dom::bindings::str::{DOMString, USVString};
|
||||||
use crate::dom::bindings::xmlname::namespace_from_domstring;
|
use crate::dom::bindings::xmlname::namespace_from_domstring;
|
||||||
use crate::dom::characterdata::{CharacterData, LayoutCharacterDataHelpers};
|
use crate::dom::characterdata::{CharacterData, LayoutCharacterDataHelpers};
|
||||||
|
@ -51,6 +50,7 @@ use crate::dom::mutationobserver::{Mutation, MutationObserver, RegisteredObserve
|
||||||
use crate::dom::nodelist::NodeList;
|
use crate::dom::nodelist::NodeList;
|
||||||
use crate::dom::processinginstruction::ProcessingInstruction;
|
use crate::dom::processinginstruction::ProcessingInstruction;
|
||||||
use crate::dom::range::WeakRangeVec;
|
use crate::dom::range::WeakRangeVec;
|
||||||
|
use crate::dom::shadowroot::ShadowRoot;
|
||||||
use crate::dom::svgsvgelement::{LayoutSVGSVGElementHelpers, SVGSVGElement};
|
use crate::dom::svgsvgelement::{LayoutSVGSVGElementHelpers, SVGSVGElement};
|
||||||
use crate::dom::text::Text;
|
use crate::dom::text::Text;
|
||||||
use crate::dom::virtualmethods::{vtable_for, VirtualMethods};
|
use crate::dom::virtualmethods::{vtable_for, VirtualMethods};
|
||||||
|
|
|
@ -81,6 +81,8 @@ interface Element : Node {
|
||||||
void insertAdjacentText(DOMString where_, DOMString data);
|
void insertAdjacentText(DOMString where_, DOMString data);
|
||||||
[CEReactions, Throws]
|
[CEReactions, Throws]
|
||||||
void insertAdjacentHTML(DOMString position, DOMString html);
|
void insertAdjacentHTML(DOMString position, DOMString html);
|
||||||
|
|
||||||
|
[Throws, Pref="dom.shadowdom.enabled"] ShadowRoot attachShadow();
|
||||||
};
|
};
|
||||||
|
|
||||||
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface
|
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue