- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7708
REGRESSION: Flash callback to JavaScript function not working.
Test: plugins/invoke.html
* bindings/c/c_utility.cpp:
(KJS::Bindings::convertUTF8ToUTF16): Return a correct string length.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13263
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-03-12 Alexey Proskuryakov <ap@nypop.com>
+
+ Reviewed by Maciej.
+
+ - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7708
+ REGRESSION: Flash callback to JavaScript function not working.
+
+ Test: plugins/invoke.html
+
+ * bindings/c/c_utility.cpp:
+ (KJS::Bindings::convertUTF8ToUTF16): Return a correct string length.
+
2006-03-08 Eric Seidel <eseidel@apple.com>
Reviewed by darin.
if (U_SUCCESS(status)) {
*UTF16Chars = (NPUTF16 *)malloc(sizeof(NPUTF16) * (*UTF16Length));
ucnv_setToUCallBack(conv, UCNV_TO_U_CALLBACK_STOP, 0, 0, 0, &status);
- ucnv_toUChars(conv, *UTF16Chars, *UTF16Length, UTF8Chars, UTF8Length, &status);
+ *UTF16Length = ucnv_toUChars(conv, *UTF16Chars, *UTF16Length, UTF8Chars, UTF8Length, &status);
ucnv_close(conv);
}
// There is no "bad data" for latin1. It is unlikely that the plugin was really sending text in this encoding,
// but it should have used UTF-8, and now we are simply avoiding a crash.
if (!U_SUCCESS(status)) {
+ *UTF16Length = UTF8Length;
+
if (!*UTF16Chars) // If the memory wasn't allocated, allocate it.
*UTF16Chars = (NPUTF16 *)malloc(sizeof(NPUTF16) * (*UTF16Length));
for (unsigned i = 0; i < *UTF16Length; i++)
(*UTF16Chars)[i] = UTF8Chars[i] & 0xFF;
-
}
}
+2006-03-12 Alexey Proskuryakov <ap@nypop.com>
+
+ Reviewed by Maciej.
+
+ - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=7708
+ REGRESSION: Flash callback to JavaScript function not working.
+
+ * plugins/invoke-expected.txt: Added.
+ * plugins/invoke.html: Added.
+
2006-03-12 David Kilzer <ddkilzer@kilzer.net>
Reviewed by Darin, landed by ap.
--- /dev/null
+
+Test for bug 7708: REGRESSION: Flash callback to JavaScript function not working.
+
+SUCCESS
+
--- /dev/null
+<html>
+<body>
+<embed name="plg" type="application/x-webkit-test-netscape"></embed>
+<p>Test for <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=7708">bug 7708</a>:
+REGRESSION: Flash callback to JavaScript function not working.</p>
+<div id=res>FAILURE</div>
+<script>
+
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ function MyCallback() {
+ document.getElementById('res').innerHTML = 'SUCCESS';
+ }
+
+ try {
+
+ plg.testCallback('MyCallback');
+
+ } catch (ex) {
+ alert("Exception: " + ex.description);
+ }
+</script>
+</body>
+</html>