From d98c3455f55d872ff2fd3983da981eb8c578d93b Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 31 Mar 2015 23:52:54 +0200 Subject: Consider "invisible" forms with visible fields. A form can have a width/height of 0 even though its fields are visible in the browser. E.g., http://www.lenson.com document.forms[0].getBoundingClientRect(); { bottom: 196, height: 0, left: 37, right: 208, top: 196, width: 171, x: 37, y: 196 } document.forms[0][0].getBoundingClientRect(); { bottom: 448, height: 22, left: 60, right: 196, top: 426, width: 136, x: 60, y: 426 } document.forms[0][1].getBoundingClientRect(); { bottom: 495, height: 22, left: 60, right: 196, top: 473, width: 136, x: 60, y: 473 } --- xul-ext/chrome/content/icevault.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xul-ext/chrome/content') diff --git a/xul-ext/chrome/content/icevault.js b/xul-ext/chrome/content/icevault.js index 1eae3e1..d84c5b7 100644 --- a/xul-ext/chrome/content/icevault.js +++ b/xul-ext/chrome/content/icevault.js @@ -91,12 +91,12 @@ var icevault = (function() { // refresh the form list let forms = [], getForms = []; for (let i = 0; i < state.document.forms.length; i++) { - let form = state.document.forms[i], rect = form.getBoundingClientRect(); - if (rect.width == 0 || rect.height == 0) - continue; // invisible form + let form = state.document.forms[i]; let fields = [], getFields = []; for (let i = 0; i < form.elements.length; i++) { - let field = form.elements[i]; + let field = form.elements[i], rect = field.getBoundingClientRect(); + if (rect.width == 0 || rect.height == 0) + continue; // invisible field if (["text","email","password"].indexOf(field.type) > -1) { // store only these kinds of fields let getField = { name: field.name, type: field.type, value: field.value }; -- cgit v1.2.3