diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-02-09 06:21:29 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-09 06:21:29 -0800 |
commit | 384391da680de3f73557dc721774326bbbf8ade7 (patch) | |
tree | e0f60bb575939198b2c26b92ae4512eff83fbbe5 /components/script/dom/console.rs | |
parent | 6d1836e32bfd1337a3acdf91abb409a399c9f5e3 (diff) | |
parent | 31ad3b294991bf7635a28e049eae6508f7352bbd (diff) | |
download | servo-384391da680de3f73557dc721774326bbbf8ade7.tar.gz servo-384391da680de3f73557dc721774326bbbf8ade7.zip |
Auto merge of #15469 - stshine:no-integer-overflow, r=emilio
layout: Fix integer overflow when computing size of replace elements
<!-- Please describe your changes on the following line: -->
When calculating size of replaced element that has intrinsic aspect ratio, we need to multiply the ratio if one of the dimensions has definite size. And we can not precompute the ratio and store it as a float, because doing so may result one pixel difference in calculation for certain images, thus make some tests fail. So it may overflow when the dimension lengths are large, and this pull request convert them to `i64` before multiplication.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15249 (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- 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/15469)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/console.rs')
0 files changed, 0 insertions, 0 deletions