WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
UNCONFIRMED
93584
InsertHTML strips out div tags almost universally
https://bugs.webkit.org/show_bug.cgi?id=93584
Summary
InsertHTML strips out div tags almost universally
David Gatwood
Reported
2012-08-08 23:42:04 PDT
Created
attachment 157400
[details]
Demonstrates insertHTML stripping out div tags in five different contexts WebKit's execCommand's insertHTML seems to be unwilling to insert a div tag pretty much anywhere that contains any sort of text (even temporarily). Unfortunately, I cannot easily avoid this temporary insertion or use anything other than div tags because that is the only element that Safari seems willing to paste arbitrary blobs of HTML inside without silently changing all the pasted tags to spans.... I've attached a sample HTML file that demonstrates five different test cases in which WebKit strips out div tags instead of inserting them. Firefox passes all five tests.
Attachments
Demonstrates insertHTML stripping out div tags in five different contexts
(1.13 KB, text/html)
2012-08-08 23:42 PDT
,
David Gatwood
no flags
Details
Test case where <span> gets stripped.
(943 bytes, text/html)
2012-08-10 20:53 PDT
,
David Gatwood
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
David Gatwood
Comment 1
2012-08-10 20:53:18 PDT
Created
attachment 157855
[details]
Test case where <span> gets stripped. In this trivial test case, it strips out <span> when inserting into a <div>. It works correctly if there's text selected when it inserts, but if the start and end points of the selection are the same, it fails.
Robert McBride
Comment 2
2013-01-16 15:02:42 PST
I am seeing this behavior to. It appears that when trying to insert a span into a div or even a p tag, then the span tag is lost. The text contents of the span remain. Here is a jsfiddle the I hope demonstrates the issue well.
http://jsfiddle.net/mrexception/pyXEs/
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