Don't parse TEXTAREA child nodes (Edge bug)

This commit is contained in:
MoyuScript 2017-08-05 21:40:22 +08:00
parent 14b4dca77c
commit 09f8f0cf01

View File

@ -69,6 +69,8 @@ const parseNodeTree = (
// $FlowFixMe // $FlowFixMe
inlineSelectElement(childNode, container); inlineSelectElement(childNode, container);
} }
const SHOULD_TRAVERSE_CHILDREN = childNode.tagName !== 'TEXTAREA';
const treatAsRealStackingContext = createsRealStackingContext( const treatAsRealStackingContext = createsRealStackingContext(
container, container,
childNode childNode
@ -86,15 +88,19 @@ const parseNodeTree = (
treatAsRealStackingContext treatAsRealStackingContext
); );
parentStack.contexts.push(childStack); parentStack.contexts.push(childStack);
if (SHOULD_TRAVERSE_CHILDREN) {
parseNodeTree(childNode, container, childStack, imageLoader); parseNodeTree(childNode, container, childStack, imageLoader);
}
} else { } else {
stack.children.push(container); stack.children.push(container);
if (SHOULD_TRAVERSE_CHILDREN) {
parseNodeTree(childNode, container, stack, imageLoader); parseNodeTree(childNode, container, stack, imageLoader);
} }
} }
} }
} }
} }
}
}; };
const inlinePseudoElement = (node: HTMLElement, pseudoElt: ':before' | ':after'): void => { const inlinePseudoElement = (node: HTMLElement, pseudoElt: ':before' | ':after'): void => {