Bug 7327

Summary: REGRESSION (r12869): :hover subselector does not work in quirks mode
Product: WebKit Reporter: mitz
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: VERIFIED FIXED    
Severity: Normal Keywords: Regression
Priority: P1    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Patch to copy the tag into subselectors
none
Patch
none
Fix it another way
none
Quirks test case
none
Apply the *:hover and *:active quirks only when there are no sub-selectors hyatt: review+

Description mitz 2006-02-17 15:29:08 PST
The fix for bug 7218 causes div#myID:hover not to match anything in quirks mode. Need to refine it since other browsers do let it match.
Comment 1 mitz 2006-02-18 09:44:14 PST
Created attachment 6589 [details]
Patch to copy the tag into subselectors

I would like to fix this by having the CSS parser copy the tag into subselectors. I tried it and the only negative effect was on selectorText (and possibly on performance), and trying to fix it I realized that selectorText already has a problem with subselectors (bug 7338).
Comment 2 mitz 2006-02-23 14:04:59 PST
Created attachment 6684 [details]
Patch

This patch also incorporates the fix for bug 7338, but not the testcase+changelog from that bug.
Comment 3 Dave Hyatt 2006-02-23 16:22:26 PST
Comment on attachment 6684 [details]
Patch

Conceptually I'm not sure I like the idea of the tag names being propagated into these other selectors just to accommodate the :hover quirk.

Is there no way to solve this problem at the time you're testing for the quirk?
Comment 4 mitz 2006-02-24 02:14:05 PST
Created attachment 6698 [details]
Fix it another way
Comment 5 mitz 2006-02-25 08:24:27 PST
Comment on attachment 6698 [details]
Fix it another way

The quirk is more subtle than I thought. Apparently #foo:hover should match... I'll need to investigate other combinations.
Comment 6 mitz 2006-02-25 08:56:58 PST
Created attachment 6731 [details]
Quirks test case

Various selectors with :hover and without a tag and the browsers in which they match. ddkilzer reports that none of them match in MSIE 6. The last patch makes WebKit behave like MSIE 6.
Comment 7 mitz 2006-02-27 15:26:41 PST
Comment on attachment 6698 [details]
Fix it another way

According to Dave Hyatt or IRC, "we should allow hover on everything except for *", so this patch is wrong (but the right patch should be even simpler).
Comment 8 mitz 2006-02-28 10:24:17 PST
Created attachment 6775 [details]
Apply the *:hover and *:active quirks only when there are no sub-selectors
Comment 9 Dave Hyatt 2006-03-01 01:58:54 PST
Comment on attachment 6775 [details]
Apply the *:hover and *:active quirks only when there are no sub-selectors

r=me