mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #7288 - mdibaiee:computedstyle-element, r=Ms2ger
Fix #7268 - getComputedStyle should take `Element`, not `HTMLElement` This is my first patch, I hope I'm doing it right. About the test, do you think this is enough and reliable? <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7288) <!-- Reviewable:end -->
This commit is contained in:
commit
6e06cae44a
7 changed files with 40 additions and 13 deletions
|
@ -136,7 +136,7 @@ impl<'a> HTMLElementMethods for &'a HTMLElement {
|
|||
fn Style(self) -> Root<CSSStyleDeclaration> {
|
||||
self.style_decl.or_init(|| {
|
||||
let global = window_from_node(self);
|
||||
CSSStyleDeclaration::new(global.r(), self, None, CSSModificationAccess::ReadWrite)
|
||||
CSSStyleDeclaration::new(global.r(), ElementCast::from_ref(self), None, CSSModificationAccess::ReadWrite)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -458,4 +458,3 @@ impl PartialEq for HTMLElementTypeId {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue