Closed Bug 516666 Opened 15 years ago Closed 15 years ago

html comments are displayed

Categories

(Core :: DOM: HTML Parser, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 214476

People

(Reporter: jbjorkman, Unassigned)

References

()

Details

Attachments

(5 files)

User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 3.5.21022; .NET CLR 3.5.30428; .NET CLR 3.5.30729; .NET CLR 4.0.20506; .NET CLR 3.0.30729; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; sv-SE; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3

The ASP.NET page contains the following code:

<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
  <!-- 
  ==================================================================
  System     : ddress.se
  Filnamn    : Default.aspx
  Skapad av  : Jörgen Björkman
  Beskrivning: Startsida för DDress.se
  ==================================================================
  Version Datum      Sign Notering
  ------- ---------- ---- ------------------------------------------
  1.00.00 2009-08-17 JB   Skapad
  1.00.00 2009-08-25 JB   Kompletterat artikellänkar
                          Lagt till bildspel
  1.00.01 2009-09-10 JB   Aspect Ratio på bildspelet är fel, bilderna
                          är för breda. Ändrat colspan från 3 till 2
-->
 <title>Diamond Dresses</title>
</asp:Content>

the html comment is displayed by the parser, it should not be.

Reproducible: Always

Steps to Reproduce:
1. create a webpage that contains html comments.
2. open the webpage in Firefox
3.
Actual Results:  
The following text is displayed:

  <!-- 
  ==================================================================
  System     : ddress.se
  Filnamn    : Default.aspx
  Skapad av  : Jörgen Björkman
  Beskrivning: Startsida för DDress.se
  ==================================================================
  Version Datum      Sign Notering
  ------- ---------- ---- ------------------------------------------
  1.00.00 2009-08-17 JB   Skapad
  1.00.00 2009-08-25 JB   Kompletterat artikellänkar
                          Lagt till bildspel
  1.00.01 2009-09-10 JB   Aspect Ratio på bildspelet är fel, bilderna
                          är för breda. Ändrat colspan från 3 till 2
-->

Expected Results:  
The html comments should not be displayed. The Html parser should filter out html comments.

Compare the page www.ddress.se as it is displayed in Firefox 3.5.3 and Internet Explorer 8.
A Printscreen of the webpage as displayed in Firefox 3.5.3
A printscreen of the webpage as displayed in Internet Explorer 8 for comparison.
Attachment #400710 - Attachment description: A Printsreen of the page displayed in Firefox 3.5.3 → A Printscreen of the page displayed in Firefox 3.5.3
The HTML5 parser fixes this.
Status: UNCONFIRMED → NEW
Depends on: html5-parsing
Ever confirmed: true
In HTML 4, this bug is invalid. See <http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4>. You can not use -- inside a comment, due to the strict SGML rules. Just try a HTML validator, you will see an error.

In HTML 5, this part will be relaxed because so many people make the same mistake (and the SGML rules are a bit silly IMHO), see <http://dev.w3.org/html5/spec/Overview.html#comments>.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
No longer depends on: html5-parsing
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: