[gxml] CssSelectorParser.match() fixed for E[prop]



commit 85ab2472d82ff11602ba27241b8423bf46c41379
Author: Daniel Espinosa <esodan gmail com>
Date:   Wed Sep 6 08:18:48 2017 -0700

    CssSelectorParser.match() fixed for E[prop]

 gxml/css-selector-parser.vala |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/gxml/css-selector-parser.vala b/gxml/css-selector-parser.vala
index e89a1f8..298fa94 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;
                        }


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