RFR: 8322708: Global HTML attributes are not allowed [v3]
Pavel Rappo
prappo at openjdk.org
Fri Jun 14 12:15:47 UTC 2024
On Wed, 12 Jun 2024 09:03:38 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:
>> Wouldn't the easiest solution be to add a boolean `global`/`isGlobal` field and getter to `Attr`?
>>
>> That would give use some more opportunities to simplify the code: We could get rid of the `GLOBAL_ATTRS` map here *and* avoid putting global attributes in the the `attr` map of each `HtmlTag` instance by simply adding a shortcut to return `AttrKind.OK` in `getAttrKind(Name)` if the given attribute is global.
>
> BTW, this should also be done by global attributes that are already respected, such as `id`, `class`, and the `aria-*` accessibility attributes.
I agree with Hannes on both comments:
- `class`, `id`, `slot`, and `aria-*` are effectively global attributes and should be modelled as such
- global attributes could probably be constructed with a boolean argument `true`
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19652#discussion_r1636148171
More information about the javadoc-dev
mailing list