Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(588)

Unified Diff: Source/core/dom/Element.cpp

Issue 236153005: Check isUserActionElement() instead of separate hover/active/focus checks in supportsStyleSharing() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index a535573a04cb930f955c0a3b3e8a4b2c51316098..dd8fbb6e39be4ed668ddf038f34f257861cd9ee1 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -3318,13 +3318,10 @@ bool Element::supportsStyleSharing() const
// Ids stop style sharing if they show up in the stylesheets.
if (hasID() && document().ensureStyleResolver().hasRulesForId(idForStyleResolution()))
return false;
- // Active and hovered elements always make a chain towards the document node
- // and no siblings or cousins will have the same state.
- if (hovered())
- return false;
- if (active())
- return false;
- if (focused())
+ // :active and :hover elements always make a chain towards the document node
+ // and no siblings or cousins will have the same state. There's also only one
+ // :focus element per scope so we don't need to attempt to share.
+ if (isUserActionElement())
return false;
if (!parentOrShadowHostElement()->childrenSupportStyleSharing())
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698