File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 45724572 parseHTMLToFragment(String(html), fragment, targetDoc);
45734573 return fragment;
45744574 }
4575+ let canDirectSetHTML = true;
45754576 const SVG_NS = 'http://www.w3.org/2000/svg';
45764577 const VOID_TAGS = {
45774578 area: true,
46634664 }
46644665 function setHTML(target, html, doc) {
46654666 if (!target) return;
4667+ if (canDirectSetHTML !== false) {
4668+ try {
4669+ target.innerHTML = html === null || html === undefined ? '' : String(html);
4670+ canDirectSetHTML = true;
4671+ return;
4672+ } catch (e) {
4673+ canDirectSetHTML = false;
4674+ }
4675+ }
46664676 const targetDoc = doc || target.ownerDocument || document;
46674677 const fragment = createHTML(html, targetDoc);
46684678 while (target.firstChild) {
You can’t perform that action at this time.
0 commit comments