-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kagekiri querySelector not working #95
Comments
Hi @shivamothkuri is there any chance you could provide a minimal reproducible test case using something like stackblitz.com or codepen.io? |
@shivamothkuri Actually scratch that, I threw together a CodePen repro based on your description: https://codepen.io/nolanlawson-the-selector/pen/jORKJvg It indeed seems to demonstrate that kagekiri does not reproduce the same behavior as |
Reduction of the issue: <div class="filters">
<div>
<div>
<select class="templateInputs"></select>
</div>
</div>
</div> // null
kagekiri.querySelector('div.filters > div:nth-child(1) select.templateInputs')
// <select class="templateInputs"></select>
document.querySelector('div.filters > div:nth-child(1) select.templateInputs') |
I think I understand the problem now - basically, as we are matching right-to-left, there is a problem of ambiguity. You can imagine adding multiple layers of Essentially, kagekiri works right-to-left, and when it matches the You can imagine the algorithm for this getting fairly nasty, as there is potentially a combinatorial explosion of possibilities that kagekiri has to match against. |
This is my CSS selector
div.filters > div:nth-child(1) select.templateInputs
This works for Puppeteer and devtools element search. But, don't work in Kagekiri
When I digged into the source code, found that this is what happening.
Step1: select.templateInputs has a parent div - which resolves to div.uiInput
Step2: div.uiInput has any direct(because of > selector) parent with div.filters? No. It fails here!
Sample html
The text was updated successfully, but these errors were encountered: