The patch for https://bugs.webkit.org/show_bug.cgi?id=119686 will provide a new gradients editor but it only works as part of SourceCodeTextEditor and not CSSStyleDeclarationTextEditor. We should add support for such editors in CSSStyleDeclarationTextEditor as well and possibly adopt the CodeMirrorColorEditingController for editing colours as well so that SourceCodeTextEditor and CSSStyleDeclarationTextEditor are more alike.
<rdar://problem/16120224>
I wonder if we could refactor SourceCodeTextEditor and CSSStyleDeclarationTextEditor to share some CodeMirrorTokenTrackingController and CodeMirrorEditingController logic to implement the basic behaviour implemented in SourceCodeTextEditor across both editors. I think basically we'd have a new helper object which we'd notify when the editor hides, has its content populated or changed, and have basic handlers for tokenTrackingControllerNewHighlightCandidate and tokenTrackingControllerMouseOutOfHoveredMarker that do the work. Then the CodeMirrorEditingController delegates would be implemented by this helper object as well and the editor classes would have little knowledge of CodeMirrorEditingController.
A unified controller that SourceCodeTextEditor and CSSStyleDeclarationTextEditor uses to share the editing logic seems good to me. One thing we need to consider is how to support changing the color format if the swatch isn't there. This makes having a menu in HoverMenu for colors appealing, since you could have menu items for the other formats (with the current one having a checkmark).
(In reply to comment #3) > One thing we need to consider is how to support changing the color format if the swatch isn't there. This makes having a menu in HoverMenu for colors appealing, since you could have menu items for the other formats (with the current one having a checkmark). Good point, I'll look into implementing that.
I am pretty sure that this is no longer an issue, right? We can edit gradients in the style sidebar.
Yeah, I can confirm that this has been fixed. Very nice!