Closed (fixed)
Project:
Mollom
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Oct 2010 at 14:27 UTC
Updated:
24 Apr 2014 at 17:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sunFixed and improved various comments.
Comment #3
sunRegarding the last contained @todo, see #939510: Allow modules to react on/participate in form_state_values_clean()
Comment #4
sunStill needs proper tests, but this one should at least pass the existing.
Comment #5
dries commentedPer our call we also need to rename 'post_honeypot' to just 'honeypot'.
Comment #6
dries commentedSome reading:
Comment #7
Everett Zufelt commentedA few comments from an accessibility perspective.
1. Can we omit .element-invisible completely and just go with display:none ? This has the benefit of only presenting the form field to users with CSS disabled. Do spam bots use CSS?
2. Using .element-invisible means that screen-readers will have access to the fields, not that big of an issue if labeled appropriately.
3. Using .element-invisible on a focusable element causes a focus black hole for keyboard only users, which is why .element-invisible.element-focusable was added recently to D7 system.base.css. Of course doing this we need to somehow make the label (currently not using a label) appear when the input field appears.
+ // @todo Ping accessibility team to confirm that this is correct.
+ '#title' => t('Leave this field blank'),
This seems like good text, but I question if it will in fact be confusing, despite its simplicity. E.g. my first question is "why?" and "am I understanding this correctly? surely they don't want me to leave it blank".
+ // @todo #title_display 'attribute' does not work for #type textfield... grumble.
+ '#title_display' => 'attribute',
Nor will it in D7, already an open issue for D8 to ensure that attribute can apply to all native form input fields
Comment #8
sunThanks, Everett, for your insights! I'll come back to that very shortly. For now, merely posting a D6 version of the patch to facilitate manual testing.
Comment #9
dries commentedApplied on buytaert.net for testing.
Comment #10
Everett Zufelt commentedFor insight on why #title_display cannot be used with types other than radio and checkbox see #558928-182: Form element labeling is inconsistent, inflexible and bad for accessibility
Comment #11
sunOne more re-roll for D6. Contains debugging code.
Comment #12
dries commentedLooks great! I think we're really close to getting this committed.
I'd update the phpDoc to make it less dramatic. Let's get rid of words like 'blatantly' and be a bit more explanatory. Personally, I think it is appropriate for the Mollom module to clean up some of its data. At the same time, I'm not convinced we need to fix this. If we remove this code, where do things go wrong? Can we fix the other modules? I know this is a bit of a bi-polar review. We should probably keep this code in the Mollom module, I guess.
Still debug code.
Comment #13
sunHeavily improved the code and also comments.
@Everett: Are we right in assuming that screen-readers will not show any form element that is wrapped in a display:none container?
Comment #14
dries commentedI'm not sure I understand the first sentence. Also, I think the second sentence can be removed. Seems like these code comments need to be simplified, or removed even?
Maybe start with "Various forms outside the Drupal module blindly save all data ..." ?
Maybe one more re-roll and than it can be committed. You can commit it.
Comment #15
Everett Zufelt commented@Sun
Correct, screen-readers will ignore content if it is set to display: none, or if it inherits display: none.
Comment #16
sunAdded a test to verify the expected honeypot behavior on the client-side. I've also reworded the comments a bit. I think we should keep them, because apparently, it's the only documentation that exists ;)
I think that this patch is ready to fly.
Comment #17
Everett Zufelt commentedNot sure which is the most recent patch on http://buytaert.net/want-to-grow-drupal-put-on-a-drupalcamp
When I look at the page with JAWS it reads "Leave blank, used to catch spammers". The field itself isn't visible to JAWS. If we are doing display: none on the field we need to do display: non on the label too. if element-invisible is currently being applied to the label it will override the display:none that may be set on the container.
Comment #18
Everett Zufelt commentedOk, here is the code, I'm not sure why JAWS would read the title from an element marked with style="display: none;". I'll need to do some more research on this, since JAWS is reading the title, but not reading the form field (the text field is invisible to JAWS.
Comment #19
sunThanks for testing, Everett! I think that Dries' blog still runs an earlier version of this code, which had the display:none applied to the INPUT element only.
But speaking of, since we now wrap the entire form item element with display:none and screen-readers don't expose it, we can also remove the title attribute from the INPUT element.
Comment #20
Everett Zufelt commentedFurther testing on Dries's site showed that VO/Safari, NVDA/IE and FF and JAWS/IE all worked as expected. Only JAWS/FF read the title of the input field with when style="display: none;".
I will test the most recent patch when it is applied somewhere for testing, but it looks good to me.
I'm not really sold on the no label / title, some users do have CSS disabled and whill have no idea what the field is for. This might be an acceptable trade-off.
Comment #21
dries commentedLooks great now. Committed to DRUPAL-6--1. Thanks!
Comment #22
dries commentedMy personal site ran an older version when Everett tested it. I've upgraded my site to use the latest and greatest DRUPAL-6--1 branch.
Comment #23
dries commentedComment #24
Everett Zufelt commentedSeems to hide the @title attribute properly with JAWS / FF now, didn't re-test anything else.
Comment #25
sunPorted to HEAD.
Comment #26
sunThanks for reporting, reviewing, and testing! Committed to HEAD.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.