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.
Files changed (104) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG +10 -0
  3. data/VERSION.yml +1 -1
  4. data/lib/frameworks/sproutcore/CHANGELOG.md +114 -1
  5. data/lib/frameworks/sproutcore/apps/showcase/views/views_item_view.js +1 -7
  6. data/lib/frameworks/sproutcore/apps/showcase/views/views_list_view.js +9 -9
  7. data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +167 -5
  8. data/lib/frameworks/sproutcore/frameworks/ajax/system/response.js +24 -8
  9. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/stack_layout.js +737 -0
  10. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/layout.js +0 -6
  11. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +11 -7
  12. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane_statechart.js +7 -11
  13. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/child_view_layout_protocol.js +8 -3
  14. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/observable_protocol.js +9 -6
  15. data/lib/frameworks/sproutcore/frameworks/{desktop/protocols/responder.js → core_foundation/protocols/responder_protocol.js} +83 -17
  16. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/{sparse_array_delegate.js → sparse_array_delegate_protocol.js} +11 -7
  17. data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/view_transition_protocol.js +11 -6
  18. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/color.js +2 -2
  19. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/page.js +0 -22
  20. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +61 -56
  21. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/main_pane.js +2 -2
  22. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/append_remove.js +3 -3
  23. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/animation.js +63 -39
  24. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/border_frame_test.js +28 -28
  25. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createLayer.js +10 -4
  26. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layout.js +102 -1
  27. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js +4 -4
  28. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +103 -103
  29. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/replaceAllChildren_test.js +1 -1
  30. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +77 -1
  31. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view_states_test.js +18 -17
  32. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +42 -49
  33. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +5 -6
  34. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +16 -5
  35. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +241 -102
  36. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout_style.js +1 -4
  37. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +0 -11
  38. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/statechart.js +993 -610
  39. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +3 -2
  40. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +6 -11
  41. data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +94 -27
  42. data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +133 -53
  43. data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +30 -35
  44. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +3 -2
  45. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +73 -29
  46. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/conflictedStoreKeys_test.js +156 -0
  47. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +61 -37
  48. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/find.js +2 -2
  49. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +68 -39
  50. data/lib/frameworks/sproutcore/frameworks/designer/tests/coders/page.js +1 -2
  51. data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +8 -6
  52. data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +80 -14
  53. data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +2 -2
  54. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/{drag_data_source.js → drag_data_source_protocol.js} +16 -10
  55. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/{drag_source.js → drag_source_protocol.js} +28 -26
  56. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/{drop_target.js → drop_target_protocol.js} +73 -75
  57. data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +4 -4
  58. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +39 -23
  59. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +120 -97
  60. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowSizeForContentIndex.js +26 -25
  61. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +3 -3
  62. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +5 -0
  63. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/{dividers.js → dividers_test.js} +38 -38
  64. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +29 -14
  65. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +2 -1
  66. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll_view.js +13 -18
  67. data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +41 -35
  68. data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +14 -14
  69. data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +41 -26
  70. data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +2 -12
  71. data/lib/frameworks/sproutcore/frameworks/foundation/gestures/tap.js +2 -2
  72. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +14 -10
  73. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/gesturable.js +104 -63
  74. data/lib/frameworks/sproutcore/frameworks/foundation/protocols/swap_transition_protocol.js +9 -4
  75. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_mixin_tests.js +1 -2
  76. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_resize_test.js +33 -33
  77. data/lib/frameworks/sproutcore/frameworks/foundation/tests/transitions/view_transitions_test.js +5 -5
  78. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +0 -4
  79. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/transition_test.js +0 -4
  80. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +0 -2
  81. data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +12 -8
  82. data/lib/frameworks/sproutcore/frameworks/media/resources/silence.mp3 +0 -0
  83. data/lib/frameworks/sproutcore/frameworks/media/tests/audio.js +69 -0
  84. data/lib/frameworks/sproutcore/frameworks/media/views/audio.js +1 -0
  85. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
  86. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +11 -4
  87. data/lib/frameworks/sproutcore/frameworks/runtime/protocols/mixin_protocol.js +150 -0
  88. data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +447 -137
  89. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +9 -15
  90. data/lib/frameworks/sproutcore/frameworks/runtime/system/set.js +19 -17
  91. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +188 -16
  92. data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +1 -1
  93. data/lib/frameworks/sproutcore/frameworks/template_view/panes/template.js +0 -3
  94. data/lib/frameworks/sproutcore/frameworks/template_view/tests/panes/template.js +0 -17
  95. data/lib/frameworks/sproutcore/frameworks/template_view/tests/views/template/collection.js +43 -26
  96. data/lib/frameworks/sproutcore/frameworks/template_view/views/bindable_span.js +9 -2
  97. data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list.css +0 -1
  98. data/lib/frameworks/sproutcore/themes/ace/resources/scroll/scroll.css +3 -0
  99. data/sproutcore.gemspec +3 -3
  100. metadata +19 -17
  101. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/horizontal_stack_layout.js +0 -465
  102. data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/vertical_stack_layout.js +0 -472
  103. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/build.js +0 -87
  104. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/build_children.js +0 -89
@@ -33,12 +33,12 @@
33
33
  });
34
34
 
35
35
  test("should not be attached before calling append()", function() {
36
- equals(pane.get('isPaneAttached'), NO) ;
36
+ equals(pane.get('isAttached'), NO) ;
37
37
  });
38
38
 
39
39
  test("should attach when calling append()", function() {
40
40
  pane.append() ;
41
- equals(pane.get('isPaneAttached'), YES) ;
41
+ equals(pane.get('isAttached'), YES) ;
42
42
  });
43
43
 
44
44
  test("appending should make pane main & key", function() {
@@ -234,7 +234,7 @@ test("updates frame and clippingFrame when loading MainPane", function() {
234
234
 
235
235
  // needs a fixed layout size to make sure the sizes stay constant
236
236
  var pane = SC.MainPane.create();
237
- var w = SC.RootResponder.responder.computeWindowSize().width;
237
+ var windowWidth = SC.RootResponder.responder.computeWindowSize().width;
238
238
 
239
239
  // add the pane to the main window. should resize the frames
240
240
  SC.run(function() {
@@ -242,8 +242,8 @@ test("updates frame and clippingFrame when loading MainPane", function() {
242
242
  });
243
243
 
244
244
  // should equal window size
245
- equals(pane.get('frame').width, w, 'frame width should have changed');
246
- equals(pane.get('clippingFrame').width, w, 'clippingFrame width should have changed');
245
+ equals(pane.get('frame').width, windowWidth, 'frame width should have changed');
246
+ equals(pane.get('clippingFrame').width, windowWidth, 'clippingFrame width should have changed');
247
247
 
248
248
  // Clean up.
249
249
  pane.destroy();
@@ -41,8 +41,10 @@ var commonSetup = {
41
41
  },
42
42
 
43
43
  teardown: function () {
44
- pane.remove();
45
- pane.destroy();
44
+ SC.run(function () {
45
+ pane.destroy();
46
+ });
47
+ pane = view = null;
46
48
  }
47
49
  };
48
50
 
@@ -51,7 +53,7 @@ if (SC.platform.supportsCSSTransitions) {
51
53
  module("ANIMATION", commonSetup);
52
54
 
53
55
  test("should work", function () {
54
- stop(2000);
56
+ stop(4000);
55
57
  SC.RunLoop.begin();
56
58
  view.animate('left', 100, { duration: 1 });
57
59
  SC.RunLoop.end();
@@ -65,7 +67,7 @@ if (SC.platform.supportsCSSTransitions) {
65
67
  });
66
68
 
67
69
  test("animate + adjust: no conflict", function () {
68
- stop(1000);
70
+ stop(4000);
69
71
 
70
72
  SC.run(function () {
71
73
  view.animate('left', 100, { duration: 0.1 });
@@ -97,7 +99,7 @@ if (SC.platform.supportsCSSTransitions) {
97
99
  });
98
100
 
99
101
  test("animate + adjust: conflict", function () {
100
- stop(1000);
102
+ stop(4000);
101
103
 
102
104
  SC.run(function () {
103
105
  view.animate('left', 100, { duration: 0.1 });
@@ -122,7 +124,7 @@ if (SC.platform.supportsCSSTransitions) {
122
124
  });
123
125
 
124
126
  test("callbacks work in general", function () {
125
- stop(2000);
127
+ stop(4000);
126
128
 
127
129
  SC.run(function () {
128
130
  view.animate('left', 100, { duration: 0.5 }, function () {
@@ -135,7 +137,7 @@ if (SC.platform.supportsCSSTransitions) {
135
137
  });
136
138
 
137
139
  test("callbacks work in general with target method", function () {
138
- stop(2000);
140
+ stop(4000);
139
141
 
140
142
  var ob = SC.Object.create({
141
143
  callback: function () {
@@ -152,7 +154,7 @@ if (SC.platform.supportsCSSTransitions) {
152
154
  });
153
155
 
154
156
  test("callbacks should have appropriate data", function () {
155
- stop(2000);
157
+ stop(4000);
156
158
 
157
159
  SC.RunLoop.begin();
158
160
  view.animate('left', 100, { duration: 0.5 }, function (data) {
@@ -167,7 +169,7 @@ if (SC.platform.supportsCSSTransitions) {
167
169
  });
168
170
 
169
171
  test("handles delay function string", function () {
170
- stop(2000);
172
+ stop(4000);
171
173
 
172
174
  SC.RunLoop.begin();
173
175
  view.animate('left', 100, { duration: 1, delay: 1 });
@@ -181,7 +183,7 @@ if (SC.platform.supportsCSSTransitions) {
181
183
  });
182
184
 
183
185
  test("handles timing function string", function () {
184
- stop(2000);
186
+ stop(4000);
185
187
 
186
188
  SC.RunLoop.begin();
187
189
  view.animate('left', 100, { duration: 1, timing: 'ease-in' });
@@ -195,7 +197,7 @@ if (SC.platform.supportsCSSTransitions) {
195
197
  });
196
198
 
197
199
  test("handles timing function array", function () {
198
- stop(2000);
200
+ stop(4000);
199
201
 
200
202
  SC.RunLoop.begin();
201
203
  view.animate('left', 100, { duration: 1, timing: [0.1, 0.2, 0.3, 0.4] });
@@ -209,7 +211,7 @@ if (SC.platform.supportsCSSTransitions) {
209
211
  });
210
212
 
211
213
  test("should allow multiple keys to be set at once", function () {
212
- stop(2000);
214
+ stop(4000);
213
215
 
214
216
  SC.RunLoop.begin();
215
217
  view.animate({ top: 100, left: 100 }, { duration: 1 });
@@ -225,7 +227,7 @@ if (SC.platform.supportsCSSTransitions) {
225
227
  });
226
228
 
227
229
  test("should not animate any keys that don't change", function () {
228
- stop(2000);
230
+ stop(4000);
229
231
 
230
232
  SC.RunLoop.begin();
231
233
  view.animate({ top: 0, left: 100 }, { duration: 1 });
@@ -241,7 +243,7 @@ if (SC.platform.supportsCSSTransitions) {
241
243
  });
242
244
 
243
245
  test("animating height with a centerY layout should also animate margin-top", function () {
244
- stop(2000);
246
+ stop(4000);
245
247
 
246
248
  SC.RunLoop.begin();
247
249
  view.adjust({ top: null, centerY: 0 });
@@ -258,7 +260,7 @@ if (SC.platform.supportsCSSTransitions) {
258
260
  });
259
261
 
260
262
  test("animating width with a centerX layout should also animate margin-left", function () {
261
- stop(2000);
263
+ stop(4000);
262
264
 
263
265
  SC.RunLoop.begin();
264
266
  view.adjust({ left: null, centerX: 0 });
@@ -276,7 +278,7 @@ if (SC.platform.supportsCSSTransitions) {
276
278
 
277
279
  // Pretty sure this does the job
278
280
  test("callbacks should be called only once for a grouped animation", function () {
279
- stop(2000);
281
+ stop(4000);
280
282
  var stopped = true;
281
283
 
282
284
  expect(1);
@@ -299,7 +301,7 @@ if (SC.platform.supportsCSSTransitions) {
299
301
  // This behavior should be up for debate. Does the callback call immediately, or does it wait until the end of
300
302
  // the specified animation period? Currently we're calling it immediately.
301
303
  test("callback should be called immediately when a property is animated to its current value.", function () {
302
- stop(2000);
304
+ stop(4000);
303
305
 
304
306
  expect(1);
305
307
 
@@ -312,8 +314,30 @@ if (SC.platform.supportsCSSTransitions) {
312
314
  });
313
315
  });
314
316
 
317
+ // This behavior should be up for debate. Does the callback call immediately, or does it wait until the end of
318
+ // the specified animation period? Currently we're calling it immediately.
319
+ test("callback should be called immediately when a property is animated to its current value (even if the value is implied).", function () {
320
+ stop(4000);
321
+
322
+ expect(1);
323
+
324
+ var implicitView = SC.View.create({
325
+ backgroundColor: '#ABC',
326
+ layout: { left: 0 } // implicit layout: { top: 0, right: 0, bottom: 0 }
327
+ });
328
+ pane.appendChild(implicitView);
329
+
330
+ SC.run(function () {
331
+ implicitView.animate('top', 0, { duration: 0.5 }, function () {
332
+ ok(true, 'callback called back');
333
+
334
+ start();
335
+ });
336
+ });
337
+ });
338
+
315
339
  test("callback should be called when a property is animated with a duration of zero.", function () {
316
- stop(2000);
340
+ stop(4000);
317
341
 
318
342
  expect(1);
319
343
 
@@ -326,7 +350,7 @@ if (SC.platform.supportsCSSTransitions) {
326
350
  });
327
351
 
328
352
  test("multiple animations should be able to run simultaneously", function () {
329
- stop(2000);
353
+ stop(4000);
330
354
 
331
355
  expect(2);
332
356
 
@@ -343,7 +367,7 @@ if (SC.platform.supportsCSSTransitions) {
343
367
  });
344
368
 
345
369
  test("altering existing animation should call callback as cancelled", function () {
346
- stop(2000);
370
+ stop(4000);
347
371
 
348
372
  var order = 0;
349
373
  expect(6);
@@ -379,7 +403,7 @@ if (SC.platform.supportsCSSTransitions) {
379
403
 
380
404
  test("should not cancel callback when value hasn't changed", function () {
381
405
  var callbacks = 0, wasCancelled = NO, check = 0;
382
- stop(2000);
406
+ stop(4000);
383
407
 
384
408
  SC.run(function () {
385
409
  // this triggers the initial layoutStyle code
@@ -412,7 +436,7 @@ if (SC.platform.supportsCSSTransitions) {
412
436
  // and not expecting a null value.
413
437
  test("animating different attributes at different times should not throw an error", function () {
414
438
  // Run test.
415
- stop(2000);
439
+ stop(4000);
416
440
 
417
441
  expect(0);
418
442
 
@@ -442,7 +466,7 @@ if (SC.platform.supportsCSSTransitions) {
442
466
  });
443
467
 
444
468
  test("should handle transform attributes", function () {
445
- stop(2000);
469
+ stop(4000);
446
470
 
447
471
  SC.run(function () {
448
472
  view.animate('rotateX', 45, { duration: 1 });
@@ -459,7 +483,7 @@ if (SC.platform.supportsCSSTransitions) {
459
483
 
460
484
  test("should handle conflicting transform animations", function () {
461
485
  /*global console*/
462
- stop(2000);
486
+ stop(4000);
463
487
 
464
488
  var originalConsoleWarn = console.warn;
465
489
  console.warn = function (warning) {
@@ -485,7 +509,7 @@ if (SC.platform.supportsCSSTransitions) {
485
509
  });
486
510
 
487
511
  test("removes animation property when done", function () {
488
- stop(2000);
512
+ stop(4000);
489
513
 
490
514
  SC.RunLoop.begin();
491
515
  view.animate({ top: 100, scale: 2 }, { duration: 0.5 });
@@ -500,7 +524,7 @@ if (SC.platform.supportsCSSTransitions) {
500
524
  });
501
525
 
502
526
  test("Test that cancelAnimation() removes the animation style and fires the callback with isCancelled set.", function () {
503
- stop(2000);
527
+ stop(4000);
504
528
 
505
529
  expect(7);
506
530
 
@@ -532,7 +556,7 @@ if (SC.platform.supportsCSSTransitions) {
532
556
  });
533
557
 
534
558
  test("Test that cancelAnimation(SC.LayoutState.CURRENT) removes the animation style, stops at the current position and fires the callback with isCancelled set.", function () {
535
- stop(2000);
559
+ stop(4000);
536
560
 
537
561
  expect(9);
538
562
 
@@ -566,7 +590,7 @@ if (SC.platform.supportsCSSTransitions) {
566
590
  });
567
591
 
568
592
  test("Test that cancelAnimation(SC.LayoutState.START) removes the animation style, returns to the start position and fires the callback with isCancelled set.", function () {
569
- stop(2000);
593
+ stop(4000);
570
594
 
571
595
  expect(9);
572
596
 
@@ -609,7 +633,7 @@ if (SC.platform.supportsCSSTransitions) {
609
633
  });
610
634
 
611
635
  test("handles acceleration when appropriate", function () {
612
- stop(2000);
636
+ stop(4000);
613
637
 
614
638
  SC.RunLoop.begin();
615
639
  view.animate('top', 100, { duration: 1 });
@@ -623,7 +647,7 @@ if (SC.platform.supportsCSSTransitions) {
623
647
  });
624
648
 
625
649
  test("doesn't use acceleration when not appropriate", function () {
626
- stop(1000);
650
+ stop(4000);
627
651
 
628
652
  SC.RunLoop.begin();
629
653
  view.adjust({ height: null, bottom: 0 });
@@ -638,7 +662,7 @@ if (SC.platform.supportsCSSTransitions) {
638
662
  });
639
663
 
640
664
  test("combines accelerated layer animation with compatible transform animations", function () {
641
- stop(1000);
665
+ stop(4000);
642
666
 
643
667
  SC.RunLoop.begin();
644
668
  view.animate('top', 100, { duration: 1 }).animate('rotateX', 45, { duration: 1 });
@@ -656,7 +680,7 @@ if (SC.platform.supportsCSSTransitions) {
656
680
  });
657
681
 
658
682
  test("should not use accelerated layer if other transforms are being animated at different speeds", function () {
659
- stop(1000);
683
+ stop(4000);
660
684
 
661
685
  SC.RunLoop.begin();
662
686
  view.animate('rotateX', 45, { duration: 2 }).animate('top', 100, { duration: 1 });
@@ -673,7 +697,7 @@ if (SC.platform.supportsCSSTransitions) {
673
697
  });
674
698
 
675
699
  test("callbacks should work properly with acceleration", function () {
676
- stop(1000);
700
+ stop(4000);
677
701
 
678
702
  SC.run(function () {
679
703
  view.animate({ top: 100, left: 100, scale: 2 }, { duration: 0.25 }, function () {
@@ -694,7 +718,7 @@ if (SC.platform.supportsCSSTransitions) {
694
718
 
695
719
  ok(callbacks === 0, "precond - callback should not have been run yet");
696
720
 
697
- stop(2000);
721
+ stop(4000);
698
722
 
699
723
  // we need to test changing the width at a later time
700
724
  setTimeout(function () {
@@ -711,7 +735,7 @@ if (SC.platform.supportsCSSTransitions) {
711
735
  });
712
736
 
713
737
  test("Test that cancelAnimation() removes the animation style and fires the callback with isCancelled set.", function () {
714
- stop(2000);
738
+ stop(4000);
715
739
 
716
740
  SC.run(function () {
717
741
  view.animate({ left: 100, top: 100, width: 400 }, { duration: 0.5 }, function (data) {
@@ -756,7 +780,7 @@ if (SC.platform.supportsCSSTransitions) {
756
780
  });
757
781
 
758
782
  test("Test that cancelAnimation(SC.LayoutState.CURRENT) removes the animation style, stops at the current position and fires the callback with isCancelled set.", function () {
759
- stop(2000);
783
+ stop(4000);
760
784
 
761
785
 
762
786
  SC.run(function () {
@@ -799,7 +823,7 @@ if (SC.platform.supportsCSSTransitions) {
799
823
  });
800
824
 
801
825
  test("Test that cancelAnimation(SC.LayoutState.START) removes the animation style, goes back to the start position and fires the callback with isCancelled set.", function () {
802
- stop(2000);
826
+ stop(4000);
803
827
 
804
828
  // expect(12);
805
829
 
@@ -863,7 +887,7 @@ module("ANIMATION WITHOUT TRANSITIONS", {
863
887
  });
864
888
 
865
889
  test("should update layout", function () {
866
- stop(2000);
890
+ stop(4000);
867
891
  SC.RunLoop.begin();
868
892
  view.animate('left', 100, { duration: 1 });
869
893
  SC.RunLoop.end();
@@ -875,7 +899,7 @@ test("should update layout", function () {
875
899
  });
876
900
 
877
901
  test("should still run callback", function () {
878
- stop(2000);
902
+ stop(4000);
879
903
 
880
904
  expect(1);
881
905
 
@@ -29,8 +29,8 @@ test("The borderFrame property of the view should include the borders from the l
29
29
  frame = view.get('frame');
30
30
  borderFrame = view.get('borderFrame');
31
31
 
32
- ok(SC.rectsEqual(frame, { x: 0, y: 0, width: 100, height: 100 }), "The frame without borders is");
33
- ok(SC.rectsEqual(borderFrame, { x: 0, y: 0, width: 100, height: 100 }), "The borderFrame without borders is");
32
+ same(frame, { x: 0, y: 0, width: 100, height: 100 }, "The frame without borders is");
33
+ same(borderFrame, { x: 0, y: 0, width: 100, height: 100 }, "The borderFrame without borders is");
34
34
 
35
35
  // Right 5px border.
36
36
  SC.run(function () {
@@ -40,8 +40,8 @@ test("The borderFrame property of the view should include the borders from the l
40
40
  frame = view.get('frame');
41
41
  borderFrame = view.get('borderFrame');
42
42
 
43
- ok(SC.rectsEqual(frame, { x: 0, y: 0, width: 95, height: 100 }), "The frame with 5px right border is");
44
- ok(SC.rectsEqual(borderFrame, { x: 0, y: 0, width: 100, height: 100 }), "The borderFrame with 5px right border is");
43
+ same(frame, { x: 0, y: 0, width: 95, height: 100 }, "The frame with 5px right border is");
44
+ same(borderFrame, { x: 0, y: 0, width: 100, height: 100 }, "The borderFrame with 5px right border is");
45
45
 
46
46
  // Top 10px border.
47
47
  SC.run(function () {
@@ -51,8 +51,8 @@ test("The borderFrame property of the view should include the borders from the l
51
51
  frame = view.get('frame');
52
52
  borderFrame = view.get('borderFrame');
53
53
 
54
- ok(SC.rectsEqual(frame, { x: 0, y: 10, width: 95, height: 90 }), "The frame with 5px right border & 10px top border is");
55
- ok(SC.rectsEqual(borderFrame, { x: 0, y: 0, width: 100, height: 100 }), "The borderFrame with 5px right border & 10px top border is");
54
+ same(frame, { x: 0, y: 10, width: 95, height: 90 }, "The frame with 5px right border & 10px top border is");
55
+ same(borderFrame, { x: 0, y: 0, width: 100, height: 100 }, "The borderFrame with 5px right border & 10px top border is");
56
56
 
57
57
  // Left 15px border.
58
58
  SC.run(function () {
@@ -62,8 +62,8 @@ test("The borderFrame property of the view should include the borders from the l
62
62
  frame = view.get('frame');
63
63
  borderFrame = view.get('borderFrame');
64
64
 
65
- ok(SC.rectsEqual(frame, { x: 15, y: 10, width: 80, height: 90 }), "The frame with 5px right border & 10px top border & 15px left border is");
66
- ok(SC.rectsEqual(borderFrame, { x: 0, y: 0, width: 100, height: 100 }), "The borderFrame with 5px right border & 10px top border & 15px left border is");
65
+ same(frame, { x: 15, y: 10, width: 80, height: 90 }, "The frame with 5px right border & 10px top border & 15px left border is");
66
+ same(borderFrame, { x: 0, y: 0, width: 100, height: 100 }, "The borderFrame with 5px right border & 10px top border & 15px left border is");
67
67
 
68
68
  // Bottom 20px border.
69
69
  SC.run(function () {
@@ -73,8 +73,8 @@ test("The borderFrame property of the view should include the borders from the l
73
73
  frame = view.get('frame');
74
74
  borderFrame = view.get('borderFrame');
75
75
 
76
- ok(SC.rectsEqual(frame, { x: 15, y: 10, width: 80, height: 70 }), "The frame with 5px right border & 10px top border & 15px left border & 20px bottom border is");
77
- ok(SC.rectsEqual(borderFrame, { x: 0, y: 0, width: 100, height: 100 }), "The borderFrame with 5px right border & 10px top border & 15px left border & 20px bottom border is");
76
+ same(frame, { x: 15, y: 10, width: 80, height: 70 }, "The frame with 5px right border & 10px top border & 15px left border & 20px bottom border is");
77
+ same(borderFrame, { x: 0, y: 0, width: 100, height: 100 }, "The borderFrame with 5px right border & 10px top border & 15px left border & 20px bottom border is");
78
78
 
79
79
  // 25px border.
80
80
  SC.run(function () {
@@ -84,8 +84,8 @@ test("The borderFrame property of the view should include the borders from the l
84
84
  frame = view.get('frame');
85
85
  borderFrame = view.get('borderFrame');
86
86
 
87
- ok(SC.rectsEqual(frame, { x: 25, y: 25, width: 50, height: 50 }), "The frame with 25px border is");
88
- ok(SC.rectsEqual(borderFrame, { x: 0, y: 0, width: 100, height: 100 }), "The borderFrame with 25px border is");
87
+ same(frame, { x: 25, y: 25, width: 50, height: 50 }, "The frame with 25px border is");
88
+ same(borderFrame, { x: 0, y: 0, width: 100, height: 100 }, "The borderFrame with 25px border is");
89
89
 
90
90
  });
91
91
 
@@ -112,8 +112,8 @@ test("The borderFrame property of the view should be correct for view with useSt
112
112
  frame = view.get('frame');
113
113
  borderFrame = view.get('borderFrame');
114
114
 
115
- ok(SC.rectsEqual(frame, { x: 0, y: 0, width: 100, height: 100 }), "The frame with useStaticLayout true after rendering is");
116
- ok(SC.rectsEqual(borderFrame, { x: 0, y: 0, width: 100, height: 100 }), "The borderFrame with useStaticLayout true after rendering is");
115
+ same(frame, { x: 0, y: 0, width: 100, height: 100 }, "The frame with useStaticLayout true after rendering is");
116
+ same(borderFrame, { x: 0, y: 0, width: 100, height: 100 }, "The borderFrame with useStaticLayout true after rendering is");
117
117
 
118
118
  // Right 5px border.
119
119
  SC.run(function () {
@@ -123,8 +123,8 @@ test("The borderFrame property of the view should be correct for view with useSt
123
123
  frame = view.get('frame');
124
124
  borderFrame = view.get('borderFrame');
125
125
 
126
- ok(SC.rectsEqual(frame, { x: 0, y: 0, width: 95, height: 100 }), "The frame with 5px right border is");
127
- ok(SC.rectsEqual(borderFrame, { x: 0, y: 0, width: 100, height: 100 }), "The borderFrame with 5px right border is");
126
+ same(frame, { x: 0, y: 0, width: 95, height: 100 }, "The frame with 5px right border is");
127
+ same(borderFrame, { x: 0, y: 0, width: 100, height: 100 }, "The borderFrame with 5px right border is");
128
128
 
129
129
  // Top 10px border.
130
130
  SC.run(function () {
@@ -134,8 +134,8 @@ test("The borderFrame property of the view should be correct for view with useSt
134
134
  frame = view.get('frame');
135
135
  borderFrame = view.get('borderFrame');
136
136
 
137
- ok(SC.rectsEqual(frame, { x: 0, y: 10, width: 95, height: 90 }), "The frame with 5px right border & 10px top border is");
138
- ok(SC.rectsEqual(borderFrame, { x: 0, y: 0, width: 100, height: 100 }), "The borderFrame with 5px right border & 10px top border is");
137
+ same(frame, { x: 0, y: 10, width: 95, height: 90 }, "The frame with 5px right border & 10px top border is");
138
+ same(borderFrame, { x: 0, y: 0, width: 100, height: 100 }, "The borderFrame with 5px right border & 10px top border is");
139
139
 
140
140
  // Left 15px border.
141
141
  SC.run(function () {
@@ -145,8 +145,8 @@ test("The borderFrame property of the view should be correct for view with useSt
145
145
  frame = view.get('frame');
146
146
  borderFrame = view.get('borderFrame');
147
147
 
148
- ok(SC.rectsEqual(frame, { x: 15, y: 10, width: 80, height: 90 }), "The frame with 5px right border & 10px top border & 15px left border is");
149
- ok(SC.rectsEqual(borderFrame, { x: 0, y: 0, width: 100, height: 100 }), "The borderFrame with 5px right border & 10px top border & 15px left border is");
148
+ same(frame, { x: 15, y: 10, width: 80, height: 90 }, "The frame with 5px right border & 10px top border & 15px left border is");
149
+ same(borderFrame, { x: 0, y: 0, width: 100, height: 100 }, "The borderFrame with 5px right border & 10px top border & 15px left border is");
150
150
 
151
151
  // Bottom 20px border.
152
152
  SC.run(function () {
@@ -156,8 +156,8 @@ test("The borderFrame property of the view should be correct for view with useSt
156
156
  frame = view.get('frame');
157
157
  borderFrame = view.get('borderFrame');
158
158
 
159
- ok(SC.rectsEqual(frame, { x: 15, y: 10, width: 80, height: 70 }), "The frame with 5px right border & 10px top border & 15px left border & 20px bottom border is");
160
- ok(SC.rectsEqual(borderFrame, { x: 0, y: 0, width: 100, height: 100 }), "The borderFrame with 5px right border & 10px top border & 15px left border & 20px bottom border is");
159
+ same(frame, { x: 15, y: 10, width: 80, height: 70 }, "The frame with 5px right border & 10px top border & 15px left border & 20px bottom border is");
160
+ same(borderFrame, { x: 0, y: 0, width: 100, height: 100 }, "The borderFrame with 5px right border & 10px top border & 15px left border & 20px bottom border is");
161
161
 
162
162
  // 25px border.
163
163
  SC.run(function () {
@@ -167,8 +167,8 @@ test("The borderFrame property of the view should be correct for view with useSt
167
167
  frame = view.get('frame');
168
168
  borderFrame = view.get('borderFrame');
169
169
 
170
- ok(SC.rectsEqual(frame, { x: 25, y: 25, width: 50, height: 50 }), "The frame with 25px border is");
171
- ok(SC.rectsEqual(borderFrame, { x: 0, y: 0, width: 100, height: 100 }), "The borderFrame with 25px border is");
170
+ same(frame, { x: 25, y: 25, width: 50, height: 50 }, "The frame with 25px border is");
171
+ same(borderFrame, { x: 0, y: 0, width: 100, height: 100 }, "The borderFrame with 25px border is");
172
172
 
173
173
  pane.destroy();
174
174
  });
@@ -185,8 +185,8 @@ test("borderFrame on a view with a scale.", function() {
185
185
  frame = view.get('frame');
186
186
  borderFrame = view.get('borderFrame');
187
187
 
188
- ok(SC.rectsEqual(frame, { x: 2, y: 2, height: 96, width: 96 }), "PRELIM: The unscaled frame with border: 2 is correct.");
189
- ok(SC.rectsEqual(borderFrame, { x: 0, y: 0, height: 100, width: 100 }), "PRELIM: The unscaled borderFrame with border: 2 is correct.");
188
+ same(frame, { x: 2, y: 2, height: 96, width: 96 }, "PRELIM: The unscaled frame with border: 2 is correct.");
189
+ same(borderFrame, { x: 0, y: 0, height: 100, width: 100 }, "PRELIM: The unscaled borderFrame with border: 2 is correct.");
190
190
 
191
191
  SC.run(function() {
192
192
  view.adjust({ scale: 0.5 });
@@ -195,7 +195,7 @@ test("borderFrame on a view with a scale.", function() {
195
195
  frame = view.get('frame');
196
196
  borderFrame = view.get('borderFrame');
197
197
 
198
- ok(SC.rectsEqual(frame, { x: 26, y: 26, height: 48, width: 48 }), "The scaled frame with border: 2 is correct.");
199
- ok(SC.rectsEqual(borderFrame, { x: 25, y: 25, height: 50, width: 50 }), "The scaled borderFrame with border: 2 is correct.");
198
+ same(frame, { x: 26, y: 26, height: 48, width: 48, scale: 0.5 }, "The scaled frame with border: 2 is correct.");
199
+ same(borderFrame, { x: 25, y: 25, height: 50, width: 50, scale: 0.5 }, "The scaled borderFrame with border: 2 is correct.");
200
200
 
201
201
  });