Bug 238894

Summary: [:has() pseudo-class] Support invalidation for :placeholder-shown
Product: WebKit Reporter: Tim Nguyen (:ntim) <ntim>
Component: CSSAssignee: Tim Nguyen (:ntim) <ntim>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, esprehn+autocc, ews-watchlist, gyuyoung.kim, mifenton, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 234556    
Attachments:
Description Flags
Patch
none
Patch
simon.fraser: review+, ews-feeder: commit-queue-
[fast-cq] Patch none

Description Tim Nguyen (:ntim) 2022-04-06 14:42:23 PDT
See title
Comment 1 Tim Nguyen (:ntim) 2022-04-06 14:54:36 PDT
Created attachment 456866 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2022-04-06 14:56:09 PDT
<rdar://problem/91377662>
Comment 3 Tim Nguyen (:ntim) 2022-04-06 15:08:53 PDT
Created attachment 456871 [details]
Patch
Comment 4 EWS 2022-04-06 17:10:06 PDT
Found 1 new test failure: imported/blink/fast/forms/textarea-placeholder-visibility-3.html
Comment 5 Tim Nguyen (:ntim) 2022-04-06 21:22:28 PDT
Created attachment 456888 [details]
[fast-cq] Patch
Comment 6 Tim Nguyen (:ntim) 2022-04-06 21:26:47 PDT
For the imported/blink/fast/forms/textarea-placeholder-visibility-3.html failure, it seems like we need to call TextControlPlaceholderElement::resolveCustomStyle(). Not sure if this is an isolated case where Style::PseudoClassChangeInvalidation is not enough compared to invalidateStyleForSubtree(), but might be worth checking.

In the meantime, I've added this for the placeholder case:

    if (RefPtr placeholder = placeholderElement())
        placeholder->invalidateStyle();
Comment 7 EWS 2022-04-06 21:30:18 PDT
Committed r292523 (249361@main): <https://commits.webkit.org/249361@main>

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