From e020f1328af55fa450d1e69b91da7d16a16b8dbe Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Tue, 31 Mar 2015 16:30:29 +1100 Subject: [PATCH] Bug 1146114 - Make assertion checking additional leading in ruby frame non-crash. r=dholbert --- layout/generic/crashtests/1146114.html | 6 ++++++ layout/generic/crashtests/crashtests.list | 1 + layout/generic/nsRubyFrame.cpp | 7 ++++--- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 layout/generic/crashtests/1146114.html diff --git a/layout/generic/crashtests/1146114.html b/layout/generic/crashtests/1146114.html new file mode 100644 index 00000000000..5f148a1679f --- /dev/null +++ b/layout/generic/crashtests/1146114.html @@ -0,0 +1,6 @@ + + + +
+ + diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list index f68f05bf46b..77ebeb99687 100644 --- a/layout/generic/crashtests/crashtests.list +++ b/layout/generic/crashtests/crashtests.list @@ -579,3 +579,4 @@ asserts(3-7) load 1137723-2.html # bug 1019192, bug 1138133 asserts(0-3) load 1134667.html asserts(0-3) load 1134667.html asserts(0-3) load 1134667.html +load 1146114.html diff --git a/layout/generic/nsRubyFrame.cpp b/layout/generic/nsRubyFrame.cpp index 6e098a34bdd..bfbcf3b71e1 100644 --- a/layout/generic/nsRubyFrame.cpp +++ b/layout/generic/nsRubyFrame.cpp @@ -374,9 +374,10 @@ nsRubyFrame::ReflowSegment(nsPresContext* aPresContext, // Set block leadings of the base container nscoord startLeading = baseRect.BStart(lineWM) - offsetRect.BStart(lineWM); nscoord endLeading = offsetRect.BEnd(lineWM) - baseRect.BEnd(lineWM); - NS_ASSERTION(startLeading >= 0 && endLeading >= 0, - "Leadings should be non-negative (because adding " - "ruby annotation can only increase the size)"); + // XXX When bug 765861 gets fixed, this warning should be upgraded. + NS_WARN_IF_FALSE(startLeading >= 0 && endLeading >= 0, + "Leadings should be non-negative (because adding " + "ruby annotation can only increase the size)"); mBStartLeading = std::max(mBStartLeading, startLeading); mBEndLeading = std::max(mBEndLeading, endLeading); }