diff --git a/dom/security/sanitizer/tests/mochitest/test_sanitizer_api.html b/dom/security/sanitizer/tests/mochitest/test_sanitizer_api.html index c9ea8c416e32..bfa1fdf6c82a 100644 --- a/dom/security/sanitizer/tests/mochitest/test_sanitizer_api.html +++ b/dom/security/sanitizer/tests/mochitest/test_sanitizer_api.html @@ -52,23 +52,23 @@ SimpleTest.waitForExplicitFinish(); sanitizerOptions: {}, }, { - // test for the allowElements option + // test for the elements option testString: "

hello folks

", testExpected: "

hello folks

", - sanitizerOptions: { allowElements: ["p"] }, + sanitizerOptions: { elements: ["p"] }, }, { - // test for the blockElements option + // test for the replaceWithChildrenElements option testString: "

hello folks

", testExpected: "

hello folks

", - sanitizerOptions: { blockElements: ["i"] }, + sanitizerOptions: { replaceWithChildrenElements: ["i"] }, }, // TODO: Unknown attributes aren't supported yet. // { // // test for the allowAttributes option // testString: `

hello

`, // testExpected: `

hello

`, - // sanitizerOptions: { allowUnknownMarkup: true, allowAttributes: { 'haha': ['p'] } }, + // sanitizerOptions: { unknownMarkup: true, attributes: ["haha"] }, // }, { // confirming the inverse @@ -77,10 +77,10 @@ SimpleTest.waitForExplicitFinish(); sanitizerOptions: {}, }, { - // test for the dropAttributes option + // test for the removeAttributes option testString: `

hello

`, testExpected: `

hello

`, - sanitizerOptions: { dropAttributes: [{name: 'title', elements: ['p']}] }, + sanitizerOptions: { removeAttributes: ['title'] }, }, { // confirming the inverse @@ -89,12 +89,12 @@ SimpleTest.waitForExplicitFinish(); sanitizerOptions: {}, }, { - // if an attribute is allowed and dropped, the drop will take preference + // if an attribute is allowed and removed, the remove will take preference testString: `

hello

`, testExpected: `

hello

`, sanitizerOptions: { - allowAttributes: [{ name: 'title', elements: ['p'] }], - dropAttributes: [{ name: 'title', elements: ['p'] }] + attributes: ["title"], + removeAttributes: ["title"], }, }, ]; @@ -123,7 +123,7 @@ SimpleTest.waitForExplicitFinish(); else { // test setHTML: try { - div.setHTML(testString, { sanitizer: testSanitizer }); + div.setHTML(testString, { sanitizer: sanitizerOptions }); is(div.innerHTML, testExpected, `div.setHTML() should turn(${testType}) '${testInput}' into '${testExpected}'`); } catch (e) { diff --git a/testing/web-platform/meta/sanitizer-api/element-set-sanitized-html.https.html.ini b/testing/web-platform/meta/sanitizer-api/element-set-sanitized-html.https.html.ini new file mode 100644 index 000000000000..2f3bcfc1c80a --- /dev/null +++ b/testing/web-platform/meta/sanitizer-api/element-set-sanitized-html.https.html.ini @@ -0,0 +1,3 @@ +[element-set-sanitized-html.https.html] + [Sanitizer: Element.setHTML with config: attributes: unknown attributes and with unknownMarkup] + expected: FAIL diff --git a/testing/web-platform/meta/sanitizer-api/sanitizer-names.https.html.ini b/testing/web-platform/meta/sanitizer-api/sanitizer-names.https.html.ini index d3dbbf64af51..d8f4a8db4848 100644 --- a/testing/web-platform/meta/sanitizer-api/sanitizer-names.https.html.ini +++ b/testing/web-platform/meta/sanitizer-api/sanitizer-names.https.html.ini @@ -1,22 +1,22 @@ [sanitizer-names.https.html] expected: if (os == "android") and fission: [OK, TIMEOUT] - [Element names in config item: allowElements] + [Element names in config item: elements] expected: FAIL - [Element names in config item: dropElements] + [Element names in config item: removeElements] expected: FAIL - [Element names in config item: blockElements] + [Element names in config item: replaceWithChildrenElements] expected: FAIL - [Attribute names in config item: allowAttributes] + [Attribute names in config item: attributes] expected: FAIL - [Attribute names in config item: dropAttributes] + [Attribute names in config item: removeAttributes] expected: FAIL - [Namespaced attributes #2: allowAttributes: [{"name":"xlink:href","elements":"*"}\]] + [Namespaced attributes #2: attributes: [{"name":"xlink:href"}\]] expected: FAIL [Lower-case element names #0: "svg:feblend"] diff --git a/testing/web-platform/meta/sanitizer-api/sanitizer-sanitize.https.tentative.html.ini b/testing/web-platform/meta/sanitizer-api/sanitizer-sanitize.https.tentative.html.ini index ffb0fb0b925b..d1cb7c271502 100644 --- a/testing/web-platform/meta/sanitizer-api/sanitizer-sanitize.https.tentative.html.ini +++ b/testing/web-platform/meta/sanitizer-api/sanitizer-sanitize.https.tentative.html.ini @@ -1,15 +1,15 @@ [sanitizer-sanitize.https.tentative.html] + max-asserts: 120 expected: if (os == "android") and fission: [OK, TIMEOUT] - max-asserts: 120 [SanitizerAPI with config: plaintext, sanitize from document function for ] expected: FAIL - [SanitizerAPI with config: allowAttributes unknown attributes and with allowUnknownMarkup, sanitize from document function for ] + [SanitizerAPI with config: attributes: unknown attributes and with unknownMarkup, sanitize from document function for ] expected: FAIL [SanitizerAPI with config: plaintext, sanitize from document fragment function for