<?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>33931</bug_id>
          
          <creation_ts>2010-01-20 18:07:13 -0800</creation_ts>
          <short_desc>pushstate() from within a popstate handler might lead to improper scroll/view state being incorrect later</short_desc>
          <delta_ts>2010-06-29 14:14:15 -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>Page Loading</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Brady Eidson">beidson</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>fishd</cc>
    
    <cc>justin.lebar+bug</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>183003</commentid>
    <comment_count>0</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2010-01-20 18:07:13 -0800</bug_when>
    <thetext>pushstate() from within a popstate handler might lead to improper scroll/view state being incorrect later

See the test case in https://bugs.webkit.org/show_bug.cgi?id=33830 for reference.

Since the popstate event - fired from within FrameLoader::loadInSameDocument() called from FrameLoader::navigateWithinDocument() - can effectively change the current history item, the later call to history()-&gt;restoreScrollPositionAndViewState() will be operating on the wrong &quot;current history item&quot; from the perspective of the load.

There&apos;s a lot of complexity here in getting this precisely right, especially since popstate events might nest and we&apos;d probably only want to restore the scroll/view state from the most recently popped item.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>183527</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Fisher (:fishd, Google)">fishd</who>
    <bug_when>2010-01-22 00:27:58 -0800</bug_when>
    <thetext>We should be very careful here since history()-&gt;restoreScrollPositionAndViewState() may lead to the scroll event being dispatched.  Can the app do other things within the popstate event that could cause the scroll event to be confusing to the app?  (This re-entrancy stuff gives me a headache!)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>244475</commentid>
    <comment_count>2</comment_count>
    <who name="Justin Lebar">justin.lebar+bug</who>
    <bug_when>2010-06-29 14:13:53 -0700</bug_when>
    <thetext>Forgot to include a link above:

[2]: http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-definitions</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>244477</commentid>
    <comment_count>3</comment_count>
    <who name="Justin Lebar">justin.lebar+bug</who>
    <bug_when>2010-06-29 14:14:15 -0700</bug_when>
    <thetext>Oops, wrong bug.  Sorry!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>