Bug 1146114 - Make assertion checking additional leading in ruby frame non-crash. r=dholbert

This commit is contained in:
Xidorn Quan 2015-03-31 16:30:29 +11:00
parent 89ad93c9a8
commit e020f1328a
3 changed files with 11 additions and 3 deletions

View File

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body>
<div style="display: ruby-text; margin: 288230376151711740%"></div>
</body>
</html>

View File

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

View File

@ -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);
}