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

ImageData constructors intermix logic #24274

Closed
jdm opened this issue Sep 24, 2019 · 1 comment
Closed

ImageData constructors intermix logic #24274

jdm opened this issue Sep 24, 2019 · 1 comment

Comments

@jdm
Copy link
Member

@jdm jdm commented Sep 24, 2019

The ImageData specification has two constructors. They have different logic about what arguments are valid are not. The implementation of these constructors tries to share code and ends up getting the checks a bit confused, causing some of the automated tests for the specification logic to fail.

Code: components/script/dom/imagedata.rs
Tests: ./mach test-wpt tests/wpt/web-platform-tests/2dcontext/pixel-manipulation

In particular, see 2d.imageData.object.ctor.array.bounds.html. Remove tests/wpt/metadata/2dcontext/pixel-manipulation/2d.imageData.object.ctor.array.bounds.html.ini so the test expects to pass, then run ./mach test-wpt tests/wpt/web-platform-tests/2dcontext/pixel-manipulation/2d.imageData.object.ctor.array.bounds.html to see the failing test output in your terminal after closing the window.

@jdm jdm added the A-content/dom label Sep 24, 2019
@iinuwa
Copy link
Contributor

@iinuwa iinuwa commented Sep 24, 2019

I'll take a look at this.

@jdm jdm added the C-assigned label Sep 24, 2019
bors-servo added a commit that referenced this issue Sep 26, 2019
Add check for empty data on ImageData constructor.

<!-- Please describe your changes on the following line: -->
This commit implements the nonzero check for ImageData::new_with_jsobject() according to the ImageData spec.

---
<!-- 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 #24274 (GitHub issue number if applicable)

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- 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/24275)
<!-- 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.

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