Reviewed by Kevin.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Nov 2004 18:35:37 +0000 (18:35 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Nov 2004 18:35:37 +0000 (18:35 +0000)
        - fixed a couple places that would not work for XML documents

        * khtml/ecma/kjs_window.cpp:
        (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
        is present on the base class.
        (WindowFunc::tryCall): More of the same.

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/ecma/kjs_window.cpp

index f588bf69a397c9a3b36f7cbda219174dec61735e..a243f48fc6e4683d7fa893384c4f01047a9f0ab6 100644 (file)
@@ -1,3 +1,14 @@
+2004-11-12  Darin Adler  <darin@apple.com>
+
+        Reviewed by Kevin.
+
+        - fixed a couple places that would not work for XML documents
+
+        * khtml/ecma/kjs_window.cpp:
+        (Window::isSafeScript): Use xmlDocImpl instead of docImpl, since the function we're using
+        is present on the base class.
+        (WindowFunc::tryCall): More of the same.
+
 2004-11-12  Darin Adler  <darin@apple.com>
 
         - land versions of these files generated by the newer gperf
index 982ee4a7d3c83c25e883f5fb7ef77e355d35f80e..f1bb0afaf376288ca1827dd3205dcc1d25d4f46e 100644 (file)
@@ -1125,7 +1125,7 @@ bool Window::isSafeScript(ExecState *exec) const
     }
     
     if (ancestorPart)
-      thisDomain = ancestorPart->docImpl()->domain();
+      thisDomain = ancestorPart->xmlDocImpl()->domain();
   }
 
   //kdDebug(6070) << "current domain:" << actDomain.string() << ", frame domain:" << thisDomain.string() << endl;
@@ -1478,23 +1478,20 @@ Value WindowFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
         khtmlpart->setOpenedByJS(true);
         
         if (khtmlpart->document().isNull()) {
-            if (part->docImpl() && part->docImpl()->baseURL() != 0) {
-                khtmlpart->begin(part->docImpl()->baseURL());
-            }
-            else {
+            DocumentImpl *oldDoc = part->xmlDocImpl();
+            if (oldDoc && oldDoc->baseURL() != 0)
+                khtmlpart->begin(oldDoc->baseURL());
+            else
                 khtmlpart->begin();
-            }
             
             khtmlpart->write("<HTML><BODY>");
             khtmlpart->end();
 
-          if (part->xmlDocImpl()) {
-              kdDebug(6070) << "Setting domain to " << part->xmlDocImpl()->domain().string() << endl;
-              khtmlpart->xmlDocImpl()->setDomain( part->xmlDocImpl()->domain(), true );
-          }
-          
-          if ( part->docImpl() )
-              khtmlpart->docImpl()->setBaseURL( part->docImpl()->baseURL() );
+            if (oldDoc) {
+              kdDebug(6070) << "Setting domain to " << oldDoc->domain().string() << endl;
+              khtmlpart->xmlDocImpl()->setDomain( oldDoc->domain(), true );
+              khtmlpart->xmlDocImpl()->setBaseURL( oldDoc->baseURL() );
+            }
         }
 #if APPLE_CHANGES
         if (!url.isEmpty()) {