Skip to content

Commit

Permalink
Merge pull request #1 from PolymerElements/fix-async-attached-detached
Browse files Browse the repository at this point in the history
Sprinkle some of that magic polyfill dust on it.
  • Loading branch information
cdata committed Apr 16, 2015
2 parents d17ee6b + 1c535b5 commit 02005de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
13 changes: 13 additions & 0 deletions test-fixture.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
);
}, this);

this.forcePolyfillAttachedStateSynchrony();

if (generatedDoms.length < 2) {
return generatedDoms[0];
}
Expand Down Expand Up @@ -89,6 +91,17 @@
this.generatedDomStack = [];

this._elementsFixtured = false;

this.forcePolyfillAttachedStateSynchrony();
},

forcePolyfillAttachedStateSynchrony: function () {
// Force synchrony in attachedCallback and detachedCallback where
// implemented, in the event that we are dealing with the async Web
// Components Polyfill.
if (window.CustomElements && window.CustomElements.takeRecords) {
window.CustomElements.takeRecords();
}
},

collectElementChildren: function (parent) {
Expand Down
5 changes: 1 addition & 4 deletions test/test-fixture.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@
attachedFixture.restore();
});

// TODO(cdata): Make this test pass somehow. Currently it fails in
// not-Chrome due to an implementation detail of the Web Components
// polyfill.
xit('detaches the fixtured DOM when it is restored', function () {
it('detaches the fixtured DOM when it is restored', function () {
var detached = false;

element.onDetached = function () {
Expand Down

0 comments on commit 02005de

Please sign in to comment.