зеркало из https://github.com/mozilla/gecko-dev.git
Make sure to do saturating adds on possibly-unconstrained nscoords. Bug 421404, r=dholbert, sr=roc, a=beltzner
This commit is contained in:
Родитель
d64ed99c7f
Коммит
21dee34a41
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div style="width: -moz-fit-content; width: fit-content; clear: both">
|
||||
<div style="float: left; width: 20px; padding: 100%"></div>
|
||||
<div style="float: left; width: 20px"></div>
|
||||
<div style="float: left; width: 20px"></div>
|
||||
</div>
|
||||
<div style="width: -moz-fit-content; width: fit-content; clear: both">
|
||||
<div style="float: right; width: 20px; padding: 100%"></div>
|
||||
<div style="float: right; width: 20px"></div>
|
||||
<div style="float: right; width: 20px"></div>
|
||||
</div>
|
||||
<div style="width: -moz-fit-content; width: fit-content; clear: both">
|
||||
<div style="float: left; width: 20px; padding: 100%"></div>
|
||||
<div style="float: right; width: 20px; padding: 100%; clear: right"></div>
|
||||
<div style="float: right; width: 20px; clear: right"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -92,3 +92,4 @@ load 407009-1.xhtml
|
|||
load 408749-1.xhtml
|
||||
load 408883-1.html
|
||||
load 410228-1.html
|
||||
load 421404-1.html
|
||||
|
|
|
@ -2859,7 +2859,8 @@ nsIFrame::InlinePrefWidthData::ForceBreak(nsIRenderingContext *aRenderingContext
|
|||
if (floatDisp->mBreakType == NS_STYLE_CLEAR_LEFT ||
|
||||
floatDisp->mBreakType == NS_STYLE_CLEAR_RIGHT ||
|
||||
floatDisp->mBreakType == NS_STYLE_CLEAR_LEFT_AND_RIGHT) {
|
||||
nscoord floats_cur = floats_cur_left + floats_cur_right;
|
||||
nscoord floats_cur = NSCoordSaturatingAdd(floats_cur_left,
|
||||
floats_cur_right);
|
||||
if (floats_cur > floats_done)
|
||||
floats_done = floats_cur;
|
||||
if (floatDisp->mBreakType != NS_STYLE_CLEAR_RIGHT)
|
||||
|
@ -2870,12 +2871,15 @@ nsIFrame::InlinePrefWidthData::ForceBreak(nsIRenderingContext *aRenderingContext
|
|||
|
||||
nscoord &floats_cur = floatDisp->mFloats == NS_STYLE_FLOAT_LEFT
|
||||
? floats_cur_left : floats_cur_right;
|
||||
floats_cur +=
|
||||
nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
||||
floatFrame, nsLayoutUtils::PREF_WIDTH);
|
||||
floats_cur =
|
||||
NSCoordSaturatingAdd(floats_cur,
|
||||
nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
||||
floatFrame,
|
||||
nsLayoutUtils::PREF_WIDTH));
|
||||
}
|
||||
|
||||
nscoord floats_cur = floats_cur_left + floats_cur_right;
|
||||
nscoord floats_cur =
|
||||
NSCoordSaturatingAdd(floats_cur_left, floats_cur_right);
|
||||
if (floats_cur > floats_done)
|
||||
floats_done = floats_cur;
|
||||
|
||||
|
@ -2884,7 +2888,8 @@ nsIFrame::InlinePrefWidthData::ForceBreak(nsIRenderingContext *aRenderingContext
|
|||
floats.Clear();
|
||||
}
|
||||
|
||||
currentLine = NSCoordSaturatingSubtract(currentLine, trailingWhitespace, nscoord_MAX);
|
||||
currentLine =
|
||||
NSCoordSaturatingSubtract(currentLine, trailingWhitespace, nscoord_MAX);
|
||||
prevLines = PR_MAX(prevLines, currentLine);
|
||||
currentLine = trailingWhitespace = 0;
|
||||
skipWhitespace = PR_TRUE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче