Bug 621841. Clear restyle flags in frameset kids when we process them. r=dbaron

This commit is contained in:
Boris Zbarsky 2011-03-04 10:27:02 -05:00
parent 12a6879b47
commit c79bd4569e
3 changed files with 33 additions and 3 deletions

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
var frame = document.getElementById("f");
var frameDoc = frame.contentDocument;
frameDoc.getElementById("g").style.background = "yellow";
frame.style.cssFloat = "right";
document.documentElement.offsetHeight;
frameDoc.documentElement.style.color = "green";
}
</script>
</head>
<body onload="boom();"><iframe id="f" src="data:text/html,<!DOCTYPE html><frameset><frame id=g></frameset>"></iframe></body>
</html>

View File

@ -352,3 +352,4 @@ load 603510-1.html
load 604314-1.html
load 604843.html
load 605340.html
load 621841-1.html

View File

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