Instead of incorrectly setting nsComputedDOMStyle's mOuterFrame and mInnerFrame when we have a pseudo-element to the element's frames, leave them null. (Bug 435442, patch 13) r=bzbarsky
authorL. David Baron <dbaron@dbaron.org>
Mon, 11 Apr 2011 23:18:44 -0700
changeset 67987 6645b30313c5a33d07e5028080962233800b164e
parent 67986 3a3c77941d26fd6e4f77c04234948870c9a440f6
child 67988 37cc67bd29b0c37f826f7acb59e672baa70ec712
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs435442
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Instead of incorrectly setting nsComputedDOMStyle's mOuterFrame and mInnerFrame when we have a pseudo-element to the element's frames, leave them null. (Bug 435442, patch 13) r=bzbarsky Note: tested by the pseudo-element tests in patch 14.
layout/style/nsComputedDOMStyle.cpp
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -487,32 +487,34 @@ nsComputedDOMStyle::GetPropertyCSSValue(
 #ifdef DEBUG
   mFlushedPendingReflows = propEntry->mNeedsLayoutFlush;
 #endif
 
   mPresShell = document->GetShell();
   NS_ENSURE_TRUE(mPresShell && mPresShell->GetPresContext(),
                  NS_ERROR_NOT_AVAILABLE);
 
-  mOuterFrame = mContent->GetPrimaryFrame();
-  mInnerFrame = mOuterFrame;
-  if (mOuterFrame && !mPseudo) {
-    nsIAtom* type = mOuterFrame->GetType();
-    if (type == nsGkAtoms::tableOuterFrame) {
-      // If the frame is an outer table frame then we should get the style
-      // from the inner table frame.
-      mInnerFrame = mOuterFrame->GetFirstChild(nsnull);
-      NS_ASSERTION(mInnerFrame, "Outer table must have an inner");
-      NS_ASSERTION(!mInnerFrame->GetNextSibling(),
-                   "Outer table frames should have just one child, the inner "
-                   "table");
+  if (!mPseudo) {
+    mOuterFrame = mContent->GetPrimaryFrame();
+    mInnerFrame = mOuterFrame;
+    if (mOuterFrame) {
+      nsIAtom* type = mOuterFrame->GetType();
+      if (type == nsGkAtoms::tableOuterFrame) {
+        // If the frame is an outer table frame then we should get the style
+        // from the inner table frame.
+        mInnerFrame = mOuterFrame->GetFirstChild(nsnull);
+        NS_ASSERTION(mInnerFrame, "Outer table must have an inner");
+        NS_ASSERTION(!mInnerFrame->GetNextSibling(),
+                     "Outer table frames should have just one child, "
+                     "the inner table");
+      }
+
+      mStyleContextHolder = mInnerFrame->GetStyleContext();
+      NS_ASSERTION(mStyleContextHolder, "Frame without style context?");
     }
-
-    mStyleContextHolder = mInnerFrame->GetStyleContext();
-    NS_ASSERTION(mStyleContextHolder, "Frame without style context?");
   }
 
   if (!mStyleContextHolder || mStyleContextHolder->HasPseudoElementData()) {
 #ifdef DEBUG
     if (mStyleContextHolder) {
       // We want to check that going through this path because of
       // HasPseudoElementData is rare, because it slows us down a good
       // bit.  So check that we're really inside something associated