Skip to content

Commit

Permalink
Auto merge of #16658 - n0max:remove-index-size-error, r=emilio
Browse files Browse the repository at this point in the history
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 -->
  • Loading branch information
bors-servo committed Apr 29, 2017
2 parents 5dac4fb + 49820a6 commit 0c4e13c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
4 changes: 2 additions & 2 deletions components/script/dom/canvasrenderingcontext2d.rs
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 0c4e13c

Please sign in to comment.