Bug 9661

Summary: textContent returns "\n" for a <br> or a '\n' even if it is collapsed
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: adele, annevk, ap, darin, ian, justin.garcia, mitz, sullivan
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   

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.