Markup validation of http://www.google.com(validator.w3.org)
validator.w3.org
Markup validation of http://www.google.com
http://validator.w3.org/check?uri=http://www.google.com&charset=(detect+automatically)&doctype=Inline&group=0
12 comments
Virtually all of those are "use CSS instead" or "use & instead of &".
External CSS on Google's home page would mean billions of extra HTTP requests. Adding the amp; would mean terabytes of data transfer to fix something that works just fine in all browsers.
External CSS on Google's home page would mean billions of extra HTTP requests. Adding the amp; would mean terabytes of data transfer to fix something that works just fine in all browsers.
Adding the amp; would mean terabytes of data transfer to
fix something that works just fine in all browsers.
If thats the case even more can be saved by optimizing the current version. Don't be blinded by the fact that it is Google: the code clearly shows that it is this way because nobody cares, not because it was thought out very throughly.
Point in case: <input autocomplete="off" maxlength=2048 name=q class="lst" title="Google Search"
value="" size=57 style="background:#fff;border:1px solid #ccc;border-bottom-
color:#999;border-right-color:#999;color:#000;font:18px arial,sans-serif
bold;height:25px;margin:0;padding:5px 8px 0 6px;vertical-align:top">
Could be just: <input autocomplete=off maxlength=2048 name=q class=lst title="Google Search"
size=57 style="background:#fff;border:1px solid;border-color:#ccc #999 #999
#ccc;font:18px arial,sans-serif bold;height:25px;margin:0;padding:5px 8px 0 6px;">
Even more, it could be just <input autocomplete=off maxlength=2048 name=q class=lst title="Google Search"
size=57>
because there is already .lst in CSS section, why not to specify attributes there?I read somewhere that they would rather have the page load as fast as possible on all kinds of browsers rather then have a standards compliant slow loading page.
Is my memory failing me or was there indeed the time when google.com had no DOCTYPE?
That makes perfect sense if you are not going to adhere to any standards.
I suppose the reason they have a doctype now is to force browsers into standards compliant rendering mode (it would be quirks otherwise). What baffles me why did they choose HTML5 doctype if they don't care about actually adhering to the spec. They can go with <!DOCTYPE google> and it will work just fine (any unknown doctype triggers standards compliant mode in browsers) without false claim of being compliant with some actual standard.
Ehm, they are either using obsolete tags or failed escaped the & sign. Nothing to be worried about.
How has this reached the front page :|
It seems obvious to me, but I will point it out anyway.
The Google homepage contains all sorts of 'non-conformant' code, so as it supports legacy browsers which don't implement css properly, or require some sort of quirk for them to work correctly.
The Google homepage contains all sorts of 'non-conformant' code, so as it supports legacy browsers which don't implement css properly, or require some sort of quirk for them to work correctly.
This is probably related to a really old HN post: http://news.ycombinator.com/item?id=677125
So if it's OK for Google to skip on standards, it's OK for the rest of us too. right?
It's a conscious business decision they have made, you can do whatever you want to with your business. As long as it looks right in all browser/os configurations I don't think your customers will mind.
It's OK for anyone to do anything they want with standards, you can ignore them or follow them at your pleasure.
Whether or not you decide to ignore standards - there may or may not be consequences. And if there are consequences, you still might have perfectly valid reasons for accepting those risks.
For a long time, arguably even till now, Microsoft didn't pay enough attention to web standards. They made a business decision for whatever reasons which is their perogative. One of the consequences is that they've lost a lot of browser market share. Whether that matters to them or not I don't know.
I suspect that Google balanced the benefits and harms of strict adherence to HTML and CSS standards and found that, for that page at least, it would be much worse to be anal about standards and the impact to the user, if they didn't meet the standards, would be pretty much nil.
Makes sense to me.
Whether or not you decide to ignore standards - there may or may not be consequences. And if there are consequences, you still might have perfectly valid reasons for accepting those risks.
For a long time, arguably even till now, Microsoft didn't pay enough attention to web standards. They made a business decision for whatever reasons which is their perogative. One of the consequences is that they've lost a lot of browser market share. Whether that matters to them or not I don't know.
I suspect that Google balanced the benefits and harms of strict adherence to HTML and CSS standards and found that, for that page at least, it would be much worse to be anal about standards and the impact to the user, if they didn't meet the standards, would be pretty much nil.
Makes sense to me.
Google is well aware and proud of that fact. They cut their bandwidth in half by not validating.
I was playing with jQuery in the dev console in Chrome yesterday on the Google homepage and realized that I was writing valid jQuery, but that $("body") simply didn't exist.
I was playing with jQuery in the dev console in Chrome yesterday on the Google homepage and realized that I was writing valid jQuery, but that $("body") simply didn't exist.
They cut their bandwidth in half by not validating.
Care to elaborate on this bullshit about cutting bandwidth in half? I just want to remind you that quoting attributes and leaving out some tags is perfectly valid in HTML5 and HTML4.01. Even in strict.Converting their markup to the valid one would not be difficult, and they could even save some bandwidth. For example: drop those stupid attributes for body tag. drop <html><head> - these tags are optional. Why do you waste precious bandwidth with <meta http-equiv="content-type" content="text/html; charset=UTF-8">? Your DOCTYPE claims that page is marked up in HTML5 so use it: <meta charset=UTF-8>. Drop thet method=GET from your form: it's default. Alias your document.getElementById: you repeat it 7 times what a waste. Etc., etc.
I have to imagine that Google.com is the most bandwidth optimized page EVER.
Big picture, the W3C spec is not what matters here. What matters is making the same HTML document render exactly across different browsers. So maybe they could drop <html><head> according to W3C, but does that break the document in other browsers?
My guess is that Google doesn't care about the W3C spec in this specific regard. What matters is delivering the smallest document possible that can be rendered by as many browsers as possible.
*Grammar edit.
Big picture, the W3C spec is not what matters here. What matters is making the same HTML document render exactly across different browsers. So maybe they could drop <html><head> according to W3C, but does that break the document in other browsers?
My guess is that Google doesn't care about the W3C spec in this specific regard. What matters is delivering the smallest document possible that can be rendered by as many browsers as possible.
*Grammar edit.
I have to imagine that Google.com is the most bandwidth
optimized page EVER.
Sure it is not, because I can see how it can be optimized even more — and that's just at a glance. So maybe they could drop <html><head> according to W3C, but does that
break the document in other browsers?
No it doesn't. My guess is that Google doesn't care about the W3C spec in this specific
regard.
Ok, it is their call. Anyone is allowed not to care, but why put doctype of existing standard then. Just put <!DOCTYPE foobar> or <!DOCTYPE idontcare> and be done with that.Okay, not half. But cutting down on bandwidth is their own self proclaimed reason for failing so hard at validation.
I would have expected better from google.
Google deals with a scale few understand, you should hesitate to criticize unless you've worked on similar problems.
You're unintentionally hilarious. You know nothing about Google's technological challenges nor the decisions behind the various circumstances where they chose to ignore the standard.
I guarantee you that there are thousands of people working at Google who are:
1. Smarter than you
2. Know more about web standards than you
Seriously, get the hell out of here.
I guarantee you that there are thousands of people working at Google who are:
1. Smarter than you
2. Know more about web standards than you
Seriously, get the hell out of here.
Do not think for one second someone from Google is going to see this and go, "Oh darn it, I knew I was supposed to do something before google went live."