named-slots
named-slots copied to clipboard
Attribute value should be re-encoded in outerHTML
Browsers seem to consistently report outerHTML / innerHTML between vendors but have odd behaviour when inspecting the values. For example:
const div = document.createElement('div');
div.innerHTML = '<div test=""test1 & test2"">"test1 & test2"</div>';
console.log(div.outerHTML);
console.log(div.innerHTML);
console.log(div.getAttribute('test');
console.log(div.firstChild.outerHTML);
console.log(div.firstChild.innerHTML);
console.log(div.firstChild.getAttribute('test');
To be consistent with their inconsistencies, we need to make outerHTML
encode the values that it uses to serialise the attributes using node.value
.