Bug 105570 - Applying multiple Filter Functions may lead to unexpected results
Summary: Applying multiple Filter Functions may lead to unexpected results
Status: RESOLVED DUPLICATE of bug 106674
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-12-20 12:54 PST by eric.lemoine
Modified: 2013-01-13 09:48 PST (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 eric.lemoine 2012-12-20 12:54:57 PST
A -webkit-filter with multiple Filter Functions may lead to unexpected results.

This is an example that illustrates the issue:

#rect {
    width: 200px;
    height: 200px;
    background-color: #ff0000; /* red */
    -webkit-filter: brightness(1) brightness(-1);
}

I would expect the -webkit-filter to be a noop in this case, which means that div should stay red. But, instead, the filter makes it black. It makes it black becasuse the first Filter Function changes the color to #ffffff (white), and the second Filter Function changes the color #000000 (black). In other words clipping occurs each time a Filter Function is applied, instead of on the final result.

See http://jsfiddle.net/jwCgV/ for reproducing.
Comment 1 Dirk Schulze 2013-01-11 15:34:55 PST
IIRC this is a duplicate.

*** This bug has been marked as a duplicate of bug 106674 ***
Comment 2 Dirk Schulze 2013-01-13 09:48:03 PST
(In reply to comment #0)

>     -webkit-filter: brightness(1) brightness(-1);

Even if webkit would work as specified, a brightness operation can be irreversible since information get lost (when multiplying the amount, the color value can get beyond 255 or 0, where it get truncated).