<?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>16951</bug_id>
          
          <creation_ts>2008-01-20 15:47:10 -0800</creation_ts>
          <short_desc>Assertion failure in FrameView::scheduleRelayout (!m_frame-&gt;document() || !m_frame-&gt;document()-&gt;inPageCache()) when going back from a page with a focused popup</short_desc>
          <delta_ts>2008-01-20 18:02:44 -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>Mac</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>mitz</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aroben</cc>
    
    <cc>timothy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>67798</commentid>
    <comment_count>0</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-01-20 15:47:10 -0800</bug_when>
    <thetext>Going back to about:blank from a back/forward-cacheable document that has a focused popup button results in an assertion failure:

ASSERTION FAILED: !m_frame-&gt;document() || !m_frame-&gt;document()-&gt;inPageCache()
(WebCore/page/FrameView.cpp:714 void WebCore::FrameView::scheduleRelayout())

Steps to reproduce:
1) Go to about:blank
2) Go to data:text/html,%3Cselect%3E
3) Press Tab to focus the popup button
4) Choose History &gt; Back.

Backtrace:
#0  0x01bc0597 in WebCore::FrameView::scheduleRelayout (this=0x196326d0) at WebCore/page/FrameView.cpp:714
#1  0x01e1216d in WebCore::RenderObject::scheduleRelayout (this=0x19cef64c) at WebCore/rendering/RenderObject.cpp:2738
#2  0x01e1239b in WebCore::RenderObject::markContainingBlocksForLayout (this=0x19c8f3ec, scheduleRelayout=true, newRoot=0x0) at WebCore/rendering/RenderObject.cpp:757
#3  0x01e12493 in WebCore::RenderObject::setNeedsLayout (this=0x19c8f3ec, b=true, markParents=true) at WebCore/rendering/RenderObject.cpp:688
#4  0x01a3a53f in WebCore::RenderObject::setNeedsLayoutAndPrefWidthsRecalc (this=0x19c8f3ec) at RenderObject.h:393
#5  0x01e13112 in WebCore::RenderObject::setStyle (this=0x19c8f3ec, style=0x19c53b1c) at WebCore/rendering/RenderObject.cpp:2321
#6  0x01dcceeb in WebCore::RenderBox::setStyle (this=0x19c8f3ec, newStyle=0x19c53b1c) at WebCore/rendering/RenderBox.cpp:83
#7  0x01db6145 in WebCore::RenderBlock::setStyle (this=0x19c8f3ec, _style=0x19c53b1c) at WebCore/rendering/RenderBlock.cpp:127
#8  0x01db61fd in WebCore::RenderBlock::setStyle (this=0x196c49ec, _style=0x195dfc4c) at WebCore/rendering/RenderBlock.cpp:135
#9  0x01e07af5 in WebCore::RenderMenuList::setStyle (this=0x196c49ec, newStyle=0x195dfc4c) at WebCore/rendering/RenderMenuList.cpp:121
#10 0x01e1598f in WebCore::RenderObject::setAnimatableStyle (this=0x196c49ec, style=0x195dfc4c) at WebCore/rendering/RenderObject.cpp:2162
#11 0x01d8c665 in WebCore::Node::setRenderStyle (this=0x19ced530, s=0x195dfc4c) at WebCore/dom/Node.cpp:1052
#12 0x01b666d6 in WebCore::Element::recalcStyle (this=0x19ced530, change=WebCore::Node::NoChange) at WebCore/dom/Element.cpp:741
#13 0x01bf1a5a in WebCore::HTMLGenericFormElement::recalcStyle (this=0x19ced530, change=WebCore::Node::NoChange) at WebCore/html/HTMLGenericFormElement.cpp:176
#14 0x01c25102 in WebCore::HTMLSelectElement::recalcStyle (this=0x19ced530, ch=WebCore::Node::NoChange) at WebCore/html/HTMLSelectElement.cpp:112
#15 0x01b6686c in WebCore::Element::recalcStyle (this=0x19634870, change=WebCore::Node::NoChange) at WebCore/dom/Element.cpp:765
#16 0x01b6686c in WebCore::Element::recalcStyle (this=0x19e739e0, change=WebCore::Node::NoChange) at WebCore/dom/Element.cpp:765
#17 0x01b39aa6 in WebCore::Document::recalcStyle (this=0x3b5a200, change=WebCore::Node::NoChange) at WebCore/dom/Document.cpp:1103
#18 0x01b2fead in WebCore::Document::updateRendering (this=0x3b5a200) at WebCore/dom/Document.cpp:1126
#19 0x01b31e61 in WebCore::Document::updateDocumentsRendering () at WebCore/dom/Document.cpp:1136
#20 0x01b7799a in WebCore::EventTarget::dispatchGenericEvent (this=0x19ced558, referenceNode=0x19ced530, e=@0xbfffd43c, tempEvent=true) at WebCore/dom/EventTarget.cpp:264
#21 0x01b78912 in WebCore::EventTargetNode::dispatchEvent (this=0x19ced530, e=@0xbfffd478, ec=@0xbfffd474, tempEvent=true) at WebCore/dom/EventTargetNode.cpp:115
#22 0x01b7a0d2 in WebCore::EventTargetNode::dispatchHTMLEvent (this=0x19ced530, eventType=@0x233c5c4, canBubbleArg=false, cancelableArg=false) at WebCore/dom/EventTargetNode.cpp:350
#23 0x01b7a11e in WebCore::EventTargetNode::dispatchBlurEvent (this=0x19ced530) at WebCore/dom/EventTargetNode.cpp:343
#24 0x01c24f31 in WebCore::HTMLSelectElement::dispatchBlurEvent (this=0x19ced530) at WebCore/html/HTMLSelectElement.cpp:590
#25 0x01b35274 in WebCore::Document::setFocusedNode (this=0x3b5a200, newFocusedNode=@0xbfffd544) at WebCore/dom/Document.cpp:2286
#26 0x0032e248 in -[WebHTMLView clearFocus] (self=0x19e28620, _cmd=0x3b98f8) at WebKit/mac/WebView/WebHTMLView.mm:2723
#27 0x003271f4 in -[WebHTMLView resignFirstResponder] (self=0x19e28620, _cmd=0x900d789c) at WebKit/mac/WebView/WebHTMLView.mm:3192
#28 0x90edc2ed in -[NSWindow makeFirstResponder:] ()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67799</commentid>
    <comment_count>1</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-01-20 16:02:14 -0800</bug_when>
    <thetext>Note that this does not happen with focused &lt;input&gt; text fields, because in that case -[WebHTMLView maintainsInactiveSelection] returns YES and therefore -resignFirstResponder does not call -clearFocus.

I think putting a page into the back/forward cache should never change the focused node in that document (so it should also not dispatch a blur event). That&apos;s how it works for text fields, and I see no reason why it should be different for popups.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67803</commentid>
    <comment_count>2</comment_count>
      <attachid>18570</attachid>
    <who name="">mitz</who>
    <bug_when>2008-01-20 16:53:11 -0800</bug_when>
    <thetext>Created attachment 18570
Do not allow focus to change in pages that are in the back/forward cache

Cannot make a regression test because the back/forward cache is disabled in DumpRenderTree.

Besides clearing the focused node, -[WebHTMLView resignFirstResponder] also clears the selection (if it is not in editable content). The patch leaves the selection clearing behavior intact.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67811</commentid>
    <comment_count>3</comment_count>
      <attachid>18570</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2008-01-20 17:57:06 -0800</bug_when>
    <thetext>Comment on attachment 18570
Do not allow focus to change in pages that are in the back/forward cache

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67813</commentid>
    <comment_count>4</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-01-20 18:02:44 -0800</bug_when>
    <thetext>Fixed in &lt;http://trac.webkit.org/projects/webkit/changeset/29679&gt;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>18570</attachid>
            <date>2008-01-20 16:53:11 -0800</date>
            <delta_ts>2008-01-20 17:57:06 -0800</delta_ts>
            <desc>Do not allow focus to change in pages that are in the back/forward cache</desc>
            <filename>16951_r1.diff</filename>
            <type>text/plain</type>
            <size>1309</size>
            <attacher>mitz</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiAyOTY3OCkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTUgQEAKKzIwMDgtMDEtMjAgIERhbiBCZXJuc3RlaW4gIDxtaXR6QGFwcGxlLmNv
bT4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICAtIGZp
eCBodHRwOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xNjk1MQorICAgICAgICAg
IEFzc2VydGlvbiBmYWlsdXJlIGluIEZyYW1lVmlldzo6c2NoZWR1bGVSZWxheW91dCAoIW1fZnJh
bWUtPmRvY3VtZW50KCkgfHwgIW1fZnJhbWUtPmRvY3VtZW50KCktPmluUGFnZUNhY2hlKCkpIHdo
ZW4gZ29pbmcgYmFjayBmcm9tIGEgcGFnZSB3aXRoIGEgZm9jdXNlZCBwb3B1cAorCisgICAgICAg
ICogZG9tL0RvY3VtZW50LmNwcDoKKyAgICAgICAgKFdlYkNvcmU6OkRvY3VtZW50OjpzZXRGb2N1
c2VkTm9kZSk6IEJhaWwgb3V0IGlmIHRoZSBkb2N1bWVudCBpcyBpbiB0aGUKKyAgICAgICAgcGFn
ZSBjYWNoZS4gRG9jdW1lbnRzIGluIHRoZSBiYWNrL2ZvcndhcmQgY2FjaGUgYXJlICJmcm96ZW4i
IGFuZCBzaG91bGQKKyAgICAgICAgbm90IGNoYW5nZSBzdGF0ZS4KKwogMjAwOC0wMS0yMCAgQ29s
bGluIEphY2tzb24gIDx3ZWJraXRAY29sbGluamFja3Nvbi5jb20+CiAKICAgICAgICAgUmV2aWV3
ZWQgYnkgU2FtIFdlaW5pZy4KSW5kZXg6IFdlYkNvcmUvZG9tL0RvY3VtZW50LmNwcAo9PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09Ci0tLSBXZWJDb3JlL2RvbS9Eb2N1bWVudC5jcHAJKHJldmlzaW9uIDI5Njc3KQorKysgV2Vi
Q29yZS9kb20vRG9jdW1lbnQuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0yMjYyLDcgKzIyNjIsMTAg
QEAgYm9vbCBEb2N1bWVudDo6c2V0Rm9jdXNlZE5vZGUoUGFzc1JlZlB0cgogCiAgICAgaWYgKG1f
Zm9jdXNlZE5vZGUgPT0gbmV3Rm9jdXNlZE5vZGUpCiAgICAgICAgIHJldHVybiB0cnVlOwotICAg
ICAgICAKKworICAgIGlmIChtX2luUGFnZUNhY2hlKQorICAgICAgICByZXR1cm4gZmFsc2U7CisK
ICAgICBib29sIGZvY3VzQ2hhbmdlQmxvY2tlZCA9IGZhbHNlOwogICAgIFJlZlB0cjxOb2RlPiBv
bGRGb2N1c2VkTm9kZSA9IG1fZm9jdXNlZE5vZGU7CiAgICAgbV9mb2N1c2VkTm9kZSA9IDA7Cg==
</data>
<flag name="review"
          id="8124"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>