GithubHelp home page GithubHelp logo

Comments (8)

LouisStAmour avatar LouisStAmour commented on July 19, 2024 1

Never mind, I just read the spec. Indeed it’s supposed to always return false. My mistake

from inert.

bkardell avatar bkardell commented on July 19, 2024

hmm... the active element winds up being null in https://github.com/WICG/inert/blob/master/dist/inert.js#L251

should default it to root?

from inert.

valdrinkoshi avatar valdrinkoshi commented on July 19, 2024

This seems more a bug of node-contains, as the native Node.contains accepts undefined or null as parameter - e.g. document.body.contains(undefined)

from inert.

straker avatar straker commented on July 19, 2024

So should the contains polyfill just return false if other is falsey?

return other && (node === other || !!(node.compareDocumentPosition(other) & 16) )

from inert.

valdrinkoshi avatar valdrinkoshi commented on July 19, 2024

Yeah something on those lines

from inert.

LouisStAmour avatar LouisStAmour commented on July 19, 2024

It’s actually not a node-contains bug because it’s a precondition error if null is passed in to contains, at least according to a Firefox bug report I saw. You need a try catch or you need to check first. My fix mentioned in #64 is correct.

from inert.

straker avatar straker commented on July 19, 2024

So we're going on a week now and I haven't heard from the creator of node-contains about the pr. It hasn't been updated in 3 years, should it's code just be consumed and updated?

from inert.

robdodson avatar robdodson commented on July 19, 2024

yeah probably, looks simple enough

from inert.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.