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

Side by Side Diff: Source/core/html/HTMLInputElement.cpp

Issue 23623017: Prepare for date/time input datalist support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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) 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 r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. 10 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
(...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 StepRange stepRange = createStepRange(RejectAny); 1824 StepRange stepRange = createStepRange(RejectAny);
1825 if (stepRange.hasStep()) { 1825 if (stepRange.hasStep()) {
1826 parameters.step = stepRange.step().toDouble(); 1826 parameters.step = stepRange.step().toDouble();
1827 parameters.stepBase = stepRange.stepBase().toDouble(); 1827 parameters.stepBase = stepRange.stepBase().toDouble();
1828 } else { 1828 } else {
1829 parameters.step = 1.0; 1829 parameters.step = 1.0;
1830 parameters.stepBase = 0; 1830 parameters.stepBase = 0;
1831 } 1831 }
1832 1832
1833 parameters.anchorRectInRootView = document().view()->contentsToRootView(pixe lSnappedBoundingBox()); 1833 parameters.anchorRectInRootView = document().view()->contentsToRootView(pixe lSnappedBoundingBox());
1834 parameters.currentValue = value(); 1834 parameters.currentValue = m_inputType->valueAsDouble();
1835 parameters.isAnchorElementRTL = computedStyle()->direction() == RTL; 1835 parameters.isAnchorElementRTL = computedStyle()->direction() == RTL;
1836 if (RuntimeEnabledFeatures::dataListElementEnabled()) { 1836 if (RuntimeEnabledFeatures::dataListElementEnabled()) {
1837 if (HTMLDataListElement* dataList = this->dataList()) { 1837 if (HTMLDataListElement* dataList = this->dataList()) {
1838 RefPtr<HTMLCollection> options = dataList->options(); 1838 RefPtr<HTMLCollection> options = dataList->options();
1839 for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement (options->item(i)); ++i) { 1839 for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement (options->item(i)); ++i) {
1840 if (!isValidValue(option->value())) 1840 if (!isValidValue(option->value()))
1841 continue; 1841 continue;
1842 parameters.suggestionValues.append(sanitizeValue(option->value() )); 1842 DateTimeSuggestion suggestion;
1843 parameters.localizedSuggestionValues.append(localizeValue(option ->value())); 1843 suggestion.value = m_inputType->parseToNumber(option->value(), - 1).toDouble();
1844 parameters.suggestionLabels.append(option->value() == option->la bel() ? String() : option->label()); 1844 suggestion.localizedValue = localizeValue(option->value());
1845 suggestion.label = option->value() == option->label() ? String() : option->label();
1846 parameters.suggestions.append(suggestion);
1845 } 1847 }
1846 } 1848 }
1847 } 1849 }
1848 return true; 1850 return true;
1849 } 1851 }
1850 1852
1851 bool HTMLInputElement::supportsInputModeAttribute() const 1853 bool HTMLInputElement::supportsInputModeAttribute() const
1852 { 1854 {
1853 return m_inputType->supportsInputModeAttribute(); 1855 return m_inputType->supportsInputModeAttribute();
1854 } 1856 }
1855 1857
1856 bool HTMLInputElement::isInteractiveContent() const 1858 bool HTMLInputElement::isInteractiveContent() const
1857 { 1859 {
1858 return m_inputType->isInteractiveContent(); 1860 return m_inputType->isInteractiveContent();
1859 } 1861 }
1860 1862
1861 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 1863 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
1862 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() 1864 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer()
1863 { 1865 {
1864 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer()); 1866 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer());
1865 } 1867 }
1866 #endif 1868 #endif
1867 1869
1868 } // namespace 1870 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698