Closed Bug 305534 (html_end_tags_prob) Opened 19 years ago Closed 19 years ago

HTML comment end tags end not rendering properly

Categories

(Core :: DOM: HTML Parser, defect)

1.7 Branch
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: robert.birkline, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

This problem was found when commenting out several section of html code which
envolved a hyphenated class name.

Affected both windows and linux version of firefox.

The --> html end comment was displayed on the screen after rendering a double
hyphenated class name.  After viewing the rendered source code firefox was
seeing a premature end of the comment.  View the sample below.


Reproducible: Always

Steps to Reproduce:
You can use the following sample code:

<!-- TEMPORARILY COMMENTED OUT DUE TO SERVER RELOCATION - DEH 8/21/05 -->
<!--
                      <td valign="top" class="shopping-content-header">SEARCH
SHOPPING <a href="javascript:;" onClick="MM_openBrWindow('scripts/sear
ch_tips.html','popup','width=300,height=275')"><img
src="http://images.chron.com/class/images/shopping/questionmark.gif" width="17"
height="17" border
="0" align="absmiddle"></a></td>
-->

Actual Results:  
--> will be displayed on the screen.  The browser see the 2 hyphens in the class
name as an end comment and end the commnet showing the additional html code
including the -->.

Expected Results:  
All comments to be not displayed on the screen.


Conclusion:
-----------------
After reviewing the code it appears that firefox interpreted the following code
as an end tag. 

class="shopping-content-header">

As you can see there is 2 hyphens and a greater than sign.  It appears that
firefox is using a regex similar to /\-.*\-.*>/ that would cause the above code
to be evaluated as a end comment tag. This caused the browser to display the -->
because firefox already ended the comment.
Alias: html_end_tags_prob
I can't see it in your code (can you provide an example URL ?), but similar bugs
have been reeported before, like bug 290070. Are you sure there wasn't a "--"
pattern (a double one) somewhere ?

See <http://www.w3.org/TR/html401/intro/sgmltut.html#idx-HTML>
Component: General → HTML: Parser
Product: Firefox → Core
Summary: HTML comment end tags end not redering properly → HTML comment end tags end not rendering properly
Version: unspecified → 1.7 Branch
Attached file example comment #0
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b4) Gecko/20050822
Firefox/1.0+ ID:2005082212

WFM
Technically per the spec there should be no '-' characters allowed in comment's
(as in not without potential trouble).

Since this bug is filed against 1.7; and Given that this has been fixed since
Gecko 1.7 branched, and given that it will not be fixed on the current 1.7
branch; I will mark this bug WONTFIX; CC-ing a parser peer to "Verify" that
wontfix (or recind it)
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → WONTFIX
Reopening to mark WFM.
Status: RESOLVED → UNCONFIRMED
Resolution: WONTFIX → ---
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: