<?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>31049</bug_id>
          
          <creation_ts>2009-11-03 01:40:24 -0800</creation_ts>
          <short_desc>Watch expression editor should stay open after Add button was clicked</short_desc>
          <delta_ts>2009-11-03 10:45:28 -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 (Deprecated)</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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yury Semikhatsky">yurys</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>pmuellr</cc>
    
    <cc>timothy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>160013</commentid>
    <comment_count>0</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2009-11-03 01:40:24 -0800</bug_when>
    <thetext>Steps to reproduce.
1. Go to Scripts panel
2. In &quot;Watch Expression&quot; panel click &quot;Add&quot;

Expected result: expression editor is open and focused.
Actual result: an empty expression is added. You need to click the colon symbol to start editing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>160024</commentid>
    <comment_count>1</comment_count>
    <who name="Patrick Mueller">pmuellr</who>
    <bug_when>2009-11-03 04:01:30 -0800</bug_when>
    <thetext>Yes, this is a regression.  IIRC, the code to make this happen was a bit confusing, as it involved setting the value to some kind of special value.  Easy to imagine someone might have &quot;cleaned some code up&quot; but broke it instead.  When fixing this problem, let&apos;s make sure it&apos;s commented well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>160072</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick Mueller">pmuellr</who>
    <bug_when>2009-11-03 08:30:55 -0800</bug_when>
    <thetext>The problem is that the add WatchExpressionsSection.addExpression() was dependent on update() being synchronous.  But it&apos;s not.  I&apos;m curious how this ever worked, unless our eval() code used to be synchronous, but is now asynchronous.

Doesn&apos;t matter, I have a fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>160077</commentid>
    <comment_count>3</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2009-11-03 09:01:29 -0800</bug_when>
    <thetext>Yes eval() code used to be synchronous, but is now asynchronous.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>160081</commentid>
    <comment_count>4</comment_count>
      <attachid>42387</attachid>
    <who name="Patrick Mueller">pmuellr</who>
    <bug_when>2009-11-03 09:10:34 -0800</bug_when>
    <thetext>Created attachment 42387
proposed patch 2009/11/03 - a

Moved the code to put the entry into &quot;edit&quot; mode into the path where the entry is added to the tree.  With the new async eval(), the old code path would never work, because the entry wasn&apos;t added by the time the code was run.  

Because the new check for &quot;edit&quot; mode is now in a code path that runs a lot more often, also added a flag - _newExpressionAdded - to indicate when the check should be made, since it requires a linear search through the watch expressions, and could in theory be expensive.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>160083</commentid>
    <comment_count>5</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2009-11-03 09:19:19 -0800</bug_when>
    <thetext>BTW, do we really need to call update and reevaluate all the expressions when a new one is added?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>160089</commentid>
    <comment_count>6</comment_count>
    <who name="Patrick Mueller">pmuellr</who>
    <bug_when>2009-11-03 09:33:38 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; BTW, do we really need to call update and reevaluate all the expressions when a
&gt; new one is added?

Probably not.  

OTOH, optimizing to JUST evaluate the new expression will likely add more code, so not clear if it&apos;s really worth it, given the probably relative infrequency that people will be updating watch expressions.

Part of the problem is also that the WatchExpressions classes subclass ObjectProperties sections, which don&apos;t (IIRC) have fine-grained control over dealing with individual members.  Hence the kinda hacky findAddedTreeElement() function.  Perhaps some additional goodies in the superclasses would make optimizing this a bit easier.

Note also that, in general, we don&apos;t really update enough.  For instance, we don&apos;t update after a line is executed on the console, but probably should.  You could also imagine updating after every UI event that occurs in the target (well, except some of the excessive mouse events).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>160127</commentid>
    <comment_count>7</comment_count>
      <attachid>42387</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-11-03 10:45:25 -0800</bug_when>
    <thetext>Comment on attachment 42387
proposed patch 2009/11/03 - a

Clearing flags on attachment: 42387

Committed r50468: &lt;http://trac.webkit.org/changeset/50468&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>160128</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-11-03 10:45:28 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>42387</attachid>
            <date>2009-11-03 09:10:34 -0800</date>
            <delta_ts>2009-11-03 10:45:25 -0800</delta_ts>
            <desc>proposed patch 2009/11/03 - a</desc>
            <filename>31049.patch</filename>
            <type>text/plain</type>
            <size>2607</size>
            <attacher name="Patrick Mueller">pmuellr</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNv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CiAKICAgICB1
cGRhdGVFeHByZXNzaW9uOiBmdW5jdGlvbihlbGVtZW50LCB2YWx1ZSkK
</data>

          </attachment>
      

    </bug>

</bugzilla>