Bug 488390. Get special siblings correctly even when bidi is involved. r+sr=roc

This commit is contained in:
Boris Zbarsky 2009-04-14 22:28:27 -04:00
parent 2dd00a24df
commit 2b4145319a
6 changed files with 48 additions and 2 deletions

View File

@ -0,0 +1,18 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
function boom()
{
document.getElementById("select").removeAttribute("multiple");
// Trigger a reflow
document.body.style.width = 0;
// And flush layout
document.body.offsetWidth;
}
</script>
</head>
<body onload="boom();"><span>&#x202E;text text text text text&#x202C;<span><dir/></span><span><tr><select id="select" multiple="multiple"/></tr></span></span></body>
</html>

View File

@ -198,3 +198,4 @@ load 468645-3.xhtml
load 471594-1.xhtml
load 479114-1.html
load 477333-1.xhtml
load 488390-1.xhtml

View File

@ -1634,8 +1634,8 @@ nsLayoutUtils::GetNextContinuationOrSpecialSibling(nsIFrame *aFrame)
if ((aFrame->GetStateBits() & NS_FRAME_IS_SPECIAL) != 0) {
// We only store the "special sibling" annotation with the first
// frame in the flow. Walk back to find that frame now.
aFrame = aFrame->GetFirstInFlow();
// frame in the continuation chain. Walk back to find that frame now.
aFrame = aFrame->GetFirstContinuation();
void* value = aFrame->GetProperty(nsGkAtoms::IBSplitSpecialSibling);
return static_cast<nsIFrame*>(value);

View File

@ -0,0 +1,4 @@
<!DOCTYPE html>
<html>
<body>ab</body>
</html>

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function boom()
{
var s = document.getElementById("s");
s.parentNode.removeChild(s);
}
</script>
</head>
<body onload="boom();">
<!-- Need the bidi control chars to trigger non-fluid continuations, and
need the span right around the div so that the prevSibling of the node
whose frame we try to get doesn't have a frame map entry (so that we
don't have a useful hint). -->
<span>&#x202E;a&#x202C;b
<span><div></div></span>
<span id="s">This text should be gone</span>
</span>
</body>
</html>

View File

@ -1207,3 +1207,4 @@ fails == 472020-2.xul 472020-2-ref.xul
== 486052-2g.html 486052-2-ref.html
== 486848-1.xul 486848-1-ref.xul
== 487539-1.html about:blank
== 488390-1.html 488390-1-ref.html