@@ -53,14 +53,14 @@ class DDGRuntimeChecks extends HTMLElement {
53
53
// Solves re-entrancy issues from React
54
54
if ( this . #connected) return
55
55
this . #connected = true
56
- if ( ! this . #transplantElement ) {
56
+ if ( ! this . _transplantElement ) {
57
57
// Restore the 'this' object with the DDGRuntimeChecks prototype as sometimes pages will overwrite it.
58
58
Object . setPrototypeOf ( this , DDGRuntimeChecks . prototype )
59
59
}
60
- this . #transplantElement ( )
60
+ this . _transplantElement ( )
61
61
}
62
62
63
- #monitorProperties ( el ) {
63
+ _monitorProperties ( el ) {
64
64
// Mutation oberver and observedAttributes don't work on property accessors
65
65
// So instead we need to monitor all properties on the prototypes and forward them to the real element
66
66
let propertyNames = [ ]
@@ -93,7 +93,7 @@ class DDGRuntimeChecks extends HTMLElement {
93
93
* The element has been moved to the DOM, so we can now reflect all changes to a real element.
94
94
* This is to allow us to interrogate the real element before it is moved to the DOM.
95
95
*/
96
- #transplantElement ( ) {
96
+ _transplantElement ( ) {
97
97
// Creeate the real element
98
98
const el = initialCreateElement . call ( document , this . #tagName)
99
99
@@ -153,7 +153,7 @@ class DDGRuntimeChecks extends HTMLElement {
153
153
this . insertAdjacentElement ( 'afterend' , el )
154
154
} catch ( e ) { console . warn ( e ) }
155
155
156
- this . #monitorProperties ( el )
156
+ this . _monitorProperties ( el )
157
157
// TODO pollyfill WeakRef
158
158
this . #el = new WeakRef ( el )
159
159
@@ -163,14 +163,14 @@ class DDGRuntimeChecks extends HTMLElement {
163
163
} , elementRemovalTimeout )
164
164
}
165
165
166
- #getElement ( ) {
166
+ _getElement ( ) {
167
167
return this . #el?. deref ( )
168
168
}
169
169
170
170
/* Native DOM element methods we're capturing to supplant values into the constructed node or store data for. */
171
171
172
172
set src ( value ) {
173
- const el = this . #getElement ( )
173
+ const el = this . _getElement ( )
174
174
if ( el ) {
175
175
el . src = value
176
176
return
@@ -179,7 +179,7 @@ class DDGRuntimeChecks extends HTMLElement {
179
179
}
180
180
181
181
get src ( ) {
182
- const el = this . #getElement ( )
182
+ const el = this . _getElement ( )
183
183
if ( el ) {
184
184
return el . src
185
185
}
@@ -196,7 +196,7 @@ class DDGRuntimeChecks extends HTMLElement {
196
196
if ( supportedSinks . includes ( name ) ) {
197
197
return this [ name ]
198
198
}
199
- const el = this . #getElement ( )
199
+ const el = this . _getElement ( )
200
200
if ( el ) {
201
201
return el . getAttribute ( name )
202
202
}
@@ -209,7 +209,7 @@ class DDGRuntimeChecks extends HTMLElement {
209
209
this [ name ] = value
210
210
return
211
211
}
212
- const el = this . #getElement ( )
212
+ const el = this . _getElement ( )
213
213
if ( el ) {
214
214
return el . setAttribute ( name , value )
215
215
}
@@ -222,7 +222,7 @@ class DDGRuntimeChecks extends HTMLElement {
222
222
delete this [ name ]
223
223
return
224
224
}
225
- const el = this . #getElement ( )
225
+ const el = this . _getElement ( )
226
226
if ( el ) {
227
227
return el . removeAttribute ( name )
228
228
}
@@ -231,7 +231,7 @@ class DDGRuntimeChecks extends HTMLElement {
231
231
232
232
addEventListener ( ...args ) {
233
233
if ( shouldFilterKey ( this . #tagName, 'listener' , args [ 0 ] ) ) return
234
- const el = this . #getElement ( )
234
+ const el = this . _getElement ( )
235
235
if ( el ) {
236
236
return el . addEventListener ( ...args )
237
237
}
@@ -240,7 +240,7 @@ class DDGRuntimeChecks extends HTMLElement {
240
240
241
241
removeEventListener ( ...args ) {
242
242
if ( shouldFilterKey ( this . #tagName, 'listener' , args [ 0 ] ) ) return
243
- const el = this . #getElement ( )
243
+ const el = this . _getElement ( )
244
244
if ( el ) {
245
245
return el . removeEventListener ( ...args )
246
246
}
@@ -263,15 +263,15 @@ class DDGRuntimeChecks extends HTMLElement {
263
263
}
264
264
265
265
remove ( ) {
266
- const el = this . #getElement ( )
266
+ const el = this . _getElement ( )
267
267
if ( el ) {
268
268
return el . remove ( )
269
269
}
270
270
return super . remove ( )
271
271
}
272
272
273
273
removeChild ( child ) {
274
- const el = this . #getElement ( )
274
+ const el = this . _getElement ( )
275
275
if ( el ) {
276
276
return el . removeChild ( child )
277
277
}
0 commit comments