Title: [221067] trunk
- Revision
- 221067
- Author
- [email protected]
- Date
- 2017-08-22 21:54:59 -0700 (Tue, 22 Aug 2017)
Log Message
Consolidate the code to normalize MIME type in DataTransfer
https://bugs.webkit.org/show_bug.cgi?id=175810
Rubber-stamped by Wenson Hsieh.
Address the forgotten review comment by Wenson.
Source/WebCore:
Tests: editing/pasteboard/datatransfer-getdata-plaintext.html
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::clearData):
LayoutTests:
* editing/pasteboard/datatransfer-getdata-plaintext-expected.txt:
* editing/pasteboard/datatransfer-getdata-plaintext.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (221066 => 221067)
--- trunk/LayoutTests/ChangeLog 2017-08-23 04:47:26 UTC (rev 221066)
+++ trunk/LayoutTests/ChangeLog 2017-08-23 04:54:59 UTC (rev 221067)
@@ -1,3 +1,15 @@
+2017-08-22 Ryosuke Niwa <[email protected]>
+
+ Consolidate the code to normalize MIME type in DataTransfer
+ https://bugs.webkit.org/show_bug.cgi?id=175810
+
+ Rubber-stamped by Wenson Hsieh.
+
+ Address the forgotten review comment by Wenson.
+
+ * editing/pasteboard/datatransfer-getdata-plaintext-expected.txt:
+ * editing/pasteboard/datatransfer-getdata-plaintext.html:
+
2017-08-22 Wenson Hsieh <[email protected]>
[iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div
Modified: trunk/LayoutTests/editing/pasteboard/datatransfer-getdata-plaintext-expected.txt (221066 => 221067)
--- trunk/LayoutTests/editing/pasteboard/datatransfer-getdata-plaintext-expected.txt 2017-08-23 04:47:26 UTC (rev 221066)
+++ trunk/LayoutTests/editing/pasteboard/datatransfer-getdata-plaintext-expected.txt 2017-08-23 04:54:59 UTC (rev 221067)
@@ -6,6 +6,7 @@
PASS clipboardData.setData(" text/PLAIN ", "hello"); clipboardData.getData("text/plain") is "hello"
PASS clipboardData.setData(" tEXT/pLaIN", "world"); clipboardData.getData("text/plain") is "world"
PASS clipboardData.setData("text/plain; charset=utf-8", "hello"); clipboardData.getData("text/plain; charset=Shift_JIS") is "hello"
+PASS clipboardData.clearData("url"); clipboardData.getData("text/plain") is "hello"
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/editing/pasteboard/datatransfer-getdata-plaintext.html (221066 => 221067)
--- trunk/LayoutTests/editing/pasteboard/datatransfer-getdata-plaintext.html 2017-08-23 04:47:26 UTC (rev 221066)
+++ trunk/LayoutTests/editing/pasteboard/datatransfer-getdata-plaintext.html 2017-08-23 04:54:59 UTC (rev 221067)
@@ -19,6 +19,7 @@
shouldBeEqualToString('clipboardData.setData(" text/PLAIN ", "hello"); clipboardData.getData("text/plain")', 'hello');
shouldBeEqualToString('clipboardData.setData(" tEXT/pLaIN", "world"); clipboardData.getData("text/plain")', 'world');
shouldBeEqualToString('clipboardData.setData("text/plain; charset=utf-8", "hello"); clipboardData.getData("text/plain; charset=Shift_JIS")', 'hello');
+ shouldBeEqualToString('clipboardData.clearData("url"); clipboardData.getData("text/plain")', 'hello');
document.getElementById('container').style.display = 'none';
finishJSTest();
}
Modified: trunk/Source/WebCore/ChangeLog (221066 => 221067)
--- trunk/Source/WebCore/ChangeLog 2017-08-23 04:47:26 UTC (rev 221066)
+++ trunk/Source/WebCore/ChangeLog 2017-08-23 04:54:59 UTC (rev 221067)
@@ -1,3 +1,17 @@
+2017-08-22 Ryosuke Niwa <[email protected]>
+
+ Consolidate the code to normalize MIME type in DataTransfer
+ https://bugs.webkit.org/show_bug.cgi?id=175810
+
+ Rubber-stamped by Wenson Hsieh.
+
+ Address the forgotten review comment by Wenson.
+
+ Tests: editing/pasteboard/datatransfer-getdata-plaintext.html
+
+ * dom/DataTransfer.cpp:
+ (WebCore::DataTransfer::clearData):
+
2017-08-20 Wenson Hsieh <[email protected]>
[iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div
Modified: trunk/Source/WebCore/dom/DataTransfer.cpp (221066 => 221067)
--- trunk/Source/WebCore/dom/DataTransfer.cpp 2017-08-23 04:47:26 UTC (rev 221066)
+++ trunk/Source/WebCore/dom/DataTransfer.cpp 2017-08-23 04:54:59 UTC (rev 221067)
@@ -123,12 +123,12 @@
return;
String normalizedType = normalizeType(type);
- if (type.isNull())
+ if (normalizedType.isNull())
m_pasteboard->clear();
else
- m_pasteboard->clear(type);
+ m_pasteboard->clear(normalizedType);
if (m_itemList)
- m_itemList->didClearStringData(type);
+ m_itemList->didClearStringData(normalizedType);
}
String DataTransfer::getData(const String& type) const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes