Diff
Modified: trunk/LayoutTests/ChangeLog (107885 => 107886)
--- trunk/LayoutTests/ChangeLog 2012-02-16 06:10:24 UTC (rev 107885)
+++ trunk/LayoutTests/ChangeLog 2012-02-16 06:14:48 UTC (rev 107886)
@@ -1,3 +1,22 @@
+2012-02-15 Kentaro Hara <[email protected]>
+
+ [Mac] PasteboardMac.mm build fails
+ https://bugs.webkit.org/show_bug.cgi?id=78655
+
+ Reviewed by Enrica Casucci.
+
+ The added test drops multiple files onto an editable element,
+ and checks if the filenames are inserted into the editable element.
+
+ * editing/pasteboard/drag-files-to-editable-element-expected.txt: Added.
+ * editing/pasteboard/drag-files-to-editable-element.html: Added.
+ * platform/chromium/test_expectations.txt:
+ * platform/efl/Skipped:
+ * platform/gtk/Skipped:
+ * platform/qt/Skipped:
+ * platform/win/Skipped:
+ * platform/wk2/Skipped:
+
2012-02-15 Ilya Tikhonovsky <[email protected]>
[chromium] Unreviewed rebaseline after r107864.
Added: trunk/LayoutTests/editing/pasteboard/drag-files-to-editable-element-expected.txt (0 => 107886)
--- trunk/LayoutTests/editing/pasteboard/drag-files-to-editable-element-expected.txt (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/drag-files-to-editable-element-expected.txt 2012-02-16 06:14:48 UTC (rev 107886)
@@ -0,0 +1,10 @@
+If we drag files onto an editable area, then the filenames should be inserted into the editable area.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS result is "<div>LayoutTests/editing/pasteboard/foo</div><div>LayoutTests/editing/pasteboard/bar</div><div>LayoutTests/editing/pasteboard/baz</div>"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/editing/pasteboard/drag-files-to-editable-element.html (0 => 107886)
--- trunk/LayoutTests/editing/pasteboard/drag-files-to-editable-element.html (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/drag-files-to-editable-element.html 2012-02-16 06:14:48 UTC (rev 107886)
@@ -0,0 +1,38 @@
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<div id="editable" contentEditable=true style="width:200px; height:200px"></div>
+<script>
+description('If we drag files onto an editable area, then the filenames should be inserted into the editable area.');
+
+var editable = document.getElementById("editable");
+if (window.eventSender) {
+ dragFilesOntoEditable(['foo', 'bar', 'baz']);
+ var result = editable.innerHTML.replace(/file.*?LayoutTests/g, "LayoutTests");
+ shouldBeEqualToString('result', '<div>LayoutTests/editing/pasteboard/foo</div><div>LayoutTests/editing/pasteboard/bar</div><div>LayoutTests/editing/pasteboard/baz</div>');
+ editable.innerHTML = '';
+}
+
+function moveMouseToCenterOfElement(element)
+{
+ var centerX = element.offsetLeft + element.offsetWidth / 2;
+ var centerY = element.offsetTop + element.offsetHeight / 2;
+ eventSender.mouseMoveTo(centerX, centerY);
+}
+
+function dragFilesOntoEditable(files)
+{
+ eventSender.beginDragWithFiles(files);
+ moveMouseToCenterOfElement(editable);
+ eventSender.mouseUp();
+}
+
+var successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (107885 => 107886)
--- trunk/LayoutTests/platform/chromium/test_expectations.txt 2012-02-16 06:10:24 UTC (rev 107885)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt 2012-02-16 06:14:48 UTC (rev 107886)
@@ -825,6 +825,9 @@
BUGWK61624 WIN : editing/pasteboard/smart-paste-003.html = TEXT
BUGWK61624 WIN : editing/pasteboard/smart-paste-004.html = TEXT
+// PasteBoard::plainText() does not support file names.
+BUGWK78655 : editing/pasteboard/drag-files-to-editable-element.html = FAIL
+
// New test in r93068
BUGWK66268 WIN LINUX : editing/deleting/regional-indicators.html = TEXT
Modified: trunk/LayoutTests/platform/efl/Skipped (107885 => 107886)
--- trunk/LayoutTests/platform/efl/Skipped 2012-02-16 06:10:24 UTC (rev 107885)
+++ trunk/LayoutTests/platform/efl/Skipped 2012-02-16 06:14:48 UTC (rev 107886)
@@ -1249,6 +1249,9 @@
# The EFL port has no global history delegate
http/tests/globalhistory
+# PasteBoard::plainText() does not support file names.
+editing/pasteboard/drag-files-to-editable-element.html
+
# Fails because MutationObservers are not notified at end-of-task
# https://bugs.webkit.org/show_bug.cgi?id=78290
fast/mutation/end-of-task-delivery.html
Modified: trunk/LayoutTests/platform/gtk/Skipped (107885 => 107886)
--- trunk/LayoutTests/platform/gtk/Skipped 2012-02-16 06:10:24 UTC (rev 107885)
+++ trunk/LayoutTests/platform/gtk/Skipped 2012-02-16 06:14:48 UTC (rev 107886)
@@ -299,6 +299,9 @@
editing/pasteboard/clipboard-customData.html
fast/events/drag-customData.html
+# PasteBoard::plainText() does not support file names.
+editing/pasteboard/drag-files-to-editable-element.html
+
# Needs grammar checking.
editing/spelling/markers.html
Modified: trunk/LayoutTests/platform/qt/Skipped (107885 => 107886)
--- trunk/LayoutTests/platform/qt/Skipped 2012-02-16 06:10:24 UTC (rev 107885)
+++ trunk/LayoutTests/platform/qt/Skipped 2012-02-16 06:14:48 UTC (rev 107886)
@@ -411,6 +411,9 @@
editing/pasteboard/data-transfer-items-drag-drop-file.html
editing/pasteboard/data-transfer-items-drag-drop-string.html
+# PasteBoard::plainText() does not support file names.
+editing/pasteboard/drag-files-to-editable-element.html
+
# Missing drag & drop functionality in DRT
editing/pasteboard/drop-inputtext-acquires-style.html
fast/css/user-drag-none.html
Modified: trunk/LayoutTests/platform/win/Skipped (107885 => 107886)
--- trunk/LayoutTests/platform/win/Skipped 2012-02-16 06:10:24 UTC (rev 107885)
+++ trunk/LayoutTests/platform/win/Skipped 2012-02-16 06:14:48 UTC (rev 107886)
@@ -155,6 +155,9 @@
# https://bugs.webkit.org/show_bug.cgi?id=61829
fast/events/drag-image-filename.html
+# PasteBoard::plainText() does not support file names.
+editing/pasteboard/drag-files-to-editable-element.html
+
# <rdar://problem/5643675> window.scrollTo scrolls a window with no scrollbars
fast/events/attempt-scroll-with-no-scrollbars.html
Modified: trunk/LayoutTests/platform/wk2/Skipped (107885 => 107886)
--- trunk/LayoutTests/platform/wk2/Skipped 2012-02-16 06:10:24 UTC (rev 107885)
+++ trunk/LayoutTests/platform/wk2/Skipped 2012-02-16 06:14:48 UTC (rev 107886)
@@ -824,6 +824,9 @@
# http://webkit.org/b/58990
editing/undo/undo-iframe-location-change.html
+# PasteBoard::plainText() does not support file names.
+editing/pasteboard/drag-files-to-editable-element.html
+
# Times out
# https://bugs.webkit.org/show_bug.cgi?id=63806
http/tests/cache/history-only-cached-subresource-loads-max-age-https.html
Modified: trunk/Source/WebCore/ChangeLog (107885 => 107886)
--- trunk/Source/WebCore/ChangeLog 2012-02-16 06:10:24 UTC (rev 107885)
+++ trunk/Source/WebCore/ChangeLog 2012-02-16 06:14:48 UTC (rev 107886)
@@ -1,3 +1,18 @@
+2012-02-15 Kentaro Hara <[email protected]>
+
+ [Mac] PasteboardMac.mm build fails
+ https://bugs.webkit.org/show_bug.cgi?id=78655
+
+ Reviewed by Enrica Casucci.
+
+ This patch fixes the code to make a plain text for pasted file names.
+ The code should return a string of concatenated file names.
+
+ Test: editing/pasteboard/drag-files-to-editable-element.html
+
+ * platform/mac/PasteboardMac.mm:
+ (WebCore::Pasteboard::plainText):
+
2012-02-15 Anders Carlsson <[email protected]>
Another attempt at fixing the Snow Leopard build.
Modified: trunk/Source/WebCore/platform/mac/PasteboardMac.mm (107885 => 107886)
--- trunk/Source/WebCore/platform/mac/PasteboardMac.mm 2012-02-16 06:10:24 UTC (rev 107885)
+++ trunk/Source/WebCore/platform/mac/PasteboardMac.mm 2012-02-16 06:14:48 UTC (rev 107886)
@@ -56,6 +56,7 @@
#import <wtf/StdLibExtras.h>
#import <wtf/RetainPtr.h>
#import <wtf/UnusedParam.h>
+#import <wtf/text/StringBuilder.h>
#import <wtf/unicode/CharacterNames.h>
#if USE(PLATFORM_STRATEGIES)
@@ -316,7 +317,7 @@
return [(NSString *)platformStrategies()->pasteboardStrategy()->stringForType(NSStringPboardType, m_pasteboardName) precomposedStringWithCanonicalMapping];
NSAttributedString *attributedString = nil;
- NSString *string = nil;
+ NSString *string;
if (types.contains(String(NSRTFDPboardType))) {
RefPtr<SharedBuffer> data = "" m_pasteboardName);
@@ -335,11 +336,11 @@
if (types.contains(String(NSFilenamesPboardType))) {
Vector<String> pathnames;
platformStrategies()->pasteboardStrategy()->getPathnamesForType(pathnames, NSFilenamesPboardType, m_pasteboardName);
+ StringBuilder builder;
for (size_t i = 0; i < pathnames.size(); i++)
- string = [string length] ? @"\n" + pathnames[i] : pathnames[i];
- string = [string precomposedStringWithCanonicalMapping];
- if (string != nil)
- return string;
+ builder.append(i ? "\n" + pathnames[i] : pathnames[i]);
+ string = builder.toString();
+ return [string precomposedStringWithCanonicalMapping];
}
string = platformStrategies()->pasteboardStrategy()->stringForType(NSURLPboardType, m_pasteboardName);