Bug 1425033 - Fix frame handling in FormAssistant; r=me
authorJim Chen <nchen@mozilla.com>
Wed, 20 Dec 2017 16:10:34 -0500
changeset 448842 8652c56092922ceea05ff121ca6dfab23efdfc14
parent 448841 8ee567b6b4156dab65b281605ea1eb068c89696f
child 448843 1e4a73a1bf2fecd3a835235fbb0632f42968ac0b
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1425033
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1425033 - Fix frame handling in FormAssistant; r=me Remove the invalid `content` reference when traversing the frame tree; Checking for `frameElement` should be enough. r=me for trivial patch.
mobile/android/modules/FormAssistant.jsm
--- a/mobile/android/modules/FormAssistant.jsm
+++ b/mobile/android/modules/FormAssistant.jsm
@@ -367,17 +367,17 @@ var FormAssistant = {
     while (document.defaultView.frameElement) {
       document = document.defaultView.frameElement.ownerDocument;
     }
 
     let scrollX = 0, scrollY = 0;
     let r = aElement.getBoundingClientRect();
 
     // step out of iframes and frames, offsetting scroll values
-    for (let frame = aElement.ownerGlobal; frame.frameElement && frame != content;
+    for (let frame = aElement.ownerGlobal; frame.frameElement;
          frame = frame.parent) {
       // adjust client coordinates' origin to be top left of iframe viewport
       let rect = frame.frameElement.getBoundingClientRect();
       let left = frame.getComputedStyle(frame.frameElement).borderLeftWidth;
       let top = frame.getComputedStyle(frame.frameElement).borderTopWidth;
       scrollX += rect.left + parseInt(left);
       scrollY += rect.top + parseInt(top);
     }