Bug 202502

Summary: Fix a bug that warning icon causes infinite rendering when it has warning message.
Product: WebKit Reporter: dewei_zhu
Component: New BugsAssignee: dewei_zhu
Status: RESOLVED FIXED    
Severity: Normal CC: dewei_zhu, rniwa
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch rniwa: review+

Description dewei_zhu 2019-10-02 16:44:01 PDT
Fix a bug that warning icon causes infinite rendering when it has warning message.
Comment 1 dewei_zhu 2019-10-02 16:46:18 PDT
Created attachment 380071 [details]
Patch
Comment 2 Ryosuke Niwa 2019-10-02 19:56:10 PDT
Comment on attachment 380071 [details]
Patch

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

> Websites/perf.webkit.org/public/v3/components/warning-icon.js:4
>      {

I didn't catch this when this class was initially added but it's probably not a good idea to set the warning message in the constructor.
We should just add a member function which sets the warning message.
Then we can simply forward it to this.setButtonTitle, which would avoid this problem without having to create a LazilyEvaluatedFunction.

> Websites/perf.webkit.org/public/v3/components/warning-icon.js:10
> +    _renderWarningMessage(warningMessage)

We usually define these after render().
Comment 3 dewei_zhu 2019-10-02 22:15:14 PDT
Created attachment 380080 [details]
Patch
Comment 4 Ryosuke Niwa 2019-10-02 22:22:37 PDT
Comment on attachment 380080 [details]
Patch

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

> Websites/perf.webkit.org/public/v3/components/test-group-revision-table.js:122
> +            warningIcon.setButtonTitle(`Last status: ${request.statusDescription()}`);

It's a bit strange to call setButtonTitle on WarningIcon.
I think we should add a method like setWarning on WarningIcon itself, which is a trivial forwarding to setButtonTitle.
Comment 5 dewei_zhu 2019-10-09 15:43:35 PDT
Landed in r250647.