Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
|
tsergeant
2016/12/28 23:51:50
Hmmmm
This was copied from History, where it has
angelayang
2016/12/29 02:53:34
Done.
| |
| 6 * Replace the current primary element of the test with a new element. Useful | |
|
tsergeant
2016/12/28 23:51:50
Replace "primary element" with "body", then delete
angelayang
2016/12/29 02:53:34
Done.
| |
| 7 * as an alternative to PolymerTest.clearBody() which preserves styling. | |
| 8 * @param {Element} element | |
| 9 */ | |
| 10 function replaceBody(element) { | |
| 11 var body = document.body; | |
|
tsergeant
2016/12/28 23:51:50
I think it would be fine to replace the body of th
angelayang
2016/12/29 02:53:34
Done.
| |
| 12 while (body.children.length > 0) | |
| 13 body.removeChild(body.children[0]); | |
| 14 body.appendChild(element); | |
| 15 } | |
| OLD | NEW |