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

Changeset 178571 in webkit


Ignore:
Timestamp:
Jan 15, 2015, 7:45:01 PM (12 years ago)
Author:
rniwa@webkit.org
Message:

Removing an HTML element spends a lot of time in adjustDirectionalityIfNeededAfterChildrenChanged
https://bugs.webkit.org/show_bug.cgi?id=140523
<rdar://problem/19464329>

Reviewed by Chris Dumez.

The bug was caused by adjustDirectionalityIfNeededAfterChildrenChanged always traversing children to
unset selfOrAncestorHasDirAutoAttribute flag while removing a child element.

Fixed the bug by removing this code. This code was no-op prior to being refactored in r154957 since
we only entered a for loop with the invariant "counter < childCountDelta" when "childCountDelta < 0".

See http://trac.webkit.org/changeset/154957/trunk/Source/WebCore/html/HTMLElement.cpp.

  • html/HTMLElement.cpp:

(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r178568 r178571  
     12015-01-15  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Removing an HTML element spends a lot of time in adjustDirectionalityIfNeededAfterChildrenChanged
     4        https://bugs.webkit.org/show_bug.cgi?id=140523
     5        <rdar://problem/19464329>
     6
     7        Reviewed by Chris Dumez.
     8
     9        The bug was caused by adjustDirectionalityIfNeededAfterChildrenChanged always traversing children to
     10        unset selfOrAncestorHasDirAutoAttribute flag while removing a child element.
     11
     12        Fixed the bug by removing this code. This code was no-op prior to being refactored in r154957 since
     13        we only entered a for loop with the invariant "counter < childCountDelta" when "childCountDelta < 0".
     14
     15        See http://trac.webkit.org/changeset/154957/trunk/Source/WebCore/html/HTMLElement.cpp.
     16
     17        * html/HTMLElement.cpp:
     18        (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
     19
    1202015-01-15  Brent Fulgham  <bfulgham@apple.com>
    221
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r177996 r178571  
    945945{
    946946    // FIXME: This function looks suspicious.
    947     if (document().renderView() && (changeType == ElementRemoved || changeType == TextRemoved)) {
    948         Node* node = beforeChange ? beforeChange->nextSibling() : nullptr;
    949         for (; node; node = node->nextSibling()) {
    950             if (elementAffectsDirectionality(*node))
    951                 continue;
    952 
    953             setHasDirAutoFlagRecursively(node, false);
    954         }
    955     }
    956947
    957948    if (!selfOrAncestorHasDirAutoAttribute())
Note: See TracChangeset for help on using the changeset viewer.