Bug 100132
| Summary: | negative scale values in -webkit-image-set are handled incorrectly | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Rick Byers <rbyers> |
| Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ahmad.saleem792, bdakin, koivisto, ntim |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Rick Byers
I noticed none of the existing image-set-parsing tests checked negative scale values, eg:
background-image: url(a.png) -2x, url(b.png) -1x
I tried this in chromium and it appears like it's simply ignorning the leading negative sign. I.e., the '-2x' image is used when the device scale factor is 2. The cssText property also shows the absolute value without the sign.
I'm assuming such rules should be invalid. I glanced at the code for this, and it looks like CSSParser::parseImageSet is supposed to fail on negative values:
if (imageScaleFactor <= 0)
return 0;
So parseDouble is presumably ignorning a leading '-'. I haven't dug in further.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
@Tim & @Antti - is it still an issue, since with Interop 2023 - `image-set` support is improved significantly - https://wpt.fyi/results/css/css-images/image-set?label=master&label=experimental&aligned&view=interop&q=label%3Ainterop-2023-webcompat