File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1573,7 +1573,10 @@ export default class Element
1573
1573
if ( ! ( id in window ) || ( < any > window ) [ id ] === entry . elements [ 0 ] ) {
1574
1574
( < any > window ) [ id ] = entry . htmlCollection ;
1575
1575
}
1576
- } else if ( ! ( id in window ) || ( < any > window ) [ id ] === entry . htmlCollection ) {
1576
+ } else if (
1577
+ ! ( id in window ) ||
1578
+ ( entry . htmlCollection !== null && ( < any > window ) [ id ] === entry . htmlCollection )
1579
+ ) {
1577
1580
( < any > window ) [ id ] = element ;
1578
1581
}
1579
1582
}
Original file line number Diff line number Diff line change @@ -153,11 +153,17 @@ describe('Element', () => {
153
153
expect ( window [ 'element2' ] ) . toBe ( undefined ) ;
154
154
} ) ;
155
155
156
- it ( `Doesn't the "id" attribute as a property to Window if it collides with Window properties.` , ( ) => {
156
+ it ( `Doesn't add the "id" attribute as a property to Window if it collides with Window properties.` , ( ) => {
157
157
element . setAttribute ( 'id' , 'document' ) ;
158
158
document . body . appendChild ( element ) ;
159
159
expect ( window [ 'document' ] ) . toBe ( document ) ;
160
160
} ) ;
161
+
162
+ it ( `Doesn't add the "opener" attribute as a property to Window when the property value is null (#1841).` , ( ) => {
163
+ document . body . appendChild ( element ) ;
164
+ element . id = 'opener' ;
165
+ expect ( window [ 'opener' ] ) . toBe ( null ) ;
166
+ } ) ;
161
167
} ) ;
162
168
163
169
describe ( 'get slot()' , ( ) => {
You can’t perform that action at this time.
0 commit comments