[prev in list] [next in list] [prev in thread] [next in thread] 

List:       elinks-cvs
Subject:    [ELinks] elinks (ECMASCRIPT) - jonas: A little cleanup of the pop ...
From:       cvs () pasky ! ji ! cz
Date:       2004-02-28 20:41:02
Message-ID: 20040228204102.25009.qmail () machine ! sinus ! cz
[Download RAW message or body]

This is an automated notification of a change to the ELinks CVS tree.

Author: jonas
Module: elinks
   Tag: ECMASCRIPT
  Date: Sat Feb 28 20:41:02 2004 GMT

---- Log message:

A little cleanup of the pop callback.


---- Files affected:

elinks/src/document/dom:
   navigator.c (1.1.2.33 -> 1.1.2.34) 
    http://cvsweb.elinks.or.cz/cvsweb.cgi/elinks/src/document/dom/navigator.c.diff?r1=1.1.2.33&r2=1.1.2.34&f=u
 elinks/src/document/sgml/html:
   html.c (1.1.2.14 -> 1.1.2.15) 
    http://cvsweb.elinks.or.cz/cvsweb.cgi/elinks/src/document/sgml/html/html.c.diff?r1=1.1.2.14&r2=1.1.2.15&f=u



---- Diffs:

 elinks/src/document/dom/navigator.c  |    7 ++++---
 elinks/src/document/sgml/html/html.c |    5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)


Index: elinks/src/document/dom/navigator.c
diff -u elinks/src/document/dom/navigator.c:1.1.2.33 \
                elinks/src/document/dom/navigator.c:1.1.2.34
--- elinks/src/document/dom/navigator.c:1.1.2.33	Sat Feb 28 21:31:48 2004
+++ elinks/src/document/dom/navigator.c	Sat Feb 28 21:40:57 2004
@@ -116,7 +116,7 @@
 }
 
 static inline void
-do_pop_dom_node(struct dom_navigator *navigator, ...)
+do_pop_dom_node(struct dom_navigator *navigator, struct dom_node *node, ...)
 {
 	struct dom_navigator_state *item;
 
@@ -127,8 +127,9 @@
 	if (item->callback) {
 		va_list args;
 
-		va_start(args, navigator);
-		item->callback(navigator, item->node, args);
+		va_start(args, node);
+		/* Pass the node we are popping to and _not_ the item->node */
+		item->callback(navigator, node, args);
 		va_end(args);
 	}
 
Index: elinks/src/document/sgml/html/html.c
diff -u elinks/src/document/sgml/html/html.c:1.1.2.14 \
                elinks/src/document/sgml/html/html.c:1.1.2.15
--- elinks/src/document/sgml/html/html.c:1.1.2.14	Sat Feb 28 21:31:49 2004
+++ elinks/src/document/sgml/html/html.c	Sat Feb 28 21:40:57 2004
@@ -69,12 +69,13 @@
 	struct dom_node *parent;
 	struct dom_node_list **list;
 	struct scanner_token *token;
-	struct dom_node *pop_target = va_arg(args, struct dom_node *);
 
 	assert(navigator && parser && node);
 	assert(dom_navigator_has_parents(navigator));
 
-	if (pop_target != node) return NULL;
+	/* Are we the actual node being popped? */
+	if (node != get_dom_navigator_top(navigator)->node)
+		return NULL;
 
 	parent = get_dom_navigator_parent(navigator)->node;
 	list   = get_dom_node_list(parent, node);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic