Bug 497519 part 1. Clear the undisplayed map correctly in the presence of XBL. r=dbaron,bzbarsky

This commit is contained in:
Timothy Nikkel 2009-08-07 15:51:25 -04:00
Родитель 5be8c26635
Коммит c20df0835f
3 изменённых файлов: 47 добавлений и 0 удалений

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

@ -0,0 +1,28 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<xbl:bindings xmlns:xbl="http://www.mozilla.org/xbl">
<xbl:binding id="foo"><xbl:content><div style="position:relative;"><xbl:children/></div></xbl:content></xbl:binding>
</xbl:bindings>
<script>
<![CDATA[
function test() {
document.getElementById("span").innerHTML = "<table><tr><td></td></tr></table>";
}
]]>
</script>
</head>
<body onload="test();">
<div style="-moz-binding: url(#foo)">
<div style="display:none">text</div>
<span id="span">text</span>
</div>
</body>
</html>

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

@ -239,5 +239,6 @@ load 492014.xhtml
load 492112-1.xhtml load 492112-1.xhtml
load 492163-1.xhtml load 492163-1.xhtml
load 495350-1.html load 495350-1.html
load 497519-1.xhtml
load 500467-1.html load 500467-1.html
load 501878-1.html load 501878-1.html

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

@ -667,6 +667,24 @@ nsFrameManager::ClearAllUndisplayedContentIn(nsIContent* aParentContent)
if (mUndisplayedMap) { if (mUndisplayedMap) {
mUndisplayedMap->RemoveNodesFor(aParentContent); mUndisplayedMap->RemoveNodesFor(aParentContent);
} }
// Need to look at aParentContent's content list due to XBL insertions.
// Nodes in aParentContent's content list do not have aParentContent as a
// parent, but are treated as children of aParentContent. We get access to
// the content list via GetXBLChildNodesFor and just ignore any nodes we
// don't care about.
nsINodeList* list =
aParentContent->GetOwnerDoc()->BindingManager()->GetXBLChildNodesFor(aParentContent);
if (list) {
PRUint32 length;
list->GetLength(&length);
for (PRUint32 i = 0; i < length; ++i) {
nsIContent* child = list->GetNodeAt(i);
if (child->GetParent() != aParentContent) {
ClearUndisplayedContentIn(child, child->GetParent());
}
}
}
} }
void void