mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Auto merge of #6662 - tschneidereit:client-geometry, r=glennw,pcwatson
Implement Element.client{Top,Left,Width,Height} This isn't done, but contains a working implementation of at least `clientTop`. Feedback would be much appreciated: it's probably far from ideal. Implementing `clientLeft` is straight-forward, I think, but `clientWidth` and `clientHeight` require accessing the `border_box` - and I don't know how that works, yet. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6662) <!-- Reviewable:end -->
This commit is contained in:
commit
e0bd80f807
8 changed files with 217 additions and 1 deletions
|
@ -492,6 +492,7 @@ pub trait NodeHelpers {
|
|||
|
||||
fn get_bounding_content_box(self) -> Rect<Au>;
|
||||
fn get_content_boxes(self) -> Vec<Rect<Au>>;
|
||||
fn get_client_rect(self) -> Rect<i32>;
|
||||
|
||||
fn before(self, nodes: Vec<NodeOrString>) -> ErrorResult;
|
||||
fn after(self, nodes: Vec<NodeOrString>) -> ErrorResult;
|
||||
|
@ -794,6 +795,10 @@ impl<'a> NodeHelpers for &'a Node {
|
|||
window_from_node(self).r().content_boxes_query(self.to_trusted_node_address())
|
||||
}
|
||||
|
||||
fn get_client_rect(self) -> Rect<i32> {
|
||||
window_from_node(self).r().client_rect_query(self.to_trusted_node_address())
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-childnode-before
|
||||
fn before(self, nodes: Vec<NodeOrString>) -> ErrorResult {
|
||||
match self.parent_node.get() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue