mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
script: Rename bounding_content_box to bounding_content_box_or_zero.
And make bounding_content_box preserve whether the element is rendered.
This commit is contained in:
parent
485fe874e8
commit
bdd7cb9753
6 changed files with 11 additions and 8 deletions
|
@ -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>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue