diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-17 00:27:49 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-01-18 16:49:52 +0100 |
commit | bdd7cb9753981ad09e8258335546641b1aea3c45 (patch) | |
tree | c4e505013adc80002266ef75099287fe9029e92c /components/script/dom/node.rs | |
parent | 485fe874e8674e9a54b69e3f78f1bb9f43fdbbc9 (diff) | |
download | servo-bdd7cb9753981ad09e8258335546641b1aea3c45.tar.gz servo-bdd7cb9753981ad09e8258335546641b1aea3c45.zip |
script: Rename bounding_content_box to bounding_content_box_or_zero.
And make bounding_content_box preserve whether the element is rendered.
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 940f98fc8fd..71547c860bc 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -526,10 +526,13 @@ impl Node { /// Returns the rendered bounding content box if the element is rendered, /// and none otherwise. - pub fn bounding_content_box(&self) -> Rect<Au> { + pub fn bounding_content_box(&self) -> Option<Rect<Au>> { window_from_node(self) .content_box_query(self.to_trusted_node_address()) - .unwrap_or_else(Rect::zero) + } + + pub fn bounding_content_box_or_zero(&self) -> Rect<Au> { + self.bounding_content_box().unwrap_or_else(Rect::zero) } pub fn content_boxes(&self) -> Vec<Rect<Au>> { |