add LM_Set/ClearNodeFlags
This commit is contained in:
Родитель
1675302421
Коммит
217a13ac87
|
@ -671,3 +671,29 @@ DOM_HTMLPopElementByType(TagType type, DOM_Element *element)
|
|||
return closing;
|
||||
}
|
||||
|
||||
JSBool
|
||||
LM_SetNodeFlags(DOM_Node *node, uint32 flags)
|
||||
{
|
||||
DOM_HTMLElementPrivate *priv;
|
||||
if (!(node->type == NODE_TYPE_ELEMENT ||
|
||||
node->type == NODE_TYPE_TEXT))
|
||||
return JS_FALSE;
|
||||
priv = ELEMENT_PRIV(node);
|
||||
if (!priv)
|
||||
return JS_FALSE;
|
||||
priv->flags |= flags;
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JSBool
|
||||
LM_ClearNodeFlags(DOM_Node *node, uint32 flags)
|
||||
{
|
||||
DOM_HTMLElementPrivate *priv = ELEMENT_PRIV(node);
|
||||
if (!(node->type == NODE_TYPE_ELEMENT ||
|
||||
node->type == NODE_TYPE_TEXT) ||
|
||||
!priv)
|
||||
return JS_FALSE;
|
||||
return JS_FALSE;
|
||||
priv->flags &= ~flags;
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
|
|
@ -31,8 +31,21 @@ typedef struct DOM_HTMLElementPrivate {
|
|||
LO_Element * ele_start;
|
||||
LO_Element * ele_end;
|
||||
int32 doc_id;
|
||||
uint32 flags;
|
||||
} DOM_HTMLElementPrivate;
|
||||
|
||||
|
||||
#define STYLE_NODE_NEED_TO_POP_TABLE 0x01
|
||||
#define STYLE_NODE_NEED_TO_POP_LIST 0x02
|
||||
#define STYLE_NODE_NEED_TO_POP_MARGINS 0x04
|
||||
#define STYLE_NODE_NEED_TO_POP_FONT 0x08
|
||||
#define STYLE_NODE_NEED_TO_POP_PRE 0x10
|
||||
#define STYLE_NODE_NEED_TO_POP_ALIGNMENT 0x20
|
||||
#define STYLE_NODE_NEED_TO_POP_LINE_HEIGHT 0x40
|
||||
#define STYLE_NODE_NEED_TO_POP_LAYER 0x80
|
||||
|
||||
#define LM_NODE_FLAGS_ALL 0xff
|
||||
|
||||
#define ELEMENT_PRIV(e) ((DOM_HTMLElementPrivate *)(((DOM_Node *)(e))->data))
|
||||
#define CURRENT_NODE(d) ((DOM_Node *)(d->top_state->current_node))
|
||||
#define TOP_NODE(d) ((DOM_Node *)(d->top_state->top_node))
|
||||
|
@ -58,6 +71,12 @@ lm_DestroyDocumentNodes(MWContext *context);
|
|||
JSBool
|
||||
lm_CheckDocId(MWContext *context, DOM_HTMLElementPrivate *priv);
|
||||
|
||||
JSBool
|
||||
LM_SetNodeFlags(DOM_Node *node, uint32 flags);
|
||||
|
||||
JSBool
|
||||
LM_ClearNodeFlags(DOM_Node *node, uint32 flags);
|
||||
|
||||
#endif /* DOM */
|
||||
|
||||
#endif /* LM_DOM_H */
|
||||
|
|
Загрузка…
Ссылка в новой задаче