-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8231286: HTML font size too large with high-DPI scaling and W3C_UNIT_LENGTHS #2223
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 mperktold! A progress list of the required criteria for merging this PR into |
|
To avoid this situation, create a new branch for your changes and reset the Then proceed to create a new pull request with |
|
@mperktold The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
| /** | ||
| * Key for a client property used to indicate whether | ||
| * <a href="http://www.w3.org/TR/CSS21/syndata.html#length-units"> | ||
| * <a href="https://www.w3.org/TR/CSS22/syndata.html#length-units"> |
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.
Does this change require a CSR?
| import javax.swing.text.html.StyleSheet; | ||
|
|
||
| public class HtmlFontSizeTest { | ||
| static Rectangle w3cFrameSize, stdFrameSize; |
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.
These fields are accessed from two different threads. Shall they be declared as volatile then?
Declaring each field on its own line would follow the Java Code Conventions.
|
The comment in the bug description says, the subject contains |
|
As of now, I did not check the change in the spec, just noted that the quoted text in the PR is the same for both links: CSS 2.1 and CSS 2.2. |
The text remains the same but the external link changes from CSS 2.1 to 2.2. |
This is what I mean, the quoted text of the CSS spec is the same for both versions. |
Oh right I misread that, I really thought it changed, but it didn't. |
I believe we're talking about javadoc spec: its text has not changed. So, the changes are good as they are. Do I get right, @mrserb? |
I am not sure whether I should still do this or not, since there is already some feedback, and I don't know what happens to that. @aivanov-jdk if it's not required, do you have any preferences? |
I see you opened the PR from master branch in your personal fork rather than a new branch. Yes, I think you should go on as suggested: create a new PR from a new branch. You can create the new PR with comments addressed and link to the old PR in the description. In addition to that, if I get it right, you, @mperktold, have taken over this issue from @prsadhuk, thus #1628 is superseded by this PR and should be closed without integration. Eventually, this PR will be superseded by a new PR that you'll create. Can you edit the subject of the JBS issue to amend the constant |
OK, will do. If you don't mind, I have a couple of noob questions, as I'm new to the whole process:
Is there anything special I need to do to have "comments addressed"? Should I first apply your patches, and then proceed with the new fork afterwards?
I don't think I have the rights to do this. I don't even have an JBS account, I submitted the bug through the https://bugs.java.com/bugdatabase/. I just recently signed the OCA, is that sufficient to create a JBS account? |
Whatever you like. You can incorporate the fixes to comments in your initial commit to the new branch, or you can fix them after you create the new branch with your exiting changeset.
No, it is not sufficient. I wondered why I didn't see OCA request in the PR. You had gotten it before you created your first PR. |
No, I did not mean the JavaDoc, my question was - "what part of the CSS spec was updated"? |
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
|
@mperktold I guess this PR needs to be closed since this is from master branch. Please create a new PR from your fix branch with this latest changeset. The review will continue on top of that. |
Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk@users.noreply.github.com>
You're right. I looked closely at the text in CSS 2.1 and 2.2 and length definitions are the same. CSS 2.1 contains a warning that several sections have been updated. Yet this particular one seems to have remained the same. Yet the fix is still required. Swing handles High DPI by scaling all UI therefore all length units factors should not depend on the screen resolution or print resolution, the changes in resolution are automatically handled by 2d transform. However, changing the link to the CSS specification is optional. Shall we update it to the most recent one? |
|
Looks like this PR still needs to be closed. |
@prsadhuk asked me to take over his pull request #1628, since I filed the bug an suggested this fix.
I thought the current behavior would be buggy, but actually the units are quite precise. I checked the size of a text in font-size of 1 in, and it really was approximately 1 inch. The problem is just that browsers behave differently.
Swing follows the CSS 2.1 spec: https://www.w3.org/TR/CSS21/syndata.html#length-units.
But in CSS 2.2, length units where redefined: https://www.w3.org/TR/CSS22/syndata.html#length-units.
Now
pxis also an absolute unit, and there are constant conversion factors between all absolute units.The CSS 2.2 spec includes the following two notes regarding this change:
So the spec changed the behavior to better support high-DPI devices with existing content, and that is exactly my intention with this PR as well.
Progress
Integration blocker
Issue
Download
$ git fetch https://git.openjdk.java.net/jdk pull/2223/head:pull/2223$ git checkout pull/2223