forked from prototypejs/prototype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CHANGELOG
1364 lines (754 loc) · 77.7 KB
/
CHANGELOG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-----------------------------------------------------------------------------
NOTE: This changelog is no longer updated. Consult the commit history for a
list of changes from version to version.
-----------------------------------------------------------------------------
*1.7* (November 16, 2010)
* Ensure `Element#update` works with string content that includes a LINK tag in Internet Explorer. [#264 state:resolved] (Tobias H. Michaelsen, Andrew Dupont)
* Treat a 304 HTTP status as a successful response. [#331 state:resolved] (Kenneth Kin Lum, Andrew Dupont)
* Handle sparse arrays properly in `Array#_each` to match behavior with browsers' built-in `Array#forEach` (and ES5). [#790 state:resolved] (Andriy Tyurnikov, Yaffle, Andrew Dupont)
* Make `Event.extend` work with legacy IE events in IE 9. (Andrew Dupont)
* Stop appending `&_=` to the parameters for non-GET Ajax requests in Safari. We no longer support any version of Safari for which this is necessary. [#327 state:resolved] (John-David Dalton, Andrew Dupont)
* Ensure `Form.focusFirstElement` doesn't raise an exception on forms with no fields. [#341 state:resolved] (achernin, Andrew Dupont)
* Define a `relatedTarget` property on extended mouseenter/mouseleave events in IE's legacy event system. [#708 state:resolved] (Walter Smith, Tobie Langel, Andrew Dupont)
* Fix odd behavior with `new Element('select')` in IE6-7. [#480 state:resolved] (Bruce Harris, kangax, Andrew Dupont)
* Extend BUTTON elements with everything defined in Form.Element.Methods. Ensure BUTTON elements are traversed in Form.getElements and serialized in Form.serialize. (Luis Gomez, Samuel Lebeau, kangax, Andrew Dupont)
* Ensure Object.isFunction returns `false` for RegExp objects. [#661 state:resolved] (James, kangax, Andrew Dupont)
* Revert Opera-specific behavior for calling Element#getStyle with (left|right|top|bottom). [#268 state:resolved] (kangax, Andrew Dupont)
* Fix issue with Event#isMiddleClick and #isRightClick on Safari and Chrome. [#731 state:resolved] (Arthur Schreiber)
* Fix issue where an Ajax request in IE sometimes returns 1223 instead of 204 as the status code. [#129 state:resolved] (adevadeh, gordyt, Andrew Dupont)
* Add Object.isDate. [#443 state:resolved] (Nesterenko Dmitry, kangax, Samuel Lebeau, Andrew Dupont)
* Handle cases where `document` or `document.documentElement` is passed into Element#getOffsetParent. Fixes IE errors with many layout/positioning methods. [#90 state:resolved] (Padraig Kennedy, Andrew Dupont)
* Wrap `element` in `$` for Element#cumulativeOffset, #viewportOffset, #positionedOffset, and #getOffsetParent. [#782 state:resolved] (Radoslav Stankov, Andrew Dupont)
*1.7_rc3* (October 11, 2010)
* Feature detect IE's legacy event system, since IE9 now supports DOM L2 Events. (Michael Sciacqua, kangax, Andrew Dupont)
* Fix an issue in IE9 beta where the `value` attribute of an <input> element would not get set. (Andrew Dupont)
* Move all offset methods to layout.js, eliminating some code repetition.
* Remove unit test for passing a DOM node into `Object.toJSON`. To continue to support this use case would require bypassing IE's native JSON implementation. (Tobie Langel, Thomas Fuchs, Samuel Lebeau, Andrew Dupont)
* Ensure hidden absolutely-positioned elements are sized correctly when they have no explicit width set. [#1084 state:resolved] (Viktor Kojouharov, Andrew Dupont)
* Change custom events implementation to use the `onlosecapture` event instead of the `onfilterchange` event for non-bubbling custom events in Internet Explorer. (John-David Dalton, Andrew Dupont)
* Revert `Element.getHeight` and `Element.getWidth` to their previous behavior in order to ensure backward-compatibility. (Sam Stephenson, Andrew Dupont)
* Fix accidental declaration of `purgeElement` as a global function. [#1089 state:resolved] (Viktor Kojouharov, Andrew Dupont)
* Ensure `Element.Layout` gives accurate measurements for percentages on all elements. Fix inaccurate measurements on `position: fixed` elements with percentages. [#1040 state:resolved] (Dan Popescu, Riccardo De Agostini, Andrew Dupont)
* Fix issue with retrieving border-box-(height|width) of hidden elements. [#1035 state:resolved] (Francois-Pierre Bouchard, Andrew Dupont)
* Ensure we clean up after ourselves for all `width` and `height` computations in `Element.Layout`. (Sam Stephenson, Andrew Dupont)
*1.7_rc2* (May 12, 2010)
* Remove redefinition of `Element#cumulativeOffset` when `getBoundingClientRect` is present, as it seems to give inaccurate results. (Andrew Dupont)
* Optimize element purging. (RStankov, Andrew Dupont)
* Add `Element.purge` for cleaning up event listeners and element storage keys on elements that will be removed from the page. Make `Element.update` perform similar cleanup automatically. (Andrew Dupont, Tobie Langel)
* The second argument to Event.Handler callbacks is the target element when no selector is present, or the matching element when a selector is present. Callbacks are always bound to the original element. (sam)
* Fix issue where `Element.Layout#get` would fail to interpret negative pixel values. (Sebastien Gruhier, Andrew Dupont)
* Fix bugs in layout.js. Add tests for `Element.Layout#toCSS`, `#toObject`, and `#toHash`. (RStankov, Andrew Dupont)
* Add `Element.Layout#toObject` and `Element.Layout.toHash`. (Andrew Dupont)
* Make `Element.Layout#toCSS` return camelized property names, as expected by `Element.setStyle`. [#1021 state:resolved] (njakobsen, Andrew Dupont)
*1.7_rc1* (April 1, 2010)
* Add an `Event.Handler` class, plus `Event.on` and `Element#on` methods, for simplified event delegation. (sam, Tobie Langel, Andrew Dupont)
* Make `Element.Layout` properly interpret computed non-integer pixel values. (e.g., Firefox can report "12.5px" as a computed style value.) (henrymazza)
* Fix deprecated Selector.matchElements. (Tobie Langel)
* Make Object.keys ES5 compliant. (Tobie Langel)
* Make Prototype's JSON implementation EcmaScript 5 compliant. [#453 state:resolved] (Tobie Langel)
* Also detect embedded (UIWebView) mobile Safari. (Thomas Fuchs)
* Avoid object creation and an unnecessary function call in `Class#addMethods`, when working around JScript DontEnum bug. Replace with feature test and a simple boolean check at runtime. (kangax)
* Optimize Element#immediateDescendants. (kangax, Tobie Langel)
* Remove unnecessary function object creation and `Number#times` in `Element._getContentFromAnonymousElement`. (kangax)
* Eliminate runtime forking and long method lookup in `Element.hasAttribute`. (kangax)
* Remove redundant ternary. (kangax)
* Avoid repeating declaration statements where it makes sense, for slightly better runtime performance and minification. (kangax)
* Make `Event.stopObserving` return element in all cases. [#810 state:resolved] (Yaffle, Tobie Langel)
* String#startsWith, String#endsWith performance optimization (Yaffle, Tobie Langel, kangax)
* Rewrite String#camelize using String#replace with a replacement function (Phred, John-David Dalton, Samuel Lebeau, kangax)
*1.6.1* (August 24, 2009)
* Avoid triggering a warning when Java is disabled in IE8. [#668 state:resolved] (orv, kangax, Andrew Dupont, Tobie Langel)
* Simplify String#(un)escapeHTML and remove their DOM dependencies. (Tobie Langel)
* Update UnittestJS. Modifiy test template accordingly. (Tobie Langel)
* Remove redundant if statement in Element#readAttribute. (Tobie Langel)
* Add missing semicolons. [#751 state:resolved] (Diego Perini)
* Remove expensive (for such low-level method) internal `getClass` in favor of plain string comparison (kangax)
* Fix `PeriodicalExecuter` so that it no longer suppresses exceptions. [#696 state:resolved] (Samuel Lebeau, Yaffle)
* Fix issue related to escaping of selectors for querySelectorAll. [#559 state:resolved] (Jorn Holm)
*1.6.1_rc3* (June 16, 2009)
* Fixed a variety of non-ASCII chars and similar [#610 state:resolved] (T.J. Crowder)
* Add Chrome 1+ to the list of supported browsers. (kangax)
* Fix `Template#evaluate` "eating" previous character if `null` was returned from `toTemplateReplacements` function. (Nir, Jürgen Hörmann, kangax)
* Make sure (deficient) APPLET, OBJECT and EMBED elements are extended with simulated methods in IE8. Return early if `_extendedByPrototype` is present on an element. (Tobie Langel, kangax)
* Replace array creation and `Array#include` with a more efficient `RegExp#test`. (kangax)
* Reorganize the way `ElementExtensions` are defined. Make sure elements used in SpecificElementExtensions are cleaned up. (kangax)
* Make sure $A works with primitive values. (mr_justin, kangax)
* Do not browser sniff when forking `unmark` function in selector suite. Instead use a proper test - PROPERTIES_ATTRIBUTES_MAP. (kangax)
* Do not use short-hand element methods notation (@element.getStyle() -> Element.getStyle(@element)) for performance reasons. Do not use `$A` and `Array.prototype.shift` when `Array.prototype.slice` can be used instead. (kangax)
* `Prototype.Browser.Opera` now uses stronger inference and is determined by [[Class]] of `window.opera` being - "Opera". (kangax)
* Fix error in event.js which prevented attaching more than one responder for an event name/element combination. [#651 state:resolved] (Rob Lineweaver)
* Do not sniff when testing for IE's proprietary mouseenter/mouseleave events support. Use more robust inference instead. (kangax)
* Use `Prototype.emptyFunction` consistently throughout unit tests. [#253 state:resolved] (Michael M Slusarz, John David Dalton, kangax)
* deprecation extension: mark Array#reduce() as removed. [#569 state:resolved] (Tobie Langel)
* `Form.serialize` now works safely with forms that have "length"-named elements. [#77 state:resolved] (Peter Adrianov, John-David Dalton, kangax)
*1.6.1_rc1* (March 22, 2009)
* `Element#update` now takes care of SCRIPT elements in IE. [#573 state:resolved] (Martin, Tobie Langel, kangax)
* Remove unused local variables from `Element.extend`. Fix one of the form tests to remove `_extendedByPrototype` by setting it to `undefined` rather than `false` (`_extendedByPrototype` being `false` does not force `Element.extend` to re-extend element). (T.J. Crowder, kangax)
* Make test for `escapeHTML`/`unescapeHTML` more strict. (Chrome 1.x escapes "<" and "&" with `innerHTML`, but not ">") (kangax)
* Remove another sniffing from one of DOM tests. Fixes last IE8 failure. (kangax)
* `Element.extend` now takes care of IE8 bug when HTMLAppletElement and HTMLObjectElement objects do not inherit from `Element.prototype`. (kangax)
* Fix DOM tests to use proper feature test when testing `setOpacity` (kangax)
* Fix another failure in IE8, `for`/`htmlFor` {get/set}Attribute translation. (kangax)
* Fix `Element#writeAttribute` and `Element#readAttribute` failures in IE8 due to lack of proper feature testing. (kangax)
* Remove sniffing from one of the DOM tests, which produced failures in IE8. (kangax)
* Fix `Form.reset` test where `respondsTo` wouldn't detect a method due to typeof returning "object" (rather than "function") in IE (kangax)
* Remove Array#reduce which currently overrides native `reduce` in clients implementing JS1.8, e.g. Firefox 3+ (Tobie Langel, Andrew Dupont, kangax)
* Make sure try/catch/finally is used instead of try/finally for clients without support for the latter one (e.g. Blackberry, IE) (Ville Koskinen, kangax)
* Use `in` operator when accessing property of a nodelist to prevent Safari <=2.0.4 from crashing (kangax)
* Add Element#clone as a safe wrapper of native `cloneNode`. (Andrew Dupont, kangax)
* Add tests to ensure IE8 properly assigns a class name in the `Element` constructor. [#529 state:resolved] (Riki Fridrich, Andrew Dupont)
* Remove sniffing from `Element` when detecting broken `setAttribute` in IE. [#571 state:resolved] (kangax)
* Remove sniffing from `Element.update` branching in favor of feature detection. [#574 state:resolved] (kangax)
* Remove sniffing when branching `escapeHTML` and `unescapeHTML`. [#570 state:resolved] (kangax)
* Redefine Element#down in IE 6-7 to avoid extending all descendants when no selector is given. [#452 state:resolved] (eno, Andrew Dupont)
* Reverse the definitions of Event#pointer(X|Y) and Event#pointer to prevent unnecessary computation. [#403 state:resolved] (Nick Stakenburg, Andrew Dupont)
* Add first-class support for `mouseenter` and `mouseleave` events in non-IE browsers (IE supports them natively). [#350 state:resolved] (Nick Stakenburg, Andrew Dupont)
* Make sure `_extendedByPrototype`, `_countedByPrototype`, and `prototypeUID` node expandos are accessed with `typeof` to prevent errors in some environments. [#354 state:resolved] (Hilberty, kangax, Andrew Dupont)
* Fix issue where Opera 9.x returns incorrect results on certain Selector queries with descendant combinators. [#395 state:resolved] (Arpan, fearphage, kangax, Andrew Dupont)
* Null out references to elements in cache on page unload. Need this in addition to the Event#stopObserving calls to clean up memory leaks. [#425 state:resolved] (ykphuah, mr_justin, Andrew Dupont)
* Ensure `toString` and `valueOf` properties are copied to a subclass only when necessary in IE6. [#382 state:resolved] (Samuel Lebeau)
* Make sure `getAttribute` is used without flag when accessing the "type" attribute of an iframe (IE throws error otherwise). [#118 state:resolved] (Zekid, kangax)
* String#gsub should escape RegExp metacharacters when the first argument is a string. [#469 state:resolved] (michael, kangax)
* Fix order of replacement in String#unescapeHTML [#544 state:resolved] (SWeini, kangax)
* Fix issue where a Selector query rooted on a node that had not been attached to the document failed in IE. [#464 state:resolved] (jddalton, kangax, Douglas Fraser, Andrew Dupont)
* Fix Selector to match elements with attributes containing hyphens. [#285 state:resolved] (leiyou, jddalton, kangax)
* Make sure Form.reset always returns a reference to the receiver element. [#309 state:resolved] (Phil, kangax)
* Escape ":" and "." characters when doing contextual CSS selection in browsers that support querySelectorAll. [#559 state:resolved] (fxtentacle, Andrew Dupont)
* Ensure the `target` property on events is never undefined in IE. [#383 state:resolved] (Mathias Karstädt, Diego Perini, Andrew Dupont)
* Ensure Element#descendants always returns an array. [#373 state:resolved] (kangax)
* Don't switch fixed position elements to absolute in Element.getDimensions [#543 state:resolved] (James Wheare)
* Avoid infinite loops when calling String#sub with empty pattern [#534 state:resolved] (Samuel Lebeau)
* Switch to Sprockets for building the Prototype distfiles. (sam)
* Switch Object.is(Array|String|Number) to use the vastly-superior approach discovered by Juriy. (kangax)
* Further fix to ensure Object.is(String|Number) do not throw exceptions on host objects in IE. (grepmaster, kangax, Tobie Langel, Andrew Dupont)
* Ensure Enumerable#grep can handle strings with RegExp metacharacters. (Marton Kiss-Albert, kangax)
* Switch to the "doScroll approach" for the dom:loaded custom event. (javier, Diego Perini, Nick Stakenburg, Andrew Dupont)
* Optimize document.viewport.get(Dimensions|Width|Height). (Nick Stakenburg, Andrew Dupont)
* Fix issue where Object#isString and Object#isNumber return false for String and Number "wrapper" objects. (atrepp, Samuel Lebeau, Andrew Dupont)
* Set document.loaded = true before firing dom:loaded custom event. (Andrew Dupont)
* Allow Element#store to accept an object containing several key/value pairs. (ZenCocoon, Andrew Dupont)
* Change Element#store to return the element itself (for chaining). (Andrew Dupont)
* Add non-bubbling custom events. A new final argument to Element#fire defaults to `true`; pass `false` to prevent bubbling when firing a custom event. (Andrew Dupont)
* Alter event system to use new element storage API rather than have its own global hashtable. (Andrew Dupont)
* Add Element#store and Element#retrieve for safe, hash-backed storage of element metadata (no memory leaks). Also add Element#getStorage for working with the element's storage hash directly. Hat tip: Mootools. (ZenCocoon, Andrew Dupont)
* Fix issue where certain versions of Safari treat class names case-insensitively in Selector/$$ queries. (Andrew Dupont, kangax, Brice)
* Fix issue where Function#argumentNames returned incorrect results in IE when comments were intermixed with argument names. (Christophe Porteneuve, T.J. Crowder)
* Selector.patterns should be represented as an ordered structure. (ADO, kangax)
* Performance improvements in Function methods (Samuel Lebeau, kangax, jddalton, Tobie Langel).
*1.6.0.3* (September 29, 2008)
* Add support for the Chrome browser in jstest.rb. (Andrew Dupont)
* Workaround a JavaScript exception in Opera. (Thomas Fuchs)
* Improve NodeList detection for Safari's $A function. (Garrett Smith, jddalton)
* Use different tactic to sniff for Opera in order to avoid false positives in IE. (Tobie Langel, jddalton)
* Rename variable in Form.Element.Serializers.select. (jddalton)
* Coerce Opera's version string into a number whenever we need to sniff. (Sam Holman, jddalton)
* Ensure Object.isElement handles "falsy" values properly. (kangax)
* Fix exiting test task on INT signal. (Samuel Lebeau)
* Fix unit test freeze in IE. (Tobie Langel)
* Ensure Hash does not return keys from the prototype chain (e.g., constructor, valueOf, toString). (kangax)
* Fix toString/valueOf sharing same method reference via closure in Class#addMethods. Use plain property assignment, since Object.extend fails to enumerate over toString/valueOf. (kangax)
* Stop Form.Element.disable from stealing focus. (jddalton)
* Ensure Element.hide and Element.show return an element, even if you pass an element ID. (Andrew Dupont)
* Fix an issue where Element#getStyle('height') returns null if the height is set to "auto." (kangax, jddalton)
* Add unit tests for Element#descendantOf. (jddalton)
* Form#serializeElements should not serialize file inputs. (kangax, Lonesome Boy)
* Fix an issue with calling Event.pointer before the DOM is loaded. (kangax, jddalton) [#4 state:resolved]
* Element#down on an input element should not raise error. (humeniuc, kangax)
* More unit tests for Object.isHash. (Tobie Langel)
* Allow Function#argumentNames to handle line breaks between arguments. (Geoff M. Granum, Tobie Langel) [#63 state:resolved]
* For consistency, add additional optional parameter "context" to Number.prototype.times. (Samuel Lebeau)
* Replace all instances of foo.__proto__ by foo['__proto__'] for Caja-compliance. (Tobie Langel)
* Speed up Function#argumentNames. Avoid Enum dependency. (Samuel Lebeau, Tobie Langel)
* Fix Event#element accessing inexistent tagName property (e.g. when element is a document). (kangax)
* Amended failing Element#identify test.
* Refactor unit tests. Unit tests are now dynamically generated from a JavaScript test file and optional HTML, JS and CSS fixtures. [Tobie Langel]
* Fix issue where Safari improperly reports an element as a descendant of itself.
* Greatly simplify IE's implementation of Element#descendantOf.
* Prevent exception when using Selector to search for an attribute that is not present. [gryn, Andrew Dupont]
* Fix issues where Firefox improperly returns the wrong node from a call to Event.element. Also fixes possible exception in Event.element in IE. [jdalton, Andrew Dupont]
* Fix issue where Safari 3 deletes custom properties from the document object when the page is returned to via the back button. [mzsanford, kangax, Andrew Dupont]
* Integrate support for the W3C Selectors API into the Selector class. Will now use the API when possible (browser supports the API *and* recognizes the given selector). Means minor changes to the semantics of :enabled, :disabled, and :empty in order to comply with CSS spec.
* Avoid re-extending element in Element#getDimensions. [kangax]
* Prevent Hash#toQueryString from serializing objets. [kangax, Tobie Langel]
* Fix Event#pointer in IE standard mode. Closes #9920. [kangax, Tobie Langel]
* Instanciate Test.Unit.Logger on window load. [Tobie Langel]
* Unit tests clean-up. [Tobie Langel]
* Refactor String#escapeHTML to avoid using the `with` statement. [Tobie Langel]
* Remove usage of the `with` statement from unit tests. [Tobie Langel]
* Complete rewrite of the deprecation helper, now renamed UpdateHelper and useable by third-party libs. [Tobie Langel]
* Make Element#writeAttribute handle frameborder attribute in IE. Closes #11068. [staaky, Tobie Langel]
* Minor clean-up of selector.js. Closes #10844. [RQuadling]
* Make String#unescapeHTML strip tags in IE. Closes #10173. [kangax]
* Stop form observers in unit tests. Closes #10938. [kangax]
* Performance improvements for Enumerables. Closes #11264. [Ben, Samuel Lebeau]
* deprecation extension: mark Hash.toJSON() as removed. [Tobie Langel]
* deprecation extension: mark Class.create() used without arguments as deprecated. [Tobie Langel]
* deprecation extension: mark Event.unloadCache as removed rather than deprecated. [Tobie Langel]
* deprecation extension: log everything *but* deprecations with console.error. [Tobie Langel]
* Change deprecation extension to use Firebug's console.warn and console.error. [Andrew Dupont, Tobie Langel]
* Make tagName comparisons XHTML-compliant. Closes #11012, #11013, #11014. [cfis, Tobie Langel]
* Avoid breaking Element.prototype in browsers which support it. Closes #11004. [cfis, Tobie Langel]
* Prevent Element#cumulativeOffset, Element#getOffsetParent, Element#positionedOffset, Element#viewportOffset and Element#clonePosition from throwing an error in IE when called on a parent-less element. Closes #9416, #10192, #10248. [ronstoney, psiborg, kangax]
* Prevent Enumerable#eachSlice from entering into an endless loop if passed an argument smaller than 1. Closes #10665. [kangax, Tobie Langel]
* Allow Selector to correctly detect the presence of namespaced attributes. Closes #10987. [Samuel Lebeau, Tobie Langel]
* Make Element#absolutize and Element#relativize always return element. Closes #10983. [kangax]
* Add deprecation extension. [Tobie Langel]
*1.6.0.2* (January 25, 2008)
* Update the list of officially supported browsers in the README. [sam]
* Add tests for Element#descendantOf that deal with dynamically-created elements. [Andrew Dupont]
* Ensure positionedOffset properly considers "position: fixed" elements. Also ensures IE reports offsets correctly by triggering hasLayout when a "static" element has a "fixed" element as an offset parent. Closes #10644. [heygrady, kangax, Andrew Dupont]
* Roll back the fix for #9609, since it does not work in Opera. Instead, avoid using "valueOf" or "toString" as field names in forms.
* Prevent DOM node expandos _countedByPrototype and _prototypeEventID from being serialized into (inner|outer)HTML in IE. Closes #10909. [dcpedit, Tobie Langel, Andrew Dupont]
* Make Ajax.Request#isSameOrigin JavaScript Lint compliant. [Andrew Dupont]
* Properly serialize form fields with names that collide with built-in JS properties (like "length" or "toString"). Closes #9609. [gryn, kangax]
* Make Object.isArray correctly identify arrays created in another frame. Closes #10374. [pointy, Dean Edwards, Andrew Dupont, Tobie Langel]
* Fixed issue where Element#match failed on attribute selectors with single or double quotes. Closes #10067. [Cezary Okupski, Andrew Dupont]
* Add tests for Element#match. [Tobie Langel]
* Fix Element#writeAttribute to work with 'cellspacing' and 'cellpadding' attributes in IE. Closes #9983. [/dev/urandom, Tobie Langel]
* Prevent a potential security issue for cross-site ajax requests. [Alexey Feldgendler, sam, Tobie Langel]
* Test for attribute existence before applying more complex CSS3 selectors. Closes #10870. [arty, Tobie Langel]
* Fix "function $A" declaration inside of a conditional (confuses IE). Closes #10882. [Jacco, Andrew Dupont]
* Fixed selector parsing so that "#foo [bar=baz]" is treated the same way as "#foo *[bar=baz]". Closes #10734. [jlukas, kangax, Andrew Dupont]
* Fix Element#descendantOf logic in IE. Closes #10413. [martymix, kamil.szot]
* Fix missing "var" in Element#insert. Closes #10838. [Lantash]
* Add Test.Unit.MessageTemplate class. Add flunk, buildMessage and assertBlock methods to Test.Unit.Assertions. Refactor accordingly. [Tobie Langel]
* Remove useless binding in Template#evaluate. [Tobie Langel]
* Make Object.inspect more robust. [Tobie Langel]
* Add a description to :test and :dist rake tasks. [Christoph Sturm]
* Fix Selector.matchElements to allow for coma-separated selectors in Element#up/next/previous and Event#findElement. [Samuel Lebeau, Tobie Langel]
* Test.Unit refactoring. Allow running multiple instances of Test.Unit.Runner on the same page. Allow rake to run specific testcases (e.g.: rake test BROWSERS=firefox TESTS=array TESTCASES=testUniq,test$w). Closes #10704, #10705, #10706. [nicwilliams, Tobie Langel]
* Optimize property detection of outerHTML. Avoids triggering FOUC in Safari 3.0.4. Closes #10702. [subimage, Tobie Langel]
* Add document.loaded, a boolean that is set to true once dom:loaded is fired. Setting document.loaded to true before the document is loaded prevents dom:loaded from being fired. [Tobie Langel]
* Make Element#insert standard-compliant. Fixes an issue in FF3b2 when inserting HTML or text inside DOM nodes which aren't (yet) appended to the document. [Tobie Langel]
* Add some missing semicolons to the source tree. Closes #10659. [Richard Quadling]
* Ensure Ajax.Response#getHeader returns null for missing headers in Opera. [Tobie Langel]
* Allow WEBrick to simulate slow or dropped connections and to ease Ajax request inspection. [Tobie Langel]
* Ensure Ajax.Response#getHeader returns null for missing headers. [Tobie Langel]
* Ensure $A creates an empty array when its argument's length is undefined. Closes #10574. [henryju, Tobie Langel]
* Fix incorrect variable declaration in Event.fire. Closes #10329. [rubley]
* Fix the way Selector handles [pseudoclass + combinator] with no space in between. Closes #9696. [kangax, fearphage, Andrew Dupont]
* Optimize Element#up/down/next/previous. Closes #10353. [Dylan Bruzenak, Nick Stakenburg, Andrew Dupont]
* Handle case-sensitivity in Selector tag names better. Closes #5052. [mexx, Andrew Dupont]
*1.6.0.1* (December 4, 2007)
* Change document.viewport.getDimensions to exclude scrollbars in all cases. Closes #10148, #9288. [Nick Stakenburg]
* Add logic to Element#getStyle in Opera that fixes inaccurate reporting of computed 'width' and 'height' properties. [Andrew Dupont]
* Ensure that an Ajax.Request's parameters option can be a Hash. Closes #10172. [kangax, sam]
* Ensure no comment nodes are returned in Selector queries (IE improperly returns comment nodes on getElementsByTagName("*")). Change Element#descendants to use Element#getElementsBySelector in order to avoid this issue. Closes #10220. [Jeff Gobel, Andrew Dupont]
* Re-enable the XPath approach in Selector for Safari 3. Falls back to the non-XPath version when it sees a problematic token. [Andrew Dupont]
* Fix a bug in the IE-specific Element#descendantOf logic. [Nicholas, Andrew Dupont]
* Make Ajax.Updater clone its options hash before modifying it. Prevents memory leaks in Ajax.PeriodicalUpdater. Closes #10049 [Mislav Marohnić, Tobie Langel].
* Remove useless variable in Selector.handlers.child. Closes #10006 [kuriyama]
* Don't redeclare previously declared variables. Closes #10007 [kuriyama]
* For consistency: use Object.isUndefined where possible. [Tobie Langel]
* Make String#isJSON return false for empty or blank strings. Make Ajax.Response#responseJSON null when Ajax.Response#responseText is empty or blank. [Andrew Dupont, Thomas Fuchs, Tobie Langel]
* Make Ajax.Response#_getResponseJSON use Ajax.Response#responseText. [Tobie Langel]
* Remove the forked declaration of Hash#_each. As we are now systematically cloning the object upon instantiation, preventing iteration of shadowed properties is no longer required. [Tobie Langel]
* Performance optimizations for Event#findElement. Make Event#findElement's expression argument optional, in which case the extended target element is returned (same as Event#element). [Tobie Langel]
* Ensure Event#fire always returns an extended event. [Tobie Langel]
*1.6.0* (November 6, 2007)
* Fix Class#addMethods for "toString" and "valueOf" methods in Internet Explorer. Closes #9901. [sam]
* Exclude Opera from using the sourceIndex approach in Element#descendantOf. [Tobie Langel, Andrew Dupont]
* Ensure Element#hasClassName always returns a boolean. Closes #10075. [ronnylovtangen, Tobie Langel]
* Ensure selectors of the form "[href]" (attribute token with no preceding tag name) work properly. Closes #8870. [chao, kangax, Andrew Dupont]
* Performance optimizations for Element#descendantOf. Costliness should no longer be dependent on the difference in depth between the parent and the child. [Andrew Dupont]
* Apply the workaround for the Firefox "blinking element" opacity=1 bug only to Firefox 1.5. [Thomas Fuchs]
* Add event.stopped, a boolean that is set to `true` when Event#stop is called. [Andrew Dupont, sam]
* Reset the browser's dimensions to their original settings after running the DOM viewport tests. [sam]
* Fix the test runner for Firefox in Leopard. [sam]
* Use String#include wherever possible.
* In IE, allow opacity to be set on elements not yet attached to the document. Closes #9904. [Thomas Fuchs, dcpedit, Tobie Langel]
* Avoid the try..catch block in Ajax.Response#_getResponseJSON unless required. [Tobie Langel]
* Add more tests to Element.update. Closes #9327. [Tobie Langel]
* Make the Ajax.Response#headerJSON property correctly decode unicode characters. Closes #9285. [Marius Feraru, Tobie Langel]
* Make sure Event and Event.extend are defined before wrapping events and calling their handler. Prevents a known Firefox bug from throwing errors on page load/unload (cf.: https://bugzilla.mozilla.org/show_bug.cgi?id=361271). Closes #5393, #9421. [staaky, John Resig, sam, Tobie Langel]
* Minor cosmetic changes to the display of unit tests in terminal. [Tobie Langel]
* Make submitting forms work in Opera < 9.1. Closes #9917, #9463, #8260. [kangax]
* Fix template evaluation with empty replacements. Closes #9692. [Ryan McGeary]
* Hash#toTemplateReplacements is an alias for Hash#toObject so you can once again pass hashes to Template#evaluate and String#interpolate. [sam]
* Fix Event#is(Left|Middle|Right)Click in IE. Closes #7520 (again). [Mislav Marohnić]
*1.6.0_rc1* (October 16, 2007)
* Ensure Event.* generic methods work in IE, even when the event is not extended. [Viktor Kojouharov, Andrew Dupont]
* Don't translate "keypress" events into "keydown" events. [sam]
Note: "keypress" is broken in Safari <= 2.x, but Event#stop has no effect on "keydown" events.
* Changed Element#makeClipping to remember the original overflow value, even if it's a non-inline style. [Andrew Dupont]
* Cross-browser Event#isLeftClick with the addition of is(Middle|Right)Click. Closes #7520. [Christophe Porteneuve, Richard Quadling, Mislav Marohnić]
* Changed Selector to use the non-XPath approach for Safari 3 because of bugs in its version of document.evaluate. [Andrew Dupont]
* Changed the Selector regex that tests whether the selector can be expressed in XPath; added :checked, since XPath can't detect all scenarios in which an <input> is checked. Fixes #9776. [StelardActek, kangax, Andrew Dupont]
* Changed Selector pattern match so that descendant combinators after pseudoclass tokens are properly handled. Fixes #9696. [wiktor, kangax, Andrew Dupont]
* Make sure $w always returns an array. [Andrew Dupont, Tobie Langel]
* Add more tests to Hash. [Mislav Marohnić]
* Performance enhancements to $A. Closes #9464. [Samuel Lebeau]
* Make Function#argumentNames work with named functions. Closes #9826. [Samuel Lebeau]
* Add Object.isHash. [Tobie Langel]
* Performance improvements to String#times. [Martin Ström]
* Make Ajax.Response#getHeaderJSON and Ajax.Response#getResponseJSON pseudo private instance methods. [Tobie Langel]
* Make ObjectRange use the new Class.create syntax. [Mislav Marohnić]
* Fix a failing ClassCreate test case in IE. [Tobie Langel]
* Complete rewrite of the Hash class.
!! BACKWARDS COMPATIBILITY CHANGE !! This new version of Hash is NOT backwards compatible with the former Hash class.
Properties are now hidden away in an private store to prevent the risk of collision with Hash's instance and mixed-in methods.
This implies that properties of the hash can no longer be set, accessed or deleted directly: use the new Hash#get(key), Hash#set(key, value) and Hash#unset(key) instance methods instead.
- Make $H(object) equivalent to new Hash(object). Both now return a new (cloned) instance of Hash in all circumstances.
- Make Hash#merge non-destructive.
- Add Hash#update (a destructive version of Hash#merge).
- Add Hash#clone (returns a new, cloned instance of Hash).
- Add Hash#toObject (returns a clone of the contained object).
- Add Hash#get(key) (returns the value of the specified property).
- Add Hash#set(key, value) (sets the value of the given property. returns the value).
- Add Hash#unset(key) (deletes the specified property and returns its value).
- Add Hash.from as a alias to $H for consistency with Array.from.
- Add Object.toQueryString.
- Deprecate Hash.toQueryString (use Object.toQueryString or the instance method Hash#toQueryString instead).
- Remove Hash#remove (use Hash#unset instead).
- Remove Hash.toJSON (use Object.toJSON or the instance method Hash#toJSON instead). [sam, Tobie Langel]
* Element#wrap now returns the wrapper instead of the element being wrapped. [sam]
* Namespace all custom event names to avoid conflicts with native DOM events. [sam]
- All custom event names MUST include a namespace. Prefix custom event names for observe, stopObserving, and fire with the namespace followed by a colon. E.g. document.fire("widget:activated")
- The "contentloaded" event is now "dom:loaded".
- The Event.DOMEvents array is no longer present. If an event name does not include a namespace, the event is treated as a native event.
* Clean up the new class API. [sam, Tobie Langel]
- Add Class#addMethods for adding instance methods to classes.
- Remove Class.extend and Class.mixin.
- Class.create now takes a variable number of arguments: if the first argument is a class, the newly created class inherits from that class; all other arguments are treated as successive calls to addMethods.
* Fix contentloaded event initialization in IE. Closes #9457, #9488, #9707. [Mislav Marohnić]
* Deprecate document.getElementsByClassName and Element#getElementsByClassName since native versions return a NodeList and we can only return an Array. Please use $$ or Element#select instead. [sam]
For more information see https://bugzilla.mozilla.org/show_bug.cgi?id=390411
* Fix missing "var" in selector.js. Closes #9761. [Tobie Langel]
* Date#toJSON now returns times in UTC for better compatibility with json.js. Closes #9332. [Tobie Langel]
* Ensure document._getElementsByXPath extends the elements it returns; fixes $$ not returning extended elements in Opera 9.2. Closes #8843. [jdalton]
* Update Prototype.Browser.MobileSafari for iPod touch compatibility. [sam]
* Add tests for Object.extend and Object.clone. [Tobie Langel]
* Add a test for Form.Observer. [Christoph Sturm]
* Make sure setting opacity works on elements that have "no layout" in IE. [Thomas Fuchs]
* Simplify Class.create by establishing a prototype chain when subclassing. Closes #9342. [Ben Newman]
* Fix Ajax.PeriodicalUpdater for compatibility with Ajax.Response. Closes #9321. [kampers]
* Ensure that classes always have an initialize method. [Mislav Marohnić]
* Update Template, Selector, Ajax.*, and ObjectRange classes to use the new class system. [Mislav Marohnić]
* Change Abstract.TimedObserver to subclass PeriodicalExecuter and tweak its subclasses to use new inheritance functionality. TimedObserver can now be stopped the same way as PeriodicalExecuter. Closes #8589. [Mislav Marohnić]
* Fix Class.mixin to extend the class's prototype. [Mislav Marohnić]
* Fix superclass method call breakage from [7337]. [Mislav Marohnić, sam]
* Change Class.extend to allow for superclass method resolution and remove Class.inherit. Closes #9274. [Samuel Lebeau]
* Event handlers are now bound to the observed element, not the event's target element. [Dan Webb]
* Define Node constants conditionally after checking for Node.ELEMENT_NODE presence. Add unit test to check the values of all constants. Closes #7625. [Mislav Marohnić]
* Make sure Enumerable#include doesn't do type comparision. [Mislav Marohnić]
* Add contextmenu to Event.DOMEvents. [Thomas Fuchs]
*1.6.0_rc0* (August 15, 2007)
* Fix readAttribute-related failure in form.html in IE. [sam, Andrew Dupont]
* Fix failing dom.html and selector.html tests in IE. [Tobie Langel, Andrew Dupont]
* Make sure the WebKit redefinition of Element#cumulativeOffset uses Element._returnOffset. Closes #9245. [mdaines]
* Make sure Element#observe and Element#stopObserving are always chainable. [sam]
* Event.fire/Element#fire now returns the newly-fired event instead of the event's target element. [sam]
* Restrict Event.DOMEvents to include only events that can be supported in all browsers. [sam]
* Fix a failing test in base.html in Safari 2. [Tobie Langel]
* Fix Element#positionedOffset and Element#getOffsetParent for static elements on IE. [Thomas Fuchs]
* Make sure event handlers and their wrappers are removed from the cache by Event.stopObserving. [sam, Severin Heiniger]
* Add line numbers to failures when unit testing in Firefox. Closes #9231. [John Resig]
* Fix Function#argumentNames for Opera and IE. [Thomas Fuchs]
* Add Object.isString, Object.isNumber, and Object.isUndefined, and clean up the source to make use of Object.isXXX where possible. [sam]
* Add the document.viewport object for querying dimensions and scroll offsets of the browser viewport. [Andrew Dupont, Thomas Fuchs, sam]
Example:
document.viewport.getDimensions() // { width: 1149, height: 923 }
document.viewport.getWidth() // 1149
document.viewport.getHeight() // 923
document.viewport.getScrollOffsets() // { left: 0, top: 1592 }
* Add support for brackets in quoted attribute value selectors. Closes #9157. [Ken Snyder]
* Add some missing semicolons to the source tree. Closes #9140. [jdalton]
* Fix event extensions and custom events firing for Safari 2.0. [Thomas Fuchs]
* Add RegExp.escape for escaping regular expression strings. Closes #9094. [Ken Snyder]
* Make the eventName and handler arguments to Event.stopObserving optional. If no handler is specified, all handlers for the given event are unregistered. If no event name is specified, all observed events on the element are unregistered. [sam]
* Add cross-support for the DOMContentLoaded event through a Prototype custom event on document called "contentloaded". The DOMContentLoaded event fires before window.load, when the entire HTML document, but not necessarily its images, stylesheets or other assets, has loaded. Based on [6596]. [sam, Mislav Marohnić]
Example:
document.observe("contentloaded", function() {
$$("a").invoke("identify"); // give all <a> tags an ID
});
* Add Event.fire and Element.Methods.fire for firing custom events. Prototype custom events piggyback on a real DOM event ("ondataavailable"), so they bubble and cancel. You can fire custom events from any element, or fire global events on the document object. Observe custom events just as you'd observe a regular DOM event. [sam, Seth Dillingham]
* Extend the event object with methods from Event.Methods and normalize it in IE. [sam, Mislav Marohnić]
* Remove support for observing the capturing phase of DOM events, since we can't support it in all browsers. [sam]
* Add Ajax.Response object which supports the following methods: responseJSON, headerJSON, getHeader, getAllHeaders and handles browser discrepancies in the other response methods. Add sanitizeJSON, evalJS and evalJSON to Ajax.Request. Closes #8122, #8006, #7295. [Tobie Langel]
* Add an isRunningFromRake property to unit tests. [Tobie Langel]
* Add support for Opera browser in jstest.rb. [Tobie Langel]
* Inheritance branch merged to trunk; robust inheritance support for Class.create. Closes #5459. [Dean Edwards, Alex Arnell, Andrew Dupont, Mislav Mahronic]
- To access a method's superclass method, add "$super" as the first argument. (The naming is significant.) Works like Function#wrap.
- Class.create now takes two optional arguments. The first is an existing class to subclass; the second is an object literal defining the instance properties/methods. Either can be omitted. Backwards-compatible with old Class.create.
- Added Class.extend for dynamically adding methods to existing classes (while preserving inheritance chain). Can also be used for mixins.
- The 'constructor' property of a class instance always points back to the proper class. Class objects themselves have two special properties: 'superclass' and 'subclasses' (which default to 'null' and '[]', respectively). Allows for powerful introspection.
- Added Object.isFunction [sam]
* Add Function#argumentNames, which returns an ordered array of the function's named arguments. [sam]
* Prevent a crash in Safari 1.3 on String#stripScripts and String#extractScripts. Closes #8332. [grant, Tobie Langel]
* Add Prototype.Browser.MobileSafari which evaluates to true on the iPhone's browser. [sam]
* Optimize Selector#match and Element#match for simple selectors. Closes #9082. [Andrew Dupont]
* Remove the dependency on Element.ClassNames from Element#addClassName/removeClassName/toggleClassName, and deprecate Element.ClassNames. Closes #9073. [Tobie Langel]
* Make Element#wrap accept a second argument for setting attributes on the wrapper. Allow wrapping elements which are not part of the document. Closes #9071. [Tobie Langel]
* Improvements for Element#replace, Element#update and Element#insert. Closes #7429, #9060. [Tobie Langel]
- Element#replace/update/insert uses the argument's toElement or toHTML method if present (toElement has precedence if both are present).
- Element#replace and Element#update now also accept DOM elements.
- Element#replace better handles table-related elements in IE and Opera.
* Add Object.isArray and Object.isElement (returns true if the object is a DOM node of type 1). [Tobie Langel]
* Add Object.toHTML (uses the object's toHTML method if present or else passes the object to String.interpret). [Tobie Langel]
* Make Element#setStyle accept a string argument of CSS rules. Deprecate uncamelized style property names when setting styles using an object (for performance reasons). Closes #9059. [Tobie Langel]
Examples:
$('id').setStyle('font-size: 12px; float: left; opacity: 0.5');
$('id').setStyle({fontSize: '12px', cssFloat: 'left', opacity: 0.5});
!! BACKWARDS COMPATIBILITY CHANGE !!
If you have code that looks like this:
$('id').setStyle({'font-size': '12px'});
You need to replace it with either of the following:
$('id').setStyle({fontSize: '12px'});
$('id').setStyle('font-size: 12px;');
* Add Element#identify, which returns the element's ID if it exists, or sets and returns a unique, auto-generated ID (of the form "anonymous_element_" + auto-incremented digit) otherwise. Use this when you need to ensure an element has an ID. Closes #9012. [Jeff Watkins, sam, Tobie Langel]
* Make Element#readAttribute work for cloned elements in IE. Closes #8481. [chem, Tobie Langel]
* Template enhancements. Closes #8166. [Christophe Porteneuve]
- Added String#interpolate as a shortcut for new Template(...).evaluate(...).
- If you pass String#interpolate or Template#evaluate an object with a toTemplateReplacements() method, the return value of that method will be used as the replacement object.
- You can now substitute properties of template replacement values in template strings, using dot or bracket notation (or both). Example:
"#{name.last}, #{name.first[0]}. (#{location})".interpolate({
name: { first: "Christophe", last: "Porteneuve" }, location: "Paris"
}) // "Porteneuve, C. (Paris)"
* Extended grep semantics. The first argument to Enumerable#grep is now a "filter" (an object with a match() method) so you can now e.g. filter an array of DOM nodes by CSS selector. RegExp#match is now an alias to RegExp#test, so grep can still be used to filter an array of strings with a regular expression. Closes #7596. [Christophe Porteneuve, sam]
* Make String#scan explicitly return a string. This prevents possible issues with methods expecting input data that is typeof == 'string'. Closes #6350. [AndrewRev, Tobie Langel]
* Add Array#intersect for set intersection. Returns a new array containing all items common to the array and the argument, with duplicates removed (clone of the Ruby & method). [Thomas Fuchs]
Example:
[1,1,3,5].intersect([1,2,3]) -> [1,3]
* Rename Element#getElementsBySelector to Element#select and add alias for Element#getElementsBySelector. [Thomas Fuchs]
* Add Element#adjacent as a shortcut to selecting all adjacent nodes (and their children) that match a CSS selector. [Thomas Fuchs]
* Enhance the Enumerable and Array APIs to more closely match those of JavaScript 1.6 as implemented in Firefox 1.5. Closes #6650, #8409. [Mislav Marohnić, Sylvain Zimmer]
- Add Array#lastIndexOf, and change Array#indexOf not to overwrite the native method.
- Make Enumerable use Array.prototype.forEach instead of _each when possible (slight speed increase).
- Add "filter", "entries", "every", and "some" Array aliases.
- All Enumerable methods now have an additional parameter, "context", which, if present, specifies the object to which the iterators' "this" is bound.
- Function#bind and #curry now return the receiving function if the binding object is undefined.
* Temporary workaround for Prototype.BrowserFeatures.SpecificElementExtensions incorrectly evaluating to true on iPhone. (needs further investigation) [sam]
* The action for Form#request defaults to the current URL if the "action" attribute is empty. (This is what most of the major browsers do.) Fixes #8483. [Tomas, Mislav Marohnić]
* In form serialization, change the way submit buttons are handled. Previously all submit buttons were serialized; now Prototype serializes only the first one. Change Form#serialize and Form.serializeElements to accept a params hash. With the "hash: false" option, a serialized string is returned instead of the hash data object. With the "submit: 'foo'" option, only the submit button with the name "foo" is serialized. References #5031. [Mislav Marohnić]
Examples:
$('form').serialize({ submit: 'delete' })
$('form').serialize({ hash: false }) //-> equivalent to $('form').serialize()
* Form#findFirstElement respects HTML tabindexes. Closes #7595. [Christophe Porteneuve]
* Added Form.Element#setValue method for setting values on various form controls. Checkboxes and radio buttons respond to a boolean and multiple select boxes expect an array of values. Closes #5902. [Jonathan Viney, Mislav Marohnić]
Examples:
$('text_input').setValue('hello world!')
$('remember_me').setValue(true)
$('attend_classes').setValue(['cheese rolling', 'evil chemistry'])
* Make document.getElementsByClassName match a subset of the WHATWG Web Applications 1.0 specification which was adopted in Firefox 3 (http://www.whatwg.org/specs/web-apps/current-work/#getelementsbyclassname). It now supports multiple class names given as a whitespace-separated list in a string. Array argument is not supported. The method will only return the nodes that match all the class names. In browsers that implement the method natively it will not be overwritten. Closes #8401. [Mislav Marohnić]
Example:
document.getElementsByClassName('foo bar')
* Fix a Safari rendering issue when floating elements could temporarily disappear when opacity was set to 1. Closes #7063. References #3044, #3813, #6706. [Thomas Fuchs, davidjrice]
* Prevent a crash in Safari when calling String#evalJSON(true) on very large strings. Add String#isJSON. Closes #7834. [Tobie Langel]
* Prevent a crash in Safari 1.3 on String#stripScripts and String#extractScripts. Closes #8332. [grant, Tobie Langel]
* Allow JSON data to contain line breaks. Closes #8271. [pijyster, Tobie Langel]
* Add Hash.prototype.index which returns the first found property that has a specific value. Closes #8528. [Thomas Fuchs, slusarz, Mislav Marohnić]
Examples:
var hash = $H({a:1,b:'2'});
hash.index(1) // -> 'a'
hash.index('1') // -> undefined
* Ensure HTMLElement exists before creating Element.extend. [Tobie Langel]
* Add Number.prototype.round/ceil/floor/abs as an aliases to the respective methods in Math. Refactor to seperate number extensions from base.js. [Thomas Fuchs]
* Make Element#absolutize and Element#relativize properly use Element#getStyle. Closes #8580. [Christophe Porteneuve]
* Test library fixes: make rake dist work on Windows, only teardown if a browser is supported. Closes #8463, #8498. [Mislav Marohnić, grant]
* Change Element.insert syntax to allow multiple positions. [Thomas Fuchs]
Examples:
Element.insert('foo', {top:'bar', bottom:'baz'});
$('foo').insert({after: new Element('p').update('bar')});
Element.insert('foo', new Element('p').update('bar')); // defaults to bottom
Element.insert('foo', 'bar'); // defaults to bottom
* String.prototype.truncate now explicitly converts its return value into a string if no truncation takes place. This prevents possible issues with methods expecting input data that is typeof == 'string'. [Thomas Fuchs, Tobie Langel, Sam Stephenson]
* Event.findElement behaves as expected when the element passed matches the given selector. Closes #8395. [Mislav Marohnić, Tobie Langel]
* Element.setOpacity now calls removeAttribute on the filter style on IE if no more filters remain, which makes Cleartype work properly. Closes #8376. [alexdemi, Thomas Fuchs]
* Event.findElement now uses Element#up (and as a result can take a CSS selector instead of just a tag name). [Tobie Langel]
* Minor cleanup of the position methods [sam]
* Fix Element#clonePosition to call viewportOffset. Closes #8372. [graemenelson, Christophe Porteneuve]
* Prevent an error being thrown by $$ when #id does not exist in $$("div #id"). Closes #8325. [Tobie Langel, ecke]
* Make Prototype.ScriptFragment behave when including Prototype inline. [Christophe Porteneuve]
* Deprecate Position (kept for backwards compatibility). Add Element#cumulativeOffset, Element#positionedOffset, Element#absolutize, Element#relativize, Element#cumulativeScrollOffset, Element#getOffsetParent, Element#viewportOffset and Element#clonePosition. [Christophe Porteneuve]
* Make Element#update and Element#insert work for SELECT tags in IE and Opera. [Tobie Langel]
* Make Element#insert and Element#update better handle TABLE related elements in IE and Opera. Closes #7776, #8040, #7550, #7776, #7938. [Tobie Langel]
* Make Element#readAttribute('title') work in Opera. [Tobie Langel]
* Make Element#replace work with form elements in Firefox and Safari. Closes #8010, #7989. [dsl239, Tobie Langel]
* Add Element#wrap which wraps the element inside a new one. Closes #5732. [P. Vande, Tobie Langel]
* Make Element into a constructor: new Element(tagName, attributes). Add Element#writeAttribute which accepts a hash of attributes or a name/value pair. Closes #7476. [Mislav Marohnić, haraldmartin, Tobie Langel]
* Insertion overhaul: Add Element.insert(content[, position = 'bottom']). Deprecate Insertion (kept for backwards compatibility). Make Ajax.Updater option.insertion accept both Insertion.Top or the now preferred 'top'. Closes #7907. [Tobie Langel]
* Refactor Element.extend and eliminate Element.extend.cache. [sam]
* Add Function#curry, Function#delay, Function#defer, and Function#wrap. Closes #8134. [Andrew Dupont, Tobie Langel, sam]
*1.5.1* (May 1, 2007)
* Don't duplicate the event argument in Function#bindAsEventListener. Closes #6497. [wiktor]
* Fix Selector :not-clause chaining. [Andrew Dupont]
*1.5.1_rc4* (April 27, 2007)
* Fix $F breakage from [6598]. [sam]
* Set window.$continue to an Error with a helpful message for anyone who may still be using "throw $continue". [sam]
* Fix jstest.rb IE support so you don't have to close the IE window after each test (yay!). Closes #8207. [Ryan Schuft]
* Fix jstest.rb Konqueror support. Closes #7140. [Christophe Porteneuve]
* Fix regression in which no-argument calls to Element.addMethods() would not add the methods defined in Form.Methods and Form.Element.Methods. Closes #8206. [Tobie Langel, fwittekind]
* Fix Element#readAttribute to work with the 'type' attribute in IE. Closes #8160. [Tobie Langel, Wiktor Ihárosi]
*1.5.1_rc3* (April 24, 2007)
* Add Element#childElements as an alias for Element#immediateDescendants. [Tobie Langel]
* Optimize DOM navigation methods (Element#up, Element#down, Element#previous, Element#next) for no-argument calls. Closes #7848. [haraldmartin, sam]
* Add Element#firstDescendant to retrieve the first non-text child node of an element. [sam]
* Element.addMethods should add methods to Element as well as Element.Methods. Closes #7888. [Andrew Dupont]
* Add support for per-request onCreate callbacks to Ajax.Request. Closes #8011. [Andrew Dupont]
* Don't call evalResponse() when an Ajax response has no Content-type header. Closes #7827. [Tobie Langel]
* Automatically strip security delimiter comments from JSON strings before evaling them. The default delimiter is '/*-secure- ... */' or you can specify your own with the Prototype.JSONFilter regular expression. If you wrap your JSON response bodies in this delimiter on the server side, rogue external sites can't hijack potentially sensitive data via <script> tags. Closes #7910. [Tobie Langel]
For more details on potential security problems, see: http://www.fortifysoftware.com/servlet/downloads/public/JavaScript_Hijacking.pdf
* Add extra spacing so Array#toJSON and Hash#toJSON generate YAML-loadable JSON. Closes #7883. [Andrew Dupont]
* Fix Form.request for forms containing an input element with name="action". Closes #8063. [Thomas Fuchs, Mislav Marohnić]
* Make Event.element extend the returned element. Closes #7870. [Thomas Fuchs]
* Prevent a crash on Safari on String.prototype.stripScripts and extractScripts with large <script> tags. [Thomas Fuchs]
* Prevent linefeed normalisation in String.prototype.escapeHTML and unescapeHTML on IE for consistency with other browsers. Speed optimizations for Safari and IE. [Thomas Fuchs]
* Make Hash.toQueryString serialize undefined values. Ensure consistency with String.prototype.toQueryParams. Closes #7806. [Mislav Marohnić]
Examples:
$H({a:'b',c:undefined}).toQueryString() -> 'a=b&c'
$H({a:'b',c:null}).toQueryString() -> 'a=b&c='
$H('a=b&c'.toQueryParams()).toQueryString() -> 'a=b&c'
$H('a=b&c='.toQueryParams()).toQueryString() -> 'a=b&c='
* Fix issues with Selector an+b logic, :not support, attribute selector double quotes, plus performance improvements. Closes #7873, #7901. [Andrew Dupont]
* Fix Form.disable to work again on non-form elements. Closes #6887. [Mislav Marohnić]
* Fix an issue with String.prototype.endsWith. Closes #7822. [altblue]
*1.5.1_rc2* (March 12, 2007)
* Add a tab character via innerHTML to the selector whitespace test. [Christophe Porteneuve]
* Add an attribution to YUI-Ext's DomQuery in selector.js.
* Make Element.extend work on IE for Nodes with the same ID that where discarded. Closes #7497. [Mislav Marohnić, Thomas Fuchs]
* Make Selector correctly extend the first element it returns on IE. [Thomas Fuchs]
* Prevent a crash in Safari when using $A() on NodeList objects that contain text nodes. [Thomas Fuchs]
* Fix Element.Methods.descendants() to properly extend elements on IE. [Thomas Fuchs]
*1.5.1_rc1* (March 9, 2007)
* Fix readAttribute for IE7. [Andrew Dupont]
*1.5.1_rc0* (March 8, 2007)
* Merge the selector branch into trunk, bringing vast performance improvements, bug fixes, and near-complete CSS3 compliance to $$ and Selector. Closes #7568. [Andrew Dupont]
Selector speed test: http://andrewdupont.net/test/double-dollar/
* Add support for JSON encoding and decoding. Closes #7427. [Tobie Langel]
* Fix double escaping of query parameters in Hash.prototype.toQueryString, and prevent Safari from iterating over shadowed properties when creating hashes. Closes #7421. [Tobie Langel, Mislav Marohnić]
* Fix simulated attribute reading for IE for "href", "src" and boolean attributes. [Mislav Marohnić, Thomas Fuchs]
* Form.Element.disable() will now call blur(), removed blur() call from Form.Element.enable(). Closes #6034. [tdd]
* Optimize document.getElementsByClassName and finalize DOM performance optimization refactoring. Closes #6696. [Mislav Marohnić]
* Fix an issue with serializing empty array inputs. Closes #7516. [stakadush, Mislav Marohnić]
* Add optional third parameter "camelized" to Element.setStyle, for optimized performance if style names are known to be camelCased. [Thomas Fuchs]
* Fix a bug in the simulated hasAttribute for IE due to getAttributeNode sometimes returning null. [sam]
* Optimize Element.getStyle and add new Element.getOpacity method. Special case IE and Opera getStyle methods. Closes #7648. [Tobie Langel, Thomas Fuchs]
* Optimize Element.setStyle and add new Element.setOpacity method, special case IE and Gecko opacity methods. Closes #7585. [savetheclocktower]
* Add unified Browser detection by providing Prototype.Browser.(IE|Gecko|WebKit|Opera) booleans. Closes #6800. [savetheclocktower]
* Add String.prototype.empty and String.prototype.blank (tests if empty or whitespace-only). Closes #7016. [Jonathan Viney, Thomas Fuchs]
* Update README to reflect new URLs, update LICENSE copyright years. Closes #7426. [Tobie Langel]
* Array.prototype.uniq optimization. Closes #7417. [Christophe Porteneuve]
* String.prototype.endsWith should not fail on multiple occurrences. Closes #7416. [Christophe Porteneuve]
* Add Form.Methods.request as a convenience method for serializing and submitting a form via Ajax.Request to the URL in the form's action attribute. [sam]
Options passed to request() are intelligently merged with the underlying Ajax.Request options:
- If the form has a method attribute, its value is used for the Ajax.Request method option. If a method option is passed to request(), it takes precedence over the form's method attribute. If neither is specified, method defaults to "post".
- Key/value pairs specified in the parameters option (either as a query string or as a hash) will be merged with (and take precedence over) the serialized form parameters.
* Fix $(form).serialize() in Safari and add support for extending specific tags to Element.addMethods. Closes #7358. [Andrew Dupont]
* Add String.prototype.startsWith, String.prototype.endsWith, and String.prototype.include. Closes #7075. [Tobie Langel]
* Improve performance of String.prototype.escapeHTML by using a cached div and text node. Closes #6937. [altblue]
* Make setStyle() with opacity: 0 in Internet Explorer work correctly. [Thomas Fuchs]
* Form.Element.activate shouldn't raise an exception when the form or field is hidden. [sam]
* Remove support for "throw $continue" in Enumerable. Use "return" instead. [sam]
* Update HEADER to reflect new URL. [sam]
*1.5.0* (January 18, 2007)