@@ -74,31 +74,28 @@ const create = (root, paths) => {
7474// involved in the DOM update/change and dispatch
7575// related information to them
7676const dispatchAll = ( nodes , type ) => {
77- const isConnected = type === CONNECTED ;
77+ const event = new Event ( type ) ;
7878 const length = nodes . length ;
79- for ( let event , i = 0 ; i < length ; i ++ ) {
79+ for ( let i = 0 ; i < length ; i ++ ) {
8080 let node = nodes [ i ] ;
8181 if ( node . nodeType === ELEMENT_NODE ) {
82- event = dispatchTarget ( node , isConnected , type , event ) ;
82+ dispatchTarget ( node , event ) ;
8383 }
8484 }
8585} ;
8686
8787// the way it's done is via the components weak set
8888// and recursively looking for nested components too
89- const dispatchTarget = ( node , isConnected , type , event ) => {
89+ const dispatchTarget = ( node , event ) => {
9090 if ( components . has ( node ) ) {
91- if ( ! event ) event = new Event ( type ) ;
9291 node . dispatchEvent ( event ) ;
93- }
94- else {
92+ } else {
9593 const children = node . children ;
9694 const length = children . length ;
9795 for ( let i = 0 ; i < length ; i ++ ) {
98- event = dispatchTarget ( children [ i ] , isConnected , type , event ) ;
96+ dispatchTarget ( children [ i ] , event ) ;
9997 }
10098 }
101- return event ;
10299}
103100
104101// finding all paths is a one-off operation performed
@@ -133,6 +130,11 @@ const find = (node, paths, parts) => {
133130 }
134131 break ;
135132 case TEXT_NODE :
133+ // the following ignore is actually covered by browsers
134+ // only basicHTML ends up on previous COMMENT_NODE case
135+ // instead of TEXT_NODE because it knows nothing about
136+ // special style or textarea behavior
137+ /* istanbul ignore if */
136138 if (
137139 SHOULD_USE_TEXT_CONTENT . test ( node . nodeName ) &&
138140 trim . call ( child . textContent ) === UIDC
@@ -164,9 +166,15 @@ const findAttributes = (node, paths, parts) => {
164166 const attribute = array [ i ] ;
165167 if ( attribute . value === UID ) {
166168 const name = attribute . name ;
169+ // the following ignore is covered by IE
170+ // and the IE9 double viewBox test
171+ /* istanbul ignore else */
167172 if ( ! ( name in cache ) ) {
168173 const realName = parts . shift ( ) . replace ( / ^ (?: | [ \S \s ] * ?\s ) ( \S + ?) = [ ' " ] ? $ / , '$1' ) ;
169174 cache [ name ] = attributes [ realName ] ||
175+ // the following ignore is covered by browsers
176+ // while basicHTML is already case-sensitive
177+ /* istanbul ignore next */
170178 attributes [ realName . toLowerCase ( ) ] ;
171179 paths . push ( Path . create ( 'attr' , cache [ name ] , realName ) ) ;
172180 }
0 commit comments