This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #496 from Polymer/polymer_issue_421
allow createShadowRoot on body
- Loading branch information
Showing
5 changed files
with
51 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<script src="../../../tools/test/chai/chai.js"></script> | ||
<script src="../../../tools/test/htmltest.js"></script> | ||
<script src="../../shadowdom.js"></script> | ||
<script> | ||
|
||
var assert = chai.assert; | ||
var wrap = ShadowDOMPolyfill.wrap; | ||
var doc = wrap(document); | ||
|
||
doc.addEventListener('DOMContentLoaded', function(e) { | ||
|
||
doc.body.innerHTML = 'You should NOT see this.'; | ||
|
||
var sr = doc.body.createShadowRoot(); | ||
var firstStr = 'You should see this'; | ||
var secondStr = '... and you should also see this'; | ||
sr.innerHTML = firstStr + '<content>'; | ||
|
||
doc.body.offsetHeight; | ||
|
||
doc.body.innerHTML = secondStr; | ||
|
||
doc.body.offsetHeight; | ||
|
||
assert.equal(doc.body.innerHTML, secondStr); | ||
assert.equal(sr.firstChild.textContent, firstStr); | ||
assert.equal(document.body.textContent, firstStr + secondStr); | ||
|
||
done(); | ||
}); | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters