SF.net SVN: htmlunit: [1234] trunk/htmlunit/src

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

SF.net SVN: htmlunit: [1234] trunk/htmlunit/src

mguillem
Revision: 1234
          http://svn.sourceforge.net/htmlunit/?rev=1234&view=rev
Author:   mguillem
Date:     2006-09-11 06:07:31 -0700 (Mon, 11 Sep 2006)

Log Message:
-----------
JavaScript: use of HTMLElement.innerHTML should not cause registration of a WebWindow (#1495132)

Modified Paths:
--------------
    trunk/htmlunit/src/java/com/gargoylesoftware/htmlunit/WebWindowImpl.java
    trunk/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host/HTMLElement.java
    trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/HTMLElementTest.java
    trunk/htmlunit/src/xdocs/changes.xml

Modified: trunk/htmlunit/src/java/com/gargoylesoftware/htmlunit/WebWindowImpl.java
===================================================================
--- trunk/htmlunit/src/java/com/gargoylesoftware/htmlunit/WebWindowImpl.java 2006-09-11 12:19:11 UTC (rev 1233)
+++ trunk/htmlunit/src/java/com/gargoylesoftware/htmlunit/WebWindowImpl.java 2006-09-11 13:07:31 UTC (rev 1234)
@@ -69,6 +69,13 @@
     public WebWindowImpl(final WebClient webClient) {
         Assert.notNull("webClient", webClient);
         webClient_ = webClient;
+        performRegistration();
+    }
+
+    /**
+     * Registers the window with the client.
+     */
+    protected void performRegistration() {
         webClient_.registerWebWindow(this);
     }
 

Modified: trunk/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host/HTMLElement.java
===================================================================
--- trunk/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host/HTMLElement.java 2006-09-11 12:19:11 UTC (rev 1233)
+++ trunk/htmlunit/src/java/com/gargoylesoftware/htmlunit/javascript/host/HTMLElement.java 2006-09-11 13:07:31 UTC (rev 1234)
@@ -507,6 +507,9 @@
                     public WebWindow getTopWindow() {
                         return null;
                     }
+                    protected void performRegistration() {
+                        // nothing
+                    }
                 };
                 final HtmlPage pseudoPage = HTMLParser.parse(webResp, pseudoWindow);
                 final HtmlBody body = (HtmlBody) pseudoPage.getDocumentElement().getLastChild();

Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/HTMLElementTest.java
===================================================================
--- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/HTMLElementTest.java 2006-09-11 12:19:11 UTC (rev 1233)
+++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/host/HTMLElementTest.java 2006-09-11 13:07:31 UTC (rev 1234)
@@ -393,10 +393,7 @@
                 "";
         final List collectedAlerts = new ArrayList();
         loadPage(content, collectedAlerts);
-        final List expectedAlerts = Arrays.asList(new String[]{
-            "Old = <b>Old innerHTML</b>",
-            "New = New cell value"
-        });
+        final String[] expectedAlerts = { "Old = <b>Old innerHTML</b>", "New = New cell value" };
         assertEquals(expectedAlerts, collectedAlerts);
     }
     /**
@@ -424,16 +421,15 @@
                 "";
         final List collectedAlerts = new ArrayList();
         final HtmlPage page = loadPage(content, collectedAlerts);
-        final List expectedAlerts = Arrays.asList(new String[]{
-            "Old = <b>Old innerHTML</b>",
-            "New =  <b><i id=\"newElt\">New cell value</i></b>",
-            "I"
-        });
+        final String[] expectedAlerts = { "Old = <b>Old innerHTML</b>",
+                "New =  <b><i id=\"newElt\">New cell value</i></b>",
+                "I" };
         assertEquals(expectedAlerts, collectedAlerts);
         final HtmlElement pElt = page.getHtmlElementById("myNode");
         assertEquals("p", pElt.getNodeName());
         final HtmlElement elt = page.getHtmlElementById("newElt");
         assertEquals("New cell value", elt.asText());
+        assertEquals(1, page.getWebClient().getWebWindows().size());
     }
     /**
      * Test the use of innerHTML to set a new input

Modified: trunk/htmlunit/src/xdocs/changes.xml
===================================================================
--- trunk/htmlunit/src/xdocs/changes.xml 2006-09-11 12:19:11 UTC (rev 1233)
+++ trunk/htmlunit/src/xdocs/changes.xml 2006-09-11 13:07:31 UTC (rev 1234)
@@ -7,6 +7,9 @@
 
     <body>
         <release version="1.10-prerelease">
+            <action type="update" dev="mguillem" id="1495132">
+                JavaScript: use of HTMLElement.innerHTML should not cause registration of a WebWindow.
+            </action>
             <action type="update" dev="mguillem">
                 JavaScript: window.eval now evaluates in the right window scope.
             </action>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop