textarea does not print out non-breaking space ("nbsp;) entities

RESOLVED INVALID

Status

()

Core
HTML: Parser
RESOLVED INVALID
15 years ago
14 years ago

People

(Reporter: Nick C, Unassigned)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 Firebird/0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 Firebird/0.7

non-breaking spaces ("nbsp;) coded inside textarea tags do not appear in
their full entity form in the browser, but just as normal whitespaces...

Reproducible: Always

Steps to Reproduce:
1.
2.
3.

Actual Results:  
displayed whitespaces

Expected Results:  
display the fill "nbsp; entity within the textarea
(Reporter)

Comment 1

15 years ago
Created attachment 136417 [details]
example of behaviour
(Reporter)

Comment 2

15 years ago
this is inconvenient because when a form containing such a textarea is
submitted, the html entities are ignored and converted to whitespaces, which is
in most cases not the desired behaviour - especially when it comes to DB data etc...

Comment 3

15 years ago
This is INVALID.

If you want to display " " you should encode it as " ", it will
show up then.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → INVALID

Comment 4

15 years ago
v
Status: RESOLVED → VERIFIED
(Reporter)

Comment 5

15 years ago
Consider the following use case:

* user edits HTML content via a textarea, for example for blogging. He wants
precise spacing for some of the text he is writing so he uses  
* user submits the form, the data gets stored in the database, and displays fine.
* user decides to edit his post, makes some changes, resubmits the form, and hey
presto! his layout is broken.

This is because the   tags in the databases got converted to
whitespaces in the textarea when the user edited his content, and therefor got
saved to the database as whitespaces as well.

The w3c defines TEXTAREA's content as being PCDATA, which from what I understand
allows entities (as well as markup, curiously enough). So, whilst all entities
contained in CDATA (eg attributes etc) fields should indeed be converted to
plain chars, there's doesn't actually seem to be any reason for doing this for
PCDATA - it seems to me that Moz should allow all entities (not just
& ) to pass through to the user in the textarea content.

I just thought I'd point it out - not make or break, it just seemed to me to be
slightly inconsistent behaviour.
Status: VERIFIED → UNCONFIRMED
Resolution: INVALID → ---
Entities should be expanded in PCDATA (as far as I can find). This is still
INVALID. You're going to have to fix this on the web app's side (e.g., do extra
processing on the data in the database or something like that).
Status: UNCONFIRMED → RESOLVED
Last Resolved: 15 years ago14 years ago
Resolution: --- → INVALID

Comment 7

14 years ago
This bug is probably a consequence of bug #194498.
You need to log in before you can comment on or make changes to this bug.