mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
CustomElementRegistry.upgrade works by current spec
This commit is contained in:
parent
45cc558297
commit
065bcee371
4 changed files with 13 additions and 15 deletions
|
@ -448,6 +448,17 @@ impl CustomElementRegistryMethods for CustomElementRegistry {
|
|||
// Step 6
|
||||
promise
|
||||
}
|
||||
/// https://html.spec.whatwg.org/multipage/#dom-customelementregistry-upgrade
|
||||
fn Upgrade(&self, node: &Node) {
|
||||
// Spec says to make a list first and then iterate the list, but
|
||||
// try-to-upgrade only queues upgrade reactions and doesn't itself
|
||||
// modify the tree, so that's not an observable distinction.
|
||||
node.traverse_preorder(ShadowIncluding::Yes).for_each(|n| {
|
||||
if let Some(element) = n.downcast::<Element>() {
|
||||
try_upgrade_element(element);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, JSTraceable, MallocSizeOf)]
|
||||
|
|
|
@ -11,6 +11,8 @@ interface CustomElementRegistry {
|
|||
any get(DOMString name);
|
||||
|
||||
Promise<void> whenDefined(DOMString name);
|
||||
|
||||
[CEReactions] void upgrade(Node root);
|
||||
};
|
||||
|
||||
callback CustomElementConstructor = HTMLElement();
|
||||
|
|
|
@ -1,16 +1,4 @@
|
|||
[upgrade.html]
|
||||
[Upgrading an element directly (example from the spec)]
|
||||
expected: FAIL
|
||||
|
||||
[Two elements as children of the upgraded node]
|
||||
expected: FAIL
|
||||
|
||||
[Two elements as descendants of the upgraded node]
|
||||
expected: FAIL
|
||||
|
||||
[Two elements as shadow-including descendants (and not descendants) of the upgraded node]
|
||||
expected: FAIL
|
||||
|
||||
[Elements inside a template contents DocumentFragment node]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -62,9 +62,6 @@
|
|||
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "getTransform()" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[CustomElementRegistry interface: operation upgrade(Node)]
|
||||
expected: FAIL
|
||||
|
||||
[OffscreenCanvasRenderingContext2D interface: attribute imageSmoothingEnabled]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue