[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
eric at webkit.org
eric at webkit.org
Tue Jan 5 23:48:15 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 520134c7d94bc1211b6b691a6ce614523661efb0
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Dec 13 03:02:14 2009 +0000
2009-12-12 Kenneth Russell <kbr at google.com>
Reviewed by Oliver Hunt.
Errors in WebGL[T]Array set() and get() methods
https://bugs.webkit.org/show_bug.cgi?id=32456
Test: fast/canvas/webgl/bug-32456.html
* fast/canvas/webgl/array-unit-tests.html:
* fast/canvas/webgl/bug-32456-expected.txt: Added.
* fast/canvas/webgl/bug-32456.html: Added.
2009-12-12 Kenneth Russell <kbr at google.com>
Reviewed by Oliver Hunt.
Errors in WebGL[T]Array set() and get() methods
https://bugs.webkit.org/show_bug.cgi?id=32456
Test: fast/canvas/webgl/bug-32456.html
* bindings/js/JSWebGLFloatArrayCustom.cpp:
(WebCore::JSWebGLFloatArray::set):
* bindings/js/JSWebGLIntArrayCustom.cpp:
(WebCore::JSWebGLIntArray::set):
* bindings/js/JSWebGLShortArrayCustom.cpp:
(WebCore::JSWebGLShortArray::set):
* bindings/js/JSWebGLUnsignedByteArrayCustom.cpp:
(WebCore::JSWebGLUnsignedByteArray::set):
* bindings/js/JSWebGLUnsignedIntArrayCustom.cpp:
(WebCore::JSWebGLUnsignedIntArray::set):
* bindings/js/JSWebGLUnsignedShortArrayCustom.cpp:
(WebCore::JSWebGLUnsignedShortArray::set):
* bindings/v8/custom/V8WebGLArrayCustom.h:
(WebCore::setWebGLArray):
* html/canvas/WebGLFloatArray.idl:
* html/canvas/WebGLUnsignedIntArray.idl:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e910554..d431ef9 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -2,6 +2,19 @@
Reviewed by Oliver Hunt.
+ Errors in WebGL[T]Array set() and get() methods
+ https://bugs.webkit.org/show_bug.cgi?id=32456
+
+ Test: fast/canvas/webgl/bug-32456.html
+
+ * fast/canvas/webgl/array-unit-tests.html:
+ * fast/canvas/webgl/bug-32456-expected.txt: Added.
+ * fast/canvas/webgl/bug-32456.html: Added.
+
+2009-12-12 Kenneth Russell <kbr at google.com>
+
+ Reviewed by Oliver Hunt.
+
Update WebGL tests to released versions
https://bugs.webkit.org/show_bug.cgi?id=32457
diff --git a/LayoutTests/fast/canvas/webgl/array-unit-tests.html b/LayoutTests/fast/canvas/webgl/array-unit-tests.html
index ecfa076..e6b06af 100644
--- a/LayoutTests/fast/canvas/webgl/array-unit-tests.html
+++ b/LayoutTests/fast/canvas/webgl/array-unit-tests.html
@@ -335,6 +335,11 @@ function testBoundaryConditions(type, name, lowValue, expectedLowValue, highValu
assertEq('Element 0', expectedLowValue, array[0]);
array[0] = highValue;
assertEq('Element 0', expectedHighValue, array[0]);
+ // Test the get and set methods with these values
+ array.set(0, lowValue);
+ assertEq('Element 0 set / get', expectedLowValue, array.get(0));
+ array.set(0, highValue);
+ assertEq('Element 0 set / get', expectedHighValue, array.get(0));
pass();
} catch (e) {
fail(e);
diff --git a/LayoutTests/fast/canvas/webgl/bug-32456-expected.txt b/LayoutTests/fast/canvas/webgl/bug-32456-expected.txt
new file mode 100644
index 0000000..0e1923a
--- /dev/null
+++ b/LayoutTests/fast/canvas/webgl/bug-32456-expected.txt
@@ -0,0 +1,47 @@
+Regression test for https://bugs.webkit.org/show_bug.cgi?id=32456 : Errors in WebGL[T]Array set() and get() methods
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+Testing WebGLFloatArray get / set
+PASS array.get(0) is 1.5
+PASS array[0] is 1.5
+PASS array.set(0, 2.5) is undefined.
+PASS array.get(0) is 2.5
+PASS array[0] is 2.5
+Testing WebGLByteArray get / set
+PASS array.set(0, 127) is undefined.
+PASS array.get(0) is 127
+PASS array[0] is 127
+PASS array.set(0, -128) is undefined.
+PASS array.get(0) is -128
+PASS array[0] is -128
+Testing WebGLUnsignedByteArray get / set
+PASS array.set(0, 255) is undefined.
+PASS array.get(0) is 255
+PASS array[0] is 255
+Testing WebGLShortArray get / set
+PASS array.set(0, 32767) is undefined.
+PASS array.get(0) is 32767
+PASS array[0] is 32767
+PASS array.set(0, -32768) is undefined.
+PASS array.get(0) is -32768
+PASS array[0] is -32768
+Testing WebGLUnsignedShortArray get / set
+PASS array.set(0, 65535) is undefined.
+PASS array.get(0) is 65535
+PASS array[0] is 65535
+Testing WebGLIntArray get / set
+PASS array.set(0, -2147483648) is undefined.
+PASS array.get(0) is -2147483648
+PASS array[0] is -2147483648
+PASS array.set(0, 2147483647) is undefined.
+PASS array.get(0) is 2147483647
+PASS array[0] is 2147483647
+Testing WebGLUnsignedIntArray get / set
+PASS array.set(0, 4294967295) is undefined.
+PASS array.get(0) is 4294967295
+PASS array[0] is 4294967295
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/canvas/webgl/bug-32456.html b/LayoutTests/fast/canvas/webgl/bug-32456.html
new file mode 100644
index 0000000..50ec8f4
--- /dev/null
+++ b/LayoutTests/fast/canvas/webgl/bug-32456.html
@@ -0,0 +1,74 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="resources/webgl-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+
+description('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=32456">https://bugs.webkit.org/show_bug.cgi?id=32456</a> : <code>Errors in WebGL[T]Array set() and get() methods</code>');
+
+debug("Testing WebGLFloatArray get / set");
+var array = new WebGLFloatArray([1.5]);
+shouldBe("array.get(0)", "1.5");
+shouldBe("array[0]", "1.5");
+shouldBeUndefined("array.set(0, 2.5)");
+shouldBe("array.get(0)", "2.5");
+shouldBe("array[0]", "2.5");
+
+debug("Testing WebGLByteArray get / set");
+array = new WebGLByteArray(1);
+shouldBeUndefined("array.set(0, 127)");
+shouldBe("array.get(0)", "127");
+shouldBe("array[0]", "127");
+shouldBeUndefined("array.set(0, -128)");
+shouldBe("array.get(0)", "-128");
+shouldBe("array[0]", "-128");
+
+debug("Testing WebGLUnsignedByteArray get / set");
+array = new WebGLUnsignedByteArray(1);
+shouldBeUndefined("array.set(0, 255)");
+shouldBe("array.get(0)", "255");
+shouldBe("array[0]", "255");
+
+debug("Testing WebGLShortArray get / set");
+array = new WebGLShortArray(1);
+shouldBeUndefined("array.set(0, 32767)");
+shouldBe("array.get(0)", "32767");
+shouldBe("array[0]", "32767");
+shouldBeUndefined("array.set(0, -32768)");
+shouldBe("array.get(0)", "-32768");
+shouldBe("array[0]", "-32768");
+
+debug("Testing WebGLUnsignedShortArray get / set");
+array = new WebGLUnsignedShortArray(1);
+shouldBeUndefined("array.set(0, 65535)");
+shouldBe("array.get(0)", "65535");
+shouldBe("array[0]", "65535");
+
+debug("Testing WebGLIntArray get / set");
+array = new WebGLIntArray(1);
+shouldBeUndefined("array.set(0, -2147483648)");
+shouldBe("array.get(0)", "-2147483648");
+shouldBe("array[0]", "-2147483648");
+shouldBeUndefined("array.set(0, 2147483647)");
+shouldBe("array.get(0)", "2147483647");
+shouldBe("array[0]", "2147483647");
+
+debug("Testing WebGLUnsignedIntArray get / set");
+array = new WebGLUnsignedIntArray(1);
+shouldBeUndefined("array.set(0, 4294967295)");
+shouldBe("array.get(0)", "4294967295");
+shouldBe("array[0]", "4294967295");
+
+successfullyParsed = true;
+
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ba39cd3..87c7858 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,32 @@
Reviewed by Oliver Hunt.
+ Errors in WebGL[T]Array set() and get() methods
+ https://bugs.webkit.org/show_bug.cgi?id=32456
+
+ Test: fast/canvas/webgl/bug-32456.html
+
+ * bindings/js/JSWebGLFloatArrayCustom.cpp:
+ (WebCore::JSWebGLFloatArray::set):
+ * bindings/js/JSWebGLIntArrayCustom.cpp:
+ (WebCore::JSWebGLIntArray::set):
+ * bindings/js/JSWebGLShortArrayCustom.cpp:
+ (WebCore::JSWebGLShortArray::set):
+ * bindings/js/JSWebGLUnsignedByteArrayCustom.cpp:
+ (WebCore::JSWebGLUnsignedByteArray::set):
+ * bindings/js/JSWebGLUnsignedIntArrayCustom.cpp:
+ (WebCore::JSWebGLUnsignedIntArray::set):
+ * bindings/js/JSWebGLUnsignedShortArrayCustom.cpp:
+ (WebCore::JSWebGLUnsignedShortArray::set):
+ * bindings/v8/custom/V8WebGLArrayCustom.h:
+ (WebCore::setWebGLArray):
+ * html/canvas/WebGLFloatArray.idl:
+ * html/canvas/WebGLUnsignedIntArray.idl:
+
+2009-12-12 Kenneth Russell <kbr at google.com>
+
+ Reviewed by Oliver Hunt.
+
Update WebGL tests to released versions
https://bugs.webkit.org/show_bug.cgi?id=32457
diff --git a/WebCore/bindings/js/JSWebGLFloatArrayCustom.cpp b/WebCore/bindings/js/JSWebGLFloatArrayCustom.cpp
index 5f5b24f..bcb8bab 100644
--- a/WebCore/bindings/js/JSWebGLFloatArrayCustom.cpp
+++ b/WebCore/bindings/js/JSWebGLFloatArrayCustom.cpp
@@ -52,9 +52,9 @@ JSC::JSValue JSWebGLFloatArray::set(JSC::ExecState* exec, JSC::ArgList const& ar
return throwError(exec, SyntaxError);
if (args.size() == 2 && args.at(0).isInt32()) {
- // void set(in unsigned long index, in long value);
+ // void set(in unsigned long index, in float value);
unsigned index = args.at(0).toUInt32(exec);
- impl()->set(index, static_cast<signed char>(args.at(1).toInt32(exec)));
+ impl()->set(index, static_cast<float>(args.at(1).toNumber(exec)));
return jsUndefined();
}
diff --git a/WebCore/bindings/js/JSWebGLIntArrayCustom.cpp b/WebCore/bindings/js/JSWebGLIntArrayCustom.cpp
index 9c384d8..de08256 100644
--- a/WebCore/bindings/js/JSWebGLIntArrayCustom.cpp
+++ b/WebCore/bindings/js/JSWebGLIntArrayCustom.cpp
@@ -54,7 +54,7 @@ JSC::JSValue JSWebGLIntArray::set(JSC::ExecState* exec, JSC::ArgList const& args
if (args.size() == 2 && args.at(0).isInt32()) {
// void set(in unsigned long index, in long value);
unsigned index = args.at(0).toUInt32(exec);
- impl()->set(index, static_cast<signed char>(args.at(1).toInt32(exec)));
+ impl()->set(index, static_cast<signed int>(args.at(1).toInt32(exec)));
return jsUndefined();
}
diff --git a/WebCore/bindings/js/JSWebGLShortArrayCustom.cpp b/WebCore/bindings/js/JSWebGLShortArrayCustom.cpp
index 462b09a..899b0c9 100644
--- a/WebCore/bindings/js/JSWebGLShortArrayCustom.cpp
+++ b/WebCore/bindings/js/JSWebGLShortArrayCustom.cpp
@@ -54,7 +54,7 @@ JSC::JSValue JSWebGLShortArray::set(JSC::ExecState* exec, JSC::ArgList const& ar
if (args.size() == 2 && args.at(0).isInt32()) {
// void set(in unsigned long index, in long value);
unsigned index = args.at(0).toUInt32(exec);
- impl()->set(index, static_cast<signed char>(args.at(1).toInt32(exec)));
+ impl()->set(index, static_cast<signed short>(args.at(1).toInt32(exec)));
return jsUndefined();
}
diff --git a/WebCore/bindings/js/JSWebGLUnsignedByteArrayCustom.cpp b/WebCore/bindings/js/JSWebGLUnsignedByteArrayCustom.cpp
index 35a545d..b576374 100644
--- a/WebCore/bindings/js/JSWebGLUnsignedByteArrayCustom.cpp
+++ b/WebCore/bindings/js/JSWebGLUnsignedByteArrayCustom.cpp
@@ -54,7 +54,7 @@ JSC::JSValue JSWebGLUnsignedByteArray::set(JSC::ExecState* exec, JSC::ArgList co
if (args.size() == 2 && args.at(0).isInt32()) {
// void set(in unsigned long index, in long value);
unsigned index = args.at(0).toUInt32(exec);
- impl()->set(index, static_cast<signed char>(args.at(1).toInt32(exec)));
+ impl()->set(index, static_cast<unsigned char>(args.at(1).toInt32(exec)));
return jsUndefined();
}
diff --git a/WebCore/bindings/js/JSWebGLUnsignedIntArrayCustom.cpp b/WebCore/bindings/js/JSWebGLUnsignedIntArrayCustom.cpp
index ea28111..5a27a30 100644
--- a/WebCore/bindings/js/JSWebGLUnsignedIntArrayCustom.cpp
+++ b/WebCore/bindings/js/JSWebGLUnsignedIntArrayCustom.cpp
@@ -54,7 +54,7 @@ JSC::JSValue JSWebGLUnsignedIntArray::set(JSC::ExecState* exec, JSC::ArgList con
if (args.size() == 2 && args.at(0).isInt32()) {
// void set(in unsigned long index, in long value);
unsigned index = args.at(0).toUInt32(exec);
- impl()->set(index, static_cast<signed char>(args.at(1).toInt32(exec)));
+ impl()->set(index, static_cast<unsigned int>(args.at(1).toUInt32(exec)));
return jsUndefined();
}
diff --git a/WebCore/bindings/js/JSWebGLUnsignedShortArrayCustom.cpp b/WebCore/bindings/js/JSWebGLUnsignedShortArrayCustom.cpp
index 898cc06..0c82c3e 100644
--- a/WebCore/bindings/js/JSWebGLUnsignedShortArrayCustom.cpp
+++ b/WebCore/bindings/js/JSWebGLUnsignedShortArrayCustom.cpp
@@ -54,7 +54,7 @@ JSC::JSValue JSWebGLUnsignedShortArray::set(JSC::ExecState* exec, JSC::ArgList c
if (args.size() == 2 && args.at(0).isInt32()) {
// void set(in unsigned long index, in long value);
unsigned index = args.at(0).toUInt32(exec);
- impl()->set(index, static_cast<signed char>(args.at(1).toInt32(exec)));
+ impl()->set(index, static_cast<unsigned short>(args.at(1).toInt32(exec)));
return jsUndefined();
}
diff --git a/WebCore/bindings/v8/custom/V8WebGLArrayCustom.h b/WebCore/bindings/v8/custom/V8WebGLArrayCustom.h
index 1a4b6a4..77850f5 100644
--- a/WebCore/bindings/v8/custom/V8WebGLArrayCustom.h
+++ b/WebCore/bindings/v8/custom/V8WebGLArrayCustom.h
@@ -194,7 +194,7 @@ v8::Handle<v8::Value> setWebGLArray(const v8::Arguments& args,
CPlusPlusArrayType* array = V8DOMWrapper::convertToNativeObject<CPlusPlusArrayType>(wrapperType, args.Holder());
if (args.Length() == 2 && args[0]->IsInt32()) {
- // void set(in unsigned long index, in long value);
+ // void set(in unsigned long index, in {long|float} value);
uint32_t index = toInt32(args[0]);
array->set(index, args[1]->NumberValue());
return v8::Undefined();
diff --git a/WebCore/html/canvas/WebGLFloatArray.idl b/WebCore/html/canvas/WebGLFloatArray.idl
index 83479b3..de0eb3b 100644
--- a/WebCore/html/canvas/WebGLFloatArray.idl
+++ b/WebCore/html/canvas/WebGLFloatArray.idl
@@ -33,8 +33,8 @@ module html {
GenerateCustomConstructor,
CustomToJS
] WebGLFloatArray : WebGLArray {
- long get(in unsigned long index);
- // void set(in unsigned long index, in long value);
+ float get(in unsigned long index);
+ // void set(in unsigned long index, in float value);
// void set(in WebGLFloatArray array, [Optional] in unsigned long offset);
// void set(in sequence<long> array, [Optional] in unsigned long offset);
[Custom] void set();
diff --git a/WebCore/html/canvas/WebGLUnsignedIntArray.idl b/WebCore/html/canvas/WebGLUnsignedIntArray.idl
index 8697e70..263cc54 100644
--- a/WebCore/html/canvas/WebGLUnsignedIntArray.idl
+++ b/WebCore/html/canvas/WebGLUnsignedIntArray.idl
@@ -33,7 +33,7 @@ module html {
GenerateCustomConstructor,
CustomToJS
] WebGLUnsignedIntArray : WebGLArray {
- long get(in unsigned long index);
+ unsigned long get(in unsigned long index);
// void set(in unsigned long index, in long value);
// void set(in WebGLUnsignedIntArray array, [Optional] in unsigned long offset);
// void set(in sequence<long> array, [Optional] in unsigned long offset);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list