[webkit-changes] [WebKit/WebKit] 988fed: [LBSE] Computation of on-screen font scaling facto...

Nikolas Zimmermann noreply at github.com
Thu Jun 15 12:38:53 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 988fed7a75892691e5cde2a30da154fbdcc61091
      https://github.com/WebKit/WebKit/commit/988fed7a75892691e5cde2a30da154fbdcc61091
  Author: Nikolas Zimmermann <nzimmermann at igalia.com>
  Date:   2023-06-15 (Thu, 15 Jun 2023)

  Changed paths:
    R LayoutTests/platform/glib/svg/zoom/page/zoom-zoom-coords-expected.txt
    R LayoutTests/platform/mac-ventura-wk2-lbse-text/svg/zoom/page/zoom-zoom-coords-expected.txt
    R LayoutTests/platform/mac/svg/zoom/page/zoom-zoom-coords-expected.txt
    M LayoutTests/svg/zoom/page/zoom-zoom-coords-expected.txt
    M LayoutTests/svg/zoom/page/zoom-zoom-coords.xhtml
    M Source/WebCore/rendering/svg/SVGLayerTransformComputation.h

  Log Message:
  -----------
  [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




More information about the webkit-changes mailing list