File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -106,17 +106,18 @@ const XREngineProto = {
106106 win . ctx . getExtension ( extensions [ i ] ) ;
107107 }
108108
109- /* if (!this.shadow) {
110- this.shadow = this.attachShadow({mode: 'closed'});
109+ if ( this . _canShadow ) {
110+ if ( ! this . shadow ) {
111+ this . shadow = this . attachShadow ( { mode : 'closed' } ) ;
112+ }
113+ this . shadow . appendChild ( win . canvas ) ;
114+ } else {
115+ this . insertAdjacentElement ( 'afterend' , win . canvas ) ;
111116 }
112- this.shadow.appendChild(win.canvas); */
113117
114118 this . dispatchEvent ( new MessageEvent ( 'canvas' , {
115119 data : win . canvas ,
116120 } ) ) ;
117- if ( ! win . canvas . parentNode ) {
118- this . insertAdjacentElement ( 'afterend' , win . canvas ) ;
119- }
120121 }
121122 return win . ctx ;
122123 } ;
@@ -239,12 +240,14 @@ const XREngineStatic = {
239240class XREngine extends HTMLElement {
240241 constructor ( ) {
241242 super ( ) ;
243+ this . _canShadow = true ;
242244 this . _constructor ( ) ;
243245 }
244246}
245247class XREngineTemplate extends HTMLTemplateElement {
246248 constructor ( ) {
247249 super ( ) ;
250+ this . _canShadow = false ;
248251 this . _constructor ( ) ;
249252 }
250253}
You can’t perform that action at this time.
0 commit comments