From 0e6e95af40222bcd5c0f75312353195138746b6f Mon Sep 17 00:00:00 2001 From: girst Date: Thu, 21 Nov 2019 14:10:44 +0100 Subject: [PATCH] getAnonymousNodes() and getBindingParent() removed from fx72 see also: https://bugzil.la/1596800 the whole XULDocument code path in markable-elements.coffee::getAllElements() is now obsolete, since getAnonymousNodes() no longer exists, and before that, returned nothing of importance, since most XBL bindings have been removed before Firefox 68. Removal of the code path will follow in a follow up to ease a possible revert, since a very small amount of hints might get lost in 68esr without it (the only concrete example I've found is the urlbar in 'eb' mode, which can also be reached with 'o'). --- extension/lib/markable-elements.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extension/lib/markable-elements.coffee b/extension/lib/markable-elements.coffee index 8644e36..3885612 100644 --- a/extension/lib/markable-elements.coffee +++ b/extension/lib/markable-elements.coffee @@ -68,13 +68,14 @@ findAllDOMs = (dom) -> ) getAllElements = (document, selector) -> - unless utils.isXULDocument(document) + unless utils.isXULDocument(document) and document.getAnonymousNodes? return [].concat( findAllDOMs(document).map((d) -> Array.from(d.querySelectorAll(selector)) )... ) + # Note: getAnonymousNodes() has been removed from fx72. FIXME: remove. # Use a `Set` since this algorithm may find the same element more than once. # Ideally we should find a way to find all elements without duplicates. elements = new Set() @@ -322,7 +323,8 @@ tryPoint = (elementData, elementRect, x, dx, y, dy, tryRight = 0) -> # The same is true for Web Components (where their hosts are returned), with # the further caveat that they might be nested. normalize = (element) -> - element = elem while (elem = element.ownerDocument.getBindingParent(element))? + element = elem while (elem = element.ownerDocument.getBindingParent(element))? # =fx72 element = element.parentNode while element.prefix? return element -- 2.39.3