Closed
Bug 227358
Opened 21 years ago
Closed 20 years ago
textarea parsing: <? causes </textarea> to not be recognized
Categories
(Core :: DOM: HTML Parser, defect)
Core
DOM: HTML Parser
Tracking
()
RESOLVED
FIXED
People
(Reporter: moz, Assigned: mrbkap)
References
Details
(Keywords: testcase)
Attachments
(1 file)
243 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.5) Gecko/20031007 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.5) Gecko/20031007 In the following snippet, the closing </textarea> is not recognized. foo <textarea> <? </textarea> bar Reproducible: Always Steps to Reproduce: put the snippet above in a HTML page and view in Mozilla. Actual Results: You see the </textarea> bar displaying _inside_ the textarea. Expected Results: Compare to IE which recognizes the </textarea>, so the <? should be displayed inside the textarea, bar outside it. First, I know that the snippet does not validate. It happens in the constellation above. When you add _any_ closing angle bracket, the error does not appear. <textarea> <? > </textarea> renders correctly as well as <textarea> <? <a> </textarea> does. Apperantly, it happens only with the question mark: <textarea> <a </textarea> renders correctly.
Comment 1•21 years ago
|
||
> Compare to IE which recognizes the </textarea>, so the <? should be displayed
> inside the textarea, bar outside it.
:-) Mozilla != IE, but I think you are right, Mozilla should support this.
If this is important to you, or your company. Use:
"<?"
Which will work correctly in every browser that exists and is used today.
Reporter | ||
Comment 2•21 years ago
|
||
> :-) Mozilla != IE That's why I use Mozilla :-) > If this is important to you, or your company. Use: > > "<?" > > Which will work correctly in every browser that exists and is used today. Agreed that the sample code is not valid; I just found this issue using a forum that doesn't do this translation. Anyway, I regard it as a bug by the circumstances -- wy is <? a problem, but <foo is not? Why is <? a problem and <? <foo> is not? That is what looks strange. Jörg
Comment 3•21 years ago
|
||
INVALID. The document you've supplied isn't valid HTML. The content model for <textarea> is #PCDATA (parsed character data), which means that the parser must be involved (as opposed to #CDATA, where the parser can just skip ahead to </textarea>). <? is the start of an SGML processing instruction, so I suspect the parser is getting confused. But, just to reiterate, the document isn't valid anyway. Characters in #PCDATA sections that might be confused with markup (< and &, at a minimum) must be escaped as entity references.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
Comment 4•21 years ago
|
||
(mid air collision: I see you know the document isn't valid).
Comment 5•21 years ago
|
||
I totally agree closing such bugs, but we need this for compat mode I believe. Not everyone knows that HTML is a standard with rules ;-) In any case this is not INVALID. It could be a DUPLICATE though.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Comment 6•21 years ago
|
||
over to Parser
Assignee: form → parser
Component: Layout: Form Controls → HTML: Parser
Comment 7•21 years ago
|
||
Fair enough, but the parser's a delicate beast, and we really don't want to be adding more exceptions to it if at all possible. Just how many sites depend on this? (of course, any site that does is probably open to trivial cross-site scripting attacks, but that's not relevant here).
Comment 8•21 years ago
|
||
This is probably a wontfix, but choess may know more...
Comment 9•21 years ago
|
||
See also bug 105937, bug 154882, bug 64799 (or, search for "textarea parsing:" in the summary line).
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Summary: <? inside a textarea: closing </textarea> is not recognized → textarea parsing: <? causes </textarea> to not be recognized
Comment 10•21 years ago
|
||
Assignee | ||
Updated•20 years ago
|
Assignee: parser → mrbkap
Assignee | ||
Comment 11•20 years ago
|
||
FIXED by checkin to bug 88952
Status: NEW → RESOLVED
Closed: 21 years ago → 20 years ago
Resolution: --- → FIXED
Comment 12•20 years ago
|
||
*** Bug 277050 has been marked as a duplicate of this bug. ***
Comment 13•19 years ago
|
||
*** Bug 288820 has been marked as a duplicate of this bug. ***
Comment 14•19 years ago
|
||
*** Bug 288820 has been marked as a duplicate of this bug. ***
Comment 15•19 years ago
|
||
*** Bug 305071 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.
Description
•