Lines Matching refs:root
56 function node_have_class($root, $target_class) { argument
57 if (!$root->has_attribute('class')) { return false; };
59 $classes = preg_split("/\s+/", strtolower($root->get_attribute('class')));
70 function match_selector($selector, $root) { argument
73 if ($selector[1] == strtolower($root->tagname())) { return true; };
76 if ($selector[1] == strtolower($root->get_attribute('id'))) { return true; };
79 if (node_have_class($root, $selector[1])) { return true; }
80 if ($selector[1] == strtolower($root->get_attribute('class'))) { return true; };
83 if ((node_have_class($root, $selector[2])) &&
84 ($selector[1] == strtolower($root->tagname()))) { return true; };
88 if (!match_selector($subselector, $root)) { return false; };
93 $node = $root->parent();
101 $node = $root->parent();
108 return $root->has_attribute($attr_name);
122 if (!$root->has_attribute($attr_name)) {
125 return strtolower($root->get_attribute($attr_name)) == strtolower($attr_value);
139 if (!$root->has_attribute($attr_name)) {
143 $words = preg_split("/\s+/",$root->get_attribute($attr_name));
149 return $root->tagname() == "a" && $root->has_attribute('href');
151 return $root->tagname() == "a" && $root->has_attribute('href');