Closed Bug 122077 Opened 23 years ago Closed 23 years ago

Angle brackets in tags within NOFRAMES content escaped on save as complete page

Categories

(Core Graveyard :: File Handling, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.0

People

(Reporter: dan, Assigned: adamlock)

References

()

Details

Attachments

(2 files, 1 obsolete file)

Try using the "Save Page As" on this URL (to a frameset), using "Save as complete page" option. The NOFRAMES section includes a hyperlink, but in the saved version the angle brackets used to delineate the A tag are escaped into ampersand sequences, meaning that the link doesn't work as expected when the file is used in a non-frame browser -- the literal text of the tag is shown instead. This is an unexpected and undesired alteration of the original HTML code. (I'm using build 2002012403 in Win98.)
My attempts to create a simple testcase for this turned up another problem with saving framesets... see bug 122078.
To adamlock. Seeing this on current linux too.
Assignee: law → adamlock
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 98 → All
Hardware: PC → All
Blocks: 115634
Attached file A simpler example of the problem (obsolete) —
Original sample URL is pretty nasty, so here is a simpler example of the problem. My guess is that the HTML parser is simply turning everything inside a <NOFRAMES> element into text (since Moz never looks at it anyway). When the document is saved the encoder spews out the text converting angle brackets to entities as it does so. This line in the parser suggests some other elements which will get treated the same way. http://lxr.mozilla.org/seamonkey/source/htmlparser/src/nsHTMLTokenizer.cpp#755
Original sample URL is pretty nasty, so here is a simpler example of the problem. My guess is that the HTML parser is simply turning everything inside a <NOFRAMES> element into text (since Moz never looks at it anyway). When the document is saved the encoder is spews out the text converting angle brackets to entities as it does so. This line in the parser suggests some other elements which will get treated the same way. http://lxr.mozilla.org/seamonkey/source/htmlparser/src/nsHTMLTokenizer.cpp#755
*** Bug 125392 has been marked as a duplicate of this bug. ***
Harish would know all about that...
Harish is this your bug?
>My guess is that the HTML parser is simply turning everything inside a ><NOFRAMES> element into text (since Moz never looks at it anyway). When the >document is saved the encoder is spews out the text converting angle brackets >to entities as it does so. You're right when FRAMES are enabled NOFRAMES content would get collected as text ( mainly to avoid residual style from doing nasty stuff to the NOFRAMES content and to the rest of the content ). I don't think this is a parser problem. May be the encoder should not do any kind of conversion to the NOFRAMES content.
Target Milestone: --- → mozilla1.0
Attached patch Simple fixSplinter Review
Patch tells HTML serializer to treat noframes content as CDATA so it doesn't replace angle brackets with entities any more. Reviews?
Attachment #69460 - Attachment is obsolete: true
Comment on attachment 70381 [details] [diff] [review] Simple fix r=harishd
Attachment #70381 - Flags: review+
Comment on attachment 70381 [details] [diff] [review] Simple fix sr=jst
Attachment #70381 - Flags: superreview+
Fix is in
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
vrfy'd fixed using 2002.03.13 comm bits on linux rh7.2, win2k and mac 10.1.3. tested with http://hopey.mcom.com/tests/simple-frames-2.html
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: