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

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

Issue 84713002: Add number() static methods to AtomicString class (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Pass NaN as default argument Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLImageElement.cpp ('k') | Source/core/html/HTMLMeterElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 int HTMLInputElement::maxLength() const 1287 int HTMLInputElement::maxLength() const
1288 { 1288 {
1289 return m_maxLength; 1289 return m_maxLength;
1290 } 1290 }
1291 1291
1292 void HTMLInputElement::setMaxLength(int maxLength, ExceptionState& exceptionStat e) 1292 void HTMLInputElement::setMaxLength(int maxLength, ExceptionState& exceptionStat e)
1293 { 1293 {
1294 if (maxLength < 0) 1294 if (maxLength < 0)
1295 exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError); 1295 exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError);
1296 else 1296 else
1297 setAttribute(maxlengthAttr, String::number(maxLength)); 1297 setIntegralAttribute(maxlengthAttr, maxLength);
1298 } 1298 }
1299 1299
1300 bool HTMLInputElement::multiple() const 1300 bool HTMLInputElement::multiple() const
1301 { 1301 {
1302 return fastHasAttribute(multipleAttr); 1302 return fastHasAttribute(multipleAttr);
1303 } 1303 }
1304 1304
1305 void HTMLInputElement::setSize(unsigned size) 1305 void HTMLInputElement::setSize(unsigned size)
1306 { 1306 {
1307 setAttribute(sizeAttr, String::number(size)); 1307 setUnsignedIntegralAttribute(sizeAttr, size);
1308 } 1308 }
1309 1309
1310 void HTMLInputElement::setSize(unsigned size, ExceptionState& exceptionState) 1310 void HTMLInputElement::setSize(unsigned size, ExceptionState& exceptionState)
1311 { 1311 {
1312 if (!size) 1312 if (!size)
1313 exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError); 1313 exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError);
1314 else 1314 else
1315 setSize(size); 1315 setSize(size);
1316 } 1316 }
1317 1317
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 return m_inputType->height(); 1759 return m_inputType->height();
1760 } 1760 }
1761 1761
1762 unsigned HTMLInputElement::width() const 1762 unsigned HTMLInputElement::width() const
1763 { 1763 {
1764 return m_inputType->width(); 1764 return m_inputType->width();
1765 } 1765 }
1766 1766
1767 void HTMLInputElement::setHeight(unsigned height) 1767 void HTMLInputElement::setHeight(unsigned height)
1768 { 1768 {
1769 setAttribute(heightAttr, String::number(height)); 1769 setUnsignedIntegralAttribute(heightAttr, height);
1770 } 1770 }
1771 1771
1772 void HTMLInputElement::setWidth(unsigned width) 1772 void HTMLInputElement::setWidth(unsigned width)
1773 { 1773 {
1774 setAttribute(widthAttr, String::number(width)); 1774 setUnsignedIntegralAttribute(widthAttr, width);
1775 } 1775 }
1776 1776
1777 PassOwnPtr<ListAttributeTargetObserver> ListAttributeTargetObserver::create(cons t AtomicString& id, HTMLInputElement* element) 1777 PassOwnPtr<ListAttributeTargetObserver> ListAttributeTargetObserver::create(cons t AtomicString& id, HTMLInputElement* element)
1778 { 1778 {
1779 return adoptPtr(new ListAttributeTargetObserver(id, element)); 1779 return adoptPtr(new ListAttributeTargetObserver(id, element));
1780 } 1780 }
1781 1781
1782 ListAttributeTargetObserver::ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement* element) 1782 ListAttributeTargetObserver::ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement* element)
1783 : IdTargetObserver(element->treeScope().idTargetObserverRegistry(), id) 1783 : IdTargetObserver(element->treeScope().idTargetObserverRegistry(), id)
1784 , m_element(element) 1784 , m_element(element)
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 } 1865 }
1866 1866
1867 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 1867 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
1868 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() 1868 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer()
1869 { 1869 {
1870 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer()); 1870 return m_inputTypeView->customStyleForRenderer(originalStyleForRenderer());
1871 } 1871 }
1872 #endif 1872 #endif
1873 1873
1874 } // namespace 1874 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLImageElement.cpp ('k') | Source/core/html/HTMLMeterElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698