Implement style_attribute() on LayoutJS<Element>.

This commit is contained in:
Ms2ger 2015-07-04 21:41:34 +02:00
parent 8a6681ba70
commit 23c679d55a
2 changed files with 11 additions and 5 deletions

View file

@ -511,6 +511,7 @@ pub trait LayoutElementHelpers {
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 style_attribute(&self) -> *const Option<PropertyDeclarationBlock>;
}
impl LayoutElementHelpers for LayoutJS<Element> {
@ -528,6 +529,13 @@ impl LayoutElementHelpers for LayoutJS<Element> {
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 style_attribute(&self) -> *const Option<PropertyDeclarationBlock> {
unsafe {
(*self.unsafe_get()).style_attribute.borrow_for_layout()
}
}
}
#[derive(PartialEq)]