Auto merge of #10535 - frewsxcv:hr-align, r=mbrubeck

Implement 'align' IDL attribute on '<hr>'.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10535)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-04-12 11:18:14 +05:30
commit f9608022ca
7 changed files with 87 additions and 136 deletions

View file

@ -37,6 +37,12 @@ impl HTMLHRElement {
}
impl HTMLHRElementMethods for HTMLHRElement {
// https://html.spec.whatwg.org/multipage/#dom-hr-align
make_getter!(Align, "align");
// https://html.spec.whatwg.org/multipage/#dom-hr-align
make_atomic_setter!(SetAlign, "align");
// https://html.spec.whatwg.org/multipage/#dom-hr-color
make_getter!(Color, "color");
@ -86,6 +92,7 @@ impl VirtualMethods for HTMLHRElement {
fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
match name {
&atom!("align") => AttrValue::from_dimension(value),
&atom!("color") => AttrValue::from_legacy_color(value),
&atom!("width") => AttrValue::from_dimension(value),
_ => self.super_type().unwrap().parse_plain_attribute(name, value),

View file

@ -10,7 +10,7 @@ interface HTMLHRElement : HTMLElement {
// https://html.spec.whatwg.org/multipage/#HTMLHRElement-partial
partial interface HTMLHRElement {
// attribute DOMString align;
attribute DOMString align;
attribute DOMString color;
// attribute boolean noShade;
// attribute DOMString size;