generate_hints: check for doc.documentElement
commitbab484d689f8aac65bd83614653065f16cb50d88
authorJohn Foerch <jjfoerch@earthlink.net>
Sun, 18 Sep 2011 20:31:08 +0000 (18 16:31 -0400)
committerJohn Foerch <jjfoerch@earthlink.net>
Sun, 18 Sep 2011 20:31:08 +0000 (18 16:31 -0400)
treeddb0ee2c2638ab745f04350b815553dab7f10de6
parent988a892b4b04df0a77d4f8f01c25b6dccf3d95dc
generate_hints: check for doc.documentElement

Examples have been found in the wild, with XULRunner 6, and possibly other
versions, of DOM documents that have no 'documentElement' property.  Such
cause generate_hints to fail, leaving the hints minibuffer in an
inconsistent state where it does not close properly and shows the message
'this.manager is null' when you hit any key.

This patch was tested as follows:

 1. visit http://www.linuxforums.org/forum/networking/171407-openvpn-2-1-auth-user-pass.html

 2. make sure the full-screen ad comes up over the website.  if it does
    not, make a new profile and start over.

 3. use the delete command (d) to start deleting nodes, in an attempt to
    remove the full-screen ad.  after deleting 3 or 4 nodes, the problem
    appears.

It should be noted that this may not be the best possible test case for
this problem because it depends on the particular design of an advertising
feature on a website likely to change in the future.  But there you have
it.
modules/hints.js