RESOLVED FIXED 31049
Watch expression editor should stay open after Add button was clicked
https://bugs.webkit.org/show_bug.cgi?id=31049
Summary Watch expression editor should stay open after Add button was clicked
Yury Semikhatsky
Reported 2009-11-03 01:40:24 PST
Steps to reproduce. 1. Go to Scripts panel 2. In "Watch Expression" panel click "Add" 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.
Attachments
proposed patch 2009/11/03 - a (2.55 KB, patch)
2009-11-03 09:10 PST, Patrick Mueller
no flags
Patrick Mueller
Comment 1 2009-11-03 04:01:30 PST
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 "cleaned some code up" but broke it instead. When fixing this problem, let's make sure it's commented well.
Patrick Mueller
Comment 2 2009-11-03 08:30:55 PST
The problem is that the add WatchExpressionsSection.addExpression() was dependent on update() being synchronous. But it's not. I'm curious how this ever worked, unless our eval() code used to be synchronous, but is now asynchronous. Doesn't matter, I have a fix.
Timothy Hatcher
Comment 3 2009-11-03 09:01:29 PST
Yes eval() code used to be synchronous, but is now asynchronous.
Patrick Mueller
Comment 4 2009-11-03 09:10:34 PST
Created attachment 42387 [details] proposed patch 2009/11/03 - a Moved the code to put the entry into "edit" 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't added by the time the code was run. Because the new check for "edit" 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.
Yury Semikhatsky
Comment 5 2009-11-03 09:19:19 PST
BTW, do we really need to call update and reevaluate all the expressions when a new one is added?
Patrick Mueller
Comment 6 2009-11-03 09:33:38 PST
(In reply to comment #5) > BTW, do we really need to call update and reevaluate all the expressions when a > new one is added? Probably not. OTOH, optimizing to JUST evaluate the new expression will likely add more code, so not clear if it'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'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't really update enough. For instance, we don'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).
WebKit Commit Bot
Comment 7 2009-11-03 10:45:25 PST
Comment on attachment 42387 [details] proposed patch 2009/11/03 - a Clearing flags on attachment: 42387 Committed r50468: <http://trac.webkit.org/changeset/50468>
WebKit Commit Bot
Comment 8 2009-11-03 10:45:28 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.