summaryrefslogtreecommitdiffstats
path: root/WebCore/manual-tests
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2009-12-15 10:12:09 +0000
committerSteve Block <steveblock@google.com>2009-12-17 17:41:10 +0000
commit643ca7872b450ea4efacab6188849e5aac2ba161 (patch)
tree6982576c228bcd1a7efe98afed544d840751094c /WebCore/manual-tests
parentd026980fde6eb3b01c1fe49441174e89cd1be298 (diff)
downloadexternal_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.zip
external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.gz
external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.bz2
Merge webkit.org at r51976 : Initial merge by git.
Change-Id: Ib0e7e2f0fb4bee5a186610272edf3186f0986b43
Diffstat (limited to 'WebCore/manual-tests')
-rw-r--r--WebCore/manual-tests/autocompletion-fire-onchange.html40
-rw-r--r--WebCore/manual-tests/inspector/bp-in-named-eval-after-reload.html65
-rw-r--r--WebCore/manual-tests/inspector/debugger-shortcuts-with-console-opened.html16
-rw-r--r--WebCore/manual-tests/inspector/hidden-evals.html118
-rw-r--r--WebCore/manual-tests/inspector/remember-last-script.html42
-rw-r--r--WebCore/manual-tests/plugins/windowed.html12
-rw-r--r--WebCore/manual-tests/plugins/windowless.html12
-rw-r--r--WebCore/manual-tests/qt/qtplugin.html18
-rw-r--r--WebCore/manual-tests/user-drag-with-decorations.html7
-rw-r--r--WebCore/manual-tests/webgl/SpinningBox.html2
-rw-r--r--WebCore/manual-tests/webgl/resources/CanvasMatrix.js4
-rw-r--r--WebCore/manual-tests/webgl/resources/utils3d.js59
12 files changed, 358 insertions, 37 deletions
diff --git a/WebCore/manual-tests/autocompletion-fire-onchange.html b/WebCore/manual-tests/autocompletion-fire-onchange.html
new file mode 100644
index 0000000..c6ba288
--- /dev/null
+++ b/WebCore/manual-tests/autocompletion-fire-onchange.html
@@ -0,0 +1,40 @@
+<html>
+<head>
+<script>
+// This test case is based on the test case http://data.ici-bas.fr/chromiumissue10879/.
+window.changed = false;
+function checkForChange()
+{
+ if (!location.search)
+ return true;
+
+ if (!window.changed && document.getElementById("field").value != "")
+ log("FAIL");
+ else
+ log("PASS");
+ return false;
+}
+
+function log(msg)
+{
+ document.getElementById("log").appendChild(document.createTextNode(msg + "\n"));
+}
+</script>
+</head>
+<body>
+<p id="description">This test verifies that on autocompletion the 'onchange' event is fired.</p>
+<p>Steps to reproduce:</p>
+<ol>
+ <li>In the input field, type the word &quot;apple&quot; (without quotes). Then click the button Submit or hit the return/enter
+ key on your keyboard</li>
+ <li>Once the page reloads, in the input field, type &quot;ap&quot; (without quotes) and let the browser autocomplete the word (or select
+ &quot;apple&quot; from the autocompletion drop-down list contextual menu). Then click the button Submit or hit the return/enter
+ key on your keyboard.</li>
+</ol>
+<form method="get" onsubmit="return checkForChange()">
+ <p><input type="text" name="field" id="field" value="" onchange="window.changed = true"/></p>
+ <p><input type="submit" value="Submit"/></p>
+</form>
+<pre id="log"></pre>
+</body>
+</html>
diff --git a/WebCore/manual-tests/inspector/bp-in-named-eval-after-reload.html b/WebCore/manual-tests/inspector/bp-in-named-eval-after-reload.html
new file mode 100644
index 0000000..4612cd6
--- /dev/null
+++ b/WebCore/manual-tests/inspector/bp-in-named-eval-after-reload.html
@@ -0,0 +1,65 @@
+<style>code{background-color: #ffc;}</style>
+<p><b>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=31375">Bug 31375</a> - Web Inspector: breakpoints in named evals are not restored after a reload</b>
+
+<ul>
+<li><p>open this page with Web Inspector
+<li><p>switch to the Scripts panel, enabling debug if required
+<li><p>the available scripts in the select element should be:
+<ul>
+<li>(program): f1.js
+<li>(program): f2.js
+<li>bp-in-named-eval-after-reload.html
+</ul>
+<li><p>In <code>(program) f1.js</code>, set a breakpoint on the first
+executable line of the function <code>f1()</code>, the invocation of <code>doNothing()</code>.
+<li><p>In <code>(program) f2.js</code>, set a breakpoint on the first
+executable line of the function <code>f2()</code>, the invocation of <code>doNothing()</code>.
+<li><p>click this button: <input id=button type=button value="click me">
+<li><p>debugger should stop in the <code>f1()</code> function.
+<li><p>resume the debugger
+<li><p>debugger should stop in the <code>f2()</code> function (the function in <code>(program) f2.js</code>)
+<li><p>resume the debugger
+<li><p>switch to the web page, reload the web page, switch back to web inspector
+<li><p>in the breakpoints sidebar panel, click on the two breakpoints listed
+and the source for those functions should be shown in the source panel, and
+the previous breakpoint markers should be visible
+<li><p>click the "click me" button above, again
+<li><p>debugger should stop in the <code>f1()</code> function.
+<li><p>resume the debugger
+<li><p>debugger should stop in the <code>f2()</code> function.
+<li><p>resume the debugger
+</ul>
+
+<p>Note that without the fix in <a href="https://bugs.webkit.org/show_bug.cgi?id=31375">Bug 31375</a>,
+the breakpoints won't work after reloading the page.
+
+<script>
+
+function doNothing() { /* allows multi-line functions, easier to debug */ };
+
+eval([
+ "function f1() {",
+ " doNothing();",
+ " console.log(new Date() + ': f1() called');",
+ "}",
+ "//@sourceURL=f1.js"
+].join("\n"));
+
+f2 = Function([
+ "",
+ " doNothing();",
+ " console.log(new Date() + ': f2() called');",
+ "//@sourceURL=f2.js"
+].join("\n"));
+
+var button = document.getElementById("button");
+
+button.addEventListener("click", clickHandler, false);
+
+function clickHandler() {
+ f1();
+ f2();
+}
+
+</script>
+<!-- End -->
diff --git a/WebCore/manual-tests/inspector/debugger-shortcuts-with-console-opened.html b/WebCore/manual-tests/inspector/debugger-shortcuts-with-console-opened.html
new file mode 100644
index 0000000..df089d5
--- /dev/null
+++ b/WebCore/manual-tests/inspector/debugger-shortcuts-with-console-opened.html
@@ -0,0 +1,16 @@
+<script>
+function testFunction()
+{
+ showAlert();
+}
+
+function showAlert()
+{
+ alert("Test completed.");
+}
+</script>
+<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=31252">Bug 31252: Web Inspector: Debugger shortcuts (F8, F10, F11) have no effect if the Console view is open</a>.</p>
+<p>To test, open the Inspector and start a debugging session. Open the Console view (press Esc or click the "Show console" button in the status bar) and make sure it is focused (the cursor is blinking in the text prompt.)
+Set a breakpoint inside testFunction() (on the showAlert() call) and press F8. Now click the Test button in the page. The execution should stop on an HTML line containing <b>onclick="testFunction()"</b>. Press F8. The execution should stop on the breakpoint.
+Press F11, F10, F11 sequentially. You should see the "Test completed." alert dialog ONLY after the last keypress.</p>
+<button onclick="testFunction()">Test</button><br><br>
diff --git a/WebCore/manual-tests/inspector/hidden-evals.html b/WebCore/manual-tests/inspector/hidden-evals.html
new file mode 100644
index 0000000..c507bcd
--- /dev/null
+++ b/WebCore/manual-tests/inspector/hidden-evals.html
@@ -0,0 +1,118 @@
+
+<p><b>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=30212">Bug 30212</a> - Each JS execution in console adds extra item into "scripts" combo</b>
+
+<p>The following manual test creates functions via <tt>eval()</tt> and the
+<tt>Function()</tt> constructor, some functions are named using the
+<code>//@sourceURL=</code> directive, some aren't. Some contain
+<tt>debugger</tt> commands, some don't.
+
+<p>The functions named <tt>f_named_X</tt> are 'named' via the
+<code>//@sourceURL=</code> directive, the ones named <tt>f_unnamed_X</tt>
+are not. The 'named' functions should show up in the Scripts select element used
+to select a resource/script to view, the 'unnamed' ones should not.
+
+<ul>
+<li><p>open this page with Web Inspector
+<li><p>switch to the Scripts panel, enabling debug if required
+<li><p>the available scripts in the select element should be:
+<ul>
+<li>(program): f_named_1.eval
+<li>(program): f_named_2.eval
+<li>(program): f_named_3.eval
+<li>hidden-evals.html
+</ul>
+<li><p>click this button: <input id=button type=button value="click me">
+<li><p>debugger should stop in the <code>clickHandler</code> function
+<li><p>at this point, start stepping <b>into</b> the code
+<li><p>you should be able to step into functions <code>f_unnamed_1()</code>
+and <code>f_unnamed_2()</code>. There are no resource/scripts in the
+select element that contain these functions, until you actually are paused
+in them. At that point, entries for these functions will be in the select element,
+named: "(program)". After pausing in both functions, there will be two "(program)"
+entries.
+<li><p>you should be able to use the next/prev buttons (to the left of the select element)
+to switch to other resources/scripts that have been opened, including the ones
+containing these functions
+<li><p>you should be able to click on the functions that exist in the 'hidden'
+resources from the Call Stack, and be shown the source; click around the
+stack trace entries to verify
+<li><p>rather than stepping into the <code>f_named_3()</code> call, press the
+resume button
+<li><p>the debugger should stop in <code>f_named_3()</code> because of the
+<code>debugger</code> command
+<li><p>rather than stepping into the <code>f_unnamed_3()</code> call, press the
+resume button
+<li><p>the debugger should stop in <code>f_unnamed_3()</code> because of the
+<code>debugger</code> command. At this point, a third "(program)" entry for
+this function is added to the select element.
+</ul>
+
+<script>
+
+function doNothing() { /* allows multi-line functions, easier to debug */ };
+
+eval([
+ "function f_named_1() {",
+ " doNothing();",
+ " return 'named_1';",
+ "}",
+ "//@sourceURL=f_named_1.eval"
+].join("\n"));
+
+eval([
+ "function f_unnamed_1() {",
+ " doNothing();",
+ " return 'unnamed_1';",
+ "}"
+].join("\n"));
+
+f_named_2 = Function([
+ "",
+ " doNothing();",
+ " return 'named_2';",
+ "//@sourceURL=f_named_2.eval"
+].join("\n"));
+
+f_unnamed_2 = Function([
+ "",
+ " doNothing();",
+ " return 'unnamed_2';"
+].join("\n"));
+
+f_named_3 = Function([
+ "",
+ " debugger;",
+ " doNothing();",
+ " return 'named_3';",
+ "//@sourceURL=f_named_3.eval"
+].join("\n"));
+
+f_unnamed_3 = Function([
+ "",
+ " debugger;",
+ " doNothing();",
+ " return 'unnamed_3';"
+].join("\n"));
+
+var button = document.getElementById("button");
+
+button.addEventListener("click", clickHandler, false);
+
+function clickHandler() {
+ debugger;
+ f_named_1();
+ f_unnamed_1();
+ f_named_2();
+ f_unnamed_2();
+
+ // press "resume" at this point
+ console.log("press resume before calling f_named_3()");
+ f_named_3();
+
+ // press "resume" at this point
+ console.log("press resume before calling f_unnamed_3()");
+ f_unnamed_3();
+}
+
+</script>
+<!-- End -->
diff --git a/WebCore/manual-tests/inspector/remember-last-script.html b/WebCore/manual-tests/inspector/remember-last-script.html
new file mode 100644
index 0000000..52e7f02
--- /dev/null
+++ b/WebCore/manual-tests/inspector/remember-last-script.html
@@ -0,0 +1,42 @@
+<style>code{background-color: #ffc;}</style>
+<p><b>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=27552">Bug 27552</a> - remember last script displayed in Scripts panel</b>
+
+<ul>
+<li><p>open this page with Web Inspector, switch to the <b>Scripts</b> panel, enabling debug if required
+<li><p>the available scripts in the select element should be:
+ <ul>
+ <li><b>(program): f1.js</b>
+ <li><b>remember-last-script.html</b>
+ </ul>
+<li><p>select <b>(program): f1.js</b> so the source is available
+<li><p>switch to the <b>Resources</b> panel
+<li><p>close Web Inspector
+<li><p>Repeat the following several times. Each time, <b>(program): f1.js</b>
+should be the selected script:
+ <ul>
+ <li>open Web Inspector, switch to the <b>Scripts</b> panel, then close Web Inspector
+ </ul>
+<li><p>open Web Inspector, switch to the <b>Scripts</b> panel
+<li><p>select <b>remember-last-script.html</b> so the source is available
+<li><p>Repeat the following several times. Each time, <b>remember-last-script.html</b>
+should be the selected script:
+ <ul>
+ <li>open Web Inspector, switch to the <b>Scripts</b> panel, then close Web Inspector
+ </ul>
+</ul>
+
+<script>
+
+f1 = Function([
+ "",
+ " doNothing();",
+ "//@sourceURL=f1.js"
+].join("\n"));
+
+function doNothing() { /* allows multi-line functions, easier to debug */ };
+
+doNothing();
+f1();
+
+</script>
+<!-- End -->
diff --git a/WebCore/manual-tests/plugins/windowed.html b/WebCore/manual-tests/plugins/windowed.html
index 4020408..808a0ad 100644
--- a/WebCore/manual-tests/plugins/windowed.html
+++ b/WebCore/manual-tests/plugins/windowed.html
@@ -22,6 +22,15 @@
}
</style>
<script>
+ function testVisibility() {
+ var flashPlugin = document.getElementById('flashPlugin');
+ if (flashPlugin.style.display == 'none') {
+ flashPlugin.style.display = 'block';
+ } else {
+ flashPlugin.style.display = 'none';
+ }
+ }
+
function testResize() {
var flashPlugin = document.getElementById('flashPlugin');
flashPlugin.width = flashPlugin.width == "200" ? "100" : "200";
@@ -66,6 +75,9 @@
<div style="clear:both"/>
+ <input type="checkbox" name="visibilityCheckBox"> Verify if the flash toggles visibility
+ <input type="button" id="visibilityButton" value="Test Visibility" onClick="testVisibility()"/><br/>
+
<input type="checkbox" name="resizeCheckBox"> Verify if the flash resizes when element is resized
<input type="button" id="resizeButton" value="Test Resize" onClick="testResize()"/><br/>
diff --git a/WebCore/manual-tests/plugins/windowless.html b/WebCore/manual-tests/plugins/windowless.html
index b553526..1020abb 100644
--- a/WebCore/manual-tests/plugins/windowless.html
+++ b/WebCore/manual-tests/plugins/windowless.html
@@ -22,6 +22,15 @@
}
</style>
<script>
+ function testVisibility() {
+ var flashPlugin = document.getElementById('flashPlugin');
+ if (flashPlugin.style.display == 'none') {
+ flashPlugin.style.display = 'block';
+ } else {
+ flashPlugin.style.display = 'none';
+ }
+ }
+
function testResize() {
var flashPlugin = document.getElementById('flashPlugin');
flashPlugin.width = flashPlugin.width == "200" ? "100" : "200";
@@ -67,6 +76,9 @@
<div style="clear:both"/>
+ <input type="checkbox" name="visibilityCheckBox"> Verify if the flash toggles visibility
+ <input type="button" id="visibilityButton" value="Test Visibility" onClick="testVisibility()"/><br/>
+
<input type="checkbox" name="resizeCheckBox"> Verify if the flash resizes when element is resized
<input type="button" id="resizeButton" value="Test Resize" onClick="testResize()"/><br/>
diff --git a/WebCore/manual-tests/qt/qtplugin.html b/WebCore/manual-tests/qt/qtplugin.html
index b2dbf3c..631ce63 100644
--- a/WebCore/manual-tests/qt/qtplugin.html
+++ b/WebCore/manual-tests/qt/qtplugin.html
@@ -1,14 +1,24 @@
<html>
<body>
Image:<br/>
- <img src="http://labs.trolltech.com/skins/trolltech_labs/categories/internet.png" width="80" height="80"/>
+ <img src="qrc:/webkit/inspector/Images/largerResourcesButtonGlyph.png" width="80" height="80"/>
<br/>
+
+<!-- visible progressbar -->
+<div>
QT progress bar:
-<br/>
-<object type="application/x-qt-plugin" classid="QProgressBar" name="progressbar" height=30></object>
+<object type="application/x-qt-plugin" classid="QProgressBar" name="progressbar1" height=30></object>
+</div>
+
+<!-- should not be visible -->
+<div style="visibility: hidden;">
+You should not see this:
+<object type="application/x-qt-plugin" classid="QProgressBar" name="progressbar2" height=30></object>
+</div>
+
<script>
function display(){
- if (++document.progressbar.value != 100)
+ if (++document.progressbar1.value != 100)
setTimeout("display()", 50)
}
display();
diff --git a/WebCore/manual-tests/user-drag-with-decorations.html b/WebCore/manual-tests/user-drag-with-decorations.html
new file mode 100644
index 0000000..1878d11
--- /dev/null
+++ b/WebCore/manual-tests/user-drag-with-decorations.html
@@ -0,0 +1,7 @@
+This tests that we don't include overflow decorations from our ancestor nodes in the drag image for -webkit-user-drag: element. To perform this test drag the green square below. The drag image should not contain any parts of the scrollbar graphics visible on the page.
+
+<div style="height:100px; width:100px;overflow:scroll;">
+ <div style="-webkit-user-drag:element;position:absolute; background: rgba(0,128,0,0.5); height:100px; width:100px;">
+ Drag me!
+ </div>
+</div> \ No newline at end of file
diff --git a/WebCore/manual-tests/webgl/SpinningBox.html b/WebCore/manual-tests/webgl/SpinningBox.html
index 203d7bd..e68711c 100644
--- a/WebCore/manual-tests/webgl/SpinningBox.html
+++ b/WebCore/manual-tests/webgl/SpinningBox.html
@@ -45,7 +45,7 @@
gl.box = makeBox(gl);
// color array
- var colors = new CanvasUnsignedByteArray(
+ var colors = new WebGLUnsignedByteArray(
[ 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, // v0-v1-v2-v3 front
1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, // v0-v3-v4-v5 right
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, // v0-v5-v6-v1 top
diff --git a/WebCore/manual-tests/webgl/resources/CanvasMatrix.js b/WebCore/manual-tests/webgl/resources/CanvasMatrix.js
index f35727f..90fcb3f 100644
--- a/WebCore/manual-tests/webgl/resources/CanvasMatrix.js
+++ b/WebCore/manual-tests/webgl/resources/CanvasMatrix.js
@@ -33,7 +33,7 @@
void load(in CanvasMatrix4 matrix); // copy the values from the passed matrix
void load(in sequence<float> array); // copy 16 floats into the matrix
sequence<float> getAsArray(); // return the matrix as an array of 16 floats
- CanvasFloatArray getAsCanvasFloatArray(); // return the matrix as a CanvasFloatArray with 16 values
+ WebGLFloatArray getAsCanvasFloatArray(); // return the matrix as a WebGLFloatArray with 16 values
void makeIdentity(); // replace the matrix with identity
void transpose(); // replace the matrix with its transpose
void invert(); // replace the matrix with its inverse
@@ -141,7 +141,7 @@ CanvasMatrix4.prototype.getAsArray = function()
CanvasMatrix4.prototype.getAsCanvasFloatArray = function()
{
- return new CanvasFloatArray(this.getAsArray());
+ return new WebGLFloatArray(this.getAsArray());
}
CanvasMatrix4.prototype.makeIdentity = function()
diff --git a/WebCore/manual-tests/webgl/resources/utils3d.js b/WebCore/manual-tests/webgl/resources/utils3d.js
index 0ffd7c4..58f520f 100644
--- a/WebCore/manual-tests/webgl/resources/utils3d.js
+++ b/WebCore/manual-tests/webgl/resources/utils3d.js
@@ -2,7 +2,7 @@
// initWebGL
//
// Initialize the Canvas element with the passed name as a WebGL object and return the
-// CanvasRenderingContext3D.
+// WebGLRenderingContext.
//
// Load shaders with the passed names and create a program with them. Return this program
// in the 'program' property of the returned context.
@@ -43,7 +43,7 @@ function initWebGL(canvasName, vshader, fshader, attribs, clearColor, clearDepth
gl.linkProgram(gl.program);
// Check the link status
- var linked = gl.getProgrami(gl.program, gl.LINK_STATUS);
+ var linked = gl.getProgramParameter(gl.program, gl.LINK_STATUS);
if (!linked) {
// something went wrong with the link
var error = gl.getProgramInfoLog (gl.program);
@@ -72,7 +72,7 @@ function initWebGL(canvasName, vshader, fshader, attribs, clearColor, clearDepth
// loadShader
//
// 'shaderId' is the id of a <script> element containing the shader source string.
-// Load this shader and return the CanvasShader object corresponding to it.
+// Load this shader and return the WebGLShader object corresponding to it.
//
function loadShader(ctx, shaderId)
{
@@ -105,7 +105,7 @@ function loadShader(ctx, shaderId)
ctx.compileShader(shader);
// Check the compile status
- var compiled = ctx.getShaderi(shader, ctx.COMPILE_STATUS);
+ var compiled = ctx.getShaderParameter(shader, ctx.COMPILE_STATUS);
if (!compiled) {
// Something went wrong during compilation; get the error
var error = ctx.getShaderInfoLog(shader);
@@ -123,10 +123,10 @@ function loadShader(ctx, shaderId)
// Create a box with vertices, normals and texCoords. Create VBOs for each as well as the index array.
// Return an object with the following properties:
//
-// normalObject CanvasBuffer object for normals
-// texCoordObject CanvasBuffer object for texCoords
-// vertexObject CanvasBuffer object for vertices
-// indexObject CanvasBuffer object for indices
+// normalObject WebGLBuffer object for normals
+// texCoordObject WebGLBuffer object for texCoords
+// vertexObject WebGLBuffer object for vertices
+// indexObject WebGLBuffer object for indices
// numIndices The number of indices in the indexObject
//
function makeBox(ctx)
@@ -141,7 +141,7 @@ function makeBox(ctx)
// v2------v3
//
// vertex coords array
- var vertices = new CanvasFloatArray(
+ var vertices = new WebGLFloatArray(
[ 1, 1, 1, -1, 1, 1, -1,-1, 1, 1,-1, 1, // v0-v1-v2-v3 front
1, 1, 1, 1,-1, 1, 1,-1,-1, 1, 1,-1, // v0-v3-v4-v5 right
1, 1, 1, 1, 1,-1, -1, 1,-1, -1, 1, 1, // v0-v5-v6-v1 top
@@ -151,7 +151,7 @@ function makeBox(ctx)
);
// normal array
- var normals = new CanvasFloatArray(
+ var normals = new WebGLFloatArray(
[ 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, // v0-v1-v2-v3 front
1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, // v0-v3-v4-v5 right
0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, // v0-v5-v6-v1 top
@@ -162,7 +162,7 @@ function makeBox(ctx)
// texCoord array
- var texCoords = new CanvasFloatArray(
+ var texCoords = new WebGLFloatArray(
[ 1, 1, 0, 1, 0, 0, 1, 0, // v0-v1-v2-v3 front
0, 1, 0, 0, 1, 0, 1, 1, // v0-v3-v4-v5 right
1, 0, 1, 1, 0, 1, 0, 0, // v0-v5-v6-v1 top
@@ -172,7 +172,7 @@ function makeBox(ctx)
);
// index array
- var indices = new CanvasUnsignedByteArray(
+ var indices = new WebGLUnsignedByteArray(
[ 0, 1, 2, 0, 2, 3, // front
4, 5, 6, 4, 6, 7, // right
8, 9,10, 8,10,11, // top
@@ -214,10 +214,10 @@ function makeBox(ctx)
// Sphere has vertices, normals and texCoords. Create VBOs for each as well as the index array.
// Return an object with the following properties:
//
-// normalObject CanvasBuffer object for normals
-// texCoordObject CanvasBuffer object for texCoords
-// vertexObject CanvasBuffer object for vertices
-// indexObject CanvasBuffer object for indices
+// normalObject WebGLBuffer object for normals
+// texCoordObject WebGLBuffer object for texCoords
+// vertexObject WebGLBuffer object for vertices
+// indexObject WebGLBuffer object for indices
// numIndices The number of indices in the indexObject
//
function makeSphere(ctx, radius, lats, longs)
@@ -272,20 +272,20 @@ function makeSphere(ctx, radius, lats, longs)
retval.normalObject = ctx.createBuffer();
ctx.bindBuffer(ctx.ARRAY_BUFFER, retval.normalObject);
- ctx.bufferData(ctx.ARRAY_BUFFER, new CanvasFloatArray(normalData), ctx.STATIC_DRAW);
+ ctx.bufferData(ctx.ARRAY_BUFFER, new WebGLFloatArray(normalData), ctx.STATIC_DRAW);
retval.texCoordObject = ctx.createBuffer();
ctx.bindBuffer(ctx.ARRAY_BUFFER, retval.texCoordObject);
- ctx.bufferData(ctx.ARRAY_BUFFER, new CanvasFloatArray(texCoordData), ctx.STATIC_DRAW);
+ ctx.bufferData(ctx.ARRAY_BUFFER, new WebGLFloatArray(texCoordData), ctx.STATIC_DRAW);
retval.vertexObject = ctx.createBuffer();
ctx.bindBuffer(ctx.ARRAY_BUFFER, retval.vertexObject);
- ctx.bufferData(ctx.ARRAY_BUFFER, new CanvasFloatArray(geometryData), ctx.STATIC_DRAW);
+ ctx.bufferData(ctx.ARRAY_BUFFER, new WebGLFloatArray(geometryData), ctx.STATIC_DRAW);
retval.numIndices = indexData.length;
retval.indexObject = ctx.createBuffer();
ctx.bindBuffer(ctx.ELEMENT_ARRAY_BUFFER, retval.indexObject);
- ctx.bufferData(ctx.ELEMENT_ARRAY_BUFFER, new CanvasUnsignedShortArray(indexData), ctx.STREAM_DRAW);
+ ctx.bufferData(ctx.ELEMENT_ARRAY_BUFFER, new WebGLUnsignedShortArray(indexData), ctx.STREAM_DRAW);
return retval;
}
@@ -297,10 +297,10 @@ function makeSphere(ctx, radius, lats, longs)
// When the object load is complete, the 'loaded' property becomes true and the following
// properties are set:
//
-// normalObject CanvasBuffer object for normals
-// texCoordObject CanvasBuffer object for texCoords
-// vertexObject CanvasBuffer object for vertices
-// indexObject CanvasBuffer object for indices
+// normalObject WebGLBuffer object for normals
+// texCoordObject WebGLBuffer object for texCoords
+// vertexObject WebGLBuffer object for vertices
+// indexObject WebGLBuffer object for indices
// numIndices The number of indices in the indexObject
//
function loadObj(ctx, url)
@@ -438,20 +438,20 @@ function doLoadObj(obj, text)
// set the VBOs
obj.normalObject = obj.ctx.createBuffer();
obj.ctx.bindBuffer(obj.ctx.ARRAY_BUFFER, obj.normalObject);
- obj.ctx.bufferData(obj.ctx.ARRAY_BUFFER, new CanvasFloatArray(normalArray), obj.ctx.STATIC_DRAW);
+ obj.ctx.bufferData(obj.ctx.ARRAY_BUFFER, new WebGLFloatArray(normalArray), obj.ctx.STATIC_DRAW);
obj.texCoordObject = obj.ctx.createBuffer();
obj.ctx.bindBuffer(obj.ctx.ARRAY_BUFFER, obj.texCoordObject);
- obj.ctx.bufferData(obj.ctx.ARRAY_BUFFER, new CanvasFloatArray(textureArray), obj.ctx.STATIC_DRAW);
+ obj.ctx.bufferData(obj.ctx.ARRAY_BUFFER, new WebGLFloatArray(textureArray), obj.ctx.STATIC_DRAW);
obj.vertexObject = obj.ctx.createBuffer();
obj.ctx.bindBuffer(obj.ctx.ARRAY_BUFFER, obj.vertexObject);
- obj.ctx.bufferData(obj.ctx.ARRAY_BUFFER, new CanvasFloatArray(vertexArray), obj.ctx.STATIC_DRAW);
+ obj.ctx.bufferData(obj.ctx.ARRAY_BUFFER, new WebGLFloatArray(vertexArray), obj.ctx.STATIC_DRAW);
obj.numIndices = indexArray.length;
obj.indexObject = obj.ctx.createBuffer();
obj.ctx.bindBuffer(obj.ctx.ELEMENT_ARRAY_BUFFER, obj.indexObject);
- obj.ctx.bufferData(obj.ctx.ELEMENT_ARRAY_BUFFER, new CanvasUnsignedShortArray(indexArray), obj.ctx.STREAM_DRAW);
+ obj.ctx.bufferData(obj.ctx.ELEMENT_ARRAY_BUFFER, new WebGLUnsignedShortArray(indexArray), obj.ctx.STREAM_DRAW);
obj.loaded = true;
}
@@ -459,7 +459,7 @@ function doLoadObj(obj, text)
//
// loadImageTexture
//
-// Load the image at the passed url, place it in a new CanvasTexture object and return the CanvasTexture.
+// Load the image at the passed url, place it in a new WebGLTexture object and return the WebGLTexture.
//
function loadImageTexture(ctx, url)
{
@@ -528,4 +528,3 @@ Framerate.prototype.snapshot = function()
this.renderTime = newTime;
}
}
-