[Webkit-unassigned] [Bug 79719] Hover State + Custom Attributes Fail

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 6 09:37:39 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=79719





--- Comment #1 from Shezan Baig <shezbaig.wk at gmail.com>  2012-03-06 09:37:39 PST ---
Hi, is anyone already investigating this issue?  I took a quick look and the bug happens because the last two images share the same RenderStyle as the first image.  In CSSStyleSelector::styleForElement, allowSharing is true, and locateSharedStyle() returns the RenderStyle for the first image (which doesn't have the hover rule).

A couple of ways to fix this I can think of:

1. add a check in CSSStyleSelector::canShareStyleWithElement, which looks at the attributes of m_element and returns false if CSSStyleSelector::hasSelectorForAttribute returns true for any of the attributes

2. add a flag in MatchOptions (something like 'ignoreHoverOrActiveState'), and set this flag to true inside matchesRuleSet (which, right now, is only used from locateSharedStyle).  This flag will make SelectorChecker::checkOneSelector ignore the state of element->hovered() and element->active() when evaluating PseudoHover and PseudoActive.

(1) is definitely simpler, but would result in many false positives, which will reduce the likelihood of sharing styles.  (2) is a little more complex but more "correct".  Also, right now I'm only considering 'hover' and 'active' states, but theoretically we should be able to specify more states to ignore in MatchOptions (e.g. focus etc)

I was wondering if anybody was already working on this before I start hacking.  Also, I'm looking for feedback on these 2 approaches (and also if there are any other possible approaches).

Thanks, -shez-

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list