Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/browser/ui/ReactDefaultInjection.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function inject() {
ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig);

ReactInjection.EmptyComponent.injectEmptyComponent(ReactDOM.script);
ReactInjection.EmptyComponent.injectEmptyComponent(ReactDOM.noscript);

ReactInjection.Updates.injectReconcileTransaction(
ReactComponentBrowserEnvironment.ReactReconcileTransaction
Expand Down
12 changes: 11 additions & 1 deletion src/browser/ui/dom/setInnerHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,17 @@ if (ExecutionEnvironment.canUseDOM) {
node.parentNode.replaceChild(node, node);
}

if (html.match(/^[ \r\n\t\f]/)) {
// We also implement a workaround for non-visible tags disappearing into
// thin air on IE8, this only happens if there is no visible text
// in-front of the non-visible tags. Piggyback on the whitespace fix
// and simply check if any non-visible tags appear in the source.
if (html.match(/^[ \r\n\t\f]/) ||
html[0] === '<' && (
html.indexOf('<noscript') !== -1 ||
html.indexOf('<script') !== -1 ||
html.indexOf('<style') !== -1 ||
html.indexOf('<meta') !== -1 ||
html.indexOf('<link') !== -1)) {
// Recover leading whitespace by temporarily prepending any character.
// \uFEFF has the potential advantage of being zero-width/invisible.
node.innerHTML = '\uFEFF' + html;
Expand Down
6 changes: 3 additions & 3 deletions src/core/__tests__/ReactCompositeComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe('ReactCompositeComponent', function() {
.toBeDOMComponentWithTag('a');
});

it('should render null and false as a script tag under the hood', () => {
it('should render null and false as a noscript tag under the hood', () => {
var Component1 = React.createClass({
render: function() {
return null;
Expand All @@ -145,10 +145,10 @@ describe('ReactCompositeComponent', function() {
var instance2 = ReactTestUtils.renderIntoDocument(<Component2 />);
reactComponentExpect(instance1)
.expectRenderedChild()
.toBeDOMComponentWithTag('script');
.toBeDOMComponentWithTag('noscript');
reactComponentExpect(instance2)
.expectRenderedChild()
.toBeDOMComponentWithTag('script');
.toBeDOMComponentWithTag('noscript');
});

it('should still throw when rendering to undefined', () => {
Expand Down