Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
add ability to traverse hiddenWrap via CssSelector
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Aug 19, 2015
1 parent 25447dd commit a2174b0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 15 additions & 1 deletion CssSelector/Combinator/Child.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
namespace Wild\Templix\CssSelector\Combinator;
class Child implements CombinatorInterface{
function filter($node, $tagname){
return $node->childNodes;
$nodes = [];
foreach($node->children() as $c){
$this->recusiveTraverseHidden($c,$nodes);
}
return $nodes;
}
function recusiveTraverseHidden($node,&$nodes){
if($node->isHiddenWrap()){
foreach($node->children() as $c){
$this->recusiveTraverseHidden($c,$nodes);
}
}
else{
$nodes[] = $node;
}
}
}
3 changes: 3 additions & 0 deletions Markup.php
Original file line number Diff line number Diff line change
Expand Up @@ -1545,5 +1545,8 @@ protected function throwException($msg){
$msg .= $this->exceptionContext();
throw new MarkupException($msg);
}
function isHiddenWrap(){
return $this->hiddenWrap;
}
}
Markup::initialize();

0 comments on commit a2174b0

Please sign in to comment.