JavaScript: Reading/Writing to TextArea with "innerText"

Stefan Eilers stefan.eilers at basyskom.de
Fri Jul 6 14:48:34 BST 2007


HI Maksim!

Am 05.07.2007 um 17:21 schrieb Maksim Orlovich:

>> Hi!
>> Am 06.06.2007 um 15:22 schrieb Maksim Orlovich:
>>
>> Sorry for this delay. I was a little bit busy..
>
> No problem. I have a patch that fixes this:
> http://lists.kde.org/?l=kfm-devel&m=118141580921767&w=2

Ah cool! You patch looks much better than mine.

>
> Though I didn't get a chance to commit it yet. Sorry, I probably  
> should
> have CC'd you.

No problem. But I don't read this mailing list on a daily manner.  
Therefore it is a good idea to use a CC for me.. :)

> I think that this makes some of the stuff below moot.
> Could you perhaps test that patch w/the app to make sure it fixes  
> things?

Sure.

It works quite well. There is just one issue which is related to my  
test page. Reading the content of the textarea using the command  
"innerText" does not work with your patch (like it works with IE).  
Please use the example attached below. It shows the content of the  
text area after clicking the button "kick me". Your release shows the  
text that was written with "innerText" and not the text in the text  
area.

>
>>> So there are a couple of questions that need to be answered first:
>>> a) Does changing the child text nodes reset the value? If so,
>>> innerText
>>> should not be changed, but HTMLFormElementImpl needs to work for  
>>> child
>>> changes, which would be rather tricky.
>>
>> I thought about this issue. But implementing it this way is beyond my
>> knowledge about the implementation details. The interesting question
>> is, how IE does it. Do they really change the child nodes? I don't  
>> know.
>
> IE is bizzarre. The child nodes actually seem to even reflect what got
> typed by the user.

This seems to be the reason, why "innerText" is working for reading  
the content of the textarea..

> Actually, every browser does it differently, Opera is
> probably the closest to your patch..

This compatibility stuff is very unpleasant..

Mfg., Dr. Stefan Eilers
--  

Dr.-Ing. Stefan Eilers
Projekt Manager

basysKom GmbH
Robert-Bosch-Str. 7 | 64293 Darmstadt | Germany
Tel: +49 6151 3968753 | Fax: -736 | Mobile: +49 170 4213459
stefan.eilers at basyskom.de | www.basyskom.de

Handelsregister: Darmstadt HRB 9352
Geschaeftsfuehrung: Eva Brucherseifer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20070706/1d073dff/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 188 bytes
Desc: Signierter Teil der Nachricht
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20070706/1d073dff/attachment.sig>


More information about the kfm-devel mailing list