Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding the checks for the api methods, so we don't do any breaking ch…

…anges, as pointed by arian
  • Loading branch information...
commit 4c916e5e49fe2e6fd191a8332f90a34bde33b8bb 1 parent ed9de97
Fabio M. Costa fabiomcosta authored
Showing with 5 additions and 7 deletions.
  1. +5 −7 Source/Slick.Finder.js
12 Source/Slick.Finder.js
View
@@ -199,9 +199,7 @@ local.setDocument = function(document){
// get attribute
- this.getAttribute = (!this.isHTMLDocument) ? function(node, name){
- return node.getAttribute(name);
- } : (brokenFormAttributeGetter) ? function(node, name){
+ this.getAttribute = (brokenFormAttributeGetter) ? function(node, name){
var method = this.attributeGetters[name];
if (method) return method.call(node);
var attributeNode = node.getAttributeNode(name);
@@ -819,19 +817,19 @@ for (var p in pseudos) local['pseudo:' + p] = pseudos[p];
local.attributeGetters = {
'class': function(){
- return this.className;
+ return this.getAttribute('class') || this.className;
},
'for': function(){
- return this.htmlFor;
+ return ('htmlFor' in this) ? this.htmlFor : this.getAttribute('for');
},
'href': function(){
- return this.getAttribute('href', 2);
+ return ('href' in this) ? this.getAttribute('href', 2) : this.getAttribute('href');
},
'style': function(){
- return this.style.cssText;
+ return (this.style) ? this.style.cssText : this.getAttribute('style');
},
'tabindex': function(){
Please sign in to comment.
Something went wrong with that request. Please try again.