You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ViewEncapsulation.Native errors in (Safari Technical Preview) #7856
Steps to reproduce and a minimal demo of the problem
It looks like the Safari Technical Preview is now using the new ShadowDOM API standard attachShadow() rather than the deprecated createShadowRoot().
I wanted to have an issue at least documented that covered updating ViewEncapsulation to handle the new standard in the future.
Current behavior
ViewEncapsulation.Native errors in Safari Technical Preview
Reacted by PatrickJS, Herrington Darkholme, Mark Pieszak, Sean Larkin, Trotyl Yu, Ruslan and Sujan Kandeepan
Nice catch this would definitely have to be upgraded in core to reflect this.
Maybe check for the existence of either createShadowRoot or attachShadow is needed?
It's strange because chrome stable doesn't support attachShadow() quite yet. In fact I don't know what does besides STP. It feels like a polyfill like check to see if either method exists on Element and use that one would be a desirable approach in my opinion also.
changed the title [-]ViewEncapsulation.Native (Safari Technical Preview)[/-][+]ViewEncapsulation.Native doesn't work in (Safari Technical Preview)[/+]on Apr 1, 2016
changed the title [-]ViewEncapsulation.Native doesn't work in (Safari Technical Preview)[/-][+]ViewEncapsulation.Native errors in (Safari Technical Preview)[/+]on Apr 1, 2016
Since my issue has been closed, could anyone give us any progress on this? Maybe at least some hints on whether we should push in the direction of adding a separate ViewEncapsulation.ShadowDom, or should we instead fix the ViewEncapsulation.Native, considering Custom Elements v0 never moved beyond experimental implementations and Element.attachShadow is now a part of DOM Living Standard?
The feedback from #19059 is that ViewEncapsulation.Native can't be changed due to backward compatibility reasons. There is an initial implementation of ViewEncapsulation.ShadowDom but there has been no feedback recently on next steps.
@abraham Thanks, it would be nice hearing from the Angular devs about it (@TheLarkInn and @robwormald ?), I'm especially curious about why this hasn't been pushed for v6, considering it's been standardised and #19059 was sufficiently ready (i.e. documented and tested) months before v5 has been released.
@chriszrc That is expected, because ViewEncapsulation.Native uses the old and deprecated Shadow DOM v0 Specification. Use ViewEncapsulation.ShadowDom instead.
Don't blame Angular team for that, they designed this years ago, even before it was deprecated.
Reacted by Daan Haitsma
angular-automatic-lock-bot commented on Sep 14, 2019
Activity
MarkPieszak commentedon Apr 1, 2016
Nice catch this would definitely have to be upgraded in core to reflect this.
Maybe check for the existence of either createShadowRoot or attachShadow is needed?
TheLarkInn commentedon Apr 1, 2016
It's strange because chrome stable doesn't support attachShadow() quite yet. In fact I don't know what does besides STP. It feels like a polyfill like check to see if either method exists on Element and use that one would be a desirable approach in my opinion also.
[-]ViewEncapsulation.Native (Safari Technical Preview)[/-][+]ViewEncapsulation.Native doesn't work in (Safari Technical Preview)[/+][-]ViewEncapsulation.Native doesn't work in (Safari Technical Preview)[/-][+]ViewEncapsulation.Native errors in (Safari Technical Preview)[/+]vicb commentedon Oct 6, 2016
Should be an easy fix in
BrowserDomAdapter.createShadowRoot(the underlying fn should be memoized when the adapter is instanciated)HitkoDev commentedon Apr 9, 2018
Since my issue has been closed, could anyone give us any progress on this? Maybe at least some hints on whether we should push in the direction of adding a separate
ViewEncapsulation.ShadowDom, or should we instead fix theViewEncapsulation.Native, considering Custom Elements v0 never moved beyond experimental implementations andElement.attachShadowis now a part of DOM Living Standard?abraham commentedon Apr 9, 2018
The feedback from #19059 is that
ViewEncapsulation.Nativecan't be changed due to backward compatibility reasons. There is an initial implementation ofViewEncapsulation.ShadowDombut there has been no feedback recently on next steps.HitkoDev commentedon Apr 9, 2018
@abraham Thanks, it would be nice hearing from the Angular devs about it (@TheLarkInn and @robwormald ?), I'm especially curious about why this hasn't been pushed for v6, considering it's been standardised and #19059 was sufficiently ready (i.e. documented and tested) months before v5 has been released.
robwormald commentedon Sep 15, 2018
Fixed
chriszrc commentedon Oct 29, 2018
I'm getting a similar error in Chrome now:
"Element.createShadowRoot is deprecated ..."
Is there any way to patch older angular apps (4.x) or is upgrading to 6 the only way to proceed here?
sarunint commentedon Oct 29, 2018
@chriszrc That is expected, because
ViewEncapsulation.Nativeuses the old and deprecated Shadow DOM v0 Specification. UseViewEncapsulation.ShadowDominstead.Don't blame Angular team for that, they designed this years ago, even before it was deprecated.
angular-automatic-lock-bot commentedon Sep 14, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.