Skip to content

Commit

Permalink
browser(firefox): fix bug in Juggler with clashing method names (#1456)
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov committed Mar 21, 2020
1 parent e210e56 commit 96c9c81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion browser_patches/firefox/BUILD_NUMBER
@@ -1 +1 @@
1045
1046
8 changes: 4 additions & 4 deletions browser_patches/firefox/patches/bootstrap.diff
Expand Up @@ -2698,7 +2698,7 @@ index 0000000000000000000000000000000000000000..be70ea364f9534bb3b344f64970366c3
+
diff --git a/juggler/content/PageAgent.js b/juggler/content/PageAgent.js
new file mode 100644
index 0000000000000000000000000000000000000000..17ddd1ac290baf820bd9aa1b6aaf629f6627dc65
index 0000000000000000000000000000000000000000..fb207d8b39bee7c1365428a171f80c438097d2bb
--- /dev/null
+++ b/juggler/content/PageAgent.js
@@ -0,0 +1,945 @@
Expand Down Expand Up @@ -3316,7 +3316,7 @@ index 0000000000000000000000000000000000000000..17ddd1ac290baf820bd9aa1b6aaf629f
+ if (!unsafeObject.isConnected)
+ throw new Error('Node is detached from document');
+ await this._scrollNodeIntoViewIfNeeded(unsafeObject);
+ const box = this._getBoundingBox(unsafeObject);
+ const box = this._getNodeBoundingBox(unsafeObject);
+ if (rect) {
+ box.x += rect.x;
+ box.y += rect.y;
Expand Down Expand Up @@ -3350,7 +3350,7 @@ index 0000000000000000000000000000000000000000..17ddd1ac290baf820bd9aa1b6aaf629f
+ // TODO: implement.
+ }
+
+ _getBoundingBox(unsafeObject) {
+ _getNodeBoundingBox(unsafeObject) {
+ if (!unsafeObject.getBoxQuads)
+ throw new Error('RemoteObject is not a node');
+ const quads = unsafeObject.getBoxQuads({relativeTo: this._frameTree.mainFrame().domWindow().document});
Expand All @@ -3375,7 +3375,7 @@ index 0000000000000000000000000000000000000000..17ddd1ac290baf820bd9aa1b6aaf629f
+ if (!frame)
+ throw new Error('Failed to find frame with id = ' + frameId);
+ const unsafeObject = this._frameData.get(frame).unsafeObject(objectId);
+ const box = this._getBoundingBox(unsafeObject);
+ const box = this._getNodeBoundingBox(unsafeObject);
+ if (!box)
+ return {boundingBox: null};
+ return {boundingBox: {x: box.x + frame.domWindow().scrollX, y: box.y + frame.domWindow().scrollY, width: box.width, height: box.height}};
Expand Down

0 comments on commit 96c9c81

Please sign in to comment.