mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
Auto merge of #8527 - romankl:atom-slices, r=Ms2ger
Replace Atom::from_slice("sizes") with atom!("sizes") This PR replaces all occurrences of Atom::from_slice("sizes") with atom!("sizes"). It also updates string_cache to v0.1.17 from 0.1.16. Right now I've split the crate update and the replace in different commits - should I squash them? Fixes #8488. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8527) <!-- Reviewable:end -->
This commit is contained in:
commit
c722e0e6f4
4 changed files with 31 additions and 32 deletions
|
@ -119,18 +119,17 @@ impl VirtualMethods for HTMLLinkElement {
|
|||
return;
|
||||
}
|
||||
|
||||
let sizes_atom = &Atom::from_slice("sizes");
|
||||
let rel = get_attr(self.upcast(), &atom!(rel));
|
||||
match attr.local_name() {
|
||||
&atom!(href) => {
|
||||
if string_is_stylesheet(&rel) {
|
||||
self.handle_stylesheet_url(&attr.value());
|
||||
} else if is_favicon(&rel) {
|
||||
let sizes = get_attr(self.upcast(), sizes_atom);
|
||||
let sizes = get_attr(self.upcast(), &atom!("sizes"));
|
||||
self.handle_favicon_url(rel.as_ref().unwrap(), &attr.value(), &sizes);
|
||||
}
|
||||
},
|
||||
atom if atom == sizes_atom => {
|
||||
&atom!("sizes") => {
|
||||
if is_favicon(&rel) {
|
||||
if let Some(ref href) = get_attr(self.upcast(), &atom!("href")) {
|
||||
self.handle_favicon_url(rel.as_ref().unwrap(), href, &Some(attr.value().to_string()));
|
||||
|
@ -163,7 +162,7 @@ impl VirtualMethods for HTMLLinkElement {
|
|||
|
||||
let rel = get_attr(element, &atom!("rel"));
|
||||
let href = get_attr(element, &atom!("href"));
|
||||
let sizes = get_attr(self.upcast(), &Atom::from_slice("sizes"));
|
||||
let sizes = get_attr(self.upcast(), &atom!("sizes"));
|
||||
|
||||
match href {
|
||||
Some(ref href) if string_is_stylesheet(&rel) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue