[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:33:00 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit dccf44bd9748117ca5cf9e978820c4b28f222a4b
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Apr 8 22:42:19 2004 +0000
Rolling out previous commit. Tree was closed. Doh!
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 775867c..75a1e67 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,30 +1,3 @@
-2004-04-08 Chris Blumenberg <cblu at apple.com>
-
- Renamed the PasteHTMLCommand to PasteMarkupCommand. Removed PasteImageCommand because we will use PasteMarkupCommand for pasting images.
-
- Reviewed by kocienda.
-
- * khtml/editing/htmlediting.cpp:
- (PasteMarkupCommand::PasteMarkupCommand):
- (PasteMarkupCommand::~PasteMarkupCommand):
- (PasteMarkupCommand::impl):
- (PasteMarkupCommand::markupString):
- * khtml/editing/htmlediting.h:
- (khtml::):
- * khtml/editing/htmlediting_impl.cpp:
- (PasteMarkupCommandImpl::PasteMarkupCommandImpl):
- (PasteMarkupCommandImpl::~PasteMarkupCommandImpl):
- (PasteMarkupCommandImpl::commandID):
- (PasteMarkupCommandImpl::doApply):
- * khtml/editing/htmlediting_impl.h:
- (khtml::PasteMarkupCommandImpl::markupString):
- * khtml/khtml_part.cpp:
- (KHTMLPart::pasteMarkupString):
- * khtml/khtml_part.h:
- * kwq/WebCoreBridge.h:
- * kwq/WebCoreBridge.mm:
- (-[WebCoreBridge pasteMarkupString:]):
-
2004-04-08 David Hyatt <hyatt at apple.com>
Fix for 3608430 and 3608462, crashes in findNextLineBreak when deleting. Make sure that the removal of line boxes
diff --git a/WebCore/khtml/editing/htmlediting.cpp b/WebCore/khtml/editing/htmlediting.cpp
index bc6c59f..ac1fa78 100644
--- a/WebCore/khtml/editing/htmlediting.cpp
+++ b/WebCore/khtml/editing/htmlediting.cpp
@@ -70,8 +70,10 @@ using khtml::RemoveNodeCommand;
using khtml::RemoveNodeCommandImpl;
using khtml::RemoveNodeAndPruneCommand;
using khtml::RemoveNodeAndPruneCommandImpl;
-using khtml::PasteMarkupCommand;
-using khtml::PasteMarkupCommandImpl;
+using khtml::PasteHTMLCommand;
+using khtml::PasteHTMLCommandImpl;
+using khtml::PasteImageCommand;
+using khtml::PasteImageCommandImpl;
using khtml::SplitTextNodeCommand;
using khtml::SplitTextNodeCommandImpl;
using khtml::TypingCommand;
@@ -512,26 +514,43 @@ TextImpl *JoinTextNodesCommand::secondNode() const
}
//------------------------------------------------------------------------------------------
-// PasteMarkupCommand
+// PasteHTMLCommand
-PasteMarkupCommand::PasteMarkupCommand(DocumentImpl *document, const DOMString &markupString)
- : CompositeEditCommand(new PasteMarkupCommandImpl(document, markupString))
+PasteHTMLCommand::PasteHTMLCommand(DocumentImpl *document, const DOMString &HTMLString)
+ : CompositeEditCommand(new PasteHTMLCommandImpl(document, HTMLString))
{
}
-PasteMarkupCommand::~PasteMarkupCommand()
+PasteHTMLCommand::~PasteHTMLCommand()
{
}
-PasteMarkupCommandImpl *PasteMarkupCommand::impl() const
+PasteHTMLCommandImpl *PasteHTMLCommand::impl() const
{
- return static_cast<PasteMarkupCommandImpl *>(get());
+ return static_cast<PasteHTMLCommandImpl *>(get());
}
-DOMString PasteMarkupCommand::markupString() const
+DOMString PasteHTMLCommand::HTMLString() const
{
IF_IMPL_NULL_RETURN_ARG(DOMString());
- return impl()->markupString();
+ return impl()->HTMLString();
+}
+
+//------------------------------------------------------------------------------------------
+// PasteImageCommand
+
+PasteImageCommand::PasteImageCommand(DocumentImpl *document, const DOMString &src)
+ : CompositeEditCommand(new PasteImageCommandImpl(document, src))
+{
+}
+
+PasteImageCommand::~PasteImageCommand()
+{
+}
+
+PasteImageCommandImpl *PasteImageCommand::impl() const
+{
+ return static_cast<PasteImageCommandImpl *>(get());
}
//------------------------------------------------------------------------------------------
diff --git a/WebCore/khtml/editing/htmlediting.h b/WebCore/khtml/editing/htmlediting.h
index 3534756..1324fef 100644
--- a/WebCore/khtml/editing/htmlediting.h
+++ b/WebCore/khtml/editing/htmlediting.h
@@ -55,7 +55,8 @@ class InputTextCommandImpl;
class InsertNodeBeforeCommandImpl;
class InsertTextCommandImpl;
class JoinTextNodesCommandImpl;
-class PasteMarkupCommandImpl;
+class PasteHTMLCommandImpl;
+class PasteImageCommandImpl;
class RemoveNodeCommandImpl;
class RemoveNodeAndPruneCommandImpl;
class SplitTextNodeCommandImpl;
@@ -76,7 +77,8 @@ enum ECommandID {
InsertNodeBeforeCommandID,
InsertTextCommandID,
JoinTextNodesCommandID,
- PasteMarkupCommandID,
+ PasteHTMLCommandID,
+ PasteImageCommandID,
RemoveNodeCommandID,
RemoveNodeAndPruneCommandID,
SplitTextNodeCommandID,
@@ -316,18 +318,31 @@ private:
};
//------------------------------------------------------------------------------------------
-// PasteMarkupCommand
+// PasteHTMLCommand
-class PasteMarkupCommand : public CompositeEditCommand
+class PasteHTMLCommand : public CompositeEditCommand
{
public:
- PasteMarkupCommand(DOM::DocumentImpl *document, const DOM::DOMString &markupString);
- virtual ~PasteMarkupCommand();
+ PasteHTMLCommand(DOM::DocumentImpl *document, const DOM::DOMString &HTMLString);
+ virtual ~PasteHTMLCommand();
- DOM::DOMString markupString() const;
+ DOM::DOMString HTMLString() const;
private:
- inline PasteMarkupCommandImpl *impl() const;
+ inline PasteHTMLCommandImpl *impl() const;
+};
+
+//------------------------------------------------------------------------------------------
+// PasteImageCommand
+
+class PasteImageCommand : public CompositeEditCommand
+{
+public:
+ PasteImageCommand(DOM::DocumentImpl *document, const DOM::DOMString &src);
+ virtual ~PasteImageCommand();
+
+private:
+ inline PasteImageCommandImpl *impl() const;
};
//------------------------------------------------------------------------------------------
diff --git a/WebCore/khtml/editing/htmlediting_impl.cpp b/WebCore/khtml/editing/htmlediting_impl.cpp
index 276b90a..b7454ad 100644
--- a/WebCore/khtml/editing/htmlediting_impl.cpp
+++ b/WebCore/khtml/editing/htmlediting_impl.cpp
@@ -95,8 +95,10 @@ using khtml::RemoveNodeAndPruneCommandImpl;
using khtml::RenderObject;
using khtml::RenderStyle;
using khtml::RenderText;
-using khtml::PasteMarkupCommand;
-using khtml::PasteMarkupCommandImpl;
+using khtml::PasteHTMLCommand;
+using khtml::PasteHTMLCommandImpl;
+using khtml::PasteImageCommand;
+using khtml::PasteImageCommandImpl;
using khtml::SplitTextNodeCommand;
using khtml::SplitTextNodeCommandImpl;
using khtml::TypingCommand;
@@ -1390,26 +1392,26 @@ void JoinTextNodesCommandImpl::doUnapply()
}
//------------------------------------------------------------------------------------------
-// PasteMarkupCommandImpl
+// PasteHTMLCommandImpl
-PasteMarkupCommandImpl::PasteMarkupCommandImpl(DocumentImpl *document, const DOMString &markupString)
- : CompositeEditCommandImpl(document), m_markupString(markupString)
+PasteHTMLCommandImpl::PasteHTMLCommandImpl(DocumentImpl *document, const DOMString &HTMLString)
+ : CompositeEditCommandImpl(document), m_HTMLString(HTMLString)
{
- ASSERT(!m_markupString.isEmpty());
+ ASSERT(!m_HTMLString.isEmpty());
}
-PasteMarkupCommandImpl::~PasteMarkupCommandImpl()
+PasteHTMLCommandImpl::~PasteHTMLCommandImpl()
{
}
-int PasteMarkupCommandImpl::commandID() const
+int PasteHTMLCommandImpl::commandID() const
{
- return PasteMarkupCommandID;
+ return PasteHTMLCommandID;
}
-void PasteMarkupCommandImpl::doApply()
+void PasteHTMLCommandImpl::doApply()
{
- DocumentFragmentImpl *root = static_cast<HTMLElementImpl *>(document()->documentElement())->createContextualFragment(m_markupString);
+ DocumentFragmentImpl *root = static_cast<HTMLElementImpl *>(document()->documentElement())->createContextualFragment(m_HTMLString);
ASSERT(root);
NodeImpl *firstChild = root->firstChild();
@@ -1462,6 +1464,44 @@ void PasteMarkupCommandImpl::doApply()
}
//------------------------------------------------------------------------------------------
+// PasteImageCommandImpl
+
+PasteImageCommandImpl::PasteImageCommandImpl(DocumentImpl *document, const DOMString &src)
+: CompositeEditCommandImpl(document)
+{
+ ASSERT(!src.isEmpty());
+ m_src = src;
+}
+
+PasteImageCommandImpl::~PasteImageCommandImpl()
+{
+}
+
+int PasteImageCommandImpl::commandID() const
+{
+ return PasteImageCommandID;
+}
+
+void PasteImageCommandImpl::doApply()
+{
+ deleteSelection();
+
+ KHTMLPart *part = document()->part();
+ ASSERT(part);
+
+ KHTMLSelection selection = part->selection();
+ ASSERT(!selection.isEmpty());
+
+ DOM::NodeImpl *startNode = selection.startNode();
+ HTMLImageElementImpl *imageNode = new HTMLImageElementImpl(startNode->docPtr());
+ imageNode->setAttribute(ATTR_SRC, m_src);
+
+ insertNodeAt(imageNode, startNode, selection.startOffset());
+ selection = KHTMLSelection(imageNode, imageNode->caretMaxOffset());
+ setEndingSelection(selection);
+}
+
+//------------------------------------------------------------------------------------------
// RemoveNodeCommandImpl
RemoveNodeCommandImpl::RemoveNodeCommandImpl(DocumentImpl *document, NodeImpl *removeChild)
diff --git a/WebCore/khtml/editing/htmlediting_impl.h b/WebCore/khtml/editing/htmlediting_impl.h
index 47fec02..6a87061 100644
--- a/WebCore/khtml/editing/htmlediting_impl.h
+++ b/WebCore/khtml/editing/htmlediting_impl.h
@@ -338,22 +338,39 @@ private:
};
//------------------------------------------------------------------------------------------
-// PasteMarkupCommandImpl
+// PasteHTMLCommandImpl
-class PasteMarkupCommandImpl : public CompositeEditCommandImpl
+class PasteHTMLCommandImpl : public CompositeEditCommandImpl
{
public:
- PasteMarkupCommandImpl(DOM::DocumentImpl *document, const DOM::DOMString &markupString);
- virtual ~PasteMarkupCommandImpl();
+ PasteHTMLCommandImpl(DOM::DocumentImpl *document, const DOM::DOMString &HTMLString);
+ virtual ~PasteHTMLCommandImpl();
virtual int commandID() const;
virtual void doApply();
- DOM::DOMString markupString() const { return m_markupString; }
+ DOM::DOMString HTMLString() const { return m_HTMLString; }
private:
- DOM::DOMString m_markupString;
+ DOM::DOMString m_HTMLString;
+};
+
+//------------------------------------------------------------------------------------------
+// PasteImageCommandImpl
+
+class PasteImageCommandImpl : public CompositeEditCommandImpl
+{
+public:
+ PasteImageCommandImpl(DOM::DocumentImpl *document, const DOM::DOMString &src);
+ virtual ~PasteImageCommandImpl();
+
+ virtual int commandID() const;
+
+ virtual void doApply();
+
+private:
+ DOM::DOMString m_src;
};
//------------------------------------------------------------------------------------------
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index bb118ef..3a9ed7f 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -102,7 +102,8 @@ using khtml::Decoder;
using khtml::DeleteSelectionCommand;
using khtml::EditCommand;
using khtml::InlineTextBox;
-using khtml::PasteMarkupCommand;
+using khtml::PasteHTMLCommand;
+using khtml::PasteImageCommand;
using khtml::RenderObject;
using khtml::RenderText;
using khtml::Tokenizer;
@@ -5157,9 +5158,15 @@ void KHTMLPart::reappliedEditing(EditCommand &cmd)
d->m_lastEditCommand = EditCommand::emptyCommand();
}
-void KHTMLPart::pasteMarkupString(const QString &markupString)
+void KHTMLPart::pasteHTMLString(const QString &HTMLString)
{
- EditCommand cmd(PasteMarkupCommand(d->m_doc, DOMString(markupString)));
+ EditCommand cmd(PasteHTMLCommand(d->m_doc, DOMString(HTMLString)));
+ cmd.apply();
+}
+
+void KHTMLPart::pasteImage(const QString &src)
+{
+ EditCommand cmd(PasteImageCommand(d->m_doc, DOMString(src)));
cmd.apply();
}
diff --git a/WebCore/khtml/khtml_part.h b/WebCore/khtml/khtml_part.h
index 667400c..64d4945 100644
--- a/WebCore/khtml/khtml_part.h
+++ b/WebCore/khtml/khtml_part.h
@@ -654,9 +654,14 @@ public:
void reappliedEditing(khtml::EditCommand &);
/**
- * Pastes a markup string (such as an HTML string) at the current caret position.
+ * Pastes an HTML string at the current caret position.
*/
- void pasteMarkupString(const QString &markupString);
+ void pasteHTMLString(const QString &HTMLString);
+
+ /**
+ * Pastes a new image node at the current caret position.
+ */
+ void pasteImage(const QString &src);
/**
* Convenience method to show the document's view.
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index befc9c9..63c6fcb 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -230,6 +230,7 @@ typedef enum {
- (BOOL)moveCaretToPoint:(NSPoint)point;
- (void)pasteMarkupString:(NSString *)markupString;
+- (void)pasteImageWithURL:(NSURL *)URL;
- (void)deleteSelection;
- (BOOL)haveSelection;
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index e3aa9dd..caab38e 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -419,7 +419,12 @@ static bool initializedKJS = FALSE;
- (void)pasteMarkupString:(NSString *)markupString
{
- _part->pasteMarkupString(QString::fromNSString(markupString));
+ _part->pasteHTMLString(QString::fromNSString(markupString));
+}
+
+- (void)pasteImageWithURL:(NSURL *)URL
+{
+ _part->pasteImage(QString::fromNSString([URL absoluteString]));
}
- (void)deleteSelection
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list