Bug 278111

Summary: Firefox renders HTML comments wrong
Product: Red Hat Enterprise Linux 5 Reporter: Klaus Ethgen <Klaus+rhbz>
Component: firefoxAssignee: Gecko Maintainer <gecko-bugs-nobody>
Status: CLOSED NOTABUG QA Contact: desktop-bugs <desktop-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 5.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-04 13:42:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Klaus Ethgen 2007-09-05 09:20:17 UTC
This problem seems to be a upstream problem.

If there are ,,--'' inside of a HTML comment of a web page the rendering engine 
gets completely wrong. There are not always the same visible effects but mostly 
rendering failures.

See the example HTML page and compare the output of firefox with other graphical
browsers or with the expected result.

--- SNIP ---
<html>
   <head>
      <title>Testpage</title>
   </head>
   <body>
      Test4
      <h1>Test1<h1>
<!-- ---++%SPACEOUT{"Fail"}% -->
<p>
Test3
<h1>Test2</h1>
</body>
</html>
--- SNAP ---

Comment 1 Klaus Ethgen 2007-09-05 09:32:48 UTC
I made a mistake in the code. Use this to reproduce the bug:
--- SNIP ---
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
   <head>
      <title>Testpage</title>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
   </head>
   <body>
      <h1>Test1</h1>
      <!-- ---++%SPACEOUT{"Fail"}% -->
   </body>
</html>
--- SNAP ---

Comment 2 Christopher Aillon 2007-10-04 13:42:01 UTC
See https://bugzilla.mozilla.org/show_bug.cgi?id=214476 for a detailed explanation.

Firefox is actually correct here.  The comment delimiter is actually -- per
SGML.  Your markup has three double-dash sequences:

<!-- ---++%SPACEOUT{"Fail"}% -->
  -- --                      --
    ^  ^^^^^^^^^^^^^^^^^^^^^^

The first -- opens the comment, and there is a space commented out.  But then
you close it out with the next two dashes, so the rest is displayed.  Finally,
you close the comment again with the last two dashes and anything you would add
after that would be commented.

Bottom line is, Firefox is following the spec.  If the HTML is intended to be
commented, then it is wrong.  :-)