Skip to content

Commit 0e244a9

Browse files
Lightning00BladeDevtools-frontend LUCI CQ
authored andcommitted
Remove NonDom when Debugging
When using the in page selector this are not handled correctly and pollute the section so that you don't get any data for the searched element. Bug: none Change-Id: Id4038d9cc93b88f1039b15751db08135efc5fa4b Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7653945 Reviewed-by: Danil Somsikov <dsv@chromium.org> Auto-Submit: Nikolay Vitkov <nvitkov@chromium.org> Commit-Queue: Danil Somsikov <dsv@chromium.org>
1 parent e0d964c commit 0e244a9

1 file changed

Lines changed: 0 additions & 32 deletions

File tree

front_end/ui/visual_logging/Debugging.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ let veDebuggingEnabled = false;
1313
let debugOverlay: HTMLElement|null = null;
1414
let debugPopover: HTMLElement|null = null;
1515
const highlightedElements: HTMLElement[] = [];
16-
const nonDomDebugElements = new WeakMap<Loggable, HTMLElement>();
1716
let onInspect: ((query: string) => void)|undefined = undefined;
1817

1918
function ensureDebugOverlay(): void {
@@ -96,8 +95,6 @@ export function processForDebugging(loggable: Loggable): void {
9695
}
9796
if (loggable instanceof HTMLElement) {
9897
processElementForDebugging(loggable, loggingState);
99-
} else {
100-
processNonDomLoggableForDebugging(loggable, loggingState);
10198
}
10299
}
103100

@@ -409,35 +406,6 @@ function processImpressionsForAdHocAnalysisDebugLog(states: LoggingState[]): voi
409406
}
410407
}
411408

412-
function processNonDomLoggableForDebugging(loggable: Loggable, loggingState: LoggingState): void {
413-
let debugElement = nonDomDebugElements.get(loggable);
414-
if (!debugElement) {
415-
debugElement = document.createElement('div');
416-
debugElement.classList.add('ve-debug');
417-
debugElement.style.background = 'black';
418-
debugElement.style.color = 'white';
419-
debugElement.style.zIndex = '100000';
420-
debugElement.textContent = debugString(loggingState.config);
421-
nonDomDebugElements.set(loggable, debugElement);
422-
setTimeout(() => {
423-
if (!loggingState.size?.width || !loggingState.size?.height) {
424-
debugElement?.parentElement?.removeChild(debugElement);
425-
nonDomDebugElements.delete(loggable);
426-
}
427-
}, 10000);
428-
}
429-
const parentDebugElement =
430-
parent instanceof HTMLElement ? parent : nonDomDebugElements.get(parent as Loggable) || debugPopover;
431-
assertNotNullOrUndefined(parentDebugElement);
432-
if (!parentDebugElement.classList.contains('ve-debug')) {
433-
debugElement.style.position = 'absolute';
434-
parentDebugElement.insertBefore(debugElement, parentDebugElement.firstChild);
435-
} else {
436-
debugElement.style.marginLeft = '10px';
437-
parentDebugElement.appendChild(debugElement);
438-
}
439-
}
440-
441409
function elementKey(config: LoggingConfig): string {
442410
return `${VisualElements[config.ve]}${config.context ? `: ${config.context}` : ''}`;
443411
}

0 commit comments

Comments
 (0)