|
Posted by Michael Winter on 08/28/06 16:15
Eric B. Bednarz wrote:
> I can say offhand that IE lte 6 has a problem with list elements
> seperated by whitespace if they contain child elements with the
> display property changed from inline to block,
That's the most intrusive example that I recall as well, yet it's easily
fixed using only CSS. There's no need to alter the markup.
> and I've seen whitespace related problems regarding tables the other
> month in a dutch newsgroup.
Nothing comes to mind here, but I don't style tables that often, anyway.
[MLW:]
>> If a script depends upon an exact, node-for-node representation of
>> the document tree, it's probably not very robust. There's certainly
>> no need to use whitespace nodes as an excuse for munging markup:
>> use a loop to traverse siblings in the document tree and test the
>> node type (watch out for IE5.x and comment nodes).
>
> If I wanted to write a library, yes. :->
A library is hardly necessary: one or two functions would do. One might
even have the option of using the DOM traversal methods.
> If I know how the markup is generated, I don't see a real benefit in
> the overhead of using a loop ...
If the markup was easier to read, write, and generally maintain, I'd
argue that the overhead would be worth it. I doubt the overhead would be
that extreme, anyway[1], so it shouldn't be a factor even for
time-critical code.
> I would agree that this is quite case-dependent, though.
Quite. It was the phrase "the best way of formatting" in relation to
HTML that was my main objection (though obviously my personal dislike
was also a factor :-) ).
> [markup formatting a la <http://www.w3.org/2000/08/lb2/>]
[snip]
> ... it's not a new idea ...
I realise that, but it doesn't make it any more palatable.
It might be necessary in some situations (to add to your list: some uses
of standalone XML), but it isn't in HTML.
[snip]
> FWIW, I even find it very readable. ...
It probably is once one becomes accustomed to it. I can read it as well.
But, given the choice, I wouldn't.
Mike
[1] On a Web forum, someone asked how to improve the performance of a
DOM traversal function on Pocket PCs. He hadn't profiled the code, and
the bottleneck was actually in creating and inserting additional elements.
Even on a resource-strapped mobile device, traversal over a thousand
nodes should take less than a second (assuming that part of his
benchmark /was/ accurate), far in excess of what should be necessary.
[Back to original message]
|