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

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: Fix the problem with shared element style Created 6 years, 3 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());
keishi 2014/10/01 09:25:27 We don't need this test because this should alread
Bartek Nowierski 2014/10/02 14:26:43 Should I remove it? Or keep it since I already wro
keishi 2014/10/03 03:44:13 I don't think this adds any value, I think we shou
Bartek Nowierski 2014/10/03 06:01:33 Ok, removing this one and removing HTMLFormElement
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698