From: SourceForge.net <no...@so...> - 2003-08-04 07:21:41
|
Bugs item #713646, was opened at 2003-04-02 03:21 Message generated for change (Comment added) made by ahangler You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=713646&group_id=47038 Category: None Group: 1.2.1 Status: Closed Resolution: Fixed Priority: 5 Submitted By: David K. Taylor (dktaylor) Assigned to: Mike Bowler (mbowler) Summary: window.onload should not require parentheses Initial Comment: The window.onload property only works if the value is a function call with parentheses, not just a function name. According to the Gecko DOM Reference on window.onload, the value should just be a function name: http://www.mozilla.org/docs/dom/domref/dom_window_re f63.html Here's a sample page that should cause an alert to be raised, but doesn't with HtmlUnit 1.2.2: <html> <body> <script type="text/javascript"> testFunction = function() { alert('testFunction called.'); } onload=testFunction; </script> </body> </html> If you replace the onload statement with this, it works: onload=testFunction(); ---------------------------------------------------------------------- Comment By: Andreas Hangler (ahangler) Date: 2003-08-04 09:21 Message: Logged In: YES user_id=837008 This fix does not work in some cases (see bug 782661 where this problem is adressed and fixed). Regards Andreas ---------------------------------------------------------------------- Comment By: Mike Bowler (mbowler) Date: 2003-05-15 02:20 Message: Logged In: YES user_id=46756 The patch has been commited - thanks. Your approach is simpler than what I was thinking and simpler is definitely better :-) Notes for future patches: 1) You are entitled to add an @author tag at the top of any file you touch. I've added your name to the three files. 2) You submitted a couple of files in the patch. Be aware that the only file I even look at is the diff itself. I apply that to my code and then view the differences there. ---------------------------------------------------------------------- Comment By: David K. Taylor (dktaylor) Date: 2003-05-14 23:10 Message: Logged In: YES user_id=742109 I made a new patch file that I hope fixes the problem. I didn't do the correct diff for the old patch file. I also added a new build.xml file that fixes some problems with the target directories that allowed me to compile in the new daily CVS area. ---------------------------------------------------------------------- Comment By: Mike Bowler (mbowler) Date: 2003-05-14 13:15 Message: Logged In: YES user_id=46756 The patch appears to be taken from the root of your filesystem, not the root of the HtmlUnit tree and as a result, I can't use it to patch my copy. Can you redo the patch and submit it again? Thanks. BTW The only part of the daily build that won't compile is the "jelly" directory. If you delete that then everything else will compile and run correctly. In order to compile the jelly directory, you have to be using maven, not ant to do your build. Instructions for this will be appearing on the website when I get some time (I'm swamped right now) ---------------------------------------------------------------------- Comment By: David K. Taylor (dktaylor) Date: 2003-05-14 02:43 Message: Logged In: YES user_id=742109 I have a patch to fix this bug, which I will attach to this bug. The patch include the fix in HtmlPage.java, a new test in HtmlPageTest.java, and a CVS difference for both files. The daily CVS build did not work (wouldn't compile), so I made the changes in 1.2.2, made sure that compiled and tested (checkstyle had 2 TODO failures already), and then differenced and merged the changes into the daily CVS code versions. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=713646&group_id=47038 |