mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Handle null strings in Namespace::new.
This also avoids a string copy in the rare case of an unrecognized namespace.
This commit is contained in:
parent
4546d5d23c
commit
d3d7c1dabd
5 changed files with 21 additions and 24 deletions
|
@ -57,7 +57,7 @@ use layout_interface::{DocumentDamageLevel, ContentChangedDocumentDamage};
|
|||
use servo_util::atom::Atom;
|
||||
use servo_util::namespace;
|
||||
use servo_util::namespace::{Namespace, Null};
|
||||
use servo_util::str::{DOMString, null_str_as_empty_ref, split_html_space_chars};
|
||||
use servo_util::str::{DOMString, split_html_space_chars};
|
||||
|
||||
use std::collections::hashmap::HashMap;
|
||||
use std::ascii::StrAsciiExt;
|
||||
|
@ -464,7 +464,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
|
|||
fn CreateElementNS(self,
|
||||
namespace: Option<DOMString>,
|
||||
qualified_name: DOMString) -> Fallible<Temporary<Element>> {
|
||||
let ns = Namespace::from_str(null_str_as_empty_ref(&namespace));
|
||||
let ns = Namespace::from_str(namespace);
|
||||
match xml_name_type(qualified_name.as_slice()) {
|
||||
InvalidXMLName => {
|
||||
debug!("Not a valid element name");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue