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/SharedStyleFinder.cpp

Issue 616443002: Implement :valid and :invalid pseudoclass for <form> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add layout tests, apply feedback from Keishi, add support for removing/inserting elements into the … Created 6 years, 2 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
Index: Source/core/css/resolver/SharedStyleFinder.cpp
diff --git a/Source/core/css/resolver/SharedStyleFinder.cpp b/Source/core/css/resolver/SharedStyleFinder.cpp
index ce16c0df1f0d4b7ef17a08556a3e785caf1906c7..c1130eab7f6c39556b50302751b124eccbd4d27f 100644
--- a/Source/core/css/resolver/SharedStyleFinder.cpp
+++ b/Source/core/css/resolver/SharedStyleFinder.cpp
@@ -84,7 +84,7 @@ bool SharedStyleFinder::canShareStyleWithControl(Element& candidate) const
if (willValidate != element().willValidate())
return false;
- if (willValidate && (candidate.isValidFormControlElement() != element().isValidFormControlElement()))
+ if (willValidate && (candidate.isValidElement() != element().isValidElement()))
return false;
if (candidate.isInRange() != element().isInRange())
@@ -242,6 +242,9 @@ bool SharedStyleFinder::canShareStyleWithElement(Element& candidate) const
|| toHTMLOptionElement(candidate).spatialNavigationFocused() != toHTMLOptionElement(element()).spatialNavigationFocused()))
return false;
+ if (candidate.isValidElement() != element().isValidElement())
keishi 2014/10/03 03:44:13 I think we should check document().containsValidit
Bartek Nowierski 2014/10/03 06:01:33 Done. And I moved this check to the bottom
+ return false;
+
// FIXME: This line is surprisingly hot, we may wish to inline hasDirectionAuto into StyleResolver.
if (candidate.isHTMLElement() && toHTMLElement(candidate).hasDirectionAuto())
return false;

Powered by Google App Engine
This is Rietveld 408576698