smparkes-envjs 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/envjsrb +157 -73
- data/bin/jquery-1.3.2-test.js +11 -4
- data/lib/envjs/env.js +935 -11028
- data/lib/envjs/net/cgi.rb +94 -0
- data/lib/envjs/net/file.rb +4 -4
- data/lib/envjs/runtime.rb +80 -24
- data/test/call-load-test.js +0 -2
- data/test/firebug/errorIcon.png +0 -0
- data/test/firebug/firebug.css +209 -0
- data/test/firebug/firebug.html +23 -0
- data/test/firebug/firebug.js +672 -0
- data/test/firebug/firebugx.js +10 -0
- data/test/firebug/infoIcon.png +0 -0
- data/test/firebug/warningIcon.png +0 -0
- data/test/fixtures/html/events.html +171 -0
- data/test/fixtures/html/iframe1.html +46 -0
- data/test/fixtures/html/iframe1a.html +46 -0
- data/test/fixtures/html/iframe2.html +45 -0
- data/test/fixtures/html/iframe3.html +28 -0
- data/test/fixtures/html/iframeN.html +57 -0
- data/test/fixtures/html/malformed.html +181 -0
- data/test/fixtures/html/scope.html +81 -0
- data/test/fixtures/html/trivial.html +19 -0
- data/test/fixtures/html/with_js.html +26 -0
- data/test/fixtures/images/icon-blue.png +0 -0
- data/test/fixtures/js/external_script.js +1 -0
- data/test/fixtures/js/script.js +1 -0
- data/test/fixtures/js/script_error.js +2 -0
- data/test/html/malformed.html +1 -0
- data/test/index.html +21 -19
- data/test/{primaryTests.js → primary-tests.js} +1 -3
- data/test/{prototype.js → prototype-test.js} +0 -2
- data/test/qunit/qunit/qunit.css +0 -0
- data/test/qunit/qunit/qunit.js +2 -2
- data/test/{qunit/qunit/qunit.js.smp → specs/dist/env.spec.js} +539 -7
- data/test/specs/envjs.spec.css +46 -0
- data/test/specs/parser/html.js +31 -0
- data/test/specs/parser/spec.html +40 -0
- data/test/specs/parser/xml.js +31 -0
- data/test/specs/qunit.bdd.js +210 -0
- data/test/{qunit.smp/qunit → specs}/qunit.css +0 -0
- data/test/{qunit.smp/qunit → specs}/qunit.js +2 -2
- data/test/specs/template/spec-0.js +31 -0
- data/test/specs/template/spec-1.js +31 -0
- data/test/specs/template/spec.html +40 -0
- data/test/specs/window/css.js +23 -0
- data/test/specs/window/dialog.js +25 -0
- data/test/specs/window/document.js +23 -0
- data/test/specs/window/event.js +25 -0
- data/test/specs/window/history.js +34 -0
- data/test/specs/window/location.js +34 -0
- data/test/specs/window/navigator.js +71 -0
- data/test/specs/window/screen.js +42 -0
- data/test/specs/window/spec.html +48 -0
- data/test/specs/window/timer.js +26 -0
- data/test/specs/window/window.js +53 -0
- data/test/specs/xhr/spec.html +47 -0
- data/test/specs/xhr/xhr.js +31 -0
- data/test/test.js +10 -0
- data/test/unit/elementmembers.js +31 -0
- data/test/unit/nu.validator.js +34 -0
- data/test/unit/onload.js +1 -3
- data/test/unit/parser.js +106 -98
- data/test/unit/prototypecompat.js +2 -2
- data/test/vendor/jQuery/1.3.2/ChangeLog.txt +98 -0
- data/test/vendor/jQuery/1.3.2/GPL-LICENSE.txt +278 -0
- data/test/vendor/jQuery/1.3.2/MIT-LICENSE.txt +20 -0
- data/test/vendor/jQuery/1.3.2/Makefile +154 -0
- data/test/vendor/jQuery/1.3.2/README +67 -0
- data/test/vendor/jQuery/1.3.2/build/ant-contrib-0.6.jar +0 -0
- data/test/vendor/jQuery/1.3.2/build/build/min.js +11 -0
- data/test/vendor/jQuery/1.3.2/build/build/pack.js +19 -0
- data/test/vendor/jQuery/1.3.2/build/js/Packer.js +209 -0
- data/test/vendor/jQuery/1.3.2/build/js/ParseMaster.js +106 -0
- data/test/vendor/jQuery/1.3.2/build/js/Words.js +62 -0
- data/test/vendor/jQuery/1.3.2/build/js/base2.js +978 -0
- data/test/vendor/jQuery/1.3.2/build/js/jsmin.js +316 -0
- data/test/vendor/jQuery/1.3.2/build/js/json.js +117 -0
- data/test/vendor/jQuery/1.3.2/build/js/pack.js +316 -0
- data/test/vendor/jQuery/1.3.2/build/js/parse.js +105 -0
- data/test/vendor/jQuery/1.3.2/build/js/writeFile.js +19 -0
- data/test/vendor/jQuery/1.3.2/build/js/xml.js +25 -0
- data/test/vendor/jQuery/1.3.2/build/js.jar +0 -0
- data/test/vendor/jQuery/1.3.2/build/runtest/env.js +1 -0
- data/test/vendor/jQuery/1.3.2/build/runtest/test.js +106 -0
- data/test/vendor/jQuery/1.3.2/build/runtest/testrunner.js +197 -0
- data/test/vendor/jQuery/1.3.2/build/speed/benchmarker.css +65 -0
- data/test/vendor/jQuery/1.3.2/build/speed/benchmarker.js +181 -0
- data/test/vendor/jQuery/1.3.2/build/speed/index.html +72 -0
- data/test/vendor/jQuery/1.3.2/build/speed/jquery-basis.js +3549 -0
- data/test/vendor/jQuery/1.3.2/build/style.xsl +99 -0
- data/test/vendor/jQuery/1.3.2/build/yuicompressor-2.4.2.jar +0 -0
- data/test/vendor/jQuery/1.3.2/build.xml +123 -0
- data/test/vendor/jQuery/1.3.2/dist/jquery.js +4376 -0
- data/test/vendor/jQuery/1.3.2/reminder.txt +3 -0
- data/test/vendor/jQuery/1.3.2/src/ajax.js +541 -0
- data/test/vendor/jQuery/1.3.2/src/core.js +1255 -0
- data/test/vendor/jQuery/1.3.2/src/data.js +145 -0
- data/test/vendor/jQuery/1.3.2/src/dimensions.js +49 -0
- data/test/vendor/jQuery/1.3.2/src/event.js +684 -0
- data/test/vendor/jQuery/1.3.2/src/fx.js +407 -0
- data/test/vendor/jQuery/1.3.2/src/intro.js +13 -0
- data/test/vendor/jQuery/1.3.2/src/offset.js +155 -0
- data/test/vendor/jQuery/1.3.2/src/outro.js +1 -0
- data/test/vendor/jQuery/1.3.2/src/selector.js +1015 -0
- data/test/vendor/jQuery/1.3.2/src/support.js +112 -0
- data/test/vendor/jQuery/1.3.2/test/data/cow.jpg +0 -0
- data/test/vendor/jQuery/1.3.2/test/data/dashboard.xml +11 -0
- data/test/vendor/jQuery/1.3.2/test/data/echoQuery.php +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/iframe.html +8 -0
- data/test/vendor/jQuery/1.3.2/test/data/json.php +9 -0
- data/test/vendor/jQuery/1.3.2/test/data/json_assigned_obj.js +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/json_obj.js +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/jsonp.php +10 -0
- data/test/vendor/jQuery/1.3.2/test/data/name.html +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/name.php +29 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/absolute.html +39 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/body.html +24 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/fixed.html +33 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/relative.html +31 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/scroll.html +39 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/static.html +31 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/table.html +43 -0
- data/test/vendor/jQuery/1.3.2/test/data/params_html.php +12 -0
- data/test/vendor/jQuery/1.3.2/test/data/test.html +7 -0
- data/test/vendor/jQuery/1.3.2/test/data/test.js +3 -0
- data/test/vendor/jQuery/1.3.2/test/data/test.php +7 -0
- data/test/vendor/jQuery/1.3.2/test/data/test2.html +5 -0
- data/test/vendor/jQuery/1.3.2/test/data/test3.html +3 -0
- data/test/vendor/jQuery/1.3.2/test/data/testrunner.js +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/text.php +12 -0
- data/test/vendor/jQuery/1.3.2/test/data/with_fries.xml +25 -0
- data/test/vendor/jQuery/1.3.2/test/index.html +229 -0
- data/test/vendor/jQuery/1.3.2/test/jqenv-1259090275493.html +247 -0
- data/test/vendor/jQuery/1.3.2/test/jqenv-1259091671501.html +247 -0
- data/test/vendor/jQuery/1.3.2/test/jqenv-1259175319655.html +247 -0
- data/test/vendor/jQuery/1.3.2/test/offset.html +28 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/jquery/1.2.1/jquery.js +11 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/jquery/1.2.3/jquery.js +11 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/mootools/1.11/mootools.js +1577 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/prototype/1.6.0.2/prototype.js +4221 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/builder.js +131 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/controls.js +835 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/dragdrop.js +944 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/effects.js +1090 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/scriptaculous.js +51 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/slider.js +278 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/unittest.js +564 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/builder.js +136 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/controls.js +965 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/dragdrop.js +974 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/effects.js +1122 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/scriptaculous.js +58 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/slider.js +275 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/sound.js +55 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/unittest.js +568 -0
- data/test/vendor/jQuery/1.3.2/test/polluted.php +64 -0
- data/test/vendor/jQuery/1.3.2/test/qunit/testrunner.js +780 -0
- data/test/vendor/jQuery/1.3.2/test/qunit/testsuite.css +120 -0
- data/test/vendor/jQuery/1.3.2/test/test.js +41 -0
- data/test/vendor/jQuery/1.3.2/test/unit/ajax.js +856 -0
- data/test/vendor/jQuery/1.3.2/test/unit/core.js +1872 -0
- data/test/vendor/jQuery/1.3.2/test/unit/data.js +160 -0
- data/test/vendor/jQuery/1.3.2/test/unit/dimensions.js +86 -0
- data/test/vendor/jQuery/1.3.2/test/unit/event.js +670 -0
- data/test/vendor/jQuery/1.3.2/test/unit/fx.js +451 -0
- data/test/vendor/jQuery/1.3.2/test/unit/offset.js +173 -0
- data/test/vendor/jQuery/1.3.2/test/unit/selector.js +395 -0
- data/test/vendor/jQuery/1.3.2/test/xhtml.php +5 -0
- data/test/vendor/jQuery/1.3.2/version.txt +1 -0
- metadata +158 -22
- data/lib/envjs/runtime.rb.smp +0 -133
- data/test/envjs-call-load-test.js +0 -5
- data/test/envjs-prototype.js +0 -5
- data/test/qunit/package.json +0 -21
- data/test/qunit/test/index.html +0 -17
- data/test/qunit/test/same.js +0 -1368
- data/test/qunit/test/test.js +0 -136
- data/test/qunit.smp/package.json +0 -21
- data/test/qunit.smp/test/index.html +0 -17
- data/test/qunit.smp/test/same.js +0 -1368
- data/test/qunit.smp/test/test.js +0 -136
- data/test/rhino-call-load-test.js +0 -5
- data/test/rhino-prototype.js +0 -5
- data/test/test-with-envs-jar.js +0 -8
- data/test/test-with-rhino-jar.js +0 -9
@@ -0,0 +1,48 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5
|
+
<title>Envjs Window Spec</title>
|
6
|
+
<link rel="stylesheet" media="screen" href="../qunit.css"/>
|
7
|
+
<link rel="stylesheet" media="screen" href="../envjs.spec.css"/>
|
8
|
+
<link rel="stylesheet" media="screen" href="http://www.envjs.com/css/blueprint/screen.css"/>
|
9
|
+
<link rel="stylesheet" media="screen" href="http://www.envjs.com/css/site.css"/>
|
10
|
+
<script type='text/javascript' src='../qunit.js'></script>
|
11
|
+
<script type='text/javascript' src='../qunit.bdd.js'></script>
|
12
|
+
|
13
|
+
<!-- specs for this general api 'module' -->
|
14
|
+
<script type='text/javascript' src='window.js'></script>
|
15
|
+
<script type='text/javascript' src='css.js'></script>
|
16
|
+
<script type='text/javascript' src='dialog.js'></script>
|
17
|
+
<script type='text/javascript' src='document.js'></script>
|
18
|
+
<script type='text/javascript' src='event.js'></script>
|
19
|
+
<script type='text/javascript' src='history.js'></script>
|
20
|
+
<script type='text/javascript' src='location.js'></script>
|
21
|
+
<script type='text/javascript' src='navigator.js'></script>
|
22
|
+
<script type='text/javascript' src='screen.js'></script>
|
23
|
+
<script type='text/javascript' src='timer.js'></script>
|
24
|
+
</head>
|
25
|
+
<body class='container'>
|
26
|
+
<h2 id="qunit-banner">
|
27
|
+
<img id="envjs-icon"
|
28
|
+
src="../../fixtures/images/icon-blue.png"
|
29
|
+
height='40'/>
|
30
|
+
<span id="spec-title">Envjs Window Spec</span>
|
31
|
+
</h2>
|
32
|
+
<h2 id="qunit-userAgent"></h2>
|
33
|
+
<div id='qunit-testrunner-toolbar'></div>
|
34
|
+
<div id='qunit-test-summary'>
|
35
|
+
<ol id='qunit-tests'></ol>
|
36
|
+
</div>
|
37
|
+
<div id="qunit-main" style="display:none;">
|
38
|
+
<!--
|
39
|
+
Test HTML here:
|
40
|
+
|
41
|
+
not required to be in here but it makes it convenient
|
42
|
+
by convention to avoid having to look at the html
|
43
|
+
artifacts the test may require or have generated as
|
44
|
+
a side effect.
|
45
|
+
-->
|
46
|
+
</div>
|
47
|
+
</body>
|
48
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
/**
|
2
|
+
* @author thatcher
|
3
|
+
*/
|
4
|
+
|
5
|
+
(function(Q){
|
6
|
+
|
7
|
+
Q.describe('Window Timer',{
|
8
|
+
|
9
|
+
before:function(){
|
10
|
+
//setup
|
11
|
+
},
|
12
|
+
after:function(){
|
13
|
+
//tear down
|
14
|
+
}
|
15
|
+
|
16
|
+
}).should('provide the required w3c interfaces', function(){
|
17
|
+
|
18
|
+
expect(4);
|
19
|
+
ok(setTimeout, 'setTimeout');
|
20
|
+
ok(setInterval, 'setInterval');
|
21
|
+
ok(clearTimeout, 'clearTimeout');
|
22
|
+
ok(clearInterval, 'clearInterval');
|
23
|
+
|
24
|
+
});
|
25
|
+
|
26
|
+
})(QUnit);
|
@@ -0,0 +1,53 @@
|
|
1
|
+
/**
|
2
|
+
* @author thatcher
|
3
|
+
*/
|
4
|
+
var global_scope=this;
|
5
|
+
|
6
|
+
(function(Q){
|
7
|
+
|
8
|
+
Q.describe('Window Basic Properties',{
|
9
|
+
|
10
|
+
before:function(){
|
11
|
+
//setup
|
12
|
+
},
|
13
|
+
after:function(){
|
14
|
+
//tear down
|
15
|
+
}
|
16
|
+
|
17
|
+
}).should('provide the required w3c interfaces', function(){
|
18
|
+
|
19
|
+
expect(19);
|
20
|
+
ok(window, 'window');
|
21
|
+
ok(self, 'self');
|
22
|
+
ok(top, 'top');
|
23
|
+
ok(parent, 'parent');
|
24
|
+
ok(window.toString(), '[object Window]');
|
25
|
+
|
26
|
+
//these values are usually the empty string ''
|
27
|
+
//so we just verify the property is available
|
28
|
+
ok('name' in window, 'name');
|
29
|
+
ok('status' in window, 'status');
|
30
|
+
ok('closed' in window, 'closed');
|
31
|
+
ok('defaultStatus' in window, 'defaultStatus');
|
32
|
+
ok('length' in window, 'length');
|
33
|
+
ok('opener' in window, 'opener');
|
34
|
+
|
35
|
+
ok(frames, 'frames');
|
36
|
+
ok(open, 'open');
|
37
|
+
ok(close, 'close');
|
38
|
+
ok(innerHeight, 'innerHeight');
|
39
|
+
ok(outerHeight, 'outerHeight');
|
40
|
+
ok(outerWidth, 'outerWidth');
|
41
|
+
ok(screenX, 'screenX');
|
42
|
+
ok(screenY, 'screenY');
|
43
|
+
|
44
|
+
|
45
|
+
}).should('have the expected values', function(){
|
46
|
+
|
47
|
+
equals( window, global_scope, 'window is the global scope "this"');
|
48
|
+
equals( window, self, 'self is an alias for window');
|
49
|
+
equals( window, top, 'top is an alias for window when the window is not in a frame');
|
50
|
+
|
51
|
+
});
|
52
|
+
|
53
|
+
})(QUnit);
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5
|
+
<title>Envjs Window Spec</title>
|
6
|
+
<link rel="stylesheet" media="screen" href="../qunit.css"/>
|
7
|
+
<link rel="stylesheet" media="screen" href="../envjs.spec.css"/>
|
8
|
+
<link rel="stylesheet" media="screen" href="http://www.envjs.com/css/blueprint/screen.css"/>
|
9
|
+
<link rel="stylesheet" media="screen" href="http://www.envjs.com/css/site.css"/>
|
10
|
+
<script type='text/javascript' src='../qunit.js'></script>
|
11
|
+
<script type='text/javascript' src='../qunit.bdd.js'></script>
|
12
|
+
|
13
|
+
<!-- specs for this general api 'module' -->
|
14
|
+
<script type='text/javascript' src='css.js'></script>
|
15
|
+
<script type='text/javascript' src='dialog.js'></script>
|
16
|
+
<script type='text/javascript' src='document.js'></script>
|
17
|
+
<script type='text/javascript' src='event.js'></script>
|
18
|
+
<script type='text/javascript' src='history.js'></script>
|
19
|
+
<script type='text/javascript' src='location.js'></script>
|
20
|
+
<script type='text/javascript' src='navigator.js'></script>
|
21
|
+
<script type='text/javascript' src='window.js'></script>
|
22
|
+
<script type='text/javascript' src='timer.js'></script>
|
23
|
+
</head>
|
24
|
+
<body class='container'>
|
25
|
+
<h2 id="qunit-banner">
|
26
|
+
<img id="envjs-icon"
|
27
|
+
src="../../fixtures/images/icon-blue.png"
|
28
|
+
height='40'/>
|
29
|
+
<span id="spec-title">Envjs Window Spec</span>
|
30
|
+
</h2>
|
31
|
+
<h2 id="qunit-userAgent"></h2>
|
32
|
+
<div id='qunit-testrunner-toolbar'></div>
|
33
|
+
<div id='qunit-test-summary'>
|
34
|
+
<ol id='qunit-tests'></ol>
|
35
|
+
</div>
|
36
|
+
<div id="qunit-main" style="display:none;">
|
37
|
+
<!--
|
38
|
+
Test HTML here:
|
39
|
+
|
40
|
+
not required to be in here but it makes it convenient
|
41
|
+
by convention to avoid having to look at the html
|
42
|
+
artifacts the test may require or have generated as
|
43
|
+
a side effect.
|
44
|
+
-->
|
45
|
+
</div>
|
46
|
+
</body>
|
47
|
+
</html>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/**
|
2
|
+
* @author thatcher
|
3
|
+
*/
|
4
|
+
|
5
|
+
(function(Q){
|
6
|
+
|
7
|
+
Q.describe('Another TEMPLATE Spec',{
|
8
|
+
before:function(){
|
9
|
+
//setup
|
10
|
+
},
|
11
|
+
after:function(){
|
12
|
+
//tear down
|
13
|
+
}
|
14
|
+
|
15
|
+
}).should('do something', function(){
|
16
|
+
|
17
|
+
expect(1);
|
18
|
+
ok(true, 'good job');
|
19
|
+
|
20
|
+
}).should('do something else', function(){
|
21
|
+
|
22
|
+
expect(1);
|
23
|
+
ok(true, 'good job');
|
24
|
+
|
25
|
+
}).pending('should do something new soon', function(){
|
26
|
+
|
27
|
+
expect(1);
|
28
|
+
ok(false, 'todo');
|
29
|
+
});
|
30
|
+
|
31
|
+
})(QUnit);
|
data/test/test.js
ADDED
data/test/unit/elementmembers.js
CHANGED
@@ -27,3 +27,34 @@ test("attributes common to all HTML elements", function() {
|
|
27
27
|
}catch(e){print(e);}
|
28
28
|
});
|
29
29
|
|
30
|
+
test("select element", function() {
|
31
|
+
expect(14);
|
32
|
+
|
33
|
+
var select = document.getElementById('select1');
|
34
|
+
equals("select-one", select.type, "Select field's type is select-one by default");
|
35
|
+
|
36
|
+
select = document.getElementById('test_value');
|
37
|
+
equals("optionvalue", select.value, "Select field returns its selected option's value as its value");
|
38
|
+
|
39
|
+
// if option2 is selected, unselect option1 (and update select.value)
|
40
|
+
select = document.getElementById('test_selecting');
|
41
|
+
select.options[2].selected = true;
|
42
|
+
ok(select.options[2].selected, "Select's option should be selected");
|
43
|
+
ok(!select.options[1].selected, "Previously selected option should be automatically unselected");
|
44
|
+
equals("2", select.value, "Select's value should be updated");
|
45
|
+
|
46
|
+
// if option2 is unselected, then select first option on the list (and update select.value)
|
47
|
+
select.options[2].selected = false;
|
48
|
+
ok(!select.options[2].selected, "Select's option should be unselected");
|
49
|
+
ok(!select.options[1].selected, "Previously selected option should stay unselected");
|
50
|
+
ok(select.options[0].selected, "First option in the select should be selected");
|
51
|
+
equals("0", select.value, "Select's value should be updated");
|
52
|
+
|
53
|
+
// update select's value and options when selectedIndex is changed
|
54
|
+
equals(0, select.selectedIndex, "Select's selectedIndex should return the index of selected option");
|
55
|
+
select.selectedIndex = 2;
|
56
|
+
equals(2, select.selectedIndex, "Select's selectedIndex should be updated");
|
57
|
+
equals("2", select.value, "Changing selectedIndex should update select's value");
|
58
|
+
ok(!select.options[0].selected, "Changing selectedIndex should unselect currently selected option");
|
59
|
+
ok(select.options[2].selected, "Changing selectedIndex should select option at given index");
|
60
|
+
});
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
* @author thatcher
|
3
|
+
*/
|
4
|
+
|
5
|
+
load('dist/env.rhino.js');
|
6
|
+
|
7
|
+
window.location = 'test/html/malformed.html';
|
8
|
+
|
9
|
+
|
10
|
+
var fixture = document.xml,
|
11
|
+
testhtml = '<!DOCTYPE html><html><head/><body><script>document.write("<a>efg");</script><p>abc</body></html>',
|
12
|
+
testfragment = '<div>this is a<strong>pig<div>oink oink!',
|
13
|
+
success = function(){
|
14
|
+
print(doc.xml);
|
15
|
+
};
|
16
|
+
|
17
|
+
var doc;
|
18
|
+
//Envjs.logLevel = Envjs.DEBUG;
|
19
|
+
doc = new DOMParser().parseFromString(testhtml);
|
20
|
+
print(doc.xml);
|
21
|
+
|
22
|
+
|
23
|
+
doc.body.innerHTML = testfragment;
|
24
|
+
print(doc.xml);
|
25
|
+
|
26
|
+
|
27
|
+
/*
|
28
|
+
var start = new Date().getTime();
|
29
|
+
for(var i=0;i<1000;i++){
|
30
|
+
parseHtmlDocument(trivial, document, null, null);
|
31
|
+
}
|
32
|
+
var stop = new Date().getTime();
|
33
|
+
print("1000 parses "+(stop-start));
|
34
|
+
*/
|
data/test/unit/onload.js
CHANGED
@@ -14,7 +14,7 @@ test("Execution of onload events in top-level document",
|
|
14
14
|
function() {
|
15
15
|
|
16
16
|
// top-level window-onload works, or test framework wouldn't run.....
|
17
|
-
expect(
|
17
|
+
expect(11);
|
18
18
|
|
19
19
|
var mtch = document.getElementById('pCreatedByBodyOnload').innerHTML.
|
20
20
|
match(/dynamically-generated paragraph/);
|
@@ -22,13 +22,11 @@ test("Execution of onload events in top-level document",
|
|
22
22
|
"Got confirmation that body-onload handler executed");
|
23
23
|
}catch(e){print(e);}
|
24
24
|
|
25
|
-
/*
|
26
25
|
mtch = document.getElementById('pCreatedByIframeOnload').innerHTML.
|
27
26
|
match(/iframe-onload event handler/);
|
28
27
|
try{ ok(mtch && mtch.length > 0,
|
29
28
|
"Got confirmation that iframe-onload handler executed");
|
30
29
|
}catch(e){print(e);}
|
31
|
-
*/
|
32
30
|
|
33
31
|
var iframe = document.getElementById('loadediframe');
|
34
32
|
var aCounter = 0;
|
data/test/unit/parser.js
CHANGED
@@ -1,113 +1,121 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
module("Html5Parser");
|
2
|
+
|
3
|
+
var should = function(msg, options){
|
4
|
+
try{
|
5
|
+
if(options.be&&options.be=='equal'){
|
6
|
+
equals(
|
7
|
+
options.expected,
|
8
|
+
options.actual,
|
9
|
+
msg
|
10
|
+
);
|
11
|
+
}else if(options.be&&options.be==='safe'){
|
12
|
+
options.test();
|
13
|
+
ok(true, msg);
|
14
|
+
}else{
|
15
|
+
ok(false, 'unknown test '+options.be);
|
16
|
+
}
|
17
|
+
}catch(e){
|
18
|
+
//no nothing
|
19
|
+
equals(true, false, options.msg||'This test failed.');
|
20
|
+
}finally{
|
21
|
+
//TODO: might as well keep score here
|
22
|
+
return this;
|
23
|
+
}
|
24
|
+
};
|
25
25
|
|
26
|
-
equals(XMLP._TEXT, p.next(), "Parser emits second text event");
|
27
|
-
actual = p.getContent().substring(p.getContentBegin(), p.getContentEnd());
|
28
|
-
equals("World", actual, "Parser content set");
|
29
26
|
|
30
|
-
|
31
|
-
actual = p.getContent().substring(p.getContentBegin(), p.getContentEnd());
|
32
|
-
equals('"', actual, "Parser replaces second " entity");
|
27
|
+
test("XML Standard Entities: Spot Check", function() {
|
33
28
|
|
34
|
-
|
35
|
-
|
36
|
-
|
29
|
+
expect(2);
|
30
|
+
var htmlstr =
|
31
|
+
"<div id='xmlentity' \
|
32
|
+
style='<Hello>, "W'rld"!'\
|
33
|
+
><Hello>, "W'rld"!</div>";
|
37
34
|
|
38
|
-
|
39
|
-
|
35
|
+
var doc = document.implementation.createHTMLDocument();
|
36
|
+
doc.body.innerHTML = htmlstr;
|
37
|
+
|
38
|
+
should("Replace entities at nodeValue",{
|
39
|
+
be:'equal',
|
40
|
+
actual : doc.
|
41
|
+
getElementById('xmlentity').
|
42
|
+
childNodes[0].
|
43
|
+
nodeValue,
|
44
|
+
expected : '<Hello>, "W\'rld"!'
|
45
|
+
}).
|
46
|
+
should("serialize only &, < and > for TextNode with innerHTML",{
|
47
|
+
be: 'equal',
|
48
|
+
actual : doc.
|
49
|
+
getElementById('xmlentity').
|
50
|
+
innerHTML,
|
51
|
+
expected : '<Hello>, "W\'rld"!'
|
52
|
+
});
|
53
|
+
|
40
54
|
});
|
41
55
|
|
42
|
-
test("HTML
|
43
|
-
|
44
|
-
|
45
|
-
var
|
46
|
-
expect(numexpect)
|
47
|
-
var htmlstr = "<html><body>" & < > "+
|
56
|
+
test("HTML Standard Entities: Spot Check", function() {
|
57
|
+
|
58
|
+
expect(1);
|
59
|
+
var htmlstr = "<div id='htmlentity'>" & < > "+
|
48
60
|
" © ® ¥ ¶ " +
|
49
61
|
"Ê Õ æ ÷ Κ θ "+
|
50
62
|
"• … ™ ⇒ ∑ ♣ " +
|
51
|
-
"  &mdash
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
p.getContentBegin(), p.getContentEnd());
|
69
|
-
equals(expected[idx], actual, "Parser replaces entity -- '" +
|
70
|
-
expected[idx] + "'");
|
71
|
-
|
72
|
-
equals(XMLP._TEXT, p.next(), "Parser emits text event");
|
73
|
-
actual = p.getContent().substring(
|
74
|
-
p.getContentBegin(), p.getContentEnd());
|
75
|
-
equals(" ", actual, "Parser content set");
|
76
|
-
}
|
63
|
+
"  —</div>";
|
64
|
+
|
65
|
+
var doc = document.implementation.createHTMLDocument();
|
66
|
+
doc.body.innerHTML = htmlstr;
|
67
|
+
|
68
|
+
should("serialize only &, < and > for TextNode with innerHTML",{
|
69
|
+
be:'equal',
|
70
|
+
actual:doc.
|
71
|
+
getElementById('htmlentity').
|
72
|
+
innerHTML,
|
73
|
+
expected : '" & < > '+
|
74
|
+
'\xA0 \xA9 \xAE \xA5 \xB6 '+
|
75
|
+
'\xCA \xD5 \xE6 \xF7 \u039A \u03B8 '+
|
76
|
+
'\u2022 \u2026 \u2122 \u21D2 \u2211 \u2663 '+
|
77
|
+
'\u2002 \u2014'
|
78
|
+
});
|
79
|
+
|
77
80
|
});
|
78
81
|
|
79
|
-
test("
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
equals(XMLP._ELM_B, p.next(), "Opening html tag"); // _ELM_B <html>
|
85
|
-
equals(XMLP._ELM_B, p.next(), "Opening body tag"); // _ELM_B <body>
|
82
|
+
test("Serialization Conventions", function(){
|
83
|
+
|
84
|
+
});
|
85
|
+
|
86
|
+
test("Ugly HTML Parsing", function() {
|
86
87
|
|
87
|
-
|
88
|
-
|
89
|
-
|
88
|
+
expect(1);
|
89
|
+
|
90
|
+
var doc = document.implementation.createHTMLDocument();
|
91
|
+
doc.body.innerHTML = '<div id="pig"><p>this is a pig... 'oink! oink!'</div>';
|
92
|
+
|
93
|
+
should('correct the unclosed p tag',{
|
94
|
+
be:'equal',
|
95
|
+
actual:doc.
|
96
|
+
getElementById('pig').
|
97
|
+
xml,
|
98
|
+
expected:'<div id="pig"><p>this is a pig... \'oink! oink!\'</p></div>'
|
99
|
+
});
|
90
100
|
|
91
|
-
equals(XMLP._ELM_E, p.next(), "Closing body tag"); // _ELM_E </body>
|
92
|
-
equals(XMLP._ELM_E, p.next(), "Closing html tag"); // _ELM_E </html>
|
93
101
|
});
|
94
|
-
|
95
|
-
test("
|
96
|
-
|
97
|
-
|
98
|
-
htmlstr = "<div><p>this is a pig... 'oink! oink!'</div>";
|
99
|
-
|
100
|
-
Envjs.tidyHTML = true;
|
101
|
-
equals(Envjs.tidy(htmlstr),
|
102
|
-
"<div><p>this is a pig... 'oink! oink!'</p></div>",
|
103
|
-
'got expected xmlstring');
|
104
|
-
|
102
|
+
|
103
|
+
test("Really Ugly HTML Parsing", function() {
|
104
|
+
|
105
|
+
expect(1);
|
105
106
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
107
|
+
should('parse the document without error',{
|
108
|
+
be:'safe',
|
109
|
+
test:function(){
|
110
|
+
var doc = document.implementation.createDocument();
|
111
|
+
doc.load('html/malformed.html');
|
112
|
+
}
|
113
|
+
});
|
114
|
+
|
115
|
+
});
|
116
|
+
|
117
|
+
// Local Variables:
|
118
|
+
// espresso-indent-level:4
|
119
|
+
// c-basic-offset:4
|
120
|
+
// tab-width:4
|
121
|
+
// End:
|
@@ -0,0 +1,98 @@
|
|
1
|
+
== jQuery ChangeLog ==
|
2
|
+
|
3
|
+
== 1.2.2 ==
|
4
|
+
|
5
|
+
* show is now element aware (uses default display type instead of just forcing block)
|
6
|
+
* New special events api: jQuery.events.special
|
7
|
+
* ready is now a real event and can be bound, unbound and triggered.
|
8
|
+
* mouseenter and mouseleave now work on all supported browsers
|
9
|
+
* The hover helper method now uses the mouseenter and mouseleave events
|
10
|
+
* New offset test suite test/offset.html (requires your pop-up blocker to be disabled)
|
11
|
+
* Refactored the width and height methods (fixes lots of bugs)
|
12
|
+
* Fixed event memory leaks in IE (html, remove, empty also no longer leak memory)
|
13
|
+
* Fixed window/document width/height values
|
14
|
+
* Fixed event.pageX and event.pageY in IE
|
15
|
+
|
16
|
+
== 1.2 ==
|
17
|
+
|
18
|
+
=== 1.1.3 ===
|
19
|
+
* Always create an ActiveXObject when it is available instead of the XMLHttpRequest, even in IE7
|
20
|
+
* Removed XMLHttpRequest shadowing, may break code that relies on existence of that function for browser checking
|
21
|
+
* ...
|
22
|
+
|
23
|
+
=== 1.1.2 ===
|
24
|
+
|
25
|
+
* Event handlers (like element.onclick) are now removed when no more functions are bound to the event.
|
26
|
+
* Fixed DOM Manipulations for form elements.
|
27
|
+
* Fixed jQuery.isFunction to return false on nodes.
|
28
|
+
* Fixed jQuery.className.has, escaping regex characters in className (for metadata)
|
29
|
+
* Fixed an issue in IE where an event on a cloned element is fired during a .clone() inside of an event handler.
|
30
|
+
* Fixed IE ID selectors selecting by the name attribute.
|
31
|
+
* Change: Events are now internally stored in elem.$events rather than elem.events (due to a nasty bug relating to DOM 0 expandos).
|
32
|
+
* .attr('href') is now consistent in all browsers.
|
33
|
+
* @href is now consistent in all browsers.
|
34
|
+
* Fixed the slideDown flickering bug.
|
35
|
+
* Having a \r endline in $("...") caused a never-ending loop.
|
36
|
+
* Fixed IE6 AJAX memory leak
|
37
|
+
* Fixed bug in pushStack, reporting an element at [0] in a jQuery object with length 0
|
38
|
+
|
39
|
+
=== 1.1.1 ===
|
40
|
+
|
41
|
+
* Setting the numerical value of a css property failed, for example: .css("opacity",0.5) (also occurred with zIndex, fontWeight)
|
42
|
+
* Calling $(..., jqobj) with a context of a jQuery object failed.
|
43
|
+
* Accessing a property on an element that doesn't exist caused an error, for example: $("#foobar").attr("id")
|
44
|
+
* Calling .load() without a callback caused an error.
|
45
|
+
* You couldn't cancel an event that was triggered using .trigger() or .click() (for example).
|
46
|
+
* .add()ing a single DOM element to a jQuery object was broken.
|
47
|
+
* Passing in undefined values to a $.post() caused weird errors to occur.
|
48
|
+
* Accessing child nodes within an xml document didn't work properly.
|
49
|
+
* jQuery.isFunction() was unable to reliably determine a function, in a cross-browser way.
|
50
|
+
* Triggering a .click() failed in IE.
|
51
|
+
* Triggered click handlers were executed twice in most browsers.
|
52
|
+
* A newline passed into $(...) caused Firefox to go into a never-ending loop.
|
53
|
+
* Calling $.post() without any data caused an error.
|
54
|
+
* Calling a descendant selector after a child selector caused strange results, for example: $("ul > li ul")
|
55
|
+
* Triggered events did not occur if an event handler was not bound for that event.
|
56
|
+
|
57
|
+
== 1.1 ==
|
58
|
+
|
59
|
+
* Massive speed-ups (4x-10x) in the selector engine.
|
60
|
+
* You can now unbind event handlers from within themselves
|
61
|
+
* Added new .one( "type", fn ) method
|
62
|
+
* text(String) now escapes HTML
|
63
|
+
* Added attr(String,Function) to calculate the value
|
64
|
+
* Performming .click(), .blur(), .focus(), .submit() will actually trigger the browsers default action for those events.
|
65
|
+
* Added global settings for AJAX (in addition to timeout), use $.ajaxSetup() to modify them
|
66
|
+
* Implemented a better error handling for ajax requests. Exceptions caused by dropping connections are now handled, too.
|
67
|
+
* Improved event fixing (Opera provides event.srcElement, must ignore it if target is available; only create pageX if clientX is available)
|
68
|
+
* Fixed nth-child selectors to start on the right number
|
69
|
+
* jQuery is no longer destructive. Doing var a = $("a"); a.find("span"); does not change the original "a" variable.
|
70
|
+
* Fixed synchronous requests
|
71
|
+
* Fixed ID with context selectors (eg. div #id doesn't ignore "div" anymore)
|
72
|
+
* Fixed docs for html(): Now mentions that is not available for XML documents
|
73
|
+
* Improved AJAX docs (eg. more examples for $.ajax)
|
74
|
+
* Documented filter(Function), a very powerful approach for custom filtering
|
75
|
+
* Improved docs for FX module, merging method descriptions and marking optional arguments
|
76
|
+
* Improved docs for append, prepend, before and after, merging the three pairs into one
|
77
|
+
* Improved show/hide animations to show only hidden and hide only visible elements
|
78
|
+
* Removed .oneEvent() and .unEvent() helper methods.
|
79
|
+
* Removed all CSS helper methods.
|
80
|
+
* Removed most attribute helper methods.
|
81
|
+
* Removed the (undocumented) .find( "selector", fn ) for all destructive methods.
|
82
|
+
* $.get, $.getIfModified, $.post, $.getScript and $.getJSON now all pass through the XMLHttpRequest as returned by $.ajax
|
83
|
+
|
84
|
+
== 1.0.4 ==
|
85
|
+
|
86
|
+
* Tons of bug fixes
|
87
|
+
* Extensions to $.ajax: $.ajax accepts additonal options: beforeSend, async and processData; returns XMLHttpRequest to allow manual aborting of requests, see docs for details
|
88
|
+
* AJAX module: the public $.ajax API is now used internally (for $.get/$.post etc.); loading scripts works now much more reliable on all browers except Safari
|
89
|
+
* New global ajax handler: ajaxSend - called before an ajax request is sent
|
90
|
+
* Extensions to global ajax handlers: ajaxSend, ajaxSuccess, ajaxError and ajaxComplete get XMLHttpRequest and settings passed as arguments
|
91
|
+
* Extensions to event handling: pageX and pageY are available x-browser (IE does not provide native pageX/Y)
|
92
|
+
* Improved docs: $(String) method has now two seperate descriptions, one for selecting elements, one for creating (html on-the-fly)
|
93
|
+
* FX module: Most inline stlyes added by animations are now removed when the animation is complete, eg. height style when animating height (exception: display styles)
|
94
|
+
* Added note to attr(String, Object) about issues with setting the name property on input elements
|
95
|
+
* Seperated internal stuff from get() into set()
|
96
|
+
* Merged the two API examples for each() into one more precise example
|
97
|
+
* Improved docs for $.browser and added docs for $.boxModel
|
98
|
+
* Docs for the jQuery constructor $() were improved: There is now $(String expression[, Object context]) and $(String html)
|