Bug 67732 - [Chromium] Web Inspector: Bug with console.log and popstate/hashchange events
Summary: [Chromium] Web Inspector: Bug with console.log and popstate/hashchange events
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: History (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Minor
Assignee: Yury Semikhatsky
URL: http://jsbin.com/owuyel
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-07 14:12 PDT by Zach Leatherman
Modified: 2011-09-27 05:40 PDT (History)
12 users (show)

See Also:


Attachments
Global i holds the number of times popstate has fired. (689 bytes, text/html)
2011-09-07 14:12 PDT, Zach Leatherman
no flags Details
Reduced test case (227 bytes, text/html)
2011-09-27 02:19 PDT, Yury Semikhatsky
no flags Details
Patch (2.83 KB, patch)
2011-09-27 05:11 PDT, Yury Semikhatsky
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zach Leatherman 2011-09-07 14:12:00 PDT
Created attachment 106634 [details]
Global i holds the number of times popstate has fired.

If I bind a simple event handler to the popstate event with a console.log, it will execute the console.log multiple times per onpopstate event.  The onpopstate event fires only once, it just triggers console.log multiple times.

Looks like the same for hashchange.

Chrome 14.0.835.157 beta-m
Comment 1 Eric Seidel (no email) 2011-09-26 17:05:48 PDT
I'm told Darin is mr. popstate (but I could be misinformed).
Comment 2 Eric Seidel (no email) 2011-09-26 17:06:40 PDT
I see.  So this isn't a popstate bug, this is an interaction with the web inspector?

In which case, Pavel is your man.
Comment 3 Yury Semikhatsky 2011-09-27 00:35:14 PDT
Looks like a bug in web inspector. After navigation two original messages are printed before the actual PopStateEvent.
Comment 4 Yury Semikhatsky 2011-09-27 02:19:38 PDT
Created attachment 108817 [details]
Reduced test case

This is a Chromium-specific issue. The problem here is that when back button is pushed we receive OnNavigatingToPendingEntry in the browser and send Detach followed by Attach to the corresponding DevToolsAgent to make sure our front-end is connected to correct RenderViewHost. In case of navigation back to the same URL with a different fragment we probably shouldn't do this as RVH doesn't change in that case.
Comment 5 Yury Semikhatsky 2011-09-27 05:09:28 PDT
Filed Chromium bug: http://code.google.com/p/chromium/issues/detail?id=98210
Comment 6 Yury Semikhatsky 2011-09-27 05:11:47 PDT
Created attachment 108827 [details]
Patch
Comment 7 Yury Semikhatsky 2011-09-27 05:39:28 PDT
Committed r96100: <http://trac.webkit.org/changeset/96100>
Comment 8 Yury Semikhatsky 2011-09-27 05:40:57 PDT
Chromium patch will be landed after WebKit r96100 is rolled.