pedantic filter should prevent inlining CSS into the body #1153
Comments
I'm not sure what you're asking. Can you give an example of a page with this problem, showing what it looked like originally and what it looked like after PageSpeed modified it? |
Example: <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 |
My understanding had been that elements in were also forbidden by validation – does the original page validate? |
The pedantic filter inserts some things that are required by html4 but not html5. So we might need a pedantic5 filter for this case. |
Original page with that kind of |
…enabled. This is to maintain w3c validation of page. Bug fix apache#1153
Automatic CSS inlining leaves
<style>
tag inside<body>
, making the pages invalid.The text was updated successfully, but these errors were encountered: