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

Unified Diff: Source/core/html/HTMLFormControlElementTest.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/html/HTMLFormControlElementTest.cpp
diff --git a/Source/core/html/HTMLFormControlElementTest.cpp b/Source/core/html/HTMLFormControlElementTest.cpp
index d64936d11e96c9291ea226c8984380f54a1f9c7d..1258a49573a75a47797dc6331c439b122a8e02a5 100644
--- a/Source/core/html/HTMLFormControlElementTest.cpp
+++ b/Source/core/html/HTMLFormControlElementTest.cpp
@@ -67,4 +67,16 @@ TEST_F(HTMLFormControlElementTest, customValidationMessageTextDirection)
EXPECT_EQ(RTL, subMessageDir);
}
+TEST_F(HTMLFormControlElementTest, isValidElement)
+{
+ document().documentElement()->setInnerHTML("<body><input required id=input1><input required id=input2 value=0></body>", ASSERT_NO_EXCEPTION);
+ document().view()->updateLayoutAndStyleIfNeededRecursive();
+
+ HTMLInputElement* input1 = toHTMLInputElement(document().getElementById("input1"));
+ HTMLInputElement* input2 = toHTMLInputElement(document().getElementById("input2"));
+
+ EXPECT_FALSE(input1->isValidElement());
+ EXPECT_TRUE(input2->isValidElement());
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698