Bug 1146591 - Avoid unsafe CPOW usage in helper_outerhtml_test_runner.js; r=bgrins

helper_outerhtml_test_runner.js was accessing DOM nodes directly in content (via
CPOWs) to check their outerHTML.
This change adds outerHTML, innerHTML and textContent to the common
devtools:test:getDomElementInfo frame-script message listener so that the test
can get it there instead.
This commit is contained in:
Patrick Brosset
2015-03-25 18:03:22 +01:00
parent 7f8f9dce87
commit 9eb3bf7352
2 changed files with 11 additions and 4 deletions

View File

@@ -143,6 +143,9 @@ addMessageListener("devtools:test:setStyle", function(msg) {
* - {String} namespaceURI.
* - {Number} numChildren The number of children in the element.
* - {Array} attributes An array of {name, value, namespaceURI} objects.
* - {String} outerHTML.
* - {String} innerHTML.
* - {String} textContent.
*/
addMessageListener("devtools:test:getDomElementInfo", function(msg) {
let {selector} = msg.data;
@@ -156,7 +159,10 @@ addMessageListener("devtools:test:getDomElementInfo", function(msg) {
numChildren: node.children.length,
attributes: [...node.attributes].map(({name, value, namespaceURI}) => {
return {name, value, namespaceURI};
})
}),
outerHTML: node.outerHTML,
innerHTML: node.innerHTML,
textContent: node.textContent
};
}