Changeset 6563
- Timestamp:
- 04/24/07 06:17:59 (1 year ago)
- Files:
-
- spinoffs/prototype/trunk/CHANGELOG (modified) (1 diff)
- spinoffs/prototype/trunk/src/dom.js (modified) (1 diff)
- spinoffs/prototype/trunk/test/unit/dom.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinoffs/prototype/trunk/CHANGELOG
r6562 r6563 1 1 *SVN* 2 3 * Add Element#childElements as an alias for Element#immediateDescendants. [Tobie Langel] 2 4 3 5 * Optimize DOM navigation methods (Element#up, Element#down, Element#previous, Element#next) for no-argument calls. Closes #7848. [haraldmartin, sam] spinoffs/prototype/trunk/src/dom.js
r6562 r6563 427 427 }; 428 428 429 Object.extend(Element.Methods, {childOf: Element.Methods.descendantOf}); 429 Object.extend(Element.Methods, { 430 childOf: Element.Methods.descendantOf, 431 childElements: Element.Methods.immediateDescendants 432 }); 430 433 431 434 if (Prototype.Browser.Opera) { spinoffs/prototype/trunk/test/unit/dom.html
r6562 r6563 485 485 }}, 486 486 487 testElement ImmediateDescendants: function() {with(this) {488 assertElementsMatch($('navigation_test'). immediateDescendants(),487 testElementChildElements: function() {with(this) { 488 assertElementsMatch($('navigation_test').childElements(), 489 489 'li.first', 'li', 'li#navigation_test_c', 'li.last'); 490 490 assertNotEqual(0, $('navigation_test_next_sibling').childNodes.length); 491 assertEnumEqual([], $('navigation_test_next_sibling'). immediateDescendants());491 assertEnumEqual([], $('navigation_test_next_sibling').childElements()); 492 492 493 493 var dummy = $(document.createElement('DIV')); 494 494 dummy.innerHTML = '<div></div>'.times(3); 495 assert(typeof dummy.immediateDescendants()[0].setStyle == 'function'); 496 }}, 495 assert(typeof dummy.childElements()[0].setStyle == 'function'); 496 }}, 497 498 testElementImmediateDescendants: function() {with(this) { 499 assertIdentical(Element.Methods.childElements, Element.Methods.immediateDescendants); 500 }}, 497 501 498 502 testElementPreviousSiblings: function() {with(this) {