
How Browsers Work: Behind the Scenes of Modern Web Browsers - Garbage
http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/?
======
gioele
> So a lot of the parser code is fixing the HTML author mistakes.

This is probably my biggest problem with most of the ideology behind HTML 5.
You learn from past mistakes and HTML has no way to teach you anything because
there is no error-correction-test feedback cycle.

How do you learn proper HTML? You write something, you load it in a browser,
does it show properly? It was right. Does it show in a funny way? There must
be something wrong. What? Who knows. Nobody knows because you cannot, by
definition create _wrong_ HTML 5. It is just that you did not write what you
think you wrote.

There are validators you can use to validate your page. But most of the times
they will tell you that your page is wrong while it actually looks perfectly
as you wish in the browser. The browser is not complaining and the page looks
good... these validators must be too picky, a waste of time.

The problem that killed XHTML was the draconian error handling in most
browser. Only Opera had a good way to handle XHTML errors: a banner that told
you that the page had an error and which error. Under that banner the page,
rendered as best as possible. That was a good way to learn (and to tell people
that the person who wrote the site is not a pro).

~~~
RyanMcGreal
I'd argue that forgiving HTML parsing is one of the main reasons the web got
as big and broad as it did.

[http://quandyfactory.com/blog/39/the_virtue_of_forgiving_htm...](http://quandyfactory.com/blog/39/the_virtue_of_forgiving_html_parsers)

~~~
finnw
I disagree. It's also what allowed the "IE-only web" to persist for about five
years.

It might have been a good thing until about 1997, but at that point there was
no shortage of people creating new web content, and raising the barrier to
entry would have done no harm. And a lot of innovation in browser features
might have happened sooner (due to increased competition between browsers.)

~~~
RyanMcGreal
There was great competition between browsers through the 1990s. Unfortunately,
they were competing through 'value add' proprietary extensions and browser
lock-in, which is orthogonal to the issue of whether HTML parsing should be
more permissive or more draconian.

~~~
flomo
Somewhat. Microsoft reverse-engineered a lot of Netscape's rendering quirks,
as well as adding their own. Being quite liberal it what it accepted certainly
didn't hurt IE adoption. (And a lot of these things are now in black&white in
the HTML5 spec).

~~~
RyanMcGreal
Related: <http://diveintohtml5.info/past.html>

"[W]hy do we have an <img> element? Why not an <icon> element? Or an <include>
element? Why not a hyperlink with an include attribute, or some combination of
rel values? Why an <img> element? Quite simply, because Marc Andreessen
shipped one, and shipping code wins."

------
andrewthornton
This is great content, but it is so hard to read. The light blue against the
light gray is rough on the eyes, and the font size/style isn't helping either.

~~~
truncate
Here's the article at author's website
<http://taligarsiel.com/Projects/howbrowserswork1.htm>.

~~~
moonboots
"Tali published her research on her site, but we knew it deserved a larger
audience, so we've cleaned it up and republished it here."

------
Erunno
Started reading the document tripped over a statement at the beginning:

"It is important to note that Chrome, unlike most browsers, holds multiple
instances of the rendering engine - one for each tab. Each tab is a separate
process."

This is not true and has never been true to my knowledge without restricting
the statement. Chrome will open links opened in a new tab/window which point
to the same domain in the same content process and it will start mixing
different domains in the same content processes once a certain threshold is
reached (whether this is a hard-coded upper limit on how many content
processes may exist simultaneously or if this is calculated dynamically I do
not know).

------
srl
Old discussion: <http://news.ycombinator.com/item?id=2894708>

Personally, I'm happy for the repost - I was looking for this, but couldn't
find it, just yesterday.

~~~
topherjaynes
Agree, reposts help me when searching in google
site:<http://news.ycombinator.com/>

Also, it gives a chance to add to the discussion of what's been happening in
the domain in the past 181 days!

------
camtarn
A few interesting quotes about performance optimization from the article:

"Firefox blocks all scripts when there is a style sheet that is still being
loaded and parsed. Webkit blocks scripts only when they try to access certain
style properties that may be affected by unloaded style sheets."

"WebCore simply throws a global switch when any sibling selector is
encountered and disables style sharing [optimization] for the entire document
when they are present. This includes the + selector and selectors like :first-
child and :last-child."

"After parsing the style sheet, the rules are added to one of several hash
maps, according to the selector. There are maps by id, by class name, by tag
name and a general map for anything that doesn't fit into those categories."
Every element then looks in these maps to find rules which might apply to it.

------
monsterix
Great work! The guy who does photoshop job for you is simply amazing.

From a high-level view, I hope we see super-intense competition of tablet
browsers soon. Because looking at -webkit-on-iPad, I feel IE6 has just been
re-invented.

~~~
duaneb
What's so bad about webkit on the iPad? It's my favorite way to browse the
web.

~~~
monsterix
Yeah it's good when it comes to rendering neatly done content websites - i.e
consumption.

But when it comes to creating the content, such as having an email done with
browser based rich text-editing, or file-input for attachments it falls flat
on the face.

Example of a discussion: [http://answers.37signals.com/basecamp/2659-ipad-
file-uploadi...](http://answers.37signals.com/basecamp/2659-ipad-file-
uploading)

------
awt
I desperately need this in ebook format so I can read it in chunks, leave it,
come back to it, etc. [edit] Found something -- dotEPUB works great.

------
Mavrik
_sigh_ Is it too much to ask HTML5 advocates to make sure their pages render
properly on an iPad?

~~~
monsterix
And also you guys, being at that level, should insist on Apple guys to respect
web-standards for file-input on iPad Safari.

This is gonna get corny very soon.

