--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -4471,16 +4471,25 @@ nsTextFrame::CharacterDataChanged(Charac
}
return NS_OK;
}
/* virtual */ void
nsTextFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
{
+ // A belt-and-braces check just in case we never get the
+ // MarkIntrinsicISizesDirty call from the style system.
+ if (StyleText()->mTextTransform == NS_STYLE_TEXT_TRANSFORM_CAPITALIZE &&
+ mTextRun &&
+ !(mTextRun->GetFlags() & nsTextFrameUtils::TEXT_IS_TRANSFORMED)) {
+ NS_ERROR("the current textrun doesn't match the style");
+ // The current textrun is now of the wrong type.
+ ClearTextRuns();
+ }
nsFrame::DidSetStyleContext(aOldStyleContext);
}
class nsDisplayTextGeometry : public nsDisplayItemGenericGeometry
{
public:
nsDisplayTextGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder)
: nsDisplayItemGenericGeometry(aItem, aBuilder)