Conversation
|
I've implemented a working model for the Example code: <!doctype html>
<main>
<h2 id="pass">Pass</h2>
<div>intermediate</div>
<p class="warning">warning</p>
<h2 id="fail">Fail</h2>
<div>no warning sibling</div>
</main>$translator = new Translator("h2:has(~ p.warning)");
$elements = $xpath->query($translator);
self::assertEquals(1, $elements->length);
self::assertEquals("pass", $elements->item(0)->getAttribute("id")); |
|
The current regex tokenisation model cannot represent functional arguments reliably, as far as I can tell. I'm reminding myself how the The plan so far:
It turns out that the latest release, refactoring this codebase into a set of readable classes, was a tremendous idea and perfectly timed to work on this! Implementation notes: I caught a recursive loop while wiring up the new builder. I need to switch the Due to the introduction of the new |
|
Take a look at HasSelectorConditionBuilder and PseudoSelectorConverter. I will tidy the implementation up in my next coding session on this. It's getting late now. @reaganch, @Inverle and others, your feedback is appreciated, if you have any comment. |
|
Phew - all tests are green. This PR is good to go in my opinion, but I would really appreciate any feedback on the code, as this is the first feature implemented since refactoring the library into a more object oriented approach. |
Closes #235
This is a WIP while I'm working on the functionality.
The branch has a selection of tests for the upcoming
:hasselector.