Bug 52372 - history.go(-3) goes to a wrong page
Summary: history.go(-3) goes to a wrong page
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-13 08:27 PST by Prasad
Modified: 2011-03-26 14:21 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Prasad 2011-01-13 08:27:04 PST
Steps to reproduce
------------------
1. Load URL:
"http://testsuite.nokia-boston.com/content/esmp_Sec9/objHistory/go_n1.html"
2. Tap on Link "Next" till the "Page 8"
3. Tap on "Go to page-5" in page 8 

Expected Outcome
----------------
Page 5 should be loaded

Actual Outcome
--------------
Page 6 is loaded

Note:
-----

* Mozilla works as expected.


* Retested using below mentioned test environments and the error is REPRODUCIBLE:

Symbian: Latest Release

QtTestBrowser: Webkit 2.1

Linux: Ubuntu 10.04 Lucid Lynx, Qt v.4.7.0, Webkit -2.1 (Trunk:-73634)

Safari: Version: 5.0.3 (7533.19.4)
Comment 1 Prasad 2011-01-13 08:27:32 PST
Nokia Internal Bugzilla ID: 

http://bugs.nokia-boston.com/bugzilla/show_bug.cgi?id=1051
Comment 2 Prasad 2011-01-13 08:28:50 PST
Similar/Related existing webkit bugzilla error id: 
https://bugs.webkit.org/show_bug.cgi?id=29972.
Comment 3 Alexey Proskuryakov 2011-01-13 11:10:34 PST
I could reproduce this in Safari 5.0.3 on second attempt.
Comment 4 Ryosuke Niwa 2011-01-24 17:37:27 PST
I don't think this belongs to HTML Editing component.
Comment 5 Joe Wild 2011-02-23 16:08:24 PST
52372 Maj P3 All webkit-unassigned@lists.web...  NEW history.go(-3)
goes to a wrong page
  
I think this is a problem with the test case.  The <a> on page 8th
page (go_n8.html) has an href and an onClick handler.  The link is
handled after the onClick event.  It pushes another entry onto the
stack, "go_n8.html#" which then causes the go(-3) to be off by 1 and
go back to the 6th page instead of the 5th.

  http://testsuite.nokia-boston.com/content/esmp_Sec9/objHistory/go_n8.html#
  function fMain(){
    history.go(-3);
  }
  <p>
    <a href="#" onClick="fMain()">Go to Page-5</a>
  </p>

If I change the test case make the onclick event return false, the
elements default action (loading the href) is not executed, and
everything works as expected.

  <p>
    <a href="#" onClick="fMain(); return false;">Go to Page-5</a>
  </p>

I think this should be ignored.
Comment 6 Siddharth Mathur 2011-03-26 14:21:09 PDT
Marking invalid based on Comment #5. Please reopen if necessary.