RFR: 8185831: Pseudo selectors do not appear to work in Node.lookupAll() [v6]
Andy Goryachev
angorya at openjdk.org
Thu Oct 19 23:52:38 UTC 2023
On Thu, 19 Oct 2023 23:45:58 GMT, Sai Pradeep Dandem <duke at openjdk.org> wrote:
>> **Issue:**
>> Using pseudo classes in programmatic query using Node.lookupAll() or Node.lookup() gives unexpected results.
>>
>> **Cause:**
>> There is no check for checking the psuedo states matching in the applies() method of SimpleSelector.java. So checking for "applies()" alone is not sufficient in lookup() method.
>>
>> **Fix:**
>> Included an extra check for the psuedo states to match.
>
> Sai Pradeep Dandem has updated the pull request incrementally with one additional commit since the last revision:
>
> 8185831: Included space
modules/javafx.graphics/src/test/java/test/javafx/scene/Node_lookup_Test.java line 154:
> 152: */
> 153: @Test
> 154: public void lookupPseudoTest2() {
the reason I've used different nodes is because the situation you have with existing nodes might give false positive.
I wanted to make sure that selector "a." will collect nodes with ".a" and ".a:pseudo", but in the standard set of nodes with g and hg nodes - but they have the same :testPseudo1, so it's not exactly equivalent.
The other option is to add new nodes, one with ".x" and another with ".x:pseudo"
If you do that, it might be easier to change the javadoc format to do something like this:
└─ Pane
├─ VFlow (Pane) .flow
│ ├─ ClippedPane (Pane) .content
(but it's just a very minor suggestion)
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1245#discussion_r1366244667
More information about the openjfx-dev
mailing list