<?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>45430</bug_id>
          
          <creation_ts>2010-09-08 18:10:44 -0700</creation_ts>
          <short_desc>http/tests/navigation/anchor-frames.html doesn&apos;t pass when not run in isolation</short_desc>
          <delta_ts>2010-09-09 07:57:29 -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>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="Mihai Parparita">mihaip</reporter>
          <assigned_to name="Mihai Parparita">mihaip</assigned_to>
          <cc>dpranke</cc>
    
    <cc>jamesr</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>276234</commentid>
    <comment_count>0</comment_count>
    <who name="Mihai Parparita">mihaip</who>
    <bug_when>2010-09-08 18:10:44 -0700</bug_when>
    <thetext>http/tests/navigation/anchor-frames.html doesn&apos;t pass with TestShell</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276236</commentid>
    <comment_count>1</comment_count>
      <attachid>66978</attachid>
    <who name="Mihai Parparita">mihaip</who>
    <bug_when>2010-09-08 18:12:04 -0700</bug_when>
    <thetext>Created attachment 66978
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276243</commentid>
    <comment_count>2</comment_count>
    <who name="Dirk Pranke">dpranke</who>
    <bug_when>2010-09-08 18:22:56 -0700</bug_when>
    <thetext>this change LGTM. James, do you feel like rubber-stamping this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276246</commentid>
    <comment_count>3</comment_count>
      <attachid>66978</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2010-09-08 18:28:07 -0700</bug_when>
    <thetext>Comment on attachment 66978
Patch

I&apos;d strongly prefer to know when TestShell is updating the scroll offset and having the test code run off of that.  Running it in a setTimeout() might be racy depending on exactly when test shell updates the scroll offsets and is unreliable for a test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276257</commentid>
    <comment_count>4</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2010-09-08 18:40:41 -0700</bug_when>
    <thetext>Alternately, decide we don&apos;t care about this test for TestShell and add it to the expectations.  That makes me a little nervous but might a good option if it seems it will take a long time to debug what TestShell is doing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276261</commentid>
    <comment_count>5</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2010-09-08 18:48:55 -0700</bug_when>
    <thetext>This test is currently failing on mac&apos;s DumpRenderTree as well (leopard and snow leopard).  Sure this is a test shell problem?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276270</commentid>
    <comment_count>6</comment_count>
    <who name="Mihai Parparita">mihaip</who>
    <bug_when>2010-09-08 19:11:34 -0700</bug_when>
    <thetext>Re-titling, since this appears to fail with the regular DRT (though I can only reproduce locally when using --iterations 2). The setTimeout wrapper does seem to fix that, but I&apos;d like to understand why better first.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276275</commentid>
    <comment_count>7</comment_count>
    <who name="Mihai Parparita">mihaip</who>
    <bug_when>2010-09-08 19:28:10 -0700</bug_when>
    <thetext>Not sure how the test ever worked. In FrameLoader::finishedParsing() we do things in this order:
1. Call FrameLoader::checkCompleted (which triggers the onload handler via FrameLoader::checkCallImplicitClose -&gt; Document::implicitClose -&gt; Document::dispatchWindowLoadEvent)
2. Call m_frame-&gt;view()-&gt;scrollToFragment(m_URL)

So onload always fires before we scroll to the fragment.

I think the original patch on this bug is the way to go, since the setTimeout(0) will definitely happen after both 1 and 2 above, so we&apos;ll always be scrolled.

I&apos;m going to be offline for a couple of hours. James/Dirk, feel free to either land this patch or back out r67033.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276278</commentid>
    <comment_count>8</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2010-09-08 19:48:45 -0700</bug_when>
    <thetext>Ahh, I see.  So this patch is fine, then, since the setTimeout() will _always_ happen after the scroll.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276279</commentid>
    <comment_count>9</comment_count>
      <attachid>66978</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2010-09-08 19:48:57 -0700</bug_when>
    <thetext>Comment on attachment 66978
Patch

I&apos;ll land this to fix the bots.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276280</commentid>
    <comment_count>10</comment_count>
      <attachid>66978</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2010-09-08 19:50:47 -0700</bug_when>
    <thetext>Comment on attachment 66978
Patch

Clearing flags on attachment: 66978

Committed r67051: &lt;http://trac.webkit.org/changeset/67051&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276281</commentid>
    <comment_count>11</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2010-09-08 19:51:01 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276459</commentid>
    <comment_count>12</comment_count>
    <who name="Mihai Parparita">mihaip</who>
    <bug_when>2010-09-09 07:57:29 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; Not sure how the test ever worked. 

I think I understand this better. The test has external resources (two scripts and a stylesheet). IIRC, stylesheets do not block, so in the uncached case, checkCompleted returns early (because of the numRequests(m_frame-&gt;document()) check) and we end up calling scrollToFragment before onload is dispatched. However, in the cached case, the resources are (presumably) loaded synchronously from the cache, so we have no outstanding requests.

This is why the test passed when run in isolation (or even when running all of the http/tests/navigation tests, since it&apos;s the first one to use those resources in there), but failed when run twice or when being run with all the other tests on the bots.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>66978</attachid>
            <date>2010-09-08 18:12:04 -0700</date>
            <delta_ts>2010-09-08 19:50:47 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-45430-20100908181203.patch</filename>
            <type>text/plain</type>
            <size>2680</size>
            <attacher name="Mihai Parparita">mihaip</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0xheW91dFRlc3RzL0NoYW5nZUxvZyBiL0xheW91dFRlc3RzL0NoYW5nZUxv
ZwppbmRleCAwYzhkN2FkYWJlZDMyYTBjNmE4OTI0ODk5NjYwODhjNWE5NjM0NGM0Li5kYzY0NGE3
YjdhZmY2NjNkZGU0NmE1NjEyMjgxNTVmY2E5MjVlYTY4IDEwMDY0NAotLS0gYS9MYXlvdXRUZXN0
cy9DaGFuZ2VMb2cKKysrIGIvTGF5b3V0VGVzdHMvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTUgQEAK
KzIwMTAtMDktMDggIE1paGFpIFBhcnBhcml0YSAgPG1paGFpcEBjaHJvbWl1bS5vcmc+CisKKyAg
ICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgaHR0cC90ZXN0cy9u
YXZpZ2F0aW9uL2FuY2hvci1mcmFtZXMuaHRtbCBkb2Vzbid0IHBhc3Mgd2l0aCBUZXN0U2hlbGwK
KyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTQ1NDMwCisK
KyAgICAgICAgQ2hlY2sgc2Nyb2xsIHBvc2l0aW9uIGluIGEgdGltZW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