1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-28 01:35:32 +00:00

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.
This commit is contained in:
Jonas Fonseca 2006-01-30 06:05:32 +01:00 committed by Jonas Fonseca
parent bc50084475
commit a3dcc7d5e5
2 changed files with 4 additions and 4 deletions

View File

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

View File

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