Fix up XPath syntax for proper functioning in Safari (patch from Jacob Potter <jdpott...
authorJoshua Wise <joshua@h2so4.joshuawise.com>
Fri, 4 Dec 2009 13:44:06 +0000 (08:44 -0500)
committerJoshua Wise <joshua@h2so4.joshuawise.com>
Fri, 4 Dec 2009 13:44:06 +0000 (08:44 -0500)
std/toolkit.js

index df2149e..dbc3cc2 100644 (file)
@@ -412,7 +412,7 @@ function unselect_node(node) {
 
 function unselect_all_nodes(container) {
        if(xpath_ok()) {
-               var nodes = xpath_query(container, ".//.[@selected]");
+               var nodes = xpath_query(container, ".//*[@selected]");
                var n; 
                var elems = new Array();
                while((n = nodes.iterateNext())) {
@@ -435,7 +435,7 @@ function unselect_all_nodes(container) {
 /* will check if anything is selected */
 function selection_anything_selected(container) {
        if(xpath_ok()) {
-               var x = xpath_query(container, ".//.[@selected]", XPathResult.ANY_UNORDERED_NODE_TYPE);
+               var x = xpath_query(container, ".//*[@selected]", XPathResult.ANY_UNORDERED_NODE_TYPE);
                return x.singleNodeValue?true:false;
        }
        else {
@@ -454,7 +454,7 @@ function selection_anything_selected(container) {
  */
 function find_first_selected_node(container, needle) {
        if(xpath_ok()&&!needle) {
-               var x = xpath_query(container, ".//.[@selected]", XPathResult.FIRST_ORDERED_NODE_TYPE);
+               var x = xpath_query(container, ".//*[@selected]", XPathResult.FIRST_ORDERED_NODE_TYPE);
                return x.singleNodeValue;
        }
        else {
This page took 0.016101 seconds and 4 git commands to generate.