Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.teledata-fn.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <1940345.aqSPkdTlGX@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Sat, 10 Mar 2012 12:33:39 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit Subject: Re: Removing a Control from the taborder Newsgroups: comp.lang.javascript References: <1fuil7tf54q4gu2h40ous7k58q3766aaa9@4ax.com> <4191797.g0LvDaAvTT@PointedEars.de> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 86 NNTP-Posting-Date: 10 Mar 2012 12:33:40 CET NNTP-Posting-Host: 4e15960f.newsspool3.arcor-online.net X-Trace: DXC=7D;4>9HJU;2QbA1[CgMQ00McF=Q^Z^V384Fo<]lROoR18kF 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] , , [1b] [1c] [2] [3] [4a] , type `', select "Validate HTML fragment" (which by default selects "Use Doctype: HTML 4.01", select "Check". [4b] [5a] [5b] [5c] -- 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 (404-comp.)