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,160 @@
|
|
1
|
+
module("data");
|
2
|
+
|
3
|
+
test("jQuery.data", function() {
|
4
|
+
expect(5);
|
5
|
+
var div = jQuery("#foo")[0];
|
6
|
+
equals( jQuery.data(div, "test"), undefined, "Check for no data exists" );
|
7
|
+
jQuery.data(div, "test", "success");
|
8
|
+
equals( jQuery.data(div, "test"), "success", "Check for added data" );
|
9
|
+
jQuery.data(div, "test", "overwritten");
|
10
|
+
equals( jQuery.data(div, "test"), "overwritten", "Check for overwritten data" );
|
11
|
+
jQuery.data(div, "test", undefined);
|
12
|
+
equals( jQuery.data(div, "test"), "overwritten", "Check that data wasn't removed");
|
13
|
+
jQuery.data(div, "test", null);
|
14
|
+
ok( jQuery.data(div, "test") === null, "Check for null data");
|
15
|
+
});
|
16
|
+
|
17
|
+
test(".data()", function() {
|
18
|
+
expect(22);
|
19
|
+
var div = jQuery("#foo");
|
20
|
+
equals( div.data("test"), undefined, "Check for no data exists" );
|
21
|
+
div.data("test", "success");
|
22
|
+
equals( div.data("test"), "success", "Check for added data" );
|
23
|
+
div.data("test", "overwritten");
|
24
|
+
equals( div.data("test"), "overwritten", "Check for overwritten data" );
|
25
|
+
div.data("test", undefined);
|
26
|
+
equals( div.data("test"), "overwritten", "Check that data wasn't removed");
|
27
|
+
div.data("test", null);
|
28
|
+
ok( div.data("test") === null, "Check for null data");
|
29
|
+
|
30
|
+
div.data("test", "overwritten");
|
31
|
+
var hits = {test:0}, gets = {test:0};
|
32
|
+
|
33
|
+
div
|
34
|
+
.bind("setData",function(e,key,value){ hits[key] += value; })
|
35
|
+
.bind("setData.foo",function(e,key,value){ hits[key] += value; })
|
36
|
+
.bind("getData",function(e,key){ gets[key] += 1; })
|
37
|
+
.bind("getData.foo",function(e,key){ gets[key] += 3; });
|
38
|
+
|
39
|
+
div.data("test.foo", 2);
|
40
|
+
equals( div.data("test"), "overwritten", "Check for original data" );
|
41
|
+
equals( div.data("test.foo"), 2, "Check for namespaced data" );
|
42
|
+
equals( div.data("test.bar"), "overwritten", "Check for unmatched namespace" );
|
43
|
+
equals( hits.test, 2, "Check triggered setter functions" );
|
44
|
+
equals( gets.test, 5, "Check triggered getter functions" );
|
45
|
+
|
46
|
+
hits.test = 0;
|
47
|
+
gets.test = 0;
|
48
|
+
|
49
|
+
div.data("test", 1);
|
50
|
+
equals( div.data("test"), 1, "Check for original data" );
|
51
|
+
equals( div.data("test.foo"), 2, "Check for namespaced data" );
|
52
|
+
equals( div.data("test.bar"), 1, "Check for unmatched namespace" );
|
53
|
+
equals( hits.test, 1, "Check triggered setter functions" );
|
54
|
+
equals( gets.test, 5, "Check triggered getter functions" );
|
55
|
+
|
56
|
+
hits.test = 0;
|
57
|
+
gets.test = 0;
|
58
|
+
|
59
|
+
div
|
60
|
+
.bind("getData",function(e,key){ return key + "root"; })
|
61
|
+
.bind("getData.foo",function(e,key){ return key + "foo"; });
|
62
|
+
|
63
|
+
equals( div.data("test"), "testroot", "Check for original data" );
|
64
|
+
equals( div.data("test.foo"), "testfoo", "Check for namespaced data" );
|
65
|
+
equals( div.data("test.bar"), "testroot", "Check for unmatched namespace" );
|
66
|
+
|
67
|
+
// #3748
|
68
|
+
var $elem = jQuery({});
|
69
|
+
equals( $elem.data('nothing'), undefined, "Non-existent data returns undefined");
|
70
|
+
equals( $elem.data('null',null).data('null'), null, "null's are preserved");
|
71
|
+
equals( $elem.data('emptyString','').data('emptyString'), '', "Empty strings are preserved");
|
72
|
+
equals( $elem.data('false',false).data('false'), false, "false's are preserved");
|
73
|
+
|
74
|
+
// Clean up
|
75
|
+
$elem.removeData();
|
76
|
+
});
|
77
|
+
|
78
|
+
test("jQuery.removeData", function() {
|
79
|
+
expect(1);
|
80
|
+
var div = jQuery("#foo")[0];
|
81
|
+
jQuery.data(div, "test", "testing");
|
82
|
+
jQuery.removeData(div, "test");
|
83
|
+
equals( jQuery.data(div, "test"), undefined, "Check removal of data" );
|
84
|
+
});
|
85
|
+
|
86
|
+
test(".removeData()", function() {
|
87
|
+
expect(6);
|
88
|
+
var div = jQuery("#foo");
|
89
|
+
div.data("test", "testing");
|
90
|
+
div.removeData("test");
|
91
|
+
equals( div.data("test"), undefined, "Check removal of data" );
|
92
|
+
|
93
|
+
div.data("test", "testing");
|
94
|
+
div.data("test.foo", "testing2");
|
95
|
+
div.removeData("test.bar");
|
96
|
+
equals( div.data("test.foo"), "testing2", "Make sure data is intact" );
|
97
|
+
equals( div.data("test"), "testing", "Make sure data is intact" );
|
98
|
+
|
99
|
+
div.removeData("test");
|
100
|
+
equals( div.data("test.foo"), "testing2", "Make sure data is intact" );
|
101
|
+
equals( div.data("test"), undefined, "Make sure data is intact" );
|
102
|
+
|
103
|
+
div.removeData("test.foo");
|
104
|
+
equals( div.data("test.foo"), undefined, "Make sure data is intact" );
|
105
|
+
});
|
106
|
+
|
107
|
+
test("queue() defaults to 'fx' type", function () {
|
108
|
+
expect(2);
|
109
|
+
stop();
|
110
|
+
|
111
|
+
var $foo = jQuery("#foo");
|
112
|
+
$foo.queue("fx", [ "sample", "array" ]);
|
113
|
+
var arr = $foo.queue();
|
114
|
+
isSet(arr, [ "sample", "array" ], "queue() got an array set with type 'fx'");
|
115
|
+
$foo.queue([ "another", "one" ]);
|
116
|
+
var arr = $foo.queue("fx");
|
117
|
+
isSet(arr, [ "another", "one" ], "queue('fx') got an array set with no type");
|
118
|
+
// clean up after test
|
119
|
+
$foo.queue([]);
|
120
|
+
|
121
|
+
start();
|
122
|
+
});
|
123
|
+
|
124
|
+
test("queue() with other types",function() {
|
125
|
+
expect(9);
|
126
|
+
var counter = 0;
|
127
|
+
|
128
|
+
var $div = jQuery({});
|
129
|
+
|
130
|
+
$div
|
131
|
+
.queue('foo',function(){
|
132
|
+
equals( ++counter, 1, "Dequeuing" );
|
133
|
+
jQuery.dequeue(this,'foo');
|
134
|
+
})
|
135
|
+
.queue('foo',function(){
|
136
|
+
equals( ++counter, 2, "Dequeuing" );
|
137
|
+
jQuery(this).dequeue('foo');
|
138
|
+
})
|
139
|
+
.queue('foo',function(){
|
140
|
+
equals( ++counter, 3, "Dequeuing" );
|
141
|
+
})
|
142
|
+
.queue('foo',function(){
|
143
|
+
equals( ++counter, 4, "Dequeuing" );
|
144
|
+
});
|
145
|
+
|
146
|
+
equals( $div.queue('foo').length, 4, "Testing queue length" );
|
147
|
+
|
148
|
+
$div.dequeue('foo');
|
149
|
+
|
150
|
+
equals( counter, 3, "Testing previous call to dequeue" );
|
151
|
+
equals( $div.queue('foo').length, 1, "Testing queue length" );
|
152
|
+
|
153
|
+
$div.dequeue('foo');
|
154
|
+
|
155
|
+
equals( counter, 4, "Testing previous call to dequeue" );
|
156
|
+
equals( $div.queue('foo').length, 0, "Testing queue length" );
|
157
|
+
|
158
|
+
// Clean up
|
159
|
+
$div.removeData();
|
160
|
+
})
|
@@ -0,0 +1,86 @@
|
|
1
|
+
module("dimensions");
|
2
|
+
|
3
|
+
test("innerWidth()", function() {
|
4
|
+
expect(3);
|
5
|
+
|
6
|
+
var $div = jQuery("#nothiddendiv");
|
7
|
+
// set styles
|
8
|
+
$div.css({
|
9
|
+
margin: 10,
|
10
|
+
border: "2px solid #fff",
|
11
|
+
width: 30
|
12
|
+
});
|
13
|
+
|
14
|
+
equals($div.innerWidth(), 30, "Test with margin and border");
|
15
|
+
$div.css("padding", "20px");
|
16
|
+
equals($div.innerWidth(), 70, "Test with margin, border and padding");
|
17
|
+
$div.hide();
|
18
|
+
equals($div.innerWidth(), 70, "Test hidden div");
|
19
|
+
|
20
|
+
// reset styles
|
21
|
+
$div.css({ display: "", border: "", padding: "", width: "", height: "" });
|
22
|
+
});
|
23
|
+
|
24
|
+
test("innerHeight()", function() {
|
25
|
+
expect(3);
|
26
|
+
|
27
|
+
var $div = jQuery("#nothiddendiv");
|
28
|
+
// set styles
|
29
|
+
$div.css({
|
30
|
+
margin: 10,
|
31
|
+
border: "2px solid #fff",
|
32
|
+
height: 30
|
33
|
+
});
|
34
|
+
|
35
|
+
equals($div.innerHeight(), 30, "Test with margin and border");
|
36
|
+
$div.css("padding", "20px");
|
37
|
+
equals($div.innerHeight(), 70, "Test with margin, border and padding");
|
38
|
+
$div.hide();
|
39
|
+
equals($div.innerHeight(), 70, "Test hidden div");
|
40
|
+
|
41
|
+
// reset styles
|
42
|
+
$div.css({ display: "", border: "", padding: "", width: "", height: "" });
|
43
|
+
});
|
44
|
+
|
45
|
+
test("outerWidth()", function() {
|
46
|
+
expect(6);
|
47
|
+
|
48
|
+
var $div = jQuery("#nothiddendiv");
|
49
|
+
$div.css("width", 30);
|
50
|
+
|
51
|
+
equals($div.outerWidth(), 30, "Test with only width set");
|
52
|
+
$div.css("padding", "20px");
|
53
|
+
equals($div.outerWidth(), 70, "Test with padding");
|
54
|
+
$div.css("border", "2px solid #fff");
|
55
|
+
equals($div.outerWidth(), 74, "Test with padding and border");
|
56
|
+
$div.css("margin", "10px");
|
57
|
+
equals($div.outerWidth(), 74, "Test with padding, border and margin without margin option");
|
58
|
+
$div.css("position", "absolute");
|
59
|
+
equals($div.outerWidth(true), 94, "Test with padding, border and margin with margin option");
|
60
|
+
$div.hide();
|
61
|
+
equals($div.outerWidth(true), 94, "Test hidden div with padding, border and margin with margin option");
|
62
|
+
|
63
|
+
// reset styles
|
64
|
+
$div.css({ position: "", display: "", border: "", padding: "", width: "", height: "" });
|
65
|
+
});
|
66
|
+
|
67
|
+
test("outerHeight()", function() {
|
68
|
+
expect(6);
|
69
|
+
|
70
|
+
var $div = jQuery("#nothiddendiv");
|
71
|
+
$div.css("height", 30);
|
72
|
+
|
73
|
+
equals($div.outerHeight(), 30, "Test with only width set");
|
74
|
+
$div.css("padding", "20px");
|
75
|
+
equals($div.outerHeight(), 70, "Test with padding");
|
76
|
+
$div.css("border", "2px solid #fff");
|
77
|
+
equals($div.outerHeight(), 74, "Test with padding and border");
|
78
|
+
$div.css("margin", "10px");
|
79
|
+
equals($div.outerHeight(), 74, "Test with padding, border and margin without margin option");
|
80
|
+
equals($div.outerHeight(true), 94, "Test with padding, border and margin with margin option");
|
81
|
+
$div.hide();
|
82
|
+
equals($div.outerHeight(true), 94, "Test hidden div with padding, border and margin with margin option");
|
83
|
+
|
84
|
+
// reset styles
|
85
|
+
$div.css({ display: "", border: "", padding: "", width: "", height: "" });
|
86
|
+
});
|