double hyphen within comment causes comment to display, displayable text hidden

VERIFIED INVALID

Status

()

Core
HTML: Parser
--
minor
VERIFIED INVALID
14 years ago
11 years ago

People

(Reporter: richienh, Unassigned)

Tracking

Trunk
x86
Windows ME
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

14 years ago
User-Agent:       
Build Identifier: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.6) Gecko/20040113

Including two consecutive hyphens (dash, minus sign) within a comment causes the
text of the comment itself to display and otherwise displayable text to
disappear.  The behavior changes slightly if there is a second comment which
contains any text which appears to be an HTML tag (even if the tag is bogus).

Reproducible: Always
Steps to Reproduce:
1.  Here is a code fragment which shows the problem:

Here is the first way to see the problem<br>
<!-- This is a comment showing the problem of the -- double hyphen -->
<br>This text is hidden by the double hyphen bug<br>
<!-- <p>This text magically appears even though it's a comment -->

Here is a different way to see the problem<br>
<!-- A second comment showing the problem -- differently -->
<br>This text appears regardless because there's no tag in the next comment<br>
<!-- This text contains no HTML tag, hence doesn't display -->
Even a bogus tag (for example, &lt;bogus&gt;) makes a difference

Actual Results:  
Some text one expects to see is hidden.  Some text one expected to be invisible
because it occurs within a comment is displayed.

The simple workaround is to not have hyphens in sequence, either by removing the
second hyphen or by separating them with a space.

Expected Results:  
Hide all text within a comment.  Display text outside comments.
> The simple workaround is to not have hyphens in sequence

Which is what the HTML spec clearly says authors should do.  The reason is that
in HTML "--" is that character sequence that both starts and ends comments.  In
quirks mode, we treat "<!--" and "-->" as the start/end sequences, but in
standards mode, which your test pages must  be triggering, we actually do
correct comment parsing.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → INVALID

Updated

14 years ago
Status: RESOLVED → VERIFIED
*** Bug 305122 has been marked as a duplicate of this bug. ***
*** Bug 361731 has been marked as a duplicate of this bug. ***

Updated

11 years ago
Duplicate of this bug: 369780
You need to log in before you can comment on or make changes to this bug.