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

Unified Diff: Source/core/html/HTMLSelectElement.cpp

Issue 1200853003: HTMLSelectElement size type changed to unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLSelectElement.h ('k') | Source/core/html/HTMLSelectElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLSelectElement.cpp
diff --git a/Source/core/html/HTMLSelectElement.cpp b/Source/core/html/HTMLSelectElement.cpp
index 40e693be924001375294aac11ae0a0f410e5de77..5355d74fc161af5da9769be4867b04afbd462621 100644
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -328,17 +328,17 @@ bool HTMLSelectElement::isPresentationAttribute(const QualifiedName& name) const
void HTMLSelectElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (name == sizeAttr) {
- int oldSize = m_size;
+ unsigned oldSize = m_size;
// Set the attribute value to a number.
// This is important since the style rules for this attribute can determine the appearance property.
- int size = value.toInt();
+ unsigned size = value.string().toUInt();
AtomicString attrSize = AtomicString::number(size);
if (attrSize != value) {
// FIXME: This is horribly factored.
if (Attribute* sizeAttribute = ensureUniqueElementData().attributes().find(sizeAttr))
sizeAttribute->setValue(attrSize);
}
- size = std::max(size, 0);
+ size = std::max(size, 0u);
// Ensure that we've determined selectedness of the items at least once prior to changing the size.
if (oldSize != size)
@@ -442,9 +442,9 @@ void HTMLSelectElement::setMultiple(bool multiple)
setSelectedIndex(oldSelectedIndex);
}
-void HTMLSelectElement::setSize(int size)
+void HTMLSelectElement::setSize(unsigned size)
{
- setIntegralAttribute(sizeAttr, size);
+ setUnsignedIntegralAttribute(sizeAttr, size);
}
Element* HTMLSelectElement::namedItem(const AtomicString& name)
« no previous file with comments | « Source/core/html/HTMLSelectElement.h ('k') | Source/core/html/HTMLSelectElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698