https://bugs.webkit.org/show_bug.cgi?id=76947
Reviewed by Adam Barth.
Source/WebCore:
This matches the HTML5 spec which says the first thing to do is to lowercase
the type before comparing.
I also removed the stripping of whitespace since that is not part of the modern spec (and no tests failed as a result of removal).
Turns out we already had a test for case sensitivity, but it was disabled on Mac
so I just re-enabled it and have added failing expectations for the parts
of the test we still fail.
* platform/mac/ClipboardMac.mm:
(WebCore::cocoaTypeFromHTMLClipboardType):
(WebCore::ClipboardMac::getData):
LayoutTests:
This test has been disabled on Mac since it was added 2 years ago.
But we actually need to fix at least one of the bugs covered by this
test, so I'm unskipping it and adding failing expectations for the
parts Mac doens't yet pass.
* platform/mac/Skipped:
* platform/mac/editing/pasteboard/dataTransfer-setData-getData-expected.txt: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105941
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2012-01-25 Eric Seidel <eric@webkit.org>
+ "text" and "URL" legacy clipboard types should not be case sensitive
+ https://bugs.webkit.org/show_bug.cgi?id=76947
+
+ Reviewed by Adam Barth.
+
+ This test has been disabled on Mac since it was added 2 years ago.
+ But we actually need to fix at least one of the bugs covered by this
+ test, so I'm unskipping it and adding failing expectations for the
+ parts Mac doens't yet pass.
+
+ * platform/mac/Skipped:
+ * platform/mac/editing/pasteboard/dataTransfer-setData-getData-expected.txt: Added.
+
+2012-01-25 Eric Seidel <eric@webkit.org>
+
HTMLEmbedObject should match HTMLObjectElement by stopping any load when it is removed from beforeload
https://bugs.webkit.org/show_bug.cgi?id=74360
--- Test set/get 'URL':
PASS getDataResultType is "string"
-PASS getDataResult is "http://test.com/"
+FAIL getDataResult should be http://test.com/. Was http://test.com.
--- Test set/get 'URL' with multiple URLs:
-PASS getDataResultType is "string"
-PASS getDataResult is "http://test.com/"
+FAIL getDataResultType should be string. Was undefined.
+FAIL getDataResult should be http://test.com/ (of type string). Was undefined (of type undefined).
--- Test set/get 'text/uri-list':
-PASS getDataResultType is "string"
-PASS getDataResult is "http://test.com\r\nhttp://check.com"
+FAIL getDataResultType should be string. Was undefined.
+FAIL getDataResult should be http://test.com
+http://check.com (of type string). Was undefined (of type undefined).
--- Test set/get 'text/uri-list' using '\n':
-PASS getDataResultType is "string"
-PASS getDataResult is "http://test.com\nhttp://check.com"
+FAIL getDataResultType should be string. Was undefined.
+FAIL getDataResult should be http://test.com
+http://check.com (of type string). Was undefined (of type undefined).
--- Test set 'text/uri-list', get 'URL':
-PASS getDataResultType is "string"
-PASS getDataResult is "http://test.com/"
+FAIL getDataResultType should be string. Was undefined.
+FAIL getDataResult should be http://test.com/ (of type string). Was undefined (of type undefined).
--- Test set 'URL', get 'text/uri-list':
-PASS getDataResultType is "string"
-PASS getDataResult is "http://test.com\r\nhttp://check.com"
+FAIL getDataResultType should be string. Was undefined.
+FAIL getDataResult should be http://test.com
+http://check.com (of type string). Was undefined (of type undefined).
--- Test set 'text/uri-list', get 'URL', using only '\n':
-PASS getDataResultType is "string"
-PASS getDataResult is "http://test.com/"
+FAIL getDataResultType should be string. Was undefined.
+FAIL getDataResult should be http://test.com/ (of type string). Was undefined (of type undefined).
--- Test set/get 'text/uri-list' with comments:
-PASS getDataResultType is "string"
-PASS getDataResult is "# comment\r\nhttp://test.com\r\nhttp://check.com"
+FAIL getDataResultType should be string. Was undefined.
+FAIL getDataResult should be # comment
+http://test.com
+http://check.com (of type string). Was undefined (of type undefined).
--- Test set 'text/uri-list', get 'URL' with comments:
-PASS getDataResultType is "string"
-PASS getDataResult is "http://test.com/"
+FAIL getDataResultType should be string. Was undefined.
+FAIL getDataResult should be http://test.com/ (of type string). Was undefined (of type undefined).
--- Test set 'text/uri-list', get 'URL' with only comments:
-PASS getDataResultType is "string"
-PASS getDataResult is ""
+FAIL getDataResultType should be string. Was undefined.
+FAIL getDataResult should be (of type string). Was undefined (of type undefined).
--- Test set/get 'text/plain':
PASS getDataResultType is "string"
PASS getDataResult is "Lorem ipsum dolor sit amet."
--- /dev/null
+Tests correct behavior of event.dataTransfer.setData/getData for 'URL', 'text/uri-list' and 'text/plain'
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+--- Test set/get 'URL':
+PASS getDataResultType is "string"
+PASS getDataResult is "http://test.com/"
+--- Test set/get 'URL' with multiple URLs:
+PASS getDataResultType is "string"
+PASS getDataResult is "http://test.com/"
+--- Test set/get 'text/uri-list':
+PASS getDataResultType is "string"
+PASS getDataResult is "http://test.com\r\nhttp://check.com"
+--- Test set/get 'text/uri-list' using '\n':
+PASS getDataResultType is "string"
+PASS getDataResult is "http://test.com\nhttp://check.com"
+--- Test set 'text/uri-list', get 'URL':
+PASS getDataResultType is "string"
+PASS getDataResult is "http://test.com/"
+--- Test set 'URL', get 'text/uri-list':
+PASS getDataResultType is "string"
+PASS getDataResult is "http://test.com\r\nhttp://check.com"
+--- Test set 'text/uri-list', get 'URL', using only '\n':
+PASS getDataResultType is "string"
+PASS getDataResult is "http://test.com/"
+--- Test set/get 'text/uri-list' with comments:
+PASS getDataResultType is "string"
+PASS getDataResult is "# comment\r\nhttp://test.com\r\nhttp://check.com"
+--- Test set 'text/uri-list', get 'URL' with comments:
+PASS getDataResultType is "string"
+PASS getDataResult is "http://test.com/"
+--- Test set 'text/uri-list', get 'URL' with only comments:
+PASS getDataResultType is "string"
+PASS getDataResult is ""
+--- Test set/get 'text/plain':
+PASS getDataResultType is "string"
+PASS getDataResult is "Lorem ipsum dolor sit amet."
+--- Test set 'text/plain', get 'text':
+PASS getDataResultType is "string"
+PASS getDataResult is "Lorem ipsum dolor sit amet."
+--- Test set 'text', get 'text/plain':
+PASS getDataResultType is "string"
+PASS getDataResult is "Lorem ipsum dolor sit amet."
+--- Test set/get 'text':
+PASS getDataResultType is "string"
+PASS getDataResult is "Lorem ipsum dolor sit amet."
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
# The animation causes the result of this test to depend on the speed of executing it, and that will cause it to be flaky
fast/dom/HTMLProgressElement/progress-element.html
-# event.dataTransfer.setData('text/uri-list') not correctly implemented on Mac
-editing/pasteboard/dataTransfer-setData-getData.html
-
# eventSender needs to propagate the event to the calling window, not the main frame always.
http/tests/plugins/plugin-document-has-focus.html
2012-01-25 Eric Seidel <eric@webkit.org>
+ "text" and "URL" legacy clipboard types should not be case sensitive
+ https://bugs.webkit.org/show_bug.cgi?id=76947
+
+ Reviewed by Adam Barth.
+
+ This matches the HTML5 spec which says the first thing to do is to lowercase
+ the type before comparing.
+ I also removed the stripping of whitespace since that is not part of the modern spec (and no tests failed as a result of removal).
+ Turns out we already had a test for case sensitivity, but it was disabled on Mac
+ so I just re-enabled it and have added failing expectations for the parts
+ of the test we still fail.
+
+ * platform/mac/ClipboardMac.mm:
+ (WebCore::cocoaTypeFromHTMLClipboardType):
+ (WebCore::ClipboardMac::getData):
+
+2012-01-25 Eric Seidel <eric@webkit.org>
+
HTMLIsIndexElement should not expose HTMLInputElement properties
https://bugs.webkit.org/show_bug.cgi?id=76095
static RetainPtr<NSString> cocoaTypeFromHTMLClipboardType(const String& type)
{
- String qType = type.stripWhiteSpace();
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dom-datatransfer-setdata
+ String qType = type.lower();
- // two special cases for IE compatibility
- if (qType == "Text")
- return NSStringPboardType;
- if (qType == "URL")
- return NSURLPboardType;
+ if (qType == "text")
+ qType = "text/plain";
+ if (qType == "url")
+ qType = "text/uri-list";
// Ignore any trailing charset - JS strings are Unicode, which encapsulates the charset issue
if (qType == "text/plain" || qType.startsWith("text/plain;"))
if (qType == "text/uri-list")
// special case because UTI doesn't work with Cocoa's URL type
return NSURLPboardType; // note special case in getData to read NSFilenamesType
-
+
// Try UTI now
NSString *mimeType = qType;
RetainPtr<CFStringRef> utiType(AdoptCF, UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (CFStringRef)mimeType, NULL));
// Grab the value off the pasteboard corresponding to the cocoaType
if ([cocoaType.get() isEqualToString:NSURLPboardType]) {
- // "URL" and "text/url-list" both map to NSURLPboardType in cocoaTypeFromHTMLClipboardType(), "URL" only wants the first URL
- bool onlyFirstURL = (type == "URL");
+ // "url" and "text/url-list" both map to NSURLPboardType in cocoaTypeFromHTMLClipboardType(), "url" only wants the first URL
+ bool onlyFirstURL = (equalIgnoringCase(type, "url"));
NSArray *absoluteURLs = absoluteURLsFromPasteboard(m_pasteboard.get(), onlyFirstURL);
cocoaValue = [absoluteURLs componentsJoinedByString:@"\n"];
} else if ([cocoaType.get() isEqualToString:NSStringPboardType]) {