Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9bd41e74f05fdc5149e5bd3e3760512e2e5ddad0
      
https://github.com/WebKit/WebKit/commit/9bd41e74f05fdc5149e5bd3e3760512e2e5ddad0
  Author: ChangSeok Oh <changs...@webkit.org>
  Date:   2023-03-23 (Thu, 23 Mar 2023)

  Changed paths:
    M LayoutTests/platform/gtk/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.png
    M LayoutTests/platform/gtk/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt
    M LayoutTests/platform/wpe/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt
    M Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp

  Log Message:
  -----------
  [GTK] font-size-adjust does not work for non-Ahem fonts
https://bugs.webkit.org/show_bug.cgi?id=254145

Reviewed by Carlos Garcia Campos.

The GTK port does not properly handle the font-size-adjust CSS property.
This is because xHeight is not retrieved with FreeType in Font::platformInit()
at SimpleFontDataFreeType.cpp. We attempt to get the xHeight from FreeType 
first,
then do the same from Cairo. If we get 0 of xHeight in the first trial and
set it to `std::optional<float> xHeight`, the second trial never happens
as `if (!xHeight)` does not hit. That condition just checks if xHeight has
a value or not. Our intention is to retry to get xHeight by an alternative way
(i.e., Cairo) where the xHeight is not normal (i.e., 0). To fix this, we test
if xHeight has a value and that is a non-zero value for the second trial.
Otherwise, we get the xHeight from Cairo.

The following results are updated since the xHeight value was not reflected.

* LayoutTests/platform/gtk/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.png:
* LayoutTests/platform/gtk/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt:
* LayoutTests/platform/wpe/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt:
* Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformInit):

Canonical link: https://commits.webkit.org/262061@main


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to