WebKit Bugzilla
Attachment 357708 Details for
Bug 192870
: Web Inspector: Audit: provide localization support for % pass display
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192870-20181219133333.patch (text/plain), 6.21 KB, created by
Devin Rousso
on 2018-12-19 12:33:34 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2018-12-19 12:33:34 PST
Size:
6.21 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 7d0af5a0c8220fd42de246bc4e29df89bcfeda52..544637c2d35b33fa5ba821238105196ad3217e2c 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,23 @@ >+2018-12-19 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Audit: provide localization support for % pass display >+ https://bugs.webkit.org/show_bug.cgi?id=192870 >+ <rdar://problem/46779245> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Views/AuditTestGroupContentView.js: >+ (WI.AuditTestGroupContentView.prototype.initialLayout): >+ (WI.AuditTestGroupContentView.prototype.layout): >+ * UserInterface/Views/AuditTestGroupContentView.css: >+ (.content-view.audit-test-group > header > .percentage-pass): >+ (.content-view.audit-test-group > header > .percentage-pass > span): Added. >+ (@media (prefers-dark-interface) .content-view.audit-test-group > header > .percentage-pass): Added. >+ (@media (prefers-dark-interface) .content-view.audit-test-group > header > .percentage-pass > span): Added. >+ (.content-view.audit-test-group > header > .percentage-pass:not(:empty)::after): Deleted. >+ >+ * Localizations/en.lproj/localizedStrings.js: >+ > 2018-12-18 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: m3u8 content not shown, it should be text >diff --git a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >index 60fc1d97a18dea49d5d6b1a1349e9e3311061ebd..675ba31954bc506042e6cdd2704adce4653caac6 100644 >--- a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >+++ b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >@@ -54,6 +54,7 @@ localizedStrings["%s \u2014 %s"] = "%s \u2014 %s"; > localizedStrings["%s cannot be modified"] = "%s cannot be modified"; > localizedStrings["%s delay"] = "%s delay"; > localizedStrings["%s interval"] = "%s interval"; >+localizedStrings["%s%%"] = "%s%%"; > localizedStrings["(Action %s)"] = "(Action %s)"; > localizedStrings["(Disk)"] = "(Disk)"; > localizedStrings["(Index)"] = "(Index)"; >diff --git a/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.css b/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.css >index 18de866df9c35b22246375108991211532018bd6..726312275590f0f1460c2445c9b17c673fd902f4 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.css >+++ b/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.css >@@ -122,16 +122,17 @@ > .content-view.audit-test-group > header > .percentage-pass { > width: var(--metadata-width); > -webkit-margin-start: var(--audit-test-horizontal-space); >- font-size: 24px; >+ font-size: 16px; > text-align: center; > font-weight: bold; >- opacity: 0.65; >+ /* FIXME: Use CSS4 color blend functions once they're available. */ >+ color: hsla(0, 0%, 0%, 0.5); > } > >-.content-view.audit-test-group > header > .percentage-pass:not(:empty)::after { >- content: "%"; >- font-size: 16px; >- opacity: 0.75; >+.content-view.audit-test-group > header > .percentage-pass > span { >+ font-size: 24px; >+ /* FIXME: Use CSS4 color blend functions once they're available. */ >+ color: hsla(0, 0%, 0%, 0.65); > } > > .content-view.audit-test-group > section > .audit-test-case:first-child, >@@ -143,3 +144,15 @@ > .content-view.audit-test-group > section > .audit-test-case:last-child { > margin-bottom: var(--audit-test-vertical-space); > } >+ >+@media (prefers-dark-interface) { >+ .content-view.audit-test-group > header > .percentage-pass { >+ /* FIXME: Use CSS4 color blend functions once they're available. */ >+ color: hsla(0, 0%, 88%, 0.5); >+ } >+ >+ .content-view.audit-test-group > header > .percentage-pass > span { >+ /* FIXME: Use CSS4 color blend functions once they're available. */ >+ color: hsla(0, 0%, 88%, 0.65); >+ } >+} >diff --git a/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js b/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js >index 54bacf4db192211fa932cdb4d83651497bd9e0e9..44101dad5aca3ff4540467a434686b5ebbdae81c 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js >@@ -59,9 +59,16 @@ WI.AuditTestGroupContentView = class AuditTestGroupContentView extends WI.AuditT > this._levelNavigationBar.element.dataset.prefix = WI.UIString("Showing:"); > this.headerView.addSubview(this._levelNavigationBar); > >- this._percentageTextElement = this.headerView.element.appendChild(document.createElement("div")); >- this._percentageTextElement.classList.add("percentage-pass"); >- this.headerView.element.appendChild(this._percentageTextElement); >+ this._percentageContainer = this.headerView.element.appendChild(document.createElement("div")); >+ this._percentageContainer.classList.add("percentage-pass"); >+ this._percentageContainer.hidden = true; >+ >+ this._percentageTextElement = document.createElement("span"); >+ >+ String.format(WI.UIString("%s%%"), [this._percentageTextElement], String.standardFormatters, this._percentageContainer, (a, b) => { >+ a.append(b); >+ return a; >+ }); > } > > layout() >@@ -78,6 +85,7 @@ WI.AuditTestGroupContentView = class AuditTestGroupContentView extends WI.AuditT > this._levelScopeBar = null; > } > >+ this._percentageContainer.hidden = true; > this._percentageTextElement.textContent = ""; > > if (this.representedObject.runningState === WI.AuditManager.RunningState.Inactive) >@@ -93,6 +101,7 @@ WI.AuditTestGroupContentView = class AuditTestGroupContentView extends WI.AuditT > let levelCounts = result.levelCounts; > let totalCount = Object.values(levelCounts).reduce((accumulator, current) => accumulator + current); > this._percentageTextElement.textContent = Math.floor(100 * levelCounts[WI.AuditTestCaseResult.Level.Pass] / totalCount); >+ this._percentageContainer.hidden = false; > > if (!this._levelScopeBar) { > let scopeBarItems = [];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192870
: 357708