News for hackers. Stuff that matters.
Re:Google finally has a 404 page that isn't ugly by nathan82 on Wednesday March 02, 2011 @10:56AM (#2279949)
View the source. All the css is inlined, the images are base64 encoded, and there's no closing tag. That's one efficient 404!
Re:Google finally has a 404 page that isn't ugly by rimantas on Wednesday March 02, 2011 @11:03AM (#2279984)
Also:

  href=//www.google.com/
Title is funny :) I think they could drop margin:0; padding:0 from css, default values in browsers won't change much for this type of page anyway.
Re:Google finally has a 404 page that isn't ugly by tuxcanfly on Wednesday March 02, 2011 @11:16AM (#2280041)
`//www.google.com` will automatically translate the url to http/https depending on the requested protocol.
Re:Google finally has a 404 page that isn't ugly by Matt_Cutts on Wednesday March 02, 2011 @11:52AM (#2280175)
Yup, that way of doing it is protocol-agnostic.
Re:Google finally has a 404 page that isn't ugly by etherealG on Wednesday March 02, 2011 @11:57AM (#2280194)
is this officially accepted syntax? does it work in all browsers? (I'd really love both these answers to be yes so I can start doing this on my sites)
Re:Google finally has a 404 page that isn't ugly by shazow on Wednesday March 02, 2011 @12:02PM (#2280205)
Re:Google finally has a 404 page that isn't ugly by etherealG on Wednesday March 02, 2011 @12:09PM (#2280227)
thanks :)
Re:Google finally has a 404 page that isn't ugly by davidu on Wednesday March 02, 2011 @12:52PM (#2280417)
Which is interesting since Google doesn't serve a 404 over HTTPS as far as I can tell.
Re:Google finally has a 404 page that isn't ugly by lancefisher on Wednesday March 02, 2011 @05:53PM (#2281774)
Re:Google finally has a 404 page that isn't ugly by corin_ on Wednesday March 02, 2011 @01:47PM (#2280652)
But they're clearly doing their best to minimise file size, and so using // cuts down on a few characters.
Re:Google finally has a 404 page that isn't ugly by windsurfer on Wednesday March 02, 2011 @02:05PM (#2280728)
Well maybe they will...?
Re:Google finally has a 404 page that isn't ugly by stanleydrew on Thursday March 03, 2011 @08:03AM (#2283794)
None of the html attribute values are quoted either.
Re:Google finally has a 404 page that isn't ugly by cstuder on Wednesday March 02, 2011 @11:12AM (#2280022)
One image is inline, the other is a conventional file. I wonder why.

Oh, and it validates indeed: http://validator.w3.org/check?uri=http://www.google.com/nota...

Re:Google finally has a 404 page that isn't ugly by estel on Wednesday March 02, 2011 @11:25AM (#2280077)
The other image, the logo, is probably generic enough that it's used elsewhere and a user is likely to have it cached. The other looks bespoke for this page, so wouldn't.
Re:Google finally has a 404 page that isn't ugly by rodh on Wednesday March 02, 2011 @11:24AM (#2280071)
Maybe that logo is used elsewhere, and there's a high likelihood for that logo to be in the user's cache.
Re:Google finally has a 404 page that isn't ugly by pbhjpbhj on Wednesday March 02, 2011 @03:10PM (#2281067)
I don't understand how it validates - I'd always understood that html, head, [title] and body were required for a complete document. Certainly the draft spec at http://www.w3.org/TR/html5/semantics.html#the-html-element-0 appears to confirm this ...

Fairplay to them though, they got a semantically and structurally deficient document to validate - it's like the IE6 of webpages ;0)

Re:Google finally has a 404 page that isn't ugly by nostrademons on Wednesday March 02, 2011 @07:12PM (#2282078)
The elements are required, but the tags are implied by the tag structure of the rest of the document. They're added automatically at parse time:

http://www.w3.org/TR/html5/tokenization.html#the-before-html...

Re:Google finally has a 404 page that isn't ugly by pbhjpbhj on Thursday March 03, 2011 @09:19AM (#2284032)
That's a strange version of "required". Basically the elements are not required in a document until parse time at which point they are inserted following an extremely arduously defined algorithm.

It seems bizarre to me that you wouldn't simply define the location of meta elements strictly as being in the head but instead define that should the parser find them they should be wrapped in to a head element.

On a brief view it looks like one can just drop a meta tag, say, in anywhere in the document and the parser has to move this to the head element?

I didn't realise that they were encouraging tag soup; this isn't part of the spec I've seen before. This sort of complex parsing algo wasn't in XHTML1.X or HTML4.X was it?

Re:Google finally has a 404 page that isn't ugly by iclelland on Thursday March 03, 2011 @11:46AM (#2284681)
You can see the HTML 4.01 definitions at http://www.w3.org/TR/html401/struct/global.html#h-7.3

The complex parsing algorithm wasn't spelled out in excruciating detail, as it is in HTML5; much of it was implied, and left for the parser developers to figure out.

Strictly, the HTML, HEAD, and (BODY|FRAMESET) elements are required, in a valid document, but the tags delimiting them are optional. That way, code which manipulates the DOM can always count on a HEAD element being present, and CSS specifiers can use 'body' as a root, even if the tags themselves are missing from the source HTML file.

The first actual required tag in an HTML 4 document is <title>, as far as I know. Every HTML document has to have one, and it needs to be opened and closed explicitly. If it's the first thing in the document, it implies an <html><head> before it, and if body content comes after it, that will imply </head><body> as well.

You could put a <meta> tag anywhere before the first body content, and it would still be part of the implied HEAD element. As long as it doesn't come after the (explicit or implicit) </head> tag, it shouldn't cause the document to fail validation.

And no, none of this is valid XHTML. XHTML is always strict, and all opening and closing (or self-closing) tags must be present in the source file.

Re:Google finally has a 404 page that isn't ugly by reedlaw on Wednesday March 02, 2011 @11:12AM (#2280023)
Does every browser support base64 encoded images embedded in css?
Re:Google finally has a 404 page that isn't ugly by cstuder on Wednesday March 02, 2011 @11:16AM (#2280042)
Almost every browser. Guess which ones don't.

(I'll give you a hint: It's MSIE 6 and 7.)

Source: http://en.wikipedia.org/wiki/Data_URI_scheme#Web_browser_sup...

Re:Google finally has a 404 page that isn't ugly by beaumartinez on Wednesday March 02, 2011 @11:16AM (#2280040)
I don't think the older ones do; however, I'm sure Google gives them a different 404 page (change your User-Agent to IE6 and see how different the search results HTML is).
Re:Google finally has a 404 page that isn't ugly by joshfinnie on Wednesday March 02, 2011 @11:41AM (#2280133)
We unfortunate users of IE6 get the new 404 page as well. I assume they just gave up on IE6 like most of the web-world has.
Re:Google finally has a 404 page that isn't ugly by treeface on Wednesday March 02, 2011 @01:29PM (#2280574)
Yep here's what I see on our IE6 death machine:

http://i.imgur.com/bTXtn.png

Re:Google finally has a 404 page that isn't ugly by elliottcarlson on Wednesday March 02, 2011 @10:33PM (#2282680)
Which could be another indication why the Google logo itself is linked (besides it being in cache as well). The page degrades well imho in IE6 - the lack of the cutsey robot isn't essential to the page - the logo however is.
Re:Google finally has a 404 page that isn't ugly by kpreid on Wednesday March 02, 2011 @07:26PM (#2282117)
Base64 isn't exactly efficient. (Though it might be more efficient than an additional HTTP request. But if so, why aren't they using it for the homepage logo, say?) I wonder if they're using it as non-useless padding for stopping the IE-overrides-too-short-404s behavior.
Re:Google finally has a 404 page that isn't ugly by visural on Wednesday March 02, 2011 @08:45PM (#2282322)
Base64 is ok when the response is gzipped