Summary: | Web Inspector: editing a color in the Styles sidebar using the color picker only works once for a given color | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Antoine Quint <graouts> | ||||
Component: | Web Inspector | Assignee: | Antoine Quint <graouts> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, dpino, graouts, joepeck, timothy, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Antoine Quint
2014-02-18 03:25:12 PST
The CSSStyleDeclarationTextEditor does not use a CodeMirrorColorEditingController. However, the issue is that in the nested function updateCodeMirror() in CSSStyleDeclarationTextEditor.prototype._colorSwatchClicked() we do not find a valid colorTextMarker past the first update and thus we cannot update the text in the editor. Created attachment 224490 [details]
Patch
Comment on attachment 224490 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=224490&action=review > Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.js:649 > + if (WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(mark).type !== WebInspector.TextMarker.Type.Color) Where does the color type get set? The market on line 674 is just a CodeMirror marker. > Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.js:674 > colorTextMarker = this._codeMirror.markText(range.from, range.to); Doesn't this need to set the type using our API to mark the text? (In reply to comment #4) > (From update of attachment 224490 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=224490&action=review > > > Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.js:649 > > + if (WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(mark).type !== WebInspector.TextMarker.Type.Color) > > Where does the color type get set? The market on line 674 is just a CodeMirror marker. It's set in the CodeMirror extension method .createColorMarkers() which is called from CSSStyleDeclarationTextEditor in ._createColorSwatches(). > > Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.js:674 > > colorTextMarker = this._codeMirror.markText(range.from, range.to); > > Doesn't this need to set the type using our API to mark the text? Not anymore, we'll get the type from the WebInspector.TextMarker created for this CodeMirror TextMarker. *** Bug 128768 has been marked as a duplicate of this bug. *** Comment on attachment 224490 [details] Patch Clearing flags on attachment: 224490 Committed r164312: <http://trac.webkit.org/changeset/164312> All reviewed patches have been landed. Closing bug. |