[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

aroben at apple.com aroben at apple.com
Thu Apr 8 01:12:51 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 657e0bd33bb3cf6d3b60b4e70703ad113f9c058c
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 18 17:20:01 2010 +0000

    DataTransfer interface broken on Windows--types member is always undefined, and getData() does not work.
    
    https://bugs.webkit.org/show_bug.cgi?id=30527
    
    Patch by Daniel Cheng <dcheng at google.com> on 2010-01-18
    Reviewed by Adam Roben.
    
    WebCore:
    
    * platform/win/ClipboardWin.cpp:
    (WebCore::addMimeTypesForFormat): pass FORMATETC as a const ref.
    (WebCore::ClipboardWin::types): fix calls to IEnumFORMATETC.
    (WebCore::ClipboardWin::hasData): fix calls to IEnumFORMATETC.
    
    LayoutTests:
    
    * fast/events/drag-and-drop-dataTransfer-types-nocrash-expected.txt: Updated test expectations.
    * fast/events/drag-and-drop-dataTransfer-types-nocrash.html: Added test cases.
    * platform/win/Skipped: Re-enabled fast/events/drag-and-drop-dataTransfer-types-nocrash.html
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53410 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 69bd14b..9d79a77 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-18  Daniel Cheng  <dcheng at google.com>
+
+        Reviewed by Adam Roben
+
+        DataTransfer interface broken on Windows--types member is always
+        undefined, and getData() does not work.
+        https://bugs.webkit.org/show_bug.cgi?id=30527
+
+        * fast/events/drag-and-drop-dataTransfer-types-nocrash-expected.txt: Updated test expectations.
+        * fast/events/drag-and-drop-dataTransfer-types-nocrash.html: Added test cases.
+        * platform/win/Skipped: Re-enabled fast/events/drag-and-drop-dataTransfer-types-nocrash.html
+
 2010-01-17  Csaba Osztrogonác  <ossy at webkit.org>
 
         Rubber-stamped by Eric Seidel.
diff --git a/LayoutTests/fast/events/drag-and-drop-dataTransfer-types-nocrash-expected.txt b/LayoutTests/fast/events/drag-and-drop-dataTransfer-types-nocrash-expected.txt
index afe730a..669baf2 100644
--- a/LayoutTests/fast/events/drag-and-drop-dataTransfer-types-nocrash-expected.txt
+++ b/LayoutTests/fast/events/drag-and-drop-dataTransfer-types-nocrash-expected.txt
@@ -4,6 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS event.dataTransfer.types contains format "text/plain"
+PASS event.dataTransfer.getData("text/plain") contains "Square"
 
 TEST COMPLETE
 
diff --git a/LayoutTests/fast/events/drag-and-drop-dataTransfer-types-nocrash.html b/LayoutTests/fast/events/drag-and-drop-dataTransfer-types-nocrash.html
index a37b0e6..40eb13f 100644
--- a/LayoutTests/fast/events/drag-and-drop-dataTransfer-types-nocrash.html
+++ b/LayoutTests/fast/events/drag-and-drop-dataTransfer-types-nocrash.html
@@ -89,6 +89,11 @@
             testFailed('event.dataTransfer.types should contain format "' + FORMAT_TYPE + '", but it does not.');
         else
             testPassed('event.dataTransfer.types contains format "' + FORMAT_TYPE + '"');
+
+        if (event.dataTransfer.getData(FORMAT_TYPE) != 'Square')
+            testFailed('event.dataTransfer.getData("' + FORMAT_TYPE + '") should contain "Square", but it does not.');
+        else
+            testPassed('event.dataTransfer.getData("' + FORMAT_TYPE + '") contains "Square"');
     }
 
     function runTest()
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 1f81ec8..9c7c186 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -109,9 +109,6 @@ editing/selection/drag-in-iframe.html
 fast/events/drag-in-frames.html
 fast/events/standalone-image-drag-to-editable.html
 
-# Event.dataTransfer.types does not behave correctly (https://bugs.webkit.org/show_bug.cgi?id=30527)
-fast/events/drag-and-drop-dataTransfer-types-nocrash.html
-
 # <rdar://problem/5643675> window.scrollTo scrolls a window with no scrollbars
 fast/events/attempt-scroll-with-no-scrollbars.html
 
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6c10ce0..5e735cf 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-18  Daniel Cheng  <dcheng at google.com>
+
+        Reviewed by Adam Roben.
+
+        DataTransfer interface broken on Windows--types member is always
+        undefined, and getData() does not work.
+        https://bugs.webkit.org/show_bug.cgi?id=30527
+
+        * platform/win/ClipboardWin.cpp:
+        (WebCore::addMimeTypesForFormat): pass FORMATETC as a const ref.
+        (WebCore::ClipboardWin::types): fix calls to IEnumFORMATETC.
+        (WebCore::ClipboardWin::hasData): fix calls to IEnumFORMATETC.
+
 2010-01-18  Mikhail Naganov  <mnaganov at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/platform/win/ClipboardWin.cpp b/WebCore/platform/win/ClipboardWin.cpp
index b75ce46..f83927d 100644
--- a/WebCore/platform/win/ClipboardWin.cpp
+++ b/WebCore/platform/win/ClipboardWin.cpp
@@ -534,7 +534,7 @@ bool ClipboardWin::setData(const String& type, const String& data)
     return false;
 }
 
-static void addMimeTypesForFormat(HashSet<String>& results, FORMATETC& format)
+static void addMimeTypesForFormat(HashSet<String>& results, const FORMATETC& format)
 {
     // URL and Text are provided for compatibility with IE's model
     if (format.cfFormat == urlFormat()->cfFormat || format.cfFormat == urlWFormat()->cfFormat) {
@@ -560,7 +560,7 @@ HashSet<String> ClipboardWin::types() const
 
     COMPtr<IEnumFORMATETC> itr;
 
-    if (FAILED(m_dataObject->EnumFormatEtc(0, &itr)))
+    if (FAILED(m_dataObject->EnumFormatEtc(DATADIR_GET, &itr)))
         return results;
 
     if (!itr)
@@ -568,7 +568,8 @@ HashSet<String> ClipboardWin::types() const
 
     FORMATETC data;
 
-    while (SUCCEEDED(itr->Next(1, &data, 0))) {
+    // IEnumFORMATETC::Next returns S_FALSE if there are no more items.
+    while (itr->Next(1, &data, 0) == S_OK) {
         addMimeTypesForFormat(results, data);
     }
 
@@ -781,7 +782,7 @@ bool ClipboardWin::hasData()
         return false;
 
     COMPtr<IEnumFORMATETC> itr;
-    if (FAILED(m_dataObject->EnumFormatEtc(0, &itr)))
+    if (FAILED(m_dataObject->EnumFormatEtc(DATADIR_GET, &itr)))
         return false;
 
     if (!itr)
@@ -789,7 +790,8 @@ bool ClipboardWin::hasData()
 
     FORMATETC data;
 
-    if (SUCCEEDED(itr->Next(1, &data, 0))) {
+    // IEnumFORMATETC::Next returns S_FALSE if there are no more items.
+    if (itr->Next(1, &data, 0) == S_OK) {
         // There is at least one item in the IDataObject
         return true;
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list