<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>105570</bug_id>
          
          <creation_ts>2012-12-20 12:54:57 -0800</creation_ts>
          <short_desc>Applying multiple Filter Functions may lead to unexpected results</short_desc>
          <delta_ts>2013-01-13 09:48:03 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>106674</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>eric.lemoine</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cabanier</cc>
    
    <cc>dino</cc>
    
    <cc>krit</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>795695</commentid>
    <comment_count>0</comment_count>
    <who name="">eric.lemoine</who>
    <bug_when>2012-12-20 12:54:57 -0800</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>805685</commentid>
    <comment_count>1</comment_count>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2013-01-11 15:34:55 -0800</bug_when>
    <thetext>IIRC this is a duplicate.

*** This bug has been marked as a duplicate of bug 106674 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>805981</commentid>
    <comment_count>2</comment_count>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2013-01-13 09:48:03 -0800</bug_when>
    <thetext>(In reply to comment #0)

&gt;     -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).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>