Bug 112626
Summary: | Removing all content of an input element leaves behind a blank TextNode | ||
---|---|---|---|
Product: | WebKit | Reporter: | Daniel Freedman <dfreedm> |
Component: | Forms | Assignee: | Nobody <webkit-unassigned> |
Status: | UNCONFIRMED | ||
Severity: | Normal | CC: | ap, aurimas, enrica, esprehn, rniwa |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://jsfiddle.net/dfreedm/BdFCQ/ |
Daniel Freedman
It appears that removing content from an <input> generates a blank TextNode in the ShadowDOM
Steps to reproduce:
1. Turn on "Show Shadow DOM" in the inspector
2. Load the example jsfiddle
3. Add content to the <input>
4. Remove the all content with backspace
4. Inspect the shadowed <div> child of the <input>, there is an extra, empty TextNode
5. Repeat steps 3 & 4
6. Now there are two empty TextNodes
Highlighting and replacing the text does not seem to generate a blank TextNode, only removing all content.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ryosuke Niwa
Wait, does Inspector leak the information about input element? It seems like we shouldn't. The fact input element is implemented via contenteditable is an implementation detail that should NOT be leaked from tools like Inspector.
Elliott Sprehn
(In reply to comment #1)
> Wait, does Inspector leak the information about input element? It seems like we shouldn't. The fact input element is implemented via contenteditable is an implementation detail that should NOT be leaked from tools like Inspector.
Lets discuss that in a different bug.
Alexey Proskuryakov
Why is this a bug? Empty text nodes should not be causing any trouble (unless you repeat this thousands of times, which is not a practical scenario).
Elliott Sprehn
(In reply to comment #3)
> Why is this a bug? Empty text nodes should not be causing any trouble (unless you repeat this thousands of times, which is not a practical scenario).
I don't think it's unreasonable to think that people leave irccloud.com or other web apps open for weeks. Certainly gmail users do.
Alexey Proskuryakov
What are the practical scenarios that cause unlimited addition of empty TextNodes on irccloud.com or GMail? I would expect that any time the user does anything meaningful with the text input, like actually sending an IRC message, these nodes would go away.
I don't want to over-think it, as this issue can probably probably be fixed without any measurable cost, but it's always good to know when a fix actually improves anything for users.
Elliott Sprehn
(In reply to comment #5)
> What are the practical scenarios that cause unlimited addition of empty TextNodes on irccloud.com or GMail? I would expect that any time the user does anything meaningful with the text input, like actually sending an IRC message, these nodes would go away.
>
That's a really good question, I'll look into this more.