[gxml: 24/25] GDocument : use GomNodeList in 'query_selector_all' method. Reason : GListChildren is invalid, size



commit e4097a1c64ff91e82aadb5afd5c382330f4d243a
Author: BZHDeveloper <inizan yannick gmail com>
Date:   Sun Mar 17 03:04:02 2019 +0100

    GDocument : use GomNodeList in 'query_selector_all' method.
            Reason : GListChildren is invalid, size == -1 at initialization, and we can't add child

 gxml/GXmlDocument.vala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gxml/GXmlDocument.vala b/gxml/GXmlDocument.vala
index 74b9773..19e3006 100644
--- a/gxml/GXmlDocument.vala
+++ b/gxml/GXmlDocument.vala
@@ -357,11 +357,11 @@ public class GXml.GDocument : GXml.GNode,
   public DomNodeList query_selector_all (string selectors) throws GLib.Error  {
     var cs = new CssSelectorParser ();
     cs.parse (selectors);
-    var l = new GListChildren (this, get_internal_node());
+    var l = new GomNodeList();
     foreach (GXml.Node e in children_nodes) {
       if (!(e is DomElement)) continue;
       if (cs.match (e as DomElement))
-        l.add (e);
+        l.add (e as DomNode);
       l.add_all (cs.query_selector_all (e as DomElement));
     }
     return l;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]