forked from mirrors/gecko-dev
Bug 1858673 - Remove now unnecessary disabling of ESLint no-unsanitized/* rules from test files. r=freddyb,media-playback-reviewers,credential-management-reviewers,devtools-reviewers,sessionstore-reviewers,places-reviewers,aosmond,sgalich,dao,padenot
Differential Revision: https://phabricator.services.mozilla.com/D190985
This commit is contained in:
parent
79b35cfc1b
commit
31a45737c0
74 changed files with 3 additions and 92 deletions
|
|
@ -50,7 +50,6 @@ addAccessibleTask(
|
|||
var shadow = component.attachShadow({mode: "open"});
|
||||
for (var child = component.firstChild; child; child = child.nextSibling) {
|
||||
if (child.nodeType === 8)
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
shadow.innerHTML = child.data;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@
|
|||
var shadow = component.attachShadow({mode: "open"});
|
||||
for (var child = component.firstChild; child; child = child.nextSibling) {
|
||||
if (child.nodeType === 8)
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
shadow.innerHTML = child.data;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ async function initChildFrames(browser, insertHTML) {
|
|||
root.insertBefore(pre, root.firstChild);
|
||||
|
||||
if (insertHTMLChild) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.document.getElementById("insertPoint").innerHTML =
|
||||
insertHTMLChild;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ async function doTest(
|
|||
// Add the link for the child tab to the page.
|
||||
let mainDiv = content.document.createElement("div");
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
mainDiv.innerHTML =
|
||||
'<p><a id="linkToOpenInNewTab" href="' +
|
||||
childTabSpecContent +
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
is(blockedMixedDisplay, false, "OK: Should not block mixed display content!");
|
||||
|
||||
var newValue = "Verifying MCB does not trigger warning/error for an http page with https css that includes http font";
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.getElementById("testDiv").innerHTML = newValue;
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
var newValue = "Verifying MCB does not trigger warning/error for an http page ";
|
||||
newValue += "with https css that imports another http css which includes http font";
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.getElementById("testDiv").innerHTML = newValue;
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
is(blockedMixedDisplay, false, "OK: Should not block mixed display content!");
|
||||
|
||||
var newValue = "Verifying MCB does not trigger warning/error for an http page with https css that includes http image";
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.getElementById("testDiv").innerHTML = newValue;
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ try {
|
|||
}
|
||||
|
||||
function message(m) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.getElementById("message").innerHTML += `${m}<br>`;
|
||||
top.postMessage(m, "*");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ try {
|
|||
}
|
||||
|
||||
function message(m) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.getElementById("message").innerHTML += `${m}<br>`;
|
||||
top.postMessage(m, "*");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ try {
|
|||
}
|
||||
|
||||
function message(m) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.getElementById("message").innerHTML += `${m}<br>`;
|
||||
window.top.postMessage(m, "*");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ try {
|
|||
}
|
||||
|
||||
function message(m) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.getElementById("message").innerHTML += `${m}<br>`;
|
||||
window.parent.postMessage(m, "*");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ async function getResultFromSharedworker(aBrowser) {
|
|||
|
||||
let result = await new content.Promise(resolve => {
|
||||
worker.port.onmessage = function (e) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.document.getElementById("display").innerHTML = e.data;
|
||||
resolve(e.data);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
<script type="text/javascript">
|
||||
let bc = new BroadcastChannel("testBroadcastChannel");
|
||||
bc.onmessage = function(e) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.getElementById("display").innerHTML = e.data;
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<meta charset="UTF-8">
|
||||
Hi, I was opened via a <script>
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
document.write(location.search ?
|
||||
"popup call from the opened window... uh oh, that shouldn't happen!" :
|
||||
"bookmarklet, and I will open a new window myself.");</script><br>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
result.oscpu = navigator.oscpu;
|
||||
result.hardwareConcurrency = navigator.hardwareConcurrency;
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.getElementById("result").innerHTML = JSON.stringify(result);
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ function test() {
|
|||
tab.linkedBrowser.removeEventListener("load", listener, true);
|
||||
|
||||
let iframes = tab.linkedBrowser.contentWindow.frames;
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
iframes[1].document.body.innerHTML = uniqueValue;
|
||||
|
||||
frameCount = 0;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ add_task(async function test_save_doorhanger_not_shown() {
|
|||
|
||||
await BrowserTestUtils.withNewTab(EMPTY_URL, async function (browser) {
|
||||
await SpecialPowers.spawn(browser, [TEST.document], doc => {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.document.body.innerHTML = doc;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ add_task(async function test_save_doorhanger_tel_concatenated() {
|
|||
{ gBrowser, url: EMPTY_URL },
|
||||
async function (browser) {
|
||||
await SpecialPowers.spawn(browser, [MARKUP], doc => {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.document.body.innerHTML = doc;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,6 @@ add_task(async function test_save_doorhanger_not_shown() {
|
|||
|
||||
await BrowserTestUtils.withNewTab(EMPTY_URL, async function (browser) {
|
||||
await SpecialPowers.spawn(browser, [TEST.document], doc => {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.document.body.innerHTML = doc;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,6 @@ add_task(async function test_heuristics() {
|
|||
|
||||
await BrowserTestUtils.withNewTab(EMPTY_URL, async function (browser) {
|
||||
await SpecialPowers.spawn(browser, [TEST.document], doc => {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.document.body.innerHTML = doc;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,6 @@ add_task(async function test_save_doorhanger_click_save() {
|
|||
let onChanged = waitForStorageChangedEvents("add");
|
||||
await BrowserTestUtils.withNewTab(EMPTY_URL, async function (browser) {
|
||||
await SpecialPowers.spawn(browser, [TEST.document], doc => {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.document.body.innerHTML = doc;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
function log(msg) {
|
||||
const output = document.getElementById("output");
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
output.innerHTML = msg;
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
function log(msg) {
|
||||
const output = document.getElementById("output");
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
output.innerHTML = msg;
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ const html = `
|
|||
</head>
|
||||
`;
|
||||
onload = function() {
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
document.write(html);
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ add_task(async function () {
|
|||
console.log(new Map([[null, rtlOverride + "msg07"]]));
|
||||
|
||||
const parser = content.document.createElement("div");
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
parser.innerHTML = `
|
||||
<div data-test="${rtlOverride}msg08"></div>
|
||||
<div data-${rtlOverride}="msg09"></div>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ Test that css-logic calculates CSS specificity properly
|
|||
function createDocument() {
|
||||
let text = TEST_DATA.map(i=>i.text).join(",");
|
||||
text = '<style>' + text + " {color:red;}</style>";
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.body.innerHTML = text;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ SimpleTest.waitForExplicitFinish();
|
|||
|
||||
// Import all the test cases
|
||||
const tests =
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
(await Promise.all(testFiles.map(f => import(f).then(data => data.default)))).flat();
|
||||
|
||||
for (const {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
window.onpagehide = null;
|
||||
pageHideAsserts = {};
|
||||
pageHideAsserts.persisted = event.persisted;
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
pageHideAsserts.innerHTML = window.document.body.innerHTML;
|
||||
};
|
||||
window.location.href = msg.testUrl2;
|
||||
|
|
@ -22,7 +21,6 @@
|
|||
}
|
||||
window.onpageshow = function(e) {
|
||||
var msg = {command: "child1PageShow", persisted: e.persisted, pageHideAsserts};
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
msg.innerHTML = window.document.body.innerHTML;
|
||||
bc.postMessage(msg);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
<body>
|
||||
<script>
|
||||
function addMetaRefresh() {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.head.innerHTML = "<meta http-equiv='refresh' content='5; url=" +
|
||||
location.href.replace("?initial", "?refresh") + "'>";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
<body>
|
||||
<script>
|
||||
var src = window.location.hash.substring(1);
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
document.write('<iframe src="' + src + '"></iframe>');
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
var args = window.location.hash.substring(1).split(",");
|
||||
var target = args[0];
|
||||
var mechanism = args[1];
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
document.write("target=" + target + " mechanism=" + mechanism);
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
<body>
|
||||
<script>
|
||||
var target = window.location.hash.substring(1);
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
document.write("target=" + target);
|
||||
window.open("navigation_target_popup_url.html", target, "width=10,height=10");
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -21,10 +21,8 @@ function testChild0() {
|
|||
if (!window.window0) {
|
||||
window0 = window.open("", "window0", "width=10,height=10");
|
||||
window0.document.open();
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
window0.document.write(headerHTML);
|
||||
window0.document.write("<script>navigateByLocation(opener.frames[0])<\/script>");
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
window0.document.write(footerHTML);
|
||||
window0.document.close();
|
||||
}
|
||||
|
|
@ -34,10 +32,8 @@ function testChild1() {
|
|||
if (!window.window1) {
|
||||
window1 = window.open("", "window1", "width=10,height=10");
|
||||
window1.document.open();
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
window1.document.write(headerHTML);
|
||||
window1.document.write("<script>navigateByOpen('child1');<\/script>");
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
window1.document.write(footerHTML);
|
||||
window1.document.close();
|
||||
}
|
||||
|
|
@ -47,10 +43,8 @@ function testChild2() {
|
|||
if (!window.window2) {
|
||||
window2 = window.open("", "window2", "width=10,height=10");
|
||||
window2.document.open();
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
window2.document.write(headerHTML);
|
||||
window2.document.write("<script>navigateByForm('child2');<\/script>");
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
window2.document.write(footerHTML);
|
||||
window2.document.close();
|
||||
}
|
||||
|
|
@ -60,10 +54,8 @@ function testChild3() {
|
|||
if (!window.window3) {
|
||||
window3 = window.open("", "window3", "width=10,height=10");
|
||||
window3.document.open();
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
window3.document.write(headerHTML);
|
||||
window3.document.write("<script>navigateByHyperlink('child3');<\/script>");
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
window3.document.write(footerHTML);
|
||||
window3.document.close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
function elem(name) {
|
||||
return function(str) {
|
||||
const element = document.createElement(name);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
element.innerHTML = str;
|
||||
return element;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
function elem(name) {
|
||||
return function(str) {
|
||||
const element = document.createElement(name);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
element.innerHTML = str;
|
||||
return element;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
function elem(name) {
|
||||
return function(str) {
|
||||
const element = document.createElement(name);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
element.innerHTML = str;
|
||||
return element;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
function elem(name) {
|
||||
return function(str) {
|
||||
const element = document.createXULElement(name);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
element.innerHTML = str;
|
||||
return element;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
function elem(name) {
|
||||
return function(str) {
|
||||
const element = document.createElement(name);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
element.innerHTML = str;
|
||||
return element;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
function elem(name) {
|
||||
return function(str) {
|
||||
const element = document.createElement(name);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
element.innerHTML = str;
|
||||
return element;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ const MediaSessionActions = [
|
|||
|
||||
for (const action of MediaSessionActions) {
|
||||
navigator.mediaSession.setActionHandler(action, () => {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.getElementById("result").innerHTML = action;
|
||||
document.getElementById("result").dispatchEvent(new CustomEvent("actionChanged"));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ function createTestArray() {
|
|||
function log(msg) {
|
||||
info(msg);
|
||||
var l = document.getElementById('log');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
l.innerHTML += msg + "<br>";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ function startTest(test, token) {
|
|||
}
|
||||
html += '</table>\n';
|
||||
var div = document.createElement('div');
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
div.innerHTML = html;
|
||||
d.appendChild(div);
|
||||
// Verify decoded tag values.
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ addLoadEvent(function() {gotLoadEvent=true;});
|
|||
|
||||
function log(m) {
|
||||
var l = document.getElementById("log");
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
l.innerHTML += m;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ SimpleTest.waitForExplicitFinish();
|
|||
// 2) as DocumentFragment
|
||||
let temp = document.createElement('template');
|
||||
// asking eslint to skip this: innerHTML is safe for template elements.
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
temp.innerHTML = inputStr;
|
||||
yield ({testInput: temp.content, testType: "DocumentFragment" });
|
||||
// 3) as HTMLDocument
|
||||
|
|
|
|||
|
|
@ -5,12 +5,10 @@
|
|||
var result = null;
|
||||
|
||||
function handlePosition(position) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
result.innerHTML = position.coords.latitude + " " + position.coords.longitude;
|
||||
}
|
||||
|
||||
function handleError(error) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
result.innerHTML = error.message;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ SimpleTest.waitForFocus(async () => {
|
|||
{
|
||||
init: (normalSel, editingHost) => {
|
||||
info("Staring to test spellcheck of misspelled word after joining paragraphs");
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
editingHost.innerHTML = "<p>It is</p><p>what I want</p>";
|
||||
normalSel.collapse(editingHost.querySelector("p + p").firstChild, 0);
|
||||
return 0;
|
||||
|
|
@ -83,7 +82,6 @@ SimpleTest.waitForFocus(async () => {
|
|||
{
|
||||
init: (normalSel, editingHost) => {
|
||||
info("Staring to test spellcheck of correct word after joining paragraphs");
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
editingHost.innerHTML = "<p>It's beco</p><p>ming nicer</p>";
|
||||
normalSel.collapse(editingHost.querySelector("p + p").firstChild, 0);
|
||||
return 2;
|
||||
|
|
@ -103,7 +101,6 @@ SimpleTest.waitForFocus(async () => {
|
|||
{
|
||||
init: (normalSel, editingHost) => {
|
||||
info("Staring to test spellcheck of correct words after splitting a paragraph");
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
editingHost.innerHTML = "<p>It iswhat I want</p>";
|
||||
normalSel.collapse(editingHost.querySelector("p").firstChild, "It is".length);
|
||||
return 1;
|
||||
|
|
@ -123,7 +120,6 @@ SimpleTest.waitForFocus(async () => {
|
|||
{
|
||||
init: (normalSel, editingHost) => {
|
||||
info("Staring to test spellcheck of misspelled words after splitting a paragraph");
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
editingHost.innerHTML = "<p>It's becoming nicer</p>";
|
||||
normalSel.collapse(editingHost.querySelector("p").firstChild, "It's beco".length);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ function populateScroller() {
|
|||
for (let i = 1; i < 100; i++) {
|
||||
text += 'line ' + i + '<br>';
|
||||
}
|
||||
/* eslint-disable no-unsanitized/property */
|
||||
document.querySelector('#scroller').contentDocument.body.innerHTML = text;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,6 @@ function makeFragmentTestChecker(input, expected, errors, fragment, testframe) {
|
|||
fragment
|
||||
);
|
||||
}
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
context.innerHTML = input;
|
||||
var domAsString = fragmentToTestOutput(context);
|
||||
is(domAsString, expected, "HTML5 expected success. " + new Date());
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=339350
|
|||
</div>
|
||||
<pre id="test">
|
||||
<script type="text/javascript">
|
||||
/* eslint-disable no-unsanitized/property */
|
||||
var text1 = "foo bar";
|
||||
var text2 = "foo [bar]";
|
||||
var text3 = "foo {bar}";
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=460437
|
|||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
/* eslint-disable no-unsanitized/property */
|
||||
<![CDATA[
|
||||
|
||||
SimpleTest.expectAssertions(1);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ function runTest() {
|
|||
}
|
||||
|
||||
function continuation1() {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.getElementById("content").innerHTML = initialState;
|
||||
setTimeout(continuation2, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
"use strict";
|
||||
|
||||
document.open();
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
document.write("This is insecure XSS script " + document.cookie);
|
||||
isSecurityState(
|
||||
"broken",
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
This is frame 1:
|
||||
<script>
|
||||
"use strict";
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
document.write(location.href);
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
This is frame 2:
|
||||
<script>
|
||||
"use strict";
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
document.write(location.href);
|
||||
</script>
|
||||
<iframe src="http://example.com/tests/security/manager/ssl/tests/mochitest/mixedcontent/iframe.html"></iframe>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ server.registerPathHandler("/script.js", (request, response) => {
|
|||
ok(false, "Unexpected request to /script.js");
|
||||
});
|
||||
|
||||
/* eslint-disable no-unsanitized/method, no-eval, no-implied-eval */
|
||||
/* eslint-disable no-eval, no-implied-eval */
|
||||
|
||||
const MODULE1 = `
|
||||
import {foo} from "./module2.js";
|
||||
|
|
|
|||
|
|
@ -528,7 +528,6 @@ function testInlineCSS() {
|
|||
// Test creating <style> element from the extension side and then appending
|
||||
// to it using insertAdjacentHTML, with the same rules as above.
|
||||
testModifyAfterInject("insertAdjacentHTML", (style, css) => {
|
||||
// eslint-disable-next-line no-unsanitized/method
|
||||
style.insertAdjacentHTML("beforeend", css);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ let authPromptIsCommonDialog =
|
|||
* and internal state for the elements are removed.
|
||||
*/
|
||||
function recreateTree(element) {
|
||||
// eslint-disable-next-line no-unsanitized/property, no-self-assign
|
||||
// eslint-disable-next-line no-self-assign
|
||||
element.outerHTML = element.outerHTML;
|
||||
}
|
||||
|
||||
|
|
@ -779,7 +779,6 @@ async function loadFormIntoWindow(origin, html, win, expectedCount = 1, task) {
|
|||
win,
|
||||
[html, task?.toString()],
|
||||
function (contentHtml, contentTask = null) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
this.content.document.documentElement.innerHTML = contentHtml;
|
||||
// Similar to the invokeContentTask helper in accessible/tests/browser/shared-head.js
|
||||
if (contentTask) {
|
||||
|
|
@ -980,7 +979,6 @@ function setFormAndWaitForFieldFilled(
|
|||
form,
|
||||
{ fieldSelector, fieldValue, formId }
|
||||
) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.querySelector("#content").innerHTML = form;
|
||||
return SimpleTest.promiseWaitForCondition(() => {
|
||||
let ancestor = formId
|
||||
|
|
@ -1107,14 +1105,12 @@ function setContentForTask(html) {
|
|||
const content = document.querySelector("#content");
|
||||
const innerHTMLBefore = content.innerHTML || "";
|
||||
SimpleTest.registerCurrentTaskCleanupFunction(
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
() => (content.innerHTML = innerHTMLBefore)
|
||||
);
|
||||
if (html.content?.cloneNode) {
|
||||
const clone = html.content.cloneNode(true);
|
||||
content.replaceChildren(clone);
|
||||
} else {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.innerHTML = html;
|
||||
}
|
||||
return content.firstElementChild;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ Login Manager test: filling generated passwords into confirm password fields
|
|||
|
||||
await setupScript.sendAsyncMessage("resetLoginsAndGeneratedPasswords");
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.innerHTML = html;
|
||||
|
||||
// wait for the just created form to get autofilled
|
||||
|
|
|
|||
|
|
@ -50,9 +50,8 @@ const availableLogins = {
|
|||
|
||||
async function recreateTreeInWindow(formNum) {
|
||||
await SpecialPowers.spawn(win, [formNum], (formNumF) => {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
let form = this.content.document.querySelector(`#form${formNumF}`);
|
||||
// eslint-disable-next-line no-unsanitized/property, no-self-assign
|
||||
// eslint-disable-next-line no-self-assign
|
||||
form.outerHTML = form.outerHTML;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,6 @@ add_task(async function test() {
|
|||
|
||||
let processedFormPromise = promiseFormsProcessedInSameProcess(numFormLikesExpected);
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
frameDoc.documentElement.innerHTML = tc.document;
|
||||
info("waiting for " + numFormLikesExpected + " processed form(s)");
|
||||
await processedFormPromise;
|
||||
|
|
|
|||
|
|
@ -182,7 +182,6 @@ async function testFormlessSubmit(tc) {
|
|||
info("Starting testcase: " + JSON.stringify(tc));
|
||||
|
||||
let formsProcessed = promiseFormsProcessedInSameProcess(tc.expectedFormsCount);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
frameDoc.documentElement.innerHTML = tc.document;
|
||||
await formsProcessed;
|
||||
// We eliminate no user input as a reason for not capturing by modifying the value
|
||||
|
|
|
|||
|
|
@ -204,7 +204,6 @@ async function testFormlesSubmitFormRemoval(tc, testDoc, scriptName) {
|
|||
let frameDoc = SpecialPowers.wrap(loginFrame.contentWindow).document;
|
||||
|
||||
let formsProcessed = promiseFormsProcessed(tc.expectedFormsCount);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
frameDoc.documentElement.innerHTML = testDoc;
|
||||
await formsProcessed;
|
||||
// We eliminate no user input as a reason for not capturing by modifying the value
|
||||
|
|
|
|||
|
|
@ -133,7 +133,6 @@ async function testFormlesSubmitNavigationNegative(tc, scriptName, heuristic) {
|
|||
|
||||
let frameDoc = SpecialPowers.wrap(loginFrame.contentWindow).document;
|
||||
let formsProcessed = promiseFormsProcessed();
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
frameDoc.documentElement.innerHTML = tc.document;
|
||||
await formsProcessed;
|
||||
|
||||
|
|
|
|||
|
|
@ -197,7 +197,6 @@ async function testFormlesSubmitNavigation(tc, testDoc, scriptName) {
|
|||
let frameDoc = SpecialPowers.wrap(loginFrame.contentWindow).document;
|
||||
|
||||
let formsProcessed = promiseFormsProcessed(tc.expectedFormsCount);
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
frameDoc.documentElement.innerHTML = testDoc;
|
||||
await formsProcessed;
|
||||
// We eliminate no user input as a reason for not capturing by modifying the value
|
||||
|
|
|
|||
|
|
@ -105,7 +105,6 @@ async function testFormlesSubmitNavigationNegative(tc, scriptName) {
|
|||
await loadedPromise;
|
||||
|
||||
let frameDoc = SpecialPowers.wrap(loginFrame.contentWindow).document;
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
frameDoc.documentElement.innerHTML = tc.document;
|
||||
// We eliminate no user input as a reason for not capturing by modifying the value
|
||||
setUserInputValues(frameDoc.documentElement, tc.selectorValues);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ async function reinitializeForm(index) {
|
|||
let form = document.getElementById("form" + index);
|
||||
let temp = form.innerHTML;
|
||||
form.innerHTML = "";
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
form.innerHTML = temp;
|
||||
|
||||
await new Promise(resolve => {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ async function loadFormIntoIframe(origin, html) {
|
|||
await loadedPromise;
|
||||
|
||||
await SpecialPowers.spawn(getIframeBrowsingContext(window, 0), [html], function(contentHtml) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
this.content.document.documentElement.innerHTML = contentHtml;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
let text = "";
|
||||
for (let i = 0; i < 1000; i++) {
|
||||
text += "more";
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
document.getElementById("holder").innerHTML = text;
|
||||
}
|
||||
document.getElementById("holder").classList.add("loaded");
|
||||
|
|
|
|||
|
|
@ -91,7 +91,6 @@ async function postFrom(start, target) {
|
|||
|
||||
// Create the form element in our loaded URI.
|
||||
await SpecialPowers.spawn(browser, [{ target }], function ({ target }) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.document.body.innerHTML = `
|
||||
<form method="post" action="${target}">
|
||||
<input type="text" name="initialRemoteType" value="${Services.appinfo.remoteType}">
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ add_task(async function test_autoscroll_links() {
|
|||
"https://example.com/browser/toolkit/content/tests/browser/file_empty.html",
|
||||
async function (browser) {
|
||||
await SpecialPowers.spawn(browser, [markup], html => {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.document.body.innerHTML = html;
|
||||
content.document.documentElement.scrollTop = 1;
|
||||
content.document.documentElement.scrollTop; // Flush layout.
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ add_task(async function testStopStartingAutoScroll() {
|
|||
aExpectedActiveElement,
|
||||
}) {
|
||||
await SpecialPowers.spawn(browser, [aInnerHTML], async contentHTML => {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
content.document.body.innerHTML = contentHTML;
|
||||
content.document.documentElement.scrollTop; // Flush layout.
|
||||
const iframe = content.document.querySelector("iframe");
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@ function initAndRunTests()
|
|||
result = readFromClipboard();
|
||||
ok(expect.test(result), "data on system pasteboard is wrapped with charset metadata");
|
||||
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
$("display").innerHTML =
|
||||
'<em>source:</em> <pre>' + encodeHtmlEntities(source) + '</pre><br/>' +
|
||||
'<em>result:</em> <pre>' + encodeHtmlEntities(result) + '</pre>';
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ function shouldThrowException(fun, exception) {
|
|||
fun.call();
|
||||
return false;
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
$("display").innerHTML += "<br/>OK thrown: "+e.message;
|
||||
return (e instanceof Components.Exception &&
|
||||
e.result === exception)
|
||||
|
|
@ -49,7 +48,6 @@ function doesntThrowException(fun) {
|
|||
|
||||
var baseWindow = getBaseWindowInterface(this);
|
||||
var nativeHandle = baseWindow.nativeHandle;
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
$("display").innerHTML = "found nativeHandle for this window: "+nativeHandle;
|
||||
|
||||
var win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
|
|
|
|||
|
|
@ -10000,7 +10000,6 @@ async function runIMEContentObserverTest()
|
|||
break;
|
||||
case "p":
|
||||
case "div":
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
aElement.innerHTML = "<" + aDefaultParagraphSeparator + "></" + aDefaultParagraphSeparator + ">";
|
||||
sel.collapse(aElement.firstChild, 0);
|
||||
offsetAtContainer = offsetAtStart + kLFLen;
|
||||
|
|
|
|||
Loading…
Reference in a new issue