Bug 83490 - history pushState doesn't affect :target selector
: history pushState doesn't affect :target selector
Status: UNCONFIRMED
: WebKit
History
: 528+ (Nightly build)
: Unspecified Unspecified
: P2 Normal
Assigned To:
: http://jsbin.com/esunoh/2/
:
:
:
  Show dependency treegraph
 
Reported: 2012-04-09 11:36 PST by
Modified: 2014-01-07 02:32 PST (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


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.