Merge sync and async code paths for getting context menus
[WebKit-https.git] / Source / WebInspectorUI / ChangeLog
1 2018-01-16  Nikita Vasilyev  <nvasilyev@apple.com>
2
3         Web Inspector: Styles: pressing down key should select first item from completion list when focusing on empty value
4         https://bugs.webkit.org/show_bug.cgi?id=181633
5         <rdar://problem/36501797>
6
7         Reviewed by Joseph Pecoraro.
8
9         * UserInterface/Views/SpreadsheetTextField.js:
10         (WI.SpreadsheetTextField.prototype._updateCompletions):
11
12 2018-01-16  Nikita Vasilyev  <nvasilyev@apple.com>
13
14         Web Inspector: Styles Redesign: Long value causes bad wrapping
15         https://bugs.webkit.org/show_bug.cgi?id=181618
16         <rdar://problem/36485175>
17
18         Reviewed by Joseph Pecoraro.
19
20         Wrap long values only when editing.
21
22         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
23         (.spreadsheet-style-declaration-editor .value.editing):
24
25 2018-01-16  Nikita Vasilyev  <nvasilyev@apple.com>
26
27         Web Inspector: Styles Redesign: clicking on the white space after the property sometimes places a blank property at the wrong index
28         https://bugs.webkit.org/show_bug.cgi?id=179585
29         <rdar://problem/35490780>
30
31         Reviewed by Joseph Pecoraro.
32
33         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
34         (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetStylePropertyRemoved):
35         Layout call is needed to update data-property-index attributes on the property views.
36
37 2018-01-16  Joseph Pecoraro  <pecoraro@apple.com>
38
39         Web Inspector: Network Tab - Export HAR Context Menu not working
40         https://bugs.webkit.org/show_bug.cgi?id=181694
41         <rdar://problem/36479197>
42
43         Reviewed by Brian Burg.
44
45         * UserInterface/Views/NetworkTableContentView.js:
46         (WI.NetworkTableContentView.prototype.tableCellContextMenuClicked):
47         Ensure `this` works in the handler.
48
49 2018-01-15  Matt Baker  <mattbaker@apple.com>
50
51         Web Inspector: TabBar redesign: add context menu to TabBar for toggling available tabs
52         https://bugs.webkit.org/show_bug.cgi?id=181448
53         <rdar://problem/36383298>
54
55         Reviewed by Devin Rousso.
56
57         * UserInterface/Base/Main.js:
58         (WI.loaded):
59         (WI.contentLoaded):
60         Reorder production tab classes and default (open) tabs.
61         (WI.registerTabClass): Removed.
62         Not used.
63
64         * UserInterface/Base/Object.js:
65         Remove notification that is no longer used.
66
67         * UserInterface/Views/GeneralTabBarItem.js:
68         (WI.GeneralTabBarItem):
69         (WI.GeneralTabBarItem.prototype.set title):
70         (WI.GeneralTabBarItem.prototype._handleContextMenuEvent): Deleted.
71         Remove per-tab context menu (provided Close Tab and Close Other Tabs).
72
73         * UserInterface/Views/NewTabContentView.js:
74         (WI.NewTabContentView):
75
76         * UserInterface/Views/TabBar.js:
77         (WI.TabBar):
78         (WI.TabBar.prototype._handleContextMenu):
79
80         * UserInterface/Views/TabBrowser.js:
81         (WI.TabBrowser):
82         (WI.TabBrowser._handleNewTabContextMenu): Deleted.
83         No longer needed.
84
85 2018-01-13  Nikita Vasilyev  <nvasilyev@apple.com>
86
87         Web Inspector: Styles Redesign: properties should never be semitransparent or crossed out while editing
88         https://bugs.webkit.org/show_bug.cgi?id=180793
89         <rdar://problem/36038813>
90
91         Reviewed by Devin Rousso.
92
93         * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
94         (.spreadsheet-style-declaration-editor .value.editing):
95         (.spreadsheet-style-declaration-editor .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled) .content > *):
96         (.spreadsheet-style-declaration-editor .property.invalid-name:not(.disabled) .content > *):
97         (.spreadsheet-style-declaration-editor .property.invalid-value:not(.disabled) .content .value):
98         (.spreadsheet-style-declaration-editor .property.not-inherited .content > *):
99         * UserInterface/Views/SpreadsheetStyleProperty.js:
100         (WI.SpreadsheetStyleProperty.prototype._update):
101
102 2018-01-12  Joseph Pecoraro  <pecoraro@apple.com>
103
104         Web Inspector: Drop support for iOS 7 targets
105         https://bugs.webkit.org/show_bug.cgi?id=181549
106         <rdar://problem/36444813>
107
108         Reviewed by Brian Burg.
109
110         * Versions/Inspector-iOS-7.0.json: Removed.
111         * UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js: Removed.
112         Remove protocol snapshot and generated commands for iOS 7.
113
114         * UserInterface/Base/Main.js:
115         * UserInterface/Controllers/BreakpointPopoverController.js:
116         (WI.BreakpointPopoverController.prototype._createPopoverContent):
117         * UserInterface/Controllers/DebuggerManager.js:
118         (WI.DebuggerManager.prototype._setBreakpoint):
119         * UserInterface/Controllers/SourceMapManager.js:
120         (WI.SourceMapManager.prototype._loadAndParseSourceMap):
121         * UserInterface/Models/Instrument.js:
122         (WI.Instrument.startLegacyTimelineAgent):
123         * UserInterface/Models/ResourceTimingData.js:
124         * UserInterface/Models/ScriptTimelineRecord.js:
125         (WI.ScriptTimelineRecord.EventType.displayName):
126         * UserInterface/Models/SourceMapResource.js:
127         (WI.SourceMapResource.prototype.requestContentFromBackend):
128         * UserInterface/Protocol/CSSObserver.js:
129         (WI.CSSObserver.prototype.regionLayoutUpdated): Deleted.
130         * UserInterface/Protocol/RemoteObject.js:
131         (WI.RemoteObject.fromPayload):
132         Remove code that was only necessary to support iOS 7.
133
134 2018-01-12  Joseph Pecoraro  <pecoraro@apple.com>
135
136         Web Inspector: Support JSX (React) syntax highlighting
137         https://bugs.webkit.org/show_bug.cgi?id=181607
138         <rdar://problem/36442564>
139
140         Reviewed by Brian Burg.
141
142         * UserInterface/Base/MIMETypeUtilities.js:
143         (WI.mimeTypeForFileExtension):
144         (WI.fileExtensionForMIMEType):
145         * UserInterface/Models/Resource.js:
146         Support the jsx extension and mime types.
147
148         * UserInterface/Main.html:
149         * Scripts/update-codemirror-resources.rb:
150         * UserInterface/External/CodeMirror/jsx.js: Added.
151         Include new mode from CodeMirror@d8926768.
152
153 2018-01-11  Joseph Pecoraro  <pecoraro@apple.com>
154
155         Web Inspector: Rename "Query String" section as "Query String Parameters" for clarity
156         https://bugs.webkit.org/show_bug.cgi?id=181464
157
158         Reviewed by Darin Adler.
159
160         * Localizations/en.lproj/localizedStrings.js:
161         * UserInterface/Views/ResourceHeadersContentView.js:
162         (WI.ResourceHeadersContentView.prototype.initialLayout):
163
164 2018-01-11  Joseph Pecoraro  <pecoraro@apple.com>
165
166         Web Inspector: Remove unused variable in WI.DebuggerSidebarPanel
167         https://bugs.webkit.org/show_bug.cgi?id=181517
168
169         Reviewed by Matt Baker.
170
171         * UserInterface/Views/DebuggerSidebarPanel.js:
172
173 2018-01-10  Joseph Pecoraro  <pecoraro@apple.com>
174
175         REGRESSION(r218975): Web Inspector: Add back NavigationSidebarPanel initialization parameter used by SearchSidebarPanel (top overflow shadow)
176         https://bugs.webkit.org/show_bug.cgi?id=181518
177         <rdar://problem/36427197>
178
179         Reviewed by Matt Baker.
180
181         * UserInterface/Views/NavigationSidebarPanel.css:
182         (.sidebar > .panel.navigation > .overflow-shadow.top):
183         * UserInterface/Views/NavigationSidebarPanel.js:
184         (WI.NavigationSidebarPanel):
185         Add back the initialization parameter still used by SearchSidebarPanel
186         and add back its implementation. There were still references to
187         dynamically update _topOverflowShadowElement in NavigationSidebarPanel.
188
189 2018-01-10  Joseph Pecoraro  <pecoraro@apple.com>
190
191         Web Inspector: Incorrect check with WI.debuggableType
192         https://bugs.webkit.org/show_bug.cgi?id=181515
193         <rdar://problem/36425509>
194
195         Reviewed by Brian Burg.
196
197         * UserInterface/Base/Main.js:
198         (WI.contentLoaded):
199         This moved to WI.sharedApp a while ago.
200
201 2018-01-10  Matt Baker  <mattbaker@apple.com>
202
203         Web Inspector: Canvas tab: throttle recording slider updates
204         https://bugs.webkit.org/show_bug.cgi?id=180839
205         <rdar://problem/36057849>
206
207         Reviewed by Joseph Pecoraro
208
209         * UserInterface/Base/Utilities.js:
210         Add Object.throttle and Function.cancelThrottle. Repeated calls to a
211         function on a throttled object are delayed, so that the function isn't
212         invoked more frequently than the specified delay value.
213
214         For a description of throttling behavior see:
215           - http://www.chrislondon.co/throttling-vs-debouncing
216           - http://benalman.com/projects/jquery-throttle-debounce-plugin
217
218         * UserInterface/Views/RecordingContentView.js:
219         (WI.RecordingContentView.prototype.updateActionIndex):
220         Throttle frequency of canvas snapshot creation to 200ms.
221         (WI.RecordingContentView.prototype.hidden):
222         Prevent trailing edge call after hiding the view.
223
224 2018-01-10  Joseph Pecoraro  <pecoraro@apple.com>
225
226         Web Inspector: Should not try to autocomplete subsections of a string
227         https://bugs.webkit.org/show_bug.cgi?id=181461
228         <rdar://problem/36369421>
229
230         Reviewed by Brian Burg.
231
232         * UserInterface/Controllers/CodeMirrorCompletionController.js:
233         (WI.CodeMirrorCompletionController.prototype._completeAtCurrentPosition):
234         Disable autocompletion within strings.
235
236 2018-01-09  Joseph Pecoraro  <pecoraro@apple.com>
237
238         REGRESSION(r201855): Web Inspector: Should see "length" autocompletion suggestion on a string literal
239         https://bugs.webkit.org/show_bug.cgi?id=181462
240         <rdar://problem/36390699>
241
242         Reviewed by Matt Baker.
243
244         * UserInterface/Controllers/JavaScriptRuntimeCompletionProvider.js:
245         (WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded.inspectedPage_evalResult_getCompletions):
246         This is code that runs on the inspected target, which may have an old version of
247         WebKit/JavaScriptCore, so don't use new syntax like this.
248
249         (WI.JavaScriptRuntimeCompletionProvider.prototype.completionControllerCompletionsNeeded):
250         We intended to return the result by as a JSON value instead of a RemoteObject.
251
252 2018-01-09  Ross Kirsling  <ross.kirsling@sony.com>
253
254         Web Inspector: Layers sidebar shows popover on selection even when collapsed
255         https://bugs.webkit.org/show_bug.cgi?id=181465
256
257         Reviewed by Matt Baker.
258
259         * UserInterface/Views/LayerDetailsSidebarPanel.js:
260         (WI.LayerDetailsSidebarPanel.prototype.selectNodeByLayerId):
261         Have sidebar show itself if necessary before displaying popover.
262
263 2018-01-08  Joseph Pecoraro  <pecoraro@apple.com>
264
265         Web Inspector: Find next / previous within a resource content view does not have bouncy highlight when editor scrolls
266         https://bugs.webkit.org/show_bug.cgi?id=181279
267         <rdar://problem/36291097>
268
269         Reviewed by Brian Burg.
270
271         * UserInterface/Views/TextEditor.js:
272         (WI.TextEditor.prototype._revealSearchResult):
273         Reposition the bouncy highlight on scroll based on the CodeMirror
274         line/ch position of the search result.
275
276         (WI.TextEditor.prototype._removeBouncyHighlightElementIfNeeded):
277         Track the bouncy highlight scroll handler in a member variable so that
278         we always remember to remove it and don't leak scroll handlers.
279
280 2018-01-07  David Kilzer  <ddkilzer@apple.com>
281
282         Enable -Wcast-qual for WebInspectorUI, WebKitLegacy, WebKit projects
283         <https://webkit.org/b/181256>
284         <rdar://problem/36281730>
285
286         Reviewed by Darin Adler.
287
288         * Configurations/Base.xcconfig:
289         (WARNING_CFLAGS): Add -Wcast-qual.
290
291 2018-01-05  Joseph Pecoraro  <pecoraro@apple.com>
292
293         Web Inspector: Add another Protocol Version
294         https://bugs.webkit.org/show_bug.cgi?id=181354
295         <rdar://problem/35432817>
296
297         Reviewed by Matt Baker.
298
299         * UserInterface/Protocol/Legacy/11.3/InspectorBackendCommands.js: Added.
300         * Versions/Inspector-iOS-11.3.json: Added.
301
302 2018-01-04  Devin Rousso  <webkit@devinrousso.com>
303
304         Web Inspector: replace HTMLCanvasElement with CanvasRenderingContext for instrumentation logic
305         https://bugs.webkit.org/show_bug.cgi?id=180770
306
307         Reviewed by Joseph Pecoraro.
308
309         * UserInterface/Models/Canvas.js:
310         (WI.Canvas.fromPayload):
311         (WI.Canvas.prototype.get contextType):
312         (WI.Canvas.prototype.saveIdentityToCookie):
313         (WI.Canvas.prototype.get frame): Deleted.
314
315 2018-01-04  Joseph Pecoraro  <pecoraro@apple.com>
316
317         REGRESSION (r225709): Web Inspector: CSS Source maps not loading
318         https://bugs.webkit.org/show_bug.cgi?id=181314
319         <rdar://problem/36177620>
320
321         Reviewed by Brian Burg.
322
323         * UserInterface/Controllers/SourceMapManager.js:
324         (WI.SourceMapManager.prototype._loadAndParseSourceMap):
325         * UserInterface/Models/SourceMapResource.js:
326         (WI.SourceMapResource.prototype.requestContentFromBackend):
327         Correct this so that we only fall back to a reasonable frame id
328         if we couldn't determine a frame id from earlier. Previously this
329         was incorrectly clearing the frame id if we had gotten it earlier.
330
331         * UserInterface/Test.html:
332         * UserInterface/Test/Test.js:
333         (WI.loaded):
334         Add SourceMap related files for tests.
335
336 2018-01-04  Brian Burg  <bburg@apple.com>
337
338         Web Inspector: Capture Element Screenshot looks fuzzy
339         https://bugs.webkit.org/show_bug.cgi?id=175734
340         <rdar://problem/33803377>
341
342         Reviewed by Joseph Pecoraro and Simon Fraser.
343
344         Spruce up these functions a bit. They now optionally return a promise
345         if no callback is supplied. They now can take either a WI.DOMNode or a node id.
346
347         * UserInterface/Controllers/DOMTreeManager.js:
348         (WI.DOMTreeManager.prototype.querySelector):
349         (WI.DOMTreeManager.prototype.querySelectorAll):
350
351 2018-01-04  Brian Burg  <bburg@apple.com>
352
353         Web Inspector: add RemoteObject.fetchProperties and some basic tests for RemoteObject API
354         https://bugs.webkit.org/show_bug.cgi?id=180945
355
356         Reviewed by Joseph Pecoraro.
357
358         Add a new method, fetchProperties, which async fetches an arbitrary list of properties
359         from a RemoteObject. This is intended for writing tests and other quick evaluations,
360         so it has some behaviors that are suitable in these situations:
361         - If the evaluation throws an exception, the result will reject with that exception.
362         - If there is a protocol error for some reason, the result will reject with an exception.
363         - Non-string and non-number keys cause an exception, as this is probably not intended.
364         - Does not accept a callback, returns a promise only. New code should use async.
365
366         For full fidelity introspection of property descriptors, clients should use the existing
367         getOwnPropertyDescriptor[s] class of methods.
368
369         * UserInterface/Protocol/RemoteObject.js:
370         (WI.RemoteObject.prototype.async.fetchProperties): Added.
371         - Validate specified keys and remove duplicates.
372         - Request properties one-by-one to avoid fetching all descriptors and dealing with previews.
373         - Unwrap returned primitive values to avoid unnecessary munging in tests.
374
375         (WI.RemoteObject.prototype.getProperty):
376         - Rework this to return a promise if no callback was supplied.
377         - Introduce stricter property type checking to avoid unintended mistakes.
378
379         (WI.RemoteObject.prototype.callFunction):
380         - Rework this to return a promise if no callback was supplied.
381         - Turn thrown exceptions and protocol errors into rejected promises.
382
383 2018-01-04  Joseph Pecoraro  <pecoraro@apple.com>
384
385         Web Inspector: ⌘G / ⇧⌘G text search does not working after closing find banner
386         https://bugs.webkit.org/show_bug.cgi?id=181280
387         <rdar://problem/36291175>
388
389         Reviewed by Matt Baker.
390
391         * UserInterface/Views/ContentBrowser.js:
392         (WI.ContentBrowser.prototype._findBannerDidHide):
393         When the find banner is hidden trigger a new ContentView method,
394         searchHidden instead of the destructive searchCleared. This allows
395         most content views (text editors, DOM tree, Network Headers view)
396         to keep their populated search results.
397
398         * UserInterface/Views/ContentView.js:
399         (WI.ContentView.prototype.searchHidden):
400         * UserInterface/Views/LogContentView.js:
401         (WI.LogContentView.prototype.searchHidden):
402         By default searchHidden does nothing. The Console's LogContentView
403         treats the find banner differently and clears its search results.
404
405         * UserInterface/Views/TextEditor.js:
406         (WI.TextEditor.prototype.searchCleared):
407         Modernize some code while working in this area.
408
409         * UserInterface/Views/Main.css:
410         (.bouncy-highlight):
411         Ensure black text on yellow background in the bouncy highlight. In the
412         DOM Tree it could have been white if the find banner was closed.
413
414 2018-01-03  Ting-Wei Lan  <lantw44@gmail.com>
415
416         Replace hard-coded paths in shebangs with #!/usr/bin/env
417         https://bugs.webkit.org/show_bug.cgi?id=181040
418
419         Reviewed by Alex Christensen.
420
421         * Scripts/combine-resources.pl:
422         * Scripts/copy-user-interface-resources-dryrun.rb:
423         * Scripts/copy-user-interface-resources.pl:
424         * Scripts/fix-worker-imports-for-optimized-builds.pl:
425         * Scripts/remove-console-asserts-dryrun.rb:
426         * Scripts/remove-console-asserts.pl:
427         * Scripts/update-LegacyInspectorBackendCommands.rb:
428         * Scripts/update-codemirror-resources.rb:
429         * WebInspectorUI.vcxproj/build-webinspectorui.pl:
430
431 2018-01-03  Joseph Pecoraro  <pecoraro@apple.com>
432
433         Web Inspector: "Log Value" context menu is sometimes unavailable
434         https://bugs.webkit.org/show_bug.cgi?id=181278
435         <rdar://problem/36281649>
436
437         Reviewed by Devin Rousso.
438
439         * UserInterface/Views/ObjectPreviewView.css:
440         (.object-preview > .title):
441         * UserInterface/Views/ObjectTreeView.css:
442         (.object-tree.expanded > .title):
443         Make the expanded object title information 16px tall to match ObjectTree
444         tree element row heights. This eliminates the floating console message
445         location from overlapping the first ObjectTree's TreeElement and causing
446         truncation and other behavior issues (like Context Menu identification).
447
448 2018-01-03  Joseph Pecoraro  <pecoraro@apple.com>
449
450         Web Inspector: RTL - DOM Tree Element selection doesn't work
451         https://bugs.webkit.org/show_bug.cgi?id=181275
452         <rdar://problem/36290450>
453
454         Reviewed by Devin Rousso.
455
456         * UserInterface/Views/TreeOutline.js:
457         (WI.TreeOutline.prototype.treeElementFromEvent):
458         Provide a better explanation for why we are making the `x` adjustment here,
459         to detect the inner most tree element along the horizontal. Fix the algorithm
460         for RTL, since the intent is to adjust to the trailing edge of the container
461         which is on the opposite side in RTL.
462
463 2018-01-03  Joseph Pecoraro  <pecoraro@apple.com>
464
465         Web Inspector: Find banner sometimes does not work (when already populated and shown for first time on resource)
466         https://bugs.webkit.org/show_bug.cgi?id=181255
467         <rdar://problem/36248855>
468
469         Reviewed by Matt Baker.
470
471         * UserInterface/Views/TextEditor.js:
472         (WI.TextEditor.prototype.set string):
473         Defer any early searches until the initial content of a TextEditor has been set.
474         Such searches can happen when the FindBanner already has content when a
475         ContentView is first opened and needs to load its content from the backend.
476         Further, even though the content may be loaded from the backend before the
477         search results, microtask hops might cause the content to get to the TextEditor
478         after the search results.
479
480 2018-01-03  Joseph Pecoraro  <pecoraro@apple.com>
481
482         REGRESSION: Web Inspector: Debugger tab doesn't restore selected resource on reload
483         https://bugs.webkit.org/show_bug.cgi?id=181253
484         <rdar://problem/36280564>
485
486         Reviewed by Matt Baker.
487
488         * UserInterface/Views/DebuggerSidebarPanel.js:
489         (WI.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
490         Add braces to ensure the trailing else is actually trailing the outer
491         chain as it was intended to be.
492
493 2018-01-02  Joseph Pecoraro  <pecoraro@apple.com>
494
495         Web Inspector: Clicking source location link in Console unexpectedly jumps to Network tab
496         https://bugs.webkit.org/show_bug.cgi?id=181229
497         <rdar://problem/36075219>
498
499         Reviewed by Matt Baker.
500
501         * UserInterface/Base/Main.js:
502         Cleanup linkifyURLAsNode. Ignore Search tab in generic handlePossibleLinkClick
503         when not already in the Search tab.
504
505         * UserInterface/Views/CallFrameView.js:
506         (WI.CallFrameView):
507         Ignore Search and Network tab in CallFrame links.
508
509         * UserInterface/Views/TabBrowser.js:
510         (WI.TabBrowser.prototype.bestTabContentViewForRepresentedObject):
511         Improve style.
512
513 == Rolled over to ChangeLog-2018-01-01 ==