Changeset 106685 in webkit


Ignore:
Timestamp:
Feb 3, 2012 12:57:08 PM (12 years ago)
Author:
kling@webkit.org
Message:

HTMLElement: Clean up tabindex attribute parsing.
<http://webkit.org/b/77763>

Reviewed by Antti Koivisto.

Remove an unnecessary getAttribute() call when parsing tabindexAttr.

  • html/HTMLElement.cpp:

(WebCore::HTMLElement::parseMappedAttribute):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106683 r106685  
     12012-02-03  Andreas Kling  <awesomekling@apple.com>
     2
     3        HTMLElement: Clean up tabindex attribute parsing.
     4        <http://webkit.org/b/77763>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Remove an unnecessary getAttribute() call when parsing tabindexAttr.
     9
     10        * html/HTMLElement.cpp:
     11        (WebCore::HTMLElement::parseMappedAttribute):
     12
    1132012-02-03  Anders Carlsson  <andersca@apple.com>
    214
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r104838 r106685  
    190190        return StyledElement::parseMappedAttribute(attr);
    191191
    192     String indexstring;
    193192    if (attr->name() == alignAttr) {
    194193        if (equalIgnoringCase(attr->value(), "middle"))
     
    201200        addCSSProperty(attr, CSSPropertyDisplay, CSSValueNone);
    202201    } else if (attr->name() == tabindexAttr) {
    203         indexstring = getAttribute(tabindexAttr);
    204202        int tabindex = 0;
    205         if (!indexstring.length()) {
     203        if (attr->isEmpty())
    206204            clearTabIndexExplicitly();
    207         } else if (parseHTMLInteger(indexstring, tabindex)) {
     205        else if (parseHTMLInteger(attr->value(), tabindex)) {
    208206            // Clamp tabindex to the range of 'short' to match Firefox's behavior.
    209207            setTabIndexExplicitly(max(static_cast<int>(std::numeric_limits<short>::min()), min(tabindex, static_cast<int>(std::numeric_limits<short>::max()))));
Note: See TracChangeset for help on using the changeset viewer.