[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

cmarrin at apple.com cmarrin at apple.com
Thu Oct 29 20:38:11 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 37904a5270252bb190b632c2bb1bd5a9fd6849b1
Author: cmarrin at apple.com <cmarrin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 2 17:49:33 2009 +0000

            WebGL crashes with recent CanvasArray change
            https://bugs.webkit.org/show_bug.cgi?id=30018
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49027 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 6edc83a..cfbfb8b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2009-10-02  Kenneth Russell  <kbr at google.com>
+
+        Reviewed by Oliver Hunt.
+
+        WebGL crashes with recent CanvasArray change
+        https://bugs.webkit.org/show_bug.cgi?id=30018
+
+        * fast/canvas/webgl/array-unit-tests-expected.html: Added.
+        * fast/canvas/webgl/array-unit-tests.html: Added.
+
 2009-10-02  Ben Murdoch  <benm at google.com>
 
         Reviewed by  David Kilzer.
diff --git a/LayoutTests/fast/canvas/webgl/array-unit-tests-expected.txt b/LayoutTests/fast/canvas/webgl/array-unit-tests-expected.txt
new file mode 100644
index 0000000..bbb9192
--- /dev/null
+++ b/LayoutTests/fast/canvas/webgl/array-unit-tests-expected.txt
@@ -0,0 +1,30 @@
+Verifies the functionality of the new array-like objects in the WebGL spec
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS test CanvasByteArray SetAndGetPos10ToNeg10
+PASS test CanvasByteArray ConstructWithArrayOfSignedValues
+PASS test CanvasByteArray BoundaryConditions(-128, -128, 127, 127)
+PASS test CanvasFloatArray SetAndGetPos10ToNeg10
+PASS test CanvasFloatArray ConstructWithArrayOfSignedValues
+PASS test CanvasFloatArray BoundaryConditions(-500, -500, 500, 500)
+PASS test CanvasIntArray SetAndGetPos10ToNeg10
+PASS test CanvasIntArray ConstructWithArrayOfSignedValues
+PASS test CanvasIntArray BoundaryConditions(-2147483648, -2147483648, 2147483647, 2147483647)
+PASS test CanvasShortArray SetAndGetPos10ToNeg10
+PASS test CanvasShortArray ConstructWithArrayOfSignedValues
+PASS test CanvasShortArray BoundaryConditions(-32768, -32768, 32767, 32767)
+PASS test CanvasUnsignedByteArray SetAndGet10To1
+PASS test CanvasUnsignedByteArray ConstructWithArrayOfUnsignedValues
+PASS test CanvasUnsignedByteArray BoundaryConditions(0, 0, 255, 255)
+PASS test CanvasUnsignedIntArray SetAndGet10To1
+PASS test CanvasUnsignedIntArray ConstructWithArrayOfUnsignedValues
+PASS test CanvasUnsignedIntArray BoundaryConditions(0, 0, 4294967295, 4294967295)
+PASS test CanvasUnsignedShortArray SetAndGet10To1
+PASS test CanvasUnsignedShortArray ConstructWithArrayOfUnsignedValues
+PASS test CanvasUnsignedShortArray BoundaryConditions(0, 0, 65535, 65535)
+Test passed.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/canvas/webgl/array-unit-tests.html b/LayoutTests/fast/canvas/webgl/array-unit-tests.html
new file mode 100644
index 0000000..cbadd1f
--- /dev/null
+++ b/LayoutTests/fast/canvas/webgl/array-unit-tests.html
@@ -0,0 +1,229 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+
+if (window.layoutTestController)
+    layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
+
+description("Verifies the functionality of the new array-like objects in the WebGL spec");
+
+var currentlyRunning = '';
+var allPassed = true;
+function running(str) {
+  currentlyRunning = str;
+}
+
+function output(str) {
+  debug(str);
+}
+
+function pass() {
+  testPassed(currentlyRunning);
+}
+
+function fail(str) {
+  var exc = 'FAILED: ' + currentlyRunning + ': ' + str;
+  testFailed(str);
+}
+
+function assertEq(prefix, expected, val) {
+  if (expected != val) {
+    fail(prefix + ': expected ' + expected + ', got ' + val);
+  }
+}
+
+function printSummary() {
+  if (allPassed) {
+    debug("Test passed.");
+  } else {
+    debug("TEST FAILED");
+  }
+}
+
+//
+// Tests for unsigned array variants
+//
+
+function testSetAndGet10To1(type, name) {
+  running('test ' + name + ' SetAndGet10To1');
+  try {
+    var array = new type(10);
+    for (var i = 0; i < 10; i++) {
+      array[i] = 10 - i;
+    }
+    for (var i = 0; i < 10; i++) {
+      assertEq('Element ' + i, 10 - i, array[i]);
+    }
+    pass();
+  } catch (e) {
+    fail(e);
+  }
+}
+
+function testConstructWithArrayOfUnsignedValues(type, name) {
+  running('test ' + name + ' ConstructWithArrayOfUnsignedValues');
+  try {
+    var array = new type([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]);
+    assertEq('Array length', 10, array.length);
+    for (var i = 0; i < 10; i++) {
+      assertEq('Element ' + i, 10 - i, array[i]);
+    }
+    pass();
+  } catch (e) {
+    fail(e);
+  }
+}
+
+//
+// Tests for signed array variants
+//
+
+function testSetAndGetPos10ToNeg10(type, name) {
+  running('test ' + name + ' SetAndGetPos10ToNeg10');
+  try {
+    var array = new type(21);
+    for (var i = 0; i < 21; i++) {
+      array[i] = 10 - i;
+    }
+    for (var i = 0; i < 21; i++) {
+      assertEq('Element ' + i, 10 - i, array[i]);
+    }
+    pass();
+  } catch (e) {
+    fail(e);
+  }
+}
+
+function testConstructWithArrayOfSignedValues(type, name) {
+  running('test ' + name + ' ConstructWithArrayOfSignedValues');
+  try {
+    var array = new type([10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10]);
+    assertEq('Array length', 21, array.length);
+    for (var i = 0; i < 21; i++) {
+      assertEq('Element ' + i, 10 - i, array[i]);
+    }
+    pass();
+  } catch (e) {
+    fail(e);
+  }
+}
+
+//
+// Test cases for both signed and unsigned types
+//
+
+function testBoundaryConditions(type, name, lowValue, expectedLowValue, highValue, expectedHighValue) {
+  running('test ' + name + ' BoundaryConditions(' +
+          lowValue + ', ' + expectedLowValue + ', ' +
+          highValue + ', ' + expectedHighValue + ')');
+  try {
+    var array = new type(1);
+    assertEq('Array length', 1, array.length);
+    array[0] = lowValue;
+    assertEq('Element 0', expectedLowValue, array[0]);
+    array[0] = highValue;
+    assertEq('Element 0', expectedHighValue, array[0]);
+    pass();
+  } catch (e) {
+    fail(e);
+  }
+}
+
+//
+// Test driver
+//
+
+function runTests() {
+  allPassed = true;
+
+  // The "name" attribute is a concession to browsers which don't
+  // implement the "name" property on function objects
+  var testCases =
+    [ {name: "CanvasByteArray",
+       unsigned: false,
+       low: -128,
+       expectedLow: -128,
+       high: 127,
+       expectedHigh: 127},
+      {name: "CanvasFloatArray",
+       unsigned: false,
+       low: -500,
+       expectedLow: -500,
+       high: 500,
+       expectedHigh: 500},
+      {name: "CanvasIntArray",
+       unsigned: false,
+       low: -2147483648,
+       expectedLow: -2147483648,
+       high: 2147483647,
+       expectedHigh: 2147483647},
+      {name: "CanvasShortArray",
+       unsigned: false,
+       low: -32768,
+       expectedLow: -32768,
+       high: 32767,
+       expectedHigh: 32767},
+      {name: "CanvasUnsignedByteArray",
+       unsigned: true,
+       low: 0,
+       expectedLow: 0,
+       high: 255,
+       expectedHigh: 255},
+      {name: "CanvasUnsignedIntArray",
+       unsigned: true,
+       low: 0,
+       expectedLow: 0,
+       high: 4294967295,
+       expectedHigh: 4294967295},
+      {name: "CanvasUnsignedShortArray",
+       unsigned: true,
+       low: 0,
+       expectedLow: 0,
+       high: 65535,
+       expectedHigh: 65535} ];
+
+  for (var i = 0; i < testCases.length; i++) {
+    var testCase = testCases[i];
+    running(testCase.name);
+    if (!(testCase.name in window)) {
+        fail("does not exist");
+        continue;
+    }
+    var type = window[testCase.name];
+    var name = testCase.name;
+    if (testCase.unsigned) {
+      testSetAndGet10To1(type, name);
+      testConstructWithArrayOfUnsignedValues(type, name);
+    } else {
+      testSetAndGetPos10ToNeg10(type, name);
+      testConstructWithArrayOfSignedValues(type, name);
+    }
+    testBoundaryConditions(type,
+                           name,
+                           testCase.low,
+                           testCase.expectedLow,
+                           testCase.high,
+                           testCase.expectedHigh);
+  }
+
+  printSummary();
+}
+
+runTests();
+successfullyParsed = true;
+
+</script>
+<script src="../../js/resources/js-test-post.js"></script>
+
+<script>
+</script>
+
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 37b17d5..bc1e077 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-02  Kenneth Russell  <kbr at google.com>
+
+        Reviewed by Oliver Hunt.
+
+        WebGL crashes with recent CanvasArray change
+        https://bugs.webkit.org/show_bug.cgi?id=30018
+
+        Test: fast/canvas/webgl/array-unit-tests.html
+
+        * html/canvas/CanvasArray.cpp:
+        (WebCore::CanvasArray::CanvasArray):
+        Fix bug where PassRefPtr was tested after transferring value to RefPtr.
+
 2009-10-02  Steve Falkenburg  <sfalken at apple.com>
 
         Reviewed by Mark Rowe.
diff --git a/WebCore/html/canvas/CanvasArray.cpp b/WebCore/html/canvas/CanvasArray.cpp
index 1e7c0b8..6b5688a 100644
--- a/WebCore/html/canvas/CanvasArray.cpp
+++ b/WebCore/html/canvas/CanvasArray.cpp
@@ -36,7 +36,7 @@ namespace WebCore {
         : m_offset(offset)
         , m_buffer(buffer)
     {
-        m_baseAddress = buffer ? (static_cast<char*>(m_buffer->data()) + m_offset) : 0;
+        m_baseAddress = m_buffer ? (static_cast<char*>(m_buffer->data()) + m_offset) : 0;
     }
 
     CanvasArray::~CanvasArray()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list