<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>128965</bug_id>
          
          <creation_ts>2014-02-18 03:25:12 -0800</creation_ts>
          <short_desc>Web Inspector: editing a color in the Styles sidebar using the color picker only works once for a given color</short_desc>
          <delta_ts>2014-02-18 13:39:40 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Antoine Quint">graouts</reporter>
          <assigned_to name="Antoine Quint">graouts</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>dpino</cc>
    
    <cc>graouts</cc>
    
    <cc>joepeck</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>981865</commentid>
    <comment_count>0</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2014-02-18 03:25:12 -0800</bug_when>
    <thetext>Steps to reproduce:

1. select any DOM node with a style property set to a color value
2. show the Styles sidebar
3. click on the color swatch for that value
4. click anywhere on the color wheel, notice how the color in the editor is changed to match
5. click anywhere on the color wheel, notice how the color _does not_ change to match in the editor

I believe the CodeMirror text marker managed by the WebInspector.TextMarker object is no longer present when we try to update its text from the WebInspector.CodeMirrorColorEditingController.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>981867</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2014-02-18 03:25:38 -0800</bug_when>
    <thetext>&lt;rdar://problem/16096027&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>981870</commentid>
    <comment_count>2</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2014-02-18 03:32:19 -0800</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>981877</commentid>
    <comment_count>3</comment_count>
      <attachid>224490</attachid>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2014-02-18 03:53:19 -0800</bug_when>
    <thetext>Created attachment 224490
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>981921</commentid>
    <comment_count>4</comment_count>
      <attachid>224490</attachid>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2014-02-18 07:25:38 -0800</bug_when>
    <thetext>Comment on attachment 224490
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=224490&amp;action=review

&gt; Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.js:649
&gt; +                        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.

&gt; Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.js:674
&gt;                  colorTextMarker = this._codeMirror.markText(range.from, range.to);

Doesn&apos;t this need to set the type using our API to mark the text?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>981928</commentid>
    <comment_count>5</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2014-02-18 07:39:32 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; (From update of attachment 224490 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=224490&amp;action=review
&gt; 
&gt; &gt; Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.js:649
&gt; &gt; +                        if (WebInspector.TextMarker.textMarkerForCodeMirrorTextMarker(mark).type !== WebInspector.TextMarker.Type.Color)
&gt; 
&gt; Where does the color type get set? The market on line 674 is just a CodeMirror marker.

It&apos;s set in the CodeMirror extension method .createColorMarkers() which is called from CSSStyleDeclarationTextEditor in ._createColorSwatches().

&gt; &gt; Source/WebInspectorUI/UserInterface/CSSStyleDeclarationTextEditor.js:674
&gt; &gt;                  colorTextMarker = this._codeMirror.markText(range.from, range.to);
&gt; 
&gt; Doesn&apos;t this need to set the type using our API to mark the text?

Not anymore, we&apos;ll get the type from the WebInspector.TextMarker created for this CodeMirror TextMarker.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>982054</commentid>
    <comment_count>6</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2014-02-18 13:10:46 -0800</bug_when>
    <thetext>*** Bug 128768 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>982066</commentid>
    <comment_count>7</comment_count>
      <attachid>224490</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-02-18 13:39:38 -0800</bug_when>
    <thetext>Comment on attachment 224490
Patch

Clearing flags on attachment: 224490

Committed r164312: &lt;http://trac.webkit.org/changeset/164312&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>982067</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-02-18 13:39:40 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>224490</attachid>
            <date>2014-02-18 03:53:19 -0800</date>
            <delta_ts>2014-02-18 13:39:38 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-128965-20140218125317.patch</filename>
            <type>text/plain</type>
            <size>2551</size>
            <attacher name="Antoine Quint">graouts</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTY0MjM3CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViSW5zcGVj
dG9yVUkvQ2hhbmdlTG9nIGIvU291cmNlL1dlYkluc3BlY3RvclVJL0NoYW5nZUxvZwppbmRleCAx
MzYxMmNhN2NjYWZjNTA0MGY1ZWZiMGI0MWY4OWIwMWZmOTlhMGZjLi5hODY0YTZiYTlhZTU3ZTg2
YzI5NTc3NzY1YTMyNDViOGIwYzcyMzY4IDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViSW5zcGVjdG9y
VUkvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9DaGFuZ2VMb2cKQEAgLTEs
MyArMSwxOCBAQAorMjAxNC0wMi0xOCAgQW50b2luZSBRdWludCAgPGdyYW91dHNAd2Via2l0Lm9y
Zz4KKworICAgICAgICBXZWIgSW5zcGVjdG9yOiBlZGl0aW5nIGEgY29sb3IgaW4gdGhlIFN0eWxl
cyBzaWRlYmFyIHVzaW5nIHRoZSBjb2xvciBwaWNrZXIgb25seSB3b3JrcyBvbmNlIGZvciBhIGdp
dmVuIGNvbG9yCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9p
ZD0xMjg5NjUKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAg
ICBVc2UgdGhlIFdlYkluc3BlY3Rvci5UZXh0TWFya2VyIGJhY2tpbmcgdGhlIENvZGVNaXJyb3Ig
VGV4dE1hcmtlciBvYmplY3QgdG8gaW5zcGVjdCBpdHMgdHlwZSBpbgorICAgICAgICBvc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S5jaCArIG5ld0NvbG9yVGV4dC5sZW5ndGg7CiAKICAg
ICAgICAgICAgICAgICBjb2xvclRleHRNYXJrZXIgPSB0aGlzLl9jb2RlTWlycm9yLm1hcmtUZXh0
KHJhbmdlLmZyb20sIHJhbmdlLnRvKTsKLSAgICAgICAgICAgICAgICBjb2xvclRleHRNYXJrZXIu
X19tYXJrZWRDb2xvciA9IHRydWU7CiAKICAgICAgICAgICAgICAgICBzd2F0Y2guX19jb2xvclRl
eHRNYXJrZXIgPSBjb2xvclRleHRNYXJrZXI7CiAgICAgICAgICAgICB9Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>