Commit 03d95530 authored by Dave Methvin's avatar Dave Methvin

Remove the rarely-used pseudos from quickis.html

The cutting will continue until file size is improved.
parent 61511d5a
...@@ -7,20 +7,14 @@ var rnamespaces = /\.(.*)$/, ...@@ -7,20 +7,14 @@ var rnamespaces = /\.(.*)$/,
rescape = /[^\w\s.|`]/g, rescape = /[^\w\s.|`]/g,
rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
rhoverHack = /\bhover(\.\S+)?/, rhoverHack = /\bhover(\.\S+)?/,
rquickIs = /^([\w\-]+)?(?:#([\w\-]+))?(?:\.([\w\-]+))?(?:\[([\w+\-]+)=["']?([\w\-]*)["']?\])?(?::(first-child|last-child|empty))?$/, rquickIs = /^([\w\-]+)?(?:#([\w\-]+))?(?:\.([\w\-]+))?(?:\[([\w+\-]+)=["']?([\w\-]*)["']?\])?$/,
quickPseudoMap = {
"empty": "firstChild",
"first-child": "previousSibling",
"last-child": "nextSibling"
},
quickParse = function( selector ) { quickParse = function( selector ) {
var quick = rquickIs.exec( selector ); var quick = rquickIs.exec( selector );
if ( quick ) { if ( quick ) {
// 0 1 2 3 4 5 6 // 0 1 2 3 4 5
// [ _, tag, id, class, attrName, attrValue, :(empty first-child last-child) ] // [ _, tag, id, class, attrName, attrValue ]
quick[1] = ( quick[1] || "" ).toLowerCase(); quick[1] = ( quick[1] || "" ).toLowerCase();
quick[3] = quick[3] && new RegExp( "\\b" + quick[3] + "\\b" ); quick[3] = quick[3] && new RegExp( "\\b" + quick[3] + "\\b" );
quick[6] = quickPseudoMap[ quick[6] ];
} }
return quick; return quick;
}, },
...@@ -29,8 +23,7 @@ var rnamespaces = /\.(.*)$/, ...@@ -29,8 +23,7 @@ var rnamespaces = /\.(.*)$/,
(!m[1] || elem.nodeName.toLowerCase() === m[1]) && (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
(!m[2] || elem.id === m[2]) && (!m[2] || elem.id === m[2]) &&
(!m[3] || m[3].test( elem.className )) && (!m[3] || m[3].test( elem.className )) &&
(!m[4] || elem.getAttribute( m[4] ) == m[5]) && (!m[4] || elem.getAttribute( m[4] ) == m[5])
(!m[6] || !elem[ m[6] ])
); );
}, },
useNativeMethod = function( event ) { useNativeMethod = function( event ) {
......
...@@ -2337,7 +2337,7 @@ test(".on and .off", function() { ...@@ -2337,7 +2337,7 @@ test(".on and .off", function() {
}); });
test("delegated events quickIs", function() { test("delegated events quickIs", function() {
expect(23); expect(17);
var markup = jQuery( var markup = jQuery(
'<div>'+ '<div>'+
'<p class="D">'+ '<p class="D">'+
...@@ -2369,19 +2369,16 @@ test("delegated events quickIs", function() { ...@@ -2369,19 +2369,16 @@ test("delegated events quickIs", function() {
.on( "blink", "p.d", func ) .on( "blink", "p.d", func )
.on( "blink", "[devo=cool]", func ) .on( "blink", "[devo=cool]", func )
.on( "blink", "[devo='NO']", func ) .on( "blink", "[devo='NO']", func )
.on( "blink", "#famous", func ) .on( "blink", "#famous", func );
.on( "blink", "em:empty", func )
.on( "blink", ":first-child", func )
.on( "blink", "em:last-child", func );
check( "[devo=cool]", "b|[devo=cool] p|.D p|:first-child" ); check( "[devo=cool]", "b|[devo=cool] p|.D" );
check( "[devo='']", "" ); check( "[devo='']", "" );
check( "p", "p|.D p|:first-child" ); check( "p", "p|.D" );
check( "b", "b|[devo=cool] p|.D p|:first-child" ); check( "b", "b|[devo=cool] p|.D" );
check( "em", "em|em q|#famous em|em em|em:empty em|em:last-child q|#famous" ); check( "em", "em|em q|#famous em|em q|#famous" );
markup.find( "b" ).attr( "devo", "NO" ); markup.find( "b" ).attr( "devo", "NO" );
check( "b", "b|[devo='NO'] p|.D p|:first-child" ); check( "b", "b|[devo='NO'] p|.D" );
markup.remove(); markup.remove();
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment