Bug 817395 - Clean up the temporary style context used for font size comparision of the root before the rule node tree is rebuilt. r=dbaron
authorKang-Hao (Kenny) Lu <kennyluck@csail.mit.edu>
Mon, 11 Feb 2013 18:04:11 -0800
changeset 131457 04f8351eb2af9279a2d52b7023e116ad1badd68d
parent 131456 d1b8047ed4dba5ff8669b69534a4e4c416871591
child 131458 d2702388ca93e131e81e9608a88276db27d5a832
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs817395
milestone21.0a1
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
Bug 817395 - Clean up the temporary style context used for font size comparision of the root before the rule node tree is rebuilt. r=dbaron
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -8425,16 +8425,17 @@ nsCSSFrameConstructor::RestyleElement(El
   if (GetPresContext()->UsesRootEMUnits() && aPrimaryFrame) {
     nsStyleContext *oldContext = aPrimaryFrame->GetStyleContext();
     if (!oldContext->GetParent()) { // check that we're the root element
       nsRefPtr<nsStyleContext> newContext = mPresShell->StyleSet()->
         ResolveStyleFor(aElement, nullptr /* == oldContext->GetParent() */);
       if (oldContext->GetStyleFont()->mFont.size !=
           newContext->GetStyleFont()->mFont.size) {
         // The basis for 'rem' units has changed.
+        newContext = nullptr;
         DoRebuildAllStyleData(aRestyleTracker, nsChangeHint(0));
         if (aMinHint == 0) {
           return;
         }
         aPrimaryFrame = aElement->GetPrimaryFrame();
       }
     }
   }