Bug 202502 - Fix a bug that warning icon causes infinite rendering when it has warning message.
Summary: Fix a bug that warning icon causes infinite rendering when it has warning mes...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: dewei_zhu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-02 16:44 PDT by dewei_zhu
Modified: 2019-10-09 15:43 PDT (History)
2 users (show)

See Also:


Attachments
Patch (2.71 KB, patch)
2019-10-02 16:46 PDT, dewei_zhu
no flags Details | Formatted Diff | Diff
Patch (4.55 KB, patch)
2019-10-02 22:15 PDT, dewei_zhu
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.