Closed Bug 209485 Opened 22 years ago Closed 22 years ago

[FIX]View source eats parts of CDATA sections when ']' encountered

Categories

(Core Graveyard :: View Source, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.5alpha

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(1 file)

Typical XBL markup: <constructor> <![CDATA[ var foo = Components.classes["contractfoo"]; var bar = 5; ]]> </constructor> When one views the source, everything between the first ']' and the ending '>' is dropped, due to the patch that was checked in for bug 130045.
Attached patch Proposed changeSplinter Review
This does not make things completely correct, but it should fix the 99% case for scripts in XML... To do this completely correctly, view-source would need to use a real XML tokenizer for XML content.
Attachment #125702 - Attachment filename: &#29696;&#25856;&#29440;&#29696;&#11776;&#28672;&#24832;&#29696;&#25344;&#26624; → test.patch
Attachment #125702 - Flags: superreview?(heikki)
Attachment #125702 - Flags: review?(harishd)
Priority: -- → P2
Summary: View source eats parts of CDATA sections when ']' encountered → [FIX]View source eats parts of CDATA sections when ']' encountered
Target Milestone: --- → mozilla1.5alpha
Just pointing out another reason to use an XML parser: view-source: doesn't handle extended doctypes properly e.g. <!DOCTYPE bindings [ <!ENTITY % tabBrowserDTD SYSTEM "chrome://global/locale/tabbrowser.dtd" > %tabBrowserDTD ]>
Comment on attachment 125702 [details] [diff] [review] Proposed change r=harishd
Attachment #125702 - Flags: review?(harishd) → review+
Comment on attachment 125702 [details] [diff] [review] Proposed change jst, could you sr?
Attachment #125702 - Flags: superreview?(heikki) → superreview?(jst)
Comment on attachment 125702 [details] [diff] [review] Proposed change sr=jst
Attachment #125702 - Flags: superreview?(jst) → superreview+
Fixed.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
Product: SeaMonkey → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: