mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 05:35:31 +00:00
Bug 1280362 - Remove DocumentWrite and htmlesc as unused. r=arai
--HG-- extra : rebase_source : 8343509b1250ab440e18c516748031687063f65b
This commit is contained in:
parent
57cc3af889
commit
f8b0f4ec6d
@ -30,7 +30,6 @@
|
||||
var documentBody = global.document.body;
|
||||
var documentDocumentElement = global.document.documentElement;
|
||||
var DocumentCreateElement = global.document.createElement;
|
||||
var HTMLDocumentPrototypeWrite = global.HTMLDocument.prototype.write;
|
||||
var ElementInnerHTMLSetter =
|
||||
ObjectGetOwnPropertyDescriptor(global.Element.prototype, "innerHTML").set;
|
||||
var HTMLIFramePrototypeContentWindowGetter =
|
||||
@ -64,10 +63,6 @@
|
||||
ReflectApply(HTMLElementPrototypeSetAttribute, element, [name, value]);
|
||||
}
|
||||
|
||||
function SetInnerHTML(element, html) {
|
||||
ReflectApply(ElementInnerHTMLSetter, element, [html]);
|
||||
}
|
||||
|
||||
function SetTextContent(element, text) {
|
||||
ReflectApply(NodePrototypeTextContentSetter, element, [text]);
|
||||
}
|
||||
@ -92,21 +87,6 @@
|
||||
global.newGlobal = newGlobal;
|
||||
}
|
||||
|
||||
// This function is *only* used in this file! Ultimately it should only be
|
||||
// used by other exports in this IIFE, but for now just export it so that
|
||||
// functions not exported within this IIFE (but still in this file) can use
|
||||
// it.
|
||||
function DocumentWrite(s) {
|
||||
try {
|
||||
var msgDiv = CreateElement('div');
|
||||
SetInnerHTML(msgDiv, s);
|
||||
AppendChild(documentBody, msgDiv);
|
||||
} catch (e) {
|
||||
ReflectApply(HTMLDocumentPrototypeWrite, document, [s + "<br>\n"]);
|
||||
}
|
||||
}
|
||||
global.DocumentWrite = DocumentWrite;
|
||||
|
||||
// This function is *only* used by this file's |print()| function! It's only
|
||||
// defined/exported here because |print| is defined outside this IIFE and
|
||||
// because it needs access to unadulterated functionality as originally
|
||||
@ -203,16 +183,6 @@ function setRestoreFunction(restore) {
|
||||
jstestsRestoreFunction = restore;
|
||||
}
|
||||
|
||||
function htmlesc(str) {
|
||||
if (str == '<')
|
||||
return '<';
|
||||
if (str == '>')
|
||||
return '>';
|
||||
if (str == '&')
|
||||
return '&';
|
||||
return str;
|
||||
}
|
||||
|
||||
function print() {
|
||||
var s = 'TEST-INFO | ';
|
||||
var a;
|
||||
|
Loading…
Reference in New Issue
Block a user