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

Misc cleanups and improvements

This commit is contained in:
Jonas Fonseca 2005-12-20 00:01:18 +01:00 committed by Jonas Fonseca
parent f5b102cfea
commit 8e769d48a5
2 changed files with 4 additions and 17 deletions

View File

@ -284,7 +284,8 @@ parse_dom_select_pseudo(struct dom_select *select, struct dom_select_node *sel,
token = get_next_scanner_token(scanner);
} while (token && token->type == ':');
if (!token) return DOM_ERR_SYNTAX;
if (!token || token->type != CSS_TOKEN_IDENT)
return DOM_ERR_SYNTAX;
pseudo = get_dom_select_pseudo(token);
switch (pseudo) {
@ -492,23 +493,9 @@ parse_dom_select(struct dom_select *select, unsigned char *string, int length)
if (select->selector)
return DOM_ERR_NONE;
WDBG("All has failed ...");
return DOM_ERR_INVALID_STATE;
}
void
print_dom_select(struct dom_select *select)
{
if (select->selector) {
struct dom_node *node = (struct dom_node *) select->selector;
done_dom_node(node);
}
mem_free(select);
}
struct dom_select *
init_dom_select(enum dom_select_syntax syntax,
unsigned char *string, int length)

View File

@ -46,7 +46,7 @@ enum dom_select_element_match {
/* The special CSS .bar class attribute syntax is represented as
* E[class="bar"]. The ID flag will match against any attribute with it's
* boolean id member set. XXX: These flags are ATM mutual exclusive. */
* boolean id member set. XXX: These flags are ATM mutually exclusive. */
enum dom_select_attribute_match {
/* Matches any set value: E[foo] */
DOM_SELECT_ATTRIBUTE_ANY = 1,
@ -104,7 +104,7 @@ struct dom_select_nth_match {
* for holding data for attribute matching and element text matching. */
struct dom_select_node {
/* This holds the DOM node which has data about the node being matched.
* It can be either an element, attribute, and a text node. */
* It can be either an element, attribute, or a text node. */
/* XXX: Keep at the top. This is used for translating dom_node
* reference to dom_select_node. */
struct dom_node node;