Skip to content

Commit

Permalink
browser(firefox): ensure rendering update before taking quads and scr…
Browse files Browse the repository at this point in the history
…olling (#2123)
  • Loading branch information
dgozman authored May 6, 2020
1 parent 41de5bc commit 10cca04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion browser_patches/firefox/BUILD_NUMBER
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1089
1090
8 changes: 6 additions & 2 deletions browser_patches/firefox/patches/bootstrap.diff
Original file line number Diff line number Diff line change
Expand Up @@ -3639,10 +3639,10 @@ index 0000000000000000000000000000000000000000..155d0770ddf704728829272a41a31ce8
+
diff --git a/juggler/content/PageAgent.js b/juggler/content/PageAgent.js
new file mode 100644
index 0000000000000000000000000000000000000000..63754937b3464794227fe894b3d6057fbf0ae582
index 0000000000000000000000000000000000000000..2d70debb89be35dd68851c47bbee909495808f0b
--- /dev/null
+++ b/juggler/content/PageAgent.js
@@ -0,0 +1,914 @@
@@ -0,0 +1,918 @@
+"use strict";
+const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
+const Ci = Components.interfaces;
Expand Down Expand Up @@ -4212,6 +4212,8 @@ index 0000000000000000000000000000000000000000..63754937b3464794227fe894b3d6057f
+ const unsafeObject = this._frameData.get(frame).unsafeObject(objectId);
+ if (!unsafeObject.getBoxQuads)
+ throw new Error('RemoteObject is not a node');
+ frame.domWindow().windowUtils.advanceTimeAndRefresh(0);
+ frame.domWindow().windowUtils.restoreNormalRefresh();
+ const quads = unsafeObject.getBoxQuads({relativeTo: this._frameTree.mainFrame().domWindow().document}).map(quad => {
+ return {
+ p1: {x: quad.p1.x, y: quad.p1.y},
Expand Down Expand Up @@ -4254,6 +4256,8 @@ index 0000000000000000000000000000000000000000..63754937b3464794227fe894b3d6057f
+ throw new Error('Node is detached from document');
+ if (!rect)
+ rect = { x: -1, y: -1, width: -1, height: -1};
+ frame.domWindow().windowUtils.advanceTimeAndRefresh(0);
+ frame.domWindow().windowUtils.restoreNormalRefresh();
+ if (unsafeObject.scrollRectIntoViewIfNeeded)
+ unsafeObject.scrollRectIntoViewIfNeeded(rect.x, rect.y, rect.width, rect.height);
+ else
Expand Down

0 comments on commit 10cca04

Please sign in to comment.