[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
weinig at apple.com
weinig at apple.com
Wed Dec 22 12:29:12 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit bea95ceadcee51f9222b197e1fed4af3af30ef75
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Aug 24 17:59:22 2010 +0000
Paste event fires twice for mac WebKit
<rdar://problem/8094611>
https://bugs.webkit.org/show_bug.cgi?id=44535
Reviewed by Oliver Hunt.
WebCore:
The mac implementation of paste in WebKit was accidentally calling
Editor::tryDHTMLPaste twice, once in -[WebHTMLView paste:] and once
in Editor::pasteAsPlainText (which is called -[WebHTMLView paste:]).
Use the new pasteAsPlainTextBypassingDHTML function to bypass the
second call.
Test: editing/pasteboard/paste-event-only-once.html
* WebCore.exp.in:
* editing/Editor.cpp:
(WebCore::Editor::pasteAsPlainTextBypassingDHTML):
* editing/Editor.h:
Expose a function which just pastes using from the general pasteboard,
bypassing all the checking and DHTML pasting.
WebKit/mac:
The mac implementation of paste in WebKit was accidentally calling
Editor::tryDHTMLPaste twice, once in -[WebHTMLView paste:] and once
in Editor::pasteAsPlainText (which is called -[WebHTMLView paste:]).
Use the new pasteAsPlainTextBypassingDHTML function to bypass the
second call.
* WebView/WebHTMLView.mm:
(-[WebHTMLView paste:]):
LayoutTests:
* editing/pasteboard/paste-event-only-once-expected.txt: Added.
* editing/pasteboard/paste-event-only-once.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7787f56..7d00323 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-08-24 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ Paste event fires twice for mac WebKit
+ <rdar://problem/8094611>
+ https://bugs.webkit.org/show_bug.cgi?id=44535
+
+ * editing/pasteboard/paste-event-only-once-expected.txt: Added.
+ * editing/pasteboard/paste-event-only-once.html: Added.
+
2010-08-24 Nate Chapin <japhet at chromium.org>
Reviewed by David Levin.
diff --git a/LayoutTests/editing/pasteboard/paste-event-only-once-expected.txt b/LayoutTests/editing/pasteboard/paste-event-only-once-expected.txt
new file mode 100644
index 0000000..c14062b
--- /dev/null
+++ b/LayoutTests/editing/pasteboard/paste-event-only-once-expected.txt
@@ -0,0 +1,6 @@
+Pasting in the text area should only fire one paste event.
+
+
+PASSED
+
+
diff --git a/LayoutTests/editing/pasteboard/paste-event-only-once.html b/LayoutTests/editing/pasteboard/paste-event-only-once.html
new file mode 100644
index 0000000..774d92d
--- /dev/null
+++ b/LayoutTests/editing/pasteboard/paste-event-only-once.html
@@ -0,0 +1,27 @@
+<body>
+<p>Pasting in the text area should only fire one paste event.</p>
+<textarea id="test">Content</textarea>
+<p id="results">FAILED</p>
+</body>
+<script src="../editing.js"></script>
+<script>
+function editingTest()
+{
+ var firedCount = 0;
+ document.getElementById("test").addEventListener("paste", function(){
+ firedCount++
+ }, false);
+
+ document.getElementById("test").focus();
+ execSelectAllCommand();
+ execCopyCommand();
+ execPasteCommand();
+
+ if (firedCount == 1)
+ document.getElementById("results").innerText = "PASSED";
+ else
+ document.getElementById("results").innerText = "FAILED firedCount:" + firedCount;
+}
+
+runDumpAsTextEditingTest(false);
+</script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 797afce..0b9f6e2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2010-08-24 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ Paste event fires twice for mac WebKit
+ <rdar://problem/8094611>
+ https://bugs.webkit.org/show_bug.cgi?id=44535
+
+ The mac implementation of paste in WebKit was accidentally calling
+ Editor::tryDHTMLPaste twice, once in -[WebHTMLView paste:] and once
+ in Editor::pasteAsPlainText (which is called -[WebHTMLView paste:]).
+ Use the new pasteAsPlainTextBypassingDHTML function to bypass the
+ second call.
+
+ Test: editing/pasteboard/paste-event-only-once.html
+
+ * WebCore.exp.in:
+ * editing/Editor.cpp:
+ (WebCore::Editor::pasteAsPlainTextBypassingDHTML):
+ * editing/Editor.h:
+ Expose a function which just pastes using from the general pasteboard,
+ bypassing all the checking and DHTML pasting.
+
2010-08-24 Nate Chapin <japhet at chromium.org>
Unreviewed.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index c3d9e43..e1b7c22 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -361,6 +361,7 @@ __ZN7WebCore15VisiblePositionC1ERKNS_8PositionENS_9EAffinityE
__ZN7WebCore15reportExceptionEPN3JSC9ExecStateENS0_7JSValueE
__ZN7WebCore15visitedLinkHashEPKtj
__ZN7WebCore16AbstractDatabase14setIsAvailableEb
+__ZN7WebCore16DeviceMotionData6createEbdbdbdbdbdbdbd
__ZN7WebCore16FontFallbackList15releaseFontDataEv
__ZN7WebCore16FontPlatformDataC1EP6NSFontbb
__ZN7WebCore16FontPlatformDataD1Ev
@@ -401,7 +402,6 @@ __ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionE
__ZN7WebCore16jsStringSlowCaseEPN3JSC9ExecStateERNS0_9WeakGCMapIPN3WTF10StringImplEPNS0_8JSStringEEES6_
__ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE
__ZN7WebCore17DOMImplementation14isTextMIMETypeERKN3WTF6StringE
-__ZN7WebCore16DeviceMotionData6createEbdbdbdbdbdbdbd
__ZN7WebCore17DeviceOrientation6createEbdbdbd
__ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
__ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv
@@ -461,12 +461,12 @@ __ZN7WebCore22externalRepresentationEPNS_5FrameEj
__ZN7WebCore23ReplaceSelectionCommandC1EPNS_8DocumentEN3WTF10PassRefPtrINS_16DocumentFragmentEEEbbbbbNS_10EditActionE
__ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0EEE
__ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv
+__ZN7WebCore24DocumentMarkerController13removeMarkersENS_14DocumentMarker10MarkerTypeE
+__ZN7WebCore24DocumentMarkerController23renderedRectsForMarkersENS_14DocumentMarker10MarkerTypeE
__ZN7WebCore24contextMenuItemTagItalicEv
__ZN7WebCore24contextMenuItemTagStylesEv
__ZN7WebCore24createFragmentFromMarkupEPNS_8DocumentERKN3WTF6StringES5_NS_27FragmentScriptingPermissionE
__ZN7WebCore24decodeURLEscapeSequencesERKN3WTF6StringE
-__ZN7WebCore24DocumentMarkerController13removeMarkersENS_14DocumentMarker10MarkerTypeE
-__ZN7WebCore24DocumentMarkerController23renderedRectsForMarkersENS_14DocumentMarker10MarkerTypeE
__ZN7WebCore24notifyHistoryItemChangedE
__ZN7WebCore24rangeCompliantEquivalentERKNS_8PositionE
__ZN7WebCore25HistoryPropertyListWriter11releaseDataEv
@@ -628,6 +628,7 @@ __ZN7WebCore6Editor29canDecreaseSelectionListLevelEv
__ZN7WebCore6Editor29canIncreaseSelectionListLevelEv
__ZN7WebCore6Editor30applyParagraphStyleToSelectionEPNS_19CSSStyleDeclarationENS_10EditActionE
__ZN7WebCore6Editor30deleteSelectionWithSmartDeleteEb
+__ZN7WebCore6Editor30pasteAsPlainTextBypassingDHTMLEv
__ZN7WebCore6Editor32guessesForUngrammaticalSelectionEv
__ZN7WebCore6Editor33increaseSelectionListLevelOrderedEv
__ZN7WebCore6Editor35increaseSelectionListLevelUnorderedEv
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 0052a55..fd4c210 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -326,6 +326,11 @@ void Editor::pasteAsFragment(PassRefPtr<DocumentFragment> pastingFragment, bool
target->dispatchEvent(TextEvent::createForFragmentPaste(m_frame->domWindow(), pastingFragment, smartReplace, matchStyle), ec);
}
+void Editor::pasteAsPlainTextBypassingDHTML()
+{
+ pasteAsPlainTextWithPasteboard(Pasteboard::generalPasteboard());
+}
+
void Editor::pasteAsPlainTextWithPasteboard(Pasteboard* pasteboard)
{
String text = pasteboard->plainText(m_frame);
diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h
index 06e7513..fe4b9d1 100644
--- a/WebCore/editing/Editor.h
+++ b/WebCore/editing/Editor.h
@@ -299,6 +299,9 @@ public:
void pasteAsFragment(PassRefPtr<DocumentFragment>, bool smartReplace, bool matchStyle);
void pasteAsPlainText(const String&, bool smartReplace);
+ // This is only necessary while paste is primarily implemented in WebKit for the mac platform.
+ void pasteAsPlainTextBypassingDHTML();
+
Node* findEventTargetFrom(const VisibleSelection& selection) const;
private:
Frame* m_frame;
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index f89b7b1..48e300c 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,20 @@
+2010-08-24 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ Paste event fires twice for mac WebKit
+ <rdar://problem/8094611>
+ https://bugs.webkit.org/show_bug.cgi?id=44535
+
+ The mac implementation of paste in WebKit was accidentally calling
+ Editor::tryDHTMLPaste twice, once in -[WebHTMLView paste:] and once
+ in Editor::pasteAsPlainText (which is called -[WebHTMLView paste:]).
+ Use the new pasteAsPlainTextBypassingDHTML function to bypass the
+ second call.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView paste:]):
+
2010-08-24 Daniel Cheng <dcheng at chromium.org>
Reviewed by Eric Seidel.
diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm
index 9c2430c..a619f18 100644
--- a/WebKit/mac/WebView/WebHTMLView.mm
+++ b/WebKit/mac/WebView/WebHTMLView.mm
@@ -5176,7 +5176,7 @@ static BOOL writingDirectionKeyBindingsEnabled()
if (coreFrame->selection()->isContentRichlyEditable())
[self _pasteWithPasteboard:[NSPasteboard generalPasteboard] allowPlainText:YES];
else
- coreFrame->editor()->pasteAsPlainText();
+ coreFrame->editor()->pasteAsPlainTextBypassingDHTML();
}
- (void)closeIfNotCurrentView
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list