Closed
Bug 41464
Opened 25 years ago
Closed 15 years ago
textarea.wrap not exposed through DOM (IE compatability)
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a2
People
(Reporter: martin.honnen, Assigned: Ms2ger)
References
Details
(Keywords: dev-doc-complete, dom0, testcase)
Attachments
(3 files, 1 obsolete file)
Textarea elements have a
wrap
attribute which can have values
off
hard
soft
While mozilla supports setting those via html it fails to change the wrapping
when the attribute is changed via javascript. IE5 does that nicely.
Reporter | ||
Comment 1•25 years ago
|
||
Comment 2•25 years ago
|
||
Reassigning to Eric, but I'm not sure if pollmann, rods, or mjudge owns this
one.
Assignee: rods → pollmann
Comment 3•25 years ago
|
||
Hm, I tried returning a hint of REFLOW and FRAMECHANGE for that attribute change
in nsHTMLTextAreaElement::GetMappedAttributeImpact and neither seemed to have
any effect. It would be good to get this working in the Ender lite version, so
I'll work with Mike try that...
Status: NEW → ASSIGNED
Comment 4•25 years ago
|
||
Ah, okay... So the reason why this does nothing is that it is not part of the
DOM spec. See:
http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510/html.html#ID-24874179
We have a fairly strict interpretation of the spec in most cases, so that is why
this attribute is not exposed through the DOM. I'm CC'ing our DOM guy to see if
it make sense to add this to our proprietary extensions (i.e. add it to
NSHTMLTextAreaElement in the idl file)
Component: HTML Form Controls → DOM Level 0
OS: Windows 98 → All
Hardware: PC → All
Summary: change of wrap attribute of textarea without visual effect → textarea.wrap not exposed through DOM (IE compatability)
Comment 5•25 years ago
|
||
I think it should be possible to solve this without changing any DOM code or
interfaces, the actual wrapping of the text is done in the editor in the
textarea frame (AFAIK) and the testcase here shows that setting and getting the
value of the .wrap property (which just maps to the attribute getter/setter)
does work. It looks like the problem is that the textarea should be reflown when
the wrap attribute changes and nsGfxTextControlFrame::Reflow() needs to change
the wrapping in the editor in the textarea frame...
Comment 6•25 years ago
|
||
Hmm.. After some testing, I found that we actually do need to change the idl
interfaces in the DOM in order to let the GfxTextControlFrame know that it needs
to reflow when the wrap property changes (specifically, adding a wrap attribute
line to NSHTMLTextAreaElement inside HTMLTextAreaElement.idl). I've got all the
changes in my tree needed to fix this bug, though with the change we are giving
a hint of FRAMECHANGE instead of REFLOW which is not the most efficient way to
do things (but better than not doing them at all).
Whiteboard: fix in hand
Target Milestone: --- → M17
Comment 7•25 years ago
|
||
Hmm, ok, or would it be possible to make this change in
GfxTextControlFrame::AttributeChanged() (plus the DOM changes) and avoid hinting
about possibly unnecessary reflows?
Comment 8•25 years ago
|
||
Thanks, I didn't try that yet, I'll give it a whirl!
Whiteboard: fix in hand
Comment 9•25 years ago
|
||
This bug has been marked "future" because the original netscape engineer working
on this is over-burdened. If you feel this is an error, that you or another
known resource will be working on this bug,or if it blocks your work in some way
-- please attach your concern to the bug for reconsideration.
Target Milestone: M17 → Future
Comment 11•24 years ago
|
||
Comment 12•23 years ago
|
||
Bulk reassigning Eric Pollmann's remaining form submission bugs to Alex.
Assignee: pollmann → alexsavulov
Status: ASSIGNED → NEW
Comment 13•23 years ago
|
||
Fabian, wanna fix this one now? This one should be trivial now that we're using
XPConnect to talk to the DOM from JS.
Comment 14•23 years ago
|
||
I had this one on my radar just never took the time to investigate it. Will look :-)
Comment 15•23 years ago
|
||
So uh... I mapped .wrap to Get/SetAttribute, but it doesn't do anything. Then I
did a static HTML file with attributes wrap="off", wrap="soft", wrap="hard", and
all of them displayed in the same way??
Do we actually support this attribute?
Reporter | ||
Comment 16•23 years ago
|
||
When I filed this bug (4 June 2000) Mozilla at that time supported the wrap
attribute for textarea elements. It doesn't seem to do it anymore. So it might
seem we first need a 4xp compatibility bug (as wrap is not part of HTML 4)
Comment 17•23 years ago
|
||
Hmm, I still see wrapping related code in nsGftTextControlFrame2.cpp, Rod, did
support for the "wrap" attribute regress lately?
Comment 18•22 years ago
|
||
Should this bug be marked as invalid ? We do not seem to support wrap which is
not part of the w3c specs. It is not a 4xp compatibilty issue since NS4 didn't
support this part of IE DOM either. RFE ?
Reporter | ||
Comment 19•22 years ago
|
||
When I try the test case
http://bugzilla.mozilla.org/attachment.cgi?id=9590&action=view
with the Mozilla 1.3 release build on Win 98 then the wrap="off" setting for the
<textarea> element is recognized, the text line is not wrapped and a horizontal
scrollbar is displayed. Thus at least Mozilla 1.3 supports the HTML attribute
wrap for <textarea> elements and I think it should be scriptable as a property
as well.
Comment 20•21 years ago
|
||
To default owners.
Assignee: alexsavulov → general
Priority: P3 → --
QA Contact: desale → ian
Target Milestone: Future → ---
Comment 21•21 years ago
|
||
Editor questions:
1) Would it be OK to make SetWrapWidth be a no-op when the width is being set to
the value it already is?
2) Would it be OK to change the default wrap width value to -1 (so that regular
text controls don't take a perf hit from editor munging styles that are
already correctly set)?
Comment 22•19 years ago
|
||
*** Bug 302710 has been marked as a duplicate of this bug. ***
Comment 23•19 years ago
|
||
See <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/750fa0da420a46a6/eb9efd932d383526?hl=en#eb9efd932d383526>
for much simplier fix found by BootNic:
...
txtarea.setAttribute('wrap', mode):
/*Fix display for mozilla*/
txtarea.style.display='none';
txtarea.style.display='';
...
So it's a rendering failure, not a property access problem. So stop saying wise words and fix it ;-)
Eric Pollmann wrote:
> So the reason why this does nothing is that it is not part of the
DOM spec.
Oh com'on guys! Textarea doesn't have wrap property? That's a hot discover since 1995. The only reason it's not on the triple-W site is (I guess) that wrap still have double set of arguments supported:
legacy "off", "virtual", "physical" from the golden era of Netscape
newer "off", "soft", "hard" from Microsoft.
As it happens often in such situations, triple-W prefers to keep silence until it's clear where the wind is coming from.
Comment 24•19 years ago
|
||
Truly, it would be nice to have this fixed. As regards VK's comments and the notes in Bug 302710. I could not get any of those methods to work for me in FF 1.5.0.1 on my Win 2K Pro. Furthermore, it is not simply a display issue (as you may verify by this attachment - but remember to uncheck the checkbox for it), since dynamically changing the .wrap setting (between hard and anything else) and then submitting the textarea does not alter what gets submitted to the server.
The attachment does demonstrate a workaround, however. Essentially, it is:
function elem(id) { return document.getElementById(id); }
ta = elem('myTextareaId');
ta.setAttribute("wrap",newWrapVal);
var oldValue = ta.value;
ta.parentNode.replaceChild(ta.cloneNode(true), ta);
elem('myTextareaId').value=oldValue;
Whenever the checkbox in the attachment is checked, the workaround is in effect. You can notice it on the client if you are switching to/from a wrap setting of off. You can notice it on the server when switching to/from a wrap setting of hard.
Csaba Gabor from Vienna
Comment 25•19 years ago
|
||
This isn't just IE compatibility - XUL textboxes have a wrap attribute and are affected by the same issue.
Updated•15 years ago
|
Assignee: general → nobody
QA Contact: ian → general
Assignee | ||
Comment 26•15 years ago
|
||
This should fix bug 159979 as well.
Attachment #425002 -
Flags: review?(bzbarsky)
Updated•15 years ago
|
Attachment #425002 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → Ms2ger
Keywords: checkin-needed
Updated•15 years ago
|
Attachment #28528 -
Attachment is obsolete: true
Updated•15 years ago
|
Comment 27•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
Updated•15 years ago
|
Target Milestone: mozilla1.9.3a1 → mozilla1.9.3a2
Comment 28•15 years ago
|
||
dev-doc-needed to be included in the next "what's new?"
Updated•15 years ago
|
Keywords: dev-doc-needed
Assignee | ||
Comment 29•15 years ago
|
||
I've added notes to <https://developer.mozilla.org/en/DOM/TextArea> and <https://developer.mozilla.org/en/Upcoming_Firefox_features_for_developers>. Is anything else needed?
Comment 30•15 years ago
|
||
No, not now. Eventually this will be documented more fully when textareas are properly documented.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•