Don't reserve space for start (end) margin on the first- (last-) in-flow if it has a previous (next) bidi continuation. bug=421419 r+sr=dbaron a1.9=dsicore

This commit is contained in:
uriber%gmail.com 2008-03-11 21:54:35 +00:00
Родитель fc37ea022b
Коммит 3930679ef2
4 изменённых файлов: 49 добавлений и 8 удалений

Просмотреть файл

@ -660,13 +660,19 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
// messy the bidi situations are, since per CSS2.1 section 8.6
// (implemented in bug 328168), the startSide border is always on the
// first line.
aData->currentLine +=
GetCoord(stylePadding->mPadding.Get(startSide), 0) +
styleBorder->GetBorderWidth(startSide) +
GetCoord(styleMargin->mMargin.Get(startSide), 0);
// This frame is a first-in-flow, but it might have a previous bidi
// continuation, in which case that continuation should handle the startSide
// border.
if (!GetPrevContinuation()) {
aData->currentLine +=
GetCoord(stylePadding->mPadding.Get(startSide), 0) +
styleBorder->GetBorderWidth(startSide) +
GetCoord(styleMargin->mMargin.Get(startSide), 0);
}
const nsLineList_iterator* savedLine = aData->line;
nsContainerFrame *lastInFlow;
for (nsContainerFrame *nif = this; nif;
nif = (nsContainerFrame*) nif->GetNextInFlow()) {
for (nsIFrame *kid = nif->mFrames.FirstChild(); kid;
@ -682,6 +688,7 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
// After we advance to our next-in-flow, the stored line may not
// longer be the correct line. Just forget it.
aData->line = nsnull;
lastInFlow = nif;
}
aData->line = savedLine;
@ -690,10 +697,15 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
// messy the bidi situations are, since per CSS2.1 section 8.6
// (implemented in bug 328168), the endSide border is always on the
// last line.
aData->currentLine +=
GetCoord(stylePadding->mPadding.Get(endSide), 0) +
styleBorder->GetBorderWidth(endSide) +
GetCoord(styleMargin->mMargin.Get(endSide), 0);
// We reached the last-in-flow, but it might have a next bidi
// continuation, in which case that continuation should handle
// the endSide border.
if (!lastInFlow->GetNextContinuation()) {
aData->currentLine +=
GetCoord(stylePadding->mPadding.Get(endSide), 0) +
styleBorder->GetBorderWidth(endSide) +
GetCoord(styleMargin->mMargin.Get(endSide), 0);
}
}
/* virtual */ nsSize

Просмотреть файл

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
div {
float: left;
border: medium solid black;
}
</style>
</head>
<body>
<div><span style="padding-right: 10em;"><br>&lrm;</span></div>
</body>
</html>

Просмотреть файл

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
div {
float: left;
border: medium solid black;
}
</style>
</head>
<body>
<div><span style="padding-right: 10em;"><br>&rlm;</span></div>
</body>
</html>

Просмотреть файл

@ -754,3 +754,4 @@ random == 403134-1.html 403134-1-ref.html # bug 405377
== 420069-2.html 420069-2-ref.html
# == 420351-1.html 420351-1-ref.html
== 421234-1.html 421234-1-ref.html
== 421419-1.html 421419-1-ref.html