Bug 564368. Clear lazy frame construction bits when constructing framesets. r=bzbarsky

This commit is contained in:
Timothy Nikkel 2010-05-11 19:30:42 -05:00
Родитель c109fe2321
Коммит cd6a9cc251
3 изменённых файлов: 34 добавлений и 0 удалений

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

@ -0,0 +1,27 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
<![CDATA[
function boom()
{
var a = document.createElementNS("http://www.w3.org/1999/xhtml", "frameset");
var b = document.createElementNS("http://www.w3.org/1999/xhtml", "frameset");
var c = document.createElementNS("http://www.w3.org/1999/xhtml", "frameset");
var div = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
a.appendChild(b);
document.documentElement.appendChild(a);
document.documentElement.offsetHeight;
b.appendChild(c);
document.documentElement.offsetHeight;
c.appendChild(div)
}
window.addEventListener("load", boom, false);
]]>
</script></head>
<body></body>
</html>

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

@ -298,3 +298,4 @@ load 541714-1.html
load 541714-2.html load 541714-2.html
load 547338.xul load 547338.xul
load 551635-1.html load 551635-1.html
load 564368-1.xhtml

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

@ -355,9 +355,15 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
for (PRUint32 childX = 0; childX < numChildren; childX++) { for (PRUint32 childX = 0; childX < numChildren; childX++) {
if (mChildCount == numCells) { // we have more <frame> or <frameset> than cells if (mChildCount == numCells) { // we have more <frame> or <frameset> than cells
// Clear the lazy bits in the remaining children.
for (PRUint32 i = childX; i < numChildren; i++) {
mContent->GetChildAt(i)->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES |
NODE_NEEDS_FRAME);
}
break; break;
} }
nsIContent *child = mContent->GetChildAt(childX); nsIContent *child = mContent->GetChildAt(childX);
child->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME);
// IMPORTANT: This must match the conditions in // IMPORTANT: This must match the conditions in
// nsCSSFrameConstructor::ContentAppended/Inserted/Removed // nsCSSFrameConstructor::ContentAppended/Inserted/Removed