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
Account for zoom when computing SVG font size #4011
Conversation
EWS run on previous version of this PR (hash 7a165c8) |
7a165c8
to
971ee85
Compare
EWS run on previous version of this PR (hash 971ee85) |
971ee85
to
2cbd139
Compare
EWS run on previous version of this PR (hash 2cbd139) |
@smfr & @nikolaszimmermann - Can you guide or suggest on how to fix this 'ios-wk2' failure (svg/text/font-small-enlarged-minimum-larger.svg)? |
971c72d
to
dd62d17
Compare
EWS run on previous version of this PR (hash dd62d17) |
dd62d17
to
e71775a
Compare
EWS run on previous version of this PR (hash e71775a) |
e71775a
to
d8b31c6
Compare
EWS run on previous version of this PR (hash d8b31c6) |
d8b31c6
to
3a63c84
Compare
EWS run on previous version of this PR (hash 3a63c84) |
3a63c84
to
ee073ca
Compare
EWS run on previous version of this PR (hash ee073ca) |
Sorry for not responding at all - I'm pretty busy these days... |
LayoutTests/svg/text/font-small-enlarged-minimum-larger-expected.html
Outdated
Show resolved
Hide resolved
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.
Thanks for tackling this -- not ready though, the LayoutTests changes seem fishy.
Replied above and would appreciate your guidance because I am able to pass all changes by adding 'font-size: 80' but only fails in iOS-wk2 and have asked for input from Simon and he referred that it might be iOS device scaling factor and I should look into hidpi test cases. |
ee073ca
to
e6ebd1a
Compare
EWS run on previous version of this PR (hash e6ebd1a) |
e6ebd1a
to
f958ea2
Compare
EWS run on previous version of this PR (hash f958ea2) |
f958ea2
to
ee3acf9
Compare
EWS run on previous version of this PR (hash ee3acf9) |
ee3acf9
to
6a007a4
Compare
EWS run on previous version of this PR (hash 6a007a4) |
LayoutTests/svg/text/font-small-enlarged-minimum-larger-expected.svg
Outdated
Show resolved
Hide resolved
LayoutTests/platform/ios/svg/text/font-small-enlarged-minimum-larger-expected.svg
Outdated
Show resolved
Hide resolved
6a007a4
to
2dbdf5c
Compare
EWS run on previous version of this PR (hash 2dbdf5c) |
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.
That looks good - let's wait for EWS results. If ok, I'll r+ it. Thanks @Ahmad-S792 for your patience.
No worries - I should appreciate you to deal with noob like me. :-) I am just learning day by day and have day job so some time response take some time. :-) |
Account for zoom when computing SVG font size https://bugs.webkit.org/show_bug.cgi?id=118818 Reviewed by NOBODY (OOPS!). Merge - https://chromium.googlesource.com/chromium/blink/+/5624c6e475af92d541edc8a3394602e320d00323 & https://src.chromium.org/viewvc/blink?view=revision&revision=180995 & https://src.chromium.org/viewvc/blink?view=revision&revision=154004 Previously, text that was zoomed appeared larger than geometry under the same zoom value. This was caused by two bugs: 1) When setting the computed font size, we incorrectly referenced the computedTextSize instead of the specified size. 2) Text with GeometricPrecision did not set a computed size but instead relied on the text size being correct. Further, it also fixes an issue about optimization in RenderSVGInlineText::computeNewScaledFontForStyle would skip updating the font size on lowdpi devices while zooming. The computed font size calculation depends on zoom and the font scaling factor depends on the device's scaling factor. Previously, we would skip updating the font when the scaling factor was 1 which would fail to account for zoom. This patch updates the optimization to only be used when both the scaling factor and zoom are 1. This change addresses both of these issues and adds a test to prove correctness. SVG doesn't scale zoomed font units so zooming should not affect font sizes. This patch fixes a bug where em lengths were resolved against the style's font size (with zoom) instead of the specified font size (without zoom). * Source/WebCore/rendering/svg/RenderSVGInlineText.cpp: (RenderSVGInlineText::computedNewScaledFontForStyle) - Updated Scaling factor to be accounted into two buckets: 1) GeometricPrecision 2) computedTextSize being referred 3) Use DoNotUseSmartMinimumForFontSize 4) Also fix low DPI issue * Source/WebCore/svg/SVGLengthContext.cpp: Update "convertValueFromUserUnitsToEMS" and "convertValueFromEMSToUserUnits" to use "specifiedFontSize" rather than "computedFontPixelSize" * LayoutTests/svg/zoom/text/zoom-text-geometry.html: Added Test Case * LayoutTests/svg/zoom/text/zoom-text-geometry-expected.html: Added Test Case Expectations * LayoutTests/svg/zoom/text/lowdpi-zoom-text.html: Added Test Case * LayoutTests/svg/texst/lowdpi-zoom-text-expected.txt: Added Test Case Expectations * LayoutTets/svg/zoom/text/zoom-em-units.html: Added Test Case * LayoutTets/svg/zoom/text/zoom-em-units-expected.html: Added Test Case Expectations
2dbdf5c
to
488e2eb
Compare
EWS run on current version of this PR (hash 488e2eb) |
As discussed with @nikolaszimmermann over Slack, there is another change, which we require prior to landing this. So I will work on it and then have similar to this another PR to land this in future hoping that EWS does not reflect same failures. |
488e2eb