MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / resolve

Method resolve

www/js/_hyperscript-max.js:8404–8439  ·  view source on GitHub ↗
(ctx, { target })

Source from the content-addressed store, hash-verified

8402 return new _MeasureCommand(targetExpr, propsToMeasure);
8403 }
8404 resolve(ctx, { target }) {
8405 ctx.meta.runtime.nullCheck(target, this.targetExpr);
8406 if (0 in target) target = target[0];
8407 var rect = target.getBoundingClientRect();
8408 var scroll = {
8409 top: target.scrollTop,
8410 left: target.scrollLeft,
8411 topMax: target.scrollTopMax,
8412 leftMax: target.scrollLeftMax,
8413 height: target.scrollHeight,
8414 width: target.scrollWidth
8415 };
8416 ctx.result = {
8417 x: rect.x,
8418 y: rect.y,
8419 left: rect.left,
8420 top: rect.top,
8421 right: rect.right,
8422 bottom: rect.bottom,
8423 width: rect.width,
8424 height: rect.height,
8425 bounds: rect,
8426 scrollLeft: scroll.left,
8427 scrollTop: scroll.top,
8428 scrollLeftMax: scroll.leftMax,
8429 scrollTopMax: scroll.topMax,
8430 scrollWidth: scroll.width,
8431 scrollHeight: scroll.height,
8432 scroll
8433 };
8434 ctx.meta.runtime.forEach(this.properties, (prop) => {
8435 if (prop in ctx.result) ctx.locals[prop] = ctx.result[prop];
8436 else throw new Error("No such measurement as " + prop);
8437 });
8438 return this.findNext(ctx);
8439 }
8440 };
8441 var FocusCommand = class _FocusCommand extends Command {
8442 static keyword = "focus";

Callers

nothing calls this directly

Calls 3

nullCheckMethod · 0.45
forEachMethod · 0.45
findNextMethod · 0.45

Tested by

no test coverage detected