mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Use static atoms in some places.
This commit is contained in:
parent
d5ee58caf2
commit
9faa2de0fc
3 changed files with 4 additions and 5 deletions
|
@ -520,7 +520,7 @@ impl VirtualMethods for HTMLInputElement {
|
|||
self.radio_group_updated(
|
||||
mutation.new_value(attr).as_ref().map(|value| &***value));
|
||||
},
|
||||
name if name == &Atom::from_slice("placeholder") => {
|
||||
&atom!(placeholder) => {
|
||||
let mut placeholder = self.placeholder.borrow_mut();
|
||||
placeholder.clear();
|
||||
if let AttributeMutation::Set(_) = mutation {
|
||||
|
|
|
@ -45,7 +45,6 @@ use net_traits::{Metadata, AsyncResponseListener, AsyncResponseTarget};
|
|||
use std::cell::{RefCell, Cell};
|
||||
use std::mem;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use string_cache::Atom;
|
||||
use url::{Url, UrlParser};
|
||||
use util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec};
|
||||
|
||||
|
@ -233,7 +232,7 @@ impl HTMLScriptElement {
|
|||
|
||||
// Step 12.
|
||||
let for_attribute = element.get_attribute(&ns!(""), &atom!("for"));
|
||||
let event_attribute = element.get_attribute(&ns!(""), &Atom::from_slice("event"));
|
||||
let event_attribute = element.get_attribute(&ns!(""), &atom!("event"));
|
||||
match (for_attribute.r(), event_attribute.r()) {
|
||||
(Some(for_attribute), Some(event_attribute)) => {
|
||||
let for_value = for_attribute.value().to_ascii_lowercase();
|
||||
|
@ -252,7 +251,7 @@ impl HTMLScriptElement {
|
|||
}
|
||||
|
||||
// Step 13.
|
||||
if let Some(ref charset) = element.get_attribute(&ns!(""), &Atom::from_slice("charset")) {
|
||||
if let Some(ref charset) = element.get_attribute(&ns!(""), &atom!("charset")) {
|
||||
if let Some(encodingRef) = encoding_from_whatwg_label(&charset.r().Value()) {
|
||||
*self.block_character_encoding.borrow_mut() = encodingRef;
|
||||
}
|
||||
|
|
|
@ -1759,7 +1759,7 @@ pub mod longhands {
|
|||
|
||||
#[inline]
|
||||
pub fn get_initial_value() -> computed_value::T {
|
||||
computed_value::T(vec![FontFamily::FamilyName(Atom::from_slice("serif"))])
|
||||
computed_value::T(vec![FontFamily::FamilyName(atom!("serif"))])
|
||||
}
|
||||
/// <family-name>#
|
||||
/// <family-name> = <string> | [ <ident>+ ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue