Closed
Bug 212532
Opened 21 years ago
Closed 21 years ago
Getting window.history returns null after the first attempt (bug 209866 regression)
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: timwatt, Assigned: caillon)
References
()
Details
(Keywords: regression)
Attachments
(1 file)
556 bytes,
patch
|
caillon
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
Bug 209866 is responsible for getting window.history to fail after the first get. This is due to: http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsGlobalWindow.cpp#1106 - 1100 if (!mHistory && mDocShell) { 1101 mHistory = new HistoryImpl(mDocShell); 1102 if (!mHistory) { 1103 return NS_ERROR_OUT_OF_MEMORY; 1104 } 1105 1106 NS_ADDREF(*aHistory = mHistory); 1107 } (the assignment should happen outside of the if). Patch coming up (gotta test it first).
Moves the addref/assignment outside of the if. Appears to fix the problem. Quick testcase (forgot to post that): 1) access javascript:history (expect "[object History]") 2) access the same URL again (expect the same thing) Before this patch, step 2 yields "null". After it, "[object History]".
Updated•21 years ago
|
Attachment #127636 -
Flags: superreview+
Attachment #127636 -
Flags: review?(caillon)
Assignee | ||
Updated•21 years ago
|
Attachment #127636 -
Flags: review?(caillon) → review+
Comment 2•21 years ago
|
||
Comment on attachment 127636 [details] [diff] [review] Patch r=biesi if you make that NS_IF_ADDREF
Comment 3•21 years ago
|
||
Checking in dom/src/base/nsGlobalWindow.cpp; /cvsroot/mozilla/dom/src/base/nsGlobalWindow.cpp,v <-- nsGlobalWindow.cpp new revision: 1.606; previous revision: 1.605 done (with NS_ADDREF -> NS_IF_ADDREF change done)
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•