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

@ -625,7 +625,7 @@ impl Document {
// Really what needs to happen is that this needs to go through layout to ask which
// layer the element belongs to, and have it send the scroll message to the
// compositor.
let rect = element.upcast::<Node>().bounding_content_box();
let rect = element.upcast::<Node>().bounding_content_box_or_zero();
// In order to align with element edges, we snap to unscaled pixel boundaries, since
// the paint thread currently does the same for drawing elements. This is important