Add scrollWidth/Height to element interface

Add the scrollWidth and scrollHeight extensions to the element
interface.
This commit is contained in:
Daniel Robertson 2016-03-01 16:45:16 +00:00
parent 5fbed88248
commit 16d2778ece
10 changed files with 234 additions and 39 deletions

View file

@ -1421,6 +1421,16 @@ impl ElementMethods for Element {
rect.size.height.to_f64_px())
}
// https://drafts.csswg.org/cssom-view/#dom-element-scrollwidth
fn ScrollWidth(&self) -> i32 {
self.upcast::<Node>().get_scroll_area().size.width
}
// https://drafts.csswg.org/cssom-view/#dom-element-scrollheight
fn ScrollHeight(&self) -> i32 {
self.upcast::<Node>().get_scroll_area().size.height
}
// https://drafts.csswg.org/cssom-view/#dom-element-clienttop
fn ClientTop(&self) -> i32 {
self.upcast::<Node>().get_client_rect().origin.y