Closed Bug 161855 Opened 23 years ago Closed 19 years ago

Assertion: !aElementId.IsEmpty(), "getElementById(\"\") called, fix caller?"

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 296237
Future

People

(Reporter: rbs, Assigned: hjtoi-bugzilla)

References

Details

With a tip of the trunk, I hit the assertion in nsHTMLDocument::GetElementById() when visiting: http://www.adobe.com/products/incopy/ NTDLL! 77f9eea9() nsDebug::Assertion(const char * 0x01f22c9c, const char * 0x01f22c84, const char * 0x01f22c38, int 2838) line 280 + 13 bytes nsDebug::WarnIfFalse(const char * 0x01f22c9c, const char * 0x01f22c84, const char * 0x01f22c38, int 2838) line 397 + 21 bytes nsHTMLDocument::GetElementById(nsHTMLDocument * const 0x05e64bdc, const nsAString & {...}, nsIDOMElement * * 0x0012cc5c) line 2838 + 39 bytes XPTC_InvokeByIndex(nsISupports * 0x05e64db0, unsigned int 44, unsigned int 2, nsXPTCVariant * 0x0012cc4c) line 106 XPCWrappedNative::CallMethod(XPCCallContext & {...}, XPCWrappedNative::CallMode CALL_METHOD) line 1994 + 42 bytes XPC_WN_CallMethod(JSContext * 0x05dbb938, JSObject * 0x05560868, unsigned int 1, long * 0x05e2225c, long * 0x0012cf28) line 1266 + 14 bytes js_Invoke(JSContext * 0x05dbb938, unsigned int 1, unsigned int 0) line 838 + 23 bytes js_Interpret(JSContext * 0x05dbb938, long * 0x0012dd68) line 2791 + 15 bytes js_Invoke(JSContext * 0x05dbb938, unsigned int 1, unsigned int 2) line 855 + 13 bytes js_InternalInvoke(JSContext * 0x05dbb938, JSObject * 0x04d9b6e0, long 81377416, unsigned int 0, unsigned int 1, long * 0x0012dfc0, long * 0x0012de90) line 930 + 20 bytes JS_CallFunctionValue(JSContext * 0x05dbb938, JSObject * 0x04d9b6e0, long 81377416, unsigned int 1, long * 0x0012dfc0, long * 0x0012de90) line 3431 + 31 bytes nsJSContext::CallEventHandler(nsJSContext * const 0x05dbb8d0, void * 0x04d9b6e0, void * 0x04d9b888, unsigned int 1, void * 0x0012dfc0, int * 0x0012dfc4, int 1) line 1041 + 33 bytes nsJSEventListener::HandleEvent(nsJSEventListener * const 0x05fa5078, nsIDOMEvent * 0x05f19c80) line 182 + 77 bytes nsEventListenerManager::HandleEventSubType(nsListenerStruct * 0x05fa5138, nsIDOMEvent * 0x05f19c80, nsIDOMEventTarget * 0x05d667c0, unsigned int 16, unsigned int 2) line 1274 + 20 bytes nsEventListenerManager::HandleEvent(nsEventListenerManager * const 0x05fa5010, nsIPresContext * 0x05e68dc0, nsEvent * 0x0012ee5c, nsIDOMEvent * * 0x0012ece8, nsIDOMEventTarget * 0x05d667c0, unsigned int 2, nsEventStatus * 0x0012eea4) line 1438 + 36 bytes nsGenericElement::HandleDOMEvent(nsGenericElement * const 0x05fa4eb0, nsIPresContext * 0x05e68dc0, nsEvent * 0x0012ee5c, nsIDOMEvent * * 0x0012ece8, unsigned int 2, nsEventStatus * 0x0012eea4) line 1819 nsGenericHTMLElement::HandleDOMEventForAnchors(nsIContent * 0x05fa4eb0, nsIPresContext * 0x05e68dc0, nsEvent * 0x0012ee5c, nsIDOMEvent * * 0x0012ece8, unsigned int 2, nsEventStatus * 0x0012eea4) line 1371 + 32 bytes nsHTMLAnchorElement::HandleDOMEvent(nsHTMLAnchorElement * const 0x05fa4eb0, nsIPresContext * 0x05e68dc0, nsEvent * 0x0012ee5c, nsIDOMEvent * * 0x0012ece8, unsigned int 2, nsEventStatus * 0x0012eea4) line 359 nsGenericElement::HandleDOMEvent(nsGenericElement * const 0x05fa53c8, nsIPresContext * 0x05e68dc0, nsEvent * 0x0012ee5c, nsIDOMEvent * * 0x0012ece8, unsigned int 1, nsEventStatus * 0x0012eea4) line 1845 + 50 bytes nsHTMLImageElement::HandleDOMEvent(nsHTMLImageElement * const 0x05fa53c8, nsIPresContext * 0x05e68dc0, nsEvent * 0x0012ee5c, nsIDOMEvent * * 0x00000000, unsigned int 1, nsEventStatus * 0x0012eea4) line 611 nsEventStateManager::GenerateMouseEnterExit(nsIPresContext * 0x05e68dc0, nsGUIEvent * 0x0012f8a0) line 2376 nsEventStateManager::PreHandleEvent(nsEventStateManager * const 0x05e77a38, nsIPresContext * 0x05e68dc0, nsEvent * 0x0012f8a0, nsIFrame * 0x05fe877c, nsEventStatus * 0x0012f698, nsIView * 0x05ef63a0) line 393 PresShell::HandleEventInternal(nsEvent * 0x0012f8a0, nsIView * 0x05ef63a0, unsigned int 1, nsEventStatus * 0x0012f698) line 6099 + 43 bytes PresShell::HandleEvent(PresShell * const 0x05e73bfc, nsIView * 0x05ef63a0, nsGUIEvent * 0x0012f8a0, nsEventStatus * 0x0012f698, int 0, int & 1) line 6028 + 25 bytes nsViewManager::HandleEvent(nsView * 0x05ef6120, nsGUIEvent * 0x0012f8a0, int 0) line 2098 nsView::HandleEvent(nsViewManager * 0x05e18590, nsGUIEvent * 0x0012f8a0, int 0) line 301 nsViewManager::DispatchEvent(nsViewManager * const 0x05e18590, nsGUIEvent * 0x0012f8a0, nsEventStatus * 0x0012f79c) line 1903 + 23 bytes HandleEvent(nsGUIEvent * 0x0012f8a0) line 83 nsWindow::DispatchEvent(nsWindow * const 0x05ef61dc, nsGUIEvent * 0x0012f8a0, nsEventStatus & nsEventStatus_eIgnore) line 1034 + 10 bytes nsWindow::DispatchWindowEvent(nsGUIEvent * 0x0012f8a0) line 1055 nsWindow::DispatchMouseEvent(unsigned int 300, unsigned int 0, nsPoint * 0x00000000) line 5125 + 21 bytes ChildWindow::DispatchMouseEvent(unsigned int 300, unsigned int 0, nsPoint * 0x00000000) line 5382 nsWindow::ProcessMessage(unsigned int 512, unsigned int 0, long 13500863, long * 0x0012fcec) line 3833 + 28 bytes nsWindow::WindowProc(HWND__ * 0x00ac0702, unsigned int 512, unsigned int 0, long 13500863) line 1303 + 27 bytes USER32! 77e148dc() USER32! 77e14aa7() USER32! 77e266fd() nsAppShellService::Run(nsAppShellService * const 0x010c5200) line 452 main1(int 1, char * * 0x00284fb0, nsISupports * 0x00000000) line 1516 + 32 bytes main(int 1, char * * 0x00284fb0) line 1880 + 37 bytes mainCRTStartup() line 338 + 17 bytes KERNEL32! 77e992a6()
Heikki added that assertion. Could we make that assert only if the caller is chrome? That way we'd know if someone does something silly in our chrome code while not asserting of someone decides to call getElementById(""); in a webpage. This assert really shouldn't be an assert, at least not when called from JS on a webpage.
Assignee: jst → heikki
OS: Windows 2000 → All
Hardware: PC → All
Blocks: 160540
Target Milestone: --- → Future
Is this still an issue?
This bug is older but bug 296237 has a patch and a target milestone. *** This bug has been marked as a duplicate of 296237 ***
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.