Skip to content

ViewEncapsulation.Native errors in (Safari Technical Preview) #7856

Closed

Description

@TheLarkInn

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

Activity

  1. MarkPieszak commented on Apr 1, 2016

    @MarkPieszak

    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?

  2. TheLarkInn commented on Apr 1, 2016

    @TheLarkInn
    MemberAuthor

    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.

  3. changed the title [-]ViewEncapsulation.Native (Safari Technical Preview)[/-] [+]ViewEncapsulation.Native doesn't work in (Safari Technical Preview)[/+] on Apr 1, 2016
  4. changed the title [-]ViewEncapsulation.Native doesn't work in (Safari Technical Preview)[/-] [+]ViewEncapsulation.Native errors in (Safari Technical Preview)[/+] on Apr 1, 2016
  5. added
    area: coreIssues related to the framework runtime
    open for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).
    on Sep 28, 2016
  6. added
    featureLabel used to distinguish feature request from other issues
    on Oct 6, 2016
  7. vicb commented on Oct 6, 2016

    @vicb
    Contributor

    Should be an easy fix in BrowserDomAdapter.createShadowRoot (the underlying fn should be memoized when the adapter is instanciated)

  8. added this to the Backlog milestone on Jan 23, 2018
  9. HitkoDev commented on Apr 9, 2018

    @HitkoDev

    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?

  10. abraham commented on Apr 9, 2018

    @abraham
    Contributor

    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.

  11. HitkoDev commented on Apr 9, 2018

    @HitkoDev

    @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.

  12. robwormald commented on Sep 15, 2018

    @robwormald
    Contributor

    Fixed

  13. chriszrc commented on Oct 29, 2018

    @chriszrc

    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?

  14. sarunint commented on Oct 29, 2018

    @sarunint
    Contributor

    @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.

  15. angular-automatic-lock-bot commented on Sep 14, 2019

    @angular-automatic-lock-bot

    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.

  16. locked and limited conversation to collaborators on Sep 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtimefeatureLabel used to distinguish feature request from other issuesopen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions