RESOLVED FIXED 11321
Element with :target pseudo-class still matched after fragment identifier change
https://bugs.webkit.org/show_bug.cgi?id=11321
Summary Element with :target pseudo-class still matched after fragment identifier change
Brad Fults
Reported 2006-10-16 15:03:27 PDT
Open the given URL (or see attachment), follow the steps. Summary: An element styled with the :target pseudo-class will still be matched after the fragment identifier changes. Expected: Elements styled with the :target pseudo-class should only be matched when the fragment identifier matches the id of the element.
Attachments
Testcase (856 bytes, text/html)
2006-10-16 15:03 PDT, Brad Fults
no flags
first attempt (1.41 KB, patch)
2006-10-24 12:03 PDT, Rob Buis
mjs: review-
This timewith testcase (15.96 KB, text/plain)
2006-11-17 14:35 PST, Rob Buis
no flags
Now with improved testcase (15.96 KB, patch)
2006-11-18 06:31 PST, Rob Buis
mjs: review+
Brad Fults
Comment 1 2006-10-16 15:03:54 PDT
Created attachment 11120 [details] Testcase
Brad Fults
Comment 2 2006-10-16 15:04:13 PDT
*** This bug has been confirmed by popular vote. ***
Rob Buis
Comment 3 2006-10-24 12:03:47 PDT
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.
Maciej Stachowiak
Comment 4 2006-10-31 04:31:35 PST
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.
Rob Buis
Comment 5 2006-11-17 14:35:00 PST
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.
Rob Buis
Comment 6 2006-11-18 06:31:41 PST
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.
Brad Fults
Comment 7 2006-11-18 13:50:05 PST
FWIW you should probably use location.hash = "#target-01"; in target-fragment-match.html.
Maciej Stachowiak
Comment 8 2006-11-18 14:48:29 PST
Comment on attachment 11566 [details] Now with improved testcase r=me
Rob Buis
Comment 9 2006-11-19 04:01:38 PST
Landed in r17848.
Note You need to log in before you can comment on or make changes to this bug.