Made two small changes that make it possible for comments to have DOM nodes made for them
when pasting. This relies on some earlier work I did some days ago.
* khtml/xml/dom_nodeimpl.cpp:
(NodeImpl::startMarkup): Get the string from the comment.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
be included in the DOM.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8085
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2004-11-29 Ken Kocienda <kocienda@apple.com>
+
+ Reviewed by Harrison
+
+ Made two small changes that make it possible for comments to have DOM nodes made for them
+ when pasting. This relies on some earlier work I did some days ago.
+
+ * khtml/xml/dom_nodeimpl.cpp:
+ (NodeImpl::startMarkup): Get the string from the comment.
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge documentFragmentWithMarkupString:baseURLString:]): Did some very minor
+ rearranging. Now passes a flag when creating a contextual fragment, requesting that comments
+ be included in the DOM.
+
2004-11-29 Ken Kocienda <kocienda@apple.com>
Reviewed by Harrison
Id parentID = parentNode()->id();
bool dontEscape = (parentID == ID_SCRIPT || parentID == ID_TEXTAREA || parentID == ID_STYLE);
return dontEscape ? str.string() : escapeHTML(str.string());
+ } else if (type == Node::COMMENT_NODE) {
+ return static_cast<const CommentImpl *>(this)->toString().string();
} else if (type != Node::DOCUMENT_NODE) {
QString markup = QChar('<') + nodeName().string();
if (type == Node::ELEMENT_NODE) {
- (DOMDocumentFragment *)documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString
{
- DOM::DocumentImpl *document = _part->xmlDocImpl();
- DOM::DocumentFragmentImpl *fragment = static_cast<HTMLElementImpl *>(document->documentElement())->createContextualFragment(markupString);
+ DocumentImpl *document = _part->xmlDocImpl();
+ HTMLElementImpl *element = static_cast<HTMLElementImpl *>(document->documentElement());
+ DocumentFragmentImpl *fragment = element->createContextualFragment(markupString, true); // true to include comments in DOM
ASSERT(fragment);
if ([baseURLString length] > 0) {