Bug 234800

Summary: Text-decoration color not changing back after input blur with outline removed
Product: WebKit Reporter: hi
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, cdumez, changseok, esprehn+autocc, ews-watchlist, glenn, hi, koivisto, kondapallykalyan, mifenton, mmaxfield, pdr, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: HasReduction, InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Minimum reproducible example of the issue
none
Patch
none
Patch
none
Patch none

Description hi 2022-01-02 11:50:56 PST
Created attachment 448180 [details]
Minimum reproducible example of the issue

On a page with multiple input elements that have colored text-decoration, and the color changes on focus:
- The text-decoration color doesn't change back to the non-focused style when blurring one input and focusing another, leading to a "stuck" effect.
- This issue only occurs when `outline: none;` is specified in the input styles.

Steps to reproduce:
- Download and open reduction.html (attached)
- Tap/click on one input
- Tap/click on a different input

Observe how the first-focused input keeps the red underline, despite the focus shifting away. The expected result is for only one input to ever have a red underline, as the CSS specifies.
Comment 1 zalan 2022-01-05 07:36:02 PST
we are mostly likely missing a repaint when it's a text-decoration-color change only. We trigger repaint when

input:focus {
  text-decoration-color: red;
  color: green;
}
Comment 2 Radar WebKit Bug Importer 2022-01-05 08:07:03 PST
<rdar://problem/87145636>
Comment 3 zalan 2022-01-05 12:11:41 PST
Created attachment 448416 [details]
Patch
Comment 4 zalan 2022-01-05 12:31:44 PST
Created attachment 448419 [details]
Patch
Comment 5 zalan 2022-01-05 12:52:52 PST
Created attachment 448421 [details]
Patch
Comment 6 Simon Fraser (smfr) 2022-01-05 13:09:07 PST
Comment on attachment 448421 [details]
Patch

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

> LayoutTests/fast/forms/dynamic-text-decoration-change.html:26
> +    result.textContent = internals.repaintRectsAsText().length ? "PASS" : "FAIL -no repaint happened";

Would it be better to dump the rects so that we detect if they change?
Comment 7 zalan 2022-01-05 13:16:27 PST
(In reply to Simon Fraser (smfr) from comment #6)
> Comment on attachment 448421 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=448421&action=review
> 
> > LayoutTests/fast/forms/dynamic-text-decoration-change.html:26
> > +    result.textContent = internals.repaintRectsAsText().length ? "PASS" : "FAIL -no repaint happened";
> 
> Would it be better to dump the rects so that we detect if they change?
I don't feel strongly about this but such rect changes (especially with a fix like this) in the past only implied rebaselineing and not actual bugs.
Comment 8 EWS 2022-01-05 21:52:52 PST
Committed r287674 (?): <https://commits.webkit.org/r287674>

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