Auto merge of #8255 - frewsxcv:rm-font-face-attribute-field, r=eefriedman

Remove struct field for <font> 'face' attribute

Part of #7863

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8255)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-10-30 11:29:29 +05:30
commit a1939b0c6f

View file

@ -4,7 +4,6 @@
use cssparser::RGBA; use cssparser::RGBA;
use dom::attr::{Attr, AttrValue}; use dom::attr::{Attr, AttrValue};
use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::HTMLFontElementBinding; use dom::bindings::codegen::Bindings::HTMLFontElementBinding;
use dom::bindings::codegen::Bindings::HTMLFontElementBinding::HTMLFontElementMethods; use dom::bindings::codegen::Bindings::HTMLFontElementBinding::HTMLFontElementMethods;
use dom::bindings::conversions::Castable; use dom::bindings::conversions::Castable;
@ -23,7 +22,6 @@ use util::str::{self, DOMString, parse_legacy_font_size};
pub struct HTMLFontElement { pub struct HTMLFontElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
color: Cell<Option<RGBA>>, color: Cell<Option<RGBA>>,
face: DOMRefCell<Option<Atom>>,
} }
@ -32,7 +30,6 @@ impl HTMLFontElement {
HTMLFontElement { HTMLFontElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(localName, prefix, document),
color: Cell::new(None), color: Cell::new(None),
face: DOMRefCell::new(None),
} }
} }
@ -82,11 +79,6 @@ impl VirtualMethods for HTMLFontElement {
str::parse_legacy_color(&value).ok() str::parse_legacy_color(&value).ok()
})); }));
}, },
&atom!(face) => {
*self.face.borrow_mut() =
mutation.new_value(attr)
.map(|value| value.as_atom().clone())
},
_ => {}, _ => {},
} }
} }
@ -111,10 +103,11 @@ impl HTMLFontElement {
#[allow(unsafe_code)] #[allow(unsafe_code)]
pub fn get_face(&self) -> Option<Atom> { pub fn get_face(&self) -> Option<Atom> {
let face = unsafe { self.face.borrow_for_layout() }; unsafe {
match *face { self.upcast::<Element>()
Some(ref s) => Some(s.clone()), .get_attr_for_layout(&ns!(""), &atom!("face"))
None => None, .map(AttrValue::as_atom)
.cloned()
} }
} }