-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
/2dcontext/drawing-images-to-the-canvas/2d.drawImage.broken.html seems to have wrong expectations #21683
Comments
I'm also happy to open a PR for this, but first I want it to be clear that the test's expectation is indeed wrong. |
Currently all browsers except Safari pass this test, which suggests that the spec should be updated to match the implementation behaviour. |
That would be the more appropriate thing to do then. The spec <-> test combination is a little confusing, because the test for |
Why is an The Per https://html.spec.whatwg.org/multipage/images.html#current-request "Broken" is defined as follows
(Emphasis added). While some image programs, e.g., ristretto image viewer, might have issues reading the PNG, Chromium 81 and Firefox 72 each are able to decode the image enough to get dimensions. The request for the image itself should not cause any error or exception to be thrown. |
For reference this is what ristretto image viewer at *nix displays when the image is loaded:
however, that reason does not appear to be a specified for an error or exception to be thrown per HTML Standard. |
This code does not throw an error or exception at Chromium or Firefox
This code will throw an exception
yet creating an
|
Thanks for providing so much information and context. My research was obviously not very thorough. My apologies!
Is there something up with that or am I missing something? |
An Would refer to the HTML Standard, where the description of "Broken" does not appear to be applicable to the image being used for the test. Re the
? Some of the tests re Also, would carefully review the For what specific reason is a |
No exception is thrown at Nightly 74 for the same code. Perhaps the image is not "broken" enough within the context of current implementations' capability to decode "broken.png"? |
From
Since
I agree that
My guess is due to this statement from checking the usability of image:
But since the image is not "broken" in the sense of the HTML standard, this test should not expect an |
I agree on this. But then I would not expect |
Since
is not applicable to the image being used, at least not with regards to The tests at WPT are not fail-safe in and of themselves, do not spontaneously update corresponding to updates to specifications or implementations. Therefore, here, do not expect any test to be absolutely accurate. Either an image needs to be used that is "Broken" per the specification or standard being relied on, or the test need to be modified to suit what you are expecting. |
Alright, thanks for clarifying!
Meaning the modifications should be done in a fork and not upstream? |
Yes. Would first clearly define what is expected (pass or faile), and why. Then create various images and test the input and output locally. Then create a branch corresponding to what is actually in the current specification or standard relied on. During the composition of the tests, reviewing each result, it could be the case that a given specification might need to be updated. Or, you might be able to create objects which do in fact meet the existing published criteria. There are no guarantees that either the specification is in accord with current implementations or that implementations are in accord with specifications. As an example, testing resizing of |
Alright, I see. Thank you so much for your patience and your input. I learned a lot of new things through this! |
From the spec of drawImage():
From the checking the usability of the image argument spec:
Currently 2d.drawImage.broken.html checks that
drawImage()
just returns and nothing is painted. To me it looks like the test should check thatdrawImage()
raises anInvalidStateError
.References:
The text was updated successfully, but these errors were encountered: