Hacker News

Favorites Setup
Comment by hyperhello | original | HTML Can Do That
[−]hyperhello · 2026-08-20 Thu 15:25 UTC · link
I don’t understand why the group invented these new attributes and methods of action for dialogs that don’t seem relevant to anything else. Was there some silly patent to work around?
[−]esprehn · 2026-08-20 Thu 15:41 UTC · link
As opposed to what? Not sure what the alternative you're picturing is.
[−]hyperhello · 2026-08-20 Thu 15:48 UTC · link
popovertarget="example-dialog" popovertargetaction="hide"

It’s all binding. This is what JavaScript is for: dynamic content.

[−]Aachen · 2026-08-20 Thu 17:17 UTC · link
Input fields are dynamic elements. Textareas can be resized. Pages can be scrolled. Why implement everything anew in custom code if it can be implemented once per browser engine in native code, native UI, and expected/homogenous UX?
[−]hyperhello · 2026-08-20 Thu 17:57 UTC · link
I mean the action and target attributes don’t seem to appear anywhere else but the popover api. I’m in favor of HTML dialogs, I just don’t see the point in the trend of making everything into this declarative nightmare it’s becoming when we have onclick=dialog.show() without even quotes.
[−]esprehn · 2026-08-20 Thu 20:19 UTC · link
Script attributes are very often disabled for security reasons.

The declarative actions API is currently only used for popover, but it's been discussed for over a decade to allow SSR of rich content that's interactive before script loading. See also https://developer.chrome.com/blog/command-and-commandfor

For a long time I also pushed back on these interactive APIs because script is a better primitive and every site seems to have quirky requirements. I've come around on it though because there's huge demand for SSR again and businesses are seeing the value in very fast TTI.

I do still think the date picker API is a disaster. Everyone actually needs something much richer than the system date picker. Travel websites want ranges. People want to put dots and day highlights. I wish they'd fix that next.

[−]hyperhello · 2026-08-20 Thu 22:10 UTC · link
What I guess this all leads to is that we’re trying to create some kind of DSA that doesn’t have the possibility to hang or crash the way imperative programs must have the ability to if they are to be effective. So it seems like web design is an avalanche of sort of silly css prefixes and selectors and attributes that refer to object ids and everything, when what we might have said instead is that if a script takes more than one second wall clock or something equivalent adjusted to standard then it gets rolled back like a transaction.