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

8266966: Wrong CSS properties are applied to other nodes after fix for JDK-8204568 #504

Closed
wants to merge 2 commits into from

Conversation

@arapte
Copy link
Member

@arapte arapte commented May 17, 2021

Issue:
When css file is added to a Scene.getStylesheets() of a Scene which has few controls in addition to a Label then css style of a different control gets applied to Label after Stage is hidden and shown. This is a regression of JDK-8204568.

The sample program attached to JBS adds a Label, Button, CheckBox and another Label to Scene. The css style of the Button gets applied to second Label after Stage is hidden and shown.

Fix: Do not recalculateRelativeSizeProperties() when resetToInitialValues() is in progress.
After Stage is hidden and shown, the css style is reset to initial value in method resetToInitialValues(), which resets the font size of a Control to default font size. This reset results in execution of method recalculateRelativeSizeProperties() that was added as part of fix for JDK-8204568. recalculateRelativeSizeProperties() uses getStyleMap() to get StyleMap of the node. In this case getStyleMap() returns an incorrect StyleMap as the reset is still in progress.

A comment is added in this fix to explain how the StyleMap is stored and retrieved.
Added a system test which fails before and passes after this fix.


Progress

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

Issue

  • JDK-8266966: Wrong CSS properties are applied to other nodes after fix for JDK-8204568

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jfx pull/504/head:pull/504
$ git checkout pull/504

Update a local copy of the PR:
$ git checkout pull/504
$ git pull https://git.openjdk.java.net/jfx pull/504/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 504

View PR using the GUI difftool:
$ git pr show -t 504

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jfx/pull/504.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented May 17, 2021

👋 Welcome back arapte! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label May 17, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented May 17, 2021

Webrevs

@johanvos
Copy link
Collaborator

@johanvos johanvos commented May 17, 2021

@jperedadnr Can you review this?

@johanvos johanvos requested a review from jperedadnr May 17, 2021
@kevinrushforth kevinrushforth self-requested a review May 17, 2021
@kevinrushforth
Copy link
Member

@kevinrushforth kevinrushforth commented May 17, 2021

/reviewers 2

@openjdk
Copy link

@openjdk openjdk bot commented May 17, 2021

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

Copy link
Collaborator

@jperedadnr jperedadnr left a comment

Looks good to me, tested the proposed patch, and it works as expected.
Just added two minor comments.

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Looks good. I confirm that it fixes the bug, and that the new test fails without the fix and passes with the fix. I also did a full build / test (including manual tests) and don't see any other regressions.

@arapte
Copy link
Member Author

@arapte arapte commented May 17, 2021

Just added two minor comments.

Updated PR according to comments, please have a re-look.

@openjdk
Copy link

@openjdk openjdk bot commented May 17, 2021

@arapte 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:

8266966: Wrong CSS properties are applied to other nodes after fix for JDK-8204568

Reviewed-by: jpereda, kcr

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:

  • d2d145d: 8266643: Intermittent failure of HonorDeveloperSettingsTest unit test
  • 9c97d9b: 8267121: Illegal access to private "size" field of ArrayList from build.gradle
  • f236a7d: 8266539: [TreeView]: Change.getRemoved() contains null item when deselecting a TreeItem
  • 285a0b6: 8264770: BidirectionalBinding should use InvalidationListener to prevent boxing

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label May 17, 2021
@arapte
Copy link
Member Author

@arapte arapte commented May 18, 2021

/integrate

@openjdk openjdk bot closed this May 18, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels May 18, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 18, 2021

@arapte Since your change was applied there have been 5 commits pushed to the master branch:

  • c511789: 8266860: [macos] Incorrect duration reported for HLS live streams
  • d2d145d: 8266643: Intermittent failure of HonorDeveloperSettingsTest unit test
  • 9c97d9b: 8267121: Illegal access to private "size" field of ArrayList from build.gradle
  • f236a7d: 8266539: [TreeView]: Change.getRemoved() contains null item when deselecting a TreeItem
  • 285a0b6: 8264770: BidirectionalBinding should use InvalidationListener to prevent boxing

Your commit was automatically rebased without conflicts.

Pushed as commit 93de584.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants