-
Notifications
You must be signed in to change notification settings - Fork 507
8296387: [Tooltip, CSS] -fx-show-delay is only applied to the first tooltip that is shown before it is displayed #1394
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
Conversation
👋 Welcome back mhanl! A progress list of the required criteria for merging this PR into |
Webrevs
|
6d40b52
to
f0c5224
Compare
@Maran23 Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
f0c5224
to
cd9892b
Compare
@Maran23 Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
…st tooltip that is shown before it is displayed
cd9892b
to
a4a1a49
Compare
@Maran23 Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
Testing the combined (this PR merged with the latest master) on macOS 14.3.1 M1 Pro (though this is probably not important), using the latest MonkeyTester
What I see is the very first time the tooltip appears it's using the old show-delay value of 1000ms. Any subsequent attempts the new delay is in effect. Then, change back to 1000ms. Same thing happens: the first time the old timeout value is used instead of the new. |
There is also another problem (though it is a separate issue as it can be seen with the master branch):
Notice how sometimes, when slowly entering the tooltip page from the left side, the tooltip appears and then disappears. Async code is hard! edit 2024/04/12: created https://bugs.openjdk.org/browse/JDK-8330187 |
the disappearing tooltip clip (will move to its own ticket later): video1956899183.mp4 |
This is another, unrelated issue: If I specify a number instead of duration like
Once that happens, the exception will get thrown every time, even after the correct CSS is entered. The app must be restarted. But we don't get an exception for a boolean value:
edit 2024/11/12: created https://bugs.openjdk.org/browse/JDK-8330186 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although the change is an improvement, I think a similar problem will still be present when CSS changes. The cssForced
flag I think needs to reset to false
whenever a CSS styleable property of the tool tip is modified. That would include all such properties...
This is a bit of a general issue in JavaFX (it really shouldn't be possible for any Node
to be shown that hasn't had CSS processed for it), yet this can easily happen, and depending on how different the default style is versus the intended style, this can lead to a visual artifact (most noticable is for example a white background, when it is supposed to be black or transparent).
Perhaps we should open an issue to solve this for all controls in one go? A solution that would prevent any Node
from being displayed without CSS applied?
There seems to be a difference when using |
Yes, that sounds like a good idea. Checking the calls to
Will check. |
…tylesheets are considered for the e.g. tooltip show-delay
modules/javafx.controls/src/main/java/javafx/scene/control/Tooltip.java
Outdated
Show resolved
Hide resolved
This is because the CSS implementation thinks it is a PX value and therefore parse it wrong. You can check the CssParser to see why this happens. Fix might be simple, but the code in the parser is very error prone for this kind of stuff. (And Note that the StyleableProperty does not do any typecheck, therefore a double value can be set where a Duration would be expected, which is very very bad) |
@Maran23 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:
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 2 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
@Maran23 This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
keep it open. |
Please sync up with the latest master (should be a SOP for any long outstanding PRs - sorry for long delay!)
^ please remove the 'stage' argument, see JDK-8325566 |
modules/javafx.controls/src/main/java/javafx/scene/control/Tooltip.java
Outdated
Show resolved
Hide resolved
@Maran23 This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
…orrect CSS processing for the Tooltip Node.
Strange: I still see the same issue described in |
I don't see |
It's 100 (expected value) plus 50 (maximum delta). Here is the call stack:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few inline comments, including a possible suggestion to fix the intermittent test failures.
tests/system/src/test/java/test/robot/javafx/scene/TooltipTest.java
Outdated
Show resolved
Hide resolved
tests/system/src/test/java/test/robot/javafx/scene/TooltipTest.java
Outdated
Show resolved
Hide resolved
tests/system/src/test/java/test/robot/javafx/scene/TooltipTest.java
Outdated
Show resolved
Hide resolved
The Tooltip timing looks much better now in the tests. I decided to use 80ms as a threshhold. In my testing, I got a maximum difference of ~35 ms. Also merged in master. |
modules/javafx.controls/src/test/java/test/javafx/scene/control/TooltipTest.java
Show resolved
Hide resolved
Thanks. I'll test and re-review. |
I ran it on our CI Linux and macOS systems and it passed on all of them. It also passed on my local Linux system. On my Windows machine I still get the following test failure almost every time I run it:
I've seen the actual result as high as 390 one time. The other times were in the 200 - 260 range. Have you run it on Windows? If it's only my system, we could file a bug and look at it later. We might consider skipping that test on Windows using |
Yes, on Windows 10 and Windows 11. Executed the test multiple time now again, always around 110 - 140 ms for me. Weird. |
With your latest change, the test now passes on my Windows 11 system. Maybe the resetting of |
I would not expect that, but maybe it has something to do with it. |
I looked at the code, and you're right, it doesn't seem like it would have mattered. Regardless, it now passes on my system reliably. I also reverted your fix and verified that the new test catches the failures. So all good from my point of view. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
I'll create the tickets for creating utility methods that use base64 urls and system nano time.
@Maran23 This is ready to integrate. If you can do it in the next 30 minutes, it will make JavaFX 23 before the RDP1 fork. If it is after the fork, it might be a candidate to backport to jfx23. |
Damn, missed the time. I will keep it open until tomorrow, in case someone else want to review or just check the PR. |
/integrate |
Going to push as commit 5b448b8.
Your commit was automatically rebased without conflicts. |
This PR fixes a long standing issue where the
Tooltip
will always wait one second until it appears the very first time, even if the-fx-show-delay
was set to another value.The culprit is, that the
cssForced
flag is not insideTooltip
, but inside theTooltipBehaviour
. So the very firstTooltip
gets processed correctly, but after noTooltip
will be processed by CSS before showing, resulting in the set-fx-show-delay
to not be applied immediately.Added a bunch of headful and headless tests for the behaviour since there were none before.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1394/head:pull/1394
$ git checkout pull/1394
Update a local copy of the PR:
$ git checkout pull/1394
$ git pull https://git.openjdk.org/jfx.git pull/1394/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1394
View PR using the GUI difftool:
$ git pr show -t 1394
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1394.diff
Webrev
Link to Webrev Comment