summaryrefslogtreecommitdiffstats
path: root/WebCore/wml/WMLElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/wml/WMLElement.cpp')
-rw-r--r--WebCore/wml/WMLElement.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/WebCore/wml/WMLElement.cpp b/WebCore/wml/WMLElement.cpp
index 4d18e94..5c8a94c 100644
--- a/WebCore/wml/WMLElement.cpp
+++ b/WebCore/wml/WMLElement.cpp
@@ -72,12 +72,10 @@ void WMLElement::parseMappedAttribute(Attribute* attr)
addCSSProperty(attr, CSSPropertyTextAlign, attr->value());
} else if (attr->name() == HTMLNames::tabindexAttr) {
String indexstring = attr->value();
- if (indexstring.length()) {
- bool parsedOK;
- int tabindex = indexstring.toIntStrict(&parsedOK);
- if (parsedOK)
- // Clamp tabindex to the range of 'short' to match Firefox's behavior.
- setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max()))));
+ int tabindex = 0;
+ if (parseHTMLInteger(tabindex)) {
+ // Clamp tabindex to the range of 'short' to match Firefox's behavior.
+ setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max()))));
}
}
}