Bug 48117

Summary: History item and document.location change.
Product: WebKit Reporter: Jędrzej Nowacki <jedrzej.nowacki>
Component: HistoryAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jedrzej.nowacki, mihaip, msrinirao, tonikitoo
Priority: P4    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
test none

Description Jędrzej Nowacki 2010-10-22 00:41:13 PDT
Behavior of back / forward history changed between QtWebkit 2.0 and the trunk.

<html>
  <head>
    <script>
      document.location = "another url";
    </script>
  </head>
  <body></body>
</html>

I believe that page above should not create a history item in the B/F history, which is the current behavior. From user point of view there is no difference between document.location and http redirection.

Related mail thread (with real use case):
https://lists.webkit.org/pipermail/webkit-qt/2010-October/000902.html
Comment 1 Jędrzej Nowacki 2010-10-22 00:44:21 PDT
Created attachment 71532 [details]
test

I would like to add this test
Comment 2 Antonio Gomes 2010-10-22 09:55:44 PDT
Comment on attachment 71532 [details]
test

Tests!
Comment 3 WebKit Commit Bot 2010-10-22 10:14:51 PDT
The commit-queue encountered the following flaky tests while processing attachment 71532 [details]:

java/lc3/JSObject/ToObject-001.html

Please file bugs against the tests.  The author(s) of the test(s) are ap@webkit.org and ap@webkit.org.  The commit-queue is continuing to process your patch.
Comment 4 WebKit Commit Bot 2010-10-22 10:15:39 PDT
Comment on attachment 71532 [details]
test

Clearing flags on attachment: 71532

Committed r70315: <http://trac.webkit.org/changeset/70315>
Comment 5 WebKit Commit Bot 2010-10-22 10:15:45 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Mihai Parparita 2010-10-22 14:52:30 PDT
FWIW, this behavior already had tests (e.g. http/tests/history/redirect-js-location-before-load.html), which were updated when the change was made: http://trac.webkit.org/changeset/65340.
Comment 7 Jędrzej Nowacki 2010-10-25 00:27:57 PDT
(In reply to comment #6)
> FWIW, this behavior already had tests (e.g. http/tests/history/redirect-js-location-before-load.html), which were updated when the change was made: http://trac.webkit.org/changeset/65340.

True, I've missed that one. Do you think it is worth to revert my test? If yes I can do it.
Comment 8 Mihai Parparita 2010-10-25 06:33:32 PDT
(In reply to comment #7)
> (In reply to comment #6)
> > FWIW, this behavior already had tests (e.g. http/tests/history/redirect-js-location-before-load.html), which were updated when the change was made: http://trac.webkit.org/changeset/65340.
> 
> True, I've missed that one. Do you think it is worth to revert my test? If yes I can do it.

No, I think it's fine to leave as is. However, if you're going to be making other history-related changes, you may want to add tests to that directory instead.