Bug 100132 - negative scale values in -webkit-image-set are handled incorrectly
Summary: negative scale values in -webkit-image-set are handled incorrectly
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-23 08:57 PDT by Rick Byers
Modified: 2024-07-28 12:10 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Byers 2012-10-23 08:57:40 PDT
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.
Comment 1 Ahmad Saleem 2024-07-28 12:10:21 PDT
@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