Closed Bug 166866 Opened 22 years ago Closed 21 years ago

HTML escape chars in textarea have confusing behavior.

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 154882

People

(Reporter: bugzilla, Assigned: harishd)

References

Details

(Keywords: compat, testcase)

Attachments

(1 file, 1 obsolete file)

HTML escape chars like &quot; are usually "translated" by the browser, when present in <textarea>. However, using today's build, if the escape-chars are in a tag, in quotes, they are not translated. I write an application which "double escapes" html special characters becuase of the way most(all?) browsers handle escape chars in textarea. It makes &quot; into &amp;quot; so that the browser will render it as &quot; in the text area. &lt;li&gt; will render just fine, but: <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=78676" title="[Bug 78676] selection inside a single &lt;li&gt; shouldn't include bullet">Yea!</a> will render as : <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=78676" title="[Bug 78676] selection inside a single &amp;lt;li&amp;gt; shouldn't include bullet">Yea!</a> in a textarea
This is parser. Could you attach a small HTML file demonstrating the problem using http://bugzilla.mozilla.org/attachment.cgi?bugid=166866&action=enter ?
Assignee: jkeiser → harishd
Component: HTML Form Controls → Parser
QA Contact: tpreston → moied
Attached file HTML example (obsolete) —
I guess I should also point out that when you File: Save As the attachment, the saved source actually has &amp;amp;lt; in it, which differs from what View Source shows (and the way the file really is.)
Bug #167616 may be related to this issue...(?)
I'm not really sure what the correct behavior should be here; <textarea> isn't allowed to have content other that text, and I imagine sticking that <a> element in there is confusing the parser.
Keywords: compat, testcase
Coming back to this...yes, your problem is that you're putting "<a ..." into the textarea, which isn't valid. Change that to "&lt;a ..." and the parsing will work fine. Resolving bug as INVALID.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
They said the same thing about Bug 133044 at first. This is a compatibility issue. Right or wrong, lots and lots and lots of people use <textarea> to edit web pages and other browsers don't mangle HTML entities. Mozilla shouldn't either.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Is this bug still unconfirmed?
I've noticed a similar problem using Mozilla 1.2 with Blogger (http://www.blogger.com). When I try to edit my weblog template with Mozilla, all of the attributes in the anchor tags are stipped out. For example: <a href="...">foobar</a> becomes <a>foobar</a> Now, if I do a viewsource on the page with the textarea, all of the data is there: <a href="...">foobar</a> It's just not being displayed by Mozilla. Note that I only have this problem with that one textarea on the Blogger site. There are other textareas on the Blogger site that don't cause any problems.
Attached file updated testcase
testcase showing parser is breaking on a tag opening
Attachment #98115 - Attachment is obsolete: true
Confirming All/All off 1.3b/OS X based on my updated testcase. The parser is indeed choking on the A tag... yes this is all invalid code... but I think the parser should be consistant about parsing entities between the 3 textareas in the updated testcase
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: PC → All
*** This bug has been marked as a duplicate of 154882 ***
Status: NEW → RESOLVED
Closed: 22 years ago21 years ago
Resolution: --- → DUPLICATE
*** Bug 223008 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: