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

Side by Side Diff: third_party/WebKit/Source/web/WebInputElement.cpp

Issue 2174303002: Move filtering logic in GetDataListSuggestions() to Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move implementation to HTMLInputElement Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 24 matching lines...) Expand all
35 #include "core/dom/shadow/ElementShadow.h" 35 #include "core/dom/shadow/ElementShadow.h"
36 #include "core/dom/shadow/ShadowRoot.h" 36 #include "core/dom/shadow/ShadowRoot.h"
37 #include "core/html/HTMLDataListElement.h" 37 #include "core/html/HTMLDataListElement.h"
38 #include "core/html/HTMLDataListOptionsCollection.h" 38 #include "core/html/HTMLDataListOptionsCollection.h"
39 #include "core/html/HTMLInputElement.h" 39 #include "core/html/HTMLInputElement.h"
40 #include "core/html/shadow/ShadowElementNames.h" 40 #include "core/html/shadow/ShadowElementNames.h"
41 #include "core/html/shadow/TextControlInnerElements.h" 41 #include "core/html/shadow/TextControlInnerElements.h"
42 #include "platform/RuntimeEnabledFeatures.h" 42 #include "platform/RuntimeEnabledFeatures.h"
43 #include "public/platform/WebString.h" 43 #include "public/platform/WebString.h"
44 #include "public/web/WebElementCollection.h" 44 #include "public/web/WebElementCollection.h"
45 #include "public/web/WebOptionElement.h"
45 #include "wtf/PassRefPtr.h" 46 #include "wtf/PassRefPtr.h"
46 47
47 namespace blink { 48 namespace blink {
48 49
49 bool WebInputElement::isTextField() const 50 bool WebInputElement::isTextField() const
50 { 51 {
51 return constUnwrap<HTMLInputElement>()->isTextField(); 52 return constUnwrap<HTMLInputElement>()->isTextField();
52 } 53 }
53 54
54 bool WebInputElement::isText() const 55 bool WebInputElement::isText() const
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 bool WebInputElement::isChecked() const 116 bool WebInputElement::isChecked() const
116 { 117 {
117 return constUnwrap<HTMLInputElement>()->checked(); 118 return constUnwrap<HTMLInputElement>()->checked();
118 } 119 }
119 120
120 bool WebInputElement::isMultiple() const 121 bool WebInputElement::isMultiple() const
121 { 122 {
122 return constUnwrap<HTMLInputElement>()->multiple(); 123 return constUnwrap<HTMLInputElement>()->multiple();
123 } 124 }
124 125
125 WebElementCollection WebInputElement::dataListOptions() const 126 WebVector<WebOptionElement> WebInputElement::filteredDataListOptions() const
126 { 127 {
127 if (HTMLDataListElement* dataList = toHTMLDataListElement(constUnwrap<HTMLIn putElement>()->list())) 128 return WebVector<WebOptionElement>(constUnwrap<HTMLInputElement>()->filtered DataListOptions());
128 return WebElementCollection(dataList->options());
129 return WebElementCollection();
130 } 129 }
131 130
132 WebString WebInputElement::localizeValue(const WebString& proposedValue) const 131 WebString WebInputElement::localizeValue(const WebString& proposedValue) const
133 { 132 {
134 return constUnwrap<HTMLInputElement>()->localizeValue(proposedValue); 133 return constUnwrap<HTMLInputElement>()->localizeValue(proposedValue);
135 } 134 }
136 135
137 int WebInputElement::defaultMaxLength() 136 int WebInputElement::defaultMaxLength()
138 { 137 {
139 return HTMLInputElement::maximumLength; 138 return HTMLInputElement::maximumLength;
(...skipping 23 matching lines...) Expand all
163 } 162 }
164 163
165 WebInputElement* toWebInputElement(WebElement* webElement) 164 WebInputElement* toWebInputElement(WebElement* webElement)
166 { 165 {
167 if (!isHTMLInputElement(*webElement->unwrap<Element>())) 166 if (!isHTMLInputElement(*webElement->unwrap<Element>()))
168 return 0; 167 return 0;
169 168
170 return static_cast<WebInputElement*>(webElement); 169 return static_cast<WebInputElement*>(webElement);
171 } 170 }
172 } // namespace blink 171 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698