From ae979a966541ba1a9eb493bbff235f2e8b83f06e Mon Sep 17 00:00:00 2001 From: jahorton Date: Mon, 24 May 2021 10:59:54 +0700 Subject: [PATCH] chore(web): removes diagnostic breadcrumbing --- web/source/dom/touchAliasElement.ts | 53 ----------------------------- 1 file changed, 53 deletions(-) diff --git a/web/source/dom/touchAliasElement.ts b/web/source/dom/touchAliasElement.ts index a80d9cc21e..b8940f5aba 100644 --- a/web/source/dom/touchAliasElement.ts +++ b/web/source/dom/touchAliasElement.ts @@ -34,52 +34,6 @@ namespace com.keyman.dom { // Not to be confused with the simulated scrollbar. let scroller: HTMLElement; - // Designed to 'breadcrumb' elements to assist in diagnosis of an evasive known issue. - let elementLogger = function() { - let elementDescriber = function(element: HTMLElement) { - if(element) { - let childIndex = undefined; - let parent = element.parentElement; - if(parent) { - for(let child = parent.firstChild, i = 0; child; child = child.nextSibling, i++) { - if(child == element) { - childIndex = i; - break; - } - } - } - - // ID: should never be specified for TouchAliasElement components - // Class: specified for the root TouchAliasElement and for its text spans - // index: useful for identifying elements with no class info - return `tag type ${element.tagName}, class '${element.classList}', index under parent: '${childIndex}', id '${element.id}'`; - } else { - return `null`; - } - }; - - // Very rough breadcrumbs for use with any Sentry logs. - - // We'd expect to see the telltale 'keymanweb-input' appear as the class for one of the - // three elements logged here... at least, normally. - console.info(`(For diagnosing https://github.com/keymanapp/keyman/issues/4797)`); - // We don't use .innerHTML because that would tell us what the user's been typing. - // No keylogging! - console.info(`Original target: ${elementDescriber(target)}`); - if(target.previousSibling && target.previousSibling instanceof HTMLElement) { - console.info(`Previous sibling: ${elementDescriber(target.previousSibling)}`); - } - if(target.nextSibling && target.nextSibling instanceof HTMLElement) { - console.info(`Next sibling: ${elementDescriber(target.nextSibling)}`); - } - console.info(`Target's parent: ${elementDescriber(target.parentElement)}`); - if(target.parentElement instanceof HTMLElement) { - console.info(`Target's grandparent: ${elementDescriber(target.parentElement.parentElement)}`); - } - // Triggers the actual Sentry log (on pages that include Sentry logging) - //throw new Error(`Unexpected touch-start event target.`); - }; - // Identify the scroller element if(target && dom.Utils.instanceof(target, "HTMLSpanElement")) { scroller=target.parentNode as HTMLElement; @@ -101,12 +55,6 @@ namespace com.keyman.dom { return target['kmw_ip'] as TouchAliasElement; } else { // If it's not in any way related to a TouchAliasElement, simply return null. - // NOTE: At present, this method should only be called in places that actually EXPECT a TouchAliasElement... - // So if we fail to find one, something's gone wrong, and we'd like more details. - - // There's an evasive error related to this at present so we'll temporarily console-log info - // that may help us determine why we couldn't find the expected element. - elementLogger(); return null; } @@ -115,7 +63,6 @@ namespace com.keyman.dom { if(root['base'] !== undefined) { return root as TouchAliasElement; } else { - elementLogger(); return null; } }