Newer browsers less strict?

Please compose all posts in Emacs.

Moderators: phlip, Moderators General, Prelates

Newer browsers less strict?

Postby Anonymously Famous » Sat Aug 13, 2011 7:42 pm UTC

Some background:
I work in a translation company. We were asked by a client to take a look at the Spanish version of their website, for linguistic errors and such, and get back to them.

What we found was this: Some of the words with accented characters such as "más" (more) displayed as "m&aacutes" in Firefox 3.6. They got back to the client, who couldn't see the problem. It turns out that in Firefox 5 and Chrome, it displays the word as intended. We later advised the client to either go through and put the missing semicolon on the entity or just use the character itself.

So my question is this: Is this sort of smart correcting good or bad? I know that browsers have to be somewhat robust, that people don't always write well-formed HTML, but some things are clearly errors. What sorts of things should the browser pick up on?
Anonymously Famous
 
Posts: 240
Joined: Thu Nov 18, 2010 4:01 am UTC

Re: Newer browsers less strict?

Postby Xanthir » Sun Aug 14, 2011 7:33 am UTC

What's important, more than anything else, is that every browser corrects things in the same way. These days, modulo an occasional bug (which you should report), they do. So don't worry about the details too much, just be happy that HTML5 reverse-engineered everybody and set down a single true way to do all of this.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))
User avatar
Xanthir
My HERO!!!
 
Posts: 4022
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex

Re: Newer browsers less strict?

Postby Anonymously Famous » Sun Aug 14, 2011 2:27 pm UTC

Xanthir wrote:What's important, more than anything else, is that every browser corrects things in the same way.

This would be true, but they don't. The browser that it didn't work on was Firefox 3.6. A month ago or so, that was the most up-to-date browser there was.
Anonymously Famous
 
Posts: 240
Joined: Thu Nov 18, 2010 4:01 am UTC

Re: Newer browsers less strict?

Postby Xanthir » Sun Aug 14, 2011 5:28 pm UTC

Reread my statement. I'm talking about modern browsers. Firefox 3.6 does not use the HTML5 parser by default (it's there, but you have to turn it on with a pref).

Almost every behavior in the HTML5 parser is there because at least one browser (usually IE) was already doing it. (Occasionally, every browser did something different and they were all stupid, so it wasn't too bad to make up a new behavior that was sane.)
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))
User avatar
Xanthir
My HERO!!!
 
Posts: 4022
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex

Re: Newer browsers less strict?

Postby Anonymously Famous » Sun Aug 14, 2011 10:35 pm UTC

In an ideal world, you may be right. I know a lot of people who do not use "modern" browsers.

And I'm fine with HTML5. The missing semicolon is not HTML5 compliant, though. It's just incorrect HTML. I'm not just talking about the web entity, either. I'm talking about missing end tags, etc. that parsers have to "guess" at. Is it, or has it been, really beneficial in the long run to be forgiving of these errors?
Anonymously Famous
 
Posts: 240
Joined: Thu Nov 18, 2010 4:01 am UTC

Re: Newer browsers less strict?

Postby Xanthir » Mon Aug 15, 2011 3:28 am UTC

It doesn't matter if it's beneficial in the long run. It's necessary to correctly display large amounts of content on the web. Every once in a while we find some detail that isn't necessary for web compat and fix it to be sane, but otherwise all the weirdness of modern browsers is intentional and we're stuck with it.

That said, definitely tell you clients to stop fucking around and just input the entities correctly, or use actual unicode characters. What they're doing is indeed invalid, even if HTML specifies exactly how browsers are supposed to handle it.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))
User avatar
Xanthir
My HERO!!!
 
Posts: 4022
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex

Re: Newer browsers less strict?

Postby Goplat » Mon Aug 15, 2011 4:57 pm UTC

Xanthir wrote:It doesn't matter if it's beneficial in the long run. It's necessary to correctly display large amounts of content on the web.
Having a bunch of "&amp"s everywhere doesn't prevent people from using a site, it just makes the site look as unprofessional as it actually is. When a page is doing something obviously wrong, like using unterminated character entities, then it should look wrong.
Goplat
 
Posts: 490
Joined: Sun Mar 04, 2007 11:41 pm UTC

Re: Newer browsers less strict?

Postby Xanthir » Tue Aug 16, 2011 12:12 am UTC

Your disapproval means little to the browser vendors, who are motivated by market forces to display pages as close to the author's intent as possible.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))
User avatar
Xanthir
My HERO!!!
 
Posts: 4022
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex

Re: Newer browsers less strict?

Postby Yakk » Tue Aug 16, 2011 12:50 am UTC

Be strict in what you produce and generous in what you accept.
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.
User avatar
Yakk
 
Posts: 10064
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: Newer browsers less strict?

Postby Goplat » Tue Aug 16, 2011 5:37 pm UTC

Yakk wrote:Be strict in what you produce and generous in what you accept.
I'd say this principle is a failure in practice. The few people who write browsers followed this principle, but each had their own idea of how to be generous. The masses of website authors knew nothing of the HTML standard or this principle, so each just did whatever works in his own preferred browser. The inevitable result was lots of sites that look right only in some browsers and not in others.
Goplat
 
Posts: 490
Joined: Sun Mar 04, 2007 11:41 pm UTC

Re: Newer browsers less strict?

Postby Yakk » Tue Aug 16, 2011 5:38 pm UTC

Yep. So now html5 specifies exactly how to be generous. :)
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.
User avatar
Yakk
 
Posts: 10064
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove


Return to Religious Wars

Who is online

Users browsing this forum: Bakstoola and 0 guests