break universal dep on lm_dom.h; start wiring DOM_Node<->LO_Element

This commit is contained in:
shaver%netscape.com 1998-08-28 07:53:18 +00:00
Родитель a3b18a4883
Коммит dc8518abd7
3 изменённых файлов: 36 добавлений и 6 удалений

Просмотреть файл

@ -35,10 +35,6 @@
#include "libmocha.h"
#ifdef DOM
#include "dom.h"
#endif
#define MEMORY_ARENAS 1
#define NEXT_ELEMENT state->top_state->element_id++
@ -662,8 +658,9 @@ typedef struct lo_DocState_struct {
#ifdef DOM
Bool in_span;
PA_Block current_span;
DOM_Node *top_node;
DOM_Node *current_node;
void /*DOM_Node*/ *top_node;
void /*DOM_Node*/ *current_node;
void /*DOM_Node*/ *last_node;
#endif
} lo_DocState;

Просмотреть файл

@ -45,6 +45,11 @@
#include "privacy.h"
#include "intl_csi.h"
#ifdef DOM
#include "lm_dom.h"
#endif
/* WEBFONTS are defined only in laytags.c and layout.c */
#define WEBFONTS
@ -7306,6 +7311,19 @@ XP_TRACE(("lo_LayoutTag(%d)\n", tag->type));
*/
lo_PostLayoutTag( context, state, tag, started_in_head);
#ifdef DOM_NOTYET
if (tag->is_end && state->current_node) {
/* mark the end LO_Element for the _last_ node */
LO_Element *eptr = state->line_list;
XP_ASSERT(eptr);
while (eptr->lo_any.next != NULL) {
eptr = eptr->lo_any.next;
}
XP_ASSERT(ELEMENT_PRIV(state->last_node)->ele_start);
ELEMENT_PRIV(state->last_node)->ele_end = eptr;
}
#endif
LO_UnlockLayout();
}

Просмотреть файл

@ -36,6 +36,10 @@
#endif /* NSPR20 */
#include "intl_csi.h"
#ifdef DOM
#include "lm_dom.h"
#endif
#ifdef EDITOR
#include "edt.h"
#endif
@ -2579,6 +2583,17 @@ lo_AppendToLineList(MWContext *context, lo_DocState *state,
}
state->current_span = NULL;
}
/* Wire the element to the DOM Node data for DOM-driven feedback. */
if (CURRENT_NODE(state) &&
CURRENT_NODE(state)->type != NODE_TYPE_DOCUMENT) {
XP_ASSERT(!ELEMENT_PRIV(CURRENT_NODE(state))->ele_end);
eptr = ELEMENT_PRIV(CURRENT_NODE(state))->ele_start;
if (!eptr)
/* this the first element for this node, so mark it */
ELEMENT_PRIV(CURRENT_NODE(state))->ele_start = element;
}
#endif
if (state->current_named_anchor != NULL) {