Bug 361657 - Adopt nodes when placing them into the output window.

ChatZilla only.
r=samuel
This commit is contained in:
silver%warwickcompsoc.co.uk 2006-11-23 19:31:07 +00:00
Родитель 4e9f9b42f2
Коммит c8436e7a5b
2 изменённых файлов: 32 добавлений и 4 удалений

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

@ -133,7 +133,7 @@ function stock_initOutputWindow(newClient, newView, newClickHandler)
updateMotifSettings();
var output = document.getElementById("output");
output.appendChild(view.messages);
output.appendChild(adoptNode(view.messages));
if (view.TYPE in headers)
{
@ -291,6 +291,11 @@ function getMotifSettings()
return rv;
}
function adoptNode(node)
{
return client.adoptNode(node, document);
}
function setText(field, text, checkCondition)
{
if (!header[field].firstChild)
@ -440,7 +445,7 @@ function updateChannel()
var data = getObjectDetails(view);
data.dontLogURLs = true;
var nodes = client.munger.munge(view.topic, null, data);
header["topicnodes"].appendChild(nodes);
header["topicnodes"].appendChild(adoptNode(nodes));
}
else
{
@ -479,7 +484,7 @@ function updateUser()
var data = getObjectDetails(view);
data.dontLogURLs = true;
var nodes = client.munger.munge(view.desc, null, data);
header["descnodes"].appendChild(nodes);
header["descnodes"].appendChild(adoptNode(nodes));
}
else
{

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

@ -3497,6 +3497,29 @@ function c_updatemenus(menus)
return this.menuManager.updateMenus(document, menus);
}
client.adoptNode =
function cli_adoptnode(node, doc)
{
try
{
doc.adoptNode(node);
}
catch(ex)
{
dd(formatException(ex));
var err = ex.name;
// TypeError from before adoptNode was added; NOT_IMPL after.
if ((err == "TypeError") || (err == "NS_ERROR_NOT_IMPLEMENTED"))
client.adoptNode = cli_adoptnode_noop;
}
return node;
}
function cli_adoptnode_noop(node, doc)
{
return node;
}
client.addNetwork =
function cli_addnet(name, serverList, temporary)
{
@ -4317,7 +4340,7 @@ function addHistory (source, obj, mergeData)
if ("frame" in source)
needScroll = checkScroll(source.frame);
if (obj)
appendTo.appendChild(obj);
appendTo.appendChild(client.adoptNode(obj, appendTo.ownerDocument));
if (source.MAX_MESSAGES)
{