W3C home > Mailing lists > Public > www-validator-cvs@w3.org > February 2013

[Bug 20846] New: For XHTML5: Warn for comments inside <style/> or <script/>

From: <bugzilla@jessica.w3.org>
Date: Fri, 01 Feb 2013 14:39:16 +0000
To: www-validator-cvs@w3.org
Message-ID: <bug-20846-169@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=20846

            Bug ID: 20846
           Summary: For XHTML5: Warn for comments inside <style/> or
                    <script/>
    Classification: Unclassified
           Product: Validator (Nu)
           Version: unspecified
          Hardware: PC
               URL: http://tinyurl.com/as4k9y3
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: General
          Assignee: mike+validator@w3.org
          Reporter: xn--mlform-iua@xn--mlform-iua.no
        QA Contact: www-validator-cvs@w3.org

ISSUE:    Situation:
       1. Authors/generators sometimes do
          <style type="text/css"><!--/*HTML comment start*/
          body{background:yellow}
          -/*HTML comment end*/--></style>
       2. This is useless but harmless in text/html since
          the HTML parser does not treat them as comments
          when they occur inside <style> or <script>
       3. But in XML, the comments *do* have effect, 
          and the above example would thus not be 
          styled and could, in fact, even be deleted
          by XML parsers

SOLUTION:

          EITHER: only warn when the first non-white-space
                  character is a comment and that comment
                  spans the entire element.
   OR EVENTUALLY: take a more drastic step and always
                  warn whenever comments occurs inside
                  <style> or <script>.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Friday, 1 February 2013 14:39:18 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:54 UTC