+2015-01-15 Ryosuke Niwa <rniwa@webkit.org>
+
+ 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):
+
2015-01-15 Brent Fulgham <bfulgham@apple.com>
RenderLayerCompositor: Strange comparison of opacity (float) to boolean.
void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Element* beforeChange, ChildChangeType changeType)
{
// FIXME: This function looks suspicious.
- if (document().renderView() && (changeType == ElementRemoved || changeType == TextRemoved)) {
- Node* node = beforeChange ? beforeChange->nextSibling() : nullptr;
- for (; node; node = node->nextSibling()) {
- if (elementAffectsDirectionality(*node))
- continue;
-
- setHasDirAutoFlagRecursively(node, false);
- }
- }
if (!selfOrAncestorHasDirAutoAttribute())
return;