erikringsmuth / app-router

Router for Web Components
https://erikringsmuth.github.io/app-router/
MIT License
610 stars 83 forks source link

/deep/ combinator is deprecated. #135

Open OlsonDev opened 8 years ago

OlsonDev commented 8 years ago

See https://www.chromestatus.com/features/6750456638341120 for more details.

Also see W3 and Google Groups.

Warning comes from Chrome 45.0.2454.85. Code called into question:

  // scroll to the element with id="hash" or name="hash"
  function scrollToHash(hash) {
    if (!hash) return;

    // wait for the browser's scrolling to finish before we scroll to the hash
    // ex: http://example.com/#/page1#middle
    // the browser will scroll to an element with id or name `/page1#middle` when the page finishes loading. if it doesn't exist
    // it will scroll to the top of the page. let the browser finish the current event loop and scroll to the top of the page
    // before we scroll to the element with id or name `middle`.
    setTimeout(function() {
      var hashElement = document.querySelector('html /deep/ ' + hash) || document.querySelector('html /deep/ [name="' + hash.substring(1) + '"]');
      if (hashElement && hashElement.scrollIntoView) {
        hashElement.scrollIntoView(true);
      }
    }, 0);
  }
MetaMemoryT commented 8 years ago

:+1: this is annoying

https://github.com/erikringsmuth/app-router/blob/master/src/app-router.js#L451