⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 175968 in webkit


Ignore:
Timestamp:
Nov 11, 2014, 12:41:50 PM (12 years ago)
Author:
Chris Dumez
Message:

Regression(r175947): Caused assertions in debug builds
https://bugs.webkit.org/show_bug.cgi?id=138620

Reviewed by Benjamin Poulain.

In HTMLCollection::traverseForward(), traversedCount was incremented 1
time too many when hitting the end of the collection (i.e. element
becomes null). Doing a partial revert.

No new tests, already covered by existing tests.

  • html/HTMLCollection.cpp:

(WebCore::HTMLCollection::traverseForward):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r175966 r175968  
     12014-11-11  Chris Dumez  <cdumez@apple.com>
     2
     3        Regression(r175947): Caused assertions in debug builds
     4        https://bugs.webkit.org/show_bug.cgi?id=138620
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        In HTMLCollection::traverseForward(), traversedCount was incremented 1
     9        time too many when hitting the end of the collection (i.e. element
     10        becomes null). Doing a partial revert.
     11
     12        No new tests, already covered by existing tests.
     13
     14        * html/HTMLCollection.cpp:
     15        (WebCore::HTMLCollection::traverseForward):
     16
    1172014-11-11  Tim Horton  <timothy_horton@apple.com>
    218
  • trunk/Source/WebCore/html/HTMLCollection.cpp

    r175947 r175968  
    330330    Element* element = &current;
    331331    if (usesCustomForwardOnlyTraversal()) {
    332         for (traversedCount = 0; element && traversedCount < count; ++traversedCount)
     332        for (traversedCount = 0; traversedCount < count; ++traversedCount) {
    333333            element = customElementAfter(element);
     334            if (!element)
     335                return nullptr;
     336        }
    334337    } else if (m_shouldOnlyIncludeDirectChildren) {
    335         for (traversedCount = 0; element && traversedCount < count; ++traversedCount)
     338        for (traversedCount = 0; traversedCount < count; ++traversedCount) {
    336339            element = nextMatchingSiblingElement(*this, *element);
     340            if (!element)
     341                return nullptr;
     342        }
    337343    } else {
    338         for (traversedCount = 0; element && traversedCount < count; ++traversedCount)
     344        for (traversedCount = 0; traversedCount < count; ++traversedCount) {
    339345            element = nextMatchingElement(*this, *element, root);
     346            if (!element)
     347                return nullptr;
     348        }
    340349    }
    341350    return element;
Note: See TracChangeset for help on using the changeset viewer.