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

Changeset 8692

Show
Ignore:
Timestamp:
01/23/08 00:33:04 (7 months ago)
Author:
tobie
Message:

prototype: Test for attribute existence before applying more complex CSS3 selectors. Closes #10870.

Files:

Legend:

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

    r8691 r8692  
    11*SVN* 
    22 
    3 * Fix "function $A" declaration inside of a conditional (confuses IE). Fixes #10882. [Jacco, Andrew Dupont] 
     3* Test for attribute existence before applying more complex CSS3 selectors. Closes #10870. [arty, Tobie Langel] 
     4 
     5* Fix "function $A" declaration inside of a conditional (confuses IE). Closes #10882. [Jacco, Andrew Dupont] 
    46 
    57* Fixed selector parsing so that "#foo [bar=baz]" is treated the same way as "#foo *[bar=baz]". Closes #10734. [jlukas, kangax, Andrew Dupont] 
  • spinoffs/prototype/trunk/src/selector.js

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

    r8656 r8692  
    246246      assert(!span.match('span > span'), 'different parent'); 
    247247      assert(!span.match('span:nth-child(5)'), 'different pseudoclass'); 
     248       
     249      assert(!$('link_2').match('a[rel^=external]')); 
     250      assert($('link_1').match('a[rel^=external]')); 
    248251    }}, 
    249252