Patch let applets/objects/embeds behave alike

Koos Vriezen koos.vriezen at xs4all.nl
Fri Nov 21 23:32:07 GMT 2003


On Sat, 22 Nov 2003, David Faure wrote:

> On Friday 21 November 2003 23:33, Koos Vriezen wrote:
> > Hi,
> >
> > This patch makes window.xxx or document.xxx work for
> > applets/objects/embeds
>
> Looks good to me.
>
> Can you add tests to khtmltests/regressions/tests/ecma/?
> (for instance in document.html or document2.html). This will allow
> 1) to easily check that other browsers behave the same
> 2) to detect regressions.

Ah, I forgot that the last time you asked.. Anyway, something like
attached? Mozilla fails on these, and returns 2 for
document.applets.length.

Koos

-------------- next part --------------
? .document.html.swp
? .swp
Index: document.html
===================================================================
RCS file: /home/kde/khtmltests/regression/tests/ecma/document.html,v
retrieving revision 1.2
diff -u -3 -p -r1.2 document.html
--- document.html	20 Nov 2003 14:30:13 -0000	1.2
+++ document.html	21 Nov 2003 23:23:30 -0000
@@ -90,6 +90,12 @@
       <iframe name="close" width=0 height=0></iframe>
 
       <div id="outputdiv"></div>
+      <embed id="myembed1"></embed>
+      <embed name="myembed2"></embed>
+      <object id="myobject1"></object>
+      <object name="myobject2"></object>
+      <applet id="myapplet1"></applet>
+      <applet name="myapplet2"></applet>
 
       <script>
         shouldBe("typeof document.location.href", "'string'");
@@ -98,7 +104,7 @@
 	shouldBe("typeof document.height", "'object'");  // IE finds the iframe! And moz says "number", which would be better.
         shouldBe("typeof document.close", "'object'"); // IE finds the iframe!
         shouldBe("document.forms.length", "3");
-        shouldBe("document.applets.length", "0");
+        shouldBe("document.applets.length", "6");
         shouldBe("typeof document.anchors.length", "'number'");
         shouldBe("document.anchors.length >= 2", "true");
         shouldBe("/*Expected failure*/ typeof document.anchors.target", "'undefined'");
@@ -277,6 +283,12 @@
         shouldBe( "linkkde.protocol", "'http:'" );
         shouldBe( "linkkde.pathname", "'/index.html'" );
         shouldBe( "linkkde.text", "'link'" );
+        shouldBe( "myembed1", "document.myembed1" );
+        shouldBe( "myembed2", "document.myembed2" );
+        shouldBe( "myobject1", "document.myobject1" );
+        shouldBe( "myobject2", "document.myobject2" );
+        shouldBe( "myapplet1", "document.myapplet1" );
+        shouldBe( "myapplet2", "document.myapplet2" );
 
         document.write("<br>End Of Test");
       </script>


More information about the kfm-devel mailing list