Code Monkey home page Code Monkey logo

Comments (5)

Jack-Works avatar Jack-Works commented on August 15, 2024 2

So should I open the issue in Chrome and Safari?

from dom.

bathos avatar bathos commented on August 15, 2024 1

the name composedPath indicates it is for DOM Node

I’m unsure what about the name suggests that. While EventTargets constructed directly from user code never have a non-default “get the parent” algorithm presently, IndexedDB interfaces extending EventTarget do — an IDBRequest’s parent is an IDBTransaction and an IDBTransaction’s parent is an IDBDatabase. The usual bubbling behavior applies.

As far as I can tell, composedPath() for e.g. an IDBRequest success event should reflect this, and in Firefox, it does:

image

In Chromium presently, I get an empty array.

from dom.

annevk avatar annevk commented on August 15, 2024

I think that's right. Would you be willing to add web-platform-tests coverage? Edit: there are some tests for composedPath() in the /shadow-dom/ directory, not nothing covering this. Perhaps even better to add to /dom/events/ given that shadow trees are not involved in your scenario.

cc @rniwa @mfreed7

from dom.

Jack-Works avatar Jack-Works commented on August 15, 2024

I wonder which behavior is expected? Since the name composedPath indicates it is for DOM Node, the list missing pure EventTarget might be intended.

from dom.

annevk avatar annevk commented on August 15, 2024

Fair, might be good to wait a bit for others to chime in. In my mind this was always the event's path, but we didn't call it that because it had to be partially obscured in the presence of shadow trees. So I would expect Firefox's behavior and if we ever added the ability for userland EventTarget to hook into "get the parent" that would be reflected here as well.

(These days we would probably not add an API that so casually reveals open shadow trees however.)

cc @smaug----

from dom.

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.