HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Keithamus

no profile record

Submissions

Too Much Color

keithcirkel.co.uk
10 points·by Keithamus·4개월 전·1 comments

Show HN: What's my JND? – a colour guessing game

keithcirkel.co.uk
56 points·by Keithamus·4개월 전·56 comments

comments

Keithamus
·12일 전·discuss
It’s unfortunate that this name was used. There is a W3C community group called OpenUI (https://open-ui.org/) which has been around for close to a decade, working on improving UI standards for the web.
Keithamus
·4개월 전·discuss
I will get around to fixing this. An oversight. Apologies.
Keithamus
·4개월 전·discuss
Right. The average score is under different test conditions. Obviously this game is a little silly version with very little accuracy to the lab testing, but hopefully it gets people thinking about this stuff a bit more! Which given your investigations into this, I would say it has succeeded.
Keithamus
·4개월 전·discuss
JND is an average. A lot of people will do a lot worse. The measure, as I understand it, is also under different test conditions, while this is a game where people are on their own and able to - for example - tilt their head trying to find the exact angle to see the difference.
Keithamus
·작년·discuss
It’s not executing JS. The names map to JS methods but both the HTML and JS call into C++ (or rust or swift whatever the browser is written in). Arbitrary JS code execution cannot occur. Of course if you’re ingesting user generated content you should not allow these attributes on buttons (but for proper security you should already have an allow-list of tags and attributes on any user generated content).
Keithamus
·작년·discuss
Author here. I am not affiliated with Google. My current employer is GitHub, and this was incubated in the OpenUI working group. Open source & the open Web are still very much alive!
Keithamus
·2년 전·discuss
BroadcastChannel is a better solution for a couple of reasons. Service Workers are better at intercepting network requests and returning items from a cache, there’s some amount of additional effort to do work outside of that. The other thing is they’re a little more difficult to set up. A broadcast channel can be handled in a couple lines of code, easily debuggable as they run on the main thread, and they’re more suited to the purpose.
Keithamus
·2년 전·discuss
Thank you for providing the detail I was scant on.
Keithamus
·2년 전·discuss
While it hasn't been expressly resolved by the HTML working group to not propose new attributes with dashes, and while I don't speak for everyone in the HTML working group, I would assert that many members would object to a proposed attribute that included a dash (including myself).

There is also a proposal in the works to allow web developers to define custom attributes - much like custom elements - which would likely follow the same or similar rules around dashes, at which point I imagine the HTML spec would guarantee that no dashes would be used in "built in" attributes.

New attributes have been proposed that reasonably _could_ have had a dash, for example `popovertargetaction`, but instead they were compounded to one word precisely to cave out this path.
Keithamus
·2년 전·discuss
They key difference is that an attribute can only appear once on an element, and consequently only have one of its variants present. Classes can present multiple variants at once.

At a surface level `<div class="Card" data-size="big">` isn't really any better `<div class="Card big">`. But `<div class="Card" data-size="big" data-size="small">` is not valid HTML - the second attribute is discarded. While `<div class="Card big small">` has no such contract, and as such is valid HTML and the CSS is unlikely to account for it, perhaps doing surprising things.