-
Notifications
You must be signed in to change notification settings - Fork 715
[css-images] Define what happens when all image-set options are invalid #8266
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
Comments
I guess, the options in that case are:
Sebastian |
The test is wrong. The spec is very clear that the image-set() function shouldn't become invalid due to the type() argument. The spec doesn't explicitly define what happens when none of the items are valid, so for now use our behavior (just first image), but w3c/csswg-drafts#8266 is on file to possibly change this behavior. In any case the tests before this patch should never render green. Differential Revision: https://phabricator.services.mozilla.com/D165695 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1806025 gecko-commit: 6cc8cc1231f4fb7272e1b9cf82d9cac6cdf7d516 gecko-reviewers: dholbert
The test is wrong. The spec is very clear that the image-set() function shouldn't become invalid due to the type() argument. The spec doesn't explicitly define what happens when none of the items are valid, so for now use our behavior (just first image), but w3c/csswg-drafts#8266 is on file to possibly change this behavior. In any case the tests before this patch should never render green. Differential Revision: https://phabricator.services.mozilla.com/D165695
The test is wrong. The spec is very clear that the image-set() function shouldn't become invalid due to the type() argument. The spec doesn't explicitly define what happens when none of the items are valid, so for now use our behavior (just first image), but w3c/csswg-drafts#8266 is on file to possibly change this behavior. In any case the tests before this patch should never render green. Differential Revision: https://phabricator.services.mozilla.com/D165695 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1806025 gecko-commit: 6cc8cc1231f4fb7272e1b9cf82d9cac6cdf7d516 gecko-reviewers: dholbert
The test is wrong. The spec is very clear that the image-set() function shouldn't become invalid due to the type() argument. The spec doesn't explicitly define what happens when none of the items are valid, so for now use our behavior (just first image), but w3c/csswg-drafts#8266 is on file to possibly change this behavior. In any case the tests before this patch should never render green. Differential Revision: https://phabricator.services.mozilla.com/D165695
I think we should choose not to load any image if there are no options remaining after filtering by type.
Since the MIME type string doesn't determine whether or not the |
I made a PR to change the tests in WPT web-platform-tests/wpt#38662 Please have a look! I can't add reviewers manually. |
I'd prefer to have a resolution or a quick ack from the spec editors before changing the test again, but sure, looks good if we decide to go that route, and it seems sensible. I don't think it matters much in practice between choosing first or choosing not to render an image because the only way to get an empty set but still render something is to lie in the type() function. Still explicitly choosing nothing seems less confusing, so I'd support that. @tabatkins @fantasai @LeaVerou can you confirm? Thanks! |
… no (#38662) supported types in the image-set If the image-set does not contain any images with a supported MIME type the image set is valid but empty. In that case we shouldn't expect any image to render. See w3c/csswg-drafts#8266 for discussion.
Yeah if we discard all the options I'd expect it to be an "invalid image". |
Happy to get a resolution on this, but for now I've gone ahead and edited that into the spec - if you remove all the options, it's an invalid image (and thus renders as a transparent black image with no dimensions). |
…der if there are no supported types in the image-set, a=testonly Automatic update from web-platform-tests [css-images] [image-set] Don't expect an image to render if there are no (#38662) supported types in the image-set If the image-set does not contain any images with a supported MIME type the image set is valid but empty. In that case we shouldn't expect any image to render. See w3c/csswg-drafts#8266 for discussion. -- wpt-commits: 1ba5cfed0836d1f7ea78b115ef6d9c7ed767b8b9 wpt-pr: 38662
The test is wrong. The spec is very clear that the image-set() function shouldn't become invalid due to the type() argument. The spec doesn't explicitly define what happens when none of the items are valid, so for now use our behavior (just first image), but w3c/csswg-drafts#8266 is on file to possibly change this behavior. In any case the tests before this patch should never render green. Differential Revision: https://phabricator.services.mozilla.com/D165695 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1806025 gecko-commit: 6cc8cc1231f4fb7272e1b9cf82d9cac6cdf7d516 gecko-reviewers: dholbert
… no (#38662) supported types in the image-set If the image-set does not contain any images with a supported MIME type the image set is valid but empty. In that case we shouldn't expect any image to render. See w3c/csswg-drafts#8266 for discussion.
The CSS Working Group just discussed
The full IRC log of that discussion<emeyer> emilio: If you specify an invalid type that the UA doesn’t understand, we don’t have a good answer for what happens<emeyer> …Does the UA try to load and then discard? <emeyer> …Tab put in the spec we render an invalid image <emeyer> …The difference is that if the type function ends up invalid, like say it’s PNG in the CSS but then serve a JPEG, it’s a problem <emeyer> …I think what Tab put in the spec is fine <emeyer> astearns: Proposed resolution is to accept what’s been added to the spec? <emeyer> TabAtkins: More specifically, if there are no valid options, it rendered as an invalid image <fantasai> +1 <emeyer> astearns: Objections? <emeyer> RESOLVED: if there are no valid options, render as an invalid image |
…der if there are no supported types in the image-set, a=testonly Automatic update from web-platform-tests [css-images] [image-set] Don't expect an image to render if there are no (#38662) supported types in the image-set If the image-set does not contain any images with a supported MIME type the image set is valid but empty. In that case we shouldn't expect any image to render. See w3c/csswg-drafts#8266 for discussion. -- wpt-commits: 1ba5cfed0836d1f7ea78b115ef6d9c7ed767b8b9 wpt-pr: 38662
Uh oh!
There was an error while loading. Please reload this page.
https://drafts.csswg.org/css-images-4/#image-set-notation says:
What if there are no remaining options? Firefox chooses just the first here but that's fairly arbitrary as well.
The text was updated successfully, but these errors were encountered: