changeset 197:b4da709724e1

Bug 379233 - check offset before recording page load complete - r=vladimir
author Alice Nodelman <alice@mozilla.com>
date Fri, 17 Sep 2010 11:34:40 -0400
parents dd0018bc27de
children 59d4f04497dd
files chrome/pageloader.js
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/chrome/pageloader.js	Wed Jul 21 15:57:39 2010 -0400
+++ b/chrome/pageloader.js	Fri Sep 17 11:34:40 2010 -0400
@@ -290,6 +290,18 @@
   if (timeout > 0) { 
     clearTimeout(timeoutEvent);
   }
+  var docElem;
+  if (browserWindow)
+    docElem = browserWindow.frames["content"].document.documentElement;
+  else
+    docElem = content.contentDocument.documentElement;
+  var width;
+  if ("getBoundingClientRect" in docElem) {
+    width = docElem.getBoundingClientRect().width;
+  } else if ("offsetWidth" in docElem) {
+    width = docElem.offsetWidth;
+  }
+
   var end_time = Date.now();
   var time = (end_time - start_time);