2006-09-17 Eric Seidel <eric@eseidel.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2006 06:14:46 +0000 (06:14 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2006 06:14:46 +0000 (06:14 +0000)
        Reviewed by hyatt.

        * fast/js/window-properties.html: make work in Firefox (hangs IE)

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16418 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/js/window-properties.html

index 194b4047f50c869c4a4a3b3a6cd558319e79de3c..44e42995b6e8acddb5c9d4c667adf436c7460bcf 100644 (file)
@@ -1,3 +1,9 @@
+2006-09-17  Eric Seidel  <eric@eseidel.com>
+
+        Reviewed by hyatt.
+
+        * fast/js/window-properties.html: make work in Firefox (hangs IE)
+
 2006-09-17  Eric Seidel  <eric@eseidel.com>
 
         Add a textual dump of the window object property tree.
index 65454274030bf1aa4e5dcfbbec268a7f4b1f50fa..5e500118c345c3a61865de8233504c94ecb695b2 100644 (file)
@@ -1,3 +1,5 @@
+<html>
+<body>
 <div id="log"></div>
 <script type="text/javascript">
 
@@ -26,16 +28,27 @@ function shouldSkipChildren(fullPropertyName, propertyValue) {
 }
 
 function havePrintedChildren(fullPropertyName, propertyValue) {
-  var childrenPrintedUnderName = propertyValue._childrenPrintedUnderName;
-  if (!childrenPrintedUnderName)
-    propertyValue._childrenPrintedUnderName = fullPropertyName;
-  return childrenPrintedUnderName;
+  try {
+    var childrenPrintedUnderName = propertyValue._childrenPrintedUnderName;
+    if (!childrenPrintedUnderName)
+      propertyValue._childrenPrintedUnderName = fullPropertyName;
+    return childrenPrintedUnderName;
+  } catch (e) {
+    log(fullPropertyName + " : ERROR determining if we have already printed children, assuming true");
+    return true;
+  }
 }
 
 function printProperties(object, parentString) {
   for (propertyName in object) {
     var fullPropertyName = parentString + '.' + propertyName;
-    var propertyValue = object[propertyName];
+    var propertyValue;
+    try {
+      propertyValue = object[propertyName]; // Firefox throws here for certain unimplemented DOM3 properties
+    } catch (e) {
+      log(fullPropertyName + " : ERROR accessing property, exception thrown: " + e);
+      continue;
+    }
     if (shouldSkipProperty(fullPropertyName, propertyValue))
       continue;
     var type = typeof(propertyValue);
@@ -57,3 +70,5 @@ havePrintedChildren(window, 'window');
 printProperties(window, 'window');
 
 </script>
+</body>
+</html>