Commit bc0eca60 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msxml3: Store information about ignorrable whitespace nodes in xmlNode._private variable.

parent 7bd995a1
......@@ -448,8 +448,15 @@ static void sax_characters(void *ctx, const xmlChar *ch, int len)
(!ctxt->node->last ||
((ctxt->node->last && (cur == '<' || ctxt->node->last->type != XML_TEXT_NODE))
)))
{
/* Keep information about ignorable whitespace text node in previous or parent node */
if (ctxt->node->last)
*(DWORD*)&ctxt->node->last->_private |= NODE_PRIV_TRAILING_IGNORABLE_WS;
else if (ctxt->node->type != XML_DOCUMENT_NODE)
*(DWORD*)&ctxt->node->_private |= NODE_PRIV_CHILD_IGNORABLE_WS;
return;
}
}
xmlSAX2Characters(ctxt, ch, len);
}
......
......@@ -559,4 +559,7 @@ HRESULT detach_bsc(bsc_t*) DECLSPEC_HIDDEN;
/* ... */
#define E_XML_REQUIRED_ATTRIBUTE_MISSING 0xC00CE020
#define NODE_PRIV_TRAILING_IGNORABLE_WS 0x40000000
#define NODE_PRIV_CHILD_IGNORABLE_WS 0x80000000
#define NODE_PRIV_REFCOUNT_MASK ~(NODE_PRIV_TRAILING_IGNORABLE_WS|NODE_PRIV_CHILD_IGNORABLE_WS)
#endif /* __MSXML_PRIVATE__ */
......@@ -398,7 +398,7 @@ HRESULT node_get_next_sibling(xmlnode *This, IXMLDOMNode **ret)
static int node_get_inst_cnt(xmlNodePtr node)
{
int ret = *(LONG *)&node->_private;
int ret = *(LONG *)&node->_private & NODE_PRIV_REFCOUNT_MASK;
xmlNodePtr child;
/* add attribute counts */
......@@ -429,7 +429,8 @@ int xmlnode_get_inst_cnt(xmlnode *node)
return node_get_inst_cnt(node->node);
}
/* _private field holds a number of COM instances spawned from this libxml2 node */
/* _private field holds a number of COM instances spawned from this libxml2 node
* most significant bits are used to store information about ignorrable whitespace nodes */
static void xmlnode_add_ref(xmlNodePtr node)
{
if (node->type == XML_DOCUMENT_NODE) return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment