Incremental reflow bug with direction:rtl and bidi-override. b=375716 r=uriber sr=dbaron

This commit is contained in:
mats.palmgren%bredband.net 2007-05-06 10:29:58 +00:00
Родитель c26ebbf76f
Коммит de2fa93bc5
4 изменённых файлов: 58 добавлений и 15 удалений

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

@ -485,7 +485,6 @@ nsBidiPresUtils::InitLogicalArray(nsPresContext* aPresContext,
PRBool aAddMarkers)
{
nsIFrame* frame;
nsIFrame* directionalFrame;
nsresult res = NS_OK;
nsIPresShell* shell = aPresContext->PresShell();
@ -494,11 +493,10 @@ nsBidiPresUtils::InitLogicalArray(nsPresContext* aPresContext,
for (frame = aCurrentFrame;
frame && frame != aNextInFlow;
frame = frame->GetNextSibling()) {
directionalFrame = nsnull;
PRUnichar ch = 0;
if (aAddMarkers &&
frame->IsFrameOfType(nsIFrame::eBidiInlineContainer) &&
!frame->GetPrevContinuation()) {
frame->IsFrameOfType(nsIFrame::eBidiInlineContainer)) {
const nsStyleVisibility* vis = frame->GetStyleVisibility();
const nsStyleTextReset* text = frame->GetStyleTextReset();
switch (text->mUnicodeBidi) {
@ -508,28 +506,31 @@ nsBidiPresUtils::InitLogicalArray(nsPresContext* aPresContext,
styleContext = frame->GetStyleContext();
if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kRLE);
ch = kRLE;
}
else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kLRE);
ch = kLRE;
}
break;
case NS_STYLE_UNICODE_BIDI_OVERRIDE:
styleContext = frame->GetStyleContext();
if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kRLO);
ch = kRLO;
}
else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kLRO);
ch = kLRO;
}
break;
}
// Create a directional frame before the first frame of an
// element specifying embedding or override
if (directionalFrame) {
mLogicalFrames.AppendElement(directionalFrame);
if (ch != 0 && !frame->GetPrevContinuation()) {
nsIFrame* dirFrame = NS_NewDirectionalFrame(shell, styleContext, ch);
if (dirFrame) {
mLogicalFrames.AppendElement(dirFrame);
}
}
}
@ -551,13 +552,12 @@ nsBidiPresUtils::InitLogicalArray(nsPresContext* aPresContext,
}
// If the element is attributed by dir, indicate direction pop (add PDF frame)
if (directionalFrame && !frame->GetNextContinuation()) {
directionalFrame = NS_NewDirectionalFrame(shell, styleContext, kPDF);
if (ch != 0 && !frame->GetNextContinuation()) {
// Create a directional frame after the last frame of an
// element specifying embedding or override
if (directionalFrame) {
mLogicalFrames.AppendElement(directionalFrame);
nsIFrame* dirFrame = NS_NewDirectionalFrame(shell, styleContext, kPDF);
if (dirFrame) {
mLogicalFrames.AppendElement(dirFrame);
}
}
} // for

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

@ -0,0 +1,18 @@
<html><head>
<title>Bug 375716 - Incremental reflow bug with direction: rtl and bidi-override</title>
<style>
div {
border: 1px solid black;
width:200px;
}
</style>
</head><body>
<div>
<i style="direction: rtl;">
text text text text
<b>&#8238;text text text text text&#8236;</b>
text
</i>
</div>
</body></html>

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

@ -0,0 +1,24 @@
<html><head>
<title>Bug 375716 - Incremental reflow bug with direction: rtl and bidi-override</title>
<style>
div {
border: 1px solid black;
width:200px;
}
</style>
<script>
function boom() {
var div = document.getElementById('div');
div.removeAttribute('style')
}
</script>
</head><body onload="setTimeout(boom,10)">
<div id="div" style="font-size:120%">
<i style="direction: rtl;">
text text text text
<b style="unicode-bidi: bidi-override;">text text text text text</b>
text
</i>
</div>
</body></html>

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

@ -222,6 +222,7 @@ fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 372037-1.html 372037-1-ref.html # bug 3
== 374038-1.xul 374038-1-ref.xul
== 374038-2.xul 374038-2-ref.xul
== 374193-1.xhtml about:blank
== 375716-1.html 375716-1-ref.html
== 376484-1.html 376484-1-ref.html
== 377603-1.html 377603-1-ref.html
== 378535-1.html 378535-1-ref.html