Bug 32187

Summary: Combination of #specific div:hover, and (non-inheriting) p:first-letter and p:first-line declarations inappropriately affects first-letter on hover
Product: WebKit Reporter: Pat <micropat+bugzilla>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hamaji, hayato, micropat+bugzilla, mitz, mjs, simon.fraser, yuzo
Priority: P2 Keywords: GoogleBug, Regression
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows 7   
Attachments:
Description Flags
Test case
none
In diffing render styles, consider all pseudo style changes.
none
In diffing render styles, consider all pseudo style changes.
none
In diffing render styles, consider all pseudo style changes. none

Description Pat 2009-12-05 18:28:32 PST
Created attachment 44352 [details]
Test case

See the attached page for a test case.  To reproduce: load page, then hover over the paragraph.

Expected result: The font of the first letter should *not* suddenly change on hover.

What happens: The font of the first letter unexpectedly changes on hover.

This is very odd behavior because the paragraph should not inherit the :hover selector due to specificity: #specific div:hover

Reproduced on:
 WebKit nightly r51705
 Chrome 4.0.249.25
 Safari 4.0.3 (531.9.1)

Other non-webkit browsers OK.
Comment 1 mitz 2009-12-06 20:32:32 PST
Why is the Regression keyword attached?
Comment 2 Yuzo Fujishima 2010-01-13 23:13:22 PST
Created attachment 46544 [details]
In diffing render styles, consider all pseudo style changes.
Comment 3 Darin Adler 2010-01-14 11:41:36 PST
Comment on attachment 46544 [details]
In diffing render styles, consider all pseudo style changes.

I don't know if this is correct.

But if it is, then to keep performance good, I think we should consider a fast check that quickly tests if any pseudo style bits are set at all, avoiding the loop checking one bit at a time in the vast majority of cases. That's assuming this is a hot enough function that it matters.
Comment 4 Yuzo Fujishima 2010-01-14 20:48:04 PST
Created attachment 46639 [details]
In diffing render styles, consider all pseudo style changes.
Comment 5 Yuzo Fujishima 2010-01-14 20:51:07 PST
Hi, Darin,

Thank you for your comment.
Now the loop is not entered if the style doesn't have any (public) pseudo styles.

Yuzo
Comment 6 Shinichiro Hamaji 2010-01-19 06:29:53 PST
I'm not 100% sure if the C++ change is correct (it looks good though) either.

I think you need to add png and checksum of the expected result. Or, it would be better if we can test this with dumpAsText.
Comment 7 Yuzo Fujishima 2010-01-20 02:12:24 PST
Created attachment 46992 [details]
In diffing render styles, consider all pseudo style changes.
Comment 8 Yuzo Fujishima 2010-01-20 02:18:22 PST
Added .png and .checksum.

I've tried to make the test text-based, but failed.
dumpAsText doesn't seem to output text for pseudo-elements.
I've also tried window.getComputedStyle, element.offsetHeight, offsetTop, etc.,
but none worked for me.

Yuzo
Comment 9 Yuzo Fujishima 2010-02-01 20:00:39 PST
Ping?
Comment 10 Yuzo Fujishima 2010-02-07 22:39:38 PST
Ping again?
Comment 11 Yuzo Fujishima 2010-02-15 23:59:28 PST
Ping, the third time. :)
Comment 12 Eric Seidel (no email) 2010-02-17 14:56:08 PST
Comment on attachment 46992 [details]
In diffing render styles, consider all pseudo style changes.

As far as I can tell this looks right.
Comment 13 WebKit Commit Bot 2010-02-17 21:15:06 PST
Comment on attachment 46992 [details]
In diffing render styles, consider all pseudo style changes.

Clearing flags on attachment: 46992

Committed r54926: <http://trac.webkit.org/changeset/54926>
Comment 14 WebKit Commit Bot 2010-02-17 21:15:11 PST
All reviewed patches have been landed.  Closing bug.