[Attachment Support] Create attachment elements when dropping files on iOS
[WebKit-https.git] / Source / WebCore / editing / WebContentReader.cpp
index e6bc262daa89a21821fac5f05db45be2e63168a7..544912a7493c716807777e35eee023e4e23ea734 100644 (file)
 
 namespace WebCore {
 
+DocumentFragment& WebContentReader::ensureFragment()
+{
+    ASSERT(frame.document());
+    if (!fragment)
+        fragment = frame.document()->createDocumentFragment();
+    return *fragment;
+}
+
 void WebContentReader::addFragment(Ref<DocumentFragment>&& newFragment)
 {
     if (!fragment)
@@ -39,9 +47,10 @@ void WebContentReader::addFragment(Ref<DocumentFragment>&& newFragment)
         fragment->appendChild(newFragment.get());
 }
 
-bool WebContentMarkupReader::shouldSanitize() const
+bool FrameWebContentReader::shouldSanitize() const
 {
-    return frame.document() && frame.document()->originIdentifierForPasteboard() != contentOrigin;
+    ASSERT(frame.document());
+    return frame.document()->originIdentifierForPasteboard() != contentOrigin;
 }
 
 }