File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 106106
107107 /**
108108 * Returns a list of nodes that are the effective childNodes. The effective
109- * childNodes list is the same as the element's childNodes except that
109+ * childNodes list is the same as the element's childNodes except that
110110 * any `<content>` elements are replaced with the list of nodes distributed
111111 * to the `<content>`, the result of its `getDistributedNodes` method.
112112 *
119119
120120 /**
121121 * Returns a list of elements that are the effective children. The effective
122- * children list is the same as the element's children except that
123- * any `<content>` elements are replaced with the list of elements
122+ * children list is the same as the element's children except that
123+ * any `<content>` elements are replaced with the list of elements
124124 * distributed to the `<content>`.
125125 *
126126 * @method getEffectiveChildren
134134 } ,
135135
136136 /**
137- * Returns a string of text content that is the concatenation of the
137+ * Returns a string of text content that is the concatenation of the
138138 * text content's of the element's effective childNodes (the elements
139139 * returned by <a href="#getEffectiveChildNodes>getEffectiveChildNodes</a>.
140140 *
373373 * @return {Boolean } true if node is in this element's light DOM tree.
374374 */
375375 isLightDescendant : function ( node ) {
376- return this . contains ( node ) &&
376+ return this !== node && this . contains ( node ) &&
377377 Polymer . dom ( this ) . getOwnerRoot ( ) === Polymer . dom ( node ) . getOwnerRoot ( ) ;
378378 } ,
379379
Original file line number Diff line number Diff line change 5959 var elt2 = document . querySelector ( '#elt2' ) ;
6060 var elt3 = document . querySelector ( '#elt3' ) ;
6161 var elt4 = document . querySelector ( '#elt4' ) ;
62-
62+
6363 test ( 'getContentChildNodes (empty)' , function ( ) {
6464 var nodes = elt1 . getContentChildNodes ( ) ;
6565 assert . equal ( nodes . length , 1 , 'should have 1 text node' ) ;
123123 var text = elt7 . $ . content . getEffectiveTextContent ( ) ;
124124 assert . equal ( text . replace ( / \s / g, '' ) , 'abcde' ) ;
125125 } ) ;
126-
126+
127127 } ) ;
128128
129129 suite ( 'isLight/Local descendant utils' , function ( ) {
132132 var elt5 = document . querySelector ( '#elt5' ) ;
133133 var elt6 = document . querySelector ( '#elt6' ) ;
134134
135+ test ( 'isLightDescendant is false for self' , function ( ) {
136+ assert . isFalse ( elt1 . isLightDescendant ( elt1 ) ) ;
137+ } ) ;
138+
139+ test ( 'isLocalDescendant is false for self' , function ( ) {
140+ assert . isFalse ( elt1 . isLocalDescendant ( elt1 ) ) ;
141+ } ) ;
142+
135143 test ( 'isLightDescendant is true for light children' , function ( ) {
136144 var span = elt4 . querySelector ( 'span' ) ;
137145 var customElement = elt4 . querySelector ( 'x-content' ) ;
You can’t perform that action at this time.
0 commit comments