<?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>42012</bug_id>
          
          <creation_ts>2010-07-09 17:47:51 -0700</creation_ts>
          <short_desc>Alpha value obtained by getComputedStyle is noticeably less than the actual value.</short_desc>
          <delta_ts>2012-07-15 20:39:54 -0700</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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>91355</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>1</everconfirmed>
          <reporter name="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>patrice</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>249394</commentid>
    <comment_count>0</comment_count>
      <attachid>61124</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-07-09 17:47:51 -0700</bug_when>
    <thetext>Created attachment 61124
demonstrates the bug

When the background color is set to rgba(255, 255, 0.5), the computed style&apos;s background color indicates the actual alpha value to be 0.496094.  Firefox returns 0.5 correctly.  The bug is demonstrated in the attachment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276858</commentid>
    <comment_count>1</comment_count>
    <who name="">patrice</who>
    <bug_when>2010-09-09 17:04:03 -0700</bug_when>
    <thetext>Also, sometimes, assigning the generated rgba color append to generate a new value :

document.body.style.backgroundColor=&quot;rgba(0,0,0,0.3)&quot;;
&quot;rgba(0,0,0,0.3)&quot;
document.body.style.backgroundColor = document.body.style.backgroundColor;
&quot;rgba(0, 0, 0, 0.296875)&quot;
document.body.style.backgroundColor = document.body.style.backgroundColor;
&quot;rgba(0, 0, 0, 0.292969)&quot;
document.body.style.backgroundColor = document.body.style.backgroundColor;
&quot;rgba(0, 0, 0, 0.292969)&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>320988</commentid>
    <comment_count>2</comment_count>
      <attachid>76360</attachid>
    <who name="Daniel Wagner">daniel.wagner</who>
    <bug_when>2010-12-13 01:44:08 -0800</bug_when>
    <thetext>Created attachment 76360
demonstrates issue with getComputedStyle for opacity

Similarly, if an element&apos;s opacity is set to 0.7, getComputedStyle returns 0.699999988079071.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>321231</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2010-12-13 10:37:47 -0800</bug_when>
    <thetext>I think this is a divide-by-255 vs. 256 issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>321392</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2010-12-13 14:05:28 -0800</bug_when>
    <thetext>Internally rgba(255, 255, 0, 0.5) is stored as 0x7fffff00 (ARGB), and 127/255 is 0.49803921568627.

(In reply to comment #2)
&gt; Created an attachment (id=76360) [details]
&gt; demonstrates issue with getComputedStyle for opacity
&gt; 
&gt; Similarly, if an element&apos;s opacity is set to 0.7, getComputedStyle returns 0.699999988079071.

This is just floating point rounding error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>670063</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-07-15 20:39:54 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 91355 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>61124</attachid>
            <date>2010-07-09 17:47:51 -0700</date>
            <delta_ts>2010-07-09 17:47:51 -0700</delta_ts>
            <desc>demonstrates the bug</desc>
            <filename>computedStyleTest.html</filename>
            <type>text/html</type>
            <size>276</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">PGh0bWw+Cjxib2R5Pgo8cD4KPHNwYW4gaWQ9InRlc3QiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9y
OiByZ2JhKDI1NSwgMjU1LCAwLCAwLjUpOyI+aGVsbG8sIHdvcmxkPC9zcGFuPgo8L3A+CjxzY3Jp
cHQgdHlwZT0idGV4dC9qYXZhc2NyaXB0Ij4KCnZhciBlID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5
SWQoJ3Rlc3QnKTsKZG9jdW1lbnQud3JpdGUod2luZG93LmdldENvbXB1dGVkU3R5bGUoZSwgbnVs
bCkuYmFja2dyb3VuZENvbG9yKTsKCjwvc2NyaXB0Pgo8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>76360</attachid>
            <date>2010-12-13 01:44:08 -0800</date>
            <delta_ts>2010-12-13 01:44:08 -0800</delta_ts>
            <desc>demonstrates issue with getComputedStyle for opacity</desc>
            <filename>webkit_opacity.html</filename>
            <type>text/html</type>
            <size>651</size>
            <attacher name="Daniel Wagner">daniel.wagner</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjEvL0VOIiAiaHR0cDov
L3d3dy53My5vcmcvVFIveGh0bWwxMS9EVEQveGh0bWwxMS5kdGQiPgo8aHRtbCB4bWxucz0iaHR0
cDovL3d3dy53My5vcmcvMTk5OS94aHRtbCIgeG1sOmxhbmc9ImVuIj4KPGhlYWQ+CiAgPG1ldGEg
aHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9dXRm
LTgiIC8+CiAgPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KICAjdGVzdCB7CiAgICBiYWNrZ3JvdW5k
LWNvbG9yOiBibGFjazsKICAgIGNvbG9yOiB3aGl0ZTsKICAgIG9wYWNpdHk6IDAuNzsKICB9CiAg
PC9zdHlsZT4KICA8c2NyaXB0IHR5cGU9InRleHQvamF2YXNjcmlwdCI+CiAgd2luZG93Lm9ubG9h
ZCA9IGZ1bmN0aW9uKCkKICB7CiAgICB2YXIgZWwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgi
dGVzdCIpOwogICAgdmFyIGNvbXB1dGVkVmFsdWUgPSBkb2N1bWVudC5kZWZhdWx0Vmlldy5nZXRD
b21wdXRlZFN0eWxlKGVsLCBudWxsKS5vcGFjaXR5OwogICAgZWwuaW5uZXJIVE1MID0gY29tcHV0
ZWRWYWx1ZTsKICB9OwogIDwvc2NyaXB0Pgo8L2hlYWQ+Cjxib2R5PgogIDxkaXYgaWQ9InRlc3Qi
Pjwvb3V0Pgo8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>