Bug 83490

Summary: history pushState doesn't affect :target selector
Product: WebKit Reporter: Paul Irish <paulirish@chromium.org>
Component: HistoryAssignee: Nobody <webkit-unassigned@lists.webkit.org>
Status: UNCONFIRMED    
Severity: Normal CC: 7raivis@inbox.lv, beidson@apple.com, ben@abmcd.com, christopher.bentley@gmail.com, edwardjsabol@iname.com, ericbidelman@chromium.org, fishd@chromium.org
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jsbin.com/esunoh/2/

Description From 2012-04-09 11:36:10 PST
0. open http://jsbin.com/esunoh/2/
1. click "select two"
2. hash on url changes
3. click button to remove hash from url
4. :target selector is still active

What is the expected result?

Should remove the :target selector as the hash is no longer on the url

What happens instead?

Doesn't update the selector.  However, if you try location.hash = ''; button, it will remove the :target selector - therefore I'd expect the pushState to work the same.


Downstream: http://code.google.com/p/chromium/issues/detail?id=89165
------- Comment #1 From 2012-04-10 13:49:23 PST -------
(In reply to comment #0)
> 0. open http://jsbin.com/esunoh/2/
> 1. click "select two"
> 2. hash on url changes
> 3. click button to remove hash from url
> 4. :target selector is still active
> 
> What is the expected result?
> 
> Should remove the :target selector as the hash is no longer on the url
> 
> What happens instead?
> 
> Doesn't update the selector.  However, if you try location.hash = ''; button, it will remove the :target selector - therefore I'd expect the pushState to work the same.
> 
> 
> Downstream: http://code.google.com/p/chromium/issues/detail?id=89165


What do other browsers do?  What does the relevant spec say?
------- Comment #2 From 2012-08-06 11:14:15 PST -------
It doesn't work in Firefox either, but I agree with the reporter that it should, FWIW.