<?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>7363</bug_id>
          
          <creation_ts>2006-02-19 09:16:35 -0800</creation_ts>
          <short_desc>REGRESSION (r12872): Repro crash when clicking the Quick Reply box in Gmail</short_desc>
          <delta_ts>2006-03-01 09:21:06 -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>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://mail.google.com</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction, InRadar, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="musti">mustiman</reporter>
          <assigned_to name="Vicki Murley">vicki</assigned_to>
          <cc>adele</cc>
    
    <cc>alice.barraclough</cc>
    
    <cc>darin</cc>
    
    <cc>Graham.Dennis</cc>
    
    <cc>mitz</cc>
    
    <cc>vicki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>33375</commentid>
    <comment_count>0</comment_count>
    <who name="musti">mustiman</who>
    <bug_when>2006-02-19 09:16:35 -0800</bug_when>
    <thetext>Steps:
Logon to GMail
Click on any message in Inbox
Click on the Quick Reply box to enter a reply
You see the input box with Check Spelling, then WebKit crashes.

Crash Report below:
Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000000

Thread 0 Crashed:
0   com.apple.WebCore        	0x01180b20 WebCore::DocumentImpl::setFocusNode(KXMLCore::PassRefPtr&lt;WebCore::NodeImpl&gt;) + 400
1   com.apple.WebCore        	0x010b0cd4 WebCore::ElementImpl::focus() + 116
2   com.apple.WebCore        	0x01064b10 KJS::HTMLElementFunction::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&amp;) + 1136
3   com.apple.JavaScriptCore 	0x00139ec4 KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&amp;) + 100
4   com.apple.JavaScriptCore 	0x0012badc KJS::FunctionCallDotNode::evaluate(KJS::ExecState*) + 524
5   com.apple.JavaScriptCore 	0x00130468 KJS::ExprStatementNode::execute(KJS::ExecState*) + 104
6   com.apple.JavaScriptCore 	0x001337d8 KJS::SourceElementsNode::execute(KJS::ExecState*) + 488
7   com.apple.JavaScriptCore 	0x00130398 KJS::BlockNode::execute(KJS::ExecState*) + 152
8   com.apple.JavaScriptCore 	0x0013330c KJS::TryNode::execute(KJS::ExecState*) + 108
9   com.apple.JavaScriptCore 	0x001336ec KJS::SourceElementsNode::execute(KJS::ExecState*) + 252
10  com.apple.JavaScriptCore 	0x00130398 KJS::BlockNode::execute(KJS::ExecState*) + 152
11  com.apple.JavaScriptCore 	0x001183f8 KJS::DeclaredFunctionImp::execute(KJS::ExecState*) + 56
12  com.apple.JavaScriptCore 	0x00117d30 KJS::FunctionImp::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&amp;) + 464
13  com.apple.JavaScriptCore 	0x00139ec4 KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&amp;) + 100
14  com.apple.JavaScriptCore 	0x0012c27c KJS::FunctionCallResolveNode::evaluate(KJS::ExecState*) + 524
15  com.apple.JavaScriptCore 	0x00130468 KJS::ExprStatementNode::execute(KJS::ExecState*) + 104
16  com.apple.JavaScriptCore 	0x001336ec KJS::SourceElementsNode::execute(KJS::ExecState*) + 252
17  com.apple.JavaScriptCore 	0x00130398 KJS::BlockNode::execute(KJS::ExecState*) + 152
18  com.apple.JavaScriptCore 	0x001183f8 KJS::DeclaredFunctionImp::execute(KJS::ExecState*) + 56
19  com.apple.JavaScriptCore 	0x00117d30 KJS::FunctionImp::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&amp;) + 464
20  com.apple.JavaScriptCore 	0x00139ec4 KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&amp;) + 100
21  com.apple.JavaScriptCore 	0x0012c27c KJS::FunctionCallResolveNode::evaluate(KJS::ExecState*) + 524
22  com.apple.JavaScriptCore 	0x00130468 KJS::ExprStatementNode::execute(KJS::ExecState*) + 104
23  com.apple.JavaScriptCore 	0x001336ec KJS::SourceElementsNode::execute(KJS::ExecState*) + 252
24  com.apple.JavaScriptCore 	0x00130398 KJS::BlockNode::execute(KJS::ExecState*) + 152
25  com.apple.JavaScriptCore 	0x00130744 KJS::IfNode::execute(KJS::ExecState*) + 484
26  com.apple.JavaScriptCore 	0x001336ec KJS::SourceElementsNode::execute(KJS::ExecState*) + 252
27  com.apple.JavaScriptCore 	0x00130398 KJS::BlockNode::execute(KJS::ExecState*) + 152
28  com.apple.JavaScriptCore 	0x00130744 KJS::IfNode::execute(KJS::ExecState*) + 484
29  com.apple.JavaScriptCore 	0x001337d8 KJS::SourceElementsNode::execute(KJS::ExecState*) + 488
30  com.apple.JavaScriptCore 	0x00130398 KJS::BlockNode::execute(KJS::ExecState*) + 152
31  com.apple.JavaScriptCore 	0x0013330c KJS::TryNode::execute(KJS::ExecState*) + 108
32  com.apple.JavaScriptCore 	0x001336ec KJS::SourceElementsNode::execute(KJS::ExecState*) + 252
33  com.apple.JavaScriptCore 	0x00130398 KJS::BlockNode::execute(KJS::ExecState*) + 152
34  com.apple.JavaScriptCore 	0x001183f8 KJS::DeclaredFunctionImp::execute(KJS::ExecState*) + 56
35  com.apple.JavaScriptCore 	0x00117d30 KJS::FunctionImp::callAsFunction(KJS::ExecState*, KJS::JSObject*, KJS::List const&amp;) + 464
36  com.apple.JavaScriptCore 	0x00139ec4 KJS::JSObject::call(KJS::ExecState*, KJS::JSObject*, KJS::List const&amp;) + 100
37  com.apple.WebCore        	0x010766dc KJS::ScheduledAction::execute(KJS::Window*) + 236
38  com.apple.WebCore        	0x010769d4 KJS::WindowQObject::timerFired(KJS::DOMWindowTimer*) + 148
39  com.apple.WebCore        	0x012d2164 WebCore::TimerBase::fireTimers(double, KXMLCore::Vector&lt;WebCore::TimerBase*, (unsigned long)0&gt; const&amp;) + 324
40  com.apple.WebCore        	0x012d2210 WebCore::TimerBase::sharedTimerFired() + 112
41  com.apple.CoreFoundation 	0x90770aec __CFRunLoopDoTimer + 184
42  com.apple.CoreFoundation 	0x9075d464 __CFRunLoopRun + 1680
43  com.apple.CoreFoundation 	0x9075ca18 CFRunLoopRunSpecific + 268
44  com.apple.HIToolbox      	0x9318f1e0 RunCurrentEventLoopInMode + 264
45  com.apple.HIToolbox      	0x9318e874 ReceiveNextEventCommon + 380
46  com.apple.HIToolbox      	0x9318e6e0 BlockUntilNextEventMatchingListInMode + 96
47  com.apple.AppKit         	0x9366c104 _DPSNextEvent + 384
48  com.apple.AppKit         	0x9366bdc8 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 116
49  com.apple.Safari         	0x000072d4 0x1000 + 25300
50  com.apple.AppKit         	0x9366830c -[NSApplication run] + 472
51  com.apple.AppKit         	0x93758e68 NSApplicationMain + 452
52  com.apple.Safari         	0x0005cfdc 0x1000 + 376796
53  com.apple.Safari         	0x0005ce80 0x1000 + 376448</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33390</commentid>
    <comment_count>1</comment_count>
      <attachid>6612</attachid>
    <who name="">mitz</who>
    <bug_when>2006-02-19 10:51:32 -0800</bug_when>
    <thetext>Created attachment 6612
Test case (crasher)

To see the problem, open the test case and click where indicated. The second time you click, Safari will crash.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33391</commentid>
    <comment_count>2</comment_count>
    <who name="">mitz</who>
    <bug_when>2006-02-19 10:56:05 -0800</bug_when>
    <thetext>This is a regression from r12872 (the fix for &lt;rdar://problem/4315673&gt; and &lt;rdar://problem/4447009&gt;). The crash happens when the element losing focus no longer has a renderer. The fix may be as simple as adding a null check for r right here in DocumentImpl::setFocusNode:

        // Dispatch a change event for text fields or textareas that have been edited
        RenderObject *r = static_cast&lt;RenderObject*&gt;(oldFocusNode.get()-&gt;renderer());
        if ((r-&gt;isTextArea() || r-&gt;isTextField()) &amp;&amp; r-&gt;isEdited()) {
            oldFocusNode-&gt;dispatchHTMLEvent(changeEvent, true, false);
            r-&gt;setEdited(false);
        }

However I&apos;m not sure about the implications of not dispatching the changeEvent in this case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33414</commentid>
    <comment_count>3</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-02-19 15:04:39 -0800</bug_when>
    <thetext>The code quoted here has another problem, too. After calling dispatchHTMLEvent, the renderer may be gone, so we can&apos;t just call r-&gt;setEdited(false) without first re-getting that renderer from the DOM node.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33582</commentid>
    <comment_count>4</comment_count>
    <who name="Graham Dennis">Graham.Dennis</who>
    <bug_when>2006-02-20 23:59:30 -0800</bug_when>
    <thetext>*** Bug 7398 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33583</commentid>
    <comment_count>5</comment_count>
      <attachid>6641</attachid>
    <who name="Graham Dennis">Graham.Dennis</who>
    <bug_when>2006-02-21 00:47:46 -0800</bug_when>
    <thetext>Created attachment 6641
automatic testcase (caused by detached node)

This is a second testcase where the lack of a renderer is caused by a detached node instead of &apos;display: none&apos; styling.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33638</commentid>
    <comment_count>6</comment_count>
    <who name="Vicki Murley">vicki</who>
    <bug_when>2006-02-21 14:20:12 -0800</bug_when>
    <thetext>I&apos;ve attached the patch that fixes this bug, which Adele reviewed and I&apos;ll commit shortly.  

The second test case here (&quot;automatic testcase&quot;), exhibits a second bug.  Focusing a text field from an onload handler fails, b/c the node doesn&apos;t have a renderer when onload fires.  &quot;Automatic testcase&quot; no longer crashes, but the text field isn&apos;t focused as it should be.  This issue has already been reported in another bug (http://bugzilla.opendarwin.org/show_bug.cgi?id=7405).  The attached patch doesn&apos;t aim to fix this second bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33640</commentid>
    <comment_count>7</comment_count>
      <attachid>6650</attachid>
    <who name="Vicki Murley">vicki</who>
    <bug_when>2006-02-21 14:23:50 -0800</bug_when>
    <thetext>Created attachment 6650
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33642</commentid>
    <comment_count>8</comment_count>
    <who name="Vicki Murley">vicki</who>
    <bug_when>2006-02-21 14:33:29 -0800</bug_when>
    <thetext>I haven&apos;t committed a test case for this yet b/c tests that use eventSender are hanging from time to time (see Justin&apos;s comment in the Changelog).  I&apos;m seeing this hang in the test case I&apos;m working on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34646</commentid>
    <comment_count>9</comment_count>
    <who name="Alice Liu">alice.barraclough</who>
    <bug_when>2006-03-01 09:21:06 -0800</bug_when>
    <thetext>&lt;rdar://problem/4462712&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>6612</attachid>
            <date>2006-02-19 10:51:32 -0800</date>
            <delta_ts>2006-02-19 10:51:32 -0800</delta_ts>
            <desc>Test case (crasher)</desc>
            <filename>gmail crash reduction.html</filename>
            <type>text/html</type>
            <size>211</size>
            <attacher>mitz</attacher>
            
              <data encoding="base64">PHNjcmlwdD4KICAgIGZ1bmN0aW9uIHRlc3QoKQogICAgewogICAgICAgIGIuc3R5bGUuZGlzcGxh
eSA9ICdub25lJzsKICAgICAgICBhLnZhbHVlID0gJ25vdyBjbGljayBoZXJlJzsKICAgIH0KPC9z
Y3JpcHQ+CjxpbnB1dCBpZD0iYiIgdHlwZT0idGV4dCIgdmFsdWU9ImNsaWNrIGhlcmUiIG9uZm9j
dXM9InRlc3QoKSI+CjxpbnB1dCBpZD0iYSIgdHlwZT0idGV4dCI+Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>6641</attachid>
            <date>2006-02-21 00:47:46 -0800</date>
            <delta_ts>2006-02-21 00:47:46 -0800</delta_ts>
            <desc>automatic testcase (caused by detached node)</desc>
            <filename>setFocusNode.html</filename>
            <type>text/html</type>
            <size>245</size>
            <attacher name="Graham Dennis">Graham.Dennis</attacher>
            
              <data encoding="base64">PGh0bWw+CjxzY3JpcHQ+CiAgICBmdW5jdGlvbiB0ZXN0KCkKICAgIHsKICAgICAgICBiLnBhcmVu
dE5vZGUucmVtb3ZlQ2hpbGQoYik7CiAgICAgICAgYS5mb2N1cygpOwogICAgfQo8L3NjcmlwdD4K
PGJvZHkgb25Mb2FkPSJiLmZvY3VzKCkiPgo8aW5wdXQgaWQ9ImIiIHR5cGU9InRleHQiIHZhbHVl
PSJjbGljayBoZXJlIiBvbmZvY3VzPSJ0ZXN0KCkiPgo8aW5wdXQgaWQ9ImEiIHR5cGU9InRleHQi
Pgo8L2JvZHk+CjwvaHRtbD4=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>6650</attachid>
            <date>2006-02-21 14:23:50 -0800</date>
            <delta_ts>2006-02-21 14:23:50 -0800</delta_ts>
            <desc>patch</desc>
            <filename>7363.txt</filename>
            <type>text/plain</type>
            <size>1538</size>
            <attacher name="Vicki Murley">vicki</attacher>
            
              <data encoding="base64">SW5kZXg6IGRvbS9Eb2N1bWVudEltcGwuY3BwCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGRvbS9Eb2N1bWVudElt
cGwuY3BwCShyZXZpc2lvbiAx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c2lvbiAxMjkyNikKKysrIENo
YW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE2IEBACisyMDA2LTAyLTIxICBWaWNr
aSBNdXJsZXkgPHZpY2tpQGFwcGxlLmNvbT4KKworICAgICAgICBSZXZpZXdlZCBieSBBZGVsZS4K
KworICAgICAgICAtIGZpeCBodHRwOi8vYnVnemlsbGEub3BlbmRhcndpbi5vcmcvc2hvd19idWcu
Y2dpP2lkPTczNjMKKyAgICAgICAgUkVHUkVTU0lPTiAocjEyODcyKTogUmVwcm8gY3Jhc2ggd2hl
biBjbGlja2luZyB0aGUgUXVpY2sgUmVwbHkgYm94IGluIEdtYWlsCisKKyAgICAgICAgQWRkIGEg
bmlsIGNoZWNrIGZvciB0aGUgcmVuZGVyZXIsIGFuZCByZWZldGNoIHRoZSByZW5kZXJlciBmb3Ig
dGhlIG9sZCBmb2N1cyBub2RlCisgICAgICAgIGFmdGVyIGRpc3BhdGNoaW5nIHRoZSBldmVudC4g
CisKKyAgICAgICAgKiBkb20vRG9jdW1lbnRJbXBsLmNwcDoKKyAgICAgICAgKFdlYkNvcmU6OkRv
Y3VtZW50SW1wbDo6c2V0Rm9jdXNOb2RlKToKKwogMjAwNi0wMi0yMSAgTWFjaWVqIFN0YWNob3dp
YWsgIDxtanNAYXBwbGUuY29tPgogCiAgICAgICAgIFJ1YmJlciBTdGFtcGVkIGJ5IEh5YXR0Lgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>