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

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

Issue 419053005: Fix crash in HTMLInputElement::setupDateTimeChooserParameters (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 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) 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 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after
1821 parameters.step = stepRange.step().toDouble(); 1821 parameters.step = stepRange.step().toDouble();
1822 parameters.stepBase = stepRange.stepBase().toDouble(); 1822 parameters.stepBase = stepRange.stepBase().toDouble();
1823 } else { 1823 } else {
1824 parameters.step = 1.0; 1824 parameters.step = 1.0;
1825 parameters.stepBase = 0; 1825 parameters.stepBase = 0;
1826 } 1826 }
1827 1827
1828 parameters.anchorRectInRootView = document().view()->contentsToRootView(pixe lSnappedBoundingBox()); 1828 parameters.anchorRectInRootView = document().view()->contentsToRootView(pixe lSnappedBoundingBox());
1829 parameters.currentValue = value(); 1829 parameters.currentValue = value();
1830 parameters.doubleValue = m_inputType->valueAsDouble(); 1830 parameters.doubleValue = m_inputType->valueAsDouble();
1831 parameters.isAnchorElementRTL = computedStyle()->direction() == RTL; 1831 parameters.isAnchorElementRTL = m_inputType->computedTextDirection() == RTL;
1832 if (HTMLDataListElement* dataList = this->dataList()) { 1832 if (HTMLDataListElement* dataList = this->dataList()) {
1833 RefPtrWillBeRawPtr<HTMLCollection> options = dataList->options(); 1833 RefPtrWillBeRawPtr<HTMLCollection> options = dataList->options();
1834 for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(opt ions->item(i)); ++i) { 1834 for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(opt ions->item(i)); ++i) {
1835 if (!isValidValue(option->value())) 1835 if (!isValidValue(option->value()))
1836 continue; 1836 continue;
1837 DateTimeSuggestion suggestion; 1837 DateTimeSuggestion suggestion;
1838 suggestion.value = m_inputType->parseToNumber(option->value(), Decim al::nan()).toDouble(); 1838 suggestion.value = m_inputType->parseToNumber(option->value(), Decim al::nan()).toDouble();
1839 if (std::isnan(suggestion.value)) 1839 if (std::isnan(suggestion.value))
1840 continue; 1840 continue;
1841 suggestion.localizedValue = localizeValue(option->value()); 1841 suggestion.localizedValue = localizeValue(option->value());
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1880 { 1880 {
1881 return m_inputType->shouldDispatchFormControlChangeEvent(oldValue, newValue) ; 1881 return m_inputType->shouldDispatchFormControlChangeEvent(oldValue, newValue) ;
1882 } 1882 }
1883 1883
1884 void HTMLInputElement::didNotifySubtreeInsertionsToDocument() 1884 void HTMLInputElement::didNotifySubtreeInsertionsToDocument()
1885 { 1885 {
1886 listAttributeTargetChanged(); 1886 listAttributeTargetChanged();
1887 } 1887 }
1888 1888
1889 } // namespace 1889 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698