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

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

Issue 149413004: HTMLInputElement.valueAsNumber compliance (NaN handling.) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 m_inputType->setValueAsDate(value, exceptionState); 1048 m_inputType->setValueAsDate(value, exceptionState);
1049 } 1049 }
1050 1050
1051 double HTMLInputElement::valueAsNumber() const 1051 double HTMLInputElement::valueAsNumber() const
1052 { 1052 {
1053 return m_inputType->valueAsDouble(); 1053 return m_inputType->valueAsDouble();
1054 } 1054 }
1055 1055
1056 void HTMLInputElement::setValueAsNumber(double newValue, ExceptionState& excepti onState, TextFieldEventBehavior eventBehavior) 1056 void HTMLInputElement::setValueAsNumber(double newValue, ExceptionState& excepti onState, TextFieldEventBehavior eventBehavior)
1057 { 1057 {
1058 if (!std::isfinite(newValue)) { 1058 if (std::isinf(newValue)) {
1059 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::n otAFiniteNumber(newValue)); 1059 exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(newVal ue));
1060 return; 1060 return;
1061 } 1061 }
1062 m_inputType->setValueAsDouble(newValue, eventBehavior, exceptionState); 1062 m_inputType->setValueAsDouble(newValue, eventBehavior, exceptionState);
1063 } 1063 }
1064 1064
1065 void HTMLInputElement::setValueFromRenderer(const String& value) 1065 void HTMLInputElement::setValueFromRenderer(const String& value)
1066 { 1066 {
1067 // File upload controls will never use this. 1067 // File upload controls will never use this.
1068 ASSERT(!isFileUpload()); 1068 ASSERT(!isFileUpload());
1069 1069
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
1866 } 1866 }
1867 1867
1868 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 1868 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
1869 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() 1869 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer()
1870 { 1870 {
1871 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer()); 1871 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer());
1872 } 1872 }
1873 #endif 1873 #endif
1874 1874
1875 } // namespace 1875 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698