mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Use 'atom!' macro for known static strings
This commit is contained in:
parent
6cc8186481
commit
edc1493932
3 changed files with 4 additions and 4 deletions
|
@ -70,7 +70,7 @@ impl HTMLBodyElementMethods for HTMLBodyElement {
|
||||||
fn SetText(&self, value: DOMString) {
|
fn SetText(&self, value: DOMString) {
|
||||||
let element = self.upcast::<Element>();
|
let element = self.upcast::<Element>();
|
||||||
let color = str::parse_legacy_color(&value).ok();
|
let color = str::parse_legacy_color(&value).ok();
|
||||||
element.set_attribute(&Atom::from_slice("text"), AttrValue::Color(value, color));
|
element.set_attribute(&atom!("text"), AttrValue::Color(value, color));
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#the-body-element
|
// https://html.spec.whatwg.org/multipage/#the-body-element
|
||||||
|
|
|
@ -62,7 +62,7 @@ impl HTMLFontElementMethods for HTMLFontElement {
|
||||||
fn SetSize(&self, value: DOMString) {
|
fn SetSize(&self, value: DOMString) {
|
||||||
let element = self.upcast::<Element>();
|
let element = self.upcast::<Element>();
|
||||||
let length = parse_length(&value);
|
let length = parse_length(&value);
|
||||||
element.set_attribute(&Atom::from_slice("size"), AttrValue::Length(value, length));
|
element.set_attribute(&atom!("size"), AttrValue::Length(value, length));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -304,7 +304,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
|
||||||
fn Mozbrowser(&self) -> bool {
|
fn Mozbrowser(&self) -> bool {
|
||||||
if mozbrowser_enabled() {
|
if mozbrowser_enabled() {
|
||||||
let element = self.upcast::<Element>();
|
let element = self.upcast::<Element>();
|
||||||
element.has_attribute(&Atom::from_slice("mozbrowser"))
|
element.has_attribute(&atom!("mozbrowser"))
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
@ -314,7 +314,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
|
||||||
fn SetMozbrowser(&self, value: bool) -> ErrorResult {
|
fn SetMozbrowser(&self, value: bool) -> ErrorResult {
|
||||||
if mozbrowser_enabled() {
|
if mozbrowser_enabled() {
|
||||||
let element = self.upcast::<Element>();
|
let element = self.upcast::<Element>();
|
||||||
element.set_bool_attribute(&Atom::from_slice("mozbrowser"), value);
|
element.set_bool_attribute(&atom!("mozbrowser"), value);
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue