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