From 7f03db596fce94c53315db0745bfd66a9023cb33 Mon Sep 17 00:00:00 2001 From: Stephen Scott Date: Sat, 18 Feb 2017 00:33:46 -0700 Subject: [PATCH 1/4] Add test app that nests iframes --- test/nested-frames/.gitignore | 1 + test/nested-frames/target.js | 42 ++++++++++++++++++++++++++++ test/nested-frames/webpack.config.js | 29 +++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 test/nested-frames/.gitignore create mode 100644 test/nested-frames/target.js create mode 100644 test/nested-frames/webpack.config.js diff --git a/test/nested-frames/.gitignore b/test/nested-frames/.gitignore new file mode 100644 index 0000000000..378eac25d3 --- /dev/null +++ b/test/nested-frames/.gitignore @@ -0,0 +1 @@ +build diff --git a/test/nested-frames/target.js b/test/nested-frames/target.js new file mode 100644 index 0000000000..5b1be8680d --- /dev/null +++ b/test/nested-frames/target.js @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ +'use strict'; + +var React = require('react'); +var ReactDOM = require('react-dom'); + +class InnerContent extends React.Component { + render() { + return ( +
Inner content
+ ); + } +} + +class OuterWrapper extends React.Component { + componentDidMount() { + const node = document.createElement('div'); + this.frame.contentDocument.body.appendChild(node); + ReactDOM.render(, node); + } + + render() { + return ( +
+
Iframe below
+