<?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>140477</bug_id>
          
          <creation_ts>2015-01-14 16:23:47 -0800</creation_ts>
          <short_desc>RenderLayerCompositor: Strange comparison of opacity to boolean.</short_desc>
          <delta_ts>2015-01-15 18:18:37 -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>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>138448</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brent Fulgham">bfulgham</reporter>
          <assigned_to name="Brent Fulgham">bfulgham</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>commit-queue</cc>
    
    <cc>dino</cc>
    
    <cc>esprehn+autocc</cc>
    
    <cc>glenn</cc>
    
    <cc>kondapallykalyan</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>thorton</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1061393</commentid>
    <comment_count>0</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2015-01-14 16:23:47 -0800</bug_when>
    <thetext>I receive the following warning when I build. Reviewing the line in question reveals that we are comparing a boolean (the return value of &quot;ancestorBacking-&gt;graphicsLayer-&gt;drawsContents()&quot;) to the float returned by the style&apos;s opacity property.

This seems very strange. At the very least, we should do some casting here to make it clear that this is intentional (if it is).

            if (newStyle.opacity() != ancestorBacking-&gt;graphicsLayer()-&gt;drawsContent())
                return true;

Where:
opacity is a float
drawsContent is a boolean.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1061397</commentid>
    <comment_count>1</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2015-01-14 16:28:12 -0800</bug_when>
    <thetext>Based on Bug 138448, it looks like this was an intentional comparison, but I think a cast would make it clear that this is desired behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1061401</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2015-01-14 16:35:57 -0800</bug_when>
    <thetext>Agreed it&apos;s odd. Would be fine to clarify.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1061405</commentid>
    <comment_count>3</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2015-01-14 16:40:54 -0800</bug_when>
    <thetext>I neglected to include the compiler error:

18&gt;c:\projects\webkit\opensource\source\webcore\rendering\RenderLayerCompositor.cpp(888): warning C4805: &apos;!=&apos; : unsafe mix of type &apos;float&apos; and type &apos;bool&apos; in operation (..\rendering\RenderingAllInOne.cpp)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1061549</commentid>
    <comment_count>4</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2015-01-15 08:40:08 -0800</bug_when>
    <thetext>This code is checking for non-zero opacity.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1061651</commentid>
    <comment_count>5</comment_count>
      <attachid>244716</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2015-01-15 14:56:37 -0800</bug_when>
    <thetext>Created attachment 244716
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1061734</commentid>
    <comment_count>6</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2015-01-15 18:18:37 -0800</bug_when>
    <thetext>Committed r178568: &lt;http://trac.webkit.org/changeset/178568&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>244716</attachid>
            <date>2015-01-15 14:56:37 -0800</date>
            <delta_ts>2015-01-15 15:39:12 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-140477-20150115150352.patch</filename>
            <type>text/plain</type>
            <size>1595</size>
            <attacher name="Brent Fulgham">bfulgham</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDE3ODUzMikKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE0IEBACisyMDE1LTAxLTE1ICBCcmVudCBG
dWxnaGFtICA8YmZ1bGdoYW1AYXBwbGUuY29tPgorCisgICAgICAgIFJlbmRlckxheWVyQ29tcG9z
aXRvcjogU3RyYW5nZSBjb21wYXJpc29uIG9mIG9wYWNpdHkgKGZsb2F0KSB0byBib29sZWFuLgor
ICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTQwNDc3Lgor
CisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICogcmVuZGVy
aW5nL1JlbmRlckxheWVyQ29tcG9zaXRvci5jcHA6CisgICAgICAgIChXZWJDb3JlOjpzdHlsZUNo
YW5nZVJlcXVpcmVzTGF5ZXJSZWJ1aWxkKTogQWRkIGEgY2FzdCB0byBtYWtlIHRoZSBtZWFuaW5n
IG9mIHRoaXMKKyAgICAgICAgY29kZSBjbGVhcmVyLgorCiAyMDE1LTAxL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udCgpKQorICAgICAgICAgICAgaWYgKHN0YXRpY19jYXN0PGJvb2w+KG5ld1N0eWxl
Lm9wYWNpdHkoKSkgIT0gYW5jZXN0b3JCYWNraW5nLT5ncmFwaGljc0xheWVyKCktPmRyYXdzQ29u
dGVudCgpKQogICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgICB9CiAgICAgfQo=
</data>
<flag name="review"
          id="269647"
          type_id="1"
          status="+"
          setter="simon.fraser"
    />
          </attachment>
      

    </bug>

</bugzilla>