Skip to content

Commit

Permalink
Fix for createHTMLDocument API specific to IE11 (#10921)
Browse files Browse the repository at this point in the history
* Fix for createHTMLDocument API specific to IE11

The createHTMLDocument API title parameter is not optional in IE while other browsers don't care IE11 will throw if an argument is not passed. This only impacts react.dom.development not react.dom.production.

* Tweak
  • Loading branch information
leidegre authored and gaearon committed Sep 28, 2017
1 parent 96fde8a commit 857ed18
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/renderers/dom/fiber/ReactDOMFiberComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ if (__DEV__) {
// can be used for comparison.
var normalizeHTML = function(parent: Element, html: string) {
if (!testDocument) {
testDocument = document.implementation.createHTMLDocument();
// The title argument is required in IE11 so we pass an empty string.
testDocument = document.implementation.createHTMLDocument('');
}
var testElement = parent.namespaceURI === HTML_NAMESPACE
? testDocument.createElement(parent.tagName)
Expand Down

0 comments on commit 857ed18

Please sign in to comment.