Bug 75903 - Crashes on document.formname.fieldname.focus() in Javascript
Summary: Crashes on document.formname.fieldname.focus() in Javascript
Status: RESOLVED DUPLICATE of bug 75353
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: 3.2
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-23 10:50 UTC by Hogne Titlestad
Modified: 2004-06-30 15:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
login_screen.html (2.31 KB, text/html)
2004-02-23 11:18 UTC, Hogne Titlestad
Details
backtrace.txt (6.53 KB, text/plain)
2004-02-23 11:18 UTC, Hogne Titlestad
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hogne Titlestad 2004-02-23 10:50:30 UTC
Version:           3.2 (using KDE KDE 3.2.0)
Installed from:    Compiled From Sources
Compiler:          Gcc 3.2.3 athlonxp
OS:          Linux

Konqueror 3.2 crashes every time I run this javascript code from a form:

function verifyFields()
{
	if ( document.loginform.username.value.length < 1 )
	{
		alert ( "Please enter a username" );
		document.loginform.username.focus();
		return -1;
	}
	if ( document.loginform.password.value.length < 1 )
	{
		alert ( "Please enter a password" );
		document.loginform.password.focus();
		return -1;
	}
}

This is a serious bug which prevents me from using Konqueror in development. All prior version of Konqueror 3.1.x ran this code without problems. Let's hope Konqueror 3.2.1 is a better one :)
Comment 1 Harri Porten 2004-02-23 11:12:39 UTC
I cannot reproduce this with the following example form (and current 3.2.x branch):

<form name="loginform" onsubmit="verifyFields()">
<input type="text" name="username">
<input type="text" name="password">
<input type="submit" name="Submit">
</form>

Could you provide a complete example, please?
Comment 2 Hogne Titlestad 2004-02-23 11:18:14 UTC
Hey!

That was fast!

I can!

I am attaching the HTML. Just click "Logg deg inn", the button, meaning "Log 
in", and it should crash. It does here in all variants every time. I am 
including the backtrace as well.

My best regards,

Hogne Titlestad

On Monday 23 February 2004 11:12, Harri Porten wrote:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
> You are a voter for the bug, or are watching someone who is.
>
> http://bugs.kde.org/show_bug.cgi?id=75903
>
>
>
>
> ------- Additional Comments From porten kde org  2004-02-23 11:12 -------
> I cannot reproduce this with the following example form (and current 3.2.x
> branch):
>
> <form name="loginform" onsubmit="verifyFields()">
> <input type="text" name="username">
> <input type="text" name="password">
> <input type="submit" name="Submit">
> </form>
>
> Could you provide a complete example, please?


Created an attachment (id=4851)
login_screen.html

Created an attachment (id=4852)
backtrace.txt
Comment 3 Harri Porten 2004-02-23 11:31:59 UTC
David was able to reproduce this crash. Still works for me. KHTMLPartBrowserExtension::updateEditActions calls inherits() on a NULL pointer.
Comment 4 Harri Porten 2004-02-23 11:41:23 UTC

*** This bug has been marked as a duplicate of 75353 ***
Comment 5 jspedron 2004-06-30 15:51:43 UTC
I reproduced this bug with Konqueror 3.2.2 on KDE 3.2.3.

I found that Konqueror crashes on the line
  document.forms[n].fieldname.focus();
when it follows an alert().

This example will segfault:
  alert("You didn't entered a name");
  document.forms[0].name.focus();

But this one won't:
  document.forms[0].name.focus();
  alert("You didn't entered a name");
(and the effect is the same)