Changeset 8656
- Timestamp:
- 01/18/08 04:52:38 (9 months ago)
- Files:
-
- spinoffs/prototype/trunk/CHANGELOG (modified) (1 diff)
- spinoffs/prototype/trunk/src/selector.js (modified) (3 diffs)
- spinoffs/prototype/trunk/test/unit/selector.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinoffs/prototype/trunk/CHANGELOG
r8654 r8656 1 1 *SVN* 2 3 * Fixed selector parsing so that "#foo [bar=baz]" is treated the same way as "#foo *[bar=baz]". Closes #10734. [jlukas, kangax, Andrew Dupont] 2 4 3 5 * Fix Element#descendantOf logic in IE. Closes #10413. [martymix, kamil.szot] spinoffs/prototype/trunk/src/selector.js
r8580 r8656 242 242 243 243 criteria: { 244 tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;',245 className: 'n = h.className(n, r, "#{1}", c); c = false;',246 id: 'n = h.id(n, r, "#{1}", c); c = false;',247 attrPresence: 'n = h.attrPresence(n, r, "#{1}" ); c = false;',244 tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;', 245 className: 'n = h.className(n, r, "#{1}", c); c = false;', 246 id: 'n = h.id(n, r, "#{1}", c); c = false;', 247 attrPresence: 'n = h.attrPresence(n, r, "#{1}", c); c = false;', 248 248 attr: function(m) { 249 249 m[3] = (m[5] || m[6]); 250 return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}" ); c = false;').evaluate(m);250 return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m); 251 251 }, 252 252 pseudo: function(m) { … … 458 458 }, 459 459 460 attrPresence: function(nodes, root, attr ) {460 attrPresence: function(nodes, root, attr, combinator) { 461 461 if (!nodes) nodes = root.getElementsByTagName("*"); 462 if (nodes && combinator) nodes = this[combinator](nodes); 462 463 var results = []; 463 464 for (var i = 0, node; node = nodes[i]; i++) … … 466 467 }, 467 468 468 attr: function(nodes, root, attr, value, operator ) {469 attr: function(nodes, root, attr, value, operator, combinator) { 469 470 if (!nodes) nodes = root.getElementsByTagName("*"); 471 if (nodes && combinator) nodes = this[combinator](nodes); 470 472 var handler = Selector.operators[operator], results = []; 471 473 for (var i = 0, node; node = nodes[i]; i++) { spinoffs/prototype/trunk/test/unit/selector.html
r8580 r8656 185 185 assertEnumEqual($$('*[type=checkbox]'), $$('[type=checkbox]')); 186 186 assertEnumEqual($('with_title', 'commaParent'), $$('[title]')); 187 assertEnumEqual($$('#troubleForm *[type=radio]'), $$('#troubleForm [type=radio]')); 188 assertEnumEqual($$('#troubleForm *[type]'), $$('#troubleForm [type]')); 187 189 }}, 188 190