Bug 145383

Summary: Web Inspector: focus outline of a search field should have a radius
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Animated GIF of the problem
none
[Image] Native input has rounded outline
none
Patch
none
[Animated GIF] With the patch applied
none
[Image] Native outline radius none

Description Nikita Vasilyev 2015-05-26 12:51:48 PDT
Created attachment 253719 [details]
Animated GIF of the problem

https://bugs.webkit.org/show_bug.cgi?id=20807 would solve our problem, but I don’t see any progress there.
Comment 1 Radar WebKit Bug Importer 2015-05-26 12:52:04 PDT
<rdar://problem/21109008>
Comment 2 Nikita Vasilyev 2015-05-26 13:01:35 PDT
Created attachment 253721 [details]
[Image] Native input has rounded outline

There are at least two ways of fixing this:

1. Use native <input type=search> as it does have a rounded outline.

Unfortunately, changing it’s hight via CSS isn't possible with the hight property – only with font-size. Also, we can’t change border colors.
Comment 3 Nikita Vasilyev 2015-05-26 13:35:41 PDT
2. Use box-shadow and make it look like outline. http://stackoverflow.com/a/14896315/16185
Comment 4 Nikita Vasilyev 2015-05-26 13:45:12 PDT
Created attachment 253731 [details]
Patch
Comment 5 Nikita Vasilyev 2015-05-26 13:51:13 PDT
Created attachment 253733 [details]
[Animated GIF] With the patch applied
Comment 6 Timothy Hatcher 2015-05-26 14:03:03 PDT
Comment on attachment 253731 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Views/Toolbar.css:121
> +    box-shadow: rgba(0, 0, 0, 0.15) 0 1px 0, 0 0 0 7px hsla(211, 96%, 48%, 0);

I think the system animates from a much larger size than 7px. Maybe even 15px.
Comment 7 Nikita Vasilyev 2015-05-26 14:42:02 PDT
Created attachment 253740 [details]
[Image] Native outline radius

(In reply to comment #6)
> Comment on attachment 253731 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=253731&action=review
> 
> > Source/WebInspectorUI/UserInterface/Views/Toolbar.css:121
> > +    box-shadow: rgba(0, 0, 0, 0.15) 0 1px 0, 0 0 0 7px hsla(211, 96%, 48%, 0);
> 
> I think the system animates from a much larger size than 7px. Maybe even
> 15px.

I measured it, it’s 24px.

However, in Web Inspector I have two constrains:

1. box-shadow can be clipped by a parent element with overflow hidden. In our case it’s Web Inspector toolbar.

2. CSS transition/animations don't allow animating box shadow color separately from its radius, which needs to be done to match the native behavior.
Comment 8 Nikita Vasilyev 2015-05-26 14:43:38 PDT
(In reply to comment #7)
> Created attachment 253740 [details]
> [Image] Native outline radius
> 
> (In reply to comment #6)
> 2. CSS transition/animations don't allow animating box shadow color
> separately from its radius, which needs to be done to match the native
> behavior.

To clarify, I need to use two different timing function for box shadow color and box shadow spread radius, which isn’t possible.
Comment 9 Timothy Hatcher 2015-05-26 14:44:37 PDT
Comment on attachment 253731 [details]
Patch

Okay, makes sense. This is clearly better than before.
Comment 10 WebKit Commit Bot 2015-05-26 14:48:58 PDT
Comment on attachment 253731 [details]
Patch

Clearing flags on attachment: 253731

Committed r184877: <http://trac.webkit.org/changeset/184877>
Comment 11 WebKit Commit Bot 2015-05-26 14:49:01 PDT
All reviewed patches have been landed.  Closing bug.