Closed zetashift closed 1 year ago
Actually finding a name for ImageLoadingMode
was the hardest part hahaha. I looked at the specs and it didn't have a name for it.
MDN also feels very unofficial with the "hint" so I used mode
just to get started.
Policy sounds okay, but they also just drop that in a comment, the type itself doesn't really have a name...
I was also wondering if it should be Image
and not HTMLImageLoadingMode
:P. I don't have a real preference, hint
could probably be the most familiar to people because MDN describes it like that.
Ha yeah I thought as much 😂
Looking at the existing enums we have, both "mode" and "policy" are common. So I think either is a fine choice. No "hint". https://github.com/scala-js/scala-js-dom/tree/main/dom/src/main/scala-3/org/scalajs/dom
Now it's just a philosophical question of what the difference between those is 🤔
I guess "mode" sounds like it can only be certain cases, whereas policy sounds more like "something that just should be followed but might not be"?
Naming is hard :P
lol, well what about this? They seem to call it a "state" https://html.spec.whatwg.org/multipage/urls-and-fetching.html#lazy-loading-attributes
The other thing that's notable is that it's not specific to Image
, seems that iframe
uses it too. So I wonder if it should actually be shared by both 🤔
Yuck, I don't find state fitting, but spec is spec...
Can rename to something like LoadingState
Ok ... coming back to this ... 😅
I think I'm in favor of LazyLoadingState
. Since it's the "lazy loading attribute", and "Some attributes, called enumerated attributes, take on a finite set of states". So that seems like the specciest name.
@armanbilge I renamed it to LazyLoadingState and changed the Longs to Doubles!
Another good first issue!