Bug 32187 - Combination of #specific div:hover, and (non-inheriting) p:first-letter and p:first-line declarations inappropriately affects first-letter on hover
Summary: Combination of #specific div:hover, and (non-inheriting) p:first-letter and p...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Nobody
URL:
Keywords: GoogleBug, Regression
Depends on:
Blocks:
 
Reported: 2009-12-05 18:28 PST by Pat
Modified: 2010-02-17 21:15 PST (History)
8 users (show)

See Also:


Attachments
Test case (714 bytes, text/html)
2009-12-05 18:28 PST, Pat
no flags Details
In diffing render styles, consider all pseudo style changes. (6.24 KB, patch)
2010-01-13 23:13 PST, Yuzo Fujishima
no flags Details | Formatted Diff | Diff
In diffing render styles, consider all pseudo style changes. (7.66 KB, patch)
2010-01-14 20:48 PST, Yuzo Fujishima
no flags Details | Formatted Diff | Diff
In diffing render styles, consider all pseudo style changes. (23.23 KB, patch)
2010-01-20 02:12 PST, Yuzo Fujishima
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.