| OLD | NEW |
| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "WebInputElement.h" | 32 #include "WebInputElement.h" |
| 33 | 33 |
| 34 #include "HTMLDataListElement.h" |
| 34 #include "HTMLInputElement.h" | 35 #include "HTMLInputElement.h" |
| 35 #include "HTMLNames.h" | 36 #include "HTMLNames.h" |
| 36 #include "TextControlInnerElements.h" | 37 #include "TextControlInnerElements.h" |
| 37 #include "platform/WebString.h" | 38 #include "platform/WebString.h" |
| 39 #include "WebDataListElement.h" |
| 38 #include <wtf/PassRefPtr.h> | 40 #include <wtf/PassRefPtr.h> |
| 39 | 41 |
| 40 using namespace WebCore; | 42 using namespace WebCore; |
| 41 | 43 |
| 42 namespace WebKit { | 44 namespace WebKit { |
| 43 | 45 |
| 44 bool WebInputElement::isTextField() const | 46 bool WebInputElement::isTextField() const |
| 45 { | 47 { |
| 46 return constUnwrap<HTMLInputElement>()->isTextField(); | 48 return constUnwrap<HTMLInputElement>()->isTextField(); |
| 47 } | 49 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 bool WebInputElement::isValidValue(const WebString& value) const | 146 bool WebInputElement::isValidValue(const WebString& value) const |
| 145 { | 147 { |
| 146 return constUnwrap<HTMLInputElement>()->isValidValue(value); | 148 return constUnwrap<HTMLInputElement>()->isValidValue(value); |
| 147 } | 149 } |
| 148 | 150 |
| 149 bool WebInputElement::isChecked() const | 151 bool WebInputElement::isChecked() const |
| 150 { | 152 { |
| 151 return constUnwrap<HTMLInputElement>()->checked(); | 153 return constUnwrap<HTMLInputElement>()->checked(); |
| 152 } | 154 } |
| 153 | 155 |
| 156 WebDataListElement WebInputElement::dataList() const |
| 157 { |
| 158 #if ENABLE(DATALIST) |
| 159 return WebDataListElement(static_cast<HTMLDataListElement*>(constUnwrap<HTML
InputElement>()->list())); |
| 160 #else |
| 161 return WebDataListElement(); |
| 162 #endif |
| 163 } |
| 164 |
| 154 bool WebInputElement::isSpeechInputEnabled() const | 165 bool WebInputElement::isSpeechInputEnabled() const |
| 155 { | 166 { |
| 156 #if ENABLE(INPUT_SPEECH) | 167 #if ENABLE(INPUT_SPEECH) |
| 157 return constUnwrap<HTMLInputElement>()->isSpeechEnabled(); | 168 return constUnwrap<HTMLInputElement>()->isSpeechEnabled(); |
| 158 #else | 169 #else |
| 159 return false; | 170 return false; |
| 160 #endif | 171 #endif |
| 161 } | 172 } |
| 162 | 173 |
| 163 WebInputElement::SpeechInputState WebInputElement::getSpeechInputState() const | 174 WebInputElement::SpeechInputState WebInputElement::getSpeechInputState() const |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 WebInputElement* toWebInputElement(WebElement* webElement) | 224 WebInputElement* toWebInputElement(WebElement* webElement) |
| 214 { | 225 { |
| 215 HTMLInputElement* inputElement = webElement->unwrap<Element>()->toInputEleme
nt(); | 226 HTMLInputElement* inputElement = webElement->unwrap<Element>()->toInputEleme
nt(); |
| 216 if (!inputElement) | 227 if (!inputElement) |
| 217 return 0; | 228 return 0; |
| 218 | 229 |
| 219 return static_cast<WebInputElement*>(webElement); | 230 return static_cast<WebInputElement*>(webElement); |
| 220 } | 231 } |
| 221 | 232 |
| 222 } // namespace WebKit | 233 } // namespace WebKit |
| OLD | NEW |