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
--- 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