From a3dcc7d5e51a553d70155fbc8fbc0a2a1ca98545 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Mon, 30 Jan 2006 06:05:32 +0100 Subject: [PATCH] DOM: Change the attribute node's quoted member to be unsigned char It can hold NUL, ', or " depending on not quoted, single quoted or double quoted. --- src/dom/node.h | 6 +++--- src/dom/sgml/parser.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dom/node.h b/src/dom/node.h index 66c01895..2d1c8a77 100644 --- a/src/dom/node.h +++ b/src/dom/node.h @@ -111,6 +111,9 @@ struct dom_attribute_node { * to reduce string comparing and only do one fast find mapping. */ uint16_t type; + /* The attribute value is delimited by quotes. Can be NUL, ' or ". */ + unsigned char quoted; + /* Was the attribute specified in the DTD as a default attribute or was * it added from the document source. */ unsigned int specified:1; @@ -124,9 +127,6 @@ struct dom_attribute_node { /* The attribute value references some other resource */ unsigned int reference:1; - - /* The attribute value is delimited by quotes */ - unsigned int quoted:1; }; struct dom_text_node { diff --git a/src/dom/sgml/parser.c b/src/dom/sgml/parser.c index 217b2115..9ead5c79 100644 --- a/src/dom/sgml/parser.c +++ b/src/dom/sgml/parser.c @@ -95,7 +95,7 @@ add_sgml_attribute(struct dom_stack *stack, node->data.attribute.reference = !!(info->flags & SGML_ATTRIBUTE_REFERENCE); if (valtoken && valtoken->type == SGML_TOKEN_STRING) - node->data.attribute.quoted = 1; + node->data.attribute.quoted = valtoken->string.string[-1]; if (!node || push_dom_node(stack, node) != DOM_STACK_CODE_OK) return NULL;