diff --git a/src/instance/base.js b/src/instance/base.js index ad28959..13e5b7a 100644 --- a/src/instance/base.js +++ b/src/instance/base.js @@ -64,6 +64,16 @@ if (this.enteredView) { this.enteredView(); } + // NOTE: domReady can be used to access elements in dom (descendants, + // ancestors, siblings) such that the developer is enured to upgrade + // ordering. If the element definitions have loaded, domReady + // can be used to access upgraded elements. + if (!this.hasBeenAttached) { + this.hasBeenAttached = true; + if (this.domReady) { + this.async('domReady'); + } + } }, detachedCallback: function() { if (!this.preventDispose) { diff --git a/test/html/ctor.html b/test/html/ctor.html new file mode 100644 index 0000000..549b4c3 --- /dev/null +++ b/test/html/ctor.html @@ -0,0 +1,60 @@ + + + + constructor test + + + + + + + + + + + + + + + + + + + + + diff --git a/test/html/domready.html b/test/html/domready.html new file mode 100644 index 0000000..9e853f7 --- /dev/null +++ b/test/html/domready.html @@ -0,0 +1,45 @@ + + + + domReady test + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/js/register.js b/test/js/register.js index d5e01cf..b4a611e 100644 --- a/test/js/register.js +++ b/test/js/register.js @@ -52,4 +52,6 @@ htmlSuite('element registration', function() { htmlTest('html/element-registration.html'); htmlTest('html/element-import.html'); htmlTest('html/polymer-body.html'); + htmlTest('html/ctor.html'); + htmlTest('html/domready.html'); });