Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8709

Show
Ignore:
Timestamp:
01/23/08 20:05:17 (7 months ago)
Author:
andrew
Message:

Fixed issue where Element#match failed on attribute selectors with single or double quotes. Closes #10067. [Cezary Okupski, Andrew Dupont]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spinoffs/prototype/trunk/CHANGELOG

    r8704 r8709  
    11*SVN* 
     2 
     3* Fixed issue where Element#match failed on attribute selectors with single or double quotes. Closes #10067. [Cezary Okupski, Andrew Dupont] 
    24 
    35* Add tests for Element#match.  [Tobie Langel] 
  • spinoffs/prototype/trunk/src/selector.js

    r8692 r8709  
    298298    attr: function(element, matches) { 
    299299      var nodeValue = Element.readAttribute(element, matches[1]); 
    300       return nodeValue && Selector.operators[matches[2]](nodeValue, matches[3]); 
     300      return nodeValue && Selector.operators[matches[2]](nodeValue, matches[5] || matches[6]); 
    301301    }     
    302302  }, 
  • spinoffs/prototype/trunk/test/unit/selector.html

    r8704 r8709  
    250250      assert(!$('link_2').match('a[rel^=external]')); 
    251251      assert($('link_1').match('a[rel^=external]')); 
     252      assert($('link_1').match('a[rel^="external"]')); 
     253      assert($('link_1').match("a[rel^='external']")); 
    252254       
    253255      assert(span.match({ match: function(element) { return true }}), 'custom selector');