mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-29 03:17:53 -04:00
Misc cleanups and improvements
This commit is contained in:
parent
f5b102cfea
commit
8e769d48a5
@ -284,7 +284,8 @@ parse_dom_select_pseudo(struct dom_select *select, struct dom_select_node *sel,
|
|||||||
token = get_next_scanner_token(scanner);
|
token = get_next_scanner_token(scanner);
|
||||||
} while (token && token->type == ':');
|
} 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);
|
pseudo = get_dom_select_pseudo(token);
|
||||||
switch (pseudo) {
|
switch (pseudo) {
|
||||||
@ -492,23 +493,9 @@ parse_dom_select(struct dom_select *select, unsigned char *string, int length)
|
|||||||
if (select->selector)
|
if (select->selector)
|
||||||
return DOM_ERR_NONE;
|
return DOM_ERR_NONE;
|
||||||
|
|
||||||
WDBG("All has failed ...");
|
|
||||||
|
|
||||||
return DOM_ERR_INVALID_STATE;
|
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 *
|
struct dom_select *
|
||||||
init_dom_select(enum dom_select_syntax syntax,
|
init_dom_select(enum dom_select_syntax syntax,
|
||||||
unsigned char *string, int length)
|
unsigned char *string, int length)
|
||||||
|
@ -46,7 +46,7 @@ enum dom_select_element_match {
|
|||||||
|
|
||||||
/* The special CSS .bar class attribute syntax is represented as
|
/* The special CSS .bar class attribute syntax is represented as
|
||||||
* E[class="bar"]. The ID flag will match against any attribute with it's
|
* 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 {
|
enum dom_select_attribute_match {
|
||||||
/* Matches any set value: E[foo] */
|
/* Matches any set value: E[foo] */
|
||||||
DOM_SELECT_ATTRIBUTE_ANY = 1,
|
DOM_SELECT_ATTRIBUTE_ANY = 1,
|
||||||
@ -104,7 +104,7 @@ struct dom_select_nth_match {
|
|||||||
* for holding data for attribute matching and element text matching. */
|
* for holding data for attribute matching and element text matching. */
|
||||||
struct dom_select_node {
|
struct dom_select_node {
|
||||||
/* This holds the DOM node which has data about the node being matched.
|
/* 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
|
/* XXX: Keep at the top. This is used for translating dom_node
|
||||||
* reference to dom_select_node. */
|
* reference to dom_select_node. */
|
||||||
struct dom_node node;
|
struct dom_node node;
|
||||||
|
Loading…
Reference in New Issue
Block a user