git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
using parseFloat for offset and position methods and removed num helper method
[jquery.git]
/
src
/
selector.js
diff --git
a/src/selector.js
b/src/selector.js
index
48aeea5
..
2fa8e5d
100644
(file)
--- a/
src/selector.js
+++ b/
src/selector.js
@@
-65,7
+65,7
@@
var Sizzle = function(selector, context, results, seed) {
if ( context ) {
var ret = seed ?
{ expr: parts.pop(), set: makeArray(seed) } :
if ( context ) {
var ret = seed ?
{ expr: parts.pop(), set: makeArray(seed) } :
- Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, contextXML );
+ Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
if ( parts.length > 0 ) {
set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
if ( parts.length > 0 ) {
@@
-656,7
+656,7
@@
var Expr = Sizzle.selectors = {
var origPOS = Expr.match.POS;
for ( var type in Expr.match ) {
var origPOS = Expr.match.POS;
for ( var type in Expr.match ) {
- Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
+ Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
}
var makeArray = function(array, results) {
}
var makeArray = function(array, results) {
@@
-735,9
+735,9
@@
if ( document.documentElement.compareDocumentPosition ) {
// querying by getElementById (and provide a workaround)
(function(){
// We're going to inject a fake input element with a specified name
// querying by getElementById (and provide a workaround)
(function(){
// We're going to inject a fake input element with a specified name
- var form = document.createElement("form"),
+ var form = document.createElement("div"),
id = "script" + (new Date).getTime();
id = "script" + (new Date).getTime();
- form.innerHTML = "<input name='" + id + "'/>";
+ form.innerHTML = "<a name='" + id + "'/>";
// Inject it into the root element, check its status, and remove it quickly
var root = document.documentElement;
// Inject it into the root element, check its status, and remove it quickly
var root = document.documentElement;
@@
-826,10
+826,9
@@
if ( document.querySelectorAll ) (function(){
return oldSizzle(query, context, extra, seed);
};
return oldSizzle(query, context, extra, seed);
};
- Sizzle.find = oldSizzle.find;
- Sizzle.filter = oldSizzle.filter;
- Sizzle.selectors = oldSizzle.selectors;
- Sizzle.matches = oldSizzle.matches;
+ for ( var prop in oldSizzle ) {
+ Sizzle[ prop ] = oldSizzle[ prop ];
+ }
})();
if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
})();
if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
@@
-941,7
+940,7
@@
var contains = document.compareDocumentPosition ? function(a, b){
var isXML = function(elem){
return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
var isXML = function(elem){
return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
- !!elem.ownerDocument && isXML( elem.ownerDocument );
+ !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML";
};
var posProcess = function(selector, context){
};
var posProcess = function(selector, context){