[gxml: 7/25] Implement Element.matches
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml: 7/25] Implement Element.matches
- Date: Tue, 19 Mar 2019 17:45:56 +0000 (UTC)
commit 301f134be5f6c56a301fb19bbc04158862a9cfc3
Author: BZHDeveloper <inizan yannick gmail com>
Date: Thu Nov 1 21:13:27 2018 +0100
Implement Element.matches
gxml/DomElement.vala | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/gxml/DomElement.vala b/gxml/DomElement.vala
index 35c30f4..2cd05eb 100644
--- a/gxml/DomElement.vala
+++ b/gxml/DomElement.vala
@@ -67,6 +67,12 @@ public interface GXml.DomElement : GLib.Object,
public abstract DomHTMLCollection get_elements_by_tag_name(string local_name);
public abstract DomHTMLCollection get_elements_by_tag_name_ns (string? namespace, string local_name);
public abstract DomHTMLCollection get_elements_by_class_name (string class_names);
+
+ public bool matches (string selectors) throws GLib.Error {
+ var parser = new CssSelectorParser();
+ parser.parse (selectors);
+ return parser.match (selectors);
+ }
}
public class GXml.DomElementList : Gee.ArrayList<DomElement>, GXml.DomHTMLCollection {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]