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

Unified Diff: third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp

Issue 2183773003: DATALIST element: Filter DATALIST OPTIONs by sustring matching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « third_party/WebKit/Source/core/html/HTMLInputElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp
index e17481e06b7f5f7a53804a9cddbc19c7229477b0..7ef7a1cc5d89de236a49987cc3d2bbe1bb7b8b59 100644
--- a/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp
@@ -47,18 +47,31 @@ TEST_F(HTMLInputElementTest, FilteredDataListOptionsNoList)
EXPECT_TRUE(testElement().filteredDataListOptions().isEmpty());
}
-TEST_F(HTMLInputElementTest, FilteredDataListOptionsPrefixed)
+TEST_F(HTMLInputElementTest, FilteredDataListOptionsContain)
{
document().documentElement()->setInnerHTML(
- "<input id=test value=ABC list=dl2>"
+ "<input id=test value=BC list=dl2>"
"<datalist id=dl2>"
"<option>AbC DEF</option>"
"<option>VAX</option>"
- "<option value=ghi>abc</option>"
+ "<option value=ghi>abc</option>" // Match to label, not value.
"</datalist>", ASSERT_NO_EXCEPTION);
auto options = testElement().filteredDataListOptions();
- EXPECT_EQ(1u, options.size());
+ EXPECT_EQ(2u, options.size());
EXPECT_EQ("AbC DEF", options[0]->value().utf8());
+ EXPECT_EQ("ghi", options[1]->value().utf8());
+
+ document().documentElement()->setInnerHTML(
+ "<input id=test value=i list=dl2>"
+ "<datalist id=dl2>"
+ "<option>I</option>"
+ "<option>&#x0130;</option>" // LATIN CAPITAL LETTER I WITH DOT ABOVE
+ "<option>&#xFF49;</option>" // FULLWIDTH LATIN SMALL LETTER I
+ "</datalist>", ASSERT_NO_EXCEPTION);
+ options = testElement().filteredDataListOptions();
+ EXPECT_EQ(2u, options.size());
+ EXPECT_EQ("I", options[0]->value().utf8());
+ EXPECT_EQ(0x0130, options[1]->value()[0]);
}
TEST_F(HTMLInputElementTest, FilteredDataListOptionsForMultipleEmail)
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLInputElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698