<?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>171902</bug_id>
          
          <creation_ts>2017-05-09 18:33:34 -0700</creation_ts>
          <short_desc>REGRESSION (r?): Web Inspector: Shift-click on color square in Styles sidebar should not select text</short_desc>
          <delta_ts>2017-05-18 15:33:35 -0700</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>WebKit 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>EasyFix, GoodFirstBug</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikita Vasilyev">nvasilyev</reporter>
          <assigned_to name="Devin Rousso">hi</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>hi</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>mattbaker</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1306700</commentid>
    <comment_count>0</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2017-05-09 18:33:34 -0700</bug_when>
    <thetext>Steps:
1. Inspect any element.
2. Add &quot;color: brown&quot; rule.
3. Click twice on the color square before &quot;brown&quot; while holding Shift key.

Expected:
Text selection shouldn&apos;t change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1309938</commentid>
    <comment_count>1</comment_count>
      <attachid>310468</attachid>
    <who name="Devin Rousso">hi</who>
    <bug_when>2017-05-17 17:29:44 -0700</bug_when>
    <thetext>Created attachment 310468
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1310241</commentid>
    <comment_count>2</comment_count>
      <attachid>310468</attachid>
    <who name="Matt Baker">mattbaker</who>
    <bug_when>2017-05-18 13:50:00 -0700</bug_when>
    <thetext>Comment on attachment 310468
Patch

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

r=me, with some notes.

&gt; Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:-455
&gt; -        if (this._mouseDownCursorPosition.line === cursor.line &amp;&amp; this._mouseDownCursorPosition.ch === cursor.ch) {

Hmm, it would be nice if we could keep this check and return early if it fails. This would improve the readability of the function and avoid doing the work to determine `clickedBookmark` when not needed. To do this would require that `this._mouseDownCursorPosition = null` happen first, instead of at the end of the function. A local `mouseDownCursorPosition` would be needed since the rest of the function uses the value.

I&apos;ll leave it up to you. If you think the function is cleanest as-is, I&apos;m fine with it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1310282</commentid>
    <comment_count>3</comment_count>
      <attachid>310468</attachid>
    <who name="Devin Rousso">hi</who>
    <bug_when>2017-05-18 15:05:16 -0700</bug_when>
    <thetext>Comment on attachment 310468
Patch

(In reply to Matt Baker from comment #2)
&gt; Comment on attachment 310468 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=310468&amp;action=review
&gt; 
&gt; r=me, with some notes.
&gt; 
&gt; &gt; Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:-455
&gt; &gt; -        if (this._mouseDownCursorPosition.line === cursor.line &amp;&amp; this._mouseDownCursorPosition.ch === cursor.ch) {
&gt; 
&gt; Hmm, it would be nice if we could keep this check and return early if it
&gt; fails. This would improve the readability of the function and avoid doing
&gt; the work to determine `clickedBookmark` when not needed. To do this would
&gt; require that `this._mouseDownCursorPosition = null` happen first, instead of
&gt; at the end of the function. A local `mouseDownCursorPosition` would be
&gt; needed since the rest of the function uses the value.
&gt; 
&gt; I&apos;ll leave it up to you. If you think the function is cleanest as-is, I&apos;m
&gt; fine with it.

I personally would prefer not to do that, as it seems a bit awkward to me to null a value that will be used later while also creating a local variable with that value.  If it gets any more complex, however, it might be worth revisiting.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1310299</commentid>
    <comment_count>4</comment_count>
      <attachid>310468</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-05-18 15:33:33 -0700</bug_when>
    <thetext>Comment on attachment 310468
Patch

Clearing flags on attachment: 310468

Committed r217072: &lt;http://trac.webkit.org/changeset/217072&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1310300</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2017-05-18 15:33:35 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>310468</attachid>
            <date>2017-05-17 17:29:44 -0700</date>
            <delta_ts>2017-05-18 15:33:33 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-171902-20170517172944.patch</filename>
            <type>text/plain</type>
            <size>2431</size>
            <attacher name="Devin Rousso">hi</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9DaGFuZ2VMb2cgYi9Tb3VyY2UvV2Vi
SW5zcGVjdG9yVUkvQ2hhbmdlTG9nCmluZGV4IDEyNmMxNjEwYWViNWYxNjYwNzliYzkxNjc2NjMy
ZWFhMGE4NzliN2YuLmY3MDU2YjY4ZDZjYjc4MmJjM2Q2NDllNzJjMTg2ZjQ2MGIxZjE1NmIgMTAw
NjQ0Ci0tLSBhL1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9DaGFuZ2VMb2cKKysrI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ya2Vy
LnJlcGxhY2VkV2l0aCAhPT0gZXZlbnQudGFyZ2V0KQorICAgICAgICAgICAgICAgIGNvbnRpbnVl
OworCisgICAgICAgICAgICBsZXQgcG9zID0gbWFya2VyLmZpbmQoKTsKKyAgICAgICAgICAgIGlm
IChwb3MubGluZSA9PT0gY3Vyc29yLmxpbmUgJiYgTWF0aC5hYnMocG9zLmNoIC0gY3Vyc29yLmNo
KSA8PSAxKSB7CisgICAgICAgICAgICAgICAgY2xpY2tlZEJvb2ttYXJrID0gdHJ1ZTsKKyAgICAg
ICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlm
ICghY2xpY2tlZEJvb2ttYXJrICYmIHRoaXMuX21vdXNlRG93bkN1cnNvclBvc2l0aW9uLmxpbmUg
PT09IGN1cnNvci5saW5lICYmIHRoaXMuX21vdXNlRG93bkN1cnNvclBvc2l0aW9uLmNoID09PSBj
dXJzb3IuY2gpIHsKICAgICAgICAgICAgIGxldCBsaW5lID0gdGhpcy5fY29kZU1pcnJvci5nZXRM
aW5lKGN1cnNvci5saW5lKTsKICAgICAgICAgICAgIGlmIChjdXJzb3IuY2ggPT09IGxpbmUudHJp
bVJpZ2h0KCkubGVuZ3RoKSB7CiAgICAgICAgICAgICAgICAgbGV0IG5leHRMaW5lID0gdGhpcy5f
Y29kZU1pcnJvci5nZXRMaW5lKGN1cnNvci5saW5lICsgMSk7Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>