From 0e14804238c950af3f2d01213759550a3cb4e139 Mon Sep 17 00:00:00 2001 From: "shaver%netscape.com" Date: Tue, 29 Sep 1998 23:22:25 +0000 Subject: [PATCH] initialize toplevel properly (duh) --- lib/libmocha/lm_dom.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/libmocha/lm_dom.c b/lib/libmocha/lm_dom.c index a8a4a63345bf..8d62471055cd 100644 --- a/lib/libmocha/lm_dom.c +++ b/lib/libmocha/lm_dom.c @@ -486,6 +486,7 @@ LM_ReflectTagNode(PA_Tag *tag, void *doc_state, MWContext *context) cx = context->mocha_context; if (!TOP_NODE(doc)) { + DOM_HTMLElementPrivate *elepriv; #if 0 node = DOM_NewDocument(context, doc); #else @@ -502,6 +503,15 @@ LM_ReflectTagNode(PA_Tag *tag, void *doc_state, MWContext *context) NULL, NULL, NULL, &lm_NodeOps); if (!node) return NULL; + elepriv = XP_NEW_ZAP(DOM_HTMLElementPrivate); + if (!elepriv) { + XP_FREE(node); + return NULL; + } + elepriv->tagtype = P_HTML; + elepriv->doc_id = context->doc_id; + + node->data = elepriv; TOP_NODE(doc)->child = node; node->parent = TOP_NODE(doc); CURRENT_NODE(doc) = node;