mirror of
https://github.com/servo/servo.git
synced 2025-07-25 08:10:21 +01:00
Implement style_attribute() on LayoutJS<Element>.
This commit is contained in:
parent
8a6681ba70
commit
23c679d55a
2 changed files with 11 additions and 5 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue