Closed
Bug 181526
Opened 22 years ago
Closed 21 years ago
JavaScript behaves differently (and supports broken JavaScript) in Windows
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 178258
People
(Reporter: eb3f73+buzilla+com, Unassigned)
References
()
Details
Attachments
(1 file)
(deleted),
text/html
|
Details |
User-Agent: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020916
Build Identifier: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020916
I'm not sure if Rhino is to blame here, but I've noticed this problem when using
Mozilla on different platforms. I first noticed this problem when viewing the
"view e-bill" section from the given URL (unfortunately you need an account to
check this, so don't bother).
Here's a brief description of the problem:
http://slashdot.org/comments.pl?sid=45667&cid=4734283
Is Mozilla using a different interpreter on Windows than other Platforms?
Reproducible: Always
Steps to Reproduce:
1. Create a page with JavaScript that attempts to access document.forms.FORMNAME
(instead of documents.forms["FORMNAME"]).
2. View the page in Mozilla running on Linux (or Chimera running on OS X) and
notice that it fails as expected.
3. View the page in Mozilla running on Windows and noticed that it succeeds
(ahh! language polution!).
Actual Results:
See above.
Expected Results:
Failed on Windows (or at the very least, behaved the same way across platforms).
Comment 1•22 years ago
|
||
Browser, not Rhino - reassigning to DOM Level 0
Assignee: nboyd → jst
Component: Core → DOM Level 0
Product: Rhino → Browser
QA Contact: pschwartau → desale
Version: other → Trunk
Comment 2•22 years ago
|
||
Comment 3•22 years ago
|
||
The testcase Phil attached succeeds on Linux build 2002-11-20-08, trunk. The
testcase is perfectly correct javascript and perfectly correct DOM0 and should
not be failing on any of the Mozilla platforms.
Comment 5•22 years ago
|
||
The testcase still worksforme on Windows and Linux. Reporter, are you still
seeing this?
The behavior is now consitent across both Windows and Linux with 1.3 (I haven't
checked OS X yet). The page still doesn't work in Mozilla (it works in IE and
Oper), but that's not Mozilla's fault. I was finally able to capture the actual
HTML where it's failling to find document.forms.SIGNON. Here it is:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<script>
function decode( base)
{
base64= new String(base);
var pad = 0;
for ( t = base64.length - 1; base64.charAt(t) == '='; t--)
pad++;
var length =Math.ceil((base64.length * 6) / 8)- pad;
var raw = new Array();
var rawIndex = 0;
for (t = 0; t < base64.length; t += 4)
{
block = (getValue(base64.charCodeAt(t)) << 18)
+ (getValue(base64.charCodeAt(t + 1)) << 12)
+ (getValue(base64.charCodeAt(t + 2)) << 6)
+ (getValue(base64.charCodeAt(t + 3)));
for ( var u = 0; u < 3 && rawIndex + u <length; u++)
{
m=((block >> (8 * (2 - u))) & 0xff);
raw[rawIndex + u] = String.fromCharCode(m);
}
rawIndex += 3;
}
return raw.join('');
}
function getValue( c)
{
if (c >= 65 && c <= 90) return(c - 65);
if (c >= 97 && c <= 122) return (c - 97 + 26);
if (c >= 48 && c <= 57) return (c - 48 + 52);
if (c == 43) return(62);
if (c == 47) return (63);
if (c ==61) return (0);
return(-1);
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j); i = document.cookie.indexOf(" ", i)
+ 1;
if (i == 0) break;
}
return null;
}
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
</SCRIPT>
<form method=POST name=SIGNON TARGET="_top"
action="https://www.novusnet.com/discover/cgi-bin/dcsignon"><input TYPE="hidden"
NAME="STMT_SGNON_UserID" VALUE=""><input TYPE="hidden"
NAME="STMT_SGNON_Password" VALUE=""><input TYPE="hidden" NAME="Login"
VALUE=""><input TYPE="hidden" NAME="SCREEN_WIDTH2" VALUE="640"><input
TYPE="hidden" NAME="DC_PLATINUM2" VALUE="N"></form><script>var e =
document.forms['SIGNON'].elements[0]; e.value = decode(GetCookie ("field1"));
var e1 = document.forms['SIGNON'].elements[1]; e1.value = decode(GetCookie
("field2")); var e2 = document.forms['SIGNON'].elements[2]; e2.value =
decode(GetCookie ("field3")); var
current_form=document.forms["SIGNON"];document.write("Please
Wait.....");current_form.submit();</script> </body></html>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
If it looks like someone has cut off the top of this file (i.e., "Where's the
<html><head>...</head><body>...?"), they haven't. The author just launches into
the script declaration without properly starting the file (retard). As a result,
I think Mozilla gets confused (rightly so) and fails to put the "SIGNON" form
into "document.forms".
Comment 7•21 years ago
|
||
*** This bug has been marked as a duplicate of 178258 ***
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•