Closed Bug 79492 Opened 23 years ago Closed 23 years ago

HTML <title> handles non-entity ampersands differently than body

Categories

(Core :: DOM: HTML Parser, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: Ventifus, Assigned: harishd)

References

()

Details

(Keywords: testcase, Whiteboard: [fix in hand])

Attachments

(3 files)

Ampersands immediatly followed by text are ignored up to the next occuring
space. This results in strings like 'PG&E' to render as 'PG'. This is also true
of things which look like entities, but aren't, such as &bogusent;. This is
different than the behavior on the page, which renders the text exactly as
written if it can't identify that text as an entity.

Will attach testcase.

Mozilla 0.9
Bizarre. Bugzilla keeps saying it can't find my file, or it is empty. In any
event, here's the testcase:

<html><head>
<title>PG&E &E: &e. &e; &&e &&e;</title>
<!-- will render as 'PG . & & -->
</head><body>
<p>Title should look like this:</p>
<p>PG&E &E: &e. &e; &&e &&e;</p>
<!-- will render as 'PG&E &E: &e. &e; &&e &&e;' -->
</body>
--> parser
Assignee: karnaze → harishd
Component: Layout → Parser
QA Contact: petersen → bsharma
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9.2
*** Bug 80491 has been marked as a duplicate of this bug. ***
Here is another case:

<html>
<body>
<textarea>PG&E</textarea>
</body>
</html>

This ought to be fixed.
Attached patch Patch v1.2Splinter Review
Whiteboard: [fix in hand]
Required changes:
1) The line:
+              theNode->mSkippedContent->AppendWithConversion('&');
should be replaced with:
+              theNode->mSkippedContent->Append(PRUnichar('&'));
2) What about the trailing semicolon (if one exists)?

After these changes are made, r/sr=vidur.
The trailing semicolon is a part of the string value stored in EntityToken. So, 
there is no need explicitly include one.
*** Bug 84712 has been marked as a duplicate of this bug. ***
Keywords: approval, patch, review
Are you sure you're not trying to expand entities twice by mistake?
This is why I filed bug 84712: the URL data:text/html,<title>&amp;amp;amp;</title>
displays &amp; instead of &amp;amp;.
a= asa@mozilla.org for checkin to the trunk.
(on behalf of drivers)
Blocks: 83989
Fix is in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Verified on
build: 2001-06-20-04-Trunk
platform: Win NT

The title displays fine.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: