| 7953 | return new _MeasureCommand(targetExpr, propsToMeasure); |
| 7954 | } |
| 7955 | resolve(ctx, { target }) { |
| 7956 | ctx.meta.runtime.nullCheck(target, this.targetExpr); |
| 7957 | if (0 in target) target = target[0]; |
| 7958 | var rect = target.getBoundingClientRect(); |
| 7959 | var scroll = { |
| 7960 | top: target.scrollTop, |
| 7961 | left: target.scrollLeft, |
| 7962 | topMax: target.scrollTopMax, |
| 7963 | leftMax: target.scrollLeftMax, |
| 7964 | height: target.scrollHeight, |
| 7965 | width: target.scrollWidth |
| 7966 | }; |
| 7967 | ctx.result = { |
| 7968 | x: rect.x, |
| 7969 | y: rect.y, |
| 7970 | left: rect.left, |
| 7971 | top: rect.top, |
| 7972 | right: rect.right, |
| 7973 | bottom: rect.bottom, |
| 7974 | width: rect.width, |
| 7975 | height: rect.height, |
| 7976 | bounds: rect, |
| 7977 | scrollLeft: scroll.left, |
| 7978 | scrollTop: scroll.top, |
| 7979 | scrollLeftMax: scroll.leftMax, |
| 7980 | scrollTopMax: scroll.topMax, |
| 7981 | scrollWidth: scroll.width, |
| 7982 | scrollHeight: scroll.height, |
| 7983 | scroll |
| 7984 | }; |
| 7985 | ctx.meta.runtime.forEach(this.properties, (prop) => { |
| 7986 | if (prop in ctx.result) ctx.locals[prop] = ctx.result[prop]; |
| 7987 | else throw new Error("No such measurement as " + prop); |
| 7988 | }); |
| 7989 | return this.findNext(ctx); |
| 7990 | } |
| 7991 | }; |
| 7992 | var FocusCommand = class _FocusCommand extends Command { |
| 7993 | static keyword = "focus"; |