mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add scrollWidth/Height to element interface
Add the scrollWidth and scrollHeight extensions to the element interface.
This commit is contained in:
parent
5fbed88248
commit
16d2778ece
10 changed files with 234 additions and 39 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue