Bug 1782947 - Check for null pres context in nsLayoutUtils::GetTextRunFlagsForStyle. r=jfkthame, a=dsmith
authorAndrew Osmond <aosmond@mozilla.com>
Wed, 03 Aug 2022 14:05:29 +0000
changeset 696121 1dcb29795850db0c2baf36789c2df0760a5d0e9d
parent 696120 f9976b8c64b810d4ca4e61a6b00171db1cf4ccff
child 696122 22075771cc8a6230c0c78e0d20f4d2d600f12e04
push id16931
push userdsmith@mozilla.com
push dateThu, 04 Aug 2022 18:37:42 +0000
treeherdermozilla-beta@f028f909c84f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame, dsmith
bugs1782947
milestone104.0
Bug 1782947 - Check for null pres context in nsLayoutUtils::GetTextRunFlagsForStyle. r=jfkthame, a=dsmith Differential Revision: https://phabricator.services.mozilla.com/D153583
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -6940,18 +6940,18 @@ nsIFrame* nsLayoutUtils::GetReferenceFra
       StyleMozControlCharacterVisibility::Hidden) {
     result |= gfx::ShapedTextFlags::TEXT_HIDE_CONTROL_CHARACTERS;
   }
   switch (aComputedStyle->StyleText()->mTextRendering) {
     case StyleTextRendering::Optimizespeed:
       result |= gfx::ShapedTextFlags::TEXT_OPTIMIZE_SPEED;
       break;
     case StyleTextRendering::Auto:
-      if (aStyleFont->mFont.size.ToCSSPixels() <
-          aPresContext->GetAutoQualityMinFontSize()) {
+      if (aPresContext && aStyleFont->mFont.size.ToCSSPixels() <
+                              aPresContext->GetAutoQualityMinFontSize()) {
         result |= gfx::ShapedTextFlags::TEXT_OPTIMIZE_SPEED;
       }
       break;
     default:
       break;
   }
   return result | GetTextRunOrientFlagsForStyle(aComputedStyle);
 }