mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Set is
value when constructing custom elements with the new
operator (#35930)
* Add doc comments throughout the code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Set is-value for elements constructed with the "new" operator Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Allow custom elements to extend <slot> Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
bb3d28bca7
commit
b10c53ba6b
7 changed files with 71 additions and 373 deletions
|
@ -3261,20 +3261,24 @@ impl NodeMethods<crate::DomTypeHolder> for Node {
|
|||
}
|
||||
|
||||
/// <https://dom.spec.whatwg.org/#dom-node-clonenode>
|
||||
fn CloneNode(&self, deep: bool, can_gc: CanGc) -> Fallible<DomRoot<Node>> {
|
||||
fn CloneNode(&self, subtree: bool, can_gc: CanGc) -> Fallible<DomRoot<Node>> {
|
||||
// Step 1. If this is a shadow root, then throw a "NotSupportedError" DOMException.
|
||||
if self.is::<ShadowRoot>() {
|
||||
return Err(Error::NotSupported);
|
||||
}
|
||||
Ok(Node::clone(
|
||||
|
||||
// Step 2. Return the result of cloning a node given this with subtree set to subtree.
|
||||
let result = Node::clone(
|
||||
self,
|
||||
None,
|
||||
if deep {
|
||||
if subtree {
|
||||
CloneChildrenFlag::CloneChildren
|
||||
} else {
|
||||
CloneChildrenFlag::DoNotCloneChildren
|
||||
},
|
||||
can_gc,
|
||||
))
|
||||
);
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
/// <https://dom.spec.whatwg.org/#dom-node-isequalnode>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue