-
Notifications
You must be signed in to change notification settings - Fork 955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core: Drop workarounds for unsupported browsers #267
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* Released under the MIT license | ||
* http://jquery.org/license | ||
* | ||
* Date: 2014-05-22 | ||
* Date: 2014-06-11 | ||
*/ | ||
(function( window ) { | ||
|
||
|
@@ -236,7 +236,7 @@ function Sizzle( selector, context, results, seed ) { | |
return results; | ||
|
||
// Speed-up: Sizzle(".CLASS") | ||
} else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { | ||
} else if ( (m = match[3]) && support.getElementsByClassName ) { | ||
push.apply( results, context.getElementsByClassName( m ) ); | ||
return results; | ||
} | ||
|
@@ -509,17 +509,8 @@ setDocument = Sizzle.setDocument = function( node ) { | |
return !div.getElementsByTagName("*").length; | ||
}); | ||
|
||
// Check if getElementsByClassName can be trusted | ||
support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { | ||
div.innerHTML = "<div class='a'></div><div class='a i'></div>"; | ||
|
||
// Support: Safari<4 | ||
// Catch class over-caching | ||
div.firstChild.className = "i"; | ||
// Support: Opera<10 | ||
// Catch gEBCN failure to find non-leading classes | ||
return div.getElementsByClassName("i").length === 2; | ||
}); | ||
// Support: IE<9 | ||
support.getElementsByClassName = rnative.test( doc.getElementsByClassName ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you meant There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Err, I guess either works. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if there's a browser that has it on document but not elements. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just left what was here before so it should work. ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okies |
||
|
||
// Support: IE<10 | ||
// Check if getElementById returns elements by name | ||
|
@@ -588,7 +579,7 @@ setDocument = Sizzle.setDocument = function( node ) { | |
|
||
// Class | ||
Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { | ||
if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { | ||
if ( documentIsHTML ) { | ||
return context.getElementsByClassName( className ); | ||
} | ||
}; | ||
|
@@ -1969,7 +1960,7 @@ select = Sizzle.select = function( selector, context, results, seed ) { | |
// Sort stability | ||
support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; | ||
|
||
// Support: Chrome<14 | ||
// Support: Chrome 14-35+ | ||
// Always assume duplicates if they aren't passed to the comparison function | ||
support.detectDuplicates = !!hasDuplicate; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't drop the
rnative
test. This avoids oldIE attempting to call a method that doesn't exist.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we're lacking tests here then since the test suite passes in oldIE on my branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Errors of that nature have been hard to pin down in tests, which is why we've adopted the style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it works because in both cases where
getElementsByClassName
is used there's a check if it exists.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but that kind of check has shown to be problematic. In jQuery, we use
typeof
. In Sizzle, we usernative
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we don't support
getElementsByClassName
polyfills.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Speaking of, looks like some jQuery flavor made it into the
CLASS
find method (typeof). Let's change that to usernative
as well for consistency.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK