@@ -47,13 +47,19 @@ describe("When multiple DOM elements are present", () => {
4747 } ) ;
4848 } ) ;
4949
50- // Pending until we decide on a good solution
51- xit ( "can read attributes from custom child element's prototypes" , ( ) => {
50+ it ( "can read attributes from custom child element's prototypes" , ( ) => {
5251 class DataSource extends customElements . HTMLElement {
52+ get data ( ) {
53+ return [ 1 , 2 , 3 ] ;
54+ }
55+ }
56+ customElements . define ( "data-source" , DataSource ) ;
57+
58+ class DataDisplayer extends customElements . HTMLElement {
5359 connectedCallback ( ) {
5460 return new Promise ( ( resolve ) => {
5561 // Has to be async, as child node prototypes aren't set: http://stackoverflow.com/questions/36187227/
56- // This is a web customElements limitation generally. TODO: Find a nicer pattern for handle this.
62+ // This is a web components limitation generally. TODO: Find a nicer pattern for handle this.
5763 setTimeout ( ( ) => {
5864 var data = this . childNodes [ 0 ] . data ;
5965 this . textContent = "Data: " + JSON . stringify ( data ) ;
@@ -62,9 +68,8 @@ describe("When multiple DOM elements are present", () => {
6268 } ) ;
6369 }
6470 }
65- DataSource . data = [ 10 , 20 , 30 ] ;
6671
67- customElements . define ( "data-displayer" , DataSource ) ;
72+ customElements . define ( "data-displayer" , DataDisplayer ) ;
6873
6974 return customElements . renderFragment (
7075 "<data-displayer><data-source></data-source></data-displayer>"
0 commit comments