Closed
Bug 656283
Opened 13 years ago
Closed 13 years ago
accessing document.activeElement throws an exception
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: miroslav.kroc, Assigned: smaug)
Details
Attachments
(1 file)
4.13 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; cs; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17 Build Identifier: Firefox 3.6.17, Firefox 4.0.0 JS exception "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE" occurs if property document.activeElement refers to DOM element from previous document. We discovered this bug in following scenario. Website contains two pages. First page is login page with two input elements for username and password and "submit" button. Second page is a page accessing document.activeElement. User click on "submit" button (first step) and then on input element with username (second step). JS exception mentioned above occurs when the second page (loaded after submitting the first page) tries to access document.activeElement property. I can reproduce this bug easily in Firefox with Firebug. Reproducible: Sometimes Steps to Reproduce: 1. load simple login page (username, password, submit button) 2. fill username and password 3. click on "submit" button (active element is button) 4. click on input element before the second page appears (active element is input element) 5. wait until the second page is loaded Actual Results: JS exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSDocument.activeElement]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://serverName/pathToFile :: <TOP_LEVEL> :: line 24" data: no] Expected Results: No js exception. Property document.activeElement refers to any DOM element in the current document or is null. This bug is OS and version independent. Used software: - Firefox 3.6.17, Firefox 4.0.0 - Windows 7 x64, Windows 7 x86, MacOs 10.6
Assignee | ||
Comment 1•13 years ago
|
||
A testcase would be great.
Assignee | ||
Comment 2•13 years ago
|
||
But the implementation is certainly wrong. (And I reviewed the code :( )
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → Olli.Pettay
Assignee | ||
Comment 3•13 years ago
|
||
Patch with tests coming....
Assignee | ||
Comment 4•13 years ago
|
||
This should do it. Make sure .activeElement doesn't throw, ever.
Attachment #531662 -
Flags: review?(bzbarsky)
Comment 5•13 years ago
|
||
Comment on attachment 531662 [details] [diff] [review] patch r=me
Attachment #531662 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 6•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/a14401a8f9f2
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 7•13 years ago
|
||
Thank you for fast solution. I apologize for missing testcase. We haven't finished simplified testcase when this bug was reported.
You need to log in
before you can comment on or make changes to this bug.
Description
•