[Webkit-unassigned] [Bug 40908] unable to set focus to non-displayed elements with "required" attribute on submit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jun 27 07:58:06 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=40908


Aryeh Gregor <Simetrical+webkit at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Simetrical+webkit at gmail.com




--- Comment #4 from Aryeh Gregor <Simetrical+webkit at gmail.com>  2010-06-27 07:58:06 PST ---
Link to WHATWG discussion:

http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2010-June/026591.html

(In reply to comment #2)
> I disagree. It's not the job of a Web browser to enlist users as evangelists, or to shift the blame on HTML5 and authors.
> 
> My instinct is that we should ignore the required attribute if there is no way for the user to fix the problem. It's tricky though, as the input may be invisible for other reasons (e.g. behind an opacity:0.99 layer).

This would have to be specced -- currently the spec doesn't permit it.  (See linked discussion.)  It's not likely that you'd be able to catch all the corner cases easily . . . there are all sorts of devious ways to hide things.  Worse, it makes HTML-level semantics ("this input must match criteria X Y Z") dependent on CSS.

As an author, if I say username is required on my login form, I do *not* want the browser sometimes deciding that it's not actually required.  If the input is required, that might mean that it makes no sense to submit without the input being filled.  This is a bug in the page and it needs to be fixed by the page author; the browser can't reliably guess what to do here.

(In reply to comment #3)
> Is there any evidence of authors doing this?

MediaWiki formerly did this by mistake (until we turned off form validation due to WebKit's bug 40747).  If you're logged in and have JS enabled, the page http://en.wikipedia.org/wiki/Special:Preferences uses JS to break the page into tabs.  If you filled out something incorrectly, switched to another tab, and tried to submit, the invalid input wouldn't be focusable.

However, this is just an authoring bug, no different from misusing a script library.  If it's not possible for the browser to do the right thing here automatically, it needs to push it off onto the author.  There will be problems as authors adopt the technology too soon and write broken pages, but these will go away when enough browsers implement the features.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list