Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
To meet all accessibility criteria it is In the Netherlands it is not allowed to use inline CSS styling. In the mollom.module file there is a prefix created with display:none; which could be replaced by element-hidden.
Comment | File | Size | Author |
---|---|---|---|
#4 | don_t_use_inline_css-2544576-2.patch | 597 bytes | Oostie |
Comments
Comment #1
OostieComment #2
OostieComment #4
Oostiesrry, fixed a typo
Comment #5
eshta CreditAttribution: eshta at Acquia commentedComment #6
eshta CreditAttribution: eshta at Acquia commentedThe inline style is added in order to prevent spambots from recognizing that the form input is actually hidden. Given that "element-hidden" is the standard Drupal class for hiding a form field, it wouldn't take much for a bot to take this class into account. Another approach would be to utilize a module-specific class that perform the same hiding action. If I were to guess as to why the inline style approach was selected it would be to prevent themes from accidentally overriding the custom style. I know that some themes out there don't even properly respect element-hidden depending on the type of form element is has been applied to.
I've seen some honeypot solutions where the usage of the inline styles is configurable and if you turn it off you are responsible for hiding the field yourself. This could be a more complicated solution for those who need to comply by specific rules like you do - but it sure does seem overly complicated. Maybe a more drupally approach would be to utilize theming to add the inline-style. This would leave sites free to override it as they see fit.
Comment #7
mgiffordWhat is the accessibility problem with inline styles?