Re: [css-flexbox] Edits to testsuite have broken some submitted tests

On Thu, May 22, 2014 at 10:10 AM, Daniel Holbert <dholbert@mozilla.com> wrote:
> The problem is that there's a <!-- --> comment in the <style> block,
> which is interpreted as a comment in XHTML but apparently not in HTML,
> and it neuters some style in the converted-to-HTML version.

Yeah, in HTML the contents of <style> are automatically CDATA and
passed through to the CSS parser literally.  The CSS parser accepts
and ignores the top-level <!-- token, but the text following that
starts up a selector that continues up to and including the
.centerparent selector of the following rule.

It's usually a good pattern to manually declare <style> as CDATA in
XHTML, which would have the same behavior, but as long as no >
combinators are used or any other troublesome characters in strings,
it's not necessary, so HTML comments work, since I think only the text
node children of the <style> block get sent through to the CSS parser.

~TJ

Received on Thursday, 22 May 2014 07:39:14 UTC