Bug 9661 - textContent returns "\n" for a <br> or a '\n' even if it is collapsed
Summary: textContent returns "\n" for a <br> or a '\n' even if it is collapsed
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2006-06-29 23:49 PDT by David Kilzer (:ddkilzer)
Modified: 2007-01-08 10:02 PST (History)
7 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2006-06-29 23:49:19 PDT
When the last character in a text input field is deleted, a <br> placeholder is inserted.  The problem is that textContent returns "\n" for a <br> even if it's collapsed.  In HTMLInputElement:setValueFromRenderer(), value = "\n" and constrainValue(value) = "".

See Bug 9358 for the original issue (an assertion failure).
Comment 1 Justin Garcia 2006-10-26 18:45:26 PDT
textContent also returns '\n' for a '\n' even if it is collapsed.  Renaming.
Comment 2 Darin Adler 2007-01-08 10:02:27 PST
I believe the behavior of textContent is correct, and it's the client that has a problem. I believe this bug report may be INVALID.