pedantic filter should prevent inlining CSS into the body #1153
<body> <p>blablabla</p> <link rel="stylesheet" property="stylesheet" href="https://something/whatever.css" /> </body>
will be modified to
<body> <p>blablabla</p> <style property="stylesheet"> // Something </style> </body>
I think you just don't know what "valid" means. "Valid" here means passing the W3C validator.
Inlining CSS has substantial benefits to web-site latency which is the main goal of PageSpeed. In some cases, W3C validators flag constructs that are supported by all browsers, and PageSpeed has a choice as to whether to optimize for the validator or optimize for the end-user. By default, PageSpeed has prefers optimizing for the end-user.
PageSpeed also has a 'pedantic' filter which, if specified, ought to avoid having PageSpeed introduce new validator violations in the page. However, it probably doesn't cover this case, and that's a bug.
You probably want to turn the pedantic filter when running validators. So when you type your URL into w3c validation tool, you can append:
And having said that, I believe this case is not covered by the 'pedantic' filter, and I'm wording this bug title to reflect that.
Old title: CSS embedment makes pages invalid
…enabled. This is to maintain w3c validation of page. Bug fix apache#1153