Bug 215364

Summary: Web Inspector: breakpoint condition should be evaluated before the ignore count
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, hi, inspector-bugzilla-changes, joepeck, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 215362    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

Description Devin Rousso 2020-08-11 02:54:09 PDT
It seems very odd to me that the hit count is incremented without checking whether or not the condition matches.

As an example, <https://webkit.org/b/215362> adds the ability for event breakpoints to be configured, meaning that the All Events breakpoint could be configured with a `window.event.type.includes("key")` condition and an ignore count of 2.  There are two ways this can be interpreted
 a) ignore the first two events (whatever they may be) and then break on every event that includes "key"
 b) pause on all but the first two "key" events
I think that (b) is much preferred and more intuitive/useful.

additionally, in the frontend UI, the condition input is above the ignore count input
Comment 1 Radar WebKit Bug Importer 2020-08-18 02:55:15 PDT
<rdar://problem/67310703>
Comment 2 Devin Rousso 2020-08-21 18:53:16 PDT
Created attachment 407039 [details]
Patch
Comment 3 Joseph Pecoraro 2020-08-25 10:35:24 PDT
Comment on attachment 407039 [details]
Patch

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

r=me

> Source/JavaScriptCore/debugger/Breakpoint.cpp:78
> +    return debugger.evaluateBreakpointCondition(*this, globalObject) && ++m_hitCount > m_ignoreCount;

I find this one line unnecessarily complicated when all combined on one line. I'd break it up kinda like it was before
Comment 4 Devin Rousso 2020-08-25 10:52:46 PDT
Created attachment 407209 [details]
Patch
Comment 5 EWS 2020-08-25 11:50:01 PDT
Committed r266138: <https://trac.webkit.org/changeset/266138>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407209 [details].