diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2015-11-09 12:25:34 -0800 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2015-11-09 12:27:16 -0800 |
commit | 4b68fc18c32e889c1726e17bdcf7c0b1bac02b05 (patch) | |
tree | d95b28633c207c8489c17bf020cc8b9edc39203c /components/script/dom/element.rs | |
parent | d8df028197505ca439363cdb05bed58fe9b4b726 (diff) | |
download | servo-4b68fc18c32e889c1726e17bdcf7c0b1bac02b05.tar.gz servo-4b68fc18c32e889c1726e17bdcf7c0b1bac02b05.zip |
Move storage of bgcolor for `<tr>` and `<tbody>`.
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 9c625dde32e..829383a4a62 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -48,8 +48,8 @@ use dom::htmllegendelement::HTMLLegendElement; use dom::htmloptgroupelement::HTMLOptGroupElement; use dom::htmltablecellelement::{HTMLTableCellElement, HTMLTableCellElementLayoutHelpers}; use dom::htmltableelement::{HTMLTableElement, HTMLTableElementLayoutHelpers}; -use dom::htmltablerowelement::HTMLTableRowElement; -use dom::htmltablesectionelement::HTMLTableSectionElement; +use dom::htmltablerowelement::{HTMLTableRowElement, HTMLTableRowElementLayoutHelpers}; +use dom::htmltablesectionelement::{HTMLTableSectionElement, HTMLTableSectionElementLayoutHelpers}; use dom::htmltemplateelement::HTMLTemplateElement; use dom::htmltextareaelement::{HTMLTextAreaElement, RawLayoutHTMLTextAreaElementHelpers}; use dom::namednodemap::NamedNodeMap; @@ -217,8 +217,6 @@ impl RawLayoutElementHelpers for Element { pub trait LayoutElementHelpers { #[allow(unsafe_code)] - unsafe fn get_attr_atom_for_layout(&self, namespace: &Namespace, name: &Atom) -> Option<Atom>; - #[allow(unsafe_code)] unsafe fn has_class_for_layout(&self, name: &Atom) -> bool; #[allow(unsafe_code)] unsafe fn get_classes_for_layout(&self) -> Option<&'static [Atom]>; @@ -231,8 +229,6 @@ pub trait LayoutElementHelpers { -> Option<u32>; #[allow(unsafe_code)] unsafe fn html_element_in_html_document_for_layout(&self) -> bool; - #[allow(unsafe_code)] - unsafe fn has_attr_for_layout(&self, namespace: &Namespace, name: &Atom) -> bool; fn id_attribute(&self) -> *const Option<Atom>; fn style_attribute(&self) -> *const Option<PropertyDeclarationBlock>; fn local_name(&self) -> &Atom; @@ -246,15 +242,6 @@ pub trait LayoutElementHelpers { impl LayoutElementHelpers for LayoutJS<Element> { #[allow(unsafe_code)] #[inline] - unsafe fn get_attr_atom_for_layout(&self, namespace: &Namespace, name: &Atom) - -> Option<Atom> { - get_attr_for_layout(&*self.unsafe_get(), namespace, name).and_then(|attr| { - attr.value_atom_forever() - }) - } - - #[allow(unsafe_code)] - #[inline] unsafe fn has_class_for_layout(&self, name: &Atom) -> bool { get_attr_for_layout(&*self.unsafe_get(), &ns!(""), &atom!("class")).map_or(false, |attr| { attr.value_tokens_forever().unwrap().iter().any(|atom| atom == name) @@ -280,9 +267,9 @@ impl LayoutElementHelpers for LayoutJS<Element> { } else if let Some(this) = self.downcast::<HTMLTableCellElement>() { this.get_background_color() } else if let Some(this) = self.downcast::<HTMLTableRowElement>() { - (*this.unsafe_get()).get_background_color() + this.get_background_color() } else if let Some(this) = self.downcast::<HTMLTableSectionElement>() { - (*this.unsafe_get()).get_background_color() + this.get_background_color() } else { None }; @@ -539,11 +526,6 @@ impl LayoutElementHelpers for LayoutJS<Element> { } #[allow(unsafe_code)] - unsafe fn has_attr_for_layout(&self, namespace: &Namespace, name: &Atom) -> bool { - get_attr_for_layout(&*self.unsafe_get(), namespace, name).is_some() - } - - #[allow(unsafe_code)] fn id_attribute(&self) -> *const Option<Atom> { unsafe { (*self.unsafe_get()).id_attribute.borrow_for_layout() |