8358450: Viewport characteristics media features
Implementation of viewport characteristics media features:
widthheightaspect-ratio: width / heightorientation:portrait,landscapedisplay-mode:fullscreen,standalone(note:browserandminimal-uiare not supported in JavaFX)
/reviewers 2 /csr
Progress
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
- [ ] Change requires CSR request JDK-8363983 to be approved
- [ ] Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)
Issues
- JDK-8358450: Viewport characteristics media features (Enhancement - P4)
- JDK-8368508: Missing info in JavaFX CSS Reference Guide (Bug - P4)
- JDK-8363983: Viewport characteristics media features (CSR)
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1844/head:pull/1844
$ git checkout pull/1844
Update a local copy of the PR:
$ git checkout pull/1844
$ git pull https://git.openjdk.org/jfx.git pull/1844/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1844
View PR using the GUI difftool:
$ git pr show -t 1844
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1844.diff
Using Webrev
:wave: Welcome back mstrauss! 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.
❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.
@mstr2 The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).
@mstr2 has indicated that a compatibility and specification (CSR) request is needed for this pull request.
@mstr2 please create a CSR request for issue JDK-8358450 with the correct fix version. This pull request cannot be integrated until the CSR request is approved.
Webrevs
- 17: Full - Incremental (0fc311f2)
- 16: Full - Incremental (411da071)
- 15: Full - Incremental (d350da6a)
- 14: Full - Incremental (1c690d4f)
- 13: Full - Incremental (795d1e14)
- 12: Full - Incremental (0edf4392)
- 11: Full - Incremental (98a014f5)
- 10: Full - Incremental (dc22aa43)
- 09: Full (19cdaeaa)
- 08: Full (3dabf1e0)
- 07: Full - Incremental (d15fa713)
- 06: Full - Incremental (c6ad3e32)
- 05: Full - Incremental (1c1c118d)
- 04: Full - Incremental (d93fc2d0)
- 03: Full - Incremental (0ce8703b)
- 02: Full - Incremental (8c93b359)
- 01: Full - Incremental (cc0d44c1)
- 00: Full (abdccad9)
/issue add 8368508
@mstr2
Adding additional issue to issue list: 8368508: Missing info in JavaFX CSS Reference Guide.
Reviewers: @kevinrushforth @arapte
@mstr2 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 issue a /touch or /keepalive command to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!
It would be nice to get this in for JavaFX 26, so will look at it soon.
A CSS example (either in the ticket or the PR) would be nice, for ease of reviewing.
Here, I am trying to see if the button background will change when I move the monkey tester window from one monitor to another (one is 1900 px wide, the other is 2560). I see no change:
@media (width < 2000) {
.button {
-fx-background-color: red;
}
}
What am I doing wrong?
What am I doing wrong?
All of the new media features query the scene, not the screen. If you resize the window, you should see the background color change.
A CSS example (either in the ticket or the PR) would be nice, for ease of reviewing.
Added an example to the description of this PR.
Having both aspect-ratio and orientation is a bit redundant, isn't it? Is it just for convenience?
Having both
aspect-ratioandorientationis a bit redundant, isn't it? Is it just for convenience?
It almost seems like there could be historical reasons, like one preceded the other or something like that. But as far as I can see, both media features appear at the same time around 2008, and they've been around ever since. So I guess it's mostly convenience.
Why do I get stderr output with this:
WARNING: CSS Error parsing ' @media (aspect-ratio > 0.5) {
.button {
-fx-background-color: red;
}
}
: Invalid value <0.5> for media feature <aspect-ratio> at [1,30]
However,
display-modedoes not seem to work on macOS 26.1. To reproduce: [...]
Fixed that. I was using an InvalidationListener that would not be called again if the value of the observable was not actually read.
for other reviewers: I've updated the monkey tester's CSS Playground to apply the stylesheets to the newly created windows.