Only allow one shadowRoot.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/759663003
This commit is contained in:
Elliott Sprehn 2014-11-26 13:54:14 -05:00
parent a0c48f7369
commit b6303c5d69
4 changed files with 4 additions and 4 deletions

View File

@ -14,7 +14,7 @@ WidgetPrototype.createdCallback = function() {
this.wasAttached = false;
this.wasDetached = false;
this.attrsChanged = [];
this.createShadowRoot();
this.ensureShadowRoot();
};
WidgetPrototype.attachedCallback = function() {

View File

@ -53,7 +53,7 @@ describe("appendChild", function() {
it("should throw when inserting a tree scope", function() {
var parent = document.createElement("div");
var doc = new Document();
var shadowRoot = document.createElement("span").createShadowRoot();
var shadowRoot = document.createElement("span").ensureShadowRoot();
assert.throws(function() {
parent.appendChild(doc);
});

View File

@ -67,7 +67,7 @@ describe("replaceChild", function() {
it("should throw when inserting a tree scope", function() {
var parent = document.createElement("div");
var doc = new Document();
var shadowRoot = document.createElement("span").createShadowRoot();
var shadowRoot = document.createElement("span").ensureShadowRoot();
assert.throws(function() {
parent.replaceChild(doc);
});

View File

@ -13,7 +13,7 @@ describe('MutationObservers', function() {
}
var range = document.getElementById('range');
var shadowRoot = range.createShadowRoot();
var shadowRoot = range.ensureShadowRoot();
shadowRoot.appendChild(document.createElement('div'));
var observer = new MutationObserver(function() { });