JavaScript Error: "too much recursion"

RESOLVED DUPLICATE of bug 378171

Status

()

Core
Disability Access APIs
--
major
RESOLVED DUPLICATE of bug 378171
11 years ago
11 years ago

People

(Reporter: mats, Assigned: Aaron Leventhal)

Tracking

({assertion})

Trunk
x86
Linux
assertion
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

11 years ago
STEPS TO REPRODUCE
1. start Firefox debug build
2. open Preferences window
3. switch between the tabs Main, Tabs, Content, etc...

ACTUAL RESULT
************************************************************
WARNING: NS_ENSURE_TRUE(inputField) failed: file nsXULFormControlAccessible.cpp, line 739
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed: file nsAccessible.cpp, line 2333
************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "'[JavaScript Error: "too much recursion" {file: "chrome://global/content/bindings/textbox.xml" line: 0}]' when calling method: [nsIAccessibleProvider::accessibleType]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://global/content/bindings/textbox.xml :: set_value :: line 0"  data: yes]
************************************************************
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed: file nsAccessibilityService.cpp, line 1356
************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "'[JavaScript Error: "too much recursion" {file: "chrome://global/content/bindings/textbox.xml" line: 31}]' when calling method: [nsIAccessibleProvider::accessibleType]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://global/content/bindings/textbox.xml :: set_value :: line 0"  data: yes]
************************************************************
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed: file nsAccessibilityService.cpp, line 1356
************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "'[JavaScript Error: "too much recursion" {file: "chrome://global/content/bindings/textbox.xml" line: 0}]' when calling method: [nsIAccessibleProvider::accessibleType]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://global/content/bindings/textbox.xml :: set_value :: line 0"  data: yes]
************************************************************
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed: file nsAccessibilityService.cpp, line 1356
************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "'[JavaScript Error: "too much recursion" {file: "chrome://global/content/bindings/textbox.xml" line: 0}]' when calling method: [nsIAccessibleProvider::accessibleType]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://global/content/bindings/textbox.xml :: set_value :: line 0"  data: yes]
************************************************************
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed: file nsAccessibilityService.cpp, line 1356
************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "'[JavaScript Error: "too much recursion" {file: "chrome://global/content/bindings/textbox.xml" line: 0}]' when calling method: [nsIDOMXULTextBoxElement::inputField]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://global/content/bindings/textbox.xml :: set_value :: line 0"  data: yes]
************************************************************
WARNING: NS_ENSURE_TRUE(inputField) failed: file nsXULFormControlAccessible.cpp, line 739
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed: file nsAccessible.cpp, line 2333
************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "'[JavaScript Error: "too much recursion" {file: "chrome://global/content/bindings/textbox.xml" line: 0}]' when calling method: [nsIAccessibleProvider::accessibleType]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://global/content/bindings/textbox.xml :: set_value :: line 0"  data: yes]
************************************************************
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed: file nsAccessibilityService.cpp, line 1356
************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "'[JavaScript Error: "too much recursion" {file: "chrome://global/content/bindings/textbox.xml" line: 31}]' when calling method: [nsIAccessibleProvider::accessibleType]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://global/content/bindings/textbox.xml :: set_value :: line 0"  data: yes]
************************************************************
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed: file nsAccessibilityService.cpp, line 1356
************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "'[JavaScript Error: "too much recursion" {file: "chrome://global/content/bindings/textbox.xml" line: 0}]' when calling method: [nsIAccessibleProvider::accessibleType]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "JS frame :: chrome://global/content/bindings/textbox.xml :: set_value :: line 0"  data: yes]
************************************************************
WARNING: NS_ENSURE_TRUE(NS_SUCCEEDED(rv)) failed: file nsAccessibilityService.cpp, line 1356
************************************************************

PLATFORMS AND BUILDS TESTED
Bug occurs in Firefox debug build on Linux
(Reporter)

Comment 1

11 years ago
Created attachment 262115 [details]
stack

The only reason we don't blow the stack is that someone is kind enough to
detect the recursion and break it for us.  Here's the loop:

nsXULTextFieldAccessible::GetState
  nsHTMLTextFieldAccessible::GetState
    nsHyperTextAccessible::GetState
      nsAccessible::GetState
        nsAccessible::IsVisible
          nsAccessible::State
            nsAccessible::GetFinalState
              nsXULTextFieldAccessible::GetState
                ...
(Reporter)

Updated

11 years ago
Severity: normal → major

Comment 2

11 years ago
Looks like accessible->GetParent() returns the same accessible (http://lxr.mozilla.org/mozilla/source/accessible/src/base/nsAccessible.cpp#972). Is it possbile?
(Assignee)

Comment 3

11 years ago
Surkov, no it should never happen like that with the parent.

Mats, I thought you said you had another bug with XUL textfields about their parents.
(Reporter)

Comment 4

11 years ago
(In reply to comment #2)
> Looks like accessible->GetParent() returns the same accessible

Depends on what you mean by "same".  It's not the same as 'this', but
it is the same nsXULTextFieldAccessible as we started with, i.e.
all the nsXULTextFieldAccessible::GetState calls are for the same object.
(Reporter)

Comment 5

11 years ago
(In reply to comment #3)
> Mats, I thought you said you had another bug with XUL textfields about their
> parents.

You mean bug 377767 perhaps?

(Reporter)

Comment 6

11 years ago
Created attachment 262125 [details] [diff] [review]
possible fix
(Reporter)

Comment 7

11 years ago
Do we really want to have an accessible for the anon HTML input inside a
XUL textbox?  if so, feel free to review ;-)

Comment 8

11 years ago
(In reply to comment #4)
> (In reply to comment #2)
> > Looks like accessible->GetParent() returns the same accessible
> 
> Depends on what you mean by "same".  It's not the same as 'this', but
> it is the same nsXULTextFieldAccessible as we started with, i.e.
> all the nsXULTextFieldAccessible::GetState calls are for the same object.
> 

I catch you. xul textbox accessible calls getState for html input accessible (http://lxr.mozilla.org/mozilla/source/accessible/src/xul/nsXULFormControlAccessible.cpp#745) and html input accessible calls getState of xul textbox accessible http://lxr.mozilla.org/mozilla/source/accessible/src/base/nsAccessible.cpp#972)

Comment 9

11 years ago
(In reply to comment #7)
> Do we really want to have an accessible for the anon HTML input inside a
> XUL textbox?  if so, feel free to review ;-)
> 

I guess yes, though it temporary accessible and it is not in accessible tree. It is used to get redirect html input states to xul textbox states.

Patch looks like workaround :).

Aaron, why do we need to check states of parent accessible (see http://lxr.mozilla.org/mozilla/source/accessible/src/base/nsAccessible.cpp#972)? What do "programmatically hidden" mean and why we can't handle this by gecko API?

Comment 10

11 years ago
(In reply to comment #9)

> Patch looks like workaround :).

I mean we have not guarantee we won't get this error later due to the same reason.

Updated

11 years ago
Attachment #262125 - Flags: review?(aaronleventhal)
(Reporter)

Comment 11

11 years ago
(In reply to comment #9)
> I guess yes, though it temporary accessible and it is not in accessible tree.
> It is used to get redirect html input states to xul textbox states.

Ah, right, then I guess we need something like this.
(I suspect one can trigger this recursion using XBL too...)
(Assignee)

Comment 12

11 years ago
Actually the IsVisible() logic we currently have looked like it was messed up by one of my recent patches.

I'm going over it now so it doesn't need to use the parent accessible at all.

Comment 13

11 years ago
(In reply to comment #12)
> Actually the IsVisible() logic we currently have looked like it was messed up
> by one of my recent patches.
> 
> I'm going over it now so it doesn't need to use the parent accessible at all.
> 

Yes, the logic of IsVisible() is wrong a bit. Now *aIsOffscreen never gets value PR_TRUE (see bug 370455).
(Assignee)

Updated

11 years ago
Depends on: 378171
(Assignee)

Comment 14

11 years ago
Comment on attachment 262125 [details] [diff] [review]
possible fix

I guess this does basically the same thing as the patch for bug 378171. Sorry Surkov, I didn't mean to redo the same work.
Attachment #262125 - Flags: review?(aaronleventhal)
(Assignee)

Updated

11 years ago
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 378171
You need to log in before you can comment on or make changes to this bug.