Permalink
Browse files

improving the speed on xml documents on non-ie browsers by checking f…

…or the real document-feature that made us create 2 versions of getUID, expando creation on nodes. It is supported on all browser but IE.
  • Loading branch information...
1 parent 77e3967 commit a69e4291666ff17885879f79e0816ed4532f5b64 @fabiomcosta fabiomcosta committed Feb 20, 2011
Showing with 9 additions and 3 deletions.
  1. +9 −3 Source/Slick.Finder.js
View
@@ -170,6 +170,14 @@ local.setDocument = function(document){
}
+ try {
+ root.slick_expando = 1;
+ delete root.slick_expando;
+ features.getUID = this.getUIDHTML;
+ } catch(e) {
+ features.getUID = this.getUIDXML;
+ }
+
testRoot.removeChild(testNode);
testNode = selected = testRoot = null;
@@ -226,8 +234,6 @@ local.setDocument = function(document){
return aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
} : null ;
- features.getUID = (features.isHTMLDocument) ? this.getUIDHTML : this.getUIDXML;
-
root = null;
for (feature in features){
@@ -440,7 +446,7 @@ local.search = function(context, expression, append, first){
// Utils
local.uidx = 1;
-local.uidk = 'slick:uniqueid';
+local.uidk = 'slick-uniqueid';
local.getUIDXML = function(node){
var uid = node.getAttribute(this.uidk);

0 comments on commit a69e429

Please sign in to comment.