Closed Bug 321472 Opened 19 years ago Closed 19 years ago

doctype strict comment parsing problem

Categories

(Core :: DOM: HTML Parser, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 214476

People

(Reporter: ski, Assigned: mrbkap)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051224 Firefox/1.6a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051224 Firefox/1.6a1

NOTE: I belive this should be filed in layout, but that option is unavailable??

The problem exists when a comment has the characters '--' in it.

For example, <!-- Yk2--B_345 -->

My guess from perusing the spec is that this is an attempt to work around scripts and CSS embedded in HTML comments (illegal in XHTML strict) by saying "if -- exists in the block, it is not a comment"? If that is indeed the case may I suggest checking to make sure there is a <script> or <style> block in the comment before deciding to render this content.

Removing the doctype eliminates the problem.

Tested on ffox 1.6a as of 12/24/2005 and ffox 1.5 on winXP.


Reproducible: Always

Steps to Reproduce:
1. Make an HTML comment with the characters -- in it
2. Set doctype to XHTML/Strict
3. Render.

Actual Results:  
Full comment text including start and end of comment tags (<!-- and -->) is displayed.

Expected Results:  
Hide the comment.
Would have been clearer if that first sentence said:

The problem exists when a comment has the characters '--' in it AND doctype is XHTML strict.

As it is now you don't realize it's related to XHTML strict parsing until much later. Sorry for the confusion.
Assignee: jag → mrbkap
Component: XP Apps → HTML: Parser
Product: Mozilla Application Suite → Core
QA Contact: parser
Version: unspecified → Trunk
-- inside a comment is invalid ! See http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4

*** This bug has been marked as a duplicate of 214476 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.