MCPcopy Create free account
hub / github.com/nodejs/node / consider

Method consider

deps/v8/tools/turbolizer/src/common/view-elements.ts:14–25  ·  view source on GitHub ↗
(element: HTMLElement, doConsider: boolean)

Source from the content-addressed store, hash-verified

12 }
13
14 public consider(element: HTMLElement, doConsider: boolean): void {
15 if (!doConsider) return;
16 const newScrollTop = this.computeScrollTop(element);
17 if (isNaN(newScrollTop)) {
18 console.warn("New scroll top value is NaN");
19 }
20 if (this.scrollTop === undefined) {
21 this.scrollTop = newScrollTop;
22 } else {
23 this.scrollTop = Math.min(this.scrollTop, newScrollTop);
24 }
25 }
26
27 public apply(doApply: boolean): void {
28 if (!doApply || this.scrollTop === undefined) return;

Callers 4

updateSelectionMethod · 0.95
selectElementsMethod · 0.95
updateSelectionMethod · 0.95
updateSelectionMethod · 0.95

Calls 3

computeScrollTopMethod · 0.95
warnMethod · 0.80
minMethod · 0.45

Tested by

no test coverage detected