Skip to content
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

8089913: CSS pseudo classes missing by default for some controls #413

Closed
wants to merge 9 commits into from

Conversation

mstr2
Copy link
Collaborator

@mstr2 mstr2 commented Feb 26, 2021

The Slider control does not have the ":horizontal" CSS pseudo-class set by default. The pseudo-class is only set once the "orientation" property is changed. This PR fixes that.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8089913: CSS pseudo classes missing by default for some controls

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jfx pull/413/head:pull/413
$ git checkout pull/413

@bridgekeeper bridgekeeper bot added the oca Needs verification of OCA signatory status label Feb 26, 2021
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 26, 2021

Hi @mstr2, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user mstr2" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@mstr2
Copy link
Collaborator Author

mstr2 commented Feb 26, 2021

/signed

@bridgekeeper bridgekeeper bot added the oca-verify Needs verification of OCA signatory status label Feb 26, 2021
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 26, 2021

Thank you! Please allow for up to two weeks to process your OCA, although it is usually done within one to two business days. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

@bridgekeeper bridgekeeper bot removed oca Needs verification of OCA signatory status oca-verify Needs verification of OCA signatory status labels Mar 3, 2021
@openjdk openjdk bot added the rfr Ready for review label Mar 3, 2021
@mlbridge
Copy link

mlbridge bot commented Mar 3, 2021

Webrevs

@kevinrushforth
Copy link
Member

kevinrushforth commented Mar 3, 2021

/reviewers 2

@openjdk
Copy link

openjdk bot commented Mar 3, 2021

@kevinrushforth
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

@kevinrushforth
Copy link
Member

kevinrushforth commented Mar 3, 2021

@mstr2 can you enable pre-submit testing for your repo as indicated the Checks section? You might need to then push a new (empty) commit to your branch in order to trigger the tests to run.

@kleopatra
Copy link
Collaborator

kleopatra commented Mar 3, 2021

side note: there might be a similar issue in other controls, f.i. the pseudoState of ListView orientation doesn't seem to be initialized

@kevinrushforth
Copy link
Member

kevinrushforth commented Mar 5, 2021

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.

@openjdk openjdk bot removed the rfr Ready for review label Mar 5, 2021
@openjdk openjdk bot added the rfr Ready for review label Mar 5, 2021
@mstr2
Copy link
Collaborator Author

mstr2 commented Mar 5, 2021

I've fixed similar issues with the following pseudoclasses:

ListView:vertical
TableView:unconstrained-resize
TreeTableView:unconstrained-resize
TreeCell:collapsed
TreeTableRow:collapsed

@kevinrushforth
Copy link
Member

kevinrushforth commented Mar 5, 2021

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.

@mstr2 mstr2 changed the title 8089913: CSS styling problem with Slider pseudo classes 8089913: CSS pseudo classes missing by default for some controls Mar 5, 2021
@kevinrushforth
Copy link
Member

kevinrushforth commented Mar 5, 2021

The changes to ListView and TableView look correct to me.

And also TreeTableView.

@mstr2
Copy link
Collaborator Author

mstr2 commented Mar 5, 2021

I guess that depends on whether a TreeCell or TreeTableRow that is not expanded should be considered collapsed.

Unless there are compelling reasons to have cells that are neither expanded nor collapsed, I think it is sensible to default to treating non-existing items as collapsed.

Currently, once :expanded or :collapsed has been set, it will not be removed even if the item is set to null. This should probably be changed to either:

  1. remove any pseudoclass when the item is set to null, or
  2. set the :collapsed pseudoclass and remove the :expanded pseudoclass when the item is set to null.

@kevinrushforth
Copy link
Member

kevinrushforth commented Mar 5, 2021

It does seems like there is a possible inconsistency for TreeCell and TreeTableRow. I'm not sure it matters in practice, since an application doesn't directly manage the creation of the cells (other than by providing a cell factory) or setting the item. The pseudo-class state of the cell is a proxy for the item it points to. Ideally, it would only contain the "empty" state if the item is null, but given that such a cell would never be rendered it would be hard to point to something that doesn't work as a result.

In any case, since there are larger issues than just setting the default state for TreeCell and TreeTableRow I'd prefer to decouple them from this issue and file a follow-up issue (which doesn't need to be looked at any time soon).

@mstr2
Copy link
Collaborator Author

mstr2 commented Mar 5, 2021

I've reverted the changes to TreeCell and TreeTableRow.

@kevinrushforth
Copy link
Member

kevinrushforth commented Mar 5, 2021

Thanks. I filed JDK-8263096 to track the follow-issue for TreeCell and TreeTableRow.

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Looks good. I can confirm that the new tests fail without the fix and pass with the fix.

@openjdk
Copy link

openjdk bot commented Mar 8, 2021

@mstr2 This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8089913: CSS pseudo classes missing by default for some controls

Reviewed-by: kcr, aghaisas

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 4 new commits pushed to the master branch:

  • e394b0a: 8262802: Wrong context origin coordinates when using EGL and HiDPI
  • a00ef79: Merge
  • e0ce73a: 8262460: Create release notes for JavaFX 16
  • 8ad18c3: 8260165: CSSFilterTest.testCSSFilterRendering system test fails

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@kevinrushforth, @aghaisas) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Ready to be integrated label Mar 8, 2021
@mstr2
Copy link
Collaborator Author

mstr2 commented Mar 8, 2021

/integrate

@openjdk openjdk bot added the sponsor Ready to sponsor label Mar 8, 2021
@openjdk
Copy link

openjdk bot commented Mar 8, 2021

@mstr2
Your change (at version e0bedd5) is now ready to be sponsored by a Committer.

@kevinrushforth
Copy link
Member

kevinrushforth commented Mar 8, 2021

/sponsor

@openjdk openjdk bot closed this Mar 8, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed sponsor Ready to sponsor ready Ready to be integrated rfr Ready for review labels Mar 8, 2021
@openjdk
Copy link

openjdk bot commented Mar 8, 2021

@kevinrushforth @mstr2 Since your change was applied there have been 4 commits pushed to the master branch:

  • e394b0a: 8262802: Wrong context origin coordinates when using EGL and HiDPI
  • a00ef79: Merge
  • e0ce73a: 8262460: Create release notes for JavaFX 16
  • 8ad18c3: 8260165: CSSFilterTest.testCSSFilterRendering system test fails

Your commit was automatically rebased without conflicts.

Pushed as commit 3374f47.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@mstr2 mstr2 deleted the JDK-8089913 branch Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
4 participants