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

Method resolve

www/js/_hyperscript.js:8405–8440  ·  view source on GitHub ↗
(ctx, { target })

Source from the content-addressed store, hash-verified

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