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

Unified Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 18089009: Hovered/active/focused nodes will never share style with siblings/cousins. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed indentation and review issue in test Created 7 years, 6 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 | « PerformanceTests/CSS/HoverUpdate.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index dd3d7c788119c5b2549d12b25395b5187b83262b..1647e2d38d1e3f3ecc680dfacdc308fb36c00953 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -783,6 +783,15 @@ RenderStyle* StyleResolver::locateSharedStyle()
// Ids stop style sharing if they show up in the stylesheets.
if (state.styledElement()->hasID() && m_features.idsInRules.contains(state.styledElement()->idForStyleResolution().impl()))
return 0;
+ // Active and hovered elements always make a chain towards the document node
+ // and no siblings or cousins will have the same state.
+ if (state.styledElement()->hovered())
+ return 0;
+ if (state.styledElement()->active())
+ return 0;
+ // There is always only one focused element.
+ if (state.styledElement()->focused())
+ return 0;
if (parentElementPreventsSharing(state.element()->parentElement()))
return 0;
if (state.styledElement()->hasScopedHTMLStyleChild())
« no previous file with comments | « PerformanceTests/CSS/HoverUpdate.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698