Don't return a dom:document as parent
Mon Nov 23 11:36:20 UTC 2009 pix@kepibu.org
* Don't return a dom:document as parent
diff -rN -u old-Oh, Ducks!/traversal/dom.lisp new-Oh, Ducks!/traversal/dom.lisp
--- old-Oh, Ducks!/traversal/dom.lisp 2015-04-10 16:16:04.000000000 +0000
+++ new-Oh, Ducks!/traversal/dom.lisp 2015-04-10 16:16:04.000000000 +0000
@@ -8,10 +8,10 @@
(defmethod element-children ((element dom:element))
(remove-if-not #'dom:element-p (coerce (dom:child-nodes element) 'list)))
-(defmethod element-parent ((element dom:document))
- nil)
(defmethod element-parent ((element dom:element))
- (dom:parent-node element))
+ (let ((parent (dom:parent-node element)))
+ (unless (typep parent 'dom:document)
+ parent)))
(defmethod element-attribute ((attribute symbol) (element dom:element))
(element-attribute (string-downcase (symbol-name attribute)) element))