Call AdjustOffsetsForBidi on a new continuation frame immediately after creating it. Bug 536963, r=roc

This commit is contained in:
Simon Montagu 2010-01-03 00:46:19 -08:00
Родитель 16759521a4
Коммит 4e72e68aab
4 изменённых файлов: 39 добавлений и 2 удалений

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

@ -513,14 +513,17 @@ nsBidiPresUtils::Resolve(nsBlockFrame* aBlockFrame,
}
lineIter.GetLine()->MarkDirty();
nsIFrame* nextBidi;
PRInt32 runEnd = contentOffset + runLength;
EnsureBidiContinuation(frame, &nextBidi, frameIndex,
contentOffset,
contentOffset + runLength);
runEnd);
if (NS_FAILED(mSuccess)) {
break;
}
nextBidi->AdjustOffsetsForBidi(runEnd,
contentOffset + fragmentLength);
frame = nextBidi;
contentOffset += runLength;
contentOffset = runEnd;
} // if (runLength < fragmentLength)
else {
if (contentOffset + fragmentLength == contentTextLength) {

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

@ -0,0 +1,13 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Dynamic bidi bug</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
p { width: 3ch;}
</style>
</head>
<body>
<p dir="rtl">0 123 4</p>
</body>
</html>

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

@ -0,0 +1,20 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Dynamic bidi bug</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
p { width: 3ch;}
</style>
<script type="text/javascript">
function flip()
{
var flipped= document.getElementById('flipped');
flipped.dir = "rtl";
}
</script>
</head>
<body onload="flip()">
<p id="flipped">0 123 4</p>
</body>
</html>

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

@ -44,3 +44,4 @@ random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 386339.html 386339-ref.html
== 503269-1.html 503269-1-ref.html
== 503957-1.html 503957-1-ref.html
== 525740-1.html 525740-1-ref.html
== 536963-1.html 536963-1-ref.html