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 Editing | Assignee: | 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
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Kent Tamura
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
Is it hard to fix this issue? Sorry I have no experience in C++ (?)
danya.postfactum
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
The bug doesn't seem to reproduce on nightly builds of WebKit anymore.