Bug 214550 - [FreeType] Add support for text-underline-offset and text-decoration-thickness
Summary: [FreeType] Add support for text-underline-offset and text-decoration-thickness
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk, InRadar, LayoutTestFailure
Depends on:
Blocks:
 
Reported: 2020-07-20 05:53 PDT by Carlos Garcia Campos
Modified: 2020-07-21 01:07 PDT (History)
5 users (show)

See Also:


Attachments
Patch (8.91 KB, patch)
2020-07-20 05:58 PDT, Carlos Garcia Campos
aperez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2020-07-20 05:53:45 PDT
We need to set underline position and thickness in font metrics.
Comment 1 Carlos Garcia Campos 2020-07-20 05:58:09 PDT
Created attachment 404711 [details]
Patch
Comment 2 Adrian Perez 2020-07-20 07:36:58 PDT
Comment on attachment 404711 [details]
Patch

I'm almost tempted to r+ this, but I think the comment below is important
enough to double check it before, so please take a look.

View in context: https://bugs.webkit.org/attachment.cgi?id=404711&action=review

> Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:79
> +    if (!determinant)

Is the intention here to check for zero exactly, or for some floating point
value that is small enough that is logically zero? In the latter case, this
looks like a footgun hiding in plain sight and it would be better to compare
“std::fabs(determinant) < K” for a reasonable value of “K”, otherwise the
value of “determinant” can be almost-but-not zero and defeat the check.
Comment 3 Carlos Garcia Campos 2020-07-20 07:42:07 PDT
(In reply to Adrian Perez from comment #2)
> Comment on attachment 404711 [details]
> Patch
> 
> I'm almost tempted to r+ this, but I think the comment below is important
> enough to double check it before, so please take a look.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=404711&action=review
> 
> > Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:79
> > +    if (!determinant)
> 
> Is the intention here to check for zero exactly, or for some floating point
> value that is small enough that is logically zero? In the latter case, this
> looks like a footgun hiding in plain sight and it would be better to compare
> “std::fabs(determinant) < K” for a reasonable value of “K”, otherwise the
> value of “determinant” can be almost-but-not zero and defeat the check.

Zero exactly. See the cairo code from which I took this:

https://cgit.freedesktop.org/cairo/tree/src/cairo-matrix.c#n685
Comment 4 Adrian Perez 2020-07-20 07:51:53 PDT
(In reply to Carlos Garcia Campos from comment #3)
> (In reply to Adrian Perez from comment #2)
> > Comment on attachment 404711 [details]
> > Patch
> > 
> > I'm almost tempted to r+ this, but I think the comment below is important
> > enough to double check it before, so please take a look.
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=404711&action=review
> > 
> > > Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:79
> > > +    if (!determinant)
> > 
> > Is the intention here to check for zero exactly, or for some floating point
> > value that is small enough that is logically zero? In the latter case, this
> > looks like a footgun hiding in plain sight and it would be better to compare
> > “std::fabs(determinant) < K” for a reasonable value of “K”, otherwise the
> > value of “determinant” can be almost-but-not zero and defeat the check.
> 
> Zero exactly. See the cairo code from which I took this:
> 
> https://cgit.freedesktop.org/cairo/tree/src/cairo-matrix.c#n685

Great, thanks for confirming that the intention is indeed to check
for zero exactly :]
Comment 5 Carlos Garcia Campos 2020-07-21 01:06:42 PDT
Committed r264646: <https://trac.webkit.org/changeset/264646>
Comment 6 Radar WebKit Bug Importer 2020-07-21 01:07:13 PDT
<rdar://problem/65871255>