From 85ab2472d82ff11602ba27241b8423bf46c41379 Mon Sep 17 00:00:00 2001 From: Daniel Espinosa Date: Wed, 6 Sep 2017 08:18:48 -0700 Subject: [PATCH] CssSelectorParser.match() fixed for E[prop] --- gxml/css-selector-parser.vala | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gxml/css-selector-parser.vala b/gxml/css-selector-parser.vala index e89a1f8b..298fa94f 100644 --- a/gxml/css-selector-parser.vala +++ b/gxml/css-selector-parser.vala @@ -310,22 +310,17 @@ public class GXml.CssSelectorParser : GLib.Object { } public bool match (DomElement element) { bool is_element = false; - bool is_inside = false; for (int i = 0; i < selectors.size; i++) { CssSelectorData s = selectors.get (i); if (s.selector_type == CssSelectorType.ALL) return true; + if (s.selector_type == CssSelectorType.INSIDE) continue; if (s.selector_type == CssSelectorType.ELEMENT) { if (element.node_name.down () != s.data.down ()) return false; is_element = true; if ((i+1) >= selectors.size) return true; continue; } - if (is_element && s.selector_type != CssSelectorType.INSIDE) return true; - if (is_element && s.selector_type == CssSelectorType.INSIDE) { - is_inside = true; - continue; - } - if (is_element && is_inside && s.selector_type == CssSelectorType.ATTRIBUTE) { + if (is_element && s.selector_type == CssSelectorType.ATTRIBUTE) { var p = element.get_attribute (s.data); if (p != null) return true; } -- GitLab