Skip to content
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

[LBSE] Computation of on-screen font scaling factor ignores page zoom #15000

Commits on Jun 15, 2023

  1. [LBSE] Computation of on-screen font scaling factor ignores page zoom

    https://bugs.webkit.org/show_bug.cgi?id=258120
    
    Reviewed by Rob Buis.
    
    For standalone SVG documents the page zoom has to be taken into account when computing the
    on-screen font scaling factor. Currently we ignore the effective zoom factor and thus select
    a sub-optimal font.
    
    Non-scaling-stroke (webkit.org/b/139322) works properly in LBSE, if this fix is applied as well.
    Two tests fail in LBSE without this patch: svg/text/non-scaling-stroke-textRendering-default.svg
    and svg/text/non-scaling-stroke-textRendering-geometricPrecision.svg).
    
    Covered by new tests added by webkit.org/b/139322 -- easy to test with non-scaling-stroke.
    Without non-scaling-stroke, this is most noticeable in zoom-zoom-coords.html which now
    exposes slighly different metrics for <text> since the internal font-size scaling factor
    changed (now taking zoom into account, as the legacy SVG engine already does).
    
    zoom-zoom-coords.xhtml now delivers correct results across all platforms and is identical
    for legacy SVG engine and LBSE -- get rid of platform specific results, finally.
    
    * LayoutTests/platform/glib/svg/zoom/page/zoom-zoom-coords-expected.txt: Removed.
    * LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-zoom-coords-expected.txt: Removed.
    * LayoutTests/platform/mac/svg/zoom/page/zoom-zoom-coords-expected.txt: Removed.
    * LayoutTests/svg/zoom/page/zoom-zoom-coords-expected.txt:
    Finally a single non-LBSE/LBSE result for all platforms.
    * LayoutTests/svg/zoom/page/zoom-zoom-coords.xhtml:
    * Source/WebCore/rendering/svg/SVGLayerTransformComputation.h:
    (WebCore::SVGLayerTransformComputation::calculateScreenFontSizeScalingFactor const):
    Multiply scaling factor by effectiveZoom() (which includes page zoom), but only for non-standalone
    SVG documents. For standalone SVG documents the page-zoom induced scaling is already part of the CTM.
    
    Canonical link: https://commits.webkit.org/265208@main
    nikolaszimmermann committed Jun 15, 2023
    Configuration menu
    Copy the full SHA
    988fed7 View commit details
    Browse the repository at this point in the history