commit | 1eea03cf28669cb2b11144651a5a289d3a067235 | [log] [tgz] |
---|---|---|
author | Christy Chen <[email protected]> | Wed Jun 26 19:31:24 2019 |
committer | Commit Bot <[email protected]> | Wed Jun 26 19:31:24 2019 |
tree | 7a0481e90a4879a96a2a467c6531456602594177 | |
parent | 3e93ca8563756dec0843adfaf5f7768722e6cb5d [diff] [blame] |
DevTools: work around rjsmin issue to fix Audits frontpage bug 972969 In previous change https://chromium-review.googlesource.com/c/chromium/src/+/1600375, some strings are wrapped inside placeholders ${} in string literals for localization purposes. However, rjsmin couldn't process nested string literals properly so the white-spaces after commas or periods would get trimmed off. It causes the issue where words cannot break to the next line when Audits page resized, and leaves unwanted extra space. This change works around the issue by pulling the string with comma out to a variable to prevent nested string literal. Before fix: https://imgur.com/uMjr5Bp After fix: https://imgur.com/a/X5wq6Xo More details on the rjsmin issue: https://bugs.chromium.org/p/chromium/issues/detail?id=973285 Bug: 972969 Change-Id: I4b4cf243df0ce74c400e488f6c6b98595cf4ecca Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1655913 Commit-Queue: Christy Chen <[email protected]> Reviewed-by: Joel Einbinder <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#672610} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: fa697bc2152cac2195356446de838270ccc964a6
diff --git a/front_end/audits/AuditsStartView.js b/front_end/audits/AuditsStartView.js index e042fe6..4e454f2 100644 --- a/front_end/audits/AuditsStartView.js +++ b/front_end/audits/AuditsStartView.js
@@ -81,18 +81,19 @@ const deviceIcon = UI.Icon.create('largeicon-phone'); const categoriesIcon = UI.Icon.create('largeicon-checkmark'); const throttlingIcon = UI.Icon.create('largeicon-settings-gear'); + const auditsDescription = ls + `Identify and fix common problems that affect your site's performance, accessibility, and user experience.`; // crbug.com/972969 const fragment = UI.Fragment.build` <div class="vbox audits-start-view"> <header> <div class="audits-logo"></div> <div class="audits-start-view-text"> - <h2>${ls`Audits`}</h2> - <p> - ${ls`Identify and fix common problems that affect your site's performance, - accessibility, and user experience.`} - <span class="link" $="learn-more">${ls`Learn more`}</a> - </p> + <h2>${ls`Audits`}</h2> + <p> + <span class="text">${auditsDescription}</span> + <span class="link" $="learn-more">${ls`Learn more`}</a> + </p> </div> </header> <form>