User agents should not render elements that are in the hidden state.
An alternative implementation would be to always propagate the hidden attribute to the sanitised HTML content, i.e., let the browser deal with hiding it.
Do you follow the guidelines?
[x] I have tested my changes
[x] There is no breaking changes
[x] I really tested my changes and there is no regression
This adjusts the
Sanitize
function to skip tags with thehidden
attribute, similar to how it skips blocked tags and their contents.From the whatwg HTML spec:
An alternative implementation would be to always propagate the
hidden
attribute to the sanitised HTML content, i.e., let the browser deal with hiding it.Do you follow the guidelines?