Bug 215428 - [macOS] Zoomed-in search field is clipped out
Summary: [macOS] Zoomed-in search field is clipped out
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari Technology Preview
Hardware: Mac Other
: P2 Normal
Assignee: Aditya Keerthi
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-12 14:26 PDT by Aditya Keerthi
Modified: 2020-08-13 15:10 PDT (History)
11 users (show)

See Also:


Attachments
Patch (5.83 KB, patch)
2020-08-12 14:47 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff
Patch (9.46 KB, patch)
2020-08-12 19:10 PDT, Aditya Keerthi
darin: review+
Details | Formatted Diff | Diff
Patch for landing (8.17 KB, patch)
2020-08-12 21:09 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff
Patch for landing (8.18 KB, patch)
2020-08-13 07:34 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff
Rebaseline test (2.72 KB, patch)
2020-08-13 14:30 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aditya Keerthi 2020-08-12 14:26:19 PDT
The top and bottom borders, as well as the top and bottom of the focus ring, are clipped when a search field is zoomed in.
Comment 1 Aditya Keerthi 2020-08-12 14:27:44 PDT
<rdar://problem/66161781>
Comment 2 Aditya Keerthi 2020-08-12 14:47:53 PDT
Created attachment 406476 [details]
Patch
Comment 3 Aditya Keerthi 2020-08-12 19:10:32 PDT
Created attachment 406488 [details]
Patch
Comment 4 Darin Adler 2020-08-12 19:32:21 PDT
Comment on attachment 406488 [details]
Patch

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

> Source/WebCore/rendering/RenderThemeMac.mm:1999
> +    NSControlSize controlSize = controlSizeForFont(style);
> +    setFontFromControlSize(style, controlSize);

I know you just moved this, but I suggest doing this in one line without a local variable.

> LayoutTests/ChangeLog:15
> +        * fast/forms/search/search-zoom-rendering-expected.txt: Added.
> +        * fast/forms/search/search-zoom-rendering.html: Added.
> +        * platform/ios-wk2/fast/forms/search/search-zoom-rendering-expected.txt: Added.
> +        * platform/mac-mojave/fast/forms/search/search-zoom-rendering-expected.txt: Added.
> +        * platform/win/fast/forms/search/search-zoom-rendering-expected.txt: Added.

It’s really undesirable to have another render-tree-dumping test like this. Is there any way we can test this without a render tree dump?

One thing to think about is that the render tree dump doesn’t actually check the clipping, only the geometry. Since that’s all we need to check, maybe we can do a reftest that explicitly sets the size? Or perhaps we can do a dumpAsText test that explicitly queries the height?

We can land like this, but these are really hard to maintain over time. I’m particularly puzzled by the seemingly random set of expectation files. For example, why does legacy WebKit testing on iOS use the shared master expectation, but modern WebKit testing on iOS use its own. Maybe that file should be in platform/ios instead of in platform/ios-wk2?
Comment 5 Aditya Keerthi 2020-08-12 21:09:15 PDT
Created attachment 406494 [details]
Patch for landing
Comment 6 Aditya Keerthi 2020-08-12 21:13:07 PDT
(In reply to Darin Adler from comment #4)
> Comment on attachment 406488 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=406488&action=review
> 
> > Source/WebCore/rendering/RenderThemeMac.mm:1999
> > +    NSControlSize controlSize = controlSizeForFont(style);
> > +    setFontFromControlSize(style, controlSize);
> 
> I know you just moved this, but I suggest doing this in one line without a
> local variable.

👍

> > LayoutTests/ChangeLog:15
> > +        * fast/forms/search/search-zoom-rendering-expected.txt: Added.
> > +        * fast/forms/search/search-zoom-rendering.html: Added.
> > +        * platform/ios-wk2/fast/forms/search/search-zoom-rendering-expected.txt: Added.
> > +        * platform/mac-mojave/fast/forms/search/search-zoom-rendering-expected.txt: Added.
> > +        * platform/win/fast/forms/search/search-zoom-rendering-expected.txt: Added.
> 
> It’s really undesirable to have another render-tree-dumping test like this.
> Is there any way we can test this without a render tree dump?
> 
> One thing to think about is that the render tree dump doesn’t actually check
> the clipping, only the geometry. Since that’s all we need to check, maybe we
> can do a reftest that explicitly sets the size? Or perhaps we can do a
> dumpAsText test that explicitly queries the height?
> 
> We can land like this, but these are really hard to maintain over time. I’m
> particularly puzzled by the seemingly random set of expectation files. For
> example, why does legacy WebKit testing on iOS use the shared master
> expectation, but modern WebKit testing on iOS use its own. Maybe that file
> should be in platform/ios instead of in platform/ios-wk2?

I was unable to write a reftest that explicitly sets the size, since height is overridden when rendering our native search control (same behavior as NSSearchFieldCell). However, I did replace the render-tree-dumping test with a dumpAsText test.

I also moved the expectation from platform/ios-wk2 into platform/ios.
Comment 7 Aditya Keerthi 2020-08-13 07:34:05 PDT
Created attachment 406514 [details]
Patch for landing
Comment 8 EWS 2020-08-13 10:56:12 PDT
Committed r265613: <https://trac.webkit.org/changeset/265613>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 406514 [details].
Comment 9 Aditya Keerthi 2020-08-13 14:30:00 PDT
Reopening to attach patch for test fix.
Comment 10 Aditya Keerthi 2020-08-13 14:30:27 PDT
Created attachment 406542 [details]
Rebaseline test
Comment 11 EWS 2020-08-13 15:10:00 PDT
Committed r265625: <https://trac.webkit.org/changeset/265625>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 406542 [details].