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: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-29 23:49 PDT by David Kilzer (:ddkilzer)
Modified: 2023-09-01 04:40 PDT (History)
8 users (show)

See Also:


Attachments

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.
Comment 3 Anne van Kesteren 2023-09-01 04:40:32 PDT
Resolving this per comment 2 as INVALID as without a test case proving otherwise it seems highly unlikely that textContent has a bug.