Same thing as find() just moving up the dom tree.
So, I could do something like:
$prevElem = $myElem->find_up('h2'); => Would give me Title
$prevElem = $myElem->find_up('div[class=myclass]'); Would give me
How is this different to find()? What are he benefits? I'm not seeing it.
This is partially implemented as find_ancestor_tag. It allows you to move up the dom tree and find the tag specifies as a parent of the current tag. It starts at line 330 in the code.
If you expand it to use the full find syntax, I'd be happy to look at that patch. (you should use the parse_selector and match functions in your solution.