sproutcore 1.11.0.rc2 → 1.11.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG +10 -0
- data/VERSION.yml +1 -1
- data/lib/frameworks/sproutcore/CHANGELOG.md +114 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/views_item_view.js +1 -7
- data/lib/frameworks/sproutcore/apps/showcase/views/views_list_view.js +9 -9
- data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +167 -5
- data/lib/frameworks/sproutcore/frameworks/ajax/system/response.js +24 -8
- data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/stack_layout.js +737 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/layout.js +0 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +11 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane_statechart.js +7 -11
- data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/child_view_layout_protocol.js +8 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/observable_protocol.js +9 -6
- data/lib/frameworks/sproutcore/frameworks/{desktop/protocols/responder.js → core_foundation/protocols/responder_protocol.js} +83 -17
- data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/{sparse_array_delegate.js → sparse_array_delegate_protocol.js} +11 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/view_transition_protocol.js +11 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/color.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/page.js +0 -22
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +61 -56
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/main_pane.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/append_remove.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/animation.js +63 -39
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/border_frame_test.js +28 -28
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createLayer.js +10 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layout.js +102 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +103 -103
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/replaceAllChildren_test.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +77 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view_states_test.js +18 -17
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +42 -49
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +5 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +16 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +241 -102
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout_style.js +1 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +0 -11
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/statechart.js +993 -610
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +6 -11
- data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +94 -27
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +133 -53
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +30 -35
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +73 -29
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/conflictedStoreKeys_test.js +156 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +61 -37
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/find.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +68 -39
- data/lib/frameworks/sproutcore/frameworks/designer/tests/coders/page.js +1 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +8 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +80 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/{drag_data_source.js → drag_data_source_protocol.js} +16 -10
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/{drag_source.js → drag_source_protocol.js} +28 -26
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/{drop_target.js → drop_target_protocol.js} +73 -75
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +39 -23
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +120 -97
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowSizeForContentIndex.js +26 -25
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +5 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/{dividers.js → dividers_test.js} +38 -38
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +29 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll_view.js +13 -18
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +41 -35
- data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +14 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +41 -26
- data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +2 -12
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/tap.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +14 -10
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/gesturable.js +104 -63
- data/lib/frameworks/sproutcore/frameworks/foundation/protocols/swap_transition_protocol.js +9 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_mixin_tests.js +1 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_resize_test.js +33 -33
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/transitions/view_transitions_test.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +0 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/transition_test.js +0 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +0 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +12 -8
- data/lib/frameworks/sproutcore/frameworks/media/resources/silence.mp3 +0 -0
- data/lib/frameworks/sproutcore/frameworks/media/tests/audio.js +69 -0
- data/lib/frameworks/sproutcore/frameworks/media/views/audio.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +11 -4
- data/lib/frameworks/sproutcore/frameworks/runtime/protocols/mixin_protocol.js +150 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +447 -137
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +9 -15
- data/lib/frameworks/sproutcore/frameworks/runtime/system/set.js +19 -17
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +188 -16
- data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/template_view/panes/template.js +0 -3
- data/lib/frameworks/sproutcore/frameworks/template_view/tests/panes/template.js +0 -17
- data/lib/frameworks/sproutcore/frameworks/template_view/tests/views/template/collection.js +43 -26
- data/lib/frameworks/sproutcore/frameworks/template_view/views/bindable_span.js +9 -2
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list.css +0 -1
- data/lib/frameworks/sproutcore/themes/ace/resources/scroll/scroll.css +3 -0
- data/sproutcore.gemspec +3 -3
- metadata +19 -17
- data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/horizontal_stack_layout.js +0 -465
- data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/vertical_stack_layout.js +0 -472
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/build.js +0 -87
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/build_children.js +0 -89
@@ -38,21 +38,26 @@ test("calls renderToContext() and sets layer to resulting element", function() {
|
|
38
38
|
});
|
39
39
|
|
40
40
|
test("invokes didCreateLayer() on receiver and all child views", function() {
|
41
|
-
var callCount = 0, mixinCount = 0
|
41
|
+
var callCount = 0, mixinCount = 0,
|
42
|
+
callees = [];
|
42
43
|
var v = SC.View.create({
|
43
44
|
|
44
|
-
didCreateLayer: function() { callCount++; },
|
45
|
+
didCreateLayer: function() { callees.push(this); callCount++; },
|
45
46
|
didCreateLayerMixin: function() { mixinCount++; },
|
46
47
|
|
47
48
|
childViews: [SC.View.extend({
|
48
|
-
didCreateLayer: function() { callCount++; },
|
49
|
+
didCreateLayer: function() { callees.push(this); callCount++; },
|
49
50
|
childViews: [SC.View.extend({
|
50
|
-
didCreateLayer: function() { callCount++; },
|
51
|
+
didCreateLayer: function() { callees.push(this); callCount++; },
|
51
52
|
didCreateLayerMixin: function() { mixinCount++; }
|
52
53
|
}), SC.View.extend({ /* no didCreateLayer */ })]
|
53
54
|
})]
|
54
55
|
});
|
55
56
|
|
57
|
+
// Grab the child and grandchild view for easy reference.
|
58
|
+
var childView = v.get('childViews').objectAt(0),
|
59
|
+
grandChildView = childView.get('childViews').objectAt(0);
|
60
|
+
|
56
61
|
// verify setup...
|
57
62
|
ok(v.didCreateLayer, 'precondition - has root');
|
58
63
|
ok(v.childViews[0].didCreateLayer, 'precondition - has firstChild');
|
@@ -62,6 +67,7 @@ test("invokes didCreateLayer() on receiver and all child views", function() {
|
|
62
67
|
v.createLayer();
|
63
68
|
equals(callCount, 3, 'did invoke all methods');
|
64
69
|
equals(mixinCount, 2, 'did invoke all mixin methods');
|
70
|
+
same(callees, [grandChildView, childView, v], "The didCreateLayer function should be called bottom-up so that parent's that alter children, do so while the child is in the proper state.");
|
65
71
|
v.destroy();
|
66
72
|
});
|
67
73
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
// License: Licensed under MIT license (see license.js)
|
6
6
|
// ==========================================================================
|
7
7
|
|
8
|
-
/*global module, test, equals, ok */
|
8
|
+
/*global module, test, equals, ok, same */
|
9
9
|
|
10
10
|
var view;
|
11
11
|
|
@@ -107,3 +107,104 @@ test("Test isFixedPosition for various layouts.", function () {
|
|
107
107
|
SC.run(function () { view.set('layout', { top: SC.LAYOUT_AUTO }); });
|
108
108
|
ok(!view.get('isFixedPosition'), "A top: SC.LAYOUT_AUTO (auto top) doesn't correspond to a fixed position.");
|
109
109
|
});
|
110
|
+
|
111
|
+
test("Test explicitLayout for various valid layouts.", function () {
|
112
|
+
same(view.get('explicitLayout'), { top: 0, right: 0, bottom: 0, left: 0 }, "No layout is implied as");
|
113
|
+
|
114
|
+
SC.run(function () { view.set('layout', { left: 5 }); });
|
115
|
+
same(view.get('explicitLayout'), { top: 0, right: 0, bottom: 0, left: 5 }, "{ left: 5 } is implied as");
|
116
|
+
|
117
|
+
SC.run(function () { view.set('layout', { top: 5 }); });
|
118
|
+
same(view.get('explicitLayout'), { top: 5, right: 0, bottom: 0, left: 0 }, "{ top: 5 } is implied as");
|
119
|
+
|
120
|
+
SC.run(function () { view.set('layout', { bottom: 5 }); });
|
121
|
+
same(view.get('explicitLayout'), { top: 0, right: 0, bottom: 5, left: 0 }, "{ bottom: 5 } is implied as");
|
122
|
+
|
123
|
+
SC.run(function () { view.set('layout', { right: 5 }); });
|
124
|
+
same(view.get('explicitLayout'), { top: 0, right: 5, bottom: 0, left: 0 }, "{ right: 5 } is implied as");
|
125
|
+
|
126
|
+
SC.run(function () { view.set('layout', { bottom: 5, left: 5 }); });
|
127
|
+
same(view.get('explicitLayout'), { top: 0, right: 0, bottom: 5, left: 5 }, "{ bottom: 5, left: 5 } is implied as");
|
128
|
+
|
129
|
+
SC.run(function () { view.set('layout', { right: 5, bottom: 5, left: 5 }); });
|
130
|
+
same(view.get('explicitLayout'), { top: 0, right: 5, bottom: 5, left: 5 }, "{ right: 5, bottom: 5, left: 5 } is implied as");
|
131
|
+
|
132
|
+
SC.run(function () { view.set('layout', { top: 5, right: 5, bottom: 5, left: 5 }); });
|
133
|
+
same(view.get('explicitLayout'), { top: 5, right: 5, bottom: 5, left: 5 }, "{ top: 5, right: 5, bottom: 5, left: 5 } is implied as");
|
134
|
+
|
135
|
+
SC.run(function () { view.set('layout', { top: 5, right: 5, bottom: 5 }); });
|
136
|
+
same(view.get('explicitLayout'), { top: 5, right: 5, bottom: 5, left: 0 }, "{ top: 5, right: 5, bottom: 5 } is implied as");
|
137
|
+
|
138
|
+
SC.run(function () { view.set('layout', { top: 5, right: 5 }); });
|
139
|
+
same(view.get('explicitLayout'), { top: 5, right: 5, bottom: 0, left: 0 }, "{ top: 5, right: 5 } is implied as");
|
140
|
+
|
141
|
+
SC.run(function () { view.set('layout', { width: 100 }); });
|
142
|
+
same(view.get('explicitLayout'), { top: 0, width: 100, bottom: 0, left: 0 }, "{ width: 100 } is implied as");
|
143
|
+
|
144
|
+
SC.run(function () { view.set('layout', { width: 100, right: 5 }); });
|
145
|
+
same(view.get('explicitLayout'), { top: 0, width: 100, bottom: 0, right: 5 }, "{ width: 100, right: 5 } is implied as");
|
146
|
+
|
147
|
+
SC.run(function () { view.set('layout', { height: 100 }); });
|
148
|
+
same(view.get('explicitLayout'), { top: 0, height: 100, right: 0, left: 0 }, "{ height: 100 } is implied as");
|
149
|
+
|
150
|
+
SC.run(function () { view.set('layout', { height: 100, bottom: 5 }); });
|
151
|
+
same(view.get('explicitLayout'), { right: 0, height: 100, bottom: 5, left: 0 }, "{ height: 100, bottom: 5 } is implied as");
|
152
|
+
|
153
|
+
// MIN/MAX
|
154
|
+
|
155
|
+
SC.run(function () { view.set('layout', { minWidth: 100, maxHeight: 100 }); });
|
156
|
+
same(view.get('explicitLayout'), { top: 0, right: 0, bottom: 0, left: 0, minWidth: 100, maxHeight: 100 }, "{ minWidth: 100, maxHeight: 100 } is implied as");
|
157
|
+
|
158
|
+
SC.run(function () { view.set('layout', { maxWidth: 100, minHeight: 100 }); });
|
159
|
+
same(view.get('explicitLayout'), { top: 0, right: 0, bottom: 0, left: 0, maxWidth: 100, minHeight: 100 }, "{ maxWidth: 100, minHeight: 100 } is implied as");
|
160
|
+
|
161
|
+
// CENTERS
|
162
|
+
|
163
|
+
SC.run(function () { view.set('layout', { centerX: 0, width: 100 }); });
|
164
|
+
same(view.get('explicitLayout'), { top: 0, centerX: 0, width: 100, bottom: 0 }, "{ centerX: 0, width: 100 } is implied as");
|
165
|
+
|
166
|
+
SC.run(function () { view.set('layout', { centerY: 0, height: 100 }); });
|
167
|
+
same(view.get('explicitLayout'), { right: 0, centerY: 0, height: 100, left: 0 }, "{ centerY: 0, height: 100 } is implied as");
|
168
|
+
|
169
|
+
// OPACITY
|
170
|
+
|
171
|
+
SC.run(function () { view.set('layout', { opacity: 0.25 }); });
|
172
|
+
same(view.get('explicitLayout'), { top: 0, right: 0, bottom: 0, left: 0, opacity: 0.25 }, "{ opacity: 0.25 } is implied as");
|
173
|
+
|
174
|
+
// TRANSFORMS
|
175
|
+
|
176
|
+
SC.run(function () { view.set('layout', { scale: 0.25 }); });
|
177
|
+
same(view.get('explicitLayout'), { top: 0, right: 0, bottom: 0, left: 0, scale: 0.25 }, "{ scale: 0.25 } is implied as");
|
178
|
+
|
179
|
+
SC.run(function () { view.set('layout', { transformOriginX: 0, transformOriginY: 1 }); });
|
180
|
+
same(view.get('explicitLayout'), { top: 0, right: 0, bottom: 0, left: 0, transformOriginX: 0, transformOriginY: 1 }, "{ transformOriginX: 0, transformOriginY: 1 } is implied as");
|
181
|
+
|
182
|
+
// BORDERS
|
183
|
+
|
184
|
+
SC.run(function () { view.set('layout', { border: 1 }); });
|
185
|
+
same(view.get('explicitLayout'), { top: 0, right: 0, bottom: 0, left: 0, borderTop: 1, borderRight: 1, borderBottom: 1, borderLeft: 1 }, "{ border: 1 } is implied as");
|
186
|
+
|
187
|
+
SC.run(function () { view.set('layout', { border: 1, borderTop: 2 }); });
|
188
|
+
same(view.get('explicitLayout'), { top: 0, right: 0, bottom: 0, left: 0, borderTop: 2, borderRight: 1, borderBottom: 1, borderLeft: 1 }, "{ border: 1, borderTop: 2 } is implied as");
|
189
|
+
|
190
|
+
SC.run(function () { view.set('layout', { borderBottom: 1, borderTop: 2 }); });
|
191
|
+
same(view.get('explicitLayout'), { top: 0, right: 0, bottom: 0, left: 0, borderTop: 2, borderBottom: 1 }, "{ borderBottom: 1, borderTop: 2 } is implied as");
|
192
|
+
});
|
193
|
+
|
194
|
+
test("Test explicitLayout for various invalid layouts.", function () {
|
195
|
+
// Centered without a size dimension.
|
196
|
+
SC.run(function () { view.set('layout', { centerX: 0 }); });
|
197
|
+
same(view.get('explicitLayout'), { top: 0, centerX: 0, bottom: 0 }, "{ centerX: 0 } is implied as");
|
198
|
+
|
199
|
+
// Centered without a size dimension.
|
200
|
+
SC.run(function () { view.set('layout', { centerY: 0 }); });
|
201
|
+
same(view.get('explicitLayout'), { left: 0, centerY: 0, right: 0 }, "{ centerY: 0 } is implied as");
|
202
|
+
|
203
|
+
// Left, right & width
|
204
|
+
SC.run(function () { view.set('layout', { left: 5, width: 100, right: 5 }); });
|
205
|
+
same(view.get('explicitLayout'), { top: 0, left: 5, bottom: 0, width: 100 }, "{ left: 5, width: 100, right: 5 } is implied as");
|
206
|
+
|
207
|
+
// Top, bottom & height
|
208
|
+
SC.run(function () { view.set('layout', { top: 5, height: 100, bottom: 5 }); });
|
209
|
+
same(view.get('explicitLayout'), { left: 0, top: 5, right: 0, height: 100 }, "{ top: 5, height: 100, bottom: 5 } is implied as");
|
210
|
+
});
|
data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js
CHANGED
@@ -21,7 +21,7 @@ test("notifies layoutStyle & frame change", function () {
|
|
21
21
|
view.layoutDidChange();
|
22
22
|
});
|
23
23
|
|
24
|
-
equals(frameCallCount, 1, 'should trigger
|
24
|
+
equals(frameCallCount, 1, 'should trigger observer for frame');
|
25
25
|
equals(layoutStyleCallCount, 0, 'should not trigger observers for layoutStyle');
|
26
26
|
|
27
27
|
// Attach to the document.
|
@@ -29,15 +29,15 @@ test("notifies layoutStyle & frame change", function () {
|
|
29
29
|
parent.append();
|
30
30
|
parent.appendChild(view);
|
31
31
|
|
32
|
-
equals(frameCallCount, 2, 'should trigger observers for frame when
|
32
|
+
equals(frameCallCount, 2, 'should trigger observers for frame when adopted');
|
33
33
|
equals(layoutStyleCallCount, 0, 'should still not trigger observers for layoutStyle');
|
34
34
|
|
35
35
|
SC.run(function () {
|
36
36
|
view.adjust('top', 20);
|
37
37
|
});
|
38
38
|
|
39
|
-
equals(frameCallCount, 3, 'should trigger observers for frame when
|
40
|
-
equals(layoutStyleCallCount, 1, 'should trigger observers for layoutStyle');
|
39
|
+
equals(frameCallCount, 3, 'should trigger observers for frame when adjusted');
|
40
|
+
equals(layoutStyleCallCount, 1, 'should trigger observers for layoutStyle when adjusted');
|
41
41
|
|
42
42
|
// Clean up.
|
43
43
|
view.destroy();
|
@@ -15,7 +15,7 @@
|
|
15
15
|
(function () {
|
16
16
|
var parent, child, frameKeys, layoutKeys;
|
17
17
|
|
18
|
-
frameKeys = ['x', 'y', 'width', 'height', 'scale', 'transformOriginX', 'transformOriginY'
|
18
|
+
frameKeys = ['x', 'y', 'width', 'height', 'scale', 'transformOriginX', 'transformOriginY'];
|
19
19
|
layoutKeys = ['width', 'height', 'top', 'bottom', 'marginLeft', 'marginTop', 'left', 'right',
|
20
20
|
'minWidth', 'maxWidth', 'minHeight', 'maxHeight', 'borderTopWidth', 'borderBottomWidth',
|
21
21
|
'borderLeftWidth', 'borderRightWidth'];
|
@@ -164,8 +164,8 @@
|
|
164
164
|
|
165
165
|
var layout = { top: 10, left: 10, width: 50, height: 50 };
|
166
166
|
var s = { top: 10, left: 10, width: 50, height: 50 };
|
167
|
-
var no_f = { x: 10, y: 10, width: 50, height: 50
|
168
|
-
var with_f = { x: 10, y: 10, width: 50, height: 50
|
167
|
+
var no_f = { x: 10, y: 10, width: 50, height: 50 };
|
168
|
+
var with_f = { x: 10, y: 10, width: 50, height: 50 };
|
169
169
|
|
170
170
|
performLayoutTest(layout, no_f, s, with_f, s, YES);
|
171
171
|
});
|
@@ -173,8 +173,8 @@
|
|
173
173
|
test("layout {top, left, bottom, right}", function () {
|
174
174
|
|
175
175
|
var layout = { top: 10, left: 10, bottom: 10, right: 10 };
|
176
|
-
var no_f = { x: 10, y: 10, width: 0, height: 0
|
177
|
-
var with_f = { x: 10, y: 10, width: 180, height: 180
|
176
|
+
var no_f = { x: 10, y: 10, width: 0, height: 0 };
|
177
|
+
var with_f = { x: 10, y: 10, width: 180, height: 180 };
|
178
178
|
var s = { top: 10, left: 10, bottom: 10, right: 10 };
|
179
179
|
|
180
180
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -183,8 +183,8 @@
|
|
183
183
|
test("layout {bottom, right, width, height}", function () {
|
184
184
|
|
185
185
|
var layout = { bottom: 10, right: 10, width: 50, height: 50 };
|
186
|
-
var no_f = { x: 0, y: 0, width: 50, height: 50
|
187
|
-
var with_f = { x: 140, y: 140, width: 50, height: 50
|
186
|
+
var no_f = { x: 0, y: 0, width: 50, height: 50 };
|
187
|
+
var with_f = { x: 140, y: 140, width: 50, height: 50 };
|
188
188
|
var s = { bottom: 10, right: 10, width: 50, height: 50 };
|
189
189
|
|
190
190
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -193,8 +193,8 @@
|
|
193
193
|
test("layout {centerX, centerY, width, height}", function () {
|
194
194
|
|
195
195
|
var layout = { centerX: 10, centerY: 10, width: 60, height: 60 };
|
196
|
-
var no_f = { x: 10, y: 10, width: 60, height: 60
|
197
|
-
var with_f = { x: 80, y: 80, width: 60, height: 60
|
196
|
+
var no_f = { x: 10, y: 10, width: 60, height: 60 };
|
197
|
+
var with_f = { x: 80, y: 80, width: 60, height: 60 };
|
198
198
|
var s = { marginLeft: -20, marginTop: -20, width: 60, height: 60, top: "50%", left: "50%" };
|
199
199
|
|
200
200
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -246,8 +246,8 @@
|
|
246
246
|
|
247
247
|
var layout = { top: 0.1, left: 0.1, width: 0.5, height: 0.5 };
|
248
248
|
var s = { top: '10%', left: '10%', width: '50%', height: '50%' };
|
249
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
250
|
-
var with_f = { x: 20, y: 20, width: 100, height: 100
|
249
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
250
|
+
var with_f = { x: 20, y: 20, width: 100, height: 100 };
|
251
251
|
|
252
252
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
253
253
|
});
|
@@ -255,8 +255,8 @@
|
|
255
255
|
test("layout {top, left, bottom, right}", function () {
|
256
256
|
|
257
257
|
var layout = { top: 0.1, left: 0.1, bottom: 0.1, right: 0.1 };
|
258
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
259
|
-
var with_f = { x: 20, y: 20, width: 160, height: 160
|
258
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
259
|
+
var with_f = { x: 20, y: 20, width: 160, height: 160 };
|
260
260
|
var s = { top: '10%', left: '10%', bottom: '10%', right: '10%' };
|
261
261
|
|
262
262
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -265,8 +265,8 @@
|
|
265
265
|
test("layout {bottom, right, width, height}", function () {
|
266
266
|
|
267
267
|
var layout = { bottom: 0.1, right: 0.1, width: 0.5, height: 0.5 };
|
268
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
269
|
-
var with_f = { x: 80, y: 80, width: 100, height: 100
|
268
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
269
|
+
var with_f = { x: 80, y: 80, width: 100, height: 100 };
|
270
270
|
var s = { bottom: '10%', right: '10%', width: '50%', height: '50%' };
|
271
271
|
|
272
272
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -275,8 +275,8 @@
|
|
275
275
|
test("layout {centerX, centerY, width, height}", function () {
|
276
276
|
|
277
277
|
var layout = { centerX: 0.1, centerY: 0.1, width: 0.6, height: 0.6 };
|
278
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
279
|
-
var with_f = { x: 60, y: 60, width: 120, height: 120
|
278
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
279
|
+
var with_f = { x: 60, y: 60, width: 120, height: 120 };
|
280
280
|
var s = { marginLeft: '-20%', marginTop: '-20%', width: '60%', height: '60%', top: "50%", left: "50%" };
|
281
281
|
|
282
282
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -287,11 +287,11 @@
|
|
287
287
|
// test shows that.
|
288
288
|
test("layout {centerX 0, centerY 0, width %, height %}", function () {
|
289
289
|
var layout = { centerX: 0, centerY: 0, width: 0.6, height: 0.6 };
|
290
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
290
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
291
291
|
|
292
292
|
// The parent frame is 200 x 200.
|
293
293
|
var size = 200 * 0.6;
|
294
|
-
var with_f = { x: (200 - size) * 0.5, y: (200 - size) * 0.5, width: size, height: size
|
294
|
+
var with_f = { x: (200 - size) * 0.5, y: (200 - size) * 0.5, width: size, height: size };
|
295
295
|
var s = { marginLeft: '-30%', marginTop: '-30%', width: '60%', height: '60%', top: "50%", left: "50%" };
|
296
296
|
|
297
297
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -300,11 +300,11 @@
|
|
300
300
|
// Edge case: although rare, centered views should be able to have metrics of zero.
|
301
301
|
test("layout {centerX 0, centerY 0, width 0, height 0}", function () {
|
302
302
|
var layout = { centerX: 0, centerY: 0, width: 0, height: 0 };
|
303
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
303
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
304
304
|
|
305
305
|
// The parent frame is 200 x 200.
|
306
306
|
var size = 0;
|
307
|
-
var with_f = { x: (200 - size) * 0.5, y: (200 - size) * 0.5, width: size, height: size
|
307
|
+
var with_f = { x: (200 - size) * 0.5, y: (200 - size) * 0.5, width: size, height: size };
|
308
308
|
var s = { marginLeft: '0px', marginTop: '0px', width: '0px', height: '0px', top: '50%', left: '50%' };
|
309
309
|
|
310
310
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -360,8 +360,8 @@
|
|
360
360
|
|
361
361
|
var layout = { top: 10, left: 10, width: 50, height: 50, scale: 2 };
|
362
362
|
var s = { top: 10, left: 10, width: 50, height: 50, transform: "scale(2)" };
|
363
|
-
var no_f = { x: -15, y: -15, width: 100, height: 100, scale: 2
|
364
|
-
var with_f = { x: -15, y: -15, width: 100, height: 100, scale: 2
|
363
|
+
var no_f = { x: -15, y: -15, width: 100, height: 100, scale: 2 };
|
364
|
+
var with_f = { x: -15, y: -15, width: 100, height: 100, scale: 2 };
|
365
365
|
|
366
366
|
performLayoutTest(layout, no_f, s, with_f, s, YES);
|
367
367
|
});
|
@@ -370,8 +370,8 @@
|
|
370
370
|
|
371
371
|
var layout = { top: 10, left: 10, width: 50, height: 50, scale: 0.6 };
|
372
372
|
var s = { top: 10, left: 10, width: 50, height: 50, transform: "scale(0.6)" };
|
373
|
-
var no_f = { x: 20, y: 20, width: 30, height: 30, scale: 0.6
|
374
|
-
var with_f = { x: 20, y: 20, width: 30, height: 30, scale: 0.6
|
373
|
+
var no_f = { x: 20, y: 20, width: 30, height: 30, scale: 0.6 };
|
374
|
+
var with_f = { x: 20, y: 20, width: 30, height: 30, scale: 0.6 };
|
375
375
|
|
376
376
|
performLayoutTest(layout, no_f, s, with_f, s, YES);
|
377
377
|
});
|
@@ -380,8 +380,8 @@
|
|
380
380
|
|
381
381
|
var layout = { top: 10, left: 10, width: 50, height: 50, scale: 2, transformOriginX: 0, transformOriginY: 0 };
|
382
382
|
var s = { top: 10, left: 10, width: 50, height: 50, transform: "scale(2)", transformOrigin: "0% 0%" };
|
383
|
-
var no_f = { x: 10, y: 10, width: 100, height: 100, scale: 2,
|
384
|
-
var with_f = { x: 10, y: 10, width: 100, height: 100, scale: 2,
|
383
|
+
var no_f = { x: 10, y: 10, width: 100, height: 100, scale: 2, transformOriginX: 0, transformOriginY: 0 };
|
384
|
+
var with_f = { x: 10, y: 10, width: 100, height: 100, scale: 2, transformOriginX: 0, transformOriginY: 0 };
|
385
385
|
|
386
386
|
performLayoutTest(layout, no_f, s, with_f, s, YES);
|
387
387
|
});
|
@@ -390,8 +390,8 @@
|
|
390
390
|
|
391
391
|
var layout = { top: 10, left: 10, width: 50, height: 50, scale: 0.6, transformOriginX: 0, transformOriginY: 0 };
|
392
392
|
var s = { top: 10, left: 10, width: 50, height: 50, transform: "scale(0.6)", transformOrigin: "0% 0%" };
|
393
|
-
var no_f = { x: 10, y: 10, width: 30, height: 30, scale: 0.6,
|
394
|
-
var with_f = { x: 10, y: 10, width: 30, height: 30, scale: 0.6,
|
393
|
+
var no_f = { x: 10, y: 10, width: 30, height: 30, scale: 0.6, transformOriginX: 0, transformOriginY: 0 };
|
394
|
+
var with_f = { x: 10, y: 10, width: 30, height: 30, scale: 0.6, transformOriginX: 0, transformOriginY: 0 };
|
395
395
|
|
396
396
|
performLayoutTest(layout, no_f, s, with_f, s, YES);
|
397
397
|
});
|
@@ -400,8 +400,8 @@
|
|
400
400
|
|
401
401
|
var layout = { top: 10, left: 10, width: 50, height: 50, scale: 2, transformOriginX: 1, transformOriginY: 1 };
|
402
402
|
var s = { top: 10, left: 10, width: 50, height: 50, transform: "scale(2)", transformOrigin: "100% 100%" };
|
403
|
-
var no_f = { x: -40, y: -40, width: 100, height: 100, scale: 2,
|
404
|
-
var with_f = { x: -40, y: -40, width: 100, height: 100, scale: 2,
|
403
|
+
var no_f = { x: -40, y: -40, width: 100, height: 100, scale: 2, transformOriginX: 1, transformOriginY: 1 };
|
404
|
+
var with_f = { x: -40, y: -40, width: 100, height: 100, scale: 2, transformOriginX: 1, transformOriginY: 1 };
|
405
405
|
|
406
406
|
performLayoutTest(layout, no_f, s, with_f, s, YES);
|
407
407
|
});
|
@@ -410,8 +410,8 @@
|
|
410
410
|
|
411
411
|
var layout = { top: 10, left: 10, width: 50, height: 50, scale: 0.6, transformOriginX: 1, transformOriginY: 1 };
|
412
412
|
var s = { top: 10, left: 10, width: 50, height: 50, transform: "scale(0.6)", transformOrigin: "100% 100%" };
|
413
|
-
var no_f = { x: 30, y: 30, width: 30, height: 30, scale: 0.6,
|
414
|
-
var with_f = { x: 30, y: 30, width: 30, height: 30, scale: 0.6,
|
413
|
+
var no_f = { x: 30, y: 30, width: 30, height: 30, scale: 0.6, transformOriginX: 1, transformOriginY: 1 };
|
414
|
+
var with_f = { x: 30, y: 30, width: 30, height: 30, scale: 0.6, transformOriginX: 1, transformOriginY: 1 };
|
415
415
|
|
416
416
|
performLayoutTest(layout, no_f, s, with_f, s, YES);
|
417
417
|
});
|
@@ -422,8 +422,8 @@
|
|
422
422
|
test("layout {top, left, bottom, right, scale up}", function () {
|
423
423
|
|
424
424
|
var layout = { top: 10, left: 10, bottom: 10, right: 10, scale: 2 };
|
425
|
-
var no_f = { x: 10, y: 10, width: 0, height: 0, scale: 2
|
426
|
-
var with_f = { x: -80, y: -80, width: 360, height: 360, scale: 2
|
425
|
+
var no_f = { x: 10, y: 10, width: 0, height: 0, scale: 2 };
|
426
|
+
var with_f = { x: -80, y: -80, width: 360, height: 360, scale: 2 };
|
427
427
|
var s = { top: 10, left: 10, bottom: 10, right: 10, transform: "scale(2)" };
|
428
428
|
|
429
429
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -432,8 +432,8 @@
|
|
432
432
|
test("layout {top, left, bottom, right, scale down}", function () {
|
433
433
|
|
434
434
|
var layout = { top: 10, left: 10, bottom: 10, right: 10, scale: 0.5 };
|
435
|
-
var no_f = { x: 10, y: 10, width: 0, height: 0, scale: 0.5
|
436
|
-
var with_f = { x: 55, y: 55, width: 90, height: 90, scale: 0.5
|
435
|
+
var no_f = { x: 10, y: 10, width: 0, height: 0, scale: 0.5 };
|
436
|
+
var with_f = { x: 55, y: 55, width: 90, height: 90, scale: 0.5 };
|
437
437
|
var s = { top: 10, left: 10, bottom: 10, right: 10, transform: "scale(0.5)" };
|
438
438
|
|
439
439
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -442,8 +442,8 @@
|
|
442
442
|
test("layout {top, left, bottom, right, scale up, origin top left}", function () {
|
443
443
|
|
444
444
|
var layout = { top: 10, left: 10, bottom: 10, right: 10, scale: 2, transformOriginX: 0, transformOriginY: 0 };
|
445
|
-
var no_f = { x: 10, y: 10, width: 0, height: 0, scale: 2,
|
446
|
-
var with_f = { x: 10, y: 10, width: 360, height: 360, scale: 2,
|
445
|
+
var no_f = { x: 10, y: 10, width: 0, height: 0, scale: 2, transformOriginX: 0, transformOriginY: 0 };
|
446
|
+
var with_f = { x: 10, y: 10, width: 360, height: 360, scale: 2, transformOriginX: 0, transformOriginY: 0 };
|
447
447
|
var s = { top: 10, left: 10, bottom: 10, right: 10, transform: "scale(2)", transformOrigin: "0% 0%" };
|
448
448
|
|
449
449
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -452,8 +452,8 @@
|
|
452
452
|
test("layout {top, left, bottom, right, scale down, origin top left}", function () {
|
453
453
|
|
454
454
|
var layout = { top: 10, left: 10, bottom: 10, right: 10, scale: 0.5, transformOriginX: 0, transformOriginY: 0 };
|
455
|
-
var no_f = { x: 10, y: 10, width: 0, height: 0, scale: 0.5,
|
456
|
-
var with_f = { x: 10, y: 10, width: 90, height: 90, scale: 0.5,
|
455
|
+
var no_f = { x: 10, y: 10, width: 0, height: 0, scale: 0.5, transformOriginX: 0, transformOriginY: 0 };
|
456
|
+
var with_f = { x: 10, y: 10, width: 90, height: 90, scale: 0.5, transformOriginX: 0, transformOriginY: 0 };
|
457
457
|
var s = { top: 10, left: 10, bottom: 10, right: 10, transform: "scale(0.5)", transformOrigin: "0% 0%" };
|
458
458
|
|
459
459
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -462,8 +462,8 @@
|
|
462
462
|
test("layout {top, left, bottom, right, scale up, origin bottom right}", function () {
|
463
463
|
|
464
464
|
var layout = { top: 10, left: 10, bottom: 10, right: 10, scale: 2, transformOriginX: 1, transformOriginY: 1 };
|
465
|
-
var no_f = { x: 10, y: 10, width: 0, height: 0, scale: 2,
|
466
|
-
var with_f = { x: -170, y: -170, width: 360, height: 360, scale: 2,
|
465
|
+
var no_f = { x: 10, y: 10, width: 0, height: 0, scale: 2, transformOriginX: 1, transformOriginY: 1 };
|
466
|
+
var with_f = { x: -170, y: -170, width: 360, height: 360, scale: 2, transformOriginX: 1, transformOriginY: 1 };
|
467
467
|
var s = { top: 10, left: 10, bottom: 10, right: 10, transform: "scale(2)", transformOrigin: "100% 100%" };
|
468
468
|
|
469
469
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -472,8 +472,8 @@
|
|
472
472
|
test("layout {top, left, bottom, right, scale down, origin bottom right}", function () {
|
473
473
|
|
474
474
|
var layout = { top: 10, left: 10, bottom: 10, right: 10, scale: 0.5, transformOriginX: 1, transformOriginY: 1 };
|
475
|
-
var no_f = { x: 10, y: 10, width: 0, height: 0, scale: 0.5,
|
476
|
-
var with_f = { x: 100, y: 100, width: 90, height: 90, scale: 0.5,
|
475
|
+
var no_f = { x: 10, y: 10, width: 0, height: 0, scale: 0.5, transformOriginX: 1, transformOriginY: 1 };
|
476
|
+
var with_f = { x: 100, y: 100, width: 90, height: 90, scale: 0.5, transformOriginX: 1, transformOriginY: 1 };
|
477
477
|
var s = { top: 10, left: 10, bottom: 10, right: 10, transform: "scale(0.5)", transformOrigin: "100% 100%" };
|
478
478
|
|
479
479
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -485,8 +485,8 @@
|
|
485
485
|
test("layout {bottom, right, width, height, scaled up}", function () {
|
486
486
|
|
487
487
|
var layout = { bottom: 10, right: 10, width: 50, height: 50, scale: 2 };
|
488
|
-
var no_f = { x: -25, y: -25, width: 100, height: 100, scale: 2
|
489
|
-
var with_f = { x: 115, y: 115, width: 100, height: 100, scale: 2
|
488
|
+
var no_f = { x: -25, y: -25, width: 100, height: 100, scale: 2 };
|
489
|
+
var with_f = { x: 115, y: 115, width: 100, height: 100, scale: 2 };
|
490
490
|
var s = { bottom: 10, right: 10, width: 50, height: 50, transform: "scale(2)" };
|
491
491
|
|
492
492
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -495,8 +495,8 @@
|
|
495
495
|
test("layout {bottom, right, width, height, scaled down}", function () {
|
496
496
|
|
497
497
|
var layout = { bottom: 10, right: 10, width: 50, height: 50, scale: 0.6 };
|
498
|
-
var no_f = { x: 10, y: 10, width: 30, height: 30, scale: 0.6
|
499
|
-
var with_f = { x: 150, y: 150, width: 30, height: 30, scale: 0.6
|
498
|
+
var no_f = { x: 10, y: 10, width: 30, height: 30, scale: 0.6 };
|
499
|
+
var with_f = { x: 150, y: 150, width: 30, height: 30, scale: 0.6 };
|
500
500
|
var s = { bottom: 10, right: 10, width: 50, height: 50, transform: "scale(0.6)" };
|
501
501
|
|
502
502
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -505,8 +505,8 @@
|
|
505
505
|
test("layout {bottom, right, width, height, scaled up, origin top left}", function () {
|
506
506
|
|
507
507
|
var layout = { bottom: 10, right: 10, width: 50, height: 50, scale: 2, transformOriginX: 0, transformOriginY: 0 };
|
508
|
-
var no_f = { x: 0, y: 0, width: 100, height: 100, scale: 2,
|
509
|
-
var with_f = { x: 140, y: 140, width: 100, height: 100, scale: 2,
|
508
|
+
var no_f = { x: 0, y: 0, width: 100, height: 100, scale: 2, transformOriginX: 0, transformOriginY: 0 };
|
509
|
+
var with_f = { x: 140, y: 140, width: 100, height: 100, scale: 2, transformOriginX: 0, transformOriginY: 0 };
|
510
510
|
var s = { bottom: 10, right: 10, width: 50, height: 50, transform: "scale(2)", transformOrigin: "0% 0%" };
|
511
511
|
|
512
512
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -515,8 +515,8 @@
|
|
515
515
|
test("layout {bottom, right, width, height, scaled down, origin top left}", function () {
|
516
516
|
|
517
517
|
var layout = { bottom: 10, right: 10, width: 50, height: 50, scale: 0.6, transformOriginX: 0, transformOriginY: 0 };
|
518
|
-
var no_f = { x: 0, y: 0, width: 30, height: 30, scale: 0.6,
|
519
|
-
var with_f = { x: 140, y: 140, width: 30, height: 30, scale: 0.6,
|
518
|
+
var no_f = { x: 0, y: 0, width: 30, height: 30, scale: 0.6, transformOriginX: 0, transformOriginY: 0 };
|
519
|
+
var with_f = { x: 140, y: 140, width: 30, height: 30, scale: 0.6, transformOriginX: 0, transformOriginY: 0 };
|
520
520
|
var s = { bottom: 10, right: 10, width: 50, height: 50, transform: "scale(0.6)", transformOrigin: "0% 0%" };
|
521
521
|
|
522
522
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -525,8 +525,8 @@
|
|
525
525
|
test("layout {bottom, right, width, height, scaled up, origin bottom right}", function () {
|
526
526
|
|
527
527
|
var layout = { bottom: 10, right: 10, width: 50, height: 50, scale: 2, transformOriginX: 1, transformOriginY: 1 };
|
528
|
-
var no_f = { x: -50, y: -50, width: 100, height: 100, scale: 2,
|
529
|
-
var with_f = { x: 90, y: 90, width: 100, height: 100, scale: 2,
|
528
|
+
var no_f = { x: -50, y: -50, width: 100, height: 100, scale: 2, transformOriginX: 1, transformOriginY: 1 };
|
529
|
+
var with_f = { x: 90, y: 90, width: 100, height: 100, scale: 2, transformOriginX: 1, transformOriginY: 1 };
|
530
530
|
var s = { bottom: 10, right: 10, width: 50, height: 50, transform: "scale(2)", transformOrigin: "100% 100%" };
|
531
531
|
|
532
532
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -535,8 +535,8 @@
|
|
535
535
|
test("layout {bottom, right, width, height, scaled down, origin bottom right}", function () {
|
536
536
|
|
537
537
|
var layout = { bottom: 10, right: 10, width: 50, height: 50, scale: 0.6, transformOriginX: 1, transformOriginY: 1 };
|
538
|
-
var no_f = { x: 20, y: 20, width: 30, height: 30, scale: 0.6,
|
539
|
-
var with_f = { x: 160, y: 160, width: 30, height: 30, scale: 0.6,
|
538
|
+
var no_f = { x: 20, y: 20, width: 30, height: 30, scale: 0.6, transformOriginX: 1, transformOriginY: 1 };
|
539
|
+
var with_f = { x: 160, y: 160, width: 30, height: 30, scale: 0.6, transformOriginX: 1, transformOriginY: 1 };
|
540
540
|
var s = { bottom: 10, right: 10, width: 50, height: 50, transform: "scale(0.6)", transformOrigin: "100% 100%" };
|
541
541
|
|
542
542
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -548,8 +548,8 @@
|
|
548
548
|
test("layout {centerX, centerY, width, height, scale up}", function () {
|
549
549
|
|
550
550
|
var layout = { centerX: 10, centerY: 10, width: 60, height: 60, scale: 2 };
|
551
|
-
var no_f = { x: -20, y: -20, width: 120, height: 120, scale: 2
|
552
|
-
var with_f = { x: 50, y: 50, width: 120, height: 120, scale: 2
|
551
|
+
var no_f = { x: -20, y: -20, width: 120, height: 120, scale: 2 };
|
552
|
+
var with_f = { x: 50, y: 50, width: 120, height: 120, scale: 2 };
|
553
553
|
var s = { marginLeft: -20, marginTop: -20, width: 60, height: 60, top: "50%", left: "50%", transform: "scale(2)" };
|
554
554
|
|
555
555
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -558,8 +558,8 @@
|
|
558
558
|
test("layout {centerX, centerY, width, height, scale down}", function () {
|
559
559
|
|
560
560
|
var layout = { centerX: 10, centerY: 10, width: 60, height: 60, scale: 0.6 };
|
561
|
-
var no_f = { x: 22, y: 22, width: 36, height: 36, scale: 0.6
|
562
|
-
var with_f = { x: 92, y: 92, width: 36, height: 36, scale: 0.6
|
561
|
+
var no_f = { x: 22, y: 22, width: 36, height: 36, scale: 0.6 };
|
562
|
+
var with_f = { x: 92, y: 92, width: 36, height: 36, scale: 0.6 };
|
563
563
|
var s = { marginLeft: -20, marginTop: -20, width: 60, height: 60, top: "50%", left: "50%", transform: "scale(0.6)" };
|
564
564
|
|
565
565
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -568,8 +568,8 @@
|
|
568
568
|
test("layout {centerX, centerY, width, height, scale up, origin top left}", function () {
|
569
569
|
|
570
570
|
var layout = { centerX: 10, centerY: 10, width: 60, height: 60, scale: 2, transformOriginX: 0, transformOriginY: 0 };
|
571
|
-
var no_f = { x: 10, y: 10, width: 120, height: 120, scale: 2,
|
572
|
-
var with_f = { x: 80, y: 80, width: 120, height: 120, scale: 2,
|
571
|
+
var no_f = { x: 10, y: 10, width: 120, height: 120, scale: 2, transformOriginX: 0, transformOriginY: 0 };
|
572
|
+
var with_f = { x: 80, y: 80, width: 120, height: 120, scale: 2, transformOriginX: 0, transformOriginY: 0 };
|
573
573
|
var s = { marginLeft: -20, marginTop: -20, width: 60, height: 60, top: "50%", left: "50%", transform: "scale(2)", transformOrigin: "0% 0%" };
|
574
574
|
|
575
575
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -578,8 +578,8 @@
|
|
578
578
|
test("layout {centerX, centerY, width, height, scale down, origin top left}", function () {
|
579
579
|
|
580
580
|
var layout = { centerX: 10, centerY: 10, width: 60, height: 60, scale: 0.6, transformOriginX: 0, transformOriginY: 0 };
|
581
|
-
var no_f = { x: 10, y: 10, width: 36, height: 36, scale: 0.6,
|
582
|
-
var with_f = { x: 80, y: 80, width: 36, height: 36, scale: 0.6,
|
581
|
+
var no_f = { x: 10, y: 10, width: 36, height: 36, scale: 0.6, transformOriginX: 0, transformOriginY: 0 };
|
582
|
+
var with_f = { x: 80, y: 80, width: 36, height: 36, scale: 0.6, transformOriginX: 0, transformOriginY: 0 };
|
583
583
|
var s = { marginLeft: -20, marginTop: -20, width: 60, height: 60, top: "50%", left: "50%", transform: "scale(0.6)", transformOrigin: "0% 0%" };
|
584
584
|
|
585
585
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -588,8 +588,8 @@
|
|
588
588
|
test("layout {centerX, centerY, width, height, scale up, origin bottom right}", function () {
|
589
589
|
|
590
590
|
var layout = { centerX: 10, centerY: 10, width: 60, height: 60, scale: 2, transformOriginX: 1, transformOriginY: 1 };
|
591
|
-
var no_f = { x: -50, y: -50, width: 120, height: 120, scale: 2,
|
592
|
-
var with_f = { x: 20, y: 20, width: 120, height: 120, scale: 2,
|
591
|
+
var no_f = { x: -50, y: -50, width: 120, height: 120, scale: 2, transformOriginX: 1, transformOriginY: 1 };
|
592
|
+
var with_f = { x: 20, y: 20, width: 120, height: 120, scale: 2, transformOriginX: 1, transformOriginY: 1 };
|
593
593
|
var s = { marginLeft: -20, marginTop: -20, width: 60, height: 60, top: "50%", left: "50%", transform: "scale(2)", transformOrigin: "100% 100%" };
|
594
594
|
|
595
595
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -598,8 +598,8 @@
|
|
598
598
|
test("layout {centerX, centerY, width, height, scale down, origin bottom right}", function () {
|
599
599
|
|
600
600
|
var layout = { centerX: 10, centerY: 10, width: 60, height: 60, scale: 0.6, transformOriginX: 1, transformOriginY: 1 };
|
601
|
-
var no_f = { x: 34, y: 34, width: 36, height: 36, scale: 0.6,
|
602
|
-
var with_f = { x: 104, y: 104, width: 36, height: 36, scale: 0.6,
|
601
|
+
var no_f = { x: 34, y: 34, width: 36, height: 36, scale: 0.6, transformOriginX: 1, transformOriginY: 1 };
|
602
|
+
var with_f = { x: 104, y: 104, width: 36, height: 36, scale: 0.6, transformOriginX: 1, transformOriginY: 1 };
|
603
603
|
var s = { marginLeft: -20, marginTop: -20, width: 60, height: 60, top: "50%", left: "50%", transform: "scale(0.6)", transformOrigin: "100% 100%" };
|
604
604
|
|
605
605
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -759,8 +759,8 @@
|
|
759
759
|
var expectedTransform = 'translateX(10px) translateY(10px)';
|
760
760
|
if (SC.platform.supportsCSS3DTransforms) expectedTransform += ' translateZ(0px)';
|
761
761
|
var s = { top: 0, left: 0, width: 50, height: 50, transform: expectedTransform };
|
762
|
-
var no_f = { x: 10, y: 10, width: 50, height: 50
|
763
|
-
var with_f = { x: 10, y: 10, width: 50, height: 50
|
762
|
+
var no_f = { x: 10, y: 10, width: 50, height: 50 };
|
763
|
+
var with_f = { x: 10, y: 10, width: 50, height: 50 };
|
764
764
|
|
765
765
|
performLayoutTest(layout, no_f, s, with_f, s, YES);
|
766
766
|
});
|
@@ -768,8 +768,8 @@
|
|
768
768
|
test("layout {top, left, bottom, right}", function () {
|
769
769
|
|
770
770
|
var layout = { top: 10, left: 10, bottom: 10, right: 10 };
|
771
|
-
var no_f = { x: 10, y: 10, width: 0, height: 0
|
772
|
-
var with_f = { x: 10, y: 10, width: 180, height: 180
|
771
|
+
var no_f = { x: 10, y: 10, width: 0, height: 0 };
|
772
|
+
var with_f = { x: 10, y: 10, width: 180, height: 180 };
|
773
773
|
var s = { top: 10, left: 10, bottom: 10, right: 10, transform: null };
|
774
774
|
|
775
775
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -813,8 +813,8 @@
|
|
813
813
|
|
814
814
|
var layout = { top: 0.1, left: 0.1, width: 0.5, height: 0.5 };
|
815
815
|
var s = { top: '10%', left: '10%', width: '50%', height: '50%', transform: null };
|
816
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
817
|
-
var with_f = { x: 20, y: 20, width: 100, height: 100
|
816
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
817
|
+
var with_f = { x: 20, y: 20, width: 100, height: 100 };
|
818
818
|
|
819
819
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
820
820
|
});
|
@@ -834,8 +834,8 @@
|
|
834
834
|
test("layout {top, left} - assume right/bottom=0", function () {
|
835
835
|
|
836
836
|
var layout = { top: 0.1, left: 0.1 };
|
837
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
838
|
-
var with_f = { x: 20, y: 20, width: 180, height: 180
|
837
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
838
|
+
var with_f = { x: 20, y: 20, width: 180, height: 180 };
|
839
839
|
var s = { bottom: 0, right: 0, top: '10%', left: '10%' };
|
840
840
|
|
841
841
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -844,8 +844,8 @@
|
|
844
844
|
test("layout {height, width} - assume top/left=0", function () {
|
845
845
|
|
846
846
|
var layout = { height: 0.6, width: 0.6 };
|
847
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
848
|
-
var with_f = { x: 0, y: 0, width: 120, height: 120
|
847
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
848
|
+
var with_f = { x: 0, y: 0, width: 120, height: 120 };
|
849
849
|
var s = { width: '60%', height: '60%', top: 0, left: 0 };
|
850
850
|
|
851
851
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -855,8 +855,8 @@
|
|
855
855
|
test("layout {right, bottom} - assume top/left=0", function () {
|
856
856
|
|
857
857
|
var layout = { right: 0.1, bottom: 0.1 };
|
858
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
859
|
-
var with_f = { x: 0, y: 0, width: 180, height: 180
|
858
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
859
|
+
var with_f = { x: 0, y: 0, width: 180, height: 180 };
|
860
860
|
var s = { bottom: '10%', right: '10%', top: 0, left: 0 };
|
861
861
|
|
862
862
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -866,8 +866,8 @@
|
|
866
866
|
test("layout {right, bottom, maxWidth, maxHeight} - assume top/left=null", function () {
|
867
867
|
|
868
868
|
var layout = { right: 0.1, bottom: 0.1, maxWidth: 10, maxHeight: 10 };
|
869
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
870
|
-
var with_f = { x: 0, y: 0, width: 10, height: 10
|
869
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
870
|
+
var with_f = { x: 0, y: 0, width: 10, height: 10 };
|
871
871
|
var s = { bottom: '10%', right: '10%', top: null, left: null, maxWidth: 10, maxHeight: 10 };
|
872
872
|
|
873
873
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -877,8 +877,8 @@
|
|
877
877
|
test("layout {centerX, centerY} - assume width/height=0", function () {
|
878
878
|
|
879
879
|
var layout = { centerX: 0.1, centerY: 0.1 };
|
880
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
881
|
-
var with_f = { x: 120, y: 120, width: 0, height: 0
|
880
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
881
|
+
var with_f = { x: 120, y: 120, width: 0, height: 0 };
|
882
882
|
var s = { width: 0, height: 0, top: "50%", left: "50%", marginTop: "50%", marginLeft: "50%" };
|
883
883
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
884
884
|
|
@@ -887,8 +887,8 @@
|
|
887
887
|
test("layout {top, left, centerX, centerY, height, width} - top/left take presidence", function () {
|
888
888
|
|
889
889
|
var layout = { top: 0.1, left: 0.1, centerX: 0.1, centerY: 0.1, height: 0.6, width: 0.6 };
|
890
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
891
|
-
var with_f = { x: 20, y: 20, width: 120, height: 120
|
890
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
891
|
+
var with_f = { x: 20, y: 20, width: 120, height: 120 };
|
892
892
|
var s = { width: '60%', height: '60%', top: '10%', left: '10%' };
|
893
893
|
|
894
894
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -898,8 +898,8 @@
|
|
898
898
|
test("layout {bottom, right, centerX, centerY, height, width} - bottom/right take presidence", function () {
|
899
899
|
|
900
900
|
var layout = { bottom: 0.1, right: 0.1, centerX: 0.1, centerY: 0.1, height: 0.6, width: 0.6 };
|
901
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
902
|
-
var with_f = { x: 60, y: 60, width: 120, height: 120
|
901
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
902
|
+
var with_f = { x: 60, y: 60, width: 120, height: 120 };
|
903
903
|
var s = { width: '60%', height: '60%', bottom: '10%', right: '10%' };
|
904
904
|
|
905
905
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -909,8 +909,8 @@
|
|
909
909
|
test("layout {top, left, bottom, right, centerX, centerY, height, width} - top/left take presidence", function () {
|
910
910
|
|
911
911
|
var layout = { top: 0.1, left: 0.1, bottom: 0.1, right: 0.1, centerX: 0.1, centerY: 0.1, height: 0.6, width: 0.6 };
|
912
|
-
var no_f = { x: 0, y: 0, width: 0, height: 0
|
913
|
-
var with_f = { x: 20, y: 20, width: 120, height: 120
|
912
|
+
var no_f = { x: 0, y: 0, width: 0, height: 0 };
|
913
|
+
var with_f = { x: 20, y: 20, width: 120, height: 120 };
|
914
914
|
var s = { width: '60%', height: '60%', top: '10%', left: '10%' };
|
915
915
|
|
916
916
|
performLayoutTest(layout, no_f, s, with_f, s, NO);
|
@@ -946,16 +946,16 @@
|
|
946
946
|
var layout = { top: 10, left: 10, width: 50, height: 50, border: 2 };
|
947
947
|
var s = { top: 10, left: 10, width: 46, height: 46,
|
948
948
|
borderTopWidth: 2, borderRightWidth: 2, borderBottomWidth: 2, borderLeftWidth: 2 };
|
949
|
-
var no_f = { x: 12, y: 12, width: 46, height: 46
|
950
|
-
var with_f = { x: 12, y: 12, width: 46, height: 46
|
949
|
+
var no_f = { x: 12, y: 12, width: 46, height: 46 };
|
950
|
+
var with_f = { x: 12, y: 12, width: 46, height: 46 };
|
951
951
|
|
952
952
|
performLayoutTest(layout, no_f, s, with_f, s, YES);
|
953
953
|
});
|
954
954
|
|
955
955
|
test("layout {top, left, bottom, right, border}", function () {
|
956
956
|
var layout = { top: 10, left: 10, bottom: 10, right: 10, border: 2 };
|
957
|
-
var no_f = { x: 12, y: 12, width: 0, height: 0
|
958
|
-
var with_f = { x: 12, y: 12, width: 176, height: 176
|
957
|
+
var no_f = { x: 12, y: 12, width: 0, height: 0 };
|
958
|
+
var with_f = { x: 12, y: 12, width: 176, height: 176 };
|
959
959
|
var s = { top: 10, left: 10, bottom: 10, right: 10,
|
960
960
|
borderTopWidth: 2, borderRightWidth: 2, borderBottomWidth: 2, borderLeftWidth: 2 };
|
961
961
|
|
@@ -964,8 +964,8 @@
|
|
964
964
|
|
965
965
|
test("layout {top, left, bottom, right, borderTop, borderLeft, borderRight, borderBottom}", function () {
|
966
966
|
var layout = { top: 10, left: 10, bottom: 10, right: 10, borderTop: 1, borderRight: 2, borderBottom: 3, borderLeft: 4 };
|
967
|
-
var no_f = { x: 14, y: 11, width: 0, height: 0
|
968
|
-
var with_f = { x: 14, y: 11, width: 174, height: 176
|
967
|
+
var no_f = { x: 14, y: 11, width: 0, height: 0 };
|
968
|
+
var with_f = { x: 14, y: 11, width: 174, height: 176 };
|
969
969
|
var s = { top: 10, left: 10, bottom: 10, right: 10,
|
970
970
|
borderTopWidth: 1, borderRightWidth: 2, borderBottomWidth: 3, borderLeftWidth: 4 };
|
971
971
|
|
@@ -974,8 +974,8 @@
|
|
974
974
|
|
975
975
|
test("layout {top, left, bottom, right, border, borderTop, borderLeft}", function () {
|
976
976
|
var layout = { top: 10, left: 10, bottom: 10, right: 10, border: 5, borderTop: 1, borderRight: 2 };
|
977
|
-
var no_f = { x: 15, y: 11, width: 0, height: 0
|
978
|
-
var with_f = { x: 15, y: 11, width: 173, height: 174
|
977
|
+
var no_f = { x: 15, y: 11, width: 0, height: 0 };
|
978
|
+
var with_f = { x: 15, y: 11, width: 173, height: 174 };
|
979
979
|
var s = { top: 10, left: 10, bottom: 10, right: 10,
|
980
980
|
borderTopWidth: 1, borderRightWidth: 2, borderBottomWidth: 5, borderLeftWidth: 5 };
|
981
981
|
|
@@ -985,8 +985,8 @@
|
|
985
985
|
test("layout {bottom, right, width, height, border}", function () {
|
986
986
|
|
987
987
|
var layout = { bottom: 10, right: 10, width: 50, height: 50, border: 2 };
|
988
|
-
var no_f = { x: 2, y: 2, width: 46, height: 46
|
989
|
-
var with_f = { x: 142, y: 142, width: 46, height: 46
|
988
|
+
var no_f = { x: 2, y: 2, width: 46, height: 46 };
|
989
|
+
var with_f = { x: 142, y: 142, width: 46, height: 46 };
|
990
990
|
var s = { bottom: 10, right: 10, width: 46, height: 46,
|
991
991
|
borderTopWidth: 2, borderRightWidth: 2, borderBottomWidth: 2, borderLeftWidth: 2 };
|
992
992
|
|
@@ -996,8 +996,8 @@
|
|
996
996
|
test("layout {centerX, centerY, width, height, border}", function () {
|
997
997
|
|
998
998
|
var layout = { centerX: 10, centerY: 10, width: 60, height: 60, border: 2 };
|
999
|
-
var no_f = { x: 12, y: 12, width: 56, height: 56
|
1000
|
-
var with_f = { x: 82, y: 82, width: 56, height: 56
|
999
|
+
var no_f = { x: 12, y: 12, width: 56, height: 56 };
|
1000
|
+
var with_f = { x: 82, y: 82, width: 56, height: 56 };
|
1001
1001
|
var s = { marginLeft: -20, marginTop: -20, width: 56, height: 56, top: "50%", left: "50%",
|
1002
1002
|
borderTopWidth: 2, borderRightWidth: 2, borderBottomWidth: 2, borderLeftWidth: 2 };
|
1003
1003
|
|