<?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>34156</bug_id>
          
          <creation_ts>2010-01-26 00:56:28 -0800</creation_ts>
          <short_desc>Incorrect boolean expression in isMailBlockquote() (WebCore/htmlediting.cpp)</short_desc>
          <delta_ts>2010-01-29 13:42:39 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>OS X 10.5</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="Roland Steiner">rolandsteiner</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>darin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>184518</commentid>
    <comment_count>0</comment_count>
    <who name="Roland Steiner">rolandsteiner</who>
    <bug_when>2010-01-26 00:56:28 -0800</bug_when>
    <thetext>Incorrect boolean expression in isMailBlockquote() (WebCore/htmlediting.cpp)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184519</commentid>
    <comment_count>1</comment_count>
      <attachid>47391</attachid>
    <who name="Roland Steiner">rolandsteiner</who>
    <bug_when>2010-01-26 00:59:28 -0800</bug_when>
    <thetext>Created attachment 47391
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184520</commentid>
    <comment_count>2</comment_count>
    <who name="Roland Steiner">rolandsteiner</who>
    <bug_when>2010-01-26 01:01:03 -0800</bug_when>
    <thetext>Could potentially lead to a crash if applied to an attribute named &quot;blockquote&quot;,
or an incorrect result if applied to a different element that has an attribute &quot;cite&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184596</commentid>
    <comment_count>3</comment_count>
      <attachid>47391</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-01-26 08:18:36 -0800</bug_when>
    <thetext>Comment on attachment 47391
Patch

&gt; +        Could potentially lead to a crash if applied to an attribute named &quot;blockquote&quot;,

That&apos;s incorrect. The Node::hasTagName will only return true for an Element. You can look at the implementation to double-check this.

&gt; +        or an incorrect result if applied to a different element that has an attribute &quot;cite&quot;.

I don&apos;t understand this claim.

&gt; +        No new tests. (minor code change)

If the &quot;cite&quot; case existed, you could probably construct a test case for it.

&gt; -    if (!node || (!node-&gt;isElementNode() &amp;&amp; !node-&gt;hasTagName(blockquoteTag)))
&gt; +    if (!node || !node-&gt;isElementNode() || !node-&gt;hasTagName(blockquoteTag))
&gt;          return false;

The isElementNode check is entirely unnecessary and can be removed. That&apos;s probably the best fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184878</commentid>
    <comment_count>4</comment_count>
      <attachid>47478</attachid>
    <who name="Roland Steiner">rolandsteiner</who>
    <bug_when>2010-01-26 18:01:52 -0800</bug_when>
    <thetext>Created attachment 47478
patch - simplified expression</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>185184</commentid>
    <comment_count>5</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-01-27 12:21:29 -0800</bug_when>
    <thetext>It’s too late for this, I guess, but I realized that there must be a real bug here. There *must* have been some way to get this code to run for non-blockquote elements just by adding a cite attribute to them, and this in turn must have done the wrong thing in the editing operation. If we dig into that a bit I think we could reproduce incorrect behavior, although probably not a crash.

So a test case would have been possible and should have been developed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>185333</commentid>
    <comment_count>6</comment_count>
    <who name="Roland Steiner">rolandsteiner</who>
    <bug_when>2010-01-27 21:09:24 -0800</bug_when>
    <thetext>Yes (btw, that was what I was referring to in my remark, was just poorly worded). 

I&apos;ll probably continue to be working on editing anyway, so I&apos;ll keep it in the back of my head and try to come up with (or include it in) a good test case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>185334</commentid>
    <comment_count>7</comment_count>
    <who name="Roland Steiner">rolandsteiner</who>
    <bug_when>2010-01-27 21:11:09 -0800</bug_when>
    <thetext>(forgot: patch was committed in rev. 53885)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>185949</commentid>
    <comment_count>8</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-01-29 13:42:39 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; Yes (btw, that was what I was referring to in my remark, was just poorly
&gt; worded).

Makes sense. I eventually figured that out.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>47391</attachid>
            <date>2010-01-26 00:59:28 -0800</date>
            <delta_ts>2010-01-26 18:01:47 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-34156-20100126175926.patch</filename>
            <type>text/plain</type>
            <size>1411</size>
            <attacher name="Roland Steiner">rolandsteiner</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA1Mzg0MikKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTggQEAKKzIwMTAtMDEtMjYgIFJvbGFuZCBTdGVpbmVyICA8cm9sYW5kc3RlaW5l
ckBjaHJvbWl1bS5vcmc+CisKKyAgICAgICAgUmV2aWV3ZW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sb2Nr
cXVvdGVzKGNvbgogCiBib29sIGlzTWFpbEJsb2NrcXVvdGUoY29uc3QgTm9kZSAqbm9kZSkKIHsK
LSAgICBpZiAoIW5vZGUgfHwgKCFub2RlLT5pc0VsZW1lbnROb2RlKCkgJiYgIW5vZGUtPmhhc1Rh
Z05hbWUoYmxvY2txdW90ZVRhZykpKQorICAgIGlmICghbm9kZSB8fCAhbm9kZS0+aXNFbGVtZW50
Tm9kZSgpIHx8ICFub2RlLT5oYXNUYWdOYW1lKGJsb2NrcXVvdGVUYWcpKQogICAgICAgICByZXR1
cm4gZmFsc2U7CiAgICAgICAgIAogICAgIHJldHVybiBzdGF0aWNfY2FzdDxjb25zdCBFbGVtZW50
ICo+KG5vZGUpLT5nZXRBdHRyaWJ1dGUoInR5cGUiKSA9PSAiY2l0ZSI7Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>47478</attachid>
            <date>2010-01-26 18:01:52 -0800</date>
            <delta_ts>2010-01-26 18:08:24 -0800</delta_ts>
            <desc>patch - simplified expression</desc>
            <filename>bug-34156-20100127110151.patch</filename>
            <type>text/plain</type>
            <size>1202</size>
            <attacher name="Roland Steiner">rolandsteiner</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA1Mzg3NikKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTUgQEAKKzIwMTAtMDEtMjYgIFJvbGFuZCBTdGVpbmVyICA8cm9sYW5kc3RlaW5l
ckBjaHJvbWl1bS5vcmc+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisK
KyAgICAgICAgSW5jb3J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ICAgICAgICAKICAgICByZXR1cm4gc3RhdGlj
X2Nhc3Q8Y29uc3QgRWxlbWVudCAqPihub2RlKS0+Z2V0QXR0cmlidXRlKCJ0eXBlIikgPT0gImNp
dGUiOwo=
</data>
<flag name="review"
          id="29922"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>