<?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>83544</bug_id>
          
          <creation_ts>2012-04-09 20:55:44 -0700</creation_ts>
          <short_desc>Make CSSParser::parseValue()&apos;s handling of CSSPropertyCursor more obviously correct.</short_desc>
          <delta_ts>2012-04-17 15:56:46 -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>Unspecified</rep_platform>
          <op_sys>Unspecified</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Luke Macpherson">macpherson</reporter>
          <assigned_to name="Luke Macpherson">macpherson</assigned_to>
          <cc>abarth</cc>
    
    <cc>darin</cc>
    
    <cc>haraken</cc>
    
    <cc>macpherson</cc>
    
    <cc>menard</cc>
    
    <cc>mikelawther</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>598967</commentid>
    <comment_count>0</comment_count>
    <who name="Luke Macpherson">macpherson</who>
    <bug_when>2012-04-09 20:55:44 -0700</bug_when>
    <thetext>Make CSSParser::parseValue()&apos;s handling of CSSPropertyCursor more obviously correct.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>598970</commentid>
    <comment_count>1</comment_count>
      <attachid>136389</attachid>
    <who name="Luke Macpherson">macpherson</who>
    <bug_when>2012-04-09 20:59:31 -0700</bug_when>
    <thetext>Created attachment 136389
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>599158</commentid>
    <comment_count>2</comment_count>
      <attachid>136389</attachid>
    <who name="Alexis Menard (darktears)">menard</who>
    <bug_when>2012-04-10 04:33:48 -0700</bug_when>
    <thetext>Comment on attachment 136389
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=136389&amp;action=review

&gt; Source/WebCore/css/CSSParser.cpp:1595
&gt; +        if (value) {

Why you assert here if you check with an if?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>599163</commentid>
    <comment_count>3</comment_count>
      <attachid>136389</attachid>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2012-04-10 05:11:33 -0700</bug_when>
    <thetext>Comment on attachment 136389
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=136389&amp;action=review

&gt; Source/WebCore/css/CSSParser.cpp:1581
&gt; +        ASSERT(list || value);

I am not sure what the ASSERT() is for. It seems that the ASSERT(list || value) has the same meaning as the ASSERT(value) in the line 1594.

Other changes looks OK to me.

&gt;&gt; Source/WebCore/css/CSSParser.cpp:1595
&gt;&gt; +        if (value) {
&gt; 
&gt; Why you assert here if you check with an if?

Maybe because ASSERT() is ignored in the Release build.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>599217</commentid>
    <comment_count>4</comment_count>
      <attachid>136389</attachid>
    <who name="Alexis Menard (darktears)">menard</who>
    <bug_when>2012-04-10 06:33:54 -0700</bug_when>
    <thetext>Comment on attachment 136389
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=136389&amp;action=review

&gt;&gt;&gt; Source/WebCore/css/CSSParser.cpp:1595
&gt;&gt;&gt; +        if (value) {
&gt;&gt; 
&gt;&gt; Why you assert here if you check with an if?
&gt; 
&gt; Maybe because ASSERT() is ignored in the Release build.

I know it is but what&apos;s the point of asserting here in debug only if you protect the code with the if after, just avoiding the crash in Release but you may get erratic behavior. An example in WebKit code :
bool AccessibilityRenderObject::isPasswordField() const
{
    ASSERT(m_renderer);
    if (!m_renderer-&gt;node() || !m_renderer-&gt;node()-&gt;isHTMLElement())

...

m_renderer validity is not tested.

To me assert means that if the assert is true well we&apos;re in bad shape, it should not happen. It&apos;s a nit pick maybe.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>599223</commentid>
    <comment_count>5</comment_count>
      <attachid>136389</attachid>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2012-04-10 06:41:14 -0700</bug_when>
    <thetext>Comment on attachment 136389
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=136389&amp;action=review

&gt;&gt;&gt;&gt; Source/WebCore/css/CSSParser.cpp:1595
&gt;&gt;&gt;&gt; +        if (value) {
&gt;&gt;&gt; 
&gt;&gt;&gt; Why you assert here if you check with an if?
&gt;&gt; 
&gt;&gt; Maybe because ASSERT() is ignored in the Release build.
&gt; 
&gt; I know it is but what&apos;s the point of asserting here in debug only if you protect the code with the if after, just avoiding the crash in Release but you may get erratic behavior. An example in WebKit code :
&gt; bool AccessibilityRenderObject::isPasswordField() const
&gt; {
&gt;     ASSERT(m_renderer);
&gt;     if (!m_renderer-&gt;node() || !m_renderer-&gt;node()-&gt;isHTMLElement())
&gt; 
&gt; ...
&gt; 
&gt; m_renderer validity is not tested.
&gt; 
&gt; To me assert means that if the assert is true well we&apos;re in bad shape, it should not happen. It&apos;s a nit pick maybe.

Ah, makes sense. Maybe removing the if statement is a solution, since we are assuming that &apos;value&apos; should not be 0 here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>599748</commentid>
    <comment_count>6</comment_count>
      <attachid>136389</attachid>
    <who name="Luke Macpherson">macpherson</who>
    <bug_when>2012-04-10 15:52:29 -0700</bug_when>
    <thetext>Comment on attachment 136389
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=136389&amp;action=review

&gt;&gt; Source/WebCore/css/CSSParser.cpp:1581
&gt;&gt; +        ASSERT(list || value);
&gt; 
&gt; I am not sure what the ASSERT() is for. It seems that the ASSERT(list || value) has the same meaning as the ASSERT(value) in the line 1594.
&gt; 
&gt; Other changes looks OK to me.

This is to document (and enforce) the expected invariant that after the loop has executed, either value is set, or a list of values has been created. If neither of these are true, you have a problem.

&gt;&gt;&gt;&gt;&gt; Source/WebCore/css/CSSParser.cpp:1595
&gt;&gt;&gt;&gt;&gt; +        if (value) {
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; Why you assert here if you check with an if?
&gt;&gt;&gt; 
&gt;&gt;&gt; Maybe because ASSERT() is ignored in the Release build.
&gt;&gt; 
&gt;&gt; I know it is but what&apos;s the point of asserting here in debug only if you protect the code with the if after, just avoiding the crash in Release but you may get erratic behavior. An example in WebKit code :
&gt;&gt; bool AccessibilityRenderObject::isPasswordField() const
&gt;&gt; {
&gt;&gt;     ASSERT(m_renderer);
&gt;&gt;     if (!m_renderer-&gt;node() || !m_renderer-&gt;node()-&gt;isHTMLElement())
&gt;&gt; 
&gt;&gt; ...
&gt;&gt; 
&gt;&gt; m_renderer validity is not tested.
&gt;&gt; 
&gt;&gt; To me assert means that if the assert is true well we&apos;re in bad shape, it should not happen. It&apos;s a nit pick maybe.
&gt; 
&gt; Ah, makes sense. Maybe removing the if statement is a solution, since we are assuming that &apos;value&apos; should not be 0 here.

What&apos;s going on here is that static analysis tools look at the &quot;while (value &amp;&amp; value-&gt;unit == CSSPrimitiveValue::CSS_URI) {&quot; above, and deduce that a possible exit condition of the loop is that value is null. It turns out that we expect that if that has happened we would have handled it in the if (list) case above. Again, this is non-obvious to a cursory reading, and too convoluted for coverity to pick up. So here, the ASSERT is to document the expectation that if value was null, it should have been handled above in the if (list) case, and the if (value) was added to reassure any static analysis tools that we really are not going to do a null-pointer dereference here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>600085</commentid>
    <comment_count>7</comment_count>
      <attachid>136389</attachid>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2012-04-11 00:11:41 -0700</bug_when>
    <thetext>Comment on attachment 136389
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=136389&amp;action=review

&gt;&gt;&gt; Source/WebCore/css/CSSParser.cpp:1581
&gt;&gt;&gt; +        ASSERT(list || value);
&gt;&gt; 
&gt;&gt; I am not sure what the ASSERT() is for. It seems that the ASSERT(list || value) has the same meaning as the ASSERT(value) in the line 1594.
&gt;&gt; 
&gt;&gt; Other changes looks OK to me.
&gt; 
&gt; This is to document (and enforce) the expected invariant that after the loop has executed, either value is set, or a list of values has been created. If neither of these are true, you have a problem.

Think this way:

Basically, ASSERT(... || ...) is not a good form since it is not intuitive. We want to write ASSERT(...) for one variable at the exact place. So let&apos;s consider how we can split ASSERT(list || value) into ASSERT(list) and ASSERT(value). Then the code will look like this:

if (list) {
    if (!value) {
        ...;
    }
}
ASSERT(value);    // already written
if (value) {
    ...;
}

This means that the original ASSERT(list || value) is not needed.

&gt;&gt;&gt;&gt;&gt;&gt; Source/WebCore/css/CSSParser.cpp:1595
&gt;&gt;&gt;&gt;&gt;&gt; +        if (value) {
&gt;&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt;&gt; Why you assert here if you check with an if?
&gt;&gt;&gt;&gt; 
&gt;&gt;&gt;&gt; Maybe because ASSERT() is ignored in the Release build.
&gt;&gt;&gt; 
&gt;&gt;&gt; I know it is but what&apos;s the point of asserting here in debug only if you protect the code with the if after, just avoiding the crash in Release but you may get erratic behavior. An example in WebKit code :
&gt;&gt;&gt; bool AccessibilityRenderObject::isPasswordField() const
&gt;&gt;&gt; {
&gt;&gt;&gt;     ASSERT(m_renderer);
&gt;&gt;&gt;     if (!m_renderer-&gt;node() || !m_renderer-&gt;node()-&gt;isHTMLElement())
&gt;&gt;&gt; 
&gt;&gt;&gt; ...
&gt;&gt;&gt; 
&gt;&gt;&gt; m_renderer validity is not tested.
&gt;&gt;&gt; 
&gt;&gt;&gt; To me assert means that if the assert is true well we&apos;re in bad shape, it should not happen. It&apos;s a nit pick maybe.
&gt;&gt; 
&gt;&gt; Ah, makes sense. Maybe removing the if statement is a solution, since we are assuming that &apos;value&apos; should not be 0 here.
&gt; 
&gt; What&apos;s going on here is that static analysis tools look at the &quot;while (value &amp;&amp; value-&gt;unit == CSSPrimitiveValue::CSS_URI) {&quot; above, and deduce that a possible exit condition of the loop is that value is null. It turns out that we expect that if that has happened we would have handled it in the if (list) case above. Again, this is non-obvious to a cursory reading, and too convoluted for coverity to pick up. So here, the ASSERT is to document the expectation that if value was null, it should have been handled above in the if (list) case, and the if (value) was added to reassure any static analysis tools that we really are not going to do a null-pointer dereference here.

I think that WebKit normally does not write such &quot;reassurance&quot;.

abarth@, darin@ (who will know much about WebKit codebase): Any idea?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>600709</commentid>
    <comment_count>8</comment_count>
    <who name="Luke Macpherson">macpherson</who>
    <bug_when>2012-04-11 16:42:35 -0700</bug_when>
    <thetext>Hi Kentaro, I still don&apos;t feel like we&apos;re on the same page here. 

This is hard to do in the context of a code review / bug tracker, but I think it would be helpful if you took a look at the original code, and try to explain why it is safe to dereference value on line 1593 &quot;id = value-&gt;id;&quot;

I think once you go through that exercise it will become much clearer what this patch is trying to achieve.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>600845</commentid>
    <comment_count>9</comment_count>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2012-04-11 20:39:01 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; Hi Kentaro, I still don&apos;t feel like we&apos;re on the same page here. 
&gt; 
&gt; This is hard to do in the context of a code review / bug tracker, but I think it would be helpful if you took a look at the original code, and try to explain why it is safe to dereference value on line 1593 &quot;id = value-&gt;id;&quot;
&gt; 
&gt; I think once you go through that exercise it will become much clearer what this patch is trying to achieve.

As darktears@ pointed out, I think

- If value-&gt;id should be always safe, put &apos;ASSERT(value)&apos; and remove &apos;if(value)&apos;.
- If value-&gt;id can be unsafe, put &apos;if(value)&apos; and remove &apos;ASSERT(value)&apos;.

The point is that having both &apos;ASSERT(value)&apos; and &apos;if(value)&apos; sounds strange.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>604298</commentid>
    <comment_count>10</comment_count>
      <attachid>137593</attachid>
    <who name="Luke Macpherson">macpherson</who>
    <bug_when>2012-04-17 13:39:59 -0700</bug_when>
    <thetext>Created attachment 137593
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>604306</commentid>
    <comment_count>11</comment_count>
      <attachid>137593</attachid>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2012-04-17 13:46:39 -0700</bug_when>
    <thetext>Comment on attachment 137593
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=137593&amp;action=review

OK

&gt; Source/WebCore/css/CSSParser.cpp:1641
&gt; +            return false;

Nit: What happens if we do not write &apos;return false&apos;? Compile error?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>604325</commentid>
    <comment_count>12</comment_count>
    <who name="Luke Macpherson">macpherson</who>
    <bug_when>2012-04-17 14:04:41 -0700</bug_when>
    <thetext>(In reply to comment #11)
&gt; (From update of attachment 137593 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=137593&amp;action=review
&gt; 
&gt; OK
&gt; 
&gt; &gt; Source/WebCore/css/CSSParser.cpp:1641
&gt; &gt; +            return false;
&gt; 
&gt; Nit: What happens if we do not write &apos;return false&apos;? Compile error?

The safest thing to do is to immediately stop treat the property as invalid if we did get to this state somehow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>604427</commentid>
    <comment_count>13</comment_count>
      <attachid>137593</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-04-17 15:56:40 -0700</bug_when>
    <thetext>Comment on attachment 137593
Patch

Clearing flags on attachment: 137593

Committed r114455: &lt;http://trac.webkit.org/changeset/114455&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>604428</commentid>
    <comment_count>14</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-04-17 15:56:46 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>136389</attachid>
            <date>2012-04-09 20:59:31 -0700</date>
            <delta_ts>2012-04-17 13:39:51 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-83544-20120410135929.patch</filename>
            <type>text/plain</type>
            <size>3145</size>
            <attacher name="Luke Macpherson">macpherson</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTEzNjY1CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggMDU3Y2IzYzgxZWJlOGQ2
OTI3NzJjZTk0MmNiMzU3YWQ1YWFjNjMxMS4uNTFjYmU5ZjM4ZTA3OGI3YjZmOGY2MDU5MDdiY2Ji
Y2MwYjljYTkwMyAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE4IEBACisyMDEyLTA0LTA5ICBMdWtl
IE1hY3BoZXJzb24gIDxtYWNwaGVyc29uQGNocm9taXVtLm9yZz4KKworICAgICAgICBNYWtlIENT
U1BhcnNlcjo6cGFyc2VWYWx1ZSgpJ3MgaGFuZGxpbmcgb2YgQ1NTUHJvcGVydHlDdXJzb3IgbW9y
ZSBvYnZpb3VzbHkgY29ycmVjdC4KKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hv
d19idWcuY2dpP2lkPTgzNTQ0CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISku
CisKKyAgICAgICAgTm8gbmV3IHRlc3RzIC8gY29kZSBjbGVhbnVwIG9ubHkuCisKKyAgICAgICAg
VGhlIGNvZGUgYXMgaXQgc3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1ZhbHVlV2Via2l0R3JhYmJpbmcpIHx8IHZhbHVlLT5p
ZCA9PSBDU1NWYWx1ZUNvcHkgfHwgdmFsdWUtPmlkID09IENTU1ZhbHVlTm9uZSkKKyAgICAgICAg
ICAgICAgICB2YWxpZFByaW1pdGl2ZSA9IHRydWU7CisgICAgICAgIH0KICAgICAgICAgYnJlYWs7
CiAgICAgfQogCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>137593</attachid>
            <date>2012-04-17 13:39:59 -0700</date>
            <delta_ts>2012-04-17 15:56:40 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-83544-20120418063957.patch</filename>
            <type>text/plain</type>
            <size>2947</size>
            <attacher name="Luke Macpherson">macpherson</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTE0NDA1CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggNDk4NTVhYjQ2MGEwMmFm
Mjg5NmM2NDRkZjA0NWJmYzM3MGIyNjY0OS4uNjgwOWU1NzY1NjE3NGI5NGVlNmU2MjRhYjdjYzVk
Yjc0YWEyOTgxMCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE4IEBACisyMDEyLTA0LTA5ICBMdWtl
IE1hY3BoZXJzb24gIDxtYWNwaGVyc29uQGNocm9taXVtLm9yZz4KKworICAgICAgICBNYWtlIENT
U1BhcnNlcjo6cGFyc2VWYWx1ZSgpJ3MgaGFuZGxpbmcgb2YgQ1NTUHJvcGVydHlDdXJzb3IgbW9y
ZSBvYnZpb3VzbHkgY29ycmVjdC4KKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hv
d19idW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1
ZUNvcHkgfHwgdmFsdWUtPmlkID09IENTU1ZhbHVlTm9uZSkKLSAgICAgICAgICAgIHZhbGlkUHJp
bWl0aXZlID0gdHJ1ZTsKICAgICAgICAgYnJlYWs7CiAgICAgfQogCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>