WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
53846
Webkit removes empty text nodes and does not allow creating such ones.
https://bugs.webkit.org/show_bug.cgi?id=53846
Summary
Webkit removes empty text nodes and does not allow creating such ones.
Alex
Reported
2011-02-05 03:27:07 PST
Here's a code example: var a = document.createElement( 'div' ); var b = document.createTextNode( 's' ); a.appendChild( b ); document.body.appendChild( a ); And code line 'b.deleteData( 0, 1 )' will cause webkit not only to remove the text node's data, but a text node. I develop an online editor project and this behaviour for me is very disappointed. Opera and firefox( gecko ) treat empty text nodes normally.
Attachments
Test case
(2.46 KB, text/plain)
2022-08-06 00:17 PDT
,
Ryosuke Niwa
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2022-08-05 12:21:49 PDT
I am able to reproduce this bug in Safari 15.6 on macOS 12.5 using below JSFiddle from test case of
Comment 0
: Link -
https://jsfiddle.net/arpL7twq/
Open and in console type - 'b.deleteData( 0, 1 )' without quotes and then hit "Enter". Safari 15.6 will keep on showing 's' text node while Firefox Nightly 105 and Chrome Canary 106 will get rid of text node. I am changing status to "New". Thanks!
Ryosuke Niwa
Comment 2
2022-08-06 00:17:12 PDT
Created
attachment 461437
[details]
Test case All browsers agree now (Text node is retained).
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug