releasePointerCapture() not working for implicit capture; can't opt-in to pointerente...
[WebKit-https.git] / LayoutTests / pointerevents / utils.js
index 6cfc3a9..15c38f4 100644 (file)
@@ -18,20 +18,24 @@ function target_test(...args)
     options.height = options.height || "100%";
 
     async_test(test => {
-        const target = document.body.appendChild(document.createElement("div"));
-        target.setAttribute("style", `
-            position: absolute;
-            left: ${options.x};
-            top: ${options.y};
-            width: ${options.width};
-            height: ${options.height};
-        `);
-        test.add_cleanup(() => target.remove());
-
-        continutation(target, test);
+        continutation(makeTarget(test, options), test);
     }, description);
 }
 
+function makeTarget(test, options)
+{
+    const target = document.body.appendChild(document.createElement("div"));
+    target.setAttribute("style", `
+        position: absolute;
+        left: ${options.x};
+        top: ${options.y};
+        width: ${options.width};
+        height: ${options.height};
+    `);
+    test.add_cleanup(() => target.remove());
+    return target;
+}
+
 class EventTracker
 {
     constructor(target, eventNames)