mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
renaming tokens(), atom() and uint() and rewriting to return or panic
This commit is contained in:
parent
eaf90c0b1c
commit
105ea0d690
8 changed files with 31 additions and 35 deletions
|
@ -1762,10 +1762,10 @@ impl DocumentMethods for Document {
|
|||
match html_elem_type {
|
||||
HTMLElementTypeId::HTMLAppletElement => {
|
||||
match elem.get_attribute(&ns!(""), &atom!("name")) {
|
||||
Some(ref attr) if attr.r().value().atom() == Some(name) => true,
|
||||
Some(ref attr) if attr.r().value().as_atom() == name => true,
|
||||
_ => {
|
||||
match elem.get_attribute(&ns!(""), &atom!("id")) {
|
||||
Some(ref attr) => attr.r().value().atom() == Some(name),
|
||||
Some(ref attr) => attr.r().value().as_atom() == name,
|
||||
None => false,
|
||||
}
|
||||
},
|
||||
|
@ -1773,18 +1773,18 @@ impl DocumentMethods for Document {
|
|||
},
|
||||
HTMLElementTypeId::HTMLFormElement => {
|
||||
match elem.get_attribute(&ns!(""), &atom!("name")) {
|
||||
Some(ref attr) => attr.r().value().atom() == Some(name),
|
||||
Some(ref attr) => attr.r().value().as_atom() == name,
|
||||
None => false,
|
||||
}
|
||||
},
|
||||
HTMLElementTypeId::HTMLImageElement => {
|
||||
match elem.get_attribute(&ns!(""), &atom!("name")) {
|
||||
Some(ref attr) => {
|
||||
if attr.r().value().atom() == Some(name) {
|
||||
if attr.r().value().as_atom() == name {
|
||||
true
|
||||
} else {
|
||||
match elem.get_attribute(&ns!(""), &atom!("id")) {
|
||||
Some(ref attr) => attr.r().value().atom() == Some(name),
|
||||
Some(ref attr) => attr.r().value().as_atom() == name,
|
||||
None => false,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue