<?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>11675</bug_id>
          
          <creation_ts>2006-11-22 02:52:59 -0800</creation_ts>
          <short_desc>REGRESSION(r17871): Pages do not render properly when using the back/forward buttons in certain cases</short_desc>
          <delta_ts>2006-12-07 08:18:33 -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>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></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chris Beckinsale">chrisw27</reporter>
          <assigned_to name="Brady Eidson">beidson</assigned_to>
          <cc>beidson</cc>
    
    <cc>c.petersen87</cc>
    
    <cc>darin</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>dev+webkit</cc>
    
    <cc>mrowe</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>44778</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Beckinsale">chrisw27</who>
    <bug_when>2006-11-22 02:52:59 -0800</bug_when>
    <thetext>The pages are not rendering correctly after using the back/forward buttons to navigate. This seems to be happening only after clicking a link that opens up a new window.

This bug behaves the same way as bug #11590, as the pages are loading in background, but don&apos;t seem to render anything visible. There are more ways to reproduce this, but this is the fastest and easiest I&apos;ve encountered.

Steps to Reproduce:
1. Start from an existing page and go to
http://www.webdevelopersnotes.com/tutorials/adhtml/html_links_target_attribute_of_anchor_tag.php3

2. Click back then click forward (You will be on the test page again)
3. Open any of the test scripts and close the new window it creates
4. Click Back</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44755</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2006-11-22 03:01:21 -0800</bug_when>
    <thetext>I can reproduce this with ToT.  I also see a crash due to a null Frame when clicking on the blank page:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x0000000c
0x010c9755 in WebCore::Frame::eventHandler (this=0x0) at WebCore/page/Frame.cpp:1453
1453        return &amp;d-&gt;m_eventHandler;
(gdb) bt
#0  0x010c9755 in WebCore::Frame::eventHandler (this=0x0) at WebCore/page/Frame.cpp:1453
#1  0x0034c38b in -[WebHTMLView(WebDocumentInternalProtocols) elementAtPoint:allowShadowContent:] (self=0x181abfe0, _cmd=0x3b92c4, point={x = 454, y = 243}, allow=1 &apos;\001&apos;) at WebKit/WebView/WebHTMLView.m:6144
#2  0x003427c6 in -[WebHTMLView _isSelectionEvent:] (self=0x181abfe0, _cmd=0x90a79648, event=0x18c79df0) at WebKit/WebView/WebHTMLView.m:2887
#3  0x00342a9d in -[WebHTMLView shouldDelayWindowOrderingForEvent:] (self=0x181abfe0, _cmd=0x90ac6138, event=0x18c79df0) at WebKit/WebView/WebHTMLView.m:2918
#4  0x9334b67c in -[NSWindow sendEvent:] ()
#5  0x0002338e in ?? ()
#6  0x9333e350 in -[NSApplication sendEvent:] ()
#7  0x00022f1e in ?? ()
#8  0x93268dfe in -[NSApplication run] ()
#9  0x9325cd2f in NSApplicationMain ()
#10 0x0005f7de in ?? ()
#11 0x0005f6f9 in ?? ()
Current language:  auto; currently c++
(gdb) 
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44748</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2006-11-22 03:31:08 -0800</bug_when>
    <thetext>Local testing reveals that r17871, the fix for bug 11669, is the cause of this problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44557</commentid>
    <comment_count>3</comment_count>
    <who name="">mitz</who>
    <bug_when>2006-11-24 02:19:05 -0800</bug_when>
    <thetext>The buggy behavior results from navigating back/forward to a WebHTMLView that&apos;s already been -close&apos;d. This problem has existed prior to r17871, but clearing the private data (in particular, the data source) made it more evident. What I&apos;ve seen is that -[WebHTMLView close] is called from +[WebHistoryItem _closeObjectsInPendingPageCaches], but the WebFrame has its own WebHistoryItem which holds a pageCache which references the now-closed WebHTMLView. When you navigate back/forward, the WebHTMLView is pulled from there and reused despite having been closed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44558</commentid>
    <comment_count>4</comment_count>
    <who name="">mitz</who>
    <bug_when>2006-11-24 04:38:14 -0800</bug_when>
    <thetext>The crash can be reproduced with any two cacheable pages, if the timing is correct (because of the 2.5-second pageCache release timer). You can use
defaults write com.apple.Safari WebKitLogLevel -string 00080000
to track the events.
1) Go to data:text/html,A
2) In the same window, go to data:text/html,B
3) Go back to A and quickly go forward to B
4) Wait 5 seconds (or until you see &quot;releasing 2 items&quot; it logging is enabled).
5) Go back to A and click anywhere on the page

In step 3, when you navigate back to A, its pageCache, referencing its WebHTMLView, is scheduled for release, but then when you navigate forward to B, a new pageCache is created for A, referencing the same WebHTMLView. 2.5 seconds later the original pageCache is released and the WebHTMLView is closed.

Currently a WebHistoryItem has no way of knowing of pageCaches that it has scheduled for release, but perhaps this can be changed by maintaining a set of &quot;WebHistoryItems pending pageCache release&quot; instead of the current set of &quot;pageCaches pending release&quot;. Then this set could be checked against in -setHasPageCache:YES.

To see the effects of this bug before r17871, use an &quot;A&quot; page that has links or hover effects and notice that after step 5, the hover effects don&apos;t work and the cursor and Safari status bar don&apos;t change over links.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44505</commentid>
    <comment_count>5</comment_count>
    <who name="Chris Petersen">c.petersen87</who>
    <bug_when>2006-11-24 22:35:27 -0800</bug_when>
    <thetext>With r17878, I&apos;m encountering this same issue as described when navigating (back/forward) between cached pages in my history.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43062</commentid>
    <comment_count>6</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2006-12-06 15:15:14 -0800</bug_when>
    <thetext>I&apos;ll have this one figured out shortly</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43064</commentid>
    <comment_count>7</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2006-12-06 15:31:24 -0800</bug_when>
    <thetext>As a result of r17871, releasing a page cache now causes the WebHTMLView&apos;s datasource to be release and nil&apos;d out.  I&apos;ve confirmed that commenting out the lines in Darin&apos;s patch which do that fix this regression.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43067</commentid>
    <comment_count>8</comment_count>
      <attachid>11759</attachid>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2006-12-06 16:04:10 -0800</bug_when>
    <thetext>Created attachment 11759
Darin and I hashed this one out</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43069</commentid>
    <comment_count>9</comment_count>
      <attachid>11759</attachid>
    <who name="John Sullivan">sullivan</who>
    <bug_when>2006-12-06 16:48:56 -0800</bug_when>
    <thetext>Comment on attachment 11759
Darin and I hashed this one out

Thank goodness.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43070</commentid>
    <comment_count>10</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2006-12-06 16:59:01 -0800</bug_when>
    <thetext>Committed in r18049

Please verify!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43078</commentid>
    <comment_count>11</comment_count>
    <who name="">mitz</who>
    <bug_when>2006-12-06 23:24:01 -0800</bug_when>
    <thetext>(In reply to comment #10)
&gt; Committed in r18049
&gt; 
&gt; Please verify!
&gt; 

I was going to comment that &quot;reopening&quot; the WebHTMLView doesn&apos;t resume listening for WebPreferencesChangedNotification, so when you&apos;re back in the &quot;A&quot; page, changing the showsURLsInToolTips preference will have no effect. I made an app to test it, and while it&apos;s true, there&apos;s an even bigger problem with that preference, in that the first time _resetCachedWebPreferences is called, to pick up the initial value, [self _webView] is still nil, so the value is taken from the standard preferences.

I will file a separate bug on that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43023</commentid>
    <comment_count>12</comment_count>
    <who name="">mitz</who>
    <bug_when>2006-12-07 08:18:33 -0800</bug_when>
    <thetext>(In reply to comment #11)

&gt; I will file a separate bug on that.
&gt; 

Bug 11775.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>11759</attachid>
            <date>2006-12-06 16:04:10 -0800</date>
            <delta_ts>2006-12-06 16:48:56 -0800</delta_ts>
            <desc>Darin and I hashed this one out</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>4262</size>
            <attacher name="Brady Eidson">beidson</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmVTdXBwb3J0L1dlYkZyYW1lTG9hZGVyQ2xpZW50Lm1tCj09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0K
LS0tIFdlYkNvcmVTdXBwb3J0L1dlYkZyYW1lTG9hZGVyQ2xpZW50Lm1tCShyZXZpc2lvbiAxODA0
NikKKysrIFdlYkNvcmVTdXBwb3J0L1dlYkZyYW1lTG9hZGVyQ2xpZW50Lm1tCSh3b3JraW5nIGNv
cHkpCkBAIC0yMTMsOCArMjEzLDExIEBACiAKIHZvaWQgV2ViRnJhbWVMb2FkZXJDbGllbnQ6OnNl
dERvY3VtZW50Vmlld0Zyb21QYWdlQ2FjaGUoTlNEaWN0aW9uYXJ5ICpwYWdlQ2FjaGUpCiB7Cisg
ICAgV2ViRGF0YVNvdXJjZSAqY2FjaGVkRGF0YVNvdXJjZSA9IF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YmplY3RzSW5QZW5k
aW5nUGFnZUNhY2hlc107CiAgICAgW19wZW5kaW5nUGFnZUNhY2hlVG9SZWxlYXNlIHJlbW92ZUFs
bE9iamVjdHNdOwpJbmRleDogV2ViVmlldy9XZWJIVE1MVmlldy5tCj09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdl
YlZpZXcvV2ViSFRNTFZpZXcubQkocmV2aXNpb24gMTgwNDYpCisrKyBXZWJWaWV3L1dlYkhUTUxW
aWV3Lm0JKHdvcmtpbmcgY29weSkKQEAgLTMxOTEsNyArMzE5MSwxMSBAQAogCiAtICh2b2lkKXNl
dERhdGFTb3VyY2U6KFdlYkRhdGFTb3VyY2UgKilkYXRhU291cmNlIAogeworICAgIEFTU0VSVChk
YXRhU291cmNlKTsKKyAgICBpZiAoX3ByaXZhdGUtPmRhdGFTb3VyY2UgPT0gZGF0YVNvdXJjZSkK
KyAgICAgICAgcmV0dXJuOwogICAgIEFTU0VSVCghX3ByaXZhdGUtPmRhdGFTb3VyY2UpOworICAg
IF9wcml2YXRlLT5jbG9zZWQgPSBOTzsgLy8gc2V0dGluZyBhIGRhdGEgc291cmNlIHJlb3BlbnMg
YSBjbG9zZWQgdmlldwogICAgIF9wcml2YXRlLT5kYXRhU291cmNlID0gW2RhdGFTb3VyY2UgcmV0
YWluXTsKICAgICBbX3ByaXZhdGUtPnBsdWdpbkNvbnRyb2xsZXIgc2V0RGF0YVNvdXJjZTpkYXRh
U291cmNlXTsKICAgICBbc2VsZiBhZGRNb3VzZU1vdmVkT2JzZXJ2ZXJdOwo=
</data>
<flag name="review"
          id="4254"
          type_id="1"
          status="+"
          setter="sullivan"
    />
          </attachment>
      

    </bug>

</bugzilla>