Fixed: <rdar://problem/4026639> www.bmw.ca configurator does not work with Safari
[WebKit-https.git] / WebCore / khtml / ecma / kjs_html.cpp
index e860967412860a9e55cd88ce1e5443a599e62717..da414a21f27558d0ec5a48b5bb93701a6e4af261 100644 (file)
@@ -1151,6 +1151,22 @@ Value KJS::HTMLElement::tryGet(ExecState *exec, const Identifier &propertyName)
         return getDOMNode(exec,select.options().item(u)); // not specified by DOM(?) but supported in netscape/IE
     }
       break;
+    case ID_FRAMESET: {
+        DOM::Node frame = element.children().namedItem(propertyName.string());
+        if (!frame.isNull() && frame.elementId() == ID_FRAME) {
+            DOM::DocumentImpl* doc = static_cast<DOM::HTMLFrameElementImpl *>(frame.handle())->contentDocument();
+            if (doc) {
+                KHTMLPart* part = doc->part();
+                if (part) {
+                    Window *window = Window::retrieveWindow(part);
+                    if (window) {
+                        return Value(window);
+                    }
+                }
+            }
+        }
+    }
+        break;
     case ID_FRAME:
     case ID_IFRAME: {
         DOM::DocumentImpl* doc = static_cast<DOM::HTMLFrameElementImpl *>(element.handle())->contentDocument();