Bug 190289

Summary: [macOS] Fix some font attribute conversion bugs in preparation for "Font > Styles…" support in WebKit2
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: HTML EditingAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue, mitz, rniwa, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Test tweak
none
Add rdar to ChangeLog none

Description Wenson Hsieh 2018-10-04 13:24:53 PDT
After fixing <https://bugs.webkit.org/show_bug.cgi?id=146381> locally (along with the "Styles…" and "Show Colors" options in the context menu), I noticed a couple of bugs in our font attribute conversion code:
- Setting a font shadow with a blur radius of 0 and an offset of (X, Y) where X < 0 or Y < 0 does not work.
- We hit a debug assertion when removing background text colors using the modal sheet presented via "Font > Styles…"
Comment 1 Wenson Hsieh 2018-10-04 13:25:28 PDT
...we can address these bugs in parallel.
Comment 2 Wenson Hsieh 2018-10-04 13:51:41 PDT
Created attachment 351624 [details]
Patch
Comment 3 Wenson Hsieh 2018-10-04 13:55:11 PDT
Created attachment 351625 [details]
Test tweak
Comment 4 Radar WebKit Bug Importer 2018-10-04 13:55:38 PDT
<rdar://problem/45020807>
Comment 5 Radar WebKit Bug Importer 2018-10-04 13:55:39 PDT
<rdar://problem/45020806>
Comment 6 Wenson Hsieh 2018-10-04 13:59:40 PDT
Created attachment 351626 [details]
Add rdar to ChangeLog
Comment 7 Ryosuke Niwa 2018-10-04 14:52:36 PDT
Comment on attachment 351626 [details]
Add rdar to ChangeLog

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

Nice bug fixes!

> Source/WebCore/ChangeLog:19
> +        Currently, we bail from adding a font shadow if the shadow's offset is empty. However, valid shadow offsets may
> +        have negative dimensions, so a check for `isZero()` should be used instead.

It's very strange / unintuitive that isEmpty() returns true for negative offsets...

> Source/WebCore/ChangeLog:26
> +        transparent color (this scenario is exercised when using "Font > Stylesâ¦" to specify a font style without a

What's up with "â¦"?
Comment 8 Wenson Hsieh 2018-10-04 14:58:28 PDT
(In reply to Ryosuke Niwa from comment #7)
> Comment on attachment 351626 [details]
> Add rdar to ChangeLog
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=351626&action=review
> 
> Nice bug fixes!
> 
> > Source/WebCore/ChangeLog:19
> > +        Currently, we bail from adding a font shadow if the shadow's offset is empty. However, valid shadow offsets may
> > +        have negative dimensions, so a check for `isZero()` should be used instead.
> 
> It's very strange / unintuitive that isEmpty() returns true for negative
> offsets...

Yeah... :/ I think this makes it easier than it should be to make this kind of mistake for FloatSizes that represent offsets, like this.

> 
> > Source/WebCore/ChangeLog:26
> > +        transparent color (this scenario is exercised when using "Font > Stylesâ¦" to specify a font style without a
> 
> What's up with "â¦"?

This is actually an ellipsis '…' character, but the Bugzilla patch review tool apparently displays this as "â¦". It looks normal outside of the Bugzilla patch review page.
Comment 9 WebKit Commit Bot 2018-10-04 15:09:00 PDT
Comment on attachment 351626 [details]
Add rdar to ChangeLog

Clearing flags on attachment: 351626

Committed r236854: <https://trac.webkit.org/changeset/236854>
Comment 10 WebKit Commit Bot 2018-10-04 15:09:02 PDT
All reviewed patches have been landed.  Closing bug.