mirror of
https://github.com/servo/servo
synced 2026-04-28 10:27:40 +02:00
script: Use CString for Error::Type and Error::Range (#42576)
Continuation of https://github.com/servo/servo/pull/42135, switch Error::Type and Error::Range to also use CStrings internally, as they are converted to CString for throwing JS exceptions (other get thrown as DomException object, which uses rust string internally). Changes in script crate are mechanical. Testing: Should be covered by WPT tests. Part of #42126 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
@@ -303,7 +303,7 @@ impl HTMLFormElementMethods<crate::DomTypeHolder> for HTMLFormElement {
|
||||
Some(submitter_element) => {
|
||||
// Step 1.1
|
||||
let error_not_a_submit_button =
|
||||
Err(Error::Type("submitter must be a submit button".to_string()));
|
||||
Err(Error::Type(c"submitter must be a submit button".to_owned()));
|
||||
|
||||
let element = match submitter_element.upcast::<Node>().type_id() {
|
||||
NodeTypeId::Element(ElementTypeId::HTMLElement(element)) => element,
|
||||
|
||||
Reference in New Issue
Block a user