diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -22,16 +22,18 @@
 #include "nsTransitionManager.h"
 #include "nsViewManager.h"
 #include "nsRenderingContext.h"
 #include "nsSVGIntegrationUtils.h"
 #include "nsCSSAnonBoxes.h"
 #include "nsContainerFrame.h"
 #include "nsPlaceholderFrame.h"
 #include "nsBlockFrame.h"
+#include "nsTextFrame.h"
+#include "nsTextFrameUtils.h"
 #include "nsViewportFrame.h"
 #include "SVGTextFrame.h"
 #include "StickyScrollContainer.h"
 #include "nsIRootBox.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsContentUtils.h"
 #include "nsIFrameInlines.h"
 #include "ActiveLayerTracker.h"
@@ -1825,16 +1827,25 @@ VerifyContextParent(nsPresContext* aPres
 
 static void
 VerifyStyleTree(nsPresContext* aPresContext, nsIFrame* aFrame,
                 nsStyleContext* aParentContext)
 {
   nsStyleContext*  context = aFrame->StyleContext();
   VerifyContextParent(aPresContext, aFrame, context, nullptr);
 
+  nsTextFrame* tf = do_QueryFrame(aFrame);
+  if (tf) {
+    gfxTextRun* textRun = tf->GetTextRun(nsTextFrame::eInflated);
+    MOZ_ASSERT(!textRun ||
+      (tf->StyleText()->mTextTransform == NS_STYLE_TEXT_TRANSFORM_CAPITALIZE) ==
+      !!(textRun->GetFlags() & nsTextFrameUtils::TEXT_IS_TRANSFORMED),
+      "Text run doesn't match style!");
+  }
+
   nsIFrame::ChildListIterator lists(aFrame);
   for (; !lists.IsDone(); lists.Next()) {
     nsFrameList::Enumerator childFrames(lists.CurrentList());
     for (; !childFrames.AtEnd(); childFrames.Next()) {
       nsIFrame* child = childFrames.get();
       if (!(child->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) {
         // only do frames that are in flow
         if (nsGkAtoms::placeholderFrame == child->GetType()) {
@@ -3477,17 +3488,17 @@ ElementRestyler::InitializeAccessibility
   }
 #endif
 }
 
 void
 ElementRestyler::RestyleContentChildren(nsIFrame* aParent,
                                         nsRestyleHint aChildRestyleHint)
 {
-  LOG_RESTYLE("RestyleContentChildren");
+  LOG_RESTYLE("RestyleContentChildren aParent=%p", aParent);
 
   nsIFrame::ChildListIterator lists(aParent);
   TreeMatchContext::AutoAncestorPusher ancestorPusher(mTreeMatchContext);
   if (!lists.IsDone()) {
     ancestorPusher.PushAncestorAndStyleScope(mContent);
   }
   for (; !lists.IsDone(); lists.Next()) {
     nsFrameList::Enumerator childFrames(lists.CurrentList());
