Bug 179215

Summary: Web Inspector: Styles Redesign: Display warnings
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, buildbot, commit-queue, hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[Animated GIF] With patch applied
none
Patch
buildbot: commit-queue-
[Animated GIF] With patch applied
none
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Patch
none
Patch
none
Patch
none
Patch
nvasilyev: review-, nvasilyev: commit-queue-
[Image] With Brian's patch applied
none
Patch
none
Patch none

Nikita Vasilyev
Reported 2017-11-02 17:17:49 PDT
- Warning icons should NOT knock things out of alignment, like in the old styles sidebar. - Show warning icons at the end, similar to inline errors/warnings in Resources. - Allows showing a checkbox and warning/error at the same time. Makes sense for advisory warnings, but not for errors. <rdar://problem/33948129>
Attachments
[Animated GIF] With patch applied (228.21 KB, image/gif)
2017-11-02 17:24 PDT, Nikita Vasilyev
no flags
Patch (9.53 KB, patch)
2017-11-03 13:16 PDT, Nikita Vasilyev
buildbot: commit-queue-
[Animated GIF] With patch applied (506.99 KB, image/gif)
2017-11-03 13:23 PDT, Nikita Vasilyev
no flags
Archive of layout-test-results from ews125 for ios-simulator-wk2 (1.23 MB, application/zip)
2017-11-03 14:30 PDT, Build Bot
no flags
Patch (9.53 KB, patch)
2017-11-03 14:32 PDT, Nikita Vasilyev
no flags
Patch (10.06 KB, patch)
2017-11-03 14:47 PDT, Nikita Vasilyev
no flags
Patch (10.15 KB, patch)
2017-11-04 16:33 PDT, Nikita Vasilyev
no flags
Patch (12.35 KB, patch)
2017-11-06 14:47 PST, Blaze Burg
nvasilyev: review-
nvasilyev: commit-queue-
[Image] With Brian's patch applied (160.20 KB, image/png)
2017-11-06 15:07 PST, Nikita Vasilyev
no flags
Patch (11.29 KB, patch)
2017-11-06 16:06 PST, Nikita Vasilyev
no flags
Patch (11.26 KB, patch)
2017-11-06 16:08 PST, Nikita Vasilyev
no flags
Nikita Vasilyev
Comment 1 2017-11-02 17:24:03 PDT
Created attachment 325801 [details] [Animated GIF] With patch applied Scrollbar can cover the warning icons, making it hard to get the tooltips when hovering the icons :/
Nikita Vasilyev
Comment 2 2017-11-03 13:16:20 PDT
Nikita Vasilyev
Comment 3 2017-11-03 13:23:56 PDT
Created attachment 325945 [details] [Animated GIF] With patch applied https://www.theverge.com with two invalid inline properties added.
Nikita Vasilyev
Comment 4 2017-11-03 13:30:34 PDT
(In reply to Nikita Vasilyev from comment #3) > Created attachment 325945 [details] > [Animated GIF] With patch applied > > https://www.theverge.com with two invalid inline properties added. The scrollbar partially covers the warning icon. This is the trade-off of having the warning icons on the right side. I think this is an improvement over no warning icons at all. However, I'd like to re-iterate on this when working on styling for overridden/unused/invalid properties (rdar://problem/35077806).
Blaze Burg
Comment 5 2017-11-03 14:01:26 PDT
(In reply to Nikita Vasilyev from comment #4) > (In reply to Nikita Vasilyev from comment #3) > > Created attachment 325945 [details] > > [Animated GIF] With patch applied > > > > https://www.theverge.com with two invalid inline properties added. > > The scrollbar partially covers the warning icon. This is the trade-off of > having > the warning icons on the right side. > > I think this is an improvement over no warning icons at all. However, I'd > like to re-iterate on this when working on styling for > overridden/unused/invalid properties (rdar://problem/35077806). I think the yellow background is enough for most people to notice it has a problem. It would be nice to show the message tooltip when hovering anywhere in the row, though.
Build Bot
Comment 6 2017-11-03 14:30:42 PDT
Comment on attachment 325943 [details] Patch Attachment 325943 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/5094850 New failing tests: http/tests/workers/service/service-worker-clear.html
Build Bot
Comment 7 2017-11-03 14:30:44 PDT
Created attachment 325961 [details] Archive of layout-test-results from ews125 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews125 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.6
Nikita Vasilyev
Comment 8 2017-11-03 14:32:51 PDT
Created attachment 325962 [details] Patch Unrelated test failure. Re-uploading the same patch.
Nikita Vasilyev
Comment 9 2017-11-03 14:46:22 PDT
(In reply to Brian Burg from comment #5) > (In reply to Nikita Vasilyev from comment #4) > > (In reply to Nikita Vasilyev from comment #3) > > > Created attachment 325945 [details] > > > [Animated GIF] With patch applied > > > > > > https://www.theverge.com with two invalid inline properties added. > > > > The scrollbar partially covers the warning icon. This is the trade-off of > > having > > the warning icons on the right side. > > > > I think this is an improvement over no warning icons at all. However, I'd > > like to re-iterate on this when working on styling for > > overridden/unused/invalid properties (rdar://problem/35077806). > > I think the yellow background is enough for most people to notice it has a > problem. It would be nice to show the message tooltip when hovering anywhere > in the row, though. I tried setting the title attribute on the property — it looked fine. I'll do that.
Nikita Vasilyev
Comment 10 2017-11-03 14:47:39 PDT
Joseph Pecoraro
Comment 11 2017-11-03 22:45:19 PDT
Comment on attachment 325965 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=325965&action=review > Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:509 > +localizedStrings["Invalid property name"] = "Invalid property name"; > +localizedStrings["Invalid property value"] = "Invalid property value"; Hmm, maybe "Invalid" should be "Unsupported"? A common case where we see this warning is for a property like "-webkit-text-size-adjust: none". That property name is not invalid, its just unsupported.
Nikita Vasilyev
Comment 12 2017-11-04 16:33:07 PDT
Created attachment 326051 [details] Patch (In reply to Joseph Pecoraro from comment #11) > Comment on attachment 325965 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=325965&action=review > > > Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:509 > > +localizedStrings["Invalid property name"] = "Invalid property name"; > > +localizedStrings["Invalid property value"] = "Invalid property value"; > > Hmm, maybe "Invalid" should be "Unsupported"? A common case where we see > this warning is for a property like "-webkit-text-size-adjust: none". That > property name is not invalid, its just unsupported. Makes sense. On production websites, we're more likely to see property names and values that are unsupported by this version of WebKit on this particular platform.
Devin Rousso
Comment 13 2017-11-05 23:20:15 PST
Comment on attachment 326051 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=326051&action=review > Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:33 > + padding-right: var(--css-declaration-side-padding); > + padding-left: calc(var(--css-declaration-side-padding) + 17px); -webkit-padding-start: calc(var(--css-declaration-side-padding) + 17px); -webkit-padding-end: var(--css-declaration-side-padding); > Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:63 > + left: calc(var(--css-declaration-side-padding) + 1px); Can you add RTL support for this? > Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:103 > + right: 0; Ditto (63). > Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:114 > + padding-left: var(--css-declaration-side-padding); -webkit-padding-start: var(--css-declaration-side-padding); > Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:114 > if (!propertyNameIsValid || duplicatePropertyExistsBelow(this._property)) So does this mean that we only want to add title text if the property is valid? Wouldn't it be pretty simple to add another title right here for duplicate properties? let isDuplicate = duplicatePropertyExistsBelow(this._property); if (!propertyIsValid || isDuplicate) { elementTitle = isDuplicate ? WI.UIString("Duplicate property") : WI.UIString("Unsupported property name"); classNames.push("invalid-name"); } else { elementTitle = WI.UIString("Unsupported property value"); classNames.push("invalid-value"); } > Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:185 > + this._warningElement = document.createElement("span"); this._warningElement = this.element.appendChild(document.createElement("span"));
Blaze Burg
Comment 14 2017-11-06 11:50:36 PST
Comment on attachment 326051 [details] Patch r=me provided you address Devin's requested changes.
Blaze Burg
Comment 15 2017-11-06 14:46:37 PST
Comment on attachment 326051 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=326051&action=review >> Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:114 >> + padding-left: var(--css-declaration-side-padding); > > -webkit-padding-start: var(--css-declaration-side-padding); This matches the opening brace as-is in RTL (i.e., both are equally screwed up due to WebKit's version of unicode, whose bidi algorithm flips braces incorrectly)
Blaze Burg
Comment 16 2017-11-06 14:47:23 PST
Nikita Vasilyev
Comment 17 2017-11-06 15:07:13 PST
Created attachment 326161 [details] [Image] With Brian's patch applied I think it's strange to place checkboxes on the right side while everything else is aligned to left. RTL in the new styles sidebar is basically broken. Before we do anything, we should decide to either: 1. Keep styles sidebar always LTR. CSS code is strictly left to right. 2. Align text to right, flip property name and value fields.
Nikita Vasilyev
Comment 18 2017-11-06 15:12:56 PST
Comment on attachment 326158 [details] Patch Let's continue discussing RTL in Bug 175357 - Web Inspector: Styles redesign: add RTL support.
Nikita Vasilyev
Comment 19 2017-11-06 15:41:32 PST
Comment on attachment 326051 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=326051&action=review >> Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:114 >> if (!propertyNameIsValid || duplicatePropertyExistsBelow(this._property)) > > So does this mean that we only want to add title text if the property is valid? Wouldn't it be pretty simple to add another title right here for duplicate properties? > > let isDuplicate = duplicatePropertyExistsBelow(this._property); > if (!propertyIsValid || isDuplicate) { > elementTitle = isDuplicate ? WI.UIString("Duplicate property") : WI.UIString("Unsupported property name"); > classNames.push("invalid-name"); > } else { > elementTitle = WI.UIString("Unsupported property value"); > classNames.push("invalid-value"); > } My code only checks duplicate INVALID properties. This is wrong. I carried it over from _createTextMarkerForPropertyIfNeeded.prototype._createTextMarkerForPropertyIfNeeded 🤦‍♂️
Nikita Vasilyev
Comment 20 2017-11-06 15:43:00 PST
Comment on attachment 326051 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=326051&action=review >>> Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:114 >>> if (!propertyNameIsValid || duplicatePropertyExistsBelow(this._property)) >> >> So does this mean that we only want to add title text if the property is valid? Wouldn't it be pretty simple to add another title right here for duplicate properties? >> >> let isDuplicate = duplicatePropertyExistsBelow(this._property); >> if (!propertyIsValid || isDuplicate) { >> elementTitle = isDuplicate ? WI.UIString("Duplicate property") : WI.UIString("Unsupported property name"); >> classNames.push("invalid-name"); >> } else { >> elementTitle = WI.UIString("Unsupported property value"); >> classNames.push("invalid-value"); >> } > > My code only checks duplicate INVALID properties. This is wrong. I carried it over from _createTextMarkerForPropertyIfNeeded.prototype._createTextMarkerForPropertyIfNeeded 🤦‍♂️ *from WI.CSSStyleDeclarationTextEditor.prototype._createTextMarkerForPropertyIfNeeded 🤦‍♂️🤦‍♂️
Nikita Vasilyev
Comment 21 2017-11-06 16:06:00 PST
Created attachment 326164 [details] Patch Setting r? since I didn't follow most of the Devin's comments.
Nikita Vasilyev
Comment 22 2017-11-06 16:08:10 PST
WebKit Commit Bot
Comment 23 2017-11-06 17:18:44 PST
The commit-queue encountered the following flaky tests while processing attachment 326165 [details]: svg/animations/svgtransform-animation-1.html bug 179354 (authors: ap@webkit.org, arv@chromium.org, krit@webkit.org, mark.lam@apple.com, and zimmermann@kde.org) The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 24 2017-11-06 17:19:15 PST
Comment on attachment 326165 [details] Patch Clearing flags on attachment: 326165 Committed r224523: <https://trac.webkit.org/changeset/224523>
WebKit Commit Bot
Comment 25 2017-11-06 17:19:16 PST
All reviewed patches have been landed. Closing bug.
Devin Rousso
Comment 26 2017-12-14 21:04:50 PST
*** Bug 174338 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.