RFR: 8228363: ContextMenu.show with side=TOP does not work the first time in the presence of CSS

Robert Lichtenberger rlichten at openjdk.java.net
Fri Jan 22 10:36:48 UTC 2021


On Thu, 21 Jan 2021 23:11:44 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> By using the anchor location facility of PopupWindows we can avoid miscalculation of the
>> menu's height entirely.
>> This fix also cleans up some documentation issues.
>> This fix introduces tests that check the correct positioning (test_position_)
>> test_position_withCSS reproduces the problem that is fixed with this patch.
>> The other test_position_ cases serve as "proof" that no regressions are introduces.
>> They work before and after the fix is introduced.
>
> modules/javafx.controls/src/test/java/test/javafx/scene/control/ContextMenuTest.java line 646:
> 
>> 644:     @Test public void test_position_showOnScreen() {
>> 645:         ContextMenu cm = createContextMenu(false);
>> 646:         cm.show(anchorBtn,100, 100);
> 
> Minor: missing space after the `,`

Space inserted.

> modules/javafx.controls/src/test/java/test/javafx/scene/control/ContextMenuTest.java line 649:
> 
>> 647: 
>> 648:         assertEquals(cm.getAnchorX(), 100, 0.0);
>> 649:         assertEquals(cm.getAnchorY(), 100, 0.0);
> 
> The expected and actual values are backwards (expected should be first).

Swapped positions.

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

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


More information about the openjfx-dev mailing list