mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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
|
@ -358,7 +358,7 @@ impl HTMLImageElementMethods for HTMLImageElement {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-img-width
|
||||
fn Width(&self) -> u32 {
|
||||
let node = self.upcast::<Node>();
|
||||
let rect = node.bounding_content_box();
|
||||
let rect = node.bounding_content_box_or_zero();
|
||||
rect.size.width.to_px() as u32
|
||||
}
|
||||
|
||||
|
@ -370,7 +370,7 @@ impl HTMLImageElementMethods for HTMLImageElement {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-img-height
|
||||
fn Height(&self) -> u32 {
|
||||
let node = self.upcast::<Node>();
|
||||
let rect = node.bounding_content_box();
|
||||
let rect = node.bounding_content_box_or_zero();
|
||||
rect.size.height.to_px() as u32
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue