| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <!-- This page can create whatever iframe structure you want, across whatever | 2 <!-- This page can create whatever iframe structure you want, across whatever |
| 3 sites you want. This is useful for testing site isolation. | 3 sites you want. This is useful for testing site isolation. |
| 4 | 4 |
| 5 Example usage in a browsertest, explained: | 5 Example usage in a browsertest, explained: |
| 6 | 6 |
| 7 GURL url = | 7 GURL url = |
| 8 test_server()->GetURL("a.com", "/cross_site_iframe_factory.html?a(b(c,d))"); | 8 test_server()->GetURL("a.com", "/cross_site_iframe_factory.html?a(b(c,d))"); |
| 9 | 9 |
| 10 When you navigate to the above URL, the outer document (on a.com) will create a | 10 When you navigate to the above URL, the outer document (on a.com) will create a |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 url += window.location.protocol + '//'; // scheme (preserved) | 150 url += window.location.protocol + '//'; // scheme (preserved) |
| 151 url += goCrossSite ? site : window.location.host; // host | 151 url += goCrossSite ? site : window.location.host; // host |
| 152 if (window.location.port) | 152 if (window.location.port) |
| 153 url += ':' + window.location.port; // port (preserved) | 153 url += ':' + window.location.port; // port (preserved) |
| 154 url += window.location.pathname; // path (preserved) | 154 url += window.location.pathname; // path (preserved) |
| 155 url += '?' + encodeURIComponent(subtreeString); // query | 155 url += '?' + encodeURIComponent(subtreeString); // query |
| 156 | 156 |
| 157 // Add the iframe to the document. | 157 // Add the iframe to the document. |
| 158 var iframe = document.createElement('iframe'); | 158 var iframe = document.createElement('iframe'); |
| 159 iframe.src = url; | 159 iframe.src = url; |
| 160 iframe.id = "child-" + i; |
| 160 iframe.style.borderColor = borderColorForSite(site); | 161 iframe.style.borderColor = borderColorForSite(site); |
| 161 iframe.width = frameTree.children[i].layoutX; | 162 iframe.width = frameTree.children[i].layoutX; |
| 162 iframe.height = frameTree.children[i].layoutY; | 163 iframe.height = frameTree.children[i].layoutY; |
| 163 document.body.appendChild(iframe); | 164 document.body.appendChild(iframe); |
| 164 } | 165 } |
| 165 } | 166 } |
| 166 | 167 |
| 167 main(); | 168 main(); |
| 168 </script> | 169 </script> |
| 169 </body></html> | 170 </body></html> |
| OLD | NEW |