Closed Bug 284710 Opened 20 years ago Closed 13 years ago

Javascript game present in the above mentioned URL does not work in Mozilla.

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: d_menashi, Unassigned)

References

()

Details

(Keywords: classic)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

Hi,

I am Dan Menashi. I have created a game and hosted it in my web site. It works
in IE but does not work in Mozilla.

Following is the link of the game.

http://www.mywirelesskit.com/games-dec192003.html
Thanks,
Dan. 

Reproducible: Always

Steps to Reproduce:
1. Open Internet explorer and type the  URL
http://www.mywirelesskit.com/games-dec192003.html using IE.

2. Now open Mozilla and type the same URL.

3. One can see the difference which is the bug.

Actual Results:  
I could see the difference between the working of IE and Mozilla for uploading
Javascript games.

Expected Results:  
The URL http://www.mywirelesskit.com/games-dec192003.html should work the same
in IE and Mozilla.
Keywords: classic
confirming on firefox
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050302
Firefox/1.0+
Status: UNCONFIRMED → NEW
Ever confirmed: true
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8b2) Gecko/20050303
Kurt, it´s not a good idea to confirm a bug in Component: General, you should
know where to put it.

Hi Dan,
looking at the start page, I´m seeing lots of CSS errors in JS console
you can use http://validator.w3.org/ to check HTML, and
http://jigsaw.w3.org/css-validator/ to check CSS.
http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.mywirelesskit.com%2Fgames-dec192003.html&usermedium=all

Javascript console of Firefox 1.0 doesn´t show CSS errors.

10x
Error: Expected identifier for class selector but found '.'.  Ruleset ignored
due to bad selector.
Source File: http://www.mywirelesskit.com/games-dec192003.html
Line: 8

<style>
..bigcell {
..cell {
..hole {

Try using one dot only ...


10x
Error: Unknown property 'mso-bidi-font-size'.  Declaration dropped.
Source File: http://www.mywirelesskit.com/games-dec192003.html
Line: 0

try using font-size

2x
Warning: Element referenced by ID/NAME in the global scope. Use W3C standard
document.getElementById() instead.
Source File: http://www.mywirelesskit.com/games-dec192003.html
Line: 909
Line: 553

selecting a level gives me three messages, 

then starting the game I get:

Warning: Element referenced by ID/NAME in the global scope. Use W3C standard
document.getElementById() instead.
Source File: http://www.mywirelesskit.com/games-dec192003.html
Line: 553

function getCell(row, col)

{   <- Line 553

  return eval("a_" + row + "_" + col);

}


Warning: reference to undefined property getCell(t, ghcol).click
Source File: http://www.mywirelesskit.com/games-dec192003.html
Line: 873
Error: getCell(t, ghcol).click is not a function
Source File: http://www.mywirelesskit.com/games-dec192003.html
Line: 873

873:    while (t == ghrow) t = r0(gsize); //skip holes

        getCell(t,ghcol).click();

I don´t know enough about JS to tell you what is wrong here,
there is a famous JS debugger available for Firefox, Venkman
http://www.mozilla.org/projects/venkman/venkman-walkthrough.html
http://www.hacksrus.com/~ginda/venkman/
I'm pretty sure I didn't change this to NEW. I was just saying in my post that I
can confirm this bug also on Firefox.
Here is what the javascript console says about that page.

Warning: Element referenced by ID/NAME in the global scope. Use W3C standard
document.getElementById() instead.
Source File: http://www.mywirelesskit.com/games-dec192003.html
Line: 909

Warning: Element referenced by ID/NAME in the global scope. Use W3C standard
document.getElementById() instead.
Source File: http://www.mywirelesskit.com/games-dec192003.html
Line: 553

(A bunch of these errors on many different lines)
Error: Expected identifier for class selector but found '.'.  Ruleset ignored
due to bad selector.
Source File: http://www.mywirelesskit.com/games-dec192003.html
Line: 72 

(bunch fo these on different lines also)
Error: Unknown property 'mso-bidi-font-size'.  Declaration dropped.
Source File: http://www.mywirelesskit.com/games-dec192003.html
Line: 0
> I'm pretty sure I didn't change this to NEW.

You most certainly did -- see
https://bugzilla.mozilla.org/show_activity.cgi?id=284710

The warnings are just that, warnings.  Not fatal.

What _is_ fatal is that when I click "start game" I get:

Error: getCell(t, ghcol).click is not a function
Source File: http://www.mywirelesskit.com/games-dec192003.html
Line: 873

Dan, it looks like getCell() returns a <td> node.  Why would this have a "click"
method?  I don't see you setting one in your JS anywhere.
Hi All,
Thanks a lot for working on the bug I reported. I agree that my Javascript in
the game is not that clean. But my point was if the game runs on IE then why it
does not run in Firefox.

In other words what can we do to run this game as it is in Firefox. We have to
keep in mind that there may be thousands such games in internet which actually
work in IE but would not work in Firefox.

Dont you guys feel that this can hurt the popularity of Firefox. Atleast my
game's users wont be inclined  much to use Firefox for playing the game b'cos
the game does not work there.

Bottomline is we have to make Firefox as simple as possible so that it takes in
bad code as well as IE takes in.

Thanks,
Dan. 
> In other words what can we do to run this game as it is in Firefox. 

I can't tell _why_ this game works in IE.  It looks like you're calling click()
on a table cell.  Does IE allow calling click() on any element in the DOM?
Ah.  Dan, that's your answer.  The game in question is using an IE-proprietary
method instead of using the standard DOM way of dispatching click events.

If this method is very widely used it may be worth implementing, but it doesn't
seem to be.
This implements click() on all elements, seems like this is probably worth it.
Attachment #176950 - Flags: superreview?(bzbarsky)
Attachment #176950 - Flags: review?(bzbarsky)
... based on talking to Bob, that is.
Comment on attachment 176950 [details] [diff] [review]
Implement click() on all HTML elements.

If Bob says this is used...

>Index: dom/public/idl/html/nsIDOMNSHTMLElement.idl

>+  void click();

Document that this sends a left-click event, with all modifiers set to false?

>Index: content/html/content/src/nsGenericHTMLElement.cpp

>+NS_IMETHODIMP
>+nsGenericHTMLElement::Click()
>+{

Do we need to worry about people calling this from the onclick handler?

>+      if (context) {
>+        nsEventStatus status = nsEventStatus_eIgnore;
>+        nsMouseEvent event(NS_MOUSE_LEFT_CLICK);
>+
>+        HandleDOMEvent(context, &event, nsnull, NS_EVENT_FLAG_INIT, &status);

Hmm... want to make nsGenericHTMLElement::DispatchClickEvent deal with lack of
an aSourceEvent and use that here?  That'll make the presshell aware that we're
handling an event and all....  You want PR_FALSE for aFullDispatch, if you do
that.
Comment on attachment 176950 [details] [diff] [review]
Implement click() on all HTML elements.

r- to get attention for review comments....
Attachment #176950 - Flags: superreview?(bzbarsky)
Attachment #176950 - Flags: superreview-
Attachment #176950 - Flags: review?(bzbarsky)
Attachment #176950 - Flags: review-
Hi All,
Thanks a lot for creating this patch. Please let me know as to when this patch
would be implemented. I am eagerly waiting to try my game
http://www.mywirelesskit.com/games-dec192003.html

in the Firefox browser.

Thanks,
Dan
Looking at the patch, why do the two existing click() implementations prevent
recursion, but not the new one? Seems like we'd want to just prevent clicks from
being recursive in general? Or...?

What does IE do? What should the WHATWG spec say?
Component: General → DOM: HTML
Product: Mozilla Application Suite → Core
Version: unspecified → Trunk
Component: DOM: HTML → DOM: Core & HTML
QA Contact: general → general
Is this a wontfix ?
Assignee: general → nobody
Given that the game is gone, lets go with incomplete.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: