Skip to content
This repository has been archived by the owner on Nov 23, 2018. It is now read-only.

Use conditional comment for IEMobile-specific meta tag that doesn't validate #109

Closed
wants to merge 1 commit into from
Closed

Conversation

Trott
Copy link

@Trott Trott commented Mar 29, 2012

index.html is not valid HTML5 because a value of cleartype is not permitted for the http-equiv attribute in <meta http-equiv="cleartype">. (Either that or http://www.w3.org/TR/html5/semantics.html#attr-meta-http-equiv is out of date, which I suppose is entirely possible since it's a work-in-progress and all that.)

Assuming I'm not completely off base here and that producing valid HTML5 is important to the project, perhaps an acceptable solution is to enclose that invalid markup in a conditional comment like I've done here.

The comments around the invalid markup already indicate that it's for Mobile IE.

I believe the conditional comments are only supported on Windows Phone 7 and later, so I guess earlier phones will have to deal without the smoother typefaces. (I'm OK with that personally, but Windows Phones before Windows Phone 7 constitutes a vanishingly small portion of traffic to my sites.)

@Trott
Copy link
Author

Trott commented Mar 29, 2012

Hmm...is this just validation-for-validation's-sake and I should close this pull request?

@Trott
Copy link
Author

Trott commented Apr 1, 2012

Sheesh, nobody's even going to comment? Harumph! OK, well, since I'm not even sure this makes sense to do, I'm just going to quietly close this pull request.

@Trott Trott closed this Apr 1, 2012
@alexgibson
Copy link
Member

@Trott - please feel free to leave this open. Sorry no one commented yet, but it does not mean this has gone un-noticed and will not be looked into :)

@Trott
Copy link
Author

Trott commented Apr 2, 2012

Thanks! I'm not so sure it was a good idea anyway, especially coming across a persuasive Paul Irish comment or three in a forum somewhere about the limits of the value of validation. And it was a one-liner pull-request anyway.

@barraponto
Copy link

I got here from a Drupal issue since H5BP is somewhat of a reference for proper HTML5 implementation. I believe it should strive for validation, since everyone is learning from this project.

@JohnAlbin
Copy link

I'm also coming from a Drupal issue. :-) http://drupal.org/node/1468582 But have the opposite opinion. Validation for validation's sake, as Paul Irish says, is silly. We know that this tag is ignored by browsers that don't understand it. And we know that it is validly written for IE. Adding extra code weight of a conditional comment is superfluous.

@barraponto
Copy link

I guess @JohnAlbin means http://drupal.org/node/1717090, which is a spin off of the mentioned issue and is specific to what we're dealing here. There is a claim that the Netherlands require W3C validation for governmental projects (see http://drupal.org/node/1717090#comment-6366038) and that IE10 will drop conditional comments (see http://blogs.msdn.com/b/ie/archive/2011/07/06/html5-parsing-in-ie10.aspx).

@Shoplifter
Copy link

I don't think, it's just validation-for-validation's-sake. Validation errors give a hint that you are wasting unnecessary bytes for standard compliant browsers. Admittedly not many, but I've seen optimizations less 'micro'. So my first try would be to handle that issue same way as hbp5 did with the X-UA-Compatible meta tag (move it to .htaccess or whatever server config file else is used). Unfortunately I don't have a win phone available to test this, anybody help me out?

<IfModule mod_headers.c>
    Header set X-UA-Compatible "IE=Edge,chrome=1"
    Header set cleartype "on"
  <FilesMatch "\.(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svg|svgz|ttf|vcf|webm|webp|woff|xml|xpi)$">
    Header unset X-UA-Compatible
    Header unset cleartype
  </FilesMatch>
</IfModule>

My second-best option - if that dousn't work out - would be to drop that cleartype thing totally. Users can turn it on/off on their device deliberately, so why overrule them? If they dont, tey're obviously happy with their defaults anyway.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants