Changeset 223330 in webkit


Ignore:
Timestamp:
Oct 15, 2017 2:58:42 PM (7 years ago)
Author:
Chris Dumez
Message:

DOMTokenList shouldn't add empty attributes
https://bugs.webkit.org/show_bug.cgi?id=178280
<rdar://problem/34987431>

Reviewed by Ryosuke Niwa.

Follow-up to r223306, reverse the check conditions to avoid attribute
lookup when possible. Also use m_tokens instead of tokens() to avoid
unnecessary branch.

  • html/DOMTokenList.cpp:

(WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r223329 r223330  
     12017-10-15  Chris Dumez  <cdumez@apple.com>
     2
     3        DOMTokenList shouldn't add empty attributes
     4        https://bugs.webkit.org/show_bug.cgi?id=178280
     5        <rdar://problem/34987431>
     6
     7        Reviewed by Ryosuke Niwa.
     8
     9        Follow-up to r223306, reverse the check conditions to avoid attribute
     10        lookup when possible. Also use m_tokens instead of tokens() to avoid
     11        unnecessary branch.
     12
     13        * html/DOMTokenList.cpp:
     14        (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
     15
    1162017-10-15  Darin Adler  <darin@apple.com>
    217
  • trunk/Source/WebCore/html/DOMTokenList.cpp

    r223306 r223330  
    249249    ASSERT(!m_tokensNeedUpdating);
    250250
    251     if (!m_element.hasAttribute(m_attributeName) && tokens().isEmpty())
     251    if (m_tokens.isEmpty() && !m_element.hasAttribute(m_attributeName))
    252252        return;
    253253
Note: See TracChangeset for help on using the changeset viewer.