Bug 191968

Summary: Placeholder text is not repainted after caps lock indicator is hidden
Product: WebKit Reporter: Daniel Bates <dbates>
Component: Layout and RenderingAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, dino, mitz, sam, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 191164    
Attachments:
Description Flags
Test
none
Patch and layout test zalan: review+

Description Daniel Bates 2018-11-26 09:57:49 PST
Created attachment 355646 [details]
Test

Placeholder text is truncated when the caps lock indicator is hidden. You can see this by opening the attached test case and following the included instructions.
Comment 1 Radar WebKit Bug Importer 2018-11-26 09:58:28 PST
<rdar://problem/46247234>
Comment 2 Daniel Bates 2018-11-26 10:01:00 PST
Created attachment 355647 [details]
Patch and layout test
Comment 3 Daniel Bates 2018-11-26 13:48:12 PST
The placeholder renderer is special. It is an excluded child renderer and does not take part in normal flow layout. It is also created and destroyed as needed. The caps lock indicator is also special in that it is implemented as a RenderImage and we do not know its dimensions before it is loaded and the load happens asynchronously. These constraints together led me to the solution proposed in the patch (attachment #355647 [details]): to detect when the inner text size changes and mark the placeholder as dirty as a way to keep the dimensions of the placeholder in sync with the dimensions of the inner text.
Comment 4 Daniel Bates 2018-11-26 13:49:08 PST
The reason we do not know the dimensions of the caps lock indicator in advance of its load is because we want it to scale with respect to the height of the field.
Comment 5 Daniel Bates 2018-11-26 13:50:26 PST
Committed r238519: <https://trac.webkit.org/changeset/238519>
Comment 6 Daniel Bates 2018-11-26 13:56:46 PST
Substituted UIHelper.toggleCapsLock() for testRunner.toggleCapsLock() as the former replaces the latter following <https://trac.webkit.org/changeset/238512> (bug #191972) and committed the fix in <https://trac.webkit.org/changeset/238520/>.