-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend global attributes array #175
Conversation
Extending the list of allowed global attributes Signed-off-by: Koopz <[email protected]>
src/View/Helper/AbstractHelper.php
Outdated
@@ -93,18 +93,25 @@ abstract class AbstractHelper extends BaseAbstractHelper | |||
*/ | |||
protected $validGlobalAttributes = [ | |||
'accesskey' => true, | |||
'autocapitalize' => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we at least document where these attributes come from? A link to their spec would be helpful 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean inside the code, per attribute?
'autocapitalize' => true, // https://html.spec.whatwg.org/multipage/interaction.html#attr-autocapitalize
I don't know how prone the spec page is regarding breaking links, should they ever decide to move that blurp to another page.
Or a mention on https://docs.laminas.dev/laminas-form/v3/helper/abstract-helper/?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean inside the code, per attribute?
'autocapitalize' => true, // https://html.spec.whatwg.org/multipage/interaction.html#attr-autocapitalize
IMHO yes, per attribute pointing to whatwg.org
is ok and enough. I wouldn't care about link stability, we can't be perfect.
Or a mention on https://docs.laminas.dev/laminas-form/v3/helper/abstract-helper/?
Listing each attribute would be cumbersome to me, but a mention that only some are supported with a call to look at Laminas\Form\View\Helper\AbstractHelper::$validGlobalAttributes
to have the full list, that would be very welcome
Signed-off-by: Koopz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for taking the time to expand on the references.
As for the CS failures, I think those are on our sude to adjust/fix (probably suppress)
Signed-off-by: Koopz <[email protected]>
Looks like i was a bit too hasty trying to fix things myself. |
I don't mind - these are usually very stable regardless 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I'll try to fix the CI once back from vacation 🏖️
Thank you @Koopzington |
Description
With further development of the HTML standard there have been introduced a number of new global attributes of which some are also applicable on form elements. To support these new attributes i have decided to extend the existing whitelist of global attributes that's being used in the rendering process and added the attributes listed on MDN which were missing.
As suggested by @froschdesign on slack i've commented out the ones i perceived as not really useful in context of form elements.
The following attributes have been added:
<script>
and<style>
or similar tags