osdir.com
mailing list archive
Mozy Online Backup: 2GB Free. Automatic. Secure.

Subject: [HtmlUnit] [ htmlunit-Bugs-1185806 ] frame content should be loaded first when </frameset> found - msg#00090

List: java.htmlunit.devel

Date: Prev Next Index Thread: Prev Next Index
Bugs item #1185806, was opened at 2005-04-19 12:10
Message generated for change (Comment added) made by mguillem
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1185806&group_id=47038

Category: None
Group: 1.5
Status: Open
>Resolution: Accepted
Priority: 5
Submitted By: BhupeshReddy (bhupeshreddy)
Assigned to: Nobody/Anonymous (nobody)
>Summary: frame content should be loaded first when </frameset> found

Initial Comment:
The onLoad event on my page calls the hideLeftnav()
javascript function.

I am getting the following exception.
======= EXCEPTION START ========
EcmaError: lineNumber=[148] column=[0] lineSource=
[null] name=[TypeError] sourceName=
[/zpm/jscripts/navbar.js] message=[TypeError: Cannot
set property "cols" of null to "0,*"
(/zpm/jscripts/navbar.js#148)]
com.gargoylesoftware.htmlunit.ScriptException:
TypeError: Cannot set property "cols" of null to "0,*"
(/zpm/jscripts/navbar.js#148)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngin
e.callFunction(JavaScriptEngine.java:344)


Apparantly the function call getFrameset("bottom") is
returning null.

/**
* function called to hide the left nav bar
*
*/
function hideLeftnav() {
var bottom = getFrameset("bottom") ;
bottom.cols="0,*";
}
/**
* function called to access frame elements
*
*/
function getFrameset(aFrame) {
if (document.getElementById) {
elm = parent.document.getElementById(aFrame);
} else if (document.all) {
elm = parent.frames[1].document.all[aFrame];
} else if (document.layers) {
elm = parent.frames[1].document.layers[aFrame];
}

return elm;
}

the frameset code is as follows.

<frameset id="application" title="Application"
rows="60,0,*" framespacing="0" frameborder="1" >
<frame noresize id="navbar" name="navbar" src="<%
= navbar %>" marginwidth="0" marginheight="0"
scrolling="no" frameborder="0">
<frame noresize id="subnavbar" name="subnavbar"
src="subNavblank.jsp" marginwidth="0"
marginheight="0" scrolling="no" frameborder="0">
<frameset id="bottom" title="bottom" cols="<%=
bodysize %>" framespacing="0">
<frame class="leftNav" id="leftNav" name="leftNav"
noresize src="<%= leftnav %>" marginwidth="0"
marginheight="0" frameborder="0" scrolling="auto">
<frame class="workArea" id="workarea"
name="workArea" marginwidth="0" marginheight="0"
scrolling="auto" frameborder="0" src="<%= workarea %
>">
</frameset>
</frameset>

----------------------------------------------------------------------

>Comment By: Marc Guillemot (mguillem)
Date: 2005-04-28 21:37

Message:
Logged In: YES
user_id=402164

Htmlunit seems to wrongly load frame content too early,
before it finds the closing </frameset> tag.
The problem can be shown with simplier example (below).
Firefox and IE display alert with "true" whereas htmlunit
says "false".
I change the bug's title to better express the cause of the
problem.

<html>
<frameset rows="60,0,*">
<frame src="1.html">
<frame id="bottom" src="about:blank">
</frameset>
</html>

1.html:
<html>
<head>
<script>
function test()
{
alert(parent.document.getElementById('bottom') != null);
}
</script>
</head>
<body onload="test()" ></body>
</html>

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1185806&group_id=47038


-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix


Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

[HtmlUnit] [ htmlunit-Patches-1109506 ] WebClient refactorings

Patches item #1109506, was opened at 2005-01-26 01:35 Message generated for change (Comment added) made by mguillem You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448268&aid=1109506&group_id=47038 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Hans Donner (jhdonner) Assigned to: Nobody/Anonymous (nobody) Summary: WebClient refactorings Initial Comment: Refactoring to WebClient (and directly related classes): - less usage of magic numbers & texts (upgraded to static final) - removed duplication in constructor code - moved assertionFailed to Assert (kept a deprecated reference in place!) - has nothing to do with webclient - added some javadoc - added some TODO comments regarding the internal status - moved expandUrl to new WebUtil class (kept a deprecated reference in place!) - is not specifc for webclient, but more for general usage Created a new WebResponseImpl, with an ABOUT_BLANK Created/updated related testcases Updated classes refering to the now deprecated classses Regarding Checkstyle, I have two methods in WebResponseImpl with 7 params, I prefer to keep them (although they're probably not often used directly) Note: updated with latest CVS version, these changes don't conflict with the latest refactorings. Unit test still run (the failing HtmlTestPage I've updated locally, and is not included in this path, awaiting the soon to come fix) ---------------------------------------------------------------------- >Comment By: Marc Guillemot (mguillem) Date: 2005-04-28 16:44 Message: Logged In: YES user_id=402164 Any chance to get an actual version of the patch? If not, I'd like to close the issue. ---------------------------------------------------------------------- Comment By: Brad Clarke (yourgod) Date: 2005-02-23 18:15 Message: Logged In: YES user_id=257129 I gave it a shot before and after the even more recent indenting patch but it's still not applying :( ---------------------------------------------------------------------- Comment By: Hans Donner (jhdonner) Date: 2005-02-01 23:03 Message: Logged In: YES user_id=132719 Not only the monser final patch was causing the original patch to fail, too much has been changed :-) Attached the updated patch (I had to wait for the final patch to appear in the public cvs) ---------------------------------------------------------------------- Comment By: Brad Clarke (yourgod) Date: 2005-02-01 20:37 Message: Logged In: YES user_id=257129 I think the "finals patch" broke this one. Could you make the patch again please? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448268&aid=1109506&group_id=47038 ------------------------------------------------------- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix

Next Message by Date: click to view message preview

[HtmlUnit] [ htmlunit-Bugs-1191089 ] Problem with the URL return after a submitting a Form

Bugs item #1191089, was opened at 2005-04-27 17:33 Message generated for change (Comment added) made by mguillem You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1191089&group_id=47038 Category: None Group: Latest code in CVS >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: SALL Ousmane (osall751) >Assigned to: Marc Guillemot (mguillem) Summary: Problem with the URL return after a submitting a Form Initial Comment: (Excuse of my poor english) I have download the current version in CVS for gettin the new url after I sumit a form (the code code of the html page and the my java code are on down this page) normally on a browser the url return is it's : http://fr.yahoo.com/?varform2=javascriptModified2 But the after a submit the page.getWebResponse().getUrl().toExternalForm()) give me : http://www.yahoo.fr?varform2=valform2 or valform2 is the initial value of the input. I think HtmlUnit does'nt execute the methode submitForm2() but I dont know why Here is the HTML code of mypage.html: ---------------------------- <html> <body> <script> function submitForm2() { leform2.varform2.value="javascriptModified2"; leform2.submit(); } </script> <form action="http://www.yahoo.fr" name="leform2"> <input type="text" name="varform2" value="valform2"> <input type="button" onclick="submitForm2()" value=submit> </form> </body> </html> ---------------------------- Here is my Java code : public class ForumHtmlUnit { public static URL URL_FIRST; private static String url = "file:///home/mypage.html"; public static void main(String[] args) throws Exception { URL_URL_FIRST = new URL(url); String webPageCode = new WebClient().getPage(URL_URL_FIRST) .getWebResponse().getContentAsString(); List collectedAlerts = new ArrayList(); WebClient client = new WebClient(); if (collectedAlerts != null) { client.setAlertHandler(new CollectingAlertHandler(collectedAlerts)); } MockWebConnection webConnection = new MockWebConnection(client); webConnection.setDefaultResponse(webPageCode); client.setWebConnection(webConnection); HtmlPage page = (HtmlPage) client.getPage(URL_FIRST); List listInput = page.getDocumentElement().getHtmlElementsByTagName("form"); for (Iterator iter = listInput.iterator(); iter.hasNext();) { HtmlForm formul = (HtmlForm) iter.next(); System.out.println("New URL -> " + formul.submit().getWebResponse().getUrl() .toExternalForm()); } } } ---------------------------------------------------------------------- >Comment By: Marc Guillemot (mguillem) Date: 2005-04-28 21:16 Message: Logged In: YES user_id=402164 Your java code submits the form directly without clicking the button. Everything works fine if you click the button changing the end of your code to something like: final HtmlForm form = (HtmlForm) page.getAllForms().get(0); final HtmlButtonInput button = (HtmlButtonInput) form.getHtmlElementsByAttribute("input", "type", "button").get(0); System.out.println("New URL -> " + button.click().getWebResponse().getUrl().toExternalForm()); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448266&aid=1191089&group_id=47038 ------------------------------------------------------- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix

Previous Message by Thread: click to view message preview

[HtmlUnit] [ htmlunit-Patches-1109506 ] WebClient refactorings

Patches item #1109506, was opened at 2005-01-26 01:35 Message generated for change (Comment added) made by mguillem You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448268&aid=1109506&group_id=47038 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Hans Donner (jhdonner) Assigned to: Nobody/Anonymous (nobody) Summary: WebClient refactorings Initial Comment: Refactoring to WebClient (and directly related classes): - less usage of magic numbers & texts (upgraded to static final) - removed duplication in constructor code - moved assertionFailed to Assert (kept a deprecated reference in place!) - has nothing to do with webclient - added some javadoc - added some TODO comments regarding the internal status - moved expandUrl to new WebUtil class (kept a deprecated reference in place!) - is not specifc for webclient, but more for general usage Created a new WebResponseImpl, with an ABOUT_BLANK Created/updated related testcases Updated classes refering to the now deprecated classses Regarding Checkstyle, I have two methods in WebResponseImpl with 7 params, I prefer to keep them (although they're probably not often used directly) Note: updated with latest CVS version, these changes don't conflict with the latest refactorings. Unit test still run (the failing HtmlTestPage I've updated locally, and is not included in this path, awaiting the soon to come fix) ---------------------------------------------------------------------- >Comment By: Marc Guillemot (mguillem) Date: 2005-04-28 16:44 Message: Logged In: YES user_id=402164 Any chance to get an actual version of the patch? If not, I'd like to close the issue. ---------------------------------------------------------------------- Comment By: Brad Clarke (yourgod) Date: 2005-02-23 18:15 Message: Logged In: YES user_id=257129 I gave it a shot before and after the even more recent indenting patch but it's still not applying :( ---------------------------------------------------------------------- Comment By: Hans Donner (jhdonner) Date: 2005-02-01 23:03 Message: Logged In: YES user_id=132719 Not only the monser final patch was causing the original patch to fail, too much has been changed :-) Attached the updated patch (I had to wait for the final patch to appear in the public cvs) ---------------------------------------------------------------------- Comment By: Brad Clarke (yourgod) Date: 2005-02-01 20:37 Message: Logged In: YES user_id=257129 I think the "finals patch" broke this one. Could you make the patch again please? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=448268&aid=1109506&group_id=47038 ------------------------------------------------------- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix

Next Message by Thread: click to view message preview

[HtmlUnit] HtmlUnit build-2 Build Successful

BUILD COMPLETE -  build-2Date of build:04/28/2005 21:15:21Time to build:31 secondsTime to compile:31 secondsTime to Acceptance Test:Last changed:04/28/2005 14:47:10Last log entry:_javascript_: fixed exception occuring while changing type of input created via document.createElement(). Patch from Bruce Faulkner.  Errors/Warnings: (4) Note: E:\ccprojects\htmlunit\src\java\com\gargoylesoftware\htmlunit\html\xpath\HtmlUnitXPath.java uses or overrides a deprecated API.Note: Recompile with -Xlint:deprecation for details.Note: E:\ccprojects\htmlunit\src\test\java\com\gargoylesoftware\htmlunit\Base64Test.java uses or overrides a deprecated API.Note: Recompile with -Xlint:deprecation for details.  Unit Tests: (2333) All Tests Passed    Modifications since last successful build:  (3) Newmodifiedmguillemsrc/xdocs/changes.xml_javascript_: fixed exception occuring while changing type of input created via document.createElement(). Patch from Bruce Faulkner.Newmodifiedmguillemsrc/java/com/gargoylesoftware/htmlunit/_javascript_/host/Input.java_javascript_: fixed exception occuring while changing type of input created via document.createElement(). Patch from Bruce Faulkner.Newmodifiedmguillemsrc/test/java/com/gargoylesoftware/htmlunit/_javascript_/host/InputTest.java_javascript_: fixed exception occuring while changing type of input created via document.createElement(). Patch from Bruce Faulkner.  Deployments by this build: (2) Building jar: E:\ccprojects\htmlunit\ant-target\HtmlUnit.jarBuilding jar: E:\ccprojects\htmlunit\ant-target\HtmlUnit-src.jar
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by