Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect is_rect_valid checks in CanvasRenderingContext2D::drawImage. #10600

Closed
Ms2ger opened this issue Apr 14, 2016 · 3 comments
Closed

Incorrect is_rect_valid checks in CanvasRenderingContext2D::drawImage. #10600

Ms2ger opened this issue Apr 14, 2016 · 3 comments

Comments

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Apr 14, 2016

Blocks #10597.

Nothing in the spec seems to support throwing IndexSizeErrors with empty rectangles. The spec may have changed since we implemented it, though.

Unfortunately, there seem to be some tests that will start failing with this change (web-platform-tests/wpt#2835). We probably need to write some more tests too.

@n0max
Copy link
Contributor

@n0max n0max commented Apr 23, 2017

Hi, I like to work on this.

The tests
/2dcontext/conformance-requirements/2d.voidreturn.html
/2dcontext/drawing-images-to-the-canvas/2d.drawImage.zerosource.html
are expected to fail and with the changes they pass.

What additional tests are required?

@jdm jdm added the C-assigned label Apr 24, 2017
@jdm
Copy link
Member

@jdm jdm commented Apr 24, 2017

Running ./mach test-wpt tests/wpt/web-platform-tests/2dcontext should not show any unexpected failures (only passes) with these changes.

@n0max
Copy link
Contributor

@n0max n0max commented Apr 24, 2017

I meant both tests are already changed for the current spec and set to FAIL in https://github.com/servo/servo/blob/17fe437fb72694763f0f7f1b4701127ebc2ef5aa/tests/wpt/metadata/2dcontext/drawing-images-to-the-canvas/2d.drawImage.zerosource.html.ini
and https://github.com/servo/servo/blob/234951e4b6d66891cd0cc9705f42e3ca16d9e3d5/tests/wpt/metadata/2dcontext/conformance-requirements/2d.voidreturn.html.ini

Running ./mach test-wpt tests/wpt/web-platform-tests/2dcontext shows

  ▶ Unexpected subtest result in /2dcontext/conformance-requirements/2d.voidreturn.html:
  └ PASS [expected FAIL] void methods return undefined

  ▶ Unexpected subtest result in /2dcontext/drawing-images-to-the-canvas/2d.drawImage.zerosource.html:
  └ PASS [expected FAIL] drawImage with zero-sized source rectangle draws nothing without exception

When I change the ini files to PASS the test runs without failures.

bors-servo added a commit that referenced this issue Apr 29, 2017
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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.