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:
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user