Auto merge of #15053 - emilio:image-width, r=jdm

Return the intrinsic image dimension when the image is not rendered

See individual commits for details.

r? @jdm

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15053)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-01-18 08:43:19 -08:00 committed by GitHub
commit ba59ee6627
11 changed files with 58 additions and 23 deletions

View file

@ -1604,7 +1604,7 @@ impl ElementMethods for Element {
// https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect
fn GetBoundingClientRect(&self) -> Root<DOMRect> {
let win = window_from_node(self);
let rect = self.upcast::<Node>().bounding_content_box();
let rect = self.upcast::<Node>().bounding_content_box_or_zero();
DOMRect::new(win.upcast(),
rect.origin.x.to_f64_px(),
rect.origin.y.to_f64_px(),