Commit 36be5466 authored by gman@google.com's avatar gman@google.com

Fix for shader-test.html and IE

Issue #1) creating HTML by string is fast in all browsers.
Creating HTML by DOM methods is extremely slow in IE. 100-300x slower.

http://www.quirksmode.org/dom/innerhtml.html

Issue #2) There's a bug in IE related to <select> tags.

http://support.microsoft.com/kb/276228


Review URL: http://codereview.chromium.org/155154

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20059 0039d316-1c4b-4281-b951-d872f2087c98
parent 76e0bcba
......@@ -317,7 +317,8 @@ function initStep2(clientElements) {
g_currentTimeParam = paramObject.createParam('timeParam','ParamFloat');
// Load effects and fill out options.
options = ''
options = '<select id="shaderSelect" name="shaderSelect"' +
' onChange="changeShader()">'
for(var s = 0; s < g_shaders.length; s++) {
g_effects[s] = g_pack.createObject('Effect');
var shaderString = 'shaders/' + g_shaders[s].file + '.shader';
......@@ -325,7 +326,8 @@ function initStep2(clientElements) {
options += '<option value="' + s + '"' + (s == 0 ? ' selected' : '') +
'>' + g_shaders[s].name + '</option>';
}
document.getElementById('shaderSelect').innerHTML = options;
options += '</select>';
document.getElementById('shaderDiv').innerHTML = options;
var rampWidth = 64;
var texture = g_pack.createTexture2D(
......@@ -406,7 +408,6 @@ This example is useful for testing a shader or checking a scene. Clicking on the
<div id="o3d" style="width: 100%; height: 80%;"></div>
<!-- End of O3D plugin -->
<p>
<select id='shaderSelect' name='shaderSelect' onChange='changeShader()'>
</select>
<div id='shaderDiv'></div>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment