Auto merge of #16658 - n0max:remove-index-size-error, r=emilio

Remove IndexSizeError in CanvasRenderingContext2D::drawImage

<!-- Please describe your changes on the following line: -->
The current spec don't expect the IndexSizeError if the rectangle is empty.

---
<!-- 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 #10600 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/16658)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-04-29 13:42:11 -05:00 committed by GitHub
commit 0c4e13cbc5
3 changed files with 2 additions and 13 deletions

View file

@ -350,7 +350,7 @@ impl CanvasRenderingContext2D {
dh);
if !is_rect_valid(source_rect) || !is_rect_valid(dest_rect) {
return Err(Error::IndexSize);
return Ok(());
}
let smoothing_enabled = self.state.borrow().image_smoothing_enabled;
@ -407,7 +407,7 @@ impl CanvasRenderingContext2D {
dh);
if !is_rect_valid(source_rect) || !is_rect_valid(dest_rect) {
return Err(Error::IndexSize);
return Ok(());
}
let smoothing_enabled = self.state.borrow().image_smoothing_enabled;