RFR: 8089913: CSS pseudo classes missing by default for some controls

Kevin Rushforth kcr at openjdk.java.net
Fri Mar 5 16:08:27 UTC 2021


On Fri, 5 Mar 2021 10:46:52 GMT, mstr2 <github.com+43553916+mstr2 at openjdk.org> wrote:

>> The fix and test look good.
>> 
>> @kleopatra Good catch about the same problem occurring in other controls. I did a quick scan, and the same bug exists in at least `ListView`, which should initialize the VERTICAL PseudoClass in its constructor. Most of the others looked fine, except for the following, which need to be checked more carefully:
>> 
>> TableView
>> TreeTableView
>> TreeCell
>> TreeTableRow
>> 
>> 
>> @mstr2 I think the scope of this bug should be expanded to fix at least the `ListView` issue, since it is effectively the same bug as this, with the same pattern used for the fix and test. The Tree/TableView classes could be looked at separately, unless you would like to take a closer look.
>
> I've fixed similar issues with the following pseudoclasses:
> 
> ListView:vertical
> TableView:unconstrained-resize
> TreeTableView:unconstrained-resize
> TreeCell:collapsed
> TreeTableRow:collapsed

Thanks for the additional fixes. I'll change the title of the JBS bug to "CSS pseudo classes missing by default for some controls". Can you change the PR title to match?

The changes to `ListView` and `TableView` look correct to me.

In looking more closely, I'm not sure the changes  to `TreeCell` or `TreeTableRow` are correct. When a `TreeCell` or `TreeTableRow` is constructed, the item is null. Unless I'm missing something, it looks like a cell/row with a null item shouldn't have a pseudo-class state set.

-------------

PR: https://git.openjdk.java.net/jfx/pull/413


More information about the openjfx-dev mailing list