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

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2015-12-21 11:41:18 +01:00 committed by Alexandre Julliard
parent 7bd995a116
commit bc0eca60c6
3 changed files with 13 additions and 2 deletions

View File

@ -448,7 +448,14 @@ 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);

View File

@ -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__ */

View File

@ -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;