зеркало из https://github.com/mozilla/gecko-dev.git
Bug 277324: Copy XML doesn't work on #document nodes, patch by Jason Barnabe <jason_barnabe@fastmail.fm>, r=timeless, sr=neil
This commit is contained in:
Родитель
25f7b0d3b7
Коммит
b66e86e580
|
@ -360,7 +360,11 @@ DOMViewer.prototype =
|
|||
|
||||
toXML: function(aNode)
|
||||
{
|
||||
return this._toXML(aNode, 0);
|
||||
// we'll use XML serializer, if available
|
||||
if (typeof XMLSerializer != "undefined")
|
||||
return (new XMLSerializer()).serializeToString(aNode);
|
||||
else
|
||||
return this._toXML(aNode, 0);
|
||||
},
|
||||
|
||||
// not the most complete serialization ever conceived, but it'll do for now
|
||||
|
@ -405,6 +409,8 @@ DOMViewer.prototype =
|
|||
s += InsUtil.unicodeToEntity(aNode.data);
|
||||
} else if (aNode.nodeType == Node.COMMENT_NODE) {
|
||||
s += line + "<!--" + InsUtil.unicodeToEntity(aNode.data) + "-->\n";
|
||||
} else if (aNode.nodeType == Node.DOCUMENT_NODE) {
|
||||
s += this._toXML(aNode.documentElement);
|
||||
}
|
||||
|
||||
return s;
|
||||
|
|
Загрузка…
Ссылка в новой задаче