WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
20787
Inablity to insert text/html with script into innerHTML or innerText elements
https://bugs.webkit.org/show_bug.cgi?id=20787
Summary
Inablity to insert text/html with script into innerHTML or innerText elements
Ned
Reported
2008-09-11 11:57:52 PDT
I have been successfully using the recommended procedures for inserting content at the cursor into appropriate elements (e.g., <DIV>) with IE for years. I also have code that works with Navigator. But recently I downloaded the new Chrome implementation of WebKit and ran into problems. Neither the IE nor Navigator code worked. After researching the problem, I decided to try using execCommand("Paste") as an alternative. queryCommandEnabled reported that it was not supported, which appeared to be true. But it also said that execCommand("Copy") was not supported, yet it did in fact work. I found the same in consistency with some other commands. Next I tried the InsertParagraph command, which worked to some extent. The problem was that the optional id parameter was totally ignored, and instead of inserting a set of paragraph tags, it inserted the following (without an id): <div> <br> </div> With no id, it would be very difficult to use innerHTML to set the contents of the newly created block. This was a last resort, because what I really wanted was an inline insertion, not a block-level one. But it would have solved my immediate needs at least. I consider this a very serious bug inasmuch as it all but disallows editable HTML of any kind of sophistication. Oddly enough I was able to paste in other far less important elements (e.g., InsertUnorderedList) successfuly. It seems to me that the whole area of scriptable DOM manipulation needs to be revisited, particularly the editing functions. They are critical to any serious AJAX application at the very least. Also, it should be noted that the version number I specified in the report may not be correct as I don't know which release Google used in Chrome, and it's not on your pull-down list. Thanks.
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2008-09-11 15:39:20 PDT
Would it be possible for you to provide URLs or test cases for your existing code that doesn't work, as well as your recent test cases that didn't work? It isn't very easy to re-create them from the above description. Ideally, each of these should go into a separate bug report to avoid confusion, as the root causes and fixes are likely to be different. I can certainly understand the frustration that can appear after multiple attempts of making your code work with a new browser engine fail, but please be advised that multiple sites support rich editable content in Safari/Chrome well. There are certainly bugs, and we are looking into these as they are filed. As far as innerHTML goes - are you inserting the text at the current insertion point? In this case, you may be able to get the element to use from Selection object.
Alexey Proskuryakov
Comment 2
2010-01-07 16:04:31 PST
No answer in over a year, closing.
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