- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Bullshit. HTML pages are not formal systems. They're turing-complete machines with a well-defined output for every case.
Admin
for syntactically valid pages at least. fortunately it's proven that the validator will always halt so if you refuse to render on invalid input you will always halt.
that is of course discarding javascript.... ;-)
Admin
Admin
No, I'd say 'Give Up' is acceptable in some cases. Think infinite recursion; you'd rather have the browser give up and produce something rather than hang trying to render something it can't ever finish.
Admin
If you're triggering infinite recursion rendering HTML you have bigger problems than infinite recursion.
Admin
Still, there's some number between 158 and infinity where it's better for the browser to give up than to appear to hang.
Admin
How about one kilo/kibitag?
Admin
Today's hardware should be able to handle a megatag or two, no problem...
Admin
Actually, HTML is described by a formal standard that specifies how well-formed documents will be constructed. The proper term isn't "give up" for this combination, it's that "rendering behavior for a malformed document is undefined". That is, it is left to the browser builder to decide how the HTML rendering proceeds for a malformed document.
But HTML itself--sans CSS3 and scripts--is not Turing complete. So if rendering does not complete, for any given pure-HTML document, I would interpret that as a browser bug.
According to a Stack Overflow article, this combination is Turing complete. This presents two big problems for the browser implementer:
So there's no way the browser implementer can guarantee an HTML+CSS3 document will complete rendering unless they just whack it at some point. This would be a deliberate "give up," to protect the browser.
And then if we add JavaScript to the equation...which can rewrite CSS3 on the fly...as well as add its own problems...whoa...!
Edit: After I wrote all that, I discovered I should have read the footnotes on the Stack Overflow article. (The one that starts "93 BRILLIANT".) CSS3 does one iteration for each click of the mouse, so it is not Turing complete. Finks. So that just leaves JavaScript to, "Make the browser's day."
Admin
But it shouldn't give up after rendering 158 nested tags with no CSS.
Admin
how about giving up at 159 nested tags, then?
Admin
Tags take memory (child-parent structure). AFAIK, the HTML standard does not specify how many nested tags have to be handled, so I'd expect the browser to legitimately control its own limit. 25 tags is probably reeediculous, but 150? The document creator needs to find something to do in this life besides nest tags.
Admin
So it's OK for Firefox to throw the towel in when other browsers handle it fine?
Admin
The HTML reference should be amended to specify that 64 nested tags ought to be enough for anyone...
Admin
You're the one actually using Firefox: why would I care what your browser fails to render?
Admin
So it's OK for chairs to be rated for 250 pounds when some executive chairs are rated for 500? So it's OK for some cars to max out at 110, when some cars can go 280?
Admin
Executives are really heavy.
Admin
Sorry, I thought I was on a site where we expose stupid software for what it really is, when clearly we are all so accepting of things that are so obviously wrong and stupid.
Admin
You're really on a site where everyone's trolling. The software discussion is to give us something to troll about. :trolleybus:
Admin
This sounds like something somebody else would say, but I can't quite place it...
Admin
What it should do is display "The developer is an idiot and all other browsers are enablers." And then just display the raw code.
Admin
The point I'm making is that I don't really think it's wrong to give up at 158 tags, to defend your system from a failure.
Take a document having 10,000 nested tags. Which is more correct: The browser that gives up after 200 tags, or the browser that fails outright with an OS exception due to out of memory?
Given the choice, I think it is reasonable in the absence of guidance from the standard, to impose some limit. So Firefox chose 158 and two other browsers handle 250...meh.
Looking at it from the document perspective, I can't see any rational reason for the document creator to use 150 nested tags. For what exactly? Even if you apply attributes one at a time, there's font and color and background-color and line-height and ...what is that, maybe 30 tags? WTF kind of document legitimately needs 150 tags nested?
So the document creator is just being an idiot, or maybe an butthole, and wasting his life making tags--or maybe he's using an HTML generator that has the design quality of a tinker toy castle.
150 is well beyond what I would expect any reasonablly designed document to need, so again...meh!
Admin
What if the document has 800,000,000,000,301 nested tags?
Admin
Well, in that case, PhloxBrowser turns into a black hole on your desktop. :smile:
Admin
Clearly I'm the only one who thinks rendering a valid HTML file in full isn't crazy.
Admin
So you should build a proper browser. The guy who created the document in the article needs your browser!
Admin
In truth, I've been considering switching for some time now…
Admin
Out of interest, what's the most deeply nested html document you've had cause to look at in the recent past?
Admin
Absolutely no clue; the most recent docs I've looked at have been partial Razor views.
Admin
http://www.bilfinger.com/fileadmin/corporate_webseite/Magazin/2-13_Miteinander/lightbox/bil_13-2_magazin-lightbox_22_1.jpg
Admin
That's not true :smile:
There probably should be a limit, but at the same time, the browser definitely shouldn't just "give up" - there should be some kind of indication - and the limit should be extraordinarily high to accommodate for people doing stupid things exactly like that.
Admin
:headdesk: Trust that my point is made best by someone else… :smirk:
Admin
Like, say, 157?
Admin
No, like the highest the browser can feasibly handle without projectile vomiting all over the everything
Admin
I don't know, the highest I can count with my fingers is 10, and 157 is over an order of magnitude larger than that...
Admin
Correct
Admin
/me bounces and claps for joy
Admin
Welcome to the Chrome side. Have a :cookie:. @Yamikuronue should be able to provide some :cupcake:s too
Admin
I haven't switched yet… :stuck_out_tongue:
Admin
Preemptive welcome then.
Admin
Admin
Set it lower than that. Really. If it can't be done in 30 nested tags, should it be done at all? (Also, running close to the limit is a great way to go over the limit by accident.)
Admin
i never said it would be good at its job. :-P
Admin
Quit ki
bilotzing.Admin
The quote in your post goes up to 17 in Discourse. So... well.
Admin
So my point still stands. :smiley:
Admin
Opening this does not work fine in IE ... test2.html (254.0 KB)
Admin
Now, one way they could have implemented that limit would have been a UA CSS rule * * * /* etc. */ * * * { display: none !important; }. Since now it's just rendering HTML and CSS, does that make it any less of a UA?
Admin