diff options
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 2eb9bd8806c..02d640f1715 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -515,7 +515,7 @@ impl Document { self.GetDocumentElement() } else { // Step 3 & 4 - String::from_utf8(percent_decode(fragid.as_bytes())).ok() + percent_decode(fragid.as_bytes()).decode_utf8().ok() // Step 5 .and_then(|decoded_fragid| self.get_element_by_id(&Atom::from(decoded_fragid))) // Step 6 @@ -1585,7 +1585,7 @@ impl LayoutDocumentHelpers for LayoutJS<Document> { /// https://url.spec.whatwg.org/#network-scheme fn url_has_network_scheme(url: &Url) -> bool { - match &*url.scheme { + match url.scheme() { "ftp" | "http" | "https" => true, _ => false, } @@ -1844,7 +1844,7 @@ impl DocumentMethods for Document { // https://dom.spec.whatwg.org/#dom-document-url fn URL(&self) -> DOMString { - DOMString::from(self.url().serialize()) + DOMString::from(self.url().as_str()) } // https://html.spec.whatwg.org/multipage/#dom-document-activeelement @@ -1886,7 +1886,7 @@ impl DocumentMethods for Document { if let Some(host) = self.origin.host() { // Step 4. - DOMString::from(host.serialize()) + DOMString::from(host.to_string()) } else { // Step 3. DOMString::new() @@ -2154,7 +2154,7 @@ impl DocumentMethods for Document { Ok(Root::upcast(MouseEvent::new_uninitialized(&self.window))), "customevent" => Ok(Root::upcast(CustomEvent::new_uninitialized(GlobalRef::Window(&self.window)))), - "htmlevents" | "events" | "event" => + "htmlevents" | "events" | "event" | "svgevents" => Ok(Event::new_uninitialized(GlobalRef::Window(&self.window))), "keyboardevent" => Ok(Root::upcast(KeyboardEvent::new_uninitialized(&self.window))), |