RESOLVED FIXED 192784
Web Inspector: Styles: shift-clicking a color-swatch to change formats starts editing the color
https://bugs.webkit.org/show_bug.cgi?id=192784
Summary Web Inspector: Styles: shift-clicking a color-swatch to change formats starts...
Devin Rousso
Reported 2018-12-17 16:06:29 PST
# STEPS TO REPRODUCE: 1. inspect any page that uses a CSS color (e.g. via the `color` property) 2. shift-click the color swatch that appears next to the color string => format changes and the value enters editing mode
Attachments
Patch (1.46 KB, patch)
2018-12-19 16:32 PST, Nikita Vasilyev
no flags
[Animated GIF] With patch applied (145.70 KB, image/gif)
2018-12-19 16:39 PST, Nikita Vasilyev
no flags
Devin Rousso
Comment 1 2018-12-17 16:07:12 PST
Views/SpreadsheetStyleProperty.js:663:23: CONSOLE ERROR Modified property was unlocked (color) Models/CSSProperty.js:372:23: CONSOLE ERROR _styleSheetTextRange data is invalid.
Radar WebKit Bug Importer
Comment 2 2018-12-17 21:38:23 PST
Nikita Vasilyev
Comment 3 2018-12-19 16:32:00 PST
Nikita Vasilyev
Comment 4 2018-12-19 16:39:04 PST
Created attachment 357752 [details] [Animated GIF] With patch applied
Devin Rousso
Comment 5 2018-12-19 16:41:03 PST
Comment on attachment 357750 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=357750&action=review rs=me, thanks for the quick fix! > Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:484 > + if (this._swatchActive || event.shiftKey) Is there any reason to not prevent editing when clicking on the swatch? Is this needed to make sure multiple-selection works with ⌘-click/⇧-click? If that's the case, should this check instead just be that we aren't in "multiple-selection mode" or that "multiple-selection isn't active"?
Nikita Vasilyev
Comment 6 2018-12-19 17:06:05 PST
(In reply to Devin Rousso from comment #5) > Comment on attachment 357750 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=357750&action=review > > rs=me, thanks for the quick fix! > > > Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js:484 > > + if (this._swatchActive || event.shiftKey) > > Is there any reason to not prevent editing when clicking on the swatch? Is > this needed to make sure multiple-selection works with ⌘-click/⇧-click? If > that's the case, should this check instead just be that we aren't in > "multiple-selection mode" or that "multiple-selection isn't active"? Ideally, we should always prevent editing when clicking on the swatch. If I replace it with: swatch.element.addEventListener("click", (event) => { event.stop(); }); Inline swatches stop working after the first click! This happens because _swatchElementClicked removes itself: if (this._boundSwatchElementClicked) this._swatchElement.removeEventListener("click", this._boundSwatchElementClicked); and when this event listener gets added back (in didDismissPopover), it ends up *after* the `event.stop()` event listener. I'd like to rewrite InlineSwatch so I don't need to call `event.stop` in SpreadsheetStyleProperty at all. I'm planning to do after the break, not today or tomorrow.
WebKit Commit Bot
Comment 7 2018-12-19 17:22:46 PST
Comment on attachment 357750 [details] Patch Clearing flags on attachment: 357750 Committed r239413: <https://trac.webkit.org/changeset/239413>
WebKit Commit Bot
Comment 8 2018-12-19 17:22:47 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.