| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 6 * rights reserved. | 6 * rights reserved. |
| 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 8 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) | 8 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) |
| 9 * Copyright (C) 2010 Google Inc. All rights reserved. | 9 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 10 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. | 10 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. |
| (...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 return types; | 1356 return types; |
| 1357 | 1357 |
| 1358 Vector<String> splitTypes; | 1358 Vector<String> splitTypes; |
| 1359 acceptString.split(',', false, splitTypes); | 1359 acceptString.split(',', false, splitTypes); |
| 1360 for (const String& splitType : splitTypes) { | 1360 for (const String& splitType : splitTypes) { |
| 1361 String trimmedType = stripLeadingAndTrailingHTMLSpaces(splitType); | 1361 String trimmedType = stripLeadingAndTrailingHTMLSpaces(splitType); |
| 1362 if (trimmedType.isEmpty()) | 1362 if (trimmedType.isEmpty()) |
| 1363 continue; | 1363 continue; |
| 1364 if (!predicate(trimmedType)) | 1364 if (!predicate(trimmedType)) |
| 1365 continue; | 1365 continue; |
| 1366 types.append(trimmedType.lower()); | 1366 types.push_back(trimmedType.lower()); |
| 1367 } | 1367 } |
| 1368 | 1368 |
| 1369 return types; | 1369 return types; |
| 1370 } | 1370 } |
| 1371 | 1371 |
| 1372 Vector<String> HTMLInputElement::acceptMIMETypes() { | 1372 Vector<String> HTMLInputElement::acceptMIMETypes() { |
| 1373 return parseAcceptAttribute(fastGetAttribute(acceptAttr), isValidMIMEType); | 1373 return parseAcceptAttribute(fastGetAttribute(acceptAttr), isValidMIMEType); |
| 1374 } | 1374 } |
| 1375 | 1375 |
| 1376 Vector<String> HTMLInputElement::acceptFileExtensions() { | 1376 Vector<String> HTMLInputElement::acceptFileExtensions() { |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1593 if (!value.isEmpty()) { | 1593 if (!value.isEmpty()) { |
| 1594 // Firefox shows OPTIONs with matched labels, Edge shows OPTIONs | 1594 // Firefox shows OPTIONs with matched labels, Edge shows OPTIONs |
| 1595 // with matches values. We show both. | 1595 // with matches values. We show both. |
| 1596 if (option->value().foldCase().find(value) == kNotFound && | 1596 if (option->value().foldCase().find(value) == kNotFound && |
| 1597 option->label().foldCase().find(value) == kNotFound) | 1597 option->label().foldCase().find(value) == kNotFound) |
| 1598 continue; | 1598 continue; |
| 1599 } | 1599 } |
| 1600 // TODO(tkent): Should allow invalid strings. crbug.com/607097. | 1600 // TODO(tkent): Should allow invalid strings. crbug.com/607097. |
| 1601 if (!isValidValue(option->value())) | 1601 if (!isValidValue(option->value())) |
| 1602 continue; | 1602 continue; |
| 1603 filtered.append(option); | 1603 filtered.push_back(option); |
| 1604 } | 1604 } |
| 1605 return filtered; | 1605 return filtered; |
| 1606 } | 1606 } |
| 1607 | 1607 |
| 1608 void HTMLInputElement::setListAttributeTargetObserver( | 1608 void HTMLInputElement::setListAttributeTargetObserver( |
| 1609 ListAttributeTargetObserver* newObserver) { | 1609 ListAttributeTargetObserver* newObserver) { |
| 1610 if (m_listAttributeTargetObserver) | 1610 if (m_listAttributeTargetObserver) |
| 1611 m_listAttributeTargetObserver->unregister(); | 1611 m_listAttributeTargetObserver->unregister(); |
| 1612 m_listAttributeTargetObserver = newObserver; | 1612 m_listAttributeTargetObserver = newObserver; |
| 1613 } | 1613 } |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1826 continue; | 1826 continue; |
| 1827 DateTimeSuggestion suggestion; | 1827 DateTimeSuggestion suggestion; |
| 1828 suggestion.value = | 1828 suggestion.value = |
| 1829 m_inputType->parseToNumber(option->value(), Decimal::nan()) | 1829 m_inputType->parseToNumber(option->value(), Decimal::nan()) |
| 1830 .toDouble(); | 1830 .toDouble(); |
| 1831 if (std::isnan(suggestion.value)) | 1831 if (std::isnan(suggestion.value)) |
| 1832 continue; | 1832 continue; |
| 1833 suggestion.localizedValue = localizeValue(option->value()); | 1833 suggestion.localizedValue = localizeValue(option->value()); |
| 1834 suggestion.label = | 1834 suggestion.label = |
| 1835 option->value() == option->label() ? String() : option->label(); | 1835 option->value() == option->label() ? String() : option->label(); |
| 1836 parameters.suggestions.append(suggestion); | 1836 parameters.suggestions.push_back(suggestion); |
| 1837 } | 1837 } |
| 1838 } | 1838 } |
| 1839 return true; | 1839 return true; |
| 1840 } | 1840 } |
| 1841 | 1841 |
| 1842 bool HTMLInputElement::supportsInputModeAttribute() const { | 1842 bool HTMLInputElement::supportsInputModeAttribute() const { |
| 1843 return m_inputType->supportsInputModeAttribute(); | 1843 return m_inputType->supportsInputModeAttribute(); |
| 1844 } | 1844 } |
| 1845 | 1845 |
| 1846 void HTMLInputElement::setShouldRevealPassword(bool value) { | 1846 void HTMLInputElement::setShouldRevealPassword(bool value) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1886 | 1886 |
| 1887 bool HTMLInputElement::hasFallbackContent() const { | 1887 bool HTMLInputElement::hasFallbackContent() const { |
| 1888 return m_inputTypeView->hasFallbackContent(); | 1888 return m_inputTypeView->hasFallbackContent(); |
| 1889 } | 1889 } |
| 1890 | 1890 |
| 1891 void HTMLInputElement::setFilesFromPaths(const Vector<String>& paths) { | 1891 void HTMLInputElement::setFilesFromPaths(const Vector<String>& paths) { |
| 1892 return m_inputType->setFilesFromPaths(paths); | 1892 return m_inputType->setFilesFromPaths(paths); |
| 1893 } | 1893 } |
| 1894 | 1894 |
| 1895 } // namespace blink | 1895 } // namespace blink |
| OLD | NEW |