Implement ScrollTop and ScrollLeft getters:

Add new compositor message to get scroll_offset;
Add new layout query for computed value of overflow-x/y;
Implement layer_id method for ThreadSafeLayoutNode;
Add new layout query for layer_id;
Implement script interface for getting scrollTop and scrollLeft, as well as relavant helper functions.
This commit is contained in:
Zhen Zhang 2016-04-03 15:41:37 +08:00
parent f73c6143d5
commit fefdaf76de
12 changed files with 243 additions and 9 deletions

View file

@ -614,6 +614,12 @@ impl Node {
}
}
pub fn scroll_offset(&self) -> Point2D<f32> {
let document = self.owner_doc();
let window = document.window();
window.scroll_offset_query(self.to_trusted_node_address())
}
// https://dom.spec.whatwg.org/#dom-childnode-before
pub fn before(&self, nodes: Vec<NodeOrString>) -> ErrorResult {
// Step 1.