~ubuntu-branches/ubuntu/precise/maas/precise-updates

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/tests/dom/tests/dom-size-test.js

Tags: 1.2+bzr1373+dfsg-0ubuntu1~12.04.4
* SECURITY UPDATE: failure to authenticate downloaded content (LP: #1039513)
  - debian/patches/CVE-2013-1058.patch: Authenticate downloaded files with
    GnuPG and MD5SUM files. Thanks to Julian Edwards.
  - CVE-2013-1058
* SECURITY UPDATE: configuration options may be loaded from current working
  directory (LP: #1158425)
  - debian/patches/CVE-2013-1057-1-2.patch: Do not load configuration
    options from the current working directory. Thanks to Julian Edwards.
  - CVE-2013-1057

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
YUI.add('dom-size-test', function(Y) {
2
 
    var Assert = Y.Assert,
3
 
        ArrayAssert = Y.ArrayAssert;
4
 
 
5
 
    Y.Test.Runner.add(new Y.Test.Case({
6
 
        name: 'Y.DOM._setSize',
7
 
 
8
 
        'should set the node offsetWidth to the given value': function() {
9
 
            var node = document.createElement('div');
10
 
 
11
 
            document.body.appendChild(node);
12
 
            Y.DOM._setSize(node, 'width', 100);
13
 
 
14
 
            Assert.areEqual(100, node.offsetWidth);
15
 
            document.body.removeChild(node);
16
 
        },
17
 
 
18
 
        'should set the node offsetHeight to the given value': function() {
19
 
            var node = document.createElement('div');
20
 
 
21
 
            document.body.appendChild(node);
22
 
            Y.DOM._setSize(node, 'height', 100);
23
 
 
24
 
            Assert.areEqual(100, node.offsetHeight);
25
 
            document.body.removeChild(node);
26
 
        },
27
 
 
28
 
        'should set the node offsetWidth to zero if given a negative number': function() {
29
 
            var node = document.createElement('div');
30
 
 
31
 
            document.body.appendChild(node);
32
 
            Y.DOM._setSize(node, 'width', -100);
33
 
 
34
 
            Assert.areEqual(0, node.offsetWidth);
35
 
            document.body.removeChild(node);
36
 
        },
37
 
 
38
 
        'should set the node offsetHeight to zero if given a negative number': function() {
39
 
            var node = document.createElement('div');
40
 
 
41
 
            document.body.appendChild(node);
42
 
            Y.DOM._setSize(node, 'height', -100);
43
 
 
44
 
            Assert.areEqual(0, node.offsetHeight);
45
 
            document.body.removeChild(node);
46
 
        },
47
 
 
48
 
        'should set the offsetWidth via setWidth': function() {
49
 
            var node = document.createElement('div');
50
 
 
51
 
            document.body.appendChild(node);
52
 
            Y.DOM.setWidth(node, 100);
53
 
 
54
 
            Assert.areEqual(100, node.offsetWidth);
55
 
            document.body.removeChild(node);
56
 
        },
57
 
 
58
 
        'should set the offsetHeight via setHeight': function() {
59
 
            var node = document.createElement('div');
60
 
 
61
 
            document.body.appendChild(node);
62
 
            Y.DOM.setHeight(node, 100);
63
 
 
64
 
            Assert.areEqual(100, node.offsetHeight);
65
 
            document.body.removeChild(node);
66
 
        },
67
 
 
68
 
        'should set offsetWidth accounting for padding': function() {
69
 
            var node = document.createElement('div');
70
 
 
71
 
            document.body.appendChild(node);
72
 
            node.style.padding = '10px';
73
 
            Y.DOM.setWidth(node, 100);
74
 
 
75
 
            Assert.areEqual(100, node.offsetWidth);
76
 
            document.body.removeChild(node);
77
 
 
78
 
        },
79
 
 
80
 
        'should set offsetHeight accounting for padding': function() {
81
 
            var node = document.createElement('div');
82
 
 
83
 
            document.body.appendChild(node);
84
 
            node.style.padding = '10px';
85
 
            Y.DOM.setHeight(node, 100);
86
 
 
87
 
            Assert.areEqual(100, node.offsetHeight);
88
 
            document.body.removeChild(node);
89
 
        },
90
 
 
91
 
        'should set offsetWidth to padding when setting to zero': function() {
92
 
            var node = document.createElement('div');
93
 
 
94
 
            document.body.appendChild(node);
95
 
            node.style.padding = '10px';
96
 
            Y.DOM.setWidth(node, 0);
97
 
 
98
 
            Assert.areEqual(20, node.offsetWidth);
99
 
            document.body.removeChild(node);
100
 
        },
101
 
 
102
 
        'should set offsetHeight to padding when setting to zero': function() {
103
 
            var node = document.createElement('div');
104
 
 
105
 
            document.body.appendChild(node);
106
 
            node.style.padding = '10px';
107
 
            Y.DOM.setHeight(node, 0);
108
 
 
109
 
            Assert.areEqual(20, node.offsetHeight);
110
 
            document.body.removeChild(node);
111
 
        }
112
 
    }));
113
 
 
114
 
}, '@VERSION@' ,{requires:['dom-base', 'test']});