Commit Graph

280 Commits

Author SHA1 Message Date
Andrew Dupont
3b21105237 Alter event system to use new element storage API rather than have its own global hashtable. 2008-12-14 01:35:49 -06:00
Andrew Dupont
3977e66796 Added Element#store and Element#retrieve for safe, hash-backed storage of element metadata (no memory leaks). Also added Element#getStorage for working with the element's storage hash directly. Hat tip: Mootools. 2008-12-12 23:53:39 -06:00
Tobie Langel
99f74b526a Add caja_builder for optional cajoled tests. 2008-12-12 13:55:28 +01:00
Tobie Langel
52a781ae2a Switch to UnittestJS. 2008-12-11 18:01:31 +01:00
Tobie Langel
7f6b3e81a2 Overwrite Array#concat method for handling the arguments object in Opera. 2008-12-11 17:03:10 +01:00
Tobie Langel
2525b21be2 Reorganized unit tests to match the file structure of the source. 2008-12-11 12:06:00 +01:00
Andrew Dupont
54bf343560 Fix issue where Function#argumentNames returned incorrect results in IE when comments were intermixed with argument names. [#397 state:resolved] 2008-12-11 12:02:26 +01:00
Tobie Langel
413d2fd538 Add support for the Chrome browser in jstest.rb. 2008-09-29 02:32:03 +02:00
Tobie Langel
41ef42e033 Unit test lib reorganizing. 2008-09-08 01:53:46 -07:00
Tobie Langel
26ca9c3969 Add missing var declarations in unit tests. 2008-09-08 00:48:24 -07:00
Andrew Dupont
d88c25fd47 Ensure Object.isElement handles "falsy" values properly. 2008-09-07 19:26:21 -07:00
Tobie Langel
c01d1a26f7 Fix exiting test task on INT signal. 2008-09-07 19:25:11 -07:00
Tobie Langel
32628d41cd Fix unit test freeze in IE. 2008-09-07 19:21:52 -07:00
Andrew Dupont
b31f642e64 Ensure Hash does not return keys from the prototype chain (e.g., constructor, valueOf, toString). 2008-09-07 19:20:38 -07:00
Andrew Dupont
64002a9083 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. 2008-09-07 19:19:21 -07:00
Andrew Dupont
67107651c2 Update DOM unit tests to avoid failing on Element#replace tests in Opera. 2008-09-07 16:53:33 -07:00
jdalton
1d0fb77ec3 Force Element.Methods.Simulated.hasAttribute() to return a boolean value. 2008-09-07 16:30:11 -07:00
Andrew Dupont
b49c572fa0 Stop Form.Element.disable from stealing focus. 2008-09-07 10:58:47 -07:00
Tobie Langel
ae707f4475 Fix an issue where Element#getStyle('height') returns null if the height is set to "auto." 2008-09-03 18:27:04 -07:00
Tobie Langel
919b952ec3 Add unit tests for Element#descendantOf. 2008-09-03 16:42:31 -07:00
Tobie Langel
6847d27509 Form#serializeElements should not serialize file inputs. 2008-09-03 16:33:03 -07:00
Tobie Langel
b4ea2abda1 Element#down on an input element should not raise error. 2008-09-03 14:16:32 -07:00
Tobie Langel
fecdee6f63 More unit tests for Object.isHash. 2008-09-03 12:19:15 -07:00
Tobie Langel
206a4c824f Allow Function#argumentNames to handle line breaks between arguments. 2008-09-03 12:17:53 -07:00
Samuel Lebeau
15b43b7633 Add context argument to Number#times 2008-09-03 11:45:59 -07:00
Thomas Fuchs
49b921a5c7 ignore DS_Store files 2008-09-03 11:45:15 -07:00
Tobie Langel
5a1ef1e05c Fix Function#argumentNames. 2008-09-03 11:44:47 -07:00
Andrew Dupont
2c03d1a837 Amended failing Element#identify test. 2008-09-02 18:48:27 -07:00
Tobie Langel
ba6934ed87 Make Rake auto-generate test/unit/temp directory if it is missing. 2008-09-02 18:40:59 -07:00
Tobie Langel
bf967e3a41 yet more unittest clean-up 2008-09-02 18:22:57 -07:00
Tobie Langel
2d337cf367 Minor modifications to unit tests. 2008-09-02 18:21:18 -07:00
Tobie Langel
cf5d18097e refactored unit tests quite a bit. Added JS and CSS fixtures. 2008-09-02 18:19:41 -07:00
Tobie Langel
81de0e3a77 seperated test files into JS and HTML fixtures. Added Ruby test file builder and test template. 2008-04-16 16:51:20 +02:00
Andrew Dupont
ab8cc48b8d Account for context to assure Element#down, et al., work properly with Selectors API. 2008-03-31 12:51:44 -05:00
Andrew Dupont
ee52460014 Refactored unittest.js so that it does not rely on Selector methods. (Easier to debug Selector test failures.) 2008-03-31 12:07:46 -05:00
Andrew Dupont
03c1530014 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. 2008-03-27 01:18:15 -05:00
Tobie Langel
598387f137 prototype: Prevent Hash#toQueryString from serializing objets. 2008-03-19 13:01:47 +00:00
Tobie Langel
78c4b99df7 prototype: Instanciate Test.Unit.Logger on window load. 2008-03-16 20:00:07 +00:00
Tobie Langel
2ab483b695 prototype: unit tests clean-up. 2008-03-16 19:47:17 +00:00
Tobie Langel
c01cb850c1 prototype: Remove usage of the statement from unit tests. 2008-03-16 18:53:51 +00:00
Tobie Langel
addfdef8ff prototype: Make Element#writeAttribute handle frameborder attribute in IE. Closes #11068. 2008-03-09 08:05:29 +00:00
Tobie Langel
c7e0a3d93c prototype: Make String#unescapeHTML strip tags in IE. Closes #10173. 2008-03-09 07:21:45 +00:00
Tobie Langel
bfee207d1a prototype: Stop form observers in unit tests. Closes #10938. 2008-03-09 07:14:28 +00:00
Tobie Langel
7821b989fe prototype: Avoid breaking Element.prototype in browsers which support it. Closes #11004. 2008-02-04 23:22:18 +00:00
Tobie Langel
2830ac2ac5 prototype: 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. 2008-02-03 22:29:29 +00:00
Tobie Langel
d770a6c704 prototype: Prevent Enumerable#eachSlice from entering into an endless loop if passed an argument smaller than 1. Closes #10665. 2008-02-03 21:08:13 +00:00
Tobie Langel
f4d68350f3 prototype: Allow Selector to correctly detect the presence of namespaced attributes. Closes #10987. 2008-02-03 19:45:32 +00:00
Tobie Langel
ea9d81eea1 prototype: Make Element#absolutize and Element#relativize always return element. Closes #10983. 2008-02-03 19:36:35 +00:00
Andrew Dupont
034d4e1d4a Add tests for Element#descendantOf that deal with dynamically-created elements. [Andrew Dupont] 2008-01-25 22:03:39 +00:00
Andrew Dupont
c24a390c49 Ensure positionedOffset properly considers "position: fixed" elements. Also ensure 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] 2008-01-25 22:02:12 +00:00
Andrew Dupont
ffa0d0943c Roll back the fix for #9609, since it does not work in Opera. Instead, avoid using "valueOf" or "toString" as field names in forms. 2008-01-25 18:54:22 +00:00
Andrew Dupont
a1ec25cddb Prevent DOM node expandos _countedByPrototype and _prototypeEventID from being serialized into (inner|outer)HTML in IE. Closes #10909. [dcpedit, Tobie Langel, Andrew Dupont] 2008-01-25 18:49:40 +00:00
Andrew Dupont
0f97f4ce20 Properly serialize form fields with names that collide with built-in JS properties (like "length" or "toString"). Closes #9609. [gryn, kangax] 2008-01-24 02:24:33 +00:00
Tobie Langel
17cd2f9f8d prototype: Make Object.isArray correctly identify arrays created in another frame. Closes #10374. 2008-01-24 01:33:28 +00:00
Andrew Dupont
7942a9e5c9 Fixed issue where Element#match failed on attribute selectors with single or double quotes. Closes #10067. [Cezary Okupski, Andrew Dupont] 2008-01-23 20:05:17 +00:00
Tobie Langel
a5fe12b9a1 prototype: Add tests for Element#match. 2008-01-23 12:45:28 +00:00
Tobie Langel
b26f4e349e prototype: Fix Element#writeAttribute to work with 'cellspacing' and 'cellpadding' attributes in IE. Closes #9983. 2008-01-23 12:17:26 +00:00
Tobie Langel
02cc9992e9 prototype: Prevent a potential security issue for cross-site ajax requests. 2008-01-23 00:51:25 +00:00
Tobie Langel
dcada47c6d prototype: Test for attribute existence before applying more complex CSS3 selectors. Closes #10870. 2008-01-23 00:33:04 +00:00
Andrew Dupont
c67fe0b2f3 Fixed selector parsing so that "#foo [bar=baz]" is treated the same way as "#foo *[bar=baz]". Closes #10734. [jlukas, kangax, Andrew Dupont] 2008-01-18 04:52:38 +00:00
Andrew Dupont
4753cc82ec Reverted accidental change to dom.html. 2008-01-18 04:33:34 +00:00
Andrew Dupont
89cbe08e1c Fix Element#descendantOf logic in IE. Closes #10413. [martymix, kamil.szot] 2008-01-18 04:31:23 +00:00
Tobie Langel
f530309461 prototype: fix Unit.Test.Assertions#assertHidden message. 2008-01-14 15:37:30 +00:00
Tobie Langel
584acba3b2 prototype: Add Test.Unit.MessageTemplate class. Add flunk, buildMessage and assertBlock methods to Test.Unit.Assertions. Refactor accordingly. 2008-01-14 14:16:27 +00:00
Tobie Langel
ac48714ada prototype: Make Object.inspect more robust. 2008-01-14 01:22:37 +00:00
Tobie Langel
a246e777f5 prototype: Fix Selector.matchElements to allow for coma-separated selectors in Element#up/next/previous and Event#findElement. 2008-01-06 21:49:16 +00:00
Tobie Langel
e9be4660e1 prototype: unittest.js cleanup. 2008-01-06 07:38:02 +00:00
Tobie Langel
c48c1496ec prototype: forgot a semicolon. 2008-01-06 00:44:18 +00:00
Tobie Langel
0008fe4aed prototype: Test.Unit refactoring. Allow running multiple instances of Test.Unit.Runner on the same page. Allow rake to run specific testcases. Closes #10704, #10705, #10706. 2008-01-06 00:34:39 +00:00
Tobie Langel
6f0def19c5 prototype: Add document.loaded, a boolean that is set to true once dom:loaded is fired. 2008-01-04 00:30:53 +00:00
Tobie Langel
b4735bca7c prototype: 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. 2008-01-03 01:50:36 +00:00
Tobie Langel
a427d4a1b0 prototype: jstest.rb cleanup. 2007-12-30 11:16:15 +00:00
Tobie Langel
143b13d069 prototype: Allow WEBrick to simulate slow or dropped connections and to ease Ajax request inspection. 2007-12-30 10:54:34 +00:00
Tobie Langel
5a37860ffb prototype: Ensure creates an empty array when its argument's length is undefined. Closes #10574 2007-12-20 15:47:32 +00:00
Andrew Dupont
c691de7810 Fix the way Selector handles [pseudoclass + combinator] with no space in between. Closes #9696. [kangax, fearphage, Andrew Dupont] 2007-12-20 00:17:24 +00:00
Andrew Dupont
4d3ebf0912 Change document.viewport.getDimensions to exclude scrollbars in all cases. Closes #10148, #9288. [Nick Stackenburg] 2007-12-04 04:28:27 +00:00
Andrew Dupont
3e82a712d1 Changed some unit tests to filter out false test failures in Opera. 2007-12-04 03:58:44 +00:00
Andrew Dupont
f869020f05 Oops, correcting previous checkin 2007-12-04 01:57:26 +00:00
Andrew Dupont
08a68b1b3a Updated a Selector test to reflect a recent bug fix. 2007-12-04 01:53:56 +00:00
Sam Stephenson
769ae42fcc prototype: Ensure that an Ajax.Request's parameters option can be a Hash. Closes #10172. 2007-11-29 00:24:54 +00:00
Andrew Dupont
c85285496b * 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] 2007-11-27 18:43:56 +00:00
Andrew Dupont
b01903d92f * 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] 2007-11-27 18:21:50 +00:00
Andrew Dupont
26b8033295 * Fix a bug in the IE-specific Element#descendantOf logic. [Nicholas, Andrew Dupont] 2007-11-27 17:59:46 +00:00
Thomas Fuchs
6e080aa186 Add a test to check that defer handles arguments correctly 2007-11-23 11:55:42 +00:00
Tobie Langel
23823048d1 prototype: Prevent memory leaks in Ajax.PeriodicalUpdater. Closes #10049 2007-11-15 23:14:36 +00:00
Tobie Langel
b058e24a05 prototype: Make String#isJSON return false for empty or blank strings. Make Ajax.Response#responseJSON null when Ajax.Response#responseText is empty or blank. 2007-11-15 19:37:26 +00:00
Tobie Langel
26b4b3aee5 prototype: add a test to event.html. 2007-11-14 12:49:56 +00:00
Tobie Langel
74c005c678 prototype: Remove the now redundant forked declaration of Hash#_each. 2007-11-14 11:56:15 +00:00
Tobie Langel
0b6a6e2f2f prototype: Ensure Event#fire always returns an extended event. Make Event#findElement's expression argument optional. Perf optimizations for Event#findElement. 2007-11-13 21:48:09 +00:00
Sam Stephenson
9b78edb9de prototype: Fix Class#addMethods for "toString" and "valueOf" methods in Internet Explorer. Closes #9901. 2007-11-06 01:44:24 +00:00
Tobie Langel
d6b843c9cb Ensure Element#hasClassName always returns a boolean. Closes #10075. 2007-11-05 17:43:56 +00:00
Andrew Dupont
8cd85d12a2 Ensure selectors of the form "[href]" (attribute token with no preceding tag name) work properly. Closes #8870. [chao, kangax, Andrew Dupont] 2007-11-05 17:11:41 +00:00
Andrew Dupont
7cf17c7bec Performance optimizations for Element#descendantOf. Costliness should no longer be dependent on the difference in depth between the parent and the child. [Andrew Dupont] 2007-11-01 15:11:52 +00:00
Andrew Dupont
67cf750956 Add event.stopped, a boolean that is set to when Event#stop is called. 2007-10-26 19:15:35 +00:00
Sam Stephenson
18969c5159 prototype: Reset the browser's dimensions to their original settings after running the DOM viewport tests. 2007-10-26 03:10:06 +00:00
Sam Stephenson
1c5e3fe3fb prototype: Fix the test runner for Firefox in Leopard. 2007-10-23 17:41:44 +00:00
Tobie Langel
16127b024a prototype: In IE, allow opacity to be set on elements not yet attached to the document. Closes #9904. 2007-10-22 13:14:56 +00:00
Tobie Langel
0100aee1a0 prototype: Add more tests to Element.update. 2007-10-22 11:30:52 +00:00
Tobie Langel
44c9d8937a prototype: Make the Ajax.Response#headerJSON property correctly decode unicode characters. Closes #9285 2007-10-22 11:20:21 +00:00
Tobie Langel
ba96fa77bf prototype: Minor cosmetic changes to the display of unit tests in terminal. 2007-10-21 01:47:30 +00:00