Don't restyle slow selectors for changes to anonymous content (non-native-anonymous). (Bug 436453) r+sr=bzbarsky
authorL. David Baron <dbaron@dbaron.org>
Tue, 22 Jul 2008 21:50:20 -0700
changeset 16128 80865e03f6af9ae6d9f88e358f483cc8a8f232d4
parent 16127 ba8e7ded433b37e2f2a2fa0efc1c2dfb54b467fd
child 16131 ed4c2de9fa703acf3f116423f7948655b9ce6a66
push id786
push userdbaron@mozilla.com
push dateWed, 23 Jul 2008 04:50:58 +0000
treeherdermozilla-central@80865e03f6af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs436453
milestone1.9.1a1pre
Don't restyle slow selectors for changes to anonymous content (non-native-anonymous). (Bug 436453) r+sr=bzbarsky
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsPresShell.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -12944,18 +12944,18 @@ nsCSSFrameConstructor::RestyleForAppend(
 #ifdef DEBUG
   {
     for (PRInt32 index = aNewIndexInContainer;; ++index) {
       nsIContent *content = aContainer->GetChildAt(index);
       if (!content) {
         NS_ASSERTION(index != aNewIndexInContainer, "yikes, nothing appended");
         break;
       }
-      NS_ASSERTION(!content->IsRootOfNativeAnonymousSubtree(),
-                   "native anonymous nodes should not be in child lists");
+      NS_ASSERTION(!content->IsRootOfAnonymousSubtree(),
+                   "anonymous nodes should not be in child lists");
     }
   }
 #endif
   PRUint32 selectorFlags =
     aContainer->GetFlags() & (NODE_ALL_SELECTOR_FLAGS &
                               ~NODE_HAS_SLOW_SELECTOR_NOAPPEND);
   if (selectorFlags == 0)
     return;
@@ -13003,18 +13003,18 @@ nsCSSFrameConstructor::RestyleForAppend(
 // notification before the removal happened (and sometimes
 // CharacterDataChanged is more like a removal than an addition).
 // The comments are written and variables are named in terms of it being
 // a ContentInserted notification.
 void
 nsCSSFrameConstructor::RestyleForInsertOrChange(nsIContent* aContainer,
                                                 nsIContent* aChild)
 {
-  NS_ASSERTION(!aChild->IsRootOfNativeAnonymousSubtree(),
-               "native anonymous nodes should not be in child lists");
+  NS_ASSERTION(!aChild->IsRootOfAnonymousSubtree(),
+               "anonymous nodes should not be in child lists");
   PRUint32 selectorFlags =
     aContainer ? (aContainer->GetFlags() & NODE_ALL_SELECTOR_FLAGS) : 0;
   if (selectorFlags == 0)
     return;
 
   if (selectorFlags & (NODE_HAS_SLOW_SELECTOR |
                        NODE_HAS_SLOW_SELECTOR_NOAPPEND)) {
     PostRestyleEvent(aContainer, eReStyle_Self, NS_STYLE_HINT_NONE);
@@ -13084,18 +13084,18 @@ nsCSSFrameConstructor::RestyleForInsertO
   }
 }
 
 void
 nsCSSFrameConstructor::RestyleForRemove(nsIContent* aContainer,
                                         nsIContent* aOldChild,
                                         PRInt32 aIndexInContainer)
 {
-  NS_ASSERTION(!aOldChild->IsRootOfNativeAnonymousSubtree(),
-               "native anonymous nodes should not be in child lists");
+  NS_ASSERTION(!aOldChild->IsRootOfAnonymousSubtree(),
+               "anonymous nodes should not be in child lists");
   PRUint32 selectorFlags =
     aContainer ? (aContainer->GetFlags() & NODE_ALL_SELECTOR_FLAGS) : 0;
   if (selectorFlags == 0)
     return;
 
   if (selectorFlags & (NODE_HAS_SLOW_SELECTOR |
                        NODE_HAS_SLOW_SELECTOR_NOAPPEND)) {
     PostRestyleEvent(aContainer, eReStyle_Self, NS_STYLE_HINT_NONE);
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -4630,17 +4630,17 @@ PresShell::CharacterDataChanged(nsIDocum
   }
 
   // Call this here so it only happens for real content mutations and
   // not cases when the frame constructor calls its own methods to force
   // frame reconstruction.
   nsIContent *container = aContent->GetParent();
   PRUint32 selectorFlags =
     container ? (container->GetFlags() & NODE_ALL_SELECTOR_FLAGS) : 0;
-  if (selectorFlags != 0 && !aContent->IsRootOfNativeAnonymousSubtree()) {
+  if (selectorFlags != 0 && !aContent->IsRootOfAnonymousSubtree()) {
     PRUint32 index;
     if (aInfo->mAppend &&
         container->GetChildAt((index = container->GetChildCount() - 1)) ==
           aContent)
       mFrameConstructor->RestyleForAppend(container, index);
     else
       mFrameConstructor->RestyleForInsertOrChange(container, aContent);
   }