-
-
Notifications
You must be signed in to change notification settings - Fork 831
Questions About _isClobbered #585
Copy link
Copy link
Closed
Description
Out of curiosity, could you give an example/explanation of some input that makes this condition return true?
Lines 793 to 802 in dbf7a34
| if ( | |
| typeof elm.nodeName !== 'string' || | |
| typeof elm.textContent !== 'string' || | |
| typeof elm.removeChild !== 'function' || | |
| !(elm.attributes instanceof NamedNodeMap) || | |
| typeof elm.removeAttribute !== 'function' || | |
| typeof elm.setAttribute !== 'function' || | |
| typeof elm.namespaceURI !== 'string' || | |
| typeof elm.insertBefore !== 'function' | |
| ) { |
Also, why does this still run when the SANITIZE_DOM config option is false? I was under the impression that setting SANITIZE_DOM to false disables any clobbering-related checks. Is that not the purpose of SANITIZE_DOM? If not, what's the purpose?
Lastly, is it strictly necessary to get the value of elm.textContent in order to ensure it isn't clobbered? The textContent getter is really relatively slow. For large node trees, sanitization can be very noticeably slow just because of that one check (which I know because I profiled it).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels