Commit ff6ff5b8 authored by adele@apple.com's avatar adele@apple.com

WebKit/mac: Fix for <rdar://problem/8093680> "Paste and Match Style" should fire paste events

https://bugs.webkit.org/show_bug.cgi?id=41085

Reviewed by Eric Carlson.

* WebView/WebHTMLView.mm: (-[WebHTMLView pasteAsPlainText:]): Reuse code in WebCore
which does everything done here and also fires paste events.

WebKitTools: DumpRenderTree part of testing <rdar://problem/8093680> "Paste and Match Style" should fire paste events
https://bugs.webkit.org/show_bug.cgi?id=41085

Reviewed by Eric Carlson.

* DumpRenderTree/mac/DumpRenderTree.mm: (resetWebViewToConsistentStateBeforeTesting):
Clear the general pasteboard in between tests so Cut,Copy, and setData on ClipboardData won't have lasting effects.

LayoutTests: Test for <rdar://problem/8093680> "Paste and Match Style" should fire paste events
https://bugs.webkit.org/show_bug.cgi?id=41085

Reviewed by Eric Carlson.

* platform/mac/editing/pasteboard/paste-and-match-style-selector-event-expected.txt: Added.
* platform/mac/editing/pasteboard/paste-and-match-style-selector-event.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@61771 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 775726b6
2010-06-24 Adele Peterson <adele@apple.com>
Reviewed by Eric Carlson.
Test for <rdar://problem/8093680> "Paste and Match Style" should fire paste events
https://bugs.webkit.org/show_bug.cgi?id=41085
* platform/mac/editing/pasteboard/paste-and-match-style-selector-event-expected.txt: Added.
* platform/mac/editing/pasteboard/paste-and-match-style-selector-event.html: Added.
2010-06-24 Mikhail Naganov <mnaganov@chromium.org>
Unreviewed test expectations update.
......
This tests that sending the pasteAsPlainText selector, which is what happens when you paste and match style, fires the onpaste event.
SUCCESS
<html>
<head>
<script>
function test() {
if (window.layoutTestController)
layoutTestController.dumpAsText();
var result = document.getElementById("result");
window.getSelection().setBaseAndExtent(result, 0, result, 7);
document.execCommand("Cut");
if (window.textInputController)
textInputController.doCommand("pasteAsPlainText:");
}
function onpastehandler(event) {
var e = document.getElementById("result");
e.innerText = "SUCCESS";
}
</script>
</head>
<body onload="test()" onpaste="onpastehandler(event)" contenteditable>
This tests that sending the pasteAsPlainText selector, which is what happens when you paste and match style, fires the onpaste event.
<div id="result">FAILURE</div>
</body>
</html>
2010-06-24 Adele Peterson <adele@apple.com>
Reviewed by Eric Carlson.
Fix for <rdar://problem/8093680> "Paste and Match Style" should fire paste events
https://bugs.webkit.org/show_bug.cgi?id=41085
* WebView/WebHTMLView.mm: (-[WebHTMLView pasteAsPlainText:]): Reuse code in WebCore
which does everything done here and also fires paste events.
2010-06-23 Yuzo Fujishima <yuzo@google.com>
Reviewed by Shinichiro Hamaji.
......
......@@ -5166,9 +5166,11 @@ static BOOL writingDirectionKeyBindingsEnabled()
{
COMMAND_PROLOGUE
if (![self _canEdit])
RetainPtr<WebHTMLView> selfProtector = self;
RefPtr<Frame> coreFrame = core([self _frame]);
if (!coreFrame)
return;
[self _pasteAsPlainTextWithPasteboard:[NSPasteboard generalPasteboard]];
coreFrame->editor()->pasteAsPlainText();
}
- (void)closeIfNotCurrentView
......
2010-06-24 Adele Peterson <adele@apple.com>
Reviewed by Eric Carlson.
DumpRenderTree part of testing <rdar://problem/8093680> "Paste and Match Style" should fire paste events
https://bugs.webkit.org/show_bug.cgi?id=41085
* DumpRenderTree/mac/DumpRenderTree.mm: (resetWebViewToConsistentStateBeforeTesting):
Clear the general pasteboard in between tests so Cut,Copy, and setData on ClipboardData won't have lasting effects.
2010-06-23 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
......
......@@ -1185,6 +1185,9 @@ static void resetWebViewToConsistentStateBeforeTesting()
[WebView _resetOriginAccessWhitelists];
[[MockGeolocationProvider shared] stopTimer];
// Clear the contents of the general pasteboard
[[NSPasteboard generalPasteboard] declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
}
static void runTest(const string& testPathOrURL)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment