Bug 94833

Summary: Setting the value of textarea on an input event prevents new line to be inserted subsequently
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WORKSFORME    
Severity: Normal CC: adele, danya.postfactum, enrica, tkent
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Ryosuke Niwa
Reported 2012-08-23 12:26:59 PDT
http://code.google.com/p/chromium/issues/detail?id=76516 1. Open the following HTML file. 2. Open Console. 3. Press ENTER, notice the console log shows the newline. Press ENTER again, notice the textarea's value no longer receives the newline. <html> <body> <textarea oninput="console.log('[' + this.value + ']'); this.value = '';"></textarea> </body> </html> What is the expected result? [ ] [ ] What happens instead? [ ] []
Attachments
Kent Tamura
Comment 1 2012-10-01 00:31:29 PDT
For the second ENTER, TypingCommand::insertLineBreak rejects to work because canAppendNewLineFeedToSelection(endingSelection()) returns false. endingSelection() for the second ENTER is: SE#text 0x7feb01516530 "\n" start: legacy, offset, offset:0 end: legacy, offset, offset:0 though endingSelection() for the first ENTER was: BODY 0x7feb031705f0 #text 0x7feb031a80f0 " " TEXTAREA 0x7feb0316ee40 #shadow-root 0x7feb031744d0 SE DIV 0x7feb03171880 start: legacy, offset, offset:0 end: legacy, offset, offset:0 endingSelection() is pointing the text node removed by this.value='' ?
danya.postfactum
Comment 2 2012-11-27 21:47:45 PST
Is it hard to fix this issue? Sorry I have no experience in C++ (?)
danya.postfactum
Comment 3 2013-09-26 08:08:19 PDT
This issue is not reproducible anymore in Google Chrome, but I am not sure this is fixed in webkit yet rather then in blink. Can anybody test this again?
Ryosuke Niwa
Comment 4 2013-09-29 23:46:35 PDT
The bug doesn't seem to reproduce on nightly builds of WebKit anymore.
Note You need to log in before you can comment on or make changes to this bug.