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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2362223002: Stop clamping tabIndex to short range (Closed)
Patch Set: Fix test expectation Created 4 years, 2 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
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 047e339cba3e817a5c7eb056291cb3d2776f7584..03e35061c9ca40cd5608fab8a1e7dd6096a3019e 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -217,7 +217,7 @@ void Element::clearTabIndexExplicitlyIfNeeded() {
elementRareData()->clearTabIndexExplicitly();
}
-void Element::setTabIndexExplicitly(short tabIndex) {
+void Element::setTabIndexExplicitly(int tabIndex) {
ensureElementRareData().setTabIndexExplicitly(tabIndex);
}
@@ -225,7 +225,7 @@ void Element::setTabIndex(int value) {
setIntegralAttribute(tabindexAttr, value);
}
-short Element::tabIndex() const {
+int Element::tabIndex() const {
return hasRareData() ? elementRareData()->tabIndex() : 0;
}
@@ -2433,11 +2433,7 @@ void Element::parseAttribute(const QualifiedName& name,
document().setNeedsFocusedElementCheck();
}
} else if (parseHTMLInteger(value, tabindex)) {
- // Clamp tabindex to the range of 'short' to match Firefox's behavior.
- setTabIndexExplicitly(
- max(static_cast<int>(std::numeric_limits<short>::min()),
- std::min(tabindex,
- static_cast<int>(std::numeric_limits<short>::max()))));
+ setTabIndexExplicitly(tabindex);
kochi 2016/10/18 02:37:24 Could you add a comment here for the behavior when
rwlbuis 2016/10/19 00:43:43 Done.
}
} else if (name == XMLNames::langAttr) {
pseudoStateChanged(CSSSelector::PseudoLang);

Powered by Google App Engine
This is Rietveld 408576698