mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Auto merge of #8504 - frewsxcv:more-atoms, r=jdm
Prefer atoms over strs for string comparisons <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8504) <!-- Reviewable:end -->
This commit is contained in:
commit
1763a37e3b
4 changed files with 15 additions and 15 deletions
|
@ -343,7 +343,7 @@ impl HTMLInputElementMethods for HTMLInputElement {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-lfe-labels
|
||||
fn Labels(&self) -> Root<NodeList> {
|
||||
if &*self.type_() == "hidden" {
|
||||
if self.type_() == atom!("hidden") {
|
||||
let window = window_from_node(self);
|
||||
NodeList::empty(&window)
|
||||
} else {
|
||||
|
@ -418,14 +418,14 @@ impl HTMLInputElement {
|
|||
_ => false
|
||||
};
|
||||
|
||||
match &*ty {
|
||||
"submit" | "button" | "reset" if !is_submitter => return None,
|
||||
"radio" | "checkbox" => {
|
||||
match ty {
|
||||
atom!("submit") | atom!("button") | atom!("reset") if !is_submitter => return None,
|
||||
atom!("radio") | atom!("checkbox") => {
|
||||
if !self.Checked() || name.is_empty() {
|
||||
return None;
|
||||
}
|
||||
},
|
||||
"image" | "file" => return None, // Unimplemented
|
||||
atom!("image") | atom!("file") => return None, // Unimplemented
|
||||
_ => {
|
||||
if name.is_empty() {
|
||||
return None;
|
||||
|
@ -434,7 +434,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
|
||||
let mut value = self.Value();
|
||||
if &*ty == "radio" || &*ty == "checkbox" {
|
||||
if ty == atom!("radio") || ty == atom!("checkbox") {
|
||||
if value.is_empty() {
|
||||
value = DOMString::from("on");
|
||||
}
|
||||
|
|
6
components/servo/Cargo.lock
generated
6
components/servo/Cargo.lock
generated
|
@ -1689,7 +1689,7 @@ dependencies = [
|
|||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_plugin 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_shared 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_shared 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1699,12 +1699,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
dependencies = [
|
||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_shared 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_shared 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "string_cache_shared"
|
||||
version = "0.1.10"
|
||||
version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"debug_unreachable 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
6
ports/cef/Cargo.lock
generated
6
ports/cef/Cargo.lock
generated
|
@ -1648,7 +1648,7 @@ dependencies = [
|
|||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_plugin 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_shared 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_shared 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1658,12 +1658,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
dependencies = [
|
||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_shared 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_shared 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "string_cache_shared"
|
||||
version = "0.1.10"
|
||||
version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"debug_unreachable 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
6
ports/gonk/Cargo.lock
generated
6
ports/gonk/Cargo.lock
generated
|
@ -1626,7 +1626,7 @@ dependencies = [
|
|||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_plugin 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_shared 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_shared 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1636,12 +1636,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
dependencies = [
|
||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_shared 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"string_cache_shared 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "string_cache_shared"
|
||||
version = "0.1.10"
|
||||
version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"debug_unreachable 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue