Summary: | Element with :target pseudo-class still matched after fragment identifier change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brad Fults <bfults> | ||||||||||
Component: | CSS | Assignee: | Nobody <webkit-unassigned> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | ||||||||||||
Priority: | P2 | ||||||||||||
Version: | 420+ | ||||||||||||
Hardware: | Mac | ||||||||||||
OS: | OS X 10.4 | ||||||||||||
URL: | http://xkr.us/bugs/webkit-06-003.html | ||||||||||||
Attachments: |
|
Description
Brad Fults
2006-10-16 15:03:27 PDT
Created attachment 11120 [details]
Testcase
*** This bug has been confirmed by popular vote. *** Created attachment 11192 [details]
first attempt
This patch fixes the problem. Please let me know whether it is the right approach and how
to do testcase(s).
Cheers,
Rob.
Comment on attachment 11192 [details]
first attempt
The fix looks ok to me, however, it needs a test case. To make a test case for this, you will probably have to make a page that navigates to a #fragment via window.location, forces a layout to make the :target pseudo match (for example by asking for a clientHeight property), then navigates to no fragment at all. Please resubmit with test case. The code change looks fine however.
Created attachment 11557 [details]
This timewith testcase
This is a testcase for the bug. Unfortunately the .txt is not what I expected, whereas the .png is
correct. I'd appreciate it if anybody has suggestions for the .txt problem.
Cheers,
Rob.
Created attachment 11566 [details]
Now with improved testcase
This testcase is much better (thnx to Mitz) since it really reflects that the bgcolor is removed when the target pseudo-class does not match anymore.
Cheers,
Rob.
FWIW you should probably use location.hash = "#target-01"; in target-fragment-match.html. Comment on attachment 11566 [details]
Now with improved testcase
r=me
|