When does tabindex="xxxx" break? - html

Assuming, xxxx is always a positive, unique number, has someone done tests on breaking tabindex. For example, is any length of number acceptable in major browsers? Is there a maximum number of elements on a page?

HTML 4.01 sets a maximum value of 32767 for the tabindex attribute. HTML5 LC and WHATWG HTML do not set such a restriction, but this appears to be an oversight, and I have proposed that it be fixed.
Browsers actually enforce the limit, though in incompatible ways. Chrome and Firefox interpret larger values as 32767 or (for very large numbers) 0, IE as negative numbers (except that 32768 is taken as 0).
There is no limit on the number of elements on a page. Neither is there any limit on the number of elements that participate in the tabbing order. You can set the order explicitly with the tabindex attribute “only” for 32767 elements. If you need more elements in the tabbing order, you need specify the rest so that they appear (in source HTML) in that order (and after elements with a positive tabindex value).

Related

Why may not the colspan attribute be set to zero?

According to the HTML5 description the attribute rowspan may have value 0. In this case the value zero means that the cell is to span all remaining cells of the given column in the row group.
However the value of colspan may not be equal to zero.
So a question arises what is the reason for such a restriction for the attribute colspan?
This is quoted from https://lists.w3.org/Archives/Public/public-html/2011Aug/0293.html but it explains the issue in detail.
In HTML4, "colspan" and "rowspan" attributes of TD/TH elements has been allowed to have zero value ("0"):
http://www.w3.org/TR/html4/struct/tables.html#adef-colspan
This is very useful when column or row number is unknown in advance.
It's harmful to force web-editors to calculate column or row number
manually while browser could easily do this automatically.
There is a known rule in spec development: when there are two
independent implementations of a specification, then the specification
status is promoted to "recommendation" ("candidate" or "proposed").
But there ARE already two (well, 1.5) working independent
implementations of zero colspan/rowspan:
Firefox (both zero colspan and rowspan are fully working)
and Opera (supports rowspan="0" and does not support colspan="0").
So, zero value of colspan/rowspan is very good candidate to keep in
HTML spec and, moreover, to encourage rest browser vendors to
implement this useful feature as soon as possible.
There are no serious reasons to remove zero values of colspan/rowspan
from the HTML specification. It's not something "unimplemented at
all", it's already quite usably implemented and should be kept intact
in the HTML spec.
Also the HTML5 spec (4.9.11) explicitly states that colspan shall be non-zero and rowspan can be zero along with what it means to be zero. http://www.w3.org/TR/html5/tabular-data.html#attr-tdth-colspan
The quick answer to why would be to say that the HTML5 spec explicitly states this restriction. IMO I see no reason why browsers wouldn't reserve the meaning of zero to act the way Firefox has implmented other than to follow specification.

Is <output for=""> used for anything?

HTML 5 introduced the output element, which has a for attribute defined as follows:
The for content attribute allows an explicit relationship to be made between the result of a calculation and the elements that represent the values that went into the calculation or that otherwise influenced the calculation. The for attribute, if specified, must contain a string consisting of an unordered set of unique space-separated tokens that are case-sensitive, each of which must have the value of an ID of an element in the same Document.
Are there any browsers or applications which use the value of this element, and if so for what? It's a neat idea but I'm not sure how it actually plays out.

Textarea: problem in Opera -- text does not get wrapped onto the next line?

I do not want the scroll bars,hence i've given overflow:hidden.
A simple text area:
<textarea cols=10 rows=2 style='overflow:hidden' ></textarea>
when opened in Opera Browser -- fails to wrap the entered text onto the next line when the entered text exceeds the column length (Text gets wrapped onto the next line in every other browser -- FF,Chrome,Safari)
from the HTML4 spec:
cols = number [CN]
This attribute specifies the visible width in average character widths. Users should be able to enter longer lines than this, so user agents should provide some means to scroll through the contents of the control when the contents extend beyond the visible area. User agents may wrap visible text lines to keep long lines visible without the need for scrolling.
there is no required there that it must wrap.
and from the HTML5 spec:
The cols attribute specifies the expected maximum number of characters per line. If the cols attribute is specified, its value must be a valid non-negative integer greater than zero. If applying the rules for parsing non-negative integers to the attribute's value results in a number greater than zero, then the element's character width is that value; otherwise, it is 20.
The user agent may use the textarea element's character width as a hint to the user as to how many characters the server prefers per line (e.g. for visual user agents by making the width of the control be that many characters). In visual renderings, the user agent should wrap the user's input in the rendering so that each line is no wider than this number of characters.
So maybe there you could be right, although I don't know how strict a "should" is in this definition.
But in both cases it's probably by design.

HTML: why isn't the input field SIZE deprecated? we have style="width:xx"!

simply put, i think that the input 'size' field is now obsolete (like the rest of html styling outside of css), and most of the sizing attributes have been deprecated, so why not input.size?
Maybe you got confused between size and width/height attributes (btw I got confused at first when you said field). But assuming you didn't, let me explain what size is for.
size attribute
The attribute size for element <input> applies to text inputs, like e-mail, password, etc. It defines the maximum character width for the input. Let's say for example you want the maximum password length to be 4 to screw the users, you give it size=4, so you cannot enter passwords like dinosaur (anything you type after dino will not appear unless you delete the previous letters first)
Edit: as pointed out by Maksym in the comments, the above is defined by maxwidth, not size. size is, if we refer to HTML4 spec,
except when type attribute has the value "text" or "password". In that case, its value refers to the (integer) number of characters.
So size=4 is about 4 (monospaced?) characters wide (My experiment with Google Chrome has makes it size+1 though, i.e. size=4 is 5 characters wide.)
Dimension attributes
Now in case of the dimension attributes width and height. For <input> elements, they apply only to image buttons. They define the dimensions of the button. Now why can't you just apply CSS to them?
First, know that CSS is for visual purposes. Image buttons submit coordinates that the user clicked on. This behavior needs to be consistent across browsers, whether they support CSS or not. See this warped image:
There may be a case where the user is asked to click the letter e for the form submit to be processed differently. Probably the server will check whether the x coordinate is 75 <= x <= 90. But if you defined the dimension with CSS, browsers which disabled CSS will see this image instead:
And the previous coordinate range check is no longer valid, seeing that the letter e is further to the right, hardly within 75 and 90 (and you need to click on the left side of the first o to get the same input).
That is a rhetorical question really... or an attempt at persuasive argument. You are right, though-- it could easily be deprecated and CSS take over. As for why, that answer can only come from someone inside W3C who is part of the decision making process. You could also ask why cellpadding, cellspacing, and width properties are not deprecated in tables.
The best answer I can give you to your non-question is that HTML isn't a purist language--while it's getting back to it's roots of being just content and not style or behavior, it still has it's legacy from the 90's and 00's, which means it still has concerns beyond just content.
There's a valid reason why this attribute isn't deprecated: "Web Usability"
When a user views your site, considering the CSS is turned of or unavailable, it's really a bad idea to let the person see a long field while in fact, the field only requires a few characters (such as ids, phone numbers, etc.).
CSS is good, yes, but only if you also considered people who won't be able to use them.

Start a list from a certain number

What's the best way to get a ol to start from 'x'?
The start tag is deprecated and everything I have found on Google has used the :before pseudo class which doesn't work in IE6 or 7. Didn't have much luck when searching stack either.
Only thing I can think of is manually go through and number the lists myself and style accordingly?
Any help appreciated.
While the start attribute in HTML 4 is indeed deprecated, looking at the HTML 5 docs, I see:
The start attribute, if present, must be a valid integer giving the ordinal value of the first list item.
If the start attribute is present, user agents must parse it as an integer, in order to determine the attribute's value. The default value, used if the attribute is missing or if the value cannot be converted to a number according to the referenced algorithm, is 1 if the element has no reversed attribute, and is the number of child li elements otherwise.
The first item in the list has the ordinal value given by the ol element's start attribute, unless that li element has a value attribute with a value that can be successfully parsed, in which case it has the ordinal value given by that value attribute.
which tells me I am safe using start with ol and value with li elements.
With ordered lists ol, you could use the various counter CSS instructions: Examples here. But, they also won't work with IE6 and 7. I don't think there is a non-Javascript way to make this work in them.