mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Add customElements.getName (#32715)
* Add customElements.getName * rebaseline
This commit is contained in:
parent
816359583c
commit
db4cba4d6d
5 changed files with 12 additions and 15 deletions
|
@ -561,6 +561,16 @@ impl CustomElementRegistryMethods for CustomElementRegistry {
|
|||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-customelementregistry-getname>
|
||||
fn GetName(&self, constructor: Rc<CustomElementConstructor>) -> Option<DOMString> {
|
||||
self.definitions
|
||||
.borrow()
|
||||
.0
|
||||
.values()
|
||||
.find(|definition| definition.constructor == constructor)
|
||||
.map(|definition| DOMString::from(definition.name.to_string()))
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-customelementregistry-whendefined>
|
||||
#[allow(unsafe_code)]
|
||||
fn WhenDefined(&self, name: DOMString, comp: InRealm) -> Rc<Promise> {
|
||||
|
|
|
@ -14,6 +14,8 @@ interface CustomElementRegistry {
|
|||
|
||||
any get(DOMString name);
|
||||
|
||||
DOMString? getName(CustomElementConstructor constructor);
|
||||
|
||||
Promise<CustomElementConstructor> whenDefined(DOMString name);
|
||||
|
||||
[CEReactions] undefined upgrade(Node root);
|
||||
|
|
|
@ -1610,9 +1610,6 @@
|
|||
[VisibilityStateEntry interface: attribute duration]
|
||||
expected: FAIL
|
||||
|
||||
[CustomElementRegistry interface: operation getName(CustomElementConstructor)]
|
||||
expected: FAIL
|
||||
|
||||
[Navigation interface: existence and properties of interface object]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
[CustomElementRegistry-getName.html]
|
||||
[customElements.getName must return null when the registry does not contain an entry with the given constructor]
|
||||
expected: FAIL
|
||||
|
||||
[customElements.getName returns the name of the entry with the given constructor when there is a matching entry.]
|
||||
expected: FAIL
|
||||
|
||||
[customElements.getName returns the name of the entry with the given customized built in constructor when there is a matching entry.]
|
||||
expected: FAIL
|
|
@ -1490,9 +1490,6 @@
|
|||
[ImageBitmap interface: attribute height]
|
||||
expected: FAIL
|
||||
|
||||
[CustomElementRegistry interface: operation getName(CustomElementConstructor)]
|
||||
expected: FAIL
|
||||
|
||||
[Navigation interface: existence and properties of interface object]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue