Variable: xwidget-webkit-activeelement-js

xwidget-webkit-activeelement-js is a variable defined in xwidget.el.gz.

Value

"\nfunction findactiveelement(doc){\n//alert(doc.activeElement.value);\n   if(doc.activeElement.value != undefined){\n      return doc.activeElement;\n   }else{\n        // recurse over the child documents:\n        var frames = doc.getElementsByTagName('frame');\n        for (var i = 0; i < frames.length; i++)\n        {\n                var d = frames[i].contentDocument;\n                 var rv = findactiveelement(d);\n                 if(rv != undefined){\n                    return rv;\n                 }\n        }\n    }\n    return undefined;\n};\n\n\n"

Documentation

Javascript that finds the active element.

Source Code

;; Defined in /usr/src/emacs/lisp/xwidget.el.gz
(defvar xwidget-webkit-activeelement-js"
function findactiveelement(doc){
//alert(doc.activeElement.value);
   if(doc.activeElement.value != undefined){
      return doc.activeElement;
   }else{
        // recurse over the child documents:
        var frames = doc.getElementsByTagName('frame');
        for (var i = 0; i < frames.length; i++)
        {
                var d = frames[i].contentDocument;
                 var rv = findactiveelement(d);
                 if(rv != undefined){
                    return rv;
                 }
        }
    }
    return undefined;
};


"

  "Javascript that finds the active element."
  ;; Yes it's ugly, because:
  ;; - there is apparently no way to find the active frame other than recursion
  ;; - the js "for each" construct misbehaved on the "frames" collection
  ;; - a window with no frameset still has frames.length == 1, but
  ;; frames[0].document.activeElement != document.activeElement
  ;;TODO the activeelement type needs to be examined, for iframe, etc.
  )