Bug 1469769 - Part 4: svg: Replace failing NS_NOTREACHED with NS_ERROR. r?heycam draft
authorChris Peterson <cpeterson@mozilla.com>
Sat, 26 May 2018 17:11:02 -0700
changeset 808628 b6ea29cce2595d68757589c37a7922b70cfaaf74
parent 808627 11504ad179370fe453f60e38e9874e29852a8818
child 808629 a215c8f1adcc79328bf0970181bfcace3097a9a2
push id113444
push usercpeterson@mozilla.com
push dateWed, 20 Jun 2018 07:17:30 +0000
reviewersheycam
bugs1469769, 412104, 903785
milestone62.0a1
Bug 1469769 - Part 4: svg: Replace failing NS_NOTREACHED with NS_ERROR. r?heycam I'm replacing non-failing calls to NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE, but this NS_NOTREACHED fails when running the dom/svg/crashtests/412104-1.svg test. This assertion failure is bug 903785. This patch DOES NOT fix the cause of the assertion failure (a missing TextNodeCorrespondenceProperty). It just replaces this failing NS_NOTREACHED with NS_ERROR because I can't replace with a fatal MOZ_ASSERT_UNREACHABLE. MozReview-Commit-ID: 8ffEdO5W1zU
layout/svg/SVGTextFrame.cpp
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -1328,18 +1328,19 @@ NS_DECLARE_FRAME_PROPERTY_DELETABLE(Text
  */
 static uint32_t
 GetUndisplayedCharactersBeforeFrame(nsTextFrame* aFrame)
 {
   void* value = aFrame->GetProperty(TextNodeCorrespondenceProperty());
   TextNodeCorrespondence* correspondence =
     static_cast<TextNodeCorrespondence*>(value);
   if (!correspondence) {
-    NS_NOTREACHED("expected a TextNodeCorrespondenceProperty on nsTextFrame "
-                  "used for SVG text");
+    // FIXME bug 903785
+    NS_ERROR("expected a TextNodeCorrespondenceProperty on nsTextFrame "
+             "used for SVG text");
     return 0;
   }
   return correspondence->mUndisplayedCharacters;
 }
 
 /**
  * Traverses the nsTextFrames for an SVGTextFrame and records a
  * TextNodeCorrespondenceProperty on each for the number of undisplayed DOM