On 2/6/11, jdalton <[email protected]> wrote:
> @Lasse Reichstein
>> The test checks whether the value set as innerHTML is the same as
>> the one read back afterwards. There is nothing that suggests that
>> this must be the case. The formatting of the values read from innerHTML
>> is not specified. E.g., if there is an element with multiple attributes,
>> they can come back in any order. The reason that it appears to work for
>> the other tests is probably that they are so simple that there is only
>> one format possible.
>
> Correct, the test is kept simple to keep factors like attribute order
> out of it.
>
>> In the last case, the table test, the input syntax omits the start and
>> end tags of the mandatory tbody element (the element is mandatory, the
>> tags are not).
>> Reading innerHTML back shows the element, which is almost expectable.
>>
>> I'd say that this particular test doesn't show a problem with innerHTML,
>> apart from it not being fully specified. That might be the problem that
>> some people here are having, and other people don't concider that a
>> problem.
>
> Spec states "The TBODY start tag is always required *except* when the
> table contains only one table body and no table head or foot sections.
Sure, but then the TBODY is going to be created automatically so it
will be there in the DOM.
> The TBODY end tag may always be safely omitted."
> So, in this case the test was to set the table's innerHTML without a
> TBODY element.
> In browsers that allow this, like Safari 5, Chrome 6, & Opera 9.25,
> there is no TBODY element created.
Really? I'm asking because I didn't actually test that and it
surprisese me. If the TABLE contains a TR then a TBODY must be created
implicitly. According to DOM spec.
For example in DOM 2 html
"insertRow modified in DOM Level 2
Insert a new empty row in the table. The new row is inserted
immediately before and in the same section as the current indexth row
in the table. If index is -1 or equal to the number of rows, the new
row is appended. In addition, when the table is empty the row is
inserted into a TBODY which is created and inserted into the table. "
> In other browsers like IE, Firefox, & Opera 9.5+ it creates a TBODY
> element.
That[s correct behavior.
> One group of browsers is wrong and it can cause problems for devs
> using innerHTML.
>
Sure.
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]