]> git.gir.st - VimFx.git/commit
Remove misuse of isXULDocument()
authorgirst <girst@users.noreply.github.com>
Sun, 1 Dec 2019 17:57:09 +0000 (18:57 +0100)
committergirst <girst@users.noreply.github.com>
Thu, 5 Dec 2019 20:19:22 +0000 (21:19 +0100)
commitb204c03f7eb3bcc36213eb68b920829a018001e1
tree6ca795bdb8779a94c5eff33660139fa3bb50098e
parente05f376157e06a63264a18418947a07c110018a0
Remove misuse of isXULDocument()

A new isXULElement() has been introduced as a replacement for improper
use of isXULDocument() (where the latter was used to indirectly check
the former). isXULDocument() only works if the xul-xmlns is attached to
the document as its main namespace, which is not the case e.g. on fx72's
about:preferences#sync (the test for which now uses isXULElement).

The test in isProperLink() actually wants to know if an element belongs
to the XUL namespace, not if it is embedded in a document of that NS
(to treat <xul:label is="text-link"> element equivalent to <html:a>).

The blurring condition in events-frame.coffee was introduced in e881629
for about:config, but that does not work any more and is also annoying
on :prefs (and was again an indirect test for what was actually wanted).

In commands-frame.coffee's commands.follow(), two of the three uses of
isXULDocument have been replaced by the proper isXULElement, the third
one is likely to be correct (as there isn't a <body> on xul-<window>s).

This leaves us with 1 remaining unclean use, in commands-frame.coffee's
helper_follow(). It is used to catch all the xul elements that have html
equivalents with different tag names. Replacing that with something
proper will not be attempted in this change, as it would probably
require changing its callers to pass in different arguments when ran in
the XUL namespace.
extension/lib/commands-frame.coffee
extension/lib/events-frame.coffee
extension/lib/utils.coffee
Imprint / Impressum