Giter Club home page Giter Club logo

Comments (5)

domfarolino avatar domfarolino commented on May 23, 2024 1

In general, the various hooks that DOM provides (largely for HTML's consumption by my estimation) like attribute change steps, insertion steps etc., seem to be underspecified ordering-wise. DOM provides a per-specification hook, which doesn't specify ordering across specs, and also HTML seems to provide multiple overrides for some of these hooks, as you've found, which is bad form.

Probably most of the time this is fine since I would guess(??) the steps are often mutually-non-observable, but I imagine this system has grown into a larger mess than it was originally conceived to be, so an issue filed against DOM to track cleaning that up is probably best (unless Anne has more historical context that I don't know about).

For this specific instance about popover, I would delegate to @josepharhar who has more domain-specific context than I. But also happy to take a look myself if needed.

from html.

annevk avatar annevk commented on May 23, 2024

cc @domfarolino @josepharhar

from html.

josepharhar avatar josepharhar commented on May 23, 2024

I probably wrote the popover change steps this way because I found the details element change steps before I found the nonce change steps to figure out what to write:

The following attribute change steps, given element, localName, oldValue, value, and namespace, are used for all details elements:

I don't see how the hook which DOM provides has anything to do with particular types of elements or attributes, so maybe it would be most correct to change all of the attribute change steps to stop saying that they apply to certain types of elements or attributes, and add steps like the one in the popover change steps which actually examines the element and returns early when the steps don't apply.

Probably most of the time this is fine since I would guess(??) the steps are often mutually-non-observable

Yeah I don't think this is a problem, but if somebody finds a problem then I guess we will have to write in the spec somewhere what the order of attribute change step hooking algorithms is...?

from html.

domenic avatar domenic commented on May 23, 2024

I would love it if someone did a holistic refactor of the attribute change steps (and insertion steps, and connected steps, etc...). #7712 and #2771 kind of discuss that.

I don't think it's the highest-priority work, but it would be nice. It's just a lot of busywork moving stuff around.

from html.

domenic avatar domenic commented on May 23, 2024

Moving to #10331.

from html.

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.