Bug 278111 - Firefox renders HTML comments wrong
Summary: Firefox renders HTML comments wrong
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: firefox
Version: 5.0
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
: ---
Assignee: Gecko Maintainer
QA Contact: desktop-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-09-05 09:20 UTC by Klaus Ethgen
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-10-04 13:42:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.  :-)


Note You need to log in before you can comment on or make changes to this bug.