Open Bug 287761 Opened 20 years ago Updated 2 years ago

ASSERTION: we reached a null node ancestor !: 'node' when typing any letter

Categories

(Core :: DOM: Editor, defect)

x86
Windows 2000
defect

Tracking

()

REOPENED

People

(Reporter: mcsmurf, Unassigned)

Details

(Keywords: assertion)

Attachments

(2 files)

When you open composer and type any letter, this assertion appears on every
letter you type:
###!!! ASSERTION: we reached a null node ancestor !: 'node', file d:/mozilla/tree6
/mozilla/editor/libeditor/html/nsHTMLCSSUtils.cpp, line 1426

It also appears when deleting a letter or for example opening the Form
Properties Dialog on a <form>. This makes composer next to unusable in a debug
build on Windows (except you disable the assertions popup).

At the beginning of the function aElement is 0x00000000 and aNode has the childs
[nsHTMLBodyElement] and nsISupports. This assertion happens on the ~60th call to
nsHTMLCSSUtils::GetElementContainerOrSelf (why does this function get called so
often just for typing in one letter?). After the assertion, this function only
gets called two more times (before the letter finally appears ;).
Attached patch patch ideaSplinter Review
nsHTMLUtils::GetComputedProperty() doesn't like working on the document node. 
Probably the documentation should be updated or the code tweaked to ASSERT this
directly.

I didn't see any recent changes which caused this "bug", but it can't have been
too long ago...I got the ASSERT as soon as I started the debugger.
Steve, is there a reason you haven't asked for review on this patch? It'd be
nice to see this assertion be squashed.
I forgot?  I guess I don't know who to ask for a review and expected the owner 
to do something.
Comment on attachment 182810 [details] [diff] [review]
patch idea

Neil, can you review?
Attachment #182810 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 182810 [details] [diff] [review]
patch idea

Neil informs me he's a composer peer, not a editor peer.
Attachment #182810 - Flags: review?(neil.parkwaycc.co.uk) → review?(brade)
I can prevent the assertion by unchecking "Use CSS styles..." in editor prefs,
or by setting a background color. Maybe bug 92686 is related? The time frame is
right. Unfortunately the patch doesn't reverse cleanly against current trunk.
The workarounds make sense, but I don't see the connection with bug 92686.  
Most of the C++ changes for bug 92686 are in nsHTMLEditRules.cpp which is not 
in the call stack.
I just hit this assertion by starting Composer from Navigator in the suite.  I did not have a chance to type any characters.
Keywords: assertion
Is the patch still relevant? (I think so, but shouldn't it have gotten a review by now?)
QA Contact: bugzilla → editor
Assignee: mozeditor → nobody
Ping?
Ping ping?
Attachment #182810 - Flags: review?(brade)
I tried all the ways from Comment 0 and cannot reproduce the assertion anymore. Closing as wfm (though the assertion from Bug 399245 makes the HTML Tags edit mode quite annoying as it asserts all the time).
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
Attached file testcase
Sorry, I still see this assertion with this testcasen on current trunk build.
I was hoping the patch would fix it:
###!!! ASSERTION: bad action nesting!: 'mActionNesting>0', file c:/mozilla-build
/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp, line 385
###!!! ASSERTION: we reached a null node ancestor !: 'node', file c:/mozilla-bui
ld/mozilla/editor/libeditor/html/nsHTMLCSSUtils.cpp, line 1421
WARNING: NS_ENSURE_TRUE(node) failed: file c:/mozilla-build/mozilla/editor/libed
itor/html/nsHTMLCSSUtils.cpp, line 1422
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Ah, why not attach your test case then before I close the bug ;-)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: