Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #12572
| Message-ID | <1940345.aqSPkdTlGX@PointedEars.de> (permalink) |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Organization | PointedEars Software (PES) |
| Date | 2012-03-10 12:33 +0100 |
| Subject | Re: Removing a Control from the taborder |
| Newsgroups | comp.lang.javascript |
| References | (1 earlier) <XnsA011B6483162eejj99@194.109.133.133> <1fuil7tf54q4gu2h40ous7k58q3766aaa9@4ax.com> <jje5bg$f47$1@dont-email.me> <4191797.g0LvDaAvTT@PointedEars.de> <jjejit$hcc$1@dont-email.me> |
| Followup-To | comp.lang.javascript |
Followups directed to: comp.lang.javascript
Norman Peelman wrote:
> Thomas 'PointedEars' Lahn wrote:
>> Norman Peelman wrote:
>>> Consider this, the tabindex controls the tab order of the form
>>> elements with a range of 0 - 32767. That means to remove a form element
>>> from the tabindex it must not be in that range. "-1" is not in that
>>> range, nor is "-32767" or anything in between for that matter. You could
>>> simply throw (insert) a minus sign in front of a form element to disable
>>> it, even via scripting (simply multiply the tabindex by -1 to toggle).
>>
>> Your logic is flawed. The HTML 4.01 Specification is definitive about
>> this: values for the `tabindex' attribute outside the specified range are
>> *invalid*. It is specified accordingly in W3C DOM Level 2 HTML:
>
> Invalid, thereby causing the tabindex to be ignored.
No, not necessarily. That is the fallacy. The type of the `tabindex'
attribute in HTML 4.01 is the SGML type NUMBER [1a], and that type does not
include values containing the `-' (U+002D HYPHEN-MINUS) character [2].
There is no standard on handling invalid documents (only a non-normative
recommendation for HTML 4.01 documents [1b]; HTML5 would become the first
version of HTML to fix that [3]). A conforming HTML 4.01 parser is free to
interpret invalid markup as it sees fit (which is done, as evident by
comparing results of other invalid markup in MSHTML-based and Gecko-based
browsers alone). For example, one parser, but not another (i.e., one
browser, but not another), could reasonably normalize a value out of range
to one in range – 0 – which would include the element in the tab order after
all other elements that have a proper `tabindex' attribute set [1c].
On top of inconsistent results with HTML user agents, the W3C Markup
Validator and other properly working markup validators will report such an
attribute value as a *syntax error* [4a]. While validation is not a mark of
quality in itself [4b], failure of a document to validate, for dubious
reasons such as this, certainly raises doubt about the competence of the
document's author, which usually also is to the disadvantage of enterprises
making and publishing the corresponding website.
Deliberately using invalid markup will make it harder for the
author/programmer to find other, potentially more serious, accidental syntax
errors in the document by using markup validation. For example, think about
a document where several such invalid elements as you propose are generated
by a server-side application in a loop.
There is also no guarantee that, in order to avoid an invalid document,
assigning afterwards a negative Number value to the `tabIndex' attribute
property of the corresponding DOM object would work; but there is strong
indication that it would not work. W3C DOM Level 2 HTML, which applies to
HTML 4.01 and XHTML 1.0 documents [5a], specifies that property to be an
implementation of the `tabIndex' IDL attribute of the HTMLInputElement
interface (a.o.) whose values must correspond to the HTML 4.01 specification
of the markup attribute [5b, 5c].
Your approach is positively harmful to all involved (enterprise, document
author, script developer, and visitor). IOW, it is a Really Bad Idea.
HTH
PointedEars
___________
[1a] <http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html
#h-17.4>,
<http://www.w3.org/TR/1999/REC-html401-19991224/sgml/dtd.html>,
<http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd>
[1b] <http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html
#h-B.1>
[1c] <http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html
#adef-tabindex>
[2] <http://www.w3.org/MarkUp/SGML/productions.html#prod56>
[3] <http://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-
and-the-tabindex-attribute>
[4a] <http://validator.w3.org/#validate_by_input+with_options>,
type `<input tabindex="-1">', select "Validate HTML fragment" (which
by default selects "Use Doctype: HTML 4.01", select "Check".
[4b] <http://validator.w3.org/docs/help.html#validandquality>
[5a] <http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/>
[5b] <http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/ecma-script
binding.html>
[5c] <http://www.w3.org/TR/2003/REC-DOM-Level-2-
HTML-20030109/html.html#ID-62176355>
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Removing a Control from the taborder Gene Wirchenko <genew@ocis.net> - 2012-03-08 13:56 -0800
Re: Removing a Control from the taborder "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-03-09 00:07 +0000
Re: Removing a Control from the taborder Gene Wirchenko <genew@ocis.net> - 2012-03-08 19:37 -0800
Re: Removing a Control from the taborder Norman Peelman <npeelmandog@cfl.rr.com> - 2012-03-09 18:56 -0500
Re: Removing a Control from the taborder Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-03-10 01:42 +0100
Re: Removing a Control from the taborder Norman Peelman <npeelmandog@cfl.rr.com> - 2012-03-09 22:59 -0500
Re: Removing a Control from the taborder "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2012-03-10 08:40 +0200
Re: Removing a Control from the taborder Norman Peelman <npeelmandog@cfl.rr.com> - 2012-03-10 06:18 -0500
Re: Removing a Control from the taborder Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-03-10 13:33 +0100
Re: Removing a Control from the taborder Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-03-10 12:33 +0100
Re: Removing a Control from the taborder Norman Peelman <npeelmandog@cfl.rr.com> - 2012-03-09 23:22 -0500
Re: Removing a Control from the taborder Dr J R Stockton <reply1210@merlyn.demon.co.uk> - 2012-03-10 20:51 +0000
Re: Removing a Control from the taborder Gene Wirchenko <genew@ocis.net> - 2012-03-10 23:55 -0800
Re: Removing a Control from the taborder Dr J R Stockton <reply1211@merlyn.demon.co.uk.invalid> - 2012-03-12 19:46 +0000
Re: Removing a Control from the taborder David Mark <dmark.cinsoft@gmail.com> - 2012-03-12 18:24 -0700
csiph-web