mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
Use TypeError instead of InvalidState for exception.
Addresses Issue #23202
This commit is contained in:
parent
1e158bbfae
commit
15c06b1b26
5 changed files with 10 additions and 29 deletions
|
@ -182,7 +182,12 @@ where
|
|||
DomRoot::downcast(element).ok_or(Error::InvalidState)
|
||||
},
|
||||
// Step 10
|
||||
Some(ConstructionStackEntry::AlreadyConstructedMarker) => Err(Error::InvalidState),
|
||||
Some(ConstructionStackEntry::AlreadyConstructedMarker) => {
|
||||
let s = "Top of construction stack marked AlreadyConstructed due to \
|
||||
a custom element constructor constructing itself after super()"
|
||||
.to_string();
|
||||
Err(Error::Type(s))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -680,7 +680,9 @@ fn run_upgrade_constructor(
|
|||
return Err(Error::JSFailed);
|
||||
}
|
||||
if !same {
|
||||
return Err(Error::InvalidState);
|
||||
return Err(Error::Type(
|
||||
"Returned element is not SameValue as the upgraded element".to_string(),
|
||||
));
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
|
|
@ -13,7 +13,7 @@ interface CustomElementRegistry {
|
|||
Promise<void> whenDefined(DOMString name);
|
||||
};
|
||||
|
||||
callback CustomElementConstructor = any();
|
||||
callback CustomElementConstructor = HTMLElement();
|
||||
|
||||
dictionary ElementDefinitionOptions {
|
||||
DOMString extends;
|
||||
|
|
|
@ -1,13 +1,3 @@
|
|||
[Node-cloneNode.html]
|
||||
[Node.prototype.cloneNode(false) must be able to clone as a customized built-in element when it has an inconsistent "is" attribute]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLElement constructor must throw an TypeError when the top of the construction stack is marked AlreadyConstructed due to a custom element constructor constructing itself before super() call]
|
||||
expected: FAIL
|
||||
|
||||
[Upgrading a custom element must throw TypeError when the custom element's constructor returns another element]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLElement constructor must throw an TypeError when the top of the construction stack is marked AlreadyConstructed due to a custom element constructor constructing itself after super() call]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
[upgrading-parser-created-element.html]
|
||||
[Upgrading a custom element whose constructor returns a Text node must throw]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLElement constructor must throw an TypeError when the top of the construction stack is marked AlreadyConstructed due to a custom element constructor constructing itself after super() call]
|
||||
expected: FAIL
|
||||
|
||||
[Upgrading a custom element whose constructor returns an Element must throw]
|
||||
expected: FAIL
|
||||
|
||||
[Upgrading a custom element must throw an TypeError when the returned element is not SameValue as the upgraded element]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLElement constructor must throw an TypeError when the top of the construction stack is marked AlreadyConstructed due to a custom element constructor constructing itself before super() call]
|
||||
expected: FAIL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue