INNER CODE UNIT · JavaScript

getAbsolutePosition

w3c/webdriver · issue.js:88

	function getAbsolutePosition(node) {
		let bodyRect = document.body.getBoundingClientRect();
		let nodeRect = node.getBoundingClientRect();
		return {
			top: nodeRect.top - bodyRect.top,
			left: nodeRect.left - bodyRect.left,
		};
	}

	let widget = new class {
		constructor(rootEl) {
			this.parent = rootEl;
			this.el = null;
			this.shown = false;
		}

		show() {
			if (!this.el) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…